From 039c174337e9d2324a997e325a54dc3c0b187243 Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Wed, 4 Jun 2003 08:16:55 +0000 Subject: [PATCH] rm namespace leftovers --- Zend/zend.c | 1 - Zend/zend.h | 1 - Zend/zend_API.c | 23 ----------------------- Zend/zend_API.h | 2 -- Zend/zend_builtin_functions.c | 13 +++---------- Zend/zend_object_handlers.c | 3 ++- 6 files changed, 5 insertions(+), 38 deletions(-) diff --git a/Zend/zend.c b/Zend/zend.c index 97b0164834..9acc36db9f 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -568,7 +568,6 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i GLOBAL_FUNCTION_TABLE = (HashTable *) malloc(sizeof(HashTable)); GLOBAL_CLASS_TABLE = (HashTable *) malloc(sizeof(HashTable)); GLOBAL_AUTO_GLOBALS_TABLE = (HashTable *) malloc(sizeof(HashTable)); - GLOBAL_CONSTANTS_TABLE = (HashTable *) malloc(sizeof(HashTable)); zend_hash_init_ex(GLOBAL_FUNCTION_TABLE, 100, NULL, ZEND_FUNCTION_DTOR, 1, 0); zend_hash_init_ex(GLOBAL_CLASS_TABLE, 10, NULL, ZEND_CLASS_DTOR, 1, 0); diff --git a/Zend/zend.h b/Zend/zend.h index 56337eaf0d..c2bc0ae9fc 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -308,7 +308,6 @@ struct _zend_class_entry { HashTable *static_members; HashTable constants_table; zend_function_entry *builtin_functions; - struct _zend_class_entry *ns; union _zend_function *constructor; union _zend_function *destructor; diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 595c58a622..c420aebf6d 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -1565,29 +1565,6 @@ ZEND_API char *zend_get_module_version(char *module_name) return module->version; } -ZEND_API void zend_make_full_classname(zend_class_entry *ce, char **name, zend_uint *name_len) -{ - int len = ce->name_length; - char *full_name; - - if(ce->ns && ce->ns->name) { - len += ce->ns->name_length + 2; - } - - *name = full_name = emalloc(len+1); - *name_len = len; - - if(ce->ns && ce->ns->name) { - memcpy(full_name, ce->ns->name, ce->ns->name_length); - full_name += ce->ns->name_length; - *(full_name++) = ':'; - *(full_name++) = ':'; - } - - memcpy(full_name, ce->name, ce->name_length); - full_name[ce->name_length] = '\0'; -} - /* * Local variables: * tab-width: 4 diff --git a/Zend/zend_API.h b/Zend/zend_API.h index eafa667066..fb018036ec 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -257,8 +257,6 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length, ZEND_API ZEND_FUNCTION(display_disabled_function); ZEND_API ZEND_FUNCTION(display_disabled_class); -ZEND_API void zend_make_full_classname(zend_class_entry *ce, char **name, zend_uint *name_len); - #if ZEND_DEBUG #define CHECK_ZVAL_STRING(z) \ if ((z)->value.str.val[ (z)->value.str.len ] != '\0') { zend_error(E_WARNING, "String is not zero-terminated (%s)", (z)->value.str.val); } diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 3a86131c40..4cc1fec259 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -535,12 +535,7 @@ ZEND_FUNCTION(get_class) RETURN_FALSE; } - if(ce->ns) { - zend_make_full_classname(ce, &name, &name_len); - RETURN_STRINGL(name, name_len, 0); - } else { - RETURN_STRINGL(ce->name, ce->name_length, 1); - } + RETURN_STRINGL(ce->name, ce->name_length, 1); } RETURN_STRINGL(name, name_len, 0); @@ -567,8 +562,7 @@ ZEND_FUNCTION(get_parent_class) && Z_OBJ_HT_PP(arg)->get_class_name(*arg, &name, &name_length, 1 TSRMLS_CC) == SUCCESS) { RETURN_STRINGL(name, name_length, 0); } else if (Z_OBJ_HT_PP(arg)->get_class_entry && (ce = zend_get_class_entry(*arg TSRMLS_CC))) { - zend_make_full_classname(ce, &name, &name_length); - RETURN_STRINGL(name, name_length, 0); + RETURN_STRINGL(ce->name, ce->name_length, 1); } else { RETURN_FALSE; } @@ -583,8 +577,7 @@ ZEND_FUNCTION(get_parent_class) } if (ce && ce->parent) { - zend_make_full_classname(ce->parent, &name, &name_length); - RETURN_STRINGL(name, name_length, 0); + RETURN_STRINGL(ce->parent->name, ce->parent->name_length, 1); } else { RETURN_FALSE; } diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 43a78ec223..81115f2e24 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -802,7 +802,8 @@ int zend_std_object_get_class_name(zval *object, char **class_name, zend_uint *c ce = zobj->ce; } - zend_make_full_classname(ce, class_name, class_name_len); + *class_name_len = ce->name_length; + *class_name = estrndup(ce->name, ce->name_length); return SUCCESS; } -- 2.40.0