cvs: ZendEngine2 / zend_API.c zend_API.h
| From: | Andrei Zmievski | Date: | Fri, 04 Aug 2006 21:05:59 +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-5163@lists.php.net to get a copy of this message | ||
andrei Fri Aug 4 21:05:59 2006 UTC
Modified files:
/ZendEngine2 zend_API.c zend_API.h
Log:
Add add_assoc_zstr_ex() and related.
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.c?r1=1.393&r2=1.394&diff_format=u
Index: ZendEngine2/zend_API.c
diff -u ZendEngine2/zend_API.c:1.393 ZendEngine2/zend_API.c:1.394
--- ZendEngine2/zend_API.c:1.393 Fri Aug 4 18:02:20 2006
+++ ZendEngine2/zend_API.c Fri Aug 4 21:05:59 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_API.c,v 1.393 2006/08/04 18:02:20 andrei Exp $ */
+/* $Id: zend_API.c,v 1.394 2006/08/04 21:05:59 andrei Exp $ */
#include "zend.h"
#include "zend_execute.h"
@@ -1504,6 +1504,26 @@
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_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);
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.h?r1=1.252&r2=1.253&diff_format=u
Index: ZendEngine2/zend_API.h
diff -u ZendEngine2/zend_API.h:1.252 ZendEngine2/zend_API.h:1.253
--- ZendEngine2/zend_API.h:1.252 Fri Aug 4 18:08:31 2006
+++ ZendEngine2/zend_API.h Fri Aug 4 21:05:59 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_API.h,v 1.252 2006/08/04 18:08:31 andrei Exp $ */
+/* $Id: zend_API.h,v 1.253 2006/08/04 21:05:59 andrei Exp $ */
#ifndef ZEND_API_H
#define ZEND_API_H
@@ -332,6 +332,8 @@
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_zval_ex(zval *arg, char *key, uint key_len, zval *value);
#define ZSTR_DUPLICATE (1<<0)
@@ -412,6 +414,8 @@
#define add_assoc_stringl(__arg, __key, __str, __length, __duplicate) add_assoc_stringl_ex(__arg,
__key, strlen(__key)+1, __str, __length, __duplicate)
#define add_assoc_unicode(__arg, __key, __str, __duplicate) add_assoc_unicode_ex(__arg, __key,
strlen(__key)+1, __str, __duplicate)
#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_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)
@@ -853,7 +857,7 @@
#define ZVAL_ZSTR(z, zs, type, duplicate) { \
zstr __s=(zs); \
- Z_UNILEN_P(z) = (type==IS_UNICODE)?u_strlen(__s):strlen(__s); \
+ Z_UNILEN_P(z) = (type==IS_UNICODE)?u_strlen(__s.u):strlen(__s.s); \
Z_UNIVAL_P(z) = ZSTR(duplicate? \
((type==IS_UNICODE)? \
(void*)eustrndup(__s.u, Z_UNILEN_P(z)) \