diff options
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r-- | Zend/zend_API.c | 262 |
1 files changed, 131 insertions, 131 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 21039ecca6..171df36ac2 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -5,7 +5,7 @@ | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | + | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.zend.com/license/2_00.txt. | | If you did not receive a copy of the Zend license and are unable to | @@ -159,7 +159,7 @@ ZEND_API int _zend_get_parameters_array_ex(int param_count, zval ***argument_arr char *class_name; zend_uint class_name_len; int dup; - + dup = zend_get_object_classname(*value, &class_name, &class_name_len TSRMLS_CC); ALLOC_ZVAL(value_ptr); @@ -196,7 +196,7 @@ ZEND_API int zend_copy_parameters_array(int param_count, zval *argument_array TS while (param_count-->0) { zval **param = (zval **) p-(arg_count--); zval_add_ref(param); - add_next_index_zval(argument_array, *param); + add_next_index_zval(argument_array, *param); } return SUCCESS; @@ -207,7 +207,7 @@ ZEND_API void zend_wrong_param_count(TSRMLS_D) { char *space; char *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)); } @@ -265,7 +265,7 @@ ZEND_API int zend_get_object_classname(zval *object, char **class_name, zend_uin 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) { zend_class_entry *ce = Z_OBJCE_P(object); - + *class_name = ce->name; *class_name_len = ce->name_length; return 1; @@ -276,7 +276,7 @@ ZEND_API int zend_get_object_classname(zval *object, char **class_name, zend_uin #define RETURN_AS_STRING(arg, p, pl, type) \ *(char**)p = Z_STRVAL_PP(arg); \ *pl = Z_STRLEN_PP(arg); \ - *type = IS_STRING; + *type = IS_STRING; #define RETURN_AS_UNICODE(arg, p, pl, type) \ *(UChar**)p = Z_USTRVAL_PP(arg); \ @@ -428,7 +428,7 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **sp } } } - + case IS_ARRAY: case IS_RESOURCE: default: @@ -472,7 +472,7 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **sp } } } - + case IS_ARRAY: case IS_RESOURCE: default: @@ -531,7 +531,7 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **sp } } } - + case IS_ARRAY: case IS_RESOURCE: default: @@ -593,7 +593,7 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **sp } } } - + case IS_ARRAY: case IS_RESOURCE: default: @@ -722,7 +722,7 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **sp char *space; char *class_name = get_active_class_name(&space TSRMLS_CC); zend_error(E_WARNING, "%v%s%v() expects parameter %d to be a class name derived from %v, '%v' given", - class_name, space, get_active_function_name(TSRMLS_C), + class_name, space, get_active_function_name(TSRMLS_C), arg_num, ce_base->name, Z_STRVAL_PP(arg)); *pce = NULL; return ""; @@ -732,12 +732,12 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **sp char *space; char *class_name = get_active_class_name(&space TSRMLS_CC); zend_error(E_WARNING, "%v%s%v() expects parameter %d to be a valid class name, '%v' given", - class_name, space, get_active_function_name(TSRMLS_C), + class_name, space, get_active_function_name(TSRMLS_C), arg_num, Z_STRVAL_PP(arg)); return ""; } break; - + } break; @@ -786,7 +786,7 @@ static int zend_parse_arg(int arg_num, zval **arg, va_list *va, char **spec, int } return FAILURE; } - + return SUCCESS; } @@ -833,7 +833,7 @@ static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int fl if (!quiet) { char *space; char *class_name = get_active_class_name(&space TSRMLS_CC); - zend_error(E_WARNING, "%v%s%v(): bad type specifier while parsing parameters", + zend_error(E_WARNING, "%v%s%v(): bad type specifier while parsing parameters", class_name, space, get_active_function_name(TSRMLS_C)); } @@ -883,7 +883,7 @@ static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int fl } i++; break; - + case '|': case '!': case '/': /* pass */ @@ -915,7 +915,7 @@ ZEND_API int zend_parse_parameters_ex(int flags, int num_args TSRMLS_DC, char *t { va_list va; int retval; - + va_start(va, type_spec); retval = zend_parse_va_args(num_args, type_spec, &va, flags TSRMLS_CC); va_end(va); @@ -927,7 +927,7 @@ ZEND_API int zend_parse_parameters(int num_args TSRMLS_DC, char *type_spec, ...) { va_list va; int retval; - + va_start(va, type_spec); retval = zend_parse_va_args(num_args, type_spec, &va, 0 TSRMLS_CC); va_end(va); @@ -1039,7 +1039,7 @@ static int zend_merge_property(zval **value, int num_args, va_list args, zend_ha } -/* This function should be called after the constructor has been called +/* 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) { @@ -1107,7 +1107,7 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC zend_u_hash_add(CE_STATIC_MEMBERS(class_type), utype, str_index, str_length, (void**)q, sizeof(zval*), NULL); } else { zval *q; - + ALLOC_ZVAL(q); *q = **p; INIT_PZVAL(q); @@ -1118,7 +1118,7 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC } } zend_hash_apply_with_argument(CE_STATIC_MEMBERS(class_type), (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC); - + *scope = old_scope; class_type->constants_updated = 1; } @@ -1126,7 +1126,7 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC /* 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 + * 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) @@ -1140,7 +1140,7 @@ ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type } zend_update_class_constants(class_type TSRMLS_CC); - + Z_TYPE_P(arg) = IS_OBJECT; if (class_type->create_object == NULL) { Z_OBJVAL_P(arg) = zend_objects_new(&object, class_type TSRMLS_CC); @@ -1181,24 +1181,24 @@ ZEND_API int add_assoc_long_ex(zval *arg, char *key, uint key_len, long n) MAKE_STD_ZVAL(tmp); ZVAL_LONG(tmp, n); - + return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); } ZEND_API int add_assoc_null_ex(zval *arg, char *key, uint key_len) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_NULL(tmp); - + return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); } ZEND_API int add_assoc_bool_ex(zval *arg, char *key, uint key_len, int b) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_BOOL(tmp, b); @@ -1208,10 +1208,10 @@ 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) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_RESOURCE(tmp, r); - + return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); } @@ -1219,7 +1219,7 @@ 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) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_DOUBLE(tmp, d); @@ -1230,7 +1230,7 @@ ZEND_API int add_assoc_double_ex(zval *arg, char *key, uint key_len, double d) ZEND_API int add_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, int duplicate) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_STRING(tmp, str, duplicate); @@ -1241,7 +1241,7 @@ ZEND_API int add_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, ZEND_API int add_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_STRINGL(tmp, str, length, duplicate); @@ -1251,7 +1251,7 @@ ZEND_API int add_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str, ZEND_API int add_assoc_unicode_ex(zval *arg, char *key, uint key_len, void *str, int duplicate) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_UNICODE(tmp, str, duplicate); @@ -1262,7 +1262,7 @@ ZEND_API int add_assoc_unicode_ex(zval *arg, char *key, uint key_len, void *str, ZEND_API int add_assoc_unicodel_ex(zval *arg, char *key, uint key_len, void *str, uint length, int duplicate) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_UNICODEL(tmp, str, length, duplicate); @@ -1303,10 +1303,10 @@ ZEND_API int add_index_null(zval *arg, ulong index) ZEND_API int add_index_bool(zval *arg, ulong index, int b) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_BOOL(tmp, b); - + return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); } @@ -1314,10 +1314,10 @@ ZEND_API int add_index_bool(zval *arg, ulong index, int b) ZEND_API int add_index_resource(zval *arg, ulong index, int r) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_RESOURCE(tmp, r); - + return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); } @@ -1325,10 +1325,10 @@ ZEND_API int add_index_resource(zval *arg, ulong index, int r) ZEND_API int add_index_double(zval *arg, ulong index, double d) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_DOUBLE(tmp, d); - + return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); } @@ -1336,7 +1336,7 @@ ZEND_API int add_index_double(zval *arg, ulong index, double d) ZEND_API int add_index_string(zval *arg, ulong index, char *str, int duplicate) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_STRING(tmp, str, duplicate); @@ -1347,10 +1347,10 @@ ZEND_API int add_index_string(zval *arg, ulong index, char *str, int duplicate) ZEND_API int add_index_stringl(zval *arg, ulong index, char *str, uint length, int duplicate) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_STRINGL(tmp, str, length, duplicate); - + return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); } @@ -1358,7 +1358,7 @@ ZEND_API int add_index_stringl(zval *arg, ulong index, char *str, uint length, i ZEND_API int add_index_unicode(zval *arg, ulong index, UChar *str, int duplicate) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_UNICODE(tmp, str, duplicate); @@ -1369,10 +1369,10 @@ ZEND_API int add_index_unicode(zval *arg, ulong index, UChar *str, int duplicate ZEND_API int add_index_unicodel(zval *arg, ulong index, UChar *str, uint length, int duplicate) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_UNICODEL(tmp, str, length, duplicate); - + return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); } @@ -1386,10 +1386,10 @@ ZEND_API int add_index_zval(zval *arg, ulong index, zval *value) ZEND_API int add_next_index_long(zval *arg, long n) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_LONG(tmp, n); - + return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); } @@ -1397,10 +1397,10 @@ ZEND_API int add_next_index_long(zval *arg, long n) ZEND_API int add_next_index_null(zval *arg) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_NULL(tmp); - + return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); } @@ -1408,10 +1408,10 @@ ZEND_API int add_next_index_null(zval *arg) ZEND_API int add_next_index_bool(zval *arg, int b) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_BOOL(tmp, b); - + return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); } @@ -1419,10 +1419,10 @@ ZEND_API int add_next_index_bool(zval *arg, int b) ZEND_API int add_next_index_resource(zval *arg, int r) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_RESOURCE(tmp, r); - + return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); } @@ -1430,10 +1430,10 @@ ZEND_API int add_next_index_resource(zval *arg, int r) ZEND_API int add_next_index_double(zval *arg, double d) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_DOUBLE(tmp, d); - + return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); } @@ -1491,10 +1491,10 @@ ZEND_API int add_next_index_zval(zval *arg, zval *value) ZEND_API int add_get_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, void **dest, int duplicate) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_STRING(tmp, str, duplicate); - + return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), dest); } @@ -1502,7 +1502,7 @@ ZEND_API int add_get_assoc_string_ex(zval *arg, char *key, uint key_len, char *s 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; - + MAKE_STD_ZVAL(tmp); ZVAL_STRINGL(tmp, str, length, duplicate); @@ -1513,10 +1513,10 @@ ZEND_API int add_get_assoc_stringl_ex(zval *arg, char *key, uint key_len, char * ZEND_API int add_get_index_long(zval *arg, ulong index, long l, void **dest) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_LONG(tmp, l); - + return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest); } @@ -1524,10 +1524,10 @@ ZEND_API int add_get_index_long(zval *arg, ulong index, long l, void **dest) ZEND_API int add_get_index_double(zval *arg, ulong index, double d, void **dest) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_DOUBLE(tmp, d); - + return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest); } @@ -1535,10 +1535,10 @@ ZEND_API int add_get_index_double(zval *arg, ulong index, double d, void **dest) ZEND_API int add_get_index_string(zval *arg, ulong index, char *str, void **dest, int duplicate) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_STRING(tmp, str, duplicate); - + return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest); } @@ -1546,20 +1546,20 @@ ZEND_API int add_get_index_string(zval *arg, ulong index, char *str, void **dest ZEND_API int add_get_index_stringl(zval *arg, ulong index, char *str, uint length, void **dest, int duplicate) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_STRINGL(tmp, str, length, duplicate); - + 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) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_UNICODE(tmp, str, duplicate); - + return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest); } @@ -1567,10 +1567,10 @@ ZEND_API int add_get_index_unicode(zval *arg, ulong index, UChar *str, void **de ZEND_API int add_get_index_unicodel(zval *arg, ulong index, UChar *str, uint length, void **dest, int duplicate) { zval *tmp; - + MAKE_STD_ZVAL(tmp); ZVAL_UNICODEL(tmp, str, length, duplicate); - + return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest); } @@ -1581,7 +1581,7 @@ ZEND_API int add_property_long_ex(zval *arg, char *key, uint key_len, long n TSR MAKE_STD_ZVAL(tmp); ZVAL_LONG(tmp, n); - + MAKE_STD_ZVAL(z_key); ZVAL_ASCII_STRINGL(z_key, key, key_len-1, 1); @@ -1612,10 +1612,10 @@ ZEND_API int add_property_null_ex(zval *arg, char *key, uint key_len TSRMLS_DC) { zval *tmp; zval *z_key; - + MAKE_STD_ZVAL(tmp); ZVAL_NULL(tmp); - + MAKE_STD_ZVAL(z_key); ZVAL_ASCII_STRINGL(z_key, key, key_len-1, 1); @@ -1629,7 +1629,7 @@ ZEND_API int add_property_resource_ex(zval *arg, char *key, uint key_len, long n { zval *tmp; zval *z_key; - + MAKE_STD_ZVAL(tmp); ZVAL_RESOURCE(tmp, n); @@ -1650,7 +1650,7 @@ ZEND_API int add_property_double_ex(zval *arg, char *key, uint key_len, double d MAKE_STD_ZVAL(tmp); ZVAL_DOUBLE(tmp, d); - + MAKE_STD_ZVAL(z_key); ZVAL_ASCII_STRINGL(z_key, key, key_len-1, 1); @@ -1837,7 +1837,7 @@ ZEND_API int zend_startup_module_ex(zend_module_entry *module TSRMLS_DC) zend_error(E_CORE_WARNING, "Cannot load module '%s' because required module '%s' is not loaded", module->name, dep->name); module->module_started = 0; return FAILURE; - } + } efree(lcname); } ++dep; @@ -1861,7 +1861,7 @@ static void zend_sort_modules(void *base, size_t count, size_t siz, compare_func Bucket **b1 = base; Bucket **b2; Bucket **end = b1 + count; - Bucket *tmp; + Bucket *tmp; zend_module_entry *m, *r; while (b1 < end) { @@ -1877,14 +1877,14 @@ try_again: if (strcasecmp(dep->name, r->name) == 0) { tmp = *b1; *b1 = *b2; - *b2 = tmp; + *b2 = tmp; goto try_again; } b2++; } } dep++; - } + } } b1++; } @@ -1902,7 +1902,7 @@ ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TS int name_len; char *lcname; zend_module_entry *module_ptr; - + if (!module) { return NULL; } @@ -1925,7 +1925,7 @@ ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TS /* TODO: Check version relationship */ zend_error(E_CORE_WARNING, "Cannot load module '%s' because conflicting module '%s' is already loaded", module->name, dep->name); return NULL; - } + } efree(lcname); } ++dep; @@ -1968,7 +1968,7 @@ ZEND_API void zend_check_magic_method_implementation(zend_class_entry *ce, zend_ int name_len; zend_uchar utype = UG(unicode)?IS_UNICODE:IS_STRING; - /* we don't care if the function name is longer, in fact lowercasing only + /* we don't care if the function name is longer, in fact lowercasing only * the beginning of the name speeds up the check process */ if (UG(unicode)) { name_len = u_strlen((UChar*)fptr->common.function_name); @@ -1977,7 +1977,7 @@ ZEND_API void zend_check_magic_method_implementation(zend_class_entry *ce, zend_ } lcname = zend_u_str_case_fold(utype, fptr->common.function_name, name_len, 0, &lcname_len); - if (lcname_len == sizeof(ZEND_DESTRUCTOR_FUNC_NAME) - 1 && + if (lcname_len == sizeof(ZEND_DESTRUCTOR_FUNC_NAME) - 1 && ZEND_U_EQUAL(utype, lcname, lcname_len, ZEND_DESTRUCTOR_FUNC_NAME, sizeof(ZEND_DESTRUCTOR_FUNC_NAME)-1) && fptr->common.num_args != 0) { zend_error(error_type, "Destuctor %v::%s() cannot take arguments", ce->name, ZEND_DESTRUCTOR_FUNC_NAME); } else if (lcname_len == sizeof(ZEND_CLONE_FUNC_NAME) - 1 && @@ -2231,7 +2231,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr return SUCCESS; } -/* count=-1 means erase all functions, otherwise, +/* 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) @@ -2260,7 +2260,7 @@ ZEND_API void zend_unregister_functions(zend_function_entry *functions, int coun ZEND_API int zend_startup_module(zend_module_entry *module) { TSRMLS_FETCH(); - + if ((module = zend_register_internal_module(module TSRMLS_CC)) != NULL && zend_startup_module_ex(module TSRMLS_CC) == SUCCESS) { return SUCCESS; @@ -2272,7 +2272,7 @@ ZEND_API int zend_startup_module(zend_module_entry *module) 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; } @@ -2410,7 +2410,7 @@ ZEND_API void zend_class_implements(zend_class_entry *class_entry TSRMLS_DC, int } else { class_entry->interfaces = erealloc(class_entry->interfaces, sizeof(zend_class_entry*) * (class_entry->num_interfaces+num_interfaces)); } - + while (num_interfaces--) { interface_entry = va_arg(interface_list, zend_class_entry *); class_entry->interfaces[class_entry->num_interfaces++] = interface_entry; @@ -2499,7 +2499,7 @@ ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_ { zend_class_entry *disabled_class; disabled_class = (zend_class_entry *) emalloc(sizeof(zend_class_entry)); - + zend_str_tolower(class_name, class_name_length); if (zend_hash_del(CG(class_table), class_name, class_name_length+1)==FAILURE) { return FAILURE; @@ -2518,7 +2518,7 @@ static int zend_is_callable_check_func(int check_flags, zval ***zobj_ptr_ptr, ze zend_function *fptr; zend_class_entry **pce; HashTable *ftable; - + *ce_ptr = NULL; *fptr_ptr = NULL; @@ -2632,7 +2632,7 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, uint check_flags, zval *c if (check_flags & IS_CALLABLE_CHECK_SYNTAX_ONLY) { return 1; } - + return zend_is_callable_check_func(check_flags|IS_CALLABLE_CHECK_IS_STATIC, zobj_ptr_ptr, NULL, callable, ce_ptr, fptr_ptr TSRMLS_CC); case IS_ARRAY: @@ -2640,7 +2640,7 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, uint check_flags, zval *c zend_class_entry *ce = NULL; zval **method; zval **obj; - + if (zend_hash_num_elements(Z_ARRVAL_P(callable)) == 2 && zend_hash_index_find(Z_ARRVAL_P(callable), 0, (void **) &obj) == SUCCESS && zend_hash_index_find(Z_ARRVAL_P(callable), 1, (void **) &method) == SUCCESS && @@ -2727,7 +2727,7 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, uint check_flags, zval *c efree(lcname); } else { ce = Z_OBJCE_PP(obj); /* TBFixed: what if it's overloaded? */ - + *zobj_ptr_ptr = obj; if (callable_name) { @@ -2816,7 +2816,7 @@ ZEND_API zend_bool zend_make_callable(zval *callable, zval *callable_name TSRMLS switch (Z_TYPE_P(callable)) { case IS_STRING: lcname = zend_str_tolower_dup(Z_STRVAL_P(callable), Z_STRLEN_P(callable)); - + if ((func = strstr(lcname, "::")) != NULL) { *func = '\0'; class_name_len = func - lcname; @@ -2827,7 +2827,7 @@ ZEND_API zend_bool zend_make_callable(zval *callable, zval *callable_name TSRMLS add_next_index_stringl(callable, lcname, class_name_len, 1); func += 2; add_next_index_stringl(callable, func, strlen(func), 1); - retval = 1; + retval = 1; } efree(class_name); } @@ -2905,8 +2905,8 @@ ZEND_API int zend_u_declare_property_ex(zend_class_entry *ce, zend_uchar type, v pefree(prot_name, ce->type & ZEND_INTERNAL_CLASS); } zend_u_hash_update(target_symbol_table, type, name, name_length+1, &property, sizeof(zval *), NULL); - property_info.name = ce->type & ZEND_INTERNAL_CLASS ? - (type==IS_UNICODE?(char*)zend_ustrndup(name, name_length):zend_strndup(name, name_length)) : + property_info.name = ce->type & ZEND_INTERNAL_CLASS ? + (type==IS_UNICODE?(char*)zend_ustrndup(name, name_length):zend_strndup(name, name_length)) : (type==IS_UNICODE?(char*)eustrndup(name, name_length):estrndup(name, name_length)); property_info.name_length = name_length; break; @@ -2916,7 +2916,7 @@ ZEND_API int zend_u_declare_property_ex(zend_class_entry *ce, zend_uchar type, v property_info.doc_comment = doc_comment; property_info.doc_comment_len = doc_comment_len; - + zend_u_hash_update(&ce->properties_info, type, name, name_length + 1, &property_info, sizeof(zend_property_info), NULL); return SUCCESS; @@ -2940,7 +2940,7 @@ ZEND_API int zend_declare_property(zend_class_entry *ce, char *name, int name_le ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int name_length, int access_type TSRMLS_DC) { zval *property; - + if (ce->type & ZEND_INTERNAL_CLASS) { property = malloc(sizeof(zval)); } else { @@ -2953,7 +2953,7 @@ ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int na 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; - + if (ce->type & ZEND_INTERNAL_CLASS) { property = malloc(sizeof(zval)); } else { @@ -2967,7 +2967,7 @@ ZEND_API int zend_declare_property_bool(zend_class_entry *ce, char *name, int na 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; - + if (ce->type & ZEND_INTERNAL_CLASS) { property = malloc(sizeof(zval)); } else { @@ -2981,7 +2981,7 @@ ZEND_API int zend_declare_property_long(zend_class_entry *ce, char *name, int na 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; - + if (ce->type & ZEND_INTERNAL_CLASS) { property = malloc(sizeof(zval)); } else { @@ -2996,7 +2996,7 @@ ZEND_API int zend_declare_property_string(zend_class_entry *ce, char *name, int { zval *property; int len = strlen(value); - + if (ce->type & ZEND_INTERNAL_CLASS) { property = malloc(sizeof(zval)); ZVAL_STRINGL(property, zend_strndup(value, len), len, 0); @@ -3011,7 +3011,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) { zval *property; - + if (ce->type & ZEND_INTERNAL_CLASS) { property = malloc(sizeof(zval)); ZVAL_STRINGL(property, zend_strndup(value, value_len), value_len, 0); @@ -3094,7 +3094,7 @@ ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, char * { zval *property; zend_class_entry *old_scope = EG(scope); - + EG(scope) = scope; if (!Z_OBJ_HT_P(object)->write_property) { @@ -3102,7 +3102,7 @@ ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, char * zend_uint class_name_len; zend_get_object_classname(object, &class_name, &class_name_len TSRMLS_CC); - + zend_error(E_CORE_ERROR, "Property %s of class %v cannot be updated", name, class_name); } MAKE_STD_ZVAL(property); @@ -3127,7 +3127,7 @@ ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, c ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC) { zval *tmp; - + ALLOC_ZVAL(tmp); tmp->is_ref = 0; tmp->refcount = 0; @@ -3138,7 +3138,7 @@ ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, c ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC) { zval *tmp; - + ALLOC_ZVAL(tmp); tmp->is_ref = 0; tmp->refcount = 0; @@ -3149,7 +3149,7 @@ ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, c ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object, char *name, int name_length, double value TSRMLS_DC) { zval *tmp; - + ALLOC_ZVAL(tmp); tmp->is_ref = 0; tmp->refcount = 0; @@ -3160,7 +3160,7 @@ ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object, ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, char *name, int name_length, char *value TSRMLS_DC) { zval *tmp; - + ALLOC_ZVAL(tmp); tmp->is_ref = 0; tmp->refcount = 0; @@ -3171,7 +3171,7 @@ ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, 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; - + ALLOC_ZVAL(tmp); tmp->is_ref = 0; tmp->refcount = 0; @@ -3182,7 +3182,7 @@ ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object 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; - + ALLOC_ZVAL(tmp); tmp->is_ref = 0; tmp->refcount = 0; @@ -3193,7 +3193,7 @@ ZEND_API void zend_update_property_ascii_string(zend_class_entry *scope, zval *o 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; - + ALLOC_ZVAL(tmp); tmp->is_ref = 0; tmp->refcount = 0; @@ -3204,7 +3204,7 @@ ZEND_API void zend_update_property_ascii_stringl(zend_class_entry *scope, zval * 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; - + ALLOC_ZVAL(tmp); tmp->is_ref = 0; tmp->refcount = 0; @@ -3215,7 +3215,7 @@ ZEND_API void zend_update_property_rt_string(zend_class_entry *scope, zval *obje 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; - + ALLOC_ZVAL(tmp); tmp->is_ref = 0; tmp->refcount = 0; @@ -3226,7 +3226,7 @@ ZEND_API void zend_update_property_rt_stringl(zend_class_entry *scope, zval *obj ZEND_API void zend_update_property_unicode(zend_class_entry *scope, zval *object, char *name, int name_length, UChar *value TSRMLS_DC) { zval *tmp; - + ALLOC_ZVAL(tmp); tmp->is_ref = 0; tmp->refcount = 0; @@ -3237,7 +3237,7 @@ ZEND_API void zend_update_property_unicode(zend_class_entry *scope, zval *object 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; - + ALLOC_ZVAL(tmp); tmp->is_ref = 0; tmp->refcount = 0; @@ -3249,7 +3249,7 @@ ZEND_API int zend_update_static_property(zend_class_entry *scope, char *name, in { zval **property; zend_class_entry *old_scope = EG(scope); - + EG(scope) = scope; property = zend_std_get_static_property(scope, IS_STRING, name, name_length, 0 TSRMLS_CC); EG(scope) = old_scope; @@ -3293,7 +3293,7 @@ ZEND_API int zend_update_static_property_null(zend_class_entry *scope, char *nam ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, char *name, int name_length, long value TSRMLS_DC) { zval *tmp; - + ALLOC_ZVAL(tmp); tmp->is_ref = 0; tmp->refcount = 0; @@ -3304,7 +3304,7 @@ ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, char *nam ZEND_API int zend_update_static_property_long(zend_class_entry *scope, char *name, int name_length, long value TSRMLS_DC) { zval *tmp; - + ALLOC_ZVAL(tmp); tmp->is_ref = 0; tmp->refcount = 0; @@ -3315,7 +3315,7 @@ ZEND_API int zend_update_static_property_long(zend_class_entry *scope, char *nam ZEND_API int zend_update_static_property_double(zend_class_entry *scope, char *name, int name_length, double value TSRMLS_DC) { zval *tmp; - + ALLOC_ZVAL(tmp); tmp->is_ref = 0; tmp->refcount = 0; @@ -3326,7 +3326,7 @@ ZEND_API int zend_update_static_property_double(zend_class_entry *scope, char *n ZEND_API int zend_update_static_property_string(zend_class_entry *scope, char *name, int name_length, char *value TSRMLS_DC) { zval *tmp; - + ALLOC_ZVAL(tmp); tmp->is_ref = 0; tmp->refcount = 0; @@ -3337,7 +3337,7 @@ ZEND_API int zend_update_static_property_string(zend_class_entry *scope, char *n 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; - + ALLOC_ZVAL(tmp); tmp->is_ref = 0; tmp->refcount = 0; @@ -3348,7 +3348,7 @@ ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, char * ZEND_API int zend_update_static_property_ascii_string(zend_class_entry *scope, char *name, int name_length, char *value TSRMLS_DC) { zval *tmp; - + ALLOC_ZVAL(tmp); tmp->is_ref = 0; tmp->refcount = 0; @@ -3359,7 +3359,7 @@ ZEND_API int zend_update_static_property_ascii_string(zend_class_entry *scope, c 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; - + ALLOC_ZVAL(tmp); tmp->is_ref = 0; tmp->refcount = 0; @@ -3370,7 +3370,7 @@ ZEND_API int zend_update_static_property_ascii_stringl(zend_class_entry *scope, ZEND_API int zend_update_static_property_rt_string(zend_class_entry *scope, char *name, int name_length, char *value TSRMLS_DC) { zval *tmp; - + ALLOC_ZVAL(tmp); tmp->is_ref = 0; tmp->refcount = 0; @@ -3381,7 +3381,7 @@ ZEND_API int zend_update_static_property_rt_string(zend_class_entry *scope, char 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; - + ALLOC_ZVAL(tmp); tmp->is_ref = 0; tmp->refcount = 0; @@ -3392,7 +3392,7 @@ ZEND_API int zend_update_static_property_rt_stringl(zend_class_entry *scope, cha ZEND_API int zend_update_static_property_unicode(zend_class_entry *scope, char *name, int name_length, UChar *value TSRMLS_DC) { zval *tmp; - + ALLOC_ZVAL(tmp); tmp->is_ref = 0; tmp->refcount = 0; @@ -3403,7 +3403,7 @@ ZEND_API int zend_update_static_property_unicode(zend_class_entry *scope, char * 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; - + ALLOC_ZVAL(tmp); tmp->is_ref = 0; tmp->refcount = 0; @@ -3415,7 +3415,7 @@ ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, char *n { zval *property, *value; zend_class_entry *old_scope = EG(scope); - + EG(scope) = scope; if (!Z_OBJ_HT_P(object)->read_property) { @@ -3439,7 +3439,7 @@ ZEND_API zval *zend_read_static_property(zend_class_entry *scope, char *name, in { zval **property; zend_class_entry *old_scope = EG(scope); - + EG(scope) = scope; property = zend_std_get_static_property(scope, IS_STRING, name, name_length, silent TSRMLS_CC); EG(scope) = old_scope; |