summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2001-07-30 07:43:02 +0000
committerZeev Suraski <zeev@php.net>2001-07-30 07:43:02 +0000
commit4187439cfffdbb2573453ea41a3c344632405f47 (patch)
tree747e0707e4786abb924df4fdf397abfbb006c160
parent797a079a95585a07bc7f26a79e04521d3b370177 (diff)
downloadphp-git-4187439cfffdbb2573453ea41a3c344632405f47.tar.gz
More TSRMLS_FETCH work
-rw-r--r--Zend/zend.c10
-rw-r--r--Zend/zend_API.c20
-rw-r--r--Zend/zend_API.h10
-rw-r--r--Zend/zend_builtin_functions.c2
-rw-r--r--Zend/zend_compile.c11
-rw-r--r--Zend/zend_compile.h6
-rw-r--r--Zend/zend_constants.c11
-rw-r--r--Zend/zend_constants.h6
-rw-r--r--Zend/zend_execute.c5
-rw-r--r--Zend/zend_execute.h6
-rw-r--r--Zend/zend_execute_API.c28
-rw-r--r--Zend/zend_highlight.c3
-rw-r--r--Zend/zend_highlight.h2
-rw-r--r--Zend/zend_ini.c13
-rw-r--r--Zend/zend_ini.h1
-rw-r--r--Zend/zend_ini_parser.y3
-rw-r--r--Zend/zend_language_scanner.l6
17 files changed, 56 insertions, 87 deletions
diff --git a/Zend/zend.c b/Zend/zend.c
index 7ac0c69fab..fea898e9ce 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -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 {
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 7ca7d72533..25cc7a034e 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -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));
}
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index 31a7261029..29dcbc7e88 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -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, ...);
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index 11cf531837..b6defd3557 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -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 {
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index c7e9ef3925..149c009aa2 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -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);
}
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index c9b9f6d989..6fd2ac1e77 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -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);
diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c
index 59920c1404..bf6a42c279 100644
--- a/Zend/zend_constants.c
+++ b/Zend/zend_constants.c
@@ -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);
diff --git a/Zend/zend_constants.h b/Zend/zend_constants.h
index a35332d735..0540418506 100644
--- a/Zend/zend_constants.h
+++ b/Zend/zend_constants.h
@@ -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);
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index c76ccd9e2e..3de49b8d54 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -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;
diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h
index 058b5d81e1..9f52f3707d 100644
--- a/Zend/zend_execute.h
+++ b/Zend/zend_execute.h
@@ -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
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 523b8dd2ad..9646eaf49e 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -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
diff --git a/Zend/zend_highlight.c b/Zend/zend_highlight.c
index dee5a30e0e..c8af224c60 100644
--- a/Zend/zend_highlight.c
+++ b/Zend/zend_highlight.c
@@ -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);
diff --git a/Zend/zend_highlight.h b/Zend/zend_highlight.h
index 60081a8032..75ce879fc0 100644
--- a/Zend/zend_highlight.h
+++ b/Zend/zend_highlight.h
@@ -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);
diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c
index 846e893027..7595b8259a 100644
--- a/Zend/zend_ini.c
+++ b/Zend/zend_ini.c
@@ -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) {
diff --git a/Zend/zend_ini.h b/Zend/zend_ini.h
index 25a0b3916a..54e7ce98ca 100644
--- a/Zend/zend_ini.h
+++ b/Zend/zend_ini.h
@@ -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));
diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y
index 7e003a7a0e..84b414512a 100644
--- a/Zend/zend_ini_parser.y
+++ b/Zend/zend_ini_parser.y
@@ -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);
diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l
index 259bd1a947..213a92ef74 100644
--- a/Zend/zend_language_scanner.l
+++ b/Zend/zend_language_scanner.l
@@ -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;
}