]> granicus.if.org Git - php/commitdiff
- Change unset() functions to null(). unset() is legacy
authorAndi Gutmans <andi@php.net>
Wed, 31 Jan 2001 21:53:30 +0000 (21:53 +0000)
committerAndi Gutmans <andi@php.net>
Wed, 31 Jan 2001 21:53:30 +0000 (21:53 +0000)
Zend/zend_API.c
Zend/zend_API.h
ext/ingres_ii/ii.c
ext/mysql/php_mysql.c
ext/pgsql/pgsql.c
ext/standard/scanf.c

index 2877f51a00c622f0f9c57f96b0e41a6095b46ad5..02d21904ac759d2a5aa476174adca4d3ffbcff04 100644 (file)
@@ -237,7 +237,7 @@ ZEND_API inline int add_assoc_long_ex(zval *arg, char *key, uint key_len, long n
        return zend_hash_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
 }
 
-ZEND_API inline int add_assoc_unset_ex(zval *arg, char *key, uint key_len)
+ZEND_API inline int add_assoc_null_ex(zval *arg, char *key, uint key_len)
 {
        zval *tmp;
        
@@ -317,7 +317,7 @@ ZEND_API inline int add_index_long(zval *arg, uint index, long n)
 }
 
 
-ZEND_API inline int add_index_unset(zval *arg, uint index)
+ZEND_API inline int add_index_null(zval *arg, uint index)
 {
        zval *tmp;
 
@@ -399,7 +399,7 @@ ZEND_API inline int add_next_index_long(zval *arg, long n)
 }
 
 
-ZEND_API inline int add_next_index_unset(zval *arg)
+ZEND_API inline int add_next_index_null(zval *arg)
 {
        zval *tmp;
        
@@ -557,7 +557,7 @@ ZEND_API inline int add_property_bool_ex(zval *arg, char *key, uint key_len, int
        return zend_hash_update(Z_OBJPROP_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
 }
 
-ZEND_API inline int add_property_unset_ex(zval *arg, char *key, uint key_len)
+ZEND_API inline int add_property_null_ex(zval *arg, char *key, uint key_len)
 {
        zval *tmp;
        
index 2a390f6bb5785ddbb3e5a0265847fc0561d60f26..4759026eb756f080964e883c857a9461a67216c8 100644 (file)
@@ -147,7 +147,7 @@ ZEND_API int _object_init_ex(zval *arg, zend_class_entry *ce ZEND_FILE_LINE_DC);
 ZEND_API int add_assoc_function(zval *arg, char *key,void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS));
 
 ZEND_API int add_assoc_long_ex(zval *arg, char *key, uint key_len, long n);
-ZEND_API int add_assoc_unset_ex(zval *arg, char *key, uint key_len);
+ZEND_API int add_assoc_null_ex(zval *arg, char *key, uint key_len);
 ZEND_API int add_assoc_bool_ex(zval *arg, char *key, uint key_len, int b);
 ZEND_API int add_assoc_resource_ex(zval *arg, char *key, uint key_len, int r);
 ZEND_API int add_assoc_double_ex(zval *arg, char *key, uint key_len, double d);
@@ -156,7 +156,7 @@ ZEND_API int add_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str,
 ZEND_API int add_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value);
 
 #define add_assoc_long(__arg, __key, __n) add_assoc_long_ex(__arg, __key, strlen(__key)+1, __n)
-#define add_assoc_unset(__arg, __key) add_assoc_unset_ex(__arg, __key, strlen(__key) + 1)
+#define add_assoc_null(__arg, __key) add_assoc_null_ex(__arg, __key, strlen(__key) + 1)
 #define add_assoc_bool(__arg, __key, __b) add_assoc_bool_ex(__arg, __key, strlen(__key)+1, __b)
 #define add_assoc_resource(__arg, __key, __r) add_assoc_resource_ex(__arg, __key, strlen(__key)+1, __r)
 #define add_assoc_double(__arg, __key, __d) add_assoc_double_ex(__arg, __key, strlen(__key)+1, __d)
@@ -164,8 +164,14 @@ ZEND_API int add_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value);
 #define add_assoc_stringl(__arg, __key, __str, __length, __duplicate) add_assoc_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate)
 #define add_assoc_zval(__arg, __key, __value) add_assoc_zval_ex(__arg, __key, strlen(__key)+1, __value)
 
+/* unset() functions are only suported for legacy modules and null() functions should be used */
+#define add_assoc_unset(__arg, __key) add_assoc_null_ex(__arg, __key, strlen(__key) + 1)
+#define add_index_unset(__arg, __key) add_index_null(__arg, __key)
+#define add_next_index_unset(__arg) add_next_index_null(__arg)
+#define add_property_unset(__arg, __key) add_property_null(__arg, __key)
+
 ZEND_API int add_index_long(zval *arg, uint idx, long n);
-ZEND_API int add_index_unset(zval *arg, uint idx);
+ZEND_API int add_index_null(zval *arg, uint idx);
 ZEND_API int add_index_bool(zval *arg, uint idx, int b);
 ZEND_API int add_index_resource(zval *arg, uint idx, int r);
 ZEND_API int add_index_double(zval *arg, uint idx, double d);
