cvs: php4 /ext/db db.c php_db.h /ext/ingres_ii ii.c /ext/interbase interbase.c /ext/msql php_msql.c /ext/mssql php_mssql.c /ext/mysql php_mysql.c
/ext/pcre php_pcre.c /ext/pgsql pgsql.c /ext/session session.c /ext/standard array.c crypt.c exec.c file.c lcg.c php_lcg.h php_string.h string.c
uniqid.c /ext/sybase php_sybase_db.c /ext/sybase_ct php_sybase_ct.c /ext/zlib zlib.c /main php_variables.c

From: Date: Mon, 06 Aug 2001 03:50:53 +0000
Subject: cvs: php4 /ext/db db.c php_db.h /ext/ingres_ii ii.c /ext/interbase interbase.c /ext/msql php_msql.c /ext/mssql php_mssql.c /ext/mysql php_mysql.c
/ext/pcre php_pcre.c /ext/pgsql pgsql.c /ext/session session.c /ext/standard array.c crypt.c exec.c file.c lcg.c php_lcg.h php_string.h string.c
uniqid.c /ext/sybase php_sybase_db.c /ext/sybase_ct php_sybase_ct.c /ext/zlib zlib.c /main php_variables.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-6592@lists.php.net to get a copy of this message
sas Sun Aug 5 23:50:53 2001 EDT Modified files: /php4/ext/db db.c php_db.h /php4/ext/ingres_ii ii.c /php4/ext/interbase interbase.c /php4/ext/msql php_msql.c /php4/ext/mssql php_mssql.c /php4/ext/mysql php_mysql.c /php4/ext/pcre php_pcre.c /php4/ext/pgsql pgsql.c /php4/ext/session session.c /php4/ext/standard array.c crypt.c exec.c file.c lcg.c php_lcg.h php_string.h string.c uniqid.c /php4/ext/sybase php_sybase_db.c /php4/ext/sybase_ct php_sybase_ct.c /php4/ext/zlib zlib.c /php4/main php_variables.c Log: more tsrm cleanup

