]> granicus.if.org Git - php/commitdiff
More TSRMLS_FETCH work
authorZeev Suraski <zeev@php.net>
Tue, 31 Jul 2001 04:53:54 +0000 (04:53 +0000)
committerZeev Suraski <zeev@php.net>
Tue, 31 Jul 2001 04:53:54 +0000 (04:53 +0000)
49 files changed:
Zend/zend.c
Zend/zend.h
Zend/zend_API.c
Zend/zend_API.h
Zend/zend_builtin_functions.c
Zend/zend_compile.c
Zend/zend_compile.h
Zend/zend_constants.c
Zend/zend_execute.c
Zend/zend_execute.h
Zend/zend_execute_API.c
Zend/zend_extensions.c
Zend/zend_extensions.h
Zend/zend_hash.c
Zend/zend_hash.h
Zend/zend_ini.c
Zend/zend_list.c
Zend/zend_list.h
Zend/zend_llist.c
Zend/zend_llist.h
Zend/zend_modules.h
Zend/zend_opcode.c
ext/crack/crack.c
ext/domxml/php_domxml.c
ext/dotnet/dotnet.cpp
ext/fdf/fdf.c
ext/mbstring/mbstring.c
ext/mssql/php_mssql.c
ext/oci8/oci8.c
ext/odbc/php_odbc.c
ext/pgsql/pgsql.c
ext/rpc/dotnet/dotnet.cpp
ext/standard/basic_functions.c
ext/standard/info.c
ext/sybase/php_sybase_db.c
ext/sybase_ct/php_sybase_ct.c
main/SAPI.c
main/SAPI.h
main/main.c
main/php_ini.c
main/php_ini.h
main/php_ticks.c
main/rfc1867.c
sapi/apache/mod_php4.c
sapi/cgi/cgi_main.c
sapi/fastcgi/fastcgi.c
sapi/isapi/php4isapi.c
sapi/pi3web/pi3web_sapi.c
sapi/servlet/servlet.c

index fea898e9cef1d33bd7ea12ea515b2018908b3a26..a44c9bfd7b6214458d79b810e611e8bc6c882bbb 100644 (file)
@@ -431,7 +431,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
 }
 
 
-void zend_shutdown()
+void zend_shutdown(TSRMLS_D)
 {
 #ifdef ZEND_WIN32
        zend_shutdown_timeout_thread();
@@ -445,7 +445,7 @@ void zend_shutdown()
        free(GLOBAL_FUNCTION_TABLE);
        zend_hash_destroy(GLOBAL_CLASS_TABLE);
        free(GLOBAL_CLASS_TABLE);
-       zend_shutdown_extensions();
+       zend_shutdown_extensions(TSRMLS_C);
        free(zend_version_info);
 #ifndef ZTS
        zend_shutdown_constants();
@@ -520,9 +520,9 @@ void zend_activate(TSRMLS_D)
 }
 
 
-void zend_activate_modules(void)
+void zend_activate_modules(TSRMLS_D)
 {
-       zend_hash_apply(&module_registry, (apply_func_t) module_registry_request_startup);
+       zend_hash_apply(&module_registry, (apply_func_t) module_registry_request_startup TSRMLS_CC);
 }
 
 void zend_deactivate_modules(TSRMLS_D)
@@ -530,7 +530,7 @@ void zend_deactivate_modules(TSRMLS_D)
        EG(opline_ptr) = NULL; /* we're no longer executing anything */
 
        zend_try {
-               zend_hash_apply(&module_registry, (apply_func_t) module_registry_cleanup);
+               zend_hash_apply(&module_registry, (apply_func_t) module_registry_cleanup TSRMLS_CC);
        } zend_end_try();
 }
 
index 2d171a40d9578bed991e2cce77c137c0309ac4b5..5273a92b53ba6d051f63159df5f78207f81b6faf 100644 (file)
@@ -304,7 +304,7 @@ typedef int (*zend_write_func_t)(const char *str, uint str_length);
 #define BYREF_FORCE_REST 3
 
 int zend_startup(zend_utility_functions *utility_functions, char **extensions, int start_builtin_functions);
-void zend_shutdown(void);
+void zend_shutdown(TSRMLS_D);
 
 void zend_set_utility_values(zend_utility_values *utility_values);
 
