]> granicus.if.org Git - php/commitdiff
More TSRMLS_FETCH work
authorZeev Suraski <zeev@php.net>
Mon, 30 Jul 2001 07:43:02 +0000 (07:43 +0000)
committerZeev Suraski <zeev@php.net>
Mon, 30 Jul 2001 07:43:02 +0000 (07:43 +0000)
17 files changed:
Zend/zend.c
Zend/zend_API.c
Zend/zend_API.h
Zend/zend_builtin_functions.c
Zend/zend_compile.c
Zend/zend_compile.h
Zend/zend_constants.c
Zend/zend_constants.h
Zend/zend_execute.c
Zend/zend_execute.h
Zend/zend_execute_API.c
Zend/zend_highlight.c
Zend/zend_highlight.h
Zend/zend_ini.c
Zend/zend_ini.h
Zend/zend_ini_parser.y
Zend/zend_language_scanner.l

index 7ac0c69fab608be89c2a5b4607e10732dc87b700..fea898e9cef1d33bd7ea12ea515b2018908b3a26 100644 (file)
@@ -606,10 +606,10 @@ ZEND_API void zend_error(int type, const char *format, ...)
                case E_USER_ERROR:
                case E_USER_WARNING:
                case E_USER_NOTICE:
-                       if (zend_is_compiling()) {
+                       if (zend_is_compiling(TSRMLS_C)) {
                                error_filename = zend_get_compiled_filename(TSRMLS_C);
                                error_lineno = zend_get_compiled_lineno(TSRMLS_C);
-                       } else if (zend_is_executing()) {
+                       } else if (zend_is_executing(TSRMLS_C)) {
                                error_filename = zend_get_executed_filename(TSRMLS_C);
                                error_lineno = zend_get_executed_lineno(TSRMLS_C);
                        } else {
@@ -688,7 +688,7 @@ ZEND_API void zend_error(int type, const char *format, ...)
 
                        orig_user_error_handler = EG(user_error_handler);
                        EG(user_error_handler) = NULL;
-                       if (call_user_function_ex(CG(function_table), NULL, orig_user_error_handler, &retval, 5, params, 1, NULL)==SUCCESS) {
+                       if (call_user_function_ex(CG(function_table), NULL, orig_user_error_handler, &retval, 5, params, 1, NULL TSRMLS_CC)==SUCCESS) {
                                zval_ptr_dtor(&retval);
                        } else {
                                /* The user error handler failed, use built-in error handler */
@@ -783,10 +783,10 @@ ZEND_API char *zend_make_compiled_string_description(char *name TSRMLS_DC)
        int cur_lineno;
        char *compiled_string_description;
 
-       if (zend_is_compiling()) {
+       if (zend_is_compiling(TSRMLS_C)) {
                cur_filename = zend_get_compiled_filename(TSRMLS_C);
                cur_lineno = zend_get_compiled_lineno(TSRMLS_C);
-       } else if (zend_is_executing()) {
+       } else if (zend_is_executing(TSRMLS_C)) {
                cur_filename = zend_get_executed_filename(TSRMLS_C);
                cur_lineno = zend_get_executed_lineno(TSRMLS_C);
        } else {
index 7ca7d72533c5e22e60c805d9e82fd96b2da123a0..25cc7a034e67bfd2007ed79d89b36b2fb878c8da 100644 (file)
@@ -158,9 +158,9 @@ ZEND_API int _zend_get_parameters_array_ex(int param_count, zval ***argument_arr
 }
 
 
-ZEND_API void wrong_param_count()
+ZEND_API void zend_wrong_param_count(TSRMLS_D)
 {
-       zend_error(E_WARNING,"Wrong parameter count for %s()",get_active_function_name());
+       zend_error(E_WARNING, "Wrong parameter count for %s()", get_active_function_name(TSRMLS_C));
 }
 
 
@@ -429,7 +429,7 @@ static char *zend_parse_arg_impl(zval **arg, va_list *va, char **spec)
        return NULL;
 }
 
-static int zend_parse_arg(int arg_num, zval **arg, va_list *va, char **spec, int quiet)
+static int zend_parse_arg(int arg_num, zval **arg, va_list *va, char **spec, int quiet TSRMLS_DC)
 {
        char *expected_type = NULL;
        char buf[1024];
@@ -438,7 +438,7 @@ static int zend_parse_arg(int arg_num, zval **arg, va_list *va, char **spec, int
        if (expected_type) {
                if (!quiet) {
                        sprintf(buf, "%s() expects argument %d to be %s, %s given",
-                                       get_active_function_name(), arg_num, expected_type,
+                                       get_active_function_name(TSRMLS_C), arg_num, expected_type,
                                        zend_zval_type_name(*arg));
                        zend_error(E_WARNING, buf);
                }
@@ -482,7 +482,7 @@ static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int fl
 
                        default:
                                if (!quiet) {
-                                       zend_error(E_WARNING, "%s(): bad type specifier while parsing arguments", get_active_function_name());
+                                       zend_error(E_WARNING, "%s(): bad type specifier while parsing arguments", get_active_function_name(TSRMLS_C));
                                }
                                return FAILURE;
                }
@@ -495,7 +495,7 @@ static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int fl
        if (num_args < min_num_args || num_args > max_num_args) {
                if (!quiet) {
                        sprintf(buf, "%s() requires %s %d argument%s, %d given",
-                                       get_active_function_name(),
+                                       get_active_function_name(TSRMLS_C),
                                        min_num_args == max_num_args ? "exactly" : num_args < min_num_args ? "at least" : "at most",
                                        num_args < min_num_args ? min_num_args : max_num_args,
                                        (num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "" : "s",
@@ -510,7 +510,7 @@ static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int fl
 
        if (num_args > arg_count) {
                zend_error(E_WARNING, "%s(): could not obtain arguments for parsing",
-                                  get_active_function_name());
+                                  get_active_function_name(TSRMLS_C));
                return FAILURE;
        }
 
@@ -520,7 +520,7 @@ static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int fl
                if (*type_spec == '|') {
                        type_spec++;
                }
-               if (zend_parse_arg(i+1, arg, va, &type_spec, quiet) == FAILURE) {
+               if (zend_parse_arg(i+1, arg, va, &type_spec, quiet TSRMLS_CC) == FAILURE) {
                        return FAILURE;
                }
                i++;
@@ -1101,7 +1101,7 @@ void module_destructor(zend_module_entry *module)
 
        if (module->type == MODULE_TEMPORARY) {
                zend_clean_module_rsrc_dtors(module->module_number);
-               clean_module_constants(module->module_number);
+               clean_module_constants(module->module_number TSRMLS_CC);
                if (module->request_shutdown_func)
                        module->request_shutdown_func(module->type, module->module_number TSRMLS_CC);
        }
@@ -1261,7 +1261,7 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
 
 static ZEND_FUNCTION(display_disabled_function)
 {
-       zend_error(E_WARNING, "%s() has been disabled for security reasons", get_active_function_name());
+       zend_error(E_WARNING, "%s() has been disabled for security reasons", get_active_function_name(TSRMLS_C));
 }
 
 
index 31a72610296f50ac9f56ad261e91283c98704f5d..29dcbc7e880e0770a31079341b238341340219eb 100644 (file)
@@ -132,7 +132,7 @@ ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *cla
 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 void wrong_param_count(void);
+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);
 
 #define getThis() (this_ptr)
@@ -141,8 +141,8 @@ ZEND_API zend_bool zend_is_callable(zval *callable, zend_bool syntax_only, char
 #define WRONG_PARAM_COUNT_WITH_RETVAL(ret)     ZEND_WRONG_PARAM_COUNT_WITH_RETVAL(ret)
 #define ARG_COUNT(dummy)       (ht)
 #define ZEND_NUM_ARGS()                (ht)
-#define ZEND_WRONG_PARAM_COUNT()                                       { wrong_param_count(); return; }
-#define ZEND_WRONG_PARAM_COUNT_WITH_RETVAL(ret)                { wrong_param_count(); return ret; }
+#define ZEND_WRONG_PARAM_COUNT()                                       { zend_wrong_param_count(TSRMLS_C); return; }
+#define ZEND_WRONG_PARAM_COUNT_WITH_RETVAL(ret)                { zend_wrong_param_count(TSRMLS_C); return ret; }
 
 #ifndef ZEND_WIN32
 #define DLEXPORT
@@ -231,8 +231,8 @@ ZEND_API int add_property_zval_ex(zval *arg, char *key, uint key_len, zval *valu
 #define add_property_stringl(__arg, __key, __str, __length, __duplicate) add_property_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate)
 #define add_property_zval(__arg, __key, __value) add_property_zval_ex(__arg, __key, strlen(__key)+1, __value)       
 
-ZEND_API int call_user_function(HashTable *function_table, zval **object_pp, zval *function_name, zval *retval_ptr, int param_count, zval *params[]);
-ZEND_API int call_user_function_ex(HashTable *function_table, zval **object_pp, zval *function_name, zval **retval_ptr_ptr, int param_count, zval **params[], int no_separation, HashTable *symbol_table);
+ZEND_API int call_user_function(HashTable *function_table, zval **object_pp, zval *function_name, zval *retval_ptr, int param_count, zval *params[] TSRMLS_DC);
+ZEND_API int call_user_function_ex(HashTable *function_table, zval **object_pp, zval *function_name, zval **retval_ptr_ptr, int param_count, zval **params[], int no_separation, HashTable *symbol_table TSRMLS_DC);
 
 ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
                                   int is_ref, int num_symbol_tables, ...);
index 11cf531837e37022d10900284121cb495b2dac76..b6defd3557a70ad1db500dca10345243ccd405b7 100644 (file)
@@ -444,7 +444,7 @@ ZEND_FUNCTION(defined)
        }
        
        convert_to_string_ex(var);
-       if (zend_get_constant((*var)->value.str.val, (*var)->value.str.len, &c)) {
+       if (zend_get_constant((*var)->value.str.val, (*var)->value.str.len, &c TSRMLS_CC)) {
                zval_dtor(&c);
                RETURN_LONG(1);
        } else {
index c7e9ef3925ee7663e30f931d043aa418b633eb4c..149c009aa2378aa60c74b0b2f8699594d9f892cf 100644 (file)
@@ -108,11 +108,10 @@ void shutdown_compiler(TSRMLS_D)
 }
 
 
-ZEND_API char *zend_set_compiled_filename(char *new_compiled_filename)
+ZEND_API char *zend_set_compiled_filename(char *new_compiled_filename TSRMLS_DC)
 {
        char **pp, *p;
        int length = strlen(new_compiled_filename);
-       TSRMLS_FETCH();
 
        if (zend_hash_find(&CG(filenames_table), new_compiled_filename, length+1, (void **) &pp)==SUCCESS) {
                CG(compiled_filename) = *pp;
@@ -125,10 +124,8 @@ ZEND_API char *zend_set_compiled_filename(char *new_compiled_filename)
 }
 
 
-ZEND_API void zend_restore_compiled_filename(char *original_compiled_filename)
+ZEND_API void zend_restore_compiled_filename(char *original_compiled_filename TSRMLS_DC)
 {
-       TSRMLS_FETCH();
-
        CG(compiled_filename) = original_compiled_filename;
 }
 
@@ -145,10 +142,8 @@ ZEND_API int zend_get_compiled_lineno(TSRMLS_D)
 }
 
 
-ZEND_API zend_bool zend_is_compiling()
+ZEND_API zend_bool zend_is_compiling(TSRMLS_D)
 {
-       TSRMLS_FETCH();
-
        return CG(in_compilation);
 }
 
index c9b9f6d989233dd740c7f47554a2cfd43ef219df..6fd2ac1e779e09ac59a4df82ace055065cb6cc6b 100644 (file)
@@ -212,8 +212,8 @@ int lex_scan(zval *zendlval TSRMLS_DC);
 void startup_scanner(TSRMLS_D);
 void shutdown_scanner(TSRMLS_D);
 
-ZEND_API char *zend_set_compiled_filename(char *new_compiled_filename);
-ZEND_API void zend_restore_compiled_filename(char *original_compiled_filename);
+ZEND_API char *zend_set_compiled_filename(char *new_compiled_filename TSRMLS_DC);
+ZEND_API void zend_restore_compiled_filename(char *original_compiled_filename TSRMLS_DC);
 ZEND_API char *zend_get_compiled_filename(TSRMLS_D);
 ZEND_API int zend_get_compiled_lineno(TSRMLS_D);
 
@@ -387,7 +387,7 @@ int print_class(zend_class_entry *class_entry);
 void print_op_array(zend_op_array *op_array, int optimizations);
 int pass_two(zend_op_array *op_array);
 zend_brk_cont_element *get_next_brk_cont_element(zend_op_array *op_array);
-ZEND_API zend_bool zend_is_compiling(void);
+ZEND_API zend_bool zend_is_compiling(TSRMLS_D);
 ZEND_API char *zend_make_compiled_string_description(char *name TSRMLS_DC);
 
 int zendlex(znode *zendlval TSRMLS_DC);
index 59920c1404ed968102c7105f646f26c62a47105f..bf6a42c279031bf1d7911ab01bc8093d6ae8605a 100644 (file)
@@ -71,10 +71,8 @@ static int clean_module_constant(zend_constant *c, int *module_number)
 }
 
 
-void clean_module_constants(int module_number)
+void clean_module_constants(int module_number TSRMLS_DC)
 {
-       TSRMLS_FETCH();
-
        zend_hash_apply_with_argument(EG(zend_constants), (int (*)(void *,void *)) clean_module_constant, (void *) &module_number);
 }
 
@@ -156,10 +154,8 @@ int zend_shutdown_constants(TSRMLS_D)
 }
 
 
-void clean_non_persistent_constants(void)
+void clean_non_persistent_constants(TSRMLS_D)
 {
-       TSRMLS_FETCH();
-
        zend_hash_apply(EG(zend_constants), (apply_func_t) clean_non_persistent_constant);
 }
 
@@ -213,12 +209,11 @@ ZEND_API void zend_register_string_constant(char *name, uint name_len, char *str
 }
 
 
-ZEND_API int zend_get_constant(char *name, uint name_len, zval *result)
+ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC)
 {
        zend_constant *c;
        char *lookup_name = estrndup(name,name_len);
        int retval;
-       TSRMLS_FETCH();
 
        zend_str_tolower(lookup_name, name_len);
 
index a35332d735325f94f2fa5164b1de946f950e25f7..054041850675f5201690112472c3b4cd208c24c6 100644 (file)
@@ -44,13 +44,13 @@ typedef struct _zend_constant {
 #define REGISTER_MAIN_STRING_CONSTANT(name,str,flags)  zend_register_string_constant((name),sizeof(name),(str),(flags),0 TSRMLS_CC)
 #define REGISTER_MAIN_STRINGL_CONSTANT(name,str,len,flags)  zend_register_stringl_constant((name),sizeof(name),(str),(len),(flags),0 TSRMLS_CC)
 
-void clean_module_constants(int module_number);
+void clean_module_constants(int module_number TSRMLS_DC);
 void free_zend_constant(zend_constant *c);
 int zend_startup_constants(TSRMLS_D);
 int zend_shutdown_constants(TSRMLS_D);
 void zend_register_standard_constants(TSRMLS_D);
-void clean_non_persistent_constants(void);
-ZEND_API int zend_get_constant(char *name, uint name_len, zval *result);
+void clean_non_persistent_constants(TSRMLS_D);
+ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC);
 ZEND_API void zend_register_long_constant(char *name, uint name_len, long lval, int flags, int module_number TSRMLS_DC);
 ZEND_API void zend_register_double_constant(char *name, uint name_len, double dval, int flags, int module_number TSRMLS_DC);
 ZEND_API void zend_register_string_constant(char *name, uint name_len, char *strval, int flags, int module_number TSRMLS_DC);
index c76ccd9e2e95f4a8204dc6987cae05d589b3e504..3de49b8d54c8fdf7d8b94be2914a33abdbafe3df 100644 (file)
@@ -1769,7 +1769,7 @@ send_by_ref:
                                        zval **param;
 
                                        if (zend_ptr_stack_get_arg(opline->op1.u.constant.value.lval, (void **) &param TSRMLS_CC)==FAILURE) {
-                                               zend_error(E_WARNING, "Missing argument %d for %s()\n", opline->op1.u.constant.value.lval, get_active_function_name());
+                                               zend_error(E_WARNING, "Missing argument %d for %s()\n", opline->op1.u.constant.value.lval, get_active_function_name(TSRMLS_C));
                                                if (opline->result.op_type == IS_VAR) {
                                                        PZVAL_UNLOCK(*Ts[opline->result.u.var].var.ptr_ptr);
                                                }
@@ -1921,7 +1921,7 @@ send_by_ref:
                                }
                                NEXT_OPCODE();
                        case ZEND_FETCH_CONSTANT:
-                               if (!zend_get_constant(opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, &Ts[opline->result.u.var].tmp_var)) {
+                               if (!zend_get_constant(opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, &Ts[opline->result.u.var].tmp_var TSRMLS_CC)) {
                                        zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'",
                                                                opline->op1.u.constant.value.str.val,
                                                                opline->op1.u.constant.value.str.val);
@@ -2036,7 +2036,6 @@ send_by_ref:
                                        int return_value_used;
                                        zval *inc_filename = get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R);
                                        zval tmp_inc_filename;
-                                       TSRMLS_FETCH();
 
                                        if (inc_filename->type!=IS_STRING) {
                                                tmp_inc_filename = *inc_filename;
index 058b5d81e1a9f8cec12d3aca4c006835df6b0197..9f52f3707d262e3f026593c7544c9cff0a67b3fc 100644 (file)
@@ -132,13 +132,13 @@ void execute_new_code(TSRMLS_D);
 
 
 /* services */
-ZEND_API char *get_active_function_name(void);
+ZEND_API char *get_active_function_name(TSRMLS_D);
 ZEND_API char *zend_get_executed_filename(TSRMLS_D);
 ZEND_API uint zend_get_executed_lineno(TSRMLS_D);
-ZEND_API zend_bool zend_is_executing(void);
+ZEND_API zend_bool zend_is_executing(TSRMLS_D);
 
 ZEND_API void zend_set_timeout(long seconds);
-ZEND_API void zend_unset_timeout(void);
+ZEND_API void zend_unset_timeout(TSRMLS_D);
 ZEND_API void zend_timeout(int dummy);
 
 #ifdef ZEND_WIN32
index 523b8dd2ad3f5b11d68a3ac522f66fb0dbca9097..9646eaf49e900e523432ada8cccb99c65f1c6788 100644 (file)
@@ -63,7 +63,7 @@ static void zend_handle_sigsegv(int dummy)
                fprintf(stderr, "SIGSEGV caught on opcode %d on opline %d of %s() at %s:%d\n\n",
                                active_opline->opcode,
                                active_opline-EG(active_op_array)->opcodes,
-                               get_active_function_name(),
+                               get_active_function_name(TSRMLS_C),
                                zend_get_executed_filename(TSRMLS_C),
                                zend_get_executed_lineno(TSRMLS_C));
        }
@@ -182,7 +182,7 @@ void shutdown_executor(TSRMLS_D)
                                                                        */
 
        zend_try {
-               clean_non_persistent_constants();
+               clean_non_persistent_constants(TSRMLS_C);
 #if ZEND_DEBUG
        signal(SIGSEGV, original_sigsegv_handler);
 #endif
@@ -202,10 +202,8 @@ void shutdown_executor(TSRMLS_D)
 }
 
 
-ZEND_API char *get_active_function_name()
+ZEND_API char *get_active_function_name(TSRMLS_D)
 {
-       TSRMLS_FETCH();
-
        switch(EG(function_state_ptr)->function->type) {
                case ZEND_USER_FUNCTION: {
                                char *function_name = ((zend_op_array *) EG(function_state_ptr)->function)->function_name;
@@ -246,10 +244,8 @@ ZEND_API uint zend_get_executed_lineno(TSRMLS_D)
 }
 
 
-ZEND_API zend_bool zend_is_executing()
+ZEND_API zend_bool zend_is_executing(TSRMLS_D)
 {
-       TSRMLS_FETCH();
-
        return EG(in_execution);
 }
 
@@ -280,6 +276,7 @@ ZEND_API int zval_update_constant(zval **pp, void *arg)
        zval *p = *pp;
        zend_bool inline_change = (zend_bool) (unsigned long) arg;
        zval const_value;
+       TSRMLS_FETCH();
 
        if (p->type == IS_CONSTANT) {
                int refcount;
@@ -289,7 +286,7 @@ ZEND_API int zval_update_constant(zval **pp, void *arg)
 
                refcount = p->refcount;
 
-               if (!zend_get_constant(p->value.str.val, p->value.str.len, &const_value)) {
+               if (!zend_get_constant(p->value.str.val, p->value.str.len, &const_value TSRMLS_CC)) {
                        zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'",
                                                p->value.str.val,
                                                p->value.str.val);
@@ -326,7 +323,7 @@ ZEND_API int zval_update_constant(zval **pp, void *arg)
                                zend_hash_move_forward(p->value.ht);
                                continue;
                        }
-                       if (!zend_get_constant(str_index, str_index_len-1, &const_value)) {
+                       if (!zend_get_constant(str_index, str_index_len-1, &const_value TSRMLS_CC)) {
                                zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'",     str_index, str_index);
                                zend_hash_move_forward(p->value.ht);
                                continue;
@@ -349,7 +346,7 @@ ZEND_API int zval_update_constant(zval **pp, void *arg)
 }
 
 
-int call_user_function(HashTable *function_table, zval **object_pp, zval *function_name, zval *retval_ptr, int param_count, zval *params[])
+int call_user_function(HashTable *function_table, zval **object_pp, zval *function_name, zval *retval_ptr, int param_count, zval *params[] TSRMLS_DC)
 {
        zval ***params_array = (zval ***) emalloc(sizeof(zval **)*param_count);
        int i;
@@ -359,7 +356,7 @@ int call_user_function(HashTable *function_table, zval **object_pp, zval *functi
        for (i=0; i<param_count; i++) {
                params_array[i] = &params[i];
        }
-       ex_retval = call_user_function_ex(function_table, object_pp, function_name, &local_retval_ptr, param_count, params_array, 1, NULL);
+       ex_retval = call_user_function_ex(function_table, object_pp, function_name, &local_retval_ptr, param_count, params_array, 1, NULL TSRMLS_CC);
        if (local_retval_ptr) {
                COPY_PZVAL_TO_ZVAL(*retval_ptr, local_retval_ptr);
        } else {
@@ -370,7 +367,7 @@ int call_user_function(HashTable *function_table, zval **object_pp, zval *functi
 }
 
 
-int call_user_function_ex(HashTable *function_table, zval **object_pp, zval *function_name, zval **retval_ptr_ptr, int param_count, zval **params[], int no_separation, HashTable *symbol_table)
+int call_user_function_ex(HashTable *function_table, zval **object_pp, zval *function_name, zval **retval_ptr_ptr, int param_count, zval **params[], int no_separation, HashTable *symbol_table TSRMLS_DC)
 {
        int i;
        zval **original_return_value;
@@ -383,7 +380,6 @@ int call_user_function_ex(HashTable *function_table, zval **object_pp, zval *fun
        int (*orig_unary_op)(zval *result, zval *op1);
        int (*orig_binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC);
        zval function_name_copy;
-       TSRMLS_FETCH();
 
        *retval_ptr_ptr = NULL;
 
@@ -781,10 +777,8 @@ void zend_set_timeout(long seconds)
 }
 
 
-void zend_unset_timeout(void)
+void zend_unset_timeout(TSRMLS_D)
 {
-       TSRMLS_FETCH();
-
 #ifdef ZEND_WIN32
        PostThreadMessage(timeout_thread_id, WM_UNREGISTER_ZEND_TIMEOUT, (WPARAM) GetCurrentThreadId(), (LPARAM) 0);
 #else
index dee5a30e0e87513cfbaf48663f8f241dde6d30a8..c8af224c60eecc6b35691b3029c2c68dff215ed5 100644 (file)
@@ -81,14 +81,13 @@ ZEND_API void zend_html_puts(char *s, uint len)
 
 
 
-ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini)
+ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC)
 {
        zval token;
        int token_type;
        char *last_color = syntax_highlighter_ini->highlight_html;
        char *next_color;
        int in_string=0;
-       TSRMLS_FETCH();
 
        zend_printf("<code>");
        zend_printf("<font color=\"%s\">\n", last_color);
index 60081a80327a71bc856931ee7be8d82cc5a5d63f..75ce879fc0dd8f824fb6ef17d054593c232a06ca 100644 (file)
@@ -39,7 +39,7 @@ typedef struct _zend_syntax_highlighter_ini {
 
 
 BEGIN_EXTERN_C()
-ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini);
+ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC);
 ZEND_API int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC);
 ZEND_API int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name TSRMLS_DC);
 ZEND_API void zend_html_putc(char c);
index 846e89302793eef487a07392af2f14d3c8c65179..7595b8259a8f094782c415032fb3e3c22936274e 100644 (file)
@@ -298,19 +298,6 @@ ZEND_API char *zend_ini_string(char *name, uint name_length, int orig)
 }
 
 
-zend_ini_entry *get_ini_entry(char *name, uint name_length)
-{
-       zend_ini_entry *ini_entry;
-       TSRMLS_FETCH();
-
-       if (zend_hash_find(&EG(ini_directives), name, name_length, (void **) &ini_entry)==SUCCESS) {
-               return ini_entry;
-       } else {
-               return NULL;
-       }
-}
-
-
 static void zend_ini_displayer_cb(zend_ini_entry *ini_entry, int type)
 {
        if (ini_entry->displayer) {
index 25a0b3916a50f290ad251570d83fdaf5afa89ab7..54e7ce98cafa7ca8d002e94bc6298f1cc75a5328 100644 (file)
@@ -100,7 +100,6 @@ ZEND_API void display_ini_entries(zend_module_entry *module);
 ZEND_API long zend_ini_long(char *name, uint name_length, int orig);
 ZEND_API double zend_ini_double(char *name, uint name_length, int orig);
 ZEND_API char *zend_ini_string(char *name, uint name_length, int orig);
-zend_ini_entry *get_ini_entry(char *name, uint name_length);
 
 ZEND_API int zend_ini_register_displayer(char *name, uint name_length, void (*displayer)(zend_ini_entry *ini_entry, int type));
 
index 7e003a7a0e0524d36400c275208c96725123927d..84b414512ac89485239d24f553edb6aee668f199 100644 (file)
@@ -103,8 +103,9 @@ void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
 void zend_ini_get_constant(zval *result, zval *name)
 {
        zval z_constant;
+       TSRMLS_FETCH();
 
-       if (zend_get_constant(name->value.str.val, name->value.str.len, &z_constant)) {
+       if (zend_get_constant(name->value.str.val, name->value.str.len, &z_constant TSRMLS_CC)) {
                /* z_constant is emalloc()'d */
                convert_to_string(&z_constant);
                result->value.str.val = zend_strndup(z_constant.value.str.val, z_constant.value.str.len);
index 259bd1a947d5b9778b061aec92278a08d8f4a094..213a92ef74f03d86cd4892e0d887a39e04463ac6 100644 (file)
@@ -174,7 +174,7 @@ static inline void restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
        CG(ZFL) = lex_state->ZFL;
 #endif
        CG(zend_lineno) = lex_state->lineno;
-       zend_restore_compiled_filename(lex_state->filename);
+       zend_restore_compiled_filename(lex_state->filename TSRMLS_CC);
 }
 
 
@@ -314,7 +314,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
                file_path = file_handle->filename;
        }
 
-       zend_set_compiled_filename(file_path);
+       zend_set_compiled_filename(file_path TSRMLS_CC);
        CG(zend_lineno) = 1;
        return SUCCESS;
 }
@@ -431,7 +431,7 @@ static inline int prepare_string_for_scanning(zval *str, istrstream **input_stre
 
        CG(ZFL)->switch_streams(*input_stream, &cout);
 #endif
-       zend_set_compiled_filename(filename);
+       zend_set_compiled_filename(filename TSRMLS_CC);
        CG(zend_lineno) = 1;
        return SUCCESS;
 }