]> granicus.if.org Git - php/commitdiff
adjusted Satellite for Zend 2
authorDavid Eriksson <eriksson@php.net>
Sun, 12 Aug 2001 09:48:07 +0000 (09:48 +0000)
committerDavid Eriksson <eriksson@php.net>
Sun, 12 Aug 2001 09:48:07 +0000 (09:48 +0000)
ext/satellite/class.c
ext/satellite/object.c
ext/satellite/struct.c
ext/satellite/zval_to_namedvalue.c

index d258edfc3fff8df46dd2846eb5625f6e24a3bfb5..959498e661dfefa70f5dd9730cb29f5d59fd9978 100644 (file)
@@ -138,7 +138,7 @@ void orbit_save_data(zval * php_object, int type, void * data)
        INIT_PZVAL(orbit_data_handle);  /* set reference count */
 
        zend_hash_index_update(
-                       php_object->value.obj.properties, /* hashtable */
+                       Z_OBJPROP_P(php_object),                                        /* hashtable */
                        0,                                                                                                                              /* hash??? */
                        &orbit_data_handle,                                                             /* data */
                        sizeof(pval *),                                                                         /* data size */
@@ -160,7 +160,7 @@ void * orbit_retrieve_data(const zval * php_object, int wanted_type)
        
        /* get handle to corba data */
        zend_hash_index_find(                                                                           
-                       php_object->value.obj.properties,               /* hash table */        
+                       Z_OBJPROP_P(php_object),                                                /* hash table */        
                        0,                                                                                                                                      /* hash??? */
                        (void **)&orbit_data_handle                                     /* data */
                        );
index 741a69a834635300c8f62bf5762dee24131e6238..c0466a945eec8f323302ea3fbf27cecb8726e943 100644 (file)
@@ -179,7 +179,7 @@ static void OrbitObject_Wakeup(INTERNAL_FUNCTION_PARAMETERS)
 
        /* find IOR property */
        if (zend_hash_find(
-                               this_ptr->value.obj.properties
+                               Z_OBJPROP_P(this_ptr)
                                IOR_PROPERTY_KEY, 
                                sizeof(IOR_PROPERTY_KEY), 
                                (void**)&pp_ior) != SUCCESS)
@@ -242,20 +242,7 @@ zend_bool OrbitObject_Create(CORBA_Object source, zval * pDestination)
                goto error;
        }
 
-       /* set zval members */
-       pDestination->type = IS_OBJECT;
-       pDestination->is_ref = 1;
-       pDestination->refcount = 1;
-
-       pDestination->value.obj.ce = &OrbitObject_class_entry;
-       pDestination->value.obj.properties = orbit_new(HashTable);
-
-       zend_hash_init(
-                       pDestination->value.obj.properties,     /* hash table */
-                       0,                                                                                                                                      /* size */
-                       NULL,                                                                                                                   /* hash function */
-                       ZVAL_PTR_DTOR,                                                                                  /* destructor */
-                       0);                                                                                                                                     /* persistent */
+       object_init_ex(pDestination, &OrbitObject_class_entry);
 
        /* save orbit data */
        OrbitObject_SaveData(pDestination, p_object);
index 47f377e9cd3a1b2f1233d3c159aa6a2d042b3e1d..e7ffbf7daa4deeadb5ae69e52e6c807b56eb08c5 100644 (file)
@@ -209,20 +209,7 @@ zend_bool OrbitStruct_Create(const char * pId, zval * pDestination)
        if (!OrbitStruct_Initialize(pId, p_struct))
                goto error;
 
-       /* set zval members */
-       pDestination->type = IS_OBJECT;
-       pDestination->is_ref = 1;
-       pDestination->refcount = 1;
-
-       pDestination->value.obj.ce = &OrbitStruct_class_entry;
-       pDestination->value.obj.properties = orbit_new(HashTable);
-
-       zend_hash_init(
-                       pDestination->value.obj.properties,     /* hash table */
-                       0,                                                                                                                                      /* size */
-                       NULL,                                                                                                                   /* hash function */
-                       ZVAL_PTR_DTOR,                                                                                  /* destructor */
-                       0);                                                                                                                                     /* persistent */
+       object_init_ex(pDestination, &OrbitStruct_class_entry);
 
        /* save orbit data */
        OrbitStruct_SaveData(pDestination, p_struct);
index 24f7a29821af28c03d34c7a10a3a953808e4dda7..bfd222c13fb053797f35046f6a2e134728f973ed 100644 (file)
@@ -145,7 +145,7 @@ static zend_bool satellite_zval_to_namedvalue_objref(const zval * pSource,
                goto error;
 
        /* see that it's a corba object */
-       if (strcmp(pSource->value.obj.ce->name, "OrbitObject") != 0)
+       if (strcmp(Z_OBJCE_P(pSource)->name, "OrbitObject") != 0)
                goto error; /* bad class type */
 
        pObject = OrbitObject_RetrieveData(pSource);
@@ -308,7 +308,7 @@ static zend_bool satellite_zval_to_namedvalue_struct(const zval * pSource,
                goto error; /* bad source type */
 
        /* see that it's a structure object */
-       if (strcmp(pSource->value.obj.ce->name, "OrbitStruct") != 0)
+       if (strcmp(Z_OBJCE_P(pSource)->name, "OrbitStruct") != 0)
                goto error; /* bad class type */
                
        /* get struct info */