cvs: php4 /ext/calendar calendar.c /ext/com COM.c /ext/crack crack.c /ext/curl curl.c /ext/db db.c /ext/dbx dbx.c /ext/fbsql php_fbsql.c
/ext/gd gd.c gd_ctx.c /ext/imap php_imap.c /ext/ingres_ii ii.c /ext/mailparse mailparse.c rfc2045cdecode.c /ext/mssql php_mssql.c /ext/mysql
php_mysql.c /ext/odbc php_odbc.c php_odbc.h /ext/openssl openssl.c /ext/pcntl pcntl.c /ext/pcre php_pcre.c /ext/pgsql pgsql.c /ext/readline
readline.c /ext/sablot sablot.c /ext/session mod_user.c /ext/sockets sockets.c /ext/standard array.c assert.c basic_functions.c file.c
formatted_print.c fsock.c scanf.c scanf.h string.c var.c /ext/wddx wddx.c /ext/xml xml.c /ext/xslt xslt.c /ext/yp yp.c /main fopen_wrappers.c
main.c output.c streams.c /sapi/cgi cgi_main.c /sapi/isapi php4isapi.c /sapi/pi3web pi3web_sapi.c /sapi/servlet servlet.c

From: Date: Mon, 30 Jul 2001 08:24:46 +0000
Subject: cvs: php4 /ext/calendar calendar.c /ext/com COM.c /ext/crack crack.c /ext/curl curl.c /ext/db db.c /ext/dbx dbx.c /ext/fbsql php_fbsql.c
/ext/gd gd.c gd_ctx.c /ext/imap php_imap.c /ext/ingres_ii ii.c /ext/mailparse mailparse.c rfc2045cdecode.c /ext/mssql php_mssql.c /ext/mysql
php_mysql.c /ext/odbc php_odbc.c php_odbc.h /ext/openssl openssl.c /ext/pcntl pcntl.c /ext/pcre php_pcre.c /ext/pgsql pgsql.c /ext/readline
readline.c /ext/sablot sablot.c /ext/session mod_user.c /ext/sockets sockets.c /ext/standard array.c assert.c basic_functions.c file.c
formatted_print.c fsock.c scanf.c scanf.h string.c var.c /ext/wddx wddx.c /ext/xml xml.c /ext/xslt xslt.c /ext/yp yp.c /main fopen_wrappers.c
main.c output.c streams.c /sapi/cgi cgi_main.c /sapi/isapi php4isapi.c /sapi/pi3web pi3web_sapi.c /sapi/servlet servlet.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-6403@lists.php.net to get a copy of this message
zeev Mon Jul 30 04:24:46 2001 EDT Modified files: /php4/ext/calendar calendar.c /php4/ext/com COM.c /php4/ext/crack crack.c /php4/ext/curl curl.c /php4/ext/db db.c /php4/ext/dbx dbx.c /php4/ext/fbsql php_fbsql.c /php4/ext/gd gd.c gd_ctx.c /php4/ext/imap php_imap.c /php4/ext/ingres_ii ii.c /php4/ext/mailparse mailparse.c rfc2045cdecode.c /php4/ext/mssql php_mssql.c /php4/ext/mysql php_mysql.c /php4/ext/odbc php_odbc.c php_odbc.h /php4/ext/openssl openssl.c /php4/ext/pcntl pcntl.c /php4/ext/pcre php_pcre.c /php4/ext/pgsql pgsql.c /php4/ext/readline readline.c /php4/ext/sablot sablot.c /php4/ext/session mod_user.c /php4/ext/sockets sockets.c /php4/ext/standard array.c assert.c basic_functions.c file.c formatted_print.c fsock.c scanf.c scanf.h string.c var.c /php4/ext/wddx wddx.c /php4/ext/xml xml.c /php4/ext/xslt xslt.c /php4/ext/yp yp.c /php4/main fopen_wrappers.c main.c output.c streams.c /php4/sapi/cgi cgi_main.c /php4/sapi/isapi php4isapi.c /php4/sapi/pi3web pi3web_sapi.c /php4/sapi/servlet servlet.c Log: Zend compatibility patch

Index: php4/ext/calendar/calendar.c diff -u php4/ext/calendar/calendar.c:1.17 php4/ext/calendar/calendar.c:1.18 --- php4/ext/calendar/calendar.c:1.17 Mon Jul 30 02:17:49 2001 +++ php4/ext/calendar/calendar.c Mon Jul 30 04:24:22 2001 @@ -18,7 +18,7 @@ | Wez Furlong <wez@thebrainroom.com> | +----------------------------------------------------------------------+ */ -/* $Id: calendar.c,v 1.17 2001/07/30 06:17:49 zeev Exp $ */ +/* $Id: calendar.c,v 1.18 2001/07/30 08:24:22 zeev Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -150,7 +150,7 @@ } convert_to_long_ex(cal); if (Z_LVAL_PP(cal) < 0 || Z_LVAL_PP(cal) >= CAL_NUM_CALS) { - zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(), Z_LVAL_PP(cal)); + zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal)); RETURN_FALSE; } @@ -192,7 +192,7 @@ convert_to_long_ex(year); if (Z_LVAL_PP(cal) < 0 || Z_LVAL_PP(cal) >= CAL_NUM_CALS) { - zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(), Z_LVAL_PP(cal)); + zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal)); RETURN_FALSE; } @@ -228,7 +228,7 @@ convert_to_long_ex(year); if (Z_LVAL_PP(cal) < 0 || Z_LVAL_PP(cal) >= CAL_NUM_CALS) { - zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(), Z_LVAL_PP(cal)); + zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal)); RETURN_FALSE; } @@ -254,7 +254,7 @@ convert_to_long_ex(cal); if (Z_LVAL_PP(cal) < 0 || Z_LVAL_PP(cal) >= CAL_NUM_CALS) { - zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(), Z_LVAL_PP(cal)); + zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal)); RETURN_FALSE; } calendar = &cal_conversion_table[Z_LVAL_PP(cal)]; Index: php4/ext/com/COM.c diff -u php4/ext/com/COM.c:1.36 php4/ext/com/COM.c:1.37 --- php4/ext/com/COM.c:1.36 Mon Jul 30 02:17:49 2001 +++ php4/ext/com/COM.c Mon Jul 30 04:24:23 2001 @@ -1628,7 +1628,7 @@ SysFreeString(bstr_ids); c.name_len = strlen(ids)+1; c.name = ids; - if (zend_get_constant(c.name, c.name_len-1, &exists)) + if (zend_get_constant(c.name, c.name_len-1, &exists TSRMLS_CC)) { /* Oops, it already exists. No problem if it is defined as the same value */ /* Check to see if they are the same */ Index: php4/ext/crack/crack.c diff -u php4/ext/crack/crack.c:1.7 php4/ext/crack/crack.c:1.8 --- php4/ext/crack/crack.c:1.7 Mon Jul 30 02:17:50 2001 +++ php4/ext/crack/crack.c Mon Jul 30 04:24:23 2001 @@ -15,7 +15,7 @@ | Authors: | +----------------------------------------------------------------------+ */ -/* $Id: crack.c,v 1.7 2001/07/30 06:17:50 zeev Exp $ */ +/* $Id: crack.c,v 1.8 2001/07/30 08:24:23 zeev Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -61,7 +61,7 @@ STD_PHP_INI_ENTRY("crack.default_dictionary", NULL, PHP_INI_SYSTEM, OnUpdateString, default_dictionary, zend_crack_globals, crack_globals) PHP_INI_END() -long _crack_open_dict(char *dictpath) +long _crack_open_dict(char *dictpath TSRMLS_DC) { PWDICT *pwdict; long resource; @@ -145,7 +145,7 @@ convert_to_string_ex(dictpath); - if (-1 == (resource = _crack_open_dict(Z_STRVAL_PP(dictpath)))) { + if (-1 == (resource = _crack_open_dict(Z_STRVAL_PP(dictpath) TSRMLS_CC))) { RETURN_FALSE; } @@ -202,7 +202,7 @@ RETURN_FALSE; } if (NULL != CRACKG(default_dictionary) && CRACKG(current_id) == -1) { - _crack_open_dict(CRACKG(default_dictionary)); + _crack_open_dict(CRACKG(default_dictionary) TSRMLS_CC); } id = CRACKG(current_id); break; Index: php4/ext/curl/curl.c diff -u php4/ext/curl/curl.c:1.73 php4/ext/curl/curl.c:1.74 --- php4/ext/curl/curl.c:1.73 Sat Jul 28 07:35:44 2001 +++ php4/ext/curl/curl.c Mon Jul 30 04:24:24 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: curl.c,v 1.73 2001/07/28 11:35:44 zeev Exp $ */ +/* $Id: curl.c,v 1.74 2001/07/30 08:24:24 zeev Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -286,7 +286,7 @@ error = call_user_function(EG(function_table), NULL, t->func, - retval, 2, argv); + retval, 2, argv TSRMLS_CC); if (error == FAILURE) { php_error(E_WARNING, "Cannot call the CURLOPT_WRITEFUNCTION"); length = -1; @@ -340,7 +340,7 @@ error = call_user_function(EG(function_table), NULL, t->func, - retval, 3, argv); + retval, 3, argv TSRMLS_CC); if (error == FAILURE) { php_error(E_WARNING, "Cannot call the CURLOPT_READFUNCTION"); length = -1; @@ -402,7 +402,7 @@ error = call_user_function(EG(function_table), NULL, t->func, - retval, 2, argv); + retval, 2, argv TSRMLS_CC); if (error == FAILURE) { php_error(E_WARNING, "Couldn't call the CURLOPT_HEADERFUNCTION"); length = -1; @@ -450,7 +450,7 @@ error = call_user_function(EG(function_table), NULL, func, - retval, 2, argv); + retval, 2, argv TSRMLS_CC); if (error == FAILURE) { php_error(E_WARNING, "Couldn't call the CURLOPT_PASSWDFUNCTION"); ret = -1; Index: php4/ext/db/db.c diff -u php4/ext/db/db.c:1.55 php4/ext/db/db.c:1.56 --- php4/ext/db/db.c:1.55 Sat Jul 28 07:35:46 2001 +++ php4/ext/db/db.c Mon Jul 30 04:24:24 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: db.c,v 1.55 2001/07/28 11:35:46 zeev Exp $ */ +/* $Id: db.c,v 1.56 2001/07/30 08:24:24 zeev Exp $ */ #define IS_EXT_MODULE #if 1 @@ -168,13 +168,12 @@ /* {{{ php_find_dbm */ -dbm_info *php_find_dbm(pval *id) +dbm_info *php_find_dbm(pval *id TSRMLS_DC) { list_entry *le; dbm_info *info; int numitems, i; int info_type; - TSRMLS_FETCH(); if (Z_TYPE_P(id) == IS_STRING) { numitems = zend_hash_num_elements(&EG(regular_list)); @@ -260,7 +259,8 @@ /* {{{ proto int dbmopen(string filename, string mode) Opens a dbm database */ -PHP_FUNCTION(dbmopen) { +PHP_FUNCTION(dbmopen) +{ pval *filename, *mode; dbm_info *info=NULL; int ret; @@ -272,7 +272,7 @@ convert_to_string(filename); convert_to_string(mode); - info = php_dbm_open(Z_STRVAL_P(filename), Z_STRVAL_P(mode)); + info = php_dbm_open(Z_STRVAL_P(filename), Z_STRVAL_P(mode) TSRMLS_CC); if (info) { ret = zend_list_insert(info, le_db); RETURN_LONG(ret); @@ -284,22 +284,19 @@ /* {{{ php_dbm_open */ -dbm_info *php_dbm_open(char *filename, char *mode) +dbm_info *php_dbm_open(char *filename, char *mode TSRMLS_DC) { dbm_info *info; int ret, lock=0; char *lockfn = NULL; int lockfd = 0; - #if NFS_HACK int last_try = 0; struct stat sb; int retries = 0; #endif - DBM_TYPE dbf=NULL; DBM_MODE_TYPE imode; - TSRMLS_FETCH(); if (filename == NULL) { php_error(E_WARNING, "NULL filename passed to php_dbm_open()"); @@ -492,7 +489,7 @@ convert_to_string(key); convert_to_string(value); - info = php_find_dbm(id); + info = php_find_dbm(id TSRMLS_CC); if (!info) { php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id)); RETURN_FALSE; @@ -552,25 +549,24 @@ convert_to_string(key); convert_to_string(value); - info = php_find_dbm(id); + info = php_find_dbm(id TSRMLS_CC); if (!info) { php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id)); RETURN_FALSE; } - ret = php_dbm_replace(info, Z_STRVAL_P(key), Z_STRVAL_P(value)); + ret = php_dbm_replace(info, Z_STRVAL_P(key), Z_STRVAL_P(value) TSRMLS_CC); RETURN_LONG(ret); } /* }}} */ /* {{{ php_dbm_replace */ -int php_dbm_replace(dbm_info *info, char *key, char *value) +int php_dbm_replace(dbm_info *info, char *key, char *value TSRMLS_DC) { DBM_TYPE dbf; int ret; datum key_datum, value_datum; - TSRMLS_FETCH(); if (PG(magic_quotes_runtime)) { php_stripslashes(key,NULL); @@ -614,13 +610,13 @@ } convert_to_string(key); - info = php_find_dbm(id); + info = php_find_dbm(id TSRMLS_CC); if (!info) { php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id)); RETURN_FALSE; } - ret = php_dbm_fetch(info, Z_STRVAL_P(key)); + ret = php_dbm_fetch(info, Z_STRVAL_P(key) TSRMLS_CC); if (ret) { RETVAL_STRING(ret, 0); } else { @@ -631,12 +627,11 @@ /* {{{ php_dbm_fetch */ -char *php_dbm_fetch(dbm_info *info, char *key) +char *php_dbm_fetch(dbm_info *info, char *key TSRMLS_DC) { datum key_datum, value_datum; char *ret; DBM_TYPE dbf; - TSRMLS_FETCH(); key_datum.dptr = key; key_datum.dsize = strlen(key); @@ -691,7 +686,7 @@ } convert_to_string(key); - info = php_find_dbm(id); + info = php_find_dbm(id TSRMLS_CC); if (!info) { php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id)); RETURN_FALSE; @@ -740,7 +735,7 @@ } convert_to_string(key); - info = php_find_dbm(id); + info = php_find_dbm(id TSRMLS_CC); if (!info) { php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id)); RETURN_FALSE; @@ -787,7 +782,7 @@ WRONG_PARAM_COUNT; } - info = php_find_dbm(id); + info = php_find_dbm(id TSRMLS_CC); if (!info) { php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id)); RETURN_FALSE; @@ -849,13 +844,13 @@ } convert_to_string(key); - info = php_find_dbm(id); + info = php_find_dbm(id TSRMLS_CC); if (!info) { php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id)); RETURN_FALSE; } - ret = php_dbm_nextkey(info, Z_STRVAL_P(key)); + ret = php_dbm_nextkey(info, Z_STRVAL_P(key) TSRMLS_CC); if (!ret) { RETURN_FALSE; } else { @@ -866,12 +861,11 @@ /* {{{ php_dbm_nextkey */ -char *php_dbm_nextkey(dbm_info *info, char *key) +char *php_dbm_nextkey(dbm_info *info, char *key TSRMLS_DC) { datum key_datum, ret_datum; char *ret; DBM_TYPE dbf; - TSRMLS_FETCH(); key_datum.dptr = key; key_datum.dsize = strlen(key); Index: php4/ext/dbx/dbx.c diff -u php4/ext/dbx/dbx.c:1.18 php4/ext/dbx/dbx.c:1.19 --- php4/ext/dbx/dbx.c:1.18 Sun Jul 29 21:56:22 2001 +++ php4/ext/dbx/dbx.c Mon Jul 30 04:24:25 2001 @@ -79,16 +79,18 @@ } /* from dbx.h, to be used in support-files (dbx_mysql.c etc...) */ -void dbx_call_any_function(INTERNAL_FUNCTION_PARAMETERS, char * function_name, zval ** returnvalue, int number_of_arguments, zval *** params) { +void dbx_call_any_function(INTERNAL_FUNCTION_PARAMETERS, char * function_name, zval ** returnvalue, int number_of_arguments, zval ***params) +{ zval * zval_function_name; + MAKE_STD_ZVAL(zval_function_name); ZVAL_STRING(zval_function_name, function_name, 1); - if (call_user_function_ex(EG(function_table), NULL, zval_function_name, returnvalue, number_of_arguments, params, 0, NULL) == FAILURE) { + if (call_user_function_ex(EG(function_table), NULL, zval_function_name, returnvalue, number_of_arguments, params, 0, NULL TSRMLS_CC) == FAILURE) { zend_error(E_ERROR, "function '%s' not found", zval_function_name->value.str.val); - } + } zval_dtor(zval_function_name); /* to free stringvalue memory */ FREE_ZVAL(zval_function_name); - } +} /* switch_dbx functions declarations * each must be supported in the dbx_module files as dbx_module_function, Index: php4/ext/fbsql/php_fbsql.c diff -u php4/ext/fbsql/php_fbsql.c:1.39 php4/ext/fbsql/php_fbsql.c:1.40 --- php4/ext/fbsql/php_fbsql.c:1.39 Mon Jul 30 02:17:51 2001 +++ php4/ext/fbsql/php_fbsql.c Mon Jul 30 04:24:26 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_fbsql.c,v 1.39 2001/07/30 06:17:51 zeev Exp $ */ +/* $Id: php_fbsql.c,v 1.40 2001/07/30 08:24:26 zeev Exp $ */ /* TODO: * @@ -260,7 +260,7 @@ } -static void phpfbReleaseLink (zend_rsrc_list_entry *rsrc) +static void phpfbReleaseLink(zend_rsrc_list_entry *rsrc) { PHPFBLink* link = (PHPFBLink *)rsrc->ptr; TSRMLS_FETCH(); @@ -283,7 +283,7 @@ } } -static void phpfbReleasePLink (zend_rsrc_list_entry *rsrc) +static void phpfbReleasePLink(zend_rsrc_list_entry *rsrc) { PHPFBLink* link = (PHPFBLink *)rsrc->ptr; TSRMLS_FETCH(); @@ -307,10 +307,8 @@ } } -static void php_fbsql_set_default_link(int id) +static void php_fbsql_set_default_link(int id TSRMLS_DC) { - TSRMLS_FETCH(); - if (FB_SQL_G(linkIndex)!=-1) { zend_list_delete(FB_SQL_G(linkIndex)); } @@ -539,7 +537,7 @@ if (ptr && (type==le_link || type==le_plink)) { zend_list_addref(link); return_value->value.lval = link; - php_fbsql_set_default_link(link); + php_fbsql_set_default_link(link TSRMLS_CC); return_value->type = IS_RESOURCE; return; } else { @@ -577,7 +575,7 @@ } FB_SQL_G(linkCount)++; } - php_fbsql_set_default_link(return_value->value.lval); + php_fbsql_set_default_link(return_value->value.lval TSRMLS_CC); } /* }}} */ @@ -660,12 +658,11 @@ /* {{{ php_fbsql_select_db */ -static int php_fbsql_select_db(char *databaseName, PHPFBLink *link) +static int php_fbsql_select_db(char *databaseName, PHPFBLink *link TSRMLS_DC) { unsigned port; FBCDatabaseConnection* c; FBCMetaData* md; - TSRMLS_FETCH(); if (!link->databaseName || strcmp(link->databaseName, databaseName)) { @@ -1072,8 +1069,9 @@ } } - if (!php_fbsql_select_db(name, phpLink)) RETURN_FALSE; - + if (!php_fbsql_select_db(name, phpLink TSRMLS_CC)) { + RETURN_FALSE; + } RETURN_TRUE; } /* }}} */ @@ -1386,7 +1384,9 @@ convert_to_string_ex(database_name); databaseName = (*database_name)->value.str.val; - if (!php_fbsql_select_db(databaseName, phpLink)) RETURN_FALSE; + if (!php_fbsql_select_db(databaseName, phpLink TSRMLS_CC)) { + RETURN_FALSE; + } /* printf("Stop db %x\n",phpDatabase->connection); */ if (!fbcdcStopDatabase(phpLink->connection)) @@ -1499,7 +1499,6 @@ char* tp; char* fh; unsigned int sR = 1, cR = 0; - TSRMLS_FETCH(); meta = fbcdcExecuteDirectSQL(link->connection, sql); @@ -1639,12 +1638,9 @@ convert_to_string_ex(query); convert_to_string_ex(dbname); - if (php_fbsql_select_db((*dbname)->value.str.val, phpLink)) - { + if (php_fbsql_select_db((*dbname)->value.str.val, phpLink TSRMLS_CC)) { phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, (*query)->value.str.val, phpLink); - } - else - { + } else { RETURN_FALSE; } } @@ -1728,13 +1724,10 @@ convert_to_string_ex(database_name); databaseName = (*database_name)->value.str.val; - if (databaseName == NULL) - { - php_fbsql_select_db(FB_SQL_G(databaseName), phpLink); - } - else - { - php_fbsql_select_db(databaseName, phpLink); + if (databaseName == NULL) { + php_fbsql_select_db(FB_SQL_G(databaseName), phpLink TSRMLS_CC); + } else { + php_fbsql_select_db(databaseName, phpLink TSRMLS_CC); } phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, sql, phpLink); @@ -1776,7 +1769,9 @@ convert_to_string_ex(table_name); tableName = (*table_name)->value.str.val; - if (!php_fbsql_select_db(databaseName, phpLink)) RETURN_FALSE; + if (!php_fbsql_select_db(databaseName, phpLink TSRMLS_CC)) { + RETURN_FALSE; + } sprintf(sql,"EXTRACT TABLE %s;",tableName); Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.142 php4/ext/gd/gd.c:1.143 --- php4/ext/gd/gd.c:1.142 Sat Jul 28 07:35:51 2001 +++ php4/ext/gd/gd.c Mon Jul 30 04:24:27 2001 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: gd.c,v 1.142 2001/07/28 11:35:51 zeev Exp $ */ +/* $Id: gd.c,v 1.143 2001/07/30 08:24:27 zeev Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -545,7 +545,7 @@ ZEND_REGISTER_RESOURCE(return_value, im, le_gd); #else - zend_error(E_ERROR, "%s(): requires GD 2.0 or later", get_active_function_name()); + zend_error(E_ERROR, "%s(): requires GD 2.0 or later", get_active_function_name(TSRMLS_C)); #endif } /* }}} */ @@ -571,7 +571,7 @@ RETURN_TRUE; #else - zend_error(E_ERROR, "%s(): requires GD 2.0 or later", get_active_function_name()); + zend_error(E_ERROR, "%s(): requires GD 2.0 or later", get_active_function_name(TSRMLS_C)); #endif } @@ -597,7 +597,7 @@ RETURN_TRUE; #else - zend_error(E_ERROR, "%s(): requires GD 2.0 or later", get_active_function_name()); + zend_error(E_ERROR, "%s(): requires GD 2.0 or later", get_active_function_name(TSRMLS_C)); #endif } @@ -628,7 +628,7 @@ RETURN_TRUE; #else - zend_error(E_ERROR, "%s(): requires GD 2.0 or later", get_active_function_name()); + zend_error(E_ERROR, "%s(): requires GD 2.0 or later", get_active_function_name(TSRMLS_C)); #endif } /* }}} */ @@ -658,7 +658,7 @@ RETURN_TRUE; #else - zend_error(E_ERROR, "%s(): requires GD 2.0 or later", get_active_function_name()); + zend_error(E_ERROR, "%s(): requires GD 2.0 or later", get_active_function_name(TSRMLS_C)); #endif } /* }}} */ @@ -697,7 +697,7 @@ gdImageFilledArc(im,Z_LVAL_PP(cx),Z_LVAL_PP(cy),Z_LVAL_PP(w),Z_LVAL_PP(h),st,e,Z_LVAL_PP(col), Z_LVAL_PP(style)); RETURN_TRUE; #else - zend_error(E_ERROR, "%s(): requires GD 2.0 or later", get_active_function_name()); + zend_error(E_ERROR, "%s(): requires GD 2.0 or later", get_active_function_name(TSRMLS_C)); #endif } /* }}} */ @@ -722,7 +722,7 @@ RETURN_TRUE; #else - zend_error(E_ERROR, "%s(): requires GD 2.0 or later", get_active_function_name()); + zend_error(E_ERROR, "%s(): requires GD 2.0 or later", get_active_function_name(TSRMLS_C)); #endif } /* }}} */ @@ -749,7 +749,7 @@ RETURN_LONG(gdImageColorResolveAlpha(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue), Z_LVAL_PP(alpha))); #else - zend_error(E_ERROR, "%s(): requires GD 2.0 or later", get_active_function_name()); + zend_error(E_ERROR, "%s(): requires GD 2.0 or later", get_active_function_name(TSRMLS_C)); #endif } @@ -777,7 +777,7 @@ RETURN_LONG(gdImageColorClosestAlpha(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue), Z_LVAL_PP(alpha))); #else - zend_error(E_ERROR, "%s(): requires GD 2.0 or later", get_active_function_name()); + zend_error(E_ERROR, "%s(): requires GD 2.0 or later", get_active_function_name(TSRMLS_C)); #endif } /* }}} */ @@ -804,7 +804,7 @@ RETURN_LONG(gdImageColorExactAlpha(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue), Z_LVAL_PP(alpha))); #else - zend_error(E_ERROR, "%s(): requires GD 2.0 or later", get_active_function_name()); + zend_error(E_ERROR, "%s(): requires GD 2.0 or later", get_active_function_name(TSRMLS_C)); #endif } /* }}} */ @@ -848,7 +848,7 @@ gdImageCopyResampled(im_dst, im_src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH); RETURN_TRUE; #else - zend_error(E_ERROR, "%s(): requires GD 2.0 or later", get_active_function_name()); + zend_error(E_ERROR, "%s(): requires GD 2.0 or later", get_active_function_name(TSRMLS_C)); #endif } /* }}} */ @@ -873,7 +873,7 @@ RETURN_TRUE; #else - zend_error(E_ERROR, "%s(): requires a more recent version of GD", get_active_function_name()); + zend_error(E_ERROR, "%s(): requires a more recent version of GD", get_active_function_name(TSRMLS_C)); #endif } /* }}} */ @@ -898,7 +898,7 @@ RETURN_TRUE; #else - zend_error(E_ERROR, "%s(): requires a more recent version of GD", get_active_function_name()); + zend_error(E_ERROR, "%s(): requires a more recent version of GD", get_active_function_name(TSRMLS_C)); #endif } /* }}} */ @@ -999,7 +999,7 @@ im = (*ioctx_func_p)(io_ctx); if (!im) { - php_error(E_WARNING, "%s: Passed data is not in '%s' format", get_active_function_name(), tn); + php_error(E_WARNING, "%s: Passed data is not in '%s' format", get_active_function_name(TSRMLS_C), tn); return NULL; } @@ -1118,7 +1118,7 @@ #endif if (!fp && !socketd) { php_strip_url_passwd(fn); - php_error(E_WARNING, "%s: Unable to open '%s' for reading", get_active_function_name(), fn); + php_error(E_WARNING, "%s: Unable to open '%s' for reading", get_active_function_name(TSRMLS_C), fn); RETURN_FALSE; } @@ -1127,7 +1127,7 @@ #endif if(issock && !ioctx_func_p) { - php_error(E_WARNING, "%s: Sockets are not supported for image type '%s'",get_active_function_name(),tn); + php_error(E_WARNING, "%s: Sockets are not supported for image type '%s'",get_active_function_name(TSRMLS_C),tn); RETURN_FALSE; } @@ -1140,7 +1140,7 @@ buff_size = php_fread_all(&buff_em, socketd, fp, issock); if(!buff_size) { - php_error(E_WARNING,"%s: Cannot read image data",get_active_function_name()); + php_error(E_WARNING,"%s: Cannot read image data",get_active_function_name(TSRMLS_C)); RETURN_FALSE; } @@ -1150,7 +1150,7 @@ io_ctx = gdNewDynamicCtx(buff_size,buff); if(!io_ctx) { - php_error(E_WARNING,"%s: Cannot allocate GD IO context",get_active_function_name()); + php_error(E_WARNING,"%s: Cannot allocate GD IO context",get_active_function_name(TSRMLS_C)); RETURN_FALSE; } if (image_type == PHP_GDIMG_TYPE_GD2PART) { @@ -1172,7 +1172,7 @@ } if (!im) { - php_error(E_WARNING,"%s: '%s' is not a valid %s file", get_active_function_name(), fn, tn); + php_error(E_WARNING,"%s: '%s' is not a valid %s file", get_active_function_name(TSRMLS_C), fn, tn); RETURN_FALSE; } @@ -1328,20 +1328,20 @@ if ((argc == 2) || (argc == 3 && Z_STRLEN_PP(file))) { if (!fn || fn == empty_string || php_check_open_basedir(fn)) { - php_error(E_WARNING, "%s: invalid filename '%s'", get_active_function_name(), fn); + php_error(E_WARNING, "%s: invalid filename '%s'", get_active_function_name(TSRMLS_C), fn); RETURN_FALSE; } fp = VCWD_FOPEN(fn, "wb"); if (!fp) { - php_error(E_WARNING, "%s: unable to open '%s' for writing", get_active_function_name(), fn); + php_error(E_WARNING, "%s: unable to open '%s' for writing", get_active_function_name(TSRMLS_C), fn); RETURN_FALSE; } switch(image_type) { case PHP_GDIMG_CONVERT_WBM: if(q<0||q>255) { - php_error(E_WARNING, "%s: invalid threshold value '%d'. It must be between 0 and 255",get_active_function_name(), q); + php_error(E_WARNING, "%s: invalid threshold value '%d'. It must be between 0 and 255",get_active_function_name(TSRMLS_C), q); } case PHP_GDIMG_TYPE_JPG: (*func_p)(im, fp, q); @@ -1365,14 +1365,14 @@ tmp = tmpfile(); if (tmp == NULL) { - php_error(E_WARNING, "%s: unable to open temporary file", get_active_function_name()); + php_error(E_WARNING, "%s: unable to open temporary file", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } switch(image_type) { case PHP_GDIMG_CONVERT_WBM: if(q<0||q>255) { - php_error(E_WARNING, "%s: invalid threshold value '%d'. It must be between 0 and 255",get_active_function_name(), q); + php_error(E_WARNING, "%s: invalid threshold value '%d'. It must be between 0 and 255",get_active_function_name(TSRMLS_C), q); } case PHP_GDIMG_TYPE_JPG: (*func_p)(im, tmp, q); @@ -2518,7 +2518,7 @@ gdImageCopyMergeGray(im_dst, im_src, dstX, dstY, srcX, srcY, srcW, srcH, pct); RETURN_TRUE; #else - php_error(E_WARNING, "%s(): was introduced in GD version 1.5", get_active_function_name()); + php_error(E_WARNING, "%s(): was introduced in GD version 1.5", get_active_function_name(TSRMLS_C)); RETURN_FALSE; #endif } @@ -2611,7 +2611,7 @@ #if HAVE_LIBGD20 && HAVE_LIBFREETYPE && HAVE_GD_STRINGFTEX php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_BBOX, 1); #else - php_error(E_WARNING, "%s(): No FreeType 2 support in this PHP build", get_active_function_name()); + php_error(E_WARNING, "%s(): No FreeType 2 support in this PHP build", get_active_function_name(TSRMLS_C)); RETURN_FALSE; #endif } @@ -2624,7 +2624,7 @@ #if HAVE_LIBGD20 && HAVE_LIBFREETYPE && HAVE_GD_STRINGFTEX php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_DRAW, 1); #else - php_error(E_WARNING, "%s(): No FreeType 2 support in this PHP build", get_active_function_name()); + php_error(E_WARNING, "%s(): No FreeType 2 support in this PHP build", get_active_function_name(TSRMLS_C)); RETURN_FALSE; #endif } @@ -2677,7 +2677,7 @@ #if !HAVE_GD_STRINGFTEX if (extended) { - zend_error(E_ERROR, "%s(): gdImageStringFTEx not supported in this PHP build", get_active_function_name()); + zend_error(E_ERROR, "%s(): gdImageStringFTEx not supported in this PHP build", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } #endif @@ -3365,18 +3365,18 @@ im_dest = gdImageCreate (dest_width, dest_height); if (im_dest == NULL) { - php_error (E_WARNING, "%s: unable to allocate temporary buffer", get_active_function_name()); + php_error (E_WARNING, "%s: unable to allocate temporary buffer", get_active_function_name(TSRMLS_C)); return; } white = gdImageColorAllocate (im_dest, 255, 255, 255); if( white == -1) { - php_error (E_WARNING, "%s: unable to allocate the colors for the destination buffer", get_active_function_name()); + php_error (E_WARNING, "%s: unable to allocate the colors for the destination buffer", get_active_function_name(TSRMLS_C)); return; } black = gdImageColorAllocate (im_dest, 0, 0, 0); if (black == -1) { - php_error (E_WARNING, "%s: unable to allocate the colors for the destination buffer", get_active_function_name()); + php_error (E_WARNING, "%s: unable to allocate the colors for the destination buffer", get_active_function_name(TSRMLS_C)); return; } @@ -3440,33 +3440,33 @@ /* Check threshold value */ if( int_threshold < 0 || int_threshold > 8 ) { - php_error (E_WARNING, "Invalid threshold value '%d' in %s",int_threshold, get_active_function_name()); + php_error (E_WARNING, "Invalid threshold value '%d' in %s",int_threshold, get_active_function_name(TSRMLS_C)); RETURN_FALSE; } /* Check origin file */ if (!fn_org || fn_org == empty_string || php_check_open_basedir(fn_org)) { - php_error (E_WARNING, "%s: invalid origin filename '%s'", get_active_function_name(), fn_org); + php_error (E_WARNING, "%s: invalid origin filename '%s'", get_active_function_name(TSRMLS_C), fn_org); RETURN_FALSE; } /* Check destination file */ if (!fn_dest || fn_dest == empty_string || php_check_open_basedir(fn_dest)) { - php_error (E_WARNING, "%s: invalid destination filename '%s'", get_active_function_name(), fn_dest); + php_error (E_WARNING, "%s: invalid destination filename '%s'", get_active_function_name(TSRMLS_C), fn_dest); RETURN_FALSE; } /* Open origin file */ org = VCWD_FOPEN(fn_org, "rb"); if (!org) { - php_error (E_WARNING, "%s: unable to open '%s' for reading", get_active_function_name(), fn_org); + php_error (E_WARNING, "%s: unable to open '%s' for reading", get_active_function_name(TSRMLS_C), fn_org); RETURN_FALSE; } /* Open destination file */ dest = VCWD_FOPEN(fn_dest, "wb"); if (!dest) { - php_error (E_WARNING, "%s: unable to open '%s' for writing", get_active_function_name(), fn_dest); + php_error (E_WARNING, "%s: unable to open '%s' for writing", get_active_function_name(TSRMLS_C), fn_dest); RETURN_FALSE; } @@ -3475,7 +3475,7 @@ case PHP_GDIMG_TYPE_GIF: im_org = gdImageCreateFromGif (org); if (im_org == NULL) { - php_error (E_WARNING, "%s: unable to open '%s' Not a valid GIF file", get_active_function_name(), fn_dest); + php_error (E_WARNING, "%s: unable to open '%s' Not a valid GIF file", get_active_function_name(TSRMLS_C), fn_dest); RETURN_FALSE; } break; @@ -3485,7 +3485,7 @@ case PHP_GDIMG_TYPE_JPG: im_org = gdImageCreateFromJpeg (org); if (im_org == NULL) { - php_error (E_WARNING, "%s: unable to open '%s' Not a valid JPEG file", get_active_function_name(), fn_dest); + php_error (E_WARNING, "%s: unable to open '%s' Not a valid JPEG file", get_active_function_name(TSRMLS_C), fn_dest); RETURN_FALSE; } break; @@ -3496,14 +3496,14 @@ case PHP_GDIMG_TYPE_PNG: im_org = gdImageCreateFromPng(org); if (im_org == NULL) { - php_error (E_WARNING, "%s: unable to open '%s' Not a valid PNG file", get_active_function_name(), fn_dest); + php_error (E_WARNING, "%s: unable to open '%s' Not a valid PNG file", get_active_function_name(TSRMLS_C), fn_dest); RETURN_FALSE; } break; #endif /* HAVE_GD_PNG */ default: - php_error(E_WARNING, "%s: Format not supported", get_active_function_name()); + php_error(E_WARNING, "%s: Format not supported", get_active_function_name(TSRMLS_C)); break; } @@ -3539,7 +3539,7 @@ im_tmp = gdImageCreate (dest_width, dest_height); if (im_tmp == NULL ) { - php_error(E_WARNING, "%s: unable to allocate temporary buffer", get_active_function_name()); + php_error(E_WARNING, "%s: unable to allocate temporary buffer", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } @@ -3551,18 +3551,18 @@ im_dest = gdImageCreate(dest_width, dest_height); if (im_dest == NULL) { - php_error(E_WARNING, "%s: unable to allocate destination buffer", get_active_function_name()); + php_error(E_WARNING, "%s: unable to allocate destination buffer", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } white = gdImageColorAllocate(im_dest, 255, 255, 255); if (white == -1) { - php_error(E_WARNING, "%s: unable to allocate the colors for the destination buffer", get_active_function_name()); + php_error(E_WARNING, "%s: unable to allocate the colors for the destination buffer", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } black = gdImageColorAllocate(im_dest, 0, 0, 0); if (black == -1) { - php_error(E_WARNING, "%s: unable to allocate the colors for the destination buffer", get_active_function_name()); + php_error(E_WARNING, "%s: unable to allocate the colors for the destination buffer", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } Index: php4/ext/gd/gd_ctx.c diff -u php4/ext/gd/gd_ctx.c:1.8 php4/ext/gd/gd_ctx.c:1.9 --- php4/ext/gd/gd_ctx.c:1.8 Sat Jul 28 07:35:51 2001 +++ php4/ext/gd/gd_ctx.c Mon Jul 30 04:24:27 2001 @@ -50,13 +50,13 @@ if ((argc == 2) || (argc == 3 && Z_STRLEN_PP(file))) { if (!fn || fn == empty_string || php_check_open_basedir(fn)) { - php_error(E_WARNING, "%s: invalid filename '%s'", get_active_function_name(), fn); + php_error(E_WARNING, "%s: invalid filename '%s'", get_active_function_name(TSRMLS_C), fn); RETURN_FALSE; } fp = VCWD_FOPEN(fn, "wb"); if (!fp) { - php_error(E_WARNING, "%s: unable to open '%s' for writing", get_active_function_name(), fn); + php_error(E_WARNING, "%s: unable to open '%s' for writing", get_active_function_name(TSRMLS_C), fn); RETURN_FALSE; } @@ -77,7 +77,7 @@ switch(image_type) { case PHP_GDIMG_CONVERT_WBM: if(q<0||q>255) { - php_error(E_WARNING, "%s: invalid threshold value '%d'. It must be between 0 and 255",get_active_function_name(), q); + php_error(E_WARNING, "%s: invalid threshold value '%d'. It must be between 0 and 255",get_active_function_name(TSRMLS_C), q); } case PHP_GDIMG_TYPE_JPG: (*func_p)(im, ctx, q); Index: php4/ext/imap/php_imap.c diff -u php4/ext/imap/php_imap.c:1.88 php4/ext/imap/php_imap.c:1.89 --- php4/ext/imap/php_imap.c:1.88 Mon Jul 30 02:17:53 2001 +++ php4/ext/imap/php_imap.c Mon Jul 30 04:24:27 2001 @@ -25,7 +25,7 @@ | PHP 4.0 updates: Zeev Suraski <zeev@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: php_imap.c,v 1.88 2001/07/30 06:17:53 zeev Exp $ */ +/* $Id: php_imap.c,v 1.89 2001/07/30 08:24:27 zeev Exp $ */ #define IMAP41 @@ -1883,7 +1883,6 @@ pils *imap_le_struct; FOBJECTLIST *cur=NIL; char *delim=NIL; - TSRMLS_FETCH(); delim = emalloc(2 * sizeof(char)); Index: php4/ext/ingres_ii/ii.c diff -u php4/ext/ingres_ii/ii.c:1.20 php4/ext/ingres_ii/ii.c:1.21 --- php4/ext/ingres_ii/ii.c:1.20 Mon Jul 30 02:17:54 2001 +++ php4/ext/ingres_ii/ii.c Mon Jul 30 04:24:28 2001 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: ii.c,v 1.20 2001/07/30 06:17:54 zeev Exp $ */ +/* $Id: ii.c,v 1.21 2001/07/30 08:24:28 zeev Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -191,7 +191,7 @@ */ static void _clean_ii_plink(zend_rsrc_list_entry *rsrc) { - II_LINK *link = (II_LINK *)rsrc->ptr; + II_LINK *link = (II_LINK *)rsrc->ptr; IIAPI_AUTOPARM autoParm; TSRMLS_FETCH(); Index: php4/ext/mailparse/mailparse.c diff -u php4/ext/mailparse/mailparse.c:1.7 php4/ext/mailparse/mailparse.c:1.8 --- php4/ext/mailparse/mailparse.c:1.7 Mon Jul 30 00:57:58 2001 +++ php4/ext/mailparse/mailparse.c Mon Jul 30 04:24:29 2001 @@ -18,7 +18,7 @@ | the support routines for this extension were based upon. | +----------------------------------------------------------------------+ */ -/* $Id: mailparse.c,v 1.7 2001/07/30 04:57:58 zeev Exp $ */ +/* $Id: mailparse.c,v 1.8 2001/07/30 08:24:29 zeev Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -133,7 +133,9 @@ static void mailparse_rfc822t_errfunc(const char * msg, int num) { - php_error(E_WARNING, "%s(): %s %d", get_active_function_name(), msg, num); + TSRMLS_FETCH(); + + php_error(E_WARNING, "%s(): %s %d", get_active_function_name(TSRMLS_C), msg, num); } /* {{{ proto array mailparse_rfc822_parse_addresses(string addresses) @@ -313,7 +315,7 @@ enc = mbfl_name2no_encoding(Z_STRVAL_PP(encod)); if (enc == mbfl_no_encoding_invalid) { zend_error(E_WARNING, "%s(): unknown encoding \"%s\"", - get_active_function_name(), + get_active_function_name(TSRMLS_C), Z_STRVAL_PP(encod) ); RETURN_FALSE; @@ -387,7 +389,7 @@ /* open file and read it in */ fp = VCWD_FOPEN(Z_STRVAL_PP(filename), "r"); if (fp == NULL) { - zend_error(E_WARNING, "%s(): unable to open file %s", get_active_function_name(), Z_STRVAL_PP(filename)); + zend_error(E_WARNING, "%s(): unable to open file %s", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(filename)); RETURN_FALSE; } @@ -446,18 +448,20 @@ } /* }}} */ -static void get_structure_callback(struct rfc2045 *p, struct rfc2045id * id, void * ptr) +static void get_structure_callback(struct rfc2045 *p, struct rfc2045id *id, void *ptr) { zval * return_value = (zval *)ptr; char intbuf[16]; char buf[256]; int len, i = 0; + TSRMLS_FETCH(); + while(id && i < sizeof(buf)) { sprintf(intbuf, "%d", id->idnum); len = strlen(intbuf); if (len > (sizeof(buf)-i)) { /* too many sections: bail */ - zend_error(E_WARNING, "%s(): too many nested sections in message", get_active_function_name()); + zend_error(E_WARNING, "%s(): too many nested sections in message", get_active_function_name(TSRMLS_C)); return; } sprintf(&buf[i], "%s%c", intbuf, id->next ? '.' : '\0'); @@ -509,8 +513,8 @@ /* TODO: use zend_is_callable */ - if (call_user_function(EG(function_table), NULL, userfunc, retval, 1, &arg) == FAILURE) - zend_error(E_WARNING, "%s(): unable to call user function", get_active_function_name()); + if (call_user_function(EG(function_table), NULL, userfunc, retval, 1, &arg TSRMLS_CC) == FAILURE) + zend_error(E_WARNING, "%s(): unable to call user function", get_active_function_name(TSRMLS_C)); zval_dtor(retval); zval_dtor(arg); @@ -627,12 +631,12 @@ /* open file and read it in */ fp = VCWD_FOPEN(Z_STRVAL_PP(filename), "rb"); if (fp == NULL) { - zend_error(E_WARNING, "%s(): unable to open file %s", get_active_function_name(), Z_STRVAL_PP(filename)); + zend_error(E_WARNING, "%s(): unable to open file %s", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(filename)); RETURN_FALSE; } if (fseek(fp, body, SEEK_SET) == -1) { - zend_error(E_WARNING, "%s(): unable to seek to section start", get_active_function_name()); + zend_error(E_WARNING, "%s(): unable to seek to section start", get_active_function_name(TSRMLS_C)); RETVAL_FALSE; goto cleanup; } @@ -648,7 +652,7 @@ n = fread(filebuf, sizeof(char), n, fp); if (n == 0) { - zend_error(E_WARNING, "%s(): error reading from file \"%s\", offset %d", get_active_function_name(), Z_STRVAL_PP(filename), body); + zend_error(E_WARNING, "%s(): error reading from file \"%s\", offset %d", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(filename), body); RETVAL_FALSE; goto cleanup; } @@ -783,7 +787,7 @@ newsection = rfc2045_find(rfcbuf, (*mimesection)->value.str.val); if (!newsection) { - php_error(E_WARNING, "%s(): cannot find section %s in message", get_active_function_name(), (*mimesection)->value.str.val); + php_error(E_WARNING, "%s(): cannot find section %s in message", get_active_function_name(TSRMLS_C), (*mimesection)->value.str.val); RETURN_FALSE; } ZEND_REGISTER_RESOURCE(return_value, newsection, le_rfc2045_nofree); Index: php4/ext/mailparse/rfc2045cdecode.c diff -u php4/ext/mailparse/rfc2045cdecode.c:1.2 php4/ext/mailparse/rfc2045cdecode.c:1.3 --- php4/ext/mailparse/rfc2045cdecode.c:1.2 Mon May 28 06:57:22 2001 +++ php4/ext/mailparse/rfc2045cdecode.c Mon Jul 30 04:24:29 2001 @@ -1,4 +1,4 @@ -/* $Id: rfc2045cdecode.c,v 1.2 2001/05/28 10:57:22 wez Exp $ */ +/* $Id: rfc2045cdecode.c,v 1.3 2001/07/30 08:24:29 zeev Exp $ */ /* ** Copyright 1998 - 1999 Double Precision, Inc. See COPYING for ** distribution information. @@ -28,13 +28,14 @@ void *miscptr) { enum mbfl_no_encoding from = mbfl_no_encoding_8bit; - + TSRMLS_FETCH(); + if (p->content_transfer_encoding) { from = mbfl_name2no_encoding(p->content_transfer_encoding); if (from == mbfl_no_encoding_invalid) { zend_error(E_WARNING, "%s(): I don't know how to decode %s transfer encoding!", - get_active_function_name(), + get_active_function_name(TSRMLS_C), p->content_transfer_encoding); from = mbfl_no_encoding_8bit; } Index: php4/ext/mssql/php_mssql.c diff -u php4/ext/mssql/php_mssql.c:1.60 php4/ext/mssql/php_mssql.c:1.61 --- php4/ext/mssql/php_mssql.c:1.60 Mon Jul 30 02:17:57 2001 +++ php4/ext/mssql/php_mssql.c Mon Jul 30 04:24:29 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_mssql.c,v 1.60 2001/07/30 06:17:57 zeev Exp $ */ +/* $Id: php_mssql.c,v 1.61 2001/07/30 08:24:29 zeev Exp $ */ #ifdef COMPILE_DL_MSSQL #define HAVE_MSSQL 1 @@ -215,10 +215,8 @@ efree(result); } -static void php_mssql_set_default_link(int id) +static void php_mssql_set_default_link(int id TSRMLS_DC) { - TSRMLS_FETCH(); - if (MS_SQL_G(default_link)!=-1) { zend_list_delete(MS_SQL_G(default_link)); } @@ -587,7 +585,7 @@ if (ptr && (type==le_link || type==le_plink)) { zend_list_addref(link); return_value->value.lval = link; - php_mssql_set_default_link(link); + php_mssql_set_default_link(link TSRMLS_CC); return_value->type = IS_RESOURCE; efree(hashed_details); return; @@ -644,7 +642,7 @@ MS_SQL_G(num_links)++; } efree(hashed_details); - php_mssql_set_default_link(return_value->value.lval); + php_mssql_set_default_link(return_value->value.lval TSRMLS_CC); } @@ -866,12 +864,11 @@ } } -int _mssql_fetch_batch(mssql_link *mssql_ptr, mssql_result *result, int retvalue) +static int _mssql_fetch_batch(mssql_link *mssql_ptr, mssql_result *result, int retvalue TSRMLS_DC) { int i, j = 0; int *column_types; char computed_buf[16]; - TSRMLS_FETCH(); column_types = (int *) emalloc(sizeof(int) * result->num_fields); for (i=0; i<result->num_fields; i++) { @@ -964,7 +961,7 @@ mssql_ptr = result->mssql_ptr; _free_result(result, 0); result->cur_row=result->num_rows=0; - result->num_rows = _mssql_fetch_batch(mssql_ptr, result, result->lastresult); + result->num_rows = _mssql_fetch_batch(mssql_ptr, result, result->lastresult TSRMLS_CC); RETURN_LONG(result->num_rows); } /* }}} */ @@ -1047,7 +1044,7 @@ result->cur_field=result->cur_row=result->num_rows=0; result->fields = (mssql_field *) emalloc(sizeof(mssql_field)*result->num_fields); - result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue); + result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue TSRMLS_CC); ZEND_REGISTER_RESOURCE(return_value, result, le_result); } @@ -1640,7 +1637,7 @@ result->num_fields = dbnumcols(mssql_ptr->link); result->fields = (mssql_field *) emalloc(sizeof(mssql_field)*result->num_fields); - result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue); + result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue TSRMLS_CC); RETURN_TRUE; } @@ -1958,7 +1955,7 @@ result->num_fields = num_fields; result->fields = (mssql_field *) emalloc(sizeof(mssql_field)*num_fields); - result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue); + result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue TSRMLS_CC); } retval_results=dbresults(mssql_ptr->link); } Index: php4/ext/mysql/php_mysql.c diff -u php4/ext/mysql/php_mysql.c:1.92 php4/ext/mysql/php_mysql.c:1.93 --- php4/ext/mysql/php_mysql.c:1.92 Mon Jul 30 02:17:58 2001 +++ php4/ext/mysql/php_mysql.c Mon Jul 30 04:24:30 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_mysql.c,v 1.92 2001/07/30 06:17:58 zeev Exp $ */ +/* $Id: php_mysql.c,v 1.93 2001/07/30 08:24:30 zeev Exp $ */ /* TODO: @@ -969,7 +969,7 @@ mysql_result = (MYSQL_RES *) zend_list_find(mysql->active_result_id, &type); if (mysql_result && type==le_result && !mysql_eof(mysql_result)) { php_error(E_NOTICE, "Called %s() without first fetching all rows from a previous unbuffered query", - get_active_function_name()); + get_active_function_name(TSRMLS_C)); while (mysql_fetch_row(mysql_result)); zend_list_delete(mysql->active_result_id); mysql->active_result_id = 0; @@ -1080,7 +1080,7 @@ break; } - zend_error(E_NOTICE, "%s is deprecated; use mysql_select_db() and mysql_query() instead", get_active_function_name()); + zend_error(E_NOTICE, "%s is deprecated; use mysql_select_db() and mysql_query() instead", get_active_function_name(TSRMLS_C)); php_mysql_do_query_general(query, mysql_link, id, db, MYSQL_STORE_RESULT, return_value TSRMLS_CC); } Index: php4/ext/odbc/php_odbc.c diff -u php4/ext/odbc/php_odbc.c:1.99 php4/ext/odbc/php_odbc.c:1.100 --- php4/ext/odbc/php_odbc.c:1.99 Mon Jul 30 02:18:00 2001 +++ php4/ext/odbc/php_odbc.c Mon Jul 30 04:24:30 2001 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_odbc.c,v 1.99 2001/07/30 06:18:00 zeev Exp $ */ +/* $Id: php_odbc.c,v 1.100 2001/07/30 08:24:30 zeev Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -564,13 +564,12 @@ } -int odbc_bindcols(odbc_result *result) +int odbc_bindcols(odbc_result *result TSRMLS_DC) { RETCODE rc; int i; SWORD colnamelen; /* Not used */ SDWORD displaysize; - TSRMLS_FETCH(); result->values = (odbc_result_value *) emalloc(sizeof(odbc_result_value)*result->numcols); @@ -839,7 +838,7 @@ SQLNumResultCols(result->stmt, &(result->numcols)); if (result->numcols > 0) { - if (!odbc_bindcols(result)) { + if (!odbc_bindcols(result TSRMLS_CC)) { efree(result); RETURN_FALSE; } @@ -1022,7 +1021,7 @@ SQLNumResultCols(result->stmt, &(result->numcols)); if (result->numcols > 0) { - if (!odbc_bindcols(result)) { + if (!odbc_bindcols(result TSRMLS_CC)) { efree(result); RETVAL_FALSE; } @@ -1181,7 +1180,7 @@ /* For insert, update etc. cols == 0 */ if (result->numcols > 0) { - if (!odbc_bindcols(result)) { + if (!odbc_bindcols(result TSRMLS_CC)) { efree(result); RETURN_FALSE; } @@ -2280,7 +2279,7 @@ SQLNumResultCols(result->stmt, &(result->numcols)); if (result->numcols > 0) { - if (!odbc_bindcols(result)) { + if (!odbc_bindcols(result TSRMLS_CC)) { efree(result); RETVAL_FALSE; } @@ -2681,7 +2680,7 @@ SQLNumResultCols(result->stmt, &(result->numcols)); if (result->numcols > 0) { - if (!odbc_bindcols(result)) { + if (!odbc_bindcols(result TSRMLS_CC)) { efree(result); RETURN_FALSE; } @@ -2761,7 +2760,7 @@ SQLNumResultCols(result->stmt, &(result->numcols)); if (result->numcols > 0) { - if (!odbc_bindcols(result)) { + if (!odbc_bindcols(result TSRMLS_CC)) { efree(result); RETURN_FALSE; } @@ -2840,7 +2839,7 @@ SQLNumResultCols(result->stmt, &(result->numcols)); if (result->numcols > 0) { - if (!odbc_bindcols(result)) { + if (!odbc_bindcols(result TSRMLS_CC)) { efree(result); RETURN_FALSE; } @@ -2940,7 +2939,7 @@ SQLNumResultCols(result->stmt, &(result->numcols)); if (result->numcols > 0) { - if (!odbc_bindcols(result)) { + if (!odbc_bindcols(result TSRMLS_CC)) { efree(result); RETURN_FALSE; } @@ -3013,7 +3012,7 @@ SQLNumResultCols(result->stmt, &(result->numcols)); if (result->numcols > 0) { - if (!odbc_bindcols(result)) { + if (!odbc_bindcols(result TSRMLS_CC)) { efree(result); RETURN_FALSE; } @@ -3088,7 +3087,7 @@ SQLNumResultCols(result->stmt, &(result->numcols)); if (result->numcols > 0) { - if (!odbc_bindcols(result)) { + if (!odbc_bindcols(result TSRMLS_CC)) { efree(result); RETURN_FALSE; } @@ -3171,7 +3170,7 @@ SQLNumResultCols(result->stmt, &(result->numcols)); if (result->numcols > 0) { - if (!odbc_bindcols(result)) { + if (!odbc_bindcols(result TSRMLS_CC)) { efree(result); RETURN_FALSE; } @@ -3252,7 +3251,7 @@ SQLNumResultCols(result->stmt, &(result->numcols)); if (result->numcols > 0) { - if (!odbc_bindcols(result)) { + if (!odbc_bindcols(result TSRMLS_CC)) { efree(result); RETURN_FALSE; } @@ -3341,7 +3340,7 @@ SQLNumResultCols(result->stmt, &(result->numcols)); if (result->numcols > 0) { - if (!odbc_bindcols(result)) { + if (!odbc_bindcols(result TSRMLS_CC)) { efree(result); RETURN_FALSE; } @@ -3425,7 +3424,7 @@ SQLNumResultCols(result->stmt, &(result->numcols)); if (result->numcols > 0) { - if (!odbc_bindcols(result)) { + if (!odbc_bindcols(result TSRMLS_CC)) { efree(result); RETURN_FALSE; } @@ -3501,7 +3500,7 @@ SQLNumResultCols(result->stmt, &(result->numcols)); if (result->numcols > 0) { - if (!odbc_bindcols(result)) { + if (!odbc_bindcols(result TSRMLS_CC)) { efree(result); RETURN_FALSE; } Index: php4/ext/odbc/php_odbc.h diff -u php4/ext/odbc/php_odbc.h:1.40 php4/ext/odbc/php_odbc.h:1.41 --- php4/ext/odbc/php_odbc.h:1.40 Sun Jul 29 21:56:33 2001 +++ php4/ext/odbc/php_odbc.h Mon Jul 30 04:24:31 2001 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_odbc.h,v 1.40 2001/07/30 01:56:33 zeev Exp $ */ +/* $Id: php_odbc.h,v 1.41 2001/07/30 08:24:31 zeev Exp $ */ #ifndef PHP_ODBC_H #define PHP_ODBC_H @@ -314,7 +314,7 @@ int odbc_add_conn(HashTable *list, HDBC conn); odbc_connection *odbc_get_conn(HashTable *list, int count); void odbc_del_conn(HashTable *list, int ind); -int odbc_bindcols(odbc_result *result); +int odbc_bindcols(odbc_result *result TSRMLS_DC); #define ODBC_SQL_ERROR_PARAMS odbc_connection *conn_resource, ODBC_SQL_STMT_T stmt, char *func Index: php4/ext/openssl/openssl.c diff -u php4/ext/openssl/openssl.c:1.20 php4/ext/openssl/openssl.c:1.21 --- php4/ext/openssl/openssl.c:1.20 Mon Jul 30 00:58:02 2001 +++ php4/ext/openssl/openssl.c Mon Jul 30 04:24:31 2001 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: openssl.c,v 1.20 2001/07/30 04:58:02 zeev Exp $ */ +/* $Id: openssl.c,v 1.21 2001/07/30 08:24:31 zeev Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -104,8 +104,8 @@ static int le_x509; static X509 * php_openssl_x509_from_zval(zval ** val, int makeresource, long * resourceval); -static EVP_PKEY * php_openssl_evp_from_zval(zval ** val, int public_key, char * passphrase, int makeresource, long * resourceval); -static X509_STORE * setup_verify(zval * calist); +static EVP_PKEY * php_openssl_evp_from_zval(zval ** val, int public_key, char * passphrase, int makeresource, long * resourceval TSRMLS_DC); +static X509_STORE * setup_verify(zval * calist TSRMLS_DC); static STACK_OF(X509) * load_all_certs_from_file(char *certfile); /* {{{ PHP_MINIT_FUNCTION @@ -263,7 +263,7 @@ empty string rather than NULL for the passphrase - NULL causes a passphrase prompt to be emitted in the Apache error log! */ -static EVP_PKEY * php_openssl_evp_from_zval(zval ** val, int public_key, char * passphrase, int makeresource, long * resourceval) +static EVP_PKEY * php_openssl_evp_from_zval(zval ** val, int public_key, char * passphrase, int makeresource, long * resourceval TSRMLS_DC) { EVP_PKEY * key = NULL; X509 * cert = NULL; @@ -280,7 +280,7 @@ /* get passphrase */ if (zend_hash_index_find(HASH_OF(*val), 1, (void **)&zphrase) == FAILURE) { - zend_error(E_WARNING, "%s(): key array must be of the form array(0 => key, 1 => phrase)", get_active_function_name()); + zend_error(E_WARNING, "%s(): key array must be of the form array(0 => key, 1 => phrase)", get_active_function_name(TSRMLS_C)); return NULL; } convert_to_string_ex(zphrase); @@ -288,7 +288,7 @@ /* now set val to be the key param and continue */ if (zend_hash_index_find(HASH_OF(*val), 0, (void **)&val) == FAILURE) { - zend_error(E_WARNING, "%s(): key array must be of the form array(0 => key, 1 => phrase)", get_active_function_name()); + zend_error(E_WARNING, "%s(): key array must be of the form array(0 => key, 1 => phrase)", get_active_function_name(TSRMLS_C)); return NULL; } } @@ -405,7 +405,7 @@ pkey = php_openssl_evp_from_zval(key, 0, "", 0, &keyresource); if (pkey == NULL) { - zend_error(E_WARNING, "%s(): key param is not a valid private key", get_active_function_name()); + zend_error(E_WARNING, "%s(): key param is not a valid private key", get_active_function_name(TSRMLS_C) TSRMLS_CC); RETURN_FALSE; } @@ -475,7 +475,7 @@ pkey = php_openssl_evp_from_zval(key, 0, "", 0, &keyresource); if (pkey == NULL) { - zend_error(E_WARNING, "%s(): key param is not a valid private key", get_active_function_name()); + zend_error(E_WARNING, "%s(): key param is not a valid private key", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } @@ -550,9 +550,9 @@ RETVAL_FALSE; - pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, &keyresource); + pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, &keyresource TSRMLS_CC); if (pkey == NULL) { - zend_error(E_WARNING, "%s(): key param is not a valid public key", get_active_function_name()); + zend_error(E_WARNING, "%s(): key param is not a valid public key", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } @@ -620,9 +620,9 @@ convert_to_string_ex(data); RETVAL_FALSE; - pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, &keyresource); + pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, &keyresource TSRMLS_CC); if (pkey == NULL) { - zend_error(E_WARNING, "%s(): key param is not a valid public key", get_active_function_name()); + zend_error(E_WARNING, "%s(): key param is not a valid public key", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } @@ -685,10 +685,10 @@ } return_value->type = IS_RESOURCE; - pkey = php_openssl_evp_from_zval(key, 0, argc == 2 ? Z_STRVAL_PP(passphrase) : "", 1, &(return_value->value.lval)); + pkey = php_openssl_evp_from_zval(key, 0, argc == 2 ? Z_STRVAL_PP(passphrase) : "", 1, &(return_value->value.lval) TSRMLS_CC); if (pkey == NULL) { - zend_error(E_WARNING, "%s(): unable to coerce arg to a private key", get_active_function_name()); + zend_error(E_WARNING, "%s(): unable to coerce arg to a private key", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } } @@ -747,7 +747,7 @@ long gmadjust = 0; if (timestr->length < 13) { - zend_error(E_WARNING, "%s(): extension author too lazy to parse %s correctly", get_active_function_name(), timestr->data); + zend_error(E_WARNING, "%s(): extension author too lazy to parse %s correctly", get_active_function_name(TSRMLS_C), timestr->data); return (time_t)-1; } @@ -897,20 +897,21 @@ STACK_OF(X509) *stack=NULL, *ret=NULL; BIO *in=NULL; X509_INFO *xi; + TSRMLS_FETCH(); if(!(stack = sk_X509_new_null())) { - zend_error(E_ERROR, "%s(): memory allocation failure", get_active_function_name()); + zend_error(E_ERROR, "%s(): memory allocation failure", get_active_function_name(TSRMLS_C)); goto end; } if(!(in=BIO_new_file(certfile, "r"))) { - zend_error(E_WARNING, "%s(): error opening the file, %s", get_active_function_name(), certfile); + zend_error(E_WARNING, "%s(): error opening the file, %s", get_active_function_name(TSRMLS_C), certfile); goto end; } /* This loads from a file, a stack of x509/crl/pkey sets */ if(!(sk=PEM_X509_INFO_read_bio(in, NULL, NULL, NULL))) { - zend_error(E_WARNING, "%s(): error reading the file, %s", get_active_function_name(), certfile); + zend_error(E_WARNING, "%s(): error reading the file, %s", get_active_function_name(TSRMLS_C), certfile); goto end; } @@ -926,7 +927,7 @@ X509_INFO_free(xi); } if(!sk_X509_num(stack)) { - zend_error(E_WARNING, "%s(): no certificates in file, %s", get_active_function_name(), certfile); + zend_error(E_WARNING, "%s(): no certificates in file, %s", get_active_function_name(TSRMLS_C), certfile); sk_X509_free(stack); goto end; } @@ -944,11 +945,12 @@ { int ret=0; X509_STORE_CTX *csc; + TSRMLS_FETCH(); csc = X509_STORE_CTX_new(); if (csc == NULL) { - zend_error(E_ERROR, "%s(): memory allocation failure", get_active_function_name()); + zend_error(E_ERROR, "%s(): memory allocation failure", get_active_function_name(TSRMLS_C)); return 0; } X509_STORE_CTX_init(csc, ctx, x, untrustedchain); @@ -990,7 +992,7 @@ } convert_to_long_ex(zpurpose); - cainfo = setup_verify(*zcainfo); + cainfo = setup_verify(*zcainfo TSRMLS_CC); if (cainfo == NULL) goto clean_exit; @@ -1023,7 +1025,7 @@ } return_value->type = IS_RESOURCE; - pkey = php_openssl_evp_from_zval(cert, 1, NULL, 1, &(return_value->value.lval)); + pkey = php_openssl_evp_from_zval(cert, 1, NULL, 1, &(return_value->value.lval) TSRMLS_CC); if (pkey == NULL) { RETURN_FALSE; @@ -1064,7 +1066,7 @@ x509 = php_openssl_x509_from_zval(cert, 1, &(return_value->value.lval)); if (x509 == NULL) { - zend_error(E_WARNING, "%s() supplied parameter cannot be coerced into an X509 certificate!", get_active_function_name()); + zend_error(E_WARNING, "%s() supplied parameter cannot be coerced into an X509 certificate!", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } } @@ -1090,7 +1092,7 @@ * calist is an array containing file and directory names. create a * certificate store and add those certs to it for use in verification. */ -static X509_STORE * setup_verify(zval * calist) +static X509_STORE * setup_verify(zval * calist TSRMLS_DC) { X509_STORE *store; X509_LOOKUP * dir_lookup, * file_lookup; @@ -1114,14 +1116,14 @@ convert_to_string_ex(item); if (VCWD_STAT(Z_STRVAL_PP(item), &sb) == -1) { - zend_error(E_WARNING, "%s() unable to stat %s", get_active_function_name(), Z_STRVAL_PP(item)); + zend_error(E_WARNING, "%s() unable to stat %s", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(item)); continue; } if ((sb.st_mode & S_IFREG) == S_IFREG) { file_lookup = X509_STORE_add_lookup(store, X509_LOOKUP_file()); if (file_lookup == NULL || !X509_LOOKUP_load_file(file_lookup, Z_STRVAL_PP(item), X509_FILETYPE_PEM)) - zend_error(E_WARNING, "%s() error loading file %s", get_active_function_name(), Z_STRVAL_PP(item)); + zend_error(E_WARNING, "%s() error loading file %s", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(item)); else nfiles++; file_lookup = NULL; @@ -1129,7 +1131,7 @@ else { dir_lookup = X509_STORE_add_lookup(store, X509_LOOKUP_hash_dir()); if (dir_lookup == NULL || !X509_LOOKUP_add_dir(dir_lookup, Z_STRVAL_PP(item), X509_FILETYPE_PEM)) - zend_error(E_WARNING, "%s() error loading directory %s", get_active_function_name(), Z_STRVAL_PP(item)); + zend_error(E_WARNING, "%s() error loading directory %s", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(item)); else ndirs++; dir_lookup = NULL; @@ -1207,7 +1209,7 @@ if (argc >= 4) { if (Z_TYPE_PP(cainfo) != IS_ARRAY) { - zend_error(E_WARNING, "%s(): 4th parameter must be an array", get_active_function_name()); + zend_error(E_WARNING, "%s(): 4th parameter must be an array", get_active_function_name(TSRMLS_C)); goto clean_exit; } } @@ -1251,7 +1253,7 @@ } else { zend_error(E_WARNING, "%s(): signature OK, but cannot open %s for writing", - get_active_function_name(), signersfilename); + get_active_function_name(TSRMLS_C), signersfilename); RETVAL_LONG(-1); } } @@ -1299,7 +1301,7 @@ if ((*zheaders)->type == IS_NULL) zheaders = NULL; else if ((*zheaders)->type != IS_ARRAY) { - zend_error(E_WARNING, "%s(): 4th param must be an array/null value!", get_active_function_name()); + zend_error(E_WARNING, "%s(): 4th param must be an array/null value!", get_active_function_name(TSRMLS_C)); goto clean_exit; } } @@ -1445,7 +1447,7 @@ if ((*zheaders)->type == IS_NULL) zheaders = NULL; else if ((*zheaders)->type != IS_ARRAY) { - zend_error(E_WARNING, "%s(): 5th param must be an array/null value!", get_active_function_name()); + zend_error(E_WARNING, "%s(): 5th param must be an array/null value!", get_active_function_name(TSRMLS_C)); goto clean_exit; } } @@ -1453,33 +1455,33 @@ convert_to_string_ex(zinfilename); convert_to_string_ex(zoutfilename); - privkey = php_openssl_evp_from_zval(zprivkey, 0, "", 0, &keyresource); + privkey = php_openssl_evp_from_zval(zprivkey, 0, "", 0, &keyresource TSRMLS_CC); if (privkey == NULL) { - zend_error(E_WARNING, "%s(): error getting private key", get_active_function_name()); + zend_error(E_WARNING, "%s(): error getting private key", get_active_function_name(TSRMLS_C)); goto clean_exit; } cert = php_openssl_x509_from_zval(zcert, 0, &certresource); if (cert == NULL) { - zend_error(E_WARNING, "%s(): error getting cert", get_active_function_name()); + zend_error(E_WARNING, "%s(): error getting cert", get_active_function_name(TSRMLS_C)); goto clean_exit; } infile = BIO_new_file(Z_STRVAL_PP(zinfilename), "r"); if (infile == NULL) { - zend_error(E_WARNING, "%s(): error opening input file %s!", get_active_function_name(), Z_STRVAL_PP(zinfilename)); + zend_error(E_WARNING, "%s(): error opening input file %s!", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(zinfilename)); goto clean_exit; } outfile = BIO_new_file(Z_STRVAL_PP(zoutfilename), "w"); if (outfile == NULL) { - zend_error(E_WARNING, "%s(): error opening output file %s!", get_active_function_name(), Z_STRVAL_PP(zoutfilename)); + zend_error(E_WARNING, "%s(): error opening output file %s!", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(zoutfilename)); goto clean_exit; } p7 = PKCS7_sign(cert, privkey, others, infile, flags); if (p7 == NULL) { - zend_error(E_WARNING, "%s(): error creating PKCS7 structure!", get_active_function_name()); + zend_error(E_WARNING, "%s(): error creating PKCS7 structure!", get_active_function_name(TSRMLS_C)); goto clean_exit; } @@ -1539,13 +1541,13 @@ cert = php_openssl_x509_from_zval(recipcert, 0, &certresval); if (cert == NULL) { - zend_error(E_WARNING, "%s(): unable to coerce param 3 to x509 cert", get_active_function_name()); + zend_error(E_WARNING, "%s(): unable to coerce param 3 to x509 cert", get_active_function_name(TSRMLS_C)); goto clean_exit; } - key = php_openssl_evp_from_zval(argc == 3 ? recipcert : recipkey, 0, "", 0, &keyresval); + key = php_openssl_evp_from_zval(argc == 3 ? recipcert : recipkey, 0, "", 0, &keyresval TSRMLS_CC); if (key == NULL) { - zend_error(E_WARNING, "%s(): unable to coerce param %d to a private key", get_active_function_name(), argc); + zend_error(E_WARNING, "%s(): unable to coerce param %d to a private key", get_active_function_name(TSRMLS_C), argc); goto clean_exit; } @@ -1598,9 +1600,9 @@ } convert_to_string_ex(data); - pkey = php_openssl_evp_from_zval(key, 0, "", 0, &keyresource); + pkey = php_openssl_evp_from_zval(key, 0, "", 0, &keyresource TSRMLS_CC); if (pkey == NULL) { - zend_error(E_WARNING, "%s(): supplied key param cannot be coerced into a private key", get_active_function_name()); + zend_error(E_WARNING, "%s(): supplied key param cannot be coerced into a private key", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } @@ -1640,9 +1642,9 @@ convert_to_string_ex(data); convert_to_string_ex(signature); - pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, &keyresource); + pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, &keyresource TSRMLS_CC); if (pkey == NULL) { - zend_error(E_WARNING, "%s(): supplied key param cannot be coerced into a public key", get_active_function_name()); + zend_error(E_WARNING, "%s(): supplied key param cannot be coerced into a public key", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } @@ -1699,9 +1701,9 @@ i = 0; while (zend_hash_get_current_data_ex(pubkeysht, (void **) &pubkey, &pos) == SUCCESS) { - pkeys[i] = php_openssl_evp_from_zval(pubkey, 1, NULL, 0, &key_resources[i]); + pkeys[i] = php_openssl_evp_from_zval(pubkey, 1, NULL, 0, &key_resources[i] TSRMLS_CC); if (pkeys[i] == NULL) { - zend_error(E_WARNING, "%s(): not a public key (%dth member of pubkeys)", get_active_function_name(), i); + zend_error(E_WARNING, "%s(): not a public key (%dth member of pubkeys)", get_active_function_name(TSRMLS_C), i); RETVAL_FALSE; goto clean_exit; } @@ -1811,9 +1813,9 @@ convert_to_string_ex(data); convert_to_string_ex(ekey); - pkey = php_openssl_evp_from_zval(privkey, 0, "", 0, &keyresource); + pkey = php_openssl_evp_from_zval(privkey, 0, "", 0, &keyresource TSRMLS_CC); if (pkey == NULL) { - zend_error(E_WARNING, "%s(): unable to coerce param 4 into a private key", get_active_function_name()); + zend_error(E_WARNING, "%s(): unable to coerce param 4 into a private key", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } buf = emalloc(Z_STRLEN_PP(data) + 1); Index: php4/ext/pcntl/pcntl.c diff -u php4/ext/pcntl/pcntl.c:1.8 php4/ext/pcntl/pcntl.c:1.9 --- php4/ext/pcntl/pcntl.c:1.8 Mon Jul 30 01:36:13 2001 +++ php4/ext/pcntl/pcntl.c Mon Jul 30 04:24:32 2001 @@ -192,7 +192,7 @@ id=fork(); if (id == -1) { - php_error(E_ERROR, "Error %d in %s", errno, get_active_function_name()); + php_error(E_ERROR, "Error %d in %s", errno, get_active_function_name(TSRMLS_C)); } RETURN_LONG((long) id); @@ -366,23 +366,23 @@ /* Special long value case for SIG_DFL and SIG_IGN */ if (Z_TYPE_PP(handle)==IS_LONG) { if (Z_LVAL_PP(handle)!= (long) SIG_DFL && Z_LVAL_PP(handle) != (long) SIG_IGN) { - php_error(E_WARNING, "Invalid value for handle argument specifEied in %s", get_active_function_name()); + php_error(E_WARNING, "Invalid value for handle argument specifEied in %s", get_active_function_name(TSRMLS_C)); } if (php_signal(Z_LVAL_PP(signo), (Sigfunc *) Z_LVAL_PP(handle))==SIG_ERR) { - php_error(E_WARNING, "Error assigning singal in %s", get_active_function_name()); + php_error(E_WARNING, "Error assigning singal in %s", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } RETURN_TRUE; } if (Z_TYPE_PP(handle)!=IS_STRING) { - php_error(E_WARNING, "Invalid type specified for handle argument in %s", get_active_function_name()); + php_error(E_WARNING, "Invalid type specified for handle argument in %s", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } convert_to_string_ex(handle); /* Just in case */ if (!zend_is_callable(*handle, 0, &func_name)) { - php_error(E_WARNING, "%s: %s is not a callable function name error", get_active_function_name(), func_name); + php_error(E_WARNING, "%s: %s is not a callable function name error", get_active_function_name(TSRMLS_C), func_name); efree(func_name); RETURN_FALSE; } @@ -392,7 +392,7 @@ zend_hash_index_update(&PCNTL_G(php_signal_table), Z_LVAL_PP(signo), Z_STRVAL_PP(handle), (Z_STRLEN_PP(handle) + 1) * sizeof(char), NULL); if (php_signal(Z_LVAL_PP(signo), pcntl_signal_handler)==SIG_ERR) { - php_error(E_WARNING, "Error assigning singal in %s", get_active_function_name()); + php_error(E_WARNING, "Error assigning singal in %s", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } RETURN_TRUE; @@ -404,9 +404,10 @@ { char *func_name; zval *param, *call_name, *retval; - - PCNTL_LS_FETCH(); - DEBUG_OUT("Caught signal: %d\n", signo); + PCNTL_LS_FETCH(); + TSRMLS_FETCH(); + + DEBUG_OUT("Caught signal: %d\n", signo); if (zend_hash_index_find(&PCNTL_G(php_signal_table), (long) signo, (void *) &func_name)==FAILURE) { DEBUG_OUT("Signl handler not fount"); return; @@ -419,7 +420,7 @@ ZVAL_STRING(call_name, func_name, 1); /* Call php singal handler - Note that we do not report errors, and we ignore the return value */ - call_user_function(EG(function_table), NULL, call_name, retval, 1, &param); + call_user_function(EG(function_table), NULL, call_name, retval, 1, &param TSRMLS_CC); zval_dtor(call_name); efree(call_name); @@ -477,11 +478,13 @@ } /* Custom hook to ensure signals only get called at a safe poing in Zend's execute process */ -void pcntl_zend_extension_statement_handler(zend_op_array *op_array) { +void pcntl_zend_extension_statement_handler(zend_op_array *op_array) +{ zend_llist_element *element; - zval *param, *call_name, *retval; + zval *param, *call_name, *retval; char *func_name; PCNTL_LS_FETCH(); + TSRMLS_FETCH(); /* Bail if the queue is empty or if we are already playing the queue*/ if (! PCNTL_G(signal_queue_ready) || PCNTL_G(processing_signal_queue)) @@ -515,7 +518,7 @@ ZVAL_STRING(call_name, func_name, 0); /* Call php singal handler - Note that we do not report errors, and we ignore the return value */ - call_user_function(EG(function_table), NULL, call_name, retval, 1, &param); + call_user_function(EG(function_table), NULL, call_name, retval, 1, &param TSRMLS_CC); } /* Clear */ zend_llist_clean(&PCNTL_G(php_signal_queue)); Index: php4/ext/pcre/php_pcre.c diff -u php4/ext/pcre/php_pcre.c:1.105 php4/ext/pcre/php_pcre.c:1.106 --- php4/ext/pcre/php_pcre.c:1.105 Mon Jul 30 01:36:13 2001 +++ php4/ext/pcre/php_pcre.c Mon Jul 30 04:24:32 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_pcre.c,v 1.105 2001/07/30 05:36:13 zeev Exp $ */ +/* $Id: php_pcre.c,v 1.106 2001/07/30 08:24:32 zeev Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -566,7 +566,7 @@ add_next_index_stringl(subpats, &subject[offsets[i<<1]], offsets[(i<<1)+1] - offsets[i<<1], 1); args[0] = &subpats; - if (call_user_function_ex(EG(function_table), NULL, function, &retval_ptr, 1, args, 0, NULL) == SUCCESS && retval_ptr) { + if (call_user_function_ex(EG(function_table), NULL, function, &retval_ptr, 1, args, 0, NULL TSRMLS_CC) == SUCCESS && retval_ptr) { convert_to_string_ex(&retval_ptr); *result = estrndup(Z_STRVAL_P(retval_ptr), Z_STRLEN_P(retval_ptr)); result_len = Z_STRLEN_P(retval_ptr); @@ -993,7 +993,7 @@ if (is_callable_replace) { if (!zend_is_callable(*replace, 0, &callback_name)) { php_error(E_WARNING, "%s() requires argument 2, '%s', to be a valid callback", - get_active_function_name(), callback_name); + get_active_function_name(TSRMLS_C), callback_name); efree(callback_name); *return_value = **subject; zval_copy_ctor(return_value); Index: php4/ext/pgsql/pgsql.c diff -u php4/ext/pgsql/pgsql.c:1.118 php4/ext/pgsql/pgsql.c:1.119 --- php4/ext/pgsql/pgsql.c:1.118 Mon Jul 30 02:18:01 2001 +++ php4/ext/pgsql/pgsql.c Mon Jul 30 04:24:32 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pgsql.c,v 1.118 2001/07/30 06:18:01 zeev Exp $ */ +/* $Id: pgsql.c,v 1.119 2001/07/30 08:24:32 zeev Exp $ */ #include <stdlib.h> @@ -43,7 +43,7 @@ #define PGSQL_NUM 1<<1 #define PGSQL_BOTH (PGSQL_ASSOC|PGSQL_NUM) -#define CHECK_DEFAULT_LINK(x) if (x == -1) { php_error(E_WARNING, "%s: no PostgreSQL link opened yet", get_active_function_name()); } +#define CHECK_DEFAULT_LINK(x) if (x == -1) { php_error(E_WARNING, "%s: no PostgreSQL link opened yet", get_active_function_name(TSRMLS_C)); } /* {{{ pgsql_functions[] */ Index: php4/ext/readline/readline.c diff -u php4/ext/readline/readline.c:1.21 php4/ext/readline/readline.c:1.22 --- php4/ext/readline/readline.c:1.21 Sat Jul 28 07:36:10 2001 +++ php4/ext/readline/readline.c Mon Jul 30 04:24:33 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: readline.c,v 1.21 2001/07/28 11:36:10 zeev Exp $ */ +/* $Id: readline.c,v 1.22 2001/07/30 08:24:33 zeev Exp $ */ /* {{{ includes & prototypes */ @@ -394,7 +394,7 @@ params[2]=_readline_long_zval(start); params[3]=_readline_long_zval(end); - if (call_user_function(CG(function_table), NULL, params[0], &_readline_array, 3, params+1) == SUCCESS) { + if (call_user_function(CG(function_table), NULL, params[0], &_readline_array, 3, params+1 TSRMLS_CC) == SUCCESS) { if (_readline_array.type == IS_ARRAY) { matches = completion_matches(text,_readline_command_generator); } Index: php4/ext/sablot/sablot.c diff -u php4/ext/sablot/sablot.c:1.45 php4/ext/sablot/sablot.c:1.46 --- php4/ext/sablot/sablot.c:1.45 Mon Jul 30 02:18:02 2001 +++ php4/ext/sablot/sablot.c Mon Jul 30 04:24:34 2001 @@ -1133,10 +1133,11 @@ zval *retval; int i; TSRMLS_FETCH(); + MAKE_STD_ZVAL(retval); - if (call_user_function(EG(function_table), NULL, handlerName, retval, argc, args) == FAILURE) { - php_error(E_WARNING, "Sorry, couldn't call %s handler", function_name); + if (call_user_function(EG(function_table), NULL, handlerName, retval, argc, args TSRMLS_CC) == FAILURE) { + php_error(E_WARNING, "Sorry, couldn't call %s handler", function_name); } zval_dtor(retval); @@ -1433,7 +1434,7 @@ } } - if (call_user_function(EG(function_table), NULL, errorHandler, retval, argc, argv) == FAILURE) { + if (call_user_function(EG(function_table), NULL, errorHandler, retval, argc, argv TSRMLS_CC) == FAILURE) { php_error(E_WARNING, "Sorry, couldn't call %s error handler", Z_STRVAL_P(errorHandler)); } @@ -1510,7 +1511,7 @@ handle->getAllHandler, retval, argc, - argv) == FAILURE) { + argv TSRMLS_CC) == FAILURE) { php_error(E_WARNING, "Sorry couldn't call function, %s, with handler of type %s", handle->getAllHandler->value.str.val, "Scheme GetALL"); } Index: php4/ext/session/mod_user.c diff -u php4/ext/session/mod_user.c:1.16 php4/ext/session/mod_user.c:1.17 --- php4/ext/session/mod_user.c:1.16 Fri Jul 27 06:16:28 2001 +++ php4/ext/session/mod_user.c Mon Jul 30 04:24:34 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: mod_user.c,v 1.16 2001/07/27 10:16:28 zeev Exp $ */ +/* $Id: mod_user.c,v 1.17 2001/07/30 08:24:34 zeev Exp $ */ #include "php.h" #include "php_session.h" @@ -59,7 +59,7 @@ MAKE_STD_ZVAL(retval); if (call_user_function(EG(function_table), NULL, func, retval, - argc, argv) == FAILURE) { + argc, argv TSRMLS_CC) == FAILURE) { zval_ptr_dtor(&retval); retval = NULL; } Index: php4/ext/sockets/sockets.c diff -u php4/ext/sockets/sockets.c:1.57 php4/ext/sockets/sockets.c:1.58 --- php4/ext/sockets/sockets.c:1.57 Wed Jul 25 18:03:55 2001 +++ php4/ext/sockets/sockets.c Mon Jul 30 04:24:34 2001 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: sockets.c,v 1.57 2001/07/25 22:03:55 dbeu Exp $ */ +/* $Id: sockets.c,v 1.58 2001/07/30 08:24:34 zeev Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -450,7 +450,7 @@ FD_SET(php_sock->socket, &(php_fd->set)); max_fd = php_sock->socket; } else { - php_error(E_ERROR, "expecting variable of type array or resource in %s()", get_active_function_name()); + php_error(E_ERROR, "expecting variable of type array or resource in %s()", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } @@ -484,7 +484,7 @@ ZEND_FETCH_RESOURCE(php_sock, php_socket*, arg2, -1, le_socket_name, le_socket); FD_CLR(php_sock->socket, &(php_fd->set)); } else { - php_error(E_ERROR, "expecting variable of type array or resource in %s()", get_active_function_name()); + php_error(E_ERROR, "expecting variable of type array or resource in %s()", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } @@ -571,7 +571,7 @@ } if (!sets) { - php_error(E_ERROR, "expecting atleast one %s in %s()", le_destroy_name, get_active_function_name()); + php_error(E_ERROR, "expecting atleast one %s in %s()", le_destroy_name, get_active_function_name(TSRMLS_C)); RETURN_FALSE; } Index: php4/ext/standard/array.c diff -u php4/ext/standard/array.c:1.117 php4/ext/standard/array.c:1.118 --- php4/ext/standard/array.c:1.117 Mon Jul 30 00:58:04 2001 +++ php4/ext/standard/array.c Mon Jul 30 04:24:34 2001 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: array.c,v 1.117 2001/07/30 04:58:04 zeev Exp $ */ +/* $Id: array.c,v 1.118 2001/07/30 08:24:34 zeev Exp $ */ #include "php.h" #include "php_ini.h" @@ -364,7 +364,7 @@ target_hash = HASH_OF(*array); if (!target_hash) { php_error(E_WARNING, "Wrong datatype in %s() call", - get_active_function_name()); + get_active_function_name(TSRMLS_C)); return; } @@ -530,7 +530,7 @@ args[0] = (pval **) f->pData; args[1] = (pval **) s->pData; - if (call_user_function_ex(EG(function_table), NULL, *BG(user_compare_func_name), &retval_ptr, 2, args, 0, NULL)==SUCCESS + if (call_user_function_ex(EG(function_table), NULL, *BG(user_compare_func_name), &retval_ptr, 2, args, 0, NULL TSRMLS_CC)==SUCCESS && retval_ptr) { long retval; @@ -634,7 +634,7 @@ Z_TYPE(key2) = IS_LONG; } - status = call_user_function(EG(function_table), NULL, *BG(user_compare_func_name), &retval, 2, args); + status = call_user_function(EG(function_table), NULL, *BG(user_compare_func_name), &retval, 2, args TSRMLS_CC); zval_dtor(&key1); zval_dtor(&key2); @@ -978,7 +978,7 @@ /* Call the userland function */ if (call_user_function_ex(EG(function_table), NULL, *BG(array_walk_func_name), - &retval_ptr, userdata ? 3 : 2, args, 0, NULL) == SUCCESS) { + &retval_ptr, userdata ? 3 : 2, args, 0, NULL TSRMLS_CC) == SUCCESS) { zval_ptr_dtor(&retval_ptr); } else @@ -1012,14 +1012,14 @@ target_hash = HASH_OF(*array); if (!target_hash) { php_error(E_WARNING, "Wrong datatype in %s() call", - get_active_function_name()); + get_active_function_name(TSRMLS_C)); BG(array_walk_func_name) = old_walk_func_name; RETURN_FALSE; } if (Z_TYPE_PP(BG(array_walk_func_name)) != IS_ARRAY && Z_TYPE_PP(BG(array_walk_func_name)) != IS_STRING) { php_error(E_WARNING, "Wrong syntax for function name in %s() call", - get_active_function_name()); + get_active_function_name(TSRMLS_C)); BG(array_walk_func_name) = old_walk_func_name; RETURN_FALSE; } @@ -1052,12 +1052,12 @@ } if (Z_TYPE_PP(value) == IS_ARRAY || Z_TYPE_PP(value) == IS_OBJECT) { - php_error(E_WARNING, "Wrong datatype for first argument in call to %s", get_active_function_name()); + php_error(E_WARNING, "Wrong datatype for first argument in call to %s", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } if (Z_TYPE_PP(array) != IS_ARRAY) { - php_error(E_WARNING, "Wrong datatype for second argument in call to %s", get_active_function_name()); + php_error(E_WARNING, "Wrong datatype for second argument in call to %s", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } @@ -1167,7 +1167,7 @@ extract_type = Z_LVAL_PP(z_extract_type); if (extract_type > EXTR_SKIP && extract_type <= EXTR_PREFIX_INVALID) { php_error(E_WARNING, "%s() expects a prefix to be specified", - get_active_function_name()); + get_active_function_name(TSRMLS_C)); return; } break; @@ -1188,13 +1188,13 @@ if (extract_type < EXTR_OVERWRITE || extract_type > EXTR_PREFIX_INVALID) { php_error(E_WARNING, "Unknown extract type in call to %s()", - get_active_function_name()); + get_active_function_name(TSRMLS_C)); return; } if (Z_TYPE_PP(var_array) != IS_ARRAY) { php_error(E_WARNING, "%s() expects first argument to be an array", - get_active_function_name()); + get_active_function_name(TSRMLS_C)); return; } @@ -2150,7 +2150,7 @@ /* Make sure arguments are of the proper type */ if (Z_TYPE_PP(input) != IS_ARRAY) { php_error(E_WARNING, "Argument to %s() should be an array", - get_active_function_name()); + get_active_function_name(TSRMLS_C)); return; } convert_to_long_ex(pad_size); @@ -2598,7 +2598,7 @@ sort_order = Z_LVAL_PP(args[i]) == SORT_DESC ? -1 : 1; parse_state[MULTISORT_ORDER] = 0; } else { - php_error(E_WARNING, "Argument %i to %s() is expected to be an array or sorting flag that has not already been specified", i+1, get_active_function_name()); + php_error(E_WARNING, "Argument %i to %s() is expected to be an array or sorting flag that has not already been specified", i+1, get_active_function_name(TSRMLS_C)); MULTISORT_ABORT; } break; @@ -2612,20 +2612,20 @@ sort_type = Z_LVAL_PP(args[i]); parse_state[MULTISORT_TYPE] = 0; } else { - php_error(E_WARNING, "Argument %i to %s() is expected to be an array or sorting flag that has not already been specified", i+1, get_active_function_name()); + php_error(E_WARNING, "Argument %i to %s() is expected to be an array or sorting flag that has not already been specified", i+1, get_active_function_name(TSRMLS_C)); MULTISORT_ABORT; } break; default: php_error(E_WARNING, "Argument %i to %s() is an unknown sort flag", i+1, - get_active_function_name()); + get_active_function_name(TSRMLS_C)); MULTISORT_ABORT; break; } } else { - php_error(E_WARNING, "Argument %i to %s() is expected to be an array or a sort flag", i+1, get_active_function_name()); + php_error(E_WARNING, "Argument %i to %s() is expected to be an array or a sort flag", i+1, get_active_function_name(TSRMLS_C)); MULTISORT_ABORT; } } @@ -2735,7 +2735,7 @@ if (Z_TYPE_PP(input) != IS_ARRAY) { zend_error(E_WARNING, "Argument to %s() has to be an array", - get_active_function_name()); + get_active_function_name(TSRMLS_C)); return; } @@ -2745,7 +2745,7 @@ convert_to_long_ex(num_req); num_req_val = Z_LVAL_PP(num_req); if (num_req_val <= 0 || num_req_val > num_avail) { - zend_error(E_WARNING, "Second argument to %s() has to be between 1 and the number of elements in the array", get_active_function_name()); + zend_error(E_WARNING, "Second argument to %s() has to be between 1 and the number of elements in the array", get_active_function_name(TSRMLS_C)); return; } } else @@ -2816,7 +2816,7 @@ if (Z_TYPE_PP(input) != IS_ARRAY) { php_error(E_WARNING, "The argument to %s() should be an array", - get_active_function_name()); + get_active_function_name(TSRMLS_C)); return; } @@ -2863,13 +2863,13 @@ if (Z_TYPE_PP(input) != IS_ARRAY) { php_error(E_WARNING, "%s() expects argument 1 to be an array", - get_active_function_name()); + get_active_function_name(TSRMLS_C)); return; } if (!zend_is_callable(*callback, 0, &callback_name)) { php_error(E_WARNING, "%s() expects argument 2, '%s', to be a valid callback", - get_active_function_name(), callback_name); + get_active_function_name(TSRMLS_C), callback_name); efree(callback_name); return; } @@ -2891,10 +2891,10 @@ if (result) { args[0] = &result; args[1] = operand; - if (call_user_function_ex(EG(function_table), NULL, *callback, &retval, 2, args, 0, NULL) == SUCCESS && retval) { + if (call_user_function_ex(EG(function_table), NULL, *callback, &retval, 2, args, 0, NULL TSRMLS_CC) == SUCCESS && retval) { result = retval; } else { - php_error(E_WARNING, "%s() had an error invoking the reduction callback", get_active_function_name()); + php_error(E_WARNING, "%s() had an error invoking the reduction callback", get_active_function_name(TSRMLS_C)); return; } } else @@ -2929,14 +2929,14 @@ if (Z_TYPE_PP(input) != IS_ARRAY) { php_error(E_WARNING, "%s() expects argument 1 to be an array", - get_active_function_name()); + get_active_function_name(TSRMLS_C)); return; } if (ZEND_NUM_ARGS() > 1) { if (!zend_is_callable(*callback, 0, &callback_name)) { php_error(E_WARNING, "%s() expects argument 2, '%s', to be a valid callback", - get_active_function_name(), callback_name); + get_active_function_name(TSRMLS_C), callback_name); efree(callback_name); return; } @@ -2953,14 +2953,14 @@ if (callback) { args[0] = operand; - if (call_user_function_ex(EG(function_table), NULL, *callback, &retval, 1, args, 0, NULL) == SUCCESS && retval) { + if (call_user_function_ex(EG(function_table), NULL, *callback, &retval, 1, args, 0, NULL TSRMLS_CC) == SUCCESS && retval) { if (!zend_is_true(retval)) { zval_ptr_dtor(&retval); continue; } else zval_ptr_dtor(&retval); } else { - php_error(E_WARNING, "%s() had an error invoking the filter callback", get_active_function_name()); + php_error(E_WARNING, "%s() had an error invoking the filter callback", get_active_function_name(TSRMLS_C)); return; } } else if (!zend_is_true(*operand)) @@ -3008,7 +3008,7 @@ callback = *args[0]; if (Z_TYPE_P(callback) != IS_NULL && !zend_is_callable(callback, 0, &callback_name)) { php_error(E_WARNING, "%s() expects argument 1, '%s', to be either NULL or a valid callback", - get_active_function_name(), callback_name); + get_active_function_name(TSRMLS_C), callback_name); efree(callback_name); efree(args); return; @@ -3022,7 +3022,7 @@ for (i = 0; i < ZEND_NUM_ARGS()-1; i++) { if (Z_TYPE_PP(args[i+1]) != IS_ARRAY) { php_error(E_WARNING, "%s() expects argument %d to be an array", - get_active_function_name(), i + 2); + get_active_function_name(TSRMLS_C), i + 2); efree(array_len); efree(args); return; @@ -3075,8 +3075,8 @@ } if (Z_TYPE_P(callback) != IS_NULL) { - if (!call_user_function_ex(EG(function_table), NULL, callback, &result, ZEND_NUM_ARGS()-1, params, 0, NULL) == SUCCESS && result) { - php_error(E_WARNING, "%s() had an error invoking the map callback", get_active_function_name()); + if (!call_user_function_ex(EG(function_table), NULL, callback, &result, ZEND_NUM_ARGS()-1, params, 0, NULL TSRMLS_CC) == SUCCESS && result) { + php_error(E_WARNING, "%s() had an error invoking the map callback", get_active_function_name(TSRMLS_C)); efree(array_len); efree(args); zval_dtor(return_value); @@ -3108,7 +3108,7 @@ } if (Z_TYPE_PP(array) != IS_ARRAY && Z_TYPE_PP(array) != IS_OBJECT) { - php_error(E_WARNING, "Wrong datatype for second argument in call to %s", get_active_function_name()); + php_error(E_WARNING, "Wrong datatype for second argument in call to %s", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } @@ -3126,7 +3126,7 @@ RETURN_FALSE; default: - php_error(E_WARNING, "Wrong datatype for first argument in call to %s", get_active_function_name()); + php_error(E_WARNING, "Wrong datatype for first argument in call to %s", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } Index: php4/ext/standard/assert.c diff -u php4/ext/standard/assert.c:1.39 php4/ext/standard/assert.c:1.40 --- php4/ext/standard/assert.c:1.39 Mon Jul 30 02:18:05 2001 +++ php4/ext/standard/assert.c Mon Jul 30 04:24:35 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: assert.c,v 1.39 2001/07/30 06:18:05 zeev Exp $ */ +/* $Id: assert.c,v 1.40 2001/07/30 08:24:35 zeev Exp $ */ /* {{{ includes/startup/misc */ @@ -195,7 +195,7 @@ ZVAL_FALSE(retval); /* XXX do we want to check for error here? */ - call_user_function(CG(function_table), NULL, ASSERTG(callback), retval, 3, args); + call_user_function(CG(function_table), NULL, ASSERTG(callback), retval, 3, args TSRMLS_CC); for (i = 0; i <= 2; i++) { zval_ptr_dtor(&(args[i])); Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.367 php4/ext/standard/basic_functions.c:1.368 --- php4/ext/standard/basic_functions.c:1.367 Mon Jul 30 02:18:05 2001 +++ php4/ext/standard/basic_functions.c Mon Jul 30 04:24:35 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.c,v 1.367 2001/07/30 06:18:05 zeev Exp $ */ +/* $Id: basic_functions.c,v 1.368 2001/07/30 08:24:35 zeev Exp $ */ #include "php.h" #include "php_main.h" @@ -933,7 +933,7 @@ } convert_to_string_ex(const_name); - if (!zend_get_constant(Z_STRVAL_PP(const_name), Z_STRLEN_PP(const_name), return_value)) { + if (!zend_get_constant(Z_STRVAL_PP(const_name), Z_STRLEN_PP(const_name), return_value TSRMLS_CC)) { php_error(E_WARNING, "Couldn't find constant %s", Z_STRVAL_PP(const_name)); RETURN_NULL(); } @@ -1624,13 +1624,13 @@ if (!zend_is_callable(*params[0], 0, &name)) { php_error(E_WARNING, "%s() expects first argument, '%s', to be a valid callback", - get_active_function_name(), name); + get_active_function_name(TSRMLS_C), name); efree(name); efree(params); RETURN_NULL(); } - if (call_user_function_ex(EG(function_table), NULL, *params[0], &retval_ptr, argc - 1, params + 1, 0, NULL)==SUCCESS && retval_ptr) { + if (call_user_function_ex(EG(function_table), NULL, *params[0], &retval_ptr, argc - 1, params + 1, 0, NULL TSRMLS_CC)==SUCCESS && retval_ptr) { COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); } else { php_error(E_WARNING, "Unable to call %s()", name); @@ -1668,7 +1668,7 @@ if (!zend_is_callable(*func, 0, &name)) { php_error(E_WARNING, "%s() expects first argument, '%s', to be a valid callback", - get_active_function_name(), name); + get_active_function_name(TSRMLS_C), name); efree(name); RETURN_NULL(); } @@ -1684,7 +1684,7 @@ current++; } - if (call_user_function_ex(EG(function_table), NULL, *func, &retval_ptr, count, func_params, 0, NULL) == SUCCESS && retval_ptr) { + if (call_user_function_ex(EG(function_table), NULL, *func, &retval_ptr, count, func_params, 0, NULL TSRMLS_CC) == SUCCESS && retval_ptr) { COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); } else { php_error(E_WARNING, "Unable to call %s()", name); @@ -1723,7 +1723,7 @@ } SEPARATE_ZVAL(params[0]); convert_to_string(*params[0]); - if (call_user_function_ex(EG(function_table), params[1], *params[0], &retval_ptr, arg_count-2, params+2, 0, NULL)==SUCCESS && retval_ptr) { + if (call_user_function_ex(EG(function_table), params[1], *params[0], &retval_ptr, arg_count-2, params+2, 0, NULL TSRMLS_CC)==SUCCESS && retval_ptr) { COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); } else { php_error(E_WARNING,"Unable to call %s()", Z_STRVAL_PP(params[0])); @@ -1771,7 +1771,7 @@ zend_hash_move_forward(params_ar)) element++; - if (call_user_function_ex(EG(function_table), obj, *method_name, &retval_ptr, num_elems, method_args, 0, NULL) == SUCCESS && retval_ptr) { + if (call_user_function_ex(EG(function_table), obj, *method_name, &retval_ptr, num_elems, method_args, 0, NULL TSRMLS_CC) == SUCCESS && retval_ptr) { COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); } else { php_error(E_WARNING, "Unable to call %s()", Z_STRVAL_PP(method_name)); @@ -1806,7 +1806,7 @@ zval retval; TSRMLS_FETCH(); - if (call_user_function(EG(function_table), NULL, shutdown_function_entry->arguments[0], &retval, shutdown_function_entry->arg_count-1, shutdown_function_entry->arguments+1)==SUCCESS) { + if (call_user_function(EG(function_table), NULL, shutdown_function_entry->arguments[0], &retval, shutdown_function_entry->arg_count-1, shutdown_function_entry->arguments+1 TSRMLS_CC)==SUCCESS) { zval_dtor(&retval); } else { php_error(E_WARNING,"Unable to call %s() - function does not exist", @@ -1822,7 +1822,7 @@ TSRMLS_FETCH(); if (call_user_function(EG(function_table), NULL, function, &retval, - tick_fe->arg_count - 1, tick_fe->arguments + 1) == SUCCESS) { + tick_fe->arg_count - 1, tick_fe->arguments+1 TSRMLS_CC) == SUCCESS) { zval_dtor(&retval); } else { zval **obj, **method; @@ -2387,7 +2387,7 @@ /* This function is not directly accessible to end users */ PHPAPI PHP_FUNCTION(warn_not_available) { - php_error(E_WARNING, "%s() is not supported in this PHP build", get_active_function_name()); + php_error(E_WARNING, "%s() is not supported in this PHP build", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.172 php4/ext/standard/file.c:1.173 --- php4/ext/standard/file.c:1.172 Mon Jul 30 02:18:06 2001 +++ php4/ext/standard/file.c Mon Jul 30 04:24:35 2001 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: file.c,v 1.172 2001/07/30 06:18:06 zeev Exp $ */ +/* $Id: file.c,v 1.173 2001/07/30 08:24:35 zeev Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -621,7 +621,7 @@ stream = php_stream_fopen(Z_STRVAL_PP(zfilename), Z_STRVAL_PP(zmode)); if (stream == NULL) { - zend_error(E_WARNING, "%s(): unable to open %s: %s", get_active_function_name(), Z_STRVAL_PP(zfilename), strerror(errno)); + zend_error(E_WARNING, "%s(): unable to open %s: %s", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(zfilename), strerror(errno)); RETURN_FALSE; } ZEND_REGISTER_RESOURCE(return_value, stream, le_stream); @@ -1247,7 +1247,7 @@ convert_to_string_ex( format_string ); result = php_sscanf_internal( buf,(*format_string)->value.str.val, - argCount,args, 2,&return_value); + argCount, args, 2, &return_value TSRMLS_CC); efree(args); efree(buf); if (SCAN_ERROR_WRONG_PARAM_COUNT == result) { Index: php4/ext/standard/formatted_print.c diff -u php4/ext/standard/formatted_print.c:1.37 php4/ext/standard/formatted_print.c:1.38 --- php4/ext/standard/formatted_print.c:1.37 Mon Jul 30 00:58:05 2001 +++ php4/ext/standard/formatted_print.c Mon Jul 30 04:24:36 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: formatted_print.c,v 1.37 2001/07/30 04:58:05 zeev Exp $ */ +/* $Id: formatted_print.c,v 1.38 2001/07/30 08:24:36 zeev Exp $ */ #include <math.h> /* modf() */ #include "php.h" @@ -136,11 +136,11 @@ inline static void -php_sprintf_appendchar(char **buffer, int *pos, int *size, char add) +php_sprintf_appendchar(char **buffer, int *pos, int *size, char add TSRMLS_DC) { if ((*pos + 1) >= *size) { *size <<= 1; - PRINTF_DEBUG(("%s: ereallocing buffer to %d bytes\n", get_active_function_name(), *size)); + PRINTF_DEBUG(("%s: ereallocing buffer to %d bytes\n", get_active_function_name(TSRMLS_C), *size)); *buffer = erealloc(*buffer, *size); } PRINTF_DEBUG(("sprintf: appending '%c', pos=\n", add, *pos)); @@ -438,15 +438,15 @@ PRINTF_DEBUG(("sprintf: format[%d]='%c'\n", inpos, format[inpos])); PRINTF_DEBUG(("sprintf: outpos=%d\n", outpos)); if (format[inpos] != '%') { - php_sprintf_appendchar(&result, &outpos, &size, format[inpos++]); + php_sprintf_appendchar(&result, &outpos, &size, format[inpos++] TSRMLS_CC); } else if (format[inpos + 1] == '%') { - php_sprintf_appendchar(&result, &outpos, &size, '%'); + php_sprintf_appendchar(&result, &outpos, &size, '%' TSRMLS_CC); inpos += 2; } else { if (currarg >= argc && format[inpos + 1] != '%') { efree(result); efree(args); - php_error(E_WARNING, "%s(): too few arguments",get_active_function_name()); + php_error(E_WARNING, "%s(): too few arguments",get_active_function_name(TSRMLS_C)); return NULL; } /* starting a new format specifier, reset variables */ @@ -470,7 +470,7 @@ if (argnum >= argc) { efree(result); efree(args); - php_error(E_WARNING, "%s(): too few arguments",get_active_function_name()); + php_error(E_WARNING, "%s(): too few arguments", get_active_function_name(TSRMLS_C)); return NULL; } @@ -570,7 +570,7 @@ case 'c': convert_to_long_ex(args[argnum]); php_sprintf_appendchar(&result, &outpos, &size, - (char) (*args[argnum])->value.lval); + (char) (*args[argnum])->value.lval TSRMLS_CC); break; case 'o': @@ -606,7 +606,7 @@ break; case '%': - php_sprintf_appendchar(&result, &outpos, &size, '%'); + php_sprintf_appendchar(&result, &outpos, &size, '%' TSRMLS_CC); break; default: Index: php4/ext/standard/fsock.c diff -u php4/ext/standard/fsock.c:1.73 php4/ext/standard/fsock.c:1.74 --- php4/ext/standard/fsock.c:1.73 Mon Jul 30 02:18:06 2001 +++ php4/ext/standard/fsock.c Mon Jul 30 04:24:36 2001 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: fsock.c,v 1.73 2001/07/30 06:18:06 zeev Exp $ */ +/* $Id: fsock.c,v 1.74 2001/07/30 08:24:36 zeev Exp $ */ /* Synced with php 3.0 revision 1.121 1999-06-18 [ssb] */ /* Synced with php 3.0 revision 1.133 1999-07-21 [sas] */ @@ -679,13 +679,14 @@ static int php_sockop_cast(php_stream * stream, int castas, void ** ret) { php_sockbuf * sock = (php_sockbuf*)stream->abstract; + TSRMLS_FETCH(); switch(castas) { case PHP_STREAM_AS_STDIO: if (ret) { /* DANGER!: data buffered in stream->readbuf will be forgotten! */ if (TOREAD(sock) > 0) - zend_error(E_WARNING, "%s(): buffered data lost during conversion to FILE*!", get_active_function_name()); + zend_error(E_WARNING, "%s(): buffered data lost during conversion to FILE*!", get_active_function_name(TSRMLS_C)); *ret = fdopen(sock->socket, stream->mode); if (*ret) return SUCCESS; Index: php4/ext/standard/scanf.c diff -u php4/ext/standard/scanf.c:1.9 php4/ext/standard/scanf.c:1.10 --- php4/ext/standard/scanf.c:1.9 Sun Jul 15 10:08:23 2001 +++ php4/ext/standard/scanf.c Mon Jul 30 04:24:36 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: scanf.c,v 1.9 2001/07/15 14:08:23 zeev Exp $ */ +/* $Id: scanf.c,v 1.10 2001/07/30 08:24:36 zeev Exp $ */ /* scanf.c -- @@ -328,6 +328,7 @@ int staticAssign[STATIC_LIST_SIZE]; int *nassign = staticAssign; int objIndex, xpgSize, nspace = STATIC_LIST_SIZE; + TSRMLS_FETCH(); /* * Initialize an array that records the number of times a variable @@ -408,7 +409,7 @@ if (gotXpg) { mixedXPG: php_error(E_WARNING, - "cannot mix \"%\" and \"%n$\" conversion specifiers in %s", get_active_function_name() ); + "cannot mix \"%\" and \"%n$\" conversion specifiers in %s", get_active_function_name(TSRMLS_C) ); goto error; } @@ -593,7 +594,7 @@ PHPAPI int php_sscanf_internal( char *string,char *format, int argCount,zval ***args, - int varStart,pval **return_value) + int varStart,pval **return_value TSRMLS_DC) { int numVars, nconversions, totalVars = -1; int i, value, result; @@ -642,7 +643,7 @@ for (i = varStart;i < argCount;i++){ if ( ! PZVAL_IS_REF( *args[ i ] ) ) { php_error(E_WARNING,"Parameter %d to %s() must be passed by reference", - i, get_active_function_name()); + i, get_active_function_name(TSRMLS_C)); scan_set_error_return(numVars, return_value); return SCAN_ERROR_VAR_PASSED_BYVAL; } Index: php4/ext/standard/scanf.h diff -u php4/ext/standard/scanf.h:1.5 php4/ext/standard/scanf.h:1.6 --- php4/ext/standard/scanf.h:1.5 Sun Jul 15 10:08:23 2001 +++ php4/ext/standard/scanf.h Mon Jul 30 04:24:36 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: scanf.h,v 1.5 2001/07/15 14:08:23 zeev Exp $ */ +/* $Id: scanf.h,v 1.6 2001/07/30 08:24:36 zeev Exp $ */ #ifndef SCANF_H #define SCANF_H @@ -43,8 +43,8 @@ * e.g. fscanf */ PHPAPI int ValidateFormat(char *format, int numVars, int *totalVars); -PHPAPI int php_sscanf_internal(char *string,char *format,int argCount,zval ***args, - int varStart,pval **return_value); +PHPAPI int php_sscanf_internal(char *string,char *format,int argCount,zval ***args, + int varStart,pval **return_value TSRMLS_DC); #endif /* SCANF_H */ Index: php4/ext/standard/string.c diff -u php4/ext/standard/string.c:1.210 php4/ext/standard/string.c:1.211 --- php4/ext/standard/string.c:1.210 Mon Jul 30 02:18:06 2001 +++ php4/ext/standard/string.c Mon Jul 30 04:24:36 2001 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c,v 1.210 2001/07/30 06:18:06 zeev Exp $ */ +/* $Id: string.c,v 1.211 2001/07/30 08:24:36 zeev Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -796,7 +796,7 @@ delim = *arg1; } else { php_error(E_WARNING, "Bad arguments to %s()", - get_active_function_name()); + get_active_function_name(TSRMLS_C)); return; } php_implode(delim, arr, return_value); @@ -1088,7 +1088,7 @@ opt = Z_LVAL_PP(uopt); if (opt < PHP_PATHINFO_DIRNAME || opt > PHP_PATHINFO_EXTENSION) { php_error(E_WARNING, "Invalid option in call to %s()", - get_active_function_name()); + get_active_function_name(TSRMLS_C)); return; } } @@ -3220,7 +3220,7 @@ if ((*mult)->value.lval < 0) { php_error(E_WARNING, "Second argument to %s() has to be greater than or equal to 0", - get_active_function_name()); + get_active_function_name(TSRMLS_C)); return; } @@ -3538,7 +3538,7 @@ convert_to_string_ex(pad_string); if (Z_STRLEN_PP(pad_string) == 0) { php_error(E_WARNING, "Padding string cannot be empty in %s()", - get_active_function_name()); + get_active_function_name(TSRMLS_C)); return; } pad_str_val = Z_STRVAL_PP(pad_string); @@ -3548,7 +3548,7 @@ convert_to_long_ex(pad_type); pad_type_val = Z_LVAL_PP(pad_type); if (pad_type_val < STR_PAD_LEFT || pad_type_val > STR_PAD_BOTH) { - php_error(E_WARNING, "Padding type has to be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH in %s()", get_active_function_name()); + php_error(E_WARNING, "Padding type has to be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH in %s()", get_active_function_name(TSRMLS_C)); return; } } @@ -3602,7 +3602,6 @@ zval ***args; int argCount; - argCount = ZEND_NUM_ARGS(); if (argCount < 2) { WRONG_PARAM_COUNT; @@ -3621,8 +3620,8 @@ result = php_sscanf_internal( (*literal)->value.str.val, (*format)->value.str.val, - argCount,args, - 2,&return_value); + argCount, args, + 2, &return_value TSRMLS_CC); efree(args); if (SCAN_ERROR_WRONG_PARAM_COUNT == result) { Index: php4/ext/standard/var.c diff -u php4/ext/standard/var.c:1.100 php4/ext/standard/var.c:1.101 --- php4/ext/standard/var.c:1.100 Mon Jul 30 00:58:05 2001 +++ php4/ext/standard/var.c Mon Jul 30 04:24:37 2001 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: var.c,v 1.100 2001/07/30 04:58:05 zeev Exp $ */ +/* $Id: var.c,v 1.101 2001/07/30 08:24:37 zeev Exp $ */ /* {{{ includes @@ -240,7 +240,7 @@ MAKE_STD_ZVAL(fname); ZVAL_STRING(fname,"__sleep",1); - res = call_user_function_ex(CG(function_table), struc, fname, &retval_ptr, 0, 0, 1, NULL); + res = call_user_function_ex(CG(function_table), struc, fname, &retval_ptr, 0, 0, 1, NULL TSRMLS_CC); if (res == SUCCESS) { if (retval_ptr && HASH_OF(retval_ptr)) { @@ -583,7 +583,7 @@ MAKE_STD_ZVAL(fname); ZVAL_STRING(fname,"__wakeup",1); - call_user_function_ex(CG(function_table), rval, fname, &retval_ptr, 0, 0, 1, NULL); + call_user_function_ex(CG(function_table), rval, fname, &retval_ptr, 0, 0, 1, NULL TSRMLS_CC); zval_dtor(fname); FREE_ZVAL(fname); Index: php4/ext/wddx/wddx.c diff -u php4/ext/wddx/wddx.c:1.74 php4/ext/wddx/wddx.c:1.75 --- php4/ext/wddx/wddx.c:1.74 Mon Jul 30 00:58:06 2001 +++ php4/ext/wddx/wddx.c Mon Jul 30 04:24:37 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: wddx.c,v 1.74 2001/07/30 04:58:06 zeev Exp $ */ +/* $Id: wddx.c,v 1.75 2001/07/30 08:24:37 zeev Exp $ */ #include "php.h" #include "php_wddx.h" @@ -446,7 +446,7 @@ * We try to call __sleep() method on object. It's supposed to return an * array of property names to be serialized. */ - if (call_user_function_ex(CG(function_table), &obj, fname, &retval, 0, 0, 1, NULL) == SUCCESS) { + if (call_user_function_ex(CG(function_table), &obj, fname, &retval, 0, 0, 1, NULL TSRMLS_CC) == SUCCESS) { if (retval && HASH_OF(retval)) { PHP_CLASS_ATTRIBUTES; @@ -813,7 +813,7 @@ MAKE_STD_ZVAL(fname); ZVAL_STRING(fname, "__wakeup", 1); - call_user_function_ex(NULL, &ent1->data, fname, &retval, 0, 0, 0, NULL); + call_user_function_ex(NULL, &ent1->data, fname, &retval, 0, 0, 0, NULL TSRMLS_CC); zval_dtor(fname); FREE_ZVAL(fname); @@ -1027,7 +1027,7 @@ argc = ZEND_NUM_ARGS(); if (argc < 1) { php_error(E_WARNING, "%s() requires at least 1 argument, 0 given", - get_active_function_name()); + get_active_function_name(TSRMLS_C)); return; } @@ -1144,7 +1144,7 @@ argc = ZEND_NUM_ARGS(); if (argc < 2) { php_error(E_WARNING, "%s() requires at least 2 arguments, %d given", - get_active_function_name(), ZEND_NUM_ARGS()); + get_active_function_name(TSRMLS_C), ZEND_NUM_ARGS()); return; } Index: php4/ext/xml/xml.c diff -u php4/ext/xml/xml.c:1.88 php4/ext/xml/xml.c:1.89 --- php4/ext/xml/xml.c:1.88 Mon Jul 30 02:18:08 2001 +++ php4/ext/xml/xml.c Mon Jul 30 04:24:38 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: xml.c,v 1.88 2001/07/30 06:18:08 zeev Exp $ */ +/* $Id: xml.c,v 1.89 2001/07/30 08:24:38 zeev Exp $ */ #define IS_EXT_MODULE #ifdef HAVE_CONFIG_H @@ -378,7 +378,7 @@ MAKE_STD_ZVAL(retval); ZVAL_FALSE(retval); - result = call_user_function(EG(function_table), &parser->object, handler, retval, argc, argv); + result = call_user_function(EG(function_table), &parser->object, handler, retval, argc, argv TSRMLS_CC); if (result == FAILURE) { zval **method; Index: php4/ext/xslt/xslt.c diff -u php4/ext/xslt/xslt.c:1.12 php4/ext/xslt/xslt.c:1.13 --- php4/ext/xslt/xslt.c:1.12 Sun Jul 29 16:16:44 2001 +++ php4/ext/xslt/xslt.c Mon Jul 30 04:24:39 2001 @@ -81,11 +81,12 @@ zval **current; HashTable *arr; int idx = 0; + TSRMLS_FETCH(); arr = HASH_OF(*zarr); if (! arr) { php_error(E_WARNING, "Invalid argument or parameter array to %s", - get_active_function_name()); + get_active_function_name(TSRMLS_C)); return; } @@ -104,7 +105,7 @@ type = zend_hash_get_current_key(arr, &string_key, &num_key, 0); if (type == HASH_KEY_IS_LONG) { php_error(E_WARNING, "Invalid argument or parameter array to %s", - get_active_function_name()); + get_active_function_name(TSRMLS_C)); return; } @@ -229,7 +230,7 @@ /* Call the function */ error = call_user_function_ex(EG(function_table), NULL, function, - retval, argc, argv, 0, NULL); + retval, argc, argv, 0, NULL TSRMLS_CC); if (error == FAILURE) { php_error(E_WARNING, "Cannot call the %s handler: %s", name, Z_STRVAL_P(function)); Index: php4/ext/yp/yp.c diff -u php4/ext/yp/yp.c:1.25 php4/ext/yp/yp.c:1.26 --- php4/ext/yp/yp.c:1.25 Mon Jul 30 02:18:09 2001 +++ php4/ext/yp/yp.c Mon Jul 30 04:24:39 2001 @@ -16,7 +16,7 @@ | Fredrik Ohrn | +----------------------------------------------------------------------+ */ -/* $Id: yp.c,v 1.25 2001/07/30 06:18:09 zeev Exp $ */ +/* $Id: yp.c,v 1.26 2001/07/30 08:24:39 zeev Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -237,7 +237,7 @@ MAKE_STD_ZVAL (value); ZVAL_STRINGL (value, inval, invallen, 1); - if(call_user_function_ex(CG(function_table), NULL, *((zval **)indata), &retval, 3, args, 0, NULL) != SUCCESS) + if(call_user_function_ex(CG(function_table), NULL, *((zval **)indata), &retval, 3, args, 0, NULL TSRMLS_CC) != SUCCESS) { zend_error(E_ERROR, "Function call failed"); return 1; Index: php4/main/fopen_wrappers.c diff -u php4/main/fopen_wrappers.c:1.129 php4/main/fopen_wrappers.c:1.130 --- php4/main/fopen_wrappers.c:1.129 Sat Jul 28 07:36:26 2001 +++ php4/main/fopen_wrappers.c Mon Jul 30 04:24:39 2001 @@ -16,7 +16,7 @@ | Jim Winstead <jimw@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: fopen_wrappers.c,v 1.129 2001/07/28 11:36:26 zeev Exp $ */ +/* $Id: fopen_wrappers.c,v 1.130 2001/07/30 08:24:39 zeev Exp $ */ /* {{{ includes */ @@ -462,7 +462,7 @@ /* append the calling scripts' current working directory * as a fall back case */ - if (zend_is_executing()) { + if (zend_is_executing(TSRMLS_C)) { exec_fname = zend_get_executed_filename(TSRMLS_C); exec_fname_length = strlen(exec_fname); path_length = strlen(path); Index: php4/main/main.c diff -u php4/main/main.c:1.389 php4/main/main.c:1.390 --- php4/main/main.c:1.389 Mon Jul 30 02:18:10 2001 +++ php4/main/main.c Mon Jul 30 04:24:40 2001 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: main.c,v 1.389 2001/07/30 06:18:10 zeev Exp $ */ +/* $Id: main.c,v 1.390 2001/07/30 08:24:40 zeev Exp $ */ /* {{{ includes */ @@ -152,7 +152,7 @@ /* Don't set a timeout on startup, only per-request */ return SUCCESS; } - zend_unset_timeout(); + zend_unset_timeout(TSRMLS_C); zend_set_timeout(EG(timeout_seconds)); return SUCCESS; } @@ -484,7 +484,7 @@ } convert_to_long_ex(new_timeout); - zend_unset_timeout(); + zend_unset_timeout(TSRMLS_C); zend_set_timeout(Z_LVAL_PP(new_timeout)); } /* }}} */ @@ -708,7 +708,7 @@ } zend_end_try(); zend_try { - zend_unset_timeout(); + zend_unset_timeout(TSRMLS_C); } zend_end_try(); } /* }}} */ Index: php4/main/output.c diff -u php4/main/output.c:1.67 php4/main/output.c:1.68 --- php4/main/output.c:1.67 Sat Jul 28 07:36:27 2001 +++ php4/main/output.c Mon Jul 30 04:24:40 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: output.c,v 1.67 2001/07/28 11:36:27 zeev Exp $ */ +/* $Id: output.c,v 1.68 2001/07/30 08:24:40 zeev Exp $ */ #include "php.h" #include "ext/standard/head.h" @@ -183,7 +183,7 @@ params[0] = &orig_buffer; params[1] = &z_status; OG(ob_lock) = 1; - if (call_user_function_ex(CG(function_table), NULL, OG(active_ob_buffer).output_handler, &alternate_buffer, 2, params, 1, NULL)==SUCCESS) { + if (call_user_function_ex(CG(function_table), NULL, OG(active_ob_buffer).output_handler, &alternate_buffer, 2, params, 1, NULL TSRMLS_CC)==SUCCESS) { convert_to_string_ex(&alternate_buffer); final_buffer = alternate_buffer->value.str.val; final_buffer_length = alternate_buffer->value.str.len; @@ -489,14 +489,10 @@ zend_bailout(); } if (php_header()) { - if (zend_is_compiling()) { - TSRMLS_FETCH(); - + if (zend_is_compiling(TSRMLS_C)) { OG(output_start_filename) = zend_get_compiled_filename(TSRMLS_C); OG(output_start_lineno) = zend_get_compiled_lineno(TSRMLS_C); - } else if (zend_is_executing()) { - TSRMLS_FETCH(); - + } else if (zend_is_executing(TSRMLS_C)) { OG(output_start_filename) = zend_get_executed_filename(TSRMLS_C); OG(output_start_lineno) = zend_get_executed_lineno(TSRMLS_C); } Index: php4/main/streams.c diff -u php4/main/streams.c:1.4 php4/main/streams.c:1.5 --- php4/main/streams.c:1.4 Wed Jun 6 09:05:53 2001 +++ php4/main/streams.c Mon Jul 30 04:24:40 2001 @@ -149,7 +149,9 @@ PHPAPI size_t php_stream_write(php_stream * stream, const char * buf, size_t count) { if (strchr(stream->mode, 'w') == NULL) { - zend_error(E_WARNING, "%s(): stream was not opened for writing", get_active_function_name()); + TSRMLS_FETCH(); + + zend_error(E_WARNING, "%s(): stream was not opened for writing", get_active_function_name(TSRMLS_C)); return 0; } @@ -311,13 +313,17 @@ goto exit_success; } - /* must be either: - a) programmer error - b) no memory - -> lets bail - */ - zend_error(E_ERROR, "%s(): fopencookie failed", get_active_function_name()); - return FAILURE; + { + TSRMLS_FETCH(); + + /* must be either: + a) programmer error + b) no memory + -> lets bail + */ + zend_error(E_ERROR, "%s(): fopencookie failed", get_active_function_name(TSRMLS_C)); + return FAILURE; + } #endif goto exit_fail; @@ -328,12 +334,14 @@ exit_fail: if (show_err) { + TSRMLS_FETCH(); + /* these names depend on the values of the PHP_STREAM_AS_XXX defines in php_streams.h */ static const char * cast_names[3] = { "STDIO FILE*", "File Descriptor", "Socket Descriptor" }; zend_error(E_WARNING, "%s(): cannot represent a stream of type %s as a %s", - get_active_function_name(), + get_active_function_name(TSRMLS_C), stream->ops->label, cast_names[castas] ); Index: php4/sapi/cgi/cgi_main.c diff -u php4/sapi/cgi/cgi_main.c:1.121 php4/sapi/cgi/cgi_main.c:1.122 --- php4/sapi/cgi/cgi_main.c:1.121 Sat Jul 28 07:36:32 2001 +++ php4/sapi/cgi/cgi_main.c Mon Jul 30 04:24:41 2001 @@ -750,7 +750,7 @@ if (open_file_for_scanning(&file_handle TSRMLS_CC)==SUCCESS) { php_get_highlight_struct(&syntax_highlighter_ini); - zend_highlight(&syntax_highlighter_ini); + zend_highlight(&syntax_highlighter_ini TSRMLS_CC); fclose(file_handle.handle.fp); } return SUCCESS; Index: php4/sapi/isapi/php4isapi.c diff -u php4/sapi/isapi/php4isapi.c:1.73 php4/sapi/isapi/php4isapi.c:1.74 --- php4/sapi/isapi/php4isapi.c:1.73 Sat Jul 28 07:36:33 2001 +++ php4/sapi/isapi/php4isapi.c Mon Jul 30 04:24:41 2001 @@ -156,7 +156,6 @@ }; char ***server_variable_names; LPEXTENSION_CONTROL_BLOCK lpECB; - TSRMLS_FETCH(); lpECB = (LPEXTENSION_CONTROL_BLOCK) SG(server_context); @@ -246,7 +245,6 @@ HSE_SEND_HEADER_EX_INFO header_info; char status_buf[MAX_STATUS_LENGTH]; sapi_header_struct default_content_type; - TSRMLS_FETCH(); /* Obtain headers length */ if (SG(sapi_headers).send_default_content_type) { @@ -497,7 +495,7 @@ } -static void sapi_isapi_register_server_variables(zval *track_vars_array TSRMLS_DC TSRMLS_DC TSRMLS_DC) +static void sapi_isapi_register_server_variables(zval *track_vars_array TSRMLS_DC) { DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE; char *variable; @@ -648,7 +646,7 @@ } -static void init_request_info(sapi_globals_struct *sapi_globals, LPEXTENSION_CONTROL_BLOCK lpECB) +static void init_request_info(LPEXTENSION_CONTROL_BLOCK lpECB TSRMLS_DC) { SG(request_info).request_method = lpECB->lpszMethod; SG(request_info).query_string = lpECB->lpszQueryString; @@ -718,18 +716,16 @@ { zend_file_handle file_handle; zend_bool stack_overflown=0; - TSRMLS_FETCH(); - TSRMLS_FETCH(); - TSRMLS_FETCH(); #ifdef PHP_ENABLE_SEH LPEXCEPTION_POINTERS e; #endif + TSRMLS_FETCH(); zend_try { #ifdef PHP_ENABLE_SEH __try { #endif - init_request_info(sapi_globals, lpECB); + init_request_info(lpECB TSRMLS_CC); SG(server_context) = lpECB; #ifdef WITH_ZEUS @@ -750,7 +746,7 @@ } } #else - file_handle.filename = sapi_globals->request_info.path_translated; + file_handle.filename = SG(request_info.path_translated); file_handle.free_filename = 0; #endif file_handle.type = ZEND_HANDLE_FILENAME; Index: php4/sapi/pi3web/pi3web_sapi.c diff -u php4/sapi/pi3web/pi3web_sapi.c:1.24 php4/sapi/pi3web/pi3web_sapi.c:1.25 --- php4/sapi/pi3web/pi3web_sapi.c:1.24 Sat Jul 28 07:36:34 2001 +++ php4/sapi/pi3web/pi3web_sapi.c Mon Jul 30 04:24:41 2001 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pi3web_sapi.c,v 1.24 2001/07/28 11:36:34 zeev Exp $ */ +/* $Id: pi3web_sapi.c,v 1.25 2001/07/30 08:24:41 zeev Exp $ */ #include "pi3web_sapi.h" #include "php.h" @@ -78,7 +78,7 @@ PUTS("<table border=0 cellpadding=3 cellspacing=1 width=600 align=center>\n"); PUTS("<tr><th colspan=2 bgcolor=\"" PHP_HEADER_COLOR "\">Pi3Web Server Information</th></tr>\n"); php_info_print_table_header(2, "Information Field", "Value"); - php_info_print_table_row(2, "Pi3Web SAPI module version", "$Id: pi3web_sapi.c,v 1.24 2001/07/28 11:36:34 zeev Exp $"); + php_info_print_table_row(2, "Pi3Web SAPI module version", "$Id: pi3web_sapi.c,v 1.25 2001/07/30 08:24:41 zeev Exp $"); php_info_print_table_row(2, "Server Name Stamp", HTTPCore_getServerStamp()); snprintf(variable_buf, 511, "%d", HTTPCore_debugEnabled()); php_info_print_table_row(2, "Debug Enabled", variable_buf); @@ -403,7 +403,7 @@ if ( open_file_for_scanning( &file_handle TSRMLS_CC ) == SUCCESS ) { php_get_highlight_struct( &syntax_highlighter_ini ); - zend_highlight( &syntax_highlighter_ini ); + zend_highlight( &syntax_highlighter_ini TSRMLS_CC ); } else { Index: php4/sapi/servlet/servlet.c diff -u php4/sapi/servlet/servlet.c:1.51 php4/sapi/servlet/servlet.c:1.52 --- php4/sapi/servlet/servlet.c:1.51 Sat Jul 28 07:36:36 2001 +++ php4/sapi/servlet/servlet.c Mon Jul 30 04:24:42 2001 @@ -381,7 +381,7 @@ if (open_file_for_scanning(&file_handle TSRMLS_CC)==SUCCESS) { php_get_highlight_struct(&syntax_highlighter_ini); sapi_send_headers(); - zend_highlight(&syntax_highlighter_ini); + zend_highlight(&syntax_highlighter_ini TSRMLS_CC); } } else { php_execute_script(&file_handle TSRMLS_CC);
« previous php.cvs (#6403) next »