index 25cc7a034e67bfd2007ed79d89b36b2fb878c8da..a46c3872f00681a776c4abbadd8b8b264331e3e2 100644 (file)
@@ -569,9 +569,10 @@ ZEND_API int _array_init(zval *arg ZEND_FILE_LINE_DC)
 ZEND_API int _object_init_ex(zval *arg, zend_class_entry *class_type ZEND_FILE_LINE_DC)
 {
        zval *tmp;
+       TSRMLS_FETCH();
 
        if (!class_type->constants_updated) {
-               zend_hash_apply_with_argument(&class_type->default_properties, (int (*)(void *,void *)) zval_update_constant, (void *) 1);
+               zend_hash_apply_with_argument(&class_type->default_properties, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
                class_type->constants_updated = 1;
        }
        
@@ -1100,7 +1101,7 @@ void module_destructor(zend_module_entry *module)
        TSRMLS_FETCH();
 
        if (module->type == MODULE_TEMPORARY) {
-               zend_clean_module_rsrc_dtors(module->module_number);
+               zend_clean_module_rsrc_dtors(module->module_number TSRMLS_CC);
                clean_module_constants(module->module_number TSRMLS_CC);
                if (module->request_shutdown_func)
                        module->request_shutdown_func(module->type, module->module_number TSRMLS_CC);
@@ -1126,11 +1127,9 @@ void module_destructor(zend_module_entry *module)
 
 
 /* call request startup for all modules */
-int module_registry_request_startup(zend_module_entry *module)
+int module_registry_request_startup(zend_module_entry *module TSRMLS_DC)
 {
        if (module->request_startup_func) {
-               TSRMLS_FETCH();
-
 #if 0
                zend_printf("%s:  Request startup\n",module->name);
 #endif
@@ -1146,10 +1145,8 @@ int module_registry_request_startup(zend_module_entry *module)
 /* for persistent modules - call request shutdown and flag NOT to erase
  * for temporary modules - do nothing, and flag to erase
  */
-int module_registry_cleanup(zend_module_entry *module)
+int module_registry_cleanup(zend_module_entry *module TSRMLS_DC)
 {
-       TSRMLS_FETCH();
-
        switch(module->type) {
                case MODULE_PERSISTENT:
                        if (module->request_shutdown_func) {
@@ -1271,10 +1268,8 @@ static zend_function_entry disabled_function[] =  {
 };
 
 
-ZEND_API int zend_disable_function(char *function_name, uint function_name_length)
+ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC)
 {
-       TSRMLS_FETCH();
-
        if (zend_hash_del(CG(function_table), function_name, function_name_length+1)==FAILURE) {
                return FAILURE;
        }
index 29dcbc7e880e0770a31079341b238341340219eb..e8264590d3d2cef3471323d434c7db10a83e3475 100644 (file)
@@ -130,7 +130,7 @@ ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *class_
 ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce, char *parent_name TSRMLS_DC);
 
 ZEND_API zend_module_entry *zend_get_module(int module_number);
-ZEND_API int zend_disable_function(char *function_name, uint function_name_length);
+ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC);
 
 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);
index b6defd3557a70ad1db500dca10345243ccd405b7..a0e5e67da4252cb98e3394235c527b141e36f2b3 100644 (file)
@@ -553,7 +553,7 @@ ZEND_FUNCTION(get_class_vars)
                efree(lcname);
                array_init(return_value);
                if (!ce->constants_updated) {
-                       zend_hash_apply_with_argument(&ce->default_properties, (int (*)(void *,void *)) zval_update_constant, (void *) 1);
+                       zend_hash_apply_with_argument(&ce->default_properties, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
                        ce->constants_updated = 1;
                }
                zend_hash_copy(return_value->value.ht, &ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
@@ -1008,14 +1008,14 @@ ZEND_FUNCTION(get_resource_type)
 }
 
 
-static int add_extension_info(zend_module_entry *module, void *arg)
+static int add_extension_info(zend_module_entry *module, void *arg TSRMLS_DC)
 {
        zval *name_array = (zval *)arg;
        add_next_index_string(name_array, module->name, 1);
        return 0;
 }
 
-static int add_constant_info(zend_constant *constant, void *arg)
+static int add_constant_info(zend_constant *constant, void *arg TSRMLS_DC)
 {
        zval *name_array = (zval *)arg;
        zval *const_val;
@@ -1037,7 +1037,7 @@ ZEND_FUNCTION(get_loaded_extensions)
        }
 
        array_init(return_value);
-       zend_hash_apply_with_argument(&module_registry, (int (*)(void *, void*)) add_extension_info, return_value);
+       zend_hash_apply_with_argument(&module_registry, (apply_func_arg_t) add_extension_info, return_value TSRMLS_CC);
 }
 /* }}} */
 
@@ -1051,7 +1051,7 @@ ZEND_FUNCTION(get_defined_constants)
        }
 
        array_init(return_value);
-       zend_hash_apply_with_argument(EG(zend_constants), (int (*)(void *, void*)) add_constant_info, return_value);
+       zend_hash_apply_with_argument(EG(zend_constants), (apply_func_arg_t) add_constant_info, return_value TSRMLS_CC);
 }
 
 
index 149c009aa2378aa60c74b0b2f8699594d9f892cf..04a992fd46d9a6f35806412e7fa7fc33deab4426 100644 (file)
@@ -766,7 +766,7 @@ void zend_do_end_function_declaration(znode *function_token TSRMLS_DC)
 {
        zend_do_extended_info(TSRMLS_C);
        zend_do_return(NULL, 0 TSRMLS_CC);
-       pass_two(CG(active_op_array));
+       pass_two(CG(active_op_array) TSRMLS_CC);
        CG(active_op_array) = function_token->u.op_array;
 
        /* Pop the switch and foreach seperators */
index 6fd2ac1e779e09ac59a4df82ace055065cb6cc6b..fda7b57239deccd44c866f20eeff6efa5a3ead1f 100644 (file)
@@ -204,7 +204,7 @@ extern ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handl
 
 void zend_activate(TSRMLS_D);
 void zend_deactivate(TSRMLS_D);
-void zend_activate_modules(void);
+void zend_activate_modules(TSRMLS_D);
 void zend_deactivate_modules(TSRMLS_D);
 
 
@@ -383,9 +383,9 @@ void zend_class_add_ref(zend_class_entry *ce);
 zend_op *get_next_op(zend_op_array *op_array TSRMLS_DC);
 void init_op(zend_op *op TSRMLS_DC);
 int get_next_op_number(zend_op_array *op_array);
-int print_class(zend_class_entry *class_entry);
+int print_class(zend_class_entry *class_entry TSRMLS_DC);
 void print_op_array(zend_op_array *op_array, int optimizations);
-int pass_two(zend_op_array *op_array);
+int pass_two(zend_op_array *op_array TSRMLS_DC);
 zend_brk_cont_element *get_next_brk_cont_element(zend_op_array *op_array);
 ZEND_API zend_bool zend_is_compiling(TSRMLS_D);
 ZEND_API char *zend_make_compiled_string_description(char *name TSRMLS_DC);
index bf6a42c279031bf1d7911ab01bc8093d6ae8605a..cb4ac03333727e0617e07db2914065df620da484 100644 (file)
@@ -51,7 +51,7 @@ void zend_copy_constants(HashTable *target, HashTable *source)
 }
 
 
-static int clean_non_persistent_constant(zend_constant *c)
+static int clean_non_persistent_constant(zend_constant *c TSRMLS_DC)
 {
        if (c->flags & CONST_PERSISTENT) {
                return 0;
@@ -61,7 +61,7 @@ static int clean_non_persistent_constant(zend_constant *c)
 }
 
 
-static int clean_module_constant(zend_constant *c, int *module_number)
+static int clean_module_constant(zend_constant *c, int *module_number TSRMLS_DC)
 {
        if (c->module_number == *module_number) {
                return 1;
@@ -73,7 +73,7 @@ static int clean_module_constant(zend_constant *c, int *module_number)
 
 void clean_module_constants(int module_number TSRMLS_DC)
 {
-       zend_hash_apply_with_argument(EG(zend_constants), (int (*)(void *,void *)) clean_module_constant, (void *) &module_number);
+       zend_hash_apply_with_argument(EG(zend_constants), (apply_func_arg_t) clean_module_constant, (void *) &module_number TSRMLS_CC);
 }
 
 
@@ -156,7 +156,7 @@ int zend_shutdown_constants(TSRMLS_D)
 
 void clean_non_persistent_constants(TSRMLS_D)
 {
-       zend_hash_apply(EG(zend_constants), (apply_func_t) clean_non_persistent_constant);
+       zend_hash_apply(EG(zend_constants), (apply_func_t) clean_non_persistent_constant TSRMLS_CC);
 }
 
 
index 3de49b8d54c8fdf7d8b94be2914a33abdbafe3df..6720bd014b0fb93f990dfec02a7bda8b8171e58b 100644 (file)
@@ -61,9 +61,9 @@ static void zend_fetch_var_address(znode *result, znode *op1, znode *op2, temp_v
 static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2, temp_variable *Ts, int type TSRMLS_DC);
 static void zend_fetch_property_address(znode *result, znode *op1, znode *op2, temp_variable *Ts, int type TSRMLS_DC);
 static void zend_fetch_dimension_address_from_tmp_var(znode *result, znode *op1, znode *op2, temp_variable *Ts TSRMLS_DC);
-static void zend_extension_statement_handler(zend_extension *extension, zend_op_array *op_array);
-static void zend_extension_fcall_begin_handler(zend_extension *extension, zend_op_array *op_array);
-static void zend_extension_fcall_end_handler(zend_extension *extension, zend_op_array *op_array);
+static void zend_extension_statement_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC);
+static void zend_extension_fcall_begin_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC);
+static void zend_extension_fcall_end_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC);
 
 #define RETURN_VALUE_USED(opline) (!((opline)->result.u.EA.type & EXT_TYPE_UNUSED))
 
@@ -473,7 +473,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
 
 
 /* Utility Functions for Extensions */
-static void zend_extension_statement_handler(zend_extension *extension, zend_op_array *op_array)
+static void zend_extension_statement_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
 {
        if (extension->statement_handler) {
                extension->statement_handler(op_array);
@@ -481,7 +481,7 @@ static void zend_extension_statement_handler(zend_extension *extension, zend_op_
 }
 
 
-static void zend_extension_fcall_begin_handler(zend_extension *extension, zend_op_array *op_array)
+static void zend_extension_fcall_begin_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
 {
        if (extension->fcall_begin_handler) {
                extension->fcall_begin_handler(op_array);
@@ -489,7 +489,7 @@ static void zend_extension_fcall_begin_handler(zend_extension *extension, zend_o
 }
 
 
-static void zend_extension_fcall_end_handler(zend_extension *extension, zend_op_array *op_array)
+static void zend_extension_fcall_end_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
 {
        if (extension->fcall_end_handler) {
                extension->fcall_end_handler(op_array);
@@ -561,7 +561,7 @@ static void zend_fetch_var_address(znode *result, znode *op1, znode *op2, temp_v
        if (op2->u.fetch_type == ZEND_FETCH_LOCAL) {
                FREE_OP(op1, free_op1);
        } else if (op2->u.fetch_type == ZEND_FETCH_STATIC) {
-               zval_update_constant(retval, (void *) 1);
+               zval_update_constant(retval, (void *) 1 TSRMLS_CC);
        }
 
        if (varname == &tmp_varname) {
@@ -937,19 +937,19 @@ static void call_overloaded_function(temp_variable *T, int arg_count, zval *retu
 #if ZEND_INTENSIVE_DEBUGGING
 
 #define CHECK_SYMBOL_TABLES()                                                                                                          \
-       zend_hash_apply(&EG(symbol_table), (apply_func_t) zend_check_symbol);                           \
+       zend_hash_apply(&EG(symbol_table), (apply_func_t) zend_check_symbol TSRMLS_CC); \
        if (&EG(symbol_table)!=EG(active_symbol_table)) {                                                               \
-               zend_hash_apply(EG(active_symbol_table), (apply_func_t) zend_check_symbol);     \
+               zend_hash_apply(EG(active_symbol_table), (apply_func_t) zend_check_symbol TSRMLS_CC);   \
        }
 
-static int zend_check_symbol(zval **pz)
+static int zend_check_symbol(zval **pz TSRMLS_DC)
 {
        if ((*pz)->type>9) {
                fprintf(stderr, "Warning!  %x has invalid type!\n", *pz);
        } else if ((*pz)->type==IS_ARRAY) {
-               zend_hash_apply((*pz)->value.ht, (apply_func_t) zend_check_symbol);
+               zend_hash_apply((*pz)->value.ht, (apply_func_t) zend_check_symbol TSRMLS_CC);
        } else if ((*pz)->type==IS_OBJECT) {
-               zend_hash_apply((*pz)->value.obj.properties, (apply_func_t) zend_check_symbol);
+               zend_hash_apply((*pz)->value.obj.properties, (apply_func_t) zend_check_symbol TSRMLS_CC);
        }
 
        return 0;
@@ -1793,7 +1793,7 @@ send_by_ref:
                                                                zval_copy_ctor(default_value);
                                                        }
                                                        default_value->refcount=1;
-                                                       zval_update_constant(&default_value, 0);
+                                                       zval_update_constant(&default_value, 0 TSRMLS_CC);
                                                        default_value->refcount=0;
                                                        default_value->is_ref=0;
                                                        param = &default_value;
@@ -2375,17 +2375,17 @@ send_by_ref:
                                NEXT_OPCODE();
                        case ZEND_EXT_STMT: 
                                if (!EG(no_extensions)) {
-                                       zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_statement_handler, op_array);
+                                       zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_statement_handler, op_array TSRMLS_CC);
                                }
                                NEXT_OPCODE();
                        case ZEND_EXT_FCALL_BEGIN:
                                if (!EG(no_extensions)) {
-                                       zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_fcall_begin_handler, op_array);
+                                       zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_begin_handler, op_array TSRMLS_CC);
                                }
                                NEXT_OPCODE();
                        case ZEND_EXT_FCALL_END:
                                if (!EG(no_extensions)) {
-                                       zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_fcall_end_handler, op_array);
+                                       zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_end_handler, op_array TSRMLS_CC);
                                }
                                NEXT_OPCODE();
                        case ZEND_DECLARE_FUNCTION_OR_CLASS:
index 9f52f3707d262e3f026593c7544c9cff0a67b3fc..9c25e8c0ef4b9548dc4c62e08a1bb3f7b8602fec 100644 (file)
@@ -101,7 +101,7 @@ static inline int i_zend_is_true(zval *op)
        return result;
 }
 
-ZEND_API int zval_update_constant(zval **pp, void *arg);
+ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC);
 
 /* dedicated Zend executor functions - do not use! */
 static inline void zend_ptr_stack_clear_multiple(TSRMLS_D)
index 9646eaf49e900e523432ada8cccb99c65f1c6788..cf15349fec1eda3be797552ea5b1acb7d48bbb3c 100644 (file)
@@ -74,7 +74,7 @@ static void zend_handle_sigsegv(int dummy)
 #endif
 
 
-static void zend_extension_activator(zend_extension *extension)
+static void zend_extension_activator(zend_extension *extension TSRMLS_DC)
 {
        if (extension->activate) {
                extension->activate();
@@ -82,7 +82,7 @@ static void zend_extension_activator(zend_extension *extension)
 }
 
 
-static void zend_extension_deactivator(zend_extension *extension)
+static void zend_extension_deactivator(zend_extension *extension TSRMLS_DC)
 {
        if (extension->deactivate) {
                extension->deactivate();
@@ -90,13 +90,13 @@ static void zend_extension_deactivator(zend_extension *extension)
 }
 
 
-static int is_not_internal_function(zend_function *function)
+static int is_not_internal_function(zend_function *function TSRMLS_DC)
 {
        return(function->type != ZEND_INTERNAL_FUNCTION);
 }
 
 
-static int is_not_internal_class(zend_class_entry *ce)
+static int is_not_internal_class(zend_class_entry *ce TSRMLS_DC)
 {
        return(ce->type != ZEND_INTERNAL_CLASS);
 }
@@ -130,7 +130,7 @@ void init_executor(TSRMLS_D)
        zend_hash_init(&EG(symbol_table), 50, NULL, ZVAL_PTR_DTOR, 0);
        EG(active_symbol_table) = &EG(symbol_table);
 
-       zend_llist_apply(&zend_extensions, (void (*)(void *)) zend_extension_activator);
+       zend_llist_apply(&zend_extensions, (llist_apply_func_t) zend_extension_activator TSRMLS_CC);
        EG(opline_ptr) = NULL;
        EG(garbage_ptr) = 0;
 
@@ -160,7 +160,7 @@ void shutdown_executor(TSRMLS_D)
                        efree(*EG(symtable_cache_ptr));
                        EG(symtable_cache_ptr)--;
                }
-               zend_llist_apply(&zend_extensions, (void (*)(void *)) zend_extension_deactivator);
+               zend_llist_apply(&zend_extensions, (llist_apply_func_t) zend_extension_deactivator TSRMLS_CC);
 
                zend_hash_destroy(&EG(symbol_table));
 
@@ -173,8 +173,8 @@ void shutdown_executor(TSRMLS_D)
                zend_ptr_stack_destroy(&EG(argument_stack));
 
                /* Destroy all op arrays */
-               zend_hash_apply(EG(function_table), (apply_func_t) is_not_internal_function);
-               zend_hash_apply(EG(class_table), (apply_func_t) is_not_internal_class);
+               zend_hash_apply(EG(function_table), (apply_func_t) is_not_internal_function TSRMLS_CC);
+               zend_hash_apply(EG(class_table), (apply_func_t) is_not_internal_class TSRMLS_CC);
        } zend_end_try();
 
        zend_destroy_rsrc_list(TSRMLS_C); /* must be destroyed after the main symbol table and
@@ -271,12 +271,11 @@ ZEND_API int zend_is_true(zval *op)
 }
 
 
-ZEND_API int zval_update_constant(zval **pp, void *arg)
+ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC)
 {
        zval *p = *pp;
        zend_bool inline_change = (zend_bool) (unsigned long) arg;
        zval const_value;
-       TSRMLS_FETCH();
 
        if (p->type == IS_CONSTANT) {
                int refcount;
@@ -340,7 +339,7 @@ ZEND_API int zval_update_constant(zval **pp, void *arg)
                        }
                        zend_hash_del(p->value.ht, str_index, str_index_len);
                }
-               zend_hash_apply_with_argument(p->value.ht, (int (*)(void *,void *)) zval_update_constant, (void *) 1);
+               zend_hash_apply_with_argument(p->value.ht, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
        }
        return 0;
 }
index 790490fa00ed4928e05d02de0a0af3ee4e6d5e57..14b914cf8e655ec79ea29cc3d4444af879bc0d7d 100644 (file)
@@ -114,7 +114,7 @@ int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle)
 }
 
 
-static void zend_extension_shutdown(zend_extension *extension)
+static void zend_extension_shutdown(zend_extension *extension TSRMLS_DC)
 {
 #if ZEND_EXTENSIONS_SUPPORT
        if (extension->shutdown) {
@@ -153,9 +153,9 @@ int zend_startup_extensions()
 }
 
 
-void zend_shutdown_extensions()
+void zend_shutdown_extensions(TSRMLS_D)
 {
-       zend_llist_apply(&zend_extensions, (void (*)(void *)) zend_extension_shutdown);
+       zend_llist_apply(&zend_extensions, (llist_apply_func_t) zend_extension_shutdown TSRMLS_CC);
        zend_llist_destroy(&zend_extensions);
 }
 
@@ -170,7 +170,7 @@ void zend_extension_dtor(zend_extension *extension)
 }
 
 
-static void zend_extension_message_dispatcher(zend_extension *extension, int num_args, va_list args)
+static void zend_extension_message_dispatcher(zend_extension *extension, int num_args, va_list args TSRMLS_DC)
 {
        int message;
        void *arg;
@@ -186,7 +186,9 @@ static void zend_extension_message_dispatcher(zend_extension *extension, int num
 
 ZEND_API void zend_extension_dispatch_message(int message, void *arg)
 {
-       zend_llist_apply_with_arguments(&zend_extensions, (llist_apply_with_args_func_t) zend_extension_message_dispatcher, 2, message, arg);
+       TSRMLS_FETCH();
+
+       zend_llist_apply_with_arguments(&zend_extensions, (llist_apply_with_args_func_t) zend_extension_message_dispatcher TSRMLS_CC, 2, message, arg);
 }
 
 
index a31bd9cf910d9eab31f7e352ba041a300d4435f2..c7839262e581e5047b7dc6dbbc3862f0913fae06 100644 (file)
@@ -110,7 +110,7 @@ ZEND_API int zend_register_extension(zend_extension *new_extension, DL_HANDLE ha
 void zend_append_version_info(zend_extension *extension);
 int zend_startup_extensions_mechanism(void);
 int zend_startup_extensions(void);
-void zend_shutdown_extensions(void);
+void zend_shutdown_extensions(TSRMLS_D);
 ZEND_API zend_extension *zend_get_extension(char *extension_name);
 
 #endif /* ZEND_EXTENSIONS_H */
index 6b6bb7e17126211a97c359f74d0613e8d6686d4f..0078a53893e7449db3a90df94a901b85f8deeff8 100644 (file)
@@ -683,7 +683,7 @@ ZEND_API void zend_hash_graceful_destroy(HashTable *ht)
  */
 
 
-ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func)
+ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC)
 {
        Bucket *p;
 
@@ -692,7 +692,7 @@ ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func)
        HASH_PROTECT_RECURSION(ht);
        p = ht->pListHead;
        while (p != NULL) {
-               if (apply_func(p->pData)) {
+               if (apply_func(p->pData TSRMLS_CC)) {
                        p = zend_hash_apply_deleter(ht, p);
                } else {
                        p = p->pListNext;
@@ -702,7 +702,7 @@ ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func)
 }
 
 
-ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t apply_func, void *argument)
+ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t apply_func, void *argument TSRMLS_DC)
 {
        Bucket *p;
 
index c19a38c26d20c65d4830d1719c10d9d1e27c143d..e14b6c62f800e30b4789886261f8d7df9718fe94 100644 (file)
@@ -37,7 +37,7 @@ typedef ulong (*hash_func_t)(char *arKey, uint nKeyLength);
 typedef int  (*compare_func_t)(const void *, const void *);
 typedef void (*sort_func_t)(void *, size_t, register size_t, compare_func_t);
 typedef void (*dtor_func_t)(void *pDest);
-typedef int (*apply_func_t)(void *pDest);
+typedef int (*apply_func_t)(void *pDest TSRMLS_DC);
 typedef int (*apply_func_arg_t)(void *pDest, void *argument);
 typedef void (*copy_ctor_func_t)(void *pElement);
 
@@ -116,8 +116,8 @@ typedef struct _zend_hash_key {
 typedef int (*apply_func_args_t)(void *pDest, int num_args, va_list args, zend_hash_key *hash_key);
 
 ZEND_API void zend_hash_graceful_destroy(HashTable *ht);
-ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func);
-ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t apply_func, void *);
+ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC);
+ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t apply_func, void * TSRMLS_DC);
 ZEND_API void zend_hash_apply_with_arguments(HashTable *ht, apply_func_args_t apply_func, int, ...);
 
 