Index: php4/ext/db/db.c diff -u php4/ext/db/db.c:1.59 php4/ext/db/db.c:1.60 --- php4/ext/db/db.c:1.59 Sat Aug 4 21:42:33 2001 +++ php4/ext/db/db.c Sun Aug 5 23:50:46 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: db.c,v 1.59 2001/08/05 01:42:33 zeev Exp $ */ +/* $Id: db.c,v 1.60 2001/08/06 03:50:46 sas Exp $ */ #define IS_EXT_MODULE #if 1 @@ -497,7 +497,7 @@ RETURN_FALSE; } - ret = php_dbm_insert(info, Z_STRVAL_P(key), Z_STRVAL_P(value)); + ret = php_dbm_insert(info, Z_STRVAL_P(key), Z_STRVAL_P(value) TSRMLS_CC); RETURN_LONG(ret); } /* }}} */ @@ -505,13 +505,13 @@ /* {{{ php_dbm_insert */ -int php_dbm_insert(dbm_info *info, char *key, char *value) { +int php_dbm_insert(dbm_info *info, char *key, char *value TSRMLS_DC) { datum key_datum, value_datum; int ret; DBM_TYPE dbf; - php_stripslashes(key,NULL); - php_stripslashes(value,NULL); + php_stripslashes(key, NULL TSRMLS_CC); + php_stripslashes(value, NULL TSRMLS_CC); value_datum.dptr = estrdup(value); value_datum.dsize = strlen(value); @@ -571,8 +571,8 @@ datum key_datum, value_datum; if (PG(magic_quotes_runtime)) { - php_stripslashes(key,NULL); - php_stripslashes(value,NULL); + php_stripslashes(key, NULL TSRMLS_CC); + php_stripslashes(value, NULL TSRMLS_CC); } value_datum.dptr = estrdup(value); @@ -669,7 +669,7 @@ ret = NULL; if (ret && PG(magic_quotes_runtime)) { - ret = php_addslashes(ret, value_datum.dsize, NULL, 1); + ret = php_addslashes(ret, value_datum.dsize, NULL, 1 TSRMLS_CC); } return(ret); } @@ -903,7 +903,7 @@ else ret=NULL; if (ret && PG(magic_quotes_runtime)) { - ret = php_addslashes(ret, ret_datum.dsize, NULL, 1); + ret = php_addslashes(ret, ret_datum.dsize, NULL, 1 TSRMLS_CC); } return(ret); } Index: php4/ext/db/php_db.h diff -u php4/ext/db/php_db.h:1.11 php4/ext/db/php_db.h:1.12 --- php4/ext/db/php_db.h:1.11 Tue Jul 31 01:43:51 2001 +++ php4/ext/db/php_db.h Sun Aug 5 23:50:46 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_db.h,v 1.11 2001/07/31 05:43:51 zeev Exp $ */ +/* $Id: php_db.h,v 1.12 2001/08/06 03:50:46 sas Exp $ */ #ifndef PHP_DB_H @@ -54,7 +54,7 @@ dbm_info *php_find_dbm(pval *id); int php_dbm_close(zend_rsrc_list_entry *rsrc TSRMLS_DC); dbm_info *php_dbm_open(char *filename, char *mode); -int php_dbm_insert(dbm_info *info, char *key, char *value); +int php_dbm_insert(dbm_info *info, char *key, char *value TSRMLS_DC); char *php_dbm_fetch(dbm_info *info, char *key); int php_dbm_replace(dbm_info *info, char *key, char *value); int php_dbm_exists(dbm_info *info, char *key); Index: php4/ext/ingres_ii/ii.c diff -u php4/ext/ingres_ii/ii.c:1.23 php4/ext/ingres_ii/ii.c:1.24 --- php4/ext/ingres_ii/ii.c:1.23 Tue Jul 31 01:43:56 2001 +++ php4/ext/ingres_ii/ii.c Sun Aug 5 23:50:46 2001 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: ii.c,v 1.23 2001/07/31 05:43:56 zeev Exp $ */ +/* $Id: ii.c,v 1.24 2001/08/06 03:50:46 sas Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -990,7 +990,7 @@ /* Fetch a row of result */ -static void php_ii_fetch(INTERNAL_FUNCTION_PARAMETERS, II_LINK *ii_link, int result_type) +static void php_ii_fetch(INTERNAL_FUNCTION_PARAMETERS, II_LINK *ii_link, int result_type TSRMLS_DC) { IIAPI_GETCOLPARM getColParm; IIAPI_DATAVALUE *columnData; @@ -1133,7 +1133,7 @@ } /* use php_addslashes if asked to */ if(PG(magic_quotes_runtime)) { - value_char_p = php_addslashes((char *) columnData[k-1].dv_value,columnData[k-1].dv_length,&len,0); + value_char_p = php_addslashes((char *) columnData[k-1].dv_value,columnData[k-1].dv_length,&len,0 TSRMLS_CC); should_copy = 0; } else { value_char_p = (char *) columnData[k-1].dv_value; @@ -1198,7 +1198,7 @@ ZEND_FETCH_RESOURCE2(ii_link, II_LINK *, link, link_id, "Ingres II Link", le_ii_link, le_ii_plink); php_ii_fetch(INTERNAL_FUNCTION_PARAM_PASSTHRU, ii_link, - (argc == 0 ? II_BOTH : Z_LVAL_PP(result_type))); + (argc == 0 ? II_BOTH : Z_LVAL_PP(result_type)) TSRMLS_CC); } /* }}} */ @@ -1222,7 +1222,7 @@ ZEND_FETCH_RESOURCE2(ii_link, II_LINK *, link, link_id, "Ingres II Link", le_ii_link, le_ii_plink); - php_ii_fetch(INTERNAL_FUNCTION_PARAM_PASSTHRU, ii_link, II_NUM); + php_ii_fetch(INTERNAL_FUNCTION_PARAM_PASSTHRU, ii_link, II_NUM TSRMLS_CC); } /* }}} */ @@ -1251,7 +1251,7 @@ ZEND_FETCH_RESOURCE2(ii_link, II_LINK *, link, link_id, "Ingres II Link", le_ii_link, le_ii_plink); php_ii_fetch(INTERNAL_FUNCTION_PARAM_PASSTHRU, ii_link, - (argc == 0 ? II_BOTH : Z_LVAL_PP(result_type))); + (argc == 0 ? II_BOTH : Z_LVAL_PP(result_type)) TSRMLS_CC); if(Z_TYPE_P(return_value)==IS_ARRAY) { convert_to_object(return_value); } Index: php4/ext/interbase/interbase.c diff -u php4/ext/interbase/interbase.c:1.64 php4/ext/interbase/interbase.c:1.65 --- php4/ext/interbase/interbase.c:1.64 Tue Jul 31 01:56:22 2001 +++ php4/ext/interbase/interbase.c Sun Aug 5 23:50:47 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: interbase.c,v 1.64 2001/07/31 05:56:22 zeev Exp $ */ +/* $Id: interbase.c,v 1.65 2001/08/06 03:50:47 sas Exp $ */ /* TODO: Arrays, roles? @@ -577,7 +577,7 @@ php_info_print_table_start(); php_info_print_table_row(2, "Interbase Support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.64 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.65 $"); #ifdef COMPILE_DL_INTERBASE php_info_print_table_row(2, "Dynamic Module", "yes"); #endif @@ -1673,10 +1673,9 @@ /* }}} */ /* {{{ _php_ibase_var_pval() */ -static int _php_ibase_var_pval(pval *val, void *data, int type, int len, int scale, int flag) +static int _php_ibase_var_pval(pval *val, void *data, int type, int len, int scale, int flag TSRMLS_DC) { char string_data[255]; - TSRMLS_FETCH(); switch(type & ~1) { case SQL_VARYING: @@ -1688,7 +1687,7 @@ memcpy(val->value.str.val, data, len); val->value.str.val[len] = '\0'; if (PG(magic_quotes_runtime)) { - val->value.str.val = php_addslashes(val->value.str.val, len, &len, 1); + val->value.str.val = php_addslashes(val->value.str.val, len, &len, 1 TSRMLS_CC); } val->type = IS_STRING; val->value.str.len = len; @@ -1811,7 +1810,7 @@ /* {{{ _php_ibase_arr_pval() */ /* create multidimension array - resursion function (*datap) argument changed */ -static int _php_ibase_arr_pval(pval *ar_pval, char **datap, ibase_array *ib_array, int dim, int flag) +static int _php_ibase_arr_pval(pval *ar_pval, char **datap, ibase_array *ib_array, int dim, int flag TSRMLS_DC) { pval tmp; int i, dim_len, l_bound, u_bound; @@ -1829,7 +1828,7 @@ if (dim < ib_array->ar_desc.array_desc_dimensions - 1) { /* array again */ for (i = 0; i < dim_len; i++) { /* recursion here */ - if (_php_ibase_arr_pval(ar_pval, datap, ib_array, dim+1, flag) == FAILURE) { + if (_php_ibase_arr_pval(ar_pval, datap, ib_array, dim+1, flag TSRMLS_CC) == FAILURE) { return FAILURE; } } @@ -1841,7 +1840,7 @@ if (_php_ibase_var_pval(&tmp, *datap, ib_array->el_type, ib_array->ar_desc.array_desc_length, ib_array->ar_desc.array_desc_scale, - flag) == FAILURE){ + flag TSRMLS_CC) == FAILURE){ return FAILURE; } /* FIXME ??? */ @@ -1937,7 +1936,7 @@ case SQL_TYPE_DATE: case SQL_TYPE_TIME: #endif - _php_ibase_var_pval(tmp, var->sqldata, var->sqltype, var->sqllen, var->sqlscale, flag); + _php_ibase_var_pval(tmp, var->sqldata, var->sqltype, var->sqllen, var->sqlscale, flag TSRMLS_CC); break; case SQL_BLOB: if (flag & PHP_IBASE_TEXT) { /* text ? */ @@ -2030,7 +2029,7 @@ } tmp_ptr = ar_data; /* avoid changes in _arr_pval */ - if (_php_ibase_arr_pval(tmp, &tmp_ptr, ib_array, 0, flag) == FAILURE) { + if (_php_ibase_arr_pval(tmp, &tmp_ptr, ib_array, 0, flag TSRMLS_CC) == FAILURE) { RETURN_FALSE; } efree(ar_data); Index: php4/ext/msql/php_msql.c diff -u php4/ext/msql/php_msql.c:1.38 php4/ext/msql/php_msql.c:1.39 --- php4/ext/msql/php_msql.c:1.38 Tue Jul 31 01:43:58 2001 +++ php4/ext/msql/php_msql.c Sun Aug 5 23:50:47 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_msql.c,v 1.38 2001/07/31 05:43:58 zeev Exp $ */ +/* $Id: php_msql.c,v 1.39 2001/08/06 03:50:47 sas Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -844,7 +844,7 @@ if (sql_row[field_offset]) { if (PG(magic_quotes_runtime)) { - return_value->value.str.val = php_addslashes(sql_row[field_offset],0,&return_value->value.str.len,0); + return_value->value.str.val = php_addslashes(sql_row[field_offset],0,&return_value->value.str.len,0 TSRMLS_CC); } else { return_value->value.str.len = (sql_row[field_offset]?strlen(sql_row[field_offset]):0); return_value->value.str.val = (char *) safe_estrndup(sql_row[field_offset],return_value->value.str.len); @@ -943,7 +943,7 @@ int should_copy; if (PG(magic_quotes_runtime)) { - data = php_addslashes(msql_row[i], 0, &data_len, 0); + data = php_addslashes(msql_row[i], 0, &data_len, 0 TSRMLS_CC); should_copy = 0; } else { data = msql_row[i]; Index: php4/ext/mssql/php_mssql.c diff -u php4/ext/mssql/php_mssql.c:1.65 php4/ext/mssql/php_mssql.c:1.66 --- php4/ext/mssql/php_mssql.c:1.65 Sun Aug 5 11:55:41 2001 +++ php4/ext/mssql/php_mssql.c Sun Aug 5 23:50:47 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_mssql.c,v 1.65 2001/08/05 15:55:41 sas Exp $ */ +/* $Id: php_mssql.c,v 1.66 2001/08/06 03:50:47 sas Exp $ */ #ifdef COMPILE_DL_MSSQL #define HAVE_MSSQL 1 @@ -1166,7 +1166,7 @@ if (Z_TYPE(result->data[result->cur_row][i]) == IS_STRING) { if (PG(magic_quotes_runtime)) { - data = php_addslashes(Z_STRVAL(result->data[result->cur_row][i]), Z_STRLEN(result->data[result->cur_row][i]), &result->data[result->cur_row][i].value.str.len, 1); + data = php_addslashes(Z_STRVAL(result->data[result->cur_row][i]), Z_STRLEN(result->data[result->cur_row][i]), &result->data[result->cur_row][i].value.str.len, 1 TSRMLS_CC); should_copy = 0; } else Index: php4/ext/mysql/php_mysql.c diff -u php4/ext/mysql/php_mysql.c:1.94 php4/ext/mysql/php_mysql.c:1.95 --- php4/ext/mysql/php_mysql.c:1.94 Tue Jul 31 01:43:59 2001 +++ php4/ext/mysql/php_mysql.c Sun Aug 5 23:50:48 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_mysql.c,v 1.94 2001/07/31 05:43:59 zeev Exp $ */ +/* $Id: php_mysql.c,v 1.95 2001/08/06 03:50:48 sas Exp $ */ /* TODO: @@ -1462,7 +1462,7 @@ return_value->type = IS_STRING; if (PG(magic_quotes_runtime)) { - return_value->value.str.val = php_addslashes(sql_row[field_offset], sql_row_lengths[field_offset],&return_value->value.str.len, 0); + return_value->value.str.val = php_addslashes(sql_row[field_offset], sql_row_lengths[field_offset],&return_value->value.str.len, 0 TSRMLS_CC); } else { return_value->value.str.len = sql_row_lengths[field_offset]; return_value->value.str.val = (char *) safe_estrndup(sql_row[field_offset], return_value->value.str.len); @@ -1569,7 +1569,7 @@ int should_copy; if (PG(magic_quotes_runtime)) { - data = php_addslashes(mysql_row[i], mysql_row_lengths[i],&data_len, 0); + data = php_addslashes(mysql_row[i], mysql_row_lengths[i],&data_len, 0 TSRMLS_CC); should_copy = 0; } else { data = mysql_row[i]; Index: php4/ext/pcre/php_pcre.c diff -u php4/ext/pcre/php_pcre.c:1.107 php4/ext/pcre/php_pcre.c:1.108 --- php4/ext/pcre/php_pcre.c:1.107 Mon Jul 30 11:41:11 2001 +++ php4/ext/pcre/php_pcre.c Sun Aug 5 23:50:48 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_pcre.c,v 1.107 2001/07/30 15:41:11 andrei Exp $ */ +/* $Id: php_pcre.c,v 1.108 2001/08/06 03:50:48 sas Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -569,7 +569,7 @@ /* {{{ preg_do_eval */ static int preg_do_eval(char *eval_str, int eval_str_len, char *subject, - int *offsets, int count, char **result) + int *offsets, int count, char **result TSRMLS_DC) { zval retval; /* Return value from evaluation */ char *eval_str_end, /* End of eval string */ @@ -584,7 +584,6 @@ int backref; /* Current backref */ char *compiled_string_description; smart_str code = {0}; - TSRMLS_FETCH(); eval_str_end = eval_str + eval_str_len; walk = segment = eval_str; @@ -608,7 +607,7 @@ match = subject + offsets[backref<<1]; match_len = offsets[(backref<<1)+1] - offsets[backref<<1]; if (match_len) - esc_match = php_addslashes(match, match_len, &esc_match_len, 0); + esc_match = php_addslashes(match, match_len, &esc_match_len, 0 TSRMLS_CC); else { esc_match = match; esc_match_len = 0; @@ -663,7 +662,7 @@ char *php_pcre_replace(char *regex, int regex_len, char *subject, int subject_len, zval *replace_val, int is_callable_replace, - int *result_len, int limit) + int *result_len, int limit TSRMLS_DC) { pcre *re = NULL; /* Compiled regular expression */ pcre_extra *extra = NULL; /* Holds results of studying */ @@ -745,7 +744,7 @@ /* If evaluating, do it and add the return string's length */ if (eval) { eval_result_len = preg_do_eval(replace, replace_len, subject, - offsets, count, &eval_result); + offsets, count, &eval_result TSRMLS_CC); new_len += eval_result_len; } else if (is_callable_replace) { /* Use custom function to get replacement string and its length. */ @@ -871,7 +870,7 @@ /* {{{ php_replace_in_subject */ -static char *php_replace_in_subject(zval *regex, zval *replace, zval **subject, int *result_len, int limit, zend_bool is_callable_replace) +static char *php_replace_in_subject(zval *regex, zval *replace, zval **subject, int *result_len, int limit, zend_bool is_callable_replace TSRMLS_DC) { zval **regex_entry, **replace_entry = NULL, @@ -924,7 +923,7 @@ replace_value, is_callable_replace, result_len, - limit)) != NULL) { + limit TSRMLS_CC)) != NULL) { efree(subject_value); subject_value = result; subject_len = *result_len; @@ -942,7 +941,7 @@ replace, is_callable_replace, result_len, - limit); + limit TSRMLS_CC); return result; } } @@ -1004,7 +1003,7 @@ /* For each subject entry, convert it to string, then perform replacement and add the result to the return_value array. */ while (zend_hash_get_current_data(Z_ARRVAL_PP(subject), (void **)&subject_entry) == SUCCESS) { - if ((result = php_replace_in_subject(*regex, *replace, subject_entry, &result_len, limit_val, is_callable_replace)) != NULL) { + if ((result = php_replace_in_subject(*regex, *replace, subject_entry, &result_len, limit_val, is_callable_replace TSRMLS_CC)) != NULL) { /* Add to return array */ switch(zend_hash_get_current_key(Z_ARRVAL_PP(subject), &string_key, &num_key, 0)) { @@ -1022,7 +1021,7 @@ } } else { /* if subject is not an array */ - if ((result = php_replace_in_subject(*regex, *replace, subject, &result_len, limit_val, is_callable_replace)) != NULL) { + if ((result = php_replace_in_subject(*regex, *replace, subject, &result_len, limit_val, is_callable_replace TSRMLS_CC)) != NULL) { RETVAL_STRINGL(result, result_len, 0); } } Index: php4/ext/pgsql/pgsql.c diff -u php4/ext/pgsql/pgsql.c:1.124 php4/ext/pgsql/pgsql.c:1.125 --- php4/ext/pgsql/pgsql.c:1.124 Sun Aug 5 12:21:30 2001 +++ php4/ext/pgsql/pgsql.c Sun Aug 5 23:50:50 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pgsql.c,v 1.124 2001/08/05 16:21:30 sas Exp $ */ +/* $Id: pgsql.c,v 1.125 2001/08/06 03:50:50 sas Exp $ */ #include <stdlib.h> @@ -1208,7 +1208,7 @@ int should_copy=0; if (PG(magic_quotes_runtime)) { - data = php_addslashes(element, element_len, &data_len, 0); + data = php_addslashes(element, element_len, &data_len, 0 TSRMLS_CC); } else { data = safe_estrndup(element, element_len); data_len = element_len; Index: php4/ext/session/session.c diff -u php4/ext/session/session.c:1.233 php4/ext/session/session.c:1.234 --- php4/ext/session/session.c:1.233 Sun Aug 5 12:52:25 2001 +++ php4/ext/session/session.c Sun Aug 5 23:50:50 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: session.c,v 1.233 2001/08/05 16:52:25 sas Exp $ */ +/* $Id: session.c,v 1.234 2001/08/06 03:50:50 sas Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -471,7 +471,7 @@ gettimeofday(&tv, NULL); PHP_MD5Init(&context); - sprintf(buf, "%ld%ld%0.8f", tv.tv_sec, tv.tv_usec, php_combined_lcg() * 10); + sprintf(buf, "%ld%ld%0.8f", tv.tv_sec, tv.tv_usec, php_combined_lcg(TSRMLS_C) * 10); PHP_MD5Update(&context, buf, strlen(buf)); if (PS(entropy_length) > 0) { @@ -888,7 +888,7 @@ if (PS(mod_data) && PS(gc_probability) > 0) { int nrdels = -1; - nrand = (int) (100.0*php_combined_lcg()); + nrand = (int) (100.0*php_combined_lcg(TSRMLS_C)); if (nrand < PS(gc_probability)) { PS(mod)->gc(&PS(mod_data), PS(gc_maxlifetime), &nrdels); #if 0 Index: php4/ext/standard/array.c diff -u php4/ext/standard/array.c:1.120 php4/ext/standard/array.c:1.121 --- php4/ext/standard/array.c:1.120 Sat Aug 4 12:54:20 2001 +++ php4/ext/standard/array.c Sun Aug 5 23:50:50 2001 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: array.c,v 1.120 2001/08/04 16:54:20 andrei Exp $ */ +/* $Id: array.c,v 1.121 2001/08/06 03:50:50 sas Exp $ */ #include "php.h" #include "php_ini.h" @@ -96,10 +96,8 @@ return SUCCESS; } -static void set_compare_func(int sort_type) +static void set_compare_func(int sort_type TSRMLS_DC) { - TSRMLS_FETCH(); - switch (sort_type) { case SORT_NUMERIC: ARRAYG(compare_func) = numeric_compare_function; @@ -197,7 +195,7 @@ convert_to_long_ex(sort_type); sort_type_val = Z_LVAL_PP(sort_type); } - set_compare_func(sort_type_val); + set_compare_func(sort_type_val TSRMLS_CC); if (zend_hash_sort(target_hash, qsort, array_reverse_key_compare, 0) == FAILURE) { return; } @@ -226,7 +224,7 @@ convert_to_long_ex(sort_type); sort_type_val = Z_LVAL_PP(sort_type); } - set_compare_func(sort_type_val); + set_compare_func(sort_type_val TSRMLS_CC); if (zend_hash_sort(target_hash, qsort, array_key_compare,0) == FAILURE) { return; } @@ -421,7 +419,7 @@ convert_to_long_ex(sort_type); sort_type_val = Z_LVAL_PP(sort_type); } - set_compare_func(sort_type_val); + set_compare_func(sort_type_val TSRMLS_CC); if (zend_hash_sort(target_hash, qsort, array_data_compare,0) == FAILURE) { return; } @@ -450,7 +448,7 @@ convert_to_long_ex(sort_type); sort_type_val = Z_LVAL_PP(sort_type); } - set_compare_func(sort_type_val); + set_compare_func(sort_type_val TSRMLS_CC); if (zend_hash_sort(target_hash, qsort, array_reverse_data_compare,0) == FAILURE) { RETURN_FALSE; } @@ -479,7 +477,7 @@ convert_to_long_ex(sort_type); sort_type_val = Z_LVAL_PP(sort_type); } - set_compare_func(sort_type_val); + set_compare_func(sort_type_val TSRMLS_CC); if (zend_hash_sort(target_hash, qsort, array_data_compare,1) == FAILURE) { RETURN_FALSE; } @@ -508,7 +506,7 @@ convert_to_long_ex(sort_type); sort_type_val = Z_LVAL_PP(sort_type); } - set_compare_func(sort_type_val); + set_compare_func(sort_type_val TSRMLS_CC); if (zend_hash_sort(target_hash, qsort, array_reverse_data_compare,1) == FAILURE) { RETURN_FALSE; } @@ -851,7 +849,7 @@ php_error(E_WARNING, "min: must be passed at least 1 value"); RETURN_NULL(); } - set_compare_func(SORT_REGULAR); + set_compare_func(SORT_REGULAR TSRMLS_CC); if (argc == 1) { pval **arr; @@ -903,7 +901,7 @@ php_error(E_WARNING, "max: must be passed at least 1 value"); RETURN_NULL(); } - set_compare_func(SORT_REGULAR); + set_compare_func(SORT_REGULAR TSRMLS_CC); if (argc == 1) { pval **arr; @@ -944,7 +942,7 @@ } /* }}} */ -static int php_array_walk(HashTable *target_hash, zval **userdata) +static int php_array_walk(HashTable *target_hash, zval **userdata TSRMLS_DC) { zval **args[3], /* Arguments to userland function */ *retval_ptr, /* Return value - unused */ @@ -953,7 +951,6 @@ ulong string_key_len; ulong num_key; HashPosition pos; - TSRMLS_FETCH(); /* Allocate space for key */ MAKE_STD_ZVAL(key); @@ -1023,7 +1020,7 @@ BG(array_walk_func_name) = old_walk_func_name; RETURN_FALSE; } - php_array_walk(target_hash, userdata); + php_array_walk(target_hash, userdata TSRMLS_CC); BG(array_walk_func_name) = old_walk_func_name; RETURN_TRUE; } @@ -2276,7 +2273,7 @@ for (i = 0, p = target_hash->pListHead; p; i++, p = p->pListNext) arTmp[i] = p; arTmp[i] = NULL; - set_compare_func(SORT_STRING); + set_compare_func(SORT_STRING TSRMLS_CC); qsort((void *) arTmp, i, sizeof(Bucket *), array_data_compare); /* go through the sorted array and delete duplicates from the copy */ @@ -2319,7 +2316,7 @@ /* for each argument, create and sort list with pointers to the hash buckets */ lists = (Bucket ***)emalloc(argc * sizeof(Bucket **)); ptrs = (Bucket ***)emalloc(argc * sizeof(Bucket **)); - set_compare_func(SORT_STRING); + set_compare_func(SORT_STRING TSRMLS_CC); for (i=0; i<argc; i++) { if (Z_TYPE_PP(args[i]) != IS_ARRAY) { php_error(E_WARNING, "Argument #%d to array_intersect() is not an array", i+1); @@ -2424,7 +2421,7 @@ /* for each argument, create and sort list with pointers to the hash buckets */ lists = (Bucket ***)emalloc(argc * sizeof(Bucket **)); ptrs = (Bucket ***)emalloc(argc * sizeof(Bucket **)); - set_compare_func(SORT_STRING); + set_compare_func(SORT_STRING TSRMLS_CC); for (i=0; i<argc; i++) { if (Z_TYPE_PP(args[i]) != IS_ARRAY) { php_error(E_WARNING, "Argument #%d to array_diff() is not an array", i+1); @@ -2511,7 +2508,7 @@ r = 0; do { - set_compare_func(ARRAYG(multisort_flags)[MULTISORT_TYPE][r]); + set_compare_func(ARRAYG(multisort_flags)[MULTISORT_TYPE][r] TSRMLS_CC); ARRAYG(compare_func)(&temp, *((zval **)ab[r]->pData), *((zval **)bb[r]->pData) TSRMLS_CC); result = ARRAYG(multisort_flags)[MULTISORT_ORDER][r] * Z_LVAL(temp); Index: php4/ext/standard/crypt.c diff -u php4/ext/standard/crypt.c:1.43 php4/ext/standard/crypt.c:1.44 --- php4/ext/standard/crypt.c:1.43 Sat Aug 4 19:58:56 2001 +++ php4/ext/standard/crypt.c Sun Aug 5 23:50:50 2001 @@ -17,7 +17,7 @@ | Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ -/* $Id: crypt.c,v 1.43 2001/08/04 23:58:56 sniper Exp $ */ +/* $Id: crypt.c,v 1.44 2001/08/06 03:50:50 sas Exp $ */ #include <stdlib.h> #include "php.h" @@ -106,7 +106,7 @@ PHP_RINIT_FUNCTION(crypt) { if(!php_crypt_rand_seeded) { - php_srand(time(0) * getpid() * (php_combined_lcg() * 10000.0)); + php_srand(time(0) * getpid() * (php_combined_lcg(TSRMLS_C) * 10000.0)); php_crypt_rand_seeded=1; } return SUCCESS; Index: php4/ext/standard/exec.c diff -u php4/ext/standard/exec.c:1.61 php4/ext/standard/exec.c:1.62 --- php4/ext/standard/exec.c:1.61 Tue Jul 31 02:28:03 2001 +++ php4/ext/standard/exec.c Sun Aug 5 23:50:51 2001 @@ -15,7 +15,7 @@ | Author: Rasmus Lerdorf | +----------------------------------------------------------------------+ */ -/* $Id: exec.c,v 1.61 2001/07/31 06:28:03 zeev Exp $ */ +/* $Id: exec.c,v 1.62 2001/08/06 03:50:51 sas Exp $ */ #include <stdio.h> #include "php.h" @@ -201,7 +201,7 @@ if (PG(magic_quotes_runtime)) { int len; - tmp = php_addslashes(buf, 0, &len, 0); + tmp = php_addslashes(buf, 0, &len, 0 TSRMLS_CC); RETVAL_STRINGL(tmp,len,0); } else { RETVAL_STRINGL(buf,l,1); Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.180 php4/ext/standard/file.c:1.181 --- php4/ext/standard/file.c:1.180 Sun Aug 5 11:55:42 2001 +++ php4/ext/standard/file.c Sun Aug 5 23:50:51 2001 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: file.c,v 1.180 2001/08/05 15:55:42 sas Exp $ */ +/* $Id: file.c,v 1.181 2001/08/06 03:50:51 sas Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -370,7 +370,7 @@ } else if (saw_content) { /* Get the CONTENT attr (Single word attr, non-quoted) */ if (PG(magic_quotes_runtime)) { - value = php_addslashes(md.token_data,0,&md.token_len,0); + value = php_addslashes(md.token_data,0,&md.token_len,0 TSRMLS_CC); } else { value = estrndup(md.token_data,md.token_len); } @@ -408,7 +408,7 @@ } else if (saw_content) { /* Get the CONTENT attr (Single word attr, non-quoted) */ if (PG(magic_quotes_runtime)) { - value = php_addslashes(md.token_data,0,&md.token_len,0); + value = php_addslashes(md.token_data,0,&md.token_len,0 TSRMLS_CC); } else { value = estrndup(md.token_data,md.token_len); } @@ -541,7 +541,7 @@ } } if (PG(magic_quotes_runtime)) { - slashed = php_addslashes(target_buf, target_len, &len, 1); /* 1 = free source string */ + slashed = php_addslashes(target_buf, target_len, &len, 1 TSRMLS_CC); /* 1 = free source string */ add_index_stringl(return_value, i++, slashed, len, 0); } else { target_buf = erealloc(target_buf, target_len+1); /* do we really want to do that? */ @@ -1038,7 +1038,7 @@ } if (PG(magic_quotes_runtime)) { - return_value->value.str.val = php_addslashes(buf,0,&return_value->value.str.len,1); + return_value->value.str.val = php_addslashes(buf,0,&return_value->value.str.len,1 TSRMLS_CC); } else { return_value->value.str.val = buf; return_value->value.str.len = strlen(return_value->value.str.val); @@ -1308,7 +1308,7 @@ if (!arg3 && PG(magic_quotes_runtime)) { zval_copy_ctor(*arg2); - php_stripslashes((*arg2)->value.str.val,&num_bytes); + php_stripslashes(Z_STRVAL_PP(arg2), &num_bytes TSRMLS_CC); } #if HAVE_PHP_STREAM @@ -1570,8 +1570,6 @@ len = sbuf.st_size - off; p = mmap(0, len, PROT_READ, MAP_SHARED, fd, off); if (p != (void *) MAP_FAILED) { - TSRMLS_FETCH(); - BG(mmap_file) = p; BG(mmap_len) = len; PHPWRITE(p, len); @@ -2036,7 +2034,7 @@ } return_value->value.str.val[return_value->value.str.len] = 0; if (PG(magic_quotes_runtime)) { - return_value->value.str.val = php_addslashes(return_value->value.str.val,return_value->value.str.len,&return_value->value.str.len,1); + return_value->value.str.val = php_addslashes(return_value->value.str.val,return_value->value.str.len,&return_value->value.str.len,1 TSRMLS_CC); } return_value->type = IS_STRING; } Index: php4/ext/standard/lcg.c diff -u php4/ext/standard/lcg.c:1.21 php4/ext/standard/lcg.c:1.22 --- php4/ext/standard/lcg.c:1.21 Sat Jul 28 07:36:17 2001 +++ php4/ext/standard/lcg.c Sun Aug 5 23:50:51 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: lcg.c,v 1.21 2001/07/28 11:36:17 zeev Exp $ */ +/* $Id: lcg.c,v 1.22 2001/08/06 03:50:51 sas Exp $ */ #include "php.h" #include "php_lcg.h" @@ -46,11 +46,10 @@ #define MODMULT(a,b,c,m,s) q = s/a;s=b*(s-a*q)-c*q;if(s<0)s+=m -double php_combined_lcg(void) +double php_combined_lcg(TSRMLS_D) { php_int32 q; php_int32 z; - TSRMLS_FETCH(); MODMULT(53668,40014,12211,2147483563L, LCG(s1)); MODMULT(52774,40692,3791, 2147483399L, LCG(s2)); @@ -94,7 +93,7 @@ Returns a value from the combined linear congruential generator */ PHP_FUNCTION(lcg_value) { - RETURN_DOUBLE(php_combined_lcg()); + RETURN_DOUBLE(php_combined_lcg(TSRMLS_C)); } /* }}} */ Index: php4/ext/standard/php_lcg.h diff -u php4/ext/standard/php_lcg.h:1.13 php4/ext/standard/php_lcg.h:1.14 --- php4/ext/standard/php_lcg.h:1.13 Sat Jul 28 07:36:18 2001 +++ php4/ext/standard/php_lcg.h Sun Aug 5 23:50:51 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_lcg.h,v 1.13 2001/07/28 11:36:18 zeev Exp $ */ +/* $Id: php_lcg.h,v 1.14 2001/08/06 03:50:51 sas Exp $ */ #ifndef PHP_LCG_H #define PHP_LCG_H @@ -28,7 +28,7 @@ php_int32 s2; } php_lcg_globals; -double php_combined_lcg(void); +double php_combined_lcg(TSRMLS_D); PHP_FUNCTION(lcg_value); #ifdef ZTS Index: php4/ext/standard/php_string.h diff -u php4/ext/standard/php_string.h:1.46 php4/ext/standard/php_string.h:1.47 --- php4/ext/standard/php_string.h:1.46 Sun Aug 5 16:25:40 2001 +++ php4/ext/standard/php_string.h Sun Aug 5 23:50:51 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_string.h,v 1.46 2001/08/05 20:25:40 sebastian Exp $ */ +/* $Id: php_string.h,v 1.47 2001/08/06 03:50:51 sas Exp $ */ /* Synced with php 3.0 revision 1.43 1999-06-16 [ssb] */ @@ -102,17 +102,17 @@ PHPAPI char *php_strtoupper(char *s, size_t len); PHPAPI char *php_strtolower(char *s, size_t len); PHPAPI char *php_strtr(char *str, int len, char *str_from, char *str_to, int trlen); -PHPAPI char *php_addslashes(char *str, int length, int *new_length, int freeit); -PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int freeit, char *what, int wlength); -PHPAPI void php_stripslashes(char *str, int *len); +PHPAPI char *php_addslashes(char *str, int length, int *new_length, int freeit TSRMLS_DC); +PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int freeit, char *what, int wlength TSRMLS_DC); +PHPAPI void php_stripslashes(char *str, int *len TSRMLS_DC); PHPAPI void php_stripcslashes(char *str, int *len); PHPAPI char *php_basename(char *str, size_t len ,char *suffix, size_t sufflen); PHPAPI void php_dirname(char *str, int len); PHPAPI char *php_stristr(unsigned char *s, unsigned char *t, size_t s_len, size_t t_len); PHPAPI char *php_str_to_str(char *haystack, int length, char *needle, int needle_len, char *str, int str_len, int *_new_length); -PHPAPI void php_trim(pval *str, pval *return_value, int mode); -PHPAPI void php_trim2(zval *str, zval *what, zval *return_value, int mode); +PHPAPI void php_trim(pval *str, pval *return_value, int mode TSRMLS_DC); +PHPAPI void php_trim2(zval *str, zval *what, zval *return_value, int mode TSRMLS_DC); PHPAPI void php_strip_tags(char *rbuf, int len, int state, char *allow, int allow_len); PHPAPI void php_char_to_str(char *str, uint len, char from, char *to, int to_len, pval *result); Index: php4/ext/standard/string.c diff -u php4/ext/standard/string.c:1.221 php4/ext/standard/string.c:1.222 --- php4/ext/standard/string.c:1.221 Sun Aug 5 19:08:19 2001 +++ php4/ext/standard/string.c Sun Aug 5 23:50:51 2001 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c,v 1.221 2001/08/05 23:08:19 jeroen Exp $ */ +/* $Id: string.c,v 1.222 2001/08/06 03:50:51 sas Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -454,15 +454,15 @@ /* {{{ php_trim Compatibility function, ports old-API to new one. (DEPRECATED) */ -void php_trim(zval *str, zval *return_value, int mode) +void php_trim(zval *str, zval *return_value, int mode TSRMLS_DC) { - php_trim2(str, NULL, return_value, mode); + php_trim2(str, NULL, return_value, mode TSRMLS_CC); } /* }}} */ /* {{{ php_trim2 */ -PHPAPI void php_trim2(zval *str, zval *what, zval *return_value, int mode) +PHPAPI void php_trim2(zval *str, zval *what, zval *return_value, int mode TSRMLS_DC) /* mode 1 : trim left mode 2 : trim right mode 3 : trim left and right @@ -470,8 +470,6 @@ what indicates which chars are to be trimmed. NULL->default (' \t\n\r\v\0') */ { - TSRMLS_FETCH(); - register int i; int len = str->value.str.len; int trimmed = 0; @@ -528,7 +526,7 @@ /* convert_to_string_ex never fails (last line: op->type = IS_STRING), so, not checking for that. */ - php_trim2(*str, ZEND_NUM_ARGS()==2?*what:NULL, return_value, 2); + php_trim2(*str, ZEND_NUM_ARGS()==2?*what:NULL, return_value, 2 TSRMLS_CC); } /* }}} */ @@ -545,7 +543,7 @@ if (ZEND_NUM_ARGS() == 2) convert_to_string_ex(str); - php_trim2(*str, ZEND_NUM_ARGS()==2?*what:NULL, return_value, 3); + php_trim2(*str, ZEND_NUM_ARGS()==2?*what:NULL, return_value, 3 TSRMLS_CC); } /* }}} */ @@ -562,7 +560,7 @@ if (ZEND_NUM_ARGS() == 2) convert_to_string_ex(str); - php_trim2(*str, ZEND_NUM_ARGS()==2?*what:NULL, return_value, 1); + php_trim2(*str, ZEND_NUM_ARGS()==2?*what:NULL, return_value, 1 TSRMLS_CC); } /* }}} */ @@ -2107,12 +2105,11 @@ /* {{{ php_stripslashes * * be careful, this edits the string in-place */ -PHPAPI void php_stripslashes(char *str, int *len) +PHPAPI void php_stripslashes(char *str, int *len TSRMLS_DC) { char *s, *t; int l; char escape_char='\\'; - TSRMLS_FETCH(); if (PG(magic_quotes_sybase)) { escape_char='\''; @@ -2168,15 +2165,17 @@ convert_to_string_ex(str); convert_to_string_ex(what); - if(Z_STRLEN_PP(str) == 0) { + if (Z_STRLEN_PP(str) == 0) { RETURN_EMPTY_STRING(); } - if(Z_STRLEN_PP(what) == 0) { - RETURN_STRINGL(Z_STRVAL_PP(str),Z_STRLEN_PP(str),1); + if (Z_STRLEN_PP(what) == 0) { + RETURN_STRINGL(Z_STRVAL_PP(str), Z_STRLEN_PP(str), 1); } - return_value->value.str.val = php_addcslashes((*str)->value.str.val,(*str)->value.str.len,&return_value->value.str.len,0,(*what)->value.str.val,(*what)->value.str.len); + Z_STRVAL_P(return_value) = php_addcslashes(Z_STRVAL_PP(str), + Z_STRLEN_PP(str), &Z_STRLEN_P(return_value), 0, Z_STRVAL_PP(what), + Z_STRLEN_PP(what) TSRMLS_CC); return_value->type = IS_STRING; } /* }}} */ @@ -2192,12 +2191,13 @@ } convert_to_string_ex(str); - if(Z_STRLEN_PP(str) == 0) { + if (Z_STRLEN_PP(str) == 0) { RETURN_EMPTY_STRING(); } - return_value->value.str.val = php_addslashes((*str)->value.str.val,(*str)->value.str.len,&return_value->value.str.len,0); - return_value->type = IS_STRING; + Z_STRVAL_P(return_value) = php_addslashes(Z_STRVAL_PP(str), + Z_STRLEN_PP(str), &Z_STRLEN_P(return_value), 0 TSRMLS_CC); + Z_TYPE_P(return_value) = IS_STRING; } /* }}} */ @@ -2231,7 +2231,7 @@ *return_value = **str; zval_copy_ctor(return_value); - php_stripslashes(return_value->value.str.val,&return_value->value.str.len); + php_stripslashes(Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value) TSRMLS_CC); } /* }}} */ @@ -2314,10 +2314,8 @@ /* {{{ php_addcslashes */ -PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int should_free, char *what, int wlength) +PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int should_free, char *what, int wlength TSRMLS_DC) { - /* TSRMLS_FETCH(); (causes parse error -> ?) */ - char flags[256]; char *new_str = emalloc((length?length:(length=strlen(str)))*4+1); char *source,*target; @@ -2372,14 +2370,13 @@ /* {{{ php_addslashes */ -PHPAPI char *php_addslashes(char *str, int length, int *new_length, int should_free) +PHPAPI char *php_addslashes(char *str, int length, int *new_length, int should_free TSRMLS_DC) { /* maximum string length, worst case situation */ char *new_str; char *source,*target; char *end; char c; - TSRMLS_FETCH(); if (!str) { *new_length = 0; Index: php4/ext/standard/uniqid.c diff -u php4/ext/standard/uniqid.c:1.23 php4/ext/standard/uniqid.c:1.24 --- php4/ext/standard/uniqid.c:1.23 Wed Jun 6 09:05:51 2001 +++ php4/ext/standard/uniqid.c Sun Aug 5 23:50:51 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: uniqid.c,v 1.23 2001/06/06 13:05:51 rasmus Exp $ */ +/* $Id: uniqid.c,v 1.24 2001/08/06 03:50:51 sas Exp $ */ #include "php.h" @@ -77,7 +77,7 @@ * digits for usecs. */ if (MORE_ENTROPY) { - sprintf(uniqid, "%s%08x%05x%.8f", (*prefix)->value.str.val, sec, usec, php_combined_lcg() * 10); + sprintf(uniqid, "%s%08x%05x%.8f", (*prefix)->value.str.val, sec, usec, php_combined_lcg(TSRMLS_C) * 10); } else { sprintf(uniqid, "%s%08x%05x", (*prefix)->value.str.val, sec, usec); } Index: php4/ext/sybase/php_sybase_db.c diff -u php4/ext/sybase/php_sybase_db.c:1.26 php4/ext/sybase/php_sybase_db.c:1.27 --- php4/ext/sybase/php_sybase_db.c:1.26 Tue Jul 31 01:44:07 2001 +++ php4/ext/sybase/php_sybase_db.c Sun Aug 5 23:50:51 2001 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_sybase_db.c,v 1.26 2001/07/31 05:44:07 zeev Exp $ */ +/* $Id: php_sybase_db.c,v 1.27 2001/08/06 03:50:51 sas Exp $ */ #ifdef HAVE_CONFIG_H @@ -785,7 +785,7 @@ convert_to_string(cur_value); if (PG(magic_quotes_runtime)) { - cur_value->value.str.val = php_addslashes(cur_value->value.str.val, cur_value->value.str.len, &cur_value->value.str.len,0); + cur_value->value.str.val = php_addslashes(cur_value->value.str.val, cur_value->value.str.len, &cur_value->value.str.len,0 TSRMLS_CC); } } } Index: php4/ext/sybase_ct/php_sybase_ct.c diff -u php4/ext/sybase_ct/php_sybase_ct.c:1.59 php4/ext/sybase_ct/php_sybase_ct.c:1.60 --- php4/ext/sybase_ct/php_sybase_ct.c:1.59 Tue Jul 31 19:47:33 2001 +++ php4/ext/sybase_ct/php_sybase_ct.c Sun Aug 5 23:50:52 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_sybase_ct.c,v 1.59 2001/07/31 23:47:33 sniper Exp $ */ +/* $Id: php_sybase_ct.c,v 1.60 2001/08/06 03:50:52 sas Exp $ */ #ifdef HAVE_CONFIG_H @@ -1366,7 +1366,7 @@ *tmp = result->data[result->cur_row][i]; INIT_PZVAL(tmp); if (PG(magic_quotes_runtime) && tmp->type == IS_STRING) { - tmp->value.str.val = php_addslashes(tmp->value.str.val, tmp->value.str.len, &tmp->value.str.len, 0); + tmp->value.str.val = php_addslashes(tmp->value.str.val, tmp->value.str.len, &tmp->value.str.len, 0 TSRMLS_CC); } else { pval_copy_constructor(tmp); } Index: php4/ext/zlib/zlib.c diff -u php4/ext/zlib/zlib.c:1.93 php4/ext/zlib/zlib.c:1.94 --- php4/ext/zlib/zlib.c:1.93 Sun Aug 5 12:21:31 2001 +++ php4/ext/zlib/zlib.c Sun Aug 5 23:50:52 2001 @@ -16,7 +16,7 @@ | Stefan Röhrich <sr@linux.de> | +----------------------------------------------------------------------+ */ -/* $Id: zlib.c,v 1.93 2001/08/05 16:21:31 sas Exp $ */ +/* $Id: zlib.c,v 1.94 2001/08/06 03:50:52 sas Exp $ */ #define IS_EXT_MODULE #ifdef HAVE_CONFIG_H @@ -289,7 +289,7 @@ if (PG(magic_quotes_runtime)) { int len; - slashed = php_addslashes(buf,0,&len,0); /* 0 = don't free source string */ + slashed = php_addslashes(buf,0,&len,0 TSRMLS_CC); /* 0 = don't free source string */ add_index_stringl(return_value, i++, slashed, len, 0); } else { add_index_string(return_value, i++, buf, 1); @@ -406,7 +406,7 @@ RETVAL_FALSE; } else { if (PG(magic_quotes_runtime)) { - return_value->value.str.val = php_addslashes(buf,0,&return_value->value.str.len,1); + return_value->value.str.val = php_addslashes(buf,0,&return_value->value.str.len,1 TSRMLS_CC); } else { return_value->value.str.val = buf; return_value->value.str.len = strlen(return_value->value.str.val); @@ -534,7 +534,7 @@ /* strip slashes only if the length wasn't specified explicitly */ if (!arg3 && PG(magic_quotes_runtime)) { - php_stripslashes((*arg2)->value.str.val,&num_bytes); + php_stripslashes(Z_STRVAL_PP(arg2), &num_bytes TSRMLS_CC); } ret = gzwrite(zp, (*arg2)->value.str.val,num_bytes); @@ -707,7 +707,7 @@ return_value->value.str.val[return_value->value.str.len] = 0; if (PG(magic_quotes_runtime)) { - return_value->value.str.val = php_addslashes(return_value->value.str.val,return_value->value.str.len,&return_value->value.str.len,1); + return_value->value.str.val = php_addslashes(return_value->value.str.val,return_value->value.str.len,&return_value->value.str.len,1 TSRMLS_CC); } return_value->type = IS_STRING; } Index: php4/main/php_variables.c diff -u php4/main/php_variables.c:1.29 php4/main/php_variables.c:1.30 --- php4/main/php_variables.c:1.29 Sat Jul 28 07:36:28 2001 +++ php4/main/php_variables.c Sun Aug 5 23:50:52 2001 @@ -16,7 +16,7 @@ | Zeev Suraski <zeev@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: php_variables.c,v 1.29 2001/07/28 11:36:28 zeev Exp $ */ +/* $Id: php_variables.c,v 1.30 2001/08/06 03:50:52 sas Exp $ */ #include <stdio.h> #include "php.h" @@ -42,7 +42,7 @@ /* Prepare value */ new_entry.value.str.len = str_len; if (PG(magic_quotes_gpc)) { - new_entry.value.str.val = php_addslashes(strval, new_entry.value.str.len, &new_entry.value.str.len, 0); + new_entry.value.str.val = php_addslashes(strval, new_entry.value.str.len, &new_entry.value.str.len, 0 TSRMLS_CC); } else { new_entry.value.str.val = estrndup(strval, new_entry.value.str.len); } @@ -124,7 +124,7 @@ } else { if (PG(magic_quotes_gpc) && (index!=var)) { /* no need to addslashes() the index if it's the main variable name */ - escaped_index = php_addslashes(index, index_len, &index_len, 0); + escaped_index = php_addslashes(index, index_len, &index_len, 0 TSRMLS_CC); } else { escaped_index = index; }
« previous php.cvs (#6592) next »