diff options
| author | Thies C. Arntzen <thies@php.net> | 1999-09-29 15:25:06 +0000 |
|---|---|---|
| committer | Thies C. Arntzen <thies@php.net> | 1999-09-29 15:25:06 +0000 |
| commit | 446e5d0fffe571adae92b3f8c5e8dcf55608700f (patch) | |
| tree | 22a23c341a2ff8cde44a81127e6b6d41c139f14e | |
| parent | 16ff84429abb62b7828f7b75a02d4bf84972e528 (diff) | |
| download | php-git-446e5d0fffe571adae92b3f8c5e8dcf55608700f.tar.gz | |
added add_property_resource
| -rw-r--r-- | Zend/zend_API.c | 10 | ||||
| -rw-r--r-- | Zend/zend_API.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 23db2b88f1..5b4458702c 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -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) { diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 9e65b1d80d..e4da69804e 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -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); |
