diff options
| author | Zeev Suraski <zeev@php.net> | 2001-07-31 04:53:54 +0000 | 
|---|---|---|
| committer | Zeev Suraski <zeev@php.net> | 2001-07-31 04:53:54 +0000 | 
| commit | d76cf1da183f79711d7699a2ff85f743da3f9dd2 (patch) | |
| tree | 8342fd3406696bc32b81deb28d6771336fb6fe36 | |
| parent | 7bc71f442d7ddfecf43871b394c14100baa391b3 (diff) | |
| download | php-git-d76cf1da183f79711d7699a2ff85f743da3f9dd2.tar.gz | |
More TSRMLS_FETCH work
49 files changed, 261 insertions, 283 deletions
| diff --git a/Zend/zend.c b/Zend/zend.c index fea898e9ce..a44c9bfd7b 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -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();  } diff --git a/Zend/zend.h b/Zend/zend.h index 2d171a40d9..5273a92b53 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -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); diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 25cc7a034e..a46c3872f0 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -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;  	} diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 29dcbc7e88..e8264590d3 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -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); diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index b6defd3557..a0e5e67da4 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -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);  } diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 149c009aa2..04a992fd46 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -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 */ diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 6fd2ac1e77..fda7b57239 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -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); diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c index bf6a42c279..cb4ac03333 100644 --- a/Zend/zend_constants.c +++ b/Zend/zend_constants.c @@ -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);  } diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 3de49b8d54..6720bd014b 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -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: diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index 9f52f3707d..9c25e8c0ef 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -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) diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 9646eaf49e..cf15349fec 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -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;  } diff --git a/Zend/zend_extensions.c b/Zend/zend_extensions.c index 790490fa00..14b914cf8e 100644 --- a/Zend/zend_extensions.c +++ b/Zend/zend_extensions.c @@ -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);  } diff --git a/Zend/zend_extensions.h b/Zend/zend_extensions.h index a31bd9cf91..c7839262e5 100644 --- a/Zend/zend_extensions.h +++ b/Zend/zend_extensions.h @@ -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 */ diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c index 6b6bb7e171..0078a53893 100644 --- a/Zend/zend_hash.c +++ b/Zend/zend_hash.c @@ -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; diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h index c19a38c26d..e14b6c62f8 100644 --- a/Zend/zend_hash.h +++ b/Zend/zend_hash.h @@ -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, ...); diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c index 7595b8259a..fac8ab4e03 100644 --- a/Zend/zend_ini.c +++ b/Zend/zend_ini.c @@ -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;  } diff --git a/Zend/zend_list.c b/Zend/zend_list.c index 4cd588367f..db418ac186 100644 --- a/Zend/zend_list.c +++ b/Zend/zend_list.c @@ -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);  } diff --git a/Zend/zend_list.h b/Zend/zend_list.h index f3b414e4da..0b75115233 100644 --- a/Zend/zend_list.h +++ b/Zend/zend_list.h @@ -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); diff --git a/Zend/zend_llist.c b/Zend/zend_llist.c index a85492c396..e3ac9a6d73 100644 --- a/Zend/zend_llist.c +++ b/Zend/zend_llist.c @@ -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);  } diff --git a/Zend/zend_llist.h b/Zend/zend_llist.h index 420c214e1a..63bf647483 100644 --- a/Zend/zend_llist.h +++ b/Zend/zend_llist.h @@ -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); diff --git a/Zend/zend_modules.h b/Zend/zend_modules.h index e2aa72ad9a..24d40be251 100644 --- a/Zend/zend_modules.h +++ b/Zend/zend_modules.h @@ -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 diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index 29c6d86c06..6462d3e497 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -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;  } diff --git a/ext/crack/crack.c b/ext/crack/crack.c index f261381022..990ad2933c 100644 --- a/ext/crack/crack.c +++ b/ext/crack/crack.c @@ -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"); diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c index 83b1760a7c..b20ee61138 100644 --- a/ext/domxml/php_domxml.c +++ b/ext/domxml/php_domxml.c @@ -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) diff --git a/ext/dotnet/dotnet.cpp b/ext/dotnet/dotnet.cpp index 0407150e99..938491bdf4 100644 --- a/ext/dotnet/dotnet.cpp +++ b/ext/dotnet/dotnet.cpp @@ -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;  } diff --git a/ext/fdf/fdf.c b/ext/fdf/fdf.c index 8fed3d3f4b..a5da77e67b 100644 --- a/ext/fdf/fdf.c +++ b/ext/fdf/fdf.c @@ -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) { diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 4c97b9fb7f..fb69c1bf47 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -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, "&"); diff --git a/ext/mssql/php_mssql.c b/ext/mssql/php_mssql.c index 2371a94216..1afc79bf53 100644 --- a/ext/mssql/php_mssql.c +++ b/ext/mssql/php_mssql.c @@ -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); diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 4e0beb5999..f84e2f0153 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -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; diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 390b0eff60..82c2af0569 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -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);	  	}  }  /* }}} */ diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index ef16d1f7e4..bbd5cfdf06 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -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;  }  /* }}} */ diff --git a/ext/rpc/dotnet/dotnet.cpp b/ext/rpc/dotnet/dotnet.cpp index 0407150e99..938491bdf4 100644 --- a/ext/rpc/dotnet/dotnet.cpp +++ b/ext/rpc/dotnet/dotnet.cpp @@ -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;  } diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index e2ef244d47..22e0e1bffb 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -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)); diff --git a/ext/standard/info.c b/ext/standard/info.c index 84689d1733..01a70db73d 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -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();  	} diff --git a/ext/sybase/php_sybase_db.c b/ext/sybase/php_sybase_db.c index 72c357ce23..7fc514a883 100644 --- a/ext/sybase/php_sybase_db.c +++ b/ext/sybase/php_sybase_db.c @@ -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); diff --git a/ext/sybase_ct/php_sybase_ct.c b/ext/sybase_ct/php_sybase_ct.c index f9e02110fc..dfb04f36c1 100644 --- a/ext/sybase_ct/php_sybase_ct.c +++ b/ext/sybase_ct/php_sybase_ct.c @@ -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 diff --git a/main/SAPI.c b/main/SAPI.c index 618f16f140..08fa6afcc5 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -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: diff --git a/main/SAPI.h b/main/SAPI.h index 85dd8a2079..95015a7f81 100644 --- a/main/SAPI.h +++ b/main/SAPI.h @@ -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); diff --git a/main/main.c b/main/main.c index bfe8b67d0c..8e9c1c0dc2 100644 --- a/main/main.c +++ b/main/main.c @@ -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(); diff --git a/main/php_ini.c b/main/php_ini.c index 5e2a54b87e..d47dcac226 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -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); diff --git a/main/php_ini.h b/main/php_ini.h index 107a1cdc53..bc78876e79 100644 --- a/main/php_ini.h +++ b/main/php_ini.h @@ -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 diff --git a/main/php_ticks.c b/main/php_ticks.c index de79d9cc84..b82d5b03a9 100644 --- a/main/php_ticks.c +++ b/main/php_ticks.c @@ -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);  }  /* diff --git a/main/rfc1867.c b/main/rfc1867.c index 92615a4292..6ad499e5e9 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -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));  } diff --git a/sapi/apache/mod_php4.c b/sapi/apache/mod_php4.c index 9c2a86ddbc..52a65fd9c3 100644 --- a/sapi/apache/mod_php4.c +++ b/sapi/apache/mod_php4.c @@ -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" diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 08ff40ce37..633576ea67 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -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) { diff --git a/sapi/fastcgi/fastcgi.c b/sapi/fastcgi/fastcgi.c index c6f1e5bb84..3050bcd6ac 100644 --- a/sapi/fastcgi/fastcgi.c +++ b/sapi/fastcgi/fastcgi.c @@ -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 diff --git a/sapi/isapi/php4isapi.c b/sapi/isapi/php4isapi.c index 6bfaafd586..145e45cd26 100644 --- a/sapi/isapi/php4isapi.c +++ b/sapi/isapi/php4isapi.c @@ -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; diff --git a/sapi/pi3web/pi3web_sapi.c b/sapi/pi3web/pi3web_sapi.c index 25f6b3f079..66c5be1783 100644 --- a/sapi/pi3web/pi3web_sapi.c +++ b/sapi/pi3web/pi3web_sapi.c @@ -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; diff --git a/sapi/servlet/servlet.c b/sapi/servlet/servlet.c index d0c29fb23c..364d0c51b2 100644 --- a/sapi/servlet/servlet.c +++ b/sapi/servlet/servlet.c @@ -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; | 