index 7595b8259a8f094782c415032fb3e3c22936274e..fac8ab4e035bbafc2e96b54fde72d420653bd555 100644 (file)
@@ -31,7 +31,7 @@ static HashTable *registered_zend_ini_directives;
 /*
  * hash_apply functions
  */
-static int zend_remove_ini_entries(zend_ini_entry *ini_entry, int *module_number)
+static int zend_remove_ini_entries(zend_ini_entry *ini_entry, int *module_number TSRMLS_DC)
 {
        if (ini_entry->module_number == *module_number) {
                return 1;
@@ -41,10 +41,8 @@ static int zend_remove_ini_entries(zend_ini_entry *ini_entry, int *module_number
 }
 
 
-static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage)
+static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage TSRMLS_DC)
 {
-       TSRMLS_FETCH();
-
        if (ini_entry->modified) {
                if (ini_entry->on_modify) {
                        ini_entry->on_modify(ini_entry, ini_entry->orig_value, ini_entry->orig_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC);
@@ -81,7 +79,7 @@ ZEND_API int zend_ini_shutdown(TSRMLS_D)
 
 ZEND_API int zend_ini_deactivate(TSRMLS_D)
 {
-       zend_hash_apply_with_argument(&EG(ini_directives), (int (*)(void *, void *)) zend_restore_ini_entry_cb, (void *) ZEND_INI_STAGE_DEACTIVATE);
+       zend_hash_apply_with_argument(&EG(ini_directives), (apply_func_arg_t) zend_restore_ini_entry_cb, (void *) ZEND_INI_STAGE_DEACTIVATE TSRMLS_CC);
        return SUCCESS;
 }
 
@@ -159,14 +157,14 @@ ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_num
 
 ZEND_API void zend_unregister_ini_entries(int module_number)
 {
-       zend_hash_apply_with_argument(registered_zend_ini_directives, (int (*)(void *, void *)) zend_remove_ini_entries, (void *) &module_number);
+       TSRMLS_FETCH();
+
+       zend_hash_apply_with_argument(registered_zend_ini_directives, (apply_func_arg_t) zend_remove_ini_entries, (void *) &module_number TSRMLS_CC);
 }
 
 
-static int zend_ini_refresh_cache(zend_ini_entry *p, int stage)
+static int zend_ini_refresh_cache(zend_ini_entry *p, int stage TSRMLS_DC)
 {
-       TSRMLS_FETCH();
-
        if (p->on_modify) {
                p->on_modify(p, p->value, p->value_length, p->mh_arg1, p->mh_arg2, p->mh_arg3, stage TSRMLS_CC);
        }
@@ -176,7 +174,7 @@ static int zend_ini_refresh_cache(zend_ini_entry *p, int stage)
 
 ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC)
 {
-       zend_hash_apply_with_argument(&EG(ini_directives), (int (*)(void *, void *)) zend_ini_refresh_cache, (void *)(long) stage);
+       zend_hash_apply_with_argument(&EG(ini_directives), (apply_func_arg_t) zend_ini_refresh_cache, (void *)(long) stage TSRMLS_CC);
 }
 
 
@@ -224,7 +222,7 @@ ZEND_API int zend_restore_ini_entry(char *name, uint name_length, int stage)
                return FAILURE;
        }
 
-       zend_restore_ini_entry_cb(ini_entry, stage);
+       zend_restore_ini_entry_cb(ini_entry, stage TSRMLS_CC);
        return SUCCESS;
 }
 
index 4cd588367fd5744b7cc7078bb1ab32289fe76aeb..db418ac18615398ed7f75bae8e461e3804af632c 100644 (file)
@@ -263,7 +263,7 @@ void zend_destroy_rsrc_plist(TSRMLS_D)
 }
 
 
-static int clean_module_resource(zend_rsrc_list_entry *le, int *resource_id)
+static int clean_module_resource(zend_rsrc_list_entry *le, int *resource_id TSRMLS_DC)
 {
        if (le->type == *resource_id) {
                return 1;
@@ -273,13 +273,11 @@ static int clean_module_resource(zend_rsrc_list_entry *le, int *resource_id)
 }
 
 
-static int zend_clean_module_rsrc_dtors_cb(zend_rsrc_list_dtors_entry *ld, int *module_number)
+static int zend_clean_module_rsrc_dtors_cb(zend_rsrc_list_dtors_entry *ld, int *module_number TSRMLS_DC)
 {
        if (ld->module_number == *module_number) {
-               TSRMLS_FETCH();
-
-               zend_hash_apply_with_argument(&EG(regular_list), (int (*)(void *,void *)) clean_module_resource, (void *) &(ld->resource_id));
-               zend_hash_apply_with_argument(&EG(persistent_list), (int (*)(void *,void *)) clean_module_resource, (void *) &(ld->resource_id));
+               zend_hash_apply_with_argument(&EG(regular_list), (apply_func_arg_t) clean_module_resource, (void *) &(ld->resource_id) TSRMLS_CC);
+               zend_hash_apply_with_argument(&EG(persistent_list), (apply_func_arg_t) clean_module_resource, (void *) &(ld->resource_id) TSRMLS_CC);
                return 1;
        } else {
                return 0;
@@ -287,9 +285,9 @@ static int zend_clean_module_rsrc_dtors_cb(zend_rsrc_list_dtors_entry *ld, int *
 }
 
 
-void zend_clean_module_rsrc_dtors(int module_number)
+void zend_clean_module_rsrc_dtors(int module_number TSRMLS_DC)
 {
-       zend_hash_apply_with_argument(&list_destructors, (int (*)(void *,void *)) zend_clean_module_rsrc_dtors_cb, (void *) &module_number);
+       zend_hash_apply_with_argument(&list_destructors, (apply_func_arg_t) zend_clean_module_rsrc_dtors_cb, (void *) &module_number TSRMLS_CC);
 }
 
 
index f3b414e4daed126637ac0393bf6694b5949ec1b7..0b75115233a764a22dd123a6077646dbb28e6469 100644 (file)
@@ -65,7 +65,7 @@ enum list_entry_type {
 void list_entry_destructor(void *ptr);
 void plist_entry_destructor(void *ptr);
 
-void zend_clean_module_rsrc_dtors(int module_number);
+void zend_clean_module_rsrc_dtors(int module_number TSRMLS_DC);
 int zend_init_rsrc_list(TSRMLS_D);
 int zend_init_rsrc_plist(TSRMLS_D);
 void zend_destroy_rsrc_list(TSRMLS_D);
index a85492c3964102a2d5de5fc53c81f551d10cc019..e3ac9a6d73b8b1bd52c02a56c43340cad26de1c1 100644 (file)
@@ -158,12 +158,12 @@ ZEND_API void zend_llist_apply_with_del(zend_llist *l, int (*func)(void *data))
 }
 
 
-ZEND_API void zend_llist_apply(zend_llist *l, void (*func)(void *data))
+ZEND_API void zend_llist_apply(zend_llist *l, llist_apply_func_t func TSRMLS_DC)
 {
        zend_llist_element *element;
 
        for (element=l->head; element; element=element->next) {
-               func(element->data);
+               func(element->data TSRMLS_CC);
        }
 }
 
@@ -205,24 +205,24 @@ ZEND_API void zend_llist_sort(zend_llist *l, llist_compare_func_t comp_func)
 }
 
 
-ZEND_API void zend_llist_apply_with_argument(zend_llist *l, void (*func)(void *data, void *arg), void *arg)
+ZEND_API void zend_llist_apply_with_argument(zend_llist *l, llist_apply_with_arg_func_t func, void *arg TSRMLS_DC)
 {
        zend_llist_element *element;
 
        for (element=l->head; element; element=element->next) {
-               func(element->data, arg);
+               func(element->data, arg TSRMLS_CC);
        }
 }
 
 
-ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func, int num_args, ...)
+ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func TSRMLS_DC, int num_args, ...)
 {
        zend_llist_element *element;
        va_list args;
 
        va_start(args, num_args);
        for (element=l->head; element; element=element->next) {
-               func(element->data, num_args, args);
+               func(element->data, num_args, args TSRMLS_CC);
        }
        va_end(args);
 }
index 420c214e1a31a9eac847930dd7646f688f9ad03c..63bf6474839726fdac128cf6cca60bcbe24b869a 100644 (file)
@@ -31,9 +31,9 @@ typedef struct _zend_llist_element {
 
 typedef void (*llist_dtor_func_t)(void *);
 typedef int (*llist_compare_func_t)(const zend_llist_element *, const zend_llist_element *);
-typedef void (*llist_apply_with_arg_func_t)(void *data, void *arg);
-typedef void (*llist_apply_with_args_func_t)(void *data, int num_args, va_list args);
-typedef void (*llist_apply_func_t)(void *);
+typedef void (*llist_apply_with_args_func_t)(void *data, int num_args, va_list args TSRMLS_DC);
+typedef void (*llist_apply_with_arg_func_t)(void *data, void *arg TSRMLS_DC);
+typedef void (*llist_apply_func_t)(void * TSRMLS_DC);
 
 typedef struct _zend_llist {
        zend_llist_element *head;
@@ -55,10 +55,10 @@ ZEND_API void zend_llist_destroy(zend_llist *l);
 ZEND_API void zend_llist_clean(zend_llist *l);
 ZEND_API void zend_llist_remove_tail(zend_llist *l);
 ZEND_API void zend_llist_copy(zend_llist *dst, zend_llist *src);
-ZEND_API void zend_llist_apply(zend_llist *l, llist_apply_func_t);
+ZEND_API void zend_llist_apply(zend_llist *l, llist_apply_func_t func TSRMLS_DC);
 ZEND_API void zend_llist_apply_with_del(zend_llist *l, int (*func)(void *data));
-ZEND_API void zend_llist_apply_with_argument(zend_llist *l, llist_apply_with_arg_func_t, void *arg);
-ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func, int num_args, ...);
+ZEND_API void zend_llist_apply_with_argument(zend_llist *l, llist_apply_with_arg_func_t func, void *arg TSRMLS_DC);
+ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func TSRMLS_DC, int num_args, ...);
 ZEND_API int zend_llist_count(zend_llist *l);
 ZEND_API void zend_llist_sort(zend_llist *l, llist_compare_func_t comp_func);
 
