cvs: ZendEngine2 / zend_API.c zend_API.h

From: Date: Mon, 11 Sep 2006 16:32:02 +0000
Subject: cvs: ZendEngine2 / zend_API.c zend_API.h
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-5245@lists.php.net to get a copy of this message
andrei Mon Sep 11 16:32:02 2006 UTC Modified files: /ZendEngine2 zend_API.c zend_API.h Log: Add a couple more UTF-8 functions. http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.c?r1=1.400&r2=1.401&diff_format=u Index: ZendEngine2/zend_API.c diff -u ZendEngine2/zend_API.c:1.400 ZendEngine2/zend_API.c:1.401 --- ZendEngine2/zend_API.c:1.400 Mon Aug 28 17:14:49 2006 +++ ZendEngine2/zend_API.c Mon Sep 11 16:32:02 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.c,v 1.400 2006/08/28 17:14:49 andrei Exp $ */ +/* $Id: zend_API.c,v 1.401 2006/09/11 16:32:02 andrei Exp $ */ #include "zend.h" #include "zend_execute.h" @@ -1456,6 +1456,7 @@ 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; @@ -1466,6 +1467,7 @@ 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; @@ -1528,6 +1530,26 @@ 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; + + 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; + + 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); @@ -1641,6 +1663,27 @@ 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; + + 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; + + 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) { http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.h?r1=1.257&r2=1.258&diff_format=u Index: ZendEngine2/zend_API.h diff -u ZendEngine2/zend_API.h:1.257 ZendEngine2/zend_API.h:1.258 --- ZendEngine2/zend_API.h:1.257 Mon Aug 28 17:14:49 2006 +++ ZendEngine2/zend_API.h Mon Sep 11 16:32:02 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.h,v 1.257 2006/08/28 17:14:49 andrei Exp $ */ +/* $Id: zend_API.h,v 1.258 2006/09/11 16:32:02 andrei Exp $ */ #ifndef ZEND_API_H #define ZEND_API_H @@ -405,31 +405,6 @@ add_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ } -#define add_assoc_utf8_string_ex(arg, key, key_len, str, flags) \ - { \ - UErrorCode status = U_ZERO_ERROR; \ - UChar *u_str; \ - int u_len; \ - int length = strlen(str); \ - 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); \ - } - -#define add_assoc_utf8_stringl_ex(arg, key, key_len, str, length, flags) \ - { \ - 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); \ - } - #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)

« previous php.zend-engine.cvs (#5245) next »