@@ -174,7 +180,7 @@ ZEND_API int add_index_stringl(zval *arg, uint idx, char *str, uint length, int
 ZEND_API int add_index_zval(zval *arg, uint index, zval *value);
 
 ZEND_API int add_next_index_long(zval *arg, long n);
-ZEND_API int add_next_index_unset(zval *arg);
+ZEND_API int add_next_index_null(zval *arg);
 ZEND_API int add_next_index_bool(zval *arg, int b);
 ZEND_API int add_next_index_resource(zval *arg, int r);
 ZEND_API int add_next_index_double(zval *arg, double d);
@@ -194,7 +200,7 @@ ZEND_API int add_get_index_string(zval *arg, uint idx, char *str, void **dest, i
 ZEND_API int add_get_index_stringl(zval *arg, uint idx, char *str, uint length, void **dest, int duplicate);
 
 ZEND_API int add_property_long_ex(zval *arg, char *key, uint key_len, long l);
-ZEND_API int add_property_unset_ex(zval *arg, char *key, uint key_len);
+ZEND_API int add_property_null_ex(zval *arg, char *key, uint key_len);
 ZEND_API int add_property_bool_ex(zval *arg, char *key, uint key_len, int b);
 ZEND_API int add_property_resource_ex(zval *arg, char *key, uint key_len, long r);
 ZEND_API int add_property_double_ex(zval *arg, char *key, uint key_len, double d);
@@ -203,7 +209,7 @@ ZEND_API int add_property_stringl_ex(zval *arg, char *key, uint key_len,  char *
 ZEND_API int add_property_zval_ex(zval *arg, char *key, uint key_len, zval *value);
 
 #define add_property_long(__arg, __key, __n) add_property_long_ex(__arg, __key, strlen(__key)+1, __n)
-#define add_property_unset(__arg, __key) add_property_unset_ex(__arg, __key, strlen(__key) + 1)
+#define add_property_null(__arg, __key) add_property_null_ex(__arg, __key, strlen(__key) + 1)
 #define add_property_bool(__arg, __key, __b) add_property_bool_ex(__arg, __key, strlen(__key)+1, __b)
 #define add_property_resource(__arg, __key, __r) add_property_resource_ex(__arg, __key, strlen(__key)+1, __r)
 #define add_property_double(__arg, __key, __d) add_property_double_ex(__arg, __key, strlen(__key)+1, __d) 
index 48dc87300a495397ac3e27aed7270f27f3ea597d..2ed8187076fa45ee9745410abf7b61568dac1125 100644 (file)
@@ -1065,10 +1065,10 @@ static void php_ii_fetch(INTERNAL_FUNCTION_PARAMETERS, II_LINK *ii_link, int res
          if(columnData[k-1].dv_null) { /* NULL value ? */
 
            if(result_type & II_NUM) {
-             add_index_unset(return_value, i+k-1);
+             add_index_null(return_value, i+k-1);
            }
            if(result_type & II_ASSOC) {
-             add_assoc_unset(return_value, php_ii_field_name(ii_link, i+k-1));
+             add_assoc_null(return_value, php_ii_field_name(ii_link, i+k-1));
            }
 
          } else { /* non NULL value */
index db8ff01f7f3581ea49282f81e0b818ddf7098640..0acac78eb38e74171872d7ef9fa1c22a7c1b33a2 100644 (file)
@@ -1425,9 +1425,9 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
                } else {
                        /* NULL value. */
                        if (result_type & MYSQL_NUM)
-                               add_index_unset(return_value, i);
+                               add_index_null(return_value, i);
                        else
-                               add_assoc_unset(return_value, mysql_field->name);
+                               add_assoc_null(return_value, mysql_field->name);
                }
        }
 }
index 4962ca92bc3d5b45c4efcdfff2a4802f2fde5063..5ee40eebafbbe4f0c25f19b58c356b6aa8479a65 100644 (file)
@@ -1049,11 +1049,11 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
        for (i = 0, num_fields = PQnfields(pgsql_result); i<num_fields; i++) {
                if (PQgetisnull(pgsql_result, Z_LVAL_PP(row), i)) {
                        if (result_type & PGSQL_NUM) {
-                               add_index_unset(return_value, i);
+                               add_index_null(return_value, i);
                        }
                        if (result_type & PGSQL_ASSOC) {
                                field_name = PQfname(pgsql_result, i);
-                               add_assoc_unset(return_value, field_name);
+                               add_assoc_null(return_value, field_name);
                        }
                } else {
                        element = PQgetvalue(pgsql_result, Z_LVAL_PP(row), i);
index 38466e00070b067cf4d019dd5f001184aeec7b6a..22d6df049778e5e1699f1b5abd53fdbcb202492a 100644 (file)
@@ -663,7 +663,7 @@ PHPAPI int php_sscanf_internal(     char *string,char *format,
             return FAILURE;
         }
         for (i = 0; i < totalVars; i++) {
-               if (add_next_index_unset(*return_value) == FAILURE) {
+               if (add_next_index_null(*return_value) == FAILURE) {
                                scan_set_error_return(0, return_value);
                                return FAILURE;
                }