ZEND_API HashTable module_registry;
/* this function doesn't check for too many parameters */
-ZEND_API int zend_get_parameters(int ht, int param_count, ...)
+ZEND_API int zend_get_parameters(int ht, int param_count, ...) /* {{{ */
{
void **p;
int arg_count;
return SUCCESS;
}
+/* }}} */
-
-ZEND_API int _zend_get_parameters_array(int ht, int param_count, zval **argument_array TSRMLS_DC)
+ZEND_API int _zend_get_parameters_array(int ht, int param_count, zval **argument_array TSRMLS_DC) /* {{{ */
{
void **p;
int arg_count;
return SUCCESS;
}
-
-
-
+/* }}} */
/* Zend-optimized Extended functions */
/* this function doesn't check for too many parameters */
-ZEND_API int zend_get_parameters_ex(int param_count, ...)
+ZEND_API int zend_get_parameters_ex(int param_count, ...) /* {{{ */
{
void **p;
int arg_count;
return SUCCESS;
}
+/* }}} */
-
-ZEND_API int _zend_get_parameters_array_ex(int param_count, zval ***argument_array TSRMLS_DC)
+ZEND_API int _zend_get_parameters_array_ex(int param_count, zval ***argument_array TSRMLS_DC) /* {{{ */
{
void **p;
int arg_count;
return SUCCESS;
}
+/* }}} */
-
-ZEND_API int zend_copy_parameters_array(int param_count, zval *argument_array TSRMLS_DC)
+ZEND_API int zend_copy_parameters_array(int param_count, zval *argument_array TSRMLS_DC) /* {{{ */
{
void **p;
int arg_count;
return SUCCESS;
}
+/* }}} */
-
-ZEND_API void zend_wrong_param_count(TSRMLS_D)
+ZEND_API void zend_wrong_param_count(TSRMLS_D) /* {{{ */
{
char *space;
zstr class_name = get_active_class_name(&space TSRMLS_CC);
zend_error(E_WARNING, "Wrong parameter count for %v%s%v()", class_name, space, get_active_function_name(TSRMLS_C));
}
-
+/* }}} */
/* Argument parsing API -- andrei */
-ZEND_API char *zend_get_type_by_const(int type)
+ZEND_API char *zend_get_type_by_const(int type) /* {{{ */
{
switch(type) {
case IS_BOOL:
return "unknown";
}
}
+/* }}} */
-ZEND_API char *zend_zval_type_name(zval *arg)
+ZEND_API char *zend_zval_type_name(zval *arg) /* {{{ */
{
return zend_get_type_by_const(Z_TYPE_P(arg));
}
+/* }}} */
-ZEND_API zend_class_entry *zend_get_class_entry(zval *zobject TSRMLS_DC)
+ZEND_API zend_class_entry *zend_get_class_entry(zval *zobject TSRMLS_DC) /* {{{ */
{
if (Z_OBJ_HT_P(zobject)->get_class_entry) {
return Z_OBJ_HT_P(zobject)->get_class_entry(zobject TSRMLS_CC);
return NULL;
}
}
+/* }}} */
/* returns 1 if you need to copy result, 0 if it's already a copy */
-ZEND_API int zend_get_object_classname(zval *object, zstr *class_name, zend_uint *class_name_len TSRMLS_DC)
+ZEND_API int zend_get_object_classname(zval *object, zstr *class_name, zend_uint *class_name_len TSRMLS_DC) /* {{{ */
{
if (Z_OBJ_HT_P(object)->get_class_name == NULL ||
Z_OBJ_HT_P(object)->get_class_name(object, class_name, class_name_len, 0 TSRMLS_CC) != SUCCESS) {
}
return 0;
}
+/* }}} */
#define RETURN_AS_STRING(arg, p, pl, type) \
(*p).s = Z_STRVAL_PP(arg); \
*pl = Z_USTRLEN_PP(arg); \
*type = IS_UNICODE;
-static int parse_arg_object_to_string(zval **arg, char **p, int *pl, int type TSRMLS_DC)
+static int parse_arg_object_to_string(zval **arg, char **p, int *pl, int type TSRMLS_DC) /* {{{ */
{
if (Z_OBJ_HANDLER_PP(arg, cast_object)) {
SEPARATE_ZVAL_IF_NOT_REF(arg);
}
return FAILURE;
}
+/* }}} */
-static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **spec, char T_arg_type, int* ret_type TSRMLS_DC)
+static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **spec, char T_arg_type, int* ret_type TSRMLS_DC) /* {{{ */
{
char *spec_walk = *spec;
char c = *spec_walk++;
return NULL;
}
+/* }}} */
-static int zend_parse_arg(int arg_num, zval **arg, va_list *va, char **spec, int quiet, char T_arg_type TSRMLS_DC)
+static int zend_parse_arg(int arg_num, zval **arg, va_list *va, char **spec, int quiet, char T_arg_type TSRMLS_DC) /* {{{ */
{
char *expected_type = NULL;
int ret_type = IS_STRING;
return SUCCESS;
}
+/* }}} */
-static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int flags TSRMLS_DC)
+static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int flags TSRMLS_DC) /* {{{ */
{
char *spec_walk;
int c, i;
return SUCCESS;
}
+/* }}} */
#define RETURN_IF_ZERO_ARGS(num_args, type_spec, quiet) { \
int __num_args = (num_args); \
}\
}
-ZEND_API int zend_parse_parameters_ex(int flags, int num_args TSRMLS_DC, char *type_spec, ...)
+ZEND_API int zend_parse_parameters_ex(int flags, int num_args TSRMLS_DC, char *type_spec, ...) /* {{{ */
{
va_list va;
int retval;
return retval;
}
+/* }}} */
-ZEND_API int zend_parse_parameters(int num_args TSRMLS_DC, char *type_spec, ...)
+ZEND_API int zend_parse_parameters(int num_args TSRMLS_DC, char *type_spec, ...) /* {{{ */
{
va_list va;
int retval;
return retval;
}
+/* }}} */
-ZEND_API int zend_parse_method_parameters(int num_args TSRMLS_DC, zval *this_ptr, char *type_spec, ...)
+ZEND_API int zend_parse_method_parameters(int num_args TSRMLS_DC, zval *this_ptr, char *type_spec, ...) /* {{{ */
{
va_list va;
int retval;
}
return retval;
}
+/* }}} */
-
-ZEND_API int zend_parse_method_parameters_ex(int flags, int num_args TSRMLS_DC, zval *this_ptr, char *type_spec, ...)
+ZEND_API int zend_parse_method_parameters_ex(int flags, int num_args TSRMLS_DC, zval *this_ptr, char *type_spec, ...) /* {{{ */
{
va_list va;
int retval;
}
return retval;
}
-
+/* }}} */
/* Argument parsing API -- andrei */
-
-
-ZEND_API int _array_init(zval *arg ZEND_FILE_LINE_DC)
+ZEND_API int _array_init(zval *arg ZEND_FILE_LINE_DC) /* {{{ */
{
ALLOC_HASHTABLE_REL(Z_ARRVAL_P(arg));
Z_TYPE_P(arg) = IS_ARRAY;
return SUCCESS;
}
+/* }}} */
-
-static int zend_merge_property(zval **value, int num_args, va_list args, zend_hash_key *hash_key)
+static int zend_merge_property(zval **value, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
{
/* which name should a numeric property have ? */
if (hash_key->nKeyLength) {
}
return ZEND_HASH_APPLY_KEEP;
}
-
+/* }}} */
/* This function should be called after the constructor has been called
* because it may call __set from the uninitialized object otherwise. */
-ZEND_API void zend_merge_properties(zval *obj, HashTable *properties, int destroy_ht TSRMLS_DC)
+ZEND_API void zend_merge_properties(zval *obj, HashTable *properties, int destroy_ht TSRMLS_DC) /* {{{ */
{
zend_object_handlers *obj_ht = Z_OBJ_HT_P(obj);
zend_class_entry *old_scope = EG(scope);
FREE_HASHTABLE(properties);
}
}
+/* }}} */
-
-ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC)
+ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
{
if (!class_type->constants_updated || !CE_STATIC_MEMBERS(class_type)) {
zend_class_entry **scope = EG(in_execution)?&EG(scope):&CG(active_class_entry);
class_type->constants_updated = 1;
}
}
-
+/* }}} */
/* This function requires 'properties' to contain all props declared in the
* class and all props being public. If only a subset is given or the class
* has protected members then you need to merge the properties seperately by
* calling zend_merge_properties(). */
-ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type, HashTable *properties ZEND_FILE_LINE_DC TSRMLS_DC)
+ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type, HashTable *properties ZEND_FILE_LINE_DC TSRMLS_DC) /* {{{ */
{
zval *tmp;
zend_object *object;
}
return SUCCESS;
}
+/* }}} */
-ZEND_API int _object_init_ex(zval *arg, zend_class_entry *class_type ZEND_FILE_LINE_DC TSRMLS_DC)
+ZEND_API int _object_init_ex(zval *arg, zend_class_entry *class_type ZEND_FILE_LINE_DC TSRMLS_DC) /* {{{ */
{
return _object_and_properties_init(arg, class_type, 0 ZEND_FILE_LINE_RELAY_CC TSRMLS_CC);
}
+/* }}} */
-ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC TSRMLS_DC)
+ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC TSRMLS_DC) /* {{{ */
{
return _object_init_ex(arg, zend_standard_class_def ZEND_FILE_LINE_RELAY_CC TSRMLS_CC);
}
+/* }}} */
-
-ZEND_API int add_assoc_function(zval *arg, char *key, void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS))
+ZEND_API int add_assoc_function(zval *arg, char *key, void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS)) /* {{{ */
{
zend_error(E_WARNING, "add_assoc_function() is no longer supported");
return FAILURE;
}
+/* }}} */
-
-ZEND_API int add_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value)
+ZEND_API int add_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value) /* {{{ */
{
return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &value, sizeof(zval *), NULL);
}
+/* }}} */
-ZEND_API int add_ascii_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value)
+ZEND_API int add_ascii_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value) /* {{{ */
{
return zend_ascii_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void*)&value, sizeof(zval*), NULL);
}
+/* }}} */
-ZEND_API int add_rt_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value)
+ZEND_API int add_rt_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value) /* {{{ */
{
return zend_rt_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void*)&value, sizeof(zval*), NULL);
}
+/* }}} */
-ZEND_API int add_utf8_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value)
+ZEND_API int add_utf8_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value) /* {{{ */
{
return zend_utf8_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void*)&value, sizeof(zval*), NULL);
}
+/* }}} */
-ZEND_API int add_u_assoc_zval_ex(zval *arg, zend_uchar type, zstr key, uint key_len, zval *value)
+ZEND_API int add_u_assoc_zval_ex(zval *arg, zend_uchar type, zstr key, uint key_len, zval *value) /* {{{ */
{
return zend_u_symtable_update(Z_ARRVAL_P(arg), type, key, key_len, (void *) &value, sizeof(zval *), NULL);
}
+/* }}} */
-ZEND_API int add_index_zval(zval *arg, ulong index, zval *value)
+ZEND_API int add_index_zval(zval *arg, ulong index, zval *value) /* {{{ */
{
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &value, sizeof(zval *), NULL);
}
+/* }}} */
-ZEND_API int add_next_index_zval(zval *arg, zval *value)
+ZEND_API int add_next_index_zval(zval *arg, zval *value) /* {{{ */
{
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &value, sizeof(zval *), NULL);
}
+/* }}} */
-
-ZEND_API int add_get_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, void **dest, int duplicate)
+ZEND_API int add_get_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, void **dest, int duplicate) /* {{{ */
{
zval *tmp;
return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), dest);
}
+/* }}} */
-
-ZEND_API int add_get_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, void **dest, int duplicate)
+ZEND_API int add_get_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, void **dest, int duplicate) /* {{{ */
{
zval *tmp;
return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), dest);
}
+/* }}} */
-
-ZEND_API int add_get_index_long(zval *arg, ulong index, long l, void **dest)
+ZEND_API int add_get_index_long(zval *arg, ulong index, long l, void **dest) /* {{{ */
{
zval *tmp;
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest);
}
+/* }}} */
-
-ZEND_API int add_get_index_double(zval *arg, ulong index, double d, void **dest)
+ZEND_API int add_get_index_double(zval *arg, ulong index, double d, void **dest) /* {{{ */
{
zval *tmp;
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest);
}
+/* }}} */
-
-ZEND_API int add_get_index_string(zval *arg, ulong index, char *str, void **dest, int duplicate)
+ZEND_API int add_get_index_string(zval *arg, ulong index, char *str, void **dest, int duplicate) /* {{{ */
{
zval *tmp;
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest);
}
+/* }}} */
-
-ZEND_API int add_get_index_stringl(zval *arg, ulong index, char *str, uint length, void **dest, int duplicate)
+ZEND_API int add_get_index_stringl(zval *arg, ulong index, char *str, uint length, void **dest, int duplicate) /* {{{ */
{
zval *tmp;
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest);
}
+/* }}} */
-ZEND_API int add_get_index_unicode(zval *arg, ulong index, UChar *str, void **dest, int duplicate)
+ZEND_API int add_get_index_unicode(zval *arg, ulong index, UChar *str, void **dest, int duplicate) /* {{{ */
{
zval *tmp;
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest);
}
+/* }}} */
-
-ZEND_API int add_get_index_unicodel(zval *arg, ulong index, UChar *str, uint length, void **dest, int duplicate)
+ZEND_API int add_get_index_unicodel(zval *arg, ulong index, UChar *str, uint length, void **dest, int duplicate) /* {{{ */
{
zval *tmp;
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest);
}
+/* }}} */
-ZEND_API int add_property_long_ex(zval *arg, char *key, uint key_len, long n TSRMLS_DC)
+ZEND_API int add_property_long_ex(zval *arg, char *key, uint key_len, long n TSRMLS_DC) /* {{{ */
{
zval *tmp;
zval *z_key;
zval_ptr_dtor(&z_key);
return SUCCESS;
}
+/* }}} */
-ZEND_API int add_property_bool_ex(zval *arg, char *key, uint key_len, int b TSRMLS_DC)
+ZEND_API int add_property_bool_ex(zval *arg, char *key, uint key_len, int b TSRMLS_DC) /* {{{ */
{
zval *tmp;
zval *z_key;
zval_ptr_dtor(&z_key);
return SUCCESS;
}
+/* }}} */
-ZEND_API int add_property_null_ex(zval *arg, char *key, uint key_len TSRMLS_DC)
+ZEND_API int add_property_null_ex(zval *arg, char *key, uint key_len TSRMLS_DC) /* {{{ */
{
zval *tmp;
zval *z_key;
zval_ptr_dtor(&z_key);
return SUCCESS;
}
+/* }}} */
-ZEND_API int add_property_resource_ex(zval *arg, char *key, uint key_len, long n TSRMLS_DC)
+ZEND_API int add_property_resource_ex(zval *arg, char *key, uint key_len, long n TSRMLS_DC) /* {{{ */
{
zval *tmp;
zval *z_key;
zval_ptr_dtor(&z_key);
return SUCCESS;
}
+/* }}} */
-
-ZEND_API int add_property_double_ex(zval *arg, char *key, uint key_len, double d TSRMLS_DC)
+ZEND_API int add_property_double_ex(zval *arg, char *key, uint key_len, double d TSRMLS_DC) /* {{{ */
{
zval *tmp;
zval *z_key;
zval_ptr_dtor(&z_key);
return SUCCESS;
}
+/* }}} */
-
-ZEND_API int add_property_string_ex(zval *arg, char *key, uint key_len, char *str, int duplicate TSRMLS_DC)
+ZEND_API int add_property_string_ex(zval *arg, char *key, uint key_len, char *str, int duplicate TSRMLS_DC) /* {{{ */
{
zval *tmp;
zval *z_key;
zval_ptr_dtor(&z_key);
return SUCCESS;
}
+/* }}} */
-ZEND_API int add_property_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate TSRMLS_DC)
+ZEND_API int add_property_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate TSRMLS_DC) /* {{{ */
{
zval *tmp;
zval *z_key;
zval_ptr_dtor(&z_key);
return SUCCESS;
}
+/* }}} */
-ZEND_API int add_property_ascii_string_ex(zval *arg, char *key, uint key_len, char *str, int duplicate TSRMLS_DC)
+ZEND_API int add_property_ascii_string_ex(zval *arg, char *key, uint key_len, char *str, int duplicate TSRMLS_DC) /* {{{ */
{
zval *tmp;
zval *z_key;
zval_ptr_dtor(&z_key);
return SUCCESS;
}
+/* }}} */
-ZEND_API int add_property_ascii_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate TSRMLS_DC)
+ZEND_API int add_property_ascii_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate TSRMLS_DC) /* {{{ */
{
zval *tmp;
zval *z_key;
zval_ptr_dtor(&z_key);
return SUCCESS;
}
+/* }}} */
-ZEND_API int add_property_rt_string_ex(zval *arg, char *key, uint key_len, char *str, int duplicate TSRMLS_DC)
+ZEND_API int add_property_rt_string_ex(zval *arg, char *key, uint key_len, char *str, int duplicate TSRMLS_DC) /* {{{ */
{
zval *tmp;
zval *z_key;
zval_ptr_dtor(&z_key);
return SUCCESS;
}
+/* }}} */
-ZEND_API int add_property_rt_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate TSRMLS_DC)
+ZEND_API int add_property_rt_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate TSRMLS_DC) /* {{{ */
{
zval *tmp;
zval *z_key;
zval_ptr_dtor(&z_key);
return SUCCESS;
}
+/* }}} */
-ZEND_API int add_property_utf8_string_ex(zval *arg, char *key, uint key_len, char *str, int duplicate TSRMLS_DC)
+ZEND_API int add_property_utf8_string_ex(zval *arg, char *key, uint key_len, char *str, int duplicate TSRMLS_DC) /* {{{ */
{
zval *tmp;
zval *z_key;
zval_ptr_dtor(&z_key);
return SUCCESS;
}
+/* }}} */
-ZEND_API int add_property_utf8_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate TSRMLS_DC)
+ZEND_API int add_property_utf8_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate TSRMLS_DC) /* {{{ */
{
zval *tmp;
zval *z_key;
zval_ptr_dtor(&z_key);
return SUCCESS;
}
+/* }}} */
-ZEND_API int add_property_unicode_ex(zval *arg, char *key, uint key_len, UChar *str, int duplicate TSRMLS_DC)
+ZEND_API int add_property_unicode_ex(zval *arg, char *key, uint key_len, UChar *str, int duplicate TSRMLS_DC) /* {{{ */
{
zval *tmp;
zval *z_key;
zval_ptr_dtor(&z_key);
return SUCCESS;
}
+/* }}} */
-ZEND_API int add_property_unicodel_ex(zval *arg, char *key, uint key_len, UChar *str, uint length, int duplicate TSRMLS_DC)
+ZEND_API int add_property_unicodel_ex(zval *arg, char *key, uint key_len, UChar *str, uint length, int duplicate TSRMLS_DC) /* {{{ */
{
zval *tmp;
zval *z_key;
zval_ptr_dtor(&z_key);
return SUCCESS;
}
+/* }}} */
-ZEND_API int add_property_zval_ex(zval *arg, char *key, uint key_len, zval *value TSRMLS_DC)
+ZEND_API int add_property_zval_ex(zval *arg, char *key, uint key_len, zval *value TSRMLS_DC) /* {{{ */
{
zval *z_key;
zval_ptr_dtor(&z_key);
return SUCCESS;
}
+/* }}} */
-ZEND_API int add_utf8_property_zval_ex(zval *arg, char *key, uint key_len, zval *value TSRMLS_DC)
+ZEND_API int add_utf8_property_zval_ex(zval *arg, char *key, uint key_len, zval *value TSRMLS_DC) /* {{{ */
{
zval *z_key;
zval_ptr_dtor(&z_key);
return SUCCESS;
}
+/* }}} */
-ZEND_API int add_property_zstr_ex(zval *arg, char *key, uint key_len, zend_uchar type, zstr str, int duplicate TSRMLS_DC)
+ZEND_API int add_property_zstr_ex(zval *arg, char *key, uint key_len, zend_uchar type, zstr str, int duplicate TSRMLS_DC) /* {{{ */
{
zval *tmp;
zval *z_key;
zval_ptr_dtor(&z_key);
return SUCCESS;
}
+/* }}} */
-ZEND_API int add_property_zstrl_ex(zval *arg, char *key, uint key_len, zend_uchar type, zstr str, uint length, int duplicate TSRMLS_DC)
+ZEND_API int add_property_zstrl_ex(zval *arg, char *key, uint key_len, zend_uchar type, zstr str, uint length, int duplicate TSRMLS_DC) /* {{{ */
{
zval *tmp;
zval *z_key;
zval_ptr_dtor(&z_key);
return SUCCESS;
}
+/* }}} */
-ZEND_API int zend_startup_module_ex(zend_module_entry *module TSRMLS_DC)
+ZEND_API int zend_startup_module_ex(zend_module_entry *module TSRMLS_DC) /* {{{ */
{
int name_len;
char *lcname;
}
return SUCCESS;
}
+/* }}} */
-static void zend_sort_modules(void *base, size_t count, size_t siz, compare_func_t compare TSRMLS_DC)
+static void zend_sort_modules(void *base, size_t count, size_t siz, compare_func_t compare TSRMLS_DC) /* {{{ */
{
Bucket **b1 = base;
Bucket **b2;
b1++;
}
}
+/* }}} */
-ZEND_API int zend_startup_modules(TSRMLS_D)
+ZEND_API int zend_startup_modules(TSRMLS_D) /* {{{ */
{
zend_hash_sort(&module_registry, zend_sort_modules, NULL, 0 TSRMLS_CC);
zend_hash_apply(&module_registry, (apply_func_t)zend_startup_module_ex TSRMLS_CC);
return SUCCESS;
}
+/* }}} */
-ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TSRMLS_DC)
+ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TSRMLS_DC) /* {{{ */
{
int name_len;
char *lcname;
EG(current_module) = NULL;
return module;
}
+/* }}} */
-ZEND_API zend_module_entry* zend_register_internal_module(zend_module_entry *module TSRMLS_DC)
+ZEND_API zend_module_entry* zend_register_internal_module(zend_module_entry *module TSRMLS_DC) /* {{{ */
{
module->module_number = zend_next_free_module();
module->type = MODULE_PERSISTENT;
return zend_register_module_ex(module TSRMLS_CC);
}
+/* }}} */
-ZEND_API void zend_check_magic_method_implementation(zend_class_entry *ce, zend_function *fptr, int error_type TSRMLS_DC)
+ZEND_API void zend_check_magic_method_implementation(zend_class_entry *ce, zend_function *fptr, int error_type TSRMLS_DC) /* {{{ */
{
unsigned int lcname_len;
zstr lcname;
}
efree(lcname.v);
}
+/* }}} */
/* registers all functions in *library_functions in the function hash */
-ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entry *functions, HashTable *function_table, int type TSRMLS_DC)
+ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entry *functions, HashTable *function_table, int type TSRMLS_DC) /* {{{ */
{
zend_function_entry *ptr = functions;
zend_function function, *reg_function;
}
return SUCCESS;
}
+/* }}} */
/* count=-1 means erase all functions, otherwise,
* erase the first count functions
*/
-ZEND_API void zend_unregister_functions(zend_function_entry *functions, int count, HashTable *function_table TSRMLS_DC)
+ZEND_API void zend_unregister_functions(zend_function_entry *functions, int count, HashTable *function_table TSRMLS_DC) /* {{{ */
{
zend_function_entry *ptr = functions;
int i=0;
i++;
}
}
+/* }}} */
-
-ZEND_API int zend_startup_module(zend_module_entry *module)
+ZEND_API int zend_startup_module(zend_module_entry *module) /* {{{ */
{
TSRMLS_FETCH();
}
return FAILURE;
}
+/* }}} */
-
-ZEND_API int zend_get_module_started(char *module_name)
+ZEND_API int zend_get_module_started(char *module_name) /* {{{ */
{
zend_module_entry *module;
return (zend_hash_find(&module_registry, module_name, strlen(module_name)+1, (void**)&module) == SUCCESS && module->module_started) ? SUCCESS : FAILURE;
}
+/* }}} */
-
-void module_destructor(zend_module_entry *module)
+void module_destructor(zend_module_entry *module) /* {{{ */
{
TSRMLS_FETCH();
#endif
#endif
}
-
+/* }}} */
/* call request startup for all modules */
-int module_registry_request_startup(zend_module_entry *module TSRMLS_DC)
+int module_registry_request_startup(zend_module_entry *module TSRMLS_DC) /* {{{ */
{
if (module->request_startup_func) {
#if 0
}
return 0;
}
-
+/* }}} */
/* call request shutdown for all modules */
-int module_registry_cleanup(zend_module_entry *module TSRMLS_DC)
+int module_registry_cleanup(zend_module_entry *module TSRMLS_DC) /* {{{ */
{
if (module->request_shutdown_func) {
#if 0
}
return 0;
}
+/* }}} */
-int module_registry_unload_temp(zend_module_entry *module TSRMLS_DC)
+int module_registry_unload_temp(zend_module_entry *module TSRMLS_DC) /* {{{ */
{
return (module->type == MODULE_TEMPORARY) ? ZEND_HASH_APPLY_REMOVE : ZEND_HASH_APPLY_STOP;
}
-
+/* }}} */
/* return the next free module number */
-int zend_next_free_module(void)
+int zend_next_free_module(void) /* {{{ */
{
return ++module_count;
}
+/* }}} */
-static zend_class_entry *do_register_internal_class(zend_class_entry *orig_class_entry, zend_uint ce_flags TSRMLS_DC)
+static zend_class_entry *do_register_internal_class(zend_class_entry *orig_class_entry, zend_uint ce_flags TSRMLS_DC) /* {{{ */
{
zend_class_entry *class_entry = malloc(sizeof(zend_class_entry));
zstr lcname;
efree(lcname.v);
return class_entry;
}
+/* }}} */
/* If parent_ce is not NULL then it inherits from parent_ce
* If parent_ce is NULL and parent_name isn't then it looks for the parent and inherits from it
* If both parent_ce and parent_name are NULL it does a regular class registration
* If parent_name is specified but not found NULL is returned
*/
-ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce, char *parent_name TSRMLS_DC)
+ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce, char *parent_name TSRMLS_DC) /* {{{ */
{
zend_class_entry *register_class;
}
return register_class;
}
+/* }}} */
-ZEND_API void zend_class_implements(zend_class_entry *class_entry TSRMLS_DC, int num_interfaces, ...)
+ZEND_API void zend_class_implements(zend_class_entry *class_entry TSRMLS_DC, int num_interfaces, ...) /* {{{ */
{
zend_class_entry *interface_entry;
va_list interface_list;
va_end(interface_list);
}
+/* }}} */
/* A class that contains at least one abstract method automatically becomes an abstract class.
*/
-ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *orig_class_entry TSRMLS_DC)
+ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *orig_class_entry TSRMLS_DC) /* {{{ */
{
return do_register_internal_class(orig_class_entry, 0 TSRMLS_CC);
}
+/* }}} */
-ZEND_API zend_class_entry *zend_register_internal_interface(zend_class_entry *orig_class_entry TSRMLS_DC)
+ZEND_API zend_class_entry *zend_register_internal_interface(zend_class_entry *orig_class_entry TSRMLS_DC) /* {{{ */
{
return do_register_internal_class(orig_class_entry, ZEND_ACC_INTERFACE TSRMLS_CC);
}
+/* }}} */
-ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
- zend_bool is_ref, int num_symbol_tables, ...)
+ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length, zend_bool is_ref, int num_symbol_tables, ...) /* {{{ */
{
HashTable *symbol_table;
va_list symbol_table_list;
va_end(symbol_table_list);
return SUCCESS;
}
-
-
-
+/* }}} */
/* Disabled functions support */
};
-ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC)
+ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC) /* {{{ */
{
if (zend_hash_del(CG(function_table), function_name, function_name_length+1)==FAILURE) {
return FAILURE;
disabled_function[0].fname = function_name;
return zend_register_functions(NULL, disabled_function, CG(function_table), MODULE_PERSISTENT TSRMLS_CC);
}
+/* }}} */
-static zend_object_value display_disabled_class(zend_class_entry *class_type TSRMLS_DC)
+static zend_object_value display_disabled_class(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
{
zend_object_value retval;
zend_object *intern;
zend_error(E_WARNING, "%v() has been disabled for security reasons", class_type->name);
return retval;
}
+/* }}} */
static zend_function_entry disabled_class_new[] = {
{ NULL, NULL, NULL }
};
-ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC)
+ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC) /* {{{ */
{
zend_class_entry disabled_class;
zend_register_internal_class(&disabled_class TSRMLS_CC);
return SUCCESS;
}
+/* }}} */
-static int zend_is_callable_check_func(int check_flags, zval ***zobj_ptr_ptr, zend_class_entry *ce_org, zval *callable, zend_class_entry **ce_ptr, zend_function **fptr_ptr TSRMLS_DC)
+static int zend_is_callable_check_func(int check_flags, zval ***zobj_ptr_ptr, zend_class_entry *ce_org, zval *callable, zend_class_entry **ce_ptr, zend_function **fptr_ptr TSRMLS_DC) /* {{{ */
{
int retval;
zstr lmname, mname, colon = NULL_ZSTR;
efree(lmname.v);
return retval;
}
+/* }}} */
-ZEND_API zend_bool zend_is_callable_ex(zval *callable, uint check_flags, zval *callable_name, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zval ***zobj_ptr_ptr TSRMLS_DC)
+ZEND_API zend_bool zend_is_callable_ex(zval *callable, uint check_flags, zval *callable_name, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zval ***zobj_ptr_ptr TSRMLS_DC) /* {{{ */
{
zstr lcname;
unsigned int lcname_len;
return 0;
}
}
+/* }}} */
-
-ZEND_API zend_bool zend_is_callable(zval *callable, uint check_flags, zval *callable_name)
+ZEND_API zend_bool zend_is_callable(zval *callable, uint check_flags, zval *callable_name) /* {{{ */
{
TSRMLS_FETCH();
return zend_is_callable_ex(callable, check_flags, callable_name, NULL, NULL, NULL TSRMLS_CC);
}
+/* }}} */
-
-ZEND_API zend_bool zend_make_callable(zval *callable, zval *callable_name TSRMLS_DC)
+ZEND_API zend_bool zend_make_callable(zval *callable, zval *callable_name TSRMLS_DC) /* {{{ */
{
char *lcname, *func, *class_name;
zend_bool retval = 0;
}
return retval;
}
+/* }}} */
-
-ZEND_API int zend_fcall_info_init(zval *callable, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zval *callable_name TSRMLS_DC)
+ZEND_API int zend_fcall_info_init(zval *callable, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zval *callable_name TSRMLS_DC) /* {{{ */
{
zend_class_entry *ce;
zend_function *func;
return SUCCESS;
}
+/* }}} */
-ZEND_API void zend_fcall_info_args_clear(zend_fcall_info *fci, int free_mem)
+ZEND_API void zend_fcall_info_args_clear(zend_fcall_info *fci, int free_mem) /* {{{ */
{
if (fci->params) {
while (fci->param_count) {
}
fci->param_count = 0;
}
+/* }}} */
-ZEND_API void zend_fcall_info_args_save(zend_fcall_info *fci, int *param_count, zval ****params)
+ZEND_API void zend_fcall_info_args_save(zend_fcall_info *fci, int *param_count, zval ****params) /* {{{ */
{
*param_count = fci->param_count;
*params = fci->params;
fci->param_count = 0;
fci->params = NULL;
}
+/* }}} */
-ZEND_API void zend_fcall_info_args_restore(zend_fcall_info *fci, int param_count, zval ***params)
+ZEND_API void zend_fcall_info_args_restore(zend_fcall_info *fci, int param_count, zval ***params) /* {{{ */
{
zend_fcall_info_args_clear(fci, 1);
fci->param_count = param_count;
fci->params = params;
}
+/* }}} */
-ZEND_API int zend_fcall_info_args(zend_fcall_info *fci, zval *args TSRMLS_DC)
+ZEND_API int zend_fcall_info_args(zend_fcall_info *fci, zval *args TSRMLS_DC) /* {{{ */
{
HashPosition pos;
zval **arg, ***params;
return SUCCESS;
}
+/* }}} */
-ZEND_API int zend_fcall_info_argp(zend_fcall_info *fci TSRMLS_DC, int argc, zval ***argv)
+ZEND_API int zend_fcall_info_argp(zend_fcall_info *fci TSRMLS_DC, int argc, zval ***argv) /* {{{ */
{
int i;
return SUCCESS;
}
+/* }}} */
-ZEND_API int zend_fcall_info_argv(zend_fcall_info *fci TSRMLS_DC, int argc, va_list *argv)
+ZEND_API int zend_fcall_info_argv(zend_fcall_info *fci TSRMLS_DC, int argc, va_list *argv) /* {{{ */
{
int i;
zval **arg;
return SUCCESS;
}
+/* }}} */
-ZEND_API int zend_fcall_info_argn(zend_fcall_info *fci TSRMLS_DC, int argc, ...)
+ZEND_API int zend_fcall_info_argn(zend_fcall_info *fci TSRMLS_DC, int argc, ...) /* {{{ */
{
int ret;
va_list argv;
return ret;
}
+/* }}} */
-ZEND_API int zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_cache *fcc, zval **retval_ptr_ptr, zval *args TSRMLS_DC)
+ZEND_API int zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_cache *fcc, zval **retval_ptr_ptr, zval *args TSRMLS_DC) /* {{{ */
{
zval *retval, ***org_params = NULL;
int result, org_count = 0;
}
return result;
}
+/* }}} */
-
-ZEND_API char *zend_get_module_version(char *module_name)
+ZEND_API char *zend_get_module_version(char *module_name) /* {{{ */
{
char *lname;
int name_len = strlen(module_name);
efree(lname);
return module->version;
}
+/* }}} */
-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, zstr doc_comment, int doc_comment_len TSRMLS_DC)
+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, zstr doc_comment, int doc_comment_len TSRMLS_DC) /* {{{ */
{
zend_property_info property_info;
HashTable *target_symbol_table;
return SUCCESS;
}
+/* }}} */
-ZEND_API int zend_declare_property_ex(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type, zstr doc_comment, int doc_comment_len TSRMLS_DC)
+ZEND_API int zend_declare_property_ex(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type, zstr doc_comment, int doc_comment_len TSRMLS_DC) /* {{{ */
{
if (UG(unicode)) {
zstr uname;
return zend_u_declare_property_ex(ce, IS_STRING, ZSTR(name), name_length, property, access_type, doc_comment, doc_comment_len TSRMLS_CC);
}
}
+/* }}} */
-ZEND_API int zend_u_declare_property(zend_class_entry *ce, zend_uchar type, zstr name, int name_length, zval *property, int access_type TSRMLS_DC)
+ZEND_API int zend_u_declare_property(zend_class_entry *ce, zend_uchar type, zstr name, int name_length, zval *property, int access_type TSRMLS_DC) /* {{{ */
{
return zend_u_declare_property_ex(ce, type, name, name_length, property, access_type, NULL_ZSTR, 0 TSRMLS_CC);
}
+/* }}} */
-ZEND_API int zend_declare_property(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type TSRMLS_DC)
+ZEND_API int zend_declare_property(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type TSRMLS_DC) /* {{{ */
{
if (UG(unicode)) {
zstr uname;
return zend_u_declare_property_ex(ce, IS_STRING, ZSTR(name), name_length, property, access_type, NULL_ZSTR, 0 TSRMLS_CC);
}
}
+/* }}} */
-ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int name_length, int access_type TSRMLS_DC)
+ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int name_length, int access_type TSRMLS_DC) /* {{{ */
{
zval *property;
INIT_ZVAL(*property);
return zend_declare_property(ce, name, name_length, property, access_type TSRMLS_CC);
}
+/* }}} */
-ZEND_API int zend_declare_property_bool(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC)
+ZEND_API int zend_declare_property_bool(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC) /* {{{ */
{
zval *property;
ZVAL_BOOL(property, value);
return zend_declare_property(ce, name, name_length, property, access_type TSRMLS_CC);
}
+/* }}} */
-ZEND_API int zend_declare_property_long(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC)
+ZEND_API int zend_declare_property_long(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC) /* {{{ */
{
zval *property;
ZVAL_LONG(property, value);
return zend_declare_property(ce, name, name_length, property, access_type TSRMLS_CC);
}
+/* }}} */
-ZEND_API int zend_declare_property_double(zend_class_entry *ce, char *name, int name_length, double value, int access_type TSRMLS_DC)
+ZEND_API int zend_declare_property_double(zend_class_entry *ce, char *name, int name_length, double value, int access_type TSRMLS_DC) /* {{{ */
{
zval *property;
ZVAL_DOUBLE(property, value);
return zend_declare_property(ce, name, name_length, property, access_type TSRMLS_CC);
}
+/* }}} */
-ZEND_API int zend_declare_property_string(zend_class_entry *ce, char *name, int name_length, char *value, int access_type TSRMLS_DC)
+ZEND_API int zend_declare_property_string(zend_class_entry *ce, char *name, int name_length, char *value, int access_type TSRMLS_DC) /* {{{ */
{
zval *property;
int len = strlen(value);
INIT_PZVAL(property);
return zend_declare_property(ce, name, name_length, property, access_type TSRMLS_CC);
}
+/* }}} */
-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_property_stringl(zend_class_entry *ce, char *name, int name_length, char *value, int value_len, int access_type TSRMLS_DC) /* {{{ */
{
zval *property;
INIT_PZVAL(property);
return zend_declare_property(ce, name, name_length, property, access_type TSRMLS_CC);
}
+/* }}} */
-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(zend_class_entry *ce, char *name, size_t name_length, zval *value TSRMLS_DC) /* {{{ */
{
return zend_ascii_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)
+ZEND_API int zend_declare_class_constant_null(zend_class_entry *ce, char *name, size_t name_length TSRMLS_DC) /* {{{ */
{
zval *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)
+ZEND_API int zend_declare_class_constant_long(zend_class_entry *ce, char *name, size_t name_length, long value TSRMLS_DC) /* {{{ */
{
zval *constant;
INIT_PZVAL(constant);
return zend_declare_class_constant(ce, name, name_length, constant TSRMLS_CC);
}
+/* }}} */
-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_bool(zend_class_entry *ce, char *name, size_t name_length, zend_bool value TSRMLS_DC) /* {{{ */
{
zval *constant;
INIT_PZVAL(constant);
return zend_declare_class_constant(ce, name, name_length, constant TSRMLS_CC);
}
+/* }}} */
-ZEND_API int zend_declare_class_constant_double(zend_class_entry *ce, char *name, size_t name_length, double 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) /* {{{ */
{
zval *constant;
INIT_PZVAL(constant);
return zend_declare_class_constant(ce, name, name_length, constant TSRMLS_CC);
}
+/* }}} */
-ZEND_API int zend_declare_class_constant_stringl(zend_class_entry *ce, char *name, size_t name_length, char *value, size_t value_length TSRMLS_DC)
+ZEND_API int zend_declare_class_constant_stringl(zend_class_entry *ce, char *name, size_t name_length, char *value, size_t value_length TSRMLS_DC) /* {{{ */
{
zval *constant;
INIT_PZVAL(constant);
return zend_declare_class_constant(ce, name, name_length, constant TSRMLS_CC);
}
+/* }}} */
-ZEND_API int zend_declare_class_constant_string(zend_class_entry *ce, char *name, size_t name_length, char *value TSRMLS_DC)
+ZEND_API int zend_declare_class_constant_string(zend_class_entry *ce, char *name, size_t name_length, char *value TSRMLS_DC) /* {{{ */
{
return zend_declare_class_constant_stringl(ce, name, name_length, value, strlen(value) TSRMLS_CC);
}
+/* }}} */
-ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, char *name, int name_length, zval *value TSRMLS_DC)
+ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, char *name, int name_length, zval *value TSRMLS_DC) /* {{{ */
{
zval *property;
zend_class_entry *old_scope = EG(scope);
EG(scope) = old_scope;
}
+/* }}} */
-ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, char *name, int name_length TSRMLS_DC)
+ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, char *name, int name_length TSRMLS_DC) /* {{{ */
{
zval *tmp;
ZVAL_NULL(tmp);
zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC);
}
+/* }}} */
-ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC)
+ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC) /* {{{ */
{
zval *tmp;
ZVAL_BOOL(tmp, value);
zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC);
}
+/* }}} */
-ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC)
+ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC) /* {{{ */
{
zval *tmp;
ZVAL_LONG(tmp, value);
zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC);
}
+/* }}} */
-ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object, char *name, int name_length, double value TSRMLS_DC)
+ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object, char *name, int name_length, double value TSRMLS_DC) /* {{{ */
{
zval *tmp;
ZVAL_DOUBLE(tmp, value);
zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC);
}
+/* }}} */
-ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, char *name, int name_length, char *value TSRMLS_DC)
+ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, char *name, int name_length, char *value TSRMLS_DC) /* {{{ */
{
zval *tmp;
ZVAL_STRING(tmp, value, 1);
zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC);
}
+/* }}} */
-ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, char *value, int value_len TSRMLS_DC)
+ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, char *value, int value_len TSRMLS_DC) /* {{{ */
{
zval *tmp;
ZVAL_STRINGL(tmp, value, value_len, 1);
zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC);
}
+/* }}} */
-ZEND_API void zend_update_property_ascii_string(zend_class_entry *scope, zval *object, char *name, int name_length, char *value TSRMLS_DC)
+ZEND_API void zend_update_property_ascii_string(zend_class_entry *scope, zval *object, char *name, int name_length, char *value TSRMLS_DC) /* {{{ */
{
zval *tmp;
ZVAL_ASCII_STRING(tmp, value, 1);
zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC);
}
+/* }}} */
-ZEND_API void zend_update_property_ascii_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, char *value, int value_len TSRMLS_DC)
+ZEND_API void zend_update_property_ascii_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, char *value, int value_len TSRMLS_DC) /* {{{ */
{
zval *tmp;
ZVAL_ASCII_STRINGL(tmp, value, value_len, 1);
zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC);
}
+/* }}} */
-ZEND_API void zend_update_property_rt_string(zend_class_entry *scope, zval *object, char *name, int name_length, char *value TSRMLS_DC)
+ZEND_API void zend_update_property_rt_string(zend_class_entry *scope, zval *object, char *name, int name_length, char *value TSRMLS_DC) /* {{{ */
{
zval *tmp;
ZVAL_RT_STRING(tmp, value, 1);
zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC);
}
+/* }}} */
-ZEND_API void zend_update_property_rt_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, char *value, int value_len TSRMLS_DC)
+ZEND_API void zend_update_property_rt_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, char *value, int value_len TSRMLS_DC) /* {{{ */
{
zval *tmp;
ZVAL_RT_STRINGL(tmp, value, value_len, 1);
zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC);
}
+/* }}} */
-ZEND_API void zend_update_property_unicode(zend_class_entry *scope, zval *object, char *name, int name_length, UChar *value TSRMLS_DC)
+ZEND_API void zend_update_property_unicode(zend_class_entry *scope, zval *object, char *name, int name_length, UChar *value TSRMLS_DC) /* {{{ */
{
zval *tmp;
ZVAL_UNICODE(tmp, value, 1);
zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC);
}
+/* }}} */
-ZEND_API void zend_update_property_unicodel(zend_class_entry *scope, zval *object, char *name, int name_length, UChar *value, int value_len TSRMLS_DC)
+ZEND_API void zend_update_property_unicodel(zend_class_entry *scope, zval *object, char *name, int name_length, UChar *value, int value_len TSRMLS_DC) /* {{{ */
{
zval *tmp;
ZVAL_UNICODEL(tmp, value, value_len, 1);
zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC);
}
+/* }}} */
-ZEND_API int zend_update_static_property(zend_class_entry *scope, char *name, int name_length, zval *value TSRMLS_DC)
+ZEND_API int zend_update_static_property(zend_class_entry *scope, char *name, int name_length, zval *value TSRMLS_DC) /* {{{ */
{
zval **property;
zend_class_entry *old_scope = EG(scope);
return SUCCESS;
}
}
+/* }}} */
-ZEND_API int zend_update_static_property_null(zend_class_entry *scope, char *name, int name_length TSRMLS_DC)
+ZEND_API int zend_update_static_property_null(zend_class_entry *scope, char *name, int name_length TSRMLS_DC) /* {{{ */
{
zval *tmp;
ZVAL_NULL(tmp);
return zend_update_static_property(scope, name, name_length, tmp TSRMLS_CC);
}
+/* }}} */
-ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, char *name, int name_length, long value TSRMLS_DC)
+ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, char *name, int name_length, long value TSRMLS_DC) /* {{{ */
{
zval *tmp;
ZVAL_BOOL(tmp, value);
return zend_update_static_property(scope, name, name_length, tmp TSRMLS_CC);
}
+/* }}} */
-ZEND_API int zend_update_static_property_long(zend_class_entry *scope, char *name, int name_length, long value TSRMLS_DC)
+ZEND_API int zend_update_static_property_long(zend_class_entry *scope, char *name, int name_length, long value TSRMLS_DC) /* {{{ */
{
zval *tmp;
ZVAL_LONG(tmp, value);
return zend_update_static_property(scope, name, name_length, tmp TSRMLS_CC);
}
+/* }}} */
-ZEND_API int zend_update_static_property_double(zend_class_entry *scope, char *name, int name_length, double value TSRMLS_DC)
+ZEND_API int zend_update_static_property_double(zend_class_entry *scope, char *name, int name_length, double value TSRMLS_DC) /* {{{ */
{
zval *tmp;
ZVAL_DOUBLE(tmp, value);
return zend_update_static_property(scope, name, name_length, tmp TSRMLS_CC);
}
+/* }}} */
-ZEND_API int zend_update_static_property_string(zend_class_entry *scope, char *name, int name_length, char *value TSRMLS_DC)
+ZEND_API int zend_update_static_property_string(zend_class_entry *scope, char *name, int name_length, char *value TSRMLS_DC) /* {{{ */
{
zval *tmp;
ZVAL_STRING(tmp, value, 1);
return zend_update_static_property(scope, name, name_length, tmp TSRMLS_CC);
}
+/* }}} */
-ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, char *name, int name_length, char *value, int value_len TSRMLS_DC)
+ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, char *name, int name_length, char *value, int value_len TSRMLS_DC) /* {{{ */
{
zval *tmp;
ZVAL_STRINGL(tmp, value, value_len, 1);
return zend_update_static_property(scope, name, name_length, tmp TSRMLS_CC);
}
+/* }}} */
-ZEND_API int zend_update_static_property_ascii_string(zend_class_entry *scope, char *name, int name_length, char *value TSRMLS_DC)
+ZEND_API int zend_update_static_property_ascii_string(zend_class_entry *scope, char *name, int name_length, char *value TSRMLS_DC) /* {{{ */
{
zval *tmp;
ZVAL_ASCII_STRING(tmp, value, 1);
return zend_update_static_property(scope, name, name_length, tmp TSRMLS_CC);
}
+/* }}} */
-ZEND_API int zend_update_static_property_ascii_stringl(zend_class_entry *scope, char *name, int name_length, char *value, int value_len TSRMLS_DC)
+ZEND_API int zend_update_static_property_ascii_stringl(zend_class_entry *scope, char *name, int name_length, char *value, int value_len TSRMLS_DC) /* {{{ */
{
zval *tmp;
ZVAL_ASCII_STRINGL(tmp, value, value_len, 1);
return zend_update_static_property(scope, name, name_length, tmp TSRMLS_CC);
}
+/* }}} */
-ZEND_API int zend_update_static_property_rt_string(zend_class_entry *scope, char *name, int name_length, char *value TSRMLS_DC)
+ZEND_API int zend_update_static_property_rt_string(zend_class_entry *scope, char *name, int name_length, char *value TSRMLS_DC) /* {{{ */
{
zval *tmp;
ZVAL_RT_STRING(tmp, value, 1);
return zend_update_static_property(scope, name, name_length, tmp TSRMLS_CC);
}
+/* }}} */
-ZEND_API int zend_update_static_property_rt_stringl(zend_class_entry *scope, char *name, int name_length, char *value, int value_len TSRMLS_DC)
+ZEND_API int zend_update_static_property_rt_stringl(zend_class_entry *scope, char *name, int name_length, char *value, int value_len TSRMLS_DC) /* {{{ */
{
zval *tmp;
ZVAL_RT_STRINGL(tmp, value, value_len, 1);
return zend_update_static_property(scope, name, name_length, tmp TSRMLS_CC);
}
+/* }}} */
-ZEND_API int zend_update_static_property_unicode(zend_class_entry *scope, char *name, int name_length, UChar *value TSRMLS_DC)
+ZEND_API int zend_update_static_property_unicode(zend_class_entry *scope, char *name, int name_length, UChar *value TSRMLS_DC) /* {{{ */
{
zval *tmp;
ZVAL_UNICODE(tmp, value, 1);
return zend_update_static_property(scope, name, name_length, tmp TSRMLS_CC);
}
+/* }}} */
-ZEND_API int zend_update_static_property_unicodel(zend_class_entry *scope, char *name, int name_length, UChar *value, int value_len TSRMLS_DC)
+ZEND_API int zend_update_static_property_unicodel(zend_class_entry *scope, char *name, int name_length, UChar *value, int value_len TSRMLS_DC) /* {{{ */
{
zval *tmp;
ZVAL_UNICODEL(tmp, value, value_len, 1);
return zend_update_static_property(scope, name, name_length, tmp TSRMLS_CC);
}
+/* }}} */
-ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, char *name, int name_length, zend_bool silent TSRMLS_DC)
+ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, char *name, int name_length, zend_bool silent TSRMLS_DC) /* {{{ */
{
zval *property, *value;
zend_class_entry *old_scope = EG(scope);
EG(scope) = old_scope;
return value;
}
+/* }}} */
-ZEND_API zval *zend_read_static_property(zend_class_entry *scope, char *name, int name_length, zend_bool silent TSRMLS_DC)
+ZEND_API zval *zend_read_static_property(zend_class_entry *scope, char *name, int name_length, zend_bool silent TSRMLS_DC) /* {{{ */
{
zval **property;
zend_class_entry *old_scope = EG(scope);
return property?*property:NULL;
}
+/* }}} */
/*
* Return the string type that all the passed in types should be converted to.
* If none of the types are string types, IS_UNICODE or IS_STRING is returned,
* depending on the Unicode semantics switch.
*/
-ZEND_API zend_uchar zend_get_unified_string_type(int num_args TSRMLS_DC, ...)
+ZEND_API zend_uchar zend_get_unified_string_type(int num_args TSRMLS_DC, ...) /* {{{ */
{
va_list ap;
int best_type = ZEND_STR_TYPE;
return best_type;
}
+/* }}} */
/*
* Local variables:
#endif
#if ZEND_DEBUG
-void zend_debug_alloc_output(char *format, ...)
+void zend_debug_alloc_output(char *format, ...) /* {{{ */
{
char output_buf[256];
va_list args;
fprintf(stderr, "%s", output_buf);
#endif
}
+/* }}} */
#endif
#if (defined (__GNUC__) && __GNUC__ > 2 ) && !defined(__INTEL_COMPILER) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX)
# define UNEXPECTED(condition) (condition)
#endif
-static void zend_mm_panic(const char *message)
+static void zend_mm_panic(const char *message) /* {{{ */
{
fprintf(stderr, "%s\n", message);
#if ZEND_DEBUG && defined(HAVE_KILL) && defined(HAVE_GETPID)
#endif
exit(1);
}
+/* }}} */
/*******************/
/* Storage Manager */
# endif
#endif
-static zend_mm_storage* zend_mm_mem_dummy_init(void *params)
+static zend_mm_storage* zend_mm_mem_dummy_init(void *params) /* {{{ */
{
return malloc(sizeof(zend_mm_storage));
}
+/* }}} */
-static void zend_mm_mem_dummy_dtor(zend_mm_storage *storage)
+static void zend_mm_mem_dummy_dtor(zend_mm_storage *storage) /* {{{ */
{
free(storage);
}
+/* }}} */
#if defined(HAVE_MEM_MMAP_ANON) || defined(HAVE_MEM_MMAP_ZERO)
-static zend_mm_segment* zend_mm_mem_mmap_realloc(zend_mm_storage *storage, zend_mm_segment* segment, size_t size)
+static zend_mm_segment* zend_mm_mem_mmap_realloc(zend_mm_storage *storage, zend_mm_segment* segment, size_t size) /* {{{ */
{
zend_mm_segment *ret;
#ifdef HAVE_MREMAP
#endif
return ret;
}
+/* }}} */
-static void zend_mm_mem_mmap_free(zend_mm_storage *storage, zend_mm_segment* segment)
+static void zend_mm_mem_mmap_free(zend_mm_storage *storage, zend_mm_segment* segment) /* {{{ */
{
munmap(segment, segment->size);
}
+/* }}} */
#endif
#ifdef HAVE_MEM_MMAP_ANON
-static zend_mm_segment* zend_mm_mem_mmap_anon_alloc(zend_mm_storage *storage, size_t size)
+static zend_mm_segment* zend_mm_mem_mmap_anon_alloc(zend_mm_storage *storage, size_t size) /* {{{ */
{
zend_mm_segment *ret = (zend_mm_segment*)mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
if (ret == MAP_FAILED) {
}
return ret;
}
+/* }}} */
# define ZEND_MM_MEM_MMAP_ANON_DSC {"mmap_anon", zend_mm_mem_dummy_init, zend_mm_mem_dummy_dtor, zend_mm_mem_mmap_anon_alloc, zend_mm_mem_mmap_realloc, zend_mm_mem_mmap_free}
static int zend_mm_dev_zero_fd = -1;
-static zend_mm_storage* zend_mm_mem_mmap_zero_init(void *params)
+static zend_mm_storage* zend_mm_mem_mmap_zero_init(void *params) /* {{{ */
{
if (zend_mm_dev_zero_fd != -1) {
zend_mm_dev_zero_fd = open("/dev/zero", O_RDWR, S_IRUSR | S_IWUSR);
return NULL;
}
}
+/* }}} */
-static void zend_mm_mem_mmap_zero_dtor(zend_mm_storage *storage)
+static void zend_mm_mem_mmap_zero_dtor(zend_mm_storage *storage) /* {{{ */
{
close(zend_mm_dev_zero_fd);
free(storage);
}
+/* }}} */
-static zend_mm_segment* zend_mm_mem_mmap_zero_alloc(zend_mm_storage *storage, size_t size)
+static zend_mm_segment* zend_mm_mem_mmap_zero_alloc(zend_mm_storage *storage, size_t size) /* {{{ */
{
zend_mm_segment *ret = (zend_mm_segment*)mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, zend_mm_dev_zero_fd, 0);
if (ret == MAP_FAILED) {
}
return ret;
}
+/* }}} */
# define ZEND_MM_MEM_MMAP_ZERO_DSC {"mmap_zero", zend_mm_mem_mmap_zero_init, zend_mm_mem_mmap_zero_dtor, zend_mm_mem_mmap_zero_alloc, zend_mm_mem_mmap_realloc, zend_mm_mem_mmap_free}
#ifdef HAVE_MEM_WIN32
-static zend_mm_storage* zend_mm_mem_win32_init(void *params)
+static zend_mm_storage* zend_mm_mem_win32_init(void *params) /* {{{ */
{
HANDLE heap = HeapCreate(HEAP_NO_SERIALIZE, 0, 0);
zend_mm_storage* storage;
storage->data = (void*) heap;
return storage;
}
+/* }}} */
-static void zend_mm_mem_win32_dtor(zend_mm_storage *storage)
+static void zend_mm_mem_win32_dtor(zend_mm_storage *storage) /* {{{ */
{
HeapDestroy((HANDLE)storage->data);
free(storage);
}
+/* }}} */
-static zend_mm_segment* zend_mm_mem_win32_alloc(zend_mm_storage *storage, size_t size)
+static zend_mm_segment* zend_mm_mem_win32_alloc(zend_mm_storage *storage, size_t size) /* {{{ */
{
return (zend_mm_segment*) HeapAlloc((HANDLE)storage->data, HEAP_NO_SERIALIZE, size);
}
+/* }}} */
-static void zend_mm_mem_win32_free(zend_mm_storage *storage, zend_mm_segment* segment)
+static void zend_mm_mem_win32_free(zend_mm_storage *storage, zend_mm_segment* segment) /* {{{ */
{
HeapFree((HANDLE)storage->data, HEAP_NO_SERIALIZE, segment);
}
+/* }}} */
-static zend_mm_segment* zend_mm_mem_win32_realloc(zend_mm_storage *storage, zend_mm_segment* segment, size_t size)
+static zend_mm_segment* zend_mm_mem_win32_realloc(zend_mm_storage *storage, zend_mm_segment* segment, size_t size) /* {{{ */
{
return (zend_mm_segment*) HeapReAlloc((HANDLE)storage->data, HEAP_NO_SERIALIZE, segment, size);
}
+/* }}} */
# define ZEND_MM_MEM_WIN32_DSC {"win32", zend_mm_mem_win32_init, zend_mm_mem_win32_dtor, zend_mm_mem_win32_alloc, zend_mm_mem_win32_realloc, zend_mm_mem_win32_free}
#ifdef HAVE_MEM_MALLOC
-static zend_mm_segment* zend_mm_mem_malloc_alloc(zend_mm_storage *storage, size_t size)
+static zend_mm_segment* zend_mm_mem_malloc_alloc(zend_mm_storage *storage, size_t size) /* {{{ */
{
return (zend_mm_segment*)malloc(size);
}
+/* }}} */
-static zend_mm_segment* zend_mm_mem_malloc_realloc(zend_mm_storage *storage, zend_mm_segment *ptr, size_t size)
+static zend_mm_segment* zend_mm_mem_malloc_realloc(zend_mm_storage *storage, zend_mm_segment *ptr, size_t size) /* {{{ */
{
return (zend_mm_segment*)realloc(ptr, size);
}
+/* }}} */
-static void zend_mm_mem_malloc_free(zend_mm_storage *storage, zend_mm_segment *ptr)
+static void zend_mm_mem_malloc_free(zend_mm_storage *storage, zend_mm_segment *ptr) /* {{{ */
{
free(ptr);
}
+/* }}} */
# define ZEND_MM_MEM_MALLOC_DSC {"malloc", zend_mm_mem_dummy_init, zend_mm_mem_dummy_dtor, zend_mm_mem_malloc_alloc, zend_mm_mem_malloc_realloc, zend_mm_mem_malloc_free}
static void _zend_mm_free_int(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
static void *_zend_mm_realloc_int(zend_mm_heap *heap, void *p, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
-static inline unsigned int zend_mm_high_bit(size_t _size)
+static inline unsigned int zend_mm_high_bit(size_t _size) /* {{{ */
{
#if defined(__GNUC__) && defined(i386)
unsigned int n;
return n-1;
#endif
}
+/* }}} */
-static inline unsigned int zend_mm_low_bit(size_t _size)
+static inline unsigned int zend_mm_low_bit(size_t _size) /* {{{ */
{
#if defined(__GNUC__) && defined(i386)
unsigned int n;
return index;
#endif
}
+/* }}} */
-static inline void zend_mm_add_to_rest_list(zend_mm_heap *heap, zend_mm_free_block *mm_block)
+static inline void zend_mm_add_to_rest_list(zend_mm_heap *heap, zend_mm_free_block *mm_block) /* {{{ */
{
zend_mm_free_block *prev, *next;
mm_block->next_free_block = next;
prev->next_free_block = next->prev_free_block = mm_block;
}
+/* }}} */
-static inline void zend_mm_add_to_free_list(zend_mm_heap *heap, zend_mm_free_block *mm_block)
+static inline void zend_mm_add_to_free_list(zend_mm_heap *heap, zend_mm_free_block *mm_block) /* {{{ */
{
size_t size;
size_t index;
prev->next_free_block = next->prev_free_block = mm_block;
}
}
+/* }}} */
-static inline void zend_mm_remove_from_free_list(zend_mm_heap *heap, zend_mm_free_block *mm_block)
+static inline void zend_mm_remove_from_free_list(zend_mm_heap *heap, zend_mm_free_block *mm_block) /* {{{ */
{
zend_mm_free_block *prev = mm_block->prev_free_block;
zend_mm_free_block *next = mm_block->next_free_block;
}
}
}
+/* }}} */
-static inline void zend_mm_init(zend_mm_heap *heap)
+static inline void zend_mm_init(zend_mm_heap *heap) /* {{{ */
{
zend_mm_free_block* p;
int i;
}
heap->rest_buckets[0] = heap->rest_buckets[1] = ZEND_MM_REST_BUCKET(heap);
}
+/* }}} */
-static void zend_mm_del_segment(zend_mm_heap *heap, zend_mm_segment *segment)
+static void zend_mm_del_segment(zend_mm_heap *heap, zend_mm_segment *segment) /* {{{ */
{
zend_mm_segment **p = &heap->segments_list;
heap->real_size -= segment->size;
ZEND_MM_STORAGE_FREE(segment);
}
+/* }}} */
#if ZEND_MM_CACHE
-static void zend_mm_free_cache(zend_mm_heap *heap)
+static void zend_mm_free_cache(zend_mm_heap *heap) /* {{{ */
{
int i;
}
}
}
+/* }}} */
#endif
#if ZEND_MM_HEAP_PROTECTION || ZEND_MM_COOKIES
-static void zend_mm_random(unsigned char *buf, size_t size)
+static void zend_mm_random(unsigned char *buf, size_t size) /* {{{ */
{
size_t i = 0;
unsigned char t;
t = buf[i++] << 1;
}
}
+/* }}} */
#endif
/* Notes:
* - This function may alter the block_sizes values to match platform alignment
* - This function does *not* perform sanity checks on the arguments
*/
-ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_mem_handlers *handlers, size_t block_size, size_t reserve_size, int internal, void *params)
+ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_mem_handlers *handlers, size_t block_size, size_t reserve_size, int internal, void *params) /* {{{ */
{
zend_mm_storage *storage;
zend_mm_heap *heap;
}
return heap;
}
+/* }}} */
-ZEND_API zend_mm_heap *zend_mm_startup(void)
+ZEND_API zend_mm_heap *zend_mm_startup(void) /* {{{ */
{
int i;
size_t seg_size;
return zend_mm_startup_ex(handlers, seg_size, ZEND_MM_RESERVE_SIZE, 0, NULL);
}
+/* }}} */
#if ZEND_DEBUG
-static long zend_mm_find_leaks(zend_mm_segment *segment, zend_mm_block *b)
+static long zend_mm_find_leaks(zend_mm_segment *segment, zend_mm_block *b) /* {{{ */
{
long leaks = 0;
zend_mm_block *p, *q;
}
return leaks;
}
+/* }}} */
-static void zend_mm_check_leaks(zend_mm_heap *heap)
+static void zend_mm_check_leaks(zend_mm_heap *heap) /* {{{ */
{
zend_mm_segment *segment = heap->segments_list;
zend_mm_block *p, *q;
zend_message_dispatcher(ZMSG_MEMORY_LEAKS_GRAND_TOTAL, &total);
}
}
+/* }}} */
-static int zend_mm_check_ptr(zend_mm_heap *heap, void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+static int zend_mm_check_ptr(zend_mm_heap *heap, void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{{ */
{
zend_mm_block *p;
int no_cache_notice = 0;
}
return ((!had_problems) ? 1 : 0);
}
+/* }}} */
-static int zend_mm_check_heap(zend_mm_heap *heap, int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+static int zend_mm_check_heap(zend_mm_heap *heap, int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{{ */
{
zend_mm_segment *segment = heap->segments_list;
zend_mm_block *p, *q;
p = q;
}
}
+/* }}} */
#endif
-ZEND_API void zend_mm_shutdown(zend_mm_heap *heap, int full_shutdown, int silent)
+ZEND_API void zend_mm_shutdown(zend_mm_heap *heap, int full_shutdown, int silent) /* {{{ */
{
zend_mm_storage *storage;
zend_mm_segment *segment;
heap->overflow = 0;
}
}
+/* }}} */
static void zend_mm_safe_error(zend_mm_heap *heap,
const char *format,
const char *filename,
uint lineno,
#endif
- size_t size)
+ size_t size) /* {{{ */
{
if (heap->reserve) {
_zend_mm_free_int(heap, heap->reserve ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC);
}
zend_bailout();
}
+/* }}} */
-static zend_mm_free_block *zend_mm_search_large_block(zend_mm_heap *heap, size_t true_size)
+static zend_mm_free_block *zend_mm_search_large_block(zend_mm_heap *heap, size_t true_size) /* {{{ */
{
zend_mm_free_block *best_fit;
size_t index = ZEND_MM_LARGE_BUCKET_INDEX(true_size);
}
return best_fit->next_free_block;
}
+/* }}} */
-static void *_zend_mm_alloc_int(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+static void *_zend_mm_alloc_int(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{{ */
{
zend_mm_free_block *best_fit;
size_t true_size = ZEND_MM_TRUE_SIZE(size);
return ZEND_MM_DATA_OF(best_fit);
}
+/* }}} */
-
-static void _zend_mm_free_int(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+static void _zend_mm_free_int(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{{ */
{
zend_mm_block *mm_block;
zend_mm_block *next_block;
}
HANDLE_UNBLOCK_INTERRUPTIONS();
}
+/* }}} */
-static void *_zend_mm_realloc_int(zend_mm_heap *heap, void *p, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+static void *_zend_mm_realloc_int(zend_mm_heap *heap, void *p, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{{ */
{
zend_mm_block *mm_block = ZEND_MM_HEADER_OF(p);
zend_mm_block *next_block;
_zend_mm_free_int(heap, p ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
return ptr;
}
+/* }}} */
-ZEND_API void *_zend_mm_alloc(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+ZEND_API void *_zend_mm_alloc(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{{ */
{
return _zend_mm_alloc_int(heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
+/* }}} */
-ZEND_API void _zend_mm_free(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+ZEND_API void _zend_mm_free(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{{ */
{
_zend_mm_free_int(heap, p ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
+/* }}} */
-ZEND_API void *_zend_mm_realloc(zend_mm_heap *heap, void *ptr, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+ZEND_API void *_zend_mm_realloc(zend_mm_heap *heap, void *ptr, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{{ */
{
return _zend_mm_realloc_int(heap, ptr, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
+/* }}} */
-ZEND_API size_t _zend_mm_block_size(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+ZEND_API size_t _zend_mm_block_size(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{{ */
{
zend_mm_block *mm_block;
return ZEND_MM_BLOCK_SIZE(mm_block);
#endif
}
+/* }}} */
/**********************/
/* Allocation Manager */
static zend_alloc_globals alloc_globals;
#endif
-ZEND_API int is_zend_mm(TSRMLS_D)
+ZEND_API int is_zend_mm(TSRMLS_D) /* {{{ */
{
return AG(mm_heap)->use_zend_alloc;
}
+/* }}} */
-ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{{ */
{
TSRMLS_FETCH();
}
return _zend_mm_alloc_int(AG(mm_heap), size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
+/* }}} */
-ZEND_API void _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+ZEND_API void _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{{ */
{
TSRMLS_FETCH();
}
_zend_mm_free_int(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
+/* }}} */
-ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{{ */
{
TSRMLS_FETCH();
}
return _zend_mm_realloc_int(AG(mm_heap), ptr, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
+/* }}} */
-ZEND_API size_t _zend_mem_block_size(void *ptr TSRMLS_DC ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+ZEND_API size_t _zend_mem_block_size(void *ptr TSRMLS_DC ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{{ */
{
if (UNEXPECTED(!AG(mm_heap)->use_zend_alloc)) {
return 0;
}
return _zend_mm_block_size(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
+/* }}} */
#if defined(__GNUC__) && defined(i386)
-static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
+static inline size_t safe_address(size_t nmemb, size_t size, size_t offset) /* {{{ */
{
size_t res = nmemb;
unsigned long overflow ;
}
return res;
}
+/* }}} */
#else
-static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
+static inline size_t safe_address(size_t nmemb, size_t size, size_t offset) /* {{{ */
{
size_t res = nmemb * size + offset;
double _d = (double)nmemb * (double)size + (double)offset;
}
return res;
}
+/* }}} */
#endif
-
-ZEND_API void *_safe_emalloc(size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+ZEND_API void *_safe_emalloc(size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{{ */
{
return emalloc_rel(safe_address(nmemb, size, offset));
}
+/* }}} */
-ZEND_API void *_safe_malloc(size_t nmemb, size_t size, size_t offset)
+ZEND_API void *_safe_malloc(size_t nmemb, size_t size, size_t offset) /* {{{ */
{
return pemalloc(safe_address(nmemb, size, offset), 1);
}
+/* }}} */
-ZEND_API void *_safe_erealloc(void *ptr, size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+ZEND_API void *_safe_erealloc(void *ptr, size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{{ */
{
return erealloc_rel(ptr, safe_address(nmemb, size, offset));
}
+/* }}} */
-ZEND_API void *_safe_realloc(void *ptr, size_t nmemb, size_t size, size_t offset)
+ZEND_API void *_safe_realloc(void *ptr, size_t nmemb, size_t size, size_t offset) /* {{{ */
{
return perealloc(ptr, safe_address(nmemb, size, offset), 1);
}
+/* }}} */
-
-ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{{ */
{
void *p;
memset(p, 0, size * nmemb);
return p;
}
+/* }}} */
-ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{{ */
{
int length;
char *p;
memcpy(p, s, length);
return p;
}
+/* }}} */
-ZEND_API UChar *_eustrdup(const UChar *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+ZEND_API UChar *_eustrdup(const UChar *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{{ */
{
int length;
UChar *p;
u_memcpy(p, s, length);
return p;
}
+/* }}} */
-ZEND_API char *_estrndup(const char *s, uint length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+ZEND_API char *_estrndup(const char *s, uint length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{{ */
{
char *p;
p[length] = 0;
return p;
}
+/* }}} */
-ZEND_API UChar *_eustrndup(const UChar *s, int length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+ZEND_API UChar *_eustrndup(const UChar *s, int length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{{ */
{
UChar *p;
p[length] = 0;
return p;
}
+/* }}} */
-ZEND_API zstr _ezstrndup(int type, const zstr s, uint length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+ZEND_API zstr _ezstrndup(int type, const zstr s, uint length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{{ */
{
if (type == IS_STRING) {
return ZSTR(_estrndup(s.s, length ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC));
return ZSTR(_eustrndup(s.u, length ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC));
}
}
+/* }}} */
-
-ZEND_API char *zend_strndup(const char *s, uint length)
+ZEND_API char *zend_strndup(const char *s, uint length) /* {{{ */
{
char *p;
p[length] = 0;
return p;
}
+/* }}} */
-ZEND_API UChar *zend_ustrdup(const UChar *s)
+ZEND_API UChar *zend_ustrdup(const UChar *s) /* {{{ */
{
UChar *p;
uint length;
p[length] = 0;
return p;
}
+/* }}} */
-ZEND_API UChar *zend_ustrndup(const UChar *s, uint length)
+ZEND_API UChar *zend_ustrndup(const UChar *s, uint length) /* {{{ */
{
UChar *p;
p[length] = 0;
return p;
}
+/* }}} */
-ZEND_API zstr zend_zstrndup(int type, const zstr s, uint length)
+ZEND_API zstr zend_zstrndup(int type, const zstr s, uint length) /* {{{ */
{
if (type == IS_STRING) {
return ZSTR(zend_strndup(s.s, length));
return ZSTR(zend_ustrndup(s.u, length));
}
}
+/* }}} */
-ZEND_API int zend_set_memory_limit(size_t memory_limit)
+ZEND_API int zend_set_memory_limit(size_t memory_limit) /* {{{ */
{
TSRMLS_FETCH();
return SUCCESS;
}
+/* }}} */
-ZEND_API size_t zend_memory_usage(int real_usage TSRMLS_DC)
+ZEND_API size_t zend_memory_usage(int real_usage TSRMLS_DC) /* {{{ */
{
if (real_usage) {
return AG(mm_heap)->real_size;
return AG(mm_heap)->size;
}
}
+/* }}} */
-ZEND_API size_t zend_memory_peak_usage(int real_usage TSRMLS_DC)
+ZEND_API size_t zend_memory_peak_usage(int real_usage TSRMLS_DC) /* {{{ */
{
if (real_usage) {
return AG(mm_heap)->real_peak;
return AG(mm_heap)->peak;
}
}
+/* }}} */
-
-ZEND_API void shutdown_memory_manager(int silent, int full_shutdown TSRMLS_DC)
+ZEND_API void shutdown_memory_manager(int silent, int full_shutdown TSRMLS_DC) /* {{{ */
{
zend_mm_shutdown(AG(mm_heap), full_shutdown, silent);
}
+/* }}} */
-static void alloc_globals_ctor(zend_alloc_globals *alloc_globals TSRMLS_DC)
+static void alloc_globals_ctor(zend_alloc_globals *alloc_globals TSRMLS_DC) /* {{{ */
{
char *tmp;
alloc_globals->mm_heap = zend_mm_startup();
alloc_globals->mm_heap->use_zend_alloc = zend_atoi(tmp, 0);
}
}
+/* }}} */
#ifdef ZTS
-static void alloc_globals_dtor(zend_alloc_globals *alloc_globals TSRMLS_DC)
+static void alloc_globals_dtor(zend_alloc_globals *alloc_globals TSRMLS_DC) /* {{{ */
{
shutdown_memory_manager(1, 1 TSRMLS_CC);
}
+/* }}} */
#endif
-ZEND_API void start_memory_manager(TSRMLS_D)
+ZEND_API void start_memory_manager(TSRMLS_D) /* {{{ */
{
#ifdef ZTS
ts_allocate_id(&alloc_globals_id, sizeof(zend_alloc_globals), (ts_allocate_ctor) alloc_globals_ctor, (ts_allocate_dtor) alloc_globals_dtor);
alloc_globals_ctor(&alloc_globals);
#endif
}
+/* }}} */
-ZEND_API zend_mm_heap *zend_mm_set_heap(zend_mm_heap *new_heap TSRMLS_DC)
+ZEND_API zend_mm_heap *zend_mm_set_heap(zend_mm_heap *new_heap TSRMLS_DC) /* {{{ */
{
zend_mm_heap *old_heap;
AG(mm_heap) = new_heap;
return old_heap;
}
+/* }}} */
-ZEND_API zend_mm_storage *zend_mm_get_storage(zend_mm_heap *heap)
+ZEND_API zend_mm_storage *zend_mm_get_storage(zend_mm_heap *heap) /* {{{ */
{
return heap->storage;
}
+/* }}} */
#if ZEND_DEBUG
-ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{{ */
{
TSRMLS_FETCH();
}
return zend_mm_check_ptr(AG(mm_heap), ptr, silent ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
+/* }}} */
-
-ZEND_API void _full_mem_check(int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+ZEND_API void _full_mem_check(int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{{ */
{
int errors;
TSRMLS_FETCH();
zend_debug_alloc_output("End of full memory check %s:%d (%d errors)\n" ZEND_FILE_LINE_RELAY_CC, errors);
zend_debug_alloc_output("------------------------------------------------\n");
}
+/* }}} */
#endif
/*