]> granicus.if.org Git - php/commitdiff
- Add missing function for completeness
authorMarcus Boerger <helly@php.net>
Sun, 5 Mar 2006 16:09:45 +0000 (16:09 +0000)
committerMarcus Boerger <helly@php.net>
Sun, 5 Mar 2006 16:09:45 +0000 (16:09 +0000)
Zend/zend_API.c
Zend/zend_API.h

index 4916f3d47c0c1869b09cf55ff254ab642be0901e..0d7616d8582f4e46ce5fc8b3442e5ac63de0ebd5 100644 (file)
@@ -3029,6 +3029,20 @@ ZEND_API int zend_declare_class_constant(zend_class_entry *ce, char *name, size_
        return zend_hash_update(&ce->constants_table, name, name_length+1, &value, sizeof(zval *), NULL);
 }
 
+ZEND_API int zend_declare_class_constant_null(zend_class_entry *ce, char *name, size_t name_length TSRMLS_DC)
+{
+       zval *constant;
+
+       if (ce->type & ZEND_INTERNAL_CLASS) {
+               constant = malloc(sizeof(zval));
+       } else {
+               ALLOC_ZVAL(constant);
+       }
+       ZVAL_NULL(constant);
+       INIT_PZVAL(constant);
+       return zend_declare_class_constant(ce, name, name_length, constant TSRMLS_CC);
+}
+
 ZEND_API int zend_declare_class_constant_long(zend_class_entry *ce, char *name, size_t name_length, long value TSRMLS_DC)
 {
        zval *constant;
index f5e4517e8211d44fec6b3a7bcda91c8518c3fc2c..194e2d836f5110795bf973fd4a313956d6280b66 100644 (file)
@@ -230,6 +230,7 @@ ZEND_API int zend_u_declare_property(zend_class_entry *ce, zend_uchar type, zstr
 ZEND_API int zend_u_declare_property_ex(zend_class_entry *ce, zend_uchar type, zstr name, int name_length, zval *property, int access_type, char *doc_comment, int doc_comment_len TSRMLS_DC);
 
 ZEND_API int zend_declare_class_constant(zend_class_entry *ce, char *name, size_t name_length, zval *value TSRMLS_DC);
+ZEND_API int zend_declare_class_constant_null(zend_class_entry *ce, char *name, size_t name_length TSRMLS_DC);
 ZEND_API int zend_declare_class_constant_long(zend_class_entry *ce, char *name, size_t name_length, long value TSRMLS_DC);
 ZEND_API int zend_declare_class_constant_bool(zend_class_entry *ce, char *name, size_t name_length, zend_bool value TSRMLS_DC);
 ZEND_API int zend_declare_class_constant_double(zend_class_entry *ce, char *name, size_t name_length, double value TSRMLS_DC);