]> granicus.if.org Git - php/commitdiff
Add zend_get_module_started() to quickly check whether a module is present
authorMarcus Boerger <helly@php.net>
Mon, 19 Jan 2004 00:39:29 +0000 (00:39 +0000)
committerMarcus Boerger <helly@php.net>
Mon, 19 Jan 2004 00:39:29 +0000 (00:39 +0000)
and its MINIT function has been called.

Zend/zend_API.c
Zend/zend_API.h

index a9c2a1081f9b482d0b7735479516e0fb26003dc9..277421cee1a3fccdb9584e5d92df132b62af1bf5 100644 (file)
@@ -1350,6 +1350,14 @@ ZEND_API int zend_register_module(zend_module_entry *module)
 }
 
 
+ZEND_API int zend_get_module_started(char *module_name)
+{
+       zend_module_entry *module;
+       
+       return (zend_hash_find(&module_registry, module_name, strlen(module_name)+1, (void**)&module) == SUCCESS && module->module_started) ? SUCCESS : FAILURE;
+}
+
+
 void module_destructor(zend_module_entry *module)
 {
        TSRMLS_FETCH();
index f6290479ca9f93b8b2af85be1a343037033425f6..a869f2950ca350b1f88ed95bd1e79ebc7122bcd8 100644 (file)
@@ -176,6 +176,7 @@ ZEND_API void zend_wrong_param_count(TSRMLS_D);
 ZEND_API zend_bool zend_is_callable(zval *callable, zend_bool syntax_only, char **callable_name);
 ZEND_API zend_bool zend_make_callable(zval *callable, char **callable_name TSRMLS_DC);
 ZEND_API char *zend_get_module_version(char *module_name);
+ZEND_API int zend_get_module_started(char *module_name);
 ZEND_API int zend_declare_property(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type TSRMLS_DC);
 ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int name_length, int access_type TSRMLS_DC);
 ZEND_API int zend_declare_property_long(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC);