- Add missing function for completeness

This commit is contained in:
Marcus Boerger 2006-03-05 16:12:24 +00:00
parent a9080d38f4
commit 35ce5db25e
2 changed files with 15 additions and 0 deletions

View File

@ -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;

View File

@ -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);