]> granicus.if.org Git - php/commitdiff
- For Sterling. I wonder if not all of the API functions should take the
authorAndi Gutmans <andi@php.net>
Fri, 19 Jan 2001 08:40:49 +0000 (08:40 +0000)
committerAndi Gutmans <andi@php.net>
Fri, 19 Jan 2001 08:40:49 +0000 (08:40 +0000)
- key_length as a parameter in order to save that strlen().

Zend/zend_API.c
Zend/zend_API.h

index 1b6d600c2ce3617e7706e7707afb306652734341..906911cdea5f8d9bda4834b02d4caad343d014e2 100644 (file)
@@ -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)
 {
index 824bfa01362f54aa6f1d50941d97550868781232..fc7798cb7363d64445b5adf1ef33e6484bbe307f 100644 (file)
@@ -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);