Permalink
Browse files

More TSRMLS_FETCH work

  • Loading branch information...
1 parent 7bc71f4 commit d76cf1da183f79711d7699a2ff85f743da3f9dd2 @zsuraski zsuraski committed Jul 31, 2001
View
10 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,17 +520,17 @@ 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)
{
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();
}
View
2 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);
View
17 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;
}
View
2 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);
View
10 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);
}
View
2 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 */
View
6 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);
View
8 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);
}
View
32 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,23 +473,23 @@ 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);
}
}
-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);
}
}
-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 @@ binary_assign_op_addr: {
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 @@ binary_assign_op_addr: {
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:
View
2 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)
View
21 Zend/zend_execute_API.c
@@ -74,29 +74,29 @@ 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();
}
}
-static void zend_extension_deactivator(zend_extension *extension)
+static void zend_extension_deactivator(zend_extension *extension TSRMLS_DC)
{
if (extension->deactivate) {
extension->deactivate();
}
}
-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;
}
View
12 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);
}
View
2 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 */
View
6 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;
View
6 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, ...);
View
20 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;
}
View
14 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,23 +273,21 @@ 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;
}
}
-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);
}
View
2 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);
View
12 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);
}
View
12 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);
View
4 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
View
20 Zend/zend_opcode.c
@@ -27,15 +27,15 @@
#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);
}
}
-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,18 +257,17 @@ 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);
}
}
-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;
}
View
1 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");
View
122 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)
View
11 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;
}
View
1 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) {
View
2 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, "&");
View
6 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);
View
32 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;
View
7 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);
}
}
/* }}} */
View
5 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;
}
/* }}} */
View
11 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;
}
View
10 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));
View
7 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();
}
View
4 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);
View
6 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;