Date: 06/26/98
- Next message: zeev: "[PHP-DEV] CVS update: php31/ext/sybase"
- Previous message: zeev: "[PHP-DEV] CVS update: php31/ext/postgres"
- Next in thread: shane: "[PHP-DEV] CVS update: php31/ext/standard"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Friday June 26, 1998 @ 12:53
Author: zeev
Update of /repository/php31/ext/standard
In directory asf:/tmp/cvs-serv8683/ext/standard
Modified Files:
basic_functions.c browscap.c dir.c dl.c dns.c exec.c info.c
post.c reg.c string.c
Log Message:
I doubt that's all that missing, but here it is anyway
Index: php31/ext/standard/basic_functions.c
diff -c php31/ext/standard/basic_functions.c:1.15 php31/ext/standard/basic_functions.c:1.16
*** php31/ext/standard/basic_functions.c:1.15 Thu Jun 25 20:58:44 1998
--- php31/ext/standard/basic_functions.c Fri Jun 26 12:53:06 1998
***************
*** 295,301 ****
idea unless each thread gets its own environment ???
*/
#if HAVE_PUTENV && !defined(THREAD_SAFE)
! if (hash_init(&putenv_ht, 1, NULL, (void (*)(void *)) _php3_putenv_destructor, 0) == FAILURE) {
return FAILURE;
}
#endif
--- 295,301 ----
idea unless each thread gets its own environment ???
*/
#if HAVE_PUTENV && !defined(THREAD_SAFE)
! if (_php3_hashinit(&putenv_ht, 1, NULL, (void (*)(void *)) _php3_putenv_destructor, 0) == FAILURE) {
return FAILURE;
}
#endif
***************
*** 307,313 ****
TLS_VARS;
STR_FREE(GLOBAL(strtok_string));
#if HAVE_PUTENV && !defined(THREAD_SAFE)
! hash_destroy(&putenv_ht);
#endif
return SUCCESS;
}
--- 307,313 ----
TLS_VARS;
STR_FREE(GLOBAL(strtok_string));
#if HAVE_PUTENV && !defined(THREAD_SAFE)
! _php3_hashdestroy(&putenv_ht);
#endif
return SUCCESS;
}
***************
*** 359,365 ****
pe.key_len = strlen(pe.key);
pe.key = estrndup(pe.key,pe.key_len);
! hash_del(&putenv_ht,pe.key,pe.key_len+1);
/* find previous value */
pe.previous_value = NULL;
--- 359,365 ----
pe.key_len = strlen(pe.key);
pe.key = estrndup(pe.key,pe.key_len);
! _php3_hashdel(&putenv_ht,pe.key,pe.key_len+1);
/* find previous value */
pe.previous_value = NULL;
***************
*** 371,377 ****
}
if ((ret=putenv(pe.putenv_string))==0) { /* success */
! hash_add(&putenv_ht,pe.key,pe.key_len+1,(void **) &pe,sizeof(putenv_entry),NULL);
RETURN_TRUE;
} else {
efree(pe.putenv_string);
--- 371,377 ----
}
if ((ret=putenv(pe.putenv_string))==0) { /* success */
! _php3_hashadd(&putenv_ht,pe.key,pe.key_len+1,(void **) &pe,sizeof(putenv_entry),NULL);
RETURN_TRUE;
} else {
efree(pe.putenv_string);
***************
*** 520,526 ****
php3_error(E_WARNING, "Array not passed by reference in call to ksort()");
return;
}
! if (hash_sort(array->value.ht, array_key_compare,0) == FAILURE) {
return;
}
RETURN_TRUE;
--- 520,526 ----
php3_error(E_WARNING, "Array not passed by reference in call to ksort()");
return;
}
! if (_php3_hashsort(array->value.ht, array_key_compare,0) == FAILURE) {
return;
}
RETURN_TRUE;
***************
*** 634,640 ****
php3_error(E_WARNING, "Array not passed by reference in call to asort()");
return;
}
! if (hash_sort(array->value.ht, array_data_compare,0) == FAILURE) {
return;
}
RETURN_TRUE;
--- 634,640 ----
php3_error(E_WARNING, "Array not passed by reference in call to asort()");
return;
}
! if (_php3_hashsort(array->value.ht, array_data_compare,0) == FAILURE) {
return;
}
RETURN_TRUE;
***************
*** 656,662 ****
php3_error(E_WARNING, "Array not passed by reference in call to arsort()");
return;
}
! if (hash_sort(array->value.ht, array_reverse_data_compare,0) == FAILURE) {
return;
}
RETURN_TRUE;
--- 656,662 ----
php3_error(E_WARNING, "Array not passed by reference in call to arsort()");
return;
}
! if (_php3_hashsort(array->value.ht, array_reverse_data_compare,0) == FAILURE) {
return;
}
RETURN_TRUE;
***************
*** 678,684 ****
php3_error(E_WARNING, "Array not passed by reference in call to sort()");
return;
}
! if (hash_sort(array->value.ht, array_data_compare,1) == FAILURE) {
return;
}
RETURN_TRUE;
--- 678,684 ----
php3_error(E_WARNING, "Array not passed by reference in call to sort()");
return;
}
! if (_php3_hashsort(array->value.ht, array_data_compare,1) == FAILURE) {
return;
}
RETURN_TRUE;
***************
*** 700,706 ****
php3_error(E_WARNING, "Array not passed by reference in call to rsort()");
return;
}
! if (hash_sort(array->value.ht, array_reverse_data_compare,1) == FAILURE) {
return;
}
RETURN_TRUE;
--- 700,706 ----
php3_error(E_WARNING, "Array not passed by reference in call to rsort()");
return;
}
! if (_php3_hashsort(array->value.ht, array_reverse_data_compare,1) == FAILURE) {
return;
}
RETURN_TRUE;
***************
*** 721,733 ****
if (!ParameterPassedByReference(ht,1)) {
php3_error(E_WARNING, "Array not passed by reference in call to end()");
}
! hash_internal_pointer_end(array->value.ht);
while (1) {
! if (hash_get_current_data(array->value.ht, (void **) &entry) == FAILURE) {
RETURN_FALSE;
}
if (entry->type == IS_STRING && entry->value.str.val==undefined_variable_string) {
! hash_move_backwards(array->value.ht);
} else {
break;
}
--- 721,733 ----
if (!ParameterPassedByReference(ht,1)) {
php3_error(E_WARNING, "Array not passed by reference in call to end()");
}
! _php3_hashinternal_pointer_end(array->value.ht);
while (1) {
! if (_php3_hashget_current_data(array->value.ht, (void **) &entry) == FAILURE) {
RETURN_FALSE;
}
if (entry->type == IS_STRING && entry->value.str.val==undefined_variable_string) {
! _php3_hashmove_backwards(array->value.ht);
} else {
break;
}
***************
*** 749,756 ****
RETURN_FALSE;
}
do {
! hash_move_backwards(array->value.ht);
! if (hash_get_current_data(array->value.ht, (void **) &entry) == FAILURE) {
RETURN_FALSE;
}
} while (entry->type==IS_STRING && entry->value.str.val==undefined_variable_string);
--- 749,756 ----
RETURN_FALSE;
}
do {
! _php3_hashmove_backwards(array->value.ht);
! if (_php3_hashget_current_data(array->value.ht, (void **) &entry) == FAILURE) {
RETURN_FALSE;
}
} while (entry->type==IS_STRING && entry->value.str.val==undefined_variable_string);
***************
*** 771,778 ****
RETURN_FALSE;
}
do {
! hash_move_forward(array->value.ht);
! if (hash_get_current_data(array->value.ht, (void **) &entry) == FAILURE) {
RETURN_FALSE;
}
} while (entry->type==IS_STRING && entry->value.str.val==undefined_variable_string);
--- 771,778 ----
RETURN_FALSE;
}
do {
! _php3_hashmove_forward(array->value.ht);
! if (_php3_hashget_current_data(array->value.ht, (void **) &entry) == FAILURE) {
RETURN_FALSE;
}
} while (entry->type==IS_STRING && entry->value.str.val==undefined_variable_string);
***************
*** 796,804 ****
php3_error(E_WARNING,"Variable passed to each() is not an array or object");
return;
}
! while((retval=hash_get_current_data(array->value.ht, (void **) &entry)) == SUCCESS) {
if (entry->type == IS_STRING && entry->value.str.val==undefined_variable_string) {
! hash_move_forward(array->value.ht);
continue;
} else {
break;
--- 796,804 ----
php3_error(E_WARNING,"Variable passed to each() is not an array or object");
return;
}
! while((retval=_php3_hashget_current_data(array->value.ht, (void **) &entry)) == SUCCESS) {
if (entry->type == IS_STRING && entry->value.str.val==undefined_variable_string) {
! _php3_hashmove_forward(array->value.ht);
continue;
} else {
break;
***************
*** 810,818 ****
array_init(return_value);
real_entry = *entry;
yystype_copy_constructor(&real_entry);
! hash_index_update(return_value->value.ht,1,(void *) &real_entry,sizeof(pval),(void **) &inserted_pointer);
! hash_pointer_update(return_value->value.ht, "value", sizeof("value"), (void *) inserted_pointer);
! switch (hash_get_current_key(array->value.ht, &string_key, &int_key)) {
case HASH_KEY_IS_STRING:
add_get_index_string(return_value,0,string_key,(void **) &inserted_pointer,0);
break;
--- 810,818 ----
array_init(return_value);
real_entry = *entry;
yystype_copy_constructor(&real_entry);
! _php3_hashindex_update(return_value->value.ht,1,(void *) &real_entry,sizeof(pval),(void **) &inserted_pointer);
! _php3_hashpointer_update(return_value->value.ht, "value", sizeof("value"), (void *) inserted_pointer);
! switch (_php3_hashget_current_key(array->value.ht, &string_key, &int_key)) {
case HASH_KEY_IS_STRING:
add_get_index_string(return_value,0,string_key,(void **) &inserted_pointer,0);
break;
***************
*** 820,827 ****
add_get_index_long(return_value,0,int_key, (void **) &inserted_pointer);
break;
}
! hash_pointer_update(return_value->value.ht, "key", sizeof("key"), (void *) inserted_pointer);
! hash_move_forward(array->value.ht);
}
void array_reset(INTERNAL_FUNCTION_PARAMETERS)
--- 820,827 ----
add_get_index_long(return_value,0,int_key, (void **) &inserted_pointer);
break;
}
! _php3_hashpointer_update(return_value->value.ht, "key", sizeof("key"), (void *) inserted_pointer);
! _php3_hashmove_forward(array->value.ht);
}
void array_reset(INTERNAL_FUNCTION_PARAMETERS)
***************
*** 835,847 ****
php3_error(E_WARNING, "Variable passed to reset() is not an array or object");
return;
}
! hash_internal_pointer_reset(array->value.ht);
while (1) {
! if (hash_get_current_data(array->value.ht, (void **) &entry) == FAILURE) {
return;
}
if (entry->type==IS_STRING && entry->value.str.val==undefined_variable_string) {
! hash_move_forward(array->value.ht);
} else {
break;
}
--- 835,847 ----
php3_error(E_WARNING, "Variable passed to reset() is not an array or object");
return;
}
! _php3_hashinternal_pointer_reset(array->value.ht);
while (1) {
! if (_php3_hashget_current_data(array->value.ht, (void **) &entry) == FAILURE) {
return;
}
if (entry->type==IS_STRING && entry->value.str.val==undefined_variable_string) {
! _php3_hashmove_forward(array->value.ht);
} else {
break;
}
***************
*** 862,868 ****
php3_error(E_WARNING, "Variable passed to current() is not an array or object");
return;
}
! if (hash_get_current_data(array->value.ht, (void **) &entry) == FAILURE) {
return;
}
*return_value = *entry;
--- 862,868 ----
php3_error(E_WARNING, "Variable passed to current() is not an array or object");
return;
}
! if (_php3_hashget_current_data(array->value.ht, (void **) &entry) == FAILURE) {
return;
}
*return_value = *entry;
***************
*** 886,892 ****
if (!ParameterPassedByReference(ht,1)) {
php3_error(E_WARNING, "Array not passed by reference in call to key()");
}
! switch (hash_get_current_key(array->value.ht, &string_key, &int_key)) {
case HASH_KEY_IS_STRING:
return_value->value.str.val = string_key;
return_value->value.str.len = strlen(string_key);
--- 886,892 ----
if (!ParameterPassedByReference(ht,1)) {
php3_error(E_WARNING, "Array not passed by reference in call to key()");
}
! switch (_php3_hashget_current_key(array->value.ht, &string_key, &int_key)) {
case HASH_KEY_IS_STRING:
return_value->value.str.val = string_key;
return_value->value.str.len = strlen(string_key);
***************
*** 1018,1024 ****
arr->type != IS_ARRAY) {
WRONG_PARAM_COUNT;
}
! if (hash_minmax(arr->value.ht, array_data_compare, 0, (void **) &result)==SUCCESS) {
*return_value = *result;
yystype_copy_constructor(return_value);
} else {
--- 1018,1024 ----
arr->type != IS_ARRAY) {
WRONG_PARAM_COUNT;
}
! if (_php3_hashminmax(arr->value.ht, array_data_compare, 0, (void **) &result)==SUCCESS) {
*return_value = *result;
yystype_copy_constructor(return_value);
} else {
***************
*** 1026,1032 ****
var_uninit(return_value);
}
} else {
! if (hash_minmax(ht, array_data_compare, 0, (void **) &result)==SUCCESS) {
*return_value = *result;
yystype_copy_constructor(return_value);
}
--- 1026,1032 ----
var_uninit(return_value);
}
} else {
! if (_php3_hashminmax(ht, array_data_compare, 0, (void **) &result)==SUCCESS) {
*return_value = *result;
yystype_copy_constructor(return_value);
}
***************
*** 1052,1058 ****
arr->type != IS_ARRAY) {
WRONG_PARAM_COUNT;
}
! if (hash_minmax(arr->value.ht, array_data_compare, 1, (void **) &result)==SUCCESS) {
*return_value = *result;
yystype_copy_constructor(return_value);
} else {
--- 1052,1058 ----
arr->type != IS_ARRAY) {
WRONG_PARAM_COUNT;
}
! if (_php3_hashminmax(arr->value.ht, array_data_compare, 1, (void **) &result)==SUCCESS) {
*return_value = *result;
yystype_copy_constructor(return_value);
} else {
***************
*** 1060,1066 ****
var_uninit(return_value);
}
} else {
! if (hash_minmax(ht, array_data_compare, 1, (void **) &result)==SUCCESS) {
*return_value = *result;
yystype_copy_constructor(return_value);
}
--- 1060,1066 ----
var_uninit(return_value);
}
} else {
! if (_php3_hashminmax(ht, array_data_compare, 1, (void **) &result)==SUCCESS) {
*return_value = *result;
yystype_copy_constructor(return_value);
}
***************
*** 1092,1098 ****
}
/* replace the function parameters with the array */
ht = argv[0]->value.ht;
! argc = hash_num_elements(ht);
efree(argv);
} else if (argc < 2) {
WRONG_PARAM_COUNT;
--- 1092,1098 ----
}
/* replace the function parameters with the array */
ht = argv[0]->value.ht;
! argc = _php3_hashnum_elements(ht);
efree(argv);
} else if (argc < 2) {
WRONG_PARAM_COUNT;
Index: php31/ext/standard/browscap.c
diff -c php31/ext/standard/browscap.c:1.2 php31/ext/standard/browscap.c:1.3
*** php31/ext/standard/browscap.c:1.2 Wed May 27 23:25:25 1998
--- php31/ext/standard/browscap.c Fri Jun 26 12:53:06 1998
***************
*** 59,65 ****
if (GLOBAL(found_browser_entry)) { /* already found */
return 0;
}
! hash_find(browser->value.ht,"browser_name_pattern",sizeof("browser_name_pattern"),(void **) &browser_name);
if (!strchr(browser_name->value.str.val,'*')) {
return 0;
}
--- 59,65 ----
if (GLOBAL(found_browser_entry)) { /* already found */
return 0;
}
! _php3_hashfind(browser->value.ht,"browser_name_pattern",sizeof("browser_name_pattern"),(void **) &browser_name);
if (!strchr(browser_name->value.str.val,'*')) {
return 0;
}
***************
*** 84,90 ****
switch(ARG_COUNT(ht)) {
case 0:
! if (hash_find(&GLOBAL(symbol_table), "HTTP_USER_AGENT", sizeof("HTTP_USER_AGENT"), (void **) &agent_name)==FAILURE) {
agent_name = &tmp;
var_reset(agent_name);
}
--- 84,90 ----
switch(ARG_COUNT(ht)) {
case 0:
! if (_php3_hashfind(&GLOBAL(symbol_table), "HTTP_USER_AGENT", sizeof("HTTP_USER_AGENT"), (void **) &agent_name)==FAILURE) {
agent_name = &tmp;
var_reset(agent_name);
}
***************
*** 101,114 ****
convert_to_string(agent_name);
! if (hash_find(&GLOBAL(browser_hash), agent_name->value.str.val, agent_name->value.str.len+1, (void **) &agent)==FAILURE) {
GLOBAL(lookup_browser_name) = agent_name->value.str.val;
GLOBAL(found_browser_entry) = NULL;
! hash_apply(&GLOBAL(browser_hash),(int (*)(void *)) browser_reg_compare);
if (GLOBAL(found_browser_entry)) {
agent = GLOBAL(found_browser_entry);
! } else if (hash_find(&GLOBAL(browser_hash), "Default Browser", sizeof("Default Browser"), (void **) &agent)==FAILURE) {
RETURN_FALSE;
}
}
--- 101,114 ----
convert_to_string(agent_name);
! if (_php3_hashfind(&GLOBAL(browser_hash), agent_name->value.str.val, agent_name->value.str.len+1, (void **) &agent)==FAILURE) {
GLOBAL(lookup_browser_name) = agent_name->value.str.val;
GLOBAL(found_browser_entry) = NULL;
! _php3_hashapply(&GLOBAL(browser_hash),(int (*)(void *)) browser_reg_compare);
if (GLOBAL(found_browser_entry)) {
agent = GLOBAL(found_browser_entry);
! } else if (_php3_hashfind(&GLOBAL(browser_hash), "Default Browser", sizeof("Default Browser"), (void **) &agent)==FAILURE) {
RETURN_FALSE;
}
}
***************
*** 118,128 ****
yystype_copy_constructor(return_value);
return_value->value.ht->pDestructor = pval_DESTRUCTOR;
! while (hash_find(agent->value.ht, "parent", sizeof("parent"), (void **) &agent_name)==SUCCESS) {
! if (hash_find(&GLOBAL(browser_hash), agent_name->value.str.val, agent_name->value.str.len+1, (void **) &agent)==FAILURE) {
break;
}
! hash_merge(return_value->value.ht,agent->value.ht,(void (*)(void *pData)) yystype_copy_constructor, (void *) &tmp, sizeof(pval));
}
}
--- 118,128 ----
yystype_copy_constructor(return_value);
return_value->value.ht->pDestructor = pval_DESTRUCTOR;
! while (_php3_hashfind(agent->value.ht, "parent", sizeof("parent"), (void **) &agent_name)==SUCCESS) {
! if (_php3_hashfind(&GLOBAL(browser_hash), agent_name->value.str.val, agent_name->value.str.len+1, (void **) &agent)==FAILURE) {
break;
}
! _php3_hashmerge(return_value->value.ht,agent->value.ht,(void (*)(void *pData)) yystype_copy_constructor, (void *) &tmp, sizeof(pval));
}
}
Index: php31/ext/standard/dir.c
diff -c php31/ext/standard/dir.c:1.3 php31/ext/standard/dir.c:1.4
*** php31/ext/standard/dir.c:1.3 Wed Jun 3 01:45:00 1998
--- php31/ext/standard/dir.c Fri Jun 26 12:53:06 1998
***************
*** 27,33 ****
+----------------------------------------------------------------------+
*/
! /* $Id: dir.c,v 1.3 1998/06/03 05:45:00 shane Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
--- 27,33 ----
+----------------------------------------------------------------------+
*/
! /* $Id: dir.c,v 1.4 1998/06/26 16:53:06 zeev Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
***************
*** 113,119 ****
if (ARG_COUNT(ht) == 0) {
if (getThis(&id) == SUCCESS) {
! if (hash_find(id->value.ht, "handle", sizeof("handle"), (void **)&tmp) == FAILURE) {
php3_error(E_WARNING, "unable to find my handle property");
RETURN_FALSE;
}
--- 113,119 ----
if (ARG_COUNT(ht) == 0) {
if (getThis(&id) == SUCCESS) {
! if (_php3_hashfind(id->value.ht, "handle", sizeof("handle"), (void **)&tmp) == FAILURE) {
php3_error(E_WARNING, "unable to find my handle property");
RETURN_FALSE;
}
***************
*** 165,171 ****
if (ARG_COUNT(ht) == 0) {
if (getThis(&id) == SUCCESS) {
! if (hash_find(id->value.ht, "handle", sizeof("handle"), (void **)&tmp) == FAILURE) {
php3_error(E_WARNING, "unable to find my handle property");
RETURN_FALSE;
}
--- 165,171 ----
if (ARG_COUNT(ht) == 0) {
if (getThis(&id) == SUCCESS) {
! if (_php3_hashfind(id->value.ht, "handle", sizeof("handle"), (void **)&tmp) == FAILURE) {
php3_error(E_WARNING, "unable to find my handle property");
RETURN_FALSE;
}
***************
*** 199,205 ****
if (ARG_COUNT(ht) == 0) {
if (getThis(&id) == SUCCESS) {
! if (hash_find(id->value.ht, "handle", sizeof("handle"), (void **)&tmp) == FAILURE) {
php3_error(E_WARNING, "unable to find my handle property");
RETURN_FALSE;
}
--- 199,205 ----
if (ARG_COUNT(ht) == 0) {
if (getThis(&id) == SUCCESS) {
! if (_php3_hashfind(id->value.ht, "handle", sizeof("handle"), (void **)&tmp) == FAILURE) {
php3_error(E_WARNING, "unable to find my handle property");
RETURN_FALSE;
}
Index: php31/ext/standard/dl.c
diff -c php31/ext/standard/dl.c:1.6 php31/ext/standard/dl.c:1.7
*** php31/ext/standard/dl.c:1.6 Thu Jun 25 20:58:45 1998
--- php31/ext/standard/dl.c Fri Jun 26 12:53:06 1998
***************
*** 161,167 ****
}
/* update the .request_started property... */
! if (hash_find(&GLOBAL(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);
return FAILURE;
}
--- 161,167 ----
}
/* update the .request_started property... */
! if (_php3_hashfind(&GLOBAL(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);
return FAILURE;
}
Index: php31/ext/standard/dns.c
diff -c php31/ext/standard/dns.c:1.3 php31/ext/standard/dns.c:1.4
*** php31/ext/standard/dns.c:1.3 Mon Jun 8 11:13:00 1998
--- php31/ext/standard/dns.c Fri Jun 26 12:53:07 1998
***************
*** 28,34 ****
+----------------------------------------------------------------------+
*/
! /* $Id: dns.c,v 1.3 1998/06/08 15:13:00 shane Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
--- 28,34 ----
+----------------------------------------------------------------------+
*/
! /* $Id: dns.c,v 1.4 1998/06/26 16:53:07 zeev Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
***************
*** 307,317 ****
tmp1.value.str.len = strlen(buf);
tmp1.value.str.val = estrndup(buf,tmp1.value.str.len);
tmp1.type = IS_STRING;
! hash_next_index_insert(mx_list->value.ht, (void *)&tmp1, sizeof(pval), NULL);
if ( need_weight ) {
tmp2.value.lval = (long)weight;
tmp2.type = IS_LONG;
! hash_next_index_insert(weight_list->value.ht, (void *)&tmp2, sizeof(pval), NULL);
}
}
RETURN_TRUE;
--- 307,317 ----
tmp1.value.str.len = strlen(buf);
tmp1.value.str.val = estrndup(buf,tmp1.value.str.len);
tmp1.type = IS_STRING;
! _php3_hashnext_index_insert(mx_list->value.ht, (void *)&tmp1, sizeof(pval), NULL);
if ( need_weight ) {
tmp2.value.lval = (long)weight;
tmp2.type = IS_LONG;
! _php3_hashnext_index_insert(weight_list->value.ht, (void *)&tmp2, sizeof(pval), NULL);
}
}
RETURN_TRUE;
Index: php31/ext/standard/exec.c
diff -c php31/ext/standard/exec.c:1.6 php31/ext/standard/exec.c:1.7
*** php31/ext/standard/exec.c:1.6 Thu Jun 25 20:58:45 1998
--- php31/ext/standard/exec.c Fri Jun 26 12:53:07 1998
***************
*** 26,32 ****
| Author: Rasmus Lerdorf |
+----------------------------------------------------------------------+
*/
! /* $Id: exec.c,v 1.6 1998/06/26 00:58:45 shane Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
--- 26,32 ----
| Author: Rasmus Lerdorf |
+----------------------------------------------------------------------+
*/
! /* $Id: exec.c,v 1.7 1998/06/26 16:53:07 zeev Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
***************
*** 138,144 ****
tmp.value.str.len = strlen(buf);
tmp.value.str.val = estrndup(buf,tmp.value.str.len);
tmp.type = IS_STRING;
! hash_next_index_insert(array->value.ht,(void *) &tmp, sizeof(pval), NULL);
}
}
--- 138,144 ----
tmp.value.str.len = strlen(buf);
tmp.value.str.val = estrndup(buf,tmp.value.str.len);
tmp.type = IS_STRING;
! _php3_hashnext_index_insert(array->value.ht,(void *) &tmp, sizeof(pval), NULL);
}
}
Index: php31/ext/standard/info.c
diff -c php31/ext/standard/info.c:1.8 php31/ext/standard/info.c:1.9
*** php31/ext/standard/info.c:1.8 Thu Jun 25 20:58:46 1998
--- php31/ext/standard/info.c Fri Jun 26 12:53:07 1998
***************
*** 123,129 ****
PUTS("HSREGEX=" PHP_HSREGEX "</td></tr>\n");
! hash_apply(&GLOBAL(module_registry),(int (*)(void *))_display_module_info);
PUTS("</table>\n");
--- 123,129 ----
PUTS("HSREGEX=" PHP_HSREGEX "</td></tr>\n");
! _php3_hashapply(&GLOBAL(module_registry),(int (*)(void *))_display_module_info);
PUTS("</table>\n");
Index: php31/ext/standard/post.c
diff -c php31/ext/standard/post.c:1.10 php31/ext/standard/post.c:1.11
*** php31/ext/standard/post.c:1.10 Thu Jun 25 20:58:46 1998
--- php31/ext/standard/post.c Fri Jun 26 12:53:08 1998
***************
*** 151,166 ****
pval arr1, arr2, *arr_ptr, entry;
/* If the array doesn't exist, create it */
! if (hash_find(GLOBAL(active_symbol_table), var, var_len+1, (void **) &arr_ptr) == FAILURE) {
if (array_init(&arr1)==FAILURE) {
return;
}
! hash_update(GLOBAL(active_symbol_table), var, var_len+1, &arr1, sizeof(pval), NULL);
if (track_vars_array) {
if (array_init(&arr2)==FAILURE) {
return;
}
! hash_update(track_vars_array->value.ht, var, var_len+1, (void *) &arr2, sizeof(pval),NULL);
}
} else {
if (arr_ptr->type!=IS_ARRAY) {
--- 151,166 ----
pval arr1, arr2, *arr_ptr, entry;
/* If the array doesn't exist, create it */
! if (_php3_hashfind(GLOBAL(active_symbol_table), var, var_len+1, (void **) &arr_ptr) == FAILURE) {
if (array_init(&arr1)==FAILURE) {
return;
}
! _php3_hashupdate(GLOBAL(active_symbol_table), var, var_len+1, &arr1, sizeof(pval), NULL);
if (track_vars_array) {
if (array_init(&arr2)==FAILURE) {
return;
}
! _php3_hashupdate(track_vars_array->value.ht, var, var_len+1, (void *) &arr2, sizeof(pval),NULL);
}
} else {
if (arr_ptr->type!=IS_ARRAY) {
***************
*** 172,182 ****
if (array_init(&arr2)==FAILURE) {
return;
}
! hash_update(track_vars_array->value.ht, var, var_len+1, (void *) &arr2, sizeof(pval),NULL);
}
}
arr1 = *arr_ptr;
! if (track_vars_array && hash_find(track_vars_array->value.ht, var, var_len+1, (void **) &arr_ptr) == FAILURE) {
return;
}
arr2 = *arr_ptr;
--- 172,182 ----
if (array_init(&arr2)==FAILURE) {
return;
}
! _php3_hashupdate(track_vars_array->value.ht, var, var_len+1, (void *) &arr2, sizeof(pval),NULL);
}
}
arr1 = *arr_ptr;
! if (track_vars_array && _php3_hashfind(track_vars_array->value.ht, var, var_len+1, (void **) &arr_ptr) == FAILURE) {
return;
}
arr2 = *arr_ptr;
***************
*** 193,217 ****
/* And then insert it */
if (ret) { /* indexed array */
if (php3_check_type(ret) == IS_LONG) {
! hash_index_update(arr1.value.ht, atol(ret), &entry, sizeof(pval),NULL); /* s[ret]=tmp */
if (track_vars_array) {
yystype_copy_constructor(&entry);
! hash_index_update(arr2.value.ht, atol(ret), &entry, sizeof(pval),NULL);
}
} else {
! hash_update(arr1.value.ht, ret, strlen(ret)+1, &entry, sizeof(pval),NULL); /* s["ret"]=tmp */
if (track_vars_array) {
yystype_copy_constructor(&entry);
! hash_update(arr2.value.ht, ret, strlen(ret)+1, &entry, sizeof(pval),NULL);
}
}
efree(ret);
ret = NULL;
} else { /* non-indexed array */
! hash_next_index_insert(arr1.value.ht, &entry, sizeof(pval),NULL);
if (track_vars_array) {
yystype_copy_constructor(&entry);
! hash_next_index_insert(arr2.value.ht, &entry, sizeof(pval),NULL);
}
}
} else { /* we have a normal variable */
--- 193,217 ----
/* And then insert it */
if (ret) { /* indexed array */
if (php3_check_type(ret) == IS_LONG) {
! _php3_hashindex_update(arr1.value.ht, atol(ret), &entry, sizeof(pval),NULL); /* s[ret]=tmp */
if (track_vars_array) {
yystype_copy_constructor(&entry);
! _php3_hashindex_update(arr2.value.ht, atol(ret), &entry, sizeof(pval),NULL);
}
} else {
! _php3_hashupdate(arr1.value.ht, ret, strlen(ret)+1, &entry, sizeof(pval),NULL); /* s["ret"]=tmp */
if (track_vars_array) {
yystype_copy_constructor(&entry);
! _php3_hashupdate(arr2.value.ht, ret, strlen(ret)+1, &entry, sizeof(pval),NULL);
}
}
efree(ret);
ret = NULL;
} else { /* non-indexed array */
! _php3_hashnext_index_insert(arr1.value.ht, &entry, sizeof(pval),NULL);
if (track_vars_array) {
yystype_copy_constructor(&entry);
! _php3_hashnext_index_insert(arr2.value.ht, &entry, sizeof(pval),NULL);
}
}
} else { /* we have a normal variable */
***************
*** 224,233 ****
entry.value.str.val = estrndup(tmp,entry.value.str.len);
}
entry.type = IS_STRING;
! hash_update(GLOBAL(active_symbol_table), var, var_len+1, (void *) &entry, sizeof(pval),NULL);
if (track_vars_array) {
yystype_copy_constructor(&entry);
! hash_update(track_vars_array->value.ht, var, var_len+1, (void *) &entry, sizeof(pval),NULL);
}
}
--- 224,233 ----
entry.value.str.val = estrndup(tmp,entry.value.str.len);
}
entry.type = IS_STRING;
! _php3_hashupdate(GLOBAL(active_symbol_table), var, var_len+1, (void *) &entry, sizeof(pval),NULL);
if (track_vars_array) {
yystype_copy_constructor(&entry);
! _php3_hashupdate(track_vars_array->value.ht, var, var_len+1, (void *) &entry, sizeof(pval),NULL);
}
}
***************
*** 251,263 ****
array_ptr = &array;
switch (arg) {
case PARSE_POST:
! hash_add(&GLOBAL(symbol_table), "HTTP_POST_VARS", sizeof("HTTP_POST_VARS"), array_ptr, sizeof(pval),NULL);
break;
case PARSE_GET:
! hash_add(&GLOBAL(symbol_table), "HTTP_GET_VARS", sizeof("HTTP_GET_VARS"), array_ptr, sizeof(pval),NULL);
break;
case PARSE_COOKIE:
! hash_add(&GLOBAL(symbol_table), "HTTP_COOKIE_VARS", sizeof("HTTP_COOKIE_VARS"), array_ptr, sizeof(pval),NULL);
break;
}
} else {
--- 251,263 ----
array_ptr = &array;
switch (arg) {
&nbs

