diff options
44 files changed, 351 insertions, 583 deletions
diff --git a/Makefile.in b/Makefile.in index 05291688e7..cade1561ac 100644 --- a/Makefile.in +++ b/Makefile.in @@ -51,4 +51,7 @@ configuration-parser.h configuration-parser.c: configuration-parser.y configuration-scanner.c: configuration-scanner.l $(LEX) -Pcfg -o$@ -i $< +internal_functions.c: internal_functions.c.in config.status + CONFIG_FILES= CONFIG_HEADERS= ./config.status + .NOEXPORT: diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c index 1630bf7b94..f48413606f 100644 --- a/ext/ereg/ereg.c +++ b/ext/ereg/ereg.c @@ -24,24 +24,7 @@ #include "php_string.h" #include "reg.h" -unsigned char third_argument_force_ref[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE }; - -function_entry reg_functions[] = { - PHP_FE(ereg, third_argument_force_ref) - PHP_FE(ereg_replace, NULL) - PHP_FE(eregi, third_argument_force_ref) - PHP_FE(eregi_replace, NULL) - PHP_FE(split, NULL) - PHP_FALIAS(join, implode, NULL) - PHP_FE(sql_regcase, NULL) - {NULL, NULL, NULL} -}; - - -static PHP_MINIT_FUNCTION(regex); -static PHP_MSHUTDOWN_FUNCTION(regex); -static PHP_MINFO_FUNCTION(regex); - +#if 0 zend_module_entry regexp_module_entry = { "Regular Expressions", reg_functions, @@ -49,6 +32,7 @@ zend_module_entry regexp_module_entry = { NULL, NULL, PHP_MINFO(regex), STANDARD_MODULE_PROPERTIES }; +#endif #ifdef ZTS int reg_globals_id; @@ -101,7 +85,7 @@ static void php_reg_init_globals(php_reg_globals *reg_globals) zend_hash_init(®_globals->ht_rc, 0, NULL, (void (*)(void *)) _free_reg_cache, 1); } -static PHP_MINIT_FUNCTION(regex) +PHP_MINIT_FUNCTION(regex) { #ifdef ZTS reg_globals_id = ts_allocate_id(sizeof(php_reg_globals), (ts_allocate_ctor) php_reg_init_globals, NULL); @@ -112,7 +96,7 @@ static PHP_MINIT_FUNCTION(regex) return SUCCESS; } -static PHP_MSHUTDOWN_FUNCTION(regex) +PHP_MSHUTDOWN_FUNCTION(regex) { REGLS_FETCH(); @@ -120,12 +104,12 @@ static PHP_MSHUTDOWN_FUNCTION(regex) return SUCCESS; } -static PHP_MINFO_FUNCTION(regex) +PHP_MINFO_FUNCTION(regex) { #if HSREGEX - PUTS("Bundled regex library enabled\n"); + PUTS("Bundled regex library enabled<br>\n"); #else - PUTS("System regex library enabled\n"); + PUTS("System regex library enabled<br>\n"); #endif } diff --git a/ext/ereg/php_ereg.h b/ext/ereg/php_ereg.h index b7f8262d2f..0ffa7438bd 100644 --- a/ext/ereg/php_ereg.h +++ b/ext/ereg/php_ereg.h @@ -33,9 +33,6 @@ #ifndef _REG_H #define _REG_H -extern zend_module_entry regexp_module_entry; -#define regexp_module_ptr ®exp_module_entry - char *php_reg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended); PHP_FUNCTION(ereg); @@ -49,6 +46,10 @@ typedef struct { HashTable ht_rc; } php_reg_globals; +PHP_MINIT_FUNCTION(regex); +PHP_MSHUTDOWN_FUNCTION(regex); +PHP_MINFO_FUNCTION(regex); + #ifdef ZTS #define REGLS_D php_reg_globals *reg_globals @@ -66,6 +67,4 @@ typedef struct { #define REGLS_FETCH() #endif -#define phpext_regex_ptr regexp_module_ptr - #endif /* _REG_H */ diff --git a/ext/standard/array.c b/ext/standard/array.c index 0d3377722a..e280d9f002 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -14,6 +14,8 @@ +----------------------------------------------------------------------+ | Authors: Andi Gutmans <andi@zend.com> | | Zeev Suraski <zeev@zend.com> | + | Rasmus Lerdorf <rasmus@php.net> | + | Andrei Zmievski <andrei@ispi.net> | +----------------------------------------------------------------------+ */ @@ -52,64 +54,6 @@ php_array_globals array_globals; #define SORT_DESC -1 #define SORT_ASC 1 -function_entry array_functions[] = { - PHP_FE(ksort, first_arg_force_ref) - PHP_FE(krsort, first_arg_force_ref) - PHP_FE(asort, first_arg_force_ref) - PHP_FE(arsort, first_arg_force_ref) - PHP_FE(sort, first_arg_force_ref) - PHP_FE(rsort, first_arg_force_ref) - PHP_FE(usort, first_arg_force_ref) - PHP_FE(uasort, first_arg_force_ref) - PHP_FE(uksort, first_arg_force_ref) - PHP_FE(shuffle, first_arg_force_ref) - PHP_FE(array_walk, first_arg_force_ref) - PHP_FE(count, first_arg_allow_ref) - PHP_FE(end, first_arg_force_ref) - PHP_FE(prev, first_arg_force_ref) - PHP_FE(next, first_arg_force_ref) - PHP_FE(reset, first_arg_force_ref) - PHP_FE(current, first_arg_force_ref) - PHP_FE(key, first_arg_force_ref) - PHP_FE(min, NULL) - PHP_FE(max, NULL) - PHP_FE(in_array, NULL) - PHP_FE(extract, NULL) - PHP_FE(compact, NULL) - PHP_FE(range, NULL) - PHP_FE(array_multisort, NULL) - PHP_FE(array_push, first_arg_force_ref) - PHP_FE(array_pop, first_arg_force_ref) - PHP_FE(array_shift, first_arg_force_ref) - PHP_FE(array_unshift, first_arg_force_ref) - PHP_FE(array_splice, first_arg_force_ref) - PHP_FE(array_slice, NULL) - PHP_FE(array_merge, NULL) - PHP_FE(array_keys, NULL) - PHP_FE(array_values, NULL) - PHP_FE(array_count_values, NULL) - PHP_FE(array_reverse, NULL) - PHP_FE(array_pad, NULL) - PHP_FE(array_flip, NULL) - - /* Aliases */ - PHP_FALIAS(pos, current, first_arg_force_ref) - PHP_FALIAS(sizeof, count, first_arg_allow_ref) - - {NULL, NULL, NULL} -}; - -zend_module_entry array_module_entry = { - "Array Functions", /* extension name */ - array_functions, /* function list */ - PHP_MINIT(array), /* process startup */ - PHP_MSHUTDOWN(array), /* process shutdown */ - NULL, /* request startup */ - NULL, /* request shutdown */ - NULL, /* extension info */ - STANDARD_MODULE_PROPERTIES -}; - PHP_MINIT_FUNCTION(array) { #ifdef ZTS diff --git a/ext/standard/assert.c b/ext/standard/assert.c index 683b12a87f..318f6f972d 100644 --- a/ext/standard/assert.c +++ b/ext/standard/assert.c @@ -53,33 +53,6 @@ php_assert_globals assert_globals; #define SAFE_STRING(s) ((s)?(s):"") -PHP_MINIT_FUNCTION(assert); -PHP_MSHUTDOWN_FUNCTION(assert); -PHP_RINIT_FUNCTION(assert); -PHP_RSHUTDOWN_FUNCTION(assert); -PHP_MINFO_FUNCTION(assert); - -PHP_FUNCTION(assert); -PHP_FUNCTION(assert_options); - -static zend_function_entry php_assert_functions[] = { - PHP_FE(assert, NULL) - PHP_FE(assert_options, NULL) - {NULL, NULL, NULL} -}; - - -zend_module_entry assert_module_entry = { - "Assertion", - php_assert_functions, - PHP_MINIT(assert), - PHP_MSHUTDOWN(assert), - PHP_RINIT(assert), - PHP_RSHUTDOWN(assert), - PHP_MINFO(assert), - STANDARD_MODULE_PROPERTIES -}; - #define ASSERT_ACTIVE 1 #define ASSERT_CALLBACK 2 #define ASSERT_BAIL 3 diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 895a6cbf32..368cc394b9 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -59,9 +59,8 @@ php_basic_globals basic_globals; #endif static unsigned char second_and_third_args_force_ref[] = { 3, BYREF_NONE, BYREF_FORCE, BYREF_FORCE }; -/* uncomment this if/when we actually need it - tired of seeing the warning +static unsigned char third_argument_force_ref[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE }; static unsigned char third_and_fourth_args_force_ref[] = { 4, BYREF_NONE, BYREF_NONE, BYREF_FORCE, BYREF_FORCE }; -*/ ; typedef struct _php_shutdown_function_entry { @@ -311,6 +310,177 @@ function_entry basic_functions[] = { PHP_FE(parse_ini_file, NULL) + /* functions from reg.c */ + PHP_FE(ereg, third_argument_force_ref) + PHP_FE(ereg_replace, NULL) + PHP_FE(eregi, third_argument_force_ref) + PHP_FE(eregi_replace, NULL) + PHP_FE(split, NULL) + PHP_FALIAS(join, implode, NULL) + PHP_FE(sql_regcase, NULL) + + /* functions from dl.c */ + PHP_FE(dl, NULL) + + /* functions from file.c */ + PHP_FE(pclose, NULL) + PHP_FE(popen, NULL) + PHP_FE(readfile, NULL) + PHP_FE(rewind, NULL) + PHP_FE(rmdir, NULL) + PHP_FE(umask, NULL) + PHP_FE(fclose, NULL) + PHP_FE(feof, NULL) + PHP_FE(fgetc, NULL) + PHP_FE(fgets, NULL) + PHP_FE(fgetss, NULL) + PHP_FE(fread, NULL) + PHP_FE(fopen, NULL) + PHP_FE(fpassthru, NULL) + PHP_FE(ftruncate, NULL) + PHP_FE(fstat, NULL) + PHP_FE(fseek, NULL) + PHP_FE(ftell, NULL) + PHP_FE(fwrite, NULL) + PHP_FALIAS(fputs, fwrite, NULL) + PHP_FE(mkdir, NULL) + PHP_FE(rename, NULL) + PHP_FE(copy, NULL) + PHP_FE(tempnam, NULL) + PHP_FE(tmpfile, NULL) + PHP_FE(file, NULL) + PHP_FE(fgetcsv, NULL) + PHP_FE(flock, NULL) + PHP_FE(get_meta_tags, NULL) + /* set_socket_blocking() is deprecated, + use socket_set_blocking() instead */ + PHP_FE(set_socket_blocking, NULL) + PHP_FE(socket_set_blocking, NULL) +#if HAVE_SYS_TIME_H + PHP_FE(socket_set_timeout, NULL) +#endif + PHP_FE(socket_get_status, NULL) + PHP_FE(realpath, NULL) + + /* functions from fsock.c */ + PHP_FE(fsockopen, third_and_fourth_args_force_ref) + PHP_FE(pfsockopen, third_and_fourth_args_force_ref) + + /* functions from pack.c */ + PHP_FE(pack, NULL) + PHP_FE(unpack, NULL) + + /* functions from browscap.c */ + PHP_FE(get_browser, NULL) + + /* functions from crypt.c */ + PHP_FE(crypt, NULL) + + /* functions from dir.c */ + PHP_FE(opendir, NULL) + PHP_FE(closedir, NULL) + PHP_FE(chdir, NULL) + PHP_FE(getcwd, NULL) + PHP_FE(rewinddir, NULL) + PHP_FE(readdir, NULL) + PHP_FALIAS(dir, getdir, NULL) + + /* functions from filestat.c */ + PHP_FE(fileatime, NULL) + PHP_FE(filectime, NULL) + PHP_FE(filegroup, NULL) + PHP_FE(fileinode, NULL) + PHP_FE(filemtime, NULL) + PHP_FE(fileowner, NULL) + PHP_FE(fileperms, NULL) + PHP_FE(filesize, NULL) + PHP_FE(filetype, NULL) + PHP_FE(file_exists, NULL) + PHP_FE(is_writable, NULL) + PHP_FALIAS(is_writeable, is_writable, NULL) + PHP_FE(is_readable, NULL) + PHP_FE(is_executable, NULL) + PHP_FE(is_file, NULL) + PHP_FE(is_dir, NULL) + PHP_FE(is_link, NULL) + PHP_FE(stat, NULL) + PHP_FE(lstat, NULL) + PHP_FE(chown, NULL) + PHP_FE(chgrp, NULL) + PHP_FE(chmod, NULL) + PHP_FE(touch, NULL) + PHP_FE(clearstatcache, NULL) + PHP_FE(diskfreespace, NULL) + + /* functions from mail.c */ + PHP_FE(mail, NULL) + + /* functions from syslog.c */ + PHP_FE(openlog, NULL) + PHP_FE(syslog, NULL) + PHP_FE(closelog, NULL) + PHP_FE(define_syslog_variables, NULL) + + /* functions from lcg.c */ + PHP_FE(lcg_value, NULL) + + /* functions from metaphone.c */ + PHP_FE(metaphone, NULL) + + /* functions from output.c */ + PHP_FE(ob_start, NULL) + PHP_FE(ob_end_flush, NULL) + PHP_FE(ob_end_clean, NULL) + PHP_FE(ob_get_contents, NULL) + PHP_FE(ob_implicit_flush, NULL) + + /* functions from array.c */ + PHP_FE(ksort, first_arg_force_ref) + PHP_FE(krsort, first_arg_force_ref) + PHP_FE(asort, first_arg_force_ref) + PHP_FE(arsort, first_arg_force_ref) + PHP_FE(sort, first_arg_force_ref) + PHP_FE(rsort, first_arg_force_ref) + PHP_FE(usort, first_arg_force_ref) + PHP_FE(uasort, first_arg_force_ref) + PHP_FE(uksort, first_arg_force_ref) + PHP_FE(shuffle, first_arg_force_ref) + PHP_FE(array_walk, first_arg_force_ref) + PHP_FE(count, first_arg_allow_ref) + PHP_FE(end, first_arg_force_ref) + PHP_FE(prev, first_arg_force_ref) + PHP_FE(next, first_arg_force_ref) + PHP_FE(reset, first_arg_force_ref) + PHP_FE(current, first_arg_force_ref) + PHP_FE(key, first_arg_force_ref) + PHP_FE(min, NULL) + PHP_FE(max, NULL) + PHP_FE(in_array, NULL) + PHP_FE(extract, NULL) + PHP_FE(compact, NULL) + PHP_FE(range, NULL) + PHP_FE(array_multisort, NULL) + PHP_FE(array_push, first_arg_force_ref) + PHP_FE(array_pop, first_arg_force_ref) + PHP_FE(array_shift, first_arg_force_ref) + PHP_FE(array_unshift, first_arg_force_ref) + PHP_FE(array_splice, first_arg_force_ref) + PHP_FE(array_slice, NULL) + PHP_FE(array_merge, NULL) + PHP_FE(array_keys, NULL) + PHP_FE(array_values, NULL) + PHP_FE(array_count_values, NULL) + PHP_FE(array_reverse, NULL) + PHP_FE(array_pad, NULL) + PHP_FE(array_flip, NULL) + /* aliases from array.c */ + PHP_FALIAS(pos, current, first_arg_force_ref) + PHP_FALIAS(sizeof, count, first_arg_allow_ref) + + /* functions from assert.c */ + PHP_FE(assert, NULL) + PHP_FE(assert_options, NULL) + {NULL, NULL, NULL} }; @@ -359,8 +529,10 @@ zend_module_entry basic_functions_module = { PHP_MSHUTDOWN(basic), /* process shutdown */ PHP_RINIT(basic), /* request startup */ PHP_RSHUTDOWN(basic), /* request shutdown */ - NULL, /* extension info */ - STANDARD_MODULE_PROPERTIES + PHP_MINFO(basic), /* extension info */ + PHP_GINIT(basic), /* global startup function */ + NULL, /* global shutdown function */ + STANDARD_MODULE_PROPERTIES_EX }; #if defined(HAVE_PUTENV) @@ -426,6 +598,18 @@ PHP_MINIT_FUNCTION(basic) register_phpinfo_constants(INIT_FUNC_ARGS_PASSTHRU); register_html_constants(INIT_FUNC_ARGS_PASSTHRU); + + PHP_MINIT(regex)(INIT_FUNC_ARGS_PASSTHRU); + PHP_MINIT(file)(INIT_FUNC_ARGS_PASSTHRU); + PHP_MINIT(fsock)(INIT_FUNC_ARGS_PASSTHRU); + PHP_MINIT(pack)(INIT_FUNC_ARGS_PASSTHRU); + PHP_MINIT(browscap)(INIT_FUNC_ARGS_PASSTHRU); + PHP_MINIT(crypt)(INIT_FUNC_ARGS_PASSTHRU); + PHP_MINIT(dir)(INIT_FUNC_ARGS_PASSTHRU); + PHP_MINIT(syslog)(INIT_FUNC_ARGS_PASSTHRU); + PHP_MINIT(array)(INIT_FUNC_ARGS_PASSTHRU); + PHP_MINIT(assert)(INIT_FUNC_ARGS_PASSTHRU); + return SUCCESS; } @@ -441,6 +625,13 @@ PHP_MSHUTDOWN_FUNCTION(basic) #endif UNREGISTER_INI_ENTRIES(); + + PHP_MSHUTDOWN(regex)(SHUTDOWN_FUNC_ARGS_PASSTHRU); + PHP_MSHUTDOWN(fsock)(SHUTDOWN_FUNC_ARGS_PASSTHRU); + PHP_MSHUTDOWN(browscap)(SHUTDOWN_FUNC_ARGS_PASSTHRU); + PHP_MSHUTDOWN(array)(SHUTDOWN_FUNC_ARGS_PASSTHRU); + PHP_MSHUTDOWN(assert)(SHUTDOWN_FUNC_ARGS_PASSTHRU); + return SUCCESS; } @@ -462,6 +653,12 @@ PHP_RINIT_FUNCTION(basic) } #endif BG(user_shutdown_function_names)=NULL; + + PHP_RINIT(head)(INIT_FUNC_ARGS_PASSTHRU); + PHP_RINIT(filestat)(INIT_FUNC_ARGS_PASSTHRU); + PHP_RINIT(syslog)(INIT_FUNC_ARGS_PASSTHRU); + PHP_RINIT(assert)(INIT_FUNC_ARGS_PASSTHRU); + return SUCCESS; } @@ -481,10 +678,31 @@ PHP_RSHUTDOWN_FUNCTION(basic) } STR_FREE(BG(locale_string)); + PHP_RSHUTDOWN(fsock)(SHUTDOWN_FUNC_ARGS_PASSTHRU); + PHP_RSHUTDOWN(filestat)(SHUTDOWN_FUNC_ARGS_PASSTHRU); + PHP_RSHUTDOWN(syslog)(SHUTDOWN_FUNC_ARGS_PASSTHRU); + PHP_RSHUTDOWN(assert)(SHUTDOWN_FUNC_ARGS_PASSTHRU); + + return SUCCESS; +} + + +PHP_GINIT_FUNCTION(basic) +{ + PHP_GINIT(output)(GINIT_FUNC_ARGS_PASSTHRU); + return SUCCESS; } +PHP_MINFO_FUNCTION(basic) +{ + PHP_MINFO(regex)(ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU); + PHP_MINFO(dl)(ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU); + PHP_MINFO(mail)(ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU); + PHP_MINFO(assert)(ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU); +} + PHP_FUNCTION(ip2long) { zval **str; diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h index d046978c81..b17d27d526 100644 --- a/ext/standard/basic_functions.h +++ b/ext/standard/basic_functions.h @@ -45,6 +45,8 @@ PHP_MINIT_FUNCTION(basic); PHP_MSHUTDOWN_FUNCTION(basic); PHP_RINIT_FUNCTION(basic); PHP_RSHUTDOWN_FUNCTION(basic); +PHP_MINFO_FUNCTION(basic); +PHP_GINIT_FUNCTION(basic); PHP_FUNCTION(intval); PHP_FUNCTION(doubleval); diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index 7a60809d47..18ee4170c7 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -29,17 +29,6 @@ static char *lookup_browser_name; static pval *found_browser_entry; #endif -function_entry browscap_functions[] = { - PHP_FE(get_browser, NULL) - {NULL, NULL, NULL} -}; - -zend_module_entry browscap_module_entry = { - "browscap", browscap_functions, PHP_MINIT(browscap), PHP_MSHUTDOWN(browscap), - NULL, NULL, NULL, STANDARD_MODULE_PROPERTIES -}; - - static int browser_reg_compare(zval **browser) { pval *browser_name; diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c index 1d5c1bd5c3..2ac3400b99 100644 --- a/ext/standard/crypt.c +++ b/ext/standard/crypt.c @@ -48,16 +48,6 @@ extern char *crypt(char *__key,char *__salt); #include "php_crypt.h" -function_entry crypt_functions[] = { - PHP_FE(crypt, NULL) - {NULL, NULL, NULL} -}; - -zend_module_entry crypt_module_entry = { - "Crypt", crypt_functions, PHP_MINIT(crypt), NULL, NULL, NULL, NULL, STANDARD_MODULE_PROPERTIES -}; - - /* The capabilities of the crypt() function is determined by the test programs run by configure from aclocal.m4. They will set PHP_STD_DES_CRYPT, diff --git a/ext/standard/dir.c b/ext/standard/dir.c index ee0c27a4c4..e71697e859 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -82,18 +82,6 @@ static zend_class_entry *dir_class_entry_ptr; ZEND_FETCH_RESOURCE(dirp,php_dir *,id,-1, "Directory", le_dirp); \ } -static zend_function_entry php_dir_functions[] = { - PHP_FE(opendir, NULL) - PHP_FE(closedir, NULL) - PHP_FE(chdir, NULL) - PHP_FE(getcwd, NULL) - PHP_FE(rewinddir, NULL) - PHP_FE(readdir, NULL) - PHP_FALIAS(dir, getdir, NULL) - {NULL, NULL, NULL} -}; - - static zend_function_entry php_dir_class_functions[] = { PHP_FALIAS(close, closedir, NULL) PHP_FALIAS(rewind, rewinddir, NULL) @@ -102,10 +90,6 @@ static zend_function_entry php_dir_class_functions[] = { }; -zend_module_entry php_dir_module_entry = { - "PHP_dir", php_dir_functions, PHP_MINIT(dir), NULL, NULL, NULL, NULL, STANDARD_MODULE_PROPERTIES -}; - static void _dir_dtor(php_dir *dirp) { closedir(dirp->dir); diff --git a/ext/standard/dl.c b/ext/standard/dl.c index 93012b88a4..9160b2ceeb 100644 --- a/ext/standard/dl.c +++ b/ext/standard/dl.c @@ -40,21 +40,11 @@ #include <sys/param.h> #endif -function_entry dl_functions[] = { - {"dl", dl, NULL}, - {NULL, NULL, NULL} -}; - - -zend_module_entry dl_module_entry = { - "PHP_DL", dl_functions, NULL, NULL, NULL, NULL, PHP_MINFO(dl), STANDARD_MODULE_PROPERTIES -}; - #endif /* {{{ proto int dl(string extension_filename) Load a PHP extension at runtime */ -void dl(INTERNAL_FUNCTION_PARAMETERS) +PHP_FUNCTION(dl) { pval **file; PLS_FETCH(); @@ -161,7 +151,7 @@ void php_dl(pval *file,int type,pval *return_value) PHP_MINFO_FUNCTION(dl) { - PUTS("Dynamic Library support enabled.\n"); + PUTS("Dynamic Library support enabled<br>.\n"); } #else @@ -172,6 +162,11 @@ void php_dl(pval *file,int type,pval *return_value) RETURN_FALSE; } +PHP_MINFO_FUNCTION(dl) +{ + PUTS("Dynamic Library support not available<br>.\n"); +} + #endif /* diff --git a/ext/standard/dl.h b/ext/standard/dl.h index 399aa0bc51..1c9be24f5b 100644 --- a/ext/standard/dl.h +++ b/ext/standard/dl.h @@ -37,25 +37,14 @@ void php_dl(pval *file,int type,pval *return_value); - #ifdef HAVE_LIBDL -extern zend_module_entry dl_module_entry; -#define dl_module_ptr &dl_module_entry - /* dynamic loading functions */ -void dl(INTERNAL_FUNCTION_PARAMETERS); -extern PHP_MINIT_FUNCTION(dl); -extern PHP_MSHUTDOWN_FUNCTION(dl); -extern PHP_RSHUTDOWN_FUNCTION(dl); +PHP_FUNCTION(dl); PHP_MINFO_FUNCTION(dl); #else -#define dl_module_ptr NULL - #endif -#define phpext_dl_ptr dl_module_ptr - #endif /* _DL_H */ diff --git a/ext/standard/file.c b/ext/standard/file.c index d54583e23e..9eb8f2564e 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -213,65 +213,6 @@ char *tempnam(const char *dir, const char *pfx) /* }}} */ /* {{{ Module-Stuff */ -function_entry file_functions[] = { - PHP_FE(pclose, NULL) - PHP_FE(popen, NULL) - PHP_FE(readfile, NULL) - PHP_FE(rewind, NULL) - PHP_FE(rmdir, NULL) - PHP_FE(umask, NULL) - PHP_FE(fclose, NULL) - PHP_FE(feof, NULL) - PHP_FE(fgetc, NULL) - PHP_FE(fgets, NULL) - PHP_FE(fgetss, NULL) - PHP_FE(fread, NULL) - PHP_FE(fopen, NULL) - PHP_FE(fpassthru, NULL) - PHP_FE(ftruncate, NULL) - PHP_FE(fstat, NULL) - PHP_FE(fseek, NULL) - PHP_FE(ftell, NULL) - PHP_FE(fwrite, NULL) - PHP_FALIAS(fputs, fwrite, NULL) - PHP_FE(mkdir, NULL) - PHP_FE(rename, NULL) - PHP_FE(copy, NULL) - PHP_FE(tempnam, NULL) - PHP_FE(tmpfile, NULL) - PHP_FE(file, NULL) - PHP_FE(fgetcsv, NULL) - PHP_FE(flock, NULL) - PHP_FE(get_meta_tags, NULL) - /* set_socket_blocking() is deprecated, - use socket_set_blocking() instead */ - PHP_FE(set_socket_blocking, NULL) - PHP_FE(socket_set_blocking, NULL) -#if HAVE_SYS_TIME_H - PHP_FE(socket_set_timeout, NULL) -#endif - PHP_FE(socket_get_status, NULL) - PHP_FE(realpath, NULL) -#if 0 /* needs to be rethought 991221 thies@digicol.de */ - PHP_FE(fd_set, NULL) - PHP_FE(fd_isset, NULL) - PHP_FE(select, NULL) -#endif - {NULL, NULL, NULL} -}; - -zend_module_entry file_module_entry = { - "File functions", - file_functions, - PHP_MINIT(file), - NULL, - NULL, - NULL, - NULL, - STANDARD_MODULE_PROPERTIES -}; - - static void _file_popen_dtor(FILE *pipe) { FIL_FETCH(); @@ -1931,3 +1872,10 @@ PHP_FUNCTION(fd_isset) } #endif + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + */ diff --git a/ext/standard/file.h b/ext/standard/file.h index ee94d393a5..3d60850035 100644 --- a/ext/standard/file.h +++ b/ext/standard/file.h @@ -34,9 +34,6 @@ #ifndef _FILE_H #define _FILE_H -extern zend_module_entry file_module_entry; -#define file_module_ptr &file_module_entry - extern PHP_MINIT_FUNCTION(file); PHP_FUNCTION(tempnam); @@ -82,5 +79,4 @@ PHPAPI int php_file_le_fopen(void); PHPAPI int php_file_le_socket(void); PHPAPI int php_file_le_uploads(void); -#define phpext_file_ptr file_module_ptr #endif /* _FILE_H */ diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 823aeb348e..1b22347d05 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -69,7 +69,7 @@ # endif #endif -#include "ext/standard/basic_functions.h" +#include "basic_functions.h" #include "php_filestat.h" @@ -565,41 +565,6 @@ FileFunction(PHP_FN(file_exists),15) FileFunction(PHP_FN(lstat),16) FileFunction(PHP_FN(stat),17) -function_entry php_filestat_functions[] = { - PHP_FE(fileatime, NULL) - PHP_FE(filectime, NULL) - PHP_FE(filegroup, NULL) - PHP_FE(fileinode, NULL) - PHP_FE(filemtime, NULL) - PHP_FE(fileowner, NULL) - PHP_FE(fileperms, NULL) - PHP_FE(filesize, NULL) - PHP_FE(filetype, NULL) - PHP_FE(file_exists, NULL) - PHP_FE(is_writable, NULL) - PHP_FALIAS(is_writeable, is_writable, NULL) - PHP_FE(is_readable, NULL) - PHP_FE(is_executable, NULL) - PHP_FE(is_file, NULL) - PHP_FE(is_dir, NULL) - PHP_FE(is_link, NULL) - PHP_FE(stat, NULL) - PHP_FE(lstat, NULL) - PHP_FE(chown, NULL) - PHP_FE(chgrp, NULL) - PHP_FE(chmod, NULL) - PHP_FE(touch, NULL) - PHP_FE(clearstatcache, NULL) - PHP_FE(diskfreespace, NULL) - {NULL, NULL, NULL} -}; - - -zend_module_entry php_filestat_module_entry = { - "PHP_filestat", php_filestat_functions, NULL, NULL, PHP_RINIT(filestat), - PHP_RSHUTDOWN(filestat), NULL, STANDARD_MODULE_PROPERTIES -}; - /* * Local variables: * tab-width: 4 diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c index 12a466b2b2..5bd3885dde 100644 --- a/ext/standard/fsock.c +++ b/ext/standard/fsock.c @@ -95,27 +95,6 @@ extern int le_fp; #include "build-defs.h" #endif -static unsigned char third_and_fourth_args_force_ref[] = { 4, BYREF_NONE, BYREF_NONE, BYREF_FORCE, BYREF_FORCE }; - -function_entry fsock_functions[] = { - PHP_FE(fsockopen, third_and_fourth_args_force_ref) - PHP_FE(pfsockopen, third_and_fourth_args_force_ref) - {NULL, NULL, NULL} -}; - - -zend_module_entry fsock_module_entry = { - "Socket functions", - fsock_functions, - PHP_MINIT(fsock), - PHP_MSHUTDOWN(fsock), - NULL, - PHP_RSHUTDOWN(fsock), - NULL, - STANDARD_MODULE_PROPERTIES -}; - - /* {{{ lookup_hostname */ /* diff --git a/ext/standard/fsock.h b/ext/standard/fsock.h index 775f544b1e..0be635232a 100644 --- a/ext/standard/fsock.h +++ b/ext/standard/fsock.h @@ -55,9 +55,6 @@ #include <sys/time.h> #endif -extern zend_module_entry fsock_module_entry; -#define phpext_fsock_ptr &fsock_module_entry - struct php_sockbuf { int socket; unsigned char *readbuf; diff --git a/ext/standard/head.c b/ext/standard/head.c index 60a25605a9..4c0abe4af2 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -268,15 +268,6 @@ PHP_FUNCTION(headers_sent) } } -function_entry php_header_functions[] = { - {NULL, NULL, NULL} -}; - - -zend_module_entry php_header_module_entry = { - "PHP_head", php_header_functions, NULL, NULL, PHP_RINIT(head), NULL, NULL, STANDARD_MODULE_PROPERTIES -}; - /* * Local variables: * tab-width: 4 diff --git a/ext/standard/head.h b/ext/standard/head.h index db7b383e8e..f8f89f9ef0 100644 --- a/ext/standard/head.h +++ b/ext/standard/head.h @@ -49,9 +49,6 @@ typedef struct CookieList { struct CookieList *next; } CookieList; -extern zend_module_entry php_header_module_entry; -#define php_header_module_ptr &php_header_module_entry - extern PHP_RINIT_FUNCTION(head); PHP_FUNCTION(Header); PHP_FUNCTION(setcookie); @@ -62,6 +59,4 @@ void php4i_add_header_information(char *header_information, uint header_length); PHPAPI int php_header(void); int php_headers_unsent(void); -#define phpext_head_ptr php_header_module_ptr - #endif diff --git a/ext/standard/lcg.c b/ext/standard/lcg.c index 6be0a24227..2a5d873adc 100644 --- a/ext/standard/lcg.c +++ b/ext/standard/lcg.c @@ -69,7 +69,7 @@ static void lcg_init_globals(LCGLS_D) #endif } -static int php_minit_lcg(INIT_FUNC_ARGS) +PHP_MINIT_FUNCTION(lcg) { #ifdef ZTS lcg_globals_id = ts_allocate_id(sizeof(php_lcg_globals), (ts_allocate_ctor) lcg_init_globals, NULL); @@ -86,17 +86,3 @@ PHP_FUNCTION(lcg_value) RETURN_DOUBLE(php_combined_lcg()); } /* }}} */ - -static function_entry lcg_functions[] = { - PHP_FE(lcg_value, NULL) - {0} -}; - -zend_module_entry lcg_module_entry = { - "LCG", - lcg_functions, - php_minit_lcg, NULL, - NULL, NULL, - NULL, - STANDARD_MODULE_PROPERTIES -}; diff --git a/ext/standard/mail.c b/ext/standard/mail.c index 4a9c5af929..4f4938d432 100644 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@ -33,16 +33,6 @@ #include "win32/sendmail.h" #endif -function_entry mail_functions[] = { - PHP_FE(mail, NULL) - {NULL, NULL, NULL} -}; - -zend_module_entry mail_module_entry = { - "Sendmail", mail_functions, NULL, NULL, NULL, NULL, PHP_MINFO(mail), STANDARD_MODULE_PROPERTIES -}; - - #if COMPILE_DL DLEXPORT zend_module_entry *get_module(void) { return &odbc_module_entry; } #endif diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c index 61de72adb5..2c9cfb036e 100644 --- a/ext/standard/metaphone.c +++ b/ext/standard/metaphone.c @@ -26,23 +26,6 @@ static int metaphone(char *word, int max_phonemes, char **phoned_word, int tradi PHP_FUNCTION(metaphone); -function_entry metaphone_functions[] = { - PHP_FE(metaphone, NULL) - {0}, -}; - -zend_module_entry metaphone_module_entry = -{ - "Metaphone", - metaphone_functions, - NULL, - NULL, - NULL, - NULL, - NULL, - STANDARD_MODULE_PROPERTIES, -}; - /* metaphone -- Breaks english phrases down into their phonemes. */ PHP_FUNCTION(metaphone) { @@ -472,3 +455,10 @@ static int metaphone(char *word, int max_phonemes, char **phoned_word, int tradi return 0; } /* END metaphone */ + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + */ diff --git a/ext/standard/output.c b/ext/standard/output.c index fff9083251..6b46712b27 100644 --- a/ext/standard/output.c +++ b/ext/standard/output.c @@ -64,14 +64,6 @@ int output_globals_id; php_output_globals output_globals; #endif - -PHP_FUNCTION(ob_start); -PHP_FUNCTION(ob_end_flush); -PHP_FUNCTION(ob_end_clean); -PHP_FUNCTION(ob_get_contents); -PHP_FUNCTION(ob_implicit_flush); - - static void php_output_init_globals(OLS_D) { OG(php_body_write) = NULL; @@ -97,32 +89,6 @@ PHP_GINIT_FUNCTION(output) return SUCCESS; } -static zend_function_entry php_output_functions[] = { - PHP_FE(ob_start, NULL) - PHP_FE(ob_end_flush, NULL) - PHP_FE(ob_end_clean, NULL) - PHP_FE(ob_get_contents, NULL) - PHP_FE(ob_implicit_flush, NULL) - {NULL, NULL, NULL} -}; - -PHP_RINIT_FUNCTION(output); -PHP_RSHUTDOWN_FUNCTION(output); - -zend_module_entry output_module_entry = { - "PHP_output", - php_output_functions, - NULL, /* extension-wide startup function */ - NULL, /* extension-wide shutdown function */ - NULL, /* per-request startup function */ - NULL, /* per-request shutdown function */ - NULL, /* information function */ - PHP_GINIT(output), /* global startup function */ - NULL, /* global shutdown function */ - STANDARD_MODULE_PROPERTIES_EX -}; - - /* Start output layer */ PHPAPI void php_output_startup() { diff --git a/ext/standard/pack.c b/ext/standard/pack.c index ad5313440b..5ff9f29312 100644 --- a/ext/standard/pack.c +++ b/ext/standard/pack.c @@ -50,16 +50,6 @@ #include <netinet/in.h> #endif -function_entry pack_functions[] = { - PHP_FE(pack, NULL) - PHP_FE(unpack, NULL) - {NULL, NULL, NULL} -}; - -zend_module_entry pack_module_entry = { - "PHP_pack", pack_functions, PHP_MINIT(pack), NULL, NULL, NULL, NULL, STANDARD_MODULE_PROPERTIES -}; - /* Whether machine is little endian */ char machine_little_endian; diff --git a/ext/standard/pack.h b/ext/standard/pack.h index 98900415bc..3550c0270b 100644 --- a/ext/standard/pack.h +++ b/ext/standard/pack.h @@ -32,13 +32,8 @@ #ifndef _PACK_H #define _PACK_H -extern zend_module_entry pack_module_entry; -#define pack_module_ptr &pack_module_entry - extern PHP_MINIT_FUNCTION(pack); PHP_FUNCTION(pack); PHP_FUNCTION(unpack); -#define phpext_pack_ptr pack_module_ptr - #endif /* _PACK_H */ diff --git a/ext/standard/php_array.h b/ext/standard/php_array.h index 1f4f28cdb2..46f67b38bf 100644 --- a/ext/standard/php_array.h +++ b/ext/standard/php_array.h @@ -1,29 +1,21 @@ -/* +/* +----------------------------------------------------------------------+ - | PHP HTML Embedded Scripting Language Version 3.0 | + | PHP version 4.0 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-1999 PHP Development Team (See Credits file) | + | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group | +----------------------------------------------------------------------+ - | This program is free software; you can redistribute it and/or modify | - | it under the terms of one of the following licenses: | - | | - | A) the GNU General Public License as published by the Free Software | - | Foundation; either version 2 of the License, or (at your option) | - | any later version. | - | | - | B) the PHP License as published by the PHP Development Team and | - | included in the distribution in the file: LICENSE | - | | - | This program is distributed in the hope that it will be useful, | - | but WITHOUT ANY WARRANTY; without even the implied warranty of | - | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | - | GNU General Public License for more details. | - | | - | You should have received a copy of both licenses referred to here. | - | If you did not, or have any questions about PHP licensing, please | - | contact core@php.net. | + | This source file is subject to version 2.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available at through the world-wide-web at | + | http://www.php.net/license/2_01.txt. | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | + | Authors: Andi Gutmans <andi@zend.com> | + | Zeev Suraski <zeev@zend.com> | + | Rasmus Lerdorf <rasmus@php.net> | + | Andrei Zmievski <andrei@ispi.net> | +----------------------------------------------------------------------+ */ @@ -32,9 +24,6 @@ #ifndef _PHP_ARRAY_H #define _PHP_ARRAY_H -extern zend_module_entry array_module_entry; -#define array_module_ptr &array_module_entry - PHP_MINIT_FUNCTION(array); PHP_MSHUTDOWN_FUNCTION(array); @@ -102,5 +91,4 @@ extern int array_globals_id; extern php_array_globals array_globals; #endif -#define phpext_array_ptr array_module_ptr #endif /* _PHP_ARRAY_H */ diff --git a/ext/standard/php_assert.h b/ext/standard/php_assert.h index a5a50f6b22..dbb8daa393 100644 --- a/ext/standard/php_assert.h +++ b/ext/standard/php_assert.h @@ -21,8 +21,12 @@ #ifndef _PHP_ASSERT_H #define _PHP_ASSERT_H -extern zend_module_entry assert_module_entry; -#define phpext_assert_ptr &assert_module_entry - +PHP_MINIT_FUNCTION(assert); +PHP_MSHUTDOWN_FUNCTION(assert); +PHP_RINIT_FUNCTION(assert); +PHP_RSHUTDOWN_FUNCTION(assert); +PHP_MINFO_FUNCTION(assert); +PHP_FUNCTION(assert); +PHP_FUNCTION(assert_options); #endif /* _PHP_ASSERT_H */ diff --git a/ext/standard/php_browscap.h b/ext/standard/php_browscap.h index a3706952c0..04eb072582 100644 --- a/ext/standard/php_browscap.h +++ b/ext/standard/php_browscap.h @@ -31,15 +31,9 @@ #ifndef _PHP_BROWSCAP_H #define _PHP_BROWSCAP_H -extern zend_module_entry browscap_module_entry; -#define browscap_module_ptr &browscap_module_entry - extern PHP_MINIT_FUNCTION(browscap); extern PHP_MSHUTDOWN_FUNCTION(browscap); PHP_FUNCTION(get_browser); - -#define phpext_browscap_ptr browscap_module_ptr - #endif /* _PHP_BROWSCAP_H */ diff --git a/ext/standard/php_crypt.h b/ext/standard/php_crypt.h index 94dbfb40f8..760a7fe777 100644 --- a/ext/standard/php_crypt.h +++ b/ext/standard/php_crypt.h @@ -1,15 +1,36 @@ +/* + +----------------------------------------------------------------------+ + | PHP version 4.0 | + +----------------------------------------------------------------------+ + | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available at through the world-wide-web at | + | http://www.php.net/license/2_01.txt. | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Stig Bakken <ssb@gaurdian.no> | + | Zeev Suraski <zeev@zend.com> | + | Rasmus Lerdorf <rasmus@lerdorf.on.ca> | + +----------------------------------------------------------------------+ + */ + #ifndef PHP_CRYPT_H #define PHP_CRYPT_H #if HAVE_CRYPT -extern zend_module_entry crypt_module_entry; -#define crypt_module_ptr &crypt_module_entry PHP_FUNCTION(crypt); extern PHP_MINIT_FUNCTION(crypt); -#else -#define crypt_module_ptr NULL #endif -#define phpext_crypt_ptr crypt_module_ptr - #endif + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + */ diff --git a/ext/standard/php_dir.h b/ext/standard/php_dir.h index c66be2d3be..ad044c4cf0 100644 --- a/ext/standard/php_dir.h +++ b/ext/standard/php_dir.h @@ -21,8 +21,6 @@ #ifndef _PHP_DIR_H #define _PHP_DIR_H -extern zend_module_entry php_dir_module_entry; -#define php_dir_module_ptr &php_dir_module_entry /* directory functions */ extern PHP_MINIT_FUNCTION(dir); @@ -34,6 +32,4 @@ PHP_FUNCTION(rewinddir); PHP_FUNCTION(readdir); PHP_FUNCTION(getdir); -#define phpext_dir_ptr php_dir_module_ptr - #endif /* _PHP_DIR_H */ diff --git a/ext/standard/php_filestat.h b/ext/standard/php_filestat.h index 30b9a90d20..580351f0b1 100644 --- a/ext/standard/php_filestat.h +++ b/ext/standard/php_filestat.h @@ -61,9 +61,4 @@ PHP_FUNCTION(chmod); PHP_FUNCTION(touch); PHP_FUNCTION(clearstatcache); -extern zend_module_entry php_filestat_module_entry; -#define php_filestat_module_ptr &php_filestat_module_entry - -#define phpext_filestat_ptr php_filestat_module_ptr - #endif /* _FILESTAT_H */ diff --git a/ext/standard/php_lcg.h b/ext/standard/php_lcg.h index 268db98bc0..cbde08f4b8 100644 --- a/ext/standard/php_lcg.h +++ b/ext/standard/php_lcg.h @@ -26,6 +26,7 @@ typedef struct { double php_combined_lcg(void); PHP_FUNCTION(lcg_value); +PHP_MINIT_FUNCTION(lcg); #ifdef ZTS #define LCGLS_D php_lcg_globals *lcg_globals @@ -37,7 +38,4 @@ PHP_FUNCTION(lcg_value); #define LCGLS_FETCH() #endif -extern zend_module_entry lcg_module_entry; -#define phpext_lcg_ptr &lcg_module_entry - #endif diff --git a/ext/standard/php_mail.h b/ext/standard/php_mail.h index 0db81ba6e6..e897c6c83e 100644 --- a/ext/standard/php_mail.h +++ b/ext/standard/php_mail.h @@ -32,18 +32,13 @@ #ifndef _MAIL_H #define _MAIL_H + #if HAVE_SENDMAIL -extern zend_module_entry mail_module_entry; -#define mail_module_ptr &mail_module_entry PHP_FUNCTION(mail); PHP_MINFO_FUNCTION(mail); extern int php_mail(char *to, char *subject, char *message, char *headers); -#else -#define mail_module_ptr NULL #endif -#define phpext_mail_ptr mail_module_ptr - #endif /* _MAIL_H */ diff --git a/ext/standard/php_metaphone.h b/ext/standard/php_metaphone.h index 5e420863f0..60c6d8e8ea 100644 --- a/ext/standard/php_metaphone.h +++ b/ext/standard/php_metaphone.h @@ -12,7 +12,7 @@ | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Authors: Thies C. Arntzen <thies@digicol.de> | + | Authors: Thies C. Arntzen <thies@digicol.de> | +----------------------------------------------------------------------+ */ @@ -21,7 +21,6 @@ #ifndef _php_metaphone_h #define _php_metaphone_h -extern zend_module_entry metaphone_module_entry; -#define phpext_metaphone_ptr &metaphone_module_entry +PHP_FUNCTION(metaphone); #endif diff --git a/ext/standard/php_output.h b/ext/standard/php_output.h index 50f3b4c138..2278cce179 100644 --- a/ext/standard/php_output.h +++ b/ext/standard/php_output.h @@ -33,7 +33,12 @@ PHPAPI void php_end_implicit_flush(); PHPAPI char *php_get_output_start_filename(); PHPAPI int php_get_output_start_lineno(); -extern zend_module_entry output_module_entry; -#define phpext_output_ptr &output_module_entry +PHP_FUNCTION(ob_start); +PHP_FUNCTION(ob_end_flush); +PHP_FUNCTION(ob_end_clean); +PHP_FUNCTION(ob_get_contents); +PHP_FUNCTION(ob_implicit_flush); + +PHP_GINIT_FUNCTION(output); #endif /* _OUTPUT_BUFFER */ diff --git a/ext/standard/php_standard.h b/ext/standard/php_standard.h index 9f6d64221a..9ac91071f2 100644 --- a/ext/standard/php_standard.h +++ b/ext/standard/php_standard.h @@ -63,6 +63,11 @@ #include "dl.h" #include "php_crypt.h" #include "head.h" +#include "php_lcg.h" +#include "php_metaphone.h" +#include "php_output.h" +#include "php_array.h" +#include "php_assert.h" #define phpext_standard_ptr basic_functions_module_ptr diff --git a/ext/standard/php_syslog.h b/ext/standard/php_syslog.h index 01a94eb6d3..a1417e2cb8 100644 --- a/ext/standard/php_syslog.h +++ b/ext/standard/php_syslog.h @@ -23,8 +23,7 @@ | If you did not, or have any questions about PHP licensing, please | | contact core@php.net. | +----------------------------------------------------------------------+ - | Authors: | - | | + | Authors: Stig Sæther Bakken <ssb@fast.no> | +----------------------------------------------------------------------+ */ @@ -32,8 +31,6 @@ #define _PHP_SYSLOG_H #if HAVE_SYSLOG_H -extern zend_module_entry syslog_module_entry; -#define syslog_module_ptr &syslog_module_entry extern PHP_MINIT_FUNCTION(syslog); extern PHP_RINIT_FUNCTION(syslog); @@ -44,10 +41,6 @@ PHP_FUNCTION(syslog); PHP_FUNCTION(closelog); PHP_FUNCTION(define_syslog_variables); -#else -#define syslog_module_ptr NULL #endif -#define phpext_syslog_ptr syslog_module_ptr - #endif /* _PHP_SYSLOG_H */ diff --git a/ext/standard/reg.c b/ext/standard/reg.c index 1630bf7b94..f48413606f 100644 --- a/ext/standard/reg.c +++ b/ext/standard/reg.c @@ -24,24 +24,7 @@ #include "php_string.h" #include "reg.h" -unsigned char third_argument_force_ref[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE }; - -function_entry reg_functions[] = { - PHP_FE(ereg, third_argument_force_ref) - PHP_FE(ereg_replace, NULL) - PHP_FE(eregi, third_argument_force_ref) - PHP_FE(eregi_replace, NULL) - PHP_FE(split, NULL) - PHP_FALIAS(join, implode, NULL) - PHP_FE(sql_regcase, NULL) - {NULL, NULL, NULL} -}; - - -static PHP_MINIT_FUNCTION(regex); -static PHP_MSHUTDOWN_FUNCTION(regex); -static PHP_MINFO_FUNCTION(regex); - +#if 0 zend_module_entry regexp_module_entry = { "Regular Expressions", reg_functions, @@ -49,6 +32,7 @@ zend_module_entry regexp_module_entry = { NULL, NULL, PHP_MINFO(regex), STANDARD_MODULE_PROPERTIES }; +#endif #ifdef ZTS int reg_globals_id; @@ -101,7 +85,7 @@ static void php_reg_init_globals(php_reg_globals *reg_globals) zend_hash_init(®_globals->ht_rc, 0, NULL, (void (*)(void *)) _free_reg_cache, 1); } -static PHP_MINIT_FUNCTION(regex) +PHP_MINIT_FUNCTION(regex) { #ifdef ZTS reg_globals_id = ts_allocate_id(sizeof(php_reg_globals), (ts_allocate_ctor) php_reg_init_globals, NULL); @@ -112,7 +96,7 @@ static PHP_MINIT_FUNCTION(regex) return SUCCESS; } -static PHP_MSHUTDOWN_FUNCTION(regex) +PHP_MSHUTDOWN_FUNCTION(regex) { REGLS_FETCH(); @@ -120,12 +104,12 @@ static PHP_MSHUTDOWN_FUNCTION(regex) return SUCCESS; } -static PHP_MINFO_FUNCTION(regex) +PHP_MINFO_FUNCTION(regex) { #if HSREGEX - PUTS("Bundled regex library enabled\n"); + PUTS("Bundled regex library enabled<br>\n"); #else - PUTS("System regex library enabled\n"); + PUTS("System regex library enabled<br>\n"); #endif } diff --git a/ext/standard/reg.h b/ext/standard/reg.h index b7f8262d2f..0ffa7438bd 100644 --- a/ext/standard/reg.h +++ b/ext/standard/reg.h @@ -33,9 +33,6 @@ #ifndef _REG_H #define _REG_H -extern zend_module_entry regexp_module_entry; -#define regexp_module_ptr ®exp_module_entry - char *php_reg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended); PHP_FUNCTION(ereg); @@ -49,6 +46,10 @@ typedef struct { HashTable ht_rc; } php_reg_globals; +PHP_MINIT_FUNCTION(regex); +PHP_MSHUTDOWN_FUNCTION(regex); +PHP_MINFO_FUNCTION(regex); + #ifdef ZTS #define REGLS_D php_reg_globals *reg_globals @@ -66,6 +67,4 @@ typedef struct { #define REGLS_FETCH() #endif -#define phpext_regex_ptr regexp_module_ptr - #endif /* _REG_H */ diff --git a/ext/standard/syslog.c b/ext/standard/syslog.c index f6a579dc42..8c2a94cc25 100644 --- a/ext/standard/syslog.c +++ b/ext/standard/syslog.c @@ -12,7 +12,7 @@ | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Authors: Stig Sæther Bakken <ssb@guardian.no> | + | Authors: Stig Sæther Bakken <ssb@fast.no> | +----------------------------------------------------------------------+ */ @@ -253,26 +253,6 @@ PHP_FUNCTION(syslog) } /* }}} */ - -function_entry syslog_functions[] = { - PHP_FE(openlog, NULL) - PHP_FE(syslog, NULL) - PHP_FE(closelog, NULL) - PHP_FE(define_syslog_variables, NULL) - {NULL, NULL, NULL} -}; - - -zend_module_entry syslog_module_entry = { - "Syslog", syslog_functions, PHP_MINIT(syslog), NULL, PHP_RINIT(syslog), PHP_RSHUTDOWN(syslog), NULL, STANDARD_MODULE_PROPERTIES -}; - - -#if COMPILE_DL -DLEXPORT zend_module_entry *get_module(void) { return &syslog_module_entry; } -#endif - - /* * Local variables: * tab-width: 4 diff --git a/main/internal_functions.c.in b/main/internal_functions.c.in index eb2dad8b05..6cb1c500be 100644 --- a/main/internal_functions.c.in +++ b/main/internal_functions.c.in @@ -1,4 +1,4 @@ -/* +/* -*- C -*- +----------------------------------------------------------------------+ | PHP version 4.0 | +----------------------------------------------------------------------+ @@ -40,23 +40,6 @@ unsigned char second_arg_force_ref[] = { 2, BYREF_NONE, BYREF_FORCE }; unsigned char second_arg_allow_ref[] = { 2, BYREF_NONE, BYREF_ALLOW }; zend_module_entry *php_builtin_extensions[] = { - phpext_regex_ptr, - phpext_dl_ptr, - phpext_file_ptr, - phpext_fsock_ptr, - phpext_head_ptr, - phpext_pack_ptr, - phpext_browscap_ptr, - phpext_crypt_ptr, - phpext_dir_ptr, - phpext_filestat_ptr, - phpext_mail_ptr, - phpext_syslog_ptr, - phpext_lcg_ptr, - phpext_metaphone_ptr, - phpext_output_ptr, - phpext_array_ptr, - phpext_assert_ptr, @EXT_MODULE_PTRS@ }; diff --git a/main/output.c b/main/output.c index fff9083251..6b46712b27 100644 --- a/main/output.c +++ b/main/output.c @@ -64,14 +64,6 @@ int output_globals_id; php_output_globals output_globals; #endif - -PHP_FUNCTION(ob_start); -PHP_FUNCTION(ob_end_flush); -PHP_FUNCTION(ob_end_clean); -PHP_FUNCTION(ob_get_contents); -PHP_FUNCTION(ob_implicit_flush); - - static void php_output_init_globals(OLS_D) { OG(php_body_write) = NULL; @@ -97,32 +89,6 @@ PHP_GINIT_FUNCTION(output) return SUCCESS; } -static zend_function_entry php_output_functions[] = { - PHP_FE(ob_start, NULL) - PHP_FE(ob_end_flush, NULL) - PHP_FE(ob_end_clean, NULL) - PHP_FE(ob_get_contents, NULL) - PHP_FE(ob_implicit_flush, NULL) - {NULL, NULL, NULL} -}; - -PHP_RINIT_FUNCTION(output); -PHP_RSHUTDOWN_FUNCTION(output); - -zend_module_entry output_module_entry = { - "PHP_output", - php_output_functions, - NULL, /* extension-wide startup function */ - NULL, /* extension-wide shutdown function */ - NULL, /* per-request startup function */ - NULL, /* per-request shutdown function */ - NULL, /* information function */ - PHP_GINIT(output), /* global startup function */ - NULL, /* global shutdown function */ - STANDARD_MODULE_PROPERTIES_EX -}; - - /* Start output layer */ PHPAPI void php_output_startup() { diff --git a/main/php.h b/main/php.h index b9668c0c41..a667f6978a 100644 --- a/main/php.h +++ b/main/php.h @@ -233,8 +233,8 @@ extern int ap_vsnprintf(char *, size_t, const char *, va_list); #define PHP_RINIT_FUNCTION(module) int PHP_RINIT(module)(INIT_FUNC_ARGS) #define PHP_RSHUTDOWN_FUNCTION(module) int PHP_RSHUTDOWN(module)(SHUTDOWN_FUNC_ARGS) #define PHP_MINFO_FUNCTION(module) void PHP_MINFO(module)(ZEND_MODULE_INFO_FUNC_ARGS) -#define PHP_GINIT_FUNCTION(module) static int PHP_GINIT(module)(void) -#define PHP_GSHUTDOWN_FUNCTION(module) static int PHP_GSHUTDOWN(module)(void) +#define PHP_GINIT_FUNCTION(module) int PHP_GINIT(module)(GINIT_FUNC_ARGS) +#define PHP_GSHUTDOWN_FUNCTION(module) int PHP_GSHUTDOWN(module)(void) /* global variables */ diff --git a/main/php_output.h b/main/php_output.h index 50f3b4c138..2278cce179 100644 --- a/main/php_output.h +++ b/main/php_output.h @@ -33,7 +33,12 @@ PHPAPI void php_end_implicit_flush(); PHPAPI char *php_get_output_start_filename(); PHPAPI int php_get_output_start_lineno(); -extern zend_module_entry output_module_entry; -#define phpext_output_ptr &output_module_entry +PHP_FUNCTION(ob_start); +PHP_FUNCTION(ob_end_flush); +PHP_FUNCTION(ob_end_clean); +PHP_FUNCTION(ob_get_contents); +PHP_FUNCTION(ob_implicit_flush); + +PHP_GINIT_FUNCTION(output); #endif /* _OUTPUT_BUFFER */ |