From 1b2c932cc2848da25b38a4e73aa74541a9761beb Mon Sep 17 00:00:00 2001 From: Andrey Hristov Date: Mon, 26 Jul 1999 20:09:08 +0000 Subject: [PATCH] More symbol work. I've defined a few macros to help with module/request init/startup function definitions. Basically: PHP_MINIT_FUNCTION(module) PHP_MSHUTDOWN_FUNCTION(module) PHP_RINIT_FUNCTION(module) PHP_RSHUTDOWN_FUNCTION(module) PHP_MINFO_FUNCTION(module) These will expand to proper function prototypes. Now to specify these in the module entry, use: PHP_MINIT(module) PHP_MSHUTDOWN(module) PHP_RINIT(module) PHP_RSHUTDOWN(module) PHP_MINFO(module) I've updated all modules in ext/standard and everything from ext/apache to ext/db. If you can, please update your module to use these macros. --- ext/apache/apache.c | 19 ++++++++------- ext/aspell/aspell.c | 23 +++++++++--------- ext/aspell/php3_aspell.h | 13 +++++----- ext/bcmath/bcmath.c | 42 ++++++++++++++++----------------- ext/bcmath/php3_bcmath.h | 22 ++++++++--------- ext/com/php3_COM.h | 4 ++-- ext/db/db.c | 32 +++++++++++++------------ ext/db/php3_db.h | 7 +++--- ext/ereg/ereg.c | 16 ++++++------- ext/rpc/com/COM.c | 24 +++++++++---------- ext/rpc/com/php3_COM.h | 4 ++-- ext/standard/basic_functions.c | 16 ++++++------- ext/standard/basic_functions.h | 9 +++---- ext/standard/browscap.c | 3 ++- ext/standard/crypt.c | 4 ++-- ext/standard/dir.c | 4 ++-- ext/standard/dl.c | 4 ++-- ext/standard/dl.h | 8 +++---- ext/standard/file.c | 4 ++-- ext/standard/file.h | 3 ++- ext/standard/filestat.c | 43 +++++++++++++++++----------------- ext/standard/fsock.c | 12 +++++----- ext/standard/fsock.h | 6 ++--- ext/standard/head.c | 4 ++-- ext/standard/head.h | 2 +- ext/standard/mail.c | 6 ++--- ext/standard/pack.c | 4 ++-- ext/standard/pack.h | 2 +- ext/standard/php3_browscap.h | 4 ++-- ext/standard/php3_crypt.h | 2 +- ext/standard/php3_dir.h | 2 +- ext/standard/php3_filestat.h | 5 ++-- ext/standard/php3_mail.h | 2 +- ext/standard/php3_syslog.h | 7 +++--- ext/standard/reg.c | 16 ++++++------- ext/standard/syslog.c | 8 +++---- main/configuration-parser.y | 4 ++-- main/php.h | 13 ++++++++++ 38 files changed, 214 insertions(+), 189 deletions(-) diff --git a/ext/apache/apache.c b/ext/apache/apache.c index 6b35ae52fe..18a742ddb7 100644 --- a/ext/apache/apache.c +++ b/ext/apache/apache.c @@ -46,15 +46,16 @@ extern module *top_module; PHP_FUNCTION(virtual); PHP_FUNCTION(getallheaders); PHP_FUNCTION(apachelog); -void php3_info_apache(ZEND_MODULE_INFO_FUNC_ARGS); PHP_FUNCTION(apache_note); PHP_FUNCTION(apache_lookup_uri); +PHP_MINFO_FUNCTION(apache); + function_entry apache_functions[] = { - {"virtual", php3_virtual, NULL}, - {"getallheaders", php3_getallheaders, NULL}, - {"apache_note", php3_apache_note,NULL}, - {"apache_lookup_uri", php3_apache_lookup_uri,NULL}, + PHP_FE(virtual, NULL) + PHP_FE(getallheaders, NULL) + PHP_FE(apache_note, NULL) + PHP_FE(apache_lookup_uri, NULL) {NULL, NULL, NULL} }; @@ -98,14 +99,14 @@ PHP_INI_BEGIN() PHP_INI_END() -static int php_apache_minit(INIT_FUNC_ARGS) +static PHP_MINIT_FUNCTION(apache) { REGISTER_INI_ENTRIES(); return SUCCESS; } -static int php_apache_mshutdown(SHUTDOWN_FUNC_ARGS) +static PHP_MSHUTDOWN_FUNCTION(apache) { UNREGISTER_INI_ENTRIES(); return SUCCESS; @@ -113,7 +114,7 @@ static int php_apache_mshutdown(SHUTDOWN_FUNC_ARGS) php3_module_entry apache_module_entry = { - "Apache", apache_functions, php_apache_minit, php_apache_mshutdown, NULL, NULL, php3_info_apache, STANDARD_MODULE_PROPERTIES + "Apache", apache_functions, PHP_MINIT(apache), PHP_MSHUTDOWN(apache), NULL, NULL, PHP_MINFO(apache), STANDARD_MODULE_PROPERTIES }; /* {{{ proto string apache_note(string note_name [, string note_value]) @@ -146,7 +147,7 @@ PHP_FUNCTION(apache_note) } /* }}} */ -void php3_info_apache(ZEND_MODULE_INFO_FUNC_ARGS) +PHP_MINFO_FUNCTION(apache) { module *modp = NULL; char output_buf[128]; diff --git a/ext/aspell/aspell.c b/ext/aspell/aspell.c index cc5e94bcd6..93a9642281 100644 --- a/ext/aspell/aspell.c +++ b/ext/aspell/aspell.c @@ -37,17 +37,17 @@ #include function_entry aspell_functions[] = { - {"aspell_new", php3_aspell_new, NULL}, - {"aspell_check", php3_aspell_check, NULL}, - {"aspell_check_raw", php3_aspell_check_raw, NULL}, - {"aspell_suggest", php3_aspell_suggest, NULL}, + PHP_FE(aspell_new, NULL) + PHP_FE(aspell_check, NULL) + PHP_FE(aspell_check_raw, NULL) + PHP_FE(aspell_suggest, NULL) {NULL, NULL, NULL} }; static int le_aspell; php3_module_entry aspell_module_entry = { - "Aspell", aspell_functions, php3_minit_aspell, NULL, NULL, NULL, php3_info_aspell, STANDARD_MODULE_PROPERTIES + "Aspell", aspell_functions, PHP_MINIT(aspell), NULL, NULL, NULL, PHP_MINFO(aspell), STANDARD_MODULE_PROPERTIES }; @@ -55,7 +55,7 @@ php3_module_entry aspell_module_entry = { DLEXPORT php3_module_entry *get_module(void) { return &aspell_module_entry; } #endif -int php3_minit_aspell(INIT_FUNC_ARGS) +PHP_MINIT_FUNCTION(aspell) { le_aspell = register_list_destructors(php3_aspell_close,NULL); return SUCCESS; @@ -68,7 +68,7 @@ void php3_aspell_close(aspell *sc) /* {{{ proto int aspell_new(string master[, string personal]) Load a dictionary */ -void php3_aspell_new(INTERNAL_FUNCTION_PARAMETERS) +PHP_FUNCTION(aspell_new) { pval *master, *personal; int argc; @@ -93,9 +93,10 @@ void php3_aspell_new(INTERNAL_FUNCTION_PARAMETERS) } /* }}} */ + /* {{{ proto array aspell_suggest(aspell int,string word) Return array of Suggestions */ -void php3_aspell_suggest(INTERNAL_FUNCTION_PARAMETERS) +PHP_FUNCTION(aspell_suggest) { pval *scin, *word; int argc; @@ -132,7 +133,7 @@ void php3_aspell_suggest(INTERNAL_FUNCTION_PARAMETERS) /* {{{ proto int aspell_check(aspell int,string word) Return if word is valid */ -void php3_aspell_check(INTERNAL_FUNCTION_PARAMETERS) +PHP_FUNCTION(aspell_check) { int type; pval *scin,*word; @@ -164,7 +165,7 @@ void php3_aspell_check(INTERNAL_FUNCTION_PARAMETERS) /* {{{ proto int aspell_check_raw(aspell int,string word) Return if word is valid, ignoring case or trying to trim it in any way*/ -void php3_aspell_check_raw(INTERNAL_FUNCTION_PARAMETERS) +PHP_FUNCTION(aspell_check_raw) { pval *scin,*word; int type; @@ -194,7 +195,7 @@ void php3_aspell_check_raw(INTERNAL_FUNCTION_PARAMETERS) } /* }}} */ -void php3_info_aspell(ZEND_MODULE_INFO_FUNC_ARGS) +PHP_MINFO_FUNCTION(aspell) { php3_printf("ASpell support enabled"); diff --git a/ext/aspell/php3_aspell.h b/ext/aspell/php3_aspell.h index e38907c03e..d0c8b35a82 100644 --- a/ext/aspell/php3_aspell.h +++ b/ext/aspell/php3_aspell.h @@ -36,13 +36,14 @@ extern php3_module_entry aspell_module_entry; #define aspell_module_ptr &aspell_module_entry -extern int php3_minit_aspell(INIT_FUNC_ARGS); -extern void php3_info_aspell(ZEND_MODULE_INFO_FUNC_ARGS); +extern PHP_MINIT_FUNCTION(aspell); +extern PHP_MINFO_FUNCTION(aspell); extern void php3_aspell_close(); -void php3_aspell_new(INTERNAL_FUNCTION_PARAMETERS); -void php3_aspell_check(INTERNAL_FUNCTION_PARAMETERS); -void php3_aspell_check_raw(INTERNAL_FUNCTION_PARAMETERS); -void php3_aspell_suggest(INTERNAL_FUNCTION_PARAMETERS); + +PHP_FUNCTION(aspell_new); +PHP_FUNCTION(aspell_check); +PHP_FUNCTION(aspell_check_raw); +PHP_FUNCTION(aspell_suggest); #else #define aspell_module_ptr NULL diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c index ce84144c76..6adc1468a5 100644 --- a/ext/bcmath/bcmath.c +++ b/ext/bcmath/bcmath.c @@ -24,20 +24,20 @@ #include "php3_bcmath.h" function_entry bcmath_functions[] = { - {"bcadd", php3_bcmath_add, NULL}, - {"bcsub", php3_bcmath_sub, NULL}, - {"bcmul", php3_bcmath_mul, NULL}, - {"bcdiv", php3_bcmath_div, NULL}, - {"bcmod", php3_bcmath_mod, NULL}, - {"bcpow", php3_bcmath_pow, NULL}, - {"bcsqrt", php3_bcmath_sqrt, NULL}, - {"bcscale", php3_bcmath_set_scale, NULL}, - {"bccomp", php3_bcmath_comp, NULL}, + PHP_FE(bcadd, NULL) + PHP_FE(bcsub, NULL) + PHP_FE(bcmul, NULL) + PHP_FE(bcdiv, NULL) + PHP_FE(bcmod, NULL) + PHP_FE(bcpow, NULL) + PHP_FE(bcsqrt, NULL) + PHP_FE(bcscale, NULL) + PHP_FE(bccomp, NULL) {NULL, NULL, NULL} }; php3_module_entry bcmath_module_entry = { - "bcmath", bcmath_functions, NULL, NULL, php3_rinit_bcmath, php3_rend_bcmath, NULL, STANDARD_MODULE_PROPERTIES + "bcmath", bcmath_functions, NULL, NULL, PHP_RINIT(bcmath), PHP_RSHUTDOWN(bcmath), NULL, STANDARD_MODULE_PROPERTIES }; #if COMPILE_DL @@ -48,7 +48,7 @@ php3_module_entry *get_module() { return &bcmath_module_entry; }; static long bc_precision; #endif -int php3_rinit_bcmath(INIT_FUNC_ARGS) +PHP_RINIT_FUNCTION(bcmath) { init_numbers(); if (cfg_get_long("bcmath.scale",&bc_precision)==FAILURE) { @@ -57,7 +57,7 @@ int php3_rinit_bcmath(INIT_FUNC_ARGS) return SUCCESS; } -int php3_rend_bcmath(SHUTDOWN_FUNC_ARGS) +PHP_RSHUTDOWN_FUNCTION(bcmath) { destruct_numbers(); return SUCCESS; @@ -65,7 +65,7 @@ int php3_rend_bcmath(SHUTDOWN_FUNC_ARGS) /* {{{ proto string bcadd(string left_operand, string right_operand [, int scale]) Returns the sum of two arbitrary precision numbers */ -PHP_FUNCTION(bcmath_add) +PHP_FUNCTION(bcadd) { pval *left, *right,*scale_param; bc_num first, second, result; @@ -108,7 +108,7 @@ PHP_FUNCTION(bcmath_add) /* {{{ proto string bcsub(string left_operand, string right_operand [, int scale]) Returns the difference between two arbitrary precision numbers (subtration) */ -PHP_FUNCTION(bcmath_sub) +PHP_FUNCTION(bcsub) { pval *left, *right,*scale_param; bc_num first, second, result; @@ -151,7 +151,7 @@ PHP_FUNCTION(bcmath_sub) /* {{{ proto string bcmul(string left_operand, string right_operand [, int scale]) Returns the multiplication of two arbitrary precision numbers */ -PHP_FUNCTION(bcmath_mul) +PHP_FUNCTION(bcmul) { pval *left, *right,*scale_param; bc_num first, second, result; @@ -194,7 +194,7 @@ PHP_FUNCTION(bcmath_mul) /* {{{ proto string bcdiv(string left_operand, string right_operand [, int scale]) Returns the quotient of two arbitrary precision numbers (division) */ -PHP_FUNCTION(bcmath_div) +PHP_FUNCTION(bcdiv) { pval *left, *right,*scale_param; bc_num first, second, result; @@ -243,7 +243,7 @@ PHP_FUNCTION(bcmath_div) /* {{{ proto string bcmod(string left_operand, string right_operand) Returns the modulus of the two arbitrary precision operands */ -PHP_FUNCTION(bcmath_mod) +PHP_FUNCTION(bcmod) { pval *left, *right; bc_num first, second, result; @@ -284,7 +284,7 @@ PHP_FUNCTION(bcmath_mod) /* {{{ proto string bcpow(string x, string y [, int scale]) Returns the value of an arbitrary precision number raised to the power of another */ -PHP_FUNCTION(bcmath_pow) +PHP_FUNCTION(bcpow) { pval *left, *right,*scale_param; bc_num first, second, result; @@ -327,7 +327,7 @@ PHP_FUNCTION(bcmath_pow) /* {{{ proto string bcsqrt(string operand [, int scale]) Returns the square root of an arbitray precision number */ -PHP_FUNCTION(bcmath_sqrt) +PHP_FUNCTION(bcsqrt) { pval *left,*scale_param; bc_num result; @@ -367,7 +367,7 @@ PHP_FUNCTION(bcmath_sqrt) /* {{{ proto string bccomp(string left_operand, string right_operand [, int scale]) Compares two arbitrary precision numbers */ -PHP_FUNCTION(bcmath_comp) +PHP_FUNCTION(bccomp) { pval *left, *right, *scale_param; bc_num first, second; @@ -409,7 +409,7 @@ PHP_FUNCTION(bcmath_comp) /* {{{ proto string bcscale(int scale) Sets default scale parameter for all bc math functions */ -PHP_FUNCTION(bcmath_set_scale) +PHP_FUNCTION(bcscale) { pval *new_scale; diff --git a/ext/bcmath/php3_bcmath.h b/ext/bcmath/php3_bcmath.h index 062d7fe8fd..a6007e60d1 100644 --- a/ext/bcmath/php3_bcmath.h +++ b/ext/bcmath/php3_bcmath.h @@ -43,17 +43,17 @@ extern php3_module_entry bcmath_module_entry; #define phpext_bcmath_ptr &bcmath_module_entry -extern int php3_rinit_bcmath(INIT_FUNC_ARGS); -extern int php3_rend_bcmath(SHUTDOWN_FUNC_ARGS); -PHP_FUNCTION(bcmath_add); -PHP_FUNCTION(bcmath_sub); -PHP_FUNCTION(bcmath_mul); -PHP_FUNCTION(bcmath_div); -PHP_FUNCTION(bcmath_mod); -PHP_FUNCTION(bcmath_pow); -PHP_FUNCTION(bcmath_sqrt); -PHP_FUNCTION(bcmath_comp); -PHP_FUNCTION(bcmath_set_scale); +extern PHP_RINIT_FUNCTION(bcmath); +extern PHP_RSHUTDOWN_FUNCTION(bcmath); +PHP_FUNCTION(bcadd); +PHP_FUNCTION(bcsub); +PHP_FUNCTION(bcmul); +PHP_FUNCTION(bcdiv); +PHP_FUNCTION(bcmod); +PHP_FUNCTION(bcpow); +PHP_FUNCTION(bcsqrt); +PHP_FUNCTION(bccomp); +PHP_FUNCTION(bcscale); #else diff --git a/ext/com/php3_COM.h b/ext/com/php3_COM.h index a94c711559..60b7e06e97 100644 --- a/ext/com/php3_COM.h +++ b/ext/com/php3_COM.h @@ -3,8 +3,8 @@ #if WIN32|WINNT -extern int php3_minit_COM(INIT_FUNC_ARGS); -extern int php3_mshutdown_COM(SHUTDOWN_FUNC_ARGS); +extern PHP_MINIT_FUNCTION(COM); +extern PHP_MSHUTDOWN_FUNCTION(COM); PHP_FUNCTION(COM_load); PHP_FUNCTION(COM_invoke); diff --git a/ext/db/db.c b/ext/db/db.c index 4ca6c23f9d..1c375c0f14 100644 --- a/ext/db/db.c +++ b/ext/db/db.c @@ -240,7 +240,7 @@ static char *php3_get_info_db(void) } -void php3_info_db(ZEND_MODULE_INFO_FUNC_ARGS) +PHP_MINFO_FUNCTION(db) { php3_printf(php3_get_info_db()); } @@ -1079,7 +1079,7 @@ datum flatfile_nextkey(FILE *dbf) { #endif -int php3_minit_db(INIT_FUNC_ARGS) +PHP_MINIT_FUNCTION(db) { #if defined(THREAD_SAFE) dbm_global_struct *dbm_globals; @@ -1104,7 +1104,8 @@ int php3_minit_db(INIT_FUNC_ARGS) return SUCCESS; } -static int php3_mend_db(void){ +static PHP_MSHUTDOWN_FUNCTION(db) +{ DBM_TLS_VARS; #ifdef THREAD_SAFE PHP3_TLS_THREAD_FREE(dbm_globals); @@ -1121,7 +1122,8 @@ static int php3_mend_db(void){ return SUCCESS; } -int php3_rinit_db(INIT_FUNC_ARGS) { +PHP_RINIT_FUNCTION(db) +{ #if !GDBM && !NDBM CurrentFlatFilePos = 0L; #endif @@ -1130,21 +1132,21 @@ int php3_rinit_db(INIT_FUNC_ARGS) { function_entry dbm_functions[] = { - {"dblist", php3_dblist, NULL}, - {"dbmopen", php3_dbmopen, NULL}, - {"dbmclose", php3_dbmclose, NULL}, - {"dbminsert", php3_dbminsert, NULL}, - {"dbmfetch", php3_dbmfetch, NULL}, - {"dbmreplace", php3_dbmreplace, NULL}, - {"dbmexists", php3_dbmexists, NULL}, - {"dbmdelete", php3_dbmdelete, NULL}, - {"dbmfirstkey", php3_dbmfirstkey, NULL}, - {"dbmnextkey", php3_dbmnextkey, NULL}, + PHP_FE(dblist, NULL) + PHP_FE(dbmopen, NULL) + PHP_FE(dbmclose, NULL) + PHP_FE(dbminsert, NULL) + PHP_FE(dbmfetch, NULL) + PHP_FE(dbmreplace, NULL) + PHP_FE(dbmexists, NULL) + PHP_FE(dbmdelete, NULL) + PHP_FE(dbmfirstkey, NULL) + PHP_FE(dbmnextkey, NULL) {NULL,NULL,NULL} }; php3_module_entry dbm_module_entry = { - "DBM", dbm_functions, php3_minit_db, php3_mend_db, php3_rinit_db, NULL, php3_info_db, STANDARD_MODULE_PROPERTIES + "DBM", dbm_functions, PHP_MINIT(db), PHP_MSHUTDOWN(db), PHP_RINIT(db), NULL, PHP_MINFO(db), STANDARD_MODULE_PROPERTIES }; #if COMPILE_DL diff --git a/ext/db/php3_db.h b/ext/db/php3_db.h index dae46dc6bc..17069e6bcd 100644 --- a/ext/db/php3_db.h +++ b/ext/db/php3_db.h @@ -74,9 +74,10 @@ char *_php3_dbmfirstkey(dbm_info *info); char *_php3_dbmnextkey(dbm_info *info, char *key); /* db file functions */ -int php3_minit_db(INIT_FUNC_ARGS); -int php3_rinit_db(INIT_FUNC_ARGS); -void php3_info_db(ZEND_MODULE_INFO_FUNC_ARGS); +PHP_MINIT_FUNCTION(db); +PHP_RINIT_FUNCTION(db); +PHP_MINFO_FUNCTION(db); + PHP_FUNCTION(dblist); PHP_FUNCTION(dbmopen); PHP_FUNCTION(dbmclose); diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c index b07657d0c1..f36bd4056a 100644 --- a/ext/ereg/ereg.c +++ b/ext/ereg/ereg.c @@ -39,15 +39,15 @@ function_entry reg_functions[] = { }; -static int php_minit_regex(INIT_FUNC_ARGS); -static int php_mshutdown_regex(SHUTDOWN_FUNC_ARGS); -static void php_info_regex(ZEND_MODULE_INFO_FUNC_ARGS); +static PHP_MINIT_FUNCTION(regex); +static PHP_MSHUTDOWN_FUNCTION(regex); +static PHP_MINFO_FUNCTION(regex); zend_module_entry regexp_module_entry = { "Regular Expressions", reg_functions, - php_minit_regex, php_mshutdown_regex, - NULL, NULL, php_info_regex, + PHP_MINIT(regex), PHP_MSHUTDOWN(regex), + NULL, NULL, PHP_MINFO(regex), STANDARD_MODULE_PROPERTIES }; @@ -101,7 +101,7 @@ static void php_reg_init_globals(php_reg_globals *reg_globals) _php3_hash_init(®_globals->ht_rc, 0, NULL, (int (*)(void *)) _free_reg_cache, 1); } -static int php_minit_regex(INIT_FUNC_ARGS) +static PHP_MINIT_FUNCTION(regex) { #ifdef ZTS reg_globals_id = ts_allocate_id(sizeof(php_reg_globals), php_reg_init_globals, NULL); @@ -112,7 +112,7 @@ static int php_minit_regex(INIT_FUNC_ARGS) return SUCCESS; } -static int php_mshutdown_regex(SHUTDOWN_FUNC_ARGS) +static PHP_MSHUTDOWN_FUNCTION(regex) { REGLS_FETCH(); @@ -120,7 +120,7 @@ static int php_mshutdown_regex(SHUTDOWN_FUNC_ARGS) return SUCCESS; } -static void php_info_regex(ZEND_MODULE_INFO_FUNC_ARGS) +static PHP_MINFO_FUNCTION(regex) { #if HSREGEX PUTS("Bundled regex library enabled\n"); diff --git a/ext/rpc/com/COM.c b/ext/rpc/com/COM.c index 3d6702763d..38344196f3 100644 --- a/ext/rpc/com/COM.c +++ b/ext/rpc/com/COM.c @@ -50,28 +50,28 @@ static int le_idispatch; function_entry COM_functions[] = { - {"com_load", php3_COM_load, NULL}, - {"com_invoke", php3_COM_invoke, NULL}, + PHP_FE(COM_load, NULL) + PHP_FE(COM_invoke, NULL) - PHP_FE(com_propget, NULL) - PHP_FE(com_propput, NULL) + PHP_FE(com_propget, NULL) + PHP_FE(com_propput, NULL) - PHP_NAMED_FE(com_get, php3_com_propget, NULL) - PHP_NAMED_FE(com_propset, php3_com_propput, NULL) - PHP_NAMED_FE(com_set, php3_com_propput, NULL) + PHP_FALIAS(com_get, com_propget, NULL) + PHP_FALIAS(com_propset, com_propput, NULL) + PHP_FALIAS(com_set, com_propput, NULL) {NULL, NULL, NULL} }; -static void php_info_COM(ZEND_MODULE_INFO_FUNC_ARGS) +static PHP_MINFO_FUNCTION(COM) { DISPLAY_INI_ENTRIES(); } php3_module_entry COM_module_entry = { - "Win32 COM", COM_functions, php3_minit_COM, php3_mshutdown_COM, NULL, NULL, php_info_COM, STANDARD_MODULE_PROPERTIES + "Win32 COM", COM_functions, PHP_MINIT(COM), PHP_MSHUTDOWN(COM), NULL, NULL, PHP_MINFO(COM), STANDARD_MODULE_PROPERTIES }; void php_register_COM_class(); @@ -214,7 +214,7 @@ PHP_INI_BEGIN() PHP_INI_END() -int php3_minit_COM(INIT_FUNC_ARGS) +PHP_MINIT_FUNCTION(COM) { CoInitialize(NULL); le_idispatch = register_list_destructors(_php3_idispatch_destructor,NULL); @@ -224,7 +224,7 @@ int php3_minit_COM(INIT_FUNC_ARGS) } -int php3_mshutdown_COM(SHUTDOWN_FUNC_ARGS) +PHP_MSHUTDOWN_FUNCTION(COM) { CoUninitialize(); UNREGISTER_INI_ENTRIES(); @@ -817,7 +817,7 @@ void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_r && !strcmp(function_name->element.value.str.val, "com")) { /* constructor */ pval *object_handle; - php3_COM_load(INTERNAL_FUNCTION_PARAM_PASSTHRU); + PHP_FN(COM_load)(INTERNAL_FUNCTION_PARAM_PASSTHRU); if (!zend_is_true(return_value)) { var_reset(object); return; diff --git a/ext/rpc/com/php3_COM.h b/ext/rpc/com/php3_COM.h index a94c711559..60b7e06e97 100644 --- a/ext/rpc/com/php3_COM.h +++ b/ext/rpc/com/php3_COM.h @@ -3,8 +3,8 @@ #if WIN32|WINNT -extern int php3_minit_COM(INIT_FUNC_ARGS); -extern int php3_mshutdown_COM(SHUTDOWN_FUNC_ARGS); +extern PHP_MINIT_FUNCTION(COM); +extern PHP_MSHUTDOWN_FUNCTION(COM); PHP_FUNCTION(COM_load); PHP_FUNCTION(COM_invoke); diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 6a5230c037..2871958b83 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -326,10 +326,10 @@ PHP_INI_END() php3_module_entry basic_functions_module = { "Basic Functions", /* extension name */ basic_functions, /* function list */ - php3_minit_basic, /* process startup */ - php3_mshutdown_basic, /* process shutdown */ - php3_rinit_basic, /* request startup */ - php3_rshutdown_basic, /* request shutdown */ + PHP_MINIT(basic), /* process startup */ + PHP_MSHUTDOWN(basic), /* process shutdown */ + PHP_RINIT(basic), /* request startup */ + PHP_RSHUTDOWN(basic), /* request shutdown */ NULL, /* extension info */ STANDARD_MODULE_PROPERTIES }; @@ -372,7 +372,7 @@ static int _php3_putenv_destructor(putenv_entry *pe) void test_class_startup(); -int php3_minit_basic(INIT_FUNC_ARGS) +PHP_MINIT_FUNCTION(basic) { ELS_FETCH(); @@ -391,14 +391,14 @@ int php3_minit_basic(INIT_FUNC_ARGS) } -int php3_mshutdown_basic(SHUTDOWN_FUNC_ARGS) +PHP_MSHUTDOWN_FUNCTION(basic) { UNREGISTER_INI_ENTRIES(); return SUCCESS; } -int php3_rinit_basic(INIT_FUNC_ARGS) +PHP_RINIT_FUNCTION(basic) { strtok_string = NULL; #ifdef HAVE_PUTENV @@ -412,7 +412,7 @@ int php3_rinit_basic(INIT_FUNC_ARGS) } -int php3_rshutdown_basic(SHUTDOWN_FUNC_ARGS) +PHP_RSHUTDOWN_FUNCTION(basic) { STR_FREE(strtok_string); #ifdef HAVE_PUTENV diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h index 086a049e6e..10190ebe07 100644 --- a/ext/standard/basic_functions.h +++ b/ext/standard/basic_functions.h @@ -39,10 +39,11 @@ extern php3_module_entry basic_functions_module; #define basic_functions_module_ptr &basic_functions_module -extern int php3_minit_basic(INIT_FUNC_ARGS); -extern int php3_mshutdown_basic(SHUTDOWN_FUNC_ARGS); -extern int php3_rinit_basic(INIT_FUNC_ARGS); -extern int php3_rshutdown_basic(SHUTDOWN_FUNC_ARGS); +PHP_MINIT_FUNCTION(basic); +PHP_MSHUTDOWN_FUNCTION(basic); +PHP_RINIT_FUNCTION(basic); +PHP_RSHUTDOWN_FUNCTION(basic); + PHP_FUNCTION(intval); PHP_FUNCTION(doubleval); PHP_FUNCTION(strval); diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index 0101fa2416..21fe44a5db 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -35,7 +35,8 @@ function_entry browscap_functions[] = { }; php3_module_entry browscap_module_entry = { - "browscap", browscap_functions, php3_minit_browscap, php3_mshutdown_browscap, NULL, NULL, NULL, STANDARD_MODULE_PROPERTIES + "browscap", browscap_functions, PHP_MINIT(browscap), PHP_MSHUTDOWN(browscap), + NULL, NULL, NULL, STANDARD_MODULE_PROPERTIES }; diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c index c241a0fef2..36eab9be96 100644 --- a/ext/standard/crypt.c +++ b/ext/standard/crypt.c @@ -54,7 +54,7 @@ function_entry crypt_functions[] = { }; php3_module_entry crypt_module_entry = { - "Crypt", crypt_functions, php_minit_crypt, NULL, NULL, NULL, NULL, STANDARD_MODULE_PROPERTIES + "Crypt", crypt_functions, PHP_MINIT(crypt), NULL, NULL, NULL, NULL, STANDARD_MODULE_PROPERTIES }; @@ -90,7 +90,7 @@ php3_module_entry crypt_module_entry = { #endif #endif -int php_minit_crypt(INIT_FUNC_ARGS) +PHP_MINIT_FUNCTION(crypt) { ELS_FETCH(); diff --git a/ext/standard/dir.c b/ext/standard/dir.c index 3a8be1e3a6..2ad515df8c 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -63,11 +63,11 @@ static zend_function_entry php_dir_class_functions[] = { php3_module_entry php3_dir_module_entry = { - "PHP_dir", php_dir_functions, php3_minit_dir, NULL, NULL, NULL, NULL, STANDARD_MODULE_PROPERTIES + "PHP_dir", php_dir_functions, PHP_MINIT(dir), NULL, NULL, NULL, NULL, STANDARD_MODULE_PROPERTIES }; -int php3_minit_dir(INIT_FUNC_ARGS) +PHP_MINIT_FUNCTION(dir) { zend_class_entry dir_class_entry; diff --git a/ext/standard/dl.c b/ext/standard/dl.c index 678c5a4264..394dcecf96 100644 --- a/ext/standard/dl.c +++ b/ext/standard/dl.c @@ -47,7 +47,7 @@ function_entry dl_functions[] = { php3_module_entry dl_module_entry = { - "PHP_DL", dl_functions, NULL, NULL, NULL, NULL, php3_info_dl, STANDARD_MODULE_PROPERTIES + "PHP_DL", dl_functions, NULL, NULL, NULL, NULL, PHP_MINFO(dl), STANDARD_MODULE_PROPERTIES }; #endif @@ -150,7 +150,7 @@ void php3_dl(pval *file,int type,pval *return_value) } -void php3_info_dl(ZEND_MODULE_INFO_FUNC_ARGS) +PHP_MINFO_FUNCTION(dl) { PUTS("Dynamic Library support enabled.\n"); } diff --git a/ext/standard/dl.h b/ext/standard/dl.h index 45e2c46098..9489723e4b 100644 --- a/ext/standard/dl.h +++ b/ext/standard/dl.h @@ -45,10 +45,10 @@ extern php3_module_entry dl_module_entry; /* dynamic loading functions */ void dl(INTERNAL_FUNCTION_PARAMETERS); -extern int php3_minit_dl(INIT_FUNC_ARGS); -extern int php3_mshutdown_dl(SHUTDOWN_FUNC_ARGS); -extern int php3_rshutdown_dl(SHUTDOWN_FUNC_ARGS); -void php3_info_dl(ZEND_MODULE_INFO_FUNC_ARGS); +extern PHP_MINIT_FUNCTION(dl); +extern PHP_MSHUTDOWN_FUNCTION(dl); +extern PHP_RSHUTDOWN_FUNCTION(dl); +PHP_MINFO_FUNCTION(dl); #else diff --git a/ext/standard/file.c b/ext/standard/file.c index 831a372b23..05bfc71e7a 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -215,7 +215,7 @@ function_entry php3_file_functions[] = { php3_module_entry php3_file_module_entry = { "File functions", php3_file_functions, - php3_minit_file, + PHP_MINIT(file), NULL, NULL, NULL, @@ -495,7 +495,7 @@ static void php3i_destructor_fclose(FILE *fp) { (void)fclose(fp); } -int php3_minit_file(INIT_FUNC_ARGS) +PHP_MINIT_FUNCTION(file) { le_fp = register_list_destructors(php3i_destructor_fclose, NULL); le_pp = register_list_destructors(__pclose, NULL); diff --git a/ext/standard/file.h b/ext/standard/file.h index cc6ab07f9f..3d2bc05289 100644 --- a/ext/standard/file.h +++ b/ext/standard/file.h @@ -37,7 +37,8 @@ extern php3_module_entry php3_file_module_entry; #define php3_file_module_ptr &php3_file_module_entry -extern int php3_minit_file(INIT_FUNC_ARGS); +extern PHP_MINIT_FUNCTION(file); + PHP_FUNCTION(tempnam); PHP_FUNCTION(fopen); PHP_FUNCTION(fclose); diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 77786c63e5..647fb10da2 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -84,7 +84,7 @@ static struct stat lsb; #endif -int php3_init_filestat(INIT_FUNC_ARGS) +PHP_RINIT_FUNCTION(filestat) { CurrentStatFile=NULL; CurrentStatLength=0; @@ -92,7 +92,7 @@ int php3_init_filestat(INIT_FUNC_ARGS) } -int php3_shutdown_filestat(SHUTDOWN_FUNC_ARGS) +PHP_RSHUTDOWN_FUNCTION(filestat) { if (CurrentStatFile) { efree (CurrentStatFile); @@ -433,24 +433,24 @@ void name(INTERNAL_FUNCTION_PARAMETERS) { \ _php3_stat(filename->value.str.val, funcnum, return_value); \ } -FileFunction(php3_fileperms,0) -FileFunction(php3_fileinode,1) -FileFunction(php3_filesize, 2) -FileFunction(php3_fileowner,3) -FileFunction(php3_filegroup,4) -FileFunction(php3_fileatime,5) -FileFunction(php3_filemtime,6) -FileFunction(php3_filectime,7) -FileFunction(php3_filetype, 8) -FileFunction(php3_is_writable, 9) -FileFunction(php3_is_readable,10) -FileFunction(php3_is_executable,11) -FileFunction(php3_is_file,12) -FileFunction(php3_is_dir,13) -FileFunction(php3_is_link,14) -FileFunction(php3_file_exists,15) -FileFunction(php3_lstat,16) -FileFunction(php3_stat,17) +FileFunction(PHP_FN(fileperms),0) +FileFunction(PHP_FN(fileinode),1) +FileFunction(PHP_FN(filesize), 2) +FileFunction(PHP_FN(fileowner),3) +FileFunction(PHP_FN(filegroup),4) +FileFunction(PHP_FN(fileatime),5) +FileFunction(PHP_FN(filemtime),6) +FileFunction(PHP_FN(filectime),7) +FileFunction(PHP_FN(filetype), 8) +FileFunction(PHP_FN(is_writable), 9) +FileFunction(PHP_FN(is_readable),10) +FileFunction(PHP_FN(is_executable),11) +FileFunction(PHP_FN(is_file),12) +FileFunction(PHP_FN(is_dir),13) +FileFunction(PHP_FN(is_link),14) +FileFunction(PHP_FN(file_exists),15) +FileFunction(PHP_FN(lstat),16) +FileFunction(PHP_FN(stat),17) function_entry php3_filestat_functions[] = { PHP_FE(fileatime, NULL) @@ -481,7 +481,8 @@ function_entry php3_filestat_functions[] = { php3_module_entry php3_filestat_module_entry = { - "PHP_filestat", php3_filestat_functions, NULL, NULL, php3_init_filestat, php3_shutdown_filestat, NULL, STANDARD_MODULE_PROPERTIES + "PHP_filestat", php3_filestat_functions, NULL, NULL, PHP_RINIT(filestat), + PHP_RSHUTDOWN(filestat), NULL, STANDARD_MODULE_PROPERTIES }; /* diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c index 2901221a70..e439b43e5a 100644 --- a/ext/standard/fsock.c +++ b/ext/standard/fsock.c @@ -109,10 +109,10 @@ typedef struct php3i_sockbuf php3i_sockbuf; php3_module_entry fsock_module_entry = { "Socket functions", fsock_functions, - php3_minit_fsock, - php3_mshutdown_fsock, + PHP_MINIT(fsock), + PHP_MSHUTDOWN(fsock), NULL, - php3_rshutdown_fsock, + PHP_RSHUTDOWN(fsock), NULL, STANDARD_MODULE_PROPERTIES }; @@ -701,7 +701,7 @@ static int _php3_msock_destroy(int *data) /* }}} */ /* {{{ php3_minit_fsock */ -int php3_minit_fsock(INIT_FUNC_ARGS) +PHP_MINIT_FUNCTION(fsock) { #ifndef ZTS _php3_hash_init(&PG(ht_fsock_keys), 0, NULL, NULL, 1); @@ -712,7 +712,7 @@ int php3_minit_fsock(INIT_FUNC_ARGS) /* }}} */ /* {{{ php3_mshutdown_fsock */ -int php3_mshutdown_fsock(SHUTDOWN_FUNC_ARGS) +PHP_MSHUTDOWN_FUNCTION(fsock) { #ifndef ZTS _php3_hash_destroy(&PG(ht_fsock_socks)); @@ -724,7 +724,7 @@ int php3_mshutdown_fsock(SHUTDOWN_FUNC_ARGS) /* }}} */ /* {{{ php3_rshutdown_fsock() */ -int php3_rshutdown_fsock(SHUTDOWN_FUNC_ARGS) +PHP_RSHUTDOWN_FUNCTION(fsock) { php_cleanup_sockbuf(0); return SUCCESS; diff --git a/ext/standard/fsock.h b/ext/standard/fsock.h index b9fbe8b16d..5b1a7047d5 100644 --- a/ext/standard/fsock.h +++ b/ext/standard/fsock.h @@ -72,8 +72,8 @@ size_t _php3_sock_set_def_chunk_size(size_t size); PHPAPI int connect_nonb(int sockfd, struct sockaddr *addr, int addrlen, struct timeval *timeout); -int php3_minit_fsock(INIT_FUNC_ARGS); -int php3_mshutdown_fsock(SHUTDOWN_FUNC_ARGS); -int php3_rshutdown_fsock(SHUTDOWN_FUNC_ARGS); +PHP_MINIT_FUNCTION(fsock); +PHP_MSHUTDOWN_FUNCTION(fsock); +PHP_RSHUTDOWN_FUNCTION(fsock); #endif /* _FSOCK_H */ diff --git a/ext/standard/head.c b/ext/standard/head.c index 2b9c60dca5..c28626a299 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -47,7 +47,7 @@ static int header_called = 0; void php3_PushCookieList(char *, char *, time_t, char *, char *, int); CookieList *php3_PopCookieList(void); -int php3_init_head(INIT_FUNC_ARGS) +PHP_RINIT_FUNCTION(head) { php3_HeaderPrinted = 0; if (header_called == 0) @@ -574,7 +574,7 @@ function_entry php3_header_functions[] = { php3_module_entry php3_header_module_entry = { - "PHP_head", php3_header_functions, NULL, NULL, php3_init_head, NULL, NULL, STANDARD_MODULE_PROPERTIES + "PHP_head", php3_header_functions, NULL, NULL, PHP_RINIT(head), NULL, NULL, STANDARD_MODULE_PROPERTIES }; /* diff --git a/ext/standard/head.h b/ext/standard/head.h index 542d95ffaf..51208a606e 100644 --- a/ext/standard/head.h +++ b/ext/standard/head.h @@ -52,7 +52,7 @@ typedef struct CookieList { extern php3_module_entry php3_header_module_entry; #define php3_header_module_ptr &php3_header_module_entry -extern int php3_init_head(INIT_FUNC_ARGS); +extern PHP_RINIT_FUNCTION(head); PHP_FUNCTION(Header); PHP_FUNCTION(setcookie); PHP_FUNCTION(headers_sent); diff --git a/ext/standard/mail.c b/ext/standard/mail.c index 5896ced403..9e7172fa71 100644 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@ -45,7 +45,7 @@ function_entry mail_functions[] = { }; php3_module_entry mail_module_entry = { - "Sendmail", mail_functions, NULL, NULL, NULL, NULL, php3_info_mail, STANDARD_MODULE_PROPERTIES + "Sendmail", mail_functions, NULL, NULL, NULL, NULL, PHP_MINFO(mail), STANDARD_MODULE_PROPERTIES }; @@ -148,7 +148,7 @@ int _php3_mail(char *to, char *subject, char *message, char *headers) return 1; } -void php3_info_mail(ZEND_MODULE_INFO_FUNC_ARGS) +PHP_MINFO_FUNCTION(mail) { #if MSVC5 PUTS("Internal Sendmail support for Windows 4"); @@ -160,7 +160,7 @@ void php3_info_mail(ZEND_MODULE_INFO_FUNC_ARGS) #else PHP_FUNCTION(mail) {} -void php3_info_mail(ZEND_MODULE_INFO_FUNC_ARGS) {} +PHP_MINFO_FUNCTION(mail) {} #endif diff --git a/ext/standard/pack.c b/ext/standard/pack.c index 4754c5606d..0523253ee4 100644 --- a/ext/standard/pack.c +++ b/ext/standard/pack.c @@ -57,7 +57,7 @@ function_entry pack_functions[] = { }; php3_module_entry pack_module_entry = { - "PHP_pack", pack_functions, php3_minit_pack, NULL, NULL, NULL, NULL, STANDARD_MODULE_PROPERTIES + "PHP_pack", pack_functions, PHP_MINIT(pack), NULL, NULL, NULL, NULL, STANDARD_MODULE_PROPERTIES }; /* Whether machine is little endian */ @@ -794,7 +794,7 @@ PHP_FUNCTION(unpack) /* }}} */ -int php3_minit_pack(INIT_FUNC_ARGS) +PHP_MINIT_FUNCTION(pack) { int machine_endian_check = 1; int i; diff --git a/ext/standard/pack.h b/ext/standard/pack.h index 38a50a40a4..bad1af9cfe 100644 --- a/ext/standard/pack.h +++ b/ext/standard/pack.h @@ -35,7 +35,7 @@ extern php3_module_entry pack_module_entry; #define pack_module_ptr &pack_module_entry -extern int php3_minit_pack(INIT_FUNC_ARGS); +extern PHP_MINIT_FUNCTION(pack); PHP_FUNCTION(pack); PHP_FUNCTION(unpack); diff --git a/ext/standard/php3_browscap.h b/ext/standard/php3_browscap.h index c59459e5da..2a61016e47 100644 --- a/ext/standard/php3_browscap.h +++ b/ext/standard/php3_browscap.h @@ -34,8 +34,8 @@ extern php3_module_entry browscap_module_entry; #define browscap_module_ptr &browscap_module_entry -extern int php3_minit_browscap(INIT_FUNC_ARGS); -extern int php3_mshutdown_browscap(SHUTDOWN_FUNC_ARGS); +extern PHP_MINIT_FUNCTION(browscap); +extern PHP_MSHUTDOWN_FUNCTION(browscap); PHP_FUNCTION(get_browser); diff --git a/ext/standard/php3_crypt.h b/ext/standard/php3_crypt.h index 4885599ae0..1ae1d5f84b 100644 --- a/ext/standard/php3_crypt.h +++ b/ext/standard/php3_crypt.h @@ -5,7 +5,7 @@ extern php3_module_entry crypt_module_entry; #define crypt_module_ptr &crypt_module_entry PHP_FUNCTION(crypt); -extern int php_minit_crypt(INIT_FUNC_ARGS); +extern PHP_MINIT_FUNCTION(crypt); #else #define crypt_module_ptr NULL #endif diff --git a/ext/standard/php3_dir.h b/ext/standard/php3_dir.h index 1ab682ca84..29e00716e8 100644 --- a/ext/standard/php3_dir.h +++ b/ext/standard/php3_dir.h @@ -37,7 +37,7 @@ extern php3_module_entry php3_dir_module_entry; #define php3_dir_module_ptr &php3_dir_module_entry /* directory functions */ -extern int php3_minit_dir(INIT_FUNC_ARGS); +extern PHP_MINIT_FUNCTION(dir); PHP_FUNCTION(opendir); PHP_FUNCTION(closedir); PHP_FUNCTION(chdir); diff --git a/ext/standard/php3_filestat.h b/ext/standard/php3_filestat.h index 87572a37c4..bc6cc9d232 100644 --- a/ext/standard/php3_filestat.h +++ b/ext/standard/php3_filestat.h @@ -32,8 +32,9 @@ #ifndef _FILESTAT_H #define _FILESTAT_H -extern int php3_init_filestat(INIT_FUNC_ARGS); -extern int php3_shutdown_filestat(SHUTDOWN_FUNC_ARGS); +PHP_RINIT_FUNCTION(filestat); +PHP_RSHUTDOWN_FUNCTION(filestat); + PHP_FUNCTION(clearstatcache); PHP_FUNCTION(fileatime); PHP_FUNCTION(filectime); diff --git a/ext/standard/php3_mail.h b/ext/standard/php3_mail.h index 70636ecb6b..918bcbdf1c 100644 --- a/ext/standard/php3_mail.h +++ b/ext/standard/php3_mail.h @@ -37,7 +37,7 @@ extern php3_module_entry mail_module_entry; #define mail_module_ptr &mail_module_entry PHP_FUNCTION(mail); -void php3_info_mail(ZEND_MODULE_INFO_FUNC_ARGS); +PHP_MINFO_FUNCTION(mail); extern int _php3_mail(char *to, char *subject, char *message, char *headers); #else diff --git a/ext/standard/php3_syslog.h b/ext/standard/php3_syslog.h index 2353d53bc2..69dd4abb80 100644 --- a/ext/standard/php3_syslog.h +++ b/ext/standard/php3_syslog.h @@ -35,9 +35,10 @@ extern php3_module_entry syslog_module_entry; #define syslog_module_ptr &syslog_module_entry -extern int php3_minit_syslog(INIT_FUNC_ARGS); -extern int php3_rinit_syslog(INIT_FUNC_ARGS); -extern int php3_rshutdown_syslog(SHUTDOWN_FUNC_ARGS); +extern PHP_MINIT_FUNCTION(syslog); +extern PHP_RINIT_FUNCTION(syslog); +extern PHP_RSHUTDOWN_FUNCTION(syslog); + PHP_FUNCTION(openlog); PHP_FUNCTION(syslog); PHP_FUNCTION(closelog); diff --git a/ext/standard/reg.c b/ext/standard/reg.c index b07657d0c1..f36bd4056a 100644 --- a/ext/standard/reg.c +++ b/ext/standard/reg.c @@ -39,15 +39,15 @@ function_entry reg_functions[] = { }; -static int php_minit_regex(INIT_FUNC_ARGS); -static int php_mshutdown_regex(SHUTDOWN_FUNC_ARGS); -static void php_info_regex(ZEND_MODULE_INFO_FUNC_ARGS); +static PHP_MINIT_FUNCTION(regex); +static PHP_MSHUTDOWN_FUNCTION(regex); +static PHP_MINFO_FUNCTION(regex); zend_module_entry regexp_module_entry = { "Regular Expressions", reg_functions, - php_minit_regex, php_mshutdown_regex, - NULL, NULL, php_info_regex, + PHP_MINIT(regex), PHP_MSHUTDOWN(regex), + NULL, NULL, PHP_MINFO(regex), STANDARD_MODULE_PROPERTIES }; @@ -101,7 +101,7 @@ static void php_reg_init_globals(php_reg_globals *reg_globals) _php3_hash_init(®_globals->ht_rc, 0, NULL, (int (*)(void *)) _free_reg_cache, 1); } -static int php_minit_regex(INIT_FUNC_ARGS) +static PHP_MINIT_FUNCTION(regex) { #ifdef ZTS reg_globals_id = ts_allocate_id(sizeof(php_reg_globals), php_reg_init_globals, NULL); @@ -112,7 +112,7 @@ static int php_minit_regex(INIT_FUNC_ARGS) return SUCCESS; } -static int php_mshutdown_regex(SHUTDOWN_FUNC_ARGS) +static PHP_MSHUTDOWN_FUNCTION(regex) { REGLS_FETCH(); @@ -120,7 +120,7 @@ static int php_mshutdown_regex(SHUTDOWN_FUNC_ARGS) return SUCCESS; } -static void php_info_regex(ZEND_MODULE_INFO_FUNC_ARGS) +static PHP_MINFO_FUNCTION(regex) { #if HSREGEX PUTS("Bundled regex library enabled\n"); diff --git a/ext/standard/syslog.c b/ext/standard/syslog.c index 0e8f0e9c0d..d4792b2856 100644 --- a/ext/standard/syslog.c +++ b/ext/standard/syslog.c @@ -42,7 +42,7 @@ static int syslog_started; static char *syslog_device; static void start_syslog(void); -int php3_minit_syslog(INIT_FUNC_ARGS) +PHP_MINIT_FUNCTION(syslog) { ELS_FETCH(); @@ -104,7 +104,7 @@ int php3_minit_syslog(INIT_FUNC_ARGS) } -int php3_rinit_syslog(INIT_FUNC_ARGS) +PHP_RINIT_FUNCTION(syslog) { if (INI_INT("define_syslog_variables")) { start_syslog(); @@ -116,7 +116,7 @@ int php3_rinit_syslog(INIT_FUNC_ARGS) } -int php3_rshutdown_syslog(SHUTDOWN_FUNC_ARGS) +PHP_RSHUTDOWN_FUNCTION(syslog) { if (syslog_device) { efree(syslog_device); @@ -266,7 +266,7 @@ function_entry syslog_functions[] = { php3_module_entry syslog_module_entry = { - "Syslog", syslog_functions, php3_minit_syslog, NULL, php3_rinit_syslog, php3_rshutdown_syslog, NULL, STANDARD_MODULE_PROPERTIES + "Syslog", syslog_functions, PHP_MINIT(syslog), NULL, PHP_RINIT(syslog), PHP_RSHUTDOWN(syslog), NULL, STANDARD_MODULE_PROPERTIES }; diff --git a/main/configuration-parser.y b/main/configuration-parser.y index e78f7aba42..e7d1ffb1ff 100644 --- a/main/configuration-parser.y +++ b/main/configuration-parser.y @@ -244,7 +244,7 @@ int php3_init_config(void) } -int php3_minit_browscap(INIT_FUNC_ARGS) +PHP_MINIT_FUNCTION(browscap) { char *browscap = INI_STR("browscap"); @@ -277,7 +277,7 @@ int php3_shutdown_config(void) } -int php3_mshutdown_browscap(SHUTDOWN_FUNC_ARGS) +PHP_MSHUTDOWN_FUNCTION(browscap) { if (INI_STR("browscap")) { _php3_hash_destroy(&browser_hash); diff --git a/main/php.h b/main/php.h index 06256874a8..ae74736efa 100644 --- a/main/php.h +++ b/main/php.h @@ -246,6 +246,7 @@ extern int ap_vsnprintf(char *, size_t, const char *, va_list); #define MAXPATHLEN 256 /* Should be safe for any weird systems that do not define it */ #endif +#define PHP_FN(name) php3_##name #define PHP_NAMED_FUNCTION(name) void name(INTERNAL_FUNCTION_PARAMETERS) #define PHP_FUNCTION(name) PHP_NAMED_FUNCTION(php3_##name) @@ -253,6 +254,18 @@ extern int ap_vsnprintf(char *, size_t, const char *, va_list); #define PHP_FE(name, arg_types) PHP_NAMED_FE(name, php3_##name, arg_types) #define PHP_FALIAS(name, alias, arg_types) PHP_NAMED_FE(name, php3_##alias, arg_types) +#define PHP_MINIT(module) php3_minit_##module +#define PHP_MSHUTDOWN(module) php3_mshutdown_##module +#define PHP_RINIT(module) php3_rinit_##module +#define PHP_RSHUTDOWN(module) php3_rshutdown_##module +#define PHP_MINFO(module) php3_info_##module + +#define PHP_MINIT_FUNCTION(module) int php3_minit_##module(INIT_FUNC_ARGS) +#define PHP_MSHUTDOWN_FUNCTION(module) int php3_mshutdown_##module(SHUTDOWN_FUNC_ARGS) +#define PHP_RINIT_FUNCTION(module) int php3_rinit_##module(INIT_FUNC_ARGS) +#define PHP_RSHUTDOWN_FUNCTION(module) int php3_rshutdown_##module(SHUTDOWN_FUNC_ARGS) +#define PHP_MINFO_FUNCTION(module) void php3_info_##module(ZEND_MODULE_INFO_FUNC_ARGS) + /* global variables */ extern pval *data; -- 2.40.0