Skip to content

Commit

Permalink
added add_property_resource
Browse files Browse the repository at this point in the history
  • Loading branch information
Thies C. Arntzen committed Sep 29, 1999
1 parent 16ff844 commit 446e5d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Zend/zend_API.c
Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions Zend/zend_API.h
Expand Up @@ -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);
Expand Down

0 comments on commit 446e5d0

Please sign in to comment.