]> granicus.if.org Git - php/commitdiff
only check for an available class entry instead of
authorHarald Radi <phanto@php.net>
Sun, 9 Jun 2002 14:20:37 +0000 (14:20 +0000)
committerHarald Radi <phanto@php.net>
Sun, 9 Jun 2002 14:20:37 +0000 (14:20 +0000)
the std_object_handlers on some places

#some linuxtag work

Zend/zend_API.h
Zend/zend_builtin_functions.c
Zend/zend_object_handlers.h

index f7e0b03d5e3afc89bcf0e65a7d73417a53b005e7..a90cca6139f31bbd3a7a01cf55baf48381b115f3 100644 (file)
@@ -84,19 +84,7 @@ BEGIN_EXTERN_C()
 
 
 
-#define INIT_CLASS_ENTRY(class_container, class_name, functions)       \
-       {                                                                                                                               \
-               class_container.name = strdup(class_name);                                      \
-               class_container.name_length = sizeof(class_name)-1;                     \
-               class_container.builtin_functions = functions;                          \
-               class_container.constructor = NULL;                                                     \
-               class_container.destructor = NULL;                                                      \
-               class_container.clone = NULL;                                                           \
-               class_container.create_object = NULL;                                           \
-               class_container.handle_function_call = NULL;                            \
-               class_container.handle_property_get = NULL;                                     \
-               class_container.handle_property_set = NULL;                                     \
-       }
+#define INIT_CLASS_ENTRY(class_container, class_name, functions) INIT_OVERLOADED_CLASS_ENTRY(class_container, class_name, functions, NULL, NULL, NULL)
 
 #define INIT_OVERLOADED_CLASS_ENTRY(class_container, class_name, functions, handle_fcall, handle_propget, handle_propset) \
        {                                                                                                                       \
index 3a5e94727695ecd4acd64e2d3fac17da9c2e0270..6328a0a97fd3112066fe2baeb48e6770b04bc156 100644 (file)
@@ -588,7 +588,7 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass)
        }
        
        /* TBI!! new object handlers */
-       if(!IS_ZEND_STD_OBJECT(**obj)) {
+       if(!HAS_CLASS_ENTRY(**obj)) {
                RETURN_FALSE;
        }
 
@@ -706,7 +706,7 @@ ZEND_FUNCTION(get_class_methods)
 
        if (Z_TYPE_PP(class) == IS_OBJECT) {
                /* TBI!! new object handlers */
-               if(!IS_ZEND_STD_OBJECT(**class)) {
+               if(!HAS_CLASS_ENTRY(**class)) {
                        RETURN_FALSE;
                }
                ce = Z_OBJCE_PP(class);
@@ -751,7 +751,7 @@ ZEND_FUNCTION(method_exists)
        }
 
        /* TBI!! new object handlers */
-       if(!IS_ZEND_STD_OBJECT(**klass)) {
+       if(!HAS_CLASS_ENTRY(**klass)) {
                RETURN_FALSE;
        }
 
index 3d721b8247c0977ccad137928e9e1f72027af6e5..1cf015a343812021db92864ba799234455df6cdc 100644 (file)
@@ -74,5 +74,6 @@ typedef struct _zend_object_handlers {
 extern zend_object_handlers std_object_handlers;
 
 #define IS_ZEND_STD_OBJECT(z)  ((z).type == IS_OBJECT && Z_OBJ_HT(z) == &std_object_handlers)
+#define HAS_CLASS_ENTRY(z) (Z_OBJ_HT(z)->get_class_entry != NULL)
 
 #endif