cvs: php-src /ext/date php_date.c /ext/dom node.c /ext/filter logical_filters.c /ext/session session.c /ext/simplexml simplexml.c /ext/soap
php_encoding.c php_packet_soap.c soap.c /ext/sqlite sqlite.c /ext/standard basic_functions.c datetime.c dns.c file.c filestat.c http_fopen_wrapper.c
image.c info.c iptc.c microtime.c proc_open.c scanf.c streamsfuncs.c string.c url.c /ext/zlib zlib.c /main main.c output.c php_variables.c
/main/streams filter.c memory.c streams.c unicode_filter.c userspace.c xp_socket.c ZendEngine2 zend_API.c zend_API.h zend_builtin_functions.c
zend_compile.c zend_exceptions.c zend_execute_API.c zend_hash.c zend_hash.h zend_operators.c zend_vm_def.h zend_vm_execute.h zend_vm_execute.skl

From: Date: Tue, 19 Sep 2006 10:38:32 +0000
Subject: cvs: php-src /ext/date php_date.c /ext/dom node.c /ext/filter logical_filters.c /ext/session session.c /ext/simplexml simplexml.c /ext/soap
php_encoding.c php_packet_soap.c soap.c /ext/sqlite sqlite.c /ext/standard basic_functions.c datetime.c dns.c file.c filestat.c http_fopen_wrapper.c
image.c info.c iptc.c microtime.c proc_open.c scanf.c streamsfuncs.c string.c url.c /ext/zlib zlib.c /main main.c output.c php_variables.c
/main/streams filter.c memory.c streams.c unicode_filter.c userspace.c xp_socket.c ZendEngine2 zend_API.c zend_API.h zend_builtin_functions.c
zend_compile.c zend_exceptions.c zend_execute_API.c zend_hash.c zend_hash.h zend_operators.c zend_vm_def.h zend_vm_execute.h zend_vm_execute.skl
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-40585@lists.php.net to get a copy of this message
dmitry Tue Sep 19 10:38:32 2006 UTC Modified files: /ZendEngine2 zend_API.c zend_API.h zend_builtin_functions.c zend_compile.c zend_exceptions.c zend_execute_API.c zend_hash.c zend_hash.h zend_operators.c zend_vm_def.h zend_vm_execute.h zend_vm_execute.skl /php-src/ext/date php_date.c /php-src/ext/dom node.c /php-src/ext/filter logical_filters.c /php-src/ext/session session.c /php-src/ext/simplexml simplexml.c /php-src/ext/soap php_encoding.c php_packet_soap.c soap.c /php-src/ext/sqlite sqlite.c /php-src/ext/standard basic_functions.c datetime.c dns.c file.c filestat.c http_fopen_wrapper.c image.c info.c iptc.c microtime.c proc_open.c scanf.c streamsfuncs.c string.c url.c /php-src/ext/zlib zlib.c /php-src/main main.c output.c php_variables.c /php-src/main/streams filter.c memory.c streams.c unicode_filter.c userspace.c xp_socket.c Log: Disabled autoconversion of hash keys (from string to unicode) for PHP arrays

