From: Marcus Boerger Date: Tue, 30 Dec 2008 18:17:28 +0000 (+0000) Subject: Use a module struct for the built-in functions X-Git-Tag: php-5.4.0alpha1~191^2~4717 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6e29350fb87a1153a3ee1ba85d56b822dd49676b;p=php Use a module struct for the built-in functions --- diff --git a/Zend/zend.c b/Zend/zend.c index d2b9145bca..3480eaf386 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -1243,7 +1243,6 @@ void zend_shutdown(TSRMLS_D) /* {{{ */ #endif zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC); zend_hash_graceful_reverse_destroy(&module_registry); - zend_shutdown_builtin_functions(TSRMLS_C); zend_hash_destroy(GLOBAL_FUNCTION_TABLE); zend_hash_destroy(GLOBAL_CLASS_TABLE); diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index d12bb127c4..52f0fb7f4e 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -291,15 +291,23 @@ static const zend_function_entry builtin_functions[] = { /* {{{ */ }; /* }}} */ -int zend_startup_builtin_functions(TSRMLS_D) /* {{{ */ -{ - return zend_register_functions(NULL, builtin_functions, NULL, MODULE_PERSISTENT TSRMLS_CC); -} +zend_module_entry zend_builtin_module = { /* {{{ */ + STANDARD_MODULE_HEADER, + "Zend", + builtin_functions, + NULL, + NULL, + NULL, + NULL, + NULL, + ZEND_VERSION, + STANDARD_MODULE_PROPERTIES +}; /* }}} */ -void zend_shutdown_builtin_functions(TSRMLS_D) /* {{{ */ +int zend_startup_builtin_functions(TSRMLS_D) /* {{{ */ { - zend_unregister_functions(builtin_functions, -1, NULL TSRMLS_CC); + return zend_register_internal_module(&zend_builtin_module TSRMLS_CC) == NULL ? FAILURE : SUCCESS; } /* }}} */ diff --git a/Zend/zend_builtin_functions.h b/Zend/zend_builtin_functions.h index bf46a2ffdc..deb313eeb2 100644 --- a/Zend/zend_builtin_functions.h +++ b/Zend/zend_builtin_functions.h @@ -23,7 +23,6 @@ #define ZEND_BUILTIN_FUNCTIONS_H int zend_startup_builtin_functions(TSRMLS_D); -void zend_shutdown_builtin_functions(TSRMLS_D); BEGIN_EXTERN_C() ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int provide_object TSRMLS_DC);