summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2006-03-05 16:12:24 +0000
committerMarcus Boerger <helly@php.net>2006-03-05 16:12:24 +0000
commit35ce5db25e2701b62a3e26235b117471cbbbab5b (patch)
treeb5baa26b6b3084edf22caf47ba9237f224cefda3
parenta9080d38f49a16ed8bfe3d248b4c23243d93f7f7 (diff)
downloadphp-git-35ce5db25e2701b62a3e26235b117471cbbbab5b.tar.gz
- Add missing function for completeness
-rw-r--r--Zend/zend_API.c14
-rw-r--r--Zend/zend_API.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index b67887de34..b6c034a668 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -2448,6 +2448,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;
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index 837335fd22..280d313f0d 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -223,6 +223,7 @@ ZEND_API int zend_declare_property_string(zend_class_entry *ce, char *name, int
ZEND_API int zend_declare_property_stringl(zend_class_entry *ce, char *name, int name_length, char *value, int value_len, int access_type 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);