From 805dfab8902a95d94cf1393abdb99a01673a57f8 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Mon, 19 Jan 2004 00:39:29 +0000 Subject: [PATCH] Add zend_get_module_started() to quickly check whether a module is present and its MINIT function has been called. --- Zend/zend_API.c | 8 ++++++++ Zend/zend_API.h | 1 + 2 files changed, 9 insertions(+) diff --git a/Zend/zend_API.c b/Zend/zend_API.c index a9c2a1081f..277421cee1 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -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(); diff --git a/Zend/zend_API.h b/Zend/zend_API.h index f6290479ca..a869f2950c 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -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); -- 2.50.1