]> granicus.if.org Git - php/commitdiff
Added add_property_unset() and add_property_bool().
authorAndrei Zmievski <andrei@php.net>
Tue, 1 Feb 2000 23:12:48 +0000 (23:12 +0000)
committerAndrei Zmievski <andrei@php.net>
Tue, 1 Feb 2000 23:12:48 +0000 (23:12 +0000)
Zend/zend_API.c
Zend/zend_API.h

index b34ddce28717ce3b03a09037c20d6bb228f81eeb..d338f7252163d6f62b708aa3872205d6d1d400df 100644 (file)
@@ -611,6 +611,27 @@ 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_bool(zval *arg, char *key, int b)
+{
+       zval *tmp;
+
+       ALLOC_ZVAL(tmp);
+       tmp->type = IS_BOOL;
+       tmp->value.lval = b;
+       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_unset(zval *arg, char *key)
+{
+       zval *tmp;
+
+       ALLOC_ZVAL(tmp);
+       tmp->type = IS_NULL;
+       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_resource(zval *arg, char *key, long n)
 {
        zval *tmp;
index ff357ca15342e72f27ce3e0a44785e4cb7fe843e..019361b322a25fb5eaaa59c89169a177598bd66b 100644 (file)
@@ -132,6 +132,8 @@ ZEND_API int call_user_function(HashTable *function_table, zval *object, zval *f
 ZEND_API int call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval **retval_ptr_ptr, int param_count, zval **params[], int no_separation);
 
 ZEND_API int add_property_long(zval *arg, char *key, long l);
+ZEND_API int add_property_unset(zval *arg, char *key);
+ZEND_API int add_property_bool(zval *arg, char *key, int b);
 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);