index e2aa72ad9a0409e74854a763eb14fb92ebcaa7b4..24d40be25152f81942b61665ee4da43ba597cbe5 100644 (file)
@@ -77,8 +77,8 @@ struct _zend_module_entry {
 extern ZEND_API HashTable module_registry;
 
 void module_destructor(zend_module_entry *module);
-int module_registry_cleanup(zend_module_entry *module);
-int module_registry_request_startup(zend_module_entry *module);
+int module_registry_cleanup(zend_module_entry *module TSRMLS_DC);
+int module_registry_request_startup(zend_module_entry *module TSRMLS_DC);
 
 #define ZEND_MODULE_DTOR (void (*)(void *)) module_destructor
 #endif
index 29c6d86c065ac815cad5d412d1722e48bec06051..6462d3e4979298cf8016203353dab03609709aa6 100644 (file)
@@ -27,7 +27,7 @@
 #include "zend_API.h"
 
 
-static void zend_extension_op_array_ctor_handler(zend_extension *extension, zend_op_array *op_array)
+static void zend_extension_op_array_ctor_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
 {
        if (extension->op_array_ctor) {
                extension->op_array_ctor(op_array);
@@ -35,7 +35,7 @@ static void zend_extension_op_array_ctor_handler(zend_extension *extension, zend
 }
 
 
-static void zend_extension_op_array_dtor_handler(zend_extension *extension, zend_op_array *op_array)
+static void zend_extension_op_array_dtor_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
 {
        if (extension->op_array_dtor) {
                extension->op_array_dtor(op_array);
@@ -89,7 +89,7 @@ void init_op_array(zend_op_array *op_array, int type, int initial_ops_size TSRML
 
        op_array->start_op = NULL;
 
-       zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_op_array_ctor_handler, op_array);
+       zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_ctor_handler, op_array TSRMLS_CC);
 }
 
 
@@ -138,6 +138,7 @@ ZEND_API void destroy_op_array(zend_op_array *op_array)
 {
        zend_op *opline = op_array->opcodes;
        zend_op *end = op_array->opcodes+op_array->last;
+       TSRMLS_FETCH();
 
        if (op_array->static_variables) {
                zend_hash_destroy(op_array->static_variables);
@@ -176,7 +177,7 @@ ZEND_API void destroy_op_array(zend_op_array *op_array)
                efree(op_array->brk_cont_array);
        }
        if (op_array->done_pass_two) {
-               zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_op_array_dtor_handler, op_array);
+               zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_dtor_handler, op_array TSRMLS_CC);
        }
 }
 
@@ -256,7 +257,7 @@ static void zend_update_extended_info(zend_op_array *op_array TSRMLS_DC)
 
 
 
-static void zend_extension_op_array_handler(zend_extension *extension, zend_op_array *op_array)
+static void zend_extension_op_array_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
 {
        if (extension->op_array_handler) {
                extension->op_array_handler(op_array);
@@ -264,10 +265,9 @@ static void zend_extension_op_array_handler(zend_extension *extension, zend_op_a
 }
 
 
-int pass_two(zend_op_array *op_array)
+int pass_two(zend_op_array *op_array TSRMLS_DC)
 {
        zend_op *opline, *end;
-       TSRMLS_FETCH();
 
        if (op_array->type!=ZEND_USER_FUNCTION && op_array->type!=ZEND_EVAL_CODE) {
                return 0;
@@ -276,7 +276,7 @@ int pass_two(zend_op_array *op_array)
                zend_update_extended_info(op_array TSRMLS_CC);
        }
        if (CG(handle_op_arrays)) {
-               zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_op_array_handler, op_array);
+               zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_handler, op_array TSRMLS_CC);
        }
 
        opline = op_array->opcodes;
@@ -299,10 +299,10 @@ int pass_two(zend_op_array *op_array)
 }
 
 
-int print_class(zend_class_entry *class_entry)
+int print_class(zend_class_entry *class_entry TSRMLS_DC)
 {
        printf("Class %s:\n", class_entry->name);
-       zend_hash_apply(&class_entry->function_table, (apply_func_t) pass_two);
+       zend_hash_apply(&class_entry->function_table, (apply_func_t) pass_two TSRMLS_CC);
        printf("End of class %s.\n\n", class_entry->name);
        return 0;
 }
index f261381022c0dac25c98641ff066253c6e80ea97..990ad2933cb70c39a45e02c6b56962916517ff92 100644 (file)
@@ -65,7 +65,6 @@ long _crack_open_dict(char *dictpath TSRMLS_DC)
 {
        PWDICT *pwdict;
        long resource;
-       TSRMLS_FETCH();
 
        if (CRACKG(current_id) != -1) {
                zend_error(E_WARNING, "Can not use more than one open dictionary with this implementation of libcrack");
index 83b1760a7c1d647df111d628e5818cd7a81c8583..b20ee611380b98670be45366312e852c68f7e6cc 100644 (file)
@@ -466,12 +466,11 @@ static zval *php_xpathobject_new(xmlXPathObjectPtr obj, int *found) {
        return(wrapper);
 }
 
-void *php_xpath_get_context(zval *wrapper, int rsrc_type1, int rsrc_type2)
+void *php_xpath_get_context(zval *wrapper, int rsrc_type1, int rsrc_type2 TSRMLS_DC)
 {
        void *obj;
        zval **handle;
        int type;
-       TSRMLS_FETCH();
                                          
        if (Z_TYPE_P(wrapper) != IS_OBJECT) {
                php_error(E_ERROR, "Wrapper is not an object");
@@ -546,12 +545,11 @@ static zval *php_xpathcontext_new(xmlXPathContextPtr obj, int *found) {
        return(wrapper);
 }
 
-void *php_dom_get_object(zval *wrapper, int rsrc_type1, int rsrc_type2)
+void *php_dom_get_object(zval *wrapper, int rsrc_type1, int rsrc_type2 TSRMLS_DC)
 {
        void *obj;
        zval **handle;
        int type;
-       TSRMLS_FETCH();
                                  
        if (Z_TYPE_P(wrapper) != IS_OBJECT) {
                php_error(E_ERROR, "Wrapper is not an object");
@@ -878,7 +876,7 @@ PHP_FUNCTION(domxml_attr_name)
        xmlAttrPtr attrp;
        
        id = getThis();
-       attrp = php_dom_get_object(id, le_domxmlattrp, 0);
+       attrp = php_dom_get_object(id, le_domxmlattrp, 0 TSRMLS_CC);
                
        RETURN_STRING((char *) (attrp->name), 1);
 }
@@ -892,7 +890,7 @@ PHP_FUNCTION(domxml_attr_value)
        xmlAttrPtr attrp;
        
        id = getThis();
-       attrp = php_dom_get_object(id, le_domxmlattrp, 0);
+       attrp = php_dom_get_object(id, le_domxmlattrp, 0 TSRMLS_CC);
                
        RETURN_STRING((char *) xmlNodeGetContent((xmlNodePtr) attrp), 1);
 }
@@ -906,7 +904,7 @@ PHP_FUNCTION(domxml_attr_specified)
        xmlAttrPtr attrp;
        
        id = getThis();
-       attrp = php_dom_get_object(id, le_domxmlattrp, 0);
+       attrp = php_dom_get_object(id, le_domxmlattrp, 0 TSRMLS_CC);
                
        RETURN_TRUE;
 }
@@ -923,7 +921,7 @@ PHP_FUNCTION(domxml_pi_target)
        xmlNodePtr nodep;
        
        id = getThis();
-       nodep = php_dom_get_object(id, le_domxmlpip, 0);
+       nodep = php_dom_get_object(id, le_domxmlpip, 0 TSRMLS_CC);
 
        RETURN_STRING((char *)nodep->name, 1);
 }
@@ -937,7 +935,7 @@ PHP_FUNCTION(domxml_pi_data)
        xmlNodePtr nodep;
        
        id = getThis();
-       nodep = php_dom_get_object(id, le_domxmlpip, 0);
+       nodep = php_dom_get_object(id, le_domxmlpip, 0 TSRMLS_CC);
 
        RETURN_STRING(xmlNodeGetContent(nodep), 1);
 }
@@ -954,7 +952,7 @@ PHP_FUNCTION(domxml_cdata_length)
        xmlNodePtr nodep;
        
        id = getThis();
-       nodep = php_dom_get_object(id, le_domxmlcdatap, 0);
+       nodep = php_dom_get_object(id, le_domxmlcdatap, 0 TSRMLS_CC);
                
        RETURN_LONG(1);
 }
@@ -999,7 +997,7 @@ PHP_FUNCTION(domxml_node_name)
        const char *str = NULL;
        
        id = getThis();
-       n = php_dom_get_object(id, le_domxmlnodep, 0);
+       n = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
 
   switch (n->type)
     {
@@ -1044,7 +1042,7 @@ PHP_FUNCTION(domxml_node_value)
        char *str = NULL;
        
        id = getThis();
-       n = php_dom_get_object(id, le_domxmlnodep, 0);
+       n = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
 
        if (!n) {
                RETURN_FALSE;
@@ -1071,7 +1069,7 @@ PHP_FUNCTION(domxml_node_type)
        xmlNode *n;
        
        id = getThis();
-       n = php_dom_get_object(id, le_domxmlnodep, 0);
+       n = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
 
        if (!n) {
                RETURN_FALSE;
@@ -1089,7 +1087,7 @@ PHP_FUNCTION(domxml_node_first_child)
        int ret;
        
        id = getThis();
-       nodep = php_dom_get_object(id, le_domxmlnodep, 0);
+       nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
 
        first = nodep->children;
        if (!first) {
@@ -1112,7 +1110,7 @@ PHP_FUNCTION(domxml_node_last_child)
        int ret;
        
        id = getThis();
-       nodep = php_dom_get_object(id, le_domxmlnodep, 0);
+       nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
 
        last = nodep->last;
        if (!last) {
@@ -1135,7 +1133,7 @@ PHP_FUNCTION(domxml_node_next_sibling)
        int ret;
        
        id = getThis();
-       if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0)))
+       if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC)))
                RETURN_FALSE;
 
        first = nodep->next;
@@ -1159,7 +1157,7 @@ PHP_FUNCTION(domxml_node_previous_sibling)
        int ret;
        
        id = getThis();
-       if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0)))
+       if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC)))
                RETURN_FALSE;
 
        first = nodep->prev;
@@ -1184,7 +1182,7 @@ PHP_FUNCTION(domxml_node_owner_document)
        int ret;
        
        id = getThis();
-       if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0)))
+       if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC)))
                RETURN_FALSE;
 
        docp = nodep->doc;
@@ -1207,7 +1205,7 @@ PHP_FUNCTION(domxml_node_has_child_nodes)
        xmlNode *nodep;
        
        id = getThis();
-       if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0)))
+       if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC)))
                RETURN_FALSE;
 
        if (nodep->children) {
@@ -1226,7 +1224,7 @@ PHP_FUNCTION(domxml_node_has_attributes)
        xmlNode *nodep;
        
        id = getThis();
-       if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0)))
+       if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC)))
                RETURN_FALSE;
 
        if(nodep->type != XML_ELEMENT_NODE)
@@ -1249,7 +1247,7 @@ PHP_FUNCTION(domxml_node_prefix)
        xmlNsPtr        ns;
        
        id = getThis();
-       if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0)))
+       if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC)))
                RETURN_FALSE;
 
        ns = nodep->ns;
@@ -1274,7 +1272,7 @@ PHP_FUNCTION(domxml_node_parent)
        int ret;
        
        id = getThis();
