From: Andi Gutmans Date: Fri, 19 Jan 2001 08:40:49 +0000 (+0000) Subject: - For Sterling. I wonder if not all of the API functions should take the X-Git-Tag: php-4.0.5RC1~523 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0a3761e283cb49a8c2d38a1ef48a9ce825907bdc;p=php - For Sterling. I wonder if not all of the API functions should take the - key_length as a parameter in order to save that strlen(). --- diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 1b6d600c2c..906911cdea 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -318,6 +318,11 @@ ZEND_API inline int add_assoc_stringl(zval *arg, char *key, char *str, uint leng return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL); } +ZEND_API int add_assoc_zval(zval *arg, char *key, uint key_length, zval *value) +{ + return zend_hash_update(arg->value.ht, key, key_length, (void *) &value, sizeof(zval *), NULL); +} + ZEND_API inline int add_index_long(zval *arg, uint index, long n) { diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 824bfa0136..fc7798cb73 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -153,6 +153,7 @@ ZEND_API int add_assoc_resource(zval *arg, char *key, int r); ZEND_API int add_assoc_double(zval *arg, char *key, double d); ZEND_API int add_assoc_string(zval *arg, char *key, char *str, int duplicate); ZEND_API int add_assoc_stringl(zval *arg, char *key, char *str, uint length, int duplicate); +ZEND_API int add_assoc_zval(zval *arg, char *key, uint key_length, zval *value); ZEND_API int add_index_long(zval *arg, uint idx, long n); ZEND_API int add_index_unset(zval *arg, uint idx);