http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.c?r1=1.404&r2=1.405&diff_format=u Index: ZendEngine2/zend_API.c diff -u ZendEngine2/zend_API.c:1.404 ZendEngine2/zend_API.c:1.405 --- ZendEngine2/zend_API.c:1.404 Tue Sep 19 07:39:25 2006 +++ ZendEngine2/zend_API.c Tue Sep 19 10:38:30 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.c,v 1.404 2006/09/19 07:39:25 dmitry Exp $ */ +/* $Id: zend_API.c,v 1.405 2006/09/19 10:38:30 dmitry Exp $ */ #include "zend.h" #include "zend_execute.h" @@ -1150,11 +1150,9 @@ ZEND_API int _array_init(zval *arg ZEND_FILE_LINE_DC) { - TSRMLS_FETCH(); - ALLOC_HASHTABLE_REL(Z_ARRVAL_P(arg)); - zend_u_hash_init(Z_ARRVAL_P(arg), 0, NULL, ZVAL_PTR_DTOR, 0, UG(unicode)); + zend_u_hash_init(Z_ARRVAL_P(arg), 0, NULL, ZVAL_PTR_DTOR, 0, 0); Z_TYPE_P(arg) = IS_ARRAY; return SUCCESS; } @@ -1320,520 +1318,31 @@ } -ZEND_API int add_assoc_long_ex(zval *arg, char *key, uint key_len, long n) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_LONG(tmp, n); - - return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - -ZEND_API int add_u_assoc_long_ex(zval *arg, zend_uchar type, zstr key, uint key_len, long n) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_LONG(tmp, n); - - return zend_u_symtable_update(Z_ARRVAL_P(arg), type, key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - -ZEND_API int add_assoc_null_ex(zval *arg, char *key, uint key_len) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_NULL(tmp); - - return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - -ZEND_API int add_u_assoc_null_ex(zval *arg, zend_uchar type, zstr key, uint key_len) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_NULL(tmp); - - return zend_u_symtable_update(Z_ARRVAL_P(arg), type, key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - -ZEND_API int add_assoc_bool_ex(zval *arg, char *key, uint key_len, int b) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_BOOL(tmp, b); - - return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - -ZEND_API int add_u_assoc_bool_ex(zval *arg, zend_uchar type, zstr key, uint key_len, int b) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_BOOL(tmp, b); - - return zend_u_symtable_update(Z_ARRVAL_P(arg), type, key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - -ZEND_API int add_assoc_resource_ex(zval *arg, char *key, uint key_len, int r) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_RESOURCE(tmp, r); - - return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_u_assoc_resource_ex(zval *arg, zend_uchar type, zstr key, uint key_len, int r) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_RESOURCE(tmp, r); - - return zend_u_symtable_update(Z_ARRVAL_P(arg), type, key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_assoc_double_ex(zval *arg, char *key, uint key_len, double d) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_DOUBLE(tmp, d); - - return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_u_assoc_double_ex(zval *arg, zend_uchar type, zstr key, uint key_len, double d) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_DOUBLE(tmp, d); - - return zend_u_symtable_update(Z_ARRVAL_P(arg), type, key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_STRING(tmp, str, duplicate); - - return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_u_assoc_string_ex(zval *arg, zend_uchar type, zstr key, uint key_len, char *str, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_STRING(tmp, str, duplicate); - - return zend_u_symtable_update(Z_ARRVAL_P(arg), type, key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_STRINGL(tmp, str, length, duplicate); - - return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_u_assoc_stringl_ex(zval *arg, zend_uchar type, zstr key, uint key_len, char *str, uint length, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_STRINGL(tmp, str, length, duplicate); - - return zend_u_symtable_update(Z_ARRVAL_P(arg), type, key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_assoc_unicode_ex(zval *arg, char *key, uint key_len, UChar *str, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_UNICODE(tmp, str, duplicate); - - return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_u_assoc_unicode_ex(zval *arg, zend_uchar type, zstr key, uint key_len, UChar *str, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_UNICODE(tmp, str, duplicate); - - return zend_u_symtable_update(Z_ARRVAL_P(arg), type, key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_assoc_unicodel_ex(zval *arg, char *key, uint key_len, UChar *str, uint length, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_UNICODEL(tmp, str, length, duplicate); - - return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - -ZEND_API int add_u_assoc_unicodel_ex(zval *arg, zend_uchar type, zstr key, uint key_len, UChar *str, uint length, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_UNICODEL(tmp, str, length, duplicate); - - return zend_u_symtable_update(Z_ARRVAL_P(arg), type, key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - -ZEND_API int add_assoc_zstr_ex(zval *arg, char *key, uint key_len, zend_uchar type, zstr str, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_ZSTR(tmp, str, type, duplicate); - - return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - -ZEND_API int add_assoc_zstrl_ex(zval *arg, char *key, uint key_len, zend_uchar type, zstr str, uint length, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_ZSTRL(tmp, str, length, type, duplicate); - - return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - -ZEND_API int add_assoc_utf8_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate) -{ - zval *tmp; - TSRMLS_FETCH(); - - MAKE_STD_ZVAL(tmp); - ZVAL_UTF8_STRINGL(tmp, str, length, duplicate); - - return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - -ZEND_API int add_u_assoc_utf8_stringl_ex(zval *arg, zend_uchar type, zstr key, uint key_len, char *str, uint length, int duplicate) -{ - zval *tmp; - TSRMLS_FETCH(); - - MAKE_STD_ZVAL(tmp); - ZVAL_UTF8_STRINGL(tmp, str, length, duplicate); - - return zend_u_symtable_update(Z_ARRVAL_P(arg), type, key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - ZEND_API int add_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value) { return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &value, sizeof(zval *), NULL); } -ZEND_API int add_u_assoc_zval_ex(zval *arg, zend_uchar type, zstr key, uint key_len, zval *value) +ZEND_API int add_ascii_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value) { - return zend_u_symtable_update(Z_ARRVAL_P(arg), type, key, key_len, (void *) &value, sizeof(zval *), NULL); + return zend_ascii_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void*)&value, sizeof(zval*), NULL); } -ZEND_API int add_index_long(zval *arg, ulong index, long n) +ZEND_API int add_rt_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value) { - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_LONG(tmp, n); - - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); + return zend_rt_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void*)&value, sizeof(zval*), NULL); } - -ZEND_API int add_index_null(zval *arg, ulong index) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_NULL(tmp); - - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); -} - -ZEND_API int add_index_bool(zval *arg, ulong index, int b) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_BOOL(tmp, b); - - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_index_resource(zval *arg, ulong index, int r) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_RESOURCE(tmp, r); - - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_index_double(zval *arg, ulong index, double d) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_DOUBLE(tmp, d); - - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_index_string(zval *arg, ulong index, char *str, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_STRING(tmp, str, duplicate); - - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_index_stringl(zval *arg, ulong index, char *str, uint length, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_STRINGL(tmp, str, length, duplicate); - - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_index_unicode(zval *arg, ulong index, UChar *str, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_UNICODE(tmp, str, duplicate); - - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_index_unicodel(zval *arg, ulong index, UChar *str, uint length, int duplicate) +ZEND_API int add_u_assoc_zval_ex(zval *arg, zend_uchar type, zstr key, uint key_len, zval *value) { - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_UNICODEL(tmp, str, length, duplicate); - - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); + return zend_u_symtable_update(Z_ARRVAL_P(arg), type, key, key_len, (void *) &value, sizeof(zval *), NULL); } - ZEND_API int add_index_zval(zval *arg, ulong index, zval *value) { return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &value, sizeof(zval *), NULL); } -ZEND_API int add_index_utf8_string(zval *arg, ulong index, char *str, int duplicate) -{ - zval *tmp; - TSRMLS_FETCH(); - - MAKE_STD_ZVAL(tmp); - ZVAL_UTF8_STRING(tmp, str, duplicate); - - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_index_utf8_stringl(zval *arg, ulong index, char *str, uint length, int duplicate) -{ - zval *tmp; - TSRMLS_FETCH(); - - MAKE_STD_ZVAL(tmp); - ZVAL_UTF8_STRINGL(tmp, str, length, duplicate); - - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_next_index_long(zval *arg, long n) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_LONG(tmp, n); - - return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_next_index_null(zval *arg) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_NULL(tmp); - - return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_next_index_bool(zval *arg, int b) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_BOOL(tmp, b); - - return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_next_index_resource(zval *arg, int r) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_RESOURCE(tmp, r); - - return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_next_index_double(zval *arg, double d) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_DOUBLE(tmp, d); - - return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_next_index_string(zval *arg, char *str, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_STRING(tmp, str, duplicate); - - return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_next_index_stringl(zval *arg, char *str, uint length, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_STRINGL(tmp, str, length, duplicate); - - return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_next_index_unicode(zval *arg, UChar *str, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_UNICODE(tmp, str, duplicate); - - return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_next_index_unicodel(zval *arg, UChar *str, uint length, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_UNICODEL(tmp, str, length, duplicate); - - return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_next_index_utf8_string(zval *arg, char *str, int duplicate) -{ - zval *tmp; - TSRMLS_FETCH(); - - MAKE_STD_ZVAL(tmp); - ZVAL_UTF8_STRING(tmp, str, duplicate); - - return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_next_index_utf8_stringl(zval *arg, char *str, uint length, int duplicate) -{ - zval *tmp; - TSRMLS_FETCH(); - - MAKE_STD_ZVAL(tmp); - ZVAL_UTF8_STRINGL(tmp, str, length, duplicate); - - return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_next_index_zstr(zval *arg, zstr str, zend_uchar type, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_ZSTR(tmp, str, type, duplicate); - - return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_next_index_zstrl(zval *arg, zstr str, uint length, zend_uchar type, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_ZSTRL(tmp, str, length, type, duplicate); - - return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); -} - - ZEND_API int add_next_index_zval(zval *arg, zval *value) { return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &value, sizeof(zval *), NULL); @@ -2845,7 +2354,7 @@ va_start(symbol_table_list, num_symbol_tables); while (num_symbol_tables-- > 0) { symbol_table = va_arg(symbol_table_list, HashTable *); - zend_hash_update(symbol_table, name, name_length + 1, &symbol, sizeof(zval *), NULL); + zend_rt_hash_update(symbol_table, name, name_length + 1, &symbol, sizeof(zval *), NULL); zval_add_ref(&symbol); } va_end(symbol_table_list); http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.h?r1=1.259&r2=1.260&diff_format=u Index: ZendEngine2/zend_API.h diff -u ZendEngine2/zend_API.h:1.259 ZendEngine2/zend_API.h:1.260 --- ZendEngine2/zend_API.h:1.259 Mon Sep 18 17:59:10 2006 +++ ZendEngine2/zend_API.h Tue Sep 19 10:38:30 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.h,v 1.259 2006/09/18 17:59:10 andrei Exp $ */ +/* $Id: zend_API.h,v 1.260 2006/09/19 10:38:30 dmitry Exp $ */ #ifndef ZEND_API_H #define ZEND_API_H @@ -323,90 +323,131 @@ /* no longer supported */ ZEND_API int add_assoc_function(zval *arg, char *key, void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS)); -ZEND_API int add_assoc_long_ex(zval *arg, char *key, uint key_len, long n); -ZEND_API int add_assoc_null_ex(zval *arg, char *key, uint key_len); -ZEND_API int add_assoc_bool_ex(zval *arg, char *key, uint key_len, int b); -ZEND_API int add_assoc_resource_ex(zval *arg, char *key, uint key_len, int r); -ZEND_API int add_assoc_double_ex(zval *arg, char *key, uint key_len, double d); -ZEND_API int add_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, int duplicate); -ZEND_API int add_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate); -ZEND_API int add_assoc_unicode_ex(zval *arg, char *key, uint key_len, UChar *str, int duplicate); -ZEND_API int add_assoc_unicodel_ex(zval *arg, char *key, uint key_len, UChar *str, uint length, int duplicate); -ZEND_API int add_assoc_zstr_ex(zval *arg, char *key, uint key_len, zend_uchar str_type, zstr str, int duplicate); -ZEND_API int add_assoc_zstrl_ex(zval *arg, char *key, uint key_len, zend_uchar str_type, zstr str, uint str_len, int duplicate); -ZEND_API int add_assoc_utf8_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate); -ZEND_API int add_u_assoc_utf8_stringl_ex(zval *arg, zend_uchar type, zstr key, uint key_len, char *str, uint length, int duplicate); -ZEND_API int add_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value); - #define ZSTR_DUPLICATE (1<<0) #define ZSTR_AUTOFREE (1<<1) -#define add_assoc_text_ex(arg, key, key_len, str, duplicate) \ - if (UG(unicode)) { \ - add_assoc_unicode_ex(arg, key, key_len, (str).u, duplicate); \ - } else { \ - add_assoc_string_ex(arg, key, key_len, (str).s, duplicate); \ - } - -#define add_assoc_textl_ex(arg, key, key_len, str, length, duplicate) \ - if (UG(unicode)) { \ - add_assoc_unicodel_ex(arg, key, key_len, (str).u, length, duplicate); \ - } else { \ - add_assoc_stringl_ex(arg, key, key_len, (str).s, length, duplicate); \ - } +ZEND_API int add_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value); -#define add_assoc_ascii_string_ex(arg, key, key_len, str, flags) \ - if (UG(unicode)) { \ - uint length = strlen(str); \ - UChar *u_str = zend_ascii_to_unicode((str), length+1 ZEND_FILE_LINE_CC); \ - if ((flags) & ZSTR_AUTOFREE) { \ - efree(str); \ +#define add_assoc_null_ex(arg, key, key_len) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_NULL(___tmp); \ + add_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_assoc_long_ex(arg, key, key_len, n) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_LONG(___tmp, n); \ + add_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_assoc_bool_ex(arg, key, key_len, b) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_BOOL(___tmp, b); \ + add_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_assoc_resource_ex(arg, key, key_len, r) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_RESOURCE(___tmp, r); \ + add_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_assoc_double_ex(arg, key, key_len, d) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_DOUBLE(___tmp, d); \ + add_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_assoc_stringl_ex(arg, key, key_len, str, length, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_STRINGL(___tmp, str, length, duplicate); \ + add_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_assoc_unicode_ex(arg, key, key_len, str, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_UNICODE(___tmp, str, duplicate); \ + add_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_assoc_unicodel_ex(arg, key, key_len, str, length, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_UNICODEL(___tmp, str, length, duplicate); \ + add_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_assoc_zstr_ex(arg, key, key_len, type, str, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_ZSTR(___tmp, str, type, duplicate); \ + add_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_assoc_zstrl_ex(arg, key, key_len, type, str, length, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_ZSTRL(___tmp, str, length, type, duplicate); \ + add_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_assoc_text_ex(arg, key, key_len, str, duplicate) do { \ + if (UG(unicode)) { \ + add_assoc_unicode_ex(arg, key, key_len, (str).u, duplicate); \ + } else { \ + add_assoc_string_ex(arg, key, key_len, (str).s, duplicate); \ } \ - add_assoc_unicodel_ex(arg, key, key_len, u_str, length, 0); \ - } else { \ - add_assoc_string_ex(arg, key, key_len, (char*)(str), (flags) & ZSTR_DUPLICATE); \ - } - -#define add_assoc_ascii_stringl_ex(arg, key, key_len, str, length, flags) \ - if (UG(unicode)) { \ - UChar *u_str = zend_ascii_to_unicode((str), (length)+1 ZEND_FILE_LINE_CC); \ - if ((flags) & ZSTR_AUTOFREE) { \ - efree(str); \ + } while (0) +#define add_assoc_textl_ex(arg, key, key_len, str, length, duplicate) do { \ + if (UG(unicode)) { \ + add_assoc_unicodel_ex(arg, key, key_len, (str).u, length, duplicate); \ + } else { \ + add_assoc_stringl_ex(arg, key, key_len, (str).s, length, duplicate); \ } \ - add_assoc_unicodel_ex(arg, key, key_len, u_str, length, 0); \ - } else { \ - add_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ - } + } while (0) -#define add_assoc_rt_string_ex(arg, key, key_len, str, flags) \ - if (UG(unicode)) { \ - UErrorCode status = U_ZERO_ERROR; \ - UChar *u_str; \ - int u_len; \ - int length = strlen(str); \ - zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, str, length, &status); \ - if ((flags) & ZSTR_AUTOFREE) { \ - efree(str); \ +#define add_assoc_ascii_stringl_ex(arg, key, key_len, str, length, flags) do { \ + if (UG(unicode)) { \ + UChar *___u_str = zend_ascii_to_unicode((str), (length)+1 ZEND_FILE_LINE_CC); \ + if ((flags) & ZSTR_AUTOFREE) { \ + efree(str); \ + } \ + add_assoc_unicodel_ex(arg, key, key_len, ___u_str, length, 0); \ + } else { \ + add_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ } \ - add_assoc_unicodel_ex(arg, key, key_len, u_str, u_len, 0); \ - } else { \ - add_assoc_string_ex(arg, key, key_len, (char*)(str), (flags) & ZSTR_DUPLICATE); \ - } - -#define add_assoc_rt_stringl_ex(arg, key, key_len, str, length, flags) \ - if (UG(unicode)) { \ - UErrorCode status = U_ZERO_ERROR; \ - UChar *u_str; \ - int u_len; \ - zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, str, length, &status); \ - if ((flags) & ZSTR_AUTOFREE) { \ - efree(str); \ + } while (0) +#define add_assoc_rt_stringl_ex(arg, key, key_len, str, length, flags) do { \ + if (UG(unicode)) { \ + UErrorCode ___status = U_ZERO_ERROR; \ + UChar *___u_str; \ + int ___u_len; \ + zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length, &___status); \ + if ((flags) & ZSTR_AUTOFREE) { \ + efree(str); \ + } \ + add_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \ + } else { \ + add_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ } \ - add_assoc_unicodel_ex(arg, key, key_len, u_str, u_len, 0); \ - } else { \ - add_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ - } + } while (0) +#define add_assoc_utf8_stringl_ex(arg, key, key_len, str, length, flags) do { \ + if (UG(unicode)) { \ + UErrorCode ___status = U_ZERO_ERROR; \ + UChar *___u_str; \ + int ___u_len; \ + zend_string_to_unicode_ex(UG(utf8_conv), &___u_str, &___u_len, str, length, &___status); \ + if ((flags) & ZSTR_AUTOFREE) { \ + efree(str); \ + } \ + add_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \ + } else { \ + add_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ + } \ + } while (0) +#define add_assoc_string_ex(arg, key, key_len, str, flags) add_assoc_stringl_ex(arg, key, key_len, str, strlen(str), flags) +#define add_assoc_ascii_string_ex(arg, key, key_len, str, flags) add_assoc_ascii_stringl_ex(arg, key, key_len, str, strlen(str), flags) +#define add_assoc_rt_string_ex(arg, key, key_len, str, flags) add_assoc_rt_stringl_ex(arg, key, key_len, str, strlen(str), flags) +#define add_assoc_utf8_string_ex(arg, key, key_len, str, flags) add_assoc_utf8_stringl_ex(arg, key, key_len, str, strlen(str), flags) +#define add_assoc_zval(__arg, __key, __value) add_assoc_zval_ex(__arg, __key, strlen(__key)+1, __value) #define add_assoc_long(__arg, __key, __n) add_assoc_long_ex(__arg, __key, strlen(__key)+1, __n) #define add_assoc_null(__arg, __key) add_assoc_null_ex(__arg, __key, strlen(__key) + 1) #define add_assoc_bool(__arg, __key, __b) add_assoc_bool_ex(__arg, __key, strlen(__key)+1, __b) @@ -418,206 +459,693 @@ #define add_assoc_unicodel(__arg, __key, __str, __length, __duplicate) add_assoc_unicodel_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate) #define add_assoc_zstr(__arg, __key, __type, __str, __duplicate) add_assoc_zstr_ex(__arg, __key, strlen(__key)+1, __type, __str, __duplicate) #define add_assoc_zstrl(__arg, __key, __type, __str, __length, __duplicate) add_assoc_zstrl_ex(__arg, __key, strlen(__key)+1, __type, __str, __length, __duplicate) -#define add_assoc_zval(__arg, __key, __value) add_assoc_zval_ex(__arg, __key, strlen(__key)+1, __value) +#define add_assoc_ascii_string(arg, key, str, flags) add_assoc_ascii_string_ex(arg, key, strlen(key)+1, str, flags) +#define add_assoc_ascii_stringl(arg, key, str, length, flags) add_assoc_ascii_stringl_ex(arg, key, strlen(key)+1, str, length, flags) #define add_assoc_rt_string(__arg, __key, __str, __duplicate) add_assoc_rt_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate) #define add_assoc_rt_stringl(__arg, __key, __str, __length, __duplicate) add_assoc_rt_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate) #define add_assoc_utf8_string(__arg, __key, __str, __duplicate) add_assoc_utf8_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate) #define add_assoc_utf8_stringl(__arg, __key, __str, __length, __duplicate) add_assoc_utf8_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate) +#define add_assoc_text(arg, key, str, duplicate) add_assoc_text_ex(arg, key, strlen(key)+1, str, duplicate) +#define add_assoc_textl(arg, key, str, length, duplicate) add_assoc_textl_ex(arg, key, strlen(key)+1, str, length, duplicate) -#define add_assoc_text(arg, key, str, duplicate) \ - if (UG(unicode)) { \ - add_assoc_unicode(arg, key, (str).u, duplicate); \ - } else { \ - add_assoc_string(arg, key, (str).s, duplicate); \ - } +ZEND_API int add_ascii_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value); -#define add_assoc_textl(arg, key, str, length, duplicate) \ - if (UG(unicode)) { \ - add_assoc_unicodel(arg, key, (str).u, length, duplicate); \ - } else { \ - add_assoc_stringl(arg, key, (str).s, length, duplicate); \ - } +#define add_ascii_assoc_null_ex(arg, key, key_len) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_NULL(___tmp); \ + add_ascii_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_ascii_assoc_long_ex(arg, key, key_len, n) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_LONG(___tmp, n); \ + add_ascii_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_ascii_assoc_bool_ex(arg, key, key_len, b) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_BOOL(___tmp, b); \ + add_ascii_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_ascii_assoc_resource_ex(arg, key, key_len, r) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_RESOURCE(___tmp, r); \ + add_ascii_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_ascii_assoc_double_ex(arg, key, key_len, d) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_DOUBLE(___tmp, d); \ + add_ascii_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_ascii_assoc_stringl_ex(arg, key, key_len, str, length, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_STRINGL(___tmp, str, length, duplicate); \ + add_ascii_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_ascii_assoc_unicode_ex(arg, key, key_len, str, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_UNICODE(___tmp, str, duplicate); \ + add_ascii_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_ascii_assoc_unicodel_ex(arg, key, key_len, str, length, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_UNICODEL(___tmp, str, length, duplicate); \ + add_ascii_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_ascii_assoc_zstr_ex(arg, key, key_len, type, str, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_ZSTR(___tmp, str, type, duplicate); \ + add_ascii_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_ascii_assoc_zstrl_ex(arg, key, key_len, type, str, length, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_ZSTRL(___tmp, str, length, type, duplicate); \ + add_ascii_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_ascii_assoc_text_ex(arg, key, key_len, str, duplicate) do { \ + if (UG(unicode)) { \ + add_ascii_assoc_unicode_ex(arg, key, key_len, (str).u, duplicate); \ + } else { \ + add_ascii_assoc_string_ex(arg, key, key_len, (str).s, duplicate); \ + } \ + } while (0) +#define add_ascii_assoc_textl_ex(arg, key, key_len, str, length, duplicate) do { \ + if (UG(unicode)) { \ + add_ascii_assoc_unicodel_ex(arg, key, key_len, (str).u, length, duplicate); \ + } else { \ + add_ascii_assoc_stringl_ex(arg, key, key_len, (str).s, length, duplicate); \ + } \ + } while (0) -#define add_assoc_ascii_string(arg, key, str, flags) \ - if (UG(unicode)) { \ - uint length = strlen(str); \ - UChar *u_str = zend_ascii_to_unicode((str), length+1 ZEND_FILE_LINE_CC); \ - if ((flags) & ZSTR_AUTOFREE) { \ - efree(str); \ +#define add_ascii_assoc_ascii_stringl_ex(arg, key, key_len, str, length, flags) do { \ + if (UG(unicode)) { \ + UChar *___u_str = zend_ascii_to_unicode((str), (length)+1 ZEND_FILE_LINE_CC); \ + if ((flags) & ZSTR_AUTOFREE) { \ + efree(str); \ + } \ + add_ascii_assoc_unicodel_ex(arg, key, key_len, ___u_str, length, 0); \ + } else { \ + add_ascii_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ } \ - add_assoc_unicodel(arg, key, u_str, length, 0); \ - } else { \ - add_assoc_string(arg, key, (char*)(str), (flags) & ZSTR_DUPLICATE); \ - } + } while (0) +#define add_ascii_assoc_rt_stringl_ex(arg, key, key_len, str, length, flags) do { \ + if (UG(unicode)) { \ + UErrorCode ___status = U_ZERO_ERROR; \ + UChar *___u_str; \ + int ___u_len; \ + zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length, &___status); \ + if ((flags) & ZSTR_AUTOFREE) { \ + efree(str); \ + } \ + add_ascii_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \ + } else { \ + add_ascii_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ + } \ + } while (0) +#define add_ascii_assoc_utf8_stringl_ex(arg, key, key_len, str, length, flags) do { \ + if (UG(unicode)) { \ + UErrorCode ___status = U_ZERO_ERROR; \ + UChar *___u_str; \ + int ___u_len; \ + zend_string_to_unicode_ex(UG(utf8_conv), &___u_str, &___u_len, str, length, &___status); \ + if ((flags) & ZSTR_AUTOFREE) { \ + efree(str); \ + } \ + add_ascii_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \ + } else { \ + add_ascii_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ + } \ + } while (0) -#define add_assoc_ascii_stringl(arg, key, str, length, flags) \ - if (UG(unicode)) { \ - UChar *u_str = zend_ascii_to_unicode((str), (length)+1 ZEND_FILE_LINE_CC); \ - if ((flags) & ZSTR_AUTOFREE) { \ - efree(str); \ +#define add_ascii_assoc_string_ex(arg, key, key_len, str, flags) add_ascii_assoc_stringl_ex(arg, key, key_len, str, strlen(str), flags) +#define add_ascii_assoc_ascii_string_ex(arg, key, key_len, str, flags) add_ascii_assoc_ascii_stringl_ex(arg, key, key_len, str, strlen(str), flags) +#define add_ascii_assoc_rt_string_ex(arg, key, key_len, str, flags) add_ascii_assoc_rt_stringl_ex(arg, key, key_len, str, strlen(str), flags) +#define add_ascii_assoc_utf8_string_ex(arg, key, key_len, str, flags) add_ascii_assoc_utf8_stringl_ex(arg, key, key_len, str, strlen(str), flags) + +#define add_ascii_assoc_zval(__arg, __key, __value) add_ascii_assoc_zval_ex(__arg, __key, strlen(__key)+1, __value) +#define add_ascii_assoc_long(__arg, __key, __n) add_ascii_assoc_long_ex(__arg, __key, strlen(__key)+1, __n) +#define add_ascii_assoc_null(__arg, __key) add_ascii_assoc_null_ex(__arg, __key, strlen(__key)+1) +#define add_ascii_assoc_bool(__arg, __key, __b) add_ascii_assoc_bool_ex(__arg, __key, strlen(__key)+1, __b) +#define add_ascii_assoc_resource(__arg, __key, __r) add_ascii_assoc_resource_ex(__arg, __key, strlen(__key)+1, __r) +#define add_ascii_assoc_double(__arg, __key, __d) add_ascii_assoc_double_ex(__arg, __key, strlen(__key)+1, __d) +#define add_ascii_assoc_string(__arg, __key, __str, __duplicate) add_ascii_assoc_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate) +#define add_ascii_assoc_stringl(__arg, __key, __str, __length, __duplicate) add_ascii_assoc_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate) +#define add_ascii_assoc_unicode(__arg, __key, __str, __duplicate) add_ascii_assoc_unicode_ex(__arg, __key, strlen(__key)+1, __str, __duplicate) +#define add_ascii_assoc_unicodel(__arg, __key, __str, __length, __duplicate) add_ascii_assoc_unicodel_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate) +#define add_ascii_assoc_zstr(arg, key, type, str, duplicate) add_ascii_assoc_zstr_ex(arg, key, strlen(key)+1, type, str, duplicate) +#define add_ascii_assoc_zstrl(arg, key, type, str, length, duplicate) add_ascii_assoc_zstrl_ex(arg, key, strlen(key)+1, type, str, length, duplicate) +#define add_ascii_assoc_ascii_string(arg, key, str, flags) add_ascii_assoc_ascii_string_ex(arg, key, strlen(key)+1, str, flags) +#define add_ascii_assoc_ascii_stringl(arg, key, str, length, flags) add_ascii_assoc_ascii_stringl_ex(arg, key, strlen(key)+1, str, length, flags) +#define add_ascii_assoc_rt_string(arg, key, str, flags) add_ascii_assoc_rt_stringl_ex(arg, key, strlen(key)+1, str, strlen(str), flags) +#define add_ascii_assoc_rt_stringl(arg, key, str, length, flags) add_ascii_assoc_rt_stringl_ex(arg, key, strlen(key)+1, str, length, flags) +#define add_ascii_assoc_utf8_string(arg, key, str, flags) add_ascii_assoc_utf8_stringl_ex(arg, key, strlen(key)+1, str, strlen(str), flags) +#define add_ascii_assoc_utf8_stringl(arg, key, str, length, flags) add_ascii_assoc_utf8_stringl_ex(arg, key, strlen(key)+1, str, length, flags) +#define add_ascii_assoc_text(__arg, __key, __str, __duplicate) add_ascii_assoc_test_ex(__arg, __key, strlen(__key)+1, __str, __duplicate) +#define add_ascii_assoc_textl(__arg, __key, __str, __length, __duplicate) add_ascii_assoc_textl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate) + +ZEND_API int add_rt_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value); + +#define add_rt_assoc_null_ex(arg, key, key_len) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_NULL(___tmp); \ + add_rt_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_rt_assoc_long_ex(arg, key, key_len, n) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_LONG(___tmp, n); \ + add_rt_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_rt_assoc_bool_ex(arg, key, key_len, b) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_BOOL(___tmp, b); \ + add_rt_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_rt_assoc_resource_ex(arg, key, key_len, r) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_RESOURCE(___tmp, r); \ + add_rt_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_rt_assoc_double_ex(arg, key, key_len, d) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_DOUBLE(___tmp, d); \ + add_rt_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_rt_assoc_stringl_ex(arg, key, key_len, str, length, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_STRINGL(___tmp, str, length, duplicate); \ + add_rt_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_rt_assoc_unicode_ex(arg, key, key_len, str, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_UNICODE(___tmp, str, duplicate); \ + add_rt_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_rt_assoc_unicodel_ex(arg, key, key_len, str, length, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_UNICODEL(___tmp, str, length, duplicate); \ + add_rt_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_rt_assoc_zstr_ex(arg, key, key_len, type, str, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_ZSTR(___tmp, str, type, duplicate); \ + add_rt_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_rt_assoc_zstrl_ex(arg, key, key_len, type, str, length, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_ZSTRL(___tmp, str, length, type, duplicate); \ + add_rt_assoc_zval_ex(arg, key, key_len, ___tmp); \ + } while (0) +#define add_rt_assoc_text_ex(arg, key, key_len, str, duplicate) do { \ + if (UG(unicode)) { \ + add_rt_assoc_unicode_ex(arg, key, key_len, (str).u, duplicate); \ + } else { \ + add_rt_assoc_string_ex(arg, key, key_len, (str).s, duplicate); \ } \ - add_assoc_unicodel(arg, key, u_str, length, 0); \ - } else { \ - add_assoc_stringl(arg, key, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ - } + } while (0) +#define add_rt_assoc_textl_ex(arg, key, key_len, str, length, duplicate) do { \ + if (UG(unicode)) { \ + add_rt_assoc_unicodel_ex(arg, key, key_len, (str).u, length, duplicate); \ + } else { \ + add_rt_assoc_stringl_ex(arg, key, key_len, (str).s, length, duplicate); \ + } \ + } while (0) -ZEND_API int add_u_assoc_long_ex(zval *arg, zend_uchar type, zstr key, uint key_len, long n); -ZEND_API int add_u_assoc_null_ex(zval *arg, zend_uchar type, zstr key, uint key_len); -ZEND_API int add_u_assoc_bool_ex(zval *arg, zend_uchar type, zstr key, uint key_len, int b); -ZEND_API int add_u_assoc_resource_ex(zval *arg, zend_uchar type, zstr key, uint key_len, int r); -ZEND_API int add_u_assoc_double_ex(zval *arg, zend_uchar type, zstr key, uint key_len, double d); -ZEND_API int add_u_assoc_string_ex(zval *arg, zend_uchar type, zstr key, uint key_len, char *str, int duplicate); -ZEND_API int add_u_assoc_stringl_ex(zval *arg, zend_uchar type, zstr key, uint key_len, char *str, uint length, int duplicate); -ZEND_API int add_u_assoc_unicode_ex(zval *arg, zend_uchar type, zstr key, uint key_len, UChar *str, int duplicate); -ZEND_API int add_u_assoc_unicodel_ex(zval *arg, zend_uchar type, zstr key, uint key_len, UChar *str, uint length, int duplicate); -ZEND_API int add_u_assoc_zval_ex(zval *arg, zend_uchar type, zstr key, uint key_len, zval *value); +#define add_rt_assoc_ascii_stringl_ex(arg, key, key_len, str, length, flags) do { \ + if (UG(unicode)) { \ + UChar *___u_str = zend_ascii_to_unicode((str), (length)+1 ZEND_FILE_LINE_CC); \ + if ((flags) & ZSTR_AUTOFREE) { \ + efree(str); \ + } \ + add_rt_assoc_unicodel_ex(arg, key, key_len, ___u_str, length, 0); \ + } else { \ + add_rt_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ + } \ + } while (0) +#define add_rt_assoc_rt_stringl_ex(arg, key, key_len, str, length, flags) do { \ + if (UG(unicode)) { \ + UErrorCode ___status = U_ZERO_ERROR; \ + UChar *___u_str; \ + int ___u_len; \ + zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length, &___status); \ + if ((flags) & ZSTR_AUTOFREE) { \ + efree(str); \ + } \ + add_rt_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \ + } else { \ + add_rt_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ + } \ + } while (0) +#define add_rt_assoc_utf8_stringl_ex(arg, key, key_len, str, length, flags) do { \ + if (UG(unicode)) { \ + UErrorCode ___status = U_ZERO_ERROR; \ + UChar *___u_str; \ + int ___u_len; \ + zend_string_to_unicode_ex(UG(utf8_conv), &___u_str, &___u_len, str, length, &___status); \ + if ((flags) & ZSTR_AUTOFREE) { \ + efree(str); \ + } \ + add_rt_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \ + } else { \ + add_rt_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ + } \ + } while (0) -#define add_u_assoc_long(__arg, __type, __key, __n) add_u_assoc_long_ex(__arg, __type, __key, (((__type)==IS_UNICODE)?u_strlen((__key).u):strlen((__key).s))+1, __n) -#define add_u_assoc_null(__arg, __type, __key) add_u_assoc_null_ex(__arg, __type, __key, (((__type)==IS_UNICODE)?u_strlen((__key).u):strlen((__key).s))+1) -#define add_u_assoc_bool(__arg, __type, __key, __b) add_u_assoc_bool_ex(__arg, __type, __key, (((__type)==IS_UNICODE)?u_strlen((__key).u):strlen((__key).s))+1, __b) -#define add_u_assoc_resource(__arg, __type, __key, __r) add_u_assoc_resource_ex(__arg, __type, __key, (((__type)==IS_UNICODE)?u_strlen((__key).u):strlen((__key).s))+1, __r) -#define add_u_assoc_double(__arg, __type, __key, __d) add_u_assoc_double_ex(__arg, __type, __key, (((__type)==IS_UNICODE)?u_strlen((__key).u):strlen((__key).s))+1, __d) -#define add_u_assoc_string(__arg, __type, __key, __str, __duplicate) add_u_assoc_string_ex(__arg, __type, __key, (((__type)==IS_UNICODE)?u_strlen((__key).u):strlen((__key).s))+1, __str, __duplicate) -#define add_u_assoc_stringl(__arg, __type, __key, __str, __length, __duplicate) add_u_assoc_stringl_ex(__arg, __type, __key, (((__type)==IS_UNICODE)?u_strlen((__key).u):strlen((__key).s))+1, __str, __length, __duplicate) -#define add_u_assoc_unicode(__arg, __type, __key, __str, __duplicate) add_u_assoc_unicode_ex(__arg, __type, __key, (((__type)==IS_UNICODE)?u_strlen((__key).u):strlen((__key).s))+1, __str, __duplicate) -#define add_u_assoc_unicodel(__arg, __type, __key, __str, __length, __duplicate) add_u_assoc_unicodel_ex(__arg, __type, __key, (((__type)==IS_UNICODE)?u_strlen((__key).u):strlen((__key).s))+1, __str, __length, __duplicate) -#define add_u_assoc_zval(__arg, __type, __key, __value) add_u_assoc_zval_ex(__arg, __type, __key, (((__type)==IS_UNICODE)?u_strlen((__key).u):strlen((__key).s))+1, __value) +#define add_rt_assoc_string_ex(arg, key, key_len, str, flags) add_rt_assoc_stringl_ex(arg, key, key_len, str, strlen(str), flags) +#define add_rt_assoc_ascii_string_ex(arg, key, key_len, str, flags) add_rt_assoc_ascii_stringl_ex(arg, key, key_len, str, strlen(str), flags) +#define add_rt_assoc_rt_string_ex(arg, key, key_len, str, flags) add_rt_assoc_rt_stringl_ex(arg, key, key_len, str, strlen(str), flags) +#define add_rt_assoc_utf8_string_ex(arg, key, key_len, str, flags) add_rt_assoc_utf8_stringl_ex(arg, key, key_len, str, strlen(str), flags) + +#define add_rt_assoc_zval(__arg, __key, __value) add_rt_assoc_zval_ex(__arg, __key, strlen(__key)+1, __value) +#define add_rt_assoc_long(__arg, __key, __n) add_rt_assoc_long_ex(__arg, __key, strlen(__key)+1, __n) +#define add_rt_assoc_null(__arg, __key) add_rt_assoc_null_ex(__arg, __key, strlen(__key)+1) +#define add_rt_assoc_bool(__arg, __key, __b) add_rt_assoc_bool_ex(__arg, __key, strlen(__key)+1, __b) +#define add_rt_assoc_resource(__arg, __key, __r) add_rt_assoc_resource_ex(__arg, __key, strlen(__key)+1, __r) +#define add_rt_assoc_double(__arg, __key, __d) add_rt_assoc_double_ex(__arg, __key, strlen(__key)+1, __d) +#define add_rt_assoc_string(__arg, __key, __str, __duplicate) add_rt_assoc_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate) +#define add_rt_assoc_stringl(__arg, __key, __str, __length, __duplicate) add_rt_assoc_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate) +#define add_rt_assoc_unicode(__arg, __key, __str, __duplicate) add_rt_assoc_unicode_ex(__arg, __key, strlen(__key)+1, __str, __duplicate) +#define add_rt_assoc_unicodel(__arg, __key, __str, __length, __duplicate) add_rt_assoc_unicodel_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate) +#define add_rt_assoc_zstr(arg, key, type, str, duplicate) add_rt_assoc_zstr_ex(arg, key, strlen(key)+1, type, str, duplicate) +#define add_rt_assoc_zstrl(arg, key, type, str, length, duplicate) add_rt_assoc_zstrl_ex(arg, key, strlen(key)+1, type, str, length, duplicate) +#define add_rt_assoc_ascii_string(arg, key, str, flags) add_rt_assoc_ascii_string_ex(arg, key, strlen(key)+1, str, flags) +#define add_rt_assoc_ascii_stringl(arg, key, str, length, flags) add_rt_assoc_ascii_stringl_ex(arg, key, strlen(key)+1, str, length, flags) +#define add_rt_assoc_rt_string(arg, key, str, flags) add_rt_assoc_rt_stringl_ex(arg, key, strlen(key)+1, str, strlen(str), flags) +#define add_rt_assoc_rt_stringl(arg, key, str, length, flags) add_rt_assoc_rt_stringl_ex(arg, key, strlen(key)+1, str, length, flags) +#define add_rt_assoc_utf8_string(arg, key, str, flags) add_rt_assoc_utf8_stringl_ex(arg, key, strlen(key)+1, str, strlen(str), flags) +#define add_rt_assoc_utf8_stringl(arg, key, str, length, flags) add_rt_assoc_utf8_stringl_ex(arg, key, strlen(key)+1, str, length, flags) +#define add_rt_assoc_text(__arg, __key, __str, __duplicate) add_rt_assoc_test_ex(__arg, __key, strlen(__key)+1, __str, __duplicate) +#define add_rt_assoc_textl(__arg, __key, __str, __length, __duplicate) add_rt_assoc_textl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate) -/* unset() functions are only suported for legacy modules and null() functions should be used */ -#define add_assoc_unset(__arg, __key) add_assoc_null_ex(__arg, __key, strlen(__key) + 1) -#define add_index_unset(__arg, __key) add_index_null(__arg, __key) -#define add_next_index_unset(__arg) add_next_index_null(__arg) -#define add_property_unset(__arg, __key) add_property_null(__arg, __key) +ZEND_API int add_u_assoc_zval_ex(zval *arg, zend_uchar type, zstr key, uint key_len, zval *value); -ZEND_API int add_index_long(zval *arg, ulong idx, long n); -ZEND_API int add_index_null(zval *arg, ulong idx); -ZEND_API int add_index_bool(zval *arg, ulong idx, int b); -ZEND_API int add_index_resource(zval *arg, ulong idx, int r); -ZEND_API int add_index_double(zval *arg, ulong idx, double d); -ZEND_API int add_index_string(zval *arg, ulong idx, char *str, int duplicate); -ZEND_API int add_index_stringl(zval *arg, ulong idx, char *str, uint length, int duplicate); -ZEND_API int add_index_unicode(zval *arg, ulong idx, UChar *str, int duplicate); -ZEND_API int add_index_unicodel(zval *arg, ulong idx, UChar *str, uint length, int duplicate); -ZEND_API int add_index_utf8_stringl(zval *arg, ulong index, char *str, uint length, int duplicate); -ZEND_API int add_index_zval(zval *arg, ulong index, zval *value); +#define add_u_assoc_null_ex(arg, type, key, key_len) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_NULL(___tmp); \ + add_u_assoc_zval_ex(arg, type, key, key_len, ___tmp); \ + } while (0) +#define add_u_assoc_long_ex(arg, type, key, key_len, n) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_LONG(___tmp, n); \ + add_u_assoc_zval_ex(arg, type, key, key_len, ___tmp); \ + } while (0) +#define add_u_assoc_bool_ex(arg, type, key, key_len, b) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_BOOL(___tmp, b); \ + add_u_assoc_zval_ex(arg, type, key, key_len, ___tmp); \ + } while (0) +#define add_u_assoc_resource_ex(arg, type, key, key_len, r) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_RESOURCE(___tmp, r); \ + add_u_assoc_zval_ex(arg, type, key, key_len, ___tmp); \ + } while (0) +#define add_u_assoc_double_ex(arg, type, key, key_len, d) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_DOUBLE(___tmp, d); \ + add_u_assoc_zval_ex(arg, type, key, key_len, ___tmp); \ + } while (0) +#define add_u_assoc_stringl_ex(arg, type, key, key_len, str, length, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_STRINGL(___tmp, str, length, duplicate); \ + add_u_assoc_zval_ex(arg, type, key, key_len, ___tmp); \ + } while (0) +#define add_u_assoc_unicode_ex(arg, type, key, key_len, str, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_UNICODE(___tmp, str, duplicate); \ + add_u_assoc_zval_ex(arg, type, key, key_len, ___tmp); \ + } while (0) +#define add_u_assoc_unicodel_ex(arg, type, key, key_len, str, length, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_UNICODEL(___tmp, str, length, duplicate); \ + add_u_assoc_zval_ex(arg, type, key, key_len, ___tmp); \ + } while (0) +#define add_u_assoc_zstr_ex(arg, key_type, key, key_len, type, str, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_ZSTR(___tmp, str, type, duplicate); \ + add_u_assoc_zval_ex(arg, key_type, key, key_len, ___tmp); \ + } while (0) +#define add_u_assoc_zstrl_ex(arg, key_type, key, key_len, type, str, length, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_ZSTRL(___tmp, str, length, type, duplicate); \ + add_u_assoc_zval_ex(arg, key_type, key, key_len, ___tmp); \ + } while (0) +#define add_u_assoc_text_ex(arg, type, key, key_len, str, duplicate) do { \ + if (UG(unicode)) { \ + add_u_assoc_unicode_ex(arg, type, key, key_len, (str).u, duplicate); \ + } else { \ + add_u_assoc_string_ex(arg, type, key, key_len, (str).s, duplicate); \ + } \ + } while (0) +#define add_u_assoc_textl_ex(arg, type, key, key_len, str, length, duplicate) do { \ + if (UG(unicode)) { \ + add_u_assoc_unicodel_ex(arg, type, key, key_len, (str).u, length, duplicate); \ + } else { \ + add_u_assoc_stringl_ex(arg, type, key, key_len, (str).s, length, duplicate); \ + } \ + } while (0) -#define add_index_text(arg, idx, str, duplicate) \ - if (UG(unicode)) { \ - add_index_unicode(arg, idx, (str).u, duplicate); \ - } else { \ - add_index_string(arg, idx, (str).s, duplicate); \ - } +#define add_u_assoc_ascii_stringl_ex(arg, type, key, key_len, str, length, flags) do { \ + if (UG(unicode)) { \ + UChar *___u_str = zend_ascii_to_unicode((str), (length)+1 ZEND_FILE_LINE_CC); \ + if ((flags) & ZSTR_AUTOFREE) { \ + efree(str); \ + } \ + add_u_assoc_unicodel_ex(arg, type, key, key_len, ___u_str, length, 0); \ + } else { \ + add_u_assoc_stringl_ex(arg, type, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ + } \ + } while (0) +#define add_u_assoc_rt_stringl_ex(arg, type, key, key_len, str, length, flags) do { \ + if (UG(unicode)) { \ + UErrorCode ___status = U_ZERO_ERROR; \ + UChar *___u_str; \ + int ___u_len; \ + zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length, &___status); \ + if ((flags) & ZSTR_AUTOFREE) { \ + efree(str); \ + } \ + add_u_assoc_unicodel_ex(arg, type, key, key_len, ___u_str, ___u_len, 0); \ + } else { \ + add_u_assoc_stringl_ex(arg, type, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ + } \ + } while (0) +#define add_u_assoc_utf8_stringl_ex(arg, type, key, key_len, str, length, flags) do { \ + if (UG(unicode)) { \ + UErrorCode ___status = U_ZERO_ERROR; \ + UChar *___u_str; \ + int ___u_len; \ + zend_string_to_unicode_ex(UG(utf8_conv), &___u_str, &___u_len, str, length, &___status); \ + if ((flags) & ZSTR_AUTOFREE) { \ + efree(str); \ + } \ + add_u_assoc_unicodel_ex(arg, type, key, key_len, ___u_str, ___u_len, 0); \ + } else { \ + add_u_assoc_stringl_ex(arg, type, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ + } \ + } while (0) -#define add_index_textl(arg, idx, str, length, duplicate) \ - if (UG(unicode)) { \ - add_index_unicodel(arg, idx, (str).u, length, duplicate); \ - } else { \ - add_index_stringl(arg, idx, (str).s, length, duplicate); \ - } +#define add_u_assoc_string_ex(arg, key_type, key, key_len, str, flags) add_u_assoc_stringl_ex(arg, key_type, key, key_len, str, strlen(str), flags) +#define add_u_assoc_ascii_string_ex(arg, key_type, key, key_len, str, flags) add_u_assoc_ascii_stringl_ex(arg, key_type, key, key_len, str, strlen(str), flags) +#define add_u_assoc_rt_string_ex(arg, key_type, key, key_len, str, flags) add_u_assoc_rt_stringl_ex(arg, key_type, key, key_len, str, strlen(str), flags) +#define add_u_assoc_utf8_string_ex(arg, key_type, key, key_len, str, flags) add_u_assoc_utf8_stringl_ex(arg, key_type, key, key_len, str, strlen(str), flags) + +#define add_u_assoc_zval(__arg, __key_type, __key, __value) add_u_assoc_zval_ex(__arg, __key_type, __key, ((__key_type==IS_UNICODE)?u_strlen(__key.u):strlen(__key.s))+1, __value) +#define add_u_assoc_long(__arg, __key_type, __key, __n) add_u_assoc_long_ex(__arg, __key_type, __key, ((__key_type==IS_UNICODE)?u_strlen(__key.u):strlen(__key.s))+1, __n) +#define add_u_assoc_null(__arg, __key_type, __key) add_u_assoc_null_ex(__arg, __key_type, __key, ((__key_type==IS_UNICODE)?u_strlen(__key.u):strlen(__key.s))+1+1) +#define add_u_assoc_bool(__arg, __key_type, __key, __b) add_u_assoc_bool_ex(__arg, __key_type, __key, ((__key_type==IS_UNICODE)?u_strlen(__key.u):strlen(__key.s))+1, __b) +#define add_u_assoc_resource(__arg, __key_type, __key, __r) add_u_assoc_resource_ex(__arg, __key_type, __key, ((__key_type==IS_UNICODE)?u_strlen(__key.u):strlen(__key.s))+1, __r) +#define add_u_assoc_double(__arg, __key_type, __key, __d) add_u_assoc_double_ex(__arg, __key_type, __key, ((__key_type==IS_UNICODE)?u_strlen(__key.u):strlen(__key.s))+1, __d) +#define add_u_assoc_string(__arg, __key_type, __key, __str, __duplicate) add_u_assoc_string_ex(__arg, __key_type, __key, ((__key_type==IS_UNICODE)?u_strlen(__key.u):strlen(__key.s))+1, __str, __duplicate) +#define add_u_assoc_stringl(__arg, __key_type, __key, __str, __length, __duplicate) add_u_assoc_stringl_ex(__arg, __key_type, __key, ((__key_type==IS_UNICODE)?u_strlen(__key.u):strlen(__key.s))+1, __str, __length, __duplicate) +#define add_u_assoc_unicode(__arg, __key_type, __key, __str, __duplicate) add_u_assoc_unicode_ex(__arg, __key_type, __key, ((__key_type==IS_UNICODE)?u_strlen(__key.u):strlen(__key.s))+1, __str, __duplicate) +#define add_u_assoc_unicodel(__arg, __key_type, __key, __str, __length, __duplicate) add_u_assoc_unicodel_ex(__arg, __key_type, __key, ((__key_type==IS_UNICODE)?u_strlen(__key.u):strlen(__key.s))+1, __str, __length, __duplicate) +#define add_u_assoc_zstr(arg, key_type, key, type, str, duplicate) add_u_assoc_zstr_ex(arg, key_type, key, ((__key_type==IS_UNICODE)?u_strlen(__key.u):strlen(__key.s))+1, type, str, duplicate) +#define add_u_assoc_zstrl(arg, key_type, key, type, str, length, duplicate) add_u_assoc_zstrl_ex(arg, key_type, key, ((__key_type==IS_UNICODE)?u_strlen(__key.u):strlen(__key.s))+1, type, str, length, duplicate) +#define add_u_assoc_ascii_string(arg, key_type, key, str, flags) add_u_assoc_ascii_string_ex(arg, key_type, key, ((__key_type==IS_UNICODE)?u_strlen(__key.u):strlen(__key.s))+1, str, flags) +#define add_u_assoc_ascii_stringl(arg, key_type, key, str, length, flags) add_u_assoc_ascii_stringl_ex(arg, key_type, key, ((__key_type==IS_UNICODE)?u_strlen(__key.u):strlen(__key.s))+1, str, length, flags) +#define add_u_assoc_rt_string(arg, key_type, key, str, flags) add_rt_assoc_u_stringl_ex(arg, key_type, key, ((__key_type==IS_UNICODE)?u_strlen(__key.u):strlen(__key.s))+1, str, strlen(str), flags) +#define add_u_assoc_rt_stringl(arg, key_type, key, str, length, flags) add_u_assoc_rt_stringl_ex(arg, key_type, key, ((__key_type==IS_UNICODE)?u_strlen(__key.u):strlen(__key.s))+1, str, length, flags) +#define add_u_assoc_utf8_string(arg, key_type, key, str, flags) add_u_assoc_utf8_stringl_ex(arg, key_type, key, ((__key_type==IS_UNICODE)?u_strlen(__key.u):strlen(__key.s))+1, str, strlen(str), flags) +#define add_u_assoc_utf8_stringl(arg, key_type, key, str, length, flags) add_u_assoc_utf8_stringl_ex(arg, key_type, key, ((__key_type==IS_UNICODE)?u_strlen(__key.u):strlen(__key.s))+1, str, length, flags) +#define add_u_assoc_text(__arg, __key_type, __key, __str, __duplicate) add_u_assoc_test_ex(__arg, __key_type, __key, ((__key_type==IS_UNICODE)?u_strlen(__key.u):strlen(__key.s))+1, __str, __duplicate) +#define add_u_assoc_textl(__arg, __key_type, __key, __str, __length, __duplicate) add_u_assoc_textl_ex(__arg, __key_type, __key, ((__key_type==IS_UNICODE)?u_strlen(__key.u):strlen(__key.s))+1, __str, __length, __duplicate) -#define add_index_ascii_string(arg, idx, str, flags) \ - if (UG(unicode)) { \ - uint length = strlen(str); \ - UChar *u_str = zend_ascii_to_unicode((str), length+1 ZEND_FILE_LINE_CC); \ - if ((flags) & ZSTR_AUTOFREE) { \ - efree(str); \ - } \ - add_index_unicodel(arg, idx, u_str, length, 0); \ - } else { \ - add_index_string(arg, idx, (char*)(str), (flags) & ZSTR_DUPLICATE); \ - } +ZEND_API int add_index_zval(zval *arg, ulong index, zval *value); -#define add_index_ascii_stringl(arg, idx, str, length, flags) \ - if (UG(unicode)) { \ - UChar *u_str = zend_ascii_to_unicode((str), length+1 ZEND_FILE_LINE_CC); \ - if ((flags) & ZSTR_AUTOFREE) { \ - efree(str); \ +#define add_index_null(arg, idx) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_NULL(___tmp); \ + add_index_zval(arg, idx, ___tmp); \ + } while (0) +#define add_index_long(arg, idx, n) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_LONG(___tmp, n); \ + add_index_zval(arg, idx, ___tmp); \ + } while (0) +#define add_index_bool(arg, idx, b) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_BOOL(___tmp, b); \ + add_index_zval(arg, idx, ___tmp); \ + } while (0) +#define add_index_resource(arg, idx, r) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_RESOURCE(___tmp, r); \ + add_index_zval(arg, idx, ___tmp); \ + } while (0) +#define add_index_double(arg, idx, d) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_DOUBLE(___tmp, d); \ + add_index_zval(arg, idx, ___tmp); \ + } while (0) +#define add_index_stringl(arg, idx, str, length, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_STRINGL(___tmp, str, length, duplicate); \ + add_index_zval(arg, idx, ___tmp); \ + } while (0) +#define add_index_unicode(arg, idx, str, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_UNICODE(___tmp, str, duplicate); \ + add_index_zval(arg, idx, ___tmp); \ + } while (0) +#define add_index_unicodel(arg, idx, str, length, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_UNICODEL(___tmp, str, length, duplicate); \ + add_index_zval(arg, idx, ___tmp); \ + } while (0) +#define add_index_zstr(arg, idx, type, str, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_ZSTR(___tmp, str, type, duplicate); \ + add_index_zval(arg, idx, ___tmp); \ + } while (0) +#define add_index_zstrl(arg, idx, type, str, length, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_ZSTRL(___tmp, str, length, type, duplicate); \ + add_index_zval(arg, idx, ___tmp); \ + } while (0) +#define add_index_text(arg, idx, str, duplicate) do { \ + if (UG(unicode)) { \ + add_index_unicode(arg, idx, (str).u, duplicate); \ + } else { \ + add_index_string(arg, idx, (str).s, duplicate); \ } \ - add_index_unicodel(arg, idx, u_str, length, 0); \ - } else { \ - add_index_stringl(arg, idx, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ - } + } while (0) +#define add_index_textl(arg, idx, str, length, duplicate) do { \ + if (UG(unicode)) { \ + add_index_unicodel(arg, idx, (str).u, length, duplicate); \ + } else { \ + add_index_stringl(arg, idx, (str).s, length, duplicate); \ + } \ + } while (0) -ZEND_API int add_next_index_long(zval *arg, long n); -ZEND_API int add_next_index_null(zval *arg); -ZEND_API int add_next_index_bool(zval *arg, int b); -ZEND_API int add_next_index_resource(zval *arg, int r); -ZEND_API int add_next_index_double(zval *arg, double d); -ZEND_API int add_next_index_string(zval *arg, char *str, int duplicate); -ZEND_API int add_next_index_stringl(zval *arg, char *str, uint length, int duplicate); -ZEND_API int add_next_index_unicode(zval *arg, UChar *str, int duplicate); -ZEND_API int add_next_index_unicodel(zval *arg, UChar *str, uint length, int duplicate); -ZEND_API int add_next_index_utf8_string(zval *arg, char *str, int duplicate); -ZEND_API int add_next_index_utf8_stringl(zval *arg, char *str, uint length, int duplicate); -ZEND_API int add_next_index_zstr(zval *arg, zstr str, zend_uchar type, int duplicate); -ZEND_API int add_next_index_zstrl(zval *arg, zstr str, uint length, zend_uchar type, int duplicate); -ZEND_API int add_next_index_zval(zval *arg, zval *value); +#define add_index_ascii_stringl(arg, idx, str, length, flags) do { \ + if (UG(unicode)) { \ + UChar *___u_str = zend_ascii_to_unicode((str), (length)+1 ZEND_FILE_LINE_CC); \ + if ((flags) & ZSTR_AUTOFREE) { \ + efree(str); \ + } \ + add_index_unicodel(arg, idx, ___u_str, length, 0); \ + } else { \ + add_index_stringl(arg, idx, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ + } \ + } while (0) +#define add_index_rt_stringl(arg, idx, str, length, flags) do {\ + if (UG(unicode)) { \ + UErrorCode ___status = U_ZERO_ERROR; \ + UChar *___u_str; \ + int ___u_len; \ + zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length, &___status); \ + if ((flags) & ZSTR_AUTOFREE) { \ + efree(str); \ + } \ + add_index_unicodel(arg, idx, ___u_str, ___u_len, 0); \ + } else { \ + add_index_stringl(arg, idx, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ + } \ + } while (0) +#define add_index_utf8_stringl(arg, idx, str, length, flags) do { \ + if (UG(unicode)) { \ + UErrorCode ___status = U_ZERO_ERROR; \ + UChar *___u_str; \ + int ___u_len; \ + zend_string_to_unicode_ex(UG(utf8_conv), &___u_str, &___u_len, str, length, &___status); \ + if ((flags) & ZSTR_AUTOFREE) { \ + efree(str); \ + } \ + add_index_unicodel(arg, idx, ___u_str, ___u_len, 0); \ + } else { \ + add_index_stringl(arg, idx, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ + } \ + } while (0) -#define add_next_index_text(arg, str, duplicate) \ - if (UG(unicode)) { \ - add_next_index_unicode(arg, (str).u, duplicate); \ - } else { \ - add_next_index_string(arg, (str).s, duplicate); \ - } +#define add_index_string(arg, idx, str, flags) add_index_stringl(arg, idx, str, strlen(str), flags) +#define add_index_ascii_string(arg, idx, str, flags) add_index_ascii_stringl(arg, idx, str, strlen(str), flags) +#define add_index_rt_string(arg, idx, str, flags) add_index_rt_stringl(arg, idx, str, strlen(str), flags) +#define add_index_utf8_string(arg, idx, str, flags) add_index_utf8_stringl(arg, idx, str, strlen(str), flags) -#define add_next_index_textl(arg, str, length, duplicate) \ - if (UG(unicode)) { \ - add_next_index_unicodel(arg, (str).u, length, duplicate); \ - } else { \ - add_next_index_stringl(arg, (str).s, length, duplicate); \ - } +ZEND_API int add_next_index_zval(zval *arg, zval *value); -#define add_next_index_ascii_string(arg, str, flags) \ - if (UG(unicode)) { \ - uint length = strlen(str); \ - UChar *u_str = zend_ascii_to_unicode((str), length+1 ZEND_FILE_LINE_CC); \ - if ((flags) & ZSTR_AUTOFREE) { \ - efree(str); \ +#define add_next_index_null(arg) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_NULL(___tmp); \ + add_next_index_zval(arg, ___tmp); \ + } while (0) +#define add_next_index_long(arg, n) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_LONG(___tmp, n); \ + add_next_index_zval(arg, ___tmp); \ + } while (0) +#define add_next_index_bool(arg, b) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_BOOL(___tmp, b); \ + add_next_index_zval(arg, ___tmp); \ + } while (0) +#define add_next_index_resource(arg, r) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_RESOURCE(___tmp, r); \ + add_next_index_zval(arg, ___tmp); \ + } while (0) +#define add_next_index_double(arg, d) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_DOUBLE(___tmp, d); \ + add_next_index_zval(arg, ___tmp); \ + } while (0) +#define add_next_index_stringl(arg, str, length, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_STRINGL(___tmp, str, length, duplicate); \ + add_next_index_zval(arg, ___tmp); \ + } while (0) +#define add_next_index_unicode(arg, str, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_UNICODE(___tmp, str, duplicate); \ + add_next_index_zval(arg, ___tmp); \ + } while (0) +#define add_next_index_unicodel(arg, str, length, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_UNICODEL(___tmp, str, length, duplicate); \ + add_next_index_zval(arg, ___tmp); \ + } while (0) +#define add_next_index_zstr(arg, type, str, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_ZSTR(___tmp, str, type, duplicate); \ + add_next_index_zval(arg, ___tmp); \ + } while (0) +#define add_next_index_zstrl(arg, type, str, length, duplicate) do { \ + zval *___tmp; \ + MAKE_STD_ZVAL(___tmp); \ + ZVAL_ZSTRL(___tmp, str, length, type, duplicate); \ + add_next_index_zval(arg, ___tmp); \ + } while (0) +#define add_next_index_text(arg, str, duplicate) do { \ + if (UG(unicode)) { \ + add_next_index_unicode(arg, (str).u, duplicate); \ + } else { \ + add_next_index_string(arg, (str).s, duplicate); \ } \ - add_next_index_unicodel(arg, u_str, length, 0); \ - } else { \ - add_next_index_string(arg, (char*)(str), (flags) & ZSTR_DUPLICATE); \ - } - -#define add_next_index_ascii_stringl(arg, str, length, flags) \ - if (UG(unicode)) { \ - UChar *u_str = zend_ascii_to_unicode((str), length+1 ZEND_FILE_LINE_CC); \ - if ((flags) & ZSTR_AUTOFREE) { \ - efree(str); \ + } while (0) +#define add_next_index_textl(arg, str, length, duplicate) do { \ + if (UG(unicode)) { \ + add_next_index_unicodel(arg, (str).u, length, duplicate); \ + } else { \ + add_next_index_stringl(arg, (str).s, length, duplicate); \ } \ - add_next_index_unicodel(arg, u_str, length, 0); \ - } else { \ - add_next_index_stringl(arg, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ - } + } while (0) -#define add_next_index_rt_string(arg, str, flags) \ - if (UG(unicode)) { \ - UErrorCode status = U_ZERO_ERROR; \ - UChar *u_str; \ - int u_len; \ - int length = strlen(str); \ - zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, str, length, &status); \ - if ((flags) & ZSTR_AUTOFREE) { \ - efree(str); \ +#define add_next_index_ascii_stringl(arg, str, length, flags) do { \ + if (UG(unicode)) { \ + UChar *___u_str = zend_ascii_to_unicode((str), (length)+1 ZEND_FILE_LINE_CC); \ + if ((flags) & ZSTR_AUTOFREE) { \ + efree(str); \ + } \ + add_next_index_unicodel(arg, ___u_str, length, 0); \ + } else { \ + add_next_index_stringl(arg, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ } \ - add_next_index_unicodel(arg, u_str, u_len, 0); \ - } else { \ - add_next_index_string(arg, (char*)(str), (flags) & ZSTR_DUPLICATE); \ - } - -#define add_next_index_rt_stringl(arg, str, length, flags) \ - if (UG(unicode)) { \ - UErrorCode status = U_ZERO_ERROR; \ - UChar *u_str; \ - int u_len; \ - zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, str, length, &status); \ - if ((flags) & ZSTR_AUTOFREE) { \ - efree(str); \ + } while (0) +#define add_next_index_rt_stringl(arg, str, length, flags) do { \ + if (UG(unicode)) { \ + UErrorCode ___status = U_ZERO_ERROR; \ + UChar *___u_str; \ + int ___u_len; \ + zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length, &___status); \ + if ((flags) & ZSTR_AUTOFREE) { \ + efree(str); \ + } \ + add_next_index_unicodel(arg, ___u_str, ___u_len, 0); \ + } else { \ + add_next_index_stringl(arg, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ } \ - add_next_index_unicodel(arg, u_str, u_len, 0); \ - } else { \ - add_next_index_stringl(arg, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ - } + } while (0) +#define add_next_index_utf8_stringl(arg, str, length, flags) do { \ + if (UG(unicode)) { \ + UErrorCode ___status = U_ZERO_ERROR; \ + UChar *___u_str; \ + int ___u_len; \ + zend_string_to_unicode_ex(UG(utf8_conv), &___u_str, &___u_len, str, length, &___status); \ + if ((flags) & ZSTR_AUTOFREE) { \ + efree(str); \ + } \ + add_next_index_unicodel(arg, ___u_str, ___u_len, 0); \ + } else { \ + add_next_index_stringl(arg, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ + } \ + } while (0) + +#define add_next_index_string(arg, str, flags) add_next_index_stringl(arg, str, strlen(str), flags) +#define add_next_index_ascii_string(arg, str, flags) add_next_index_ascii_stringl(arg, str, strlen(str), flags) +#define add_next_index_rt_string(arg, str, flags) add_next_index_rt_stringl(arg, str, strlen(str), flags) +#define add_next_index_utf8_string(arg, str, flags) add_next_index_utf8_stringl(arg, str, strlen(str), flags) + +/* unset() functions are only suported for legacy modules and null() functions should be used */ +#define add_assoc_unset(__arg, __key) add_assoc_null_ex(__arg, __key, strlen(__key) + 1) +#define add_index_unset(__arg, __key) add_index_null(__arg, __key) +#define add_next_index_unset(__arg) add_next_index_null(__arg) +#define add_property_unset(__arg, __key) add_property_null(__arg, __key) ZEND_API int add_get_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, void **dest, int duplicate); ZEND_API int add_get_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, void **dest, int duplicate); @@ -1087,7 +1615,28 @@ } #define ZEND_SET_SYMBOL_WITH_LENGTH(symtable, name, name_length, var, _refcount, _is_ref) \ - ZEND_U_SET_SYMBOL_WITH_LENGTH(symtable, IS_STRING, ZSTR(name), name_length, var, _refcount, _is_ref) + { \ + zval **orig_var; \ + \ + if (zend_rt_hash_find(symtable, (name), (name_length), (void **) &orig_var)==SUCCESS \ + && PZVAL_IS_REF(*orig_var)) { \ + (var)->refcount = (*orig_var)->refcount; \ + (var)->is_ref = 1; \ + \ + if (_refcount) { \ + (var)->refcount += _refcount-1; \ + } \ + zval_dtor(*orig_var); \ + **orig_var = *(var); \ + FREE_ZVAL(var); \ + } else { \ + (var)->is_ref = _is_ref; \ + if (_refcount) { \ + (var)->refcount = _refcount; \ + } \ + zend_rt_hash_update(symtable, (name), (name_length), &(var), sizeof(zval *), NULL); \ + } \ + } #define ZEND_SET_GLOBAL_VAR(name, var) \ ZEND_SET_SYMBOL(&EG(symbol_table), name, var) http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_builtin_functions.c?r1=1.323&r2=1.324&diff_format=u Index: ZendEngine2/zend_builtin_functions.c diff -u ZendEngine2/zend_builtin_functions.c:1.323 ZendEngine2/zend_builtin_functions.c:1.324 --- ZendEngine2/zend_builtin_functions.c:1.323 Mon Aug 14 21:09:30 2006 +++ ZendEngine2/zend_builtin_functions.c Tue Sep 19 10:38:30 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_builtin_functions.c,v 1.323 2006/08/14 21:09:30 andrei Exp $ */ +/* $Id: zend_builtin_functions.c,v 1.324 2006/09/19 10:38:30 dmitry Exp $ */ #include "zend.h" #include "zend_API.h" @@ -434,7 +434,7 @@ } zend_hash_index_update(Z_ARRVAL_P(return_value), 1, &entry, sizeof(zval *), NULL); entry->refcount++; - zend_hash_update(Z_ARRVAL_P(return_value), "value", sizeof("value"), &entry, sizeof(zval *), NULL); + zend_ascii_hash_update(Z_ARRVAL_P(return_value), "value", sizeof("value"), &entry, sizeof(zval *), NULL); entry->refcount++; /* add the key elements */ @@ -449,7 +449,7 @@ add_get_index_long(return_value, 0, num_key, (void **) &inserted_pointer); break; } - zend_hash_update(Z_ARRVAL_P(return_value), "key", sizeof("key"), inserted_pointer, sizeof(zval *), NULL); + zend_ascii_hash_update(Z_ARRVAL_P(return_value), "key", sizeof("key"), inserted_pointer, sizeof(zval *), NULL); (*inserted_pointer)->refcount++; zend_hash_move_forward(target_hash); } @@ -1476,12 +1476,12 @@ zend_hash_apply_with_arguments(EG(function_table), (apply_func_args_t) copy_function_name, 2, internal, user); - if (zend_hash_add(Z_ARRVAL_P(return_value), "internal", sizeof("internal"), (void **)&internal, sizeof(zval *), NULL) == FAILURE) { + if (zend_ascii_hash_add(Z_ARRVAL_P(return_value), "internal", sizeof("internal"), (void **)&internal, sizeof(zval *), NULL) == FAILURE) { zend_error(E_WARNING, "Cannot add internal functions to return value from get_defined_functions()"); RETURN_FALSE; } - if (zend_hash_add(Z_ARRVAL_P(return_value), "user", sizeof("user"), (void **)&user, sizeof(zval *), NULL) == FAILURE) { + if (zend_ascii_hash_add(Z_ARRVAL_P(return_value), "user", sizeof("user"), (void **)&user, sizeof(zval *), NULL) == FAILURE) { zend_error(E_WARNING, "Cannot add user functions to return value from get_defined_functions()"); RETURN_FALSE; } @@ -2035,8 +2035,8 @@ if (skip->op_array) { filename = skip->op_array->filename; lineno = skip->opline->lineno; - add_assoc_rt_string_ex(stack_frame, "file", sizeof("file"), filename, 1); - add_assoc_long_ex(stack_frame, "line", sizeof("line"), lineno); + add_ascii_assoc_rt_string_ex(stack_frame, "file", sizeof("file"), filename, 1); + add_ascii_assoc_long_ex(stack_frame, "line", sizeof("line"), lineno); /* try to fetch args only if an FCALL was just made - elsewise we're in the middle of a function * and debug_baktrace() might have been called by the error_handler. in this case we don't @@ -2050,8 +2050,8 @@ break; } if (prev->op_array) { - add_assoc_string_ex(stack_frame, "file", sizeof("file"), prev->op_array->filename, 1); - add_assoc_long_ex(stack_frame, "line", sizeof("line"), prev->opline->lineno); + add_ascii_assoc_string_ex(stack_frame, "file", sizeof("file"), prev->op_array->filename, 1); + add_ascii_assoc_long_ex(stack_frame, "line", sizeof("line"), prev->opline->lineno); break; } prev = prev->prev_execute_data; @@ -2062,32 +2062,32 @@ function_name = ptr->function_state.function->common.function_name; if (function_name.v) { - add_assoc_text_ex(stack_frame, "function", sizeof("function"), function_name, 1); + add_ascii_assoc_text_ex(stack_frame, "function", sizeof("function"), function_name, 1); if (ptr->object && Z_TYPE_P(ptr->object) == IS_OBJECT) { if (ptr->function_state.function->common.scope) { - add_assoc_textl_ex(stack_frame, "class", sizeof("class"), ptr->function_state.function->common.scope->name, ptr->function_state.function->common.scope->name_length, 1); + add_ascii_assoc_textl_ex(stack_frame, "class", sizeof("class"), ptr->function_state.function->common.scope->name, ptr->function_state.function->common.scope->name_length, 1); } else { zend_uint class_name_len; int dup; dup = zend_get_object_classname(ptr->object, &class_name, &class_name_len TSRMLS_CC); - add_assoc_text_ex(stack_frame, "class", sizeof("class"), class_name, dup); + add_ascii_assoc_text_ex(stack_frame, "class", sizeof("class"), class_name, dup); } if (provide_object) { - add_assoc_zval_ex(stack_frame, "object", sizeof("object"), ptr->object); + add_ascii_assoc_zval_ex(stack_frame, "object", sizeof("object"), ptr->object); ptr->object->refcount++; } - add_assoc_ascii_string_ex(stack_frame, "type", sizeof("type"), "->", 1); + add_ascii_assoc_ascii_string_ex(stack_frame, "type", sizeof("type"), "->", 1); } else if (ptr->function_state.function->common.scope) { - add_assoc_textl_ex(stack_frame, "class", sizeof("class"), ptr->function_state.function->common.scope->name, ptr->function_state.function->common.scope->name_length, 1); - add_assoc_ascii_string_ex(stack_frame, "type", sizeof("type"), "::", 1); + add_ascii_assoc_textl_ex(stack_frame, "class", sizeof("class"), ptr->function_state.function->common.scope->name, ptr->function_state.function->common.scope->name_length, 1); + add_ascii_assoc_ascii_string_ex(stack_frame, "type", sizeof("type"), "::", 1); } if ((! ptr->opline) || ((ptr->opline->opcode == ZEND_DO_FCALL_BY_NAME) || (ptr->opline->opcode == ZEND_DO_FCALL))) { if (arg_stack_consistent && (frames_on_stack > 0)) { - add_assoc_zval_ex(stack_frame, "args", sizeof("args"), debug_backtrace_get_args(&cur_arg_pos TSRMLS_CC)); + add_ascii_assoc_zval_ex(stack_frame, "args", sizeof("args"), debug_backtrace_get_args(&cur_arg_pos TSRMLS_CC)); frames_on_stack--; } } @@ -2136,10 +2136,10 @@ */ add_next_index_rt_string(arg_array, include_filename, 1); - add_assoc_zval_ex(stack_frame, "args", sizeof("args"), arg_array); + add_ascii_assoc_zval_ex(stack_frame, "args", sizeof("args"), arg_array); } - add_assoc_ascii_string_ex(stack_frame, "function", sizeof("function"), function_name.s, 1); + add_ascii_assoc_ascii_string_ex(stack_frame, "function", sizeof("function"), function_name.s, 1); } add_next_index_zval(return_value, stack_frame); http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1.722&r2=1.723&diff_format=u Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.722 ZendEngine2/zend_compile.c:1.723 --- ZendEngine2/zend_compile.c:1.722 Tue Sep 12 11:01:31 2006 +++ ZendEngine2/zend_compile.c Tue Sep 19 10:38:30 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.722 2006/09/12 11:01:31 dmitry Exp $ */ +/* $Id: zend_compile.c,v 1.723 2006/09/19 10:38:30 dmitry Exp $ */ #include <zend_language_parser.h> #include "zend.h" @@ -3522,7 +3522,7 @@ zval_dtor(&offset->u.constant); break; case IS_NULL: - zend_symtable_update(Z_ARRVAL(result->u.constant), "", 1, &element, sizeof(zval *), NULL); + zend_u_symtable_update(Z_ARRVAL(result->u.constant), ZEND_STR_TYPE, EMPTY_ZSTR, 1, &element, sizeof(zval *), NULL); break; case IS_LONG: case IS_BOOL: http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_exceptions.c?r1=1.110&r2=1.111&diff_format=u Index: ZendEngine2/zend_exceptions.c diff -u ZendEngine2/zend_exceptions.c:1.110 ZendEngine2/zend_exceptions.c:1.111 --- ZendEngine2/zend_exceptions.c:1.110 Tue Aug 8 16:58:06 2006 +++ ZendEngine2/zend_exceptions.c Tue Sep 19 10:38:30 2006 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_exceptions.c,v 1.110 2006/08/08 16:58:06 tony2001 Exp $ */ +/* $Id: zend_exceptions.c,v 1.111 2006/09/19 10:38:30 dmitry Exp $ */ #include "zend.h" #include "zend_API.h" @@ -140,16 +140,8 @@ if (message) { if (message_type == IS_UNICODE) { zend_update_property_unicodel(default_exception_ce, object, "message", sizeof("message")-1, message, message_len TSRMLS_CC); - } else if (UG(unicode)) { - UErrorCode status = U_ZERO_ERROR; - UChar *u_str; - int u_len; - - zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, message, message_len, &status); - zend_update_property_unicodel(default_exception_ce, object, "message", sizeof("message")-1, u_str, u_len TSRMLS_CC); - efree(u_str); } else { - zend_update_property_stringl(default_exception_ce, object, "message", sizeof("message")-1, message, message_len TSRMLS_CC); + zend_update_property_rt_stringl(default_exception_ce, object, "message", sizeof("message")-1, message, message_len TSRMLS_CC); } } @@ -179,16 +171,8 @@ if (message) { if (message_type == IS_UNICODE) { zend_update_property_unicodel(default_exception_ce, object, "message", sizeof("message")-1, message, message_len TSRMLS_CC); - } else if (UG(unicode)) { - UErrorCode status = U_ZERO_ERROR; - UChar *u_str; - int u_len; - - zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, message, message_len, &status); - zend_update_property_unicodel(default_exception_ce, object, "message", sizeof("message")-1, u_str, u_len TSRMLS_CC); - efree(u_str); } else { - zend_update_property_stringl(default_exception_ce, object, "message", sizeof("message")-1, message, message_len TSRMLS_CC); + zend_update_property_rt_stringl(default_exception_ce, object, "message", sizeof("message")-1, message, message_len TSRMLS_CC); } } @@ -333,7 +317,7 @@ TRACE_APPEND_STRL(val, sizeof(val)-1) #define TRACE_APPEND_KEY(key) \ - if (zend_hash_find(ht, key, sizeof(key), (void**)&tmp) == SUCCESS) { \ + if (zend_ascii_hash_find(ht, key, sizeof(key), (void**)&tmp) == SUCCESS) { \ if (Z_TYPE_PP(tmp) == IS_UNICODE) { \ zval copy; \ int use_copy; \ @@ -500,8 +484,8 @@ sprintf(s_tmp, "#%d ", (*num)++); TRACE_APPEND_STRL(s_tmp, strlen(s_tmp)); efree(s_tmp); - if (zend_hash_find(ht, "file", sizeof("file"), (void**)&file) == SUCCESS) { - if (zend_hash_find(ht, "line", sizeof("line"), (void**)&tmp) == SUCCESS) { + if (zend_ascii_hash_find(ht, "file", sizeof("file"), (void**)&file) == SUCCESS) { + if (zend_ascii_hash_find(ht, "line", sizeof("line"), (void**)&tmp) == SUCCESS) { line = Z_LVAL_PP(tmp); } else { line = 0; @@ -518,7 +502,7 @@ TRACE_APPEND_KEY("type"); TRACE_APPEND_KEY("function"); TRACE_APPEND_CHR('('); - if (zend_hash_find(ht, "args", sizeof("args"), (void**)&tmp) == SUCCESS) { + if (zend_ascii_hash_find(ht, "args", sizeof("args"), (void**)&tmp) == SUCCESS) { int last_len = *len; zend_hash_apply_with_arguments(Z_ARRVAL_PP(tmp), (apply_func_args_t)_build_trace_args, 2, str, len); if (last_len != *len) { http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute_API.c?r1=1.381&r2=1.382&diff_format=u Index: ZendEngine2/zend_execute_API.c diff -u ZendEngine2/zend_execute_API.c:1.381 ZendEngine2/zend_execute_API.c:1.382 --- ZendEngine2/zend_execute_API.c:1.381 Mon Sep 11 14:28:19 2006 +++ ZendEngine2/zend_execute_API.c Tue Sep 19 10:38:30 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute_API.c,v 1.381 2006/09/11 14:28:19 tony2001 Exp $ */ +/* $Id: zend_execute_API.c,v 1.382 2006/09/19 10:38:30 dmitry Exp $ */ #include <stdio.h> #include <signal.h> @@ -170,7 +170,7 @@ globals->is_ref=1; Z_TYPE_P(globals) = IS_ARRAY; Z_ARRVAL_P(globals) = &EG(symbol_table); - zend_hash_update(&EG(symbol_table), "GLOBALS", sizeof("GLOBALS"), &globals, sizeof(zval *), NULL); + zend_ascii_hash_update(&EG(symbol_table), "GLOBALS", sizeof("GLOBALS"), &globals, sizeof(zval *), NULL); } EG(active_symbol_table) = &EG(symbol_table); http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_hash.c?r1=1.137&r2=1.138&diff_format=u Index: ZendEngine2/zend_hash.c diff -u ZendEngine2/zend_hash.c:1.137 ZendEngine2/zend_hash.c:1.138 --- ZendEngine2/zend_hash.c:1.137 Thu Aug 24 09:42:51 2006 +++ ZendEngine2/zend_hash.c Tue Sep 19 10:38:30 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_hash.c,v 1.137 2006/08/24 09:42:51 dmitry Exp $ */ +/* $Id: zend_hash.c,v 1.138 2006/09/19 10:38:30 dmitry Exp $ */ #include "zend.h" #include "zend_operators.h" @@ -47,6 +47,8 @@ (ht)->pInternalPointer = (element); \ } +#define ZEND_HASH_CVT_ERROR() zend_error(E_WARNING, "Could not convert String to Unicode") + #define UNICODE_KEY(ht, type, arKey, nKeyLength, tmp) \ if (ht->unicode && type == IS_STRING) { \ UErrorCode status = U_ZERO_ERROR; \ @@ -55,10 +57,11 @@ TSRMLS_FETCH(); \ zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u, &u_len, arKey.s, nKeyLength-1, &status); \ if (U_FAILURE(status)) { \ - /* UTODO: */ \ + ZEND_HASH_CVT_ERROR(); \ + } else { \ + type = IS_UNICODE; \ + tmp = arKey.u = u; \ } \ - type = IS_UNICODE; \ - tmp = arKey.u = u; \ } @@ -312,6 +315,48 @@ return _zend_u_hash_add_or_update(ht, IS_STRING, ZSTR(arKey), nKeyLength, pData, nDataSize, pDest, flag ZEND_FILE_LINE_CC); } +ZEND_API int _zend_ascii_hash_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC) +{ + TSRMLS_FETCH(); + + if (UG(unicode)) { + zstr key; + int ret; + + key.u = zend_ascii_to_unicode(arKey, nKeyLength ZEND_FILE_LINE_CC); + ret = _zend_u_hash_add_or_update(ht, IS_UNICODE, key, nKeyLength, pData, nDataSize, pDest, flag ZEND_FILE_LINE_CC); + efree(key.u); + return ret; + } else { + return _zend_u_hash_add_or_update(ht, IS_STRING, ZSTR(arKey), nKeyLength, pData, nDataSize, pDest, flag ZEND_FILE_LINE_CC); + } +} + +ZEND_API int _zend_rt_hash_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC) +{ + TSRMLS_FETCH(); + + if (UG(unicode)) { + zstr key; + int ret; + UErrorCode status = U_ZERO_ERROR; + int u_len; + + zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &key.u, &u_len, arKey, nKeyLength-1, &status); + if (U_FAILURE(status)) { + ZEND_HASH_CVT_ERROR(); + goto string_key; + } + + ret = _zend_u_hash_add_or_update(ht, IS_UNICODE, key, u_len+1, pData, nDataSize, pDest, flag ZEND_FILE_LINE_CC); + efree(key.u); + return ret; + } else { +string_key: + return _zend_u_hash_add_or_update(ht, IS_STRING, ZSTR(arKey), nKeyLength, pData, nDataSize, pDest, flag ZEND_FILE_LINE_CC); + } +} + ZEND_API int _zend_u_hash_quick_add_or_update(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC) { uint nIndex; @@ -594,6 +639,47 @@ return zend_u_hash_del_key_or_index(ht, IS_STRING, ZSTR(arKey), nKeyLength, h, flag); } +ZEND_API int zend_ascii_hash_del(HashTable *ht, char *arKey, uint nKeyLength) +{ + TSRMLS_FETCH(); + + if (UG(unicode)) { + zstr key; + int ret; + + key.u = zend_ascii_to_unicode(arKey, nKeyLength ZEND_FILE_LINE_CC); + ret = zend_u_hash_del_key_or_index(ht, IS_UNICODE, key, nKeyLength, 0, HASH_DEL_KEY); + efree(key.u); + return ret; + } else { + return zend_u_hash_del_key_or_index(ht, IS_STRING, ZSTR(arKey), nKeyLength, 0, HASH_DEL_KEY); + } +} + +ZEND_API int zend_rt_hash_del(HashTable *ht, char *arKey, uint nKeyLength) +{ + TSRMLS_FETCH(); + + if (UG(unicode)) { + zstr key; + int ret; + UErrorCode status = U_ZERO_ERROR; + int u_len; + + zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &key.u, &u_len, arKey, nKeyLength-1, &status); + if (U_FAILURE(status)) { + ZEND_HASH_CVT_ERROR(); + goto string_key; + } + ret = zend_u_hash_del_key_or_index(ht, IS_UNICODE, key, u_len+1, 0, HASH_DEL_KEY); + efree(key.u); + return ret; + } else { +string_key: + return zend_u_hash_del_key_or_index(ht, IS_STRING, ZSTR(arKey), nKeyLength, 0, HASH_DEL_KEY); + } +} + ZEND_API void zend_hash_destroy(HashTable *ht) { Bucket *p, *q; @@ -972,6 +1058,47 @@ return zend_u_hash_find(ht, IS_STRING, ZSTR(arKey), nKeyLength, pData); } +ZEND_API int zend_ascii_hash_find(HashTable *ht, char *arKey, uint nKeyLength, void **pData) +{ + TSRMLS_FETCH(); + + if (UG(unicode)) { + zstr key; + int ret; + + key.u = zend_ascii_to_unicode(arKey, nKeyLength ZEND_FILE_LINE_CC); + ret = zend_u_hash_find(ht, IS_UNICODE, key, nKeyLength, pData); + efree(key.u); + return ret; + } else { + return zend_u_hash_find(ht, IS_STRING, ZSTR(arKey), nKeyLength, pData); + } +} + +ZEND_API int zend_rt_hash_find(HashTable *ht, char *arKey, uint nKeyLength, void **pData) +{ + TSRMLS_FETCH(); + + if (UG(unicode)) { + zstr key; + int ret; + UErrorCode status = U_ZERO_ERROR; + int u_len; + + zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &key.u, &u_len, arKey, nKeyLength-1, &status); + if (U_FAILURE(status)) { + ZEND_HASH_CVT_ERROR(); + goto string_key; + } + ret = zend_u_hash_find(ht, IS_UNICODE, key, u_len+1, pData); + efree(key.u); + return ret; + } else { +string_key: + return zend_u_hash_find(ht, IS_STRING, ZSTR(arKey), nKeyLength, pData); + } +} + ZEND_API int zend_u_hash_quick_find(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, ulong h, void **pData) { @@ -1051,6 +1178,47 @@ return zend_u_hash_exists(ht, IS_STRING, ZSTR(arKey), nKeyLength); } +ZEND_API int zend_ascii_hash_exists(HashTable *ht, char *arKey, uint nKeyLength) +{ + TSRMLS_FETCH(); + + if (UG(unicode)) { + zstr key; + int ret; + + key.u = zend_ascii_to_unicode(arKey, nKeyLength ZEND_FILE_LINE_CC); + ret = zend_u_hash_exists(ht, IS_UNICODE, key, nKeyLength); + efree(key.u); + return ret; + } else { + return zend_u_hash_exists(ht, IS_STRING, ZSTR(arKey), nKeyLength); + } +} + +ZEND_API int zend_rt_hash_exists(HashTable *ht, char *arKey, uint nKeyLength) +{ + TSRMLS_FETCH(); + + if (UG(unicode)) { + zstr key; + int ret; + UErrorCode status = U_ZERO_ERROR; + int u_len; + + zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &key.u, &u_len, arKey, nKeyLength-1, &status); + if (U_FAILURE(status)) { + ZEND_HASH_CVT_ERROR(); + goto string_key; + } + ret = zend_u_hash_exists(ht, IS_UNICODE, key, u_len+1); + efree(key.u); + return ret; + } else { +string_key: + return zend_u_hash_exists(ht, IS_STRING, ZSTR(arKey), nKeyLength); + } +} + ZEND_API int zend_u_hash_quick_exists(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, ulong h) { uint nIndex; @@ -1726,6 +1894,60 @@ return zend_hash_update_current_key(ht, HASH_KEY_IS_STRING, ZSTR(arKey), nKeyLength, 0); } +ZEND_API int zend_ascii_symtable_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest) +{ + HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_update(ht, idx, pData, nDataSize, pDest)); + return zend_ascii_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest); +} + + +ZEND_API int zend_ascii_symtable_del(HashTable *ht, char *arKey, uint nKeyLength) +{ + HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_del(ht, idx)) + return zend_ascii_hash_del(ht, arKey, nKeyLength); +} + + +ZEND_API int zend_ascii_symtable_find(HashTable *ht, char *arKey, uint nKeyLength, void **pData) +{ + HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_find(ht, idx, pData)); + return zend_ascii_hash_find(ht, arKey, nKeyLength, pData); +} + + +ZEND_API int zend_ascii_symtable_exists(HashTable *ht, char *arKey, uint nKeyLength) +{ + HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_exists(ht, idx)); + return zend_ascii_hash_exists(ht, arKey, nKeyLength); +} + +ZEND_API int zend_rt_symtable_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest) +{ + HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_update(ht, idx, pData, nDataSize, pDest)); + return zend_rt_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest); +} + + +ZEND_API int zend_rt_symtable_del(HashTable *ht, char *arKey, uint nKeyLength) +{ + HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_del(ht, idx)) + return zend_rt_hash_del(ht, arKey, nKeyLength); +} + + +ZEND_API int zend_rt_symtable_find(HashTable *ht, char *arKey, uint nKeyLength, void **pData) +{ + HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_find(ht, idx, pData)); + return zend_rt_hash_find(ht, arKey, nKeyLength, pData); +} + + +ZEND_API int zend_rt_symtable_exists(HashTable *ht, char *arKey, uint nKeyLength) +{ + HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_exists(ht, idx)); + return zend_rt_hash_exists(ht, arKey, nKeyLength); +} + ZEND_API void zend_hash_to_unicode(HashTable *ht, apply_func_t apply_func TSRMLS_DC) { Bucket **p; @@ -1747,6 +1969,9 @@ Bucket *q; zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u, &u_len, (*p)->key.arKey.s, (*p)->nKeyLength-1, &status); + if (U_FAILURE(status)) { + zend_error(E_ERROR, "Cannot convert HashTable to Unicode"); + } q = (Bucket *) pemalloc(sizeof(Bucket)-sizeof(q->key.arKey)+((u_len+1)*2), ht->persistent); memcpy(q, *p, sizeof(Bucket)-sizeof(q->key.arKey)); http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_hash.h?r1=1.85&r2=1.86&diff_format=u Index: ZendEngine2/zend_hash.h diff -u ZendEngine2/zend_hash.h:1.85 ZendEngine2/zend_hash.h:1.86 --- ZendEngine2/zend_hash.h:1.85 Tue Feb 21 20:12:41 2006 +++ ZendEngine2/zend_hash.h Tue Sep 19 10:38:30 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_hash.h,v 1.85 2006/02/21 20:12:41 dmitry Exp $ */ +/* $Id: zend_hash.h,v 1.86 2006/09/19 10:38:30 dmitry Exp $ */ #ifndef ZEND_HASH_H #define ZEND_HASH_H @@ -118,13 +118,23 @@ /* additions/updates/changes */ ZEND_API int _zend_hash_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC); +ZEND_API int _zend_ascii_hash_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC); +ZEND_API int _zend_rt_hash_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC); ZEND_API int _zend_u_hash_add_or_update(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC); #define zend_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest) \ _zend_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC) +#define zend_ascii_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest) \ + _zend_ascii_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC) +#define zend_rt_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest) \ + _zend_rt_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC) #define zend_u_hash_update(ht, type, arKey, nKeyLength, pData, nDataSize, pDest) \ _zend_u_hash_add_or_update(ht, type, arKey, nKeyLength, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC) #define zend_hash_add(ht, arKey, nKeyLength, pData, nDataSize, pDest) \ _zend_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_ADD ZEND_FILE_LINE_CC) +#define zend_ascii_hash_add(ht, arKey, nKeyLength, pData, nDataSize, pDest) \ + _zend_ascii_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_ADD ZEND_FILE_LINE_CC) +#define zend_rt_hash_add(ht, arKey, nKeyLength, pData, nDataSize, pDest) \ + _zend_rt_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_ADD ZEND_FILE_LINE_CC) #define zend_u_hash_add(ht, type, arKey, nKeyLength, pData, nDataSize, pDest) \ _zend_u_hash_add_or_update(ht, type, arKey, nKeyLength, pData, nDataSize, pDest, HASH_ADD ZEND_FILE_LINE_CC) @@ -176,6 +186,8 @@ /* Deletes */ ZEND_API int zend_hash_del_key_or_index(HashTable *ht, char *arKey, uint nKeyLength, ulong h, int flag); +ZEND_API int zend_ascii_hash_del(HashTable *ht, char *arKey, uint nKeyLength); +ZEND_API int zend_rt_hash_del(HashTable *ht, char *arKey, uint nKeyLength); ZEND_API int zend_u_hash_del_key_or_index(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, ulong h, int flag); #define zend_hash_del(ht, arKey, nKeyLength) \ zend_hash_del_key_or_index(ht, arKey, nKeyLength, 0, HASH_DEL_KEY) @@ -189,6 +201,8 @@ /* Data retreival */ ZEND_API int zend_hash_find(HashTable *ht, char *arKey, uint nKeyLength, void **pData); +ZEND_API int zend_ascii_hash_find(HashTable *ht, char *arKey, uint nKeyLength, void **pData); +ZEND_API int zend_rt_hash_find(HashTable *ht, char *arKey, uint nKeyLength, void **pData); ZEND_API int zend_u_hash_find(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, void **pData); ZEND_API int zend_hash_quick_find(HashTable *ht, char *arKey, uint nKeyLength, ulong h, void **pData); ZEND_API int zend_u_hash_quick_find(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, ulong h, void **pData); @@ -196,6 +210,8 @@ /* Misc */ ZEND_API int zend_hash_exists(HashTable *ht, char *arKey, uint nKeyLength); +ZEND_API int zend_ascii_hash_exists(HashTable *ht, char *arKey, uint nKeyLength); +ZEND_API int zend_rt_hash_exists(HashTable *ht, char *arKey, uint nKeyLength); ZEND_API int zend_u_hash_exists(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength); ZEND_API int zend_hash_quick_exists(HashTable *ht, char *arKey, uint nKeyLength, ulong h); ZEND_API int zend_u_hash_quick_exists(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, ulong h); @@ -338,6 +354,16 @@ ZEND_API int zend_symtable_exists(HashTable *ht, char *arKey, uint nKeyLength); ZEND_API int zend_symtable_update_current_key(HashTable *ht, char *arKey, uint nKeyLength); +ZEND_API int zend_ascii_symtable_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest); +ZEND_API int zend_ascii_symtable_del(HashTable *ht, char *arKey, uint nKeyLength); +ZEND_API int zend_ascii_symtable_find(HashTable *ht, char *arKey, uint nKeyLength, void **pData); +ZEND_API int zend_ascii_symtable_exists(HashTable *ht, char *arKey, uint nKeyLength); + +ZEND_API int zend_rt_symtable_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest); +ZEND_API int zend_rt_symtable_del(HashTable *ht, char *arKey, uint nKeyLength); +ZEND_API int zend_rt_symtable_find(HashTable *ht, char *arKey, uint nKeyLength, void **pData); +ZEND_API int zend_rt_symtable_exists(HashTable *ht, char *arKey, uint nKeyLength); + ZEND_API int zend_u_symtable_update(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest); ZEND_API int zend_u_symtable_del(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength); ZEND_API int zend_u_symtable_find(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, void **pData); http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_operators.c?r1=1.254&r2=1.255&diff_format=u Index: ZendEngine2/zend_operators.c diff -u ZendEngine2/zend_operators.c:1.254 ZendEngine2/zend_operators.c:1.255 --- ZendEngine2/zend_operators.c:1.254 Wed Aug 2 20:31:40 2006 +++ ZendEngine2/zend_operators.c Tue Sep 19 10:38:30 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_operators.c,v 1.254 2006/08/02 20:31:40 andrei Exp $ */ +/* $Id: zend_operators.c,v 1.255 2006/09/19 10:38:30 dmitry Exp $ */ #include <ctype.h> @@ -985,7 +985,7 @@ switch (type) { case IS_ARRAY: ALLOC_HASHTABLE(Z_ARRVAL_P(op)); - zend_u_hash_init(Z_ARRVAL_P(op), 0, NULL, ZVAL_PTR_DTOR, 0, UG(unicode)); + zend_u_hash_init(Z_ARRVAL_P(op), 0, NULL, ZVAL_PTR_DTOR, 0, 0); zend_hash_index_update(Z_ARRVAL_P(op), 0, (void *) &entry, sizeof(zval *), NULL); Z_TYPE_P(op) = IS_ARRAY; break; @@ -1017,7 +1017,7 @@ HashTable *ht; ALLOC_HASHTABLE(ht); - zend_u_hash_init(ht, 0, NULL, ZVAL_PTR_DTOR, 0, UG(unicode)); + zend_u_hash_init(ht, 0, NULL, ZVAL_PTR_DTOR, 0, 0); if (Z_OBJ_HT_P(op)->get_properties) { HashTable *obj_ht = Z_OBJ_HT_P(op)->get_properties(op TSRMLS_CC); if(obj_ht) { @@ -1037,7 +1037,7 @@ return; case IS_NULL: ALLOC_HASHTABLE(Z_ARRVAL_P(op)); - zend_u_hash_init(Z_ARRVAL_P(op), 0, NULL, ZVAL_PTR_DTOR, 0, UG(unicode)); + zend_u_hash_init(Z_ARRVAL_P(op), 0, NULL, ZVAL_PTR_DTOR, 0, 0); Z_TYPE_P(op) = IS_ARRAY; break; default: http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_def.h?r1=1.142&r2=1.143&diff_format=u Index: ZendEngine2/zend_vm_def.h diff -u ZendEngine2/zend_vm_def.h:1.142 ZendEngine2/zend_vm_def.h:1.143 --- ZendEngine2/zend_vm_def.h:1.142 Tue Sep 19 07:40:38 2006 +++ ZendEngine2/zend_vm_def.h Tue Sep 19 10:38:30 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_vm_def.h,v 1.142 2006/09/19 07:40:38 dmitry Exp $ */ +/* $Id: zend_vm_def.h,v 1.143 2006/09/19 10:38:30 dmitry Exp $ */ /* If you change this file, please regenerate the zend_vm_execute.h and * zend_vm_opcodes.h files by running: @@ -2702,7 +2702,7 @@ zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); break; case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); + zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL); break; default: zend_error(E_WARNING, "Illegal offset type"); @@ -3074,7 +3074,7 @@ break; } case IS_NULL: - zend_hash_del(ht, "", sizeof("")); + zend_u_hash_del(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof("")); break; default: zend_error(E_WARNING, "Illegal offset type in unset"); @@ -3560,7 +3560,7 @@ break; } case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { + if (zend_u_hash_find(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) { isset = 1; } break; http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_execute.h?r1=1.146&r2=1.147&diff_format=u Index: ZendEngine2/zend_vm_execute.h diff -u ZendEngine2/zend_vm_execute.h:1.146 ZendEngine2/zend_vm_execute.h:1.147 --- ZendEngine2/zend_vm_execute.h:1.146 Tue Sep 19 07:40:38 2006 +++ ZendEngine2/zend_vm_execute.h Tue Sep 19 10:38:30 2006 @@ -66,7 +66,7 @@ if (op_array->uses_this && EG(This)) { EG(This)->refcount++; /* For $this pointer */ - if (zend_hash_add(EG(active_symbol_table), "this", sizeof("this"), &EG(This), sizeof(zval *), NULL)==FAILURE) { + if (zend_ascii_hash_add(EG(active_symbol_table), "this", sizeof("this"), &EG(This), sizeof(zval *), NULL)==FAILURE) { EG(This)->refcount--; } } @@ -2725,7 +2725,7 @@ zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); break; case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); + zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL); break; default: zend_error(E_WARNING, "Illegal offset type"); @@ -3085,7 +3085,7 @@ zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); break; case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); + zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL); break; default: zend_error(E_WARNING, "Illegal offset type"); @@ -3445,7 +3445,7 @@ zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); break; case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); + zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL); break; default: zend_error(E_WARNING, "Illegal offset type"); @@ -3539,7 +3539,7 @@ zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); break; case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); + zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL); break; default: zend_error(E_WARNING, "Illegal offset type"); @@ -3898,7 +3898,7 @@ zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); break; case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); + zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL); break; default: zend_error(E_WARNING, "Illegal offset type"); @@ -5408,7 +5408,7 @@ zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); break; case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); + zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL); break; default: zend_error(E_WARNING, "Illegal offset type"); @@ -5856,7 +5856,7 @@ zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); break; case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); + zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL); break; default: zend_error(E_WARNING, "Illegal offset type"); @@ -6304,7 +6304,7 @@ zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); break; case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); + zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL); break; default: zend_error(E_WARNING, "Illegal offset type"); @@ -6398,7 +6398,7 @@ zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); break; case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); + zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL); break; default: zend_error(E_WARNING, "Illegal offset type"); @@ -6843,7 +6843,7 @@ zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); break; case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); + zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL); break; default: zend_error(E_WARNING, "Illegal offset type"); @@ -9501,7 +9501,7 @@ zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); break; case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); + zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL); break; default: zend_error(E_WARNING, "Illegal offset type"); @@ -9613,7 +9613,7 @@ break; } case IS_NULL: - zend_hash_del(ht, "", sizeof("")); + zend_u_hash_del(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof("")); break; default: zend_error(E_WARNING, "Illegal offset type in unset"); @@ -9746,7 +9746,7 @@ break; } case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { + if (zend_u_hash_find(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) { isset = 1; } break; @@ -11041,7 +11041,7 @@ zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); break; case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); + zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL); break; default: zend_error(E_WARNING, "Illegal offset type"); @@ -11153,7 +11153,7 @@ break; } case IS_NULL: - zend_hash_del(ht, "", sizeof("")); + zend_u_hash_del(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof("")); break; default: zend_error(E_WARNING, "Illegal offset type in unset"); @@ -11286,7 +11286,7 @@ break; } case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { + if (zend_u_hash_find(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) { isset = 1; } break; @@ -12619,7 +12619,7 @@ zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); break; case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); + zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL); break; default: zend_error(E_WARNING, "Illegal offset type"); @@ -12731,7 +12731,7 @@ break; } case IS_NULL: - zend_hash_del(ht, "", sizeof("")); + zend_u_hash_del(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof("")); break; default: zend_error(E_WARNING, "Illegal offset type in unset"); @@ -12864,7 +12864,7 @@ break; } case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { + if (zend_u_hash_find(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) { isset = 1; } break; @@ -13368,7 +13368,7 @@ zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); break; case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); + zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL); break; default: zend_error(E_WARNING, "Illegal offset type"); @@ -14627,7 +14627,7 @@ zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); break; case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); + zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL); break; default: zend_error(E_WARNING, "Illegal offset type"); @@ -14739,7 +14739,7 @@ break; } case IS_NULL: - zend_hash_del(ht, "", sizeof("")); + zend_u_hash_del(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof("")); break; default: zend_error(E_WARNING, "Illegal offset type in unset"); @@ -14872,7 +14872,7 @@ break; } case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { + if (zend_u_hash_find(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) { isset = 1; } break; @@ -15882,7 +15882,7 @@ break; } case IS_NULL: - zend_hash_del(ht, "", sizeof("")); + zend_u_hash_del(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof("")); break; default: zend_error(E_WARNING, "Illegal offset type in unset"); @@ -16013,7 +16013,7 @@ break; } case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { + if (zend_u_hash_find(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) { isset = 1; } break; @@ -16899,7 +16899,7 @@ break; } case IS_NULL: - zend_hash_del(ht, "", sizeof("")); + zend_u_hash_del(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof("")); break; default: zend_error(E_WARNING, "Illegal offset type in unset"); @@ -17030,7 +17030,7 @@ break; } case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { + if (zend_u_hash_find(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) { isset = 1; } break; @@ -17916,7 +17916,7 @@ break; } case IS_NULL: - zend_hash_del(ht, "", sizeof("")); + zend_u_hash_del(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof("")); break; default: zend_error(E_WARNING, "Illegal offset type in unset"); @@ -18047,7 +18047,7 @@ break; } case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { + if (zend_u_hash_find(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) { isset = 1; } break; @@ -19197,7 +19197,7 @@ break; } case IS_NULL: - zend_hash_del(ht, "", sizeof("")); + zend_u_hash_del(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof("")); break; default: zend_error(E_WARNING, "Illegal offset type in unset"); @@ -19328,7 +19328,7 @@ break; } case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { + if (zend_u_hash_find(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) { isset = 1; } break; @@ -21878,7 +21878,7 @@ zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); break; case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); + zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL); break; default: zend_error(E_WARNING, "Illegal offset type"); @@ -21990,7 +21990,7 @@ break; } case IS_NULL: - zend_hash_del(ht, "", sizeof("")); + zend_u_hash_del(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof("")); break; default: zend_error(E_WARNING, "Illegal offset type in unset"); @@ -22121,7 +22121,7 @@ break; } case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { + if (zend_u_hash_find(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) { isset = 1; } break; @@ -23410,7 +23410,7 @@ zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); break; case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); + zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL); break; default: zend_error(E_WARNING, "Illegal offset type"); @@ -23522,7 +23522,7 @@ break; } case IS_NULL: - zend_hash_del(ht, "", sizeof("")); + zend_u_hash_del(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof("")); break; default: zend_error(E_WARNING, "Illegal offset type in unset"); @@ -23653,7 +23653,7 @@ break; } case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { + if (zend_u_hash_find(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) { isset = 1; } break; @@ -24979,7 +24979,7 @@ zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); break; case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); + zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL); break; default: zend_error(E_WARNING, "Illegal offset type"); @@ -25091,7 +25091,7 @@ break; } case IS_NULL: - zend_hash_del(ht, "", sizeof("")); + zend_u_hash_del(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof("")); break; default: zend_error(E_WARNING, "Illegal offset type in unset"); @@ -25222,7 +25222,7 @@ break; } case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { + if (zend_u_hash_find(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) { isset = 1; } break; @@ -25723,7 +25723,7 @@ zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); break; case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); + zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL); break; default: zend_error(E_WARNING, "Illegal offset type"); @@ -26977,7 +26977,7 @@ zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); break; case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); + zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL); break; default: zend_error(E_WARNING, "Illegal offset type"); @@ -27089,7 +27089,7 @@ break; } case IS_NULL: - zend_hash_del(ht, "", sizeof("")); + zend_u_hash_del(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof("")); break; default: zend_error(E_WARNING, "Illegal offset type in unset"); @@ -27220,7 +27220,7 @@ break; } case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { + if (zend_u_hash_find(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) { isset = 1; } break; http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_execute.skl?r1=1.5&r2=1.6&diff_format=u Index: ZendEngine2/zend_vm_execute.skl diff -u ZendEngine2/zend_vm_execute.skl:1.5 ZendEngine2/zend_vm_execute.skl:1.6 --- ZendEngine2/zend_vm_execute.skl:1.5 Tue Feb 21 08:00:39 2006 +++ ZendEngine2/zend_vm_execute.skl Tue Sep 19 10:38:30 2006 @@ -37,7 +37,7 @@ if (op_array->uses_this && EG(This)) { EG(This)->refcount++; /* For $this pointer */ - if (zend_hash_add(EG(active_symbol_table), "this", sizeof("this"), &EG(This), sizeof(zval *), NULL)==FAILURE) { + if (zend_ascii_hash_add(EG(active_symbol_table), "this", sizeof("this"), &EG(This), sizeof(zval *), NULL)==FAILURE) { EG(This)->refcount--; } } http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.117&r2=1.118&diff_format=u Index: php-src/ext/date/php_date.c diff -u php-src/ext/date/php_date.c:1.117 php-src/ext/date/php_date.c:1.118 --- php-src/ext/date/php_date.c:1.117 Sun Sep 10 17:01:10 2006 +++ php-src/ext/date/php_date.c Tue Sep 19 10:38:30 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_date.c,v 1.117 2006/09/10 17:01:10 bjori Exp $ */ +/* $Id: php_date.c,v 1.118 2006/09/19 10:38:30 dmitry Exp $ */ #include "php.h" #include "php_streams.h" @@ -1511,15 +1511,15 @@ array_init(return_value); if (associative) { - add_assoc_long(return_value, "tm_sec", ts->s); - add_assoc_long(return_value, "tm_min", ts->i); - add_assoc_long(return_value, "tm_hour", ts->h); - add_assoc_long(return_value, "tm_mday", ts->d); - add_assoc_long(return_value, "tm_mon", ts->m - 1); - add_assoc_long(return_value, "tm_year", ts->y - 1900); - add_assoc_long(return_value, "tm_wday", timelib_day_of_week(ts->y, ts->m, ts->d)); - add_assoc_long(return_value, "tm_yday", timelib_day_of_year(ts->y, ts->m, ts->d)); - add_assoc_long(return_value, "tm_isdst", ts->dst); + add_ascii_assoc_long(return_value, "tm_sec", ts->s); + add_ascii_assoc_long(return_value, "tm_min", ts->i); + add_ascii_assoc_long(return_value, "tm_hour", ts->h); + add_ascii_assoc_long(return_value, "tm_mday", ts->d); + add_ascii_assoc_long(return_value, "tm_mon", ts->m - 1); + add_ascii_assoc_long(return_value, "tm_year", ts->y - 1900); + add_ascii_assoc_long(return_value, "tm_wday", timelib_day_of_week(ts->y, ts->m, ts->d)); + add_ascii_assoc_long(return_value, "tm_yday", timelib_day_of_year(ts->y, ts->m, ts->d)); + add_ascii_assoc_long(return_value, "tm_isdst", ts->dst); } else { add_next_index_long(return_value, ts->s); add_next_index_long(return_value, ts->i); @@ -1556,16 +1556,16 @@ array_init(return_value); - add_assoc_long(return_value, "seconds", ts->s); - add_assoc_long(return_value, "minutes", ts->i); - add_assoc_long(return_value, "hours", ts->h); - add_assoc_long(return_value, "mday", ts->d); - add_assoc_long(return_value, "wday", timelib_day_of_week(ts->y, ts->m, ts->d)); - add_assoc_long(return_value, "mon", ts->m); - add_assoc_long(return_value, "year", ts->y); - add_assoc_long(return_value, "yday", timelib_day_of_year(ts->y, ts->m, ts->d)); - add_assoc_string(return_value, "weekday", php_date_full_day_name(ts->y, ts->m, ts->d), 1); - add_assoc_string(return_value, "month", mon_full_names[ts->m - 1], 1); + add_ascii_assoc_long(return_value, "seconds", ts->s); + add_ascii_assoc_long(return_value, "minutes", ts->i); + add_ascii_assoc_long(return_value, "hours", ts->h); + add_ascii_assoc_long(return_value, "mday", ts->d); + add_ascii_assoc_long(return_value, "wday", timelib_day_of_week(ts->y, ts->m, ts->d)); + add_ascii_assoc_long(return_value, "mon", ts->m); + add_ascii_assoc_long(return_value, "year", ts->y); + add_ascii_assoc_long(return_value, "yday", timelib_day_of_year(ts->y, ts->m, ts->d)); + add_ascii_assoc_string(return_value, "weekday", php_date_full_day_name(ts->y, ts->m, ts->d), 1); + add_ascii_assoc_string(return_value, "month", mon_full_names[ts->m - 1], 1); add_index_long(return_value, 0, timestamp); timelib_time_dtor(ts); @@ -1831,9 +1831,9 @@ array_init(return_value); #define PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(name, elem) \ if (parsed_time->elem == -1) { \ - add_assoc_bool(return_value, #name, 0); \ + add_ascii_assoc_bool(return_value, #name, 0); \ } else { \ - add_assoc_long(return_value, #name, parsed_time->elem); \ + add_ascii_assoc_long(return_value, #name, parsed_time->elem); \ } PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(year, y); PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(month, m); @@ -1843,49 +1843,49 @@ PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(second, s); if (parsed_time->f == -1) { - add_assoc_bool(return_value, "fraction", 0); + add_ascii_assoc_bool(return_value, "fraction", 0); } else { - add_assoc_double(return_value, "fraction", parsed_time->f); + add_ascii_assoc_double(return_value, "fraction", parsed_time->f); } - add_assoc_long(return_value, "warning_count", error->warning_count); + add_ascii_assoc_long(return_value, "warning_count", error->warning_count); MAKE_STD_ZVAL(element); array_init(element); for (i = 0; i < error->warning_count; i++) { add_index_string(element, error->warning_messages[i].position, error->warning_messages[i].message, 1); } - add_assoc_zval(return_value, "warnings", element); + add_ascii_assoc_zval(return_value, "warnings", element); - add_assoc_long(return_value, "error_count", error->error_count); + add_ascii_assoc_long(return_value, "error_count", error->error_count); MAKE_STD_ZVAL(element); array_init(element); for (i = 0; i < error->error_count; i++) { add_index_string(element, error->error_messages[i].position, error->error_messages[i].message, 1); } - add_assoc_zval(return_value, "errors", element); + add_ascii_assoc_zval(return_value, "errors", element); timelib_error_container_dtor(error); - add_assoc_bool(return_value, "is_localtime", parsed_time->is_localtime); + add_ascii_assoc_bool(return_value, "is_localtime", parsed_time->is_localtime); if (parsed_time->is_localtime) { PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(zone_type, zone_type); switch (parsed_time->zone_type) { case TIMELIB_ZONETYPE_OFFSET: PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(zone, z); - add_assoc_bool(return_value, "is_dst", parsed_time->dst); + add_ascii_assoc_bool(return_value, "is_dst", parsed_time->dst); break; case TIMELIB_ZONETYPE_ID: if (parsed_time->tz_abbr) { - add_assoc_string(return_value, "tz_abbr", parsed_time->tz_abbr, 1); + add_ascii_assoc_string(return_value, "tz_abbr", parsed_time->tz_abbr, 1); } if (parsed_time->tz_info) { - add_assoc_string(return_value, "tz_id", parsed_time->tz_info->name, 1); + add_ascii_assoc_string(return_value, "tz_id", parsed_time->tz_info->name, 1); } break; case TIMELIB_ZONETYPE_ABBR: PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(zone, z); - add_assoc_bool(return_value, "is_dst", parsed_time->dst); - add_assoc_string(return_value, "tz_abbr", parsed_time->tz_abbr, 1); + add_ascii_assoc_bool(return_value, "is_dst", parsed_time->dst); + add_ascii_assoc_string(return_value, "tz_abbr", parsed_time->tz_abbr, 1); break; } } @@ -1894,18 +1894,18 @@ array_init(element); } if (parsed_time->have_relative) { - add_assoc_long(element, "year", parsed_time->relative.y); - add_assoc_long(element, "month", parsed_time->relative.m); - add_assoc_long(element, "day", parsed_time->relative.d); - add_assoc_long(element, "hour", parsed_time->relative.h); - add_assoc_long(element, "minute", parsed_time->relative.i); - add_assoc_long(element, "second", parsed_time->relative.s); + add_ascii_assoc_long(element, "year", parsed_time->relative.y); + add_ascii_assoc_long(element, "month", parsed_time->relative.m); + add_ascii_assoc_long(element, "day", parsed_time->relative.d); + add_ascii_assoc_long(element, "hour", parsed_time->relative.h); + add_ascii_assoc_long(element, "minute", parsed_time->relative.i); + add_ascii_assoc_long(element, "second", parsed_time->relative.s); } if (parsed_time->have_weekday_relative) { - add_assoc_long(element, "weekday", parsed_time->relative.weekday); + add_ascii_assoc_long(element, "weekday", parsed_time->relative.weekday); } if (parsed_time->have_relative || parsed_time->have_weekday_relative) { - add_assoc_zval(return_value, "relative", element); + add_ascii_assoc_zval(return_value, "relative", element); } timelib_time_dtor(parsed_time); } @@ -2258,11 +2258,11 @@ for (i = 0; i < tzobj->tz->timecnt; ++i) { MAKE_STD_ZVAL(element); array_init(element); - add_assoc_long(element, "ts", tzobj->tz->trans[i]); - add_assoc_string(element, "time", php_format_date(DATE_FORMAT_ISO8601, 13, tzobj->tz->trans[i], 0 TSRMLS_CC), 0); - add_assoc_long(element, "offset", tzobj->tz->type[tzobj->tz->trans_idx[i]].offset); - add_assoc_bool(element, "isdst", tzobj->tz->type[tzobj->tz->trans_idx[i]].isdst); - add_assoc_string(element, "abbr", &tzobj->tz->timezone_abbr[tzobj->tz->type[tzobj->tz->trans_idx[i]].abbr_idx], 1); + add_ascii_assoc_long(element, "ts", tzobj->tz->trans[i]); + add_ascii_assoc_string(element, "time", php_format_date(DATE_FORMAT_ISO8601, 13, tzobj->tz->trans[i], 0 TSRMLS_CC), 0); + add_ascii_assoc_long(element, "offset", tzobj->tz->type[tzobj->tz->trans_idx[i]].offset); + add_ascii_assoc_bool(element, "isdst", tzobj->tz->type[tzobj->tz->trans_idx[i]].isdst); + add_ascii_assoc_string(element, "abbr", &tzobj->tz->timezone_abbr[tzobj->tz->type[tzobj->tz->trans_idx[i]].abbr_idx], 1); add_next_index_zval(return_value, element); } @@ -2303,18 +2303,18 @@ do { MAKE_STD_ZVAL(element); array_init(element); - add_assoc_bool(element, "dst", entry->type); - add_assoc_long(element, "offset", entry->gmtoffset); + add_ascii_assoc_bool(element, "dst", entry->type); + add_ascii_assoc_long(element, "offset", entry->gmtoffset); if (entry->full_tz_name) { - add_assoc_string(element, "timezone_id", entry->full_tz_name, 1); + add_ascii_assoc_string(element, "timezone_id", entry->full_tz_name, 1); } else { - add_assoc_null(element, "timezone_id"); + add_ascii_assoc_null(element, "timezone_id"); } if (zend_hash_find(HASH_OF(return_value), entry->name, strlen(entry->name) + 1, (void **) &abbr_array_pp) == FAILURE) { MAKE_STD_ZVAL(abbr_array); array_init(abbr_array); - add_assoc_zval(return_value, entry->name, abbr_array); + add_ascii_assoc_zval(return_value, entry->name, abbr_array); } else { abbr_array = *abbr_array_pp; } @@ -2493,74 +2493,74 @@ rs = timelib_astro_rise_set_altitude(t, latitude, longitude, -35.0/60, 1, &ddummy, &ddummy, &rise, &set, &transit); switch (rs) { case -1: /* always below */ - add_assoc_bool(return_value, "sunrise", 0); - add_assoc_bool(return_value, "sunset", 0); + add_ascii_assoc_bool(return_value, "sunrise", 0); + add_ascii_assoc_bool(return_value, "sunset", 0); break; case 1: /* always above */ - add_assoc_bool(return_value, "sunrise", 1); - add_assoc_bool(return_value, "sunset", 1); + add_ascii_assoc_bool(return_value, "sunrise", 1); + add_ascii_assoc_bool(return_value, "sunset", 1); break; default: t2->sse = rise; - add_assoc_long(return_value, "sunrise", timelib_date_to_int(t2, &dummy)); + add_ascii_assoc_long(return_value, "sunrise", timelib_date_to_int(t2, &dummy)); t2->sse = set; - add_assoc_long(return_value, "sunset", timelib_date_to_int(t2, &dummy)); + add_ascii_assoc_long(return_value, "sunset", timelib_date_to_int(t2, &dummy)); } t2->sse = transit; - add_assoc_long(return_value, "transit", timelib_date_to_int(t2, &dummy)); + add_ascii_assoc_long(return_value, "transit", timelib_date_to_int(t2, &dummy)); /* Get civil twilight */ rs = timelib_astro_rise_set_altitude(t, latitude, longitude, -6.0, 0, &ddummy, &ddummy, &rise, &set, &transit); switch (rs) { case -1: /* always below */ - add_assoc_bool(return_value, "civil_twilight_begin", 0); - add_assoc_bool(return_value, "civil_twilight_end", 0); + add_ascii_assoc_bool(return_value, "civil_twilight_begin", 0); + add_ascii_assoc_bool(return_value, "civil_twilight_end", 0); break; case 1: /* always above */ - add_assoc_bool(return_value, "civil_twilight_begin", 1); - add_assoc_bool(return_value, "civil_twilight_end", 1); + add_ascii_assoc_bool(return_value, "civil_twilight_begin", 1); + add_ascii_assoc_bool(return_value, "civil_twilight_end", 1); break; default: t2->sse = rise; - add_assoc_long(return_value, "civil_twilight_begin", timelib_date_to_int(t2, &dummy)); + add_ascii_assoc_long(return_value, "civil_twilight_begin", timelib_date_to_int(t2, &dummy)); t2->sse = set; - add_assoc_long(return_value, "civil_twilight_end", timelib_date_to_int(t2, &dummy)); + add_ascii_assoc_long(return_value, "civil_twilight_end", timelib_date_to_int(t2, &dummy)); } /* Get nautical twilight */ rs = timelib_astro_rise_set_altitude(t, latitude, longitude, -12.0, 0, &ddummy, &ddummy, &rise, &set, &transit); switch (rs) { case -1: /* always below */ - add_assoc_bool(return_value, "nautical_twilight_begin", 0); - add_assoc_bool(return_value, "nautical_twilight_end", 0); + add_ascii_assoc_bool(return_value, "nautical_twilight_begin", 0); + add_ascii_assoc_bool(return_value, "nautical_twilight_end", 0); break; case 1: /* always above */ - add_assoc_bool(return_value, "nautical_twilight_begin", 1); - add_assoc_bool(return_value, "nautical_twilight_end", 1); + add_ascii_assoc_bool(return_value, "nautical_twilight_begin", 1); + add_ascii_assoc_bool(return_value, "nautical_twilight_end", 1); break; default: t2->sse = rise; - add_assoc_long(return_value, "nautical_twilight_begin", timelib_date_to_int(t2, &dummy)); + add_ascii_assoc_long(return_value, "nautical_twilight_begin", timelib_date_to_int(t2, &dummy)); t2->sse = set; - add_assoc_long(return_value, "nautical_twilight_end", timelib_date_to_int(t2, &dummy)); + add_ascii_assoc_long(return_value, "nautical_twilight_end", timelib_date_to_int(t2, &dummy)); } /* Get astronomical twilight */ rs = timelib_astro_rise_set_altitude(t, latitude, longitude, -18.0, 0, &ddummy, &ddummy, &rise, &set, &transit); switch (rs) { case -1: /* always below */ - add_assoc_bool(return_value, "astronomical_twilight_begin", 0); - add_assoc_bool(return_value, "astronomical_twilight_end", 0); + add_ascii_assoc_bool(return_value, "astronomical_twilight_begin", 0); + add_ascii_assoc_bool(return_value, "astronomical_twilight_end", 0); break; case 1: /* always above */ - add_assoc_bool(return_value, "astronomical_twilight_begin", 1); - add_assoc_bool(return_value, "astronomical_twilight_end", 1); + add_ascii_assoc_bool(return_value, "astronomical_twilight_begin", 1); + add_ascii_assoc_bool(return_value, "astronomical_twilight_end", 1); break; default: t2->sse = rise; - add_assoc_long(return_value, "astronomical_twilight_begin", timelib_date_to_int(t2, &dummy)); + add_ascii_assoc_long(return_value, "astronomical_twilight_begin", timelib_date_to_int(t2, &dummy)); t2->sse = set; - add_assoc_long(return_value, "astronomical_twilight_end", timelib_date_to_int(t2, &dummy)); + add_ascii_assoc_long(return_value, "astronomical_twilight_end", timelib_date_to_int(t2, &dummy)); } timelib_time_dtor(t); timelib_time_dtor(t2); http://cvs.php.net/viewvc.cgi/php-src/ext/dom/node.c?r1=1.50&r2=1.51&diff_format=u Index: php-src/ext/dom/node.c diff -u php-src/ext/dom/node.c:1.50 php-src/ext/dom/node.c:1.51 --- php-src/ext/dom/node.c:1.50 Sat Sep 16 13:56:25 2006 +++ php-src/ext/dom/node.c Tue Sep 19 10:38:30 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: node.c,v 1.50 2006/09/16 13:56:25 rrichards Exp $ */ +/* $Id: node.c,v 1.51 2006/09/19 10:38:30 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1747,7 +1747,7 @@ char *xquery; int xquery_len; - if (zend_hash_find(ht, "query", sizeof("query"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "query", sizeof("query"), (void**)&tmp) == SUCCESS && (Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) { zxquery = tmp; /* @@ -1768,7 +1768,7 @@ ctxp = xmlXPathNewContext(docp); ctxp->node = nodep; - if (zend_hash_find(ht, "namespaces", sizeof("namespaces"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "namespaces", sizeof("namespaces"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_ARRAY) { zval **tmpns; char *nschar; http://cvs.php.net/viewvc.cgi/php-src/ext/filter/logical_filters.c?r1=1.9&r2=1.10&diff_format=u Index: php-src/ext/filter/logical_filters.c diff -u php-src/ext/filter/logical_filters.c:1.9 php-src/ext/filter/logical_filters.c:1.10 --- php-src/ext/filter/logical_filters.c:1.9 Thu Sep 14 17:48:11 2006 +++ php-src/ext/filter/logical_filters.c Tue Sep 19 10:38:30 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: logical_filters.c,v 1.9 2006/09/14 17:48:11 iliaa Exp $ */ +/* $Id: logical_filters.c,v 1.10 2006/09/19 10:38:30 dmitry Exp $ */ #include "php_filter.h" #include "filter_private.h" @@ -29,7 +29,7 @@ var_name = 0; \ var_name##_set = 0; \ if (option_array) { \ - if (zend_hash_find(HASH_OF(option_array), option_name, sizeof(option_name), (void **) &option_val) == SUCCESS) { \ + if (zend_ascii_hash_find(HASH_OF(option_array), option_name, sizeof(option_name), (void **) &option_val) == SUCCESS) { \ convert_to_long(*option_val); \ var_name = Z_LVAL_PP(option_val); \ var_name##_set = 1; \ @@ -43,7 +43,7 @@ var_name##_set = 0; \ var_name##_len = 0; \ if (option_array) { \ - if (zend_hash_find(HASH_OF(option_array), option_name, sizeof(option_name), (void **) &option_val) == SUCCESS) { \ + if (zend_ascii_hash_find(HASH_OF(option_array), option_name, sizeof(option_name), (void **) &option_val) == SUCCESS) { \ convert_to_string(*option_val); \ var_name = Z_STRVAL_PP(option_val); \ var_name##_set = 1; \ http://cvs.php.net/viewvc.cgi/php-src/ext/session/session.c?r1=1.450&r2=1.451&diff_format=u Index: php-src/ext/session/session.c diff -u php-src/ext/session/session.c:1.450 php-src/ext/session/session.c:1.451 --- php-src/ext/session/session.c:1.450 Wed Aug 30 17:57:25 2006 +++ php-src/ext/session/session.c Tue Sep 19 10:38:30 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: session.c,v 1.450 2006/08/30 17:57:25 tony2001 Exp $ */ +/* $Id: session.c,v 1.451 2006/09/19 10:38:30 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -297,7 +297,7 @@ zval **sym_track = NULL; IF_SESSION_VARS() { - zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), name, namelen + 1, + zend_rt_hash_find(Z_ARRVAL_P(PS(http_session_vars)), name, namelen + 1, (void *) &sym_track); } else { return; @@ -321,7 +321,7 @@ int ret = FAILURE; IF_SESSION_VARS() { - ret = zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), name, + ret = zend_rt_hash_find(Z_ARRVAL_P(PS(http_session_vars)), name, namelen+1, (void **) state_var); } @@ -591,10 +591,10 @@ gettimeofday(&tv, NULL); - if (zend_hash_find(&EG(symbol_table), "_SERVER", + if (zend_ascii_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **) &array) == SUCCESS && Z_TYPE_PP(array) == IS_ARRAY && - zend_hash_find(Z_ARRVAL_PP(array), "REMOTE_ADDR", + zend_ascii_hash_find(Z_ARRVAL_PP(array), "REMOTE_ADDR", sizeof("REMOTE_ADDR"), (void **) &token) == SUCCESS) { remote_addr = Z_STRVAL_PP(token); } @@ -1027,7 +1027,7 @@ } /* if the SID constant exists, destroy it. */ - zend_hash_del(EG(zend_constants), "sid", sizeof("sid")); + zend_ascii_hash_del(EG(zend_constants), "sid", sizeof("sid")); if (PS(define_sid)) { smart_str var = {0}; @@ -1088,10 +1088,10 @@ */ if (!PS(id)) { - if (PS(use_cookies) && zend_hash_find(&EG(symbol_table), "_COOKIE", + if (PS(use_cookies) && zend_ascii_hash_find(&EG(symbol_table), "_COOKIE", sizeof("_COOKIE"), (void **) &data) == SUCCESS && Z_TYPE_PP(data) == IS_ARRAY && - zend_hash_find(Z_ARRVAL_PP(data), PS(session_name), + zend_ascii_hash_find(Z_ARRVAL_PP(data), PS(session_name), lensess + 1, (void **) &ppid) == SUCCESS) { PPID2SID; PS(apply_trans_sid) = 0; @@ -1100,20 +1100,20 @@ } if (!PS(use_only_cookies) && !PS(id) && - zend_hash_find(&EG(symbol_table), "_GET", + zend_ascii_hash_find(&EG(symbol_table), "_GET", sizeof("_GET"), (void **) &data) == SUCCESS && Z_TYPE_PP(data) == IS_ARRAY && - zend_hash_find(Z_ARRVAL_PP(data), PS(session_name), + zend_rt_hash_find(Z_ARRVAL_PP(data), PS(session_name), lensess + 1, (void **) &ppid) == SUCCESS) { PPID2SID; PS(send_cookie) = 0; } if (!PS(use_only_cookies) && !PS(id) && - zend_hash_find(&EG(symbol_table), "_POST", + zend_ascii_hash_find(&EG(symbol_table), "_POST", sizeof("_POST"), (void **) &data) == SUCCESS && Z_TYPE_PP(data) == IS_ARRAY && - zend_hash_find(Z_ARRVAL_PP(data), PS(session_name), + zend_rt_hash_find(Z_ARRVAL_PP(data), PS(session_name), lensess + 1, (void **) &ppid) == SUCCESS) { PPID2SID; PS(send_cookie) = 0; @@ -1125,7 +1125,7 @@ http://yoursite/<session-name>=<session-id>/script.php */ if (!PS(use_only_cookies) && !PS(id) && PG(http_globals)[TRACK_VARS_SERVER] && - zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "REQUEST_URI", + zend_ascii_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "REQUEST_URI", sizeof("REQUEST_URI"), (void **) &data) == SUCCESS && Z_TYPE_PP(data) == IS_STRING && (p = strstr(Z_STRVAL_PP(data), PS(session_name))) && @@ -1250,11 +1250,11 @@ array_init(return_value); - add_assoc_long(return_value, "lifetime", PS(cookie_lifetime)); - add_assoc_string(return_value, "path", PS(cookie_path), 1); - add_assoc_string(return_value, "domain", PS(cookie_domain), 1); - add_assoc_bool(return_value, "secure", PS(cookie_secure)); - add_assoc_bool(return_value, "httponly", PS(cookie_httponly)); + add_ascii_assoc_long(return_value, "lifetime", PS(cookie_lifetime)); + add_ascii_assoc_rt_string(return_value, "path", PS(cookie_path), 1); + add_ascii_assoc_rt_string(return_value, "domain", PS(cookie_domain), 1); + add_ascii_assoc_bool(return_value, "secure", PS(cookie_secure)); + add_ascii_assoc_bool(return_value, "httponly", PS(cookie_httponly)); } /* }}} */ http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.219&r2=1.220&diff_format=u Index: php-src/ext/simplexml/simplexml.c diff -u php-src/ext/simplexml/simplexml.c:1.219 php-src/ext/simplexml/simplexml.c:1.220 --- php-src/ext/simplexml/simplexml.c:1.219 Wed Sep 6 15:32:19 2006 +++ php-src/ext/simplexml/simplexml.c Tue Sep 19 10:38:30 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: simplexml.c,v 1.219 2006/09/06 15:32:19 nlopess Exp $ */ +/* $Id: simplexml.c,v 1.220 2006/09/19 10:38:30 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -996,7 +996,16 @@ array_init(zattr); sxe_properties_add(rv, "@attributes", sizeof("@attributes"), zattr TSRMLS_CC); } - add_assoc_zval_ex(zattr, (char*)attr->name, namelen, value); + if (UG(unicode)) { + UErrorCode status = U_ZERO_ERROR; + zstr u_name; + int u_name_len; + zend_string_to_unicode_ex(UG(utf8_conv), &u_name.u, &u_name_len, (char*)attr->name, namelen, &status); + add_u_assoc_zval_ex(zattr, IS_UNICODE, u_name, u_name_len, value); + efree(u_name.u); + } else { + add_assoc_zval_ex(zattr, (char*)attr->name, namelen, value); + } } attr = attr->next; } @@ -1288,14 +1297,17 @@ prefix_len = strlen(prefix) + 1; - if (zend_hash_exists(Z_ARRVAL_P(return_value), prefix, prefix_len) == 0) { + if (zend_ascii_hash_exists(Z_ARRVAL_P(return_value), prefix, prefix_len) == 0) { if (UG(unicode)) { UErrorCode status = U_ZERO_ERROR; UChar *u_str; - int u_len; + zstr u_prefix; + int u_len, u_prefix_len; int length = strlen((char*)ns->href); zend_string_to_unicode_ex(UG(utf8_conv), &u_str, &u_len, (char*)ns->href, length, &status); - add_assoc_unicodel_ex(return_value, prefix, prefix_len, u_str, u_len, 0); + zend_string_to_unicode_ex(UG(utf8_conv), &u_prefix.u, &u_prefix_len, prefix, prefix_len, &status); + add_u_assoc_unicodel_ex(return_value, IS_UNICODE, u_prefix, u_prefix_len, u_str, u_len, 0); + efree(u_prefix.u); } else { add_assoc_string_ex(return_value, prefix, prefix_len, (char*)ns->href, 1); } @@ -2339,7 +2351,7 @@ { php_info_print_table_start(); php_info_print_table_header(2, "Simplexml support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.219 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.220 $"); php_info_print_table_row(2, "Schema support", #ifdef LIBXML_SCHEMAS_ENABLED "enabled"); http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_encoding.c?r1=1.141&r2=1.142&diff_format=u Index: php-src/ext/soap/php_encoding.c diff -u php-src/ext/soap/php_encoding.c:1.141 php-src/ext/soap/php_encoding.c:1.142 --- php-src/ext/soap/php_encoding.c:1.141 Tue Aug 8 16:59:11 2006 +++ php-src/ext/soap/php_encoding.c Tue Sep 19 10:38:30 2006 @@ -17,7 +17,7 @@ | Dmitry Stogov <dmitry@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: php_encoding.c,v 1.141 2006/08/08 16:59:11 tony2001 Exp $ */ +/* $Id: php_encoding.c,v 1.142 2006/09/19 10:38:30 dmitry Exp $ */ #include <time.h> @@ -1018,7 +1018,7 @@ } else if (Z_TYPE_P(object) == IS_ARRAY) { zval **data_ptr; - if (zend_hash_find(Z_ARRVAL_P(object), name, strlen(name)+1, (void**)&data_ptr) == SUCCESS) { + if (zend_rt_hash_find(Z_ARRVAL_P(object), name, strlen(name)+1, (void**)&data_ptr) == SUCCESS) { return *data_ptr; } } http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_packet_soap.c?r1=1.48&r2=1.49&diff_format=u Index: php-src/ext/soap/php_packet_soap.c diff -u php-src/ext/soap/php_packet_soap.c:1.48 php-src/ext/soap/php_packet_soap.c:1.49 --- php-src/ext/soap/php_packet_soap.c:1.48 Thu Aug 3 16:13:06 2006 +++ php-src/ext/soap/php_packet_soap.c Tue Sep 19 10:38:30 2006 @@ -17,7 +17,7 @@ | Dmitry Stogov <dmitry@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: php_packet_soap.c,v 1.48 2006/08/03 16:13:06 dmitry Exp $ */ +/* $Id: php_packet_soap.c,v 1.49 2006/09/19 10:38:30 dmitry Exp $ */ #include "php_soap.h" @@ -318,7 +318,16 @@ tmp = master_to_zval(NULL, val); } } - add_assoc_zval(return_value, param->paramName, tmp); + if (UG(unicode)) { + UErrorCode status = U_ZERO_ERROR; + zstr u_name; + int u_name_len; + zend_string_to_unicode_ex(UG(utf8_conv), &u_name.u, &u_name_len, param->paramName, strlen(param->paramName), &status); + add_u_assoc_zval_ex(return_value, IS_UNICODE, u_name, u_name_len+1, tmp); + efree(u_name.u); + } else { + add_assoc_zval(return_value, param->paramName, tmp); + } param_count++; @@ -339,7 +348,16 @@ tmp = master_to_zval(NULL, val); if (val->name) { - add_assoc_zval(return_value, (char*)val->name, tmp); + if (UG(unicode)) { + UErrorCode status = U_ZERO_ERROR; + zstr u_name; + int u_name_len; + zend_string_to_unicode_ex(UG(utf8_conv), &u_name.u, &u_name_len, (char*)val->name, strlen((char*)val->name), &status); + add_u_assoc_zval_ex(return_value, IS_UNICODE, u_name, u_name_len+1, tmp); + efree(u_name.u); + } else { + add_assoc_zval(return_value, (char*)val->name, tmp); + } } else { add_next_index_zval(return_value, tmp); } @@ -391,7 +409,16 @@ smart_str_free(&key); } val = master_to_zval(enc, trav); - add_assoc_zval(soap_headers, (char*)trav->name, val); + if (UG(unicode)) { + UErrorCode status = U_ZERO_ERROR; + zstr u_name; + int u_name_len; + zend_string_to_unicode_ex(UG(utf8_conv), &u_name.u, &u_name_len, (char*)trav->name, strlen((char*)trav->name), &status); + add_u_assoc_zval_ex(soap_headers, IS_UNICODE, u_name, u_name_len+1, val); + efree(u_name.u); + } else { + add_assoc_zval(soap_headers, (char*)trav->name, val); + } } trav = trav->next; } http://cvs.php.net/viewvc.cgi/php-src/ext/soap/soap.c?r1=1.208&r2=1.209&diff_format=u Index: php-src/ext/soap/soap.c diff -u php-src/ext/soap/soap.c:1.208 php-src/ext/soap/soap.c:1.209 --- php-src/ext/soap/soap.c:1.208 Fri Sep 15 07:11:09 2006 +++ php-src/ext/soap/soap.c Tue Sep 19 10:38:30 2006 @@ -17,7 +17,7 @@ | Dmitry Stogov <dmitry@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: soap.c,v 1.208 2006/09/15 07:11:09 dmitry Exp $ */ +/* $Id: soap.c,v 1.209 2006/09/19 10:38:30 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1236,14 +1236,14 @@ HashTable *ht = Z_ARRVAL_P(options); zval **tmp; - if (zend_hash_find(ht, "soap_version", sizeof("soap_version"), (void**)&tmp) == SUCCESS) { + if (zend_ascii_hash_find(ht, "soap_version", sizeof("soap_version"), (void**)&tmp) == SUCCESS) { if (Z_TYPE_PP(tmp) == IS_LONG || (Z_LVAL_PP(tmp) == SOAP_1_1 && Z_LVAL_PP(tmp) == SOAP_1_2)) { version = Z_LVAL_PP(tmp); } } - if (zend_hash_find(ht, "uri", sizeof("uri"), (void**)&tmp) == SUCCESS) { + if (zend_ascii_hash_find(ht, "uri", sizeof("uri"), (void**)&tmp) == SUCCESS) { if (Z_TYPE_PP(tmp) == IS_STRING) { service->uri = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); } else if (Z_TYPE_PP(tmp) == IS_UNICODE) { @@ -1251,7 +1251,7 @@ } } - if (zend_hash_find(ht, "actor", sizeof("actor"), (void**)&tmp) == SUCCESS) { + if (zend_ascii_hash_find(ht, "actor", sizeof("actor"), (void**)&tmp) == SUCCESS) { if (Z_TYPE_PP(tmp) == IS_STRING) { service->actor = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); } else if (Z_TYPE_PP(tmp) == IS_UNICODE) { @@ -1259,7 +1259,7 @@ } } - if (zend_hash_find(ht, "encoding", sizeof("encoding"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "encoding", sizeof("encoding"), (void**)&tmp) == SUCCESS && (Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) { xmlCharEncodingHandlerPtr encoding; char *str; @@ -1280,7 +1280,7 @@ } } - if (zend_hash_find(ht, "classmap", sizeof("classmap"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "classmap", sizeof("classmap"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_ARRAY) { zval *ztmp; @@ -1289,12 +1289,12 @@ zend_hash_copy(service->class_map, (*tmp)->value.ht, (copy_ctor_func_t) zval_add_ref, (void *) &ztmp, sizeof(zval *)); } - if (zend_hash_find(ht, "features", sizeof("features"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "features", sizeof("features"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_LONG) { service->features = Z_LVAL_PP(tmp); } - if (zend_hash_find(ht, "cache_wsdl", sizeof("cache_wsdl"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "cache_wsdl", sizeof("cache_wsdl"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_LONG) { cache_wsdl = Z_LVAL_PP(tmp); } @@ -1777,16 +1777,16 @@ } if (ZEND_NUM_ARGS() == 0) { - if (zend_hash_find(&EG(symbol_table), HTTP_RAW_POST_DATA, sizeof(HTTP_RAW_POST_DATA), (void **) &raw_post) != FAILURE && + if (zend_ascii_hash_find(&EG(symbol_table), HTTP_RAW_POST_DATA, sizeof(HTTP_RAW_POST_DATA), (void **) &raw_post) != FAILURE && (Z_TYPE_PP(raw_post) == IS_STRING || Z_TYPE_PP(raw_post) == IS_UNICODE)) { if (Z_TYPE_PP(raw_post) == IS_STRING) { zval **server_vars, **encoding; zend_is_auto_global("_SERVER", sizeof("_SERVER")-1 TSRMLS_CC); - if (zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **) &server_vars) == SUCCESS && + if (zend_ascii_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **) &server_vars) == SUCCESS && Z_TYPE_PP(server_vars) == IS_ARRAY && - zend_hash_find(Z_ARRVAL_PP(server_vars), "HTTP_CONTENT_ENCODING", sizeof("HTTP_CONTENT_ENCODING"), (void **) &encoding)==SUCCESS && + zend_ascii_hash_find(Z_ARRVAL_PP(server_vars), "HTTP_CONTENT_ENCODING", sizeof("HTTP_CONTENT_ENCODING"), (void **) &encoding)==SUCCESS && (Z_TYPE_PP(encoding) == IS_STRING || Z_TYPE_PP(encoding) == IS_UNICODE)) { zval func; zval retval; @@ -1892,7 +1892,7 @@ } /* Find the soap object and assign */ - if (zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), "_bogus_session_name", sizeof("_bogus_session_name"), (void **) &tmp_soap) == SUCCESS && + if (zend_ascii_hash_find(Z_ARRVAL_P(PS(http_session_vars)), "_bogus_session_name", sizeof("_bogus_session_name"), (void **) &tmp_soap) == SUCCESS && Z_TYPE_PP(tmp_soap) == IS_OBJECT && Z_OBJCE_PP(tmp_soap) == service->soap_class.ce) { soap_obj = *tmp_soap; @@ -1968,7 +1968,7 @@ /* If session then update session hash with new object */ if (service->soap_class.persistance == SOAP_PERSISTENCE_SESSION) { zval **tmp_soap_pp; - if (zend_hash_update(Z_ARRVAL_P(PS(http_session_vars)), "_bogus_session_name", sizeof("_bogus_session_name"), &tmp_soap, sizeof(zval *), (void **)&tmp_soap_pp) == SUCCESS) { + if (zend_ascii_hash_update(Z_ARRVAL_P(PS(http_session_vars)), "_bogus_session_name", sizeof("_bogus_session_name"), &tmp_soap, sizeof(zval *), (void **)&tmp_soap_pp) == SUCCESS) { soap_obj = *tmp_soap_pp; } } else { @@ -2534,7 +2534,7 @@ if (wsdl == NULL) { /* Fetching non-WSDL mode options */ - if (zend_hash_find(ht, "uri", sizeof("uri"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "uri", sizeof("uri"), (void**)&tmp) == SUCCESS && (Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) { if (Z_TYPE_PP(tmp) == IS_STRING) { client->uri = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); @@ -2546,25 +2546,25 @@ return; } - if (zend_hash_find(ht, "style", sizeof("style"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "style", sizeof("style"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_LONG && (Z_LVAL_PP(tmp) == SOAP_RPC || Z_LVAL_PP(tmp) == SOAP_DOCUMENT)) { client->style = Z_LVAL_PP(tmp); } - if (zend_hash_find(ht, "use", sizeof("use"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "use", sizeof("use"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_LONG && (Z_LVAL_PP(tmp) == SOAP_LITERAL || Z_LVAL_PP(tmp) == SOAP_ENCODED)) { client->use = Z_LVAL_PP(tmp); } } - if (zend_hash_find(ht, "stream_context", sizeof("stream_context"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "stream_context", sizeof("stream_context"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_RESOURCE) { context = php_stream_context_from_zval(*tmp, 1); } - if (zend_hash_find(ht, "location", sizeof("location"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "location", sizeof("location"), (void**)&tmp) == SUCCESS && (Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) { if (Z_TYPE_PP(tmp) == IS_STRING) { client->location = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); @@ -2576,20 +2576,20 @@ return; } - if (zend_hash_find(ht, "soap_version", sizeof("soap_version"), (void**)&tmp) == SUCCESS) { + if (zend_ascii_hash_find(ht, "soap_version", sizeof("soap_version"), (void**)&tmp) == SUCCESS) { if (Z_TYPE_PP(tmp) == IS_LONG || (Z_LVAL_PP(tmp) == SOAP_1_1 && Z_LVAL_PP(tmp) == SOAP_1_2)) { soap_version = Z_LVAL_PP(tmp); } } - if (zend_hash_find(ht, "login", sizeof("login"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "login", sizeof("login"), (void**)&tmp) == SUCCESS && (Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) { if (Z_TYPE_PP(tmp) == IS_STRING) { client->login = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); } else { client->login = soap_unicode_to_string(Z_USTRVAL_PP(tmp), Z_USTRLEN_PP(tmp) TSRMLS_CC); } - if (zend_hash_find(ht, "password", sizeof("password"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "password", sizeof("password"), (void**)&tmp) == SUCCESS && (Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) { if (Z_TYPE_PP(tmp) == IS_STRING) { client->password = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); @@ -2597,31 +2597,31 @@ client->password = soap_unicode_to_string(Z_USTRVAL_PP(tmp), Z_USTRLEN_PP(tmp) TSRMLS_CC); } } - if (zend_hash_find(ht, "authentication", sizeof("authentication"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "authentication", sizeof("authentication"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_LONG && Z_LVAL_PP(tmp) == SOAP_AUTHENTICATION_DIGEST) { client->digest = 1; } } - if (zend_hash_find(ht, "proxy_host", sizeof("proxy_host"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "proxy_host", sizeof("proxy_host"), (void**)&tmp) == SUCCESS && (Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) { if (Z_TYPE_PP(tmp) == IS_STRING) { client->proxy_host = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); } else { client->proxy_host = soap_unicode_to_string(Z_USTRVAL_PP(tmp), Z_USTRLEN_PP(tmp) TSRMLS_CC); } - if (zend_hash_find(ht, "proxy_port", sizeof("proxy_port"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "proxy_port", sizeof("proxy_port"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_LONG) { client->proxy_port = Z_LVAL_PP(tmp); } - if (zend_hash_find(ht, "proxy_login", sizeof("proxy_login"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "proxy_login", sizeof("proxy_login"), (void**)&tmp) == SUCCESS && (Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) { if (Z_TYPE_PP(tmp) == IS_STRING) { client->proxy_login = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); } else { client->proxy_login = soap_unicode_to_string(Z_USTRVAL_PP(tmp), Z_USTRLEN_PP(tmp) TSRMLS_CC); } - if (zend_hash_find(ht, "proxy_password", sizeof("proxy_password"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "proxy_password", sizeof("proxy_password"), (void**)&tmp) == SUCCESS && (Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) { if (Z_TYPE_PP(tmp) == IS_STRING) { client->proxy_password = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); @@ -2631,28 +2631,28 @@ } } } - if (zend_hash_find(ht, "local_cert", sizeof("local_cert"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "local_cert", sizeof("local_cert"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { if (!context) { context = php_stream_context_alloc(); } php_stream_context_set_option(context, "ssl", "local_cert", *tmp); - if (zend_hash_find(ht, "passphrase", sizeof("passphrase"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "passphrase", sizeof("passphrase"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { php_stream_context_set_option(context, "ssl", "passphrase", *tmp); } } - if (zend_hash_find(ht, "trace", sizeof("trace"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "trace", sizeof("trace"), (void**)&tmp) == SUCCESS && (Z_TYPE_PP(tmp) == IS_BOOL || Z_TYPE_PP(tmp) == IS_LONG) && Z_LVAL_PP(tmp) == 1) { client->trace = 1; } - if (zend_hash_find(ht, "exceptions", sizeof("exceptions"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "exceptions", sizeof("exceptions"), (void**)&tmp) == SUCCESS && (Z_TYPE_PP(tmp) == IS_BOOL || Z_TYPE_PP(tmp) == IS_LONG) && Z_LVAL_PP(tmp) == 0) { client->exceptions = 0; } - if (zend_hash_find(ht, "compression", sizeof("compression"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "compression", sizeof("compression"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_LONG && zend_hash_exists(EG(function_table), "gzinflate", sizeof("gzinflate")) && zend_hash_exists(EG(function_table), "gzdeflate", sizeof("gzdeflate")) && @@ -2661,7 +2661,7 @@ zend_hash_exists(EG(function_table), "gzencode", sizeof("gzencode"))) { client->compression = Z_LVAL_PP(tmp); } - if (zend_hash_find(ht, "encoding", sizeof("encoding"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "encoding", sizeof("encoding"), (void**)&tmp) == SUCCESS && (Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) { xmlCharEncodingHandlerPtr encoding; char *str; @@ -2681,7 +2681,7 @@ efree(str); } } - if (zend_hash_find(ht, "classmap", sizeof("classmap"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "classmap", sizeof("classmap"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_ARRAY) { zval *ztmp; @@ -2690,12 +2690,12 @@ zend_hash_copy(client->class_map, (*tmp)->value.ht, (copy_ctor_func_t) zval_add_ref, (void *) &ztmp, sizeof(zval *)); } - if (zend_hash_find(ht, "features", sizeof("features"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "features", sizeof("features"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_LONG) { client->features = Z_LVAL_PP(tmp); } - if (zend_hash_find(ht, "connection_timeout", sizeof("connection_timeout"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "connection_timeout", sizeof("connection_timeout"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_LONG && Z_LVAL_PP(tmp) >= 0) { client->connection_timeout = Z_LVAL_PP(tmp); } @@ -2704,12 +2704,12 @@ client->stream_context = context; } - if (zend_hash_find(ht, "cache_wsdl", sizeof("cache_wsdl"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "cache_wsdl", sizeof("cache_wsdl"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_LONG) { cache_wsdl = Z_LVAL_PP(tmp); } - if (zend_hash_find(ht, "user_agent", sizeof("user_agent"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "user_agent", sizeof("user_agent"), (void**)&tmp) == SUCCESS && (Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) { if (Z_TYPE_PP(tmp) == IS_STRING) { client->user_agent = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); @@ -3053,7 +3053,7 @@ if (options) { if (Z_TYPE_P(options) == IS_ARRAY) { HashTable *ht = Z_ARRVAL_P(options); - if (zend_hash_find(ht, "location", sizeof("location"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "location", sizeof("location"), (void**)&tmp) == SUCCESS && (Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) { if (Z_TYPE_PP(tmp) == IS_STRING) { location = Z_STRVAL_PP(tmp); @@ -3063,7 +3063,7 @@ } } - if (zend_hash_find(ht, "soapaction", sizeof("soapaction"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "soapaction", sizeof("soapaction"), (void**)&tmp) == SUCCESS && (Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) { if (Z_TYPE_PP(tmp) == IS_STRING) { soap_action = Z_STRVAL_PP(tmp); @@ -3073,7 +3073,7 @@ } } - if (zend_hash_find(ht, "uri", sizeof("uri"), (void**)&tmp) == SUCCESS && + if (zend_ascii_hash_find(ht, "uri", sizeof("uri"), (void**)&tmp) == SUCCESS && (Z_TYPE_PP(tmp) == IS_STRING || Z_TYPE_PP(tmp) == IS_UNICODE)) { if (Z_TYPE_PP(tmp) == IS_STRING) { uri = Z_STRVAL_PP(tmp); http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/sqlite.c?r1=1.196&r2=1.197&diff_format=u Index: php-src/ext/sqlite/sqlite.c diff -u php-src/ext/sqlite/sqlite.c:1.196 php-src/ext/sqlite/sqlite.c:1.197 --- php-src/ext/sqlite/sqlite.c:1.196 Sat Sep 16 18:23:05 2006 +++ php-src/ext/sqlite/sqlite.c Tue Sep 19 10:38:31 2006 @@ -17,7 +17,7 @@ | Marcus Boerger <helly@php.net> | +----------------------------------------------------------------------+ - $Id: sqlite.c,v 1.196 2006/09/16 18:23:05 iliaa Exp $ + $Id: sqlite.c,v 1.197 2006/09/19 10:38:31 dmitry Exp $ */ #ifdef HAVE_CONFIG_H @@ -1129,7 +1129,7 @@ { php_info_print_table_start(); php_info_print_table_header(2, "SQLite support", "enabled"); - php_info_print_table_row(2, "PECL Module version", PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.196 2006/09/16 18:23:05 iliaa Exp $"); + php_info_print_table_row(2, "PECL Module version", PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.197 2006/09/19 10:38:31 dmitry Exp $"); php_info_print_table_row(2, "SQLite Library", sqlite_libversion()); php_info_print_table_row(2, "SQLite Encoding", sqlite_libencoding()); php_info_print_table_end(); @@ -1702,7 +1702,7 @@ zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, tmp, strlen(tmp), &status); if (result_type == PHPSQLITE_ASSOC) { - add_assoc_unicode(return_value, colname, u_str, 1); + add_rt_assoc_unicode(return_value, colname, u_str, 1); } if (result_type == PHPSQLITE_NUM) { add_index_unicode(return_value, i, u_str, 1); @@ -1885,12 +1885,12 @@ if (mode & PHPSQLITE_ASSOC) { add_index_zval(return_value, j, decoded); ZVAL_ADDREF(decoded); - add_assoc_zval(return_value, (char*)colnames[j], decoded); + add_rt_assoc_zval(return_value, (char*)colnames[j], decoded); } else { add_next_index_zval(return_value, decoded); } } else { - add_assoc_zval(return_value, (char*)colnames[j], decoded); + add_rt_assoc_zval(return_value, (char*)colnames[j], decoded); } } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.802&r2=1.803&diff_format=u Index: php-src/ext/standard/basic_functions.c diff -u php-src/ext/standard/basic_functions.c:1.802 php-src/ext/standard/basic_functions.c:1.803 --- php-src/ext/standard/basic_functions.c:1.802 Fri Sep 15 09:11:31 2006 +++ php-src/ext/standard/basic_functions.c Tue Sep 19 10:38:31 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.c,v 1.802 2006/09/15 09:11:31 tony2001 Exp $ */ +/* $Id: basic_functions.c,v 1.803 2006/09/19 10:38:31 dmitry Exp $ */ #include "php.h" #include "php_streams.h" @@ -4484,8 +4484,8 @@ * in order to be on the safe side, even though it is also available * from the symbol table. */ - if (zend_hash_find(HASH_OF(PG(http_globals)[TRACK_VARS_SERVER]), "argv", sizeof("argv"), (void **) &args) != FAILURE || - zend_hash_find(&EG(symbol_table), "argv", sizeof("argv"), (void **) &args) != FAILURE) { + if (zend_ascii_hash_find(HASH_OF(PG(http_globals)[TRACK_VARS_SERVER]), "argv", sizeof("argv"), (void **) &args) != FAILURE || + zend_ascii_hash_find(&EG(symbol_table), "argv", sizeof("argv"), (void **) &args) != FAILURE) { int pos = 0; zval **arg; @@ -4702,8 +4702,8 @@ RETURN_TRUE; } else if (errno == EINTR) { array_init(return_value); - add_assoc_long_ex(return_value, "seconds", sizeof("seconds"), php_rem.tv_sec); - add_assoc_long_ex(return_value, "nanoseconds", sizeof("nanoseconds"), php_rem.tv_nsec); + add_ascii_assoc_long_ex(return_value, "seconds", sizeof("seconds"), php_rem.tv_sec); + add_ascii_assoc_long_ex(return_value, "nanoseconds", sizeof("nanoseconds"), php_rem.tv_nsec); return; } else if (errno == EINVAL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "nanoseconds was not in the range 0 to 999 999 999 or seconds was negative"); @@ -4967,10 +4967,10 @@ } if (PG(last_error_message)) { array_init(return_value); - add_assoc_long_ex(return_value, "type", sizeof("type"), PG(last_error_type)); - add_assoc_string_ex(return_value, "message", sizeof("message"), PG(last_error_message), 1); - add_assoc_string_ex(return_value, "file", sizeof("file"), PG(last_error_file)?PG(last_error_file):"-", 1 ); - add_assoc_long_ex(return_value, "line", sizeof("line"), PG(last_error_lineno)); + add_ascii_assoc_long_ex(return_value, "type", sizeof("type"), PG(last_error_type)); + add_ascii_assoc_string_ex(return_value, "message", sizeof("message"), PG(last_error_message), 1); + add_ascii_assoc_string_ex(return_value, "file", sizeof("file"), PG(last_error_file)?PG(last_error_file):"-", 1 ); + add_ascii_assoc_long_ex(return_value, "line", sizeof("line"), PG(last_error_lineno)); } } /* }}} */ @@ -5521,22 +5521,22 @@ array_init(option); if (ini_entry->orig_value) { - add_assoc_stringl(option, "global_value", ini_entry->orig_value, ini_entry->orig_value_length, 1); + add_ascii_assoc_stringl(option, "global_value", ini_entry->orig_value, ini_entry->orig_value_length, 1); } else if (ini_entry->value) { - add_assoc_stringl(option, "global_value", ini_entry->value, ini_entry->value_length, 1); + add_ascii_assoc_stringl(option, "global_value", ini_entry->value, ini_entry->value_length, 1); } else { - add_assoc_null(option, "global_value"); + add_ascii_assoc_null(option, "global_value"); } if (ini_entry->value) { - add_assoc_stringl(option, "local_value", ini_entry->value, ini_entry->value_length, 1); + add_ascii_assoc_stringl(option, "local_value", ini_entry->value, ini_entry->value_length, 1); } else { - add_assoc_null(option, "local_value"); + add_ascii_assoc_null(option, "local_value"); } - add_assoc_long(option, "access", ini_entry->modifiable); + add_ascii_assoc_long(option, "access", ini_entry->modifiable); - add_assoc_zval_ex(ini_array, ini_entry->name, ini_entry->name_length, option); + add_ascii_assoc_zval_ex(ini_array, ini_entry->name, ini_entry->name_length, option); } return 0; } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/datetime.c?r1=1.139&r2=1.140&diff_format=u Index: php-src/ext/standard/datetime.c diff -u php-src/ext/standard/datetime.c:1.139 php-src/ext/standard/datetime.c:1.140 --- php-src/ext/standard/datetime.c:1.139 Thu Aug 24 11:05:38 2006 +++ php-src/ext/standard/datetime.c Tue Sep 19 10:38:31 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: datetime.c,v 1.139 2006/08/24 11:05:38 tony2001 Exp $ */ +/* $Id: datetime.c,v 1.140 2006/09/19 10:38:31 dmitry Exp $ */ #include "php.h" #include "zend_operators.h" @@ -109,15 +109,15 @@ } array_init(return_value); - add_assoc_long(return_value, "tm_sec", parsed_time.tm_sec); - add_assoc_long(return_value, "tm_min", parsed_time.tm_min); - add_assoc_long(return_value, "tm_hour", parsed_time.tm_hour); - add_assoc_long(return_value, "tm_mday", parsed_time.tm_mday); - add_assoc_long(return_value, "tm_mon", parsed_time.tm_mon); - add_assoc_long(return_value, "tm_year", parsed_time.tm_year); - add_assoc_long(return_value, "tm_wday", parsed_time.tm_wday); - add_assoc_long(return_value, "tm_yday", parsed_time.tm_yday); - add_assoc_string(return_value, "unparsed", unparsed_part, 1); + add_ascii_assoc_long(return_value, "tm_sec", parsed_time.tm_sec); + add_ascii_assoc_long(return_value, "tm_min", parsed_time.tm_min); + add_ascii_assoc_long(return_value, "tm_hour", parsed_time.tm_hour); + add_ascii_assoc_long(return_value, "tm_mday", parsed_time.tm_mday); + add_ascii_assoc_long(return_value, "tm_mon", parsed_time.tm_mon); + add_ascii_assoc_long(return_value, "tm_year", parsed_time.tm_year); + add_ascii_assoc_long(return_value, "tm_wday", parsed_time.tm_wday); + add_ascii_assoc_long(return_value, "tm_yday", parsed_time.tm_yday); + add_ascii_assoc_string(return_value, "unparsed", unparsed_part, 1); } /* }}} */ #endif http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.79&r2=1.80&diff_format=u Index: php-src/ext/standard/dns.c diff -u php-src/ext/standard/dns.c:1.79 php-src/ext/standard/dns.c:1.80 --- php-src/ext/standard/dns.c:1.79 Thu Mar 2 13:12:45 2006 +++ php-src/ext/standard/dns.c Tue Sep 19 10:38:31 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dns.c,v 1.79 2006/03/02 13:12:45 dmitry Exp $ */ +/* $Id: dns.c,v 1.80 2006/09/19 10:38:31 dmitry Exp $ */ /* {{{ includes */ #include "php.h" @@ -426,82 +426,82 @@ ALLOC_INIT_ZVAL(*subarray); array_init(*subarray); - add_assoc_string(*subarray, "host", name, 1); + add_ascii_assoc_string(*subarray, "host", name, 1); switch (type) { case DNS_T_A: - add_assoc_string(*subarray, "type", "A", 1); + add_ascii_assoc_string(*subarray, "type", "A", 1); sprintf(name, "%d.%d.%d.%d", cp[0], cp[1], cp[2], cp[3]); - add_assoc_string(*subarray, "ip", name, 1); + add_ascii_assoc_string(*subarray, "ip", name, 1); cp += dlen; break; case DNS_T_MX: - add_assoc_string(*subarray, "type", "MX", 1); + add_ascii_assoc_string(*subarray, "type", "MX", 1); GETSHORT(n, cp); - add_assoc_long(*subarray, "pri", n); + add_ascii_assoc_long(*subarray, "pri", n); /* no break; */ case DNS_T_CNAME: if (type == DNS_T_CNAME) - add_assoc_string(*subarray, "type", "CNAME", 1); + add_ascii_assoc_string(*subarray, "type", "CNAME", 1); /* no break; */ case DNS_T_NS: if (type == DNS_T_NS) - add_assoc_string(*subarray, "type", "NS", 1); + add_ascii_assoc_string(*subarray, "type", "NS", 1); /* no break; */ case DNS_T_PTR: if (type == DNS_T_PTR) - add_assoc_string(*subarray, "type", "PTR", 1); + add_ascii_assoc_string(*subarray, "type", "PTR", 1); n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof name) - 2); if (n < 0) { return NULL; } cp += n; - add_assoc_string(*subarray, "target", name, 1); + add_ascii_assoc_string(*subarray, "target", name, 1); break; case DNS_T_HINFO: /* See RFC 1010 for values */ - add_assoc_string(*subarray, "type", "HINFO", 1); + add_ascii_assoc_string(*subarray, "type", "HINFO", 1); n = *cp & 0xFF; cp++; - add_assoc_stringl(*subarray, "cpu", (char*)cp, n, 1); + add_ascii_assoc_stringl(*subarray, "cpu", (char*)cp, n, 1); cp += n; n = *cp & 0xFF; cp++; - add_assoc_stringl(*subarray, "os", (char*)cp, n, 1); + add_ascii_assoc_stringl(*subarray, "os", (char*)cp, n, 1); cp += n; break; case DNS_T_TXT: - add_assoc_string(*subarray, "type", "TXT", 1); + add_ascii_assoc_string(*subarray, "type", "TXT", 1); n = cp[0]; tp = emalloc(n + 1); memcpy(tp, cp + 1, n); tp[n] = '\0'; cp += dlen; - add_assoc_stringl(*subarray, "txt", (char*)tp, n, 0); + add_ascii_assoc_stringl(*subarray, "txt", (char*)tp, n, 0); break; case DNS_T_SOA: - add_assoc_string(*subarray, "type", "SOA", 1); + add_ascii_assoc_string(*subarray, "type", "SOA", 1); n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof name) -2); if (n < 0) { return NULL; } cp += n; - add_assoc_string(*subarray, "mname", name, 1); + add_ascii_assoc_string(*subarray, "mname", name, 1); n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof name) -2); if (n < 0) { return NULL; } cp += n; - add_assoc_string(*subarray, "rname", name, 1); + add_ascii_assoc_string(*subarray, "rname", name, 1); GETLONG(n, cp); - add_assoc_long(*subarray, "serial", n); + add_ascii_assoc_long(*subarray, "serial", n); GETLONG(n, cp); - add_assoc_long(*subarray, "refresh", n); + add_ascii_assoc_long(*subarray, "refresh", n); GETLONG(n, cp); - add_assoc_long(*subarray, "retry", n); + add_ascii_assoc_long(*subarray, "retry", n); GETLONG(n, cp); - add_assoc_long(*subarray, "expire", n); + add_ascii_assoc_long(*subarray, "expire", n); GETLONG(n, cp); - add_assoc_long(*subarray, "minimum-ttl", n); + add_ascii_assoc_long(*subarray, "minimum-ttl", n); break; case DNS_T_AAAA: tp = (u_char*)name; @@ -533,15 +533,15 @@ tp++; } tp[0] = '\0'; - add_assoc_string(*subarray, "type", "AAAA", 1); - add_assoc_string(*subarray, "ipv6", name, 1); + add_ascii_assoc_string(*subarray, "type", "AAAA", 1); + add_ascii_assoc_string(*subarray, "ipv6", name, 1); break; case DNS_T_A6: p = cp; - add_assoc_string(*subarray, "type", "A6", 1); + add_ascii_assoc_string(*subarray, "type", "A6", 1); n = ((int)cp[0]) & 0xFF; cp++; - add_assoc_long(*subarray, "masklen", n); + add_ascii_assoc_long(*subarray, "masklen", n); tp = (u_char*)name; if (n > 15) { have_v6_break = 1; @@ -601,59 +601,59 @@ tp++; } tp[0] = '\0'; - add_assoc_string(*subarray, "ipv6", name, 1); + add_ascii_assoc_string(*subarray, "ipv6", name, 1); if (cp < p + dlen) { n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof name) - 2); if (n < 0) { return NULL; } cp += n; - add_assoc_string(*subarray, "chain", name, 1); + add_ascii_assoc_string(*subarray, "chain", name, 1); } break; case DNS_T_SRV: - add_assoc_string(*subarray, "type", "SRV", 1); + add_ascii_assoc_string(*subarray, "type", "SRV", 1); GETSHORT(n, cp); - add_assoc_long(*subarray, "pri", n); + add_ascii_assoc_long(*subarray, "pri", n); GETSHORT(n, cp); - add_assoc_long(*subarray, "weight", n); + add_ascii_assoc_long(*subarray, "weight", n); GETSHORT(n, cp); - add_assoc_long(*subarray, "port", n); + add_ascii_assoc_long(*subarray, "port", n); n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof name) - 2); if (n < 0) { return NULL; } cp += n; - add_assoc_string(*subarray, "target", name, 1); + add_ascii_assoc_string(*subarray, "target", name, 1); break; case DNS_T_NAPTR: - add_assoc_string(*subarray, "type", "NAPTR", 1); + add_ascii_assoc_string(*subarray, "type", "NAPTR", 1); GETSHORT(n, cp); - add_assoc_long(*subarray, "order", n); + add_ascii_assoc_long(*subarray, "order", n); GETSHORT(n, cp); - add_assoc_long(*subarray, "pref", n); + add_ascii_assoc_long(*subarray, "pref", n); n = (cp[0] & 0xFF); - add_assoc_stringl(*subarray, "flags", (char*)++cp, n, 1); + add_ascii_assoc_stringl(*subarray, "flags", (char*)++cp, n, 1); cp += n; n = (cp[0] & 0xFF); - add_assoc_stringl(*subarray, "services", (char*)++cp, n, 1); + add_ascii_assoc_stringl(*subarray, "services", (char*)++cp, n, 1); cp += n; n = (cp[0] & 0xFF); - add_assoc_stringl(*subarray, "regex", (char*)++cp, n, 1); + add_ascii_assoc_stringl(*subarray, "regex", (char*)++cp, n, 1); cp += n; n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof name) - 2); if (n < 0) { return NULL; } cp += n; - add_assoc_string(*subarray, "replacement", name, 1); + add_ascii_assoc_string(*subarray, "replacement", name, 1); break; default: cp += dlen; } - add_assoc_string(*subarray, "class", "IN", 1); - add_assoc_long(*subarray, "ttl", ttl); + add_ascii_assoc_string(*subarray, "class", "IN", 1); + add_ascii_assoc_long(*subarray, "ttl", ttl); return cp; } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.450&r2=1.451&diff_format=u Index: php-src/ext/standard/file.c diff -u php-src/ext/standard/file.c:1.450 php-src/ext/standard/file.c:1.451 --- php-src/ext/standard/file.c:1.450 Fri Aug 18 12:50:36 2006 +++ php-src/ext/standard/file.c Tue Sep 19 10:38:31 2006 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: file.c,v 1.450 2006/08/18 12:50:36 tony2001 Exp $ */ +/* $Id: file.c,v 1.451 2006/09/19 10:38:31 dmitry Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -1748,19 +1748,19 @@ zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_blocks, sizeof(zval *), NULL); /* Store string indexes referencing the same zval*/ - zend_hash_update(HASH_OF(return_value), stat_sb_names[0], strlen(stat_sb_names[0])+1, (void *)&stat_dev, sizeof(zval *), NULL); - zend_hash_update(HASH_OF(return_value), stat_sb_names[1], strlen(stat_sb_names[1])+1, (void *)&stat_ino, sizeof(zval *), NULL); - zend_hash_update(HASH_OF(return_value), stat_sb_names[2], strlen(stat_sb_names[2])+1, (void *)&stat_mode, sizeof(zval *), NULL); - zend_hash_update(HASH_OF(return_value), stat_sb_names[3], strlen(stat_sb_names[3])+1, (void *)&stat_nlink, sizeof(zval *), NULL); - zend_hash_update(HASH_OF(return_value), stat_sb_names[4], strlen(stat_sb_names[4])+1, (void *)&stat_uid, sizeof(zval *), NULL); - zend_hash_update(HASH_OF(return_value), stat_sb_names[5], strlen(stat_sb_names[5])+1, (void *)&stat_gid, sizeof(zval *), NULL); - zend_hash_update(HASH_OF(return_value), stat_sb_names[6], strlen(stat_sb_names[6])+1, (void *)&stat_rdev, sizeof(zval *), NULL); - zend_hash_update(HASH_OF(return_value), stat_sb_names[7], strlen(stat_sb_names[7])+1, (void *)&stat_size, sizeof(zval *), NULL); - zend_hash_update(HASH_OF(return_value), stat_sb_names[8], strlen(stat_sb_names[8])+1, (void *)&stat_atime, sizeof(zval *), NULL); - zend_hash_update(HASH_OF(return_value), stat_sb_names[9], strlen(stat_sb_names[9])+1, (void *)&stat_mtime, sizeof(zval *), NULL); - zend_hash_update(HASH_OF(return_value), stat_sb_names[10], strlen(stat_sb_names[10])+1, (void *)&stat_ctime, sizeof(zval *), NULL); - zend_hash_update(HASH_OF(return_value), stat_sb_names[11], strlen(stat_sb_names[11])+1, (void *)&stat_blksize, sizeof(zval *), NULL); - zend_hash_update(HASH_OF(return_value), stat_sb_names[12], strlen(stat_sb_names[12])+1, (void *)&stat_blocks, sizeof(zval *), NULL); + zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[0], strlen(stat_sb_names[0])+1, (void *)&stat_dev, sizeof(zval *), NULL); + zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[1], strlen(stat_sb_names[1])+1, (void *)&stat_ino, sizeof(zval *), NULL); + zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[2], strlen(stat_sb_names[2])+1, (void *)&stat_mode, sizeof(zval *), NULL); + zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[3], strlen(stat_sb_names[3])+1, (void *)&stat_nlink, sizeof(zval *), NULL); + zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[4], strlen(stat_sb_names[4])+1, (void *)&stat_uid, sizeof(zval *), NULL); + zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[5], strlen(stat_sb_names[5])+1, (void *)&stat_gid, sizeof(zval *), NULL); + zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[6], strlen(stat_sb_names[6])+1, (void *)&stat_rdev, sizeof(zval *), NULL); + zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[7], strlen(stat_sb_names[7])+1, (void *)&stat_size, sizeof(zval *), NULL); + zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[8], strlen(stat_sb_names[8])+1, (void *)&stat_atime, sizeof(zval *), NULL); + zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[9], strlen(stat_sb_names[9])+1, (void *)&stat_mtime, sizeof(zval *), NULL); + zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[10], strlen(stat_sb_names[10])+1, (void *)&stat_ctime, sizeof(zval *), NULL); + zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[11], strlen(stat_sb_names[11])+1, (void *)&stat_blksize, sizeof(zval *), NULL); + zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[12], strlen(stat_sb_names[12])+1, (void *)&stat_blocks, sizeof(zval *), NULL); } /* }}} */ http://cvs.php.net/viewvc.cgi/php-src/ext/standard/filestat.c?r1=1.148&r2=1.149&diff_format=u Index: php-src/ext/standard/filestat.c diff -u php-src/ext/standard/filestat.c:1.148 php-src/ext/standard/filestat.c:1.149 --- php-src/ext/standard/filestat.c:1.148 Fri Jun 30 10:52:51 2006 +++ php-src/ext/standard/filestat.c Tue Sep 19 10:38:31 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: filestat.c,v 1.148 2006/06/30 10:52:51 tony2001 Exp $ */ +/* $Id: filestat.c,v 1.149 2006/09/19 10:38:31 dmitry Exp $ */ #include "php.h" #include "fopen_wrappers.h" @@ -831,19 +831,19 @@ zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_blocks, sizeof(zval *), NULL); /* Store string indexes referencing the same zval*/ - zend_hash_update(HASH_OF(return_value), stat_sb_names[0], strlen(stat_sb_names[0])+1, (void *) &stat_dev, sizeof(zval *), NULL); - zend_hash_update(HASH_OF(return_value), stat_sb_names[1], strlen(stat_sb_names[1])+1, (void *) &stat_ino, sizeof(zval *), NULL); - zend_hash_update(HASH_OF(return_value), stat_sb_names[2], strlen(stat_sb_names[2])+1, (void *) &stat_mode, sizeof(zval *), NULL); - zend_hash_update(HASH_OF(return_value), stat_sb_names[3], strlen(stat_sb_names[3])+1, (void *) &stat_nlink, sizeof(zval *), NULL); - zend_hash_update(HASH_OF(return_value), stat_sb_names[4], strlen(stat_sb_names[4])+1, (void *) &stat_uid, sizeof(zval *), NULL); - zend_hash_update(HASH_OF(return_value), stat_sb_names[5], strlen(stat_sb_names[5])+1, (void *) &stat_gid, sizeof(zval *), NULL); - zend_hash_update(HASH_OF(return_value), stat_sb_names[6], strlen(stat_sb_names[6])+1, (void *) &stat_rdev, sizeof(zval *), NULL); - zend_hash_update(HASH_OF(return_value), stat_sb_names[7], strlen(stat_sb_names[7])+1, (void *) &stat_size, sizeof(zval *), NULL); - zend_hash_update(HASH_OF(return_value), stat_sb_names[8], strlen(stat_sb_names[8])+1, (void *) &stat_atime, sizeof(zval *), NULL); - zend_hash_update(HASH_OF(return_value), stat_sb_names[9], strlen(stat_sb_names[9])+1, (void *) &stat_mtime, sizeof(zval *), NULL); - zend_hash_update(HASH_OF(return_value), stat_sb_names[10], strlen(stat_sb_names[10])+1, (void *) &stat_ctime, sizeof(zval *), NULL); - zend_hash_update(HASH_OF(return_value), stat_sb_names[11], strlen(stat_sb_names[11])+1, (void *) &stat_blksize, sizeof(zval *), NULL); - zend_hash_update(HASH_OF(return_value), stat_sb_names[12], strlen(stat_sb_names[12])+1, (void *) &stat_blocks, sizeof(zval *), NULL); + zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[0], strlen(stat_sb_names[0])+1, (void *) &stat_dev, sizeof(zval *), NULL); + zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[1], strlen(stat_sb_names[1])+1, (void *) &stat_ino, sizeof(zval *), NULL); + zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[2], strlen(stat_sb_names[2])+1, (void *) &stat_mode, sizeof(zval *), NULL); + zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[3], strlen(stat_sb_names[3])+1, (void *) &stat_nlink, sizeof(zval *), NULL); + zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[4], strlen(stat_sb_names[4])+1, (void *) &stat_uid, sizeof(zval *), NULL); + zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[5], strlen(stat_sb_names[5])+1, (void *) &stat_gid, sizeof(zval *), NULL); + zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[6], strlen(stat_sb_names[6])+1, (void *) &stat_rdev, sizeof(zval *), NULL); + zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[7], strlen(stat_sb_names[7])+1, (void *) &stat_size, sizeof(zval *), NULL); + zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[8], strlen(stat_sb_names[8])+1, (void *) &stat_atime, sizeof(zval *), NULL); + zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[9], strlen(stat_sb_names[9])+1, (void *) &stat_mtime, sizeof(zval *), NULL); + zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[10], strlen(stat_sb_names[10])+1, (void *) &stat_ctime, sizeof(zval *), NULL); + zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[11], strlen(stat_sb_names[11])+1, (void *) &stat_blksize, sizeof(zval *), NULL); + zend_ascii_hash_update(HASH_OF(return_value), stat_sb_names[12], strlen(stat_sb_names[12])+1, (void *) &stat_blocks, sizeof(zval *), NULL); return; } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/http_fopen_wrapper.c?r1=1.118&r2=1.119&diff_format=u Index: php-src/ext/standard/http_fopen_wrapper.c diff -u php-src/ext/standard/http_fopen_wrapper.c:1.118 php-src/ext/standard/http_fopen_wrapper.c:1.119 --- php-src/ext/standard/http_fopen_wrapper.c:1.118 Wed Aug 16 08:51:34 2006 +++ php-src/ext/standard/http_fopen_wrapper.c Tue Sep 19 10:38:31 2006 @@ -19,7 +19,7 @@ | Sara Golemon <pollita@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: http_fopen_wrapper.c,v 1.118 2006/08/16 08:51:34 sebastian Exp $ */ +/* $Id: http_fopen_wrapper.c,v 1.119 2006/09/19 10:38:31 dmitry Exp $ */ #include "php.h" #include "php_globals.h" @@ -512,7 +512,7 @@ { zval **rh; - zend_hash_find(EG(active_symbol_table), "http_response_header", sizeof("http_response_header"), (void **) &rh); + zend_ascii_hash_find(EG(active_symbol_table), "http_response_header", sizeof("http_response_header"), (void **) &rh); response_header = *rh; } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/image.c?r1=1.124&r2=1.125&diff_format=u Index: php-src/ext/standard/image.c diff -u php-src/ext/standard/image.c:1.124 php-src/ext/standard/image.c:1.125 --- php-src/ext/standard/image.c:1.124 Sun Jun 25 20:51:31 2006 +++ php-src/ext/standard/image.c Tue Sep 19 10:38:31 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: image.c,v 1.124 2006/06/25 20:51:31 bjori Exp $ */ +/* $Id: image.c,v 1.125 2006/09/19 10:38:31 dmitry Exp $ */ #include "php.h" #include <stdio.h> @@ -456,9 +456,9 @@ sprintf(markername, "APP%d", marker - M_APP0); - if (zend_hash_find(Z_ARRVAL_P(info), markername, strlen(markername)+1, (void **) &tmp) == FAILURE) { + if (zend_ascii_hash_find(Z_ARRVAL_P(info), markername, strlen(markername)+1, (void **) &tmp) == FAILURE) { /* XXX we onyl catch the 1st tag of it's kind! */ - add_assoc_stringl(info, markername, buffer, length, 1); + add_ascii_assoc_stringl(info, markername, buffer, length, 1); } efree(buffer); @@ -1399,13 +1399,13 @@ } if (result->bits != 0) { - add_assoc_long(return_value, "bits", result->bits); + add_ascii_assoc_long(return_value, "bits", result->bits); } if (result->channels != 0) { - add_assoc_long(return_value, "channels", result->channels); + add_ascii_assoc_long(return_value, "channels", result->channels); } temp = (char*)php_image_type_to_mime_type(itype); - add_assoc_ascii_string(return_value, "mime", temp, 1); + add_ascii_assoc_ascii_string(return_value, "mime", temp, 1); efree(result); } else { RETURN_FALSE; http://cvs.php.net/viewvc.cgi/php-src/ext/standard/info.c?r1=1.268&r2=1.269&diff_format=u Index: php-src/ext/standard/info.c diff -u php-src/ext/standard/info.c:1.268 php-src/ext/standard/info.c:1.269 --- php-src/ext/standard/info.c:1.268 Thu Sep 14 08:56:11 2006 +++ php-src/ext/standard/info.c Tue Sep 19 10:38:31 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: info.c,v 1.268 2006/09/14 08:56:11 dmitry Exp $ */ +/* $Id: info.c,v 1.269 2006/09/19 10:38:31 dmitry Exp $ */ #include "php.h" #include "php_ini.h" @@ -713,16 +713,16 @@ php_info_print_table_start(); php_info_print_table_header(2, "Variable", "Value"); - if (zend_hash_find(&EG(symbol_table), "PHP_SELF", sizeof("PHP_SELF"), (void **) &data) != FAILURE) { + if (zend_ascii_hash_find(&EG(symbol_table), "PHP_SELF", sizeof("PHP_SELF"), (void **) &data) != FAILURE) { php_info_print_table_row(2, "PHP_SELF", Z_STRVAL_PP(data)); } - if (zend_hash_find(&EG(symbol_table), "PHP_AUTH_TYPE", sizeof("PHP_AUTH_TYPE"), (void **) &data) != FAILURE) { + if (zend_ascii_hash_find(&EG(symbol_table), "PHP_AUTH_TYPE", sizeof("PHP_AUTH_TYPE"), (void **) &data) != FAILURE) { php_info_print_table_row(2, "PHP_AUTH_TYPE", Z_STRVAL_PP(data)); } - if (zend_hash_find(&EG(symbol_table), "PHP_AUTH_USER", sizeof("PHP_AUTH_USER"), (void **) &data) != FAILURE) { + if (zend_ascii_hash_find(&EG(symbol_table), "PHP_AUTH_USER", sizeof("PHP_AUTH_USER"), (void **) &data) != FAILURE) { php_info_print_table_row(2, "PHP_AUTH_USER", Z_STRVAL_PP(data)); } - if (zend_hash_find(&EG(symbol_table), "PHP_AUTH_PW", sizeof("PHP_AUTH_PW"), (void **) &data) != FAILURE) { + if (zend_ascii_hash_find(&EG(symbol_table), "PHP_AUTH_PW", sizeof("PHP_AUTH_PW"), (void **) &data) != FAILURE) { php_info_print_table_row(2, "PHP_AUTH_PW", Z_STRVAL_PP(data)); } php_print_gpcse_array("_REQUEST", sizeof("_REQUEST")-1 TSRMLS_CC); http://cvs.php.net/viewvc.cgi/php-src/ext/standard/iptc.c?r1=1.55&r2=1.56&diff_format=u Index: php-src/ext/standard/iptc.c diff -u php-src/ext/standard/iptc.c:1.55 php-src/ext/standard/iptc.c:1.56 --- php-src/ext/standard/iptc.c:1.55 Wed Aug 30 16:30:03 2006 +++ php-src/ext/standard/iptc.c Tue Sep 19 10:38:31 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: iptc.c,v 1.55 2006/08/30 16:30:03 tony2001 Exp $ */ +/* $Id: iptc.c,v 1.56 2006/09/19 10:38:31 dmitry Exp $ */ /* * Functions to parse & compse IPTC data. @@ -357,12 +357,12 @@ array_init(return_value); } - if (zend_hash_find(Z_ARRVAL_P(return_value), key, strlen(key) + 1, (void **) &element) == FAILURE) { + if (zend_ascii_hash_find(Z_ARRVAL_P(return_value), key, strlen(key) + 1, (void **) &element) == FAILURE) { ALLOC_ZVAL(values); INIT_PZVAL(values); array_init(values); - zend_hash_update(Z_ARRVAL_P(return_value), key, strlen(key)+1, (void *) &values, sizeof(zval*), (void **) &element); + zend_ascii_hash_update(Z_ARRVAL_P(return_value), key, strlen(key)+1, (void *) &values, sizeof(zval*), (void **) &element); } add_next_index_stringl(*element, (char*)buffer+inx, len, 1); http://cvs.php.net/viewvc.cgi/php-src/ext/standard/microtime.c?r1=1.55&r2=1.56&diff_format=u Index: php-src/ext/standard/microtime.c diff -u php-src/ext/standard/microtime.c:1.55 php-src/ext/standard/microtime.c:1.56 --- php-src/ext/standard/microtime.c:1.55 Sun Jan 1 13:09:55 2006 +++ php-src/ext/standard/microtime.c Tue Sep 19 10:38:31 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: microtime.c,v 1.55 2006/01/01 13:09:55 sniper Exp $ */ +/* $Id: microtime.c,v 1.56 2006/09/19 10:38:31 dmitry Exp $ */ #include "php.h" @@ -74,11 +74,11 @@ offset = timelib_get_time_zone_info(tp.tv_sec, get_timezone_info(TSRMLS_C)); array_init(return_value); - add_assoc_long(return_value, "sec", tp.tv_sec); - add_assoc_long(return_value, "usec", tp.tv_usec); + add_ascii_assoc_long(return_value, "sec", tp.tv_sec); + add_ascii_assoc_long(return_value, "usec", tp.tv_usec); - add_assoc_long(return_value, "minuteswest", -offset->offset / SEC_IN_MIN); - add_assoc_long(return_value, "dsttime", offset->is_dst); + add_ascii_assoc_long(return_value, "minuteswest", -offset->offset / SEC_IN_MIN); + add_ascii_assoc_long(return_value, "dsttime", offset->is_dst); timelib_time_offset_dtor(offset); } else { @@ -127,7 +127,7 @@ array_init(return_value); #define PHP_RUSAGE_PARA(a) \ - add_assoc_long(return_value, #a, usg.a) + add_ascii_assoc_long(return_value, #a, usg.a) #if !defined( _OSD_POSIX) && !defined(__BEOS__) /* BS2000 has only a few fields in the rusage struct */ PHP_RUSAGE_PARA(ru_oublock); PHP_RUSAGE_PARA(ru_inblock); http://cvs.php.net/viewvc.cgi/php-src/ext/standard/proc_open.c?r1=1.42&r2=1.43&diff_format=u Index: php-src/ext/standard/proc_open.c diff -u php-src/ext/standard/proc_open.c:1.42 php-src/ext/standard/proc_open.c:1.43 --- php-src/ext/standard/proc_open.c:1.42 Thu Jun 1 14:03:38 2006 +++ php-src/ext/standard/proc_open.c Tue Sep 19 10:38:31 2006 @@ -15,7 +15,7 @@ | Author: Wez Furlong <wez@thebrainroom.com> | +----------------------------------------------------------------------+ */ -/* $Id: proc_open.c,v 1.42 2006/06/01 14:03:38 tony2001 Exp $ */ +/* $Id: proc_open.c,v 1.43 2006/09/19 10:38:31 dmitry Exp $ */ #if 0 && (defined(__linux__) || defined(sun) || defined(__IRIX__)) # define _BSD_SOURCE /* linux wants this when XOPEN mode is on */ @@ -319,8 +319,8 @@ array_init(return_value); - add_assoc_string(return_value, "command", proc->command, 1); - add_assoc_long(return_value, "pid", (long) proc->child); + add_ascii_assoc_string(return_value, "command", proc->command, 1); + add_ascii_assoc_long(return_value, "pid", (long) proc->child); #ifdef PHP_WIN32 @@ -357,12 +357,12 @@ } #endif - add_assoc_bool(return_value, "running", running); - add_assoc_bool(return_value, "signaled", signaled); - add_assoc_bool(return_value, "stopped", stopped); - add_assoc_long(return_value, "exitcode", exitcode); - add_assoc_long(return_value, "termsig", termsig); - add_assoc_long(return_value, "stopsig", stopsig); + add_ascii_assoc_bool(return_value, "running", running); + add_ascii_assoc_bool(return_value, "signaled", signaled); + add_ascii_assoc_bool(return_value, "stopped", stopped); + add_ascii_assoc_long(return_value, "exitcode", exitcode); + add_ascii_assoc_long(return_value, "termsig", termsig); + add_ascii_assoc_long(return_value, "stopsig", stopsig); } /* }}} */ @@ -456,7 +456,7 @@ #ifdef PHP_WIN32 if (other_options) { zval **item; - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(other_options), "suppress_errors", sizeof("suppress_errors"), (void**)&item)) { + if (SUCCESS == zend_ascii_hash_find(Z_ARRVAL_P(other_options), "suppress_errors", sizeof("suppress_errors"), (void**)&item)) { if (Z_TYPE_PP(item) == IS_BOOL && Z_BVAL_PP(item)) { suppress_errors = 1; } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/scanf.c?r1=1.34&r2=1.35&diff_format=u Index: php-src/ext/standard/scanf.c diff -u php-src/ext/standard/scanf.c:1.34 php-src/ext/standard/scanf.c:1.35 --- php-src/ext/standard/scanf.c:1.34 Fri Aug 4 11:49:18 2006 +++ php-src/ext/standard/scanf.c Tue Sep 19 10:38:31 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: scanf.c,v 1.34 2006/08/04 11:49:18 tony2001 Exp $ */ +/* $Id: scanf.c,v 1.35 2006/09/19 10:38:31 dmitry Exp $ */ /* scanf.c -- @@ -656,11 +656,15 @@ */ if (!numVars) { + zval *tmp; + /* allocate an array for return */ array_init(*return_value); for (i = 0; i < totalVars; i++) { - if (add_next_index_null(*return_value) == FAILURE) { + MAKE_STD_ZVAL(tmp); + ZVAL_NULL(tmp); + if (add_next_index_zval(*return_value, tmp) == FAILURE) { scan_set_error_return(0, return_value); return FAILURE; } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.84&r2=1.85&diff_format=u Index: php-src/ext/standard/streamsfuncs.c diff -u php-src/ext/standard/streamsfuncs.c:1.84 php-src/ext/standard/streamsfuncs.c:1.85 --- php-src/ext/standard/streamsfuncs.c:1.84 Mon Sep 11 14:53:33 2006 +++ php-src/ext/standard/streamsfuncs.c Tue Sep 19 10:38:31 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: streamsfuncs.c,v 1.84 2006/09/11 14:53:33 iliaa Exp $ */ +/* $Id: streamsfuncs.c,v 1.85 2006/09/19 10:38:31 dmitry Exp $ */ #include "php.h" #include "php_globals.h" @@ -458,14 +458,14 @@ zval_copy_ctor(newval); INIT_PZVAL(newval); - add_assoc_zval(return_value, "wrapper_data", newval); + add_ascii_assoc_zval(return_value, "wrapper_data", newval); } if (stream->wrapper) { - add_assoc_string(return_value, "wrapper_type", (char *)stream->wrapper->wops->label, 1); + add_ascii_assoc_string(return_value, "wrapper_type", (char *)stream->wrapper->wops->label, 1); } - add_assoc_string(return_value, "stream_type", (char *)stream->ops->label, 1); + add_ascii_assoc_string(return_value, "stream_type", (char *)stream->ops->label, 1); - add_assoc_string(return_value, "mode", stream->mode, 1); + add_ascii_assoc_string(return_value, "mode", stream->mode, 1); if (stream->readfilters.head) { php_stream_filter *filter; @@ -477,7 +477,7 @@ add_next_index_string(newval, filter->name, 1); } - add_assoc_zval(return_value, "read_filters", newval); + add_ascii_assoc_zval(return_value, "read_filters", newval); } if (stream->writefilters.head) { @@ -490,27 +490,27 @@ add_next_index_string(newval, filter->name, 1); } - add_assoc_zval(return_value, "write_filters", newval); + add_ascii_assoc_zval(return_value, "write_filters", newval); } if (stream->readbuf_type == IS_UNICODE) { int readbuf_len = u_countChar32(stream->readbuf.u + stream->readpos, stream->writepos - stream->readpos); - add_assoc_long(return_value, "unread_bytes", UBYTES(stream->writepos - stream->readpos)); - add_assoc_long(return_value, "unread_chars", readbuf_len); + add_ascii_assoc_long(return_value, "unread_bytes", UBYTES(stream->writepos - stream->readpos)); + add_ascii_assoc_long(return_value, "unread_chars", readbuf_len); } else { /* IS_STRING */ - add_assoc_long(return_value, "unread_bytes", stream->writepos - stream->readpos); - add_assoc_long(return_value, "unread_chars", stream->writepos - stream->readpos); + add_ascii_assoc_long(return_value, "unread_bytes", stream->writepos - stream->readpos); + add_ascii_assoc_long(return_value, "unread_chars", stream->writepos - stream->readpos); } - add_assoc_bool(return_value, "seekable", (stream->ops->seek) && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0); + add_ascii_assoc_bool(return_value, "seekable", (stream->ops->seek) && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0); if (stream->orig_path) { - add_assoc_string(return_value, "uri", stream->orig_path, 1); + add_ascii_assoc_string(return_value, "uri", stream->orig_path, 1); } if (!php_stream_populate_meta_data(stream, return_value)) { - add_assoc_bool(return_value, "timed_out", 0); - add_assoc_bool(return_value, "blocked", 1); - add_assoc_bool(return_value, "eof", php_stream_eof(stream)); + add_ascii_assoc_bool(return_value, "timed_out", 0); + add_ascii_assoc_bool(return_value, "blocked", 1); + add_ascii_assoc_bool(return_value, "eof", php_stream_eof(stream)); } } @@ -914,7 +914,7 @@ int ret = SUCCESS; zval **tmp; - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "notification", sizeof("notification"), (void**)&tmp)) { + if (SUCCESS == zend_ascii_hash_find(Z_ARRVAL_P(params), "notification", sizeof("notification"), (void**)&tmp)) { if (context->notifier) { php_stream_notification_free(context->notifier); @@ -927,10 +927,10 @@ ZVAL_ADDREF(*tmp); context->notifier->dtor = user_space_stream_notifier_dtor; } - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "options", sizeof("options"), (void**)&tmp)) { + if (SUCCESS == zend_ascii_hash_find(Z_ARRVAL_P(params), "options", sizeof("options"), (void**)&tmp)) { parse_context_options(context, *tmp TSRMLS_CC); } - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "encoding", sizeof("encoding"), (void**)&tmp)) { + if (SUCCESS == zend_ascii_hash_find(Z_ARRVAL_P(params), "encoding", sizeof("encoding"), (void**)&tmp)) { zval strval = **tmp; if (context->input_encoding) { @@ -944,7 +944,7 @@ context->input_encoding = Z_STRVAL(strval); context->output_encoding = estrdup(Z_STRVAL(strval)); } - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "input_encoding", sizeof("input_encoding"), (void**)&tmp)) { + if (SUCCESS == zend_ascii_hash_find(Z_ARRVAL_P(params), "input_encoding", sizeof("input_encoding"), (void**)&tmp)) { zval strval = **tmp; if (context->input_encoding) { @@ -955,7 +955,7 @@ convert_to_string(&strval); context->input_encoding = Z_STRVAL(strval); } - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "output_encoding", sizeof("output_encoding"), (void**)&tmp)) { + if (SUCCESS == zend_ascii_hash_find(Z_ARRVAL_P(params), "output_encoding", sizeof("output_encoding"), (void**)&tmp)) { zval strval = **tmp; if (context->output_encoding) { @@ -966,7 +966,7 @@ convert_to_string(&strval); context->output_encoding = Z_STRVAL(strval); } - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "default_mode", sizeof("default_mode"), (void**)&tmp)) { + if (SUCCESS == zend_ascii_hash_find(Z_ARRVAL_P(params), "default_mode", sizeof("default_mode"), (void**)&tmp)) { zval longval = **tmp; zval_copy_ctor(&longval); http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.586&r2=1.587&diff_format=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.586 php-src/ext/standard/string.c:1.587 --- php-src/ext/standard/string.c:1.586 Thu Aug 31 14:19:33 2006 +++ php-src/ext/standard/string.c Tue Sep 19 10:38:31 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c,v 1.586 2006/08/31 14:19:33 tony2001 Exp $ */ +/* $Id: string.c,v 1.587 2006/09/19 10:38:31 dmitry Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -2076,7 +2076,7 @@ ret_len = php_dirname(ret.s, path_len); } if (ret_len > 0) { - add_assoc_zstrl(tmp, "dirname", path_type, ret, ret_len, 1); + add_ascii_assoc_zstrl(tmp, "dirname", path_type, ret, ret_len, 1); } efree(ret.v); ret = NULL_ZSTR; @@ -2091,7 +2091,7 @@ } if (have_basename) { - add_assoc_zstrl(tmp, "basename", path_type, ret, ret_len, 0); + add_ascii_assoc_zstrl(tmp, "basename", path_type, ret, ret_len, 0); } if (have_ext) { @@ -2113,7 +2113,7 @@ } if (ext.v) { - add_assoc_zstrl(tmp, "extension", path_type, ext, ext_len, 1); + add_ascii_assoc_zstrl(tmp, "extension", path_type, ext, ext_len, 1); } } @@ -2129,7 +2129,7 @@ idx = p.s ? (p.s - ret.s) : ret_len; } - add_assoc_zstrl(tmp, "filename", path_type, ret, idx, 1); + add_ascii_assoc_zstrl(tmp, "filename", path_type, ret, idx, 1); } if (!have_basename && ret.v) { @@ -5112,6 +5112,8 @@ /* For each subject entry, convert it to string, then perform replacement and add the result to the return_value array. */ while (zend_hash_get_current_data(Z_ARRVAL_PP(subject), (void **)&subject_entry) == SUCCESS) { + zend_uchar utype; + if (Z_TYPE_PP(subject_entry) != IS_ARRAY && Z_TYPE_PP(subject_entry) != IS_OBJECT) { MAKE_STD_ZVAL(result); SEPARATE_ZVAL(subject_entry); @@ -5122,11 +5124,11 @@ COPY_PZVAL_TO_ZVAL(*result, *subject_entry); } /* Add to return array */ - switch (zend_hash_get_current_key_ex(Z_ARRVAL_PP(subject), &string_key, - &string_key_len, &num_key, 0, NULL)) { + switch ((utype = zend_hash_get_current_key_ex(Z_ARRVAL_PP(subject), &string_key, + &string_key_len, &num_key, 0, NULL))) { case HASH_KEY_IS_STRING: case HASH_KEY_IS_UNICODE: - add_assoc_zval_ex(return_value, string_key.s, string_key_len, result); + add_u_assoc_zval_ex(return_value, utype, string_key, string_key_len, result); break; case HASH_KEY_IS_LONG: @@ -6456,22 +6458,22 @@ add_index_long(mon_grouping, i, currlocdata.mon_grouping[i]); } - add_assoc_string(return_value, "decimal_point", currlocdata.decimal_point, 1); - add_assoc_string(return_value, "thousands_sep", currlocdata.thousands_sep, 1); - add_assoc_string(return_value, "int_curr_symbol", currlocdata.int_curr_symbol, 1); - add_assoc_string(return_value, "currency_symbol", currlocdata.currency_symbol, 1); - add_assoc_string(return_value, "mon_decimal_point", currlocdata.mon_decimal_point, 1); - add_assoc_string(return_value, "mon_thousands_sep", currlocdata.mon_thousands_sep, 1); - add_assoc_string(return_value, "positive_sign", currlocdata.positive_sign, 1); - add_assoc_string(return_value, "negative_sign", currlocdata.negative_sign, 1); - add_assoc_long( return_value, "int_frac_digits", currlocdata.int_frac_digits ); - add_assoc_long( return_value, "frac_digits", currlocdata.frac_digits ); - add_assoc_long( return_value, "p_cs_precedes", currlocdata.p_cs_precedes ); - add_assoc_long( return_value, "p_sep_by_space", currlocdata.p_sep_by_space ); - add_assoc_long( return_value, "n_cs_precedes", currlocdata.n_cs_precedes ); - add_assoc_long( return_value, "n_sep_by_space", currlocdata.n_sep_by_space ); - add_assoc_long( return_value, "p_sign_posn", currlocdata.p_sign_posn ); - add_assoc_long( return_value, "n_sign_posn", currlocdata.n_sign_posn ); + add_ascii_assoc_string(return_value, "decimal_point", currlocdata.decimal_point, 1); + add_ascii_assoc_string(return_value, "thousands_sep", currlocdata.thousands_sep, 1); + add_ascii_assoc_string(return_value, "int_curr_symbol", currlocdata.int_curr_symbol, 1); + add_ascii_assoc_string(return_value, "currency_symbol", currlocdata.currency_symbol, 1); + add_ascii_assoc_string(return_value, "mon_decimal_point", currlocdata.mon_decimal_point, 1); + add_ascii_assoc_string(return_value, "mon_thousands_sep", currlocdata.mon_thousands_sep, 1); + add_ascii_assoc_string(return_value, "positive_sign", currlocdata.positive_sign, 1); + add_ascii_assoc_string(return_value, "negative_sign", currlocdata.negative_sign, 1); + add_ascii_assoc_long( return_value, "int_frac_digits", currlocdata.int_frac_digits ); + add_ascii_assoc_long( return_value, "frac_digits", currlocdata.frac_digits ); + add_ascii_assoc_long( return_value, "p_cs_precedes", currlocdata.p_cs_precedes ); + add_ascii_assoc_long( return_value, "p_sep_by_space", currlocdata.p_sep_by_space ); + add_ascii_assoc_long( return_value, "n_cs_precedes", currlocdata.n_cs_precedes ); + add_ascii_assoc_long( return_value, "n_sep_by_space", currlocdata.n_sep_by_space ); + add_ascii_assoc_long( return_value, "p_sign_posn", currlocdata.p_sign_posn ); + add_ascii_assoc_long( return_value, "n_sign_posn", currlocdata.n_sign_posn ); } #else /* Ok, it doesn't look like we have locale info floating around, so I guess it @@ -6480,26 +6482,26 @@ add_index_long(grouping, 0, -1); add_index_long(mon_grouping, 0, -1); - add_assoc_string(return_value, "decimal_point", "\x2E", 1); - add_assoc_string(return_value, "thousands_sep", "", 1); - add_assoc_string(return_value, "int_curr_symbol", "", 1); - add_assoc_string(return_value, "currency_symbol", "", 1); - add_assoc_string(return_value, "mon_decimal_point", "\x2E", 1); - add_assoc_string(return_value, "mon_thousands_sep", "", 1); - add_assoc_string(return_value, "positive_sign", "", 1); - add_assoc_string(return_value, "negative_sign", "", 1); - add_assoc_long( return_value, "int_frac_digits", CHAR_MAX ); - add_assoc_long( return_value, "frac_digits", CHAR_MAX ); - add_assoc_long( return_value, "p_cs_precedes", CHAR_MAX ); - add_assoc_long( return_value, "p_sep_by_space", CHAR_MAX ); - add_assoc_long( return_value, "n_cs_precedes", CHAR_MAX ); - add_assoc_long( return_value, "n_sep_by_space", CHAR_MAX ); - add_assoc_long( return_value, "p_sign_posn", CHAR_MAX ); - add_assoc_long( return_value, "n_sign_posn", CHAR_MAX ); + add_ascii_assoc_string(return_value, "decimal_point", "\x2E", 1); + add_ascii_assoc_string(return_value, "thousands_sep", "", 1); + add_ascii_assoc_string(return_value, "int_curr_symbol", "", 1); + add_ascii_assoc_string(return_value, "currency_symbol", "", 1); + add_ascii_assoc_string(return_value, "mon_decimal_point", "\x2E", 1); + add_ascii_assoc_string(return_value, "mon_thousands_sep", "", 1); + add_ascii_assoc_string(return_value, "positive_sign", "", 1); + add_ascii_assoc_string(return_value, "negative_sign", "", 1); + add_ascii_assoc_long( return_value, "int_frac_digits", CHAR_MAX ); + add_ascii_assoc_long( return_value, "frac_digits", CHAR_MAX ); + add_ascii_assoc_long( return_value, "p_cs_precedes", CHAR_MAX ); + add_ascii_assoc_long( return_value, "p_sep_by_space", CHAR_MAX ); + add_ascii_assoc_long( return_value, "n_cs_precedes", CHAR_MAX ); + add_ascii_assoc_long( return_value, "n_sep_by_space", CHAR_MAX ); + add_ascii_assoc_long( return_value, "p_sign_posn", CHAR_MAX ); + add_ascii_assoc_long( return_value, "n_sign_posn", CHAR_MAX ); #endif - zend_hash_update(Z_ARRVAL_P(return_value), "grouping", 9, &grouping, sizeof(zval *), NULL); - zend_hash_update(Z_ARRVAL_P(return_value), "mon_grouping", 13, &mon_grouping, sizeof(zval *), NULL); + zend_ascii_hash_update(Z_ARRVAL_P(return_value), "grouping", 9, &grouping, sizeof(zval *), NULL); + zend_ascii_hash_update(Z_ARRVAL_P(return_value), "mon_grouping", 13, &mon_grouping, sizeof(zval *), NULL); } /* }}} */ @@ -7076,7 +7078,7 @@ array_init(return_value); if (split_length >= str_len) { - add_next_index_zstrl(return_value, str, str_len, str_type, 1); + add_next_index_zstrl(return_value, str_type, str, str_len, 1); return; } @@ -7087,12 +7089,12 @@ } while (n_reg_segments-- > 0) { - add_next_index_zstrl(return_value, ZSTR(p), split_length, str_type, 1); + add_next_index_zstrl(return_value, str_type, ZSTR(p), split_length, 1); p += split_length * charsize; } if (p != (str.s + str_len * charsize)) { - add_next_index_zstrl(return_value, ZSTR(p), (str.s + str_len * charsize - p), str_type, 1); + add_next_index_zstrl(return_value, str_type, ZSTR(p), (str.s + str_len * charsize - p), 1); } } /* }}} */ http://cvs.php.net/viewvc.cgi/php-src/ext/standard/url.c?r1=1.94&r2=1.95&diff_format=u Index: php-src/ext/standard/url.c diff -u php-src/ext/standard/url.c:1.94 php-src/ext/standard/url.c:1.95 --- php-src/ext/standard/url.c:1.94 Thu Jun 29 14:32:24 2006 +++ php-src/ext/standard/url.c Tue Sep 19 10:38:31 2006 @@ -15,7 +15,7 @@ | Author: Jim Winstead <jimw@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: url.c,v 1.94 2006/06/29 14:32:24 bjori Exp $ */ +/* $Id: url.c,v 1.95 2006/09/19 10:38:31 dmitry Exp $ */ #include <stdlib.h> #include <string.h> @@ -386,21 +386,21 @@ /* add the various elements to the array */ if (resource->scheme != NULL) - add_assoc_string(return_value, "scheme", resource->scheme, 1); + add_ascii_assoc_string(return_value, "scheme", resource->scheme, 1); if (resource->host != NULL) - add_assoc_string(return_value, "host", resource->host, 1); + add_ascii_assoc_string(return_value, "host", resource->host, 1); if (resource->port != 0) - add_assoc_long(return_value, "port", resource->port); + add_ascii_assoc_long(return_value, "port", resource->port); if (resource->user != NULL) - add_assoc_string(return_value, "user", resource->user, 1); + add_ascii_assoc_string(return_value, "user", resource->user, 1); if (resource->pass != NULL) - add_assoc_string(return_value, "pass", resource->pass, 1); + add_ascii_assoc_string(return_value, "pass", resource->pass, 1); if (resource->path != NULL) - add_assoc_string(return_value, "path", resource->path, 1); + add_ascii_assoc_string(return_value, "path", resource->path, 1); if (resource->query != NULL) - add_assoc_string(return_value, "query", resource->query, 1); + add_ascii_assoc_string(return_value, "query", resource->query, 1); if (resource->fragment != NULL) - add_assoc_string(return_value, "fragment", resource->fragment, 1); + add_ascii_assoc_string(return_value, "fragment", resource->fragment, 1); done: php_url_free(resource); } http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/zlib.c?r1=1.210&r2=1.211&diff_format=u Index: php-src/ext/zlib/zlib.c diff -u php-src/ext/zlib/zlib.c:1.210 php-src/ext/zlib/zlib.c:1.211 --- php-src/ext/zlib/zlib.c:1.210 Mon Sep 4 10:31:11 2006 +++ php-src/ext/zlib/zlib.c Tue Sep 19 10:38:31 2006 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zlib.c,v 1.210 2006/09/04 10:31:11 mike Exp $ */ +/* $Id: zlib.c,v 1.211 2006/09/19 10:38:31 dmitry Exp $ */ #ifdef HAVE_CONFIG_H # include "config.h" @@ -57,7 +57,7 @@ if (!ZLIBG(compression_coding)) { zend_is_auto_global(ZEND_STRL("_SERVER") TSRMLS_CC); - if (PG(http_globals)[TRACK_VARS_SERVER] && SUCCESS == zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "HTTP_ACCEPT_ENCODING", sizeof("HTTP_ACCEPT_ENCODING"), (void *) &enc)) { + if (PG(http_globals)[TRACK_VARS_SERVER] && SUCCESS == zend_ascii_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "HTTP_ACCEPT_ENCODING", sizeof("HTTP_ACCEPT_ENCODING"), (void *) &enc)) { convert_to_string(*enc); if (strstr(Z_STRVAL_PP(enc), "gzip")) { ZLIBG(compression_coding) = PHP_ZLIB_ENCODING_GZIP; http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.701&r2=1.702&diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.701 php-src/main/main.c:1.702 --- php-src/main/main.c:1.701 Mon Sep 18 23:11:01 2006 +++ php-src/main/main.c Tue Sep 19 10:38:31 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: main.c,v 1.701 2006/09/18 23:11:01 iliaa Exp $ */ +/* $Id: main.c,v 1.702 2006/09/19 10:38:31 dmitry Exp $ */ /* {{{ includes */ @@ -685,7 +685,7 @@ zval *tmp; ALLOC_INIT_ZVAL(tmp); ZVAL_RT_STRINGL(tmp, buffer, buffer_len, 1); - zend_hash_update(EG(active_symbol_table), "php_errormsg", sizeof("php_errormsg"), (void **) &tmp, sizeof(zval *), NULL); + zend_ascii_hash_update(EG(active_symbol_table), "php_errormsg", sizeof("php_errormsg"), (void **) &tmp, sizeof(zval *), NULL); } efree(buffer); } @@ -950,7 +950,7 @@ ALLOC_INIT_ZVAL(tmp); ZVAL_RT_STRINGL(tmp, buffer, buffer_len, 1); - zend_hash_update(EG(active_symbol_table), "php_errormsg", sizeof("php_errormsg"), (void **) & tmp, sizeof(zval *), NULL); + zend_ascii_hash_update(EG(active_symbol_table), "php_errormsg", sizeof("php_errormsg"), (void **) & tmp, sizeof(zval *), NULL); } efree(buffer); } @@ -1735,7 +1735,7 @@ if (sapi_module.additional_functions) { zend_module_entry *module; - if (zend_hash_find(&module_registry, "standard", sizeof("standard"), (void**)&module)==SUCCESS) { + if (zend_ascii_hash_find(&module_registry, "standard", sizeof("standard"), (void**)&module)==SUCCESS) { EG(current_module) = module; zend_register_functions(NULL, sapi_module.additional_functions, NULL, MODULE_PERSISTENT TSRMLS_CC); EG(current_module) = NULL; http://cvs.php.net/viewvc.cgi/php-src/main/output.c?r1=1.195&r2=1.196&diff_format=u Index: php-src/main/output.c diff -u php-src/main/output.c:1.195 php-src/main/output.c:1.196 --- php-src/main/output.c:1.195 Thu Aug 31 13:51:35 2006 +++ php-src/main/output.c Tue Sep 19 10:38:31 2006 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: output.c,v 1.195 2006/08/31 13:51:35 mike Exp $ */ +/* $Id: output.c,v 1.196 2006/09/19 10:38:31 dmitry Exp $ */ #ifndef PHP_OUTPUT_DEBUG # define PHP_OUTPUT_DEBUG 0 @@ -548,12 +548,12 @@ if (php_output_lock_error(PHP_OUTPUT_HANDLER_START TSRMLS_CC) || !handler) { return FAILURE; } - if (SUCCESS == zend_u_hash_find(&php_output_handler_conflicts, Z_TYPE_P(handler->name), Z_UNIVAL_P(handler->name), Z_UNILEN_P(handler->name), (void *) &conflict)) { + if (SUCCESS == zend_u_hash_find(&php_output_handler_conflicts, Z_TYPE_P(handler->name), Z_UNIVAL_P(handler->name), Z_UNILEN_P(handler->name)+1, (void *) &conflict)) { if (SUCCESS != (*conflict)(handler->name TSRMLS_CC)) { return FAILURE; } } - if (SUCCESS == zend_u_hash_find(&php_output_handler_reverse_conflicts, Z_TYPE_P(handler->name), Z_UNIVAL_P(handler->name), Z_UNILEN_P(handler->name), (void *) &rconflicts)) { + if (SUCCESS == zend_u_hash_find(&php_output_handler_reverse_conflicts, Z_TYPE_P(handler->name), Z_UNIVAL_P(handler->name), Z_UNILEN_P(handler->name)+1, (void *) &rconflicts)) { for ( zend_hash_internal_pointer_reset_ex(rconflicts, &pos); zend_hash_get_current_data_ex(rconflicts, (void *) &conflict, &pos) == SUCCESS; zend_hash_move_forward_ex(rconflicts, &pos)) { @@ -616,7 +616,7 @@ zend_error(E_ERROR, "Cannot register an output handler conflict outside of MINIT"); return FAILURE; } - return zend_u_hash_update(&php_output_handler_conflicts, Z_TYPE_P(name), Z_UNIVAL_P(name), Z_UNILEN_P(name), &check_func, sizeof(php_output_handler_conflict_check_t *), NULL); + return zend_u_hash_update(&php_output_handler_conflicts, Z_TYPE_P(name), Z_UNIVAL_P(name), Z_UNILEN_P(name)+1, &check_func, sizeof(php_output_handler_conflict_check_t *), NULL); } /* }}} */ @@ -630,7 +630,7 @@ zend_error(E_ERROR, "Cannot register a reverse output handler conflict outside of MINIT"); return FAILURE; } - if (SUCCESS == zend_u_hash_find(&php_output_handler_reverse_conflicts, Z_TYPE_P(name), Z_UNIVAL_P(name), Z_UNILEN_P(name), (void *) &rev_ptr)) { + if (SUCCESS == zend_u_hash_find(&php_output_handler_reverse_conflicts, Z_TYPE_P(name), Z_UNIVAL_P(name), Z_UNILEN_P(name)+1, (void *) &rev_ptr)) { return zend_hash_next_index_insert(rev_ptr, &check_func, sizeof(php_output_handler_conflict_check_t *), NULL); } else { zend_u_hash_init(&rev, 1, NULL, NULL, 1, 1); @@ -638,7 +638,7 @@ zend_hash_destroy(&rev); return FAILURE; } - if (SUCCESS != zend_u_hash_update(&php_output_handler_reverse_conflicts, Z_TYPE_P(name), Z_UNIVAL_P(name), Z_UNILEN_P(name), &rev, sizeof(HashTable), NULL)) { + if (SUCCESS != zend_u_hash_update(&php_output_handler_reverse_conflicts, Z_TYPE_P(name), Z_UNIVAL_P(name), Z_UNILEN_P(name)+1, &rev, sizeof(HashTable), NULL)) { zend_hash_destroy(&rev); return FAILURE; } @@ -653,7 +653,7 @@ { php_output_handler_alias_ctor_t *func = NULL; - zend_u_hash_find(&php_output_handler_aliases, Z_TYPE_P(name), Z_UNIVAL_P(name), Z_UNILEN_P(name), (void *) &func); + zend_u_hash_find(&php_output_handler_aliases, Z_TYPE_P(name), Z_UNIVAL_P(name), Z_UNILEN_P(name)+1, (void *) &func); return func; } /* }}} */ @@ -666,7 +666,7 @@ zend_error(E_ERROR, "Cannot register an output handler alias outside of MINIT"); return FAILURE; } - return zend_u_hash_update(&php_output_handler_aliases, Z_TYPE_P(name), Z_UNIVAL_P(name), Z_UNILEN_P(name), &func, sizeof(php_output_handler_alias_ctor_t *), NULL); + return zend_u_hash_update(&php_output_handler_aliases, Z_TYPE_P(name), Z_UNIVAL_P(name), Z_UNILEN_P(name)+1, &func, sizeof(php_output_handler_alias_ctor_t *), NULL); } /* }}} */ @@ -1174,13 +1174,13 @@ } ZVAL_ADDREF(handler->name); - add_assoc_zval(entry, "name", handler->name); - add_assoc_long(entry, "type", (long) (handler->flags & 0xf)); - add_assoc_long(entry, "flags", (long) handler->flags); - add_assoc_long(entry, "level", (long) handler->level); - add_assoc_long(entry, "chunk_size", (long) handler->size); - add_assoc_long(entry, "buffer_size", (long) handler->buffer.size); - add_assoc_long(entry, "buffer_used", (long) handler->buffer.used); + add_ascii_assoc_zval(entry, "name", handler->name); + add_ascii_assoc_long(entry, "type", (long) (handler->flags & 0xf)); + add_ascii_assoc_long(entry, "flags", (long) handler->flags); + add_ascii_assoc_long(entry, "level", (long) handler->level); + add_ascii_assoc_long(entry, "chunk_size", (long) handler->size); + add_ascii_assoc_long(entry, "buffer_size", (long) handler->buffer.size); + add_ascii_assoc_long(entry, "buffer_used", (long) handler->buffer.used); return entry; } http://cvs.php.net/viewvc.cgi/php-src/main/php_variables.c?r1=1.130&r2=1.131&diff_format=u Index: php-src/main/php_variables.c diff -u php-src/main/php_variables.c:1.130 php-src/main/php_variables.c:1.131 --- php-src/main/php_variables.c:1.130 Tue Aug 8 17:05:14 2006 +++ php-src/main/php_variables.c Tue Sep 19 10:38:31 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_variables.c,v 1.130 2006/08/08 17:05:14 tony2001 Exp $ */ +/* $Id: php_variables.c,v 1.131 2006/09/19 10:38:31 dmitry Exp $ */ #include <stdio.h> #include "php.h" @@ -160,11 +160,11 @@ array_init(gpc_element); zend_hash_next_index_insert(symtable1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); } else { - if (zend_symtable_find(symtable1, index, index_len + 1, (void **) &gpc_element_p) == FAILURE + if (zend_rt_symtable_find(symtable1, index, index_len + 1, (void **) &gpc_element_p) == FAILURE || Z_TYPE_PP(gpc_element_p) != IS_ARRAY) { MAKE_STD_ZVAL(gpc_element); array_init(gpc_element); - zend_symtable_update(symtable1, index, index_len + 1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); + zend_rt_symtable_update(symtable1, index, index_len + 1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); } } symtable1 = Z_ARRVAL_PP(gpc_element_p); @@ -196,10 +196,10 @@ */ if (PG(http_globals)[TRACK_VARS_COOKIE] && symtable1 == Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]) && - zend_symtable_exists(symtable1, index, index_len+1)) { + zend_rt_symtable_exists(symtable1, index, index_len+1)) { zval_ptr_dtor(&gpc_element); } else { - zend_symtable_update(symtable1, index, index_len + 1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); + zend_rt_symtable_update(symtable1, index, index_len + 1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); } } } @@ -687,14 +687,14 @@ if (SG(request_info).argc) { arr->refcount++; argc->refcount++; - zend_hash_update(&EG(symbol_table), "argv", sizeof("argv"), &arr, sizeof(zval *), NULL); - zend_hash_add(&EG(symbol_table), "argc", sizeof("argc"), &argc, sizeof(zval *), NULL); + zend_ascii_hash_update(&EG(symbol_table), "argv", sizeof("argv"), &arr, sizeof(zval *), NULL); + zend_ascii_hash_add(&EG(symbol_table), "argc", sizeof("argc"), &argc, sizeof(zval *), NULL); } if (track_vars_array) { arr->refcount++; argc->refcount++; - zend_hash_update(Z_ARRVAL_P(track_vars_array), "argv", sizeof("argv"), &arr, sizeof(zval *), NULL); - zend_hash_update(Z_ARRVAL_P(track_vars_array), "argc", sizeof("argc"), &argc, sizeof(zval *), NULL); + zend_ascii_hash_update(Z_ARRVAL_P(track_vars_array), "argv", sizeof("argv"), &arr, sizeof(zval *), NULL); + zend_ascii_hash_update(Z_ARRVAL_P(track_vars_array), "argc", sizeof("argc"), &argc, sizeof(zval *), NULL); } zval_ptr_dtor(&arr); zval_ptr_dtor(&argc); @@ -893,7 +893,7 @@ } PG(http_globals)[i]->refcount++; - zend_hash_update(&EG(symbol_table), auto_global_records[i].name, auto_global_records[i].name_len, &PG(http_globals)[i], sizeof(zval *), NULL); + zend_ascii_hash_update(&EG(symbol_table), auto_global_records[i].name, auto_global_records[i].name_len, &PG(http_globals)[i], sizeof(zval *), NULL); } /* Create _REQUEST */ @@ -915,12 +915,12 @@ if (SG(request_info).argc) { zval **argc, **argv; - if (zend_hash_find(&EG(symbol_table), "argc", sizeof("argc"), (void**)&argc) == SUCCESS && - zend_hash_find(&EG(symbol_table), "argv", sizeof("argv"), (void**)&argv) == SUCCESS) { + if (zend_ascii_hash_find(&EG(symbol_table), "argc", sizeof("argc"), (void**)&argc) == SUCCESS && + zend_ascii_hash_find(&EG(symbol_table), "argv", sizeof("argv"), (void**)&argv) == SUCCESS) { (*argc)->refcount++; (*argv)->refcount++; - zend_hash_update(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "argv", sizeof("argv"), argv, sizeof(zval *), NULL); - zend_hash_update(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "argc", sizeof("argc"), argc, sizeof(zval *), NULL); + zend_ascii_hash_update(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "argv", sizeof("argv"), argv, sizeof(zval *), NULL); + zend_ascii_hash_update(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "argc", sizeof("argc"), argc, sizeof(zval *), NULL); } } else { php_build_argv(SG(request_info).query_string, PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC); @@ -938,7 +938,7 @@ PG(http_globals)[TRACK_VARS_SERVER] = server_vars; } - zend_hash_update(&EG(symbol_table), name, name_len + 1, &PG(http_globals)[TRACK_VARS_SERVER], sizeof(zval *), NULL); + zend_ascii_hash_update(&EG(symbol_table), name, name_len + 1, &PG(http_globals)[TRACK_VARS_SERVER], sizeof(zval *), NULL); PG(http_globals)[TRACK_VARS_SERVER]->refcount++; return 0; /* don't rearm */ @@ -959,7 +959,7 @@ php_import_environment_variables(PG(http_globals)[TRACK_VARS_ENV] TSRMLS_CC); } - zend_hash_update(&EG(symbol_table), name, name_len + 1, &PG(http_globals)[TRACK_VARS_ENV], sizeof(zval *), NULL); + zend_ascii_hash_update(&EG(symbol_table), name, name_len + 1, &PG(http_globals)[TRACK_VARS_ENV], sizeof(zval *), NULL); PG(http_globals)[TRACK_VARS_ENV]->refcount++; return 0; /* don't rearm */ @@ -1001,7 +1001,7 @@ } } - zend_hash_update(&EG(symbol_table), "_REQUEST", sizeof("_REQUEST"), &form_variables, sizeof(zval *), NULL); + zend_ascii_hash_update(&EG(symbol_table), "_REQUEST", sizeof("_REQUEST"), &form_variables, sizeof(zval *), NULL); return 0; } http://cvs.php.net/viewvc.cgi/php-src/main/streams/filter.c?r1=1.34&r2=1.35&diff_format=u Index: php-src/main/streams/filter.c diff -u php-src/main/streams/filter.c:1.34 php-src/main/streams/filter.c:1.35 --- php-src/main/streams/filter.c:1.34 Tue Aug 8 16:59:11 2006 +++ php-src/main/streams/filter.c Tue Sep 19 10:38:31 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: filter.c,v 1.34 2006/08/08 16:59:11 tony2001 Exp $ */ +/* $Id: filter.c,v 1.35 2006/09/19 10:38:31 dmitry Exp $ */ #include "php.h" #include "php_globals.h" @@ -826,9 +826,9 @@ ALLOC_INIT_ZVAL(filterparams); array_init(filterparams); - add_assoc_long(filterparams, "error_mode", error_mode); + add_ascii_assoc_long(filterparams, "error_mode", error_mode); if (subst) { - add_assoc_unicode(filterparams, "subst_char", subst, 1); + add_ascii_assoc_unicode(filterparams, "subst_char", subst, 1); } filter = php_stream_filter_create(buf, filterparams, php_stream_is_persistent(stream) TSRMLS_CC); efree(buf); http://cvs.php.net/viewvc.cgi/php-src/main/streams/memory.c?r1=1.24&r2=1.25&diff_format=u Index: php-src/main/streams/memory.c diff -u php-src/main/streams/memory.c:1.24 php-src/main/streams/memory.c:1.25 --- php-src/main/streams/memory.c:1.24 Thu Jun 29 14:42:30 2006 +++ php-src/main/streams/memory.c Tue Sep 19 10:38:31 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: memory.c,v 1.24 2006/06/29 14:42:30 bjori Exp $ */ +/* $Id: memory.c,v 1.25 2006/09/19 10:38:31 dmitry Exp $ */ #define _GNU_SOURCE #include "php.h" @@ -603,11 +603,11 @@ MAKE_STD_ZVAL(meta); array_init(meta); if (!semi) { /* there is only a mime type */ - add_assoc_stringl(meta, "mediatype", path, mlen, 1); + add_ascii_assoc_stringl(meta, "mediatype", path, mlen, 1); mlen = 0; } else if (sep && sep < semi) { /* there is a mime type */ plen = semi - path; - add_assoc_stringl(meta, "mediatype", path, plen, 1); + add_ascii_assoc_stringl(meta, "mediatype", path, plen, 1); mlen -= plen; path += plen; } else if (semi != path || mlen != sizeof(";base64")-1 || memcmp(path, ";base64", sizeof(";base64")-1)) { /* must be error since parameters are only allowed after mediatype */ @@ -637,7 +637,7 @@ plen = sep - path; vlen = (semi ? semi - sep : mlen - plen) - 1 /* '=' */; key = estrndup(path, plen); - add_assoc_stringl_ex(meta, key, plen + 1, sep + 1, vlen, 1); + add_rt_assoc_stringl_ex(meta, key, plen + 1, sep + 1, vlen, 1); efree(key); plen += vlen + 1; mlen -= plen; @@ -652,7 +652,7 @@ MAKE_STD_ZVAL(meta); array_init(meta); } - add_assoc_bool(meta, "base64", base64); + add_ascii_assoc_bool(meta, "base64", base64); /* skip ',' */ comma++; http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.133&r2=1.134&diff_format=u Index: php-src/main/streams/streams.c diff -u php-src/main/streams/streams.c:1.133 php-src/main/streams/streams.c:1.134 --- php-src/main/streams/streams.c:1.133 Fri Sep 15 07:26:19 2006 +++ php-src/main/streams/streams.c Tue Sep 19 10:38:31 2006 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: streams.c,v 1.133 2006/09/15 07:26:19 tony2001 Exp $ */ +/* $Id: streams.c,v 1.134 2006/09/19 10:38:31 dmitry Exp $ */ #define _GNU_SOURCE #include "php.h" @@ -2408,10 +2408,10 @@ { zval **wrapperhash; - if (FAILURE == zend_hash_find(Z_ARRVAL_P(context->options), (char*)wrappername, strlen(wrappername)+1, (void**)&wrapperhash)) { + if (FAILURE == zend_rt_hash_find(Z_ARRVAL_P(context->options), (char*)wrappername, strlen(wrappername)+1, (void**)&wrapperhash)) { return FAILURE; } - return zend_hash_find(Z_ARRVAL_PP(wrapperhash), (char*)optionname, strlen(optionname)+1, (void**)optionvalue); + return zend_rt_hash_find(Z_ARRVAL_PP(wrapperhash), (char*)optionname, strlen(optionname)+1, (void**)optionvalue); } PHPAPI int php_stream_context_set_option(php_stream_context *context, @@ -2425,16 +2425,16 @@ zval_copy_ctor(copied_val); INIT_PZVAL(copied_val); - if (FAILURE == zend_hash_find(Z_ARRVAL_P(context->options), (char*)wrappername, strlen(wrappername)+1, (void**)&wrapperhash)) { + if (FAILURE == zend_rt_hash_find(Z_ARRVAL_P(context->options), (char*)wrappername, strlen(wrappername)+1, (void**)&wrapperhash)) { MAKE_STD_ZVAL(category); array_init(category); - if (FAILURE == zend_hash_update(Z_ARRVAL_P(context->options), (char*)wrappername, strlen(wrappername)+1, (void**)&category, sizeof(zval *), NULL)) { + if (FAILURE == zend_rt_hash_update(Z_ARRVAL_P(context->options), (char*)wrappername, strlen(wrappername)+1, (void**)&category, sizeof(zval *), NULL)) { return FAILURE; } wrapperhash = &category; } - return zend_hash_update(Z_ARRVAL_PP(wrapperhash), (char*)optionname, strlen(optionname)+1, (void**)&copied_val, sizeof(zval *), NULL); + return zend_rt_hash_update(Z_ARRVAL_PP(wrapperhash), (char*)optionname, strlen(optionname)+1, (void**)&copied_val, sizeof(zval *), NULL); } PHPAPI int php_stream_context_get_link(php_stream_context *context, @@ -2445,7 +2445,7 @@ if (!stream || !hostent || !context || !(context->links)) { return FAILURE; } - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(context->links), (char*)hostent, strlen(hostent)+1, (void**)&pstream)) { + if (SUCCESS == zend_rt_hash_find(Z_ARRVAL_P(context->links), (char*)hostent, strlen(hostent)+1, (void**)&pstream)) { *stream = *pstream; return SUCCESS; } @@ -2464,9 +2464,9 @@ } if (!stream) { /* Delete any entry for <hostent> */ - return zend_hash_del(Z_ARRVAL_P(context->links), (char*)hostent, strlen(hostent)+1); + return zend_rt_hash_del(Z_ARRVAL_P(context->links), (char*)hostent, strlen(hostent)+1); } - return zend_hash_update(Z_ARRVAL_P(context->links), (char*)hostent, strlen(hostent)+1, (void**)&stream, sizeof(php_stream *), NULL); + return zend_rt_hash_update(Z_ARRVAL_P(context->links), (char*)hostent, strlen(hostent)+1, (void**)&stream, sizeof(php_stream *), NULL); } PHPAPI int php_stream_context_del_link(php_stream_context *context, http://cvs.php.net/viewvc.cgi/php-src/main/streams/unicode_filter.c?r1=1.3&r2=1.4&diff_format=u Index: php-src/main/streams/unicode_filter.c diff -u php-src/main/streams/unicode_filter.c:1.3 php-src/main/streams/unicode_filter.c:1.4 --- php-src/main/streams/unicode_filter.c:1.3 Fri Jul 14 22:24:07 2006 +++ php-src/main/streams/unicode_filter.c Tue Sep 19 10:38:31 2006 @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: unicode_filter.c,v 1.3 2006/07/14 22:24:07 pollita Exp $ */ +/* $Id: unicode_filter.c,v 1.4 2006/09/19 10:38:31 dmitry Exp $ */ #include "php.h" @@ -313,7 +313,7 @@ if (filterparams && Z_TYPE_P(filterparams) == IS_ARRAY && - zend_hash_find(Z_ARRVAL_P(filterparams), "error_mode", sizeof("error_mode"), (void**)&tmpzval) == SUCCESS && + zend_ascii_hash_find(Z_ARRVAL_P(filterparams), "error_mode", sizeof("error_mode"), (void**)&tmpzval) == SUCCESS && tmpzval && *tmpzval) { if (Z_TYPE_PP(tmpzval) == IS_LONG) { err_mode = Z_LVAL_PP(tmpzval); @@ -332,7 +332,7 @@ if (filterparams && Z_TYPE_P(filterparams) == IS_ARRAY && - zend_hash_find(Z_ARRVAL_P(filterparams), "subst_char", sizeof("subst_char"), (void**)&tmpzval) == SUCCESS && + zend_ascii_hash_find(Z_ARRVAL_P(filterparams), "subst_char", sizeof("subst_char"), (void**)&tmpzval) == SUCCESS && tmpzval && *tmpzval) { if (Z_TYPE_PP(tmpzval) == IS_UNICODE) { subst_char = Z_USTRVAL_PP(tmpzval); http://cvs.php.net/viewvc.cgi/php-src/main/streams/userspace.c?r1=1.35&r2=1.36&diff_format=u Index: php-src/main/streams/userspace.c diff -u php-src/main/streams/userspace.c:1.35 php-src/main/streams/userspace.c:1.36 --- php-src/main/streams/userspace.c:1.35 Mon Aug 14 15:00:04 2006 +++ php-src/main/streams/userspace.c Tue Sep 19 10:38:31 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: userspace.c,v 1.35 2006/08/14 15:00:04 tony2001 Exp $ */ +/* $Id: userspace.c,v 1.36 2006/09/19 10:38:31 dmitry Exp $ */ #include "php.h" #include "php_globals.h" @@ -787,7 +787,7 @@ zval **elem; #define STAT_PROP_ENTRY_EX(name, name2) \ - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(array), #name, sizeof(#name), (void**)&elem)) { \ + if (SUCCESS == zend_ascii_hash_find(Z_ARRVAL_P(array), #name, sizeof(#name), (void**)&elem)) { \ convert_to_long(*elem); \ ssb->sb.st_##name2 = Z_LVAL_PP(elem); \ } http://cvs.php.net/viewvc.cgi/php-src/main/streams/xp_socket.c?r1=1.35&r2=1.36&diff_format=u Index: php-src/main/streams/xp_socket.c diff -u php-src/main/streams/xp_socket.c:1.35 php-src/main/streams/xp_socket.c:1.36 --- php-src/main/streams/xp_socket.c:1.35 Thu Feb 2 18:16:25 2006 +++ php-src/main/streams/xp_socket.c Tue Sep 19 10:38:31 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: xp_socket.c,v 1.35 2006/02/02 18:16:25 pollita Exp $ */ +/* $Id: xp_socket.c,v 1.36 2006/09/19 10:38:31 dmitry Exp $ */ #include "php.h" #include "ext/standard/file.h" @@ -301,9 +301,9 @@ return PHP_STREAM_OPTION_RETURN_OK; case PHP_STREAM_OPTION_META_DATA_API: - add_assoc_bool((zval *)ptrparam, "timed_out", sock->timeout_event); - add_assoc_bool((zval *)ptrparam, "blocked", sock->is_blocked); - add_assoc_bool((zval *)ptrparam, "eof", stream->eof); + add_ascii_assoc_bool((zval *)ptrparam, "timed_out", sock->timeout_event); + add_ascii_assoc_bool((zval *)ptrparam, "blocked", sock->is_blocked); + add_ascii_assoc_bool((zval *)ptrparam, "eof", stream->eof); return PHP_STREAM_OPTION_RETURN_OK; case PHP_STREAM_OPTION_XPORT_API:
« previous php.cvs (#40585) next »