-       nodep = php_dom_get_object(id, le_domxmlnodep, 0);
+       nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
 
        last = nodep->parent;
        if (!last) {
@@ -1296,7 +1294,7 @@ PHP_FUNCTION(domxml_node_children)
        int ret;
        
        id = getThis();
-       nodep = php_dom_get_object(id, le_domxmlnodep, le_domxmldocp);
+       nodep = php_dom_get_object(id, le_domxmlnodep, le_domxmldocp TSRMLS_CC);
 
        /* Even if the nodep is a XML_DOCUMENT_NODE the type is at the
           same position.
@@ -1330,7 +1328,7 @@ PHP_FUNCTION(domxml_node_unlink_node)
        xmlNode *nodep;
        
        id = getThis();
-       nodep = php_dom_get_object(id, le_domxmlnodep, 0);
+       nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
 
        xmlUnlinkNode(nodep);
        xmlFreeNode(nodep);
@@ -1351,8 +1349,8 @@ PHP_FUNCTION(domxml_node_add_child)
                WRONG_PARAM_COUNT;
        }
        id = getThis();
-       nodep = php_dom_get_object(id, le_domxmlnodep, 0);
-       child = php_dom_get_object(node, le_domxmlnodep, 0);
+       nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
+       child = php_dom_get_object(node, le_domxmlnodep, 0 TSRMLS_CC);
 
        if (!child || !nodep) {
                RETURN_FALSE;
@@ -1378,8 +1376,8 @@ PHP_FUNCTION(domxml_node_append_child)
                WRONG_PARAM_COUNT;
        }
        id = getThis();
-       nodep = php_dom_get_object(id, le_domxmlnodep, 0);
-       child = php_dom_get_object(node, le_domxmlnodep, 0);
+       nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
+       child = php_dom_get_object(node, le_domxmlnodep, 0 TSRMLS_CC);
 
        if (!child || !nodep) {
                RETURN_FALSE;
@@ -1405,9 +1403,9 @@ PHP_FUNCTION(domxml_node_insert_before)
                WRONG_PARAM_COUNT;
        }
        id = getThis();
-       nodep = php_dom_get_object(id, le_domxmlnodep, 0);
-       child = php_dom_get_object(node, le_domxmlnodep, 0);
-       refp = php_dom_get_object(ref, le_domxmlnodep, 0);
+       nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
+       child = php_dom_get_object(node, le_domxmlnodep, 0 TSRMLS_CC);
+       refp = php_dom_get_object(ref, le_domxmlnodep, 0 TSRMLS_CC);
 
        if (!child || !nodep || !refp) {
                RETURN_FALSE;
@@ -1433,7 +1431,7 @@ PHP_FUNCTION(domxml_node_set_name)
        }
 
        id = getThis();
-       nodep = php_dom_get_object(id, le_domxmlnodep, 0);
+       nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
        convert_to_string(name);
 
        if(name->value.str.len)
@@ -1454,7 +1452,7 @@ PHP_FUNCTION(domxml_node_attributes)
 #endif
        
        id = getThis();
-       nodep = php_dom_get_object(id, le_domxmlnodep, 0);
+       nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
 
        if(node_attributes(&attrs, nodep) < 0)
                RETURN_FALSE;
@@ -1492,7 +1490,7 @@ PHP_FUNCTION(domxml_node_new_child)
                WRONG_PARAM_COUNT;
        }
        id = getThis();
-       nodep = php_dom_get_object(id, le_domxmlnodep, 0);
+       nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
 
        convert_to_string(name);
        convert_to_string(content);
@@ -1523,7 +1521,7 @@ PHP_FUNCTION(domxml_node_set_content)
        }
 
        id = getThis();
-       nodep = php_dom_get_object(id, le_domxmlnodep, 0);
+       nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
        convert_to_string(content);
 
        if(content->value.str.len)
@@ -1548,7 +1546,7 @@ PHP_FUNCTION(domxml_notation_public_id)
        xmlNotationPtr nodep;
        
        id = getThis();
-       nodep = (xmlNotationPtr) php_dom_get_object(id, le_domxmlnotationp, 0);
+       nodep = (xmlNotationPtr) php_dom_get_object(id, le_domxmlnotationp, 0 TSRMLS_CC);
 
        RETURN_STRING((char *) (nodep->PublicID), 1);
 }
@@ -1562,7 +1560,7 @@ PHP_FUNCTION(domxml_notation_system_id)
        xmlNotationPtr nodep;
        
        id = getThis();
-       nodep = (xmlNotationPtr) php_dom_get_object(id, le_domxmlnotationp, 0);
+       nodep = (xmlNotationPtr) php_dom_get_object(id, le_domxmlnotationp, 0 TSRMLS_CC);
 
        RETURN_STRING((char *) (nodep->SystemID), 1);
 }
@@ -1604,7 +1602,7 @@ PHP_FUNCTION(domxml_elem_tagname)
        xmlNode *nodep;
        
        id = getThis();
-       nodep = php_dom_get_object(id, le_domxmlelementp, 0);
+       nodep = php_dom_get_object(id, le_domxmlelementp, 0 TSRMLS_CC);
 
        RETURN_STRING((char *) (nodep->name), 1);
 }
@@ -1620,7 +1618,7 @@ PHP_FUNCTION(domxml_elem_get_attribute)
        
        if ((ZEND_NUM_ARGS() == 1) && getParameters(ht, 1, &arg1) == SUCCESS) {
                id = getThis();
-               nodep = php_dom_get_object(id, le_domxmlelementp, 0);
+               nodep = php_dom_get_object(id, le_domxmlelementp, 0 TSRMLS_CC);
        } else {
                WRONG_PARAM_COUNT;
        }
@@ -1647,7 +1645,7 @@ PHP_FUNCTION(domxml_elem_set_attribute)
 
        if ((ZEND_NUM_ARGS() == 2) && getParameters(ht, 2, &arg1, &arg2) == SUCCESS) {
                id = getThis();
-               nodep = php_dom_get_object(id, le_domxmlelementp, 0);
+               nodep = php_dom_get_object(id, le_domxmlelementp, 0 TSRMLS_CC);
        } else {
                WRONG_PARAM_COUNT;
        }
@@ -1676,7 +1674,7 @@ PHP_FUNCTION(domxml_elem_remove_attribute)
        
        if ((ZEND_NUM_ARGS() == 1) && getParameters(ht, 1, &arg1) == SUCCESS) {
                id = getThis();
-               nodep = php_dom_get_object(id, le_domxmlelementp, 0);
+               nodep = php_dom_get_object(id, le_domxmlelementp, 0 TSRMLS_CC);
        } else {
                WRONG_PARAM_COUNT;
        }
@@ -1697,7 +1695,7 @@ PHP_FUNCTION(domxml_elem_get_attribute_node)
        
        if ((ZEND_NUM_ARGS() == 1) && getParameters(ht, 1, &arg1) == SUCCESS) {
                id = getThis();
-               nodep = php_dom_get_object(id, le_domxmlelementp, 0);
+               nodep = php_dom_get_object(id, le_domxmlelementp, 0 TSRMLS_CC);
        } else {
                WRONG_PARAM_COUNT;
        }
@@ -1720,8 +1718,8 @@ PHP_FUNCTION(domxml_elem_set_attribute_node)
 
        if ((ZEND_NUM_ARGS() == 1) && getParameters(ht, 1, &arg1) == SUCCESS) {
                id = getThis();
-               nodep = php_dom_get_object(id, le_domxmlelementp, 0);
-               attrp = php_dom_get_object(arg1, le_domxmlattrp, 0);
+               nodep = php_dom_get_object(id, le_domxmlelementp, 0 TSRMLS_CC);
+               attrp = php_dom_get_object(arg1, le_domxmlattrp, 0 TSRMLS_CC);
        } else {
                WRONG_PARAM_COUNT;
        }
@@ -1741,7 +1739,7 @@ PHP_FUNCTION(domxml_elem_get_element_by_tagname)
        
        if ((ZEND_NUM_ARGS() == 1) && getParameters(ht, 1, &arg1) == SUCCESS) {
                id = getThis();
-               nodep = php_dom_get_object(id, le_domxmlelementp, 0);
+               nodep = php_dom_get_object(id, le_domxmlelementp, 0 TSRMLS_CC);
        } else {
                WRONG_PARAM_COUNT;
        }
@@ -1764,7 +1762,7 @@ PHP_FUNCTION(domxml_doctype_name)
        xmlNodePtr attrp;
        
        id = getThis();
-       attrp = php_dom_get_object(id, le_domxmldoctypep, 0);
+       attrp = php_dom_get_object(id, le_domxmldoctypep, 0 TSRMLS_CC);
                
        RETURN_STRING((char *) (attrp->name), 1);
 }
@@ -1784,7 +1782,7 @@ PHP_FUNCTION(domxml_doc_doctype)
        int ret;
        
        id = getThis();
-       if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0))) {
+       if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC))) {
                RETURN_FALSE;
        }
 
@@ -1804,7 +1802,7 @@ PHP_FUNCTION(domxml_doc_implementation)
        xmlDocPtr docp;
        
        id = getThis();
-       if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0))) {
+       if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC))) {
                RETURN_FALSE;
        }
 
@@ -1832,7 +1830,7 @@ PHP_FUNCTION(domxml_doc_document_element)
                }
        }
 
-       docp = php_dom_get_object(id, le_domxmldocp, 0);
+       docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC);
 
        node = docp->children;
        if (!node) {
@@ -1863,7 +1861,7 @@ PHP_FUNCTION(domxml_doc_create_element)
        int ret;
        
        id = getThis();
-       if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0))) {
+       if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC))) {
                RETURN_FALSE;
        }
 
@@ -1895,7 +1893,7 @@ PHP_FUNCTION(domxml_doc_create_text_node)
        int ret;
        
        id = getThis();
-       if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0))) {
+       if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC))) {
                RETURN_FALSE;
        }
 
@@ -1927,7 +1925,7 @@ PHP_FUNCTION(domxml_doc_create_comment)
        int ret;
        
        id = getThis();
-       if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0))) {
+       if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC))) {
                RETURN_FALSE;
        }
 
@@ -1959,7 +1957,7 @@ PHP_FUNCTION(domxml_doc_create_attribute)
        int ret;
        
        id = getThis();
-       if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0))) {
+       if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC))) {
                RETURN_FALSE;
        }
 
@@ -1992,7 +1990,7 @@ PHP_FUNCTION(domxml_doc_create_processing_instruction)
        int ret;
        
        id = getThis();
-       if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0))) {
+       if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC))) {
                RETURN_FALSE;
        }
 
@@ -2025,14 +2023,14 @@ PHP_FUNCTION(domxml_doc_imported_node)
        int ret;
        
        id = getThis();
-       if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0))) {
+       if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC))) {
                RETURN_FALSE;
        }
 
        if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) {
                WRONG_PARAM_COUNT;
        }
-       srcnode =  php_dom_get_object(arg1, le_domxmlnodep, 0);
+       srcnode =  php_dom_get_object(arg1, le_domxmlnodep, 0 TSRMLS_CC);
        if(!srcnode)
                RETURN_FALSE;
 
@@ -2061,7 +2059,7 @@ PHP_FUNCTION(domxml_intdtd)
        int ret;
        
        id = getThis();
-       docp = php_dom_get_object(id, le_domxmldocp, 0);
+       docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC);
 
        dtd = xmlGetIntSubset(docp);
        if (!dtd) {
@@ -2084,7 +2082,7 @@ PHP_FUNCTION(domxml_dumpmem)
        int size;
        
        id = getThis();
-       if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0))) {
+       if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC))) {
                RETURN_FALSE;
        }
 
@@ -2182,7 +2180,7 @@ PHP_FUNCTION(domxml_node_text_concat)
        }
 
        id = getThis();
-       nodep = php_dom_get_object(id, le_domxmlnodep, 0);
+       nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
        convert_to_string(content);
 
        if(content->value.str.len)
@@ -2206,7 +2204,7 @@ PHP_FUNCTION(domxml_add_root)
        }
 
        id = getThis();
-       docp = php_dom_get_object(id, le_domxmldocp, 0);
+       docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC);
        convert_to_string(name);
 
        nodep = xmlNewDocNode(docp, NULL, name->value.str.val, NULL);
@@ -2433,7 +2431,7 @@ static void php_xpathptr_new_context(INTERNAL_FUNCTION_PARAMETERS, int mode)
        int ret;
        
        id = getThis();
-       docp = php_dom_get_object(id, le_domxmldocp, 0);
+       docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC);
                
 #if defined(LIBXML_XPTR_ENABLED)
        if(mode == PHP_XPTR)
@@ -2477,7 +2475,7 @@ static void php_xpathptr_eval(INTERNAL_FUNCTION_PARAMETERS, int mode, int expr)
        }
 
        id = getThis();
-       ctxp = php_xpath_get_context(id, le_xpathctxp, 0);
+       ctxp = php_xpath_get_context(id, le_xpathctxp, 0 TSRMLS_CC);
        convert_to_string(str);
 
 #if defined(LIBXML_XPTR_ENABLED)
index 0407150e994319d19811f3b3550367e8521320ed..938491bdf4c154ba71ee3edd468656f0c5d46df4 100644 (file)
@@ -184,10 +184,8 @@ void php_DOTNET_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_propert
        }
 }
 
-void php_register_DOTNET_class(void)
+void php_register_DOTNET_class(TSRMLS_D)
 {
-       TSRMLS_FETCH();
-
        INIT_OVERLOADED_CLASS_ENTRY(dotnet_class_entry, "DOTNET", NULL,
                                                                php_DOTNET_call_function_handler,
                                                                php_COM_get_property_handler,
@@ -210,11 +208,14 @@ static PHP_MINFO_FUNCTION(DOTNET)
 PHP_MINIT_FUNCTION(DOTNET)
 {
        HRESULT hr;
+
        CoInitialize(0);
        hr = dotnet_init();
-       if (FAILED(hr)) return hr;
+       if (FAILED(hr)) {
+               return hr;
+       }
 
-       php_register_DOTNET_class();
+       php_register_DOTNET_class(TSRMLS_C);
        return SUCCESS;
 }
 
index 8fed3d3f4b248f6f454de099494646d6607db06a..a5da77e67b5347025d782a35aa12abe7d0b3bcf8 100644 (file)
@@ -725,7 +725,6 @@ SAPI_POST_HANDLER_FUNC(fdf_post_handler)
        FDFErc err;
        ASInt32 nBytes;
        zval *array_ptr = (zval *) arg;
-       TSRMLS_FETCH();
        
        fp=php_open_temporary_file(NULL,"fdfdata.",&filename);
        if(!fp) {
index 4c97b9fb7f1cbf73f2d53f51d4375c735720f7e2..fb69c1bf4738ce3cc80061dbb99421c220833766 100644 (file)
@@ -925,8 +925,6 @@ php_mbstr_encoding_handler(zval *arg, char *res, char *separator)
 #if !defined(COMPILE_DL_MBSTRING)
 SAPI_POST_HANDLER_FUNC(php_mbstr_post_handler)
 {
-       TSRMLS_FETCH();
-
        MBSTRG(http_input_identify_post) = mbfl_no_encoding_invalid;
 
        php_mbstr_encoding_handler(arg, SG(request_info).post_data, "&");
index 2371a942169e75f7a1151037515b9cb0d368dce0..1afc79bf53030cf64075433a206c272cd74bcbc0 100644 (file)
@@ -157,10 +157,8 @@ static int php_mssql_message_handler(DBPROCESS *dbproc, DBINT msgno,int msgstate
        return 0;
 }
 
-static int _clean_invalid_results(list_entry *le)
+static int _clean_invalid_results(list_entry *le TSRMLS_DC)
 {
-       TSRMLS_FETCH();
-
        if (le->type == le_result) {
                mssql_link *mssql_ptr = ((mssql_result *) le->ptr)->mssql_ptr;
                
@@ -230,7 +228,7 @@ static void _close_mssql_link(zend_rsrc_list_entry *rsrc)
        TSRMLS_FETCH();
 
        mssql_ptr->valid = 0;
-       zend_hash_apply(&EG(regular_list),(apply_func_t) _clean_invalid_results);
+       zend_hash_apply(&EG(regular_list),(apply_func_t) _clean_invalid_results TSRMLS_CC);
        dbclose(mssql_ptr->link);
        dbfreelogin(mssql_ptr->login);
        efree(mssql_ptr);
index 4e0beb59993d7ed63f4768d9ef053527210cf649..f84e2f01534c1b1827c631e6fdc7c25cc04e8ac2 100644 (file)
@@ -519,14 +519,14 @@ PHP_RINIT_FUNCTION(oci)
     return SUCCESS;
 }
 
-static int _session_pcleanup(oci_session *session)
+static int _session_pcleanup(oci_session *session TSRMLS_DC)
 {
        _oci_close_session(session);
 
        return 1;
 }
 
-static int _server_pcleanup(oci_server *server)
+static int _server_pcleanup(oci_server *server TSRMLS_DC)
 {
        _oci_close_server(server);
 
@@ -539,8 +539,8 @@ PHP_MSHUTDOWN_FUNCTION(oci)
 
     oci_debug("START php_mshutdown_oci");
 
-       zend_hash_apply(OCI(user), (apply_func_t)_session_pcleanup);
-       zend_hash_apply(OCI(server), (apply_func_t)_server_pcleanup);
+       zend_hash_apply(OCI(user), (apply_func_t)_session_pcleanup TSRMLS_CC);
+       zend_hash_apply(OCI(server), (apply_func_t)_server_pcleanup TSRMLS_CC);
 
        zend_hash_destroy(OCI(user));
        zend_hash_destroy(OCI(server));
@@ -562,8 +562,8 @@ PHP_RSHUTDOWN_FUNCTION(oci)
 #if 0
        /* XXX free all statements, rollback all outstanding transactions */
 
-       zend_hash_apply(OCI(user), (apply_func_t) _session_cleanup);
-       zend_hash_apply(OCI(server), (apply_func_t) _server_cleanup);
+       zend_hash_apply(OCI(user), (apply_func_t) _session_cleanup TSRMLS_CC);
+       zend_hash_apply(OCI(server), (apply_func_t) _server_cleanup TSRMLS_CC);
 #endif
 
     oci_debug("END   php_rshutdown_oci");
@@ -622,7 +622,7 @@ _oci_bind_hash_dtor(void *data)
 /* {{{ _oci_bind_pre_exec() */
 
 static int
-_oci_bind_pre_exec(void *data)
+_oci_bind_pre_exec(void *data TSRMLS_DC)
 {
        oci_bind *bind = (oci_bind *) data;
 
@@ -637,7 +637,7 @@ _oci_bind_pre_exec(void *data)
 /* {{{ _oci_bind_post_exec() */
 
 static int
-_oci_bind_post_exec(void *data)
+_oci_bind_post_exec(void *data TSRMLS_DC)
 {
        oci_bind *bind = (oci_bind *) data;
 
@@ -1319,6 +1319,7 @@ oci_execute(oci_statement *statement, char *func,ub4 mode)
        int dtype;
        dvoid *buf;
        oci_descriptor *descr;
+       TSRMLS_FETCH();
 
        statement->error = 
                oci_error(statement->pError,
@@ -1346,7 +1347,7 @@ oci_execute(oci_statement *statement, char *func,ub4 mode)
                   we don't want to execute!!! */
 
                if (statement->binds) {
-                       zend_hash_apply(statement->binds, (apply_func_t) _oci_bind_pre_exec);
+                       zend_hash_apply(statement->binds, (apply_func_t) _oci_bind_pre_exec TSRMLS_CC);
                }
 
                statement->error = 
@@ -1361,7 +1362,7 @@ oci_execute(oci_statement *statement, char *func,ub4 mode)
                                                                         NULL,
                                                                         mode));
                if (statement->binds) {
-                       zend_hash_apply(statement->binds, (apply_func_t) _oci_bind_post_exec);
+                       zend_hash_apply(statement->binds, (apply_func_t) _oci_bind_post_exec TSRMLS_CC);
                }
 
                oci_handle_error(statement->conn, statement->error);
@@ -1612,7 +1613,7 @@ oci_execute(oci_statement *statement, char *func,ub4 mode)
 /* {{{ oci_fetch() */
 
 static int
-_oci_column_pre_fetch(void *data)
+_oci_column_pre_fetch(void *data TSRMLS_DC)
 {
        oci_out_column *col = (oci_out_column *) data;
        
@@ -1631,7 +1632,7 @@ oci_fetch(oci_statement *statement, ub4 nrows, char *func)
        oci_out_column *column;
 
        if (statement->columns) {
-               zend_hash_apply(statement->columns, (apply_func_t) _oci_column_pre_fetch);
+               zend_hash_apply(statement->columns, (apply_func_t) _oci_column_pre_fetch TSRMLS_CC);
        }
 
        statement->error =
@@ -2338,7 +2339,7 @@ static oci_server *_oci_open_server(char *dbname,int persistent)
 /* {{{ _oci_close_server()
  */
 
-static int _oci_session_cleanup(void *data)
+static int _oci_session_cleanup(void *data TSRMLS_DC)
 {
        list_entry *le = (list_entry *) data;
        if (le->type == le_session) {
@@ -2356,12 +2357,11 @@ _oci_close_server(oci_server *server)
        char *dbname;
        int oldopen;
        TSRMLS_FETCH();
-       TSRMLS_FETCH();
 
        oldopen = server->is_open;
        server->is_open = 2;
        if (! OCI(shutdown)) {
-               zend_hash_apply(&EG(regular_list), _oci_session_cleanup);
+               zend_hash_apply(&EG(regular_list), (apply_func_t) _oci_session_cleanup TSRMLS_CC);
        }
        server->is_open = oldopen;
 
@@ -3917,7 +3917,7 @@ PHP_FUNCTION(ocilogoff)
 
        connection->is_open = 0;
 
-       zend_hash_apply(list, (apply_func_t) _stmt_cleanup);
+       zend_hash_apply(list, (apply_func_t) _stmt_cleanup TSRMLS_CC);
 
        if (zend_list_delete(connection->id) == SUCCESS) {
                RETURN_TRUE;
index 390b0eff6007d3c084ee19254008d3bf0cd53403..82c2af0569f6859210b185e43b4904091b039c2a 100644 (file)
@@ -644,9 +644,8 @@ void odbc_transact(INTERNAL_FUNCTION_PARAMETERS, int type)
        RETURN_TRUE;
 }
 
-static int _close_pconn_with_id(list_entry *le, int *id)
+static int _close_pconn_with_id(list_entry *le, int *id TSRMLS_DC)
 {
-
        if(le->type == le_pconn && (((odbc_connection *)(le->ptr))->id == *id)){
                return 1;
        }else{
@@ -733,7 +732,7 @@ PHP_FUNCTION(odbc_close_all)
                                zend_list_delete(i);
                                /* Delete the persistent connection */
                                zend_hash_apply_with_argument(&EG(persistent_list), 
-                                       (int (*)(void *, void *)) _close_pconn_with_id, (void *) &i);
+                                       (apply_func_arg_t) _close_pconn_with_id, (void *) &i TSRMLS_CC);
                        }
                }
        }
@@ -2222,7 +2221,7 @@ PHP_FUNCTION(odbc_close)
        
        if(is_pconn){
                zend_hash_apply_with_argument(&EG(persistent_list),
-                       (int (*)(void *, void *)) _close_pconn_with_id, (void *) &((*pv_conn)->value.lval));    
+                       (apply_func_arg_t) _close_pconn_with_id, (void *) &((*pv_conn)->value.lval) TSRMLS_CC); 
        }
 }
 /* }}} */
index ef16d1f7e46f7184777f9a649d6a44733d215e3f..bbd5cfdf06aa5c2478a0c1b8ddf73167371cfc98 100644 (file)
@@ -187,10 +187,9 @@ _notice_handler(void *arg, const char *message)
 
 /* {{{ _rollback_transactions
  */
-static int _rollback_transactions(zend_rsrc_list_entry *rsrc)
+static int _rollback_transactions(zend_rsrc_list_entry *rsrc TSRMLS_DC)
 {
        PGconn *link;
-       TSRMLS_FETCH();
 
        if (rsrc->type != le_plink) 
                return 0;
@@ -293,7 +292,7 @@ PHP_RINIT_FUNCTION(pgsql)
  */
 PHP_RSHUTDOWN_FUNCTION(pgsql)
 {
-       zend_hash_apply(&EG(persistent_list), (apply_func_t) _rollback_transactions);
+       zend_hash_apply(&EG(persistent_list), (apply_func_t) _rollback_transactions TSRMLS_CC);
        return SUCCESS;
 }
 /* }}} */
index 0407150e994319d19811f3b3550367e8521320ed..938491bdf4c154ba71ee3edd468656f0c5d46df4 100644 (file)
@@ -184,10 +184,8 @@ void php_DOTNET_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_propert
        }
 }
 
-void php_register_DOTNET_class(void)
+void php_register_DOTNET_class(TSRMLS_D)
 {
-       TSRMLS_FETCH();
-
        INIT_OVERLOADED_CLASS_ENTRY(dotnet_class_entry, "DOTNET", NULL,
                                                                php_DOTNET_call_function_handler,
                                                                php_COM_get_property_handler,
@@ -210,11 +208,14 @@ static PHP_MINFO_FUNCTION(DOTNET)
 PHP_MINIT_FUNCTION(DOTNET)
 {
        HRESULT hr;
+
        CoInitialize(0);
        hr = dotnet_init();
-       if (FAILED(hr)) return hr;
+       if (FAILED(hr)) {
+               return hr;
+       }
 
-       php_register_DOTNET_class();
+       php_register_DOTNET_class(TSRMLS_C);
        return SUCCESS;
 }
 
index e2ef244d47cd5563b678ee41a32eab0c4c12944c..22e0e1bffbda4571de55bb94579f74d03d3d3077 100644 (file)
@@ -1801,10 +1801,9 @@ void user_tick_function_dtor(user_tick_function_entry *tick_function_entry)
        efree(tick_function_entry->arguments);
 }
 
-static int user_shutdown_function_call(php_shutdown_function_entry *shutdown_function_entry)
+static int user_shutdown_function_call(php_shutdown_function_entry *shutdown_function_entry TSRMLS_DC)
 {
        zval retval;
-       TSRMLS_FETCH();
 
        if (call_user_function(EG(function_table), NULL, shutdown_function_entry->arguments[0], &retval, shutdown_function_entry->arg_count-1, shutdown_function_entry->arguments+1 TSRMLS_CC)==SUCCESS) {
                zval_dtor(&retval);
@@ -1815,11 +1814,10 @@ static int user_shutdown_function_call(php_shutdown_function_entry *shutdown_fun
        return 0;
 }
 
-static void user_tick_function_call(user_tick_function_entry *tick_fe)
+static void user_tick_function_call(user_tick_function_entry *tick_fe TSRMLS_DC)
 {
        zval retval;
        zval *function = tick_fe->arguments[0];
-       TSRMLS_FETCH();
 
        if (call_user_function(EG(function_table), NULL, function, &retval,
                                                   tick_fe->arg_count - 1, tick_fe->arguments+1 TSRMLS_CC) == SUCCESS) {
@@ -1846,7 +1844,7 @@ static void run_user_tick_functions(int tick_count)
 {
        TSRMLS_FETCH();
 
-       zend_llist_apply(BG(user_tick_functions), (llist_apply_func_t)user_tick_function_call);
+       zend_llist_apply(BG(user_tick_functions), (llist_apply_func_t) user_tick_function_call TSRMLS_CC);
 }
 
 static int user_tick_function_compare(user_tick_function_entry *tick_fe1,
@@ -1871,7 +1869,7 @@ void php_call_shutdown_functions(void)
        TSRMLS_FETCH();
 
        if (BG(user_shutdown_function_names)) zend_try {
-               zend_hash_apply(BG(user_shutdown_function_names), (apply_func_t) user_shutdown_function_call);
+               zend_hash_apply(BG(user_shutdown_function_names), (apply_func_t) user_shutdown_function_call TSRMLS_CC);
                memcpy(&EG(bailout), &orig_bailout, sizeof(jmp_buf));
                zend_hash_destroy(BG(user_shutdown_function_names));
                efree(BG(user_shutdown_function_names));
index 84689d1733b1bad783a45dd3570f3b643831f4ad..01a70db73d9f7cacf54954d126bafb16460a6f1f 100644 (file)
@@ -39,10 +39,9 @@ PHPAPI extern char *php_ini_opened_path;
 
 /* {{{ _display_module_info
  */
-static int _display_module_info(zend_module_entry *module, void *arg)
+static int _display_module_info(zend_module_entry *module, void *arg TSRMLS_DC)
 {
        int show_info_func = *((int *) arg);
-       TSRMLS_FETCH();
 
        if (show_info_func && module->info_func) {
                php_printf("<h2 align=\"center\"><a name=\"module_%s\">%s</a></h2>\n", module->name, module->name);
@@ -256,12 +255,12 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
                int show_info_func;
 
                show_info_func = 1;
-               zend_hash_apply_with_argument(&module_registry, (int (*)(void *, void *)) _display_module_info, &show_info_func);
+               zend_hash_apply_with_argument(&module_registry, (apply_func_arg_t) _display_module_info, &show_info_func TSRMLS_CC);
 
                SECTION("Additional Modules");
                php_info_print_table_start();
                show_info_func = 0;
-               zend_hash_apply_with_argument(&module_registry, (int (*)(void *, void *)) _display_module_info, &show_info_func);
+               zend_hash_apply_with_argument(&module_registry, (apply_func_arg_t) _display_module_info, &show_info_func TSRMLS_CC);
                php_info_print_table_end();
        }
 
index 72c357ce232908d99302230527c49086cf945193..7fc514a883e7c60989c0e76769bab8fea43bac63 100644 (file)
@@ -125,7 +125,7 @@ static int php_sybase_message_handler(DBPROCESS *dbproc,DBINT msgno,int msgstate
 }
 
 
-static int _clean_invalid_results(list_entry *le)
+static int _clean_invalid_results(list_entry *le TSRMLS_DC)
 {
        if (le->type == php_sybase_module.le_result) {
                sybase_link *sybase_ptr = ((sybase_result *) le->ptr)->sybase_ptr;
@@ -177,7 +177,7 @@ static void _close_sybase_link(zend_rsrc_list_entry *rsrc)
       will *not* be in a consistent state. thies@thieso.net
     */
 
-       zend_hash_apply(&EG(regular_list), (apply_func_t) _clean_invalid_results);
+       zend_hash_apply(&EG(regular_list), (apply_func_t) _clean_invalid_results TSRMLS_CC);
        dbclose(sybase_ptr->link);
        dbloginfree(sybase_ptr->login);
        efree(sybase_ptr);
index f9e02110fcab8818e9a2a61e1872d485585c7f1b..dfb04f36c1d26f9e4c9d4f1518e236ab566332cf 100644 (file)
@@ -95,10 +95,8 @@ ZEND_DECLARE_MODULE_GLOBALS(sybase)
 #define CHECK_LINK(link) { if (link==-1) { php_error(E_WARNING, "Sybase:  A link to the server could not be established"); RETURN_FALSE; } }
 
 
-static int _clean_invalid_results(list_entry *le)
+static int _clean_invalid_results(list_entry *le TSRMLS_DC)
 {
-       TSRMLS_FETCH();
-
        if (le->type == le_result) {
                sybase_link *sybase_ptr = ((sybase_result *) le->ptr)->sybase_ptr;
                
@@ -149,7 +147,7 @@ static void _close_sybase_link(zend_rsrc_list_entry *rsrc)
 
        sybase_ptr->valid = 0;
 
-       zend_hash_apply(&EG(regular_list), (apply_func_t) _clean_invalid_results);
+       zend_hash_apply(&EG(regular_list), (apply_func_t) _clean_invalid_results TSRMLS_CC);
 
        /* Non-persistent connections will always be connected or we wouldn't
         * get here, but since we want to check the death status anyway
index 618f16f14022554f9396f2be89a16144977ebe0b..08fa6afcc59807d90f2c81d6588ab37b313cd8a5 100644 (file)
@@ -496,17 +496,17 @@ SAPI_API int sapi_send_headers()
 
                                http_status_line.header = SG(sapi_headers).http_status_line;
                                http_status_line.header_len = strlen(SG(sapi_headers).http_status_line);
-                               sapi_module.send_header(&http_status_line, SG(server_context));
+                               sapi_module.send_header(&http_status_line, SG(server_context) TSRMLS_CC);
                        }
-                       zend_llist_apply_with_argument(&SG(sapi_headers).headers, (void (*)(void *, void *)) sapi_module.send_header, SG(server_context));
+                       zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) sapi_module.send_header, SG(server_context) TSRMLS_CC);
                        if(SG(sapi_headers).send_default_content_type) {
                                sapi_header_struct default_header;
 
                                sapi_get_default_content_type_header(&default_header TSRMLS_CC);
-                               sapi_module.send_header(&default_header, SG(server_context));
+                               sapi_module.send_header(&default_header, SG(server_context) TSRMLS_CC);
                                sapi_free_header(&default_header);
                        }
-                       sapi_module.send_header(NULL, SG(server_context));
+                       sapi_module.send_header(NULL, SG(server_context) TSRMLS_CC);
                        ret = SUCCESS;
                        break;
                case SAPI_HEADER_SEND_FAILED:
index 85dd8a207929beef7d9df28cb15fcae7e31e39a5..95015a7f81cabbc8b1b4bb169350819e0dbe343f 100644 (file)
@@ -169,7 +169,7 @@ struct _sapi_module_struct {
 
        int (*header_handler)(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC);
        int (*send_headers)(sapi_headers_struct *sapi_headers TSRMLS_DC);
-       void (*send_header)(sapi_header_struct *sapi_header, void *server_context);
+       void (*send_header)(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC);
 
        int (*read_post)(char *buffer, uint count_bytes TSRMLS_DC);
        char *(*read_cookies)(TSRMLS_D);
index bfe8b67d0ca8a46d9c0ef2dc90e41000bc33ded2..8e9c1c0dc23b56a53af2992c978388c0582318c6 100644 (file)
@@ -128,7 +128,7 @@ static PHP_INI_MH(OnUpdateErrorReporting)
 
 /* {{{ php_disable_functions
  */
-static void php_disable_functions()
+static void php_disable_functions(TSRMLS_D)
 {
        char *func;
        char *new_value_dup = strdup(INI_STR("disable_functions"));     /* This is an intentional leak,
@@ -137,7 +137,7 @@ static void php_disable_functions()
 
        func = strtok(new_value_dup, ", ");
        while (func) {
-               zend_disable_function(func, strlen(func));
+               zend_disable_function(func, strlen(func) TSRMLS_CC);
                func = strtok(NULL, ", ");
        }
 }
@@ -655,7 +655,7 @@ int php_request_startup(TSRMLS_D)
                /* PG(during_request_startup) = 0; */
 
                php_hash_environment(TSRMLS_C);
-               zend_activate_modules();
+               zend_activate_modules(TSRMLS_C);
                PG(modules_activated)=1;
        } zend_catch {
                retval = FAILURE;
@@ -909,10 +909,10 @@ int php_module_startup(sapi_module_struct *sf)
           which is always an internal extension and to be initialized
        ahead of all other internals
         */
-       php_ini_delayed_modules_startup();
+       php_ini_delayed_modules_startup(TSRMLS_C);
 
        /* disable certain functions as requested by php.ini */
-       php_disable_functions();
+       php_disable_functions(TSRMLS_C);
 
        zend_startup_extensions();
 
@@ -961,7 +961,7 @@ void php_module_shutdown()
        php_shutdown_ticks(TSRMLS_C);
        sapi_flush();
 
-       zend_shutdown();
+       zend_shutdown(TSRMLS_C);
        php_shutdown_fopen_wrappers();
        php_shutdown_info_logos();
        UNREGISTER_INI_ENTRIES();
index 5e2a54b87e495ce4db050a3e37d10e12e0cd168e..d47dcac2262a729d264841b88a11ac002bae89e3 100644 (file)
@@ -77,7 +77,7 @@ static void php_ini_displayer_cb(zend_ini_entry *ini_entry, int type)
 
 /* {{{ php_ini_displayer
  */
-static int php_ini_displayer(zend_ini_entry *ini_entry, int module_number)
+static int php_ini_displayer(zend_ini_entry *ini_entry, int module_number TSRMLS_DC)
 {
        if (ini_entry->module_number != module_number) {
                return 0;
@@ -109,7 +109,7 @@ PHPAPI void display_ini_entries(zend_module_entry *module)
        }
        php_info_print_table_start();
        php_info_print_table_header(3, "Directive", "Local Value", "Master Value");
-       zend_hash_apply_with_argument(&EG(ini_directives), (apply_func_arg_t) php_ini_displayer, (void *) (long) module_number);
+       zend_hash_apply_with_argument(&EG(ini_directives), (apply_func_arg_t) php_ini_displayer, (void *) (long) module_number TSRMLS_CC);
        php_info_print_table_end();
 }
 /* }}} */
@@ -176,7 +176,7 @@ static void php_config_ini_parser_cb(zval *arg1, zval *arg2, int callback_type,
 
 /* {{{ php_load_function_extension_cb
  */
-static void php_load_function_extension_cb(void *arg)
+static void php_load_function_extension_cb(void *arg TSRMLS_DC)
 {
        zval *extension = (zval *) arg;
        zval zval;
@@ -187,7 +187,7 @@ static void php_load_function_extension_cb(void *arg)
 
 /* {{{ php_load_zend_extension_cb
  */
-static void php_load_zend_extension_cb(void *arg)
+static void php_load_zend_extension_cb(void *arg TSRMLS_DC)
 {
        zend_load_extension(*((char **) arg));
 }
@@ -294,10 +294,10 @@ int php_shutdown_config(void)
 
 /* {{{ php_ini_delayed_modules_startup
  */
-void php_ini_delayed_modules_startup(void)
+void php_ini_delayed_modules_startup(TSRMLS_D)
 {
-       zend_llist_apply(&extension_lists.engine, php_load_zend_extension_cb);
-       zend_llist_apply(&extension_lists.functions, php_load_function_extension_cb);
+       zend_llist_apply(&extension_lists.engine, php_load_zend_extension_cb TSRMLS_CC);
+       zend_llist_apply(&extension_lists.functions, php_load_function_extension_cb TSRMLS_CC);
 
        zend_llist_destroy(&extension_lists.engine);
        zend_llist_destroy(&extension_lists.functions);
index 107a1cdc53224902557f6d6cda78600d9723b47b..bc78876e790ff3c3a6f2486ff9d1734e92af1328 100644 (file)
@@ -23,7 +23,7 @@
 
 int php_init_config(char *php_ini_path_override);
 int php_shutdown_config(void);
-void php_ini_delayed_modules_startup(void);
+void php_ini_delayed_modules_startup(TSRMLS_D);
 zval *cfg_get_entry(char *name, uint name_length);
 
 #define PHP_INI_USER   ZEND_INI_USER
index de79d9cc846ee5647e18bce2fbc42732057cddb6..b82d5b03a9cbfc82b1b2fa98908831d8d55b2147 100644 (file)
@@ -56,19 +56,20 @@ PHPAPI void php_remove_tick_function(void (*func)(int))
                                                   (int(*)(void*,void*))php_compare_tick_functions);
 }
 
-static void php_tick_iterator(void *data, void *arg)
+static void php_tick_iterator(void *data, void *arg TSRMLS_DC)
 {
        void (*func)(int);
 
        memcpy(&func, data, sizeof(void(*)(int)));
        func(*((int *)arg));
+       return SUCCESS;
 }
 
 void php_run_ticks(int count)
 {
        TSRMLS_FETCH();
 
-       zend_llist_apply_with_argument(&PG(tick_functions), (void(*)(void*,void*))php_tick_iterator, &count);
+       zend_llist_apply_with_argument(&PG(tick_functions), (llist_apply_with_arg_func_t) php_tick_iterator, &count TSRMLS_CC);
 }
 
 /*
index 92615a4292668b2436d670486eb9a0f59dbeffc0..6ad499e5e95a4158c7abab9a54ebbbec23dfcd74 100644 (file)
@@ -83,7 +83,7 @@ static void register_http_post_files_variable_ex(char *var, zval *val, zval *htt
 }
 
 
-static int unlink_filename(char **filename)
+static int unlink_filename(char **filename TSRMLS_DC)
 {
        VCWD_UNLINK(*filename);
        return 0;
@@ -92,7 +92,7 @@ static int unlink_filename(char **filename)
 
 void destroy_uploaded_files_hash(TSRMLS_D)
 {
-       zend_hash_apply(SG(rfc1867_uploaded_files), (apply_func_t) unlink_filename);
+       zend_hash_apply(SG(rfc1867_uploaded_files), (apply_func_t) unlink_filename TSRMLS_CC);
        zend_hash_destroy(SG(rfc1867_uploaded_files));
        FREE_HASHTABLE(SG(rfc1867_uploaded_files));
 }
index 9c2a86ddbc6ef9599e1967170e7c47f2fd7019dd..52a65fd9c3157967d187895fff824ae6938b0428 100644 (file)
@@ -459,7 +459,7 @@ static void init_request_info(TSRMLS_D)
 
 /* {{{ php_apache_alter_ini_entries
  */
-static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry)
+static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry TSRMLS_DC)
 {
        zend_alter_ini_entry(per_dir_entry->key, per_dir_entry->key_length+1, per_dir_entry->value, per_dir_entry->value_length, per_dir_entry->type, PHP_INI_STAGE_ACTIVATE);
        return 0;
@@ -493,8 +493,6 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
        int retval;
        HashTable *per_dir_conf;
        TSRMLS_FETCH();
-       TSRMLS_FETCH();
-       TSRMLS_FETCH();
 
        if (AP(in_request)) {
                zend_file_handle fh;
@@ -521,7 +519,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
 
                per_dir_conf = (HashTable *) get_module_config(r->per_dir_config, &php4_module);
                if (per_dir_conf) {
-                       zend_hash_apply((HashTable *) per_dir_conf, (apply_func_t) php_apache_alter_ini_entries);
+                       zend_hash_apply((HashTable *) per_dir_conf, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC);
                }
 
                /* If PHP parser engine has been turned off with an "engine off"
index 08ff40ce3789c22f0f6c199b8687038f741d4233..633576ea67530d373b0224c40c8c3316ee09a600 100644 (file)
@@ -82,7 +82,8 @@ extern int ap_php_optind;
 
 #define OPTSTRING "aCc:d:ef:g:hilmnqs?vz:"
 
-static int _print_module_info ( zend_module_entry *module, void *arg ) {
+static int _print_module_info(zend_module_entry *module, void *arg TSRMLS_DC)
+{
        php_printf("%s\n", module->name);
        return 0;
 }
@@ -135,7 +136,7 @@ static void sapi_cgibin_flush(void *server_context)
 }
 
 
-static void sapi_cgi_send_header(sapi_header_struct *sapi_header, void *server_context)
+static void sapi_cgi_send_header(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC)
 {
        if (sapi_header) {
                PHPWRITE_H(sapi_header->header, sapi_header->header_len);
@@ -344,10 +345,9 @@ static void define_command_line_ini_entry(char *arg)
 }
 
 
-static void php_register_command_line_global_vars(char **arg)
+static void php_register_command_line_global_vars(char **arg TSRMLS_DC)
 {
        char *var, *val;
-       TSRMLS_FETCH();
 
        var = *arg;
        val = strchr(var, '=');
@@ -585,9 +585,10 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
                                        SG(headers_sent) = 1;
                                        php_printf("Running PHP %s\n%s\n", PHP_VERSION , get_zend_version());
                                        php_printf("[PHP Modules]\n");
-                                       zend_hash_apply_with_argument(&module_registry, (int (*)(void *, void *)) _print_module_info, NULL);
-                                       php_printf("\n[Zend Modules]\n");                       
-                                       zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) _print_module_info, NULL);
+                                       zend_hash_apply_with_argument(&module_registry, (apply_func_arg_t) _print_module_info, NULL TSRMLS_CC);
+                                       php_printf("\n[Zend Modules]\n");
+                                       /* zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) _print_module_info, NULL TSRMLS_CC); */
+                                       php_printf("Not Implemented\n");
                                        php_printf("\n");
                                        php_end_ob_buffers(1);
                                        exit(1);
@@ -681,7 +682,7 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
                file_handle.free_filename = 0;
 
                /* This actually destructs the elements of the list - ugly hack */
-               zend_llist_apply(&global_vars, (llist_apply_func_t) php_register_command_line_global_vars);
+               zend_llist_apply(&global_vars, (llist_apply_func_t) php_register_command_line_global_vars TSRMLS_CC);
                zend_llist_destroy(&global_vars);
 
                if (!cgi) {
index c6f1e5bb843249d9575e53c16b03510ef26e1bdd..3050bcd6ac5c722c64a1b5ae160add1cc822865c 100644 (file)
@@ -106,7 +106,7 @@ static void sapi_fastcgi_flush( void *server_context )
 }
 
 
-static void sapi_fastcgi_send_header(sapi_header_struct *sapi_header, void *server_context)
+static void sapi_fastcgi_send_header(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC)
 {
        if( sapi_header ) {
 #ifdef DEBUG_FASTCGI
index 6bfaafd586be6f8d5290bff09ef8f2e46ec03f0b..145e45cd2652e7c97632a0ac15f9576f2f9d51a4 100644 (file)
@@ -220,13 +220,13 @@ static int sapi_isapi_header_handler(sapi_header_struct *sapi_header, sapi_heade
 
 
 
-static void accumulate_header_length(sapi_header_struct *sapi_header, uint *total_length)
+static void accumulate_header_length(sapi_header_struct *sapi_header, uint *total_length TSRMLS_DC)
 {
        *total_length += sapi_header->header_len+2;
 }
 
 
-static void concat_header(sapi_header_struct *sapi_header, char **combined_headers_ptr)
+static void concat_header(sapi_header_struct *sapi_header, char **combined_headers_ptr TSRMLS_DC)
 {
        memcpy(*combined_headers_ptr, sapi_header->header, sapi_header->header_len);
        *combined_headers_ptr += sapi_header->header_len;
@@ -249,18 +249,18 @@ static int sapi_isapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
        /* Obtain headers length */
        if (SG(sapi_headers).send_default_content_type) {
                sapi_get_default_content_type_header(&default_content_type TSRMLS_CC);
-               accumulate_header_length(&default_content_type, (void *) &total_length);
+               accumulate_header_length(&default_content_type, (void *) &total_length TSRMLS_CC);
        }
-       zend_llist_apply_with_argument(&SG(sapi_headers).headers, (void (*)(void *, void *)) accumulate_header_length, (void *) &total_length);
+       zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) accumulate_header_length, (void *) &total_length TSRMLS_CC);
 
        /* Generate headers */
        combined_headers = (char *) emalloc(total_length+1);
        combined_headers_ptr = combined_headers;
        if (SG(sapi_headers).send_default_content_type) {
-               concat_header(&default_content_type, (void *) &combined_headers_ptr);
+               concat_header(&default_content_type, (void *) &combined_headers_ptr TSRMLS_CC);
                sapi_free_header(&default_content_type); /* we no longer need it */
        }
-       zend_llist_apply_with_argument(&SG(sapi_headers).headers, (void (*)(void *, void *)) concat_header, (void *) &combined_headers_ptr);
+       zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) concat_header, (void *) &combined_headers_ptr TSRMLS_CC);
        *combined_headers_ptr++ = '\r';
        *combined_headers_ptr++ = '\n';
        *combined_headers_ptr = 0;
index 25f6b3f079fc7b82079d24780fb862519945cfe1..66c5be17830169d5e5f7501323d630c0a2ebd4e6 100644 (file)
@@ -157,13 +157,13 @@ static int sapi_pi3web_header_handler(sapi_header_struct *sapi_header, sapi_head
 
 
 
-static void accumulate_header_length(sapi_header_struct *sapi_header, uint *total_length)
+static void accumulate_header_length(sapi_header_struct *sapi_header, uint *total_length TSRMLS_DC)
 {
        *total_length += sapi_header->header_len+2;
 }
 
 
-static void concat_header(sapi_header_struct *sapi_header, char **combined_headers_ptr)
+static void concat_header(sapi_header_struct *sapi_header, char **combined_headers_ptr TSRMLS_DC)
 {
        memcpy(*combined_headers_ptr, sapi_header->header, sapi_header->header_len);
        *combined_headers_ptr += sapi_header->header_len;
@@ -187,9 +187,9 @@ static int sapi_pi3web_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
 
        if (SG(sapi_headers).send_default_content_type) {
                sapi_get_default_content_type_header(&default_content_type TSRMLS_CC);
-               accumulate_header_length(&default_content_type, (void *) &total_length);
+               accumulate_header_length(&default_content_type, (void *) &total_length TSRMLS_CC);
        }
-       zend_llist_apply_with_argument(&SG(sapi_headers).headers, (void (*)(void *, void *)) accumulate_header_length, (void *) &total_length);
+       zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) accumulate_header_length, (void *) &total_length TSRMLS_CC);
 
        /* Generate headers */
        combined_headers = (char *) emalloc(total_length+1);
@@ -198,7 +198,7 @@ static int sapi_pi3web_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
                concat_header(&default_content_type, (void *) &combined_headers_ptr);
                sapi_free_header(&default_content_type); /* we no longer need it */
        }
-       zend_llist_apply_with_argument(&SG(sapi_headers).headers, (void (*)(void *, void *)) concat_header, (void *) &combined_headers_ptr);
+       zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) concat_header, (void *) &combined_headers_ptr TSRMLS_CC);
        *combined_headers_ptr++ = '\r';
        *combined_headers_ptr++ = '\n';
        *combined_headers_ptr = 0;
index d0c29fb23ceafcc24de3d85ce78d3113f90b2a1d..364d0c51b22ffc25e01f8242c8c527f54fded923 100644 (file)
@@ -142,9 +142,8 @@ static int sapi_servlet_ub_write(const char *str, uint str_length)
 }
 
 
-static void sapi_servlet_send_header(sapi_header_struct *sapi_header, void *server_context)
+static void sapi_servlet_send_header(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC)
 {
-       TSRMLS_FETCH();
        if (!sapi_header) return;
        if (!SG(server_context)) return;