diff options
author | Zeev Suraski <zeev@php.net> | 1999-08-02 19:17:14 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 1999-08-02 19:17:14 +0000 |
commit | 3cb1eb047187d53688545ae6f64d4df880298e72 (patch) | |
tree | 7fb20f178b9df5a33a83a2b7537f5614910697c0 /ext/standard | |
parent | 07e0885519ccabbd9cebfce7223be657171a6629 (diff) | |
download | php-git-3cb1eb047187d53688545ae6f64d4df880298e72.tar.gz |
Removed '3' from key functions in PHP (maintained compatibility through
php3_compat.h)
Diffstat (limited to 'ext/standard')
-rw-r--r-- | ext/standard/basic_functions.c | 160 | ||||
-rw-r--r-- | ext/standard/browscap.c | 16 | ||||
-rw-r--r-- | ext/standard/cyr_convert.c | 4 | ||||
-rw-r--r-- | ext/standard/datetime.c | 6 | ||||
-rw-r--r-- | ext/standard/dir.c | 24 | ||||
-rw-r--r-- | ext/standard/dl.c | 20 | ||||
-rw-r--r-- | ext/standard/dns.c | 14 | ||||
-rw-r--r-- | ext/standard/exec.c | 24 | ||||
-rw-r--r-- | ext/standard/file.c | 64 | ||||
-rw-r--r-- | ext/standard/filestat.c | 26 | ||||
-rw-r--r-- | ext/standard/formatted_print.c | 48 | ||||
-rw-r--r-- | ext/standard/fsock.c | 20 | ||||
-rw-r--r-- | ext/standard/head.c | 4 | ||||
-rw-r--r-- | ext/standard/image.c | 8 | ||||
-rw-r--r-- | ext/standard/info.c | 76 | ||||
-rw-r--r-- | ext/standard/iptc.c | 10 | ||||
-rw-r--r-- | ext/standard/link.c | 10 | ||||
-rw-r--r-- | ext/standard/mail.c | 12 | ||||
-rw-r--r-- | ext/standard/math.c | 6 | ||||
-rw-r--r-- | ext/standard/pack.c | 20 | ||||
-rw-r--r-- | ext/standard/pageinfo.c | 2 | ||||
-rw-r--r-- | ext/standard/post.c | 50 | ||||
-rw-r--r-- | ext/standard/rand.c | 4 | ||||
-rw-r--r-- | ext/standard/reg.c | 26 | ||||
-rw-r--r-- | ext/standard/string.c | 30 | ||||
-rw-r--r-- | ext/standard/uniqid.c | 2 | ||||
-rw-r--r-- | ext/standard/url.c | 10 | ||||
-rw-r--r-- | ext/standard/var.c | 40 |
28 files changed, 368 insertions, 368 deletions
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); |