diff options
80 files changed, 1631 insertions, 1626 deletions
diff --git a/cgi_main.c b/cgi_main.c index 7fa08698ce..96caa39f16 100644 --- a/cgi_main.c +++ b/cgi_main.c @@ -136,7 +136,7 @@ static sapi_module_struct sapi_module = {  	zend_cgibin_ub_write,			/* unbuffered write */ -	php3_error,						/* error handler */ +	php_error,						/* error handler */  	NULL,							/* header handler */  	NULL,							/* send headers handler */ @@ -158,7 +158,7 @@ static void php_cgi_usage(char *argv0)  		prog = "php";  	} -	php3_printf("Usage: %s [-q] [-h]" +	php_printf("Usage: %s [-q] [-h]"  				" [-s]"  				" [-v] [-i] [-f <file>] | "  				"{<file> [args...]}\n" @@ -316,7 +316,7 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine  					if (no_headers) {  						SG(headers_sent) = 1;  					} -					php3_printf("%s\n", PHP_VERSION); +					php_printf("%s\n", PHP_VERSION);  					exit(1);  					break;  				case 'i': @@ -420,9 +420,9 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine  #if 0	/* this is here for debuging under windows */  		if (argc) {  			i = 0; -			php3_printf("\nargc %d\n",argc);  +			php_printf("\nargc %d\n",argc);   			while (i <= argc) { -				php3_printf("%s\n",argv[i]);  +				php_printf("%s\n",argv[i]);   				i++;  			}  		} diff --git a/ext/apache/apache.c b/ext/apache/apache.c index 18a742ddb7..be7b68d1aa 100644 --- a/ext/apache/apache.c +++ b/ext/apache/apache.c @@ -282,13 +282,13 @@ PHP_FUNCTION(virtual)  	convert_to_string(filename);  	if (!(rr = sub_req_lookup_uri (filename->value.str.val, ((request_rec *) SG(server_context))))) { -		php3_error(E_WARNING, "Unable to include '%s' - URI lookup failed", filename->value.str.val); +		php_error(E_WARNING, "Unable to include '%s' - URI lookup failed", filename->value.str.val);  		if (rr) destroy_sub_req (rr);  		RETURN_FALSE;  	}  	if (rr->status != 200) { -		php3_error(E_WARNING, "Unable to include '%s' - error finding URI", filename->value.str.val); +		php_error(E_WARNING, "Unable to include '%s' - error finding URI", filename->value.str.val);  		if (rr) destroy_sub_req (rr);  		RETURN_FALSE;  	} @@ -296,14 +296,14 @@ PHP_FUNCTION(virtual)  	/* Cannot include another PHP file because of global conflicts */  	if (rr->content_type &&  		!strcmp(rr->content_type, PHP3_MIME_TYPE)) { -		php3_error(E_WARNING, "Cannot include a PHP file " +		php_error(E_WARNING, "Cannot include a PHP file "  			  "(use <code><?include \"%s\"></code> instead)", filename->value.str.val);  		if (rr) destroy_sub_req (rr);  		RETURN_FALSE;  	}  	if (run_sub_req(rr)) { -		php3_error(E_WARNING, "Unable to include '%s' - request execution failed", filename->value.str.val); +		php_error(E_WARNING, "Unable to include '%s' - request execution failed", filename->value.str.val);  		if (rr) destroy_sub_req (rr);  		RETURN_FALSE;  	} else { @@ -354,7 +354,7 @@ PHP_FUNCTION(apache_lookup_uri)  	convert_to_string(filename);  	if(!(rr = sub_req_lookup_uri(filename->value.str.val, ((request_rec *) SG(server_context))))) { -		php3_error(E_WARNING, "URI lookup failed", filename->value.str.val); +		php_error(E_WARNING, "URI lookup failed", filename->value.str.val);  		RETURN_FALSE;  	}  	object_init(return_value); @@ -428,7 +428,7 @@ PHP_FUNCTION(apache_exec_uri)  	convert_to_string(filename);  	if(!(rr = ap_sub_req_lookup_uri(filename->value.str.val, ((request_rec *) SG(server_context))))) { -		php3_error(E_WARNING, "URI lookup failed", filename->value.str.val); +		php_error(E_WARNING, "URI lookup failed", filename->value.str.val);  		RETURN_FALSE;  	}  	RETVAL_LONG(ap_run_sub_req(rr)); diff --git a/ext/aspell/aspell.c b/ext/aspell/aspell.c index 93a9642281..fcfb33cbce 100644 --- a/ext/aspell/aspell.c +++ b/ext/aspell/aspell.c @@ -115,7 +115,7 @@ PHP_FUNCTION(aspell_suggest)  	sc= (aspell *) php3_list_find(scin->value.lval, &type);  	if(!sc)  	  { -		php3_error(E_WARNING, "%d is not a ASPELL result index", scin->value.lval); +		php_error(E_WARNING, "%d is not a ASPELL result index", scin->value.lval);  		RETURN_FALSE;  	  } @@ -149,7 +149,7 @@ PHP_FUNCTION(aspell_check)      sc= (aspell *) php3_list_find(scin->value.lval, &type);      if(!sc)        { -        php3_error(E_WARNING, "%d is not a ASPELL result index", scin->value.lval); +        php_error(E_WARNING, "%d is not a ASPELL result index", scin->value.lval);          RETURN_FALSE;        }      if (aspell_check(sc, word->value.str.val))  @@ -181,7 +181,7 @@ PHP_FUNCTION(aspell_check_raw)      sc= (aspell *) php3_list_find(scin->value.lval, &type);      if(!sc)        { -        php3_error(E_WARNING, "%d is not a ASPELL result index", scin->value.lval); +        php_error(E_WARNING, "%d is not a ASPELL result index", scin->value.lval);          RETURN_FALSE;        }  	if (aspell_check_raw(sc, word->value.str.val))  @@ -197,7 +197,7 @@ PHP_FUNCTION(aspell_check_raw)  PHP_MINFO_FUNCTION(aspell)  { -	php3_printf("ASpell support enabled"); +	php_printf("ASpell support enabled");  } diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c index 6adc1468a5..d4a7032376 100644 --- a/ext/bcmath/bcmath.c +++ b/ext/bcmath/bcmath.c @@ -231,7 +231,7 @@ PHP_FUNCTION(bcdiv)  			return_value->type = IS_STRING;  			break;  		case -1: /* division by zero */ -			php3_error(E_WARNING,"Division by zero"); +			php_error(E_WARNING,"Division by zero");  			break;  	}  	free_num(&first); @@ -272,7 +272,7 @@ PHP_FUNCTION(bcmod)  			return_value->type = IS_STRING;  			break;  		case -1: -			php3_error(E_WARNING,"Division by zero"); +			php_error(E_WARNING,"Division by zero");  			break;  	}  	free_num(&first); @@ -358,7 +358,7 @@ PHP_FUNCTION(bcsqrt)  		return_value->value.str.len = strlen(return_value->value.str.val);  		return_value->type = IS_STRING;  	} else { -		php3_error(E_WARNING,"Square root of negative number"); +		php_error(E_WARNING,"Square root of negative number");  	}  	free_num(&result);  	return; diff --git a/ext/db/db.c b/ext/db/db.c index 1c375c0f14..915b926ad9 100644 --- a/ext/db/db.c +++ b/ext/db/db.c @@ -182,9 +182,9 @@ dbm_info *_php3_finddbm(pval *id,HashTable *list)  	DBM_TLS_VARS;  	if (id->type == IS_STRING) { -		numitems = _php3_hash_num_elements(list); +		numitems = zend_hash_num_elements(list);  		for (i=1; i<=numitems; i++) { -			if (_php3_hash_index_find(list, i, (void **) &le)==FAILURE) { +			if (zend_hash_index_find(list, i, (void **) &le)==FAILURE) {  				continue;  			}  			if (le->type == DBM_GLOBAL(le_db)) { @@ -242,7 +242,7 @@ static char *php3_get_info_db(void)  PHP_MINFO_FUNCTION(db)  { -	php3_printf(php3_get_info_db()); +	php_printf(php3_get_info_db());  }  PHP_FUNCTION(dblist) @@ -290,7 +290,7 @@ dbm_info *_php3_dbmopen(char *filename, char *mode) {  	DBM_MODE_TYPE imode;  	if (filename == NULL) { -		php3_error(E_WARNING, "NULL filename passed to _php3_dbmopen()"); +		php_error(E_WARNING, "NULL filename passed to _php3_dbmopen()");  		return NULL;  	} @@ -336,7 +336,7 @@ dbm_info *_php3_dbmopen(char *filename, char *mode) {  			lockfd = open(lockfn,O_RDWR|O_CREAT,0644);  			close(lockfd);  		} else { -			php3_error(E_WARNING, "File appears to be locked [%s]\n",lockfn); +			php_error(E_WARNING, "File appears to be locked [%s]\n",lockfn);  			return -1;  		}  #else /* NFS_HACK */ @@ -347,7 +347,7 @@ dbm_info *_php3_dbmopen(char *filename, char *mode) {  			flock(lockfd,LOCK_EX);  			close(lockfd);  		} else { -			php3_error(E_WARNING, "Unable to establish lock: %s",filename); +			php_error(E_WARNING, "Unable to establish lock: %s",filename);  		}  #endif /* else NFS_HACK */ @@ -364,7 +364,7 @@ dbm_info *_php3_dbmopen(char *filename, char *mode) {  	if (dbf) {  		info = (dbm_info *)emalloc(sizeof(dbm_info));  		if (!info) { -			php3_error(E_ERROR, "problem allocating memory!"); +			php_error(E_ERROR, "problem allocating memory!");  			return NULL;  		} @@ -376,7 +376,7 @@ dbm_info *_php3_dbmopen(char *filename, char *mode) {  		return info;  	} else {  #if GDBM  -		php3_error(E_WARNING, "dbmopen_gdbm(%s): %d [%s], %d [%s]",filename,gdbm_errno,gdbm_strerror(gdbm_errno),errno,strerror(errno)); +		php_error(E_WARNING, "dbmopen_gdbm(%s): %d [%s], %d [%s]",filename,gdbm_errno,gdbm_strerror(gdbm_errno),errno,strerror(errno));  		if (gdbm_errno)  			ret = gdbm_errno;  		else if (errno) @@ -386,13 +386,13 @@ dbm_info *_php3_dbmopen(char *filename, char *mode) {  #else   #if NDBM   #if DEBUG -		php3_error(E_WARNING, "dbmopen_ndbm(%s): errno = %d [%s]\n",filename,errno,strerror(errno)); +		php_error(E_WARNING, "dbmopen_ndbm(%s): errno = %d [%s]\n",filename,errno,strerror(errno));  #endif  		if (errno) ret=errno;  		else ret = -1;  #else  #if DEBUG -		php3_error(E_WARNING, "dbmopen_flatfile(%s): errno = %d [%s]\n",filename,errno,strerror(errno)); +		php_error(E_WARNING, "dbmopen_flatfile(%s): errno = %d [%s]\n",filename,errno,strerror(errno));  #endif  		if (errno) ret=errno;  		else ret = -1; @@ -472,7 +472,7 @@ PHP_FUNCTION(dbminsert)  	info = _php3_finddbm(id,list);  	if (!info) { -		php3_error(E_WARNING, "not a valid database identifier %d", id->value.lval); +		php_error(E_WARNING, "not a valid database identifier %d", id->value.lval);  		RETURN_FALSE;  	} @@ -499,7 +499,7 @@ int _php3_dbminsert(dbm_info *info, char *key, char *value) {  	dbf = info->dbf;  	if (!dbf) { -		php3_error(E_WARNING, "Unable to locate dbm file"); +		php_error(E_WARNING, "Unable to locate dbm file");  		return 1;  	} @@ -525,7 +525,7 @@ PHP_FUNCTION(dbmreplace)  	info = _php3_finddbm(id,list);  	if (!info) { -		php3_error(E_WARNING, "not a valid database identifier %d", id->value.lval); +		php_error(E_WARNING, "not a valid database identifier %d", id->value.lval);  		RETURN_FALSE;  	} @@ -555,7 +555,7 @@ int _php3_dbmreplace(dbm_info *info, char *key, char *value) {  	dbf = info->dbf;  	if (!dbf) { -		php3_error(E_WARNING, "Unable to locate dbm file"); +		php_error(E_WARNING, "Unable to locate dbm file");  		return 1;  	} @@ -579,7 +579,7 @@ PHP_FUNCTION(dbmfetch)  	info = _php3_finddbm(id,list);  	if (!info) { -		php3_error(E_WARNING, "not a valid database identifier %d", id->value.lval); +		php_error(E_WARNING, "not a valid database identifier %d", id->value.lval);  		RETURN_FALSE;  	} @@ -608,7 +608,7 @@ char *_php3_dbmfetch(dbm_info *info, char *key) {  	dbf = info->dbf;  	if (!dbf) { -		php3_error(E_WARNING, "Unable to locate dbm file"); +		php_error(E_WARNING, "Unable to locate dbm file");  		return(NULL);  	} @@ -651,7 +651,7 @@ PHP_FUNCTION(dbmexists)  	info = _php3_finddbm(id,list);  	if (!info) { -		php3_error(E_WARNING, "not a valid database identifier %d", id->value.lval); +		php_error(E_WARNING, "not a valid database identifier %d", id->value.lval);  		RETURN_FALSE;  	} @@ -672,7 +672,7 @@ int _php3_dbmexists(dbm_info *info, char *key) {  	dbf = info->dbf;  	if (!dbf) { -		php3_error(E_WARNING, "Unable to locate dbm file"); +		php_error(E_WARNING, "Unable to locate dbm file");  		return(0);  	} @@ -694,7 +694,7 @@ PHP_FUNCTION(dbmdelete)  	info = _php3_finddbm(id,list);  	if (!info) { -		php3_error(E_WARNING, "not a valid database identifier %d", id->value.lval); +		php_error(E_WARNING, "not a valid database identifier %d", id->value.lval);  		RETURN_FALSE;  	} @@ -715,7 +715,7 @@ int _php3_dbmdelete(dbm_info *info, char *key) {  	dbf = info->dbf;  	if (!dbf) { -		php3_error(E_WARNING, "Unable to locate dbm file"); +		php_error(E_WARNING, "Unable to locate dbm file");  		return(0);  	} @@ -735,7 +735,7 @@ PHP_FUNCTION(dbmfirstkey)  	info = _php3_finddbm(id,list);  	if (!info) { -		php3_error(E_WARNING, "not a valid database identifier %d", id->value.lval); +		php_error(E_WARNING, "not a valid database identifier %d", id->value.lval);  		RETURN_FALSE;  	} @@ -756,7 +756,7 @@ char *_php3_dbmfirstkey(dbm_info *info) {  	dbf = info->dbf;  	if (!dbf) { -		php3_error(E_WARNING, "Unable to locate dbm file"); +		php_error(E_WARNING, "Unable to locate dbm file");  		return(NULL);  	} @@ -793,7 +793,7 @@ PHP_FUNCTION(dbmnextkey)  	info = _php3_finddbm(id,list);  	if (!info) { -		php3_error(E_WARNING, "not a valid database identifier %d", id->value.lval); +		php_error(E_WARNING, "not a valid database identifier %d", id->value.lval);  		RETURN_FALSE;  	} @@ -821,7 +821,7 @@ char *_php3_dbmnextkey(dbm_info *info, char *key) {  	dbf = info->dbf;  	if (!dbf) { -		php3_error(E_WARNING, "Unable to locate dbm file"); +		php_error(E_WARNING, "Unable to locate dbm file");  		return(NULL);  	} diff --git a/ext/dba/dba.c b/ext/dba/dba.c index af186c1d61..d95f427622 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -109,7 +109,7 @@ typedef struct dba_handler {  #define DBA_ID_GET \  	convert_to_long(id); \  	DBA_IF_NOT_CORRECT_TYPE(id->value.lval) { \ -		php3_error(E_WARNING, "Unable to find DBA identifier %d", id->value.lval); \ +		php_error(E_WARNING, "Unable to find DBA identifier %d", id->value.lval); \  		RETURN_FALSE; \  	} @@ -128,7 +128,7 @@ typedef struct dba_handler {  /* check whether the user has write access */  #define DBA_WRITE_CHECK \  	if(info->mode != DBA_WRITER && info->mode != DBA_TRUNC && info->mode != DBA_CREAT) { \ -		php3_error(E_WARNING, "you cannot perform a modification to a database without proper access"); \ +		php_error(E_WARNING, "you cannot perform a modification to a database without proper access"); \  		RETURN_FALSE; \  	} @@ -176,7 +176,7 @@ static void dba_close(dba_info *info)  static PHP_MINIT_FUNCTION(dba)  { -	_php3_hash_init(&ht_keys, 0, NULL, NULL, 1); +	zend_hash_init(&ht_keys, 0, NULL, NULL, 1);  	GLOBAL(le_db) = register_list_destructors(dba_close, NULL);  	GLOBAL(le_pdb) = register_list_destructors(NULL, dba_close);  	return SUCCESS; @@ -186,7 +186,7 @@ static PHP_MINIT_FUNCTION(dba)  static PHP_MSHUTDOWN_FUNCTION(dba)  { -	_php3_hash_destroy(&ht_keys); +	zend_hash_destroy(&ht_keys);  	return SUCCESS;  }  /* }}} */ @@ -267,7 +267,7 @@ static void _php3_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)  			keylen += args[i]->value.str.len;  		} -		if(_php3_hash_find(&ht_keys, key, keylen, (void **) &info) == SUCCESS) { +		if(zend_hash_find(&ht_keys, key, keylen, (void **) &info) == SUCCESS) {  			FREENOW;  			RETURN_LONG(php3_list_insert(info, GLOBAL(le_pdb)));  		} @@ -278,7 +278,7 @@ static void _php3_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)  			strcasecmp(hptr->name, args[2]->value.str.val); hptr++);  	if(!hptr->name) { -		php3_error(E_WARNING, "no such handler: %s", args[2]->value.str.val); +		php_error(E_WARNING, "no such handler: %s", args[2]->value.str.val);  		FREENOW;  		RETURN_FALSE;  	} @@ -297,7 +297,7 @@ static void _php3_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)  			modenr = DBA_TRUNC;  			break;  		default: -			php3_error(E_WARNING,"illegal DBA mode: %s",args[1]->value.str.val); +			php_error(E_WARNING,"illegal DBA mode: %s",args[1]->value.str.val);  			FREENOW;  			RETURN_FALSE;  	} @@ -312,7 +312,7 @@ static void _php3_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)  	if(hptr->open(info) != SUCCESS) {  		dba_close(info); -		php3_error(E_WARNING, "driver initialization failed"); +		php_error(E_WARNING, "driver initialization failed");  		FREENOW;  		RETURN_FALSE;  	} @@ -322,7 +322,7 @@ static void _php3_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)  	listid = php3_list_insert(info, persistent?GLOBAL(le_pdb):GLOBAL(le_db));  	if(persistent) { -		_php3_hash_update(&ht_keys, key, keylen, info, sizeof(*info), NULL); +		zend_hash_update(&ht_keys, key, keylen, info, sizeof(*info), NULL);  	}  	FREENOW; diff --git a/ext/dbase/dbase.c b/ext/dbase/dbase.c index 9e1c14df09..196b25c191 100644 --- a/ext/dbase/dbase.c +++ b/ext/dbase/dbase.c @@ -132,7 +132,7 @@ PHP_FUNCTION(dbase_open) {  	dbh = dbf_open(dbf_name->value.str.val, options->value.lval);  	if (dbh == NULL) { -		php3_error(E_WARNING, "unable to open database %s", dbf_name->value.str.val); +		php_error(E_WARNING, "unable to open database %s", dbf_name->value.str.val);  		RETURN_FALSE;  	} @@ -155,7 +155,7 @@ PHP_FUNCTION(dbase_close) {  	convert_to_long(dbh_id);  	dbh = php3_list_find(dbh_id->value.lval, &dbh_type);  	if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { -		php3_error(E_WARNING, "Unable to find database for identifier %d", dbh_id->value.lval); +		php_error(E_WARNING, "Unable to find database for identifier %d", dbh_id->value.lval);  		RETURN_FALSE;  	} @@ -178,7 +178,7 @@ PHP_FUNCTION(dbase_numrecords) {  	convert_to_long(dbh_id);  	dbh = php3_list_find(dbh_id->value.lval, &dbh_type);  	if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { -		php3_error(E_WARNING, "Unable to find database for identifier %d", dbh_id->value.lval); +		php_error(E_WARNING, "Unable to find database for identifier %d", dbh_id->value.lval);  		RETURN_FALSE;  	} @@ -200,7 +200,7 @@ PHP_FUNCTION(dbase_numfields) {  	convert_to_long(dbh_id);  	dbh = php3_list_find(dbh_id->value.lval, &dbh_type);  	if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { -		php3_error(E_WARNING, "Unable to find database for identifier %d", dbh_id->value.lval); +		php_error(E_WARNING, "Unable to find database for identifier %d", dbh_id->value.lval);  		RETURN_FALSE;  	} @@ -222,7 +222,7 @@ PHP_FUNCTION(dbase_pack) {  	convert_to_long(dbh_id);  	dbh = php3_list_find(dbh_id->value.lval, &dbh_type);  	if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { -		php3_error(E_WARNING, "Unable to find database for identifier %d", dbh_id->value.lval); +		php_error(E_WARNING, "Unable to find database for identifier %d", dbh_id->value.lval);  		RETURN_FALSE;  	} @@ -250,34 +250,34 @@ PHP_FUNCTION(dbase_add_record) {  	}  	convert_to_long(dbh_id);  	if (fields->type != IS_ARRAY) { -		php3_error(E_WARNING, "Expected array as second parameter"); +		php_error(E_WARNING, "Expected array as second parameter");  		RETURN_FALSE;  	}  	dbh = php3_list_find(dbh_id->value.lval, &dbh_type);  	if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { -		php3_error(E_WARNING, "Unable to find database for identifier %d", dbh_id->value.lval); +		php_error(E_WARNING, "Unable to find database for identifier %d", dbh_id->value.lval);  		RETURN_FALSE;  	} -	num_fields = _php3_hash_num_elements(fields->value.ht); +	num_fields = zend_hash_num_elements(fields->value.ht);  	if (num_fields != dbh->db_nfields) { -		php3_error(E_WARNING, "Wrong number of fields specified"); +		php_error(E_WARNING, "Wrong number of fields specified");  		RETURN_FALSE;  	}  	cp = t_cp = (char *)emalloc(dbh->db_rlen + 1);  	if (!cp) { -		php3_error(E_WARNING, "unable to allocate memory"); +		php_error(E_WARNING, "unable to allocate memory");  		RETURN_FALSE;  	}  	*t_cp++ = VALID_RECORD;  	dbf = dbh->db_fields;  	for (i = 0, cur_f = dbf; cur_f < &dbf[num_fields]; i++, cur_f++) { -		if (_php3_hash_index_find(fields->value.ht, i, (void **)&field) == FAILURE) { -			php3_error(E_WARNING, "unexpected error"); +		if (zend_hash_index_find(fields->value.ht, i, (void **)&field) == FAILURE) { +			php_error(E_WARNING, "unexpected error");  			efree(cp);  			RETURN_FALSE;  		} @@ -288,7 +288,7 @@ PHP_FUNCTION(dbase_add_record) {  	dbh->db_records++;  	if (put_dbf_record(dbh, dbh->db_records, cp) < 0) { -		php3_error(E_WARNING, "unable to put record at %ld", dbh->db_records); +		php_error(E_WARNING, "unable to put record at %ld", dbh->db_records);  		efree(cp);  		RETURN_FALSE;  	} @@ -319,34 +319,34 @@ void php3_dbase_replace_record(INTERNAL_FUNCTION_PARAMETERS) {  	convert_to_long(dbh_id);  	convert_to_long(recnum);  	if (fields->type != IS_ARRAY) { -		php3_error(E_WARNING, "Expected array as second parameter"); +		php_error(E_WARNING, "Expected array as second parameter");  		RETURN_FALSE;  	}  	dbh = php3_list_find(dbh_id->value.lval, &dbh_type);  	if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { -		php3_error(E_WARNING, "Unable to find database for identifier %d", dbh_id->value.lval); +		php_error(E_WARNING, "Unable to find database for identifier %d", dbh_id->value.lval);  		RETURN_FALSE;  	} -	num_fields = _php3_hash_num_elements(fields->value.ht); +	num_fields = zend_hash_num_elements(fields->value.ht);  	if (num_fields != dbh->db_nfields) { -		php3_error(E_WARNING, "Wrong number of fields specified"); +		php_error(E_WARNING, "Wrong number of fields specified");  		RETURN_FALSE;  	}  	cp = t_cp = (char *)emalloc(dbh->db_rlen + 1);  	if (!cp) { -		php3_error(E_WARNING, "unable to allocate memory"); +		php_error(E_WARNING, "unable to allocate memory");  		RETURN_FALSE;  	}  	*t_cp++ = VALID_RECORD;  	dbf = dbh->db_fields;  	for (i = 0, cur_f = dbf; cur_f < &dbf[num_fields]; i++, cur_f++) { -		if (_php3_hash_index_find(fields->value.ht, i, (void **)&field) == FAILURE) { -			php3_error(E_WARNING, "unexpected error"); +		if (zend_hash_index_find(fields->value.ht, i, (void **)&field) == FAILURE) { +			php_error(E_WARNING, "unexpected error");  			efree(cp);  			RETURN_FALSE;  		} @@ -356,7 +356,7 @@ void php3_dbase_replace_record(INTERNAL_FUNCTION_PARAMETERS) {  	}  	if (put_dbf_record(dbh, recnum->value.lval, cp) < 0) { -		php3_error(E_WARNING, "unable to put record at %ld", dbh->db_records); +		php_error(E_WARNING, "unable to put record at %ld", dbh->db_records);  		efree(cp);  		RETURN_FALSE;  	} @@ -384,15 +384,15 @@ PHP_FUNCTION(dbase_delete_record) {  	dbh = php3_list_find(dbh_id->value.lval, &dbh_type);  	if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { -		php3_error(E_WARNING, "Unable to find database for identifier %d", dbh_id->value.lval); +		php_error(E_WARNING, "Unable to find database for identifier %d", dbh_id->value.lval);  		RETURN_FALSE;  	}  	if (del_dbf_record(dbh, record->value.lval) < 0) {  		if (record->value.lval > dbh->db_records) { -			php3_error(E_WARNING, "record %d out of bounds", record->value.lval); +			php_error(E_WARNING, "record %d out of bounds", record->value.lval);  		} else { -			php3_error(E_WARNING, "unable to delete record %d", record->value.lval); +			php_error(E_WARNING, "unable to delete record %d", record->value.lval);  		}  		RETURN_FALSE;  	} @@ -421,12 +421,12 @@ PHP_FUNCTION(dbase_get_record) {  	dbh = php3_list_find(dbh_id->value.lval, &dbh_type);  	if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { -		php3_error(E_WARNING, "Unable to find database for identifier %d", dbh_id->value.lval); +		php_error(E_WARNING, "Unable to find database for identifier %d", dbh_id->value.lval);  		RETURN_FALSE;  	}  	if ((data = get_dbf_record(dbh, record->value.lval)) == NULL) { -		php3_error(E_WARNING, "Tried to read bad record %d", record->value.lval); +		php_error(E_WARNING, "Tried to read bad record %d", record->value.lval);  		RETURN_FALSE;  	} @@ -504,12 +504,12 @@ PHP_FUNCTION(dbase_get_record_with_names) {  	dbh = php3_list_find(dbh_id->value.lval, &dbh_type);  	if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { -		php3_error(E_WARNING, "Unable to find database for identifier %d", dbh_id->value.lval); +		php_error(E_WARNING, "Unable to find database for identifier %d", dbh_id->value.lval);  		RETURN_FALSE;  	}  	if ((data = get_dbf_record(dbh, record->value.lval)) == NULL) { -		php3_error(E_WARNING, "Tried to read bad record %d", record->value.lval); +		php_error(E_WARNING, "Tried to read bad record %d", record->value.lval);  		RETURN_FALSE;  	} @@ -579,7 +579,7 @@ PHP_FUNCTION(dbase_create) {  	convert_to_string(filename);  	if (fields->type != IS_ARRAY) { -		php3_error(E_WARNING, "Expected array as second parameter"); +		php_error(E_WARNING, "Expected array as second parameter");  		RETURN_FALSE;  	} @@ -592,18 +592,18 @@ PHP_FUNCTION(dbase_create) {  	}  	if ((fd = open(filename->value.str.val, O_BINARY|O_RDWR|O_CREAT, 0644)) < 0) { -		php3_error(E_WARNING, "Unable to create database (%d): %s", errno, strerror(errno)); +		php_error(E_WARNING, "Unable to create database (%d): %s", errno, strerror(errno));  		RETURN_FALSE;  	} -	num_fields = _php3_hash_num_elements(fields->value.ht); +	num_fields = zend_hash_num_elements(fields->value.ht);  	/* have to use regular malloc() because this gets free()d by  	   code in the dbase library */  	dbh = (dbhead_t *)malloc(sizeof(dbhead_t));  	dbf = (dbfield_t *)malloc(sizeof(dbfield_t) * num_fields);  	if (!dbh || !dbf) { -		php3_error(E_WARNING, "Unable to allocate memory for header info"); +		php_error(E_WARNING, "Unable to allocate memory for header info");  		RETURN_FALSE;  	} @@ -620,35 +620,35 @@ PHP_FUNCTION(dbase_create) {  	for (i = 0, cur_f = dbf; i < num_fields; i++, cur_f++) {  		/* look up the first field */ -		if (_php3_hash_index_find(fields->value.ht, i, (void **)&field) == FAILURE) { -			php3_error(E_WARNING, "unable to find field %d", i); +		if (zend_hash_index_find(fields->value.ht, i, (void **)&field) == FAILURE) { +			php_error(E_WARNING, "unable to find field %d", i);  			free_dbf_head(dbh);  			RETURN_FALSE;  		}  		if (field->type != IS_ARRAY) { -			php3_error(E_WARNING, "second parameter must be array of arrays"); +			php_error(E_WARNING, "second parameter must be array of arrays");  			free_dbf_head(dbh);  			RETURN_FALSE;  		}  		/* field name */ -		if (_php3_hash_index_find(field->value.ht, 0, (void **)&value) == FAILURE) { -			php3_error(E_WARNING, "expected field name as first element of list in field %d", i); +		if (zend_hash_index_find(field->value.ht, 0, (void **)&value) == FAILURE) { +			php_error(E_WARNING, "expected field name as first element of list in field %d", i);  			free_dbf_head(dbh);  			RETURN_FALSE;  		}  		convert_to_string(value);  		if (value->value.str.len > 10 || value->value.str.len == 0) { -			php3_error(E_WARNING, "invalid field name '%s' (must be non-empty and less than or equal to 10 characters)", value->value.str.val); +			php_error(E_WARNING, "invalid field name '%s' (must be non-empty and less than or equal to 10 characters)", value->value.str.val);  			free_dbf_head(dbh);  			RETURN_FALSE;  		}  		copy_crimp(cur_f->db_fname, value->value.str.val, value->value.str.len);  		/* field type */ -		if (_php3_hash_index_find(field->value.ht,1,(void **)&value) == FAILURE) { -			php3_error(E_WARNING, "expected field type as sececond element of list in field %d", i); +		if (zend_hash_index_find(field->value.ht,1,(void **)&value) == FAILURE) { +			php_error(E_WARNING, "expected field type as sececond element of list in field %d", i);  			RETURN_FALSE;  		}  		convert_to_string(value); @@ -672,8 +672,8 @@ PHP_FUNCTION(dbase_create) {  		case 'N':  		case 'C':  			/* field length */ -			if (_php3_hash_index_find(field->value.ht,2,(void **)&value) == FAILURE) { -				php3_error(E_WARNING, "expected field length as third element of list in field %d", i); +			if (zend_hash_index_find(field->value.ht,2,(void **)&value) == FAILURE) { +				php_error(E_WARNING, "expected field length as third element of list in field %d", i);  				free_dbf_head(dbh);  				RETURN_FALSE;  			} @@ -681,8 +681,8 @@ PHP_FUNCTION(dbase_create) {  			cur_f->db_flen = value->value.lval;  			if (cur_f->db_type == 'N') { -				if (_php3_hash_index_find(field->value.ht,3,(void **)&value) == FAILURE) { -					php3_error(E_WARNING, "expected field precision as fourth element of list in field %d", i); +				if (zend_hash_index_find(field->value.ht,3,(void **)&value) == FAILURE) { +					php_error(E_WARNING, "expected field precision as fourth element of list in field %d", i);  					free_dbf_head(dbh);  					RETURN_FALSE;  				} @@ -691,7 +691,7 @@ PHP_FUNCTION(dbase_create) {  			}  			break;  		default: -			php3_error(E_WARNING, "unknown field type '%c'", cur_f->db_type); +			php_error(E_WARNING, "unknown field type '%c'", cur_f->db_type);  		}  		cur_f->db_foffset = rlen;  		rlen += cur_f->db_flen; diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c index f36bd4056a..6382cfd739 100644 --- a/ext/ereg/ereg.c +++ b/ext/ereg/ereg.c @@ -69,7 +69,7 @@ static int _php_regcomp(regex_t *preg, const char *pattern, int cflags)  	reg_cache *rc = NULL;  	REGLS_FETCH(); -	if(_php3_hash_find(®(ht_rc), (char *) pattern, patlen+1, (void **) &rc) == FAILURE || +	if(zend_hash_find(®(ht_rc), (char *) pattern, patlen+1, (void **) &rc) == FAILURE ||  			rc->cflags != cflags) {  		r = regcomp(preg, pattern, cflags);  		if(!r) { @@ -77,7 +77,7 @@ static int _php_regcomp(regex_t *preg, const char *pattern, int cflags)  			rcp.cflags = cflags;  			memcpy(&rcp.preg, preg, sizeof(*preg)); -			_php3_hash_update(®(ht_rc), (char *) pattern, patlen+1, +			zend_hash_update(®(ht_rc), (char *) pattern, patlen+1,  					(void *) &rcp, sizeof(rcp), NULL);  		}  	} else { @@ -98,7 +98,7 @@ static int _free_reg_cache(reg_cache *rc)  static void php_reg_init_globals(php_reg_globals *reg_globals)   { -	_php3_hash_init(®_globals->ht_rc, 0, NULL, (int (*)(void *)) _free_reg_cache, 1); +	zend_hash_init(®_globals->ht_rc, 0, NULL, (int (*)(void *)) _free_reg_cache, 1);  }  static PHP_MINIT_FUNCTION(regex) @@ -116,7 +116,7 @@ static PHP_MSHUTDOWN_FUNCTION(regex)  {  	REGLS_FETCH(); -	_php3_hash_destroy(®(ht_rc)); +	zend_hash_destroy(®(ht_rc));  	return SUCCESS;  } @@ -167,7 +167,7 @@ static void _php3_reg_eprint(int err, regex_t *re) {  		/* drop the message into place */  		regerror(err, re, message + buf_len, len); -		php3_error(E_WARNING, "%s", message); +		php_error(E_WARNING, "%s", message);  	}  	STR_FREE(buf); @@ -204,7 +204,7 @@ static void _php3_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase)  			WRONG_PARAM_COUNT;  		}  		if (!ParameterPassedByReference(ht, 3)) { -			php3_error(E_WARNING, "Array to be filled with values must be passed by reference."); +			php_error(E_WARNING, "Array to be filled with values must be passed by reference.");  			RETURN_FALSE;  		}  		break; @@ -249,7 +249,7 @@ static void _php3_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase)  		buf = emalloc(string_len);  		if (!buf) { -			php3_error(E_WARNING, "Unable to allocate memory in _php3_ereg"); +			php_error(E_WARNING, "Unable to allocate memory in _php3_ereg");  			RETURN_FALSE;  		} @@ -324,7 +324,7 @@ char *_php3_regreplace(const char *pattern, const char *replace, const char *str  	buf_len = 2 * string_len + 1;  	buf = emalloc(buf_len * sizeof(char));  	if (!buf) { -		php3_error(E_WARNING, "Unable to allocate memory in _php3_regreplace"); +		php_error(E_WARNING, "Unable to allocate memory in _php3_regreplace");  		regfree(&re);  		return ((char *) -1);  	} @@ -541,7 +541,7 @@ PHP_FUNCTION(split)  	err = regcomp(&re, spliton->value.str.val, REG_EXTENDED);  	if (err) { -		php3_error(E_WARNING, "unexpected regex error (%d)", err); +		php_error(E_WARNING, "unexpected regex error (%d)", err);  		RETURN_FALSE;  	} @@ -560,8 +560,8 @@ PHP_FUNCTION(split)  		} else if (subs[0].rm_so==0 && subs[0].rm_eo==0) {  			/* No more matches */  			regfree(&re); -			php3_error(E_WARNING, "bad regular expression for split()"); -			_php3_hash_destroy(return_value->value.ht); +			php_error(E_WARNING, "bad regular expression for split()"); +			zend_hash_destroy(return_value->value.ht);  			efree(return_value->value.ht);  			RETURN_FALSE;  		} else { @@ -586,9 +586,9 @@ PHP_FUNCTION(split)  	/* see if we encountered an error */  	if (err && err != REG_NOMATCH) { -		php3_error(E_WARNING, "unexpected regex error (%d)", err); +		php_error(E_WARNING, "unexpected regex error (%d)", err);  		regfree(&re); -		_php3_hash_destroy(return_value->value.ht); +		zend_hash_destroy(return_value->value.ht);  		efree(return_value->value.ht);  		RETURN_FALSE;  	} diff --git a/ext/fdf/fdf.c b/ext/fdf/fdf.c index b3d4b05114..1d8e0fd238 100644 --- a/ext/fdf/fdf.c +++ b/ext/fdf/fdf.c @@ -102,7 +102,7 @@ PHP_MINIT_FUNCTION(fdf)  PHP_MINFO_FUNCTION(fdf)  {  	/* need to use a PHPAPI function here because it is external module in windows */ -	php3_printf("FdfTk Version %s", FDFGetVersion()); +	php_printf("FdfTk Version %s", FDFGetVersion());  }  PHP_MSHUTDOWN_FUNCTION(fdf) @@ -156,7 +156,7 @@ PHP_FUNCTION(fdf_close) {  	id=arg1->value.lval;  	fdf = php3_list_find(id,&type);  	if(!fdf || type!=FDF_GLOBAL(le_fdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -205,7 +205,7 @@ PHP_FUNCTION(fdf_get_value) {  	id=arg1->value.lval;  	fdf = php3_list_find(id,&type);  	if(!fdf || type!=FDF_GLOBAL(le_fdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -241,7 +241,7 @@ PHP_FUNCTION(fdf_set_value) {  	id=arg1->value.lval;  	fdf = php3_list_find(id,&type);  	if(!fdf || type!=FDF_GLOBAL(le_fdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -282,7 +282,7 @@ PHP_FUNCTION(fdf_next_field_name) {  	id=argv[0]->value.lval;  	fdf = php3_list_find(id,&type);  	if(!fdf || type!=FDF_GLOBAL(le_fdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -323,7 +323,7 @@ PHP_FUNCTION(fdf_set_ap) {  	id=arg1->value.lval;  	fdf = php3_list_find(id,&type);  	if(!fdf || type!=FDF_GLOBAL(le_fdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -368,7 +368,7 @@ PHP_FUNCTION(fdf_set_status) {  	id=arg1->value.lval;  	fdf = php3_list_find(id,&type);  	if(!fdf || type!=FDF_GLOBAL(le_fdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -399,7 +399,7 @@ PHP_FUNCTION(fdf_get_status) {  	id=arg1->value.lval;  	fdf = php3_list_find(id,&type);  	if(!fdf || type!=FDF_GLOBAL(le_fdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -435,7 +435,7 @@ PHP_FUNCTION(fdf_set_file) {  	id=arg1->value.lval;  	fdf = php3_list_find(id,&type);  	if(!fdf || type!=FDF_GLOBAL(le_fdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -466,7 +466,7 @@ PHP_FUNCTION(fdf_get_file) {  	id=arg1->value.lval;  	fdf = php3_list_find(id,&type);  	if(!fdf || type!=FDF_GLOBAL(le_fdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -502,7 +502,7 @@ PHP_FUNCTION(fdf_save) {  	id=arg1->value.lval;  	fdf = php3_list_find(id,&type);  	if(!fdf || type!=FDF_GLOBAL(le_fdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} diff --git a/ext/filepro/filepro.c b/ext/filepro/filepro.c index 2ce67be16b..83a63e8f3e 100644 --- a/ext/filepro/filepro.c +++ b/ext/filepro/filepro.c @@ -209,20 +209,20 @@ PHP_FUNCTION(filepro)  	}  	if (!(fp = fopen(workbuf, "r"))) { -		php3_error(E_WARNING, "filePro: cannot open map: [%d] %s", +		php_error(E_WARNING, "filePro: cannot open map: [%d] %s",  					errno, strerror(errno));  		RETURN_FALSE;  	}  	if (!fgets(readbuf, 250, fp)) {  		fclose(fp); -		php3_error(E_WARNING, "filePro: cannot read map: [%d] %s", +		php_error(E_WARNING, "filePro: cannot read map: [%d] %s",  					errno, strerror(errno));  		RETURN_FALSE;  	}  	/* Get the field count, assume the file is readable! */  	if (strcmp(strtok(readbuf, ":"), "map")) { -		php3_error(E_WARNING, "filePro: map file corrupt or encrypted"); +		php_error(E_WARNING, "filePro: map file corrupt or encrypted");  		RETURN_FALSE;  	}  	FP_GLOBAL(fp_keysize) = atoi(strtok(NULL, ":")); @@ -233,7 +233,7 @@ PHP_FUNCTION(filepro)  	for (i = 0; i < FP_GLOBAL(fp_fcount); i++) {  		if (!fgets(readbuf, 250, fp)) {  			fclose(fp); -			php3_error(E_WARNING, "filePro: cannot read map: [%d] %s", +			php_error(E_WARNING, "filePro: cannot read map: [%d] %s",  						errno, strerror(errno));  			RETURN_FALSE;  		} @@ -285,7 +285,7 @@ PHP_FUNCTION(filepro_rowcount)  	}  	if (!FP_GLOBAL(fp_database)) { -		php3_error(E_WARNING, +		php_error(E_WARNING,  					"filePro: must set database directory first!\n");  		RETURN_FALSE;  	} @@ -304,7 +304,7 @@ PHP_FUNCTION(filepro_rowcount)  	}  	if (!(fp = fopen(workbuf, "r"))) { -		php3_error(E_WARNING, "filePro: cannot open key: [%d] %s", +		php_error(E_WARNING, "filePro: cannot open key: [%d] %s",  					errno, strerror(errno));  		RETURN_FALSE;  	} @@ -340,7 +340,7 @@ PHP_FUNCTION(filepro_fieldname)  	convert_to_long(fno);  	if (!FP_GLOBAL(fp_database)) { -		php3_error(E_WARNING, +		php_error(E_WARNING,  					"filePro: must set database directory first!\n");  		RETURN_FALSE;  	} @@ -351,7 +351,7 @@ PHP_FUNCTION(filepro_fieldname)  		}  	} -	php3_error(E_WARNING, +	php_error(E_WARNING,  				"filePro: unable to locate field number %d.\n",  				fno->value.lval); @@ -378,7 +378,7 @@ PHP_FUNCTION(filepro_fieldtype)  	convert_to_long(fno);  	if (!FP_GLOBAL(fp_database)) { -		php3_error(E_WARNING, +		php_error(E_WARNING,  					"filePro: must set database directory first!\n");  		RETURN_FALSE;  	} @@ -388,7 +388,7 @@ PHP_FUNCTION(filepro_fieldtype)  			RETURN_STRING(lp->format,1);  		}  	} -	php3_error(E_WARNING, +	php_error(E_WARNING,  				"filePro: unable to locate field number %d.\n",  				fno->value.lval);  	RETVAL_FALSE; @@ -414,7 +414,7 @@ PHP_FUNCTION(filepro_fieldwidth)  	convert_to_long(fno);  	if (!FP_GLOBAL(fp_database)) { -		php3_error(E_WARNING, +		php_error(E_WARNING,  					"filePro: must set database directory first!\n");  		RETURN_FALSE;  	} @@ -424,7 +424,7 @@ PHP_FUNCTION(filepro_fieldwidth)  			RETURN_LONG(lp->width);  		}  	} -	php3_error(E_WARNING, +	php_error(E_WARNING,  				"filePro: unable to locate field number %d.\n",  				fno->value.lval);  	RETVAL_FALSE; @@ -445,7 +445,7 @@ PHP_FUNCTION(filepro_fieldcount)  	}  	if (!FP_GLOBAL(fp_database)) { -		php3_error(E_WARNING, +		php_error(E_WARNING,  					"filePro: must set database directory first!\n");  		RETURN_FALSE;  	} @@ -476,7 +476,7 @@ PHP_FUNCTION(filepro_retrieve)  	}  	if (!FP_GLOBAL(fp_database)) { -		php3_error(E_WARNING, +		php_error(E_WARNING,  					"filePro: must set database directory first!\n");  		RETURN_FALSE;  	} @@ -488,7 +488,7 @@ PHP_FUNCTION(filepro_retrieve)  	rnum = rno->value.lval;      if (rnum < 0 || fnum < 0 || fnum >= FP_GLOBAL(fp_fcount)) { -        php3_error(E_WARNING, "filepro: parameters out of range"); +        php_error(E_WARNING, "filepro: parameters out of range");  		RETURN_FALSE;      } @@ -497,7 +497,7 @@ PHP_FUNCTION(filepro_retrieve)          offset += lp->width;      }      if (!lp) { -        php3_error(E_WARNING, "filePro: cannot locate field"); +        php_error(E_WARNING, "filePro: cannot locate field");  		RETURN_FALSE;      } @@ -513,14 +513,14 @@ PHP_FUNCTION(filepro_retrieve)  	}  	if (!(fp = fopen(workbuf, "r"))) { -		php3_error(E_WARNING, "filePro: cannot open key: [%d] %s", +		php_error(E_WARNING, "filePro: cannot open key: [%d] %s",  					errno, strerror(errno));  	    fclose(fp);  		RETURN_FALSE;  	}      fseek(fp, offset, SEEK_SET);  	if (fread(readbuf, lp->width, 1, fp) != 1) { -        php3_error(E_WARNING, "filePro: cannot read data: [%d] %s", +        php_error(E_WARNING, "filePro: cannot read data: [%d] %s",  					errno, strerror(errno));  	    fclose(fp);  		RETURN_FALSE; diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 6e549e9026..97c47f14e2 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -171,12 +171,12 @@ PHP_MINFO_FUNCTION(gd)  {  	/* need to use a PHPAPI function here because it is external module in windows */  #if HAVE_LIBGD13 -	php3_printf("Version 1.3"); +	php_printf("Version 1.3");  #else -	php3_printf("Version 1.2"); +	php_printf("Version 1.2");  #endif  #ifdef ENABLE_GD_TTF -	php3_printf(" with FreeType support"); +	php_printf(" with FreeType support");  #endif  } @@ -280,7 +280,7 @@ PHP_FUNCTION(imageloadfont) {  	fp = php3_fopen_wrapper(file->value.str.val, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd);  #endif  	if (fp == NULL) { -		php3_error(E_WARNING, "ImageFontLoad: unable to open file"); +		php_error(E_WARNING, "ImageFontLoad: unable to open file");  		RETURN_FALSE;  	} @@ -304,9 +304,9 @@ PHP_FUNCTION(imageloadfont) {  		fclose(fp);  		efree(font);  		if (feof(fp)) { -			php3_error(E_WARNING, "ImageFontLoad: end of file while reading header"); +			php_error(E_WARNING, "ImageFontLoad: end of file while reading header");  		} else { -			php3_error(E_WARNING, "ImageFontLoad: error while reading header"); +			php_error(E_WARNING, "ImageFontLoad: error while reading header");  		}  		RETURN_FALSE;  	} @@ -320,9 +320,9 @@ PHP_FUNCTION(imageloadfont) {  		efree(font->data);  		efree(font);  		if (feof(fp)) { -			php3_error(E_WARNING, "ImageFontLoad: end of file while reading body"); +			php_error(E_WARNING, "ImageFontLoad: end of file while reading body");  		} else { -			php3_error(E_WARNING, "ImageFontLoad: error while reading body"); +			php_error(E_WARNING, "ImageFontLoad: error while reading body");  		}  		RETURN_FALSE;  	} @@ -388,7 +388,7 @@ PHP_FUNCTION(imagecreatefromgif )  #endif  	if (!fp) {  		php3_strip_url_passwd(fn); -		php3_error(E_WARNING, +		php_error(E_WARNING,  					"ImageCreateFromGif: Unable to open %s for reading", fn);  		RETURN_FALSE;  	} @@ -450,7 +450,7 @@ PHP_FUNCTION(imagecolorallocate)  	im = php3_list_find(ind, &ind_type);  	if (!im || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "ImageColorAllocate: Unable to find image pointer"); +		php_error(E_WARNING, "ImageColorAllocate: Unable to find image pointer");  		RETURN_FALSE;  	}  	col = gdImageColorAllocate(im, r, g, b); @@ -480,7 +480,7 @@ PHP_FUNCTION(imagecolorat)  	im = php3_list_find(ind, &ind_type);  	if (!im || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "ImageColorAt: Unable to find image pointer"); +		php_error(E_WARNING, "ImageColorAt: Unable to find image pointer");  		RETURN_FALSE;  	}  	if (gdImageBoundsSafe(im, x->value.lval, y->value.lval)) { @@ -524,7 +524,7 @@ PHP_FUNCTION(imagecolorclosest)  	im = php3_list_find(ind, &ind_type);  	if (!im || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "ImageColorClosest: Unable to find image pointer"); +		php_error(E_WARNING, "ImageColorClosest: Unable to find image pointer");  		RETURN_FALSE;  	}  	col = gdImageColorClosest(im, r, g, b); @@ -552,7 +552,7 @@ PHP_FUNCTION(imagecolordeallocate)  	im = php3_list_find(ind, &ind_type);  	if (!im || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "ImageColorDeallocate: Unable to find image pointer"); +		php_error(E_WARNING, "ImageColorDeallocate: Unable to find image pointer");  		RETURN_FALSE;  	} @@ -561,7 +561,7 @@ PHP_FUNCTION(imagecolordeallocate)  		RETURN_TRUE;          }          else { -                php3_error(E_WARNING, "Color index out of range"); +                php_error(E_WARNING, "Color index out of range");                  RETURN_FALSE;          }  } @@ -595,7 +595,7 @@ PHP_FUNCTION(imagecolorresolve)  	im = php3_list_find(ind, &ind_type);  	if (!im || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "ImageColorResolve: Unable to find image pointer"); +		php_error(E_WARNING, "ImageColorResolve: Unable to find image pointer");  		RETURN_FALSE;  	}  	col = gdImageColorResolve(im, r, g, b); @@ -631,7 +631,7 @@ PHP_FUNCTION(imagecolorexact)  	im = php3_list_find(ind, &ind_type);  	if (!im || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "ImageColorExact: Unable to find image pointer"); +		php_error(E_WARNING, "ImageColorExact: Unable to find image pointer");  		RETURN_FALSE;  	}  	col = gdImageColorExact(im, r, g, b); @@ -668,7 +668,7 @@ PHP_FUNCTION(imagecolorset)  	im = php3_list_find(ind, &ind_type);  	if (!im || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "ImageColorSet: Unable to find image pointer"); +		php_error(E_WARNING, "ImageColorSet: Unable to find image pointer");  		RETURN_FALSE;  	}  	if (col >= 0 && col < gdImageColorsTotal(im)) { @@ -702,7 +702,7 @@ PHP_FUNCTION(imagecolorsforindex)  	im = php3_list_find(ind, &ind_type);  	if (!im || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "ImageColorsForIndex: Unable to find image pointer"); +		php_error(E_WARNING, "ImageColorsForIndex: Unable to find image pointer");  		RETURN_FALSE;  	} @@ -715,7 +715,7 @@ PHP_FUNCTION(imagecolorsforindex)  		add_assoc_long(return_value,"blue",im->blue[col]);  	}  	else { -		php3_error(E_WARNING, "Color index out of range"); +		php_error(E_WARNING, "Color index out of range");  		RETURN_FALSE;  	}  } @@ -745,21 +745,21 @@ PHP_FUNCTION(imagegif )  		convert_to_string(file);  		fn = file->value.str.val;  		if (!fn || fn == empty_string || _php3_check_open_basedir(fn)) { -			php3_error(E_WARNING, "ImageGif: Invalid filename"); +			php_error(E_WARNING, "ImageGif: Invalid filename");  			RETURN_FALSE;  		}  	}  	im = php3_list_find(imgind->value.lval, &ind_type);  	if (!im || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "ImageGif: unable to find image pointer"); +		php_error(E_WARNING, "ImageGif: unable to find image pointer");  		RETURN_FALSE;  	}  	if (argc == 2) {  		fp = fopen(fn, "wb");  		if (!fp) { -			php3_error(E_WARNING, "ImageGif: unable to open %s for writing", fn); +			php_error(E_WARNING, "ImageGif: unable to open %s for writing", fn);  			RETURN_FALSE;  		}  		gdImageGif (im,fp); @@ -773,7 +773,7 @@ PHP_FUNCTION(imagegif )  		tmp = tmpfile();  		if (tmp == NULL) { -			php3_error(E_WARNING, "Unable to open temporary file"); +			php_error(E_WARNING, "Unable to open temporary file");  			RETURN_FALSE;  		} @@ -828,7 +828,7 @@ PHP_FUNCTION(imagesetpixel)  	im = php3_list_find(imarg->value.lval, &ind_type);  	if (!im || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "Unable to find image pointer"); +		php_error(E_WARNING, "Unable to find image pointer");  		RETURN_FALSE;  	} @@ -870,7 +870,7 @@ PHP_FUNCTION(imageline)  	im = php3_list_find(IM->value.lval, &ind_type);  	if (!im || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "Unable to find image pointer"); +		php_error(E_WARNING, "Unable to find image pointer");  		RETURN_FALSE;  	} @@ -909,7 +909,7 @@ PHP_FUNCTION(imagedashedline)  	im = php3_list_find(IM->value.lval, &ind_type);  	if (!im || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "Unable to find image pointer"); +		php_error(E_WARNING, "Unable to find image pointer");  		RETURN_FALSE;  	} @@ -950,7 +950,7 @@ PHP_FUNCTION(imagerectangle)  	im = php3_list_find(IM->value.lval, &ind_type);  	if (!im || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "Unable to find image pointer"); +		php_error(E_WARNING, "Unable to find image pointer");  		RETURN_FALSE;  	} @@ -991,7 +991,7 @@ PHP_FUNCTION(imagefilledrectangle)  	im = php3_list_find(IM->value.lval, &ind_type);  	if (!im || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "Unable to find image pointer"); +		php_error(E_WARNING, "Unable to find image pointer");  		RETURN_FALSE;  	} @@ -1042,7 +1042,7 @@ PHP_FUNCTION(imagearc)  	im = php3_list_find(IM->value.lval, &ind_type);  	if (!im || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "Unable to find image pointer"); +		php_error(E_WARNING, "Unable to find image pointer");  		RETURN_FALSE;  	} @@ -1081,7 +1081,7 @@ PHP_FUNCTION(imagefilltoborder)  	im = php3_list_find(IM->value.lval, &ind_type);  	if (!im || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "Unable to find image pointer"); +		php_error(E_WARNING, "Unable to find image pointer");  		RETURN_FALSE;  	} @@ -1118,7 +1118,7 @@ PHP_FUNCTION(imagefill)  	im = php3_list_find(IM->value.lval, &ind_type);  	if (!im || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "Unable to find image pointer"); +		php_error(E_WARNING, "Unable to find image pointer");  		RETURN_FALSE;  	} @@ -1143,7 +1143,7 @@ PHP_FUNCTION(imagecolorstotal)  	im = php3_list_find(IM->value.lval, &ind_type);  	if (!im || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "Unable to find image pointer"); +		php_error(E_WARNING, "Unable to find image pointer");  		RETURN_FALSE;  	} @@ -1181,7 +1181,7 @@ PHP_FUNCTION(imagecolortransparent)  	im = php3_list_find(IM->value.lval, &ind_type);  	if (!im || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "Unable to find image pointer"); +		php_error(E_WARNING, "Unable to find image pointer");  		RETURN_FALSE;  	} @@ -1224,7 +1224,7 @@ PHP_FUNCTION(imageinterlace)  	im = php3_list_find(IM->value.lval, &ind_type);  	if (!im || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "Unable to find image pointer"); +		php_error(E_WARNING, "Unable to find image pointer");  		RETURN_FALSE;  	} @@ -1263,12 +1263,12 @@ static void _php3_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled) {  	im = php3_list_find(IM->value.lval, &ind_type);  	if (!im || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "Unable to find image pointer"); +		php_error(E_WARNING, "Unable to find image pointer");  		RETURN_FALSE;  	}  	if (POINTS->type != IS_ARRAY) { -		php3_error(E_WARNING, "2nd argument to imagepolygon not an array"); +		php_error(E_WARNING, "2nd argument to imagepolygon not an array");  		RETURN_FALSE;  	} @@ -1276,37 +1276,37 @@ static void _php3_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled) {      ** we shouldn't need this check, should we? **      if (!ParameterPassedByReference(ht, 2)) { -        php3_error(E_WARNING, "2nd argument to imagepolygon not passed by reference"); +        php_error(E_WARNING, "2nd argument to imagepolygon not passed by reference");  		RETURN_FALSE;      }  */ -	nelem = _php3_hash_num_elements(POINTS->value.ht); +	nelem = zend_hash_num_elements(POINTS->value.ht);  	if (nelem < 6) { -		php3_error(E_WARNING, +		php_error(E_WARNING,  					"you must have at least 3 points in your array");  		RETURN_FALSE;  	}  	if (nelem < npoints * 2) { -		php3_error(E_WARNING, +		php_error(E_WARNING,  					"trying to use %d points in array with only %d points",  					npoints, nelem/2);  		RETURN_FALSE;  	}  	if (npoints > PolyMaxPoints) { -		php3_error(E_WARNING, "maximum %d points", PolyMaxPoints); +		php_error(E_WARNING, "maximum %d points", PolyMaxPoints);  		RETURN_FALSE;  	}  	for (i = 0; i < npoints; i++) { -		if (_php3_hash_index_find(POINTS->value.ht, (i * 2), (void **)&var) == SUCCESS) { +		if (zend_hash_index_find(POINTS->value.ht, (i * 2), (void **)&var) == SUCCESS) {  			SEPARATE_ZVAL(var);  			convert_to_long(*var);  			points[i].x = (*var)->value.lval;  		} -		if (_php3_hash_index_find(POINTS->value.ht, (i * 2) + 1, (void **)&var) == SUCCESS) { +		if (zend_hash_index_find(POINTS->value.ht, (i * 2) + 1, (void **)&var) == SUCCESS) {  			SEPARATE_ZVAL(var);  			convert_to_long(*var);  			points[i].y = (*var)->value.lval; @@ -1479,7 +1479,7 @@ static void _php3_imagechar(INTERNAL_FUNCTION_PARAMETERS, int mode) {  	im = php3_list_find(IM->value.lval, &ind_type);  	if (!im || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "Unable to find image pointer"); +		php_error(E_WARNING, "Unable to find image pointer");  		if (string) {  			efree(string);  		} @@ -1580,13 +1580,13 @@ PHP_FUNCTION(imagecopy)  	im_src = php3_list_find(SIM->value.lval, &ind_type);  	if (!im_src || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "Unable to find image pointer"); +		php_error(E_WARNING, "Unable to find image pointer");  		RETURN_FALSE;  	}  	im_dst = php3_list_find(DIM->value.lval, &ind_type);  	if (!im_dst || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "Unable to find image pointer"); +		php_error(E_WARNING, "Unable to find image pointer");  		RETURN_FALSE;  	} @@ -1634,13 +1634,13 @@ PHP_FUNCTION(imagecopyresized)  	im_src = php3_list_find(SIM->value.lval, &ind_type);  	if (!im_src || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "Unable to find image pointer"); +		php_error(E_WARNING, "Unable to find image pointer");  		RETURN_FALSE;  	}  	im_dst = php3_list_find(DIM->value.lval, &ind_type);  	if (!im_dst || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "Unable to find image pointer"); +		php_error(E_WARNING, "Unable to find image pointer");  		RETURN_FALSE;  	} @@ -1665,7 +1665,7 @@ PHP_FUNCTION(imagesx)  	im = php3_list_find(IM->value.lval, &ind_type);  	if (!im || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "Unable to find image pointer"); +		php_error(E_WARNING, "Unable to find image pointer");  		RETURN_FALSE;  	} @@ -1688,7 +1688,7 @@ PHP_FUNCTION(imagesy)  	im = php3_list_find(IM->value.lval, &ind_type);  	if (!im || ind_type != GD_GLOBAL(le_gd)) { -		php3_error(E_WARNING, "Unable to find image pointer"); +		php_error(E_WARNING, "Unable to find image pointer");  		RETURN_FALSE;  	} @@ -1758,7 +1758,7 @@ void php3_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode)  		x = X->value.lval;                im = php3_list_find(IM->value.lval, &ind_type);                if (!im || ind_type != GD_GLOBAL(le_gd)) { -                      php3_error(E_WARNING, "Unable to find image pointer"); +                      php_error(E_WARNING, "Unable to find image pointer");                        RETURN_FALSE;                }  	} @@ -1773,7 +1773,7 @@ void php3_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode)  	error = gdttf(im, brect, col, fontname, ptsize, angle, x, y, string);  	if (error) { -		php3_error(E_WARNING, error); +		php_error(E_WARNING, error);  		RETURN_FALSE;  	} diff --git a/ext/gettext/gettext.c b/ext/gettext/gettext.c index 5aff1e32be..6eb422daf1 100644 --- a/ext/gettext/gettext.c +++ b/ext/gettext/gettext.c @@ -42,7 +42,7 @@ php3_module_entry php3_gettext_module_entry = {  PHP_MINFO_FUNCTION(gettext)  { -	php3_printf("GNU gettext support active."); +	php_printf("GNU gettext support active.");  }  PHP_FUNCTION(textdomain) diff --git a/ext/hyperwave/hg_comm.c b/ext/hyperwave/hg_comm.c index 596701be6f..dcb300de60 100644 --- a/ext/hyperwave/hg_comm.c +++ b/ext/hyperwave/hg_comm.c @@ -1151,38 +1151,38 @@ hg_msg *recv_hg_msg(int sockfd)  	hg_msg *msg;  	if ( (msg = (hg_msg *)emalloc(sizeof(hg_msg))) == NULL )  { -/*		php3_printf("recv_hg_msg"); */ +/*		php_printf("recv_hg_msg"); */  		lowerror = LE_MALLOC;  		return(NULL);  	}  	if ( hg_read_exact(sockfd, (char *)&(msg->length), 4) == -1 )  { -/*		php3_printf("recv_hg_msg: hg_read (1) returned -1\n"); */ +/*		php_printf("recv_hg_msg: hg_read (1) returned -1\n"); */  		efree(msg);  		return(NULL);  	}  	if ( hg_read_exact(sockfd, (char *)&(msg->version_msgid), 4) == -1 )  { -/*		php3_printf("recv_hg_msg: hg_read (2) returned -1\n"); */ +/*		php_printf("recv_hg_msg: hg_read (2) returned -1\n"); */  		efree(msg);  		return(NULL);  	}  	if ( hg_read_exact(sockfd, (char *)&(msg->msg_type), 4) == -1 )  { -/*		php3_printf("recv_hg_msg: hg_read (3) returned -1\n"); */ +/*		php_printf("recv_hg_msg: hg_read (3) returned -1\n"); */  		efree(msg);  		return(NULL);  	}  	if ( msg->length > HEADER_LENGTH )  {  		if ( (msg->buf = (char *) emalloc(msg->length-HEADER_LENGTH)) == NULL )  { -/*			php3_printf("recv_hg_msg"); */ +/*			php_printf("recv_hg_msg"); */  			lowerror = LE_MALLOC;  			efree(msg);  			return(NULL);  		}  		if ( hg_read_exact(sockfd, msg->buf, msg->length-HEADER_LENGTH) == -1 )  { -/*			php3_printf("recv_hg_msg: hg_read (4) returned -1\n"); */ +/*			php_printf("recv_hg_msg: hg_read (4) returned -1\n"); */  			efree(msg->buf);  			efree(msg);  			return(NULL); @@ -1192,7 +1192,7 @@ hg_msg *recv_hg_msg(int sockfd)  		msg->buf = NULL;    #ifdef HW_DEBUG -	php3_printf("<B>   Recv msg: </B>type = %d -- id = %d<BR>\n", msg->msg_type, msg->version_msgid); +	php_printf("<B>   Recv msg: </B>type = %d -- id = %d<BR>\n", msg->msg_type, msg->version_msgid);  #endif  	return(msg);  } @@ -1203,11 +1203,11 @@ hg_msg *recv_ready(int sockfd)  	hg_msg *ready_msg;  	if ( (ready_msg = recv_hg_msg(sockfd)) == NULL )  { -/*		php3_printf("recv_ready: recv_hg_msg returned NULL\n"); */ +/*		php_printf("recv_ready: recv_hg_msg returned NULL\n"); */  		return(NULL);  	}      	if ( ready_msg->msg_type != READY_MESSAGE )  { -/*		php3_printf("recv_ready: recv_hg_msg returned wrong message: %d, %d  \n", ready_msg->length, ready_msg->msg_type); */ +/*		php_printf("recv_ready: recv_hg_msg returned wrong message: %d, %d  \n", ready_msg->length, ready_msg->msg_type); */  		efree(ready_msg);  		return(NULL);  	} @@ -3933,7 +3933,7 @@ int send_pipedocument(int sockfd, char *host, hw_objectID objectID, int mode, in  	*/  	if(host) {  		if((hostptr = gethostbyname(host)) == NULL) { -			php3_error(E_WARNING, "gethostbyname failed for %s", host); +			php_error(E_WARNING, "gethostbyname failed for %s", host);  			close(fd);  			return(-1);  		} @@ -4015,7 +4015,7 @@ int send_pipedocument(int sockfd, char *host, hw_objectID objectID, int mode, in          */  	len = sizeof(serv_addr);  	if((newfd = accept(fd, (struct sockaddr *) &serv_addr, &len)) < 0) { -/*		php3_printf("client: can't open data connection to server\n"); */ +/*		php_printf("client: can't open data connection to server\n"); */  		if(attributes) efree(attributes);  		close(fd);  		return(-1); @@ -4110,7 +4110,7 @@ int send_pipecgi(int sockfd, char *host, hw_objectID objectID, char *cgi_env_str  	*/  	if(host) {  		if((hostptr = gethostbyname(host)) == NULL) { -			php3_error(E_WARNING, "gethostbyname failed for %s", host); +			php_error(E_WARNING, "gethostbyname failed for %s", host);  			close(fd);  			return(-1);  		} @@ -4128,7 +4128,7 @@ int send_pipecgi(int sockfd, char *host, hw_objectID objectID, char *cgi_env_str  			hostip = inet_ntoa(*ptr1);  			break;  		default: -/*			php3_printf(stderr, "unknown address type\n"); */ +/*			php_printf(stderr, "unknown address type\n"); */  			break;  	} @@ -4293,7 +4293,7 @@ int send_putdocument(int sockfd, char *host, hw_objectID parentID, char *objectR  	*/  	if(host) {  		if((hostptr = gethostbyname(host)) == NULL) { -			php3_error(E_WARNING, "gethostbyname failed for %s", host); +			php_error(E_WARNING, "gethostbyname failed for %s", host);  			/* close(fd); fd is not set yet */  			return(-1);  		} @@ -4532,7 +4532,7 @@ static int send_hg_msg(int sockfd, hg_msg *msg, int length)       char *buf, *tmp;  #ifdef HW_DEBUG -	php3_printf("<B>Sending msg: </B>type = %d -- id = %d<BR>\n", msg->msg_type, msg->version_msgid); +	php_printf("<B>Sending msg: </B>type = %d -- id = %d<BR>\n", msg->msg_type, msg->version_msgid);  #endif       if ( length < HEADER_LENGTH )  {  /*          fprintf(stderr, "send_hg_msg: bad msg\n"); */ @@ -4644,7 +4644,7 @@ static char *build_msg_int(char *buf, int val) {  	int tmp;  #ifdef HW_DEBUG -	php3_printf("   Added int to header: <B>%d</B><BR>\n", val); +	php_printf("   Added int to header: <B>%d</B><BR>\n", val);  #endif  	tmp = swap_on ? swap(val) : val;  	memcpy(buf, (char *)&tmp, 4); @@ -4658,7 +4658,7 @@ static char *build_msg_str(char *buf, char *str)       int len = strlen(str)+1;  #ifdef HW_DEBUG -	php3_printf("   Added str to header: <B>%s</B> (%d)<BR>\n", str, strlen(str)); +	php_printf("   Added str to header: <B>%s</B> (%d)<BR>\n", str, strlen(str));  #endif       memcpy(buf, str, len); diff --git a/ext/hyperwave/hw.c b/ext/hyperwave/hw.c index 72f3e4c678..de6597d043 100644 --- a/ext/hyperwave/hw.c +++ b/ext/hyperwave/hw.c @@ -209,7 +209,7 @@ int make_return_objrec(pval **return_value, char **objrecs, int count)  	add_assoc_long(&stat_arr, "FullCollectionHeadNr", fullcollheadnr);  	/* Add the stat array */ -	_php3_hash_next_index_insert((*return_value)->value.ht, &stat_arr, sizeof(pval), NULL); +	zend_hash_next_index_insert((*return_value)->value.ht, &stat_arr, sizeof(pval), NULL);  	/* The title array can now be freed, but I don't know how */  	return 0; @@ -285,14 +285,14 @@ int make_return_array_from_objrec(pval **return_value, char *objrec) {  	/* Add the title array, if we have one */  	if(hasTitle) { -		_php3_hash_update((*return_value)->value.ht, "Title", 6, &title_arr, sizeof(pval), NULL); +		zend_hash_update((*return_value)->value.ht, "Title", 6, &title_arr, sizeof(pval), NULL);  		/* The title array can now be freed, but I don't know how */  	}  	if(hasDescription) {  	/* Add the description array, if we have one */ -		_php3_hash_update((*return_value)->value.ht, "Description", 12, &desc_arr, sizeof(pval), NULL); +		zend_hash_update((*return_value)->value.ht, "Description", 12, &desc_arr, sizeof(pval), NULL);  		/* The description array can now be freed, but I don't know how */  	} @@ -327,16 +327,16 @@ static char * make_objrec_from_array(HashTable *lht) {  	if(NULL == lht)  		return NULL; -	if(0 == (count = _php3_hash_num_elements(lht))) +	if(0 == (count = zend_hash_num_elements(lht)))  		return NULL; -	_php3_hash_internal_pointer_reset(lht); +	zend_hash_internal_pointer_reset(lht);  	objrec = malloc(1);  	*objrec = '\0';  	for(i=0; i<count; i++) { -		keytype = _php3_hash_get_current_key(lht, &key, &length); +		keytype = zend_hash_get_current_key(lht, &key, &length);  		if(HASH_KEY_IS_STRING == keytype) { -			_php3_hash_get_current_data(lht, (void **) &keydata); +			zend_hash_get_current_data(lht, (void **) &keydata);  			switch(keydata->type) {  				case IS_STRING:  					sprintf(str, "%s=%s\n", key, keydata->value.str.val); @@ -349,7 +349,7 @@ static char * make_objrec_from_array(HashTable *lht) {  			objrec = realloc(objrec, strlen(objrec)+strlen(str)+1);  			strcat(objrec, str);  		} -		_php3_hash_move_forward(lht); +		zend_hash_move_forward(lht);  	}  	return objrec;  } @@ -362,14 +362,14 @@ static int * make_ints_from_array(HashTable *lht) {  	if(NULL == lht)  		return NULL; -	if(0 == (count = _php3_hash_num_elements(lht))) +	if(0 == (count = zend_hash_num_elements(lht)))  		return NULL; -	_php3_hash_internal_pointer_reset(lht); +	zend_hash_internal_pointer_reset(lht);  	if(NULL == (objrec = emalloc(count*sizeof(int))))  		return NULL;  	for(i=0; i<count; i++) { -		_php3_hash_get_current_data(lht, (void **) &keydata); +		zend_hash_get_current_data(lht, (void **) &keydata);  		switch(keydata->type) {  			case IS_LONG:  				objrec[i] = keydata->value.lval; @@ -377,7 +377,7 @@ static int * make_ints_from_array(HashTable *lht) {  			default:  				objrec[i] = 0;  		} -		_php3_hash_move_forward(lht); +		zend_hash_move_forward(lht);  	}  	return objrec;  } @@ -462,7 +462,7 @@ static void php3_hw_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)  		if(host) efree(host);  		if(password) efree(password);  		if(username) efree(username); -		php3_error(E_ERROR, "Could not get memory for connection details"); +		php_error(E_ERROR, "Could not get memory for connection details");  		RETURN_FALSE;  	}  	sprintf(hashed_details,"hw_%s_%d",host,port); @@ -471,11 +471,11 @@ static void php3_hw_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)  		list_entry *le;  		/* try to find if we already have this link in our persistent list */ -		if (_php3_hash_find(plist, hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) { +		if (zend_hash_find(plist, hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) {  			list_entry new_le;  			if (php3_hw_module.max_links!=-1 && php3_hw_module.num_links>=php3_hw_module.max_links) { -				php3_error(E_ERROR,"Hyperwave:  Too many open links (%d)",php3_hw_module.num_links); +				php_error(E_ERROR,"Hyperwave:  Too many open links (%d)",php3_hw_module.num_links);  				if(host) efree(host);  				if(username) efree(username);  				if(password) efree(password); @@ -483,7 +483,7 @@ static void php3_hw_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)  				RETURN_FALSE;  			}  			if (php3_hw_module.max_persistent!=-1 && php3_hw_module.num_persistent>=php3_hw_module.max_persistent) { -				php3_error(E_ERROR,"Hyperwave: Too many open persistent links (%d)",php3_hw_module.num_persistent); +				php_error(E_ERROR,"Hyperwave: Too many open persistent links (%d)",php3_hw_module.num_persistent);  				if(host) efree(host);  				if(username) efree(username);  				if(password) efree(password); @@ -492,7 +492,7 @@ static void php3_hw_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)  			}  			if ( (sockfd = open_hg_connection(host, port)) < 0 )  { -				php3_error(E_ERROR, "Could not open connection to %s, Port: %d (retval=%d)", host, port, sockfd); +				php_error(E_ERROR, "Could not open connection to %s, Port: %d (retval=%d)", host, port, sockfd);  				if(host) efree(host);  				if(username) efree(username);  				if(password) efree(password); @@ -501,7 +501,7 @@ static void php3_hw_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)  				}  			if(NULL == (ptr = malloc(sizeof(hw_connection)))) { -				php3_error(E_ERROR, "Could not get memory for connection structure"); +				php_error(E_ERROR, "Could not get memory for connection structure");  				if(host) efree(host);  				if(username) efree(username);  				if(password) efree(password); @@ -510,7 +510,7 @@ static void php3_hw_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)  			}  			if(0 != (ptr->lasterror = initialize_hg_connection(sockfd, &do_swap, &version, &userdata, &server_string, username, password))) { -				php3_error(E_ERROR, "Could not initalize hyperwave connection"); +				php_error(E_ERROR, "Could not initalize hyperwave connection");  				if(host) efree(host);  				if(username) efree(username);  				if(password) efree(password); @@ -534,8 +534,8 @@ static void php3_hw_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)  			new_le.ptr = (void *) ptr;  			new_le.type = php3_hw_module.le_psocketp;; -			if (_php3_hash_update(plist,hashed_details,hashed_details_length+1,(void *) &new_le, sizeof(list_entry), NULL)==FAILURE) { -				php3_error(E_ERROR, "Could not hash table with connection details"); +			if (zend_hash_update(plist,hashed_details,hashed_details_length+1,(void *) &new_le, sizeof(list_entry), NULL)==FAILURE) { +				php_error(E_ERROR, "Could not hash table with connection details");  				if(host) efree(host);  				if(username) efree(username);  				if(password) efree(password); @@ -547,7 +547,7 @@ static void php3_hw_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)  			php3_hw_module.num_links++;  			php3_hw_module.num_persistent++;  		} else { -			/*php3_printf("Found already open connection\n"); */ +			/*php_printf("Found already open connection\n"); */  			if (le->type != php3_hw_module.le_psocketp) {  				RETURN_FALSE;  			} @@ -565,7 +565,7 @@ static void php3_hw_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)  		 * if it doesn't, open a new hyperwave link, add it to the resource list,  		 * and add a pointer to it with hashed_details as the key.  		 */ -		if (_php3_hash_find(list,hashed_details,hashed_details_length+1,(void **) &index_ptr)==SUCCESS) { +		if (zend_hash_find(list,hashed_details,hashed_details_length+1,(void **) &index_ptr)==SUCCESS) {  			int type,link;  			void *ptr; @@ -583,12 +583,12 @@ static void php3_hw_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)  	  		if(host) efree(host);  				return;  			} else { -				_php3_hash_del(list,hashed_details,hashed_details_length+1); +				zend_hash_del(list,hashed_details,hashed_details_length+1);  			}  		}  		if ( (sockfd = open_hg_connection(host, port)) < 0 )  { -			php3_error(E_ERROR, "Could not open connection to %s, Port: %d (retval=%d", host, port, sockfd); +			php_error(E_ERROR, "Could not open connection to %s, Port: %d (retval=%d", host, port, sockfd);  		  if(host) efree(host);  			if(username) efree(username);  			if(password) efree(password); @@ -605,7 +605,7 @@ static void php3_hw_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)  		}  		if(0 != (ptr->lasterror = initialize_hg_connection(sockfd, &do_swap, &version, &userdata, &server_string, username, password))) { -			php3_error(E_ERROR, "Could not initalize hyperwave connection"); +			php_error(E_ERROR, "Could not initalize hyperwave connection");  			if(host) efree(host);  			if(username) efree(username);  			if(password) efree(password); @@ -631,8 +631,8 @@ static void php3_hw_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)  		new_index_ptr.ptr = (void *) return_value->value.lval;  		new_index_ptr.type = le_index_ptr; -		if (_php3_hash_update(list,hashed_details,hashed_details_length+1,(void *) &new_index_ptr, sizeof(list_entry), NULL)==FAILURE) { -			php3_error(E_ERROR, "Could not update connection details in hash table"); +		if (zend_hash_update(list,hashed_details,hashed_details_length+1,(void *) &new_index_ptr, sizeof(list_entry), NULL)==FAILURE) { +			php_error(E_ERROR, "Could not update connection details in hash table");  			if(host) efree(host);  			efree(hashed_details);  			RETURN_FALSE; @@ -695,7 +695,7 @@ PHP_FUNCTION(hw_close) {  	id=arg1->value.lval;  	ptr = php3_list_find(id,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	}  	php3_list_delete(id); @@ -719,12 +719,12 @@ PHP_FUNCTION(hw_info)  	id=arg1->value.lval;  	ptr = php3_list_find(id,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	}  	if(NULL != (str = get_hw_info(ptr))) {  		/* -		php3_printf("%s\n", str); +		php_printf("%s\n", str);  		efree(str);  		*/  		return_value->value.str.len = strlen(str); @@ -751,7 +751,7 @@ PHP_FUNCTION(hw_error)  	id=arg1->value.lval;  	ptr = php3_list_find(id,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	}  	RETURN_LONG(ptr->lasterror); @@ -774,7 +774,7 @@ PHP_FUNCTION(hw_errormsg)  	id=arg1->value.lval;  	ptr = php3_list_find(id,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -867,7 +867,7 @@ char *php3_hw_command(INTERNAL_FUNCTION_PARAMETERS, int comm) {  	link=arg1->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",link); +		php_error(E_WARNING,"Unable to find file identifier %d",link);  		return NULL;  	} @@ -995,7 +995,7 @@ PHP_FUNCTION(hw_who) {  		add_assoc_string(&user_arr, "TotalTime", name, 1);  		/* Add the user array */ -		_php3_hash_index_update(return_value->value.ht, i++, &user_arr, sizeof(pval), NULL); +		zend_hash_index_update(return_value->value.ht, i++, &user_arr, sizeof(pval), NULL);  		/* The user array can now be freed, but I don't know how */ @@ -1023,7 +1023,7 @@ PHP_FUNCTION(hw_dummy) {  	msgid=arg3->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1033,7 +1033,7 @@ PHP_FUNCTION(hw_dummy) {  	if (0 != (ptr->lasterror = send_dummy(ptr->socket, id, msgid, &object)))  		RETURN_FALSE; -php3_printf("%s", object); +php_printf("%s", object);  	return_value->value.str.val = object;  	return_value->value.str.len = strlen(object);  	return_value->type = IS_STRING; @@ -1056,7 +1056,7 @@ PHP_FUNCTION(hw_getobject) {  	id=arg2->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1094,7 +1094,7 @@ PHP_FUNCTION(hw_insertobject) {  	parms=arg3->value.str.val;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",link); +		php_error(E_WARNING,"Unable to find file identifier %d",link);  		RETURN_FALSE;  	} @@ -1125,7 +1125,7 @@ PHP_FUNCTION(hw_getandlock) {  	id=arg2->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1157,7 +1157,7 @@ PHP_FUNCTION(hw_unlock) {  	id=arg2->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1185,7 +1185,7 @@ PHP_FUNCTION(hw_deleteobject) {  	id=arg2->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1216,7 +1216,7 @@ PHP_FUNCTION(hw_changeobject) {  	newobjarr=arg3->value.ht;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1224,16 +1224,16 @@ PHP_FUNCTION(hw_changeobject) {  	if(0 != (ptr->lasterror = send_getobject(ptr->socket, id, &oldobjrec)))  		RETURN_FALSE; -	_php3_hash_internal_pointer_reset(newobjarr); +	zend_hash_internal_pointer_reset(newobjarr);  	modification = strdup(""); -	for(i=0; i<_php3_hash_num_elements(newobjarr); i++) { +	for(i=0; i<zend_hash_num_elements(newobjarr); i++) {  		char *key, *str, *str1, newattribute[200];  		pval *data;  		int j, noinsert=1;  		ulong ind; -		_php3_hash_get_current_key(newobjarr, &key, &ind); -		_php3_hash_get_current_data(newobjarr, (void *) &data); +		zend_hash_get_current_key(newobjarr, &key, &ind); +		zend_hash_get_current_data(newobjarr, (void *) &data);  		switch(data->type) {  			case IS_STRING:  				if(strlen(data->value.str.val) == 0) @@ -1264,13 +1264,13 @@ PHP_FUNCTION(hw_changeobject) {  			}   		}  		efree(key); -		_php3_hash_move_forward(newobjarr); +		zend_hash_move_forward(newobjarr);  	}  	efree(oldobjrec);  	set_swap(ptr->swap_on);  	modification[strlen(modification)-1] = '\0'; -/*	php3_printf("0x%X, %s", id, modification); */ +/*	php_printf("0x%X, %s", id, modification); */  	if (0 != (ptr->lasterror = send_changeobject(ptr->socket, id, modification)))  		RETURN_FALSE;  	free(modification); @@ -1313,33 +1313,33 @@ void php3_hw_mvcp(INTERNAL_FUNCTION_PARAMETERS, int mvcp) {  	}  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",link); +		php_error(E_WARNING,"Unable to find file identifier %d",link);  		RETURN_FALSE;  	}  	set_swap(ptr->swap_on); -	if(NULL == (objvIDs = emalloc(_php3_hash_num_elements(src_arr) * sizeof(pval *)))) { +	if(NULL == (objvIDs = emalloc(zend_hash_num_elements(src_arr) * sizeof(pval *)))) {  		RETURN_FALSE;  		} -	if(getParametersArray(src_arr, _php3_hash_num_elements(src_arr), objvIDs) == FAILURE) { +	if(getParametersArray(src_arr, zend_hash_num_elements(src_arr), objvIDs) == FAILURE) {  		RETURN_FALSE;  		} -	if(NULL == (collIDs = emalloc(_php3_hash_num_elements(src_arr) * sizeof(int)))) { +	if(NULL == (collIDs = emalloc(zend_hash_num_elements(src_arr) * sizeof(int)))) {  		efree(objvIDs);  		RETURN_FALSE;  		} -	if(NULL == (docIDs = emalloc(_php3_hash_num_elements(src_arr) * sizeof(int)))) { +	if(NULL == (docIDs = emalloc(zend_hash_num_elements(src_arr) * sizeof(int)))) {  		efree(objvIDs);  		efree(collIDs);  		RETURN_FALSE;  		}  	collIDcount = docIDcount = 0; -	for(i=0; i<_php3_hash_num_elements(src_arr); i++) { +	for(i=0; i<zend_hash_num_elements(src_arr); i++) {  		char *objrec;  		if(objvIDs[i]->type == IS_LONG) {  			if(0 != (ptr->lasterror = send_getobject(ptr->socket, objvIDs[i]->value.lval, &objrec))) { @@ -1417,7 +1417,7 @@ PHP_FUNCTION(hw_gettext) {  	id=argv[1]->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1459,7 +1459,7 @@ PHP_FUNCTION(hw_edittext) {  	/* FIXME id is not set anywhere */  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1468,7 +1468,7 @@ PHP_FUNCTION(hw_edittext) {  	/* FIXME id is not set anywhere */  	if(!docptr || (type!=php3_hw_module.le_document)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1500,7 +1500,7 @@ PHP_FUNCTION(hw_getcgi) {  	id=arg2->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1560,7 +1560,7 @@ PHP_FUNCTION(hw_getremote) {  	id=arg2->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1600,7 +1600,7 @@ PHP_FUNCTION(hw_getremotechildren) {  	objrec=arg2->value.str.val;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d", link); +		php_error(E_WARNING,"Unable to find file identifier %d", link);  		RETURN_FALSE;  	}  	set_swap(ptr->swap_on); @@ -1613,7 +1613,7 @@ PHP_FUNCTION(hw_getremotechildren) {  	if(strncmp(remainder, "ObjectID=0 ", 10)) {  		hw_document *doc;  		remainder[offsets[0]-18] = '\0'; -/*php3_printf("offset = %d, remainder = %s---", offsets[0], remainder);*/ +/*php_printf("offset = %d, remainder = %s---", offsets[0], remainder);*/  		doc = malloc(sizeof(hw_document));  		doc->data = strdup(remainder);  		doc->attributes = strdup(objrec); @@ -1657,7 +1657,7 @@ PHP_FUNCTION(hw_setlinkroot) {  	rootid = arg2->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",link); +		php_error(E_WARNING,"Unable to find file identifier %d",link);  		RETURN_FALSE;  	} @@ -1700,7 +1700,7 @@ PHP_FUNCTION(hw_pipedocument) {  	id=argv[1]->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d", link); +		php_error(E_WARNING,"Unable to find file identifier %d", link);  		RETURN_FALSE;  	} @@ -1760,7 +1760,7 @@ PHP_FUNCTION(hw_pipecgi) {  	id=arg2->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1825,14 +1825,14 @@ PHP_FUNCTION(hw_insertdocument) {  	id=arg2->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find connection identifier %d",link); +		php_error(E_WARNING,"Unable to find connection identifier %d",link);  		RETURN_FALSE;  	}  	doc=arg3->value.lval;  	docptr = php3_list_find(doc,&type);  	if(!docptr || (type!=php3_hw_module.le_document)) { -		php3_error(E_WARNING,"Unable to find document identifier %d",doc); +		php_error(E_WARNING,"Unable to find document identifier %d",doc);  		RETURN_FALSE;  	} @@ -1889,7 +1889,7 @@ PHP_FUNCTION(hw_free_document) {  	id=arg1->value.lval;  	ptr = php3_list_find(id,&type);  	if(!ptr || (type!=php3_hw_module.le_document)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	}  	php3_list_delete(id); @@ -1911,7 +1911,7 @@ PHP_FUNCTION(hw_output_document) {  	id=arg1->value.lval;  	ptr = php3_list_find(id,&type);  	if(!ptr || (type!=php3_hw_module.le_document)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1944,7 +1944,7 @@ PHP_FUNCTION(hw_document_bodytag) {  	id=argv[0]->value.lval;  	ptr = php3_list_find(id,&type);  	if(!ptr || (type!=php3_hw_module.le_document)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1982,7 +1982,7 @@ PHP_FUNCTION(hw_document_content) {  	id=argv[0]->value.lval;  	ptr = php3_list_find(id,&type);  	if(!ptr || (type!=php3_hw_module.le_document)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -2003,7 +2003,7 @@ PHP_FUNCTION(hw_document_size) {  	id=arg1->value.lval;  	ptr = php3_list_find(id,&type);  	if(!ptr || (type!=php3_hw_module.le_document)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -2024,7 +2024,7 @@ PHP_FUNCTION(hw_document_attributes) {  	id=arg1->value.lval;  	ptr = php3_list_find(id,&type);  	if(!ptr || (type!=php3_hw_module.le_document)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -2050,14 +2050,14 @@ PHP_FUNCTION(hw_getparentsobj) {  	id=arg2->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	}  	set_swap(ptr->swap_on);  	if (0 != (ptr->lasterror = send_getparentsobj(ptr->socket, id, &childObjRecs, &count))) { -		php3_error(E_WARNING, "send_command (getparentsobj) returned -1\n"); +		php_error(E_WARNING, "send_command (getparentsobj) returned -1\n");  		RETURN_FALSE;  	} @@ -2083,7 +2083,7 @@ PHP_FUNCTION(hw_getparents) {  	id=arg2->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -2093,7 +2093,7 @@ PHP_FUNCTION(hw_getparents) {  	int i;  	if (0 != (ptr->lasterror = send_getparents(ptr->socket, id, &childIDs, &count))) { -		php3_error(E_WARNING, "send_command (getparents) returned -1\n"); +		php_error(E_WARNING, "send_command (getparents) returned -1\n");  		RETURN_FALSE;  	} @@ -2127,7 +2127,7 @@ PHP_FUNCTION(hw_children) {  	id=arg2->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -2137,7 +2137,7 @@ PHP_FUNCTION(hw_children) {  	int i;  	if (0 != (ptr->lasterror = send_children(ptr->socket, id, &childIDs, &count))){ -		php3_error(E_WARNING, "send_command (getchildcoll) returned -1\n"); +		php_error(E_WARNING, "send_command (getchildcoll) returned -1\n");  		RETURN_FALSE;  	} @@ -2172,14 +2172,14 @@ PHP_FUNCTION(hw_childrenobj) {  	id=arg2->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	}  	set_swap(ptr->swap_on);  	if (0 != (ptr->lasterror = send_childrenobj(ptr->socket, id, &childObjRecs, &count))) { -		php3_error(E_WARNING, "send_command (getchildcollobj) returned -1\n"); +		php_error(E_WARNING, "send_command (getchildcollobj) returned -1\n");  		RETURN_FALSE;  	} @@ -2205,7 +2205,7 @@ PHP_FUNCTION(hw_getchildcoll) {  	id=arg2->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -2215,7 +2215,7 @@ PHP_FUNCTION(hw_getchildcoll) {  	int i;  	if (0 != (ptr->lasterror = send_getchildcoll(ptr->socket, id, &childIDs, &count))){ -		php3_error(E_WARNING, "send_command (getchildcoll) returned -1\n"); +		php_error(E_WARNING, "send_command (getchildcoll) returned -1\n");  		RETURN_FALSE;  	} @@ -2250,14 +2250,14 @@ PHP_FUNCTION(hw_getchildcollobj) {  	id=arg2->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	}  	set_swap(ptr->swap_on);  	if (0 != (ptr->lasterror = send_getchildcollobj(ptr->socket, id, &childObjRecs, &count))) { -		php3_error(E_WARNING, "send_command (getchildcollobj) returned -1\n"); +		php_error(E_WARNING, "send_command (getchildcollobj) returned -1\n");  		RETURN_FALSE;  	} @@ -2282,7 +2282,7 @@ PHP_FUNCTION(hw_docbyanchor) {  	id=arg2->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -2312,7 +2312,7 @@ PHP_FUNCTION(hw_docbyanchorobj) {  	id=arg2->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -2352,13 +2352,13 @@ PHP_FUNCTION(hw_getobjectbyquery) {  	if (maxhits < 0) maxhits=0x7FFFFFFF;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",link); +		php_error(E_WARNING,"Unable to find file identifier %d",link);  		RETURN_FALSE;  	}  	set_swap(ptr->swap_on);  	if (0 != (ptr->lasterror = send_getobjbyquery(ptr->socket, query, maxhits, &childIDs, &count))) { -		php3_error(E_WARNING, "send_command (getchildcoll) returned -1\n"); +		php_error(E_WARNING, "send_command (getchildcoll) returned -1\n");  		RETURN_FALSE;  	} @@ -2394,13 +2394,13 @@ PHP_FUNCTION(hw_getobjectbyqueryobj) {  	if (maxhits < 0) maxhits=0x7FFFFFFF;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",link); +		php_error(E_WARNING,"Unable to find file identifier %d",link);  		RETURN_FALSE;  	}  	set_swap(ptr->swap_on);  	if (0 != (ptr->lasterror = send_getobjbyqueryobj(ptr->socket, query, maxhits, &childObjRecs, &count))) { -		php3_error(E_WARNING, "send_command (getchildcoll) returned -1\n"); +		php_error(E_WARNING, "send_command (getchildcoll) returned -1\n");  		RETURN_FALSE;  	} @@ -2433,13 +2433,13 @@ PHP_FUNCTION(hw_getobjectbyquerycoll) {  	if (maxhits < 0) maxhits=0x7FFFFFFF;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	}  	set_swap(ptr->swap_on);  	if (0 != (ptr->lasterror = send_getobjbyquerycoll(ptr->socket, id, query, maxhits, &childIDs, &count))) { -		php3_error(E_WARNING, "send_command (getchildcoll) returned -1\n"); +		php_error(E_WARNING, "send_command (getchildcoll) returned -1\n");  		RETURN_FALSE;  	} @@ -2477,13 +2477,13 @@ PHP_FUNCTION(hw_getobjectbyquerycollobj) {  	if (maxhits < 0) maxhits=0x7FFFFFFF;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	}  	set_swap(ptr->swap_on);  	if (0 != (ptr->lasterror = send_getobjbyquerycollobj(ptr->socket, id, query, maxhits, &childObjRecs, &count))) { -		php3_error(E_WARNING, "send_command (getchildcoll) returned -1\n"); +		php_error(E_WARNING, "send_command (getchildcoll) returned -1\n");  		RETURN_FALSE;  	} @@ -2510,13 +2510,13 @@ PHP_FUNCTION(hw_getchilddoccoll) {  	id=arg2->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	}  	set_swap(ptr->swap_on);  	if (0 != (ptr->lasterror = send_getchilddoccoll(ptr->socket, id, &childIDs, &count))) { -		php3_error(E_WARNING, "send_command (getchilddoccoll) returned -1\n"); +		php_error(E_WARNING, "send_command (getchilddoccoll) returned -1\n");  		RETURN_FALSE;  	} @@ -2548,13 +2548,13 @@ PHP_FUNCTION(hw_getchilddoccollobj) {  	id=arg2->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	}  	set_swap(ptr->swap_on);  	if (0 != (ptr->lasterror = send_getchilddoccollobj(ptr->socket, id, &childObjRecs, &count))) { -		php3_error(E_WARNING, "send_command (getchilddoccollobj) returned -1\n"); +		php_error(E_WARNING, "send_command (getchilddoccollobj) returned -1\n");  		RETURN_FALSE;  	} @@ -2582,13 +2582,13 @@ PHP_FUNCTION(hw_getanchors) {  	id=arg2->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	}  	set_swap(ptr->swap_on);  	if (0 != (ptr->lasterror = send_getanchors(ptr->socket, id, &anchorIDs, &count))) { -		php3_error(E_WARNING, "send_command (getanchors) returned -1\n"); +		php_error(E_WARNING, "send_command (getanchors) returned -1\n");  		RETURN_FALSE;  	} @@ -2620,13 +2620,13 @@ PHP_FUNCTION(hw_getanchorsobj) {  	id=arg2->value.lval;  	ptr = (hw_connection *) php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	}  	set_swap(ptr->swap_on);  	if (0 != (ptr->lasterror = send_getanchorsobj(ptr->socket, id, &anchorObjRecs, &count))) { -		php3_error(E_WARNING, "send_command (getanchors) returned -1\n"); +		php_error(E_WARNING, "send_command (getanchors) returned -1\n");  		RETURN_FALSE;  	} @@ -2649,7 +2649,7 @@ PHP_FUNCTION(hw_getusername) {  	link = arg1->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",link); +		php_error(E_WARNING,"Unable to find file identifier %d",link);  		RETURN_FALSE;  	} @@ -2678,7 +2678,7 @@ PHP_FUNCTION(hw_identify) {  	passwd=arg3->value.str.val;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",link); +		php_error(E_WARNING,"Unable to find file identifier %d",link);  		RETURN_FALSE;  	} @@ -2687,7 +2687,7 @@ PHP_FUNCTION(hw_identify) {  	char *str;  	if (0 != (ptr->lasterror = send_identify(ptr->socket, name, passwd, &userdata))) { -		php3_error(E_WARNING, "send_identify returned -1\n"); +		php_error(E_WARNING, "send_identify returned -1\n");  		if(ptr->username) free(ptr->username);  		ptr->username = NULL;  		RETURN_FALSE; @@ -2760,19 +2760,19 @@ PHP_FUNCTION(hw_incollections) {  	retcoll=arg4->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",link); +		php_error(E_WARNING,"Unable to find file identifier %d",link);  		RETURN_FALSE;  	} -	cobjids = _php3_hash_num_elements(arg2->value.ht); +	cobjids = zend_hash_num_elements(arg2->value.ht);  	if(NULL == (objectIDs = make_ints_from_array(arg2->value.ht))) { -		php3_error(E_WARNING, "Could not create Int Array from Array\n"); +		php_error(E_WARNING, "Could not create Int Array from Array\n");  		RETURN_FALSE;  	} -	ccollids = _php3_hash_num_elements(arg3->value.ht); +	ccollids = zend_hash_num_elements(arg3->value.ht);  	if(NULL == (collIDs = make_ints_from_array(arg3->value.ht))) { -		php3_error(E_WARNING, "Could not create Int Array from Array\n"); +		php_error(E_WARNING, "Could not create Int Array from Array\n");  		efree(objectIDs);  		RETURN_FALSE;  	} @@ -2820,12 +2820,12 @@ PHP_FUNCTION(hw_inscoll) {  	id=arg2->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",link); +		php_error(E_WARNING,"Unable to find file identifier %d",link);  		RETURN_FALSE;  	}  	if(NULL == (objrec = make_objrec_from_array(arg3->value.ht))) { -		php3_error(E_WARNING, "Could not create Object Record from Array\n"); +		php_error(E_WARNING, "Could not create Object Record from Array\n");  		RETURN_FALSE;  	} @@ -2868,7 +2868,7 @@ PHP_FUNCTION(hw_insdoc) {  	id = argv[1]->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",link); +		php_error(E_WARNING,"Unable to find file identifier %d",link);  		RETURN_FALSE;  	} @@ -2900,13 +2900,13 @@ PHP_FUNCTION(hw_getsrcbydestobj) {  	id=arg2->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",link); +		php_error(E_WARNING,"Unable to find file identifier %d",link);  		RETURN_FALSE;  	}  	set_swap(ptr->swap_on);  	if (0 != (ptr->lasterror = send_getsrcbydest(ptr->socket, id, &childObjRecs, &count))) { -		php3_error(E_WARNING, "send_command (getsrcbydest) returned -1\n"); +		php_error(E_WARNING, "send_command (getsrcbydest) returned -1\n");  		RETURN_FALSE;  	} @@ -2938,13 +2938,13 @@ PHP_FUNCTION(hw_getrellink) {  	destid=arg4->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",link); +		php_error(E_WARNING,"Unable to find file identifier %d",link);  		RETURN_FALSE;  	}  	set_swap(ptr->swap_on);  	if (0 != (ptr->lasterror = getrellink(ptr->socket, rootid, sourceid, destid, &anchorstr))) { -		php3_error(E_WARNING, "command (getrellink) returned -1\n"); +		php_error(E_WARNING, "command (getrellink) returned -1\n");  		RETURN_FALSE;  	} @@ -2955,7 +2955,7 @@ PHP_FUNCTION(hw_getrellink) {  PHP_MINFO_FUNCTION(hw)  { -	php3_printf("HG-CSP Version: 7.17"); +	php_printf("HG-CSP Version: 7.17");  }  PHP_FUNCTION(hw_connection_info) @@ -2971,11 +2971,11 @@ PHP_FUNCTION(hw_connection_info)  	link=arg1->value.lval;  	ptr = php3_list_find(link,&type);  	if(!ptr || (type!=php3_hw_module.le_socketp && type!=php3_hw_module.le_psocketp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",link); +		php_error(E_WARNING,"Unable to find file identifier %d",link);  		RETURN_FALSE;  	} -	php3_printf("Hyperwave Info:\nhost=%s,\nserver string=%s\nversion=%d\nswap=%d\n", ptr->hostname, ptr->server_string, ptr->version, ptr->swap_on); +	php_printf("Hyperwave Info:\nhost=%s,\nserver string=%s\nversion=%d\nswap=%d\n", ptr->hostname, ptr->server_string, ptr->version, ptr->swap_on);  }  void print_msg(hg_msg *msg, char *str, int txt) diff --git a/ext/imap/imap.c b/ext/imap/imap.c index e6a6326a87..0798cebd08 100644 --- a/ext/imap/imap.c +++ b/ext/imap/imap.c @@ -189,7 +189,7 @@ inline int add_assoc_object(pval *arg, char *key, pval *tmp)  	} else {  		symtable = arg->value.ht;  	} -	return _php3_hash_update(symtable, key, strlen(key)+1, (void *) &tmp, sizeof(pval *), NULL); +	return zend_hash_update(symtable, key, strlen(key)+1, (void *) &tmp, sizeof(pval *), NULL);  }  inline int add_next_index_object(pval *arg, pval *tmp) @@ -202,21 +202,21 @@ inline int add_next_index_object(pval *arg, pval *tmp)  		symtable = arg->value.ht;  	} -	return _php3_hash_next_index_insert(symtable, (void *) &tmp, sizeof(pval *), NULL);  +	return zend_hash_next_index_insert(symtable, (void *) &tmp, sizeof(pval *), NULL);   }  PHP_MINFO_FUNCTION(imap)  { -	php3_printf("Imap Support enabled<br>"); -	php3_printf("<table>"); -	php3_printf("<tr><td>Imap c-client Version:</td>"); +	php_printf("Imap Support enabled<br>"); +	php_printf("<table>"); +	php_printf("<tr><td>Imap c-client Version:</td>");  #ifdef IMAP41 -	php3_printf("<td>Imap 4.1</td>"); +	php_printf("<td>Imap 4.1</td>");  #else -	php3_printf("<td>Imap 4.0</td>"); +	php_printf("<td>Imap 4.0</td>");  #endif -	php3_printf("</tr></table>"); +	php_printf("</tr></table>");  }  PHP_MINIT_FUNCTION(imap) @@ -441,7 +441,7 @@ PHP_FUNCTION(imap_open)  		imap_stream = mail_open(imap_stream,mailbox->value.str.val,flags);  		if (imap_stream == NIL){ -			php3_error(E_WARNING,"Couldn't open stream %s\n",mailbox->value.str.val); +			php_error(E_WARNING,"Couldn't open stream %s\n",mailbox->value.str.val);  			RETURN_FALSE;  		}  		/* Note that if we ever come up with a persistent imap stream, the persistent version of this @@ -479,7 +479,7 @@ PHP_FUNCTION(imap_reopen)  	ind = streamind->value.lval;  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	} @@ -495,7 +495,7 @@ PHP_FUNCTION(imap_reopen)  	}  	imap_stream = mail_open(imap_le_struct->imap_stream, mailbox->value.str.val, flags);  	if (imap_stream == NIL) { -		php3_error(E_WARNING,"Couldn't re-open stream\n"); +		php_error(E_WARNING,"Couldn't re-open stream\n");  		RETURN_FALSE;  	}  	RETURN_TRUE; @@ -525,7 +525,7 @@ PHP_FUNCTION(imap_append)  	imap_le_struct = (pils *)php3_list_find( ind, &ind_type );  	if ( !imap_le_struct || ind_type != le_imap ) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	}  	INIT (&st,mail_string,(void *) message->value.str.val,message->value.str.len); @@ -556,7 +556,7 @@ PHP_FUNCTION(imap_num_msg)  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	} @@ -581,7 +581,7 @@ PHP_FUNCTION(imap_ping)  	imap_le_struct = (pils *)php3_list_find( ind, &ind_type );  	if ( !imap_le_struct || ind_type != le_imap ) { -		php3_error( E_WARNING, "Unable to find stream pointer" ); +		php_error( E_WARNING, "Unable to find stream pointer" );  		RETURN_FALSE;  	}  	RETURN_LONG( mail_ping( imap_le_struct->imap_stream ) ); @@ -602,7 +602,7 @@ PHP_FUNCTION(imap_num_recent)  	ind = streamind->value.lval;  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	}  	RETURN_LONG(imap_le_struct->imap_stream->recent); @@ -628,7 +628,7 @@ PHP_FUNCTION(imap_expunge)  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	} @@ -655,7 +655,7 @@ PHP_FUNCTION(imap_close)  	ind = streamind->value.lval;  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;      }  	if(myargcount==2) { @@ -696,7 +696,7 @@ PHP_FUNCTION(imap_headers)  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	} @@ -753,7 +753,7 @@ PHP_FUNCTION(imap_body)  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	}  	RETVAL_STRING(mail_fetchtext_full (imap_le_struct->imap_stream,msgno->value.lval,NIL,myargc == 3 ? flags->value.lval : NIL),1); @@ -780,7 +780,7 @@ PHP_FUNCTION(imap_fetchtext_full)  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	}  	RETVAL_STRING(mail_fetchtext_full (imap_le_struct->imap_stream,msgno->value.lval,NIL,myargcount==3?flags->value.lval:NIL),1); @@ -808,7 +808,7 @@ PHP_FUNCTION(imap_mail_copy)  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	}  	if ( mail_copy_full(imap_le_struct->imap_stream,seq->value.str.val,folder->value.str.val,myargcount == 4 ? options->value.lval : NIL)==T ) { @@ -840,7 +840,7 @@ PHP_FUNCTION(imap_mail_move)  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	}  	if ( mail_move(imap_le_struct->imap_stream,seq->value.str.val,folder->value.str.val)==T ) { @@ -870,7 +870,7 @@ PHP_FUNCTION(imap_createmailbox)  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	}  	if ( mail_create(imap_le_struct->imap_stream,folder->value.str.val)==T ) { @@ -901,7 +901,7 @@ PHP_FUNCTION(imap_renamemailbox)  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	}  	if ( mail_rename(imap_le_struct->imap_stream,old->value.str.val,new->value.str.val)==T ) { @@ -931,7 +931,7 @@ PHP_FUNCTION(imap_deletemailbox)  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	}  	if ( mail_delete(imap_le_struct->imap_stream,folder->value.str.val)==T ) { @@ -964,7 +964,7 @@ PHP_FUNCTION(imap_list)  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	}      imap_folders = NIL; @@ -1004,7 +1004,7 @@ PHP_FUNCTION(imap_listscan)  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	}  	imap_folders = NIL; @@ -1041,7 +1041,7 @@ PHP_FUNCTION(imap_check)  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	} @@ -1081,7 +1081,7 @@ PHP_FUNCTION(imap_delete)  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	} @@ -1109,7 +1109,7 @@ PHP_FUNCTION(imap_undelete)  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	} @@ -1152,7 +1152,7 @@ PHP_FUNCTION(imap_headerinfo)  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	} @@ -1476,7 +1476,7 @@ PHP_FUNCTION(imap_lsub)  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	}  	imap_sfolders = NIL; @@ -1513,7 +1513,7 @@ PHP_FUNCTION(imap_subscribe)  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	}  	if ( mail_subscribe(imap_le_struct->imap_stream,folder->value.str.val)==T ) { @@ -1542,7 +1542,7 @@ PHP_FUNCTION(imap_unsubscribe)  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	}  	if ( mail_unsubscribe(imap_le_struct->imap_stream,folder->value.str.val)==T ) { @@ -1681,14 +1681,14 @@ PHP_FUNCTION(imap_fetchstructure)  	imap_le_struct = (pils *)php3_list_find( ind, &ind_type );  	if ( !imap_le_struct || ind_type != le_imap ) { -		php3_error( E_WARNING, "Unable to find stream pointer" ); +		php_error( E_WARNING, "Unable to find stream pointer" );  		RETURN_FALSE;  	}  	mail_fetchstructure_full( imap_le_struct->imap_stream, msgno->value.lval, &body ,myargc == 3 ? flags->value.lval : NIL);  	if ( !body ) { -		php3_error( E_WARNING, "No body information available" ); +		php_error( E_WARNING, "No body information available" );  		RETURN_FALSE;  	} @@ -1719,14 +1719,14 @@ PHP_FUNCTION(imap_fetchbody)  	imap_le_struct = (pils *)php3_list_find( ind, &ind_type );  	if ( !imap_le_struct || ind_type != le_imap ) { -		php3_error( E_WARNING, "Unable to find stream pointer" ); +		php_error( E_WARNING, "Unable to find stream pointer" );  		RETURN_FALSE;  	}  	body = mail_fetchbody_full( imap_le_struct->imap_stream, msgno->value.lval, sec->value.str.val, &len,myargc == 4 ? flags->value.lval : NIL );  	if ( !body ) { -		php3_error( E_WARNING, "No body information available" ); +		php_error( E_WARNING, "No body information available" );  		RETURN_FALSE;  	}  	RETVAL_STRINGL( body ,len,1); @@ -1826,7 +1826,7 @@ PHP_FUNCTION(imap_mailboxmsginfo)  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if(!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	} @@ -1940,7 +1940,7 @@ PHP_FUNCTION(imap_setflag_full)  	ind = streamind->value.lval;  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if(!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	}  	mail_setflag_full(imap_le_struct->imap_stream,sequence->value.str.val,flag->value.str.val,myargc == 4 ? flags->value.lval : NIL); @@ -1969,7 +1969,7 @@ PHP_FUNCTION(imap_clearflag_full)  	ind = streamind->value.lval;  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if(!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	}  	mail_clearflag_full(imap_le_struct->imap_stream,sequence->value.str.val,flag->value.str.val,myargc == 4 ? flags->value.lval : NIL); @@ -1997,7 +1997,7 @@ PHP_FUNCTION(imap_sort)  	convert_to_long(rev);  	convert_to_long(pgm);  	if(pgm->value.lval>SORTSIZE) { -		php3_error(E_WARNING, "Unrecognized sort criteria"); +		php_error(E_WARNING, "Unrecognized sort criteria");  		RETURN_FALSE;  	}  	if(myargc==4) convert_to_long(flags); @@ -2005,7 +2005,7 @@ PHP_FUNCTION(imap_sort)  	ind = streamind->value.lval;  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if(!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	}  	spg = mail_newsearchpgm(); @@ -2045,7 +2045,7 @@ PHP_FUNCTION(imap_fetchheader)  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	}  	RETVAL_STRING(mail_fetchheader_full (imap_le_struct->imap_stream,msgno->value.lval,NIL,NIL,myargc == 3 ? flags->value.lval : NIL),1); @@ -2073,7 +2073,7 @@ PHP_FUNCTION(imap_uid)  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -	php3_error(E_WARNING, "Unable to find stream pointer"); +	php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	} @@ -2101,7 +2101,7 @@ PHP_FUNCTION(imap_msgno)  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	} @@ -2129,7 +2129,7 @@ PHP_FUNCTION(imap_status)  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	} @@ -2176,7 +2176,7 @@ PHP_FUNCTION(imap_bodystruct)  	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	} @@ -2280,7 +2280,7 @@ PHP_FUNCTION(imap_fetch_overview)   	imap_le_struct = (pils *)php3_list_find(ind, &ind_type);  	if (!imap_le_struct || ind_type != le_imap) { -		php3_error(E_WARNING, "Unable to find stream pointer"); +		php_error(E_WARNING, "Unable to find stream pointer");  		RETURN_FALSE;  	}  	array_init(return_value); @@ -2339,105 +2339,105 @@ PHP_FUNCTION(imap_mail_compose)  	convert_to_array(envelope);  	convert_to_array(body);  	env=mail_newenvelope(); -	if(_php3_hash_find(envelope->value.ht,"remail",sizeof("remail"),(void **) &pvalue)== SUCCESS){ +	if(zend_hash_find(envelope->value.ht,"remail",sizeof("remail"),(void **) &pvalue)== SUCCESS){  		SEPARATE_ZVAL(pvalue);  		convert_to_string(*pvalue);  		env->remail=cpystr((*pvalue)->value.str.val);  	} -	if(_php3_hash_find(envelope->value.ht,"return_path",sizeof("return_path"),(void **) &pvalue)== SUCCESS){ +	if(zend_hash_find(envelope->value.ht,"return_path",sizeof("return_path"),(void **) &pvalue)== SUCCESS){  		SEPARATE_ZVAL(pvalue);  		convert_to_string(*pvalue);  		rfc822_parse_adrlist (&env->return_path,(*pvalue)->value.str.val,"NO HOST");  	} -	if(_php3_hash_find(envelope->value.ht,"date",sizeof("date"),(void **) &pvalue)== SUCCESS){ +	if(zend_hash_find(envelope->value.ht,"date",sizeof("date"),(void **) &pvalue)== SUCCESS){  		SEPARATE_ZVAL(pvalue);  		convert_to_string(*pvalue);  		env->date=cpystr((*pvalue)->value.str.val);  	} -	if(_php3_hash_find(envelope->value.ht,"from",sizeof("from"),(void **) &pvalue)== SUCCESS){ +	if(zend_hash_find(envelope->value.ht,"from",sizeof("from"),(void **) &pvalue)== SUCCESS){  		SEPARATE_ZVAL(pvalue);  		convert_to_string(*pvalue);  		rfc822_parse_adrlist (&env->from,(*pvalue)->value.str.val,"NO HOST");  	} -	if(_php3_hash_find(envelope->value.ht,"reply_to",sizeof("reply_to"),(void **) &pvalue)== SUCCESS){ +	if(zend_hash_find(envelope->value.ht,"reply_to",sizeof("reply_to"),(void **) &pvalue)== SUCCESS){  		SEPARATE_ZVAL(pvalue);  		convert_to_string(pvalue);  		rfc822_parse_adrlist (&env->reply_to,(*pvalue)->value.str.val,"NO HOST");  	} -	if(_php3_hash_find(envelope->value.ht,"to",sizeof("to"),(void **) &pvalue)== SUCCESS){ +	if(zend_hash_find(envelope->value.ht,"to",sizeof("to"),(void **) &pvalue)== SUCCESS){  		SEPARATE_ZVAL(pvalue);  		convert_to_string(*pvalue);  		rfc822_parse_adrlist (&env->to,(*pvalue)->value.str.val,"NO HOST");  	} -	if(_php3_hash_find(envelope->value.ht,"cc",sizeof("cc"),(void **) &pvalue)== SUCCESS){ +	if(zend_hash_find(envelope->value.ht,"cc",sizeof("cc"),(void **) &pvalue)== SUCCESS){  		SEPARATE_ZVAL(pvalue);  		convert_to_string(*pvalue);  		rfc822_parse_adrlist (&env->cc,(*pvalue)->value.str.val,"NO HOST");  	} -	if(_php3_hash_find(envelope->value.ht,"bcc",sizeof("bcc"),(void **) &pvalue)== SUCCESS){ +	if(zend_hash_find(envelope->value.ht,"bcc",sizeof("bcc"),(void **) &pvalue)== SUCCESS){  		SEPARATE_ZVAL(pvalue);  		convert_to_string(*pvalue);  		rfc822_parse_adrlist (&env->bcc,(*pvalue)->value.str.val,"NO HOST");  	} -	if(_php3_hash_find(envelope->value.ht,"message_id",sizeof("message_id"),(void **) &pvalue)== SUCCESS){ +	if(zend_hash_find(envelope->value.ht,"message_id",sizeof("message_id"),(void **) &pvalue)== SUCCESS){  		SEPARATE_ZVAL(pvalue);  		convert_to_string(*pvalue);  		env->message_id=cpystr((*pvalue)->value.str.val);  	} -	_php3_hash_internal_pointer_reset(body->value.ht); -	_php3_hash_get_current_key(body->value.ht, &key, &ind); -	_php3_hash_get_current_data(body->value.ht, (void **) &data); +	zend_hash_internal_pointer_reset(body->value.ht); +	zend_hash_get_current_key(body->value.ht, &key, &ind); +	zend_hash_get_current_data(body->value.ht, (void **) &data);  	if(data->type == IS_ARRAY) {  		bod=mail_newbody();  		topbod=bod; -		if(_php3_hash_find(data->value.ht,"type",sizeof("type"),(void **) &pvalue)== SUCCESS) { +		if(zend_hash_find(data->value.ht,"type",sizeof("type"),(void **) &pvalue)== SUCCESS) {  			SEPARATE_ZVAL(pvalue);  			convert_to_long(*pvalue);  			bod->type = (*pvalue)->value.lval;  		} -		if(_php3_hash_find(data->value.ht,"encoding",sizeof("encoding"),(void **) &pvalue)== SUCCESS){ +		if(zend_hash_find(data->value.ht,"encoding",sizeof("encoding"),(void **) &pvalue)== SUCCESS){  			SEPARATE_ZVAL(pvalue);  			convert_to_long(*pvalue);  			bod->encoding = (*pvalue)->value.lval;  		} -		if(_php3_hash_find(data->value.ht,"subtype",sizeof("subtype"),(void **) &pvalue)== SUCCESS){ +		if(zend_hash_find(data->value.ht,"subtype",sizeof("subtype"),(void **) &pvalue)== SUCCESS){  			SEPARATE_ZVAL(pvalue);  			convert_to_string(*pvalue);  			bod->subtype = cpystr((*pvalue)->value.str.val);  		} -		if(_php3_hash_find(data->value.ht,"id",sizeof("id"),(void **) &pvalue)== SUCCESS){ +		if(zend_hash_find(data->value.ht,"id",sizeof("id"),(void **) &pvalue)== SUCCESS){  			SEPARATE_ZVAL(pvalue);  			convert_to_string(*pvalue);  			bod->id = cpystr((*pvalue)->value.str.val);  		} -		if(_php3_hash_find(data->value.ht,"contents.data",sizeof("contents.data"),(void **) &pvalue)== SUCCESS){ +		if(zend_hash_find(data->value.ht,"contents.data",sizeof("contents.data"),(void **) &pvalue)== SUCCESS){  			SEPARATE_ZVAL(pvalue);  			convert_to_string(*pvalue);       			bod->contents.text.data=(char *)fs_get((*pvalue)->value.str.len);  			memcpy(bod->contents.text.data,(*pvalue)->value.str.val,(*pvalue)->value.str.len+1);  			bod->contents.text.size = (*pvalue)->value.str.len;  		} -		if(_php3_hash_find(data->value.ht,"lines",sizeof("lines"),(void **) &pvalue)== SUCCESS){ +		if(zend_hash_find(data->value.ht,"lines",sizeof("lines"),(void **) &pvalue)== SUCCESS){  			SEPARATE_ZVAL(pvalue);  			convert_to_long(*pvalue);  			bod->size.lines = (*pvalue)->value.lval;  		} -		if(_php3_hash_find(data->value.ht,"bytes",sizeof("bytes"),(void **) &pvalue)== SUCCESS){ +		if(zend_hash_find(data->value.ht,"bytes",sizeof("bytes"),(void **) &pvalue)== SUCCESS){  			SEPARATE_ZVAL(pvalue);  			convert_to_long(*pvalue);  			bod->size.bytes = (*pvalue)->value.lval;  		} -		if(_php3_hash_find(data->value.ht,"md5",sizeof("md5"),(void **) &pvalue)== SUCCESS){ +		if(zend_hash_find(data->value.ht,"md5",sizeof("md5"),(void **) &pvalue)== SUCCESS){  			SEPARATE_ZVAL(pvalue);  			convert_to_string(*pvalue);  			bod->md5 = cpystr((*pvalue)->value.str.val);  		}  	} -	_php3_hash_move_forward(body->value.ht); -	while(_php3_hash_get_current_data(body->value.ht, (void **) &data)==SUCCESS) { -		_php3_hash_get_current_key(body->value.ht, &key, &ind); +	zend_hash_move_forward(body->value.ht); +	while(zend_hash_get_current_data(body->value.ht, (void **) &data)==SUCCESS) { +		zend_hash_get_current_key(body->value.ht, &key, &ind);  		if(data->type == IS_ARRAY) {  			if(!toppart) {  				bod->nested.part=mail_newbody_part(); @@ -2449,49 +2449,49 @@ PHP_FUNCTION(imap_mail_compose)  				 mypart=mypart->next;  				 bod=&mypart->body;  			} -			if(_php3_hash_find(data->value.ht,"type",sizeof("type"),(void **) &pvalue)== SUCCESS) { +			if(zend_hash_find(data->value.ht,"type",sizeof("type"),(void **) &pvalue)== SUCCESS) {  				SEPARATE_ZVAL(pvalue);  				convert_to_long(pvalue);  				bod->type = (*pvalue)->value.lval;  			} -			if(_php3_hash_find(data->value.ht,"encoding",sizeof("encoding"),(void **) &pvalue)== SUCCESS){ +			if(zend_hash_find(data->value.ht,"encoding",sizeof("encoding"),(void **) &pvalue)== SUCCESS){  				SEPARATE_ZVAL(pvalue);  				convert_to_long(*pvalue);  				bod->encoding = (*pvalue)->value.lval;  			} -			if(_php3_hash_find(data->value.ht,"subtype",sizeof("subtype"),(void **) &pvalue)== SUCCESS){ +			if(zend_hash_find(data->value.ht,"subtype",sizeof("subtype"),(void **) &pvalue)== SUCCESS){  				SEPARATE_ZVAL(pvalue);  				convert_to_string(*pvalue);  				bod->subtype=cpystr((*pvalue)->value.str.val);  			} -			if(_php3_hash_find(data->value.ht,"id",sizeof("id"),(void **) &pvalue)== SUCCESS){ +			if(zend_hash_find(data->value.ht,"id",sizeof("id"),(void **) &pvalue)== SUCCESS){  				SEPARATE_ZVAL(pvalue);  				convert_to_string(*pvalue);  				bod->id=cpystr((*pvalue)->value.str.val);  			} -			if(_php3_hash_find(data->value.ht,"contents.data",sizeof("contents.data"),(void **) &pvalue)== SUCCESS){ +			if(zend_hash_find(data->value.ht,"contents.data",sizeof("contents.data"),(void **) &pvalue)== SUCCESS){  				SEPARATE_ZVAL(pvalue);  				convert_to_string(*pvalue);       				bod->contents.text.data=(char *)fs_get((*pvalue)->value.str.len);  				memcpy(bod->contents.text.data,(*pvalue)->value.str.val,(*pvalue)->value.str.len+1);  				bod->contents.text.size=(*pvalue)->value.str.len;  			} -			if(_php3_hash_find(data->value.ht,"lines",sizeof("lines"),(void **) &pvalue)== SUCCESS){ +			if(zend_hash_find(data->value.ht,"lines",sizeof("lines"),(void **) &pvalue)== SUCCESS){  				SEPARATE_ZVAL(pvalue);  				convert_to_long(*pvalue);  				bod->size.lines=(*pvalue)->value.lval;  			} -			if(_php3_hash_find(data->value.ht,"bytes",sizeof("bytes"),(void **) &pvalue)== SUCCESS){ +			if(zend_hash_find(data->value.ht,"bytes",sizeof("bytes"),(void **) &pvalue)== SUCCESS){  				SEPARATE_ZVAL(pvalue);  				convert_to_long(*pvalue);  				bod->size.bytes=(*pvalue)->value.lval;  			} -			if(_php3_hash_find(data->value.ht,"md5",sizeof("md5"),(void **) &pvalue)== SUCCESS){ +			if(zend_hash_find(data->value.ht,"md5",sizeof("md5"),(void **) &pvalue)== SUCCESS){  				SEPARATE_ZVAL(pvalue);  				convert_to_string(*pvalue);  				bod->md5=cpystr((*pvalue)->value.str.val);  			} -			_php3_hash_move_forward(body->value.ht); +			zend_hash_move_forward(body->value.ht);  		}  	} @@ -2641,21 +2641,21 @@ void mm_log (char *string,long errflg)  {  	switch ((short) errflg) {  	case NIL: -		/* php3_error(E_NOTICE,string); messages */ +		/* php_error(E_NOTICE,string); messages */  		break;  	case PARSE:  	case WARN: -		php3_error(E_WARNING,string); /* warnings */ +		php_error(E_WARNING,string); /* warnings */  		break;  	case ERROR: -		php3_error(E_NOTICE,string);   /* errors */ +		php_error(E_NOTICE,string);   /* errors */  		break;  	}  }  void mm_dlog (char *string)  { -	php3_error(E_NOTICE,string); +	php_error(E_NOTICE,string);  }  void mm_login (NETMBX *mb,char *user,char *pwd,long trial) diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c index d5361840ba..78f3f858a7 100644 --- a/ext/interbase/interbase.c +++ b/ext/interbase/interbase.c @@ -241,7 +241,7 @@ static int _php_ibase_attach_db(char *server, char *uname, int uname_len, char *  	isc_attach_database(status, strlen(server), server, db, db_parbuf_len, dpb);  	if (status[0] == 1 && status[1]) { -		php3_error(E_WARNING,"Unable to connect to InterBase server:  %s", "XXX"); +		php_error(E_WARNING,"Unable to connect to InterBase server:  %s", "XXX");  		return 1;  	}  	return 0; @@ -322,16 +322,16 @@ static void _php3_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)  	if (persistent) {  		list_entry *le; -		if (_php3_hash_find(plist, hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) { +		if (zend_hash_find(plist, hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) {  			list_entry new_le;  			if (IBASE_GLOBAL(php3_ibase_module).max_links!=-1 && IBASE_GLOBAL(php3_ibase_module).num_links>=IBASE_GLOBAL(php3_ibase_module).max_links) { -				php3_error(E_WARNING,"InterBase: Too many open links (%d)", IBASE_GLOBAL(php3_ibase_module).num_links); +				php_error(E_WARNING,"InterBase: Too many open links (%d)", IBASE_GLOBAL(php3_ibase_module).num_links);  				efree(hashed_details);  				RETURN_FALSE;  			}  			if (IBASE_GLOBAL(php3_ibase_module).max_persistent!=-1 && IBASE_GLOBAL(php3_ibase_module).num_persistent>=IBASE_GLOBAL(php3_ibase_module).max_persistent) { -				php3_error(E_WARNING,"InterBase: Too many open persistent links (%d)", IBASE_GLOBAL(php3_ibase_module).num_persistent); +				php_error(E_WARNING,"InterBase: Too many open persistent links (%d)", IBASE_GLOBAL(php3_ibase_module).num_persistent);  				efree(hashed_details);  				RETURN_FALSE;  			} @@ -346,7 +346,7 @@ static void _php3_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)  			/* hash it up */  			new_le.type = php3_ibase_module.le_plink;  			new_le.ptr = db_handle; -			if (_php3_hash_update(plist, hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry), NULL)==FAILURE) { +			if (zend_hash_update(plist, hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry), NULL)==FAILURE) {  				efree(hashed_details);  				RETURN_FALSE;  			} @@ -370,7 +370,7 @@ static void _php3_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)  		 * if it doesn't, open a new pgsql link, add it to the resource list,  		 * and add a pointer to it with hashed_details as the key.  		 */ -		if (_php3_hash_find(list,hashed_details,hashed_details_length+1,(void **) &index_ptr)==SUCCESS) { +		if (zend_hash_find(list,hashed_details,hashed_details_length+1,(void **) &index_ptr)==SUCCESS) {  			int type,link;  			void *ptr; @@ -385,11 +385,11 @@ static void _php3_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)  				efree(hashed_details);  				return;  			} else { -				_php3_hash_del(list,hashed_details,hashed_details_length+1); +				zend_hash_del(list,hashed_details,hashed_details_length+1);  			}  		}  		if (IBASE_GLOBAL(php3_ibase_module).max_links!=-1 && IBASE_GLOBAL(php3_ibase_module).num_links>=IBASE_GLOBAL(php3_ibase_module).max_links) { -			php3_error(E_WARNING,"InterBase:  Too many open links (%d)", IBASE_GLOBAL(php3_ibase_module).num_links); +			php_error(E_WARNING,"InterBase:  Too many open links (%d)", IBASE_GLOBAL(php3_ibase_module).num_links);  			efree(hashed_details);  			RETURN_FALSE;  		} @@ -407,7 +407,7 @@ static void _php3_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)  		/* add it to the hash */  		new_index_ptr.ptr = (void *) return_value->value.lval;  		new_index_ptr.type = le_index_ptr; -		if (_php3_hash_update(list,hashed_details,hashed_details_length+1,(void *) &new_index_ptr, sizeof(list_entry), NULL)==FAILURE) { +		if (zend_hash_update(list,hashed_details,hashed_details_length+1,(void *) &new_index_ptr, sizeof(list_entry), NULL)==FAILURE) {  			efree(hashed_details);  			RETURN_FALSE;  		} @@ -461,7 +461,7 @@ PHP_FUNCTION(ibase_close)  	db_handle = (isc_db_handle) php3_list_find(id, &type);  	if (type!=IBASE_GLOBAL(php3_ibase_module).le_link && type!=IBASE_GLOBAL(php3_ibase_module).le_plink) { -		php3_error(E_WARNING, "%d is not an InterBase link index",id); +		php_error(E_WARNING, "%d is not an InterBase link index",id);  		RETURN_FALSE;  	} @@ -481,12 +481,12 @@ static XSQLDA *_php3_ibase_prepare(isc_db_handle db, isc_tr_handle tr, isc_stmt_      isqlda->version = SQLDA_VERSION1;  	if (isc_dsql_allocate_statement(status, &db, query_handle)) { -		php3_error(E_WARNING, "InterBase: couldn't allocate space for query"); +		php_error(E_WARNING, "InterBase: couldn't allocate space for query");  		return NULL;  	}  	if (isc_dsql_prepare(status, &tr, query_handle, 0, query, 1, isqlda)) { -		php3_error(E_WARNING, "InterBase: couldn't prepare query"); +		php_error(E_WARNING, "InterBase: couldn't prepare query");  		return NULL;  	} @@ -497,7 +497,7 @@ static XSQLDA *_php3_ibase_prepare(isc_db_handle db, isc_tr_handle tr, isc_stmt_  	if (isc_dsql_describe_bind(status, query_handle, 1, isqlda)) { -		php3_error(E_WARNING, "InterBase: couldn't describe placeholders in query"); +		php_error(E_WARNING, "InterBase: couldn't describe placeholders in query");  	}  	if (isqlda->sqld > 1) { @@ -505,7 +505,7 @@ static XSQLDA *_php3_ibase_prepare(isc_db_handle db, isc_tr_handle tr, isc_stmt_  		isqlda->sqln = isqlda->sqld;  		isqlda->version = SQLDA_VERSION1;  		if (isc_dsql_describe(status, query_handle, 1, isqlda)) { -			php3_error(E_WARNING, "InterBase: couldn't describe query"); +			php_error(E_WARNING, "InterBase: couldn't describe query");  		}  		return isqlda;  	} else if (isqlda->sqld == 1) { @@ -546,7 +546,7 @@ static XSQLDA *_php3_ibase_execute(isc_tr_handle tr_handle, isc_stmt_handle quer  		osqlda->version = SQLDA_VERSION1;  		if (isc_dsql_describe(status, &query_handle, 1, osqlda)) { -			php3_error(E_WARNING, "InterBase: couldn't describe query"); +			php_error(E_WARNING, "InterBase: couldn't describe query");  		}  		if (osqlda->sqld) { @@ -554,7 +554,7 @@ static XSQLDA *_php3_ibase_execute(isc_tr_handle tr_handle, isc_stmt_handle quer  			osqlda->sqln = osqlda->sqld;  			osqlda->version = SQLDA_VERSION1;  			if (isc_dsql_describe(status, &query_handle, 1, osqlda)) { -				php3_error(E_WARNING, "InterBase: couldn't describe query"); +				php_error(E_WARNING, "InterBase: couldn't describe query");  			}  		}  		for (i = 0; i < osqlda->sqld; i++) { @@ -593,7 +593,7 @@ static XSQLDA *_php3_ibase_execute(isc_tr_handle tr_handle, isc_stmt_handle quer  		}  		if (isqlda == NULL) {  			if (isc_dsql_execute(status, &tr_handle, &query_handle, 1, NULL)) { -				php3_error(E_WARNING, "InterBase: couldn't execute query"); +				php_error(E_WARNING, "InterBase: couldn't execute query");  				return NULL;  			} else {  				return osqlda; @@ -601,7 +601,7 @@ static XSQLDA *_php3_ibase_execute(isc_tr_handle tr_handle, isc_stmt_handle quer  		} else {  			if (isc_dsql_execute2(status, &tr_handle, &query_handle, 1, isqlda, osqlda)) { -				php3_error(E_WARNING, "InterBase: couldn't execute query"); +				php_error(E_WARNING, "InterBase: couldn't execute query");  				return NULL;  			} else {  				return osqlda; @@ -611,7 +611,7 @@ static XSQLDA *_php3_ibase_execute(isc_tr_handle tr_handle, isc_stmt_handle quer  	} else {  		/* Not select */  		if (isc_dsql_execute(status, &tr_handle, &query_handle, 1, isqlda)) { -			php3_error(E_WARNING, "InterBase: couldn't execute query"); +			php_error(E_WARNING, "InterBase: couldn't execute query");  		}  		/*  		if (!php3_ibase_module.manualtransactions) { @@ -663,7 +663,7 @@ PHP_FUNCTION(ibase_query)  	db_handle = (isc_db_handle) php3_list_find(id, &type);  	if (type!=IBASE_GLOBAL(php3_ibase_module).le_link && type!=IBASE_GLOBAL(php3_ibase_module).le_plink) { -		php3_error(E_WARNING, "%d is not an InterBase link index", id); +		php_error(E_WARNING, "%d is not an InterBase link index", id);  		RETURN_FALSE;  	} @@ -671,7 +671,7 @@ PHP_FUNCTION(ibase_query)  	if (!IBASE_GLOBAL(php3_ibase_module).manualtransactions) {  		if (isc_start_transaction(status, &tr_handle, 1, &db_handle, 0, NULL)) { -			php3_error(E_WARNING, "InterBase: couldn't start transaction"); +			php_error(E_WARNING, "InterBase: couldn't start transaction");  			RETURN_FALSE;  		}  	} @@ -680,7 +680,7 @@ PHP_FUNCTION(ibase_query)  	if (isqlda != NULL) {  		isc_rollback_transaction(status, &tr_handle);  		isc_dsql_free_statement(status, &query_handle, DSQL_drop); -		php3_error(E_WARNING, "InterBase: ibase_query doesn't support parameter placeholders in query"); +		php_error(E_WARNING, "InterBase: ibase_query doesn't support parameter placeholders in query");  		RETURN_FALSE;  	} @@ -740,12 +740,12 @@ PHP_FUNCTION(ibase_fetch_row)  	ibase_result = (ibase_result_handle *) php3_list_find(result->value.lval, &type);  	if (type!=IBASE_GLOBAL(php3_ibase_module).le_result) { -		php3_error(E_WARNING,"%d is not an InterBase result index", result->value.lval); +		php_error(E_WARNING,"%d is not an InterBase result index", result->value.lval);  		RETURN_FALSE;  	}  	if (ibase_result->sqlda == NULL) { -		php3_error(E_WARNING,"InterBase: trying to fetch results from a non-select query"); +		php_error(E_WARNING,"InterBase: trying to fetch results from a non-select query");  		RETURN_FALSE;  	} @@ -762,7 +762,7 @@ PHP_FUNCTION(ibase_fetch_row)  			if (*var[i].sqlind < 0) {  				/* XXX. Column is NULL. This is not the best idea to do, think something... */  				add_get_index_stringl(return_value, i, NULL, 0, (void **) &pval_ptr, 1); -				_php3_hash_pointer_update(return_value->value.ht, fieldname, var[i].sqlname_length+1, pval_ptr); +				zend_hash_pointer_update(return_value->value.ht, fieldname, var[i].sqlname_length+1, pval_ptr);  				continue;  			}  			coltype = var[i].sqltype & ~1; @@ -779,7 +779,7 @@ PHP_FUNCTION(ibase_fetch_row)  						} else {  							add_get_index_stringl(return_value, i, char_data, collen, (void **) &pval_ptr, 1);  						} -						_php3_hash_pointer_update(return_value->value.ht, fieldname, var[i].sqlname_length+1, pval_ptr); +						zend_hash_pointer_update(return_value->value.ht, fieldname, var[i].sqlname_length+1, pval_ptr);  						efree(char_data);  					}  					break; @@ -795,14 +795,14 @@ PHP_FUNCTION(ibase_fetch_row)  						} else {  							add_get_index_stringl(return_value, i, char_data, collen, (void **) &pval_ptr, 1);  						} -						_php3_hash_pointer_update(return_value->value.ht, fieldname, var[i].sqlname_length+1, pval_ptr); +						zend_hash_pointer_update(return_value->value.ht, fieldname, var[i].sqlname_length+1, pval_ptr);  						efree(char_data);  					}  					break;  				case SQL_SHORT:  					collen = sprintf(string_data, "%d", *(short *)(var[i].sqldata));  					add_get_index_stringl(return_value, i, string_data, collen, (void **) &pval_ptr, 1); -					_php3_hash_pointer_update(return_value->value.ht, fieldname, var[i].sqlname_length+1, pval_ptr); +					zend_hash_pointer_update(return_value->value.ht, fieldname, var[i].sqlname_length+1, pval_ptr);  					break;  				case SQL_LONG:  					if (var[i].sqlscale) { @@ -818,12 +818,12 @@ PHP_FUNCTION(ibase_fetch_row)  						collen = sprintf(string_data, "%ld", *(long *)(var[i].sqldata));  					}  					add_get_index_stringl(return_value, i, string_data, collen, (void **) &pval_ptr, 1); -					_php3_hash_pointer_update(return_value->value.ht, fieldname, var[i].sqlname_length+1, pval_ptr); +					zend_hash_pointer_update(return_value->value.ht, fieldname, var[i].sqlname_length+1, pval_ptr);  					break;  				case SQL_FLOAT:  					collen = sprintf(string_data, "%f", *(float *)(var[i].sqldata));  					add_get_index_stringl(return_value, i, string_data, collen, (void **) &pval_ptr, 1); -					_php3_hash_pointer_update(return_value->value.ht, fieldname, var[i].sqlname_length+1, pval_ptr); +					zend_hash_pointer_update(return_value->value.ht, fieldname, var[i].sqlname_length+1, pval_ptr);  					break;  				case SQL_DOUBLE:  					if (ibase_result->sqlda->sqlvar[i].sqlscale) { @@ -832,7 +832,7 @@ PHP_FUNCTION(ibase_fetch_row)  						collen = sprintf(string_data, "%f", *(double *)(var[i].sqldata));  					}  					add_get_index_stringl(return_value, i, string_data, collen, (void **) &pval_ptr, 1); -					_php3_hash_pointer_update(return_value->value.ht, fieldname, var[i].sqlname_length+1, pval_ptr); +					zend_hash_pointer_update(return_value->value.ht, fieldname, var[i].sqlname_length+1, pval_ptr);  					break;  				case SQL_DATE: {  					struct tm *t; @@ -847,7 +847,7 @@ PHP_FUNCTION(ibase_fetch_row)  					collen = sprintf(string_data, "%4d-%02d-%02d %02d:%02d:%02d", t->tm_year+1900, t->tm_mon+1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);  					/* #endif */  					add_get_index_stringl(return_value, i, string_data, collen, (void **) &pval_ptr, 1); -					_php3_hash_pointer_update(return_value->value.ht, fieldname, var[i].sqlname_length+1, pval_ptr); +					zend_hash_pointer_update(return_value->value.ht, fieldname, var[i].sqlname_length+1, pval_ptr);  					efree(t);  					}  					break; @@ -859,7 +859,7 @@ PHP_FUNCTION(ibase_fetch_row)  						bid = *(ISC_QUAD ISC_FAR *) var[i].sqldata;  						sprintf(string_data, "%lx:%lx", bid.isc_quad_high, bid.isc_quad_low);  						add_get_index_stringl(return_value, i, string_data, collen, (void **) &pval_ptr, 1); -						_php3_hash_pointer_update(return_value->value.ht, fieldname, var[i].sqlname_length+1, pval_ptr); +						zend_hash_pointer_update(return_value->value.ht, fieldname, var[i].sqlname_length+1, pval_ptr);  					}  					break;  				default: @@ -893,7 +893,7 @@ PHP_FUNCTION(ibase_free_result)  	ibase_result = (ibase_result_handle *) php3_list_find(result->value.lval,&type);  	if (type!=IBASE_GLOBAL(php3_ibase_module).le_result) { -		php3_error(E_WARNING,"%d is not an InterBase result index",result->value.lval); +		php_error(E_WARNING,"%d is not an InterBase result index",result->value.lval);  		RETURN_FALSE;  	}  	php3_list_delete(result->value.lval); @@ -936,7 +936,7 @@ PHP_FUNCTION(ibase_prepare)  	db_handle = (isc_db_handle) php3_list_find(id, &type);  	if (type!=IBASE_GLOBAL(php3_ibase_module).le_link && type!=IBASE_GLOBAL(php3_ibase_module).le_plink) { -		php3_error(E_WARNING, "%d is not an InterBase link index", id); +		php_error(E_WARNING, "%d is not an InterBase link index", id);  		RETURN_FALSE;  	} @@ -944,7 +944,7 @@ PHP_FUNCTION(ibase_prepare)  	if (!IBASE_GLOBAL(php3_ibase_module).manualtransactions) {  		if (isc_start_transaction(status, &tr_handle, 1, &db_handle, 0, NULL)) { -			php3_error(E_WARNING, "InterBase: couldn't start transaction"); +			php_error(E_WARNING, "InterBase: couldn't start transaction");  			RETURN_FALSE;  		}  	} @@ -981,12 +981,12 @@ PHP_FUNCTION(ibase_bind)  	ibase_query = (ibase_query_handle *) php3_list_find(query->value.lval,&type);  	if (type!=IBASE_GLOBAL(php3_ibase_module).le_query) { -		php3_error(E_WARNING,"%d is not an InterBase query index",query->value.lval); +		php_error(E_WARNING,"%d is not an InterBase query index",query->value.lval);  		RETURN_FALSE;  	}  	if (ibase_query->sqlda == NULL) { -		php3_error(E_WARNING,"InterBase: trying to bind a query having no parameter placeholders"); +		php_error(E_WARNING,"InterBase: trying to bind a query having no parameter placeholders");  		RETURN_FALSE;  	} @@ -1044,7 +1044,7 @@ PHP_FUNCTION(ibase_execute)  	ibase_query = (ibase_query_handle *) php3_list_find(query->value.lval,&type);  	if (type!=IBASE_GLOBAL(php3_ibase_module).le_query) { -		php3_error(E_WARNING,"%d is not an InterBase query index", query->value.lval); +		php_error(E_WARNING,"%d is not an InterBase query index", query->value.lval);  		RETURN_FALSE;  	} @@ -1078,7 +1078,7 @@ PHP_FUNCTION(ibase_free_query)  	ibase_query = (ibase_query_handle *) php3_list_find(query->value.lval, &type);  	if (type!=IBASE_GLOBAL(php3_ibase_module).le_query) { -		php3_error(E_WARNING,"%d is not an InterBase query index", query->value.lval); +		php_error(E_WARNING,"%d is not an InterBase query index", query->value.lval);  		RETURN_FALSE;  	}  	php3_list_delete(query->value.lval); @@ -1101,7 +1101,7 @@ PHP_FUNCTION(ibase_timefmt)  	RETURN_TRUE;  #else -	php3_error(E_WARNING,"InterBase: ibase_timefmt not supported on this platform"); +	php_error(E_WARNING,"InterBase: ibase_timefmt not supported on this platform");  	RETURN_FALSE;  #endif  } diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 60463ca8ea..22664840ab 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -161,7 +161,7 @@ static void _close_ldap_link(LDAP *ld)  {  	LDAP_TLS_VARS;    	ldap_unbind_s(ld); -	/* php3_printf("Freeing ldap connection");*/ +	/* php_printf("Freeing ldap connection");*/  	LDAP_GLOBAL(num_links)--;  } @@ -275,7 +275,7 @@ PHP_MINFO_FUNCTION(ldap)  		maxl[15] = 0;  	} -	php3_printf("<table>" +	php_printf("<table>"  				"<tr><td>Total links:</td><td>%d/%s</td></tr>\n"  		        "<tr><td>RCS Version:</td><td>$Id$</td></tr>\n"  #if HAVE_NSLDAP @@ -290,12 +290,12 @@ PHP_MINFO_FUNCTION(ldap)  				);  #if HAVE_NSLDAP  	if ( ver.security_level != LDAP_SECURITY_NONE ) { -	   php3_printf( "<tr><td>Level of encryption:</td><td>%d bits</td></tr>\n", ver.security_level ); +	   php_printf( "<tr><td>Level of encryption:</td><td>%d bits</td></tr>\n", ver.security_level );  	} else { -	   php3_printf( "<tr><td>SSL not enabled.</td><td></td></tr>\n" ); +	   php_printf( "<tr><td>SSL not enabled.</td><td></td></tr>\n" );  	}  #endif -	php3_printf("</table>\n"); +	php_printf("</table>\n");  } @@ -360,7 +360,7 @@ PHP_FUNCTION(ldap_connect)  	}  	if (LDAP_GLOBAL(max_links)!=-1 && LDAP_GLOBAL(num_links)>=LDAP_GLOBAL(max_links)) { -	  php3_error(E_WARNING, "LDAP: Too many open links (%d)", LDAP_GLOBAL(num_links)); +	  php_error(E_WARNING, "LDAP: Too many open links (%d)", LDAP_GLOBAL(num_links));  	  RETURN_FALSE;  	} @@ -385,7 +385,7 @@ static LDAP * _get_ldap_link(pval *link, HashTable *list)  	ldap = (LDAP *) php3_list_find(link->value.lval, &type);  	if (!ldap || !(type == LDAP_GLOBAL(le_link))) { -	  php3_error(E_WARNING, "%d is not a LDAP link index", link->value.lval); +	  php_error(E_WARNING, "%d is not a LDAP link index", link->value.lval);  	  return NULL;  	}  	return ldap; @@ -402,7 +402,7 @@ static LDAPMessage * _get_ldap_result(pval *result, HashTable *list)  	ldap_result = (LDAPMessage *) php3_list_find(result->value.lval, &type);  	if (!ldap_result || type != LDAP_GLOBAL(le_result)) { -		php3_error(E_WARNING, "%d is not a LDAP result index", result->value.lval); +		php_error(E_WARNING, "%d is not a LDAP result index", result->value.lval);  		return NULL;  	} @@ -420,7 +420,7 @@ static LDAPMessage * _get_ldap_result_entry(pval *result, HashTable *list)  	ldap_result_entry = (LDAPMessage *) php3_list_find(result->value.lval, &type);  	if (!ldap_result_entry || type != LDAP_GLOBAL(le_result_entry)) { -		php3_error(E_WARNING, "%d is not a LDAP result entry index", result->value.lval); +		php_error(E_WARNING, "%d is not a LDAP result entry index", result->value.lval);  		return NULL;  	} @@ -438,7 +438,7 @@ static BerElement * _get_ber_entry(pval *berp, HashTable *list)  	ber = (BerElement *) php3_list_find(berp->value.lval, &type);  	if ( type != LDAP_GLOBAL(le_ber_entry)) { -		php3_error(E_WARNING, "%d is not a BerElement index", berp->value.lval); +		php_error(E_WARNING, "%d is not a BerElement index", berp->value.lval);  		return NULL;  	} @@ -501,9 +501,9 @@ PHP_FUNCTION(ldap_bind)  #if !HAVE_NSLDAP  #if LDAP_API_VERSION > 2000  		/* New versions of OpenLDAP do it this way */ -		php3_error(E_WARNING,"LDAP:  Unable to bind to server: %s",ldap_err2string(ldap_get_lderrno(ldap,NULL,NULL))); +		php_error(E_WARNING,"LDAP:  Unable to bind to server: %s",ldap_err2string(ldap_get_lderrno(ldap,NULL,NULL)));  #else -		php3_error(E_WARNING,"LDAP:  Unable to bind to server: %s",ldap_err2string(ldap->ld_errno)); +		php_error(E_WARNING,"LDAP:  Unable to bind to server: %s",ldap_err2string(ldap->ld_errno));  #endif  #endif  		RETURN_FALSE; @@ -566,7 +566,7 @@ static void php3_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)  			}  			if (attrs->type != IS_ARRAY) { -				php3_error(E_WARNING, "LDAP: Expected Array as last element"); +				php_error(E_WARNING, "LDAP: Expected Array as last element");  				RETURN_FALSE;  			} @@ -576,16 +576,16 @@ static void php3_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)  			ldap_base_dn = base_dn->value.str.val;  			ldap_filter = filter->value.str.val; -			num_attribs = _php3_hash_num_elements(attrs->value.ht); +			num_attribs = zend_hash_num_elements(attrs->value.ht);  			if ((ldap_attrs = emalloc((num_attribs+1) * sizeof(char *))) == NULL) { -				php3_error(E_WARNING, "LDAP: Could not allocate memory"); +				php_error(E_WARNING, "LDAP: Could not allocate memory");  				RETURN_FALSE;  				return;  			}  			for(i=0; i<num_attribs; i++) { -				if (_php3_hash_index_find(attrs->value.ht, i, (void **) &attr) == FAILURE) { -					php3_error(E_WARNING, "LDAP: Array initialization wrong"); +				if (zend_hash_index_find(attrs->value.ht, i, (void **) &attr) == FAILURE) { +					php_error(E_WARNING, "LDAP: Array initialization wrong");  					RETURN_FALSE;  					return;  				} @@ -617,9 +617,9 @@ static void php3_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)  	if (ldap_search_s(ldap, ldap_base_dn, scope, ldap_filter, ldap_attrs, attrsonly, &ldap_result) != LDAP_SUCCESS) {  #if !HAVE_NSLDAP  #if LDAP_API_VERSION > 2000 -		php3_error(E_WARNING,"LDAP:  Unable to perform the search: %s",ldap_err2string(ldap_get_lderrno(ldap,NULL,NULL))); +		php_error(E_WARNING,"LDAP:  Unable to perform the search: %s",ldap_err2string(ldap_get_lderrno(ldap,NULL,NULL)));  #else -		php3_error(E_WARNING, "LDAP: Unable to perform the search: %s", ldap_err2string(ldap->ld_errno)); +		php_error(E_WARNING, "LDAP: Unable to perform the search: %s", ldap_err2string(ldap->ld_errno));  #endif  #endif  		RETVAL_FALSE; @@ -822,7 +822,7 @@ PHP_FUNCTION(ldap_get_entries)  			}	  			ldap_value_free(ldap_value); -			_php3_hash_update(tmp1->value.ht, _php3_strtolower(attribute), strlen(attribute)+1, (void *) &tmp2, sizeof(pval *), NULL); +			zend_hash_update(tmp1->value.ht, _php3_strtolower(attribute), strlen(attribute)+1, (void *) &tmp2, sizeof(pval *), NULL);  			add_index_string(tmp1, attr_count, attribute, 1);  			attr_count++; @@ -833,7 +833,7 @@ PHP_FUNCTION(ldap_get_entries)  		dn = ldap_get_dn(ldap, ldap_result_entry);  		add_assoc_string(tmp1, "dn", dn, 1); -		_php3_hash_index_update(return_value->value.ht, entry_count, (void *) &tmp1, sizeof(pval *), NULL); +		zend_hash_index_update(return_value->value.ht, entry_count, (void *) &tmp1, sizeof(pval *), NULL);  		entry_count++;  		ldap_result_entry = ldap_next_entry(ldap, ldap_result_entry); @@ -959,7 +959,7 @@ PHP_FUNCTION(ldap_get_attributes)  		}  		ldap_value_free(ldap_value); -		_php3_hash_update(return_value->value.ht, attribute, strlen(attribute)+1, (void *) &tmp, sizeof(pval *), NULL); +		zend_hash_update(return_value->value.ht, attribute, strlen(attribute)+1, (void *) &tmp, sizeof(pval *), NULL);  		add_index_string(return_value, count, attribute, 1);  		count++; @@ -997,9 +997,9 @@ PHP_FUNCTION(ldap_get_values)  	if ((ldap_value = ldap_get_values(ldap, ldap_result_entry, attribute)) == NULL) {  #if !HAVE_NSLDAP  #if LDAP_API_VERSION > 2000 -		php3_error(E_WARNING, "LDAP: Cannot get the value(s) of attribute %s", ldap_err2string(ldap_get_lderrno(ldap,NULL,NULL))); +		php_error(E_WARNING, "LDAP: Cannot get the value(s) of attribute %s", ldap_err2string(ldap_get_lderrno(ldap,NULL,NULL)));  #else -		php3_error(E_WARNING, "LDAP: Cannot get the value(s) of attribute %s", ldap_err2string(ldap->ld_errno)); +		php_error(E_WARNING, "LDAP: Cannot get the value(s) of attribute %s", ldap_err2string(ldap->ld_errno));  #endif  #endif  		RETURN_FALSE; @@ -1132,7 +1132,7 @@ static void php3_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)  	}	  	if (entry->type != IS_ARRAY) { -		php3_error(E_WARNING, "LDAP: Expected Array as the last element"); +		php_error(E_WARNING, "LDAP: Expected Array as the last element");  		RETURN_FALSE;  	} @@ -1142,11 +1142,11 @@ static void php3_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)  	convert_to_string(dn);  	ldap_dn = dn->value.str.val; -	num_attribs = _php3_hash_num_elements(entry->value.ht); +	num_attribs = zend_hash_num_elements(entry->value.ht);  	ldap_mods = emalloc((num_attribs+1) * sizeof(LDAPMod *)); -	_php3_hash_internal_pointer_reset(entry->value.ht); +	zend_hash_internal_pointer_reset(entry->value.ht);          /* added by gerrit thomson to fix ldap_add using ldap_mod_add */          if ( oper == PHP_LD_FULL_ADD )          { @@ -1160,19 +1160,19 @@ static void php3_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)  		ldap_mods[i]->mod_op = oper; -		if (_php3_hash_get_current_key(entry->value.ht, &attribute, &index) == HASH_KEY_IS_STRING) { +		if (zend_hash_get_current_key(entry->value.ht, &attribute, &index) == HASH_KEY_IS_STRING) {  			ldap_mods[i]->mod_type = estrdup(attribute);  			efree(attribute);  		} else { -			php3_error(E_WARNING, "LDAP: Unknown Attribute in the data"); +			php_error(E_WARNING, "LDAP: Unknown Attribute in the data");  		} -		_php3_hash_get_current_data(entry->value.ht, (void **) &value); +		zend_hash_get_current_data(entry->value.ht, (void **) &value);  		if (value->type != IS_ARRAY) {  			num_values = 1;  		} else { -			num_values = _php3_hash_num_elements(value->value.ht); +			num_values = zend_hash_num_elements(value->value.ht);  		}  		ldap_mods[i]->mod_values = emalloc((num_values+1) * sizeof(char *)); @@ -1184,14 +1184,14 @@ static void php3_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)  			ldap_mods[i]->mod_values[0] = value->value.str.val;  		} else {	  			for(j=0; j<num_values; j++) { -				_php3_hash_index_find(value->value.ht, j, (void **) &ivalue); +				zend_hash_index_find(value->value.ht, j, (void **) &ivalue);  				convert_to_string(ivalue);  				ldap_mods[i]->mod_values[j] = ivalue->value.str.val;  			}  		}  		ldap_mods[i]->mod_values[num_values] = NULL; -		_php3_hash_move_forward(entry->value.ht); +		zend_hash_move_forward(entry->value.ht);  	}  	ldap_mods[num_attribs] = NULL; @@ -1200,12 +1200,12 @@ static void php3_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)          if (is_full_add == 1) {  		if (ldap_add_s(ldap, ldap_dn, ldap_mods) != LDAP_SUCCESS) {  			ldap_perror(ldap, "LDAP"); -			php3_error(E_WARNING, "LDAP: add operation could not be completed."); +			php_error(E_WARNING, "LDAP: add operation could not be completed.");  			RETVAL_FALSE;  		} else RETVAL_TRUE;  	} else {  		if (ldap_modify_s(ldap, ldap_dn, ldap_mods) != LDAP_SUCCESS) { -			php3_error(E_WARNING, "LDAP: modify operation could not be completed."); +			php_error(E_WARNING, "LDAP: modify operation could not be completed.");  			RETVAL_FALSE;  		} else RETVAL_TRUE;	  	} diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c index 574e254fcd..7c502979dc 100644 --- a/ext/mcrypt/mcrypt.c +++ b/ext/mcrypt/mcrypt.c @@ -85,7 +85,7 @@ static mcrypt_global_struct mcryptg;  #define MCRYPT_CHECK_TD_CPY \  	if(td == -1) { \ -		php3_error(E_WARNING, MCRYPT_FAILED); \ +		php_error(E_WARNING, MCRYPT_FAILED); \  		RETURN_FALSE; \  	} \  	ndata = ecalloc(nr, bsize); \ @@ -94,7 +94,7 @@ static mcrypt_global_struct mcryptg;  #define MCRYPT_CHECK_IV \  	convert_to_string(iv); \  	if(iv->value.str.len != bsize) { \ -		php3_error(E_WARNING, MCRYPT_IV_WRONG_SIZE); \ +		php_error(E_WARNING, MCRYPT_IV_WRONG_SIZE); \  		RETURN_FALSE; \  	} @@ -180,7 +180,7 @@ PHP_FUNCTION(mcrypt_create_iv)  	i = size->value.lval;  	if(i <= 0) { -		php3_error(E_WARNING, "illegal size input parameter"); +		php_error(E_WARNING, "illegal size input parameter");  		RETURN_FALSE;  	} @@ -193,7 +193,7 @@ PHP_FUNCTION(mcrypt_create_iv)  				O_RDONLY);  		if(fd < 0) {  			efree(iv); -			php3_error(E_WARNING, "cannot open source device"); +			php_error(E_WARNING, "cannot open source device");  			RETURN_FALSE;  		}  		read(fd, iv, i); diff --git a/ext/mhash/mhash.c b/ext/mhash/mhash.c index ac2a0a7c4f..9eefe7053b 100644 --- a/ext/mhash/mhash.c +++ b/ext/mhash/mhash.c @@ -127,7 +127,7 @@ PHP_FUNCTION(mhash)  	bsize = mhash_get_block_size(hash->value.lval);  	td = mhash_init(hash->value.lval);  	if(td == MHASH_FAILED) { -		php3_error(E_WARNING, MHASH_FAILED_MSG); +		php_error(E_WARNING, MHASH_FAILED_MSG);  		RETURN_FALSE;  	} diff --git a/ext/msql/msql.c b/ext/msql/msql.c index 0612c3edb4..ab6e0877cd 100644 --- a/ext/msql/msql.c +++ b/ext/msql/msql.c @@ -165,7 +165,7 @@ typedef struct {  	convert_to_long((res)); \  	msql_query = (m_query *) php3_list_find((res)->value.lval,&type); \  	if (type!=MSQL_GLOBAL(php3_msql_module).le_query) { \ -		php3_error(E_WARNING,"%d is not a mSQL query index", \ +		php_error(E_WARNING,"%d is not a mSQL query index", \  				res->value.lval); \  		RETURN_FALSE; \  	} \ @@ -297,7 +297,7 @@ DLEXPORT PHP_MINFO_FUNCTION(msql)  		snprintf(maxl,15,"%ld",MSQL_GLOBAL(php3_msql_module).max_links);  		maxl[15]=0;  	} -	php3_printf("<table>" +	php_printf("<table>"  				"<tr><td>Allow persistent links:</td><td>%s</td></tr>\n"  				"<tr><td>Persistent links:</td><td>%d/%s</td></tr>\n"  				"<tr><td>Total links:</td><td>%d/%s</td></tr>\n" @@ -347,18 +347,18 @@ static void php3_msql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  		list_entry *le;  		if (MSQL_GLOBAL(php3_msql_module).max_links!=-1 && MSQL_GLOBAL(php3_msql_module).num_links>=MSQL_GLOBAL(php3_msql_module).max_links) { -			php3_error(E_WARNING,"mSQL:  Too many open links (%d)",MSQL_GLOBAL(php3_msql_module).num_links); +			php_error(E_WARNING,"mSQL:  Too many open links (%d)",MSQL_GLOBAL(php3_msql_module).num_links);  			efree(hashed_details);  			RETURN_FALSE;  		}  		if (MSQL_GLOBAL(php3_msql_module).max_persistent!=-1 && MSQL_GLOBAL(php3_msql_module).num_persistent>=MSQL_GLOBAL(php3_msql_module).max_persistent) { -			php3_error(E_WARNING,"mSQL:  Too many open persistent links (%d)",MSQL_GLOBAL(php3_msql_module).num_persistent); +			php_error(E_WARNING,"mSQL:  Too many open persistent links (%d)",MSQL_GLOBAL(php3_msql_module).num_persistent);  			efree(hashed_details);  			RETURN_FALSE;  		}  		/* try to find if we already have this link in our persistent list */ -		if (_php3_hash_find(plist, hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) {  /* we don't */ +		if (zend_hash_find(plist, hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) {  /* we don't */  			list_entry new_le;  			/* create the link */ @@ -370,7 +370,7 @@ static void php3_msql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  			/* hash it up */  			new_le.type = MSQL_GLOBAL(php3_msql_module).le_plink;  			new_le.ptr = (void *) msql; -			if (_php3_hash_update(plist, hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry), NULL)==FAILURE) { +			if (zend_hash_update(plist, hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry), NULL)==FAILURE) {  				efree(hashed_details);  				RETURN_FALSE;  			} @@ -386,8 +386,8 @@ static void php3_msql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  			/* still have to find a way to do this nicely with mSQL */  			if (msql_stat(le->ptr)==NULL) { /* the link died */  				if (msql_connect(le->ptr,host,user,passwd)==NULL) { -					php3_error(E_WARNING,"mSQL link lost, unable to reconnect"); -					_php3_hash_del(plist,hashed_details,hashed_details_length+1); +					php_error(E_WARNING,"mSQL link lost, unable to reconnect"); +					zend_hash_del(plist,hashed_details,hashed_details_length+1);  					efree(hashed_details);  					RETURN_FALSE;  				} @@ -405,7 +405,7 @@ static void php3_msql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  		 * if it doesn't, open a new msql link, add it to the resource list,  		 * and add a pointer to it with hashed_details as the key.  		 */ -		if (_php3_hash_find(list,hashed_details,hashed_details_length+1,(void **) &index_ptr)==SUCCESS) { +		if (zend_hash_find(list,hashed_details,hashed_details_length+1,(void **) &index_ptr)==SUCCESS) {  			int type,link;  			void *ptr; @@ -420,11 +420,11 @@ static void php3_msql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  				efree(hashed_details);  				return;  			} else { -				_php3_hash_del(list,hashed_details,hashed_details_length+1); +				zend_hash_del(list,hashed_details,hashed_details_length+1);  			}  		}  		if (MSQL_GLOBAL(php3_msql_module).max_links!=-1 && MSQL_GLOBAL(php3_msql_module).num_links>=MSQL_GLOBAL(php3_msql_module).max_links) { -			php3_error(E_WARNING,"mSQL:  Too many open links (%d)",MSQL_GLOBAL(php3_msql_module).num_links); +			php_error(E_WARNING,"mSQL:  Too many open links (%d)",MSQL_GLOBAL(php3_msql_module).num_links);  			efree(hashed_details);  			RETURN_FALSE;  		} @@ -440,7 +440,7 @@ static void php3_msql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  		/* add it to the hash */  		new_index_ptr.ptr = (void *) return_value->value.lval;  		new_index_ptr.type = le_index_ptr; -		if (_php3_hash_update(list,hashed_details,hashed_details_length+1,(void *) &new_index_ptr, sizeof(list_entry), NULL)==FAILURE) { +		if (zend_hash_update(list,hashed_details,hashed_details_length+1,(void *) &new_index_ptr, sizeof(list_entry), NULL)==FAILURE) {  			efree(hashed_details);  			RETURN_FALSE;  		} @@ -503,7 +503,7 @@ DLEXPORT PHP_FUNCTION(msql_close)  	msql = (int) php3_list_find(id,&type);  	if (type!=MSQL_GLOBAL(php3_msql_module).le_link && type!=MSQL_GLOBAL(php3_msql_module).le_plink) { -		php3_error(E_WARNING,"%d is not a mSQL link index",id); +		php_error(E_WARNING,"%d is not a mSQL link index",id);  		RETURN_FALSE;  	} @@ -542,7 +542,7 @@ DLEXPORT PHP_FUNCTION(msql_select_db)  	msql = (int) php3_list_find(id,&type);  	if (type!=MSQL_GLOBAL(php3_msql_module).le_link && type!=MSQL_GLOBAL(php3_msql_module).le_plink) { -		php3_error(E_WARNING,"%d is not a mSQL link index",id); +		php_error(E_WARNING,"%d is not a mSQL link index",id);  		RETURN_FALSE;  	} @@ -586,7 +586,7 @@ DLEXPORT PHP_FUNCTION(msql_create_db)  	msql = (int) php3_list_find(id,&type);  	if (type!=MSQL_GLOBAL(php3_msql_module).le_link && type!=MSQL_GLOBAL(php3_msql_module).le_plink) { -		php3_error(E_WARNING,"%d is not a mSQL link index",id); +		php_error(E_WARNING,"%d is not a mSQL link index",id);  		RETURN_FALSE;  	} @@ -629,7 +629,7 @@ DLEXPORT PHP_FUNCTION(msql_drop_db)  	msql = (int) php3_list_find(id,&type);  	if (type!=MSQL_GLOBAL(php3_msql_module).le_link && type!=MSQL_GLOBAL(php3_msql_module).le_plink) { -		php3_error(E_WARNING,"%d is not a mSQL link index",id); +		php_error(E_WARNING,"%d is not a mSQL link index",id);  		RETURN_FALSE;  	} @@ -673,7 +673,7 @@ DLEXPORT PHP_FUNCTION(msql_query)  	msql = (int) php3_list_find(id,&type);  	if (type!=MSQL_GLOBAL(php3_msql_module).le_link && type!=MSQL_GLOBAL(php3_msql_module).le_plink) { -		php3_error(E_WARNING,"%d is not a mSQL link index",id); +		php_error(E_WARNING,"%d is not a mSQL link index",id);  		RETURN_FALSE;  	} @@ -716,7 +716,7 @@ DLEXPORT PHP_FUNCTION(msql_db_query)  	msql = (int) php3_list_find(id,&type);  	if (type!=MSQL_GLOBAL(php3_msql_module).le_link && type!=MSQL_GLOBAL(php3_msql_module).le_plink) { -		php3_error(E_WARNING,"%d is not a mSQL link index",id); +		php_error(E_WARNING,"%d is not a mSQL link index",id);  		RETURN_FALSE;  	} @@ -761,11 +761,11 @@ DLEXPORT PHP_FUNCTION(msql_list_dbs)  	msql = (int) php3_list_find(id,&type);  	if (type!=MSQL_GLOBAL(php3_msql_module).le_link && type!=MSQL_GLOBAL(php3_msql_module).le_plink) { -		php3_error(E_WARNING,"%d is not a mSQL link index",id); +		php_error(E_WARNING,"%d is not a mSQL link index",id);  		RETURN_FALSE;  	}  	if ((msql_result=msqlListDBs(msql))==NULL) { -		php3_error(E_WARNING,"Unable to save mSQL query result"); +		php_error(E_WARNING,"Unable to save mSQL query result");  		RETURN_FALSE;  	}  	RETVAL_LONG(_new_query(msql_result, 0)); @@ -803,7 +803,7 @@ DLEXPORT PHP_FUNCTION(msql_list_tables)  	msql = (int) php3_list_find(id,&type);  	if (type!=MSQL_GLOBAL(php3_msql_module).le_link && type!=MSQL_GLOBAL(php3_msql_module).le_plink) { -		php3_error(E_WARNING,"%d is not a mSQL link index",id); +		php_error(E_WARNING,"%d is not a mSQL link index",id);  		RETURN_FALSE;  	} @@ -812,7 +812,7 @@ DLEXPORT PHP_FUNCTION(msql_list_tables)  		RETURN_FALSE;  	}  	if ((msql_result=msqlListTables(msql))==NULL) { -		php3_error(E_WARNING,"Unable to save mSQL query result"); +		php_error(E_WARNING,"Unable to save mSQL query result");  		RETURN_FALSE;  	}  	RETVAL_LONG(_new_query(msql_result, 0)); @@ -850,7 +850,7 @@ DLEXPORT PHP_FUNCTION(msql_list_fields)  	msql = (int) php3_list_find(id,&type);  	if (type!=MSQL_GLOBAL(php3_msql_module).le_link && type!=MSQL_GLOBAL(php3_msql_module).le_plink) { -		php3_error(E_WARNING,"%d is not a mSQL link index",id); +		php_error(E_WARNING,"%d is not a mSQL link index",id);  		RETURN_FALSE;  	} @@ -860,7 +860,7 @@ DLEXPORT PHP_FUNCTION(msql_list_fields)  	}  	convert_to_string(table);  	if ((msql_result=msqlListFields(msql,table->value.str.val))==NULL) { -		php3_error(E_WARNING,"Unable to save mSQL query result"); +		php_error(E_WARNING,"Unable to save mSQL query result");  		RETURN_FALSE;  	}  	RETVAL_LONG(_new_query(msql_result, 0)); @@ -910,7 +910,7 @@ DLEXPORT PHP_FUNCTION(msql_result)  	convert_to_long(row);  	if (row->value.lval<0 || row->value.lval>=msqlNumRows(msql_result)) { -		php3_error(E_WARNING,"Unable to jump to row %d on mSQL query index %d",row->value.lval,result->value.lval); +		php_error(E_WARNING,"Unable to jump to row %d on mSQL query index %d",row->value.lval,result->value.lval);  		RETURN_FALSE;  	}  	msqlDataSeek(msql_result,row->value.lval); @@ -942,7 +942,7 @@ DLEXPORT PHP_FUNCTION(msql_result)  						i++;  					}  					if (!tmp_field) { /* no match found */ -						php3_error(E_WARNING,"%s%s%s not found in mSQL query index %d", +						php_error(E_WARNING,"%s%s%s not found in mSQL query index %d",  									(table_name?table_name:""), (table_name?".":""), field_name, result->value.lval);  						efree(field_name);  						if (table_name) { @@ -960,7 +960,7 @@ DLEXPORT PHP_FUNCTION(msql_result)  				convert_to_long(field);  				field_offset = field->value.lval;  				if (field_offset<0 || field_offset>=msqlNumFields(msql_result)) { -					php3_error(E_WARNING,"Bad column offset specified"); +					php_error(E_WARNING,"Bad column offset specified");  					RETURN_FALSE;  				}  				break; @@ -1146,7 +1146,7 @@ DLEXPORT PHP_FUNCTION(msql_data_seek)  	if (!msql_result ||  			offset->value.lval<0 ||   			offset->value.lval>=msqlNumRows(msql_result)) { -		php3_error(E_WARNING,"Offset %d is invalid for mSQL query index %d",offset->value.lval,result->value.lval); +		php_error(E_WARNING,"Offset %d is invalid for mSQL query index %d",offset->value.lval,result->value.lval);  		RETURN_FALSE;  	}  	msqlDataSeek(msql_result,offset->value.lval); @@ -1222,7 +1222,7 @@ DLEXPORT PHP_FUNCTION(msql_fetch_field)  	if (field) {  		if (field->value.lval<0 || field->value.lval>=msqlNumRows(msql_result)) { -			php3_error(E_NOTICE,"mSQL:  Bad field offset specified"); +			php_error(E_NOTICE,"mSQL:  Bad field offset specified");  			RETURN_FALSE;  		}  		msqlFieldSeek(msql_result,field->value.lval); @@ -1267,7 +1267,7 @@ DLEXPORT PHP_FUNCTION(msql_field_seek)  		RETURN_FALSE;  	}  	if (offset->value.lval<0 || offset->value.lval>=msqlNumFields(msql_result)) { -		php3_error(E_WARNING,"Field %d is invalid for mSQL query index %d", +		php_error(E_WARNING,"Field %d is invalid for mSQL query index %d",  				offset->value.lval,result->value.lval);  		RETURN_FALSE;  	} @@ -1301,7 +1301,7 @@ static void php3_msql_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)  	}  	convert_to_long(field);  	if (field->value.lval<0 || field->value.lval>=msqlNumFields(msql_result)) { -		php3_error(E_WARNING,"Field %d is invalid for mSQL query index %d",field->value.lval,result->value.lval); +		php_error(E_WARNING,"Field %d is invalid for mSQL query index %d",field->value.lval,result->value.lval);  		RETURN_FALSE;  	}  	msqlFieldSeek(msql_result,field->value.lval); diff --git a/ext/mysql/mysql.c b/ext/mysql/mysql.c index 67a47885ef..3cd420696f 100644 --- a/ext/mysql/mysql.c +++ b/ext/mysql/mysql.c @@ -153,7 +153,7 @@ DLEXPORT php3_module_entry *get_module(void) { return &mysql_module_entry; }  void timeout(int sig);  #endif -#define CHECK_LINK(link) { if (link==-1) { php3_error(E_WARNING,"MySQL:  A link to the server could not be established"); RETURN_FALSE; } } +#define CHECK_LINK(link) { if (link==-1) { php_error(E_WARNING,"MySQL:  A link to the server could not be established"); RETURN_FALSE; } }  /* NOTE  Don't ask me why, but soon as I made this the list   * destructor, I stoped getting access violations in windows @@ -321,7 +321,7 @@ PHP_MINFO_FUNCTION(mysql)  		snprintf(maxl,15,"%ld",MySG(max_links));  		maxl[15]=0;  	} -	php3_printf("<table cellpadding=5>" +	php_printf("<table cellpadding=5>"  				"<tr><td>Allow persistent links:</td><td>%s</td></tr>\n"  				"<tr><td>Persistent links:</td><td>%d/%s</td></tr>\n"  				"<tr><td>Total links:</td><td>%d/%s</td></tr>\n" @@ -358,7 +358,7 @@ static void php3_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  	if (PG(sql_safe_mode)) {  		if (ARG_COUNT(ht)>0) { -			php3_error(E_NOTICE,"SQL safe mode in effect - ignoring host/user/password information"); +			php_error(E_NOTICE,"SQL safe mode in effect - ignoring host/user/password information");  		}  		host=passwd=NULL;  		user=_php3_get_current_user(); @@ -440,16 +440,16 @@ static void php3_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  		list_entry *le;  		/* try to find if we already have this link in our persistent list */ -		if (_php3_hash_find(plist, hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) {  /* we don't */ +		if (zend_hash_find(plist, hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) {  /* we don't */  			list_entry new_le;  			if (MySG(max_links)!=-1 && MySG(num_links)>=MySG(max_links)) { -				php3_error(E_WARNING,"MySQL:  Too many open links (%d)",MySG(num_links)); +				php_error(E_WARNING,"MySQL:  Too many open links (%d)",MySG(num_links));  				efree(hashed_details);  				RETURN_FALSE;  			}  			if (MySG(max_persistent)!=-1 && MySG(num_persistent)>=MySG(max_persistent)) { -				php3_error(E_WARNING,"MySQL:  Too many open persistent links (%d)",MySG(num_persistent)); +				php_error(E_WARNING,"MySQL:  Too many open persistent links (%d)",MySG(num_persistent));  				efree(hashed_details);  				RETURN_FALSE;  			} @@ -461,7 +461,7 @@ static void php3_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  #else  		if (mysql_connect(mysql,host,user,passwd)==NULL) {  #endif -				php3_error(E_WARNING,mysql_error(mysql)); +				php_error(E_WARNING,mysql_error(mysql));  				free(mysql);  				efree(hashed_details);  				RETURN_FALSE; @@ -470,7 +470,7 @@ static void php3_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  			/* hash it up */  			new_le.type = le_plink;  			new_le.ptr = mysql; -			if (_php3_hash_update(plist, hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry), NULL)==FAILURE) { +			if (zend_hash_update(plist, hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry), NULL)==FAILURE) {  				free(mysql);  				efree(hashed_details);  				RETURN_FALSE; @@ -499,8 +499,8 @@ static void php3_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  #else  				if (mysql_connect(le->ptr,host,user,passwd)==NULL) {  #endif -					php3_error(E_WARNING,"MySQL:  Link to server lost, unable to reconnect"); -					_php3_hash_del(plist, hashed_details, hashed_details_length+1); +					php_error(E_WARNING,"MySQL:  Link to server lost, unable to reconnect"); +					zend_hash_del(plist, hashed_details, hashed_details_length+1);  					efree(hashed_details);  					RETURN_FALSE;  				} @@ -520,7 +520,7 @@ static void php3_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  		 * if it doesn't, open a new mysql link, add it to the resource list,  		 * and add a pointer to it with hashed_details as the key.  		 */ -		if (_php3_hash_find(list,hashed_details,hashed_details_length+1,(void **) &index_ptr)==SUCCESS) { +		if (zend_hash_find(list,hashed_details,hashed_details_length+1,(void **) &index_ptr)==SUCCESS) {  			int type,link;  			void *ptr; @@ -541,11 +541,11 @@ static void php3_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  				efree(hashed_details);  				return;  			} else { -				_php3_hash_del(list,hashed_details,hashed_details_length+1); +				zend_hash_del(list,hashed_details,hashed_details_length+1);  			}  		}  		if (MySG(max_links)!=-1 && MySG(num_links)>=MySG(max_links)) { -			php3_error(E_WARNING,"MySQL:  Too many open links (%d)",MySG(num_links)); +			php_error(E_WARNING,"MySQL:  Too many open links (%d)",MySG(num_links));  			efree(hashed_details);  			RETURN_FALSE;  		} @@ -557,7 +557,7 @@ static void php3_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  #else  		if (mysql_connect(mysql,host,user,passwd)==NULL) {  #endif -			php3_error(E_WARNING,"MySQL Connection Failed: %s\n",mysql_error(mysql)); +			php_error(E_WARNING,"MySQL Connection Failed: %s\n",mysql_error(mysql));  			efree(hashed_details);  			efree(mysql);  			RETURN_FALSE; @@ -574,7 +574,7 @@ static void php3_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  #else  		new_index_ptr.type = le_index_ptr;  #endif -		if (_php3_hash_update(list,hashed_details,hashed_details_length+1,(void *) &new_index_ptr, sizeof(list_entry), NULL)==FAILURE) { +		if (zend_hash_update(list,hashed_details,hashed_details_length+1,(void *) &new_index_ptr, sizeof(list_entry), NULL)==FAILURE) {  			efree(hashed_details);  			RETURN_FALSE;  		} @@ -641,7 +641,7 @@ PHP_FUNCTION(mysql_close)  	mysql = (MYSQL *) php3_list_find(id,&type);  	if (type!=le_link && type!=le_plink) { -		php3_error(E_WARNING,"%d is not a MySQL link index",id); +		php_error(E_WARNING,"%d is not a MySQL link index",id);  		RETURN_FALSE;  	} @@ -683,7 +683,7 @@ PHP_FUNCTION(mysql_select_db)  	mysql = (MYSQL *) php3_list_find(id,&type);  	if (type!=le_link && type!=le_plink) { -		php3_error(E_WARNING,"%d is not a MySQL link index",id); +		php_error(E_WARNING,"%d is not a MySQL link index",id);  		RETURN_FALSE;  	} @@ -730,7 +730,7 @@ PHP_FUNCTION(mysql_create_db)  	mysql = (MYSQL *) php3_list_find(id,&type);  	if (type!=le_link && type!=le_plink) { -		php3_error(E_WARNING,"%d is not a MySQL link index",id); +		php_error(E_WARNING,"%d is not a MySQL link index",id);  		RETURN_FALSE;  	} @@ -776,7 +776,7 @@ PHP_FUNCTION(mysql_drop_db)  	mysql = (MYSQL *) php3_list_find(id,&type);  	if (type!=le_link && type!=le_plink) { -		php3_error(E_WARNING,"%d is not a MySQL link index",id); +		php_error(E_WARNING,"%d is not a MySQL link index",id);  		RETURN_FALSE;  	} @@ -821,7 +821,7 @@ PHP_FUNCTION(mysql_query)  	mysql = (MYSQL *) php3_list_find(id,&type);  	if (type!=le_link && type!=le_plink) { -		php3_error(E_WARNING,"%d is not a MySQL link index",id); +		php_error(E_WARNING,"%d is not a MySQL link index",id);  		RETURN_FALSE;  	} @@ -837,7 +837,7 @@ PHP_FUNCTION(mysql_query)  	}  #endif  	if ((mysql_result=mysql_store_result(mysql))==NULL) { -		/*php3_error(E_WARNING,"Unable to save MySQL query result"); +		/*php_error(E_WARNING,"Unable to save MySQL query result");  		RETURN_FALSE;  		*/  		RETURN_TRUE; @@ -881,7 +881,7 @@ PHP_FUNCTION(mysql_db_query)  	mysql = (MYSQL *) php3_list_find(id,&type);  	if (type!=le_link && type!=le_plink) { -		php3_error(E_WARNING,"%d is not a MySQL link index",id); +		php_error(E_WARNING,"%d is not a MySQL link index",id);  		RETURN_FALSE;  	} @@ -903,7 +903,7 @@ PHP_FUNCTION(mysql_db_query)  #endif  	if ((mysql_result=mysql_store_result(mysql))==NULL) {  		/* -		php3_error(E_WARNING,"Unable to save MySQL query result"); +		php_error(E_WARNING,"Unable to save MySQL query result");  		RETURN_FALSE;  		*/  		RETURN_TRUE; @@ -944,11 +944,11 @@ PHP_FUNCTION(mysql_list_dbs)  	mysql = (MYSQL *) php3_list_find(id,&type);  	if (type!=le_link && type!=le_plink) { -		php3_error(E_WARNING,"%d is not a MySQL link index",id); +		php_error(E_WARNING,"%d is not a MySQL link index",id);  		RETURN_FALSE;  	}  	if ((mysql_result=mysql_list_dbs(mysql,NULL))==NULL) { -		php3_error(E_WARNING,"Unable to save MySQL query result"); +		php_error(E_WARNING,"Unable to save MySQL query result");  		RETURN_FALSE;  	}  	return_value->value.lval = php3_list_insert(mysql_result,le_result); @@ -990,7 +990,7 @@ PHP_FUNCTION(mysql_list_tables)  	mysql = (MYSQL *) php3_list_find(id,&type);  	if (type!=le_link && type!=le_plink) { -		php3_error(E_WARNING,"%d is not a MySQL link index",id); +		php_error(E_WARNING,"%d is not a MySQL link index",id);  		RETURN_FALSE;  	} @@ -999,7 +999,7 @@ PHP_FUNCTION(mysql_list_tables)  		RETURN_FALSE;  	}  	if ((mysql_result=mysql_list_tables(mysql,NULL))==NULL) { -		php3_error(E_WARNING,"Unable to save MySQL query result"); +		php_error(E_WARNING,"Unable to save MySQL query result");  		RETURN_FALSE;  	}  	return_value->value.lval = php3_list_insert(mysql_result,le_result); @@ -1041,7 +1041,7 @@ PHP_FUNCTION(mysql_list_fields)  	mysql = (MYSQL *) php3_list_find(id,&type);  	if (type!=le_link && type!=le_plink) { -		php3_error(E_WARNING,"%d is not a MySQL link index",id); +		php_error(E_WARNING,"%d is not a MySQL link index",id);  		RETURN_FALSE;  	} @@ -1051,7 +1051,7 @@ PHP_FUNCTION(mysql_list_fields)  	}  	convert_to_string(table);  	if ((mysql_result=mysql_list_fields(mysql,table->value.str.val,NULL))==NULL) { -		php3_error(E_WARNING,"Unable to save MySQL query result"); +		php_error(E_WARNING,"Unable to save MySQL query result");  		RETURN_FALSE;  	}  	return_value->value.lval = php3_list_insert(mysql_result,le_result); @@ -1090,7 +1090,7 @@ PHP_FUNCTION(mysql_error)  	}  	mysql = (MYSQL *) php3_list_find(id,&type);  	if (type!=le_link && type!=le_plink) { -		php3_error(E_WARNING,"%d is not a MySQL link index",id); +		php_error(E_WARNING,"%d is not a MySQL link index",id);  		RETURN_FALSE;  	} @@ -1130,7 +1130,7 @@ PHP_FUNCTION(mysql_errno)  	}  	mysql = (MYSQL *) php3_list_find(id,&type);  	if (type!=le_link && type!=le_plink) { -		php3_error(E_WARNING,"%d is not a MySQL link index",id); +		php_error(E_WARNING,"%d is not a MySQL link index",id);  		RETURN_FALSE;  	} @@ -1167,7 +1167,7 @@ PHP_FUNCTION(mysql_affected_rows)  	mysql = (MYSQL *) php3_list_find(id,&type);  	if (type!=le_link && type!=le_plink) { -		php3_error(E_WARNING,"%d is not a MySQL link index",id); +		php_error(E_WARNING,"%d is not a MySQL link index",id);  		RETURN_FALSE;  	} @@ -1205,7 +1205,7 @@ PHP_FUNCTION(mysql_insert_id)  	mysql = (MYSQL *) php3_list_find(id,&type);  	if (type!=le_link && type!=le_plink) { -		php3_error(E_WARNING,"%d is not a MySQL link index",id); +		php_error(E_WARNING,"%d is not a MySQL link index",id);  		RETURN_FALSE;  	} @@ -1247,13 +1247,13 @@ PHP_FUNCTION(mysql_result)  	mysql_result = (MYSQL_RES *) php3_list_find(result->value.lval,&type);  	if (type!=le_result) { -		php3_error(E_WARNING,"%d is not a MySQL result index",result->value.lval); +		php_error(E_WARNING,"%d is not a MySQL result index",result->value.lval);  		RETURN_FALSE;  	}  	convert_to_long(row);  	if (row->value.lval<0 || row->value.lval>=(int)mysql_num_rows(mysql_result)) { -		php3_error(E_WARNING,"Unable to jump to row %d on MySQL result index %d",row->value.lval,result->value.lval); +		php_error(E_WARNING,"Unable to jump to row %d on MySQL result index %d",row->value.lval,result->value.lval);  		RETURN_FALSE;  	}  	mysql_data_seek(mysql_result,row->value.lval); @@ -1286,7 +1286,7 @@ PHP_FUNCTION(mysql_result)  						i++;  					}  					if (!tmp_field) { /* no match found */ -						php3_error(E_WARNING,"%s%s%s not found in MySQL result index %d", +						php_error(E_WARNING,"%s%s%s not found in MySQL result index %d",  									(table_name?table_name:""), (table_name?".":""), field_name, result->value.lval);  						efree(field_name);  						if (table_name) { @@ -1304,7 +1304,7 @@ PHP_FUNCTION(mysql_result)  				convert_to_long(field);  				field_offset = field->value.lval;  				if (field_offset<0 || field_offset>=(int)mysql_num_fields(mysql_result)) { -					php3_error(E_WARNING,"Bad column offset specified"); +					php_error(E_WARNING,"Bad column offset specified");  					RETURN_FALSE;  				}  				break; @@ -1346,7 +1346,7 @@ PHP_FUNCTION(mysql_num_rows)  	mysql_result = (MYSQL_RES *) php3_list_find(result->value.lval,&type);  	if (type!=le_result) { -		php3_error(E_WARNING,"%d is not a MySQL result index",result->value.lval); +		php_error(E_WARNING,"%d is not a MySQL result index",result->value.lval);  		RETURN_FALSE;  	} @@ -1373,7 +1373,7 @@ PHP_FUNCTION(mysql_num_fields)  	mysql_result = (MYSQL_RES *) php3_list_find(result->value.lval,&type);  	if (type!=le_result) { -		php3_error(E_WARNING,"%d is not a MySQL result index",result->value.lval); +		php_error(E_WARNING,"%d is not a MySQL result index",result->value.lval);  		RETURN_FALSE;  	} @@ -1420,7 +1420,7 @@ static void php3_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)  	mysql_result = (MYSQL_RES *) php3_list_find(result->value.lval,&type);  	if (type!=le_result) { -		php3_error(E_WARNING,"%d is not a MySQL result index",result->value.lval); +		php_error(E_WARNING,"%d is not a MySQL result index",result->value.lval);  		RETURN_FALSE;  	}  	if ((mysql_row=mysql_fetch_row(mysql_result))==NULL  @@ -1515,12 +1515,12 @@ PHP_FUNCTION(mysql_data_seek)  	mysql_result = (MYSQL_RES *) php3_list_find(result->value.lval,&type);  	if (type!=le_result) { -		php3_error(E_WARNING,"%d is not a MySQL result index",result->value.lval); +		php_error(E_WARNING,"%d is not a MySQL result index",result->value.lval);  		RETURN_FALSE;  	}  	convert_to_long(offset);  	if (offset->value.lval<0 || offset->value.lval>=(int)mysql_num_rows(mysql_result)) { -		php3_error(E_WARNING,"Offset %d is invalid for MySQL result index %d",offset->value.lval,result->value.lval); +		php_error(E_WARNING,"Offset %d is invalid for MySQL result index %d",offset->value.lval,result->value.lval);  		RETURN_FALSE;  	}  	mysql_data_seek(mysql_result,offset->value.lval); @@ -1549,7 +1549,7 @@ PHP_FUNCTION(mysql_fetch_lengths)  	mysql_result = (MYSQL_RES *) php3_list_find(result->value.lval,&type);  	if (type!=le_result) { -		php3_error(E_WARNING,"%d is not a MySQL result index",result->value.lval); +		php_error(E_WARNING,"%d is not a MySQL result index",result->value.lval);  		RETURN_FALSE;  	}  	if ((lengths=mysql_fetch_lengths(mysql_result))==NULL) { @@ -1646,12 +1646,12 @@ PHP_FUNCTION(mysql_fetch_field)  	mysql_result = (MYSQL_RES *) php3_list_find(result->value.lval,&type);  	if (type!=le_result) { -		php3_error(E_WARNING,"%d is not a MySQL result index",result->value.lval); +		php_error(E_WARNING,"%d is not a MySQL result index",result->value.lval);  		RETURN_FALSE;  	}  	if (field) {  		if (field->value.lval<0 || field->value.lval>=(int)mysql_num_fields(mysql_result)) { -			php3_error(E_WARNING,"MySQL:  Bad field offset"); +			php_error(E_WARNING,"MySQL:  Bad field offset");  			RETURN_FALSE;  		}  		mysql_field_seek(mysql_result,field->value.lval); @@ -1697,12 +1697,12 @@ PHP_FUNCTION(mysql_field_seek)  	mysql_result = (MYSQL_RES *) php3_list_find(result->value.lval,&type);  	if (type!=le_result) { -		php3_error(E_WARNING,"%d is not a MySQL result index",result->value.lval); +		php_error(E_WARNING,"%d is not a MySQL result index",result->value.lval);  		RETURN_FALSE;  	}  	convert_to_long(offset);  	if (offset->value.lval<0 || offset->value.lval>=(int)mysql_num_fields(mysql_result)) { -		php3_error(E_WARNING,"Field %d is invalid for MySQL result index %d",offset->value.lval,result->value.lval); +		php_error(E_WARNING,"Field %d is invalid for MySQL result index %d",offset->value.lval,result->value.lval);  		RETURN_FALSE;  	}  	mysql_field_seek(mysql_result,offset->value.lval); @@ -1735,13 +1735,13 @@ static void php3_mysql_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)  	mysql_result = (MYSQL_RES *) php3_list_find(result->value.lval,&type);  	if (type!=le_result) { -		php3_error(E_WARNING,"%d is not a MySQL result index",result->value.lval); +		php_error(E_WARNING,"%d is not a MySQL result index",result->value.lval);  		RETURN_FALSE;  	}  	convert_to_long(field);  	if (field->value.lval<0 || field->value.lval>=(int)mysql_num_fields(mysql_result)) { -		php3_error(E_WARNING,"Field %d is invalid for MySQL result index %d",field->value.lval,result->value.lval); +		php_error(E_WARNING,"Field %d is invalid for MySQL result index %d",field->value.lval,result->value.lval);  		RETURN_FALSE;  	}  	mysql_field_seek(mysql_result,field->value.lval); @@ -1910,7 +1910,7 @@ PHP_FUNCTION(mysql_free_result)  	mysql_result = (MYSQL_RES *) php3_list_find(result->value.lval,&type);  	if (type!=le_result) { -		php3_error(E_WARNING,"%d is not a MySQL result index",result->value.lval); +		php_error(E_WARNING,"%d is not a MySQL result index",result->value.lval);  		RETURN_FALSE;  	}  	php3_list_delete(result->value.lval); diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index d25def9d00..5e01348a72 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -377,10 +377,10 @@ PHP_MINIT_FUNCTION(oci8)  	OCI8_GLOBAL(php3_oci8_module).le_stmt = register_list_destructors(_oci8_free_stmt, NULL);  	OCI8_GLOBAL(php3_oci8_module).user = malloc(sizeof(HashTable)); -	_php3_hash_init(OCI8_GLOBAL(php3_oci8_module).user, 13, NULL, NULL, 1); +	zend_hash_init(OCI8_GLOBAL(php3_oci8_module).user, 13, NULL, NULL, 1);  	OCI8_GLOBAL(php3_oci8_module).server = malloc(sizeof(HashTable)); -	_php3_hash_init(OCI8_GLOBAL(php3_oci8_module).server, 13, NULL, NULL, 1);  +	zend_hash_init(OCI8_GLOBAL(php3_oci8_module).server, 13, NULL, NULL, 1);   	if (cfg_get_long("oci8.debug_mode",  					 &OCI8_GLOBAL(php3_oci8_module).debug_mode) == FAILURE) { @@ -477,11 +477,11 @@ PHP_MSHUTDOWN_FUNCTION(oci8)  {      oci8_debug("php3_mshutdown_oci8"); -	_php3_hash_apply(OCI8_GLOBAL(php3_oci8_module).user,(int (*)(void *))_user_pcleanup); -	_php3_hash_apply(OCI8_GLOBAL(php3_oci8_module).server,(int (*)(void *))_server_pcleanup); +	zend_hash_apply(OCI8_GLOBAL(php3_oci8_module).user,(int (*)(void *))_user_pcleanup); +	zend_hash_apply(OCI8_GLOBAL(php3_oci8_module).server,(int (*)(void *))_server_pcleanup); -	_php3_hash_destroy(OCI8_GLOBAL(php3_oci8_module).user); -	_php3_hash_destroy(OCI8_GLOBAL(php3_oci8_module).server); +	zend_hash_destroy(OCI8_GLOBAL(php3_oci8_module).user); +	zend_hash_destroy(OCI8_GLOBAL(php3_oci8_module).server);  	free(OCI8_GLOBAL(php3_oci8_module).user);  	free(OCI8_GLOBAL(php3_oci8_module).server); @@ -552,8 +552,8 @@ PHP_RSHUTDOWN_FUNCTION(oci8)      oci8_debug("php3_rshutdown_oci8"); -	_php3_hash_apply(OCI8_GLOBAL(php3_oci8_module).user,(int (*)(void *))_user_cleanup); -	_php3_hash_apply(OCI8_GLOBAL(php3_oci8_module).server,(int (*)(void *))_server_cleanup); +	zend_hash_apply(OCI8_GLOBAL(php3_oci8_module).user,(int (*)(void *))_user_cleanup); +	zend_hash_apply(OCI8_GLOBAL(php3_oci8_module).server,(int (*)(void *))_server_cleanup);  	/* XXX free all statements, rollback all outstanding transactions */ @@ -564,7 +564,7 @@ PHP_RSHUTDOWN_FUNCTION(oci8)  PHP_MINFO_FUNCTION(oci8)  {  #if !(WIN32|WINNT) -	php3_printf("Oracle version: %s<br>\n" +	php_printf("Oracle version: %s<br>\n"  			    "Compile-time ORACLE_HOME: %s<br>\n"  			    "Libraries used: %s",  			    PHP_ORACLE_VERSION, PHP_ORACLE_HOME, PHP_ORACLE_LIBS); @@ -602,7 +602,7 @@ _oci8_free_column(oci8_out_column *column)  	if (column->data) {  		if (column->is_descr) { -			_php3_hash_index_del(column->statement->conn->descriptors,(int) column->data); +			zend_hash_index_del(column->statement->conn->descriptors,(int) column->data);  		} else {  			if (column->data) {  				efree(column->data); @@ -646,17 +646,17 @@ _oci8_free_stmt(oci8_statement *statement)  	}  	if (statement->columns) { -		_php3_hash_destroy(statement->columns); +		zend_hash_destroy(statement->columns);  		efree(statement->columns);  	}  	if (statement->binds) { -		_php3_hash_destroy(statement->binds); +		zend_hash_destroy(statement->binds);  		efree(statement->binds);  	}  	if (statement->defines) { -		_php3_hash_destroy(statement->defines); +		zend_hash_destroy(statement->defines);  		efree(statement->defines);  	} @@ -682,7 +682,7 @@ _oci8_close_conn(oci8_connection *connection)  	oci8_debug("_oci8_close_conn: id=%d",connection->id);  	if (connection->descriptors) { -		_php3_hash_destroy(connection->descriptors); +		zend_hash_destroy(connection->descriptors);  		efree(connection->descriptors);  	} @@ -710,27 +710,27 @@ oci8_error(OCIError *err_p, char *what, sword status)  		case OCI_SUCCESS:  			break;  		case OCI_SUCCESS_WITH_INFO: -			php3_error(E_WARNING, "%s: OCI_SUCCESS_WITH_INFO", what); +			php_error(E_WARNING, "%s: OCI_SUCCESS_WITH_INFO", what);  			break;  		case OCI_NEED_DATA: -			php3_error(E_WARNING, "%s: OCI_NEED_DATA", what); +			php_error(E_WARNING, "%s: OCI_NEED_DATA", what);  			break;  		case OCI_NO_DATA: -			php3_error(E_WARNING, "%s: OCI_NO_DATA", what); +			php_error(E_WARNING, "%s: OCI_NO_DATA", what);  			break;  		case OCI_ERROR:  			OCIErrorGet(err_p, (ub4)1, NULL, &errcode, errbuf,  						(ub4)sizeof(errbuf), (ub4)OCI_HTYPE_ERROR); -			php3_error(E_WARNING, "%s: %s", what, errbuf); +			php_error(E_WARNING, "%s: %s", what, errbuf);  			break;  		case OCI_INVALID_HANDLE: -			php3_error(E_WARNING, "%s: OCI_INVALID_HANDLE", what); +			php_error(E_WARNING, "%s: OCI_INVALID_HANDLE", what);  			break;  		case OCI_STILL_EXECUTING: -			php3_error(E_WARNING, "%s: OCI_STILL_EXECUTING", what); +			php_error(E_WARNING, "%s: OCI_STILL_EXECUTING", what);  			break;  		case OCI_CONTINUE: -			php3_error(E_WARNING, "%s: OCI_CONTINUE", what); +			php_error(E_WARNING, "%s: OCI_CONTINUE", what);  			break;  		default:  			break; @@ -769,7 +769,7 @@ static void oci8_debug(const char *format,...)  		va_end(args);  		buffer[sizeof(buffer)-1] = '\0';  		if (php3_header()) { -			php3_printf("OCIDebug: %s<br>\n", buffer); +			php_printf("OCIDebug: %s<br>\n", buffer);  		}  	}  } @@ -786,7 +786,7 @@ oci8_get_conn(int conn_ind, const char *func, HashTable *list)  	connection = (oci8_connection *)php3_list_find(conn_ind, &type);  	if (!connection || !OCI8_CONN_TYPE(type)) { -		php3_error(E_WARNING, "%s: invalid connection %d", func, conn_ind); +		php_error(E_WARNING, "%s: invalid connection %d", func, conn_ind);  		return (oci8_connection *)NULL;  	} @@ -810,7 +810,7 @@ oci8_get_stmt(int stmt_ind, const char *func, HashTable *list)  	statement = (oci8_statement *)php3_list_find(stmt_ind, &type);  	if (!statement || !OCI8_STMT_TYPE(type)) { -		php3_error(E_WARNING, "%s: invalid statement %d", func, stmt_ind); +		php_error(E_WARNING, "%s: invalid statement %d", func, stmt_ind);  		return (oci8_statement *)NULL;  	} @@ -853,8 +853,8 @@ oci8_get_col(oci8_statement *statement, int col, pval *pval, char *func)  			return oci8_get_col(statement,pval->value.lval,0,func);  		}  	} else if (col != -1) { -		if (_php3_hash_index_find(statement->columns, col, (void **)&outcol) == FAILURE) { -			php3_error(E_WARNING, "%s: invalid column %d", func, col); +		if (zend_hash_index_find(statement->columns, col, (void **)&outcol) == FAILURE) { +			php_error(E_WARNING, "%s: invalid column %d", func, col);  			return NULL;  		}  		return outcol; @@ -895,8 +895,8 @@ oci8_make_pval(pval *value,oci8_statement *statement,oci8_out_column *column, ch  		if ((column->data_type != SQLT_RDD) && (mode & OCI_RETURN_LOBS)) {  			/* OCI_RETURN_LOBS means that we want the content of the LOB back instead of the locator */ -	        if (_php3_hash_index_find(statement->conn->descriptors,(int)  column->data, (void **)&descr) == FAILURE) { -   	        	php3_error(E_WARNING, "unable to find my descriptor %d",column->data); +	        if (zend_hash_index_find(statement->conn->descriptors,(int)  column->data, (void **)&descr) == FAILURE) { +   	        	php_error(E_WARNING, "unable to find my descriptor %d",column->data);              	return -1;          	} @@ -1105,7 +1105,7 @@ oci8_execute(oci8_statement *statement, char *func,ub4 mode, HashTable *list)  		statement->columns = emalloc(sizeof(HashTable));  		if (!statement->columns || -			_php3_hash_init(statement->columns, 13, NULL,HASH_DTOR _oci8_free_column, 0) == FAILURE) { +			zend_hash_init(statement->columns, 13, NULL,HASH_DTOR _oci8_free_column, 0) == FAILURE) {  			/* out of memory */  			return 0;  		} @@ -1138,7 +1138,7 @@ oci8_execute(oci8_statement *statement, char *func,ub4 mode, HashTable *list)  		for (counter = 1; counter <= colcount; counter++) {  			memset(&column,0,sizeof(oci8_out_column)); -			if (_php3_hash_index_update(statement->columns, counter, &column, +			if (zend_hash_index_update(statement->columns, counter, &column,  										sizeof(oci8_out_column), (void**) &outcol) == FAILURE) {  				efree(statement->columns);  				/* out of memory */ @@ -1207,7 +1207,7 @@ oci8_execute(oci8_statement *statement, char *func,ub4 mode, HashTable *list)  			/* find a user-setted define */  			if (statement->defines) { -				_php3_hash_find(statement->defines,outcol->name,outcol->name_len,(void **) &outcol->define); +				zend_hash_find(statement->defines,outcol->name,outcol->name_len,(void **) &outcol->define);  			}  			buf = 0; @@ -1257,7 +1257,7 @@ oci8_execute(oci8_statement *statement, char *func,ub4 mode, HashTable *list)  									   (size_t) 0,  									   (dvoid **) 0); -					_php3_hash_index_update(statement->conn->descriptors,  +					zend_hash_index_update(statement->conn->descriptors,   											statement->conn->descriptors_count,  											&descr,  											sizeof(oci8_descriptor), @@ -1394,7 +1394,7 @@ oci8_fetch(oci8_statement *statement, ub4 nrows, char *func)  	if ((statement->error == OCI_NO_DATA) || (nrows == 0)) {  		/* XXX this is needed for REFCURSORS! */  		if (statement->columns) { -			_php3_hash_destroy(statement->columns); +			zend_hash_destroy(statement->columns);  			efree(statement->columns);  			statement->columns = 0;  		} @@ -1613,7 +1613,7 @@ oci8_define_callback(dvoid *octxp,  		}  		if (! outcol->data) { -			php3_error(E_WARNING, "OCIFetch: cannot allocate %d bytes!",outcol->storage_size4); +			php_error(E_WARNING, "OCIFetch: cannot allocate %d bytes!",outcol->storage_size4);  			return OCI_ERROR;  		} @@ -1664,7 +1664,7 @@ oci8_bind_in_callback(dvoid *ictxp, /* context pointer */  	phpbind = (oci8_bind *)ictxp;  	if (!phpbind || !(val = phpbind->value)) { -		php3_error(E_WARNING, "!phpbind || !phpbind->val"); +		php_error(E_WARNING, "!phpbind || !phpbind->val");  		return OCI_ERROR;  	} @@ -1776,7 +1776,7 @@ static oci8_session *oci8_open_user(oci8_server* server,char *username,char *pas  			SAFE_STRING(server->dbname));  	if (! exclusive) { -		_php3_hash_find(OCI8_GLOBAL(php3_oci8_module).user, hashed_details, hashed_details_length+1, (void **) &session); +		zend_hash_find(OCI8_GLOBAL(php3_oci8_module).user, hashed_details, hashed_details_length+1, (void **) &session);  		if (session) {  			if (session->open) { @@ -1885,10 +1885,10 @@ static oci8_session *oci8_open_user(oci8_server* server,char *username,char *pas  	oci8_debug("oci8_open_user new sess=%d user=%s",session->num,username);  	if (exclusive) { -		_php3_hash_next_index_pointer_insert(OCI8_GLOBAL(php3_oci8_module).user, +		zend_hash_next_index_pointer_insert(OCI8_GLOBAL(php3_oci8_module).user,  											 (void *) session);  	} else { -		_php3_hash_pointer_update(OCI8_GLOBAL(php3_oci8_module).user, +		zend_hash_pointer_update(OCI8_GLOBAL(php3_oci8_module).user,  								  hashed_details,  								  hashed_details_length+1,   								  (void *) session); @@ -2021,7 +2021,7 @@ static oci8_server *oci8_open_server(char *dbname,int persistent)  	hashed_details = (char *) emalloc(hashed_details_length+1);  	sprintf(hashed_details,"%s",SAFE_STRING((char *)dbname)); -	_php3_hash_find(OCI8_GLOBAL(php3_oci8_module).server, hashed_details, hashed_details_length+1, (void **) &server); +	zend_hash_find(OCI8_GLOBAL(php3_oci8_module).server, hashed_details, hashed_details_length+1, (void **) &server);  	if (server) {  		if (server->open) { @@ -2090,7 +2090,7 @@ static oci8_server *oci8_open_server(char *dbname,int persistent)  	oci8_debug("oci8_open_server new conn=%d dname=%s",server->num,server->dbname); -	_php3_hash_pointer_update(OCI8_GLOBAL(php3_oci8_module).server, +	zend_hash_pointer_update(OCI8_GLOBAL(php3_oci8_module).server,  							  hashed_details,  							  hashed_details_length+1,   							  (void *) server); @@ -2280,7 +2280,7 @@ static void oci8_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent,int excl  	connection->descriptors = emalloc(sizeof(HashTable));  	if (!connection->descriptors || -		_php3_hash_init(connection->descriptors, 13, NULL,HASH_DTOR _oci8_free_descr, 0) == FAILURE) { +		zend_hash_init(connection->descriptors, 13, NULL,HASH_DTOR _oci8_free_descr, 0) == FAILURE) {          goto CLEANUP;      } @@ -2343,12 +2343,12 @@ PHP_FUNCTION(oci8_definebyname)  	if (statement->defines == NULL) {  		statement->defines = emalloc(sizeof(HashTable));  		if (statement->defines == NULL || -			_php3_hash_init(statement->defines, 13, NULL,HASH_DTOR oci8_free_define, 0) == FAILURE) { +			zend_hash_init(statement->defines, 13, NULL,HASH_DTOR oci8_free_define, 0) == FAILURE) {  			/* out of memory */  			RETURN_FALSE;  		}  	} -	if (_php3_hash_add(statement->defines, +	if (zend_hash_add(statement->defines,  					   name->value.str.val,  					   name->value.str.len,  					   define, @@ -2407,13 +2407,13 @@ PHP_FUNCTION(oci8_bindbyname)  	switch (var->type) {  		case IS_OBJECT : -	        if (_php3_hash_find(var->value.ht, "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { -   		         php3_error(E_WARNING, "unable to find my descriptor property"); +	        if (zend_hash_find(var->value.ht, "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { +   		         php_error(E_WARNING, "unable to find my descriptor property");     		         RETURN_FALSE;          	} -			if (_php3_hash_index_find(statement->conn->descriptors, tmp->value.lval, (void **)&descr) == FAILURE) { -   		         php3_error(E_WARNING, "unable to find my descriptor"); +			if (zend_hash_index_find(statement->conn->descriptors, tmp->value.lval, (void **)&descr) == FAILURE) { +   		         php_error(E_WARNING, "unable to find my descriptor");     		         RETURN_FALSE;  			} @@ -2438,7 +2438,7 @@ PHP_FUNCTION(oci8_bindbyname)  				convert_to_string(var);  				if (ocimaxlen == -1) {  					if (var->value.str.len == 0) { -						php3_error(E_WARNING, "OCIBindByName bindlength is 0"); +						php_error(E_WARNING, "OCIBindByName bindlength is 0");  					}  					if (ocitype == SQLT_BIN) { @@ -2462,12 +2462,12 @@ PHP_FUNCTION(oci8_bindbyname)  	if (statement->binds == NULL) {  		statement->binds = emalloc(sizeof(HashTable));  		if (statement->binds == NULL || -			_php3_hash_init(statement->binds, 13, NULL, NULL, 0) == FAILURE) { +			zend_hash_init(statement->binds, 13, NULL, NULL, 0) == FAILURE) {  			/* out of memory */  			RETURN_FALSE;  		}  	} -	if (_php3_hash_next_index_insert(statement->binds, bind, +	if (zend_hash_next_index_insert(statement->binds, bind,  									 sizeof(oci8_bind),  									 (void **)&tmp_bind) == SUCCESS) {  		efree(bind); @@ -2529,8 +2529,8 @@ PHP_FUNCTION(oci8_freedesc)  #else  	if ((id = getThis()) != 0) {  #endif -        if (_php3_hash_find(id->value.ht, "connection", sizeof("connection"), (void **)&conn) == FAILURE) { -            php3_error(E_WARNING, "unable to find my statement property"); +        if (zend_hash_find(id->value.ht, "connection", sizeof("connection"), (void **)&conn) == FAILURE) { +            php_error(E_WARNING, "unable to find my statement property");              RETURN_FALSE;          } @@ -2539,14 +2539,14 @@ PHP_FUNCTION(oci8_freedesc)              RETURN_FALSE;          } -   		if (_php3_hash_find(id->value.ht, "descriptor", sizeof("descriptor"), (void **)&desc) == FAILURE) { -			php3_error(E_WARNING, "unable to find my locator property"); +   		if (zend_hash_find(id->value.ht, "descriptor", sizeof("descriptor"), (void **)&desc) == FAILURE) { +			php_error(E_WARNING, "unable to find my locator property");  			RETURN_FALSE;  		}  		oci8_debug("OCOfreedesc: descr=%d",desc->value.lval); -		_php3_hash_index_del(connection->descriptors,desc->value.lval); +		zend_hash_index_del(connection->descriptors,desc->value.lval);  	 	RETURN_TRUE;  	} @@ -2572,8 +2572,8 @@ PHP_FUNCTION(oci8_savedesc)  #else  	if ((id = getThis()) != 0) {  #endif -   		if (_php3_hash_find(id->value.ht, "connection", sizeof("connection"), (void **)&conn) == FAILURE) { -			php3_error(E_WARNING, "unable to find my statement property"); +   		if (zend_hash_find(id->value.ht, "connection", sizeof("connection"), (void **)&conn) == FAILURE) { +			php_error(E_WARNING, "unable to find my statement property");  			RETURN_FALSE;  		} @@ -2582,13 +2582,13 @@ PHP_FUNCTION(oci8_savedesc)  			RETURN_FALSE;  		} -   		if (_php3_hash_find(id->value.ht, "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { -			php3_error(E_WARNING, "unable to find my locator property"); +   		if (zend_hash_find(id->value.ht, "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { +			php_error(E_WARNING, "unable to find my locator property");  			RETURN_FALSE;  		} -        if (_php3_hash_index_find(connection->descriptors, tmp->value.lval, (void **)&descr) == FAILURE) { -        	php3_error(E_WARNING, "unable to find my descriptor %d",tmp->value.lval); +        if (zend_hash_index_find(connection->descriptors, tmp->value.lval, (void **)&descr) == FAILURE) { +        	php_error(E_WARNING, "unable to find my descriptor %d",tmp->value.lval);              RETURN_FALSE;          } @@ -2605,7 +2605,7 @@ PHP_FUNCTION(oci8_savedesc)  		loblen = arg->value.str.len;  		if (loblen < 1) { -			php3_error(E_WARNING, "Cannot save a lob wich size is less than 1 byte"); +			php_error(E_WARNING, "Cannot save a lob wich size is less than 1 byte");  			RETURN_FALSE;  		} @@ -2656,8 +2656,8 @@ PHP_FUNCTION(oci8_loaddesc)  #else  	if ((id = getThis()) != 0) {  #endif -   		if (_php3_hash_find(id->value.ht, "connection", sizeof("connection"), (void **)&conn) == FAILURE) { -			php3_error(E_WARNING, "unable to find my statement property"); +   		if (zend_hash_find(id->value.ht, "connection", sizeof("connection"), (void **)&conn) == FAILURE) { +			php_error(E_WARNING, "unable to find my statement property");  			RETURN_FALSE;  		} @@ -2666,13 +2666,13 @@ PHP_FUNCTION(oci8_loaddesc)  			RETURN_FALSE;  		} -   		if (_php3_hash_find(id->value.ht, "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { -			php3_error(E_WARNING, "unable to find my locator property"); +   		if (zend_hash_find(id->value.ht, "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) { +			php_error(E_WARNING, "unable to find my locator property");  			RETURN_FALSE;  		} -        if (_php3_hash_index_find(connection->descriptors, tmp->value.lval, (void **)&descr) == FAILURE) { -        	php3_error(E_WARNING, "unable to find my descriptor %d",tmp->value.lval); +        if (zend_hash_index_find(connection->descriptors, tmp->value.lval, (void **)&descr) == FAILURE) { +        	php_error(E_WARNING, "unable to find my descriptor %d",tmp->value.lval);              RETURN_FALSE;          } @@ -2714,7 +2714,7 @@ PHP_FUNCTION(oci8_newdescriptor)  			break;  	    default: -			php3_error(E_WARNING, "Unknown descriptor type %d.",descr.type); +			php_error(E_WARNING, "Unknown descriptor type %d.",descr.type);  			RETURN_FALSE;  	} @@ -2737,7 +2737,7 @@ PHP_FUNCTION(oci8_newdescriptor)  		RETURN_FALSE;  	} -	_php3_hash_index_update(connection->descriptors, connection->descriptors_count,&descr,sizeof(oci8_descriptor),NULL); +	zend_hash_index_update(connection->descriptors, connection->descriptors_count,&descr,sizeof(oci8_descriptor),NULL);  	mylob = connection->descriptors_count++; @@ -3131,7 +3131,7 @@ PHP_FUNCTION(oci8_fetchinto)  	if (! (mode & OCI_RETURN_NULLS)) {   		if (array->type == IS_ARRAY) {   			/* XXX is that right?? */ -			_php3_hash_destroy(array->value.ht); +			zend_hash_destroy(array->value.ht);  			efree(array->value.ht);  			var_reset(array);  		} @@ -3139,7 +3139,7 @@ PHP_FUNCTION(oci8_fetchinto)  	if (array->type != IS_ARRAY) {  		if (array_init(array) == FAILURE) { -			php3_error(E_WARNING, "OCIFetchInto: unable to convert arg 2 to array"); +			php_error(E_WARNING, "OCIFetchInto: unable to convert arg 2 to array");  			RETURN_FALSE;  		}  	} @@ -3165,9 +3165,9 @@ PHP_FUNCTION(oci8_fetchinto)  			oci8_make_pval(element,statement,column, "OCIFetchInto",mode);  #if PHP_API_VERSION >= 19990421 -			_php3_hash_index_update(array->value.ht, i, (void *)&element, sizeof(pval*), NULL); +			zend_hash_index_update(array->value.ht, i, (void *)&element, sizeof(pval*), NULL);  #else -			_php3_hash_index_update(array->value.ht, i, (void *)element, sizeof(pval), NULL); +			zend_hash_index_update(array->value.ht, i, (void *)element, sizeof(pval), NULL);  #endif  		} @@ -3178,9 +3178,9 @@ PHP_FUNCTION(oci8_fetchinto)  			oci8_make_pval(element,statement,column, "OCIFetchInto",mode);  #if PHP_API_VERSION >= 19990421 -		  	_php3_hash_update(array->value.ht, column->name, column->name_len+1, (void *)&element, sizeof(pval*), NULL); +		  	zend_hash_update(array->value.ht, column->name, column->name_len+1, (void *)&element, sizeof(pval*), NULL);  #else -		  	_php3_hash_update(array->value.ht, column->name, column->name_len+1, (void *)element, sizeof(pval), NULL); +		  	zend_hash_update(array->value.ht, column->name, column->name_len+1, (void *)element, sizeof(pval), NULL);  #endif  		}  	} @@ -3229,7 +3229,7 @@ PHP_FUNCTION(oci8_fetchstatement)  	if (array->type != IS_ARRAY) {  		if (array_init(array) == FAILURE) { -			php3_error(E_WARNING, "OCIFetchStatement: unable to convert arg 2 to array"); +			php_error(E_WARNING, "OCIFetchStatement: unable to convert arg 2 to array");  			RETURN_FALSE;  		}  	} @@ -3258,9 +3258,9 @@ PHP_FUNCTION(oci8_fetchstatement)  		namebuf[ columns[ i ]->name_len ] = 0;  #if PHP_API_VERSION < 19990421 -		_php3_hash_update(array->value.ht, namebuf, columns[ i ]->name_len+1, (void *) tmp, sizeof(pval), (void **) &(outarrs[ i ])); +		zend_hash_update(array->value.ht, namebuf, columns[ i ]->name_len+1, (void *) tmp, sizeof(pval), (void **) &(outarrs[ i ]));  #else -		_php3_hash_update(array->value.ht, namebuf, columns[ i ]->name_len+1, (void *) &tmp, sizeof(pval*), (void **) &(outarrs[ i ])); +		zend_hash_update(array->value.ht, namebuf, columns[ i ]->name_len+1, (void *) &tmp, sizeof(pval*), (void **) &(outarrs[ i ]));  #endif  	} @@ -3280,9 +3280,9 @@ PHP_FUNCTION(oci8_fetchstatement)  			oci8_make_pval(element,statement,columns[ i ], "OCIFetchStatement",OCI_RETURN_LOBS);  #if PHP_API_VERSION < 19990421 -			_php3_hash_index_update(outarrs[ i ]->value.ht, rows, (void *)element, sizeof(pval), NULL); +			zend_hash_index_update(outarrs[ i ]->value.ht, rows, (void *)element, sizeof(pval), NULL);  #else -			_php3_hash_index_update((*(outarrs[ i ]))->value.ht, rows, (void *)&element, sizeof(pval*), NULL); +			zend_hash_index_update((*(outarrs[ i ]))->value.ht, rows, (void *)&element, sizeof(pval*), NULL);  #endif  		}  		rows++; @@ -3356,7 +3356,7 @@ PHP_FUNCTION(oci8_logout)  	connection->open = 0; -	_php3_hash_apply(list,(int (*)(void *))_stmt_cleanup); +	zend_hash_apply(list,(int (*)(void *))_stmt_cleanup);  	if (php3_list_delete(index) == SUCCESS) {  		RETURN_TRUE; @@ -3449,7 +3449,7 @@ PHP_FUNCTION(oci8_error)  	}  	if (! errh) { -		php3_error(E_WARNING, "OCIError: unable to find Error handle"); +		php_error(E_WARNING, "OCIError: unable to find Error handle");  		RETURN_FALSE;  	} diff --git a/ext/oci8/php3_oci8.h b/ext/oci8/php3_oci8.h index bf466b0226..aeeb8c7313 100644 --- a/ext/oci8/php3_oci8.h +++ b/ext/oci8/php3_oci8.h @@ -184,7 +184,7 @@ extern php3_module_entry oci8_module_entry;  # define OCI8_STMT_TYPE(x) ((x)==OCI8_GLOBAL(php3_oci8_module).le_stmt)  # define RETURN_OUT_OF_MEMORY \ -	php3_error(E_WARNING, "Out of memory");\ +	php_error(E_WARNING, "Out of memory");\  	RETURN_FALSE  # define OCI8_FAIL(c,f,r) \  	php3i_oci8_error((c)->pError,(f),(r));\ diff --git a/ext/odbc/odbc.c b/ext/odbc/odbc.c index c32ca5cc26..fa39583bb7 100644 --- a/ext/odbc/odbc.c +++ b/ext/odbc/odbc.c @@ -146,7 +146,7 @@ static void _close_connection(odbc_connection *conn)  	ODBC_TLS_VARS;  	conn->open = 0; -	_php3_hash_apply(ODBCG(resource_list), +	zend_hash_apply(ODBCG(resource_list),  				(int (*)(void *))_results_cleanup);  	SQLDisconnect(conn->hdbc);  	SQLFreeConnect(conn->hdbc); @@ -161,7 +161,7 @@ static void _close_pconnection(odbc_connection *conn)  	conn->open = 0; -	_php3_hash_apply(ODBCG(resource_plist), +	zend_hash_apply(ODBCG(resource_plist),  				(int (*)(void *))_results_cleanup);  	SQLDisconnect(conn->hdbc); @@ -280,16 +280,16 @@ PHP_MINFO_FUNCTION(odbc)  {  	ODBC_TLS_VARS; -	php3_printf("ODBC compiled with \"" ODBC_TYPE "\" library"); -	php3_printf("<BR>"); +	php_printf("ODBC compiled with \"" ODBC_TYPE "\" library"); +	php_printf("<BR>");  #if DEBUG -	php3_printf("default_db: %s<br>\n",   ODBCG(defDB)); -	php3_printf("default_user: %s<br>\n", ODBCG(defUser)); -	php3_printf("default_pw: %s<br>\n",   ODBCG(defPW)); +	php_printf("default_db: %s<br>\n",   ODBCG(defDB)); +	php_printf("default_user: %s<br>\n", ODBCG(defUser)); +	php_printf("default_pw: %s<br>\n",   ODBCG(defPW));  #endif -	php3_printf("allow_persistent: %d<br>\n", ODBCG(allow_persistent)); -	php3_printf("max_persistent: %d<br>\n",   ODBCG(max_persistent)); -	php3_printf("max_links: %d<br>\n",        ODBCG(max_links)); +	php_printf("allow_persistent: %d<br>\n", ODBCG(allow_persistent)); +	php_printf("max_persistent: %d<br>\n",   ODBCG(max_persistent)); +	php_printf("max_links: %d<br>\n",        ODBCG(max_links));  }	  @@ -312,7 +312,7 @@ odbc_result *odbc_get_result(HashTable *list, int ind)  	res = (odbc_result*)php3_list_find(ind, &type);  	if (!res || type != ODBCG(le_result)) { -		php3_error(E_WARNING, "Bad result index %d", ind); +		php_error(E_WARNING, "Bad result index %d", ind);  		return NULL;  	}  	return res; @@ -326,7 +326,7 @@ void odbc_del_result(HashTable *list, int ind)  	res = (odbc_result *)php3_list_find(ind, &type);  	if (!res || type != ODBCG(le_result)) { -		php3_error(E_WARNING,"Can't find result %d", ind); +		php_error(E_WARNING,"Can't find result %d", ind);  		return;  	}  	php3_list_delete(ind); @@ -350,7 +350,7 @@ odbc_connection *odbc_get_conn(HashTable *list, int ind)  	if (conn && (type == ODBCG(le_conn) || type == ODBCG(le_pconn)))  		return conn; -	php3_error(E_WARNING,"Bad ODBC connection number (%d)", ind); +	php_error(E_WARNING,"Bad ODBC connection number (%d)", ind);  	return NULL;  } @@ -369,10 +369,10 @@ void ODBC_SQL_ERROR(HDBC conn, HSTMT stmt, char *func)  	SQLError(ODBCG(henv), conn, stmt, state,  			 &error, errormsg, sizeof(errormsg)-1, &errormsgsize);  	if (func) { -		php3_error(E_WARNING, "SQL error: %s, SQL state %s in %s", +		php_error(E_WARNING, "SQL error: %s, SQL state %s in %s",  				   errormsg, state, func);  	} else { -		php3_error(E_WARNING, "SQL error: %s, SQL state %s", +		php_error(E_WARNING, "SQL error: %s, SQL state %s",  				   errormsg, state);  	}  } @@ -384,7 +384,7 @@ PHP_FUNCTION(odbc_close_all)  {  	void *ptr;  	int type; -	int i, nument = _php3_hash_next_free_element(list); +	int i, nument = zend_hash_next_free_element(list);  	ODBC_TLS_VARS;  	for (i = 1; i < nument; i++) { @@ -457,7 +457,7 @@ int odbc_bindcols(odbc_result *result)  		emalloc(sizeof(odbc_result_value)*result->numcols);      if (result->values == NULL){ -        php3_error(E_WARNING, "Out of memory"); +        php_error(E_WARNING, "Out of memory");          SQLFreeStmt(result->stmt, SQL_DROP);          return 0;      } @@ -534,7 +534,7 @@ PHP_FUNCTION(odbc_prepare)  	result = (odbc_result *)emalloc(sizeof(odbc_result));  	if (result == NULL){ -		php3_error(E_WARNING, "Out of memory"); +		php_error(E_WARNING, "Out of memory");  		RETURN_FALSE;  	} @@ -543,7 +543,7 @@ PHP_FUNCTION(odbc_prepare)  	rc = SQLAllocStmt(curr_conn->hdbc, &(result->stmt));  	if (rc == SQL_INVALID_HANDLE){  		efree(result); -		php3_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in php3_odbc_prepare"); +		php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in php3_odbc_prepare");  		RETURN_FALSE;  	} @@ -606,7 +606,7 @@ PHP_FUNCTION(odbc_execute)          arr = *arg2;          if (arr.type != IS_ARRAY) { -            php3_error(E_WARNING, "No array passed to odbc_execute()"); +            php_error(E_WARNING, "No array passed to odbc_execute()");              return;          }      } @@ -620,33 +620,33 @@ PHP_FUNCTION(odbc_execute)  	}  	if (result->numparams > 0 && numArgs == 1) { -		php3_error(E_WARNING, "No parameters to SQL statement given"); +		php_error(E_WARNING, "No parameters to SQL statement given");  		RETURN_FALSE;  	}      if (result->numparams > 0){ -		if ((ne = _php3_hash_num_elements(arr.value.ht)) < result->numparams){ -			php3_error(E_WARNING,"Not enough parameters (%d should be %d) given", +		if ((ne = zend_hash_num_elements(arr.value.ht)) < result->numparams){ +			php_error(E_WARNING,"Not enough parameters (%d should be %d) given",  					   ne, result->numparams);  			RETURN_FALSE;  		}          pval_copy_constructor(arg2); -        _php3_hash_internal_pointer_reset(arr.value.ht); +        zend_hash_internal_pointer_reset(arr.value.ht);          params = (params_t *)emalloc(sizeof(params_t) * result->numparams);  		for (i = 1; i <= result->numparams; i++) { -            if (_php3_hash_get_current_data(arr.value.ht, (void **) &tmp) == FAILURE) { -                php3_error(E_WARNING,"Error getting parameter"); +            if (zend_hash_get_current_data(arr.value.ht, (void **) &tmp) == FAILURE) { +                php_error(E_WARNING,"Error getting parameter");                  SQLFreeStmt(result->stmt,SQL_RESET_PARAMS);  				efree(params);                  RETURN_FALSE;              }              convert_to_string(tmp);  			if (tmp->type != IS_STRING) { -				php3_error(E_WARNING,"Error converting parameter"); +				php_error(E_WARNING,"Error converting parameter");  				SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); -				_php3_hash_destroy(arr.value.ht); +				zend_hash_destroy(arr.value.ht);  				efree(arr.value.ht);  				efree(params);  				RETURN_FALSE; @@ -663,14 +663,14 @@ PHP_FUNCTION(odbc_execute)  				filename[tmp->value.str.len - 2] = '\0';                  if ((params[i-1].fp = open(filename,O_RDONLY)) == -1) { -					php3_error(E_WARNING,"Can't open file %s", filename); +					php_error(E_WARNING,"Can't open file %s", filename);  					SQLFreeStmt(result->stmt, SQL_RESET_PARAMS);  					for (i = 0; i < result->numparams; i++) {  						if (params[i].fp != -1) {  							close(params[i].fp);  						}  					} -					_php3_hash_destroy(arr.value.ht); +					zend_hash_destroy(arr.value.ht);  					efree(arr.value.ht);  					efree(params);  					RETURN_FALSE; @@ -684,9 +684,9 @@ PHP_FUNCTION(odbc_execute)  									  ¶ms[i-1].vallen);  			} else {  				/*if (IS_SQL_BINARY(sqltype)){ -	   				php3_error(E_WARNING,"No Filename for binary parameter"); +	   				php_error(E_WARNING,"No Filename for binary parameter");  					SQLFreeStmt(result->stmt,SQL_RESET_PARAMS); -					_php3_hash_destroy(arr.value.ht); +					zend_hash_destroy(arr.value.ht);  					efree(arr.value.ht);  					efree(params);  					RETURN_FALSE; @@ -697,7 +697,7 @@ PHP_FUNCTION(odbc_execute)  									  tmp->value.str.val, 0,  									  ¶ms[i-1].vallen);  			} -			_php3_hash_move_forward(arr.value.ht); +			zend_hash_move_forward(arr.value.ht);  		}  	}  	/* Close cursor, needed for doing multiple selects */ @@ -733,7 +733,7 @@ PHP_FUNCTION(odbc_execute)  			if (params[i].fp != -1)  				close(params[i].fp);  		} -		_php3_hash_destroy(arr.value.ht); +		zend_hash_destroy(arr.value.ht);  		efree(arr.value.ht);  		efree(params);  	} @@ -777,7 +777,7 @@ PHP_FUNCTION(odbc_cursor)  	if (max_len > 0){  		cursorname = emalloc(max_len + 1);  		if (cursorname == NULL){ -			php3_error(E_WARNING,"Out of memory"); +			php_error(E_WARNING,"Out of memory");  			RETURN_FALSE;  		}  		rc = SQLGetCursorName(result->stmt,cursorname,(SWORD)max_len,&len); @@ -801,7 +801,7 @@ PHP_FUNCTION(odbc_cursor)  					RETVAL_STRING(cursorname,1);  				}  			} else { -				php3_error(E_WARNING, "SQL error: %s, SQL state %s", errormsg, state); +				php_error(E_WARNING, "SQL error: %s, SQL state %s", errormsg, state);  				RETVAL_FALSE;  			}  		} else { @@ -846,13 +846,13 @@ PHP_FUNCTION(odbc_exec)  	result = (odbc_result *)emalloc(sizeof(odbc_result));  	if (result == NULL){ -		php3_error(E_WARNING, "Out of memory"); +		php_error(E_WARNING, "Out of memory");  		RETURN_FALSE;  	}  	rc = SQLAllocStmt(curr_conn->hdbc, &(result->stmt));  	if (rc == SQL_INVALID_HANDLE){ -		php3_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in PHP3_ODBC_DO"); +		php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in PHP3_ODBC_DO");  		efree(result);  		RETURN_FALSE;  	} @@ -946,7 +946,7 @@ PHP_FUNCTION(odbc_fetch_into)  	}  	if (!ParameterPassedByReference(ht, numArgs)){ -		php3_error(E_WARNING, "Array not passed by reference in call to odbc_fetch_into()"); +		php_error(E_WARNING, "Array not passed by reference in call to odbc_fetch_into()");  		RETURN_FALSE;  	}  #else @@ -959,7 +959,7 @@ PHP_FUNCTION(odbc_fetch_into)  	}  	if (!ParameterPassedByReference(ht, numArgs)){ -		php3_error(E_WARNING, "Array not passed by reference in call to odbc_fetch_into()"); +		php_error(E_WARNING, "Array not passed by reference in call to odbc_fetch_into()");  		RETURN_FALSE;  	}  #endif				 @@ -973,13 +973,13 @@ PHP_FUNCTION(odbc_fetch_into)  	}  	if (result->numcols == 0) { -		php3_error(E_WARNING, "No tuples available at this result index"); +		php_error(E_WARNING, "No tuples available at this result index");  		RETURN_FALSE;  	}  	if (arr->type != IS_ARRAY){  		if (array_init(arr) == FAILURE){ -			php3_error(E_WARNING, "Can't convert to type Array"); +			php_error(E_WARNING, "Can't convert to type Array");  			RETURN_FALSE;  		}  	} @@ -1055,7 +1055,7 @@ PHP_FUNCTION(odbc_fetch_into)  				tmp.value.str.val = estrndup(result->values[i].value,tmp.value.str.len);  				break;  		} -		_php3_hash_index_update(arr->value.ht, i, (void *) &tmp, sizeof(pval), NULL); +		zend_hash_index_update(arr->value.ht, i, (void *) &tmp, sizeof(pval), NULL);  	}  	if (buf) efree(buf);  	RETURN_LONG(result->numcols);	 @@ -1082,7 +1082,7 @@ PHP_FUNCTION(solid_fetch_prev)  	}  	if (result->numcols == 0) { -		php3_error(E_WARNING, "No tuples available at this result index"); +		php_error(E_WARNING, "No tuples available at this result index");  		RETURN_FALSE;  	}  	rc = SQLFetchPrev(result->stmt); @@ -1131,7 +1131,7 @@ PHP_FUNCTION(odbc_fetch_row)  	}  	if (result->numcols == 0) { -		php3_error(E_WARNING, "No tuples available at this result index"); +		php_error(E_WARNING, "No tuples available at this result index");  		RETURN_FALSE;  	} @@ -1200,7 +1200,7 @@ PHP_FUNCTION(odbc_result)  	}  	if ((result->numcols == 0)){ -		php3_error(E_WARNING, "No tuples available at this result index"); +		php_error(E_WARNING, "No tuples available at this result index");  		RETURN_FALSE;  	} @@ -1214,13 +1214,13 @@ PHP_FUNCTION(odbc_result)  		}  		if (field_ind < 0){ -			php3_error(E_WARNING, "Field %s not found", field); +			php_error(E_WARNING, "Field %s not found", field);  			RETURN_FALSE;  		}  	} else {  		/* check for limits of field_ind if the field parameter was an int */  		if (field_ind >= result->numcols || field_ind < 0){ -			php3_error(E_WARNING, "Field index is larger than the number of fields"); +			php_error(E_WARNING, "Field index is larger than the number of fields");  			RETURN_FALSE;  		}  	} @@ -1263,7 +1263,7 @@ PHP_FUNCTION(odbc_result)  			fieldsize = (result->longreadlen <= 0) ? 4096 : result->longreadlen;              field = emalloc(fieldsize);              if (!field){ -                php3_error(E_WARNING, "Out of memory"); +                php_error(E_WARNING, "Out of memory");                  RETURN_FALSE;              }  		/* SQLGetData will truncate CHAR data to fieldsize - 1 bytes and append \0. @@ -1307,7 +1307,7 @@ PHP_FUNCTION(odbc_result)  	/* We emalloc 1 byte more for SQL_C_CHAR (trailing \0) */  	fieldsize = (sql_c_type == SQL_C_CHAR) ? 4096 : 4095;      if ((field = emalloc(fieldsize)) == NULL){ -        php3_error(E_WARNING,"Out of memory"); +        php_error(E_WARNING,"Out of memory");          RETURN_FALSE;      } @@ -1373,7 +1373,7 @@ PHP_FUNCTION(odbc_result_all)  	}  	if (result->numcols == 0){ -		php3_error(E_WARNING, "No tuples available at this result index"); +		php_error(E_WARNING, "No tuples available at this result index");  		RETURN_FALSE;  	}  #if HAVE_SQL_EXTENDED_FETCH @@ -1384,26 +1384,26 @@ PHP_FUNCTION(odbc_result_all)  		rc = SQLFetch(result->stmt);  	if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO){ -		php3_printf("<h2>No rows found</h2>\n"); +		php_printf("<h2>No rows found</h2>\n");  		RETURN_LONG(0);  	}  	/* Start table tag */  	if (numArgs == 1){ -		php3_printf("<table><tr>"); +		php_printf("<table><tr>");  	} else {  		convert_to_string(arg2);	 -		php3_printf("<table %s ><tr>",arg2->value.str.val);  +		php_printf("<table %s ><tr>",arg2->value.str.val);   	}  	for(i = 0; i < result->numcols; i++) -		php3_printf("<th>%s</th>", result->values[i].name); +		php_printf("<th>%s</th>", result->values[i].name); -	php3_printf("</tr>\n"); +	php_printf("</tr>\n");  	while(rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO){  		result->fetched++; -		php3_printf("<tr>"); +		php_printf("<tr>");  		for(i = 0; i < result->numcols; i++){              sql_c_type = SQL_C_CHAR;              switch(result->values[i].coltype){ @@ -1411,14 +1411,14 @@ PHP_FUNCTION(odbc_result_all)                  case SQL_VARBINARY:                  case SQL_LONGVARBINARY:                      if (result->binmode <= 0){ -                        php3_printf("<td>Not printable</td>"); +                        php_printf("<td>Not printable</td>");                          break;                      }                      if (result->binmode <= 1) sql_c_type = SQL_C_BINARY;                   case SQL_LONGVARCHAR:                      if (IS_SQL_LONG(result->values[i].coltype) &&                          result->longreadlen <= 0){ -                        php3_printf("<td>Not printable</td>");  +                        php_printf("<td>Not printable</td>");                           break;                      } @@ -1427,37 +1427,37 @@ PHP_FUNCTION(odbc_result_all)                      rc = SQLGetData(result->stmt, (UWORD)(i + 1),sql_c_type,                                      buf, result->longreadlen, &result->values[i].vallen); -                    php3_printf("<td>"); +                    php_printf("<td>");                      if (rc == SQL_ERROR) {                          ODBC_SQL_ERROR(result->conn_ptr->hdbc, result->stmt, "SQLGetData"); -                        php3_printf("</td></tr></table>"); +                        php_printf("</td></tr></table>");                          efree(buf);                          RETURN_FALSE;                      }                      if (rc == SQL_SUCCESS_WITH_INFO) -                        php3_printf(buf,result->longreadlen); +                        php_printf(buf,result->longreadlen);                      else if (result->values[i].vallen == SQL_NULL_DATA){ -						php3_printf(" </td>"); +						php_printf(" </td>");  						break;                      }  		    else  		    { -                    	php3_printf(buf, result->values[i].vallen); +                    	php_printf(buf, result->values[i].vallen);  		    } -                    php3_printf("</td>"); +                    php_printf("</td>");                      break;                  default:                      if (result->values[i].vallen == SQL_NULL_DATA){ -                        php3_printf("<td> </td>"); +                        php_printf("<td> </td>");                      } else { -                        php3_printf("<td>%s</td>", result->values[i].value); +                        php_printf("<td>%s</td>", result->values[i].value);                      }                      break;              }  		} -   		php3_printf("</tr>\n"); +   		php_printf("</tr>\n");  #if HAVE_SQL_EXTENDED_FETCH  		if (result->fetch_abs) @@ -1466,7 +1466,7 @@ PHP_FUNCTION(odbc_result_all)  #endif  			rc = SQLFetch(result->stmt);		  	} -	php3_printf("</table>\n"); +	php_printf("</table>\n");      if (buf) efree(buf);  	RETURN_LONG(result->fetched);  } @@ -1556,7 +1556,7 @@ void php3_odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)  				cur_opt == SQL_CUR_USE_ODBC ||   				cur_opt == SQL_CUR_USE_DRIVER ||   				cur_opt == SQL_CUR_DEFAULT) ) { -				php3_error(E_WARNING, "odbc: Invalid Cursor type (%d)", cur_opt); +				php_error(E_WARNING, "odbc: Invalid Cursor type (%d)", cur_opt);  				RETURN_FALSE;  			}  			break; @@ -1578,14 +1578,14 @@ void php3_odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)  	}  	if (ODBCG(max_links) != -1 && ODBCG(num_links) >= ODBCG(max_links)) { -		php3_error(E_WARNING, "odbc: Too many open links (%d)", +		php_error(E_WARNING, "odbc: Too many open links (%d)",  				   ODBCG(num_links));  		RETURN_FALSE;  	}  	/* the user requested a persistent connection */  	if (persistent && ODBCG(max_persistent) != -1 && ODBCG(num_persistent) >= ODBCG(max_persistent)) { -		php3_error(E_WARNING,"odbc: Too many open persistent links (%d)", +		php_error(E_WARNING,"odbc: Too many open persistent links (%d)",  					ODBCG(num_persistent));  		RETURN_FALSE;  	} @@ -1594,11 +1594,11 @@ void php3_odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)  	hashed_details = emalloc(len);  	if (hashed_details == NULL) { -		php3_error(E_WARNING, "Out of memory"); +		php_error(E_WARNING, "Out of memory");  		RETURN_FALSE;  	} -	hashed_len = _php3_sprintf(hashed_details, "%s_%s_%s_%s_%d", ODBC_TYPE, db, uid, pwd, cur_opt); +	hashed_len = php_sprintf(hashed_details, "%s_%s_%s_%s_%d", ODBC_TYPE, db, uid, pwd, cur_opt);  	/* FIXME the idea of checking to see if our connection is already persistent  		is good, but it adds a lot of overhead to non-persistent connections.  We @@ -1607,9 +1607,9 @@ void php3_odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)  	 * no matter if it is to be persistent or not  	 */ -	if ((persistent || (_php3_hash_find(list, hashed_details, hashed_len + 1, +	if ((persistent || (zend_hash_find(list, hashed_details, hashed_len + 1,  		  (void **) &index_ptr) == FAILURE || !php3_list_find((int) index_ptr->ptr, &type))) && -		  _php3_hash_find(plist, hashed_details, hashed_len + 1, +		  zend_hash_find(plist, hashed_details, hashed_len + 1,  		  (void **) &index_ptr) == FAILURE) {  		/* the link is not in the persistent list */  		list_entry new_le, new_index_ptr; @@ -1713,7 +1713,7 @@ void php3_odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)  #else  			new_index_ptr.type = le_index_ptr;  #endif -			if (_php3_hash_update(plist,hashed_details,hashed_len + 1,(void *) &new_index_ptr, +			if (zend_hash_update(plist,hashed_details,hashed_len + 1,(void *) &new_index_ptr,  					sizeof(list_entry),NULL)==FAILURE) {  				SQLDisconnect(db_conn->hdbc);  				SQLFreeConnect(db_conn->hdbc); @@ -1733,7 +1733,7 @@ void php3_odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)  #else  			new_index_ptr.type = le_index_ptr;  #endif -			if (_php3_hash_update(list,hashed_details,hashed_len + 1,(void *) &new_index_ptr, +			if (zend_hash_update(list,hashed_details,hashed_len + 1,(void *) &new_index_ptr,  					sizeof(list_entry),NULL)==FAILURE) {  				SQLDisconnect(db_conn->hdbc);  				SQLFreeConnect(db_conn->hdbc); @@ -1868,17 +1868,17 @@ PHP_FUNCTION(odbc_field_name)  	}  	if (result->numcols == 0){ -		php3_error(E_WARNING, "No tuples available at this result index"); +		php_error(E_WARNING, "No tuples available at this result index");  		RETURN_FALSE;  	}  	if (arg2->value.lval > result->numcols){ -		php3_error(E_WARNING, "Field index larger than number of fields"); +		php_error(E_WARNING, "Field index larger than number of fields");  		RETURN_FALSE;  	}  	if (arg2->value.lval < 1){ -		php3_error(E_WARNING, "Field numbering starts at 1"); +		php_error(E_WARNING, "Field numbering starts at 1");  		RETURN_FALSE;  	} @@ -1907,12 +1907,12 @@ PHP_FUNCTION(odbc_field_type)  	}                 	if (result->numcols == 0){ -		php3_error(E_WARNING, "No tuples available at this result index"); +		php_error(E_WARNING, "No tuples available at this result index");  		RETURN_FALSE;  	}  	if (arg2->value.lval > result->numcols){ -		php3_error(E_WARNING, "Field index larger than number of fields"); +		php_error(E_WARNING, "Field index larger than number of fields");  		RETURN_FALSE;  	} @@ -1942,12 +1942,12 @@ PHP_FUNCTION(odbc_field_len)  	}                                                                  	if (result->numcols == 0){ -		php3_error(E_WARNING, "No tuples available at this result index"); +		php_error(E_WARNING, "No tuples available at this result index");  		RETURN_FALSE;  	}  	if (arg2->value.lval > result->numcols){ -		php3_error(E_WARNING, "Field index larger than number of fields"); +		php_error(E_WARNING, "Field index larger than number of fields");  		RETURN_FALSE;  	}  	SQLColAttributes(result->stmt, (UWORD)arg2->value.lval,  @@ -1976,7 +1976,7 @@ PHP_FUNCTION(odbc_field_num)  	fname = arg2->value.str.val;  	if (arg1->value.lval == 1){ -		php3_error(E_WARNING, "No tuples available at this result index"); +		php_error(E_WARNING, "No tuples available at this result index");  		RETURN_FALSE;  	}  	if ((result = odbc_get_result(list, arg1->value.lval)) == NULL) { @@ -2129,7 +2129,7 @@ PHP_FUNCTION(odbc_setoption)  			}  			break;  		default: -			php3_error(E_WARNING, "Unknown option type"); +			php_error(E_WARNING, "Unknown option type");  			RETURN_FALSE;  			break;  	} diff --git a/ext/odbc/velocis.c b/ext/odbc/velocis.c index d03f025576..51fca53980 100644 --- a/ext/odbc/velocis.c +++ b/ext/odbc/velocis.c @@ -101,7 +101,7 @@ PHP_RINIT_FUNCTION(velocis)  PHP_MINFO_FUNCTION(velocis)  { -	php3_printf("RAIMA Velocis Support Active"); +	php_printf("RAIMA Velocis Support Active");  }  PHP_MSHUTDOWN_FUNCTION(velocis) @@ -188,7 +188,7 @@ PHP_FUNCTION(velocis_connect)  	long ind;  	if ( php3_velocis_module.max_links != -1 && php3_velocis_module.num_links == php3_velocis_module.max_links ) { -		php3_error(E_WARNING,"Velocis: Too many open connections (%d)",php3_velocis_module.num_links); +		php_error(E_WARNING,"Velocis: Too many open connections (%d)",php3_velocis_module.num_links);  		RETURN_FALSE;  	}  	if ( ARG_COUNT(ht) != 3 || @@ -203,18 +203,18 @@ PHP_FUNCTION(velocis_connect)  	Pass = pass->value.str.val;  	stat = SQLAllocConnect(henv,&hdbc);  	if ( stat != SQL_SUCCESS ) { -		php3_error(E_WARNING,"Velocis: Could not allocate connection handle"); +		php_error(E_WARNING,"Velocis: Could not allocate connection handle");  		RETURN_FALSE;  	}  	stat = SQLConnect(hdbc,Serv,SQL_NTS,User,SQL_NTS,Pass,SQL_NTS);  	if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) { -		php3_error(E_WARNING,"Velocis: Could not connect to server \"%s\" for %s",Serv,User); +		php_error(E_WARNING,"Velocis: Could not connect to server \"%s\" for %s",Serv,User);  		SQLFreeConnect(hdbc);  		RETURN_FALSE;  	}  	new = (VConn *)emalloc(sizeof(VConn));  	if ( new == NULL ) { -		php3_error(E_WARNING,"Velocis: Out of memory for store connection"); +		php_error(E_WARNING,"Velocis: Out of memory for store connection");  		SQLFreeConnect(hdbc);  		RETURN_FALSE;  	} @@ -234,7 +234,7 @@ PHP_FUNCTION(velocis_close)  	convert_to_long(id);  	conn = velocis_find_conn(list,id->value.lval);  	if ( !conn ) { -		php3_error(E_WARNING,"Velocis: Not connection index (%d)",id->value.lval); +		php_error(E_WARNING,"Velocis: Not connection index (%d)",id->value.lval);  		RETURN_FALSE;  	}  	SQLDisconnect(conn->hdbc); @@ -261,7 +261,7 @@ PHP_FUNCTION(velocis_exec)  	convert_to_long(ind);  	conn = velocis_find_conn(list,ind->value.lval);  	if ( !conn ) { -		php3_error(E_WARNING,"Velocis: Not connection index (%d)",ind->value.lval); +		php_error(E_WARNING,"Velocis: Not connection index (%d)",ind->value.lval);  		RETURN_FALSE;  	}  	convert_to_string(exec_str); @@ -269,18 +269,18 @@ PHP_FUNCTION(velocis_exec)  	res = (Vresult *)emalloc(sizeof(Vresult));  	if ( res == NULL ) { -		php3_error(E_WARNING,"Velocis: Out of memory for result"); +		php_error(E_WARNING,"Velocis: Out of memory for result");  		RETURN_FALSE;  	}  	stat = SQLAllocStmt(conn->hdbc,&res->hstmt);  	if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) { -		php3_error(E_WARNING,"Velocis: SQLAllocStmt return %d",stat); +		php_error(E_WARNING,"Velocis: SQLAllocStmt return %d",stat);  		efree(res);  		RETURN_FALSE;  	}  	stat = SQLExecDirect(res->hstmt,query,SQL_NTS);  	if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) { -		php3_error(E_WARNING,"Velocis: Can not execute \"%s\" query",query); +		php_error(E_WARNING,"Velocis: Can not execute \"%s\" query",query);  		SQLFreeStmt(res->hstmt,SQL_DROP);  		efree(res);  		RETURN_FALSE; @@ -288,7 +288,7 @@ PHP_FUNCTION(velocis_exec)  	/* Success query */  	stat = SQLNumResultCols(res->hstmt,&cols);  	if ( stat != SQL_SUCCESS ) { -		php3_error(E_WARNING,"Velocis: SQLNumResultCols return %d",stat); +		php_error(E_WARNING,"Velocis: SQLNumResultCols return %d",stat);  		SQLFreeStmt(res->hstmt,SQL_DROP);  		efree(res);  		RETURN_FALSE; @@ -296,7 +296,7 @@ PHP_FUNCTION(velocis_exec)  	if ( !cols ) { /* Was INSERT, UPDATE, DELETE, etc. query */  		stat = SQLRowCount(res->hstmt,&rows);  		if ( stat != SQL_SUCCESS ) { -			php3_error(E_WARNING,"Velocis: SQLNumResultCols return %d",stat); +			php_error(E_WARNING,"Velocis: SQLNumResultCols return %d",stat);  			SQLFreeStmt(res->hstmt,SQL_DROP);  			efree(res);  			RETURN_FALSE; @@ -307,7 +307,7 @@ PHP_FUNCTION(velocis_exec)  	} else {  /* Was SELECT query */  		res->values = (VResVal *)emalloc(sizeof(VResVal)*cols);  		if ( res->values == NULL ) { -			php3_error(E_WARNING,"Velocis: Out of memory for result columns"); +			php_error(E_WARNING,"Velocis: Out of memory for result columns");  			SQLFreeStmt(res->hstmt,SQL_DROP);  			efree(res);  			RETURN_FALSE; @@ -356,7 +356,7 @@ PHP_FUNCTION(velocis_fetch)  	convert_to_long(ind);  	res = velocis_find_result(list,ind->value.lval);  	if ( !res ) { -		php3_error(E_WARNING,"Velocis: Not result index (%d)",ind->value.lval); +		php_error(E_WARNING,"Velocis: Not result index (%d)",ind->value.lval);  		RETURN_FALSE;  	}  	stat = SQLExtendedFetch(res->hstmt,SQL_FETCH_NEXT,1,&row,RowStat); @@ -366,7 +366,7 @@ PHP_FUNCTION(velocis_fetch)  		RETURN_FALSE;  	}  	if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) { -		php3_error(E_WARNING,"Velocis: SQLFetch return error"); +		php_error(E_WARNING,"Velocis: SQLFetch return error");  		SQLFreeStmt(res->hstmt,SQL_DROP);  		velocis_del_result(list,ind->value.lval);  		RETURN_FALSE; @@ -392,7 +392,7 @@ PHP_FUNCTION(velocis_result)  	convert_to_long(ind);  	res = velocis_find_result(list,ind->value.lval);  	if ( !res ) { -		php3_error(E_WARNING,"Velocis: Not result index (%d),ind->value.lval"); +		php_error(E_WARNING,"Velocis: Not result index (%d),ind->value.lval");  		RETURN_FALSE;  	}  	if ( col->type == IS_STRING ) { @@ -409,12 +409,12 @@ PHP_FUNCTION(velocis_result)  			}  		}  		if ( indx < 0 ) { -			php3_error(E_WARNING, "Field %s not found",field); +			php_error(E_WARNING, "Field %s not found",field);  			RETURN_FALSE;  		}  	} else {  		if ( indx < 0 || indx >= res->numcols ) { -			php3_error(E_WARNING,"Velocis: Field index not in range"); +			php_error(E_WARNING,"Velocis: Field index not in range");  			RETURN_FALSE;  		}  	} @@ -426,7 +426,7 @@ PHP_FUNCTION(velocis_result)  			RETURN_FALSE;  		}  		if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) { -			php3_error(E_WARNING,"Velocis: SQLFetch return error"); +			php_error(E_WARNING,"Velocis: SQLFetch return error");  			SQLFreeStmt(res->hstmt,SQL_DROP);  			velocis_del_result(list,ind->value.lval);  			RETURN_FALSE; @@ -443,7 +443,7 @@ l1:  			if ( !res->values[indx].value ) {  				res->values[indx].value = emalloc(4096);  				if ( !res->values[indx].value ) { -					php3_error(E_WARNING,"Out of memory"); +					php_error(E_WARNING,"Out of memory");  					RETURN_FALSE;  				}  			} @@ -455,7 +455,7 @@ l1:  				RETURN_FALSE;  			}  			if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) { -				php3_error(E_WARNING,"Velocis: SQLGetData return error"); +				php_error(E_WARNING,"Velocis: SQLGetData return error");  				SQLFreeStmt(res->hstmt,SQL_DROP);  				velocis_del_result(list,ind->value.lval);  				RETURN_FALSE; @@ -483,7 +483,7 @@ PHP_FUNCTION(velocis_freeresult)  	convert_to_long(ind);  	res = velocis_find_result(list,ind->value.lval);  	if ( !res ) { -		php3_error(E_WARNING,"Velocis: Not result index (%d)",ind->value.lval); +		php_error(E_WARNING,"Velocis: Not result index (%d)",ind->value.lval);  		RETURN_FALSE;  	}  	SQLFreeStmt(res->hstmt,SQL_DROP); @@ -503,12 +503,12 @@ PHP_FUNCTION(velocis_autocommit)  	convert_to_long(id);  	conn = velocis_find_conn(list,id->value.lval);  	if ( !conn ) { -		php3_error(E_WARNING,"Velocis: Not connection index (%d)",id->value.lval); +		php_error(E_WARNING,"Velocis: Not connection index (%d)",id->value.lval);  		RETURN_FALSE;  	}  	stat = SQLSetConnectOption(conn->hdbc,SQL_AUTOCOMMIT,SQL_AUTOCOMMIT_ON);  	if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) { -		php3_error(E_WARNING,"Velocis: Set autocommit_on option failure"); +		php_error(E_WARNING,"Velocis: Set autocommit_on option failure");  		RETURN_FALSE;  	}  	RETURN_TRUE; @@ -526,12 +526,12 @@ PHP_FUNCTION(velocis_off_autocommit)  	convert_to_long(id);  	conn = velocis_find_conn(list,id->value.lval);  	if ( !conn ) { -		php3_error(E_WARNING,"Velocis: Not connection index (%d)",id->value.lval); +		php_error(E_WARNING,"Velocis: Not connection index (%d)",id->value.lval);  		RETURN_FALSE;  	}  	stat = SQLSetConnectOption(conn->hdbc,SQL_AUTOCOMMIT,SQL_AUTOCOMMIT_OFF);  	if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) { -		php3_error(E_WARNING,"Velocis: Set autocommit_off option failure"); +		php_error(E_WARNING,"Velocis: Set autocommit_off option failure");  		RETURN_FALSE;  	}  	RETURN_TRUE; @@ -549,12 +549,12 @@ PHP_FUNCTION(velocis_commit)  	convert_to_long(id);  	conn = velocis_find_conn(list,id->value.lval);  	if ( !conn ) { -		php3_error(E_WARNING,"Velocis: Not connection index (%d)",id->value.lval); +		php_error(E_WARNING,"Velocis: Not connection index (%d)",id->value.lval);  		RETURN_FALSE;  	}  	stat = SQLTransact(NULL,conn->hdbc,SQL_COMMIT);  	if ( stat != SQL_SUCCESS ) { -		php3_error(E_WARNING,"Velocis: Commit failure"); +		php_error(E_WARNING,"Velocis: Commit failure");  		RETURN_FALSE;  	}  	RETURN_TRUE; @@ -572,12 +572,12 @@ PHP_FUNCTION(velocis_rollback)  	convert_to_long(id);  	conn = velocis_find_conn(list,id->value.lval);  	if ( !conn ) { -		php3_error(E_WARNING,"Velocis: Not connection index (%d)",id->value.lval); +		php_error(E_WARNING,"Velocis: Not connection index (%d)",id->value.lval);  		RETURN_FALSE;  	}  	stat = SQLTransact(NULL,conn->hdbc,SQL_ROLLBACK);  	if ( stat != SQL_SUCCESS ) { -		php3_error(E_WARNING,"Velocis: Rollback failure"); +		php_error(E_WARNING,"Velocis: Rollback failure");  		RETURN_FALSE;  	}  	RETURN_TRUE; @@ -595,13 +595,13 @@ PHP_FUNCTION(velocis_fieldname)  	convert_to_long(ind);  	res = velocis_find_result(list,ind->value.lval);  	if ( !res ) { -		php3_error(E_WARNING,"Velocis: Not result index (%d),ind->value.lval"); +		php_error(E_WARNING,"Velocis: Not result index (%d),ind->value.lval");  		RETURN_FALSE;  	}  	convert_to_long(col);  	indx = col->value.lval;  	if ( indx < 0 || indx >= res->numcols ) { -		php3_error(E_WARNING,"Velocis: Field index not in range"); +		php_error(E_WARNING,"Velocis: Field index not in range");  		RETURN_FALSE;  	}  	RETURN_STRING(res->values[indx].name,TRUE); @@ -618,7 +618,7 @@ PHP_FUNCTION(velocis_fieldnum)  	convert_to_long(ind);  	res = velocis_find_result(list,ind->value.lval);  	if ( !res ) { -		php3_error(E_WARNING,"Velocis: Not result index (%d),ind->value.lval"); +		php_error(E_WARNING,"Velocis: Not result index (%d),ind->value.lval");  		RETURN_FALSE;  	}  	RETURN_LONG(res->numcols); diff --git a/ext/oracle/oracle.c b/ext/oracle/oracle.c index 3bb1744933..15756751d3 100644 --- a/ext/oracle/oracle.c +++ b/ext/oracle/oracle.c @@ -201,7 +201,7 @@ static int _close_oraconn(oraConnection *conn)  	ORACLE_GLOBAL(php3_oracle_module).num_links--;  	efree(conn); -	_php3_hash_del(ORACLE_GLOBAL(php3_oracle_module).conns,(void*)&conn,sizeof(void*)); +	zend_hash_del(ORACLE_GLOBAL(php3_oracle_module).conns,(void*)&conn,sizeof(void*));  	return 1;  } @@ -217,7 +217,7 @@ static int _close_orapconn(oraConnection *conn)  	ORACLE_GLOBAL(php3_oracle_module).num_links--;  	ORACLE_GLOBAL(php3_oracle_module).num_persistent--; -	_php3_hash_del(ORACLE_GLOBAL(php3_oracle_module).conns,(void*)&conn,sizeof(void*)); +	zend_hash_del(ORACLE_GLOBAL(php3_oracle_module).conns,(void*)&conn,sizeof(void*));  	return 1;  } @@ -242,7 +242,7 @@ static int _close_oracur(oraCursor *cur)  			efree(cur->query);  		}  		if (cur->params){ -			_php3_hash_destroy(cur->params); +			zend_hash_destroy(cur->params);  			efree(cur->params);  			cur->params = NULL;  		} @@ -258,7 +258,7 @@ static int _close_oracur(oraCursor *cur)  		if (cur->open){  			oraConnection *db_conn; -			if (_php3_hash_find(ORACLE_GLOBAL(php3_oracle_module).conns,(void*)&(cur->conn_ptr),sizeof(void*),(void **)&db_conn) == SUCCESS) { +			if (zend_hash_find(ORACLE_GLOBAL(php3_oracle_module).conns,(void*)&(cur->conn_ptr),sizeof(void*),(void **)&db_conn) == SUCCESS) {  				oclose(&cur->cda);  			}   		} @@ -316,7 +316,7 @@ PHP_MINIT_FUNCTION(oracle)  		register_list_destructors(NULL, _close_orapconn);  	ORACLE_GLOBAL(php3_oracle_module).conns = malloc(sizeof(HashTable)); -	_php3_hash_init(ORACLE_GLOBAL(php3_oracle_module).conns, 13, NULL, NULL, 1); +	zend_hash_init(ORACLE_GLOBAL(php3_oracle_module).conns, 13, NULL, NULL, 1);  	REGISTER_LONG_CONSTANT("ORA_BIND_INOUT", 0, CONST_CS | CONST_PERSISTENT);  	REGISTER_LONG_CONSTANT("ORA_BIND_IN",    1, CONST_CS | CONST_PERSISTENT); @@ -365,7 +365,7 @@ PHP_MSHUTDOWN_FUNCTION(oracle)  	PHP3_MUTEX_UNLOCK(oracle_mutex);  #endif -	_php3_hash_destroy(ORACLE_GLOBAL(php3_oracle_module).conns); +	zend_hash_destroy(ORACLE_GLOBAL(php3_oracle_module).conns);  	free(ORACLE_GLOBAL(php3_oracle_module).conns);  	return SUCCESS; @@ -445,7 +445,7 @@ void php3_Ora_Do_Logon(INTERNAL_FUNCTION_PARAMETERS, int persistent)  	if (ORACLE_GLOBAL(php3_oracle_module).max_links != -1 &&  		ORACLE_GLOBAL(php3_oracle_module).num_links >=  		ORACLE_GLOBAL(php3_oracle_module).max_links) { -		php3_error(E_WARNING, "Oracle: Too many open links (%d)", +		php_error(E_WARNING, "Oracle: Too many open links (%d)",  				   ORACLE_GLOBAL(php3_oracle_module).num_links);  		RETURN_FALSE;  	} @@ -455,7 +455,7 @@ void php3_Ora_Do_Logon(INTERNAL_FUNCTION_PARAMETERS, int persistent)  		ORACLE_GLOBAL(php3_oracle_module).max_persistent != -1 &&  		ORACLE_GLOBAL(php3_oracle_module).num_persistent >=  		ORACLE_GLOBAL(php3_oracle_module).max_persistent) { -		php3_error(E_WARNING,"Oracle: Too many open persistent links (%d)", +		php_error(E_WARNING,"Oracle: Too many open persistent links (%d)",  				   ORACLE_GLOBAL(php3_oracle_module).num_persistent);  		RETURN_FALSE;  	} @@ -464,17 +464,17 @@ void php3_Ora_Do_Logon(INTERNAL_FUNCTION_PARAMETERS, int persistent)  	hashed_details = emalloc(len);  	if (hashed_details == NULL) { -		php3_error(E_WARNING, "Out of memory"); +		php_error(E_WARNING, "Out of memory");  		RETURN_FALSE;  	} -	hashed_len = _php3_sprintf(hashed_details, "ora_%s_%s", user, pwd); +	hashed_len = php_sprintf(hashed_details, "ora_%s_%s", user, pwd);  	/* try to find if we already have this link in our persistent list,  	 * no matter if it is to be persistent or not  	 */ -	if (_php3_hash_find(plist, hashed_details, hashed_len + 1, +	if (zend_hash_find(plist, hashed_details, hashed_len + 1,  				  (void **) &index_ptr) == FAILURE) {  		/* the link is not in the persistent list */  		list_entry new_index_ptr; @@ -486,7 +486,7 @@ void php3_Ora_Do_Logon(INTERNAL_FUNCTION_PARAMETERS, int persistent)  		if (db_conn == NULL){  			efree(hashed_details); -			php3_error(E_WARNING, "Out of memory"); +			php_error(E_WARNING, "Out of memory");  			RETURN_FALSE;  		} @@ -499,7 +499,7 @@ void php3_Ora_Do_Logon(INTERNAL_FUNCTION_PARAMETERS, int persistent)  		if (orlon(&db_conn->lda, db_conn->hda, user,  				 strlen(user), pwd, strlen(pwd), 0)) {  #endif -			php3_error(E_WARNING, "Unable to connect to ORACLE (%s)", +			php_error(E_WARNING, "Unable to connect to ORACLE (%s)",  					   ora_error(&db_conn->lda));  			if (persistent)  				free(db_conn); @@ -520,12 +520,12 @@ void php3_Ora_Do_Logon(INTERNAL_FUNCTION_PARAMETERS, int persistent)  #else  			new_index_ptr.type = le_index_ptr;  #endif -			if (_php3_hash_update(plist,hashed_details,hashed_len + 1,(void *) &new_index_ptr, +			if (zend_hash_update(plist,hashed_details,hashed_len + 1,(void *) &new_index_ptr,  							sizeof(list_entry),NULL) == FAILURE) {  				ologof(&db_conn->lda);  				free(db_conn);  				efree(hashed_details); -				php3_error(E_WARNING, "Can't update hashed details list"); +				php_error(E_WARNING, "Can't update hashed details list");  				RETURN_FALSE;  			}  			ORACLE_GLOBAL(php3_oracle_module).num_persistent++; @@ -546,7 +546,7 @@ void php3_Ora_Do_Logon(INTERNAL_FUNCTION_PARAMETERS, int persistent)  		if (index_ptr->type != le_index_ptr) {  #endif  			efree(hashed_details); -			php3_error(E_WARNING, "Oops, something went completly wrong"); +			php_error(E_WARNING, "Oops, something went completly wrong");  			RETURN_FALSE;  		}  		id = (int) index_ptr->ptr; @@ -563,12 +563,12 @@ void php3_Ora_Do_Logon(INTERNAL_FUNCTION_PARAMETERS, int persistent)  				if(orlon(&db_conn->lda, db_conn->hda, user,  						 strlen(user), pwd, strlen(pwd), 0)) {  #endif -					php3_error(E_WARNING, "Unable to reconnect to ORACLE (%s)", +					php_error(E_WARNING, "Unable to reconnect to ORACLE (%s)",  							   ora_error(&db_conn->lda));  					/* Delete list entry for this connection */  					php3_plist_delete(id);  					/* Delete hashed list entry for this dead connection */ -					_php3_hash_del(plist, hashed_details, hashed_len);  +					zend_hash_del(plist, hashed_details, hashed_len);   					efree(hashed_details);  					RETURN_FALSE;  				} @@ -577,7 +577,7 @@ void php3_Ora_Do_Logon(INTERNAL_FUNCTION_PARAMETERS, int persistent)  		}  	} -	_php3_hash_add(ORACLE_GLOBAL(php3_oracle_module).conns, +	zend_hash_add(ORACLE_GLOBAL(php3_oracle_module).conns,  				   (void*)&db_conn,  				   sizeof(void*),  				   (void*)&db_conn, @@ -633,12 +633,12 @@ PHP_FUNCTION(ora_open)  	}  	if ((cursor = (oraCursor *)emalloc(sizeof(oraCursor))) == NULL){ -		php3_error(E_WARNING, "Out of memory"); +		php_error(E_WARNING, "Out of memory");  		RETURN_FALSE;  	}  	memset(cursor, 0, sizeof(oraCursor));  	if (oopen(&cursor->cda, &conn->lda, (text *) 0, -1, -1, (text *) 0, -1)) { -		php3_error(E_WARNING, "Unable to open new cursor (%s)", +		php_error(E_WARNING, "Unable to open new cursor (%s)",  				   ora_error(&cursor->cda));  		efree(cursor);  		RETURN_FALSE; @@ -684,7 +684,7 @@ PHP_FUNCTION(ora_commitoff)  		RETURN_FALSE;  	}  	if (ocof(&conn->lda)) { -		php3_error(E_WARNING, "Unable to turn off auto-commit (%s)", +		php_error(E_WARNING, "Unable to turn off auto-commit (%s)",  				   ora_error(&conn->lda));  		RETURN_FALSE;  	} @@ -709,7 +709,7 @@ PHP_FUNCTION(ora_commiton)  	}  	if (ocon(&conn->lda)) { -		php3_error(E_WARNING, "Unable to turn on auto-commit (%s)", +		php_error(E_WARNING, "Unable to turn on auto-commit (%s)",  				   ora_error(&conn->lda));  		RETURN_FALSE;  	} @@ -734,7 +734,7 @@ PHP_FUNCTION(ora_commit)  		RETURN_FALSE;  	}  	if (ocom(&conn->lda)) { -		php3_error(E_WARNING, "Unable to commit transaction (%s)", +		php_error(E_WARNING, "Unable to commit transaction (%s)",  				   ora_error(&conn->lda));  		RETURN_FALSE;  	} @@ -759,7 +759,7 @@ PHP_FUNCTION(ora_rollback)  		RETURN_FALSE;  	}  	if (orol(&conn->lda)) { -		php3_error(E_WARNING, "Unable to roll back transaction (%s)", +		php_error(E_WARNING, "Unable to roll back transaction (%s)",  				   ora_error(&conn->lda));  		RETURN_FALSE;  	} @@ -795,7 +795,7 @@ PHP_FUNCTION(ora_parse)   	query = (text *) estrndup(argv[1]->value.str.val,argv[1]->value.str.len);  	if (query == NULL) { -		php3_error(E_WARNING, "Invalid query"); +		php_error(E_WARNING, "Invalid query");  		RETURN_FALSE;  	}  	if (!(cursor = ora_get_cursor(list, argv[0]->value.lval))){ @@ -809,14 +809,14 @@ PHP_FUNCTION(ora_parse)  	cursor->query = query;  	cursor->fetched = 0;  	if(cursor->params && cursor->nparams > 0){ -		_php3_hash_destroy(cursor->params); +		zend_hash_destroy(cursor->params);  		efree(cursor->params);  		cursor->params = NULL;  		cursor->nparams = 0;  	}  	if (oparse(&cursor->cda, query, (sb4) - 1, defer, VERSION_7)) { -		php3_error(E_WARNING, "Ora_Parse failed (%s)", +		php_error(E_WARNING, "Ora_Parse failed (%s)",  				   ora_error(&cursor->cda));  		RETURN_FALSE;  	} @@ -846,7 +846,7 @@ PHP_FUNCTION(ora_bind)  	cursor = ora_get_cursor(list, argv[0]->value.lval);  	if (cursor == NULL) { -		php3_error(E_WARNING, "Invalid cursor index %d", +		php_error(E_WARNING, "Invalid cursor index %d",  				   argv[0]->value.lval);  		RETURN_FALSE;  	} @@ -854,28 +854,28 @@ PHP_FUNCTION(ora_bind)  	if(cursor->params == NULL){  		cursor->params = (HashTable *)emalloc(sizeof(HashTable));  		if (!cursor->params || -			_php3_hash_init(cursor->params, 19, NULL, +			zend_hash_init(cursor->params, 19, NULL,  							HASH_DTOR pval_ora_param_destructor, 0) == FAILURE) { -			php3_error(E_ERROR, "Unable to initialize parameter list"); +			php_error(E_ERROR, "Unable to initialize parameter list");  			RETURN_FALSE;  		}  	}  	if((newparam = (oraParam *)emalloc(sizeof(oraParam))) == NULL){ -		php3_error(E_WARNING, "Out of memory for parameter"); +		php_error(E_WARNING, "Out of memory for parameter");  		RETURN_FALSE;  	}  	if((paramname = estrndup(argv[1]->value.str.val, argv[1]->value.str.len)) == NULL){ -		php3_error(E_WARNING, "Out of memory for parametername"); +		php_error(E_WARNING, "Out of memory for parametername");  		efree(newparam);  		RETURN_FALSE;  	} -	if (_php3_hash_add(cursor->params, paramname, argv[1]->value.str.len + 1, newparam, sizeof(oraParam), (void **)¶mptr) == FAILURE) { -		/* XXX _php3_hash_destroy */ +	if (zend_hash_add(cursor->params, paramname, argv[1]->value.str.len + 1, newparam, sizeof(oraParam), (void **)¶mptr) == FAILURE) { +		/* XXX zend_hash_destroy */  		efree(paramname);  		efree(newparam); -		php3_error(E_ERROR, "Could not make parameter placeholder"); +		php_error(E_ERROR, "Could not make parameter placeholder");  		RETURN_FALSE;  	} @@ -891,7 +891,7 @@ PHP_FUNCTION(ora_bind)  	}  	if((paramptr->progv = (text *)emalloc(paramptr->progvl)) == NULL){		 -		php3_error(E_WARNING, "Out of memory for parameter value"); +		php_error(E_WARNING, "Out of memory for parameter value");  		RETURN_FALSE;  	} @@ -913,7 +913,7 @@ PHP_FUNCTION(ora_bind)  			   0,  			   -1,  			   -1)) { -		php3_error(E_WARNING, "Ora_Bind failed (%s)", +		php_error(E_WARNING, "Ora_Bind failed (%s)",  				   ora_error(&cursor->cda));  		RETURN_FALSE;  	} @@ -956,7 +956,7 @@ PHP_FUNCTION(ora_exec)  	}  	if (oexec(&cursor->cda)) { -		php3_error(E_WARNING, "Ora_Exec failed (%s)", +		php_error(E_WARNING, "Ora_Exec failed (%s)",  				   ora_error(&cursor->cda));  		RETURN_FALSE;  	} @@ -1033,7 +1033,7 @@ PHP_FUNCTION(ora_do)  	}  	if ((cursor = (oraCursor *)emalloc(sizeof(oraCursor))) == NULL){ -		php3_error(E_WARNING, "Out of memory"); +		php_error(E_WARNING, "Out of memory");  		RETURN_FALSE;  	} @@ -1042,14 +1042,14 @@ PHP_FUNCTION(ora_do)          query = (text *) estrndup(argv[1]->value.str.val,argv[1]->value.str.len);          if (query == NULL) { -                php3_error(E_WARNING, "Invalid query in Ora_Do"); +                php_error(E_WARNING, "Invalid query in Ora_Do");                  RETURN_FALSE;          }          cursor->query = query;  	if (oopen(&cursor->cda, &conn->lda, (text *) 0, -1, -1, (text *) 0, -1)) { -		php3_error(E_WARNING, "Unable to open new cursor (%s)", +		php_error(E_WARNING, "Unable to open new cursor (%s)",  				   ora_error(&cursor->cda));  		efree(cursor);  		RETURN_FALSE; @@ -1061,7 +1061,7 @@ PHP_FUNCTION(ora_do)  	/* Prepare stmt */  	if (oparse(&cursor->cda, query, (sb4) - 1, 1, VERSION_7)){ -		php3_error(E_WARNING, "Ora_Do failed (%s)", +		php_error(E_WARNING, "Ora_Do failed (%s)",  				   ora_error(&cursor->cda));  		_close_oracur(cursor);  		RETURN_FALSE; @@ -1075,7 +1075,7 @@ PHP_FUNCTION(ora_do)  			RETURN_FALSE;  		}  		if (oexfet(&cursor->cda, 1, 0, 0)) { -			php3_error(E_WARNING, "Ora_Do failed (%s)", +			php_error(E_WARNING, "Ora_Do failed (%s)",  					   ora_error(&cursor->cda));  			_close_oracur(cursor);  			RETURN_FALSE; @@ -1083,7 +1083,7 @@ PHP_FUNCTION(ora_do)  		cursor->fetched = 1;  	} else {  		if (oexec(&cursor->cda)) { -			php3_error(E_WARNING, "Ora_Do failed (%s)", +			php_error(E_WARNING, "Ora_Do failed (%s)",  					   ora_error(&cursor->cda));  			_close_oracur(cursor);  			RETURN_FALSE; @@ -1112,14 +1112,14 @@ PHP_FUNCTION(ora_fetch)  	}  	if (cursor->ncols == 0){ -		php3_error(E_WARNING, "No tuples available on this cursor"); +		php_error(E_WARNING, "No tuples available on this cursor");  		RETURN_FALSE;  	}  	/* Get data from Oracle */  	if (ofetch(&cursor->cda)) {  		if (cursor->cda.rc != NO_DATA_FOUND) { -			php3_error(E_WARNING, "Ora_Fetch failed (%s)", +			php_error(E_WARNING, "Ora_Fetch failed (%s)",  					   ora_error(&cursor->cda));  		}  		RETURN_FALSE; @@ -1159,7 +1159,7 @@ PHP_FUNCTION(ora_fetch_into)  	}  	if (!ParameterPassedByReference(ht, 2)){ -		php3_error(E_WARNING, "Array not passed by reference in call to ora_fetch_into()"); +		php_error(E_WARNING, "Array not passed by reference in call to ora_fetch_into()");  		RETURN_FALSE;  	} @@ -1171,20 +1171,20 @@ PHP_FUNCTION(ora_fetch_into)  	}  	if (cursor->ncols == 0){ -		php3_error(E_WARNING, "No tuples available on this cursor"); +		php_error(E_WARNING, "No tuples available on this cursor");  		RETURN_FALSE;  	}  	if (arr->type != IS_ARRAY){  		if (array_init(arr) == FAILURE){ -			php3_error(E_WARNING, "Can't convert to type Array"); +			php_error(E_WARNING, "Can't convert to type Array");  			RETURN_FALSE;  		}  	}  	if (ofetch(&cursor->cda)) {  		if (cursor->cda.rc != NO_DATA_FOUND) { -			php3_error(E_WARNING, "Ora_Fetch_Into failed (%s)", +			php_error(E_WARNING, "Ora_Fetch_Into failed (%s)",  					   ora_error(&cursor->cda));  		}  		RETURN_FALSE; @@ -1273,15 +1273,15 @@ PHP_FUNCTION(ora_fetch_into)  		if (flags&ORA_FETCHINTO_ASSOC){  #if PHP_API_VERSION >= 19990421 -			_php3_hash_update(arr->value.ht, cursor->columns[i].cbuf, cursor->columns[i].cbufl+1, (void *) &tmp, sizeof(pval*), NULL); +			zend_hash_update(arr->value.ht, cursor->columns[i].cbuf, cursor->columns[i].cbufl+1, (void *) &tmp, sizeof(pval*), NULL);  #else -			_php3_hash_update(arr->value.ht, cursor->columns[i].cbuf, cursor->columns[i].cbufl+1, (void *) tmp, sizeof(pval), NULL); +			zend_hash_update(arr->value.ht, cursor->columns[i].cbuf, cursor->columns[i].cbufl+1, (void *) tmp, sizeof(pval), NULL);  #endif  		} else {  #if PHP_API_VERSION >= 19990421 -			_php3_hash_index_update(arr->value.ht, i, (void *) &tmp, sizeof(pval*), NULL); +			zend_hash_index_update(arr->value.ht, i, (void *) &tmp, sizeof(pval*), NULL);  #else -			_php3_hash_index_update(arr->value.ht, i, (void *) tmp, sizeof(pval), NULL); +			zend_hash_index_update(arr->value.ht, i, (void *) tmp, sizeof(pval), NULL);  #endif  		} @@ -1317,17 +1317,17 @@ PHP_FUNCTION(ora_columnname)  	convert_to_long(argv[1]);  	if (cursor->ncols == 0){ -		php3_error(E_WARNING, "No tuples available at this cursor index"); +		php_error(E_WARNING, "No tuples available at this cursor index");  		RETURN_FALSE;  	}  	if (argv[1]->value.lval >= cursor->ncols){ -		php3_error(E_WARNING, "Column index larger than number of columns"); +		php_error(E_WARNING, "Column index larger than number of columns");  		RETURN_FALSE;  	}  	if (argv[1]->value.lval < 0){ -		php3_error(E_WARNING, "Column numbering starts at 0"); +		php_error(E_WARNING, "Column numbering starts at 0");  		RETURN_FALSE;  	} @@ -1360,17 +1360,17 @@ PHP_FUNCTION(ora_columntype)  	colno = argv[1]->value.lval;  	if (cursor->ncols == 0){ -		php3_error(E_WARNING, "No tuples available at this cursor index"); +		php_error(E_WARNING, "No tuples available at this cursor index");  		RETURN_FALSE;  	}  	if (colno >= cursor->ncols){ -		php3_error(E_WARNING, "Column index larger than number of columns"); +		php_error(E_WARNING, "Column index larger than number of columns");  		RETURN_FALSE;  	}  	if (colno < 0){ -		php3_error(E_WARNING, "Column numbering starts at 0"); +		php_error(E_WARNING, "Column numbering starts at 0");  		RETURN_FALSE;  	} @@ -1431,17 +1431,17 @@ PHP_FUNCTION(ora_columnsize)  	convert_to_long(argv[1]);  	if (cursor->ncols == 0){ -		php3_error(E_WARNING, "No tuples available at this cursor index"); +		php_error(E_WARNING, "No tuples available at this cursor index");  		RETURN_FALSE;  	}  	if (argv[1]->value.lval >= cursor->ncols){ -		php3_error(E_WARNING, "Column index larger than number of columns"); +		php_error(E_WARNING, "Column index larger than number of columns");  		RETURN_FALSE;  	}  	if (argv[1]->value.lval < 0){ -		php3_error(E_WARNING, "Column numbering starts at 0"); +		php_error(E_WARNING, "Column numbering starts at 0");  		RETURN_FALSE;  	} @@ -1471,7 +1471,7 @@ PHP_FUNCTION(ora_getcolumn)  	}  	if (cursor->ncols == 0){ -		php3_error(E_WARNING, "No tuples available at this cursor index"); +		php_error(E_WARNING, "No tuples available at this cursor index");  		RETURN_FALSE;  	} @@ -1479,19 +1479,19 @@ PHP_FUNCTION(ora_getcolumn)  	colno = argv[1]->value.lval;          	if (colno >= cursor->ncols){ -		php3_error(E_WARNING, "Column index larger than number of columns"); +		php_error(E_WARNING, "Column index larger than number of columns");  		RETURN_FALSE;  	}  	if (colno < 0){ -		php3_error(E_WARNING, "Column numbering starts at 0"); +		php_error(E_WARNING, "Column numbering starts at 0");  		RETURN_FALSE;  	}  	if (cursor->fetched == 0){  		if (ofetch(&cursor->cda)) {  			if (cursor->cda.rc != NO_DATA_FOUND) { -				php3_error(E_WARNING, "Ora_Fetch failed (%s)", +				php_error(E_WARNING, "Ora_Fetch failed (%s)",  						   ora_error(&cursor->cda));  			}  			RETURN_FALSE; @@ -1576,7 +1576,7 @@ PHP_FUNCTION(ora_getcolumn)  					}  #endif  			default: -				php3_error(E_WARNING, +				php_error(E_WARNING,  						   "Ora_GetColumn found invalid type (%d)", type);  				RETURN_FALSE;  			} @@ -1633,7 +1633,7 @@ PHP_FUNCTION(ora_errorcode)  PHP_MINFO_FUNCTION(oracle)  {  #if !(WIN32|WINNT) -	php3_printf("Oracle version: %s<br>\n" +	php_printf("Oracle version: %s<br>\n"  			    "Compile-time ORACLE_HOME: %s<br>\n"  			    "Libraries used: %s",  			    PHP_ORACLE_VERSION, PHP_ORACLE_HOME, PHP_ORACLE_LIBS); @@ -1660,7 +1660,7 @@ ora_get_conn(HashTable *list,HashTable *plist,int ind)  	if (conn && type == ORACLE_GLOBAL(php3_oracle_module).le_pconn)  		return conn; -	php3_error(E_WARNING,"Bad Oracle connection number (%d)", ind); +	php_error(E_WARNING,"Bad Oracle connection number (%d)", ind);  	return NULL;  } @@ -1680,12 +1680,12 @@ ora_get_cursor(HashTable *list, int ind)  	cursor = php3_list_find(ind, &type);  	if (!cursor || type != ORACLE_GLOBAL(php3_oracle_module).le_cursor) { -		php3_error(E_WARNING, "Invalid cursor index %d", ind); +		php_error(E_WARNING, "Invalid cursor index %d", ind);  		return NULL;  	} -	if (_php3_hash_find(ORACLE_GLOBAL(php3_oracle_module).conns,(void*)&(cursor->conn_ptr),sizeof(void*),(void **)&db_conn) == FAILURE) { -		php3_error(E_WARNING, "Connection already closed for cursor index %d", ind); +	if (zend_hash_find(ORACLE_GLOBAL(php3_oracle_module).conns,(void*)&(cursor->conn_ptr),sizeof(void*),(void **)&db_conn) == FAILURE) { +		php_error(E_WARNING, "Connection already closed for cursor index %d", ind);  		return NULL;  	} @@ -1700,7 +1700,7 @@ void ora_del_cursor(HashTable *list, int ind)  	cursor = (oraCursor *) php3_list_find(ind, &type);  	if (!cursor || type != ORACLE_GLOBAL(php3_oracle_module).le_cursor) { -		php3_error(E_WARNING,"Can't find cursor %d",ind); +		php_error(E_WARNING,"Can't find cursor %d",ind);  		return;  	}  	php3_list_delete(ind); @@ -1755,7 +1755,7 @@ ora_describe_define(oraCursor * cursor)  			if (cursor->cda.rc == VAR_NOT_IN_LIST) {  				break;  			} else { -				php3_error(E_WARNING, "%s", ora_error(&cursor->cda)); +				php_error(E_WARNING, "%s", ora_error(&cursor->cda));  				cursor->ncols = 0;  				return -1;  			} @@ -1766,7 +1766,7 @@ ora_describe_define(oraCursor * cursor)  	if (cursor->ncols > 0){  		cursor->columns = (oraColumn *) emalloc(sizeof(oraColumn) * cursor->ncols);  		if (cursor->columns == NULL){ -			php3_error(E_WARNING, "Out of memory"); +			php_error(E_WARNING, "Out of memory");  			return -1;  		}  	} @@ -1783,7 +1783,7 @@ ora_describe_define(oraCursor * cursor)  			if (cursor->cda.rc == VAR_NOT_IN_LIST) {  				break;  			} else { -				php3_error(E_WARNING, "%s", ora_error(&cursor->cda)); +				php_error(E_WARNING, "%s", ora_error(&cursor->cda));  				return -1;  			}  		} @@ -1803,7 +1803,7 @@ ora_describe_define(oraCursor * cursor)  		}  		if ((cursor->columns[col].buf = (ub1 *) emalloc(cursor->columns[col].dsize + 1)) == NULL){ -			php3_error(E_WARNING, "Out of memory"); +			php_error(E_WARNING, "Out of memory");  			return -1;  		}  		/* Define an output variable for the column */ @@ -1811,7 +1811,7 @@ ora_describe_define(oraCursor * cursor)  				   cursor->columns[col].dsize + 1, type, -1, &cursor->columns[col].indp,  				   (text *) 0, -1, -1, &cursor->columns[col].col_retlen,   				   &cursor->columns[col].col_retcode)) { -			php3_error(E_WARNING, "%s", ora_error(&cursor->cda)); +			php_error(E_WARNING, "%s", ora_error(&cursor->cda));  			return -1;  		}  	} @@ -1832,21 +1832,21 @@ int ora_set_param_values(oraCursor *cursor, int isout)  	/* see variables.c */  	HashTable *symbol_table=php3i_get_symbol_table();  #endif -	_php3_hash_internal_pointer_reset(cursor->params); +	zend_hash_internal_pointer_reset(cursor->params); -	if(_php3_hash_num_elements(cursor->params) != cursor->nparams){ -		php3_error(E_WARNING, "Mismatch in number of parameters"); +	if(zend_hash_num_elements(cursor->params) != cursor->nparams){ +		php_error(E_WARNING, "Mismatch in number of parameters");  		return 0;  	} -	for(i = 0; i < cursor->nparams; i++, _php3_hash_move_forward(cursor->params)){ -		if(_php3_hash_get_current_key(cursor->params, ¶mname, NULL) != HASH_KEY_IS_STRING){ -			php3_error(E_WARNING, "Can't get parameter name"); +	for(i = 0; i < cursor->nparams; i++, zend_hash_move_forward(cursor->params)){ +		if(zend_hash_get_current_key(cursor->params, ¶mname, NULL) != HASH_KEY_IS_STRING){ +			php_error(E_WARNING, "Can't get parameter name");  			return 0;  		} -		if(_php3_hash_get_current_data(cursor->params, (void **)¶m) == FAILURE){ -			php3_error(E_WARNING, "Can't get parameter data"); +		if(zend_hash_get_current_data(cursor->params, (void **)¶m) == FAILURE){ +			php_error(E_WARNING, "Can't get parameter data");  			efree(paramname);  			return 0;  		} @@ -1860,7 +1860,7 @@ int ora_set_param_values(oraCursor *cursor, int isout)  				var.value.str.val = estrdup(param->progv);  				var.value.str.len = strlen(param->progv);  				var.type = IS_STRING;  -				_php3_hash_update(symbol_table, name, strlen(name)+1, &var, sizeof(pval),NULL);  +				zend_hash_update(symbol_table, name, strlen(name)+1, &var, sizeof(pval),NULL);   			}   #else  			SET_VAR_STRINGL(paramname, estrdup(param->progv), strlen(param->progv)); @@ -1874,19 +1874,19 @@ int ora_set_param_values(oraCursor *cursor, int isout)  		/* FIXME Globals don't work in extensions on windows, have to do something  			else here.  See oracle_hack.c */  #if (WIN32|WINNT) -		if(_php3_hash_find(symbol_table, paramname, strlen(paramname) + 1, (void **)&pdata) == FAILURE){ -			php3_error(E_WARNING, "Can't find variable for parameter"); +		if(zend_hash_find(symbol_table, paramname, strlen(paramname) + 1, (void **)&pdata) == FAILURE){ +			php_error(E_WARNING, "Can't find variable for parameter");  			efree(paramname);  			return 0;  		}  #else  #if PHP_API_VERSION < 19990421  -		if(_php3_hash_find(&GLOBAL(symbol_table), paramname, strlen(paramname) + 1, (void **)&pdata) == FAILURE){ +		if(zend_hash_find(&GLOBAL(symbol_table), paramname, strlen(paramname) + 1, (void **)&pdata) == FAILURE){  #else -		if(_php3_hash_find(&EG(symbol_table), paramname, strlen(paramname) + 1, (void **)&pdata) == FAILURE){ +		if(zend_hash_find(&EG(symbol_table), paramname, strlen(paramname) + 1, (void **)&pdata) == FAILURE){  #endif -			php3_error(E_WARNING, "Can't find variable for parameter"); +			php_error(E_WARNING, "Can't find variable for parameter");  			efree(paramname);  			return 0;  		} @@ -1900,7 +1900,7 @@ int ora_set_param_values(oraCursor *cursor, int isout)  		plen = (*pdata)->value.str.len;  #endif   		if (param->progvl <= plen){ -  			php3_error(E_NOTICE, "Input value will be truncated"); +  			php_error(E_NOTICE, "Input value will be truncated");    		}  		len = min(param->progvl - 1, plen); diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 89868982e6..ab696ad301 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -101,8 +101,8 @@ static void _php_pcre_shutdown_globals(php_pcre_globals *pcre_globals)  /* {{{ void php_info_pcre(ZEND_MODULE_INFO_FUNC_ARGS) */  void php_info_pcre(ZEND_MODULE_INFO_FUNC_ARGS)  { -	php3_printf("Perl Compatible Regular Expressions"); -	php3_printf("<table cellpadding=5>" +	php_printf("Perl Compatible Regular Expressions"); +	php_printf("<table cellpadding=5>"  				"<tr><td>PCRE library version:</td>"  				"<td>%s</td></tr>"  				"</table>", pcre_version()); diff --git a/ext/pdf/pdf.c b/ext/pdf/pdf.c index bbfbb7ef7a..82fb07d78d 100644 --- a/ext/pdf/pdf.c +++ b/ext/pdf/pdf.c @@ -152,7 +152,7 @@ int php3_minit_pdf(INIT_FUNC_ARGS)  void php3_info_pdf(ZEND_MODULE_INFO_FUNC_ARGS) {  	/* need to use a PHPAPI function here because it is external module in windows */ -	php3_printf("%s. AFM files in %s", PDFLIB_VERSION, PDF_DEFAULT_FONT_PATH); +	php_printf("%s. AFM files in %s", PDFLIB_VERSION, PDF_DEFAULT_FONT_PATH);  }  int php3_mend_pdf(void){ @@ -169,7 +169,7 @@ PHP_FUNCTION(pdf_get_info) {  	pdf_info = PDF_get_info();  	if(!pdf_info) { -		php3_error(E_WARNING, "Could not get PDF info"); +		php_error(E_WARNING, "Could not get PDF info");  		RETURN_FALSE;  	} @@ -196,7 +196,7 @@ PHP_FUNCTION(pdf_set_info_creator) {  	id=arg1->value.lval;  	pdf_info = php3_list_find(id,&type);  	if (!pdf_info || type!=PDF_GLOBAL(le_pdf_info)) { -		php3_error(E_WARNING,"Unable to find file identifier %d (type=%d)",id, type); +		php_error(E_WARNING,"Unable to find file identifier %d (type=%d)",id, type);  		RETURN_FALSE;  	} @@ -224,7 +224,7 @@ PHP_FUNCTION(pdf_set_info_title) {  	id=arg1->value.lval;  	pdf_info = php3_list_find(id,&type);  	if (!pdf_info || type!=PDF_GLOBAL(le_pdf_info)) { -		php3_error(E_WARNING,"Unable to find file identifier %d (type=%d)",id, type); +		php_error(E_WARNING,"Unable to find file identifier %d (type=%d)",id, type);  		RETURN_FALSE;  	} @@ -252,7 +252,7 @@ PHP_FUNCTION(pdf_set_info_subject) {  	id=arg1->value.lval;  	pdf_info = php3_list_find(id,&type);  	if (!pdf_info || type!=PDF_GLOBAL(le_pdf_info)) { -		php3_error(E_WARNING,"Unable to find file identifier %d (type=%d)",id, type); +		php_error(E_WARNING,"Unable to find file identifier %d (type=%d)",id, type);  		RETURN_FALSE;  	} @@ -280,7 +280,7 @@ PHP_FUNCTION(pdf_set_info_author) {  	id=arg1->value.lval;  	pdf_info = php3_list_find(id,&type);  	if (!pdf_info || type!=PDF_GLOBAL(le_pdf_info)) { -		php3_error(E_WARNING,"Unable to find file identifier %d (type=%d)",id, type); +		php_error(E_WARNING,"Unable to find file identifier %d (type=%d)",id, type);  		RETURN_FALSE;  	} @@ -308,7 +308,7 @@ PHP_FUNCTION(pdf_set_info_keywords) {  	id=arg1->value.lval;  	pdf_info = php3_list_find(id,&type);  	if (!pdf_info || type!=PDF_GLOBAL(le_pdf_info)) { -		php3_error(E_WARNING,"Unable to find file identifier %d (type=%d)",id, type); +		php_error(E_WARNING,"Unable to find file identifier %d (type=%d)",id, type);  		RETURN_FALSE;  	} @@ -339,14 +339,14 @@ PHP_FUNCTION(pdf_open) {  	id=file->value.lval;  	fp = php3_list_find(id,&type);  	if (!fp || type!=php3i_get_le_fp()) { -		php3_error(E_WARNING,"Unable to find file identifier %d (type=%d)",id, type); +		php_error(E_WARNING,"Unable to find file identifier %d (type=%d)",id, type);  		RETURN_FALSE;  	}  	id=info->value.lval;  	pdf_info = php3_list_find(id,&type);  	if (!pdf_info || type!=PDF_GLOBAL(le_pdf_info)) { -		php3_error(E_WARNING,"Unable to find pdf info identifier %d (%d!=%d)",id, type, PDF_GLOBAL(le_pdf_info)); +		php_error(E_WARNING,"Unable to find pdf info identifier %d (%d!=%d)",id, type, PDF_GLOBAL(le_pdf_info));  		RETURN_FALSE;  	} @@ -375,7 +375,7 @@ PHP_FUNCTION(pdf_close) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -406,7 +406,7 @@ PHP_FUNCTION(pdf_begin_page) {  	width = arg3->value.dval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -432,7 +432,7 @@ PHP_FUNCTION(pdf_end_page) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -459,7 +459,7 @@ PHP_FUNCTION(pdf_show) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -488,7 +488,7 @@ PHP_FUNCTION(pdf_show_xy) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -517,7 +517,7 @@ PHP_FUNCTION(pdf_set_font) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -544,7 +544,7 @@ PHP_FUNCTION(pdf_set_leading) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -571,7 +571,7 @@ PHP_FUNCTION(pdf_set_text_rendering) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -598,7 +598,7 @@ PHP_FUNCTION(pdf_set_horiz_scaling) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -625,7 +625,7 @@ PHP_FUNCTION(pdf_set_text_rise) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -656,26 +656,26 @@ PHP_FUNCTION(pdf_set_text_matrix) {  	matrix=arg2->value.ht;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} -	if(_php3_hash_num_elements(matrix) != 6) { -		 php3_error(E_WARNING,"Text matrix must have 6 elements"); +	if(zend_hash_num_elements(matrix) != 6) { +		 php_error(E_WARNING,"Text matrix must have 6 elements");  		RETURN_FALSE;  	}  	pdfmatrixptr = (float *) &pdfmatrix; -	_php3_hash_internal_pointer_reset(matrix); -	for(i=0; i<_php3_hash_num_elements(matrix); i++) { -		_php3_hash_get_current_data(matrix, (void *) &data); +	zend_hash_internal_pointer_reset(matrix); +	for(i=0; i<zend_hash_num_elements(matrix); i++) { +		zend_hash_get_current_data(matrix, (void *) &data);  		switch(data->type) {  			case IS_DOUBLE:  				*pdfmatrixptr++ = (float) data->value.dval;  			default:  				*pdfmatrixptr++ = 0.0;  		} -		_php3_hash_move_forward(matrix); +		zend_hash_move_forward(matrix);  	}  	PDF_set_text_matrix(pdf, pdfmatrix); @@ -702,7 +702,7 @@ PHP_FUNCTION(pdf_set_text_pos) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -729,7 +729,7 @@ PHP_FUNCTION(pdf_set_char_spacing) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -756,7 +756,7 @@ PHP_FUNCTION(pdf_set_word_spacing) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -783,7 +783,7 @@ PHP_FUNCTION(pdf_continue_text) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -811,7 +811,7 @@ PHP_FUNCTION(pdf_stringwidth) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -837,7 +837,7 @@ PHP_FUNCTION(pdf_save) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -863,7 +863,7 @@ PHP_FUNCTION(pdf_restore) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -891,7 +891,7 @@ PHP_FUNCTION(pdf_translate) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -919,7 +919,7 @@ PHP_FUNCTION(pdf_scale) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -946,7 +946,7 @@ PHP_FUNCTION(pdf_rotate) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -973,12 +973,12 @@ PHP_FUNCTION(pdf_setflat) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	}  	if((arg2->value.lval > 100) && (arg2->value.lval < 0)) { -		php3_error(E_WARNING,"Parameter of pdf_setflat() has to between 0 and 100"); +		php_error(E_WARNING,"Parameter of pdf_setflat() has to between 0 and 100");  		RETURN_FALSE;  	} @@ -1005,12 +1005,12 @@ PHP_FUNCTION(pdf_setlinejoin) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	}  	if((arg2->value.lval > 2) && (arg2->value.lval < 0)) { -		php3_error(E_WARNING,"Parameter of pdf_setlinejoin() has to between 0 and 2"); +		php_error(E_WARNING,"Parameter of pdf_setlinejoin() has to between 0 and 2");  		RETURN_FALSE;  	} @@ -1037,12 +1037,12 @@ PHP_FUNCTION(pdf_setlinecap) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	}  	if((arg2->value.lval > 2) && (arg2->value.lval < 0)) { -		php3_error(E_WARNING,"Parameter of pdf_setlinecap() has to be > 0 and =< 2"); +		php_error(E_WARNING,"Parameter of pdf_setlinecap() has to be > 0 and =< 2");  		RETURN_FALSE;  	} @@ -1069,12 +1069,12 @@ PHP_FUNCTION(pdf_setmiterlimit) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	}  	if(arg2->value.dval < 1) { -		php3_error(E_WARNING,"Parameter of pdf_setmiterlimit() has to be >= 1"); +		php_error(E_WARNING,"Parameter of pdf_setmiterlimit() has to be >= 1");  		RETURN_FALSE;  	} @@ -1101,7 +1101,7 @@ PHP_FUNCTION(pdf_setlinewidth) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1129,7 +1129,7 @@ PHP_FUNCTION(pdf_setdash) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1157,7 +1157,7 @@ PHP_FUNCTION(pdf_moveto) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1189,7 +1189,7 @@ PHP_FUNCTION(pdf_curveto) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1222,7 +1222,7 @@ PHP_FUNCTION(pdf_lineto) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1251,7 +1251,7 @@ PHP_FUNCTION(pdf_circle) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1282,7 +1282,7 @@ PHP_FUNCTION(pdf_arc) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1312,7 +1312,7 @@ PHP_FUNCTION(pdf_rect) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1341,7 +1341,7 @@ PHP_FUNCTION(pdf_closepath) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1367,7 +1367,7 @@ PHP_FUNCTION(pdf_closepath_stroke) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1393,7 +1393,7 @@ PHP_FUNCTION(pdf_stroke) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1419,7 +1419,7 @@ PHP_FUNCTION(pdf_fill) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1445,7 +1445,7 @@ PHP_FUNCTION(pdf_fill_stroke) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1471,7 +1471,7 @@ PHP_FUNCTION(pdf_closepath_fill_stroke) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1497,7 +1497,7 @@ PHP_FUNCTION(pdf_endpath) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1523,7 +1523,7 @@ PHP_FUNCTION(pdf_clip) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1550,7 +1550,7 @@ PHP_FUNCTION(pdf_setgray_fill) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1577,7 +1577,7 @@ PHP_FUNCTION(pdf_setgray_stroke) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1604,7 +1604,7 @@ PHP_FUNCTION(pdf_setgray) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1631,7 +1631,7 @@ PHP_FUNCTION(pdf_setrgbcolor_fill) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1658,7 +1658,7 @@ PHP_FUNCTION(pdf_setrgbcolor_stroke) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1685,7 +1685,7 @@ PHP_FUNCTION(pdf_setrgbcolor) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1712,7 +1712,7 @@ PHP_FUNCTION(pdf_add_outline) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1739,7 +1739,7 @@ PHP_FUNCTION(pdf_set_transition) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1766,7 +1766,7 @@ PHP_FUNCTION(pdf_set_duration) {  	id=arg1->value.lval;  	pdf = php3_list_find(id,&type);  	if(!pdf || type!=PDF_GLOBAL(le_pdf)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 4738a21a93..df2ff36bab 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -231,16 +231,16 @@ void php3_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  		list_entry *le;  		/* try to find if we already have this link in our persistent list */ -		if (_php3_hash_find(plist, hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) {  /* we don't */ +		if (zend_hash_find(plist, hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) {  /* we don't */  			list_entry new_le;  			if (php3_pgsql_module.max_links!=-1 && php3_pgsql_module.num_links>=php3_pgsql_module.max_links) { -				php3_error(E_WARNING,"PostgresSQL:  Too many open links (%d)",php3_pgsql_module.num_links); +				php_error(E_WARNING,"PostgresSQL:  Too many open links (%d)",php3_pgsql_module.num_links);  				efree(hashed_details);  				RETURN_FALSE;  			}  			if (php3_pgsql_module.max_persistent!=-1 && php3_pgsql_module.num_persistent>=php3_pgsql_module.max_persistent) { -				php3_error(E_WARNING,"PostgresSQL:  Too many open persistent links (%d)",php3_pgsql_module.num_persistent); +				php_error(E_WARNING,"PostgresSQL:  Too many open persistent links (%d)",php3_pgsql_module.num_persistent);  				efree(hashed_details);  				RETURN_FALSE;  			} @@ -252,7 +252,7 @@ void php3_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  				pgsql=PQsetdb(host,port,options,tty,dbname);  			}  			if (pgsql==NULL || PQstatus(pgsql)==CONNECTION_BAD) { -				php3_error(E_WARNING,"Unable to connect to PostgresSQL server:  %s",PQerrorMessage(pgsql)); +				php_error(E_WARNING,"Unable to connect to PostgresSQL server:  %s",PQerrorMessage(pgsql));  				efree(hashed_details);  				RETURN_FALSE;  			} @@ -260,7 +260,7 @@ void php3_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  			/* hash it up */  			new_le.type = php3_pgsql_module.le_plink;  			new_le.ptr = pgsql; -			if (_php3_hash_update(plist, hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry), NULL)==FAILURE) { +			if (zend_hash_update(plist, hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry), NULL)==FAILURE) {  				efree(hashed_details);  				RETURN_FALSE;  			} @@ -278,8 +278,8 @@ void php3_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  					le->ptr=PQsetdb(host,port,options,tty,dbname);  				}  				if (le->ptr==NULL || PQstatus(le->ptr)==CONNECTION_BAD) { -					php3_error(E_WARNING,"PostgresSQL link lost, unable to reconnect"); -					_php3_hash_del(plist,hashed_details,hashed_details_length+1); +					php_error(E_WARNING,"PostgresSQL link lost, unable to reconnect"); +					zend_hash_del(plist,hashed_details,hashed_details_length+1);  					efree(hashed_details);  					RETURN_FALSE;  				} @@ -296,7 +296,7 @@ void php3_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  		 * if it doesn't, open a new pgsql link, add it to the resource list,  		 * and add a pointer to it with hashed_details as the key.  		 */ -		if (_php3_hash_find(list,hashed_details,hashed_details_length+1,(void **) &index_ptr)==SUCCESS) { +		if (zend_hash_find(list,hashed_details,hashed_details_length+1,(void **) &index_ptr)==SUCCESS) {  			int type,link;  			void *ptr; @@ -311,11 +311,11 @@ void php3_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  				efree(hashed_details);  				return;  			} else { -				_php3_hash_del(list,hashed_details,hashed_details_length+1); +				zend_hash_del(list,hashed_details,hashed_details_length+1);  			}  		}  		if (php3_pgsql_module.max_links!=-1 && php3_pgsql_module.num_links>=php3_pgsql_module.max_links) { -			php3_error(E_WARNING,"PostgresSQL:  Too many open links (%d)",php3_pgsql_module.num_links); +			php_error(E_WARNING,"PostgresSQL:  Too many open links (%d)",php3_pgsql_module.num_links);  			efree(hashed_details);  			RETURN_FALSE;  		} @@ -325,7 +325,7 @@ void php3_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  			pgsql=PQsetdb(host,port,options,tty,dbname);  		}  		if (pgsql==NULL || PQstatus(pgsql)==CONNECTION_BAD) { -			php3_error(E_WARNING,"Unable to connect to PostgresSQL server:  %s",PQerrorMessage(pgsql)); +			php_error(E_WARNING,"Unable to connect to PostgresSQL server:  %s",PQerrorMessage(pgsql));  			efree(hashed_details);  			RETURN_FALSE;  		} @@ -337,7 +337,7 @@ void php3_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  		/* add it to the hash */  		new_index_ptr.ptr = (void *) return_value->value.lval;  		new_index_ptr.type = le_index_ptr; -		if (_php3_hash_update(list,hashed_details,hashed_details_length+1,(void *) &new_index_ptr, sizeof(list_entry), NULL)==FAILURE) { +		if (zend_hash_update(list,hashed_details,hashed_details_length+1,(void *) &new_index_ptr, sizeof(list_entry), NULL)==FAILURE) {  			efree(hashed_details);  			RETURN_FALSE;  		} @@ -400,7 +400,7 @@ PHP_FUNCTION(pgsql_close)  	pgsql = (PGconn *) php3_list_find(id,&type);  	if (type!=php3_pgsql_module.le_link && type!=php3_pgsql_module.le_plink) { -		php3_error(E_WARNING,"%d is not a PostgresSQL link index",id); +		php_error(E_WARNING,"%d is not a PostgresSQL link index",id);  		RETURN_FALSE;  	} @@ -441,7 +441,7 @@ void php3_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)  	pgsql = (PGconn *) php3_list_find(id,&type);  	if (type!=php3_pgsql_module.le_link && type!=php3_pgsql_module.le_plink) { -		php3_error(E_WARNING,"%d is not a PostgresSQL link index",id); +		php_error(E_WARNING,"%d is not a PostgresSQL link index",id);  		RETURN_FALSE;  	} @@ -552,7 +552,7 @@ PHP_FUNCTION(pgsql_exec)  	pgsql = (PGconn *) php3_list_find(id,&type);  	if (type!=php3_pgsql_module.le_link && type!=php3_pgsql_module.le_plink) { -		php3_error(E_WARNING,"%d is not a PostgresSQL link index",id); +		php_error(E_WARNING,"%d is not a PostgresSQL link index",id);  		RETURN_FALSE;  	} @@ -571,7 +571,7 @@ PHP_FUNCTION(pgsql_exec)  		case PGRES_BAD_RESPONSE:  		case PGRES_NONFATAL_ERROR:  		case PGRES_FATAL_ERROR: -			php3_error(E_WARNING,"PostgresSQL query failed:  %s",PQerrorMessage(pgsql)); +			php_error(E_WARNING,"PostgresSQL query failed:  %s",PQerrorMessage(pgsql));  			RETURN_FALSE;  			break;  		case PGRES_COMMAND_OK: /* successful command that did not return rows */ @@ -609,7 +609,7 @@ void php3_pgsql_get_result_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)  	pg_result = (pgsql_result_handle *) php3_list_find(result->value.lval,&type);  	if (type!=php3_pgsql_module.le_result) { -		php3_error(E_WARNING,"%d is not a PostgresSQL result index",result->value.lval); +		php_error(E_WARNING,"%d is not a PostgresSQL result index",result->value.lval);  		RETURN_FALSE;  	} @@ -626,7 +626,7 @@ void php3_pgsql_get_result_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)  #if HAVE_PQCMDTUPLES  			return_value->value.lval = atoi(PQcmdTuples(pgsql_result));  #else -			php3_error(E_WARNING,"This compilation does not support pg_cmdtuples()"); +			php_error(E_WARNING,"This compilation does not support pg_cmdtuples()");  			return_value->value.lval = 0;  #endif  			break; @@ -672,7 +672,7 @@ char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list)  	snprintf(hashed_oid_key,31,"pgsql_oid_%d",(int) oid);  	hashed_oid_key[31]=0; -	if (_php3_hash_find(list,hashed_oid_key,strlen(hashed_oid_key)+1,(void **) &field_type)==SUCCESS) { +	if (zend_hash_find(list,hashed_oid_key,strlen(hashed_oid_key)+1,(void **) &field_type)==SUCCESS) {  		ret = estrdup((char *)field_type->ptr);  	} else { /* hash all oid's */  		int i,num_rows; @@ -697,7 +697,7 @@ char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list)  			}  			new_oid_entry.type = php3_pgsql_module.le_string;  			new_oid_entry.ptr = estrdup(tmp_name); -			_php3_hash_update(list,hashed_oid_key,strlen(hashed_oid_key)+1,(void *) &new_oid_entry, sizeof(list_entry), NULL); +			zend_hash_update(list,hashed_oid_key,strlen(hashed_oid_key)+1,(void *) &new_oid_entry, sizeof(list_entry), NULL);  			if (!ret && atoi(tmp_oid)==oid) {  				ret = estrdup(tmp_name);  			} @@ -726,7 +726,7 @@ void php3_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)  	pg_result = (pgsql_result_handle *) php3_list_find(result->value.lval,&type);  	if (type!=php3_pgsql_module.le_result) { -		php3_error(E_WARNING,"%d is not a PostgresSQL result index",result->value.lval); +		php_error(E_WARNING,"%d is not a PostgresSQL result index",result->value.lval);  		RETURN_FALSE;  	} @@ -734,7 +734,7 @@ void php3_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)  	convert_to_long(field);  	if (field->value.lval<0 || field->value.lval>=PQnfields(pgsql_result)) { -		php3_error(E_WARNING,"Bad field offset specified"); +		php_error(E_WARNING,"Bad field offset specified");  		RETURN_FALSE;  	} @@ -800,7 +800,7 @@ PHP_FUNCTION(pgsql_field_number)  	pg_result = (pgsql_result_handle *) php3_list_find(result->value.lval,&type);  	if (type!=php3_pgsql_module.le_result) { -		php3_error(E_WARNING,"%d is not a PostgresSQL result index",result->value.lval); +		php_error(E_WARNING,"%d is not a PostgresSQL result index",result->value.lval);  		RETURN_FALSE;  	}  	pgsql_result = pg_result->result; @@ -829,14 +829,14 @@ PHP_FUNCTION(pgsql_result)  	pg_result = (pgsql_result_handle *) php3_list_find(result->value.lval,&type);  	if (type!=php3_pgsql_module.le_result) { -		php3_error(E_WARNING,"%d is not a PostgresSQL result index",result->value.lval); +		php_error(E_WARNING,"%d is not a PostgresSQL result index",result->value.lval);  		RETURN_FALSE;  	}  	pgsql_result = pg_result->result;  	convert_to_long(row);  	if (row->value.lval<0 || row->value.lval>=PQntuples(pgsql_result)) { -		php3_error(E_WARNING,"Unable to jump to row %d on PostgresSQL result index %d",row->value.lval,result->value.lval); +		php_error(E_WARNING,"Unable to jump to row %d on PostgresSQL result index %d",row->value.lval,result->value.lval);  		RETURN_FALSE;  	}  	switch(field->type) { @@ -849,7 +849,7 @@ PHP_FUNCTION(pgsql_result)  			break;  	}  	if (field_offset<0 || field_offset>=PQnfields(pgsql_result)) { -		php3_error(E_WARNING,"Bad column offset specified"); +		php_error(E_WARNING,"Bad column offset specified");  		RETURN_FALSE;  	} @@ -898,14 +898,14 @@ static void php3_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)  	pg_result = (pgsql_result_handle *) php3_list_find(result->value.lval,&type);  	if (type!=php3_pgsql_module.le_result) { -		php3_error(E_WARNING,"%d is not a PostgresSQL result index",result->value.lval); +		php_error(E_WARNING,"%d is not a PostgresSQL result index",result->value.lval);  		RETURN_FALSE;  	}  	pgsql_result = pg_result->result;  	convert_to_long(row);  	if (row->value.lval<0 || row->value.lval>=PQntuples(pgsql_result)) { -		php3_error(E_WARNING,"Unable to jump to row %d on PostgresSQL result index %d",row->value.lval,result->value.lval); +		php_error(E_WARNING,"Unable to jump to row %d on PostgresSQL result index %d",row->value.lval,result->value.lval);  		RETURN_FALSE;  	}  	array_init(return_value); @@ -992,14 +992,14 @@ void php3_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)  	pg_result = (pgsql_result_handle *) php3_list_find(result->value.lval,&type);  	if (type!=php3_pgsql_module.le_result) { -		php3_error(E_WARNING,"%d is not a PostgresSQL result index",result->value.lval); +		php_error(E_WARNING,"%d is not a PostgresSQL result index",result->value.lval);  		RETURN_FALSE;  	}  	pgsql_result = pg_result->result;  	convert_to_long(row);  	if (row->value.lval<0 || row->value.lval>=PQntuples(pgsql_result)) { -		php3_error(E_WARNING,"Unable to jump to row %d on PostgresSQL result index %d",row->value.lval,result->value.lval); +		php_error(E_WARNING,"Unable to jump to row %d on PostgresSQL result index %d",row->value.lval,result->value.lval);  		RETURN_FALSE;  	}  	switch(field->type) { @@ -1012,7 +1012,7 @@ void php3_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)  			break;  	}  	if (field_offset<0 || field_offset>=PQnfields(pgsql_result)) { -		php3_error(E_WARNING,"Bad column offset specified"); +		php_error(E_WARNING,"Bad column offset specified");  		RETURN_FALSE;  	} @@ -1062,7 +1062,7 @@ PHP_FUNCTION(pgsql_free_result)  	pg_result = (pgsql_result_handle *) php3_list_find(result->value.lval,&type);  	if (type!=php3_pgsql_module.le_result) { -		php3_error(E_WARNING,"%d is not a PostgresSQL result index",result->value.lval); +		php_error(E_WARNING,"%d is not a PostgresSQL result index",result->value.lval);  		RETURN_FALSE;  	}  	php3_list_delete(result->value.lval); @@ -1087,7 +1087,7 @@ PHP_FUNCTION(pgsql_last_oid)  	pg_result = (pgsql_result_handle *) php3_list_find(result->value.lval,&type);  	if (type!=php3_pgsql_module.le_result) { -		php3_error(E_WARNING,"%d is not a PostgresSQL result index",result->value.lval); +		php_error(E_WARNING,"%d is not a PostgresSQL result index",result->value.lval);  		RETURN_FALSE;  	}  	pgsql_result = pg_result->result; @@ -1129,7 +1129,7 @@ PHP_FUNCTION(pgsql_lo_create)  	pgsql = (PGconn *) php3_list_find(id,&type);  	if (type!=php3_pgsql_module.le_link && type!=php3_pgsql_module.le_plink) { -		php3_error(E_WARNING,"%d is not a PostgresSQL link index",id); +		php_error(E_WARNING,"%d is not a PostgresSQL link index",id);  		RETURN_FALSE;  	} @@ -1142,7 +1142,7 @@ PHP_FUNCTION(pgsql_lo_create)  	 */  	if ((pgsql_oid=lo_creat(pgsql, INV_READ|INV_WRITE))==0) { -		php3_error(E_WARNING,"Unable to create PostgresSQL large object"); +		php_error(E_WARNING,"Unable to create PostgresSQL large object");  		RETURN_FALSE;  	} @@ -1185,12 +1185,12 @@ PHP_FUNCTION(pgsql_lo_unlink)  	pgsql = (PGconn *) php3_list_find(id,&type);  	if (type!=php3_pgsql_module.le_link && type!=php3_pgsql_module.le_plink) { -		php3_error(E_WARNING,"%d is not a PostgresSQL link index",id); +		php_error(E_WARNING,"%d is not a PostgresSQL link index",id);  		RETURN_FALSE;  	}  	if (lo_unlink(pgsql, pgsql_oid)==-1) { -		php3_error(E_WARNING,"Unable to delete PostgresSQL large object %d", (int) pgsql_oid); +		php_error(E_WARNING,"Unable to delete PostgresSQL large object %d", (int) pgsql_oid);  		RETURN_FALSE;  	}  	RETURN_TRUE; @@ -1238,7 +1238,7 @@ PHP_FUNCTION(pgsql_lo_open)  	pgsql = (PGconn *) php3_list_find(id,&type);  	if (type!=php3_pgsql_module.le_link && type!=php3_pgsql_module.le_plink) { -		php3_error(E_WARNING,"%d is not a PostgresSQL link index",id); +		php_error(E_WARNING,"%d is not a PostgresSQL link index",id);  		RETURN_FALSE;  	} @@ -1268,17 +1268,17 @@ PHP_FUNCTION(pgsql_lo_open)  		if (create) {  			if ((pgsql_oid=lo_creat(pgsql, INV_READ|INV_WRITE))==0) {  				efree(pgsql_lofp); -				php3_error(E_WARNING,"Unable to create PostgresSQL large object"); +				php_error(E_WARNING,"Unable to create PostgresSQL large object");  				RETURN_FALSE;  			} else {  				if ((pgsql_lofd=lo_open(pgsql, pgsql_oid, pgsql_mode))==-1) {  					if (lo_unlink(pgsql, pgsql_oid)==-1) {  						efree(pgsql_lofp); -						php3_error(E_WARNING,"Something's really messed up!!! Your database is badly corrupted in a way NOT related to PHP."); +						php_error(E_WARNING,"Something's really messed up!!! Your database is badly corrupted in a way NOT related to PHP.");  						RETURN_FALSE;  					}  					efree(pgsql_lofp); -					php3_error(E_WARNING,"Unable to open PostgresSQL large object"); +					php_error(E_WARNING,"Unable to open PostgresSQL large object");  					RETURN_FALSE;  				} else {  					pgsql_lofp->conn = pgsql; @@ -1289,7 +1289,7 @@ PHP_FUNCTION(pgsql_lo_open)  			}  		} else {  			efree(pgsql_lofp); -			php3_error(E_WARNING,"Unable to open PostgresSQL large object"); +			php_error(E_WARNING,"Unable to open PostgresSQL large object");  			RETURN_FALSE;  		}  	} else { @@ -1324,12 +1324,12 @@ PHP_FUNCTION(pgsql_lo_close)  	pgsql = (pgLofp *) php3_list_find(id,&type);  	if (type!=php3_pgsql_module.le_lofp) { -		php3_error(E_WARNING,"%d is not a PostgresSQL large object index",id); +		php_error(E_WARNING,"%d is not a PostgresSQL large object index",id);  		RETURN_FALSE;  	}  	if (lo_close((PGconn *)pgsql->conn, pgsql->lofd)<0) { -		php3_error(E_WARNING,"Unable to close PostgresSQL large object descriptor %d", pgsql->lofd); +		php_error(E_WARNING,"Unable to close PostgresSQL large object descriptor %d", pgsql->lofd);  		RETVAL_FALSE;  	} else {  		RETVAL_TRUE; @@ -1365,7 +1365,7 @@ PHP_FUNCTION(pgsql_lo_read)  	pgsql = (pgLofp *) php3_list_find(id,&type);  	if (type!=php3_pgsql_module.le_lofp) { -		php3_error(E_WARNING,"%d is not a PostgresSQL large object index",id); +		php_error(E_WARNING,"%d is not a PostgresSQL large object index",id);  		RETURN_FALSE;  	} @@ -1407,7 +1407,7 @@ PHP_FUNCTION(pgsql_lo_write)  	pgsql = (pgLofp *) php3_list_find(id,&type);  	if (type!=php3_pgsql_module.le_lofp) { -		php3_error(E_WARNING,"%d is not a PostgresSQL large object index",id); +		php_error(E_WARNING,"%d is not a PostgresSQL large object index",id);  		RETURN_FALSE;  	} @@ -1446,7 +1446,7 @@ PHP_FUNCTION(pgsql_lo_readall)  	pgsql = (pgLofp *) php3_list_find(id,&type);  	if (type!=php3_pgsql_module.le_lofp) { -		php3_error(E_WARNING,"%d is not a PostgresSQL large object index",id); +		php_error(E_WARNING,"%d is not a PostgresSQL large object index",id);  		RETURN_FALSE;  	} diff --git a/ext/rpc/com/COM.c b/ext/rpc/com/COM.c index 38344196f3..6adab50be2 100644 --- a/ext/rpc/com/COM.c +++ b/ext/rpc/com/COM.c @@ -248,7 +248,7 @@ PHP_FUNCTION(COM_load)  			break;  		case 2:  			if (!INI_INT("allow_dcom")) { -				php3_error(E_WARNING, "DCOM is disabled"); +				php_error(E_WARNING, "DCOM is disabled");  				RETURN_FALSE;  			}  			getParameters(ht, 2, &module_name, &server_name); @@ -267,7 +267,7 @@ PHP_FUNCTION(COM_load)  	// obtain CLSID  	if (FAILED(hr)) {  		error_message = _php3_COM_error_message(hr);	 -		php3_error(E_WARNING,"Invalid ProgID:  %s\n", error_message); +		php_error(E_WARNING,"Invalid ProgID:  %s\n", error_message);  		LocalFree(error_message);  		RETURN_FALSE;  	} @@ -297,7 +297,7 @@ PHP_FUNCTION(COM_load)  	if (FAILED(hr)) {  		error_message = _php3_COM_error_message(hr);  		clsid_str = _php3_string_from_clsid(&clsid); -		php3_error(E_WARNING,"Unable to obtain IDispatch interface for CLSID %s:  %s",clsid_str,error_message); +		php_error(E_WARNING,"Unable to obtain IDispatch interface for CLSID %s:  %s",clsid_str,error_message);  		LocalFree(error_message);  		efree(clsid_str);  		RETURN_FALSE; @@ -355,7 +355,7 @@ static void php_variant_to_pval(VARIANTARG *var_arg, pval *pval_arg, int persist  			var_reset(pval_arg);  			break;  		default: -			php3_error(E_WARNING,"Unsupported variant type"); +			php_error(E_WARNING,"Unsupported variant type");  			var_reset(pval_arg);  			break;  	} @@ -408,7 +408,7 @@ int do_COM_invoke(IDispatch *i_dispatch, pval *function_name, VARIANTARG *var_re  	if (FAILED(hr)) {  		error_message = _php3_COM_error_message(hr); -		php3_error(E_WARNING,"Unable to lookup %s:  %s\n", function_name->value.str.val, error_message); +		php_error(E_WARNING,"Unable to lookup %s:  %s\n", function_name->value.str.val, error_message);  		LocalFree(error_message);  		efree(funcname);  		return FAILURE; @@ -433,7 +433,7 @@ int do_COM_invoke(IDispatch *i_dispatch, pval *function_name, VARIANTARG *var_re  	if (FAILED(hr)) {  		error_message = _php3_COM_error_message(hr); -		php3_error(E_WARNING,"Invoke() failed:  %s\n", error_message); +		php_error(E_WARNING,"Invoke() failed:  %s\n", error_message);  		LocalFree(error_message);  		efree(funcname);  		efree(variant_args); @@ -470,7 +470,7 @@ PHP_FUNCTION(COM_invoke)  	convert_to_long(object);  	i_dispatch = php3_list_find(object->value.lval, &type);  	if (!i_dispatch || (type!=le_idispatch)) { -		php3_error(E_WARNING,"%d is not a COM object handler", function_name->value.str.val); +		php_error(E_WARNING,"%d is not a COM object handler", function_name->value.str.val);  		RETURN_FALSE;  	} @@ -526,7 +526,7 @@ static int do_COM_propget(VARIANTARG *var_result, IDispatch *i_dispatch, pval *a  	if (FAILED(hr)) {  		error_message = _php3_COM_error_message(hr); -		php3_error(E_WARNING,"Unable to lookup %s:  %s\n", arg_property->value.str.val, error_message); +		php_error(E_WARNING,"Unable to lookup %s:  %s\n", arg_property->value.str.val, error_message);  		LocalFree(error_message);  		efree(propname);  		if (cleanup) { @@ -544,7 +544,7 @@ static int do_COM_propget(VARIANTARG *var_result, IDispatch *i_dispatch, pval *a  	if (FAILED(hr)) {  		error_message = _php3_COM_error_message(hr); -		php3_error(E_WARNING,"PropGet() failed:  %s\n", error_message); +		php_error(E_WARNING,"PropGet() failed:  %s\n", error_message);  		LocalFree(error_message);  		efree(propname);  		if (cleanup) { @@ -582,7 +582,7 @@ static void do_COM_propput(pval *return_value, IDispatch *i_dispatch, pval *arg_  	if (FAILED(hr)) {  		error_message = _php3_COM_error_message(hr); -		php3_error(E_WARNING,"Unable to lookup %s:  %s\n", arg_property->value.str.val, error_message); +		php_error(E_WARNING,"Unable to lookup %s:  %s\n", arg_property->value.str.val, error_message);  		LocalFree(error_message);  		efree(propname);  		RETURN_FALSE; @@ -608,7 +608,7 @@ static void do_COM_propput(pval *return_value, IDispatch *i_dispatch, pval *arg_  	if (FAILED(hr)) {  		error_message = _php3_COM_error_message(hr); -		php3_error(E_WARNING,"PropPut() failed:  %s\n", error_message); +		php_error(E_WARNING,"PropPut() failed:  %s\n", error_message);  		LocalFree(error_message);  		efree(propname);  		RETURN_FALSE; @@ -636,7 +636,7 @@ PHP_FUNCTION(com_propget)  	/* obtain i_dispatch interface */  	i_dispatch = php3_list_find(arg_idispatch->value.lval,&type);  	if (!i_dispatch || (type!=le_idispatch)) { -		php3_error(E_WARNING,"%d is not a COM object handler", arg_idispatch->value.lval); +		php_error(E_WARNING,"%d is not a COM object handler", arg_idispatch->value.lval);  	}	  	convert_to_string(arg_property); @@ -662,7 +662,7 @@ PHP_FUNCTION(com_propput)  	/* obtain i_dispatch interface */  	i_dispatch = php3_list_find(arg_idispatch->value.lval,&type);  	if (!i_dispatch || (type!=le_idispatch)) { -		php3_error(E_WARNING,"%d is not a COM object handler", arg_idispatch->value.lval); +		php_error(E_WARNING,"%d is not a COM object handler", arg_idispatch->value.lval);  	}	  	convert_to_string(arg_property); diff --git a/ext/session/session.c b/ext/session/session.c index f6614da409..6de13d632d 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -242,7 +242,7 @@ static void _php_session_initialize(PSLS_D)  	int vallen;  	if(PS(mod)->open(&PS(mod_data), PS(save_path), PS(session_name)) == FAILURE) { -		php3_error(E_ERROR, "failed to initialize session module"); +		php_error(E_ERROR, "failed to initialize session module");  		return;  	}  	if(PS(mod)->read(&PS(mod_data), PS(id), &val, &vallen) == SUCCESS) { @@ -460,7 +460,7 @@ PHP_FUNCTION(session_module_name)  			PS(mod_data) = tempmod;  		} else {  			efree(old); -			php3_error(E_ERROR, "Cannot find named PHP session module (%s)", +			php_error(E_ERROR, "Cannot find named PHP session module (%s)",  					p_name->value.str.val);  			RETURN_FALSE;  		} diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index 31ece45700..fa709fe097 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -94,7 +94,7 @@ int php3i_snmp_init(INIT_FUNC_ARGS) {  }  void php3_info_snmp(ZEND_MODULE_INFO_FUNC_ARGS) { -	php3_printf("ucd-snmp"); +	php_printf("ucd-snmp");  } @@ -144,7 +144,7 @@ void _php3_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) {  			if (read_objid(objid, root, &rootlen)) {  				gotroot = 1;  			} else { -				php3_error(E_WARNING,"Invalid object identifier: %s\n", objid); +				php_error(E_WARNING,"Invalid object identifier: %s\n", objid);  			}  		}      	if (gotroot == 0) { @@ -177,7 +177,7 @@ void _php3_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) {  	snmp_synch_setup(&session);  	ss = snmp_open(&session);  	if (ss == NULL){ -		php3_error(E_WARNING,"Couldn't open snmp\n"); +		php_error(E_WARNING,"Couldn't open snmp\n");  		RETURN_FALSE;  	}  	if (st>=2) { @@ -195,7 +195,7 @@ void _php3_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) {  		if (st==1) {  			name_length = MAX_NAME_LEN;  			if (!read_objid(objid, name, &name_length)) { -				php3_error(E_WARNING,"Invalid object identifier: %s\n", objid); +				php_error(E_WARNING,"Invalid object identifier: %s\n", objid);  				RETURN_FALSE;  			}  		} @@ -232,12 +232,12 @@ retry:  				}	  			} else {  				if (st!=2 || response->errstat != SNMP_ERR_NOSUCHNAME) { -					php3_error(E_WARNING,"Error in packet.\nReason: %s\n", snmp_errstring(response->errstat)); +					php_error(E_WARNING,"Error in packet.\nReason: %s\n", snmp_errstring(response->errstat));  					if (response->errstat == SNMP_ERR_NOSUCHNAME) {  						for(count=1, vars = response->variables; vars && count != response->errindex;  							vars = vars->next_variable, count++);  						if (vars) sprint_objid(buf,vars->name, vars->name_length); -						php3_error(E_WARNING,"This name does not exist: %s\n",buf); +						php_error(E_WARNING,"This name does not exist: %s\n",buf);  					}  					if (st==1) {  						if ((pdu = snmp_fix_pdu(response, SNMP_MSG_GET)) != NULL) goto retry; @@ -248,10 +248,10 @@ retry:  				}  			}  		} else if (status == STAT_TIMEOUT) { -			php3_error(E_WARNING,"No Response from %s\n", a1->value.str.val); +			php_error(E_WARNING,"No Response from %s\n", a1->value.str.val);  			RETURN_FALSE;  		} else {    /* status == STAT_ERROR */ -			php3_error(E_WARNING,"An error occurred, Quitting\n"); +			php_error(E_WARNING,"An error occurred, Quitting\n");  			RETURN_FALSE;  		}  		if (response) snmp_free_pdu(response); diff --git a/ext/snmp/winsnmp.c b/ext/snmp/winsnmp.c index 38042f9e6c..fd6c5932ec 100644 --- a/ext/snmp/winsnmp.c +++ b/ext/snmp/winsnmp.c @@ -87,7 +87,7 @@ void _php3_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) {     for the session are also required.  */  	if ((session = SnmpMgrOpen(agent, community, timeout, retries)) == NULL){ -		php3_error(E_WARNING,"error on SnmpMgrOpen %d\n", GetLastError()); +		php_error(E_WARNING,"error on SnmpMgrOpen %d\n", GetLastError());  	}      /* Determine and perform the requested operation.*/ @@ -106,12 +106,12 @@ void _php3_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) {  		if (!SnmpMgrRequest(session, requestType, &variableBindings,                              &errorStatus, &errorIndex)){              /* The API is indicating an error. */ -            php3_error(E_WARNING,"error on SnmpMgrRequest %d\n", GetLastError()); +            php_error(E_WARNING,"error on SnmpMgrRequest %d\n", GetLastError());          } else {              /* The API succeeded, errors may be indicated from the remote                 agent. */              if (errorStatus > 0){ -                php3_error(E_WARNING,"Error: errorStatus=%d, errorIndex=%d\n", +                php_error(E_WARNING,"Error: errorStatus=%d, errorIndex=%d\n",                         errorStatus, errorIndex);              } else {                  /* Display the resulting variable bindings.*/ @@ -121,13 +121,13 @@ void _php3_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) {                  for(i=0; i < variableBindings.len; i++)                      {                      SnmpMgrOidToStr(&variableBindings.list[i].name, &string); -                    php3_printf("Variable = %s\n", string); +                    php_printf("Variable = %s\n", string);                      if (string) SNMP_free(string); -                    php3_printf("Value    = "); +                    php_printf("Value    = ");                      SnmpUtilPrintAsnAny(&variableBindings.list[i].value); -                    php3_printf("\n"); +                    php_printf("\n");                      } /* end for() */                  }              } @@ -152,7 +152,7 @@ void _php3_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) {              if (!SnmpMgrRequest(session, requestType, &variableBindings,                                  &errorStatus, &errorIndex)){                  /* The API is indicating an error.*/ -                php3_error(E_WARNING,"error on SnmpMgrRequest %d\n", GetLastError()); +                php_error(E_WARNING,"error on SnmpMgrRequest %d\n", GetLastError());                  break;                  }              else @@ -170,7 +170,7 @@ void _php3_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) {                  /* Test for general error conditions or sucesss. */                  if (errorStatus > 0){ -                    php3_error(E_ERROR,"Error: errorStatus=%d, errorIndex=%d \n", +                    php_error(E_ERROR,"Error: errorStatus=%d, errorIndex=%d \n",                             errorStatus, errorIndex);                      break;                      } @@ -180,13 +180,13 @@ void _php3_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) {                      char *string = NULL;                      SnmpMgrOidToStr(&variableBindings.list[0].name, &string); -                    php3_printf("Variable = %s\n", string); +                    php_printf("Variable = %s\n", string);                      if (string) SNMP_free(string); -                    php3_printf("Value    = "); +                    php_printf("Value    = ");                      SnmpUtilPrintAsnAny(&variableBindings.list[0].value); -                    php3_printf("\n"); +                    php_printf("\n");                      }                  } /* end if () */              /* Prepare for the next iteration.  Make sure returned oid is @@ -206,7 +206,7 @@ void _php3_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) {  	/* Close SNMP session with the remote agent.*/  	if (!SnmpMgrClose(session)){ -		php3_error(E_WARNING,"error on SnmpMgrClose %d\n", GetLastError()); +		php_error(E_WARNING,"error on SnmpMgrClose %d\n", GetLastError());  	}  } diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 6fed8a31bb..9793ae1ceb 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -409,7 +409,7 @@ PHP_RINIT_FUNCTION(basic)  {  	strtok_string = NULL;  #ifdef HAVE_PUTENV -	if (_php3_hash_init(&putenv_ht, 1, NULL, (int (*)(void *)) _php3_putenv_destructor, 0) == FAILURE) { +	if (zend_hash_init(&putenv_ht, 1, NULL, (int (*)(void *)) _php3_putenv_destructor, 0) == FAILURE) {  		return FAILURE;  	}  #endif @@ -423,7 +423,7 @@ PHP_RSHUTDOWN_FUNCTION(basic)  {  	STR_FREE(strtok_string);  #ifdef HAVE_PUTENV -	_php3_hash_destroy(&putenv_ht); +	zend_hash_destroy(&putenv_ht);  #endif  	return SUCCESS; @@ -509,7 +509,7 @@ PHP_FUNCTION(putenv)  		pe.key_len = strlen(pe.key);  		pe.key = estrndup(pe.key,pe.key_len); -		_php3_hash_del(&putenv_ht,pe.key,pe.key_len+1); +		zend_hash_del(&putenv_ht,pe.key,pe.key_len+1);  		/* find previous value */  		pe.previous_value = NULL; @@ -521,7 +521,7 @@ PHP_FUNCTION(putenv)  		}  		if ((ret=putenv(pe.putenv_string))==0) { /* success */ -			_php3_hash_add(&putenv_ht,pe.key,pe.key_len+1,(void **) &pe,sizeof(putenv_entry),NULL); +			zend_hash_add(&putenv_ht,pe.key,pe.key_len+1,(void **) &pe,sizeof(putenv_entry),NULL);  			RETURN_TRUE;  		} else {  			efree(pe.putenv_string); @@ -667,14 +667,14 @@ PHP_FUNCTION(ksort)  	}  	target_hash = HASH_OF(array);  	if (!target_hash) { -		php3_error(E_WARNING, "Wrong datatype in ksort() call"); +		php_error(E_WARNING, "Wrong datatype in ksort() call");  		return;  	}  	if (!ParameterPassedByReference(ht,1)) { -		php3_error(E_WARNING, "Array not passed by reference in call to ksort()"); +		php_error(E_WARNING, "Array not passed by reference in call to ksort()");  		return;  	} -	if (_php3_hash_sort(target_hash, array_key_compare,0) == FAILURE) { +	if (zend_hash_sort(target_hash, array_key_compare,0) == FAILURE) {  		return;  	}  	RETURN_TRUE; @@ -698,7 +698,7 @@ PHP_FUNCTION(count)  		}  	} -	RETURN_LONG(_php3_hash_num_elements(target_hash)); +	RETURN_LONG(zend_hash_num_elements(target_hash));  } @@ -768,14 +768,14 @@ PHP_FUNCTION(asort)  	}  	target_hash = HASH_OF(array);  	if (!target_hash) { -		php3_error(E_WARNING, "Wrong datatype in asort() call"); +		php_error(E_WARNING, "Wrong datatype in asort() call");  		return;  	}      if (!ParameterPassedByReference(ht,1)) { -        php3_error(E_WARNING, "Array not passed by reference in call to asort()"); +        php_error(E_WARNING, "Array not passed by reference in call to asort()");  		return;      } -	if (_php3_hash_sort(target_hash, array_data_compare,0) == FAILURE) { +	if (zend_hash_sort(target_hash, array_data_compare,0) == FAILURE) {  		return;  	}  	RETURN_TRUE; @@ -791,14 +791,14 @@ PHP_FUNCTION(arsort)  	}  	target_hash = HASH_OF(array);  	if (!target_hash) { -		php3_error(E_WARNING, "Wrong datatype in arsort() call"); +		php_error(E_WARNING, "Wrong datatype in arsort() call");  		return;  	}      if (!ParameterPassedByReference(ht,1)) { -        php3_error(E_WARNING, "Array not passed by reference in call to arsort()"); +        php_error(E_WARNING, "Array not passed by reference in call to arsort()");  		return;      } -	if (_php3_hash_sort(target_hash, array_reverse_data_compare,0) == FAILURE) { +	if (zend_hash_sort(target_hash, array_reverse_data_compare,0) == FAILURE) {  		return;  	}  	RETURN_TRUE; @@ -814,14 +814,14 @@ PHP_FUNCTION(sort)  	}  	target_hash = HASH_OF(array);  	if (!target_hash) { -		php3_error(E_WARNING, "Wrong datatype in sort() call"); +		php_error(E_WARNING, "Wrong datatype in sort() call");  		return;  	}      if (!ParameterPassedByReference(ht,1)) { -        php3_error(E_WARNING, "Array not passed by reference in call to sort()"); +        php_error(E_WARNING, "Array not passed by reference in call to sort()");  		return;      } -	if (_php3_hash_sort(target_hash, array_data_compare,1) == FAILURE) { +	if (zend_hash_sort(target_hash, array_data_compare,1) == FAILURE) {  		return;  	}  	RETURN_TRUE; @@ -837,14 +837,14 @@ PHP_FUNCTION(rsort)  	}  	target_hash = HASH_OF(array);  	if (!target_hash) { -		php3_error(E_WARNING, "Wrong datatype in rsort() call"); +		php_error(E_WARNING, "Wrong datatype in rsort() call");  		return;  	}      if (!ParameterPassedByReference(ht,1)) { -        php3_error(E_WARNING, "Array not passed by reference in call to rsort()"); +        php_error(E_WARNING, "Array not passed by reference in call to rsort()");  		return;      } -	if (_php3_hash_sort(target_hash, array_reverse_data_compare,1) == FAILURE) { +	if (zend_hash_sort(target_hash, array_reverse_data_compare,1) == FAILURE) {  		return;  	}  	RETURN_TRUE; @@ -887,12 +887,12 @@ PHP_FUNCTION(usort)  	}  	target_hash = HASH_OF(array);  	if (!target_hash) { -		php3_error(E_WARNING, "Wrong datatype in usort() call"); +		php_error(E_WARNING, "Wrong datatype in usort() call");  		user_compare_func_name = old_compare_func;  		return;  	}  	convert_to_string(user_compare_func_name); -	if (_php3_hash_sort(target_hash, array_user_compare, 1) == FAILURE) { +	if (zend_hash_sort(target_hash, array_user_compare, 1) == FAILURE) {  		user_compare_func_name = old_compare_func;  		return;  	} @@ -913,12 +913,12 @@ PHP_FUNCTION(uasort)  	}  	target_hash = HASH_OF(array);  	if (!target_hash) { -		php3_error(E_WARNING, "Wrong datatype in uasort() call"); +		php_error(E_WARNING, "Wrong datatype in uasort() call");  		user_compare_func_name = old_compare_func;  		return;  	}  	convert_to_string(user_compare_func_name); -	if (_php3_hash_sort(target_hash, array_user_compare, 0) == FAILURE) { +	if (zend_hash_sort(target_hash, array_user_compare, 0) == FAILURE) {  		user_compare_func_name = old_compare_func;  		return;  	} @@ -987,12 +987,12 @@ PHP_FUNCTION(uksort)  	}  	target_hash = HASH_OF(array);  	if (!target_hash) { -		php3_error(E_WARNING, "Wrong datatype in uksort() call"); +		php_error(E_WARNING, "Wrong datatype in uksort() call");  		user_compare_func_name = old_compare_func;  		return;  	}  	convert_to_string(user_compare_func_name); -	if (_php3_hash_sort(target_hash, array_user_key_compare, 0) == FAILURE) { +	if (zend_hash_sort(target_hash, array_user_key_compare, 0) == FAILURE) {  		user_compare_func_name = old_compare_func;  		return;  	} @@ -1011,14 +1011,14 @@ PHP_FUNCTION(end)  	}  	target_hash = HASH_OF(array);  	if (!target_hash) { -		php3_error(E_WARNING, "Variable passed to end() is not an array or object"); +		php_error(E_WARNING, "Variable passed to end() is not an array or object");  		return;  	}      if (!ParameterPassedByReference(ht,1)) { -        php3_error(E_WARNING, "Array not passed by reference in call to end()"); +        php_error(E_WARNING, "Array not passed by reference in call to end()");      } -	_php3_hash_internal_pointer_end(target_hash); -	if (_php3_hash_get_current_data(target_hash, (void **) &entry) == FAILURE) { +	zend_hash_internal_pointer_end(target_hash); +	if (zend_hash_get_current_data(target_hash, (void **) &entry) == FAILURE) {  		RETURN_FALSE;  	}  	*return_value = **entry; @@ -1036,11 +1036,11 @@ PHP_FUNCTION(prev)  	}  	target_hash = HASH_OF(array);  	if (!target_hash) { -		php3_error(E_WARNING, "Variable passed to prev() is not an array or object"); +		php_error(E_WARNING, "Variable passed to prev() is not an array or object");  		RETURN_FALSE;  	} -	_php3_hash_move_backwards(target_hash); -	if (_php3_hash_get_current_data(target_hash, (void **) &entry) == FAILURE) { +	zend_hash_move_backwards(target_hash); +	if (zend_hash_get_current_data(target_hash, (void **) &entry) == FAILURE) {  		RETURN_FALSE;  	} @@ -1059,11 +1059,11 @@ PHP_FUNCTION(next)  	}  	target_hash = HASH_OF(array);  	if (!target_hash) { -		php3_error(E_WARNING, "Variable passed to next() is not an array or object"); +		php_error(E_WARNING, "Variable passed to next() is not an array or object");  		RETURN_FALSE;  	} -	_php3_hash_move_forward(target_hash); -	if (_php3_hash_get_current_data(target_hash, (void **) &entry) == FAILURE) { +	zend_hash_move_forward(target_hash); +	if (zend_hash_get_current_data(target_hash, (void **) &entry) == FAILURE) {  		RETURN_FALSE;  	} @@ -1085,10 +1085,10 @@ PHP_FUNCTION(each)  	}  	target_hash = HASH_OF(array);  	if (!target_hash) { -		php3_error(E_WARNING,"Variable passed to each() is not an array or object"); +		php_error(E_WARNING,"Variable passed to each() is not an array or object");  		return;  	} -	if (_php3_hash_get_current_data(target_hash, (void **) &entry_ptr)==FAILURE) { +	if (zend_hash_get_current_data(target_hash, (void **) &entry_ptr)==FAILURE) {  		RETURN_FALSE;  	}  	array_init(return_value); @@ -1104,13 +1104,13 @@ PHP_FUNCTION(each)  		tmp->refcount=0;  		entry=tmp;  	} -	_php3_hash_index_update(return_value->value.ht, 1, &entry, sizeof(pval *), NULL); +	zend_hash_index_update(return_value->value.ht, 1, &entry, sizeof(pval *), NULL);  	entry->refcount++; -	_php3_hash_update_ptr(return_value->value.ht, "value", sizeof("value"), entry, sizeof(pval *), NULL); +	zend_hash_update_ptr(return_value->value.ht, "value", sizeof("value"), entry, sizeof(pval *), NULL);  	entry->refcount++;  	/* add the key elements */ -	switch (_php3_hash_get_current_key(target_hash, &string_key, &num_key)) { +	switch (zend_hash_get_current_key(target_hash, &string_key, &num_key)) {  		case HASH_KEY_IS_STRING:  			add_get_index_string(return_value,0,string_key,(void **) &inserted_pointer,0);  			break; @@ -1118,9 +1118,9 @@ PHP_FUNCTION(each)  			add_get_index_long(return_value,0,num_key, (void **) &inserted_pointer);  			break;  	} -	_php3_hash_update(return_value->value.ht, "key", sizeof("key"), inserted_pointer, sizeof(pval *), NULL); +	zend_hash_update(return_value->value.ht, "key", sizeof("key"), inserted_pointer, sizeof(pval *), NULL);  	(*inserted_pointer)->refcount++; -	_php3_hash_move_forward(target_hash); +	zend_hash_move_forward(target_hash);  } @@ -1134,11 +1134,11 @@ PHP_FUNCTION(reset)  	}  	target_hash = HASH_OF(array);  	if (!target_hash) { -		php3_error(E_WARNING, "Variable passed to reset() is not an array or object"); +		php_error(E_WARNING, "Variable passed to reset() is not an array or object");  		return;  	} -	_php3_hash_internal_pointer_reset(target_hash); -	if (_php3_hash_get_current_data(target_hash, (void **) &entry) == FAILURE) { +	zend_hash_internal_pointer_reset(target_hash); +	if (zend_hash_get_current_data(target_hash, (void **) &entry) == FAILURE) {  		return;  	} @@ -1157,10 +1157,10 @@ PHP_FUNCTION(current)  	}  	target_hash = HASH_OF(array);  	if (!target_hash) { -		php3_error(E_WARNING, "Variable passed to current() is not an array or object"); +		php_error(E_WARNING, "Variable passed to current() is not an array or object");  		return;  	} -	if (_php3_hash_get_current_data(target_hash, (void **) &entry) == FAILURE) { +	if (zend_hash_get_current_data(target_hash, (void **) &entry) == FAILURE) {  		return;  	}  	*return_value = **entry; @@ -1180,13 +1180,13 @@ PHP_FUNCTION(key)  	}  	target_hash = HASH_OF(array);  	if (!target_hash) { -		php3_error(E_WARNING, "Variable passed to key() is not an array or object"); +		php_error(E_WARNING, "Variable passed to key() is not an array or object");  		return;  	}      if (!ParameterPassedByReference(ht,1)) { -        php3_error(E_WARNING, "Array not passed by reference in call to key()"); +        php_error(E_WARNING, "Array not passed by reference in call to key()");      } -	switch (_php3_hash_get_current_key(target_hash, &string_key, &num_key)) { +	switch (zend_hash_get_current_key(target_hash, &string_key, &num_key)) {  		case HASH_KEY_IS_STRING:  			return_value->value.str.val = string_key;  			return_value->value.str.len = strlen(string_key); @@ -1324,10 +1324,10 @@ PHP_FUNCTION(settype)  	} else if (!strcasecmp(new_type, "boolean")) {  		convert_to_boolean(var);  	} else if (!strcasecmp(new_type, "resource")) { -		php3_error(E_WARNING, "settype: cannot convert to resource type"); +		php_error(E_WARNING, "settype: cannot convert to resource type");  		RETURN_FALSE;  	} else { -		php3_error(E_WARNING, "settype: invalid type"); +		php_error(E_WARNING, "settype: invalid type");  		RETURN_FALSE;  	}  	RETVAL_TRUE; @@ -1340,7 +1340,7 @@ PHP_FUNCTION(min)  	pval **result;  	if (argc<=0) { -		php3_error(E_WARNING, "min: must be passed at least 1 value"); +		php_error(E_WARNING, "min: must be passed at least 1 value");  		var_uninit(return_value);  		return;  	} @@ -1351,11 +1351,11 @@ PHP_FUNCTION(min)  			arr->type != IS_ARRAY) {  			WRONG_PARAM_COUNT;  		} -		if (_php3_hash_minmax(arr->value.ht, array_data_compare, 0, (void **) &result)==SUCCESS) { +		if (zend_hash_minmax(arr->value.ht, array_data_compare, 0, (void **) &result)==SUCCESS) {  			*return_value = **result;  			pval_copy_constructor(return_value);  		} else { -			php3_error(E_WARNING, "min: array must contain at least 1 element"); +			php_error(E_WARNING, "min: array must contain at least 1 element");  			var_uninit(return_value);  		}  	} else { @@ -1391,7 +1391,7 @@ PHP_FUNCTION(max)  	pval **result;  	if (argc<=0) { -		php3_error(E_WARNING, "max: must be passed at least 1 value"); +		php_error(E_WARNING, "max: must be passed at least 1 value");  		var_uninit(return_value);  		return;  	} @@ -1402,11 +1402,11 @@ PHP_FUNCTION(max)  			arr->type != IS_ARRAY) {  			WRONG_PARAM_COUNT;  		} -		if (_php3_hash_minmax(arr->value.ht, array_data_compare, 1, (void **) &result)==SUCCESS) { +		if (zend_hash_minmax(arr->value.ht, array_data_compare, 1, (void **) &result)==SUCCESS) {  			*return_value = **result;  			pval_copy_constructor(return_value);  		} else { -			php3_error(E_WARNING, "max: array must contain at least 1 element"); +			php_error(E_WARNING, "max: array must contain at least 1 element");  			var_uninit(return_value);  		}  	} else { @@ -1460,12 +1460,12 @@ PHP_FUNCTION(array_walk) {  	}  	target_hash = HASH_OF(array);  	if (!target_hash) { -		php3_error(E_WARNING, "Wrong datatype in array_walk() call"); +		php_error(E_WARNING, "Wrong datatype in array_walk() call");  		php3_array_walk_func_name = old_walk_func_name;  		return;  	}  	convert_to_string(php3_array_walk_func_name); -	_php3_hash_apply(target_hash, (int (*)(void *))_php3_array_walk); +	zend_hash_apply(target_hash, (int (*)(void *))_php3_array_walk);  	php3_array_walk_func_name = old_walk_func_name;  	RETURN_TRUE;  } @@ -1488,13 +1488,13 @@ PHP_FUNCTION(max)  			WRONG_PARAM_COUNT;  		}  		if (argv[0]->value.ht->nNumOfElements < 2) { -			php3_error(E_WARNING, +			php_error(E_WARNING,  					   "min: array must contain at least 2 elements");  			RETURN_FALSE;  		}  		/* replace the function parameters with the array */  		ht = argv[0]->value.ht; -		argc = _php3_hash_num_elements(ht); +		argc = zend_hash_num_elements(ht);  		efree(argv);  	} else if (argc < 2) {  		WRONG_PARAM_COUNT; @@ -1708,7 +1708,7 @@ PHP_FUNCTION(leak)  	4th arg = used for additional headers if email    error options -    0 = send to php3_error_log (uses syslog or file depending on ini setting) +    0 = send to php_error_log (uses syslog or file depending on ini setting)  	1 = send via email to 3rd parameter 4th option = additional headers  	2 = send via tcp/ip to 3rd parameter (name or ip:port)  	3 = save to file in 3rd parameter @@ -1723,13 +1723,13 @@ PHP_FUNCTION(error_log)  	switch(ARG_COUNT(ht)) {  	case 1:  		if (getParameters(ht,1,&string) == FAILURE) { -			php3_error(E_WARNING,"Invalid argument 1 in error_log"); +			php_error(E_WARNING,"Invalid argument 1 in error_log");  			RETURN_FALSE;  		}  		break;  	case 2:  		if (getParameters(ht,2,&string,&erropt) == FAILURE) { -			php3_error(E_WARNING,"Invalid arguments in error_log"); +			php_error(E_WARNING,"Invalid arguments in error_log");  			RETURN_FALSE;  		}  		convert_to_long(erropt); @@ -1737,7 +1737,7 @@ PHP_FUNCTION(error_log)  		break;  	case 3:  		if (getParameters(ht,3,&string,&erropt,&option) == FAILURE){ -			php3_error(E_WARNING,"Invalid arguments in error_log"); +			php_error(E_WARNING,"Invalid arguments in error_log");  			RETURN_FALSE;  		}  		convert_to_long(erropt); @@ -1747,7 +1747,7 @@ PHP_FUNCTION(error_log)  		break;  	case 4:  		if (getParameters(ht,4,&string,&erropt,&option,&emailhead) == FAILURE){ -			php3_error(E_WARNING,"Invalid arguments in error_log"); +			php_error(E_WARNING,"Invalid arguments in error_log");  			RETURN_FALSE;  		}  		break; @@ -1770,14 +1770,14 @@ PHP_FUNCTION(error_log)  		headers=emailhead->value.str.val;  	} -	if (_php3_error_log(opt_err,message,opt,headers)==FAILURE) { +	if (_php_error_log(opt_err,message,opt,headers)==FAILURE) {  		RETURN_FALSE;  	}  	RETURN_TRUE;  } -PHPAPI int _php3_error_log(int opt_err,char *message,char *opt,char *headers){ +PHPAPI int _php_error_log(int opt_err,char *message,char *opt,char *headers){  	FILE *logfile;  	int issock=0, socketd=0;; @@ -1789,19 +1789,19 @@ PHPAPI int _php3_error_log(int opt_err,char *message,char *opt,char *headers){  			return FAILURE;  		}  #else -		php3_error(E_WARNING,"Mail option not available!"); +		php_error(E_WARNING,"Mail option not available!");  		return FAILURE;  #endif  		}  		break;  	case 2: /*send to an address */ -		php3_error(E_WARNING,"TCP/IP option not available!"); +		php_error(E_WARNING,"TCP/IP option not available!");  		return FAILURE;  		break;  	case 3: /*save to a file*/  		logfile=php3_fopen_wrapper(opt,"a", (IGNORE_URL|ENFORCE_SAFE_MODE), &issock, &socketd);  		if(!logfile) { -			php3_error(E_WARNING,"error_log: Unable to write to %s",opt); +			php_error(E_WARNING,"error_log: Unable to write to %s",opt);  			return FAILURE;  		}  		fwrite(message,strlen(message),1,logfile); @@ -1835,7 +1835,7 @@ PHP_FUNCTION(call_user_func)  	if (call_user_function(CG(function_table), NULL, params[0], &retval, arg_count-1, params+1)==SUCCESS) {  		*return_value = retval;  	} else { -		php3_error(E_WARNING,"Unable to call %s() - function does not exist", params[0]->value.str.val); +		php_error(E_WARNING,"Unable to call %s() - function does not exist", params[0]->value.str.val);  	}  	efree(params);  } @@ -1858,7 +1858,7 @@ PHP_FUNCTION(call_user_method)  		RETURN_FALSE;  	}  	if (params[1]->type != IS_OBJECT) { -		php3_error(E_WARNING,"2nd argument is not an object\n"); +		php_error(E_WARNING,"2nd argument is not an object\n");  		efree(params);  		RETURN_FALSE;  	} @@ -1866,7 +1866,7 @@ PHP_FUNCTION(call_user_method)  	if (call_user_function(CG(function_table), params[1], params[0], &retval, arg_count-2, params+2)==SUCCESS) {  		*return_value = retval;  	} else { -		php3_error(E_WARNING,"Unable to call %s() - function does not exist", params[0]->value.str.val); +		php_error(E_WARNING,"Unable to call %s() - function does not exist", params[0]->value.str.val);  	}  	efree(params);  } @@ -1888,7 +1888,7 @@ int user_shutdown_function_dtor(pval *user_shutdown_function_name)  void php3_call_shutdown_functions(void)  {  	if (user_shutdown_function_names) { -		_php3_hash_destroy(user_shutdown_function_names); +		zend_hash_destroy(user_shutdown_function_names);  		efree(user_shutdown_function_names);  	}  } @@ -1906,13 +1906,13 @@ PHP_FUNCTION(register_shutdown_function)  	convert_to_string(arg);  	if (!user_shutdown_function_names) {  		user_shutdown_function_names = (HashTable *) emalloc(sizeof(HashTable)); -		_php3_hash_init(user_shutdown_function_names, 0, NULL, (int (*)(void *))user_shutdown_function_dtor, 0); +		zend_hash_init(user_shutdown_function_names, 0, NULL, (int (*)(void *))user_shutdown_function_dtor, 0);  	}  	shutdown_function_name = *arg;  	pval_copy_constructor(&shutdown_function_name); -	_php3_hash_next_index_insert(user_shutdown_function_names, &shutdown_function_name, sizeof(pval), NULL); +	zend_hash_next_index_insert(user_shutdown_function_names, &shutdown_function_name, sizeof(pval), NULL);  }  /* }}} */ @@ -2232,7 +2232,7 @@ PHP_FUNCTION(define)  		case IS_STRING:  			break;  		default: -			php3_error(E_WARNING,"Constants may only evaluate to scalar values"); +			php_error(E_WARNING,"Constants may only evaluate to scalar values");  			RETURN_FALSE;  			break;  	} diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index 21fe44a5db..94bd24a2d8 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -48,7 +48,7 @@ static int browser_reg_compare(pval *browser)  	if (found_browser_entry) { /* already found */  		return 0;  	} -	_php3_hash_find(browser->value.ht,"browser_name_pattern",sizeof("browser_name_pattern"),(void **) &browser_name); +	zend_hash_find(browser->value.ht,"browser_name_pattern",sizeof("browser_name_pattern"),(void **) &browser_name);  	if (!strchr(browser_name->value.str.val,'*')) {  		return 0;  	} @@ -73,7 +73,7 @@ PHP_FUNCTION(get_browser)  	switch(ARG_COUNT(ht)) {  		case 0: -			if (_php3_hash_find(&EG(symbol_table), "HTTP_USER_AGENT", sizeof("HTTP_USER_AGENT"), (void **) &agent_name)==FAILURE) { +			if (zend_hash_find(&EG(symbol_table), "HTTP_USER_AGENT", sizeof("HTTP_USER_AGENT"), (void **) &agent_name)==FAILURE) {  				agent_name = &tmp;  				var_reset(agent_name);  			} @@ -90,14 +90,14 @@ PHP_FUNCTION(get_browser)  	convert_to_string(agent_name); -	if (_php3_hash_find(&browser_hash, agent_name->value.str.val, agent_name->value.str.len+1, (void **) &agent)==FAILURE) { +	if (zend_hash_find(&browser_hash, agent_name->value.str.val, agent_name->value.str.len+1, (void **) &agent)==FAILURE) {  		lookup_browser_name = agent_name->value.str.val;  		found_browser_entry = NULL; -		_php3_hash_apply(&browser_hash,(int (*)(void *)) browser_reg_compare); +		zend_hash_apply(&browser_hash,(int (*)(void *)) browser_reg_compare);  		if (found_browser_entry) {  			agent = found_browser_entry; -		} else if (_php3_hash_find(&browser_hash, "Default Browser", sizeof("Default Browser"), (void **) &agent)==FAILURE) { +		} else if (zend_hash_find(&browser_hash, "Default Browser", sizeof("Default Browser"), (void **) &agent)==FAILURE) {  			RETURN_FALSE;  		}  	} @@ -107,11 +107,11 @@ PHP_FUNCTION(get_browser)  	pval_copy_constructor(return_value);  	return_value->value.ht->pDestructor = PVAL_DESTRUCTOR; -	while (_php3_hash_find(agent->value.ht, "parent", sizeof("parent"), (void **) &agent_name)==SUCCESS) { -		if (_php3_hash_find(&browser_hash, agent_name->value.str.val, agent_name->value.str.len+1, (void **) &agent)==FAILURE) { +	while (zend_hash_find(agent->value.ht, "parent", sizeof("parent"), (void **) &agent_name)==SUCCESS) { +		if (zend_hash_find(&browser_hash, agent_name->value.str.val, agent_name->value.str.len+1, (void **) &agent)==FAILURE) {  			break;  		} -		_php3_hash_merge(return_value->value.ht,agent->value.ht,(void (*)(void *pData)) pval_copy_constructor, (void *) &tmp, sizeof(pval), 0); +		zend_hash_merge(return_value->value.ht,agent->value.ht,(void (*)(void *pData)) pval_copy_constructor, (void *) &tmp, sizeof(pval), 0);  	}  } diff --git a/ext/standard/cyr_convert.c b/ext/standard/cyr_convert.c index 9e74be983f..f99ec4a254 100644 --- a/ext/standard/cyr_convert.c +++ b/ext/standard/cyr_convert.c @@ -229,7 +229,7 @@ static char * _php3_convert_cyr_string(unsigned char *str, char from, char to)  		case 'K':  			break;  		default: -			php3_error(E_WARNING, "Unknown source charset: %c", from); +			php_error(E_WARNING, "Unknown source charset: %c", from);  			break;  	} @@ -251,7 +251,7 @@ static char * _php3_convert_cyr_string(unsigned char *str, char from, char to)  		case 'K':  			break;  		default: -			php3_error(E_WARNING, "Unknown destination charset: %c", to); +			php_error(E_WARNING, "Unknown destination charset: %c", to);  			break;  	} diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c index e8adab84c0..c654ca797f 100644 --- a/ext/standard/datetime.c +++ b/ext/standard/datetime.c @@ -179,7 +179,7 @@ _php3_date(INTERNAL_FUNCTION_PARAMETERS, int gm)  	}  	if (!ta) {			/* that really shouldn't happen... */ -		php3_error(E_WARNING, "unexpected error in date()"); +		php_error(E_WARNING, "unexpected error in date()");  		RETURN_FALSE;  	}  	for (i = 0; i < format->value.str.len; i++) { @@ -417,11 +417,11 @@ PHP_FUNCTION(getdate)  	ta = localtime(×tamp);  	if (!ta) { -		php3_error(E_WARNING, "Cannot perform date calculation"); +		php_error(E_WARNING, "Cannot perform date calculation");  		return;  	}  	if (array_init(return_value) == FAILURE) { -		php3_error(E_ERROR, "Unable to initialize array"); +		php_error(E_ERROR, "Unable to initialize array");  		return;  	}  	add_assoc_long(return_value, "seconds", ta->tm_sec); diff --git a/ext/standard/dir.c b/ext/standard/dir.c index 2ad515df8c..4ea03c2ecb 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -96,7 +96,7 @@ PHP_FUNCTION(opendir)  	dirp = opendir(arg->value.str.val);  	if (!dirp) { -		php3_error(E_WARNING, "OpenDir: %s (errno %d)", strerror(errno),errno); +		php_error(E_WARNING, "OpenDir: %s (errno %d)", strerror(errno),errno);  		RETURN_FALSE;  	}  	ret = php3_list_insert(dirp, le_dirp); @@ -117,8 +117,8 @@ PHP_FUNCTION(closedir)  	if (ARG_COUNT(ht) == 0) {  		id = getThis();  		if (id) { -			if (_php3_hash_find(id->value.obj.properties, "handle", sizeof("handle"), (void **)&tmp) == FAILURE) { -				php3_error(E_WARNING, "unable to find my handle property"); +			if (zend_hash_find(id->value.obj.properties, "handle", sizeof("handle"), (void **)&tmp) == FAILURE) { +				php_error(E_WARNING, "unable to find my handle property");  				RETURN_FALSE;  			}  			id_to_find = (*tmp)->value.lval; @@ -134,7 +134,7 @@ PHP_FUNCTION(closedir)  	dirp = (DIR *)php3_list_find(id_to_find, &dirp_type);  	if (!dirp || dirp_type != le_dirp) { -		php3_error(E_WARNING, "unable to find identifier (%d)", id_to_find); +		php_error(E_WARNING, "unable to find identifier (%d)", id_to_find);  		RETURN_FALSE;  	}  	php3_list_delete(id_to_find); @@ -155,7 +155,7 @@ PHP_FUNCTION(chdir)  	ret = chdir(arg->value.str.val);  	if (ret < 0) { -		php3_error(E_WARNING, "ChDir: %s (errno %d)", strerror(errno), errno); +		php_error(E_WARNING, "ChDir: %s (errno %d)", strerror(errno), errno);  		RETURN_FALSE;  	}  	RETURN_TRUE; @@ -174,8 +174,8 @@ PHP_FUNCTION(rewinddir)  	if (ARG_COUNT(ht) == 0) {  		id = getThis();  		if (id) { -			if (_php3_hash_find(id->value.obj.properties, "handle", sizeof("handle"), (void **)&tmp) == FAILURE) { -				php3_error(E_WARNING, "unable to find my handle property"); +			if (zend_hash_find(id->value.obj.properties, "handle", sizeof("handle"), (void **)&tmp) == FAILURE) { +				php_error(E_WARNING, "unable to find my handle property");  				RETURN_FALSE;  			}  			id_to_find = (*tmp)->value.lval; @@ -191,7 +191,7 @@ PHP_FUNCTION(rewinddir)  	dirp = (DIR *)php3_list_find(id_to_find, &dirp_type);  	if (!dirp || dirp_type != le_dirp) { -		php3_error(E_WARNING, "unable to find identifier (%d)", id_to_find); +		php_error(E_WARNING, "unable to find identifier (%d)", id_to_find);  		RETURN_FALSE;  	}  	rewinddir(dirp); @@ -211,8 +211,8 @@ PHP_FUNCTION(readdir)  	if (ARG_COUNT(ht) == 0) {  		id = getThis();  		if (id) { -			if (_php3_hash_find(id->value.obj.properties, "handle", sizeof("handle"), (void **)&tmp) == FAILURE) { -				php3_error(E_WARNING, "unable to find my handle property"); +			if (zend_hash_find(id->value.obj.properties, "handle", sizeof("handle"), (void **)&tmp) == FAILURE) { +				php_error(E_WARNING, "unable to find my handle property");  				RETURN_FALSE;  			}  			id_to_find = (*tmp)->value.lval; @@ -228,7 +228,7 @@ PHP_FUNCTION(readdir)  	dirp = (DIR *)php3_list_find(id_to_find, &dirp_type);  	if (!dirp || dirp_type != le_dirp) { -		php3_error(E_WARNING, "unable to find identifier (%d)", id_to_find); +		php_error(E_WARNING, "unable to find identifier (%d)", id_to_find);  		RETURN_FALSE;  	}  	direntp = readdir(dirp); @@ -257,7 +257,7 @@ PHP_FUNCTION(getdir)  	dirp = opendir(arg->value.str.val);  	if (!dirp) { -		php3_error(E_WARNING, "OpenDir: %s (errno %d)", strerror(errno), errno); +		php_error(E_WARNING, "OpenDir: %s (errno %d)", strerror(errno), errno);  		RETURN_FALSE;  	}  	ret = php3_list_insert(dirp, le_dirp); diff --git a/ext/standard/dl.c b/ext/standard/dl.c index 394dcecf96..945650f5aa 100644 --- a/ext/standard/dl.c +++ b/ext/standard/dl.c @@ -67,9 +67,9 @@ void dl(INTERNAL_FUNCTION_PARAMETERS)  	convert_to_string(file);  	if (!PG(enable_dl)) { -		php3_error(E_ERROR, "Dynamically loaded extentions aren't enabled."); +		php_error(E_ERROR, "Dynamically loaded extentions aren't enabled.");  	} else if (PG(safe_mode)) { -		php3_error(E_ERROR, "Dynamically loaded extensions aren't allowed when running in SAFE MODE."); +		php_error(E_ERROR, "Dynamically loaded extensions aren't allowed when running in SAFE MODE.");  	} else {  		php3_dl(file,MODULE_TEMPORARY,return_value);  	} @@ -103,10 +103,10 @@ void php3_dl(pval *file,int type,pval *return_value)  	handle = dlopen(libpath, RTLD_LAZY);  	if (!handle) {  #if MSVC5 -		php3_error(E_ERROR,"Unable to load dynamic library '%s'<br>\n%s",libpath,php3_win_err()); +		php_error(E_ERROR,"Unable to load dynamic library '%s'<br>\n%s",libpath,php3_win_err());  #else  		printf("dlerror = %s\n", dlerror()); -		php3_error(E_ERROR,"Unable to load dynamic library '%s' - %s",libpath,dlerror()); +		php_error(E_ERROR,"Unable to load dynamic library '%s' - %s",libpath,dlerror());  #endif  		RETURN_FALSE;  	} @@ -114,7 +114,7 @@ void php3_dl(pval *file,int type,pval *return_value)  	if (!get_module) {  		dlclose(handle); -		php3_error(E_CORE_WARNING,"Invalid library (maybe not a PHP3 library) '%s' ",file->value.str.val); +		php_error(E_CORE_WARNING,"Invalid library (maybe not a PHP3 library) '%s' ",file->value.str.val);  		RETURN_FALSE;  	}  	module_entry = get_module(); @@ -122,7 +122,7 @@ void php3_dl(pval *file,int type,pval *return_value)  	module_entry->module_number = zend_next_free_module();  	if (module_entry->module_startup_func) {  		if (module_entry->module_startup_func(type, module_entry->module_number)==FAILURE) { -			php3_error(E_CORE_WARNING,"%s:  Unable to initialize module",module_entry->name); +			php_error(E_CORE_WARNING,"%s:  Unable to initialize module",module_entry->name);  			dlclose(handle);  			RETURN_FALSE;  		} @@ -132,15 +132,15 @@ void php3_dl(pval *file,int type,pval *return_value)  	if (module_entry->request_startup_func) {  		if (module_entry->request_startup_func(type, module_entry->module_number)) { -			php3_error(E_CORE_WARNING,"%s:  Unable to initialize module",module_entry->name); +			php_error(E_CORE_WARNING,"%s:  Unable to initialize module",module_entry->name);  			dlclose(handle);  			RETURN_FALSE;  		}  	}  	/* update the .request_started property... */ -	if (_php3_hash_find(&module_registry,module_entry->name,strlen(module_entry->name)+1,(void **) &tmp)==FAILURE) { -		php3_error(E_ERROR,"%s:  Loaded module got lost",module_entry->name); +	if (zend_hash_find(&module_registry,module_entry->name,strlen(module_entry->name)+1,(void **) &tmp)==FAILURE) { +		php_error(E_ERROR,"%s:  Loaded module got lost",module_entry->name);  		RETURN_FALSE;  	}  	tmp->request_started=1; @@ -159,7 +159,7 @@ PHP_MINFO_FUNCTION(dl)  void php3_dl(pval *file,int type,pval *return_value)  { -	php3_error(E_WARNING,"Cannot dynamically load %s - dynamic modules are not supported",file->value.str.val); +	php_error(E_WARNING,"Cannot dynamically load %s - dynamic modules are not supported",file->value.str.val);  	RETURN_FALSE;  } diff --git a/ext/standard/dns.c b/ext/standard/dns.c index 8c9d33af1f..cbd30dc963 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -76,14 +76,14 @@ char *_php3_gethostbyaddr(char *ip)  	if ((int) (addr = inet_addr(ip)) == -1) {  #if DEBUG -		php3_error(E_WARNING, "address not in a.b.c.d form"); +		php_error(E_WARNING, "address not in a.b.c.d form");  #endif  		return estrdup(ip);  	}  	hp = gethostbyaddr((char *) &addr, sizeof(addr), AF_INET);  	if (!hp) {  #if DEBUG -		php3_error(E_WARNING, "Unable to resolve %s\n", ip); +		php_error(E_WARNING, "Unable to resolve %s\n", ip);  #endif  		return estrdup(ip);  	} @@ -128,7 +128,7 @@ PHP_FUNCTION(gethostbynamel)  	hp = gethostbyname(arg->value.str.val);  	if (hp == NULL || hp->h_addr_list == NULL) {  #if DEBUG -		php3_error(E_WARNING, "Unable to resolve %s\n", arg->value.str.val); +		php_error(E_WARNING, "Unable to resolve %s\n", arg->value.str.val);  #endif  		return;  	} @@ -150,7 +150,7 @@ char *_php3_gethostbyname(char *name)  	hp = gethostbyname(name);  	if (!hp || !hp->h_addr_list) {  #if DEBUG -		php3_error(E_WARNING, "Unable to resolve %s\n", name); +		php_error(E_WARNING, "Unable to resolve %s\n", name);  #endif  		return estrdup(name);  	} @@ -193,7 +193,7 @@ PHP_FUNCTION(checkdnsrr)  		else if ( !strcasecmp("SOA",arg2->value.str.val) ) type = T_SOA;  		else if ( !strcasecmp("CNAME",arg2->value.str.val) ) type = T_CNAME;  		else { -			php3_error(E_WARNING,"Type '%s' not supported",arg2->value.str.val); +			php_error(E_WARNING,"Type '%s' not supported",arg2->value.str.val);  			RETURN_FALSE;  		}  		break; @@ -240,7 +240,7 @@ PHP_FUNCTION(getmxrr)  			WRONG_PARAM_COUNT;  		}  		if (!ParameterPassedByReference(ht, 2)) { -			php3_error(E_WARNING, "Array to be filled with values must be passed by reference."); +			php_error(E_WARNING, "Array to be filled with values must be passed by reference.");  			RETURN_FALSE;  		}          break; @@ -249,7 +249,7 @@ PHP_FUNCTION(getmxrr)  			WRONG_PARAM_COUNT;  		}  		if (!ParameterPassedByReference(ht, 2) || !ParameterPassedByReference(ht, 3)) { -			php3_error(E_WARNING, "Array to be filled with values must be passed by reference."); +			php_error(E_WARNING, "Array to be filled with values must be passed by reference.");  			RETURN_FALSE;  		}          need_weight = 1; diff --git a/ext/standard/exec.c b/ext/standard/exec.c index 87eaddadbf..1d866a4579 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -50,7 +50,7 @@ static int _Exec(int type, char *cmd, pval *array, pval *return_value)  	buf = (char*) emalloc(EXEC_INPUT_BUF);      if (!buf) { -		php3_error(E_WARNING, "Unable to emalloc %d bytes for exec buffer", EXEC_INPUT_BUF); +		php_error(E_WARNING, "Unable to emalloc %d bytes for exec buffer", EXEC_INPUT_BUF);  		return -1;      }  	buflen = EXEC_INPUT_BUF; @@ -63,7 +63,7 @@ static int _Exec(int type, char *cmd, pval *array, pval *return_value)  		c = strchr(cmd, ' ');  		if (c) *c = '\0';  		if (strstr(cmd, "..")) { -			php3_error(E_WARNING, "No '..' components allowed in path"); +			php_error(E_WARNING, "No '..' components allowed in path");  			efree(buf);  			return -1;  		} @@ -92,7 +92,7 @@ static int _Exec(int type, char *cmd, pval *array, pval *return_value)  		fp = popen(d, "r");  #endif  		if (!fp) { -			php3_error(E_WARNING, "Unable to fork [%s]", d); +			php_error(E_WARNING, "Unable to fork [%s]", d);  			efree(d);  			efree(buf);  			return -1; @@ -104,7 +104,7 @@ static int _Exec(int type, char *cmd, pval *array, pval *return_value)  		fp = popen(cmd, "r");  #endif  		if (!fp) { -			php3_error(E_WARNING, "Unable to fork [%s]", cmd); +			php_error(E_WARNING, "Unable to fork [%s]", cmd);  			efree(buf);  			return -1;  		} @@ -125,7 +125,7 @@ static int _Exec(int type, char *cmd, pval *array, pval *return_value)  				if ( buflen <= (l+1) ) {  					buf = erealloc(buf, buflen + EXEC_INPUT_BUF);  					if ( buf == NULL ) { -						php3_error(E_WARNING, "Unable to erealloc %d bytes for exec buffer",  +						php_error(E_WARNING, "Unable to erealloc %d bytes for exec buffer",   								buflen + EXEC_INPUT_BUF);  						return -1;  					} @@ -231,16 +231,16 @@ PHP_FUNCTION(exec)  			break;  		case 2:  			if (!ParameterPassedByReference(ht,2)) { -				php3_error(E_WARNING,"Array argument to exec() not passed by reference"); +				php_error(E_WARNING,"Array argument to exec() not passed by reference");  			}  			ret = _Exec(2, arg1->value.str.val, arg2, return_value);  			break;  		case 3:  			if (!ParameterPassedByReference(ht,2)) { -				php3_error(E_WARNING,"Array argument to exec() not passed by reference"); +				php_error(E_WARNING,"Array argument to exec() not passed by reference");  			}  			if (!ParameterPassedByReference(ht,3)) { -				php3_error(E_WARNING,"return_status argument to exec() not passed by reference"); +				php_error(E_WARNING,"return_status argument to exec() not passed by reference");  			}  			ret = _Exec(2, arg1->value.str.val, arg2, return_value);  			arg3->type = IS_LONG; @@ -267,7 +267,7 @@ PHP_FUNCTION(system)  			break;  		case 2:  			if (!ParameterPassedByReference(ht,2)) { -				php3_error(E_WARNING,"return_status argument to system() not passed by reference"); +				php_error(E_WARNING,"return_status argument to system() not passed by reference");  			}  			ret = _Exec(1, arg1->value.str.val, NULL, return_value);  			arg2->type = IS_LONG; @@ -294,7 +294,7 @@ PHP_FUNCTION(passthru)  			break;  		case 2:  			if (!ParameterPassedByReference(ht,2)) { -				php3_error(E_WARNING,"return_status argument to system() not passed by reference"); +				php_error(E_WARNING,"return_status argument to system() not passed by reference");  			}  			ret = _Exec(3, arg1->value.str.val, NULL, return_value);  			arg2->type = IS_LONG; @@ -372,7 +372,7 @@ PHP_FUNCTION(shell_exec)  	}  	if (PG(safe_mode)) { -		php3_error(E_WARNING,"Cannot execute using backquotes in safe mode"); +		php_error(E_WARNING,"Cannot execute using backquotes in safe mode");  		RETURN_FALSE;  	} @@ -382,7 +382,7 @@ PHP_FUNCTION(shell_exec)  #else  	if ((in=popen(cmd->value.str.val,"r"))==NULL) {  #endif -		php3_error(E_WARNING,"Unable to execute '%s'",cmd->value.str.val); +		php_error(E_WARNING,"Unable to execute '%s'",cmd->value.str.val);  	}  	allocated_space = EXEC_INPUT_BUF;  	return_value->value.str.val = (char *) emalloc(allocated_space); diff --git a/ext/standard/file.c b/ext/standard/file.c index 05bfc71e7a..da5d1a21d8 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -252,7 +252,7 @@ PHP_FUNCTION(flock)      }      if ((!fp || (type!=le_fp && type!=le_pp)) && (!fd || type!=wsa_fp)) { -        php3_error(E_WARNING,"Unable to find file identifier %d",arg1->value.lval); +        php_error(E_WARNING,"Unable to find file identifier %d",arg1->value.lval);          RETURN_FALSE;      } @@ -262,7 +262,7 @@ PHP_FUNCTION(flock)      act = arg2->value.lval & 3;      if(act < 1 || act > 3) { -            php3_error(E_WARNING, "illegal value for second argument"); +            php_error(E_WARNING, "illegal value for second argument");              RETURN_FALSE;      }      /* flock_values contains all possible actions @@ -313,7 +313,7 @@ PHP_FUNCTION(get_meta_tags)  	if (!fp && !socketd) {  		if (issock != BAD_URL) {  			php3_strip_url_passwd(filename->value.str.val); -			php3_error(E_WARNING,"File(\"%s\") - %s",filename->value.str.val,strerror(errno)); +			php_error(E_WARNING,"File(\"%s\") - %s",filename->value.str.val,strerror(errno));  		}  		RETURN_FALSE;  	} @@ -435,7 +435,7 @@ PHP_FUNCTION(file)  	if (!fp && !socketd) {  		if (issock != BAD_URL) {  			php3_strip_url_passwd(filename->value.str.val); -			php3_error(E_WARNING,"File(\"%s\") - %s",filename->value.str.val,strerror(errno)); +			php_error(E_WARNING,"File(\"%s\") - %s",filename->value.str.val,strerror(errno));  		}  		RETURN_FALSE;  	} @@ -572,7 +572,7 @@ PHP_FUNCTION(fopen)  	if (!fp && !socketd) {  		if (issock != BAD_URL) {  			php3_strip_url_passwd(arg1->value.str.val); -			php3_error(E_WARNING,"fopen(\"%s\",\"%s\") - %s", +			php_error(E_WARNING,"fopen(\"%s\",\"%s\") - %s",  						arg1->value.str.val, p, strerror(errno));  		}  		efree(p); @@ -607,7 +607,7 @@ PHP_FUNCTION(fclose)  	id=arg1->value.lval;  	fp = php3_list_find(id,&type);  	if (!fp || (type!=le_fp && type!=wsa_fp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	}  	php3_list_delete(id); @@ -654,13 +654,13 @@ PHP_FUNCTION(popen)  		}  		fp = popen(buf,p);  		if (!fp) { -			php3_error(E_WARNING,"popen(\"%s\",\"%s\") - %s",buf,p,strerror(errno)); +			php_error(E_WARNING,"popen(\"%s\",\"%s\") - %s",buf,p,strerror(errno));  			RETURN_FALSE;  		}  	} else {  		fp = popen(arg1->value.str.val,p);  		if (!fp) { -			php3_error(E_WARNING,"popen(\"%s\",\"%s\") - %s",arg1->value.str.val,p,strerror(errno)); +			php_error(E_WARNING,"popen(\"%s\",\"%s\") - %s",arg1->value.str.val,p,strerror(errno));  			efree(p);  			RETURN_FALSE;  		} @@ -688,7 +688,7 @@ PHP_FUNCTION(pclose)  	fp = php3_list_find(id,&type);  	if (!fp || type!=le_pp) { -		php3_error(E_WARNING,"Unable to find pipe identifier %d",id); +		php_error(E_WARNING,"Unable to find pipe identifier %d",id);  		RETURN_FALSE;  	}  	php3_list_delete(id); @@ -719,7 +719,7 @@ PHP_FUNCTION(feof)  		socketd=*sock;  	}  	if ((!fp || (type!=le_fp && type!=le_pp)) && (!socketd || type!=wsa_fp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		/* we're at the eof if the file doesn't exist */  		RETURN_TRUE;  	} @@ -742,7 +742,7 @@ PHPAPI int _php3_set_sock_blocking(int socketd, int block)        /* with ioctlsocket, a non-zero sets nonblocking, a zero sets blocking */  	  flags = block;  	  if (ioctlsocket(socketd,FIONBIO,&flags)==SOCKET_ERROR){ -		  php3_error(E_WARNING,"%s",WSAGetLastError()); +		  php_error(E_WARNING,"%s",WSAGetLastError());  		  ret = FALSE;        }  #else @@ -780,7 +780,7 @@ PHP_FUNCTION(set_socket_blocking)  	sock = php3_list_find(id,&type);  	if (type != wsa_fp) { -		php3_error(E_WARNING,"%d is not a socket id",id); +		php_error(E_WARNING,"%d is not a socket id",id);  		RETURN_FALSE;  	}  	socketd = *sock; @@ -808,7 +808,7 @@ PHP_FUNCTION(set_socket_timeout)  	sock = php3_list_find(socket->value.lval, &type);  	if (type!=wsa_fp) { -		php3_error(E_WARNING,"%d is not a socket id",socket->value.lval); +		php_error(E_WARNING,"%d is not a socket id",socket->value.lval);  		RETURN_FALSE;  	}  	t.tv_sec = timeout->value.lval; @@ -847,7 +847,7 @@ PHP_FUNCTION(fgets)  		socketd=*sock;  	}  	if ((!fp || (type!=le_fp && type!=le_pp)) && (!socketd || type!=wsa_fp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	}  	buf = emalloc(sizeof(char) * (len + 1)); @@ -893,7 +893,7 @@ PHP_FUNCTION(fgetc) {  		socketd = *sock;  	}  	if ((!fp || (type!=le_fp && type!=le_pp)) && (!socketd || type!=wsa_fp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	}  	buf = emalloc(sizeof(char) * 2); @@ -939,7 +939,7 @@ PHP_FUNCTION(fgetss)  		socketd=*sock;  	}  	if ((!fp || (type!=le_fp && type!=le_pp)) && (!socketd || type!=wsa_fp)) { -		php3_error(E_WARNING, "Unable to find file identifier %d", id); +		php_error(E_WARNING, "Unable to find file identifier %d", id);  		RETURN_FALSE;  	} @@ -1003,7 +1003,7 @@ PHP_FUNCTION(fwrite)  		socketd=*sock;  	}  	if ((!fp || (type!=le_fp && type!=le_pp)) && (!socketd || type!=wsa_fp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1060,7 +1060,7 @@ PHP_FUNCTION(set_file_buffer)  	}  	if ((!fp || (type != le_fp && type != le_pp)) &&  		(!socketd || type != wsa_fp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	} @@ -1090,7 +1090,7 @@ PHP_FUNCTION(rewind)  	id = arg1->value.lval;	  	fp = php3_list_find(id,&type);  	if (!fp || (type!=le_fp && type!=le_pp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	}  	rewind(fp); @@ -1115,7 +1115,7 @@ PHP_FUNCTION(ftell)  	id = arg1->value.lval;	  	fp = php3_list_find(id,&type);  	if (!fp || (type!=le_fp && type!=le_pp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	}  	pos = ftell(fp); @@ -1142,7 +1142,7 @@ PHP_FUNCTION(fseek)  	id = arg1->value.lval;  	fp = php3_list_find(id,&type);  	if (!fp || (type!=le_fp && type!=le_pp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	}  /*fseek is flaky on windows, use setfilepointer, but we have to live with @@ -1150,7 +1150,7 @@ PHP_FUNCTION(fseek)  #if 0  	ret = SetFilePointer (fp, pos, NULL, FILE_BEGIN);  	if (ret == 0xFFFFFFFF){ -		php3_error(E_WARNING,"Unable to move file postition: %s",php3_win_err()); +		php_error(E_WARNING,"Unable to move file postition: %s",php3_win_err());  		RETURN_FALSE;  	}  #else @@ -1180,7 +1180,7 @@ PHP_FUNCTION(mkdir)  	}  	ret = mkdir(arg1->value.str.val,mode);  	if (ret < 0) { -		php3_error(E_WARNING,"MkDir failed (%s)", strerror(errno)); +		php_error(E_WARNING,"MkDir failed (%s)", strerror(errno));  		RETURN_FALSE;  	}  	RETURN_TRUE; @@ -1205,7 +1205,7 @@ PHP_FUNCTION(rmdir)  	}  	ret = rmdir(arg1->value.str.val);  	if (ret < 0) { -		php3_error(E_WARNING,"RmDir failed (%s)", strerror(errno)); +		php_error(E_WARNING,"RmDir failed (%s)", strerror(errno));  		RETURN_FALSE;  	}  	RETURN_TRUE; @@ -1251,7 +1251,7 @@ PHP_FUNCTION(readfile)  	if (!fp && !socketd){  		if (issock != BAD_URL) {  			php3_strip_url_passwd(arg1->value.str.val); -			php3_error(E_WARNING,"ReadFile(\"%s\") - %s",arg1->value.str.val,strerror(errno)); +			php_error(E_WARNING,"ReadFile(\"%s\") - %s",arg1->value.str.val,strerror(errno));  		}  		RETURN_FALSE;  	} @@ -1321,7 +1321,7 @@ PHP_FUNCTION(fpassthru)  		socketd=*sock;  	}  	if ((!fp || (type!=le_fp && type!=le_pp)) && (!socketd || type!=wsa_fp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	}  	size = 0; @@ -1362,7 +1362,7 @@ PHP_FUNCTION(rename)  	ret = rename(old_name, new_name);  	if (ret == -1) { -		php3_error(E_WARNING, +		php_error(E_WARNING,  					"Rename failed (%s)", strerror(errno));  		RETURN_FALSE;  	} @@ -1397,7 +1397,7 @@ PHP_FUNCTION(copy)  #else  	if ((fd_s=open(source->value.str.val,O_RDONLY))==-1) {  #endif -		php3_error(E_WARNING,"Unable to open '%s' for reading:  %s",source->value.str.val,strerror(errno)); +		php_error(E_WARNING,"Unable to open '%s' for reading:  %s",source->value.str.val,strerror(errno));  		RETURN_FALSE;  	}  #if WIN32|WINNT @@ -1405,14 +1405,14 @@ PHP_FUNCTION(copy)  #else  	if ((fd_t=creat(target->value.str.val,0777))==-1) {  #endif -		php3_error(E_WARNING,"Unable to create '%s':  %s", target->value.str.val,strerror(errno)); +		php_error(E_WARNING,"Unable to create '%s':  %s", target->value.str.val,strerror(errno));  		close(fd_s);  		RETURN_FALSE;  	}  	while ((read_bytes=read(fd_s,buffer,8192))!=-1 && read_bytes!=0) {  		if (write(fd_t,buffer,read_bytes)==-1) { -			php3_error(E_WARNING,"Unable to write to '%s':  %s",target->value.str.val,strerror(errno)); +			php_error(E_WARNING,"Unable to write to '%s':  %s",target->value.str.val,strerror(errno));  			close(fd_s);  			close(fd_t);  			RETURN_FALSE; @@ -1453,7 +1453,7 @@ PHP_FUNCTION(fread)  		socketd=*sock;  	}  	if ((!fp || (type!=le_fp && type!=le_pp)) && (!socketd || type!=wsa_fp)) { -		php3_error(E_WARNING,"Unable to find file identifier %d",id); +		php_error(E_WARNING,"Unable to find file identifier %d",id);  		RETURN_FALSE;  	}  	return_value->value.str.val = emalloc(sizeof(char) * (len + 1)); @@ -1535,7 +1535,7 @@ PHP_FUNCTION(fgetcsv) {  	}  	if ((!fp || (type != le_fp && type != le_pp)) &&  		(!socketd || type != wsa_fp)) { -		php3_error(E_WARNING, "Unable to find file identifier %d", id); +		php_error(E_WARNING, "Unable to find file identifier %d", id);  		RETURN_FALSE;  	} diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 647fb10da2..f44845c48b 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -115,7 +115,7 @@ PHP_FUNCTION(chgrp)  	if (group->type == IS_STRING) {  		gr = getgrnam(group->value.str.val);  		if (!gr) { -			php3_error(E_WARNING, "unable to find gid for %s", +			php_error(E_WARNING, "unable to find gid for %s",  					   group->value.str.val);  			RETURN_FALSE;  		} @@ -134,7 +134,7 @@ PHP_FUNCTION(chgrp)  	ret = chown(filename->value.str.val, -1, gid);  	if (ret == -1) { -		php3_error(E_WARNING, "chgrp failed: %s", strerror(errno)); +		php_error(E_WARNING, "chgrp failed: %s", strerror(errno));  		RETURN_FALSE;  	}  	RETURN_TRUE; @@ -159,7 +159,7 @@ PHP_FUNCTION(chown)  	if (user->type == IS_STRING) {  		pw = getpwnam(user->value.str.val);  		if (!pw) { -			php3_error(E_WARNING, "unable to find uid for %s", +			php_error(E_WARNING, "unable to find uid for %s",  					   user->value.str.val);  			RETURN_FALSE;  		} @@ -178,7 +178,7 @@ PHP_FUNCTION(chown)  	ret = chown(filename->value.str.val, uid, -1);  	if (ret == -1) { -		php3_error(E_WARNING, "chown failed: %s", strerror(errno)); +		php_error(E_WARNING, "chown failed: %s", strerror(errno));  		RETURN_FALSE;  	}  #endif @@ -207,7 +207,7 @@ PHP_FUNCTION(chmod)  	ret = chmod(filename->value.str.val, mode->value.lval);  	if (ret == -1) { -		php3_error(E_WARNING, "chmod failed: %s", strerror(errno)); +		php_error(E_WARNING, "chmod failed: %s", strerror(errno));  		RETURN_FALSE;  	}  	RETURN_TRUE; @@ -229,7 +229,7 @@ PHP_FUNCTION(touch)  #ifndef HAVE_UTIME_NULL  		newtime = (struct utimbuf *)emalloc(sizeof(struct utimbuf));  		if (!newtime) { -			php3_error(E_WARNING, "unable to emalloc memory for changing time"); +			php_error(E_WARNING, "unable to emalloc memory for changing time");  			return;  		}  		newtime->actime = time(NULL); @@ -238,7 +238,7 @@ PHP_FUNCTION(touch)  	} else if (ac == 2 && getParameters(ht,2,&filename,&filetime) != FAILURE) {  		newtime = (struct utimbuf *)emalloc(sizeof(struct utimbuf));  		if (!newtime) { -			php3_error(E_WARNING, "unable to emalloc memory for changing time"); +			php_error(E_WARNING, "unable to emalloc memory for changing time");  			return;  		}  		convert_to_long(filetime); @@ -262,7 +262,7 @@ PHP_FUNCTION(touch)  	if (ret == -1) {  		file = fopen(filename->value.str.val, "w");  		if (file == NULL) { -			php3_error(E_WARNING, "unable to create file %s because %s", filename->value.str.val, strerror(errno)); +			php_error(E_WARNING, "unable to create file %s because %s", filename->value.str.val, strerror(errno));  			if (newtime) efree(newtime);  			RETURN_FALSE;  		} @@ -272,7 +272,7 @@ PHP_FUNCTION(touch)  	ret = utime(filename->value.str.val, newtime);  	if (newtime) efree(newtime);  	if (ret == -1) { -		php3_error(E_WARNING, "utime failed: %s", strerror(errno)); +		php_error(E_WARNING, "utime failed: %s", strerror(errno));  		RETURN_FALSE;  	} else {  		RETURN_TRUE; @@ -308,7 +308,7 @@ static void _php3_stat(const char *filename, int type, pval *return_value)  #endif  		if (stat(CurrentStatFile,&sb)==-1) {  			if (type != 15 || errno != ENOENT) { /* fileexists() test must print no error */ -				php3_error(E_NOTICE,"stat failed for %s (errno=%d - %s)",CurrentStatFile,errno,strerror(errno)); +				php_error(E_NOTICE,"stat failed for %s (errno=%d - %s)",CurrentStatFile,errno,strerror(errno));  			}  			efree(CurrentStatFile);  			CurrentStatFile=NULL; @@ -325,7 +325,7 @@ static void _php3_stat(const char *filename, int type, pval *return_value)  		if (!lsb.st_mode) {  			if (lstat(CurrentStatFile,&lsb) == -1) { -				php3_error(E_NOTICE,"lstat failed for %s (errno=%d - %s)",CurrentStatFile,errno,strerror(errno)); +				php_error(E_NOTICE,"lstat failed for %s (errno=%d - %s)",CurrentStatFile,errno,strerror(errno));  				RETURN_FALSE;  			}  		} @@ -362,7 +362,7 @@ static void _php3_stat(const char *filename, int type, pval *return_value)  		case S_IFBLK: RETURN_STRING("block",1);  		case S_IFREG: RETURN_STRING("file",1);  		} -		php3_error(E_WARNING,"Unknown file type (%d)",sb.st_mode&S_IFMT); +		php_error(E_WARNING,"Unknown file type (%d)",sb.st_mode&S_IFMT);  		RETURN_STRING("unknown",1);  	case 9: /*is writable*/  		RETURN_LONG((sb.st_mode&S_IWRITE)!=0); @@ -418,7 +418,7 @@ static void _php3_stat(const char *filename, int type, pval *return_value)  #endif  		return;  	} -	php3_error(E_WARNING, "didn't understand stat call"); +	php_error(E_WARNING, "didn't understand stat call");  	RETURN_FALSE;  } diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index 39908fe1e8..50bc8766c3 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -38,7 +38,7 @@  #if 0  /* trick to control varargs functions through cpp */ -# define PRINTF_DEBUG(arg) php3_printf arg +# define PRINTF_DEBUG(arg) php_printf arg  #else  # define PRINTF_DEBUG(arg)  #endif @@ -137,7 +137,7 @@ _php3_cvt(double arg, int ndigits, int *decpt, int *sign, int eflag)  inline static void -_php3_sprintf_appendchar(char **buffer, int *pos, int *size, char add) +php_sprintf_appendchar(char **buffer, int *pos, int *size, char add)  {  	if ((*pos + 1) >= *size) {  		*size <<= 1; @@ -150,7 +150,7 @@ _php3_sprintf_appendchar(char **buffer, int *pos, int *size, char add)  inline static void -_php3_sprintf_appendstring(char **buffer, int *pos, int *size, char *add, +php_sprintf_appendstring(char **buffer, int *pos, int *size, char *add,  						   int min_width, int max_width, char padding,  						   int alignment, int len)  { @@ -189,7 +189,7 @@ _php3_sprintf_appendstring(char **buffer, int *pos, int *size, char *add,  inline static void -_php3_sprintf_appendint(char **buffer, int *pos, int *size, int number, +php_sprintf_appendint(char **buffer, int *pos, int *size, int number,  						int width, char padding, int alignment)  {  	char numbuf[NUM_BUF_SIZE]; @@ -218,13 +218,13 @@ _php3_sprintf_appendint(char **buffer, int *pos, int *size, int number,  	}  	PRINTF_DEBUG(("sprintf: appending %d as \"%s\", i=%d\n",  				  number, &numbuf[i], i)); -	_php3_sprintf_appendstring(buffer, pos, size, &numbuf[i], width, 0, +	php_sprintf_appendstring(buffer, pos, size, &numbuf[i], width, 0,  							   padding, alignment, (NUM_BUF_SIZE - 1) - i);  }  inline static void -_php3_sprintf_appenddouble(char **buffer, int *pos, +php_sprintf_appenddouble(char **buffer, int *pos,  						   int *size, double number,  						   int width, char padding,  						   int alignment, int precision, @@ -279,13 +279,13 @@ _php3_sprintf_appenddouble(char **buffer, int *pos,  	if (precision > 0) {  		width += (precision + 1);  	} -	_php3_sprintf_appendstring(buffer, pos, size, numbuf, width, 0, padding, +	php_sprintf_appendstring(buffer, pos, size, numbuf, width, 0, padding,  							   alignment, i);  }  inline static void -_php3_sprintf_append2n(char **buffer, int *pos, int *size, int number, +php_sprintf_append2n(char **buffer, int *pos, int *size, int number,  					   int width, char padding, int alignment, int n,  					   char *chartable)  { @@ -316,13 +316,13 @@ _php3_sprintf_append2n(char **buffer, int *pos, int *size, int number,  	if (neg) {  		numbuf[--i] = '-';  	} -	_php3_sprintf_appendstring(buffer, pos, size, &numbuf[i], width, 0, +	php_sprintf_appendstring(buffer, pos, size, &numbuf[i], width, 0,  							   padding, alignment, (NUM_BUF_SIZE - 1) - i);  }  inline static int -_php3_sprintf_getnumber(char *buffer, int *pos) +php_sprintf_getnumber(char *buffer, int *pos)  {  	char *endptr;  	register int num = strtol(&buffer[*pos], &endptr, 10); @@ -389,15 +389,15 @@ php3_formatted_print(int ht, int *len)  		PRINTF_DEBUG(("sprintf: format[%d]='%c'\n", inpos, format[inpos]));  		PRINTF_DEBUG(("sprintf: outpos=%d\n", outpos));  		if (format[inpos] != '%') { -			_php3_sprintf_appendchar(&result, &outpos, &size, format[inpos++]); +			php_sprintf_appendchar(&result, &outpos, &size, format[inpos++]);  		} else if (format[inpos + 1] == '%') { -			_php3_sprintf_appendchar(&result, &outpos, &size, '%'); +			php_sprintf_appendchar(&result, &outpos, &size, '%');  			inpos += 2;  		} else {  			if (currarg >= argc && format[inpos + 1] != '%') {  				efree(result);  				efree(args); -				php3_error(E_WARNING, "%s(): too few arguments",get_active_function_name()); +				php_error(E_WARNING, "%s(): too few arguments",get_active_function_name());  				return NULL;  			}  			/* starting a new format specifier, reset variables */ @@ -434,7 +434,7 @@ php3_formatted_print(int ht, int *len)  				/* after modifiers comes width */  				if (isdigit((int)format[inpos])) {  					PRINTF_DEBUG(("sprintf: getting width\n")); -					width = _php3_sprintf_getnumber(format, &inpos); +					width = php_sprintf_getnumber(format, &inpos);  					adjusting |= ADJ_WIDTH;  				} else {  					width = 0; @@ -446,7 +446,7 @@ php3_formatted_print(int ht, int *len)  					inpos++;  					PRINTF_DEBUG(("sprintf: getting precision\n"));  					if (isdigit((int)format[inpos])) { -						precision = _php3_sprintf_getnumber(format, &inpos); +						precision = php_sprintf_getnumber(format, &inpos);  						adjusting |= ADJ_PRECISION;  					} else {  						precision = 0; @@ -467,7 +467,7 @@ php3_formatted_print(int ht, int *len)  			switch (format[inpos]) {  				case 's':  					convert_to_string(args[currarg]); -					_php3_sprintf_appendstring(&result, &outpos, &size, +					php_sprintf_appendstring(&result, &outpos, &size,  											   args[currarg]->value.str.val,  											   width, precision, padding,  											   alignment, @@ -476,7 +476,7 @@ php3_formatted_print(int ht, int *len)  				case 'd':  					convert_to_long(args[currarg]); -					_php3_sprintf_appendint(&result, &outpos, &size, +					php_sprintf_appendint(&result, &outpos, &size,  											args[currarg]->value.lval,  											width, padding, alignment);  					break; @@ -485,7 +485,7 @@ php3_formatted_print(int ht, int *len)  				case 'f':  					/* XXX not done */  					convert_to_double(args[currarg]); -					_php3_sprintf_appenddouble(&result, &outpos, &size, +					php_sprintf_appenddouble(&result, &outpos, &size,  											   args[currarg]->value.dval,  											   width, padding, alignment,  											   precision, adjusting, @@ -494,13 +494,13 @@ php3_formatted_print(int ht, int *len)  				case 'c':  					convert_to_long(args[currarg]); -					_php3_sprintf_appendchar(&result, &outpos, &size, +					php_sprintf_appendchar(&result, &outpos, &size,  									   (char) args[currarg]->value.lval);  					break;  				case 'o':  					convert_to_long(args[currarg]); -					_php3_sprintf_append2n(&result, &outpos, &size, +					php_sprintf_append2n(&result, &outpos, &size,  										   args[currarg]->value.lval,  										   width, padding, alignment, 3,  										   hexchars); @@ -508,7 +508,7 @@ php3_formatted_print(int ht, int *len)  				case 'x':  					convert_to_long(args[currarg]); -					_php3_sprintf_append2n(&result, &outpos, &size, +					php_sprintf_append2n(&result, &outpos, &size,  										   args[currarg]->value.lval,  										   width, padding, alignment, 4,  										   hexchars); @@ -516,7 +516,7 @@ php3_formatted_print(int ht, int *len)  				case 'X':  					convert_to_long(args[currarg]); -					_php3_sprintf_append2n(&result, &outpos, &size, +					php_sprintf_append2n(&result, &outpos, &size,  										   args[currarg]->value.lval,  										   width, padding, alignment, 4,  										   HEXCHARS); @@ -524,14 +524,14 @@ php3_formatted_print(int ht, int *len)  				case 'b':  					convert_to_long(args[currarg]); -					_php3_sprintf_append2n(&result, &outpos, &size, +					php_sprintf_append2n(&result, &outpos, &size,  										   args[currarg]->value.lval,  										   width, padding, alignment, 1,  										   hexchars);  					break;  				case '%': -					_php3_sprintf_appendchar(&result, &outpos, &size, '%'); +					php_sprintf_appendchar(&result, &outpos, &size, '%');  					break;  				default: diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c index e439b43e5a..05401f5f34 100644 --- a/ext/standard/fsock.c +++ b/ext/standard/fsock.c @@ -145,7 +145,7 @@ int _php3_is_persistent_sock(int sock)  	char *key;  	PLS_FETCH(); -	if (_php3_hash_find(&PG(ht_fsock_socks), (char *) &sock, sizeof(sock), +	if (zend_hash_find(&PG(ht_fsock_socks), (char *) &sock, sizeof(sock),  				(void **) &key) == SUCCESS) {  		return 1;  	} @@ -254,7 +254,7 @@ static void _php3_fsockopen(INTERNAL_FUNCTION_PARAMETERS, int persistent) {  			/* fall-through */  		case 4:  			if(!ParameterPassedByReference(ht,4)) { -				php3_error(E_WARNING,"error string argument to fsockopen not passed by reference"); +				php_error(E_WARNING,"error string argument to fsockopen not passed by reference");  			}  			pval_copy_constructor(args[3]);  			args[3]->value.str.val = empty_string; @@ -263,7 +263,7 @@ static void _php3_fsockopen(INTERNAL_FUNCTION_PARAMETERS, int persistent) {  			/* fall-through */  		case 3:  			if(!ParameterPassedByReference(ht,3)) { -				php3_error(E_WARNING,"error argument to fsockopen not passed by reference"); +				php_error(E_WARNING,"error argument to fsockopen not passed by reference");  			}  			args[2]->type = IS_LONG;  			args[2]->value.lval = 0; @@ -276,7 +276,7 @@ static void _php3_fsockopen(INTERNAL_FUNCTION_PARAMETERS, int persistent) {  	key = emalloc(args[0]->value.str.len + 10);  	sprintf(key, "%s:%d", args[0]->value.str.val, portno); -	if (persistent && _php3_hash_find(&PG(ht_fsock_keys), key, strlen(key) + 1, +	if (persistent && zend_hash_find(&PG(ht_fsock_keys), key, strlen(key) + 1,  				(void *) &sockp) == SUCCESS) {  		FREE_SOCK;  		*sock = *sockp; @@ -351,9 +351,9 @@ static void _php3_fsockopen(INTERNAL_FUNCTION_PARAMETERS, int persistent) {  	*sock=socketd;  	if (persistent) { -		_php3_hash_update(&PG(ht_fsock_keys), key, strlen(key) + 1,  +		zend_hash_update(&PG(ht_fsock_keys), key, strlen(key) + 1,   				sock, sizeof(*sock), NULL); -		_php3_hash_update(&PG(ht_fsock_socks), (char *) sock, sizeof(*sock), +		zend_hash_update(&PG(ht_fsock_socks), (char *) sock, sizeof(*sock),  				key, strlen(key) + 1, NULL);  	}  	if(key) efree(key); @@ -704,8 +704,8 @@ static int _php3_msock_destroy(int *data)  PHP_MINIT_FUNCTION(fsock)  {  #ifndef ZTS -	_php3_hash_init(&PG(ht_fsock_keys), 0, NULL, NULL, 1); -	_php3_hash_init(&PG(ht_fsock_socks), 0, NULL, (int (*)(void *))_php3_msock_destroy, 1); +	zend_hash_init(&PG(ht_fsock_keys), 0, NULL, NULL, 1); +	zend_hash_init(&PG(ht_fsock_socks), 0, NULL, (int (*)(void *))_php3_msock_destroy, 1);  #endif  	return SUCCESS;  } @@ -715,8 +715,8 @@ PHP_MINIT_FUNCTION(fsock)  PHP_MSHUTDOWN_FUNCTION(fsock)  {  #ifndef ZTS -	_php3_hash_destroy(&PG(ht_fsock_socks)); -	_php3_hash_destroy(&PG(ht_fsock_keys)); +	zend_hash_destroy(&PG(ht_fsock_socks)); +	zend_hash_destroy(&PG(ht_fsock_keys));  #endif  	php_cleanup_sockbuf(1);  	return SUCCESS; diff --git a/ext/standard/head.c b/ext/standard/head.c index c28626a299..4e18f36392 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -77,7 +77,7 @@ void php4i_add_header_information(char *header_information, uint header_length)  	if (php3_HeaderPrinted == 1) {  #if DEBUG -		php3_error(E_WARNING, "Cannot add more header information - the header was already sent " +		php_error(E_WARNING, "Cannot add more header information - the header was already sent "  							  "(header information may be added only before any output is generated from the script - "  							  "check for text or whitespace outside PHP tags, or calls to functions that output text)");  #endif @@ -436,7 +436,7 @@ PHP_FUNCTION(setcookie)  		WRONG_PARAM_COUNT;  	}  	if (php3_HeaderPrinted == 1) { -		php3_error(E_WARNING, "Oops, php3_SetCookie called after header has been sent\n"); +		php_error(E_WARNING, "Oops, php3_SetCookie called after header has been sent\n");  		return;  	}  	switch (arg_count) { diff --git a/ext/standard/image.c b/ext/standard/image.c index f595942037..4628f38a2f 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -316,7 +316,7 @@ PHP_FUNCTION(getimagesize)  			WRONG_PARAM_COUNT;  		}  		if (!ParameterPassedByReference(ht, 2)) { -            php3_error(E_WARNING, "Array to be filled with values must be passed by reference."); +            php_error(E_WARNING, "Array to be filled with values must be passed by reference.");              RETURN_FALSE;          } @@ -337,7 +337,7 @@ PHP_FUNCTION(getimagesize)  	if (_php3_check_open_basedir(arg1->value.str.val)) return;  	if ((fp = fopen(arg1->value.str.val,"rb")) == 0) { -		php3_error(E_WARNING, "Unable to open %s", arg1->value.str.val); +		php_error(E_WARNING, "Unable to open %s", arg1->value.str.val);  		return;  	}  	fread(filetype,sizeof(filetype),1,fp); @@ -354,13 +354,13 @@ PHP_FUNCTION(getimagesize)  			result = php3_handle_png(fp);  			itype = 3;  		} else { -			php3_error(E_WARNING, "PNG file corrupted by ASCII conversion"); +			php_error(E_WARNING, "PNG file corrupted by ASCII conversion");  		}  	}  	fclose(fp);  	if (result) {  		if (array_init(return_value) == FAILURE) { -			php3_error(E_ERROR, "Unable to initialize array"); +			php_error(E_ERROR, "Unable to initialize array");  			if (result) efree(result);  			return;  		} diff --git a/ext/standard/info.c b/ext/standard/info.c index eb87281301..060c377f3e 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -30,7 +30,7 @@  #define PHP3_CONF_LONG(directive,value1,value2) \ -	php3_printf("<tr><td bgcolor=\"" PHP_ENTRY_NAME_COLOR "\">%s</td><td bgcolor=\"" PHP_CONTENTS_COLOR "\">%ld</td><td bgcolor=\"" PHP_CONTENTS_COLOR "\">%ld</td></tr>\n",directive,value1,value2); +	php_printf("<tr><td bgcolor=\"" PHP_ENTRY_NAME_COLOR "\">%s</td><td bgcolor=\"" PHP_CONTENTS_COLOR "\">%ld</td><td bgcolor=\"" PHP_CONTENTS_COLOR "\">%ld</td></tr>\n",directive,value1,value2);  #define SECTION(name)  PUTS("<hr><h2>" name "</h2>\n") @@ -40,7 +40,7 @@  static int _display_module_info(php3_module_entry *module)  {  	if (module->info_func) { -		php3_printf("<hr><h2>%s</h2>\n", module->name); +		php_printf("<hr><h2>%s</h2>\n", module->name);  		module->info_func(module);  	}  	return 0; @@ -77,21 +77,21 @@ PHPAPI void php_print_info(int flag)  #endif -		php3_printf("<center><h1>PHP Version %s</h1></center>\n", PHP_VERSION); +		php_printf("<center><h1>PHP Version %s</h1></center>\n", PHP_VERSION);  		PUTS("<hr><a href=\"http://www.php.net/\"><img src=\"");  		if (SG(request_info).request_uri) {  			PUTS(SG(request_info).request_uri);  		}  		PUTS("?=PHPE9568F34-D428-11d2-A769-00AA001ACF42\" border=\"0\" align=\"right\"></a>\n"); -		php3_printf("System: %s<br>Build Date: %s\n<br>", php3_uname, __DATE__); -		php3_printf("php.ini path:  %s<br>\n", CONFIGURATION_FILE_PATH); +		php_printf("System: %s<br>Build Date: %s\n<br>", php3_uname, __DATE__); +		php_printf("php.ini path:  %s<br>\n", CONFIGURATION_FILE_PATH); -		php3_printf("ZEND_DEBUG=%d<br>\n", ZEND_DEBUG); +		php_printf("ZEND_DEBUG=%d<br>\n", ZEND_DEBUG);  #ifdef ZTS -		php3_printf("ZTS is defined"); +		php_printf("ZTS is defined");  #else -		php3_printf("ZTS is undefined"); +		php_printf("ZTS is undefined");  #endif  		/* Zend Engine */  		PUTS("<hr><a href=\"http://www.zend.com/\"><img src=\""); @@ -99,7 +99,7 @@ PHPAPI void php_print_info(int flag)  			PUTS(SG(request_info).request_uri);  		}  		PUTS("?=PHPE9568F35-D428-11d2-A769-00AA001ACF42\" border=\"0\" align=\"right\"></a>\n"); -		php3_printf("This program makes use of the Zend scripting language engine:<br><pre>%s</pre>", get_zend_version()); +		php_printf("This program makes use of the Zend scripting language engine:<br><pre>%s</pre>", get_zend_version());  		PUTS("<hr>");  	} @@ -123,7 +123,7 @@ PHPAPI void php_print_info(int flag)  	}  	if (flag & PHP_INFO_MODULES) { -		_php3_hash_apply(&module_registry,(int (*)(void *)) _display_module_info); +		zend_hash_apply(&module_registry,(int (*)(void *)) _display_module_info);  	}  	if (flag & PHP_INFO_ENVIRONMENT) { @@ -153,76 +153,76 @@ PHPAPI void php_print_info(int flag)  		PUTS("<table border=5 width=\"600\">\n");  		php_info_print_table_header(2, "Variable", "Value"); -		if (_php3_hash_find(&EG(symbol_table), "PHP_SELF", sizeof("PHP_SELF"), (void **) &data) != FAILURE) { +		if (zend_hash_find(&EG(symbol_table), "PHP_SELF", sizeof("PHP_SELF"), (void **) &data) != FAILURE) {  			php_info_print_table_row(2, "PHP_SELF", (*data)->value.str.val);  		} -		if (_php3_hash_find(&EG(symbol_table), "PHP_AUTH_TYPE", sizeof("PHP_AUTH_TYPE"), (void **) &data) != FAILURE) { +		if (zend_hash_find(&EG(symbol_table), "PHP_AUTH_TYPE", sizeof("PHP_AUTH_TYPE"), (void **) &data) != FAILURE) {  			php_info_print_table_row(2, "PHP_AUTH_TYPE", (*data)->value.str.val);  		} -		if (_php3_hash_find(&EG(symbol_table), "PHP_AUTH_USER", sizeof("PHP_AUTH_USER"), (void **) &data) != FAILURE) { +		if (zend_hash_find(&EG(symbol_table), "PHP_AUTH_USER", sizeof("PHP_AUTH_USER"), (void **) &data) != FAILURE) {  			php_info_print_table_row(2, "PHP_AUTH_USER", (*data)->value.str.val);  		} -		if (_php3_hash_find(&EG(symbol_table), "PHP_AUTH_PW", sizeof("PHP_AUTH_PW"), (void **) &data) != FAILURE) { +		if (zend_hash_find(&EG(symbol_table), "PHP_AUTH_PW", sizeof("PHP_AUTH_PW"), (void **) &data) != FAILURE) {  			php_info_print_table_row(2, "PHP_AUTH_PW", (*data)->value.str.val);  		} -		if (_php3_hash_find(&EG(symbol_table), "HTTP_GET_VARS", sizeof("HTTP_GET_VARS"), (void **) &data) != FAILURE) { -			_php3_hash_internal_pointer_reset((*data)->value.ht); -			while (_php3_hash_get_current_data((*data)->value.ht, (void **) &tmp) == SUCCESS) { +		if (zend_hash_find(&EG(symbol_table), "HTTP_GET_VARS", sizeof("HTTP_GET_VARS"), (void **) &data) != FAILURE) { +			zend_hash_internal_pointer_reset((*data)->value.ht); +			while (zend_hash_get_current_data((*data)->value.ht, (void **) &tmp) == SUCCESS) {  				convert_to_string(*tmp);  				PUTS("<tr><td bgcolor=\"" PHP_ENTRY_NAME_COLOR "\"><b>HTTP_GET_VARS[\""); -				switch (_php3_hash_get_current_key((*data)->value.ht, &string_key, &num_key)) { +				switch (zend_hash_get_current_key((*data)->value.ht, &string_key, &num_key)) {  					case HASH_KEY_IS_STRING:  						PUTS(string_key);  						efree(string_key);  						break;  					case HASH_KEY_IS_LONG: -						php3_printf("%ld",num_key); +						php_printf("%ld",num_key);  						break;  				}  				PUTS("\"]</b></td><td bgcolor=\"" PHP_CONTENTS_COLOR "\">");  				PUTS((*tmp)->value.str.val); /* This could be "Array" - too ugly to expand that for now */  				PUTS("</td></tr>\n"); -				_php3_hash_move_forward((*data)->value.ht); +				zend_hash_move_forward((*data)->value.ht);  			}  		} -		if (_php3_hash_find(&EG(symbol_table), "HTTP_POST_VARS", sizeof("HTTP_POST_VARS"), (void **) &data) != FAILURE) { -			_php3_hash_internal_pointer_reset((*data)->value.ht); -			while (_php3_hash_get_current_data((*data)->value.ht, (void **) &tmp) == SUCCESS) { +		if (zend_hash_find(&EG(symbol_table), "HTTP_POST_VARS", sizeof("HTTP_POST_VARS"), (void **) &data) != FAILURE) { +			zend_hash_internal_pointer_reset((*data)->value.ht); +			while (zend_hash_get_current_data((*data)->value.ht, (void **) &tmp) == SUCCESS) {  				convert_to_string(*tmp);  				PUTS("<tr><td bgcolor=\"" PHP_ENTRY_NAME_COLOR "\"><b>HTTP_POST_VARS[\""); -				switch (_php3_hash_get_current_key((*data)->value.ht, &string_key, &num_key)) { +				switch (zend_hash_get_current_key((*data)->value.ht, &string_key, &num_key)) {  					case HASH_KEY_IS_STRING:  						PUTS(string_key);  						efree(string_key);  						break;  					case HASH_KEY_IS_LONG: -						php3_printf("%ld",num_key); +						php_printf("%ld",num_key);  						break;  				}  				PUTS("\"]</b></td><td bgcolor=\"" PHP_CONTENTS_COLOR "\">");  				PUTS((*tmp)->value.str.val);  				PUTS("</td></tr>\n"); -				_php3_hash_move_forward((*data)->value.ht); +				zend_hash_move_forward((*data)->value.ht);  			}  		} -		if (_php3_hash_find(&EG(symbol_table), "HTTP_COOKIE_VARS", sizeof("HTTP_COOKIE_VARS"), (void **) &data) != FAILURE) { -			_php3_hash_internal_pointer_reset((*data)->value.ht); -			while (_php3_hash_get_current_data((*data)->value.ht, (void **) &tmp) == SUCCESS) { +		if (zend_hash_find(&EG(symbol_table), "HTTP_COOKIE_VARS", sizeof("HTTP_COOKIE_VARS"), (void **) &data) != FAILURE) { +			zend_hash_internal_pointer_reset((*data)->value.ht); +			while (zend_hash_get_current_data((*data)->value.ht, (void **) &tmp) == SUCCESS) {  				convert_to_string(*tmp);  				PUTS("<tr><td bgcolor=\"" PHP_ENTRY_NAME_COLOR "\"><b>HTTP_COOKIE_VARS[\""); -				switch (_php3_hash_get_current_key((*data)->value.ht, &string_key, &num_key)) { +				switch (zend_hash_get_current_key((*data)->value.ht, &string_key, &num_key)) {  					case HASH_KEY_IS_STRING:  						PUTS(string_key);  						efree(string_key);  						break;  					case HASH_KEY_IS_LONG: -						php3_printf("%ld",num_key); +						php_printf("%ld",num_key);  						break;  				}  				PUTS("\"]</b></td><td bgcolor=\"" PHP_CONTENTS_COLOR "\">");  				PUTS((*tmp)->value.str.val);  				PUTS("</td></tr>\n"); -				_php3_hash_move_forward((*data)->value.ht); +				zend_hash_move_forward((*data)->value.ht);  			}  		}  		PUTS("</table>\n"); @@ -335,15 +335,15 @@ PHPAPI void php_info_print_table_header(int num_cols, ...)  	va_start(row_elements, num_cols); -	php3_printf("<tr>"); +	php_printf("<tr>");  	for (i=0; i<num_cols; i++) {  		row_element = va_arg(row_elements, char *);  		if (!row_element || !*row_element) {  			row_element = " ";  		} -		php3_printf("<th bgcolor=\"" PHP_HEADER_COLOR "\" valign=\"top\">%s</th>", row_element); +		php_printf("<th bgcolor=\"" PHP_HEADER_COLOR "\" valign=\"top\">%s</th>", row_element);  	} -	php3_printf("</tr>\n"); +	php_printf("</tr>\n");  	va_end(row_elements);  } @@ -358,17 +358,17 @@ PHPAPI void php_info_print_table_row(int num_cols, ...)  	va_start(row_elements, num_cols); -	php3_printf("<tr>"); +	php_printf("<tr>");  	for (i=0; i<num_cols; i++) {  		row_element = va_arg(row_elements, char *);  		if (!row_element || !*row_element) {  			row_element = " ";  		} -		php3_printf("<td bgcolor=\"%s\" valign=\"top\">%s%s%s</td>",  +		php_printf("<td bgcolor=\"%s\" valign=\"top\">%s%s%s</td>",   			color, (i==0?"<b>":""), row_element, (i==0?"</b>":""));  		color = PHP_CONTENTS_COLOR;  	} -	php3_printf("</tr>\n"); +	php_printf("</tr>\n");  	va_end(row_elements);  } diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c index 8419eb484e..c5718207bb 100644 --- a/ext/standard/iptc.c +++ b/ext/standard/iptc.c @@ -199,7 +199,7 @@ PHP_FUNCTION(iptcembed)  		RETURN_FALSE;      if ((fp = fopen(jpeg_file->value.str.val,"rb")) == 0) { -        php3_error(E_WARNING, "Unable to open %s", jpeg_file->value.str.val); +        php_error(E_WARNING, "Unable to open %s", jpeg_file->value.str.val);          RETURN_FALSE;      } @@ -350,20 +350,20 @@ PHP_FUNCTION(iptcparse)  		if (tagsfound == 0) { /* found the 1st tag - initialize the return array */  			if (array_init(return_value) == FAILURE) { -				php3_error(E_ERROR, "Unable to initialize array"); +				php_error(E_ERROR, "Unable to initialize array");  				RETURN_FALSE;  	  		}  		} -		if (_php3_hash_find(return_value->value.ht,key,strlen(key) + 1,(void **) &element) == FAILURE) { +		if (zend_hash_find(return_value->value.ht,key,strlen(key) + 1,(void **) &element) == FAILURE) {  			values = emalloc(sizeof(pval));  			INIT_PZVAL(values);  			if (array_init(values) == FAILURE) { -				php3_error(E_ERROR, "Unable to initialize array"); +				php_error(E_ERROR, "Unable to initialize array");  				RETURN_FALSE;  			} -			_php3_hash_update(return_value->value.ht, key, strlen(key)+1, (void *) &values, sizeof(pval*), (void **) &element); +			zend_hash_update(return_value->value.ht, key, strlen(key)+1, (void *) &values, sizeof(pval*), (void **) &element);  		}   		add_next_index_stringl(*element,buffer+inx,len,1); diff --git a/ext/standard/link.c b/ext/standard/link.c index a33253add9..978a14fda1 100644 --- a/ext/standard/link.c +++ b/ext/standard/link.c @@ -64,7 +64,7 @@ PHP_FUNCTION(readlink)  	ret = readlink(filename->value.str.val, buff, 255);  	if (ret == -1) { -		php3_error(E_WARNING, "readlink failed (%s)", strerror(errno)); +		php_error(E_WARNING, "readlink failed (%s)", strerror(errno));  		RETURN_FALSE;  	}  	/* Append NULL to the end of the string */ @@ -90,7 +90,7 @@ PHP_FUNCTION(linkinfo)  	ret = lstat(filename->value.str.val, &sb);  	if (ret == -1) { -		php3_error(E_WARNING, "LinkInfo failed (%s)", strerror(errno)); +		php_error(E_WARNING, "LinkInfo failed (%s)", strerror(errno));  		RETURN_LONG(-1L);  	}  	RETURN_LONG((long) sb.st_dev); @@ -118,7 +118,7 @@ PHP_FUNCTION(symlink)  	ret = symlink(topath->value.str.val, frompath->value.str.val);  	if (ret == -1) { -		php3_error(E_WARNING, "SymLink failed (%s)", strerror(errno)); +		php_error(E_WARNING, "SymLink failed (%s)", strerror(errno));  		RETURN_FALSE;  	}  	RETURN_TRUE; @@ -146,7 +146,7 @@ PHP_FUNCTION(link)  	ret = link(topath->value.str.val, frompath->value.str.val);  	if (ret == -1) { -		php3_error(E_WARNING, "Link failed (%s)", strerror(errno)); +		php_error(E_WARNING, "Link failed (%s)", strerror(errno));  		RETURN_FALSE;  	}  	RETURN_TRUE; @@ -173,7 +173,7 @@ PHP_FUNCTION(unlink)  	ret = unlink(filename->value.str.val);  	if (ret == -1) { -		php3_error(E_WARNING, "Unlink failed (%s)", strerror(errno)); +		php_error(E_WARNING, "Unlink failed (%s)", strerror(errno));  		RETURN_FALSE;  	}  	/* Clear stat cache */ diff --git a/ext/standard/mail.c b/ext/standard/mail.c index 9e7172fa71..73ba38aa6c 100644 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@ -70,7 +70,7 @@ PHP_FUNCTION(mail)  	if (argv[0]->value.str.val) {  		to = argv[0]->value.str.val;  	} else { -		php3_error(E_WARNING, "No to field in mail command"); +		php_error(E_WARNING, "No to field in mail command");  		RETURN_FALSE;  	} @@ -79,7 +79,7 @@ PHP_FUNCTION(mail)  	if (argv[1]->value.str.val) {  		subject = argv[1]->value.str.val;  	} else { -		php3_error(E_WARNING, "No subject field in mail command"); +		php_error(E_WARNING, "No subject field in mail command");  		RETURN_FALSE;  	} @@ -89,7 +89,7 @@ PHP_FUNCTION(mail)  		message = argv[2]->value.str.val;  	} else {  		/* this is not really an error, so it is allowed. */ -		php3_error(E_WARNING, "No message string in mail command"); +		php_error(E_WARNING, "No message string in mail command");  		message = NULL;  	} @@ -118,7 +118,7 @@ int _php3_mail(char *to, char *subject, char *message, char *headers)  #if MSVC5  	if (TSendMail(INI_STR("SMTP"), &tsm_err, headers, subject, to, message) != SUCCESS){ -		php3_error(E_WARNING, GetSMErrorText(tsm_err)); +		php_error(E_WARNING, GetSMErrorText(tsm_err));  		return 0;  	}  #else @@ -141,7 +141,7 @@ int _php3_mail(char *to, char *subject, char *message, char *headers)  			return 1;  		}  	} else { -		php3_error(E_WARNING, "Could not execute mail delivery program"); +		php_error(E_WARNING, "Could not execute mail delivery program");  		return 0;  	}  #endif @@ -153,7 +153,7 @@ PHP_MINFO_FUNCTION(mail)  #if MSVC5  	PUTS("Internal Sendmail support for Windows 4");  #else -	php3_printf("Path to sendmail: <tt>%s</tt>", INI_STR("sendmail_path")); +	php_printf("Path to sendmail: <tt>%s</tt>", INI_STR("sendmail_path"));  #endif  } diff --git a/ext/standard/math.c b/ext/standard/math.c index 8d6250aa01..daaf20ef09 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -571,12 +571,12 @@ PHP_FUNCTION(base_convert)  	convert_to_long(frombase);  	convert_to_long(tobase);  	if (frombase->value.lval < 2 || frombase->value.lval > 36) { -		php3_error(E_WARNING, "base_convert: invalid `from base' (%d)", +		php_error(E_WARNING, "base_convert: invalid `from base' (%d)",  				   frombase->value.lval);  		RETURN_FALSE;  	}  	if (tobase->value.lval < 2 || tobase->value.lval > 36) { -		php3_error(E_WARNING, "base_convert: invalid `to base' (%d)", +		php_error(E_WARNING, "base_convert: invalid `to base' (%d)",  				   tobase->value.lval);  		RETURN_FALSE;  	} @@ -602,7 +602,7 @@ char *_php3_number_format(double d,int dec,char dec_point,char thousand_sep)  	dec = MAX(0,dec);  	tmpbuf = (char *) emalloc(32+dec); -	tmplen=_php3_sprintf(tmpbuf,"%.*f",dec,d); +	tmplen=php_sprintf(tmpbuf,"%.*f",dec,d);  	if (!isdigit(tmpbuf[0])) {  		return tmpbuf; diff --git a/ext/standard/pack.c b/ext/standard/pack.c index 0523253ee4..60e8648713 100644 --- a/ext/standard/pack.c +++ b/ext/standard/pack.c @@ -161,7 +161,7 @@ PHP_FUNCTION(pack)  			/* Never uses any args */  			case 'x': case 'X':	case '@': {  				if (arg < 0) { -					php3_error(E_WARNING, "pack type %c: '*' ignored", code); +					php_error(E_WARNING, "pack type %c: '*' ignored", code);  					arg = 1;  				}  				break; @@ -173,7 +173,7 @@ PHP_FUNCTION(pack)  					efree(argv);  					efree(formatcodes);  					efree(formatargs); -					php3_error(E_ERROR, "pack type %c: not enough arguments", code); +					php_error(E_ERROR, "pack type %c: not enough arguments", code);  					RETURN_FALSE;  				} @@ -199,14 +199,14 @@ PHP_FUNCTION(pack)  					efree(argv);  					efree(formatcodes);  					efree(formatargs); -					php3_error(E_ERROR, "pack type %c: too few arguments", code); +					php_error(E_ERROR, "pack type %c: too few arguments", code);  					RETURN_FALSE;  				}  				break;  			}  			default: { -				php3_error(E_ERROR, "pack type %c: unknown format code", code); +				php_error(E_ERROR, "pack type %c: unknown format code", code);  				RETURN_FALSE;  			}  		} @@ -216,7 +216,7 @@ PHP_FUNCTION(pack)  	}  	if (currentarg < argc) { -		php3_error(E_WARNING, "pack %d arguments unused", (argc - currentarg)); +		php_error(E_WARNING, "pack %d arguments unused", (argc - currentarg));  	}  	/* Calculate output length and upper bound while processing*/ @@ -266,7 +266,7 @@ PHP_FUNCTION(pack)  				outputpos -= arg;  				if (outputpos < 0) { -					php3_error(E_WARNING, "pack type %c: outside of string", code); +					php_error(E_WARNING, "pack type %c: outside of string", code);  					outputpos = 0;  				}  				break; @@ -324,7 +324,7 @@ PHP_FUNCTION(pack)  					} else if ((n >= 'a') && (n <= 'f')) {  						n -= ('a' - 10);  					} else { -						php3_error(E_WARNING, "pack type %c: illegal hex digit %c", code, n); +						php_error(E_WARNING, "pack type %c: illegal hex digit %c", code, n);  						n = 0;  					} @@ -759,7 +759,7 @@ PHP_FUNCTION(unpack)  							i = arg - 1;		/* Break out of for loop */  							if (arg >= 0) { -								php3_error(E_WARNING, "pack type %c: outside of string", type); +								php_error(E_WARNING, "pack type %c: outside of string", type);  							}  						}  						break; @@ -769,7 +769,7 @@ PHP_FUNCTION(unpack)  						if (arg <= inputlen) {  							inputpos = arg;  						} else { -							php3_error(E_WARNING, "pack type %c: outside of string", type); +							php_error(E_WARNING, "pack type %c: outside of string", type);  						}  						i = arg - 1;	/* Done, break out of for loop */ @@ -782,7 +782,7 @@ PHP_FUNCTION(unpack)  				/* Reached end of input for '*' repeater */  				break;  			} else { -				php3_error(E_ERROR, "pack type %c: not enough input, need %d, have %d", type, size, inputlen - inputpos); +				php_error(E_ERROR, "pack type %c: not enough input, need %d, have %d", type, size, inputlen - inputpos);  				RETURN_FALSE;  			}  		} diff --git a/ext/standard/pageinfo.c b/ext/standard/pageinfo.c index e0b7593331..464d2a0bed 100644 --- a/ext/standard/pageinfo.c +++ b/ext/standard/pageinfo.c @@ -72,7 +72,7 @@ static void _php3_statpage(void)  		path = SG(request_info).path_translated;  		if (path != NULL) {  			if (stat(path, &sb) == -1) { -				php3_error(E_WARNING, "Unable to find file:  '%s'", path); +				php_error(E_WARNING, "Unable to find file:  '%s'", path);  				return;  			}  			page_uid   = sb.st_uid; diff --git a/ext/standard/post.c b/ext/standard/post.c index c9106a3b49..146d8b25f6 100644 --- a/ext/standard/post.c +++ b/ext/standard/post.c @@ -49,7 +49,7 @@ static char *php3_getpost(pval *http_post_vars PLS_DC)  	ctype = request_info.content_type;  	if (!ctype) { -		php3_error(E_WARNING, "POST Error: content-type missing"); +		php_error(E_WARNING, "POST Error: content-type missing");  		return NULL;  	}  	if (strncasecmp(ctype, "application/x-www-form-urlencoded", 33) && strncasecmp(ctype, "multipart/form-data", 19) @@ -57,7 +57,7 @@ static char *php3_getpost(pval *http_post_vars PLS_DC)   && strncasecmp(ctype, "application/vnd.fdf", 19)  #endif        ) { -		php3_error(E_WARNING, "Unsupported content-type: %s", ctype); +		php_error(E_WARNING, "Unsupported content-type: %s", ctype);  		return NULL;  	}  	if (!strncasecmp(ctype, "multipart/form-data", 19)) { @@ -66,9 +66,9 @@ static char *php3_getpost(pval *http_post_vars PLS_DC)  		if (mb) {  			strncpy(boundary, mb + 1, sizeof(boundary));  		} else { -			php3_error(E_WARNING, "File Upload Error: No MIME boundary found"); -			php3_error(E_WARNING, "There should have been a \"boundary=something\" in the Content-Type string"); -			php3_error(E_WARNING, "The Content-Type string was: \"%s\"", ctype); +			php_error(E_WARNING, "File Upload Error: No MIME boundary found"); +			php_error(E_WARNING, "There should have been a \"boundary=something\" in the Content-Type string"); +			php_error(E_WARNING, "The Content-Type string was: \"%s\"", ctype);  			return NULL;  		}  	} @@ -76,7 +76,7 @@ static char *php3_getpost(pval *http_post_vars PLS_DC)  	cnt = length;  	buf = (char *) emalloc((length + 1) * sizeof(char));  	if (!buf) { -		php3_error(E_WARNING, "Unable to allocate memory in php3_getpost()"); +		php_error(E_WARNING, "Unable to allocate memory in php3_getpost()");  		return NULL;  	}  #if FHTTPD @@ -133,7 +133,7 @@ static char *php3_getpost(pval *http_post_vars PLS_DC)  		postdata_ptr->value.str.val = (char *) estrdup(buf);  		postdata_ptr->value.str.len = cnt;  		INIT_PZVAL(postdata_ptr); -		_php3_hash_add(&symbol_table, "HTTP_FDF_DATA", sizeof("HTTP_FDF_DATA"), postdata_ptr, sizeof(pval *),NULL); +		zend_hash_add(&symbol_table, "HTTP_FDF_DATA", sizeof("HTTP_FDF_DATA"), postdata_ptr, sizeof(pval *),NULL);  	}  #endif  	return (buf); @@ -210,20 +210,20 @@ void _php3_parse_gpc_data(char *val, char *var, pval *track_vars_array)  		pval **arr_ptr;  		/* If the array doesn't exist, create it */ -		if (_php3_hash_find(EG(active_symbol_table), var, var_len+1, (void **) &arr_ptr) == FAILURE) { +		if (zend_hash_find(EG(active_symbol_table), var, var_len+1, (void **) &arr_ptr) == FAILURE) {  			arr1 = (pval *) emalloc(sizeof(pval));  			INIT_PZVAL(arr1);  			if (array_init(arr1)==FAILURE) {  				return;  			} -			_php3_hash_update(EG(active_symbol_table), var, var_len+1, &arr1, sizeof(pval *), NULL); +			zend_hash_update(EG(active_symbol_table), var, var_len+1, &arr1, sizeof(pval *), NULL);  			if (track_vars_array) {  				arr2 = (pval *) emalloc(sizeof(pval));  				INIT_PZVAL(arr2);  				if (array_init(arr2)==FAILURE) {  					return;  				} -				_php3_hash_update(track_vars_array->value.ht, var, var_len+1, (void *) &arr2, sizeof(pval *),NULL); +				zend_hash_update(track_vars_array->value.ht, var, var_len+1, (void *) &arr2, sizeof(pval *),NULL);  			}  		} else {  			if ((*arr_ptr)->type!=IS_ARRAY) { @@ -242,11 +242,11 @@ void _php3_parse_gpc_data(char *val, char *var, pval *track_vars_array)  					if (array_init(arr2)==FAILURE) {  						return;  					} -					_php3_hash_update(track_vars_array->value.ht, var, var_len+1, (void *) &arr2, sizeof(pval *),NULL); +					zend_hash_update(track_vars_array->value.ht, var, var_len+1, (void *) &arr2, sizeof(pval *),NULL);  				}  			}  			arr1 = *arr_ptr; -			if (track_vars_array && _php3_hash_find(track_vars_array->value.ht, var, var_len+1, (void **) &arr_ptr) == FAILURE) { +			if (track_vars_array && zend_hash_find(track_vars_array->value.ht, var, var_len+1, (void **) &arr_ptr) == FAILURE) {  				return;  			}  			arr2 = *arr_ptr; @@ -261,24 +261,24 @@ void _php3_parse_gpc_data(char *val, char *var, pval *track_vars_array)  		/* And then insert it */  		if (ret) {		/* array */  			if (php3_check_type(ret) == IS_LONG) { /* numeric index */ -				_php3_hash_index_update(arr1->value.ht, atol(ret), &entry, sizeof(pval *),NULL);	/* s[ret]=tmp */ +				zend_hash_index_update(arr1->value.ht, atol(ret), &entry, sizeof(pval *),NULL);	/* s[ret]=tmp */  				if (track_vars_array) { -					_php3_hash_index_update(arr2->value.ht, atol(ret), &entry, sizeof(pval *),NULL); +					zend_hash_index_update(arr2->value.ht, atol(ret), &entry, sizeof(pval *),NULL);  					entry->refcount++;  				}  			} else { /* associative index */ -				_php3_hash_update(arr1->value.ht, ret, strlen(ret)+1, &entry, sizeof(pval *),NULL);	/* s["ret"]=tmp */ +				zend_hash_update(arr1->value.ht, ret, strlen(ret)+1, &entry, sizeof(pval *),NULL);	/* s["ret"]=tmp */  				if (track_vars_array) { -					_php3_hash_update(arr2->value.ht, ret, strlen(ret)+1, &entry, sizeof(pval *),NULL); +					zend_hash_update(arr2->value.ht, ret, strlen(ret)+1, &entry, sizeof(pval *),NULL);  					entry->refcount++;  				}  			}  			efree(ret);  			ret = NULL;  		} else {		/* non-indexed array */ -			_php3_hash_next_index_insert(arr1->value.ht, &entry, sizeof(pval *),NULL); +			zend_hash_next_index_insert(arr1->value.ht, &entry, sizeof(pval *),NULL);  			if (track_vars_array) { -				_php3_hash_next_index_insert(arr2->value.ht, &entry, sizeof(pval *),NULL); +				zend_hash_next_index_insert(arr2->value.ht, &entry, sizeof(pval *),NULL);  				entry->refcount++;  			}  		} @@ -289,10 +289,10 @@ void _php3_parse_gpc_data(char *val, char *var, pval *track_vars_array)  		INIT_PZVAL(entry);  		entry->value.str.val = val;  		entry->value.str.len = val_len; -		_php3_hash_update(EG(active_symbol_table), var, var_len+1, (void *) &entry, sizeof(pval *),NULL); +		zend_hash_update(EG(active_symbol_table), var, var_len+1, (void *) &entry, sizeof(pval *),NULL);  		if (track_vars_array) {  			entry->refcount++; -			_php3_hash_update(track_vars_array->value.ht, var, var_len+1, (void *) &entry, sizeof(pval *), NULL); +			zend_hash_update(track_vars_array->value.ht, var, var_len+1, (void *) &entry, sizeof(pval *), NULL);  		}  	}  } @@ -317,13 +317,13 @@ void php3_treat_data(int arg, char *str)  				INIT_PZVAL(array_ptr);  				switch (arg) {  					case PARSE_POST: -						_php3_hash_add(&EG(symbol_table), "HTTP_POST_VARS", sizeof("HTTP_POST_VARS"), &array_ptr, sizeof(pval *),NULL); +						zend_hash_add(&EG(symbol_table), "HTTP_POST_VARS", sizeof("HTTP_POST_VARS"), &array_ptr, sizeof(pval *),NULL);  						break;  					case PARSE_GET: -						_php3_hash_add(&EG(symbol_table), "HTTP_GET_VARS", sizeof("HTTP_GET_VARS"), &array_ptr, sizeof(pval *),NULL); +						zend_hash_add(&EG(symbol_table), "HTTP_GET_VARS", sizeof("HTTP_GET_VARS"), &array_ptr, sizeof(pval *),NULL);  						break;  					case PARSE_COOKIE: -						_php3_hash_add(&EG(symbol_table), "HTTP_COOKIE_VARS", sizeof("HTTP_COOKIE_VARS"), &array_ptr, sizeof(pval *),NULL); +						zend_hash_add(&EG(symbol_table), "HTTP_COOKIE_VARS", sizeof("HTTP_COOKIE_VARS"), &array_ptr, sizeof(pval *),NULL);  						break;  				}  			} else { @@ -420,12 +420,12 @@ PHPAPI void php3_TreatHeaders(void)  	/* Check to make sure that this URL isn't authenticated  	   using a traditional auth module mechanism */  	if (auth_type(r)) { -		/*php3_error(E_WARNING, "Authentication done by server module\n");*/ +		/*php_error(E_WARNING, "Authentication done by server module\n");*/  		return;  	}  	if (strcmp(t=getword(r->pool, &s, ' '), "Basic")) {  		/* Client tried to authenticate using wrong auth scheme */ -		php3_error(E_WARNING, "client used wrong authentication scheme (%s)", t); +		php_error(E_WARNING, "client used wrong authentication scheme (%s)", t);  		return;  	}  	t = uudecode(r->pool, s); diff --git a/ext/standard/rand.c b/ext/standard/rand.c index 051eab8ce6..c8128f0675 100644 --- a/ext/standard/rand.c +++ b/ext/standard/rand.c @@ -252,7 +252,7 @@ PHP_FUNCTION(rand)  			convert_to_long(p_min);  			convert_to_long(p_max);  			if (p_max->value.lval-p_min->value.lval <= 0) { -				php3_error(E_WARNING,"rand():  Invalid range:  %ld..%ld", p_min->value.lval, p_max->value.lval); +				php_error(E_WARNING,"rand():  Invalid range:  %ld..%ld", p_min->value.lval, p_max->value.lval);  			}  			break;  		default: @@ -318,7 +318,7 @@ PHP_FUNCTION(mt_rand)  			convert_to_long(p_min);  			convert_to_long(p_max);  			if (p_max->value.lval-p_min->value.lval <= 0) { -				php3_error(E_WARNING,"mtrand():  Invalid range:  %ld..%ld", p_min->value.lval, p_max->value.lval); +				php_error(E_WARNING,"mtrand():  Invalid range:  %ld..%ld", p_min->value.lval, p_max->value.lval);  			}  			break;  		default: diff --git a/ext/standard/reg.c b/ext/standard/reg.c index f36bd4056a..6382cfd739 100644 --- a/ext/standard/reg.c +++ b/ext/standard/reg.c @@ -69,7 +69,7 @@ static int _php_regcomp(regex_t *preg, const char *pattern, int cflags)  	reg_cache *rc = NULL;  	REGLS_FETCH(); -	if(_php3_hash_find(®(ht_rc), (char *) pattern, patlen+1, (void **) &rc) == FAILURE || +	if(zend_hash_find(®(ht_rc), (char *) pattern, patlen+1, (void **) &rc) == FAILURE ||  			rc->cflags != cflags) {  		r = regcomp(preg, pattern, cflags);  		if(!r) { @@ -77,7 +77,7 @@ static int _php_regcomp(regex_t *preg, const char *pattern, int cflags)  			rcp.cflags = cflags;  			memcpy(&rcp.preg, preg, sizeof(*preg)); -			_php3_hash_update(®(ht_rc), (char *) pattern, patlen+1, +			zend_hash_update(®(ht_rc), (char *) pattern, patlen+1,  					(void *) &rcp, sizeof(rcp), NULL);  		}  	} else { @@ -98,7 +98,7 @@ static int _free_reg_cache(reg_cache *rc)  static void php_reg_init_globals(php_reg_globals *reg_globals)   { -	_php3_hash_init(®_globals->ht_rc, 0, NULL, (int (*)(void *)) _free_reg_cache, 1); +	zend_hash_init(®_globals->ht_rc, 0, NULL, (int (*)(void *)) _free_reg_cache, 1);  }  static PHP_MINIT_FUNCTION(regex) @@ -116,7 +116,7 @@ static PHP_MSHUTDOWN_FUNCTION(regex)  {  	REGLS_FETCH(); -	_php3_hash_destroy(®(ht_rc)); +	zend_hash_destroy(®(ht_rc));  	return SUCCESS;  } @@ -167,7 +167,7 @@ static void _php3_reg_eprint(int err, regex_t *re) {  		/* drop the message into place */  		regerror(err, re, message + buf_len, len); -		php3_error(E_WARNING, "%s", message); +		php_error(E_WARNING, "%s", message);  	}  	STR_FREE(buf); @@ -204,7 +204,7 @@ static void _php3_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase)  			WRONG_PARAM_COUNT;  		}  		if (!ParameterPassedByReference(ht, 3)) { -			php3_error(E_WARNING, "Array to be filled with values must be passed by reference."); +			php_error(E_WARNING, "Array to be filled with values must be passed by reference.");  			RETURN_FALSE;  		}  		break; @@ -249,7 +249,7 @@ static void _php3_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase)  		buf = emalloc(string_len);  		if (!buf) { -			php3_error(E_WARNING, "Unable to allocate memory in _php3_ereg"); +			php_error(E_WARNING, "Unable to allocate memory in _php3_ereg");  			RETURN_FALSE;  		} @@ -324,7 +324,7 @@ char *_php3_regreplace(const char *pattern, const char *replace, const char *str  	buf_len = 2 * string_len + 1;  	buf = emalloc(buf_len * sizeof(char));  	if (!buf) { -		php3_error(E_WARNING, "Unable to allocate memory in _php3_regreplace"); +		php_error(E_WARNING, "Unable to allocate memory in _php3_regreplace");  		regfree(&re);  		return ((char *) -1);  	} @@ -541,7 +541,7 @@ PHP_FUNCTION(split)  	err = regcomp(&re, spliton->value.str.val, REG_EXTENDED);  	if (err) { -		php3_error(E_WARNING, "unexpected regex error (%d)", err); +		php_error(E_WARNING, "unexpected regex error (%d)", err);  		RETURN_FALSE;  	} @@ -560,8 +560,8 @@ PHP_FUNCTION(split)  		} else if (subs[0].rm_so==0 && subs[0].rm_eo==0) {  			/* No more matches */  			regfree(&re); -			php3_error(E_WARNING, "bad regular expression for split()"); -			_php3_hash_destroy(return_value->value.ht); +			php_error(E_WARNING, "bad regular expression for split()"); +			zend_hash_destroy(return_value->value.ht);  			efree(return_value->value.ht);  			RETURN_FALSE;  		} else { @@ -586,9 +586,9 @@ PHP_FUNCTION(split)  	/* see if we encountered an error */  	if (err && err != REG_NOMATCH) { -		php3_error(E_WARNING, "unexpected regex error (%d)", err); +		php_error(E_WARNING, "unexpected regex error (%d)", err);  		regfree(&re); -		_php3_hash_destroy(return_value->value.ht); +		zend_hash_destroy(return_value->value.ht);  		efree(return_value->value.ht);  		RETURN_FALSE;  	} diff --git a/ext/standard/string.c b/ext/standard/string.c index 7be2b0317b..f557c9b91d 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -282,7 +282,7 @@ PHP_FUNCTION(explode)  	if (strlen(delim->value.str.val)==0) {  		/* the delimiter must be a valid C string that's at least 1 character long */ -		php3_error(E_WARNING,"Empty delimiter"); +		php_error(E_WARNING,"Empty delimiter");  		RETURN_FALSE;  	}  	if (array_init(return_value) == FAILURE) { @@ -302,8 +302,8 @@ void _php3_implode(pval *delim, pval *arr, pval *return_value)  	int len = 0, count = 0;  	/* convert everything to strings, and calculate length */ -	_php3_hash_internal_pointer_reset(arr->value.ht); -	while (_php3_hash_get_current_data(arr->value.ht, (void **) &tmp) == SUCCESS) { +	zend_hash_internal_pointer_reset(arr->value.ht); +	while (zend_hash_get_current_data(arr->value.ht, (void **) &tmp) == SUCCESS) {  		SEPARATE_ZVAL(tmp);  		convert_to_string(*tmp);  		if ((*tmp)->type == IS_STRING && (*tmp)->value.str.val != undefined_variable_string) { @@ -313,15 +313,15 @@ void _php3_implode(pval *delim, pval *arr, pval *return_value)  			}  			count++;  		} -		_php3_hash_move_forward(arr->value.ht); +		zend_hash_move_forward(arr->value.ht);  	}  	/* do it */  	return_value->value.str.val = (char *) emalloc(len + 1);  	return_value->value.str.val[0] = '\0';  	return_value->value.str.val[len] = '\0'; -	_php3_hash_internal_pointer_reset(arr->value.ht); -	while (_php3_hash_get_current_data(arr->value.ht, (void **) &tmp) == SUCCESS) { +	zend_hash_internal_pointer_reset(arr->value.ht); +	while (zend_hash_get_current_data(arr->value.ht, (void **) &tmp) == SUCCESS) {  		if ((*tmp)->type == IS_STRING && (*tmp)->value.str.val != undefined_variable_string) {  			count--;  			strcat(return_value->value.str.val, (*tmp)->value.str.val); @@ -329,7 +329,7 @@ void _php3_implode(pval *delim, pval *arr, pval *return_value)  				strcat(return_value->value.str.val, delim->value.str.val);  			}  		} -		_php3_hash_move_forward(arr->value.ht); +		zend_hash_move_forward(arr->value.ht);  	}  	return_value->type = IS_STRING;  	return_value->value.str.len = len; @@ -354,7 +354,7 @@ PHP_FUNCTION(implode)  		arr = arg2;  		delim = arg1;  	} else { -		php3_error(E_WARNING, "Bad arguments to %s()", +		php_error(E_WARNING, "Bad arguments to %s()",  				   get_active_function_name());  		return;  	} @@ -590,7 +590,7 @@ PHP_FUNCTION(stristr)  	convert_to_string(needle);  	if (strlen(needle->value.str.val)==0) { -		php3_error(E_WARNING,"Empty delimiter"); +		php_error(E_WARNING,"Empty delimiter");  		RETURN_FALSE;  	}  	found = php3i_stristr(haystack->value.str.val, needle->value.str.val); @@ -618,7 +618,7 @@ PHP_FUNCTION(strstr)  	if (needle->type == IS_STRING) {  		if (strlen(needle->value.str.val)==0) { -			php3_error(E_WARNING,"Empty delimiter"); +			php_error(E_WARNING,"Empty delimiter");  			RETURN_FALSE;  		}  		found = strstr(haystack->value.str.val, needle->value.str.val); @@ -662,13 +662,13 @@ PHP_FUNCTION(strpos)  	}  	convert_to_string(haystack);  	if (offset > haystack->value.str.len) { -		php3_error(E_WARNING,"offset not contained in string"); +		php_error(E_WARNING,"offset not contained in string");  		RETURN_FALSE;  	}  	if (needle->type == IS_STRING) {  		if (needle->value.str.len==0) { -			php3_error(E_WARNING,"Empty delimiter"); +			php_error(E_WARNING,"Empty delimiter");  			RETURN_FALSE;  		}  		found = strstr(haystack->value.str.val+offset, needle->value.str.val); @@ -811,7 +811,7 @@ PHP_FUNCTION(chunk_split)  	}  	if(chunklen == 0) { -		php3_error(E_WARNING, "chunk length is 0"); +		php_error(E_WARNING, "chunk length is 0");  		RETURN_FALSE;  	} @@ -1443,7 +1443,7 @@ PHP_FUNCTION(str_replace)  	}  	if(needle->value.str.len == 0) { -		php3_error(E_WARNING, "The length of the needle must not be 0"); +		php_error(E_WARNING, "The length of the needle must not be 0");  		RETURN_FALSE;  	} @@ -1696,7 +1696,7 @@ PHP_FUNCTION(setlocale)  	else if (!strcasecmp ("LC_TIME", category->value.str.val))  		cat = LC_TIME;  	else { -		php3_error(E_WARNING,"Invalid locale category name %s, must be one of LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC or LC_TIME", category->value.str.val); +		php_error(E_WARNING,"Invalid locale category name %s, must be one of LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC or LC_TIME", category->value.str.val);  		RETURN_FALSE;  	}  	if (!strcmp ("0", locale->value.str.val)) diff --git a/ext/standard/uniqid.c b/ext/standard/uniqid.c index 6bd2da3446..773ade9a67 100644 --- a/ext/standard/uniqid.c +++ b/ext/standard/uniqid.c @@ -54,7 +54,7 @@ PHP_FUNCTION(uniqid)  	/* Do some bounds checking since we are using a char array. */  	if (strlen(prefix->value.str.val) > 114) { -		php3_error(E_WARNING, "The prefix to uniqid should not be more than 114 characters."); +		php_error(E_WARNING, "The prefix to uniqid should not be more than 114 characters.");  		return;  	}  	/* dont need this on windows so lets not do it*/ diff --git a/ext/standard/url.c b/ext/standard/url.c index 40b178f531..96a6ee2c4e 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -67,7 +67,7 @@ url *url_parse(char *string)  	url *ret = (url *) emalloc(sizeof(url));  	if (!ret) { -		/*php3_error(E_WARNING,"Unable to allocate memory\n");*/ +		/*php_error(E_WARNING,"Unable to allocate memory\n");*/  		return NULL;  	}  	memset(ret, 0, sizeof(url)); @@ -76,13 +76,13 @@ url *url_parse(char *string)  	   http://www.ics.uci.edu/~fielding/url/url.txt */  	err = regcomp(&re, "^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?", REG_EXTENDED);  	if (err) { -		/*php3_error(E_WARNING,"Unable to compile regex: %d\n", err);*/ +		/*php_error(E_WARNING,"Unable to compile regex: %d\n", err);*/  		efree(ret);  		return NULL;  	}  	err = regexec(&re, string, 10, subs, 0);  	if (err) { -		/*php3_error(E_WARNING,"Error with regex\n");*/ +		/*php_error(E_WARNING,"Error with regex\n");*/  		efree(ret);  		return NULL;  	} @@ -122,7 +122,7 @@ url *url_parse(char *string)  			STR_FREE(ret->fragment);  			efree(ret);  			efree(result); -			/*php3_error(E_WARNING,"Unable to compile regex: %d\n", err);*/ +			/*php_error(E_WARNING,"Unable to compile regex: %d\n", err);*/  			return NULL;  		}  		/* now deal with all of the results */ @@ -159,7 +159,7 @@ PHP_FUNCTION(parse_url)  	resource = url_parse(string->value.str.val);  	if (resource == NULL) { -		php3_error(E_WARNING, "unable to parse url (%s)", string->value.str.val); +		php_error(E_WARNING, "unable to parse url (%s)", string->value.str.val);  		RETURN_FALSE;  	}  	/* allocate an array for return */ diff --git a/ext/standard/var.c b/ext/standard/var.c index 8cbda2674f..b3dd5bbbb9 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -64,25 +64,25 @@ void php3api_var_dump(pval **struc, int level)  			break;  		case IS_ARRAY: -			i = sprintf(buf, "%*carray(%d) {\n", level, ' ', _php3_hash_num_elements((*struc)->value.ht)); +			i = sprintf(buf, "%*carray(%d) {\n", level, ' ', zend_hash_num_elements((*struc)->value.ht));  			PHPWRITE(&buf[1], i - 1);  			goto head_done;  		case IS_OBJECT: -			i = sprintf(buf, "%*cobject(%d) {\n", level, ' ', _php3_hash_num_elements((*struc)->value.ht)); +			i = sprintf(buf, "%*cobject(%d) {\n", level, ' ', zend_hash_num_elements((*struc)->value.ht));  			PHPWRITE(&buf[1], i - 1);  		  head_done: -			_php3_hash_internal_pointer_reset((*struc)->value.ht); -			for (;; _php3_hash_move_forward((*struc)->value.ht)) { -				if ((i = _php3_hash_get_current_key((*struc)->value.ht, &key, &index)) == HASH_KEY_NON_EXISTANT) +			zend_hash_internal_pointer_reset((*struc)->value.ht); +			for (;; zend_hash_move_forward((*struc)->value.ht)) { +				if ((i = zend_hash_get_current_key((*struc)->value.ht, &key, &index)) == HASH_KEY_NON_EXISTANT)  					break;  				if (c > 0) {  					strcpy(buf, "\n");  					PHPWRITE(buf, strlen(buf));  				}  				c++; -				if (_php3_hash_get_current_data((*struc)->value.ht, (void **) (&data)) != SUCCESS || !data || (data == struc)) +				if (zend_hash_get_current_data((*struc)->value.ht, (void **) (&data)) != SUCCESS || !data || (data == struc))  					continue;  				switch (i) {  					case HASH_KEY_IS_LONG:{ @@ -193,7 +193,7 @@ void php3api_var_serialize(pval *buf, pval **struc)  		case IS_ARRAY:  			ch = 'a'; -			i = _php3_hash_num_elements((*struc)->value.ht); +			i = zend_hash_num_elements((*struc)->value.ht);  			slen = sprintf(s, "%c:%d:{", ch, i);  			STR_CAT(buf, s, slen);  			if (i > 0) { @@ -201,12 +201,12 @@ void php3api_var_serialize(pval *buf, pval **struc)  				pval **data,*d;  				ulong index; -				_php3_hash_internal_pointer_reset((*struc)->value.ht); -				for (;; _php3_hash_move_forward((*struc)->value.ht)) { -					if ((i = _php3_hash_get_current_key((*struc)->value.ht, &key, &index)) == HASH_KEY_NON_EXISTANT) { +				zend_hash_internal_pointer_reset((*struc)->value.ht); +				for (;; zend_hash_move_forward((*struc)->value.ht)) { +					if ((i = zend_hash_get_current_key((*struc)->value.ht, &key, &index)) == HASH_KEY_NON_EXISTANT) {  						break;  					} -					if (_php3_hash_get_current_data((*struc)->value.ht, (void **) (&data)) != +					if (zend_hash_get_current_data((*struc)->value.ht, (void **) (&data)) !=  							SUCCESS || !data || ((*data) == (*struc))) {  						continue;  					} @@ -245,11 +245,11 @@ void php3api_var_serialize(pval *buf, pval **struc)  				ulong index;  				zend_hash_internal_pointer_reset((*struc)->value.obj.properties); -				for (;; _php3_hash_move_forward((*struc)->value.obj.properties)) { -					if ((i = _php3_hash_get_current_key((*struc)->value.obj.properties, &key, &index)) == HASH_KEY_NON_EXISTANT) { +				for (;; zend_hash_move_forward((*struc)->value.obj.properties)) { +					if ((i = zend_hash_get_current_key((*struc)->value.obj.properties, &key, &index)) == HASH_KEY_NON_EXISTANT) {  						break;  					} -					if (_php3_hash_get_current_data((*struc)->value.obj.properties, (void **) +					if (zend_hash_get_current_data((*struc)->value.obj.properties, (void **)  							(&data)) != SUCCESS || !data || ((*data) == (*struc))) {  						continue;  					} @@ -371,7 +371,7 @@ int php3api_var_unserialize(pval **rval, const char **p, const char *max)  			(*p) += 2;  			i = atoi(*p);  			(*rval)->value.ht = (HashTable *) emalloc(sizeof(HashTable)); -			_php3_hash_init((*rval)->value.ht, i + 1, NULL, PVAL_PTR_DTOR, 0); +			zend_hash_init((*rval)->value.ht, i + 1, NULL, PVAL_PTR_DTOR, 0);  			while (**p && **p != ':') {  				(*p)++;  			} @@ -395,10 +395,10 @@ int php3api_var_unserialize(pval **rval, const char **p, const char *max)  				}  				switch (key->type) {  					case IS_LONG: -						_php3_hash_index_update((*rval)->value.ht, key->value.lval, &data, sizeof(data), NULL); +						zend_hash_index_update((*rval)->value.ht, key->value.lval, &data, sizeof(data), NULL);  						break;  					case IS_STRING: -						_php3_hash_add((*rval)->value.ht, key->value.str.val, key->value.str.len + 1, &data, sizeof(data), NULL); +						zend_hash_add((*rval)->value.ht, key->value.str.val, key->value.str.len + 1, &data, sizeof(data), NULL);  						break;  				}  				pval_destructor(key); @@ -412,7 +412,7 @@ int php3api_var_unserialize(pval **rval, const char **p, const char *max)  			(*p) += 2;  			i = atoi(*p);  			(*rval)->value.obj.properties = (HashTable *) emalloc(sizeof(HashTable)); -			_php3_hash_init((*rval)->value.obj.properties, i + 1, NULL, PVAL_PTR_DTOR, 0); +			zend_hash_init((*rval)->value.obj.properties, i + 1, NULL, PVAL_PTR_DTOR, 0);  			while (**p && **p != ':') {  				(*p)++;  			} @@ -436,10 +436,10 @@ int php3api_var_unserialize(pval **rval, const char **p, const char *max)  				}  				switch (key->type) {  					case IS_LONG: -						_php3_hash_index_update((*rval)->value.obj.properties, key->value.lval, &data, sizeof(data), NULL); +						zend_hash_index_update((*rval)->value.obj.properties, key->value.lval, &data, sizeof(data), NULL);  						break;  					case IS_STRING: -						_php3_hash_add((*rval)->value.obj.properties, key->value.str.val, key->value.str.len + 1, &data, sizeof(data), NULL); +						zend_hash_add((*rval)->value.obj.properties, key->value.str.val, key->value.str.len + 1, &data, sizeof(data), NULL);  						break;  				}  				pval_destructor(key); diff --git a/ext/sybase/sybase-ct.c b/ext/sybase/sybase-ct.c index f8c55ffaf5..d5309e8a96 100644 --- a/ext/sybase/sybase-ct.c +++ b/ext/sybase/sybase-ct.c @@ -81,7 +81,7 @@ THREAD_LS sybct_module php3_sybct_module;  THREAD_LS static CS_CONTEXT *context;  THREAD_LS static HashTable *resource_list,*resource_plist; -#define CHECK_LINK(link) { if (link==-1) { php3_error(E_WARNING,"Sybase:  A link to the server could not be established"); RETURN_FALSE; } } +#define CHECK_LINK(link) { if (link==-1) { php_error(E_WARNING,"Sybase:  A link to the server could not be established"); RETURN_FALSE; } }  static int _clean_invalid_results(list_entry *le) @@ -128,7 +128,7 @@ static void _close_sybct_link(sybct_link *sybct_ptr)  	CS_INT con_status;  	sybct_ptr->valid = 0; -	_php3_hash_apply(resource_list,(int (*)(void *))_clean_invalid_results); +	zend_hash_apply(resource_list,(int (*)(void *))_clean_invalid_results);  	/* Non-persistent connections will always be connected or we wouldn't  	 * get here, but since we want to check the death status anyway @@ -136,7 +136,7 @@ static void _close_sybct_link(sybct_link *sybct_ptr)  	 */  	if (ct_con_props(sybct_ptr->connection, CS_GET, CS_CON_STATUS,  					 &con_status, CS_UNUSED, NULL)!=CS_SUCCEED) { -		php3_error(E_WARNING,"Sybase:  Unable to get connection status on close"); +		php_error(E_WARNING,"Sybase:  Unable to get connection status on close");  		/* Assume the worst. */  		con_status = CS_CONSTAT_CONNECTED | CS_CONSTAT_DEAD;  	} @@ -161,7 +161,7 @@ static void _close_sybct_plink(sybct_link *sybct_ptr)  	 */  	if (ct_con_props(sybct_ptr->connection, CS_GET, CS_CON_STATUS,  					 &con_status, CS_UNUSED, NULL)!=CS_SUCCEED) { -		php3_error(E_WARNING,"Sybase:  Unable to get connection status on close"); +		php_error(E_WARNING,"Sybase:  Unable to get connection status on close");  		/* Assume the worst. */  		con_status = CS_CONSTAT_CONNECTED | CS_CONSTAT_DEAD;  	} @@ -181,7 +181,7 @@ static void _close_sybct_plink(sybct_link *sybct_ptr)  static CS_RETCODE _client_message_handler(CS_CONTEXT *context, CS_CONNECTION *connection, CS_CLIENTMSG *errmsg)  {  	if (CS_SEVERITY(errmsg->msgnumber) >= php3_sybct_module.min_client_severity) { -		php3_error(E_WARNING,"Sybase:  Client message:  %s (severity %d)",errmsg->msgstring, CS_SEVERITY(errmsg->msgnumber)); +		php_error(E_WARNING,"Sybase:  Client message:  %s (severity %d)",errmsg->msgstring, CS_SEVERITY(errmsg->msgnumber));  	}  	/* If this is a timeout message, return CS_FAIL to cancel the @@ -202,7 +202,7 @@ static CS_RETCODE _client_message_handler(CS_CONTEXT *context, CS_CONNECTION *co  static CS_RETCODE _server_message_handler(CS_CONTEXT *context, CS_CONNECTION *connection, CS_SERVERMSG *srvmsg)  {  	if (srvmsg->severity >= php3_sybct_module.min_server_severity) { -		php3_error(E_WARNING,"Sybase:  Server message:  %s (severity %d, procedure %s)", +		php_error(E_WARNING,"Sybase:  Server message:  %s (severity %d, procedure %s)",  					srvmsg->text, srvmsg->severity, ((srvmsg->proclen>0) ? srvmsg->proc : "N/A"));  	} @@ -235,10 +235,10 @@ int php3_minit_sybct(INIT_FUNC_ARGS)  	/* Initialize message handlers */  	if (ct_callback(context, NULL, CS_SET, CS_SERVERMSG_CB, (CS_VOID *)_server_message_handler)!=CS_SUCCEED) { -		php3_error(E_WARNING,"Sybase:  Unable to set server message handler"); +		php_error(E_WARNING,"Sybase:  Unable to set server message handler");  	}  	if (ct_callback(context, NULL, CS_SET, CS_CLIENTMSG_CB, (CS_VOID *)_client_message_handler)!=CS_SUCCEED) { -		php3_error(E_WARNING,"Sybase:  Unable to set client message handler"); +		php_error(E_WARNING,"Sybase:  Unable to set client message handler");  	}  	/* Set datetime conversion format to "Nov  3 1998  8:06PM". @@ -250,7 +250,7 @@ int php3_minit_sybct(INIT_FUNC_ARGS)  	{  		CS_INT dt_convfmt = CS_DATES_SHORT;  		if (cs_dt_info(context, CS_SET, NULL, CS_DT_CONVFMT, CS_UNUSED, &dt_convfmt, sizeof(dt_convfmt), NULL)!=CS_SUCCEED) { -			php3_error(E_WARNING,"Sybase:  Unable to set datetime conversion format"); +			php_error(E_WARNING,"Sybase:  Unable to set datetime conversion format");  		}  	} @@ -266,13 +266,13 @@ int php3_minit_sybct(INIT_FUNC_ARGS)  	if (cfg_get_long("sybct.login_timeout",&timeout)==SUCCESS) {  		CS_INT cs_login_timeout = timeout;  		if (ct_config(context, CS_SET, CS_LOGIN_TIMEOUT, &cs_login_timeout, CS_UNUSED, NULL)!=CS_SUCCEED) { -			php3_error(E_WARNING,"Sybase:  Unable to set login timeoutt"); +			php_error(E_WARNING,"Sybase:  Unable to set login timeoutt");  		}  	}  	if (cfg_get_long("sybct.timeout",&timeout)==SUCCESS) {  		CS_INT cs_timeout = timeout;  		if (ct_config(context, CS_SET, CS_TIMEOUT, &cs_timeout, CS_UNUSED, NULL)!=CS_SUCCEED) { -			php3_error(E_WARNING,"Sybase:  Unable to set timeout"); +			php_error(E_WARNING,"Sybase:  Unable to set timeout");  		}  	} @@ -338,13 +338,13 @@ static int _php3_sybct_really_connect(sybct_link *sybct, char *host, char *user,  {  	/* set a CS_CONNECTION record */  	if (ct_con_alloc(context, &sybct->connection)!=CS_SUCCEED) { -		php3_error(E_WARNING,"Sybase:  Unable to allocate connection record"); +		php_error(E_WARNING,"Sybase:  Unable to allocate connection record");  		return 0;  	}  	/* Note - this saves a copy of sybct, not a pointer to it. */  	if (ct_con_props(sybct->connection, CS_SET, CS_USERDATA, &sybct, CS_SIZEOF(sybct), NULL)!=CS_SUCCEED) { -		php3_error(E_WARNING,"Sybase:  Unable to set userdata"); +		php_error(E_WARNING,"Sybase:  Unable to set userdata");  		ct_con_drop(sybct->connection);  		return 0;  	} @@ -366,13 +366,13 @@ static int _php3_sybct_really_connect(sybct_link *sybct, char *host, char *user,  	/* create the link */  	if (ct_connect(sybct->connection, host, CS_NULLTERM)!=CS_SUCCEED) { -		php3_error(E_WARNING,"Sybase:  Unable to connect"); +		php_error(E_WARNING,"Sybase:  Unable to connect");  		ct_con_drop(sybct->connection);  		return 0;  	}  	if (ct_cmd_alloc(sybct->connection,&sybct->cmd)!=CS_SUCCEED) { -		php3_error(E_WARNING,"Sybase:  Unable to allocate command record"); +		php_error(E_WARNING,"Sybase:  Unable to allocate command record");  		ct_close(sybct->connection,CS_UNUSED);  		ct_con_drop(sybct->connection);  		return 0; @@ -459,16 +459,16 @@ static void php3_sybct_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  		list_entry *le;  		/* try to find if we already have this link in our persistent list */ -		if (_php3_hash_find(plist, hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) {  /* we don't */ +		if (zend_hash_find(plist, hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) {  /* we don't */  			list_entry new_le;  			if (php3_sybct_module.max_links!=-1 && php3_sybct_module.num_links>=php3_sybct_module.max_links) { -				php3_error(E_WARNING,"Sybase:  Too many open links (%d)",php3_sybct_module.num_links); +				php_error(E_WARNING,"Sybase:  Too many open links (%d)",php3_sybct_module.num_links);  				efree(hashed_details);  				RETURN_FALSE;  			}  			if (php3_sybct_module.max_persistent!=-1 && php3_sybct_module.num_persistent>=php3_sybct_module.max_persistent) { -				php3_error(E_WARNING,"Sybase:  Too many open persistent links (%d)",php3_sybct_module.num_persistent); +				php_error(E_WARNING,"Sybase:  Too many open persistent links (%d)",php3_sybct_module.num_persistent);  				efree(hashed_details);  				RETURN_FALSE;  			} @@ -483,7 +483,7 @@ static void php3_sybct_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  			/* hash it up */  			new_le.type = php3_sybct_module.le_plink;  			new_le.ptr = sybct_ptr; -			if (_php3_hash_update(plist, hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry),NULL)==FAILURE) { +			if (zend_hash_update(plist, hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry),NULL)==FAILURE) {  				ct_close(sybct_ptr->connection, CS_UNUSED);  				ct_con_drop(sybct_ptr->connection);  				free(sybct_ptr); @@ -506,7 +506,7 @@ static void php3_sybct_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  			if (ct_con_props(sybct_ptr->connection, CS_GET, CS_CON_STATUS,  							 &con_status, CS_UNUSED, NULL)!=CS_SUCCEED) { -				php3_error(E_WARNING,"Sybase:  Unable to get connection status"); +				php_error(E_WARNING,"Sybase:  Unable to get connection status");  				efree(hashed_details);  				RETURN_FALSE;  			} @@ -546,7 +546,7 @@ static void php3_sybct_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  		 * if it doesn't, open a new sybct link, add it to the resource list,  		 * and add a pointer to it with hashed_details as the key.  		 */ -		if (_php3_hash_find(list,hashed_details,hashed_details_length+1,(void **) &index_ptr)==SUCCESS) { +		if (zend_hash_find(list,hashed_details,hashed_details_length+1,(void **) &index_ptr)==SUCCESS) {  			int type,link;  			void *ptr; @@ -562,11 +562,11 @@ static void php3_sybct_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  				efree(hashed_details);  				return;  			} else { -				_php3_hash_del(list,hashed_details,hashed_details_length+1); +				zend_hash_del(list,hashed_details,hashed_details_length+1);  			}  		}  		if (php3_sybct_module.max_links!=-1 && php3_sybct_module.num_links>=php3_sybct_module.max_links) { -			php3_error(E_WARNING,"Sybase:  Too many open links (%d)",php3_sybct_module.num_links); +			php_error(E_WARNING,"Sybase:  Too many open links (%d)",php3_sybct_module.num_links);  			efree(hashed_details);  			RETURN_FALSE;  		} @@ -585,7 +585,7 @@ static void php3_sybct_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  		/* add it to the hash */  		new_index_ptr.ptr = (void *) return_value->value.lval;  		new_index_ptr.type = le_index_ptr; -		if (_php3_hash_update(list,hashed_details,hashed_details_length+1,(void *) &new_index_ptr, sizeof(list_entry),NULL)==FAILURE) { +		if (zend_hash_update(list,hashed_details,hashed_details_length+1,(void *) &new_index_ptr, sizeof(list_entry),NULL)==FAILURE) {  			ct_close(sybct_ptr->connection, CS_UNUSED);  			ct_con_drop(sybct_ptr->connection);  			efree(sybct_ptr); @@ -643,7 +643,7 @@ PHP_FUNCTION(sybct_close)  	php3_list_find(id,&type);  	if (type!=php3_sybct_module.le_link && type!=php3_sybct_module.le_plink) { -		php3_error(E_WARNING,"%d is not a Sybase link index",id); +		php_error(E_WARNING,"%d is not a Sybase link index",id);  		RETURN_FALSE;  	} @@ -757,7 +757,7 @@ PHP_FUNCTION(sybct_select_db)  	sybct_ptr = (sybct_link *) php3_list_find(id,&type);  	if (type!=php3_sybct_module.le_link && type!=php3_sybct_module.le_plink) { -		php3_error(E_WARNING,"%d is not a Sybase link index",id); +		php_error(E_WARNING,"%d is not a Sybase link index",id);  		RETURN_FALSE;  	} @@ -878,7 +878,7 @@ static sybct_result * _php3_sybct_fetch_result_set (sybct_link *sybct_ptr)  			|| retcode==CS_ROW_FAIL) {  		/*  		if (retcode==CS_ROW_FAIL) { -			php3_error(E_WARNING,"Sybase:  Error reading row %d",result->num_rows); +			php_error(E_WARNING,"Sybase:  Error reading row %d",result->num_rows);  		}  		*/  		i = result->num_rows++; @@ -973,7 +973,7 @@ PHP_FUNCTION(sybct_query)  	sybct_ptr = (sybct_link *) php3_list_find(id,&type);  	if (type!=php3_sybct_module.le_link && type!=php3_sybct_module.le_plink) { -		php3_error(E_WARNING,"%d is not a Sybase link index",id); +		php_error(E_WARNING,"%d is not a Sybase link index",id);  		RETURN_FALSE;  	} @@ -1169,7 +1169,7 @@ PHP_FUNCTION(sybct_free_result)  	result = (sybct_result *) php3_list_find(sybct_result_index->value.lval,&type);  	if (type!=php3_sybct_module.le_result) { -		php3_error(E_WARNING,"%d is not a Sybase result index",sybct_result_index->value.lval); +		php_error(E_WARNING,"%d is not a Sybase result index",sybct_result_index->value.lval);  		RETURN_FALSE;  	}  	php3_list_delete(sybct_result_index->value.lval); @@ -1202,7 +1202,7 @@ PHP_FUNCTION(sybct_num_rows)  	result = (sybct_result *) php3_list_find(id,&type);  	if (type!=php3_sybct_module.le_result) { -		php3_error(E_WARNING,"%d is not a Sybase result index",id); +		php_error(E_WARNING,"%d is not a Sybase result index",id);  		RETURN_FALSE;  	}	 @@ -1226,7 +1226,7 @@ PHP_FUNCTION(sybct_num_fields)  	result = (sybct_result *) php3_list_find(id,&type);  	if (type!=php3_sybct_module.le_result) { -		php3_error(E_WARNING,"%d is not a Sybase result index",id); +		php_error(E_WARNING,"%d is not a Sybase result index",id);  		RETURN_FALSE;  	}	 @@ -1251,7 +1251,7 @@ PHP_FUNCTION(sybct_fetch_row)  	result = (sybct_result *) php3_list_find(id,&type);  	if (type!=php3_sybct_module.le_result) { -		php3_error(E_WARNING,"%d is not a Sybase result index",id); +		php_error(E_WARNING,"%d is not a Sybase result index",id);  		RETURN_FALSE;  	} @@ -1265,7 +1265,7 @@ PHP_FUNCTION(sybct_fetch_row)  		*field_content = result->data[result->cur_row][i];  		INIT_PZVAL(field_content);  		pval_copy_constructor(field_content); -		_php3_hash_index_update(return_value->value.ht, i, (void *) &field_content, sizeof(pval* ), NULL); +		zend_hash_index_update(return_value->value.ht, i, (void *) &field_content, sizeof(pval* ), NULL);  	}  	result->cur_row++;  } @@ -1288,7 +1288,7 @@ static PHP_FUNCTION(sybct_fetch_hash)  	result = (sybct_result *) php3_list_find(sybct_result_index->value.lval,&type);  	if (type!=php3_sybct_module.le_result) { -		php3_error(E_WARNING,"%d is not a Sybase result index",sybct_result_index->value.lval); +		php_error(E_WARNING,"%d is not a Sybase result index",sybct_result_index->value.lval);  		RETURN_FALSE;  	} @@ -1308,8 +1308,8 @@ static PHP_FUNCTION(sybct_fetch_hash)  		if (PG(magic_quotes_runtime) && tmp->type == IS_STRING) {  			tmp->value.str.val = _php3_addslashes(tmp->value.str.val,tmp->value.str.len,&tmp->value.str.len,1);  		} -		_php3_hash_index_update(return_value->value.ht, i, (void *) &tmp, sizeof(pval *), NULL); -		_php3_hash_update(return_value->value.ht, result->fields[i].name, strlen(result->fields[i].name)+1, (void *) &tmp, sizeof(pval *), NULL); +		zend_hash_index_update(return_value->value.ht, i, (void *) &tmp, sizeof(pval *), NULL); +		zend_hash_update(return_value->value.ht, result->fields[i].name, strlen(result->fields[i].name)+1, (void *) &tmp, sizeof(pval *), NULL);  	}  	result->cur_row++;  } @@ -1346,13 +1346,13 @@ PHP_FUNCTION(sybct_data_seek)  	result = (sybct_result *) php3_list_find(id,&type);  	if (type!=php3_sybct_module.le_result) { -		php3_error(E_WARNING,"%d is not a Sybase result index",id); +		php_error(E_WARNING,"%d is not a Sybase result index",id);  		RETURN_FALSE;  	}  	convert_to_long(offset);  	if (offset->value.lval<0 || offset->value.lval>=result->num_rows) { -		php3_error(E_WARNING,"Sybase:  Bad row offset"); +		php_error(E_WARNING,"Sybase:  Bad row offset");  		RETURN_FALSE;  	} @@ -1435,7 +1435,7 @@ PHP_FUNCTION(sybct_fetch_field)  	result = (sybct_result *) php3_list_find(id,&type);  	if (type!=php3_sybct_module.le_result) { -		php3_error(E_WARNING,"%d is not a Sybase result index",id); +		php_error(E_WARNING,"%d is not a Sybase result index",id);  		RETURN_FALSE;  	} @@ -1446,7 +1446,7 @@ PHP_FUNCTION(sybct_fetch_field)  	if (field_offset<0 || field_offset >= result->num_fields) {  		if (ARG_COUNT(ht)==2) { /* field specified explicitly */ -			php3_error(E_WARNING,"Sybase:  Bad column offset"); +			php_error(E_WARNING,"Sybase:  Bad column offset");  		}  		RETURN_FALSE;  	} @@ -1477,7 +1477,7 @@ PHP_FUNCTION(sybct_field_seek)  	result = (sybct_result *) php3_list_find(id,&type);  	if (type!=php3_sybct_module.le_result) { -		php3_error(E_WARNING,"%d is not a Sybase result index",id); +		php_error(E_WARNING,"%d is not a Sybase result index",id);  		RETURN_FALSE;  	} @@ -1485,7 +1485,7 @@ PHP_FUNCTION(sybct_field_seek)  	field_offset = offset->value.lval;  	if (field_offset<0 || field_offset >= result->num_fields) { -		php3_error(E_WARNING,"Sybase:  Bad column offset"); +		php_error(E_WARNING,"Sybase:  Bad column offset");  		RETURN_FALSE;  	} @@ -1510,13 +1510,13 @@ PHP_FUNCTION(sybct_result)  	result = (sybct_result *) php3_list_find(id,&type);  	if (type!=php3_sybct_module.le_result) { -		php3_error(E_WARNING,"%d is not a Sybase result index",id); +		php_error(E_WARNING,"%d is not a Sybase result index",id);  		RETURN_FALSE;  	}  	convert_to_long(row);  	if (row->value.lval<0 || row->value.lval>=result->num_rows) { -		php3_error(E_WARNING,"Sybase:  Bad row offset (%d)",row->value.lval); +		php_error(E_WARNING,"Sybase:  Bad row offset (%d)",row->value.lval);  		RETURN_FALSE;  	} @@ -1531,7 +1531,7 @@ PHP_FUNCTION(sybct_result)  				}  			}  			if (i>=result->num_fields) { /* no match found */ -				php3_error(E_WARNING,"Sybase:  %s field not found in result",field->value.str.val); +				php_error(E_WARNING,"Sybase:  %s field not found in result",field->value.str.val);  				RETURN_FALSE;  			}  			break; @@ -1540,7 +1540,7 @@ PHP_FUNCTION(sybct_result)  			convert_to_long(field);  			field_offset = field->value.lval;  			if (field_offset<0 || field_offset>=result->num_fields) { -				php3_error(E_WARNING,"Sybase:  Bad column offset specified"); +				php_error(E_WARNING,"Sybase:  Bad column offset specified");  				RETURN_FALSE;  			}  			break; @@ -1576,7 +1576,7 @@ PHP_FUNCTION(sybct_affected_rows)  	sybct_ptr = (sybct_link *) php3_list_find(id,&type);  	if (type!=php3_sybct_module.le_link && type!=php3_sybct_module.le_plink) { -		php3_error(E_WARNING,"%d is not a Sybase link index",id); +		php_error(E_WARNING,"%d is not a Sybase link index",id);  		RETURN_FALSE;  	} @@ -1601,7 +1601,7 @@ void php3_info_sybct(ZEND_MODULE_INFO_FUNC_ARGS)  		snprintf(maxl,15,"%ld",php3_sybct_module.max_links);  		maxl[15]=0;  	} -	php3_printf("<table cellpadding=5>" +	php_printf("<table cellpadding=5>"  				"<tr><td>Allow persistent links:</td><td>%s</td></tr>\n"  				"<tr><td>Persistent links:</td><td>%d/%s</td></tr>\n"  				"<tr><td>Total links:</td><td>%d/%s</td></tr>\n" diff --git a/ext/sybase/sybase.c b/ext/sybase/sybase.c index 7853cd6a64..c289fc5cc7 100644 --- a/ext/sybase/sybase.c +++ b/ext/sybase/sybase.c @@ -90,7 +90,7 @@ THREAD_LS sybase_module php3_sybase_module;  THREAD_LS static HashTable *resource_list, *resource_plist; -#define CHECK_LINK(link) { if (link==-1) { php3_error(E_WARNING,"Sybase:  A link to the server could not be established"); RETURN_FALSE; } } +#define CHECK_LINK(link) { if (link==-1) { php_error(E_WARNING,"Sybase:  A link to the server could not be established"); RETURN_FALSE; } }  static void php3_sybase_get_column_content(sybase_link *sybase_ptr,int offset,pval *result, int column_type); @@ -100,7 +100,7 @@ static int php3_sybase_error_handler(DBPROCESS *dbproc,int severity,int dberr,  										int oserr,char *dberrstr,char *oserrstr)  {  	if (severity >= php3_sybase_module.min_error_severity) { -		php3_error(E_WARNING,"Sybase error:  %s (severity %d)",dberrstr,severity); +		php_error(E_WARNING,"Sybase error:  %s (severity %d)",dberrstr,severity);  	}  	return INT_CANCEL;    } @@ -111,7 +111,7 @@ static int php3_sybase_message_handler(DBPROCESS *dbproc,DBINT msgno,int msgstat  										char *procname,DBUSMALLINT line)  {  	if (severity >= php3_sybase_module.min_message_severity) { -		php3_error(E_WARNING,"Sybase message:  %s (severity %d)",msgtext,severity); +		php_error(E_WARNING,"Sybase message:  %s (severity %d)",msgtext,severity);  	}  	STR_FREE(php3_sybase_module.server_message);  	php3_sybase_module.server_message = estrdup(msgtext); @@ -160,7 +160,7 @@ static void _free_sybase_result(sybase_result *result)  static void _close_sybase_link(sybase_link *sybase_ptr)  {  	sybase_ptr->valid = 0; -	_php3_hash_apply(resource_list,(int (*)(void *))_clean_invalid_results); +	zend_hash_apply(resource_list,(int (*)(void *))_clean_invalid_results);  	dbclose(sybase_ptr->link);  	dbloginfree(sybase_ptr->login);  	efree(sybase_ptr); @@ -315,7 +315,7 @@ static void php3_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  	/* set a DBLOGIN record */	  	if ((sybase.login=dblogin())==NULL) { -		php3_error(E_WARNING,"Sybase:  Unable to allocate login record"); +		php_error(E_WARNING,"Sybase:  Unable to allocate login record");  		RETURN_FALSE;  	} @@ -335,24 +335,24 @@ static void php3_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  		list_entry *le;  		/* try to find if we already have this link in our persistent list */ -		if (_php3_hash_find(plist, hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) {  /* we don't */ +		if (zend_hash_find(plist, hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) {  /* we don't */  			list_entry new_le;  			if (php3_sybase_module.max_links!=-1 && php3_sybase_module.num_links>=php3_sybase_module.max_links) { -				php3_error(E_WARNING,"Sybase:  Too many open links (%d)",php3_sybase_module.num_links); +				php_error(E_WARNING,"Sybase:  Too many open links (%d)",php3_sybase_module.num_links);  				efree(hashed_details);  				dbloginfree(sybase.login);  				RETURN_FALSE;  			}  			if (php3_sybase_module.max_persistent!=-1 && php3_sybase_module.num_persistent>=php3_sybase_module.max_persistent) { -				php3_error(E_WARNING,"Sybase:  Too many open persistent links (%d)",php3_sybase_module.num_persistent); +				php_error(E_WARNING,"Sybase:  Too many open persistent links (%d)",php3_sybase_module.num_persistent);  				efree(hashed_details);  				dbloginfree(sybase.login);  				RETURN_FALSE;  			}  			/* create the link */  			if ((sybase.link=dbopen(sybase.login,host))==FAIL) { -				/*php3_error(E_WARNING,"Sybase:  Unable to connect to server:  %s",sybase_error(sybase));*/ +				/*php_error(E_WARNING,"Sybase:  Unable to connect to server:  %s",sybase_error(sybase));*/  				efree(hashed_details);  				dbloginfree(sybase.login);  				RETURN_FALSE; @@ -370,7 +370,7 @@ static void php3_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  			memcpy(sybase_ptr,&sybase,sizeof(sybase_link));  			new_le.type = php3_sybase_module.le_plink;  			new_le.ptr = sybase_ptr; -			if (_php3_hash_update(plist, hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry),NULL)==FAILURE) { +			if (zend_hash_update(plist, hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry),NULL)==FAILURE) {  				free(sybase_ptr);  				efree(hashed_details);  				dbloginfree(sybase.login); @@ -380,7 +380,7 @@ static void php3_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  			php3_sybase_module.num_links++;  		} else {  /* we do */  			if (le->type != php3_sybase_module.le_plink) { -				php3_error(E_WARNING,"Sybase:  Hashed persistent link is not a Sybase link!"); +				php_error(E_WARNING,"Sybase:  Hashed persistent link is not a Sybase link!");  				RETURN_FALSE;  			} @@ -388,13 +388,13 @@ static void php3_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  			/* test that the link hasn't died */  			if (DBDEAD(sybase_ptr->link)==TRUE) {  				if ((sybase_ptr->link=dbopen(sybase_ptr->login,host))==FAIL) { -					/*php3_error(E_WARNING,"Sybase:  Link to server lost, unable to reconnect");*/ -					_php3_hash_del(plist, hashed_details, hashed_details_length+1); +					/*php_error(E_WARNING,"Sybase:  Link to server lost, unable to reconnect");*/ +					zend_hash_del(plist, hashed_details, hashed_details_length+1);  					efree(hashed_details);  					RETURN_FALSE;  				}  				if (dbsetopt(sybase_ptr->link,DBBUFFER,"2",-1)==FAIL) { -					_php3_hash_del(plist, hashed_details, hashed_details_length+1); +					zend_hash_del(plist, hashed_details, hashed_details_length+1);  					efree(hashed_details);  					RETURN_FALSE;  				} @@ -410,7 +410,7 @@ static void php3_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  		 * if it doesn't, open a new sybase link, add it to the resource list,  		 * and add a pointer to it with hashed_details as the key.  		 */ -		if (_php3_hash_find(list,hashed_details,hashed_details_length+1,(void **) &index_ptr)==SUCCESS) { +		if (zend_hash_find(list,hashed_details,hashed_details_length+1,(void **) &index_ptr)==SUCCESS) {  			int type,link;  			void *ptr; @@ -425,17 +425,17 @@ static void php3_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  				efree(hashed_details);  				return;  			} else { -				_php3_hash_del(list,hashed_details,hashed_details_length+1); +				zend_hash_del(list,hashed_details,hashed_details_length+1);  			}  		}  		if (php3_sybase_module.max_links!=-1 && php3_sybase_module.num_links>=php3_sybase_module.max_links) { -			php3_error(E_WARNING,"Sybase:  Too many open links (%d)",php3_sybase_module.num_links); +			php_error(E_WARNING,"Sybase:  Too many open links (%d)",php3_sybase_module.num_links);  			efree(hashed_details);  			RETURN_FALSE;  		}  		if ((sybase.link=dbopen(sybase.login,host))==NULL) { -			/*php3_error(E_WARNING,"Sybase:  Unable to connect to server:  %s",sybase_error(sybase));*/ +			/*php_error(E_WARNING,"Sybase:  Unable to connect to server:  %s",sybase_error(sybase));*/  			efree(hashed_details);  			RETURN_FALSE;  		} @@ -456,7 +456,7 @@ static void php3_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)  		/* add it to the hash */  		new_index_ptr.ptr = (void *) return_value->value.lval;  		new_index_ptr.type = le_index_ptr; -		if (_php3_hash_update(list,hashed_details,hashed_details_length+1,(void *) &new_index_ptr, sizeof(list_entry),NULL)==FAILURE) { +		if (zend_hash_update(list,hashed_details,hashed_details_length+1,(void *) &new_index_ptr, sizeof(list_entry),NULL)==FAILURE) {  			efree(hashed_details);  			RETURN_FALSE;  		} @@ -511,7 +511,7 @@ PHP_FUNCTION(sybase_close)  	php3_list_find(id,&type);  	if (type!=php3_sybase_module.le_link && type!=php3_sybase_module.le_plink) { -		php3_error(E_WARNING,"%d is not a Sybase link index",id); +		php_error(E_WARNING,"%d is not a Sybase link index",id);  		RETURN_FALSE;  	} @@ -549,14 +549,14 @@ PHP_FUNCTION(sybase_select_db)  	sybase_ptr = (sybase_link *) php3_list_find(id,&type);  	if (type!=php3_sybase_module.le_link && type!=php3_sybase_module.le_plink) { -		php3_error(E_WARNING,"%d is not a Sybase link index",id); +		php_error(E_WARNING,"%d is not a Sybase link index",id);  		RETURN_FALSE;  	}  	convert_to_string(db);  	if (dbuse(sybase_ptr->link,db->value.str.val)==FAIL) { -		/*php3_error(E_WARNING,"Sybase:  Unable to select database:  %s",sybase_error(sybase));*/ +		/*php_error(E_WARNING,"Sybase:  Unable to select database:  %s",sybase_error(sybase));*/  		RETURN_FALSE;  	} else {  		RETURN_TRUE; @@ -634,7 +634,7 @@ static void php3_sybase_get_column_content(sybase_link *sybase_ptr,int offset,pv  				result->value.str.val = res_buf;  				result->type = IS_STRING;  			} else { -				php3_error(E_WARNING,"Sybase:  column %d has unknown data type (%d)", offset, coltype(offset)); +				php_error(E_WARNING,"Sybase:  column %d has unknown data type (%d)", offset, coltype(offset));  				var_reset(result);  			}  		} @@ -674,17 +674,17 @@ PHP_FUNCTION(sybase_query)  	sybase_ptr = (sybase_link *) php3_list_find(id,&type);  	if (type!=php3_sybase_module.le_link && type!=php3_sybase_module.le_plink) { -		php3_error(E_WARNING,"%d is not a Sybase link index",id); +		php_error(E_WARNING,"%d is not a Sybase link index",id);  		RETURN_FALSE;  	}  	convert_to_string(query);  	if (dbcmd(sybase_ptr->link,query->value.str.val)==FAIL) { -		/*php3_error(E_WARNING,"Sybase:  Unable to set query");*/ +		/*php_error(E_WARNING,"Sybase:  Unable to set query");*/  		RETURN_FALSE;  	}  	if (dbsqlexec(sybase_ptr->link)==FAIL || dbresults(sybase_ptr->link)==FAIL) { -		/*php3_error(E_WARNING,"Sybase:  Query failed");*/ +		/*php_error(E_WARNING,"Sybase:  Query failed");*/  		RETURN_FALSE;  	} @@ -796,7 +796,7 @@ PHP_FUNCTION(sybase_free_result)  	result = (sybase_result *) php3_list_find(sybase_result_index->value.lval,&type);  	if (type!=php3_sybase_module.le_result) { -		php3_error(E_WARNING,"%d is not a Sybase result index",sybase_result_index->value.lval); +		php_error(E_WARNING,"%d is not a Sybase result index",sybase_result_index->value.lval);  		RETURN_FALSE;  	}  	php3_list_delete(sybase_result_index->value.lval); @@ -825,7 +825,7 @@ PHP_FUNCTION(sybase_num_rows)  	result = (sybase_result *) php3_list_find(id,&type);  	if (type!=php3_sybase_module.le_result) { -		php3_error(E_WARNING,"%d is not a Sybase result index",id); +		php_error(E_WARNING,"%d is not a Sybase result index",id);  		RETURN_FALSE;  	}	 @@ -849,7 +849,7 @@ PHP_FUNCTION(sybase_num_fields)  	result = (sybase_result *) php3_list_find(id,&type);  	if (type!=php3_sybase_module.le_result) { -		php3_error(E_WARNING,"%d is not a Sybase result index",id); +		php_error(E_WARNING,"%d is not a Sybase result index",id);  		RETURN_FALSE;  	}	 @@ -874,7 +874,7 @@ PHP_FUNCTION(sybase_fetch_row)  	result = (sybase_result *) php3_list_find(id,&type);  	if (type!=php3_sybase_module.le_result) { -		php3_error(E_WARNING,"%d is not a Sybase result index",id); +		php_error(E_WARNING,"%d is not a Sybase result index",id);  		RETURN_FALSE;  	} @@ -887,7 +887,7 @@ PHP_FUNCTION(sybase_fetch_row)  		MAKE_STD_ZVAL(field_content);  		*field_content = result->data[result->cur_row][i];  		pval_copy_constructor(field_content); -		_php3_hash_index_update(return_value->value.ht, i, (void *) &field_content, sizeof(pval *), NULL); +		zend_hash_index_update(return_value->value.ht, i, (void *) &field_content, sizeof(pval *), NULL);  	}  	result->cur_row++;  } @@ -909,7 +909,7 @@ static PHP_FUNCTION(sybase_fetch_hash)  	result = (sybase_result *) php3_list_find(sybase_result_index->value.lval,&type);  	if (type!=php3_sybase_module.le_result) { -		php3_error(E_WARNING,"%d is not a Sybase result index",sybase_result_index->value.lval); +		php_error(E_WARNING,"%d is not a Sybase result index",sybase_result_index->value.lval);  		RETURN_FALSE;  	} @@ -928,9 +928,9 @@ static PHP_FUNCTION(sybase_fetch_hash)  		if (PG(magic_quotes_runtime) && tmp->type == IS_STRING) {  			tmp->value.str.val = _php3_addslashes(tmp->value.str.val,tmp->value.str.len,&tmp->value.str.len,1);  		} -		_php3_hash_index_update(return_value->value.ht, i, (void *) &tmp, sizeof(pval *), NULL); +		zend_hash_index_update(return_value->value.ht, i, (void *) &tmp, sizeof(pval *), NULL);  		tmp->refcount++; -		_php3_hash_update(return_value->value.ht, result->fields[i].name, strlen(result->fields[i].name)+1, (void *) &tmp, sizeof(pval  *), NULL); +		zend_hash_update(return_value->value.ht, result->fields[i].name, strlen(result->fields[i].name)+1, (void *) &tmp, sizeof(pval  *), NULL);  	}  	result->cur_row++;  } @@ -967,13 +967,13 @@ PHP_FUNCTION(sybase_data_seek)  	result = (sybase_result *) php3_list_find(id,&type);  	if (type!=php3_sybase_module.le_result) { -		php3_error(E_WARNING,"%d is not a Sybase result index",id); +		php_error(E_WARNING,"%d is not a Sybase result index",id);  		RETURN_FALSE;  	}  	convert_to_long(offset);  	if (offset->value.lval<0 || offset->value.lval>=result->num_rows) { -		php3_error(E_WARNING,"Sybase:  Bad row offset"); +		php_error(E_WARNING,"Sybase:  Bad row offset");  		RETURN_FALSE;  	} @@ -1059,7 +1059,7 @@ PHP_FUNCTION(sybase_fetch_field)  	result = (sybase_result *) php3_list_find(id,&type);  	if (type!=php3_sybase_module.le_result) { -		php3_error(E_WARNING,"%d is not a Sybase result index",id); +		php_error(E_WARNING,"%d is not a Sybase result index",id);  		RETURN_FALSE;  	} @@ -1070,7 +1070,7 @@ PHP_FUNCTION(sybase_fetch_field)  	if (field_offset<0 || field_offset >= result->num_fields) {  		if (ARG_COUNT(ht)==2) { /* field specified explicitly */ -			php3_error(E_WARNING,"Sybase:  Bad column offset"); +			php_error(E_WARNING,"Sybase:  Bad column offset");  		}  		RETURN_FALSE;  	} @@ -1100,7 +1100,7 @@ PHP_FUNCTION(sybase_field_seek)  	result = (sybase_result *) php3_list_find(id,&type);  	if (type!=php3_sybase_module.le_result) { -		php3_error(E_WARNING,"%d is not a Sybase result index",id); +		php_error(E_WARNING,"%d is not a Sybase result index",id);  		RETURN_FALSE;  	} @@ -1108,7 +1108,7 @@ PHP_FUNCTION(sybase_field_seek)  	field_offset = offset->value.lval;  	if (field_offset<0 || field_offset >= result->num_fields) { -		php3_error(E_WARNING,"Sybase:  Bad column offset"); +		php_error(E_WARNING,"Sybase:  Bad column offset");  		RETURN_FALSE;  	} @@ -1133,13 +1133,13 @@ PHP_FUNCTION(sybase_result)  	result = (sybase_result *) php3_list_find(id,&type);  	if (type!=php3_sybase_module.le_result) { -		php3_error(E_WARNING,"%d is not a Sybase result index",id); +		php_error(E_WARNING,"%d is not a Sybase result index",id);  		RETURN_FALSE;  	}  	convert_to_long(row);  	if (row->value.lval<0 || row->value.lval>=result->num_rows) { -		php3_error(E_WARNING,"Sybase:  Bad row offset (%d)",row->value.lval); +		php_error(E_WARNING,"Sybase:  Bad row offset (%d)",row->value.lval);  		RETURN_FALSE;  	} @@ -1154,7 +1154,7 @@ PHP_FUNCTION(sybase_result)  				}  			}  			if (i>=result->num_fields) { /* no match found */ -				php3_error(E_WARNING,"Sybase:  %s field not found in result",field->value.str.val); +				php_error(E_WARNING,"Sybase:  %s field not found in result",field->value.str.val);  				RETURN_FALSE;  			}  			break; @@ -1163,7 +1163,7 @@ PHP_FUNCTION(sybase_result)  			convert_to_long(field);  			field_offset = field->value.lval;  			if (field_offset<0 || field_offset>=result->num_fields) { -				php3_error(E_WARNING,"Sybase:  Bad column offset specified"); +				php_error(E_WARNING,"Sybase:  Bad column offset specified");  				RETURN_FALSE;  			}  			break; @@ -1190,7 +1190,7 @@ void php3_info_sybase(ZEND_MODULE_INFO_FUNC_ARGS)  		snprintf(maxl,15,"%ld",php3_sybase_module.max_links);  		maxl[15]=0;  	} -	php3_printf("<table cellpadding=5>" +	php_printf("<table cellpadding=5>"  				"<tr><td>Allow persistent links:</td><td>%s</td></tr>\n"  				"<tr><td>Persistent links:</td><td>%d/%s</td></tr>\n"  				"<tr><td>Total links:</td><td>%d/%s</td></tr>\n" diff --git a/ext/sysvsem/sysvsem.c b/ext/sysvsem/sysvsem.c index e7eda3dcbe..05c6a8b5e4 100644 --- a/ext/sysvsem/sysvsem.c +++ b/ext/sysvsem/sysvsem.c @@ -100,14 +100,14 @@ static void release_sysvsem_sem(sysvsem_sem *sem_ptr)  	/* Release the semaphore if it has been acquired but not released. */  	if (sem_ptr->count) { -		php3_error(E_WARNING, "Releasing SysV semaphore id %d key 0x%x in request cleanup", sem_ptr->id, sem_ptr->key); +		php_error(E_WARNING, "Releasing SysV semaphore id %d key 0x%x in request cleanup", sem_ptr->id, sem_ptr->key);  		sop[1].sem_num = SYSVSEM_SEM;  		sop[1].sem_op  = sem_ptr->count;  		sop[1].sem_flg = SEM_UNDO;  	}  	if (semop(sem_ptr->semid, sop, sem_ptr->count ? 2 : 1) == -1) { -		php3_error(E_WARNING, "semop() failed in release_sysvsem_sem for key 0x%x: %s", sem_ptr->key, strerror(errno)); +		php_error(E_WARNING, "semop() failed in release_sysvsem_sem for key 0x%x: %s", sem_ptr->key, strerror(errno));  	}  	efree(sem_ptr); @@ -180,7 +180,7 @@ PHP_FUNCTION(sysvsem_get)      semid = semget(key, 3, perm|IPC_CREAT);  	if (semid == -1) { -		php3_error(E_WARNING, "semget() failed for key 0x%x: %s", key, strerror(errno)); +		php_error(E_WARNING, "semget() failed for key 0x%x: %s", key, strerror(errno));  		RETURN_FALSE;  	} @@ -212,7 +212,7 @@ PHP_FUNCTION(sysvsem_get)  	sop[2].sem_flg = SEM_UNDO;  	while (semop(semid, sop, 3) == -1) {  		if (errno != EINTR) { -			php3_error(E_WARNING, "semop() failed acquiring SYSVSEM_SETVAL for key 0x%x: %s", key, strerror(errno)); +			php_error(E_WARNING, "semop() failed acquiring SYSVSEM_SETVAL for key 0x%x: %s", key, strerror(errno));  			break;  		}  	} @@ -224,7 +224,7 @@ PHP_FUNCTION(sysvsem_get)  	count = semctl(semid, SYSVSEM_USAGE, GETVAL, NULL);  #endif  	if (count == -1) { -		php3_error(E_WARNING, "semctl(GETVAL) failed for key 0x%x: %s", key, strerror(errno)); +		php_error(E_WARNING, "semctl(GETVAL) failed for key 0x%x: %s", key, strerror(errno));  	}  	/* If we are the only user, then take this opportunity to set the max. */ @@ -235,12 +235,12 @@ PHP_FUNCTION(sysvsem_get)  		union semun semarg;  		semarg.val = max_acquire;  		if (semctl(semid, SYSVSEM_SEM, SETVAL, semarg) == -1) { -			php3_error(E_WARNING, "semctl(SETVAL) failed for key 0x%x: %s", key, strerror(errno)); +			php_error(E_WARNING, "semctl(SETVAL) failed for key 0x%x: %s", key, strerror(errno));  		}  #else  		/* This is correct for Solaris 2.6 which does not have union semun. */  		if (semctl(semid, SYSVSEM_SEM, SETVAL, &max_acquire) == -1) { -			php3_error(E_WARNING, "semctl(SETVAL) failed for key 0x%x: %s", key, strerror(errno)); +			php_error(E_WARNING, "semctl(SETVAL) failed for key 0x%x: %s", key, strerror(errno));  		}  #endif  	} @@ -252,7 +252,7 @@ PHP_FUNCTION(sysvsem_get)  	sop[0].sem_flg = SEM_UNDO;  	while (semop(semid, sop, 1) == -1) {  		if (errno != EINTR) { -			php3_error(E_WARNING, "semop() failed releasing SYSVSEM_SETVAL for key 0x%x: %s", key, strerror(errno)); +			php_error(E_WARNING, "semop() failed releasing SYSVSEM_SETVAL for key 0x%x: %s", key, strerror(errno));  			break;  		}  	} @@ -291,12 +291,12 @@ static void _php3_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire)  	sem_ptr = (sysvsem_sem *) php3_list_find(id, &type);  	if (type!=php3_sysvsem_module.le_sem) { -		php3_error(E_WARNING, "%d is not a SysV semaphore index", id); +		php_error(E_WARNING, "%d is not a SysV semaphore index", id);  		RETURN_FALSE;  	}  	if (!acquire && sem_ptr->count == 0) { -		php3_error(E_WARNING, "SysV semaphore index %d (key 0x%x) is not currently acquired", id, sem_ptr->key); +		php_error(E_WARNING, "SysV semaphore index %d (key 0x%x) is not currently acquired", id, sem_ptr->key);  		RETURN_FALSE;  	} @@ -306,7 +306,7 @@ static void _php3_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire)      while (semop(sem_ptr->semid, &sop, 1) == -1) {  		if (errno != EINTR) { -			php3_error(E_WARNING, "semop(%s) failed for key 0x%x: %s", +			php_error(E_WARNING, "semop(%s) failed for key 0x%x: %s",  					   acquire ? "acquire" : "release",  sem_ptr->key, strerror(errno));  			RETURN_FALSE;  		} diff --git a/ext/sysvshm/sysvshm.c b/ext/sysvshm/sysvshm.c index e6952f03c7..44d8b3128a 100644 --- a/ext/sysvshm/sysvshm.c +++ b/ext/sysvshm/sysvshm.c @@ -123,24 +123,24 @@ PHP_FUNCTION(sysvshm_attach)  	if((shm_list_ptr = (sysvshm_shm *) emalloc(sizeof(sysvshm_shm)))==NULL) { -		php3_error(E_WARNING, "shm_attach() failed for key 0x%x: cannot allocate internal listelement", shm_key); +		php_error(E_WARNING, "shm_attach() failed for key 0x%x: cannot allocate internal listelement", shm_key);  		RETURN_FALSE;  	}  	/* get the id from a specified key or create new shared memory */  	if((shm_id=shmget(shm_key,0,0))<0) {  		if(shm_size<sizeof(sysvshm_chunk_head)) { -			php3_error(E_WARNING, "shm_attach() failed for key 0x%x: memorysize too small", shm_key); +			php_error(E_WARNING, "shm_attach() failed for key 0x%x: memorysize too small", shm_key);  			RETURN_FALSE;  		}  		if((shm_id=shmget(shm_key,shm_size,shm_flag|IPC_CREAT|IPC_EXCL))<0) { -			php3_error(E_WARNING, "shmget() failed for key 0x%x: %s", shm_key, strerror(errno)); +			php_error(E_WARNING, "shmget() failed for key 0x%x: %s", shm_key, strerror(errno));  			RETURN_FALSE;  		}  	}  	if((shm_ptr = shmat(shm_id,NULL,0))==NULL) { -		php3_error(E_WARNING, "shmget() failed for key 0x%x: %s", shm_key, strerror(errno)); +		php_error(E_WARNING, "shmget() failed for key 0x%x: %s", shm_key, strerror(errno));  		RETURN_FALSE;  	} @@ -190,12 +190,12 @@ PHP_FUNCTION(sysvshm_detach)  	shm_list_ptr = (sysvshm_shm *) php3_list_find(id, &type);  	if (type!=php3_sysvshm_module.le_shm) { -		php3_error(E_WARNING, "%d is not a SysV shared memory index", id); +		php_error(E_WARNING, "%d is not a SysV shared memory index", id);  		RETURN_FALSE;  	}  	if(shmdt((void*)shm_list_ptr->ptr)<0) { -		php3_error(E_WARNING, "shm_detach() failed for id 0x%x: %s", id, strerror(errno)); +		php_error(E_WARNING, "shm_detach() failed for id 0x%x: %s", id, strerror(errno));  		RETURN_FALSE;  	}  } @@ -229,11 +229,11 @@ PHP_FUNCTION(sysvshm_remove)  	if((id=shmget(key,0,0))<0) { -		php3_error(E_WARNING, "%d is not a existing SysV shared memory key", key); +		php_error(E_WARNING, "%d is not a existing SysV shared memory key", key);  		RETURN_FALSE;  	}  	if(shmctl(id,IPC_RMID,NULL)<0) { -		php3_error(E_WARNING, "shm_remove() failed for key 0x%x: %s", key, strerror(errno)); +		php_error(E_WARNING, "shm_remove() failed for key 0x%x: %s", key, strerror(errno));  		RETURN_FALSE;  	}   	RETURN_TRUE; @@ -270,7 +270,7 @@ PHP_FUNCTION(sysvshm_put_var)  	shm_list_ptr = (sysvshm_shm *) php3_list_find(id, &type);  	if (type!=php3_sysvshm_module.le_shm) { -		php3_error(E_WARNING, "%d is not a SysV shared memory index", id); +		php_error(E_WARNING, "%d is not a SysV shared memory index", id);  		RETURN_FALSE;  	} @@ -287,7 +287,7 @@ PHP_FUNCTION(sysvshm_put_var)  	efree(shm_var.value.str.val);  	if(ret==-1) { -		php3_error(E_WARNING, "not enough shared memory left"); +		php_error(E_WARNING, "not enough shared memory left");  		RETURN_FALSE;  	}  	RETURN_TRUE; @@ -326,7 +326,7 @@ PHP_FUNCTION(sysvshm_get_var)  	shm_list_ptr = (sysvshm_shm *) php3_list_find(id, &type);  	if (type!=php3_sysvshm_module.le_shm) { -		php3_error(E_WARNING, "%d is not a SysV shared memory index", id); +		php_error(E_WARNING, "%d is not a SysV shared memory index", id);  		RETURN_FALSE;  	} @@ -335,14 +335,14 @@ PHP_FUNCTION(sysvshm_get_var)  	shm_varpos=php3int_check_shmdata((shm_list_ptr->ptr),key);  	if(shm_varpos<0) { -		php3_error(E_WARNING, "variable key %d doesn't exist", key); +		php_error(E_WARNING, "variable key %d doesn't exist", key);  		RETURN_FALSE;  	}  	shm_var=(sysvshm_chunk*)((char*)shm_list_ptr->ptr+shm_varpos);  	shm_data=&shm_var->mem;  	if(php3api_var_unserialize(return_value, &shm_data, shm_data+shm_var->length)!=1) { -		php3_error(E_WARNING, "variable data in shared memory is corruped"); +		php_error(E_WARNING, "variable data in shared memory is corruped");  		RETURN_FALSE;  	}  } @@ -375,14 +375,14 @@ PHP_FUNCTION(sysvshm_remove_var)  	shm_list_ptr = (sysvshm_shm *) php3_list_find(id, &type);  	if (type!=php3_sysvshm_module.le_shm) { -		php3_error(E_WARNING, "%d is not a SysV shared memory index", id); +		php_error(E_WARNING, "%d is not a SysV shared memory index", id);  		RETURN_FALSE;  	}  	shm_varpos=php3int_check_shmdata((shm_list_ptr->ptr),key);  	if(shm_varpos<0) { -		php3_error(E_WARNING, "variable key %d doesn't exist", key); +		php_error(E_WARNING, "variable key %d doesn't exist", key);  		RETURN_FALSE;  	}  	php3int_remove_shmdata((shm_list_ptr->ptr),shm_varpos);	 diff --git a/ext/xml/php3_xml.h b/ext/xml/php3_xml.h index 5016848c8e..5049a11219 100644 --- a/ext/xml/php3_xml.h +++ b/ext/xml/php3_xml.h @@ -93,7 +93,7 @@ enum php3_xml_option {  };  # define RETURN_OUT_OF_MEMORY \ -	php3_error(E_WARNING, "Out of memory");\ +	php_error(E_WARNING, "Out of memory");\  	RETURN_FALSE  /* for xml_parse_into_struct */ diff --git a/ext/xml/xml.c b/ext/xml/xml.c index b270adc1ea..4018e0986f 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -342,7 +342,7 @@ xml_get_parser(int parser_ind, const char *func, HashTable *list)  	parser = (xml_parser *)php3_list_find(parser_ind, &type);  	if (!parser || type != XML_GLOBAL(php3_xml_module).le_xml_parser) { -		php3_error(E_WARNING, "%s: invalid XML parser %d", func, parser_ind); +		php_error(E_WARNING, "%s: invalid XML parser %d", func, parser_ind);  		return (xml_parser *)NULL;  	}  	return parser; @@ -664,16 +664,16 @@ static void php3i_add_to_info(xml_parser *parser,char *name)  		return;  	} -	if (_php3_hash_find(parser->info->value.ht,name,strlen(name) + 1,(void **) &element) == FAILURE) { +	if (zend_hash_find(parser->info->value.ht,name,strlen(name) + 1,(void **) &element) == FAILURE) {  		values = emalloc(sizeof(pval));  		if (array_init(values) == FAILURE) { -			php3_error(E_ERROR, "Unable to initialize array"); +			php_error(E_ERROR, "Unable to initialize array");  			return;  		}  		INIT_PZVAL(values); -		_php3_hash_update(parser->info->value.ht, name, strlen(name)+1, (void *) &values, sizeof(pval*), (void **) &element); +		zend_hash_update(parser->info->value.ht, name, strlen(name)+1, (void *) &values, sizeof(pval*), (void **) &element);  	}   	add_next_index_long(*element,parser->curtag); @@ -774,13 +774,13 @@ void php3i_xml_startElementHandler(void *userData, const char *name,  			}  			if (atcnt) { -				_php3_hash_add(tag->value.ht,"attributes",sizeof("attributes"),&atr,sizeof(pval*),NULL); +				zend_hash_add(tag->value.ht,"attributes",sizeof("attributes"),&atr,sizeof(pval*),NULL);  			} else {  				php3tls_pval_destructor(atr);  				efree(atr);  			} -			_php3_hash_next_index_insert(parser->data->value.ht,&tag,sizeof(pval*),(void *) &parser->ctag); +			zend_hash_next_index_insert(parser->data->value.ht,&tag,sizeof(pval*),(void *) &parser->ctag);  		}  		if (parser->case_folding) { @@ -831,7 +831,7 @@ void php3i_xml_endElementHandler(void *userData, const char *name)  				add_assoc_string(tag,"type","close",1);  				add_assoc_long(tag,"level",parser->level); -				_php3_hash_next_index_insert(parser->data->value.ht,&tag,sizeof(pval*),NULL); +				zend_hash_next_index_insert(parser->data->value.ht,&tag,sizeof(pval*),NULL);  			}  			parser->lastwasopen = 0; @@ -906,7 +906,7 @@ void php3i_xml_characterDataHandler(void *userData, const XML_Char *s, int len)  					add_assoc_string(tag,"type","cdata",1);  					add_assoc_long(tag,"level",parser->level); -					_php3_hash_next_index_insert(parser->data->value.ht,&tag,sizeof(pval*),NULL); +					zend_hash_next_index_insert(parser->data->value.ht,&tag,sizeof(pval*),NULL);  				}  			} else {  				efree(decoded_value); @@ -1086,7 +1086,7 @@ PHP_FUNCTION(xml_parser_create)  						encodingArg->value.str.len) == 0) {  			encoding = "US-ASCII";  		} else { /* UTF-16 not supported */ -			php3_error(E_WARNING, "%s: unsupported source encoding \"%s\"", +			php_error(E_WARNING, "%s: unsupported source encoding \"%s\"",  					   thisfunc, encodingArg->value.str.val);  			RETURN_FALSE;  		} @@ -1315,7 +1315,7 @@ PHP_FUNCTION(xml_parse_into_struct)  	argc = ARG_COUNT(ht);  	if (getParameters(ht, 4, &pind, &data, &xdata,&info) == SUCCESS) {  		if (!ParameterPassedByReference(ht, 4)) { -			php3_error(E_WARNING, "Array to be filled with values must be passed by reference."); +			php_error(E_WARNING, "Array to be filled with values must be passed by reference.");              RETURN_FALSE;  		}  		array_init(info); @@ -1324,7 +1324,7 @@ PHP_FUNCTION(xml_parse_into_struct)  	}  	if (!ParameterPassedByReference(ht, 3)) { -		php3_error(E_WARNING, "Array to be filled with values must be passed by reference."); +		php_error(E_WARNING, "Array to be filled with values must be passed by reference.");  		RETURN_FALSE;  	} @@ -1504,7 +1504,7 @@ PHP_FUNCTION(xml_parser_set_option)  		case PHP3_XML_OPTION_TARGET_ENCODING: {  			xml_encoding *enc = xml_get_encoding(val->value.str.val);  			if (enc == NULL) { -				php3_error(E_WARNING, "%s: unsupported target encoding \"%s\"", +				php_error(E_WARNING, "%s: unsupported target encoding \"%s\"",  						   thisfunc, val->value.str.val);  				RETURN_FALSE;  			} @@ -1512,7 +1512,7 @@ PHP_FUNCTION(xml_parser_set_option)  			break;  		}  		default: -			php3_error(E_WARNING, "%s: unknown option", thisfunc); +			php_error(E_WARNING, "%s: unknown option", thisfunc);  			RETURN_FALSE;  			break;  	} @@ -1546,7 +1546,7 @@ PHP_FUNCTION(xml_parser_get_option)  			RETURN_STRING(parser->target_encoding, 1);  			break;  		default: -			php3_error(E_WARNING, "%s: unknown option", thisfunc); +			php_error(E_WARNING, "%s: unknown option", thisfunc);  			RETURN_FALSE;  			break;  	} diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 4e3fc1ec61..3ddb427d3d 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -70,7 +70,7 @@  #include "dl/phpdl.h"  #endif  #ifndef PUTS -#define PUTS(a) php3_printf("%s",a) +#define PUTS(a) php_printf("%s",a)  #endif  #ifndef PUTC  #define PUTC(a) PUTS(a) @@ -333,7 +333,7 @@ PHP_FUNCTION(gzfile) {  	zp = php3_gzopen_wrapper(filename->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE);  	if (!zp) { -		php3_error(E_WARNING,"gzFile(\"%s\") - %s",filename->value.str.val,strerror(errno)); +		php_error(E_WARNING,"gzFile(\"%s\") - %s",filename->value.str.val,strerror(errno));  		RETURN_FALSE;  	} @@ -394,7 +394,7 @@ PHP_FUNCTION(gzopen) {  	 */  	zp = php3_gzopen_wrapper(arg1->value.str.val, p, use_include_path|ENFORCE_SAFE_MODE);  	if (!zp) { -		php3_error(E_WARNING,"gzopen(\"%s\",\"%s\") - %s", +		php_error(E_WARNING,"gzopen(\"%s\",\"%s\") - %s",  					arg1->value.str.val, p, strerror(errno));  		efree(p);  		RETURN_FALSE; @@ -421,7 +421,7 @@ PHP_FUNCTION(gzclose) {  	id=arg1->value.lval;  	zp = php3_list_find(id,&type);  	if (!zp || (type!=ZLIB_GLOBAL(le_zp))) { -		php3_error(E_WARNING,"Unable to find gz-file identifier %d",id); +		php_error(E_WARNING,"Unable to find gz-file identifier %d",id);  		RETURN_FALSE;  	}  	php3_list_delete(id); @@ -444,7 +444,7 @@ PHP_FUNCTION(gzeof) {  	id = arg1->value.lval;  	zp = php3_list_find(id,&type);  	if ((!zp || (type!=ZLIB_GLOBAL(le_zp)))) { -		php3_error(E_WARNING,"Unable to find gz-file identifier %d",id); +		php_error(E_WARNING,"Unable to find gz-file identifier %d",id);  		/* we're at the eof if the file doesn't exist */  		RETURN_TRUE;  	} @@ -475,7 +475,7 @@ PHP_FUNCTION(gzgets) {  	zp = php3_list_find(id,&type);  	if (!zp || (type!=ZLIB_GLOBAL(le_zp)))  { -		php3_error(E_WARNING,"Unable to find gz-file identifier %d",id); +		php_error(E_WARNING,"Unable to find gz-file identifier %d",id);  		RETURN_FALSE;  	}  	buf = emalloc(sizeof(char) * (len + 1)); @@ -514,7 +514,7 @@ PHP_FUNCTION(gzgetc) {  	zp = php3_list_find(id,&type);  	if (!zp || (type!=ZLIB_GLOBAL(le_zp))) { -		php3_error(E_WARNING,"Unable to find gz-file identifier %d",id); +		php_error(E_WARNING,"Unable to find gz-file identifier %d",id);  		RETURN_FALSE;  	}  	buf = emalloc(sizeof(char) * 2); @@ -555,7 +555,7 @@ PHP_FUNCTION(gzgetss)  	zp = php3_list_find(id,&type);  	if (!zp || (type!=ZLIB_GLOBAL(le_zp))) { -		php3_error(E_WARNING, "Unable to find gz-file identifier %d", id); +		php_error(E_WARNING, "Unable to find gz-file identifier %d", id);  		RETURN_FALSE;  	} @@ -685,7 +685,7 @@ PHP_FUNCTION(gzwrite) {  	zp = php3_list_find(id,&type);  	if (!zp || (type!=ZLIB_GLOBAL(le_zp))) { -		php3_error(E_WARNING,"Unable to find gz-file identifier %d",id); +		php_error(E_WARNING,"Unable to find gz-file identifier %d",id);  		RETURN_FALSE;  	} @@ -714,7 +714,7 @@ PHP_FUNCTION(gzrewind) {  	id = arg1->value.lval;	  	zp = php3_list_find(id,&type);  	if (!zp || (type!=ZLIB_GLOBAL(le_zp))) { -		php3_error(E_WARNING,"Unable to find gz-file identifier %d",id); +		php_error(E_WARNING,"Unable to find gz-file identifier %d",id);  		RETURN_FALSE;  	}  	gzrewind(zp); @@ -738,7 +738,7 @@ PHP_FUNCTION(gztell) {  	id = arg1->value.lval;	  	zp = php3_list_find(id,&type);  	if (!zp || (type!=ZLIB_GLOBAL(le_zp))) { -		php3_error(E_WARNING,"Unable to find gz-file identifier %d",id); +		php_error(E_WARNING,"Unable to find gz-file identifier %d",id);  		RETURN_FALSE;  	}  	pos = gztell(zp); @@ -764,7 +764,7 @@ PHP_FUNCTION(gzseek) {  	id = arg1->value.lval;  	zp = php3_list_find(id,&type);  	if (!zp || (type!=ZLIB_GLOBAL(le_zp))) { -		php3_error(E_WARNING,"Unable to find gz-file identifier %d",id); +		php_error(E_WARNING,"Unable to find gz-file identifier %d",id);  		RETURN_FALSE;  	}   	ret = gzseek(zp,pos,SEEK_SET); @@ -810,7 +810,7 @@ PHP_FUNCTION(readgzfile) {  	 */  	zp = php3_gzopen_wrapper(arg1->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE);  	if (!zp){ -		php3_error(E_WARNING,"ReadGzFile(\"%s\") - %s",arg1->value.str.val,strerror(errno)); +		php_error(E_WARNING,"ReadGzFile(\"%s\") - %s",arg1->value.str.val,strerror(errno));  		RETURN_FALSE;  	}  	size= 0; @@ -842,7 +842,7 @@ PHP_FUNCTION(gzpassthru) {  	id = arg1->value.lval;  	zp = php3_list_find(id,&type);  	if (!zp || (type!=ZLIB_GLOBAL(le_zp))) { -		php3_error(E_WARNING,"Unable to find gz-file identifier %d",id); +		php_error(E_WARNING,"Unable to find gz-file identifier %d",id);  		RETURN_FALSE;  	}  	size = 0; @@ -875,7 +875,7 @@ PHP_FUNCTION(gzread)  	zp = php3_list_find(id,&type);  	if (!zp || (type!=ZLIB_GLOBAL(le_zp))) { -		php3_error(E_WARNING,"Unable to find gz-file identifier %d",id); +		php_error(E_WARNING,"Unable to find gz-file identifier %d",id);  		RETURN_FALSE;  	}  	return_value->value.str.val = emalloc(sizeof(char) * (len + 1)); diff --git a/main/configuration-parser.y b/main/configuration-parser.y index e7d1ffb1ff..4c41f7e10f 100644 --- a/main/configuration-parser.y +++ b/main/configuration-parser.y @@ -51,7 +51,7 @@ static HashTable configuration_hash;  extern HashTable browser_hash;  PHPAPI extern char *php3_ini_path;  #endif -static HashTable *active__php3_hash_table; +static HashTable *active_zend_hash_table;  static pval *current_section;  static char *currently_parsed_filename; @@ -68,7 +68,7 @@ pval *cfg_get_entry(char *name, uint name_length)  {  	pval *tmp; -	if (_php3_hash_find(&configuration_hash, name, name_length, (void **) &tmp)==SUCCESS) { +	if (zend_hash_find(&configuration_hash, name, name_length, (void **) &tmp)==SUCCESS) {  		return tmp;  	} else {  		return NULL; @@ -80,7 +80,7 @@ PHPAPI int cfg_get_long(char *varname,long *result)  {  	pval *tmp,var; -	if (_php3_hash_find(&configuration_hash,varname,strlen(varname)+1,(void **) &tmp)==FAILURE) { +	if (zend_hash_find(&configuration_hash,varname,strlen(varname)+1,(void **) &tmp)==FAILURE) {  		*result=(long)NULL;  		return FAILURE;  	} @@ -96,7 +96,7 @@ PHPAPI int cfg_get_double(char *varname,double *result)  {  	pval *tmp,var; -	if (_php3_hash_find(&configuration_hash,varname,strlen(varname)+1,(void **) &tmp)==FAILURE) { +	if (zend_hash_find(&configuration_hash,varname,strlen(varname)+1,(void **) &tmp)==FAILURE) {  		*result=(double)0;  		return FAILURE;  	} @@ -112,7 +112,7 @@ PHPAPI int cfg_get_string(char *varname, char **result)  {  	pval *tmp; -	if (_php3_hash_find(&configuration_hash,varname,strlen(varname)+1,(void **) &tmp)==FAILURE) { +	if (zend_hash_find(&configuration_hash,varname,strlen(varname)+1,(void **) &tmp)==FAILURE) {  		*result=NULL;  		return FAILURE;  	} @@ -139,7 +139,7 @@ static int pvalue_config_destructor(pval *pvalue)  static int pvalue_browscap_destructor(pval *pvalue)  {  	if (pvalue->type == IS_OBJECT || pvalue->type == IS_ARRAY) { -		_php3_hash_destroy(pvalue->value.ht); +		zend_hash_destroy(pvalue->value.ht);  		free(pvalue->value.ht);  	}  	return 1; @@ -150,7 +150,7 @@ int php3_init_config(void)  {  	PLS_FETCH(); -	if (_php3_hash_init(&configuration_hash, 0, NULL, (int (*)(void *))pvalue_config_destructor, 1)==FAILURE) { +	if (zend_hash_init(&configuration_hash, 0, NULL, (int (*)(void *))pvalue_config_destructor, 1)==FAILURE) {  		return FAILURE;  	} @@ -224,14 +224,14 @@ int php3_init_config(void)  			tmp.value.str.val = opened_path;  			tmp.value.str.len = strlen(opened_path);  			tmp.type = IS_STRING; -			_php3_hash_update(&configuration_hash,"cfg_file_path",sizeof("cfg_file_path"),(void *) &tmp,sizeof(pval),NULL); +			zend_hash_update(&configuration_hash,"cfg_file_path",sizeof("cfg_file_path"),(void *) &tmp,sizeof(pval),NULL);  #if 0 -			php3_printf("INI file opened at '%s'\n",opened_path); +			php_printf("INI file opened at '%s'\n",opened_path);  #endif  		}  		init_cfg_scanner(); -		active__php3_hash_table = &configuration_hash; +		active_zend_hash_table = &configuration_hash;  		parsing_mode = PARSING_MODE_CFG;  		currently_parsed_filename = "php.ini";  		yyparse(); @@ -249,17 +249,17 @@ PHP_MINIT_FUNCTION(browscap)  	char *browscap = INI_STR("browscap");  	if (browscap) { -		if (_php3_hash_init(&browser_hash, 0, NULL, (int (*)(void *))pvalue_browscap_destructor, 1)==FAILURE) { +		if (zend_hash_init(&browser_hash, 0, NULL, (int (*)(void *))pvalue_browscap_destructor, 1)==FAILURE) {  			return FAILURE;  		}  		cfgin = fopen(browscap, "r");  		if (!cfgin) { -			php3_error(E_WARNING,"Cannot open '%s' for reading", browscap); +			php_error(E_WARNING,"Cannot open '%s' for reading", browscap);  			return FAILURE;  		}  		init_cfg_scanner(); -		active__php3_hash_table = &browser_hash; +		active_zend_hash_table = &browser_hash;  		parsing_mode = PARSING_MODE_BROWSCAP;  		currently_parsed_filename = browscap;  		yyparse(); @@ -272,7 +272,7 @@ PHP_MINIT_FUNCTION(browscap)  int php3_shutdown_config(void)  { -	_php3_hash_destroy(&configuration_hash); +	zend_hash_destroy(&configuration_hash);  	return SUCCESS;  } @@ -280,7 +280,7 @@ int php3_shutdown_config(void)  PHP_MSHUTDOWN_FUNCTION(browscap)  {  	if (INI_STR("browscap")) { -		_php3_hash_destroy(&browser_hash); +		zend_hash_destroy(&browser_hash);  	}  	return SUCCESS;  } @@ -356,10 +356,10 @@ statement:  #endif  			$3.type = IS_STRING;  			if (parsing_mode==PARSING_MODE_CFG) { -				_php3_hash_update(active__php3_hash_table, $1.value.str.val, $1.value.str.len+1, &$3, sizeof(pval), NULL); +				zend_hash_update(active_zend_hash_table, $1.value.str.val, $1.value.str.len+1, &$3, sizeof(pval), NULL);  			} else if (parsing_mode==PARSING_MODE_BROWSCAP) {  				php3_str_tolower($1.value.str.val,$1.value.str.len); -				_php3_hash_update(current_section->value.ht, $1.value.str.val, $1.value.str.len+1, &$3, sizeof(pval), NULL); +				zend_hash_update(current_section->value.ht, $1.value.str.val, $1.value.str.len+1, &$3, sizeof(pval), NULL);  			}  			free($1.value.str.val);  		} @@ -402,14 +402,14 @@ statement:  				/*printf("'%s' (%d)\n",$1.value.str.val,$1.value.str.len+1);*/  				tmp.value.ht = (HashTable *) malloc(sizeof(HashTable)); -				_php3_hash_init(tmp.value.ht, 0, NULL, (int (*)(void *))pvalue_config_destructor, 1); +				zend_hash_init(tmp.value.ht, 0, NULL, (int (*)(void *))pvalue_config_destructor, 1);  				tmp.type = IS_OBJECT; -				_php3_hash_update(active__php3_hash_table, $1.value.str.val, $1.value.str.len+1, (void *) &tmp, sizeof(pval), (void **) ¤t_section); +				zend_hash_update(active_zend_hash_table, $1.value.str.val, $1.value.str.len+1, (void *) &tmp, sizeof(pval), (void **) ¤t_section);  				tmp.value.str.val = php3_strndup($1.value.str.val,$1.value.str.len);  				tmp.value.str.len = $1.value.str.len;  				tmp.type = IS_STRING;  				convert_browscap_pattern(&tmp); -				_php3_hash_update(current_section->value.ht,"browser_name_pattern",sizeof("browser_name_pattern"),(void *) &tmp, sizeof(pval), NULL); +				zend_hash_update(current_section->value.ht,"browser_name_pattern",sizeof("browser_name_pattern"),(void *) &tmp, sizeof(pval), NULL);  			}  			free($1.value.str.val);  		} diff --git a/main/configuration-scanner.l b/main/configuration-scanner.l index 7aa2824c79..7610d828ac 100644 --- a/main/configuration-scanner.l +++ b/main/configuration-scanner.l @@ -175,6 +175,6 @@ void init_cfg_scanner()  <INITIAL>. {  #if DEBUG -	php3_error(E_NOTICE,"Unexpected character on line %d:  '%s' (ASCII %d)\n",yylineno,yytext,yytext[0]); +	php_error(E_NOTICE,"Unexpected character on line %d:  '%s' (ASCII %d)\n",yylineno,yytext,yytext[0]);  #endif  } diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index 1660874a0a..b9cf243792 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -172,7 +172,7 @@ PHPAPI int _php3_check_open_basedir(char *path)  			ptr = end;  		} -		php3_error(E_WARNING, "open_basedir restriction in effect. File is in wrong directory."); +		php_error(E_WARNING, "open_basedir restriction in effect. File is in wrong directory.");  		efree(pathbuf);  		return -1;  	} @@ -289,7 +289,7 @@ PHPAPI FILE *php3_fopen_for_parser(void)  		fp = NULL;  	}  	if (!fp) { -		php3_error(E_CORE_ERROR, "Unable to open %s", fn); +		php_error(E_CORE_ERROR, "Unable to open %s", fn);  		STR_FREE(SG(request_info).path_translated);	/* for same reason as above */  		return NULL;  	} @@ -449,7 +449,7 @@ static FILE *php3_fopen_url_wrapper(const char *path, char *mode, int options, i  	if (!strncasecmp(path, "http://", 7)) {  		resource = url_parse((char *) path);  		if (resource == NULL) { -			php3_error(E_WARNING, "Invalid URL specified, %s", path); +			php_error(E_WARNING, "Invalid URL specified, %s", path);  			*issock = BAD_URL;  			return NULL;  		} @@ -616,11 +616,11 @@ static FILE *php3_fopen_url_wrapper(const char *path, char *mode, int options, i  	} else if (!strncasecmp(path, "ftp://", 6)) {  		resource = url_parse((char *) path);  		if (resource == NULL) { -			php3_error(E_WARNING, "Invalid URL specified, %s", path); +			php_error(E_WARNING, "Invalid URL specified, %s", path);  			*issock = BAD_URL;  			return NULL;  		} else if (resource->path == NULL) { -			php3_error(E_WARNING, "No file-path specified"); +			php_error(E_WARNING, "No file-path specified");  			free_url(resource);  			*issock = BAD_URL;  			return NULL; @@ -739,7 +739,7 @@ static FILE *php3_fopen_url_wrapper(const char *path, char *mode, int options, i  		if (mode[0] == 'r') {  			/* when reading file, it must exist */  			if (result > 299 || result < 200) { -				php3_error(E_WARNING, "File not found"); +				php_error(E_WARNING, "File not found");  				free_url(resource);  				SOCK_FCLOSE(*socketd);  				*socketd = 0; @@ -749,7 +749,7 @@ static FILE *php3_fopen_url_wrapper(const char *path, char *mode, int options, i  		} else {  			/* when writing file, it must NOT exist */  			if (result <= 299 && result >= 200) { -				php3_error(E_WARNING, "File already exists"); +				php_error(E_WARNING, "File already exists");  				free_url(resource);  				SOCK_FCLOSE(*socketd);  				*socketd = 0; diff --git a/main/main.c b/main/main.c index 64452ab90e..230e3fbc1e 100644 --- a/main/main.c +++ b/main/main.c @@ -318,7 +318,7 @@ PHPAPI int php3_write(void *buf, int size)  	return PHPWRITE(buf, size);  } -PHPAPI int php3_printf(const char *format,...) +PHPAPI int php_printf(const char *format,...)  {  	va_list args;  	int ret; @@ -335,7 +335,7 @@ PHPAPI int php3_printf(const char *format,...)  /* extended error handling function */ -PHPAPI void php3_error(int type, const char *format,...) +PHPAPI void php_error(int type, const char *format,...)  {  	va_list args;  	char *error_filename = NULL; @@ -425,7 +425,7 @@ PHPAPI void php3_error(int type, const char *format,...)  				if (prepend_string) {  					PUTS(prepend_string);  				}		 -				php3_printf("<br>\n<b>%s</b>:  %s in <b>%s</b> on line <b>%d</b><br>\n", error_type_str, buffer, error_filename, error_lineno); +				php_printf("<br>\n<b>%s</b>:  %s in <b>%s</b> on line <b>%d</b><br>\n", error_type_str, buffer, error_filename, error_lineno);  				if (append_string) {  					PUTS(append_string);  				}		 @@ -446,7 +446,7 @@ PHPAPI void php3_error(int type, const char *format,...)  		tmp->value.str.len = size;  		tmp->type = IS_STRING; -		_php3_hash_update(EG(active_symbol_table), "php_errormsg", sizeof("php_errormsg"), (void **) & tmp, sizeof(pval *), NULL); +		zend_hash_update(EG(active_symbol_table), "php_errormsg", sizeof("php_errormsg"), (void **) & tmp, sizeof(pval *), NULL);  	}  	switch (type) { @@ -467,7 +467,7 @@ static void php3_timeout(int dummy)  {  	PLS_FETCH(); -	php3_error(E_ERROR, "Maximum execution time of %s seconds exceeded", INI_STR("max_execution_time")); +	php_error(E_ERROR, "Maximum execution time of %s seconds exceeded", INI_STR("max_execution_time"));  }  #endif @@ -514,7 +514,7 @@ PHP_FUNCTION(set_time_limit)  	PLS_FETCH();  	if (PG(safe_mode)) { -		php3_error(E_WARNING, "Cannot set time limit in safe mode"); +		php_error(E_WARNING, "Cannot set time limit in safe mode");  		RETURN_FALSE;  	}  	if (ARG_COUNT(ht) != 1 || getParameters(ht, 1, &new_timeout) == FAILURE) { @@ -578,17 +578,17 @@ static void php_message_handler_for_zend(long message, void *data)  		case ZMSG_FAILED_INCLUDE_FOPEN: {  				PLS_FETCH(); -				php3_error(E_WARNING, "Failed opening '%s' for inclusion (include_path='%s')", php3_strip_url_passwd((char *) data), STR_PRINT(PG(include_path))); +				php_error(E_WARNING, "Failed opening '%s' for inclusion (include_path='%s')", php3_strip_url_passwd((char *) data), STR_PRINT(PG(include_path)));  			}  			break;  		case ZMSG_FAILED_REQUIRE_FOPEN: {  				PLS_FETCH(); -				php3_error(E_COMPILE_ERROR, "Failed opening required '%s' (include_path='%s')", php3_strip_url_passwd((char *) data), STR_PRINT(PG(include_path))); +				php_error(E_COMPILE_ERROR, "Failed opening required '%s' (include_path='%s')", php3_strip_url_passwd((char *) data), STR_PRINT(PG(include_path)));  			}  			break;  		case ZMSG_FAILED_HIGHLIGHT_FOPEN: -			php3_error(E_WARNING, "Failed opening '%s' for highlighting", php3_strip_url_passwd((char *) data)); +			php_error(E_WARNING, "Failed opening '%s' for highlighting", php3_strip_url_passwd((char *) data));  			break;  		case ZMSG_MEMORY_LEAK_DETECTED:  		case ZMSG_MEMORY_LEAK_REPEATED: { @@ -662,7 +662,7 @@ int php_request_startup(CLS_D ELS_DC PLS_DC SLS_DC)  	}  	if (php3_init_request_info(NULL)) { -		php3_printf("Unable to initialize request info.\n"); +		php_printf("Unable to initialize request info.\n");  		return FAILURE;  	} @@ -742,7 +742,7 @@ void php_request_shutdown(void *dummy)  static int php3_config_ini_startup()  {  	if (php3_init_config() == FAILURE) { -		php3_printf("PHP:  Unable to parse configuration file.\n"); +		php_printf("PHP:  Unable to parse configuration file.\n");  		return FAILURE;  	}  	return SUCCESS; @@ -799,8 +799,8 @@ int php_module_startup(sapi_module_struct *sf)  	zend_output_startup(); -	zuf.error_function = php3_error; -	zuf.printf_function = php3_printf; +	zuf.error_function = php_error; +	zuf.printf_function = php_printf;  	zuf.write_function = zend_body_write_wrapper;  	zuf.fopen_function = php_fopen_wrapper_for_zend;  	zuf.message_handler = php_message_handler_for_zend; @@ -825,7 +825,7 @@ int php_module_startup(sapi_module_struct *sf)  #if (WIN32|WINNT) && !(USE_SAPI)  	/* start up winsock services */  	if (WSAStartup(wVersionRequested, &wsaData) != 0) { -		php3_printf("\nwinsock.dll unusable. %d\n", WSAGetLastError()); +		php_printf("\nwinsock.dll unusable. %d\n", WSAGetLastError());  		return FAILURE;  	}  #endif @@ -846,7 +846,7 @@ int php_module_startup(sapi_module_struct *sf)  	zend_set_utility_values(&zuv);  	if (module_startup_modules() == FAILURE) { -		php3_printf("Unable to start modules\n"); +		php_printf("Unable to start modules\n");  		return FAILURE;  	}  	module_initialized = 1; @@ -904,7 +904,7 @@ void php_module_shutdown()  /* in 3.1 some of this should move into sapi */ -int _php3_hash_environment(PLS_D ELS_DC) +int zend_hash_environment(PLS_D ELS_DC)  {  	char **env, *p, *t;  	unsigned char _gpc_flags[3] = {0,0,0}; @@ -951,7 +951,7 @@ int _php3_hash_environment(PLS_D ELS_DC)  		tmp->type = IS_STRING;  		INIT_PZVAL(tmp);  		/* environmental variables never take precedence over get/post/cookie variables */ -		_php3_hash_add(&EG(symbol_table), t, p - *env + 1, &tmp, sizeof(pval *), NULL); +		zend_hash_add(&EG(symbol_table), t, p - *env + 1, &tmp, sizeof(pval *), NULL);  		efree(t);  	} @@ -976,19 +976,19 @@ int _php3_hash_environment(PLS_D ELS_DC)  			}  			INIT_PZVAL(tmp);  			tmp->type = IS_STRING; -			_php3_hash_update(&EG(symbol_table), t, strlen(t)+1, &tmp, sizeof(pval *), NULL); +			zend_hash_update(&EG(symbol_table), t, strlen(t)+1, &tmp, sizeof(pval *), NULL);  		}  		/* insert special variables */ -		if (_php3_hash_find(&EG(symbol_table), "SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME"), (void **) &tmp_ptr) == SUCCESS) { +		if (zend_hash_find(&EG(symbol_table), "SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME"), (void **) &tmp_ptr) == SUCCESS) {  			(*tmp_ptr)->refcount++; -			_php3_hash_update(&EG(symbol_table), "PATH_TRANSLATED", sizeof("PATH_TRANSLATED"), tmp_ptr, sizeof(pval *), NULL); +			zend_hash_update(&EG(symbol_table), "PATH_TRANSLATED", sizeof("PATH_TRANSLATED"), tmp_ptr, sizeof(pval *), NULL);  		}  		tmp = (pval *) emalloc(sizeof(pval));  		tmp->value.str.len = strlen(((request_rec *) SG(server_context))->uri);  		tmp->value.str.val = estrndup(((request_rec *) SG(server_context))->uri, tmp->value.str.len);  		INIT_PZVAL(tmp);  		tmp->type = IS_STRING; -		_php3_hash_update(&EG(symbol_table), "PHP_SELF", sizeof("PHP_SELF"), (void *) &tmp, sizeof(pval *), NULL); +		zend_hash_update(&EG(symbol_table), "PHP_SELF", sizeof("PHP_SELF"), (void *) &tmp, sizeof(pval *), NULL);  	}  #else  	{ @@ -998,7 +998,7 @@ int _php3_hash_environment(PLS_D ELS_DC)  		pi = SG(request_info).request_uri;  		tmp = (pval *) emalloc(sizeof(pval));  		tmp->value.str.val = emalloc(((pi)?strlen(pi):0) + 1); -		tmp->value.str.len = _php3_sprintf(tmp->value.str.val, "%s", (pi ? pi : ""));	/* SAFE */ +		tmp->value.str.len = php_sprintf(tmp->value.str.val, "%s", (pi ? pi : ""));	/* SAFE */  		tmp->type = IS_STRING;  		INIT_PZVAL(tmp);  #else @@ -1016,11 +1016,11 @@ int _php3_hash_environment(PLS_D ELS_DC)  		}  		tmp = (pval *) emalloc(sizeof(pval));  		tmp->value.str.val = emalloc(l + 1); -		tmp->value.str.len = _php3_sprintf(tmp->value.str.val, "%s%s", (sn ? sn : ""), (pi ? pi : ""));	/* SAFE */ +		tmp->value.str.len = php_sprintf(tmp->value.str.val, "%s%s", (sn ? sn : ""), (pi ? pi : ""));	/* SAFE */  		tmp->type = IS_STRING;  		INIT_PZVAL(tmp);  #endif -		_php3_hash_update(&EG(symbol_table), "PHP_SELF", sizeof("PHP_SELF"), (void *) & tmp, sizeof(pval *), NULL); +		zend_hash_update(&EG(symbol_table), "PHP_SELF", sizeof("PHP_SELF"), (void *) & tmp, sizeof(pval *), NULL);  	}  #endif @@ -1039,12 +1039,12 @@ void _php3_build_argv(char *s ELS_DC)  	arr = (pval *) emalloc(sizeof(pval));  	arr->value.ht = (HashTable *) emalloc(sizeof(HashTable)); -	if (_php3_hash_init(arr->value.ht, 0, NULL, PVAL_PTR_DTOR, 0) == FAILURE) { -		php3_error(E_WARNING, "Unable to create argv array"); +	if (zend_hash_init(arr->value.ht, 0, NULL, PVAL_PTR_DTOR, 0) == FAILURE) { +		php_error(E_WARNING, "Unable to create argv array");  	} else {  		arr->type = IS_ARRAY;  		INIT_PZVAL(arr); -		_php3_hash_update(&EG(symbol_table), "argv", sizeof("argv"), &arr, sizeof(pval *), NULL); +		zend_hash_update(&EG(symbol_table), "argv", sizeof("argv"), &arr, sizeof(pval *), NULL);  	}  	/* now pick out individual entries */  	ss = s; @@ -1060,7 +1060,7 @@ void _php3_build_argv(char *s ELS_DC)  		tmp->value.str.val = estrndup(ss, tmp->value.str.len);  		INIT_PZVAL(tmp);  		count++; -		if (_php3_hash_next_index_insert(arr->value.ht, &tmp, sizeof(pval *), NULL)==FAILURE) { +		if (zend_hash_next_index_insert(arr->value.ht, &tmp, sizeof(pval *), NULL)==FAILURE) {  			if (tmp->type == IS_STRING) {  				efree(tmp->value.str.val);  			} @@ -1076,7 +1076,7 @@ void _php3_build_argv(char *s ELS_DC)  	tmp->value.lval = count;  	tmp->type = IS_LONG;  	INIT_PZVAL(tmp); -	_php3_hash_add(&EG(symbol_table), "argc", sizeof("argc"), &tmp, sizeof(pval *), NULL); +	zend_hash_add(&EG(symbol_table), "argc", sizeof("argc"), &tmp, sizeof(pval *), NULL);  } @@ -1110,7 +1110,7 @@ PHPAPI void php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_  	if (setjmp(EG(bailout))!=0) {  		return;  	} -	_php3_hash_environment(PLS_C ELS_CC); +	zend_hash_environment(PLS_C ELS_CC);  #if WIN32||WINNT  	UpdateIniFromRegistry(primary_file->filename); diff --git a/main/php.h b/main/php.h index eee90b356e..d70efbf25c 100644 --- a/main/php.h +++ b/main/php.h @@ -274,9 +274,9 @@ extern char **environ;  #endif  extern void phperror(char *error); -extern PHPAPI void php3_error(int type, const char *format,...); +extern PHPAPI void php_error(int type, const char *format,...);  extern PHPAPI int php3_write(void *buf, int size); -extern PHPAPI int php3_printf(const char *format,...); +extern PHPAPI int php_printf(const char *format,...);  extern void php3_log_err(char *log_message);  extern int Debug(char *format,...);  extern int cfgparse(void); @@ -297,7 +297,7 @@ extern int module_startup_modules(void);  extern PHPAPI int php3i_get_le_fp(void);  /*from basic functions*/ -extern PHPAPI int _php3_error_log(int opt_err,char *message,char *opt,char *headers); +extern PHPAPI int _php_error_log(int opt_err,char *message,char *opt,char *headers);  PHPAPI int cfg_get_long(char *varname, long *result);  PHPAPI int cfg_get_double(char *varname, double *result); diff --git a/main/php3_compat.h b/main/php3_compat.h index 5844f96685..85242e323e 100644 --- a/main/php3_compat.h +++ b/main/php3_compat.h @@ -58,6 +58,11 @@  #define _php3_hash_apply_with_argument zend_hash_apply_with_argument +#define php3_error php_error + +#define php3_printf php_printf +#define _php3_sprintf php_sprintf +  #define php3_module_entry zend_module_entry diff --git a/main/php_ini.c b/main/php_ini.c index 8cb324df43..4c25faf5b8 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -309,7 +309,7 @@ PHP_INI_DISP(php_ini_color_displayer_cb)  		value = NULL;  	}  	if (value) { -		php3_printf("<font color=\"%s\">%s</font>", value, value); +		php_printf("<font color=\"%s\">%s</font>", value, value);  	} else {  		PUTS("<i>no value</i>;");  	} diff --git a/main/rfc1867.c b/main/rfc1867.c index 8888f1af2f..6011c6d9a6 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -81,7 +81,7 @@ void php_mime_split(char *buf, int cnt, char *boundary)  					if (rem < 31) {  						SAFE_RETURN;  					} -					php3_error(E_WARNING, "File Upload Mime headers garbled [%c%c%c%c%c]", *ptr, *(ptr + 1), *(ptr + 2), *(ptr + 3), *(ptr + 4)); +					php_error(E_WARNING, "File Upload Mime headers garbled [%c%c%c%c%c]", *ptr, *(ptr + 1), *(ptr + 2), *(ptr + 3), *(ptr + 4));  					SAFE_RETURN;  				}  				loc = memchr(ptr, '\n', rem); @@ -90,7 +90,7 @@ void php_mime_split(char *buf, int cnt, char *boundary)  					name += 7;  					s = memchr(name, '\"', loc - name);  					if (!s) { -						php3_error(E_WARNING, "File Upload Mime headers garbled [%c%c%c%c%c]", *name, *(name + 1), *(name + 2), *(name + 3), *(name + 4)); +						php_error(E_WARNING, "File Upload Mime headers garbled [%c%c%c%c%c]", *name, *(name + 1), *(name + 2), *(name + 3), *(name + 4));  						SAFE_RETURN;  					}  					if (namebuf) { @@ -106,7 +106,7 @@ void php_mime_split(char *buf, int cnt, char *boundary)  					rem -= (loc2 - ptr) + 1;  					ptr = loc2 + 1;  				} else { -					php3_error(E_WARNING, "File upload error - no name component in content disposition"); +					php_error(E_WARNING, "File upload error - no name component in content disposition");  					SAFE_RETURN;  				}  				filename = strstr(s, " filename=\""); @@ -114,7 +114,7 @@ void php_mime_split(char *buf, int cnt, char *boundary)  					filename += 11;  					s = memchr(filename, '\"', loc - filename);  					if (!s) { -						php3_error(E_WARNING, "File Upload Mime headers garbled [%c%c%c%c%c]", *filename, *(filename + 1), *(filename + 2), *(filename + 3), *(filename + 4)); +						php_error(E_WARNING, "File Upload Mime headers garbled [%c%c%c%c%c]", *filename, *(filename + 1), *(filename + 2), *(filename + 3), *(filename + 4));  						SAFE_RETURN;  					}  					if (filenamebuf) { @@ -153,7 +153,7 @@ void php_mime_split(char *buf, int cnt, char *boundary)  					loc = memchr(u, *boundary, urem);  				}  				if (!loc) { -					php3_error(E_WARNING, "File Upload Field Data garbled"); +					php_error(E_WARNING, "File Upload Field Data garbled");  					SAFE_RETURN;  				}  				*(loc - 4) = '\0'; @@ -197,16 +197,16 @@ void php_mime_split(char *buf, int cnt, char *boundary)  					loc = memchr(u, *boundary, urem);  				}  				if (!loc) { -					php3_error(E_WARNING, "File Upload Error - No Mime boundary found after start of file header"); +					php_error(E_WARNING, "File Upload Error - No Mime boundary found after start of file header");  					SAFE_RETURN;  				}  				fn = tempnam(PG(upload_tmp_dir), "php");  				if ((loc - ptr - 4) > PG(upload_max_filesize)) { -					php3_error(E_WARNING, "Max file size of %ld bytes exceeded - file [%s] not saved", PG(upload_max_filesize),namebuf); +					php_error(E_WARNING, "Max file size of %ld bytes exceeded - file [%s] not saved", PG(upload_max_filesize),namebuf);  					bytes=0;	  					SET_VAR_STRING(namebuf, estrdup("none"));  				} else if (max_file_size && ((loc - ptr - 4) > max_file_size)) { -					php3_error(E_WARNING, "Max file size exceeded - file [%s] not saved", namebuf); +					php_error(E_WARNING, "Max file size exceeded - file [%s] not saved", namebuf);  					bytes = 0;  					SET_VAR_STRING(namebuf, estrdup("none"));  				} else if ((loc - ptr - 4) <= 0) { @@ -215,14 +215,14 @@ void php_mime_split(char *buf, int cnt, char *boundary)  				} else {  					fp = fopen(fn, "w");  					if (!fp) { -						php3_error(E_WARNING, "File Upload Error - Unable to open temporary file [%s]", fn); +						php_error(E_WARNING, "File Upload Error - Unable to open temporary file [%s]", fn);  						SAFE_RETURN;  					}  					bytes = fwrite(ptr, 1, loc - ptr - 4, fp);  					fclose(fp);  					php3_list_insert(fn,le_uploads);  /* Tell PHP about the file so the destructor can unlink it later */  					if (bytes < (loc - ptr - 4)) { -						php3_error(E_WARNING, "Only %d bytes were written, expected to write %ld", bytes, loc - ptr - 4); +						php_error(E_WARNING, "Only %d bytes were written, expected to write %ld", bytes, loc - ptr - 4);  					}  					SET_VAR_STRING(namebuf, estrdup(fn));  				} diff --git a/main/safe_mode.c b/main/safe_mode.c index e06bca9edb..02bd31b9bf 100644 --- a/main/safe_mode.c +++ b/main/safe_mode.c @@ -59,7 +59,7 @@ PHPAPI int _php3_checkuid(const char *fn, int mode) {  	if (mode<3) {  		ret = stat(fn,&sb);  		if (ret<0 && mode < 2) { -			php3_error(E_WARNING,"Unable to access %s",fn); +			php_error(E_WARNING,"Unable to access %s",fn);  			return(mode);  		}  		if (ret>-1) { @@ -82,27 +82,27 @@ PHPAPI int _php3_checkuid(const char *fn, int mode) {  		ret = stat(fn,&sb);  		*s='/';  		if (ret<0) { -			php3_error(E_WARNING, "Unable to access %s",fn); +			php_error(E_WARNING, "Unable to access %s",fn);  			return(0);  		}  		duid = sb.st_uid;  	} else {  		s = emalloc(MAXPATHLEN+1);  		if (!getcwd(s,MAXPATHLEN)) { -			php3_error(E_WARNING, "Unable to access current working directory"); +			php_error(E_WARNING, "Unable to access current working directory");  			return(0);  		}  		ret = stat(s,&sb);  		efree(s);  		if (ret<0) { -			php3_error(E_WARNING, "Unable to access %s",s); +			php_error(E_WARNING, "Unable to access %s",s);  			return(0);  		}  		duid = sb.st_uid;  	}  	if (duid == (uid=_php3_getuid())) return(1);  	else { -		php3_error(E_WARNING, "SAFE MODE Restriction in effect.  The script whose uid is %ld is not allowed to access %s owned by uid %ld",uid,fn,duid); +		php_error(E_WARNING, "SAFE MODE Restriction in effect.  The script whose uid is %ld is not allowed to access %s owned by uid %ld",uid,fn,duid);  		return(0);  	}  } diff --git a/main/snprintf.h b/main/snprintf.h index 11632caa52..4a453b2693 100644 --- a/main/snprintf.h +++ b/main/snprintf.h @@ -30,9 +30,9 @@ extern int ap_vsnprintf(char *, size_t, const char *, va_list ap);  #endif  #if BROKEN_SPRINTF -int _php3_sprintf (char* s, const char* format, ...); +int php_sprintf (char* s, const char* format, ...);  #else -#define _php3_sprintf sprintf +#define php_sprintf sprintf  #endif  #endif /* _PHP3_SNPRINTF_H */ diff --git a/mod_php4.c b/mod_php4.c index 30e1bc93df..b854f78243 100644 --- a/mod_php4.c +++ b/mod_php4.c @@ -179,7 +179,7 @@ sapi_module_struct sapi_module = {  	zend_apache_ub_write,			/* unbuffered write */ -	php3_error,						/* error handler */ +	php_error,						/* error handler */  	sapi_apache_header_handler,		/* header handler */  	sapi_apache_send_headers,		/* send headers handler */ diff --git a/php3_sprintf.c b/php3_sprintf.c index e49e668d01..24b9bf15fd 100644 --- a/php3_sprintf.c +++ b/php3_sprintf.c @@ -25,7 +25,7 @@  #if BROKEN_SPRINTF  int -_php3_sprintf (char*s, const char* format, ...) +php_sprintf (char*s, const char* format, ...)  {    va_list args;    char *ret;  | 
