]> granicus.if.org Git - php/commitdiff
added add_property_resource
authorThies C. Arntzen <thies@php.net>
Wed, 29 Sep 1999 15:25:06 +0000 (15:25 +0000)
committerThies C. Arntzen <thies@php.net>
Wed, 29 Sep 1999 15:25:06 +0000 (15:25 +0000)
Zend/zend_API.c
Zend/zend_API.h

index 23db2b88f1235a5df50d0403c952d68b79ceefce..5b4458702c08945bf1e4c27b0a0b7a3dbcca6d1c 100644 (file)
@@ -491,6 +491,16 @@ ZEND_API inline int add_property_long(zval *arg, char *key, long n)
        return zend_hash_update(arg->value.obj.properties, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
 }
 
+ZEND_API inline int add_property_resource(zval *arg, char *key, long n)
+{
+       zval *tmp = (zval *) emalloc(sizeof(zval));
+
+       tmp->type = IS_RESOURCE;
+       tmp->value.lval = n;
+       INIT_PZVAL(tmp);
+       return zend_hash_update(arg->value.obj.properties, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
+}
+
 
 ZEND_API inline int add_property_double(zval *arg, char *key, double d)
 {
index 9e65b1d80d116c67a6c50f1df1cfd50f6facbb71..e4da69804e5a6f19df2a423208525c2201454720 100644 (file)
@@ -116,6 +116,7 @@ ZEND_API int call_user_function_ex(HashTable *function_table, zval *object, zval
 
 
 ZEND_API int add_property_long(zval *arg, char *key, long l);
+ZEND_API int add_property_resource(zval *arg, char *key, long r);
 ZEND_API int add_property_double(zval *arg, char *key, double d);
 ZEND_API int add_property_string(zval *arg, char *key, char *str, int duplicate);
 ZEND_API int add_property_stringl(zval *arg, char *key, char *str, uint length, int duplicate);