]> granicus.if.org Git - php/commitdiff
- Make com work with new object model
authorAndi Gutmans <andi@php.net>
Sun, 12 Aug 2001 04:31:14 +0000 (04:31 +0000)
committerAndi Gutmans <andi@php.net>
Sun, 12 Aug 2001 04:31:14 +0000 (04:31 +0000)
ext/com/com.h
ext/com/conversion.c
ext/rpc/com/com_wrapper.h
ext/rpc/com/conversion.c

index e1f04c75c7718949d4bdb206025b90d236900d80..13ac1d68b857728fc9d4cdc825d101fcc8287fa4 100644 (file)
@@ -21,20 +21,18 @@ typedef struct comval_ {
 
 #define ZVAL_COM(z,o) {                                                                                                                                \
                        zval *handle;                                                                                                                   \
+                       HashTable *properties;                                                                                                  \
                                                                                                                                                                        \
-                       /* OBJECTS_FIXME */                                                                                                             \
-                       Z_TYPE_P(z) = IS_OBJECT;                                                                                                \
-                       Z_OBJCE_P(z) = &com_class_entry;                                                                                \
-                                                                                                                                                                       \
-                       ALLOC_HASHTABLE(Z_OBJPROP_P(z));                                                                                \
-                       zend_hash_init(Z_OBJPROP_P(z), 0, NULL, ZVAL_PTR_DTOR, 0);                              \
+                       ALLOC_HASHTABLE(properties);                                                                                    \
+                       zend_hash_init(properties, 0, NULL, ZVAL_PTR_DTOR, 0);                                  \
                                                                                                                                                                        \
                        ALLOC_ZVAL(handle);                                                                                                             \
                        INIT_PZVAL(handle);                                                                                                             \
                        ZVAL_LONG(handle, zend_list_insert((o), IS_COM));                                               \
                                                                                                                                                                        \
                        zval_copy_ctor(handle);                                                                                                 \
-                       zend_hash_index_update(Z_OBJPROP_P(z), 0, &handle, sizeof(zval *), NULL);       \
+                       zend_hash_index_update(properties, 0, &handle, sizeof(zval *), NULL);   \
+                       object_and_properties_init(z, &com_class_entry, properties);                    \
                }
 
 #define RETVAL_COM(o)  ZVAL_COM(&return_value, o)
index cd05ccdb23760d7b438e8d6dac406531cea35554..0f9bcbd32b7a59cf60ac94ecf25725db0d336735 100644 (file)
@@ -758,6 +758,8 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent,
                                }
                                else
                                {
+                                       TSRMLS_FETCH();
+
                                        ALLOC_COM(obj);
                                        php_COM_set(obj, V_DISPATCH(var_arg), TRUE);
 
index e1f04c75c7718949d4bdb206025b90d236900d80..13ac1d68b857728fc9d4cdc825d101fcc8287fa4 100644 (file)
@@ -21,20 +21,18 @@ typedef struct comval_ {
 
 #define ZVAL_COM(z,o) {                                                                                                                                \
                        zval *handle;                                                                                                                   \
+                       HashTable *properties;                                                                                                  \
                                                                                                                                                                        \
-                       /* OBJECTS_FIXME */                                                                                                             \
-                       Z_TYPE_P(z) = IS_OBJECT;                                                                                                \
-                       Z_OBJCE_P(z) = &com_class_entry;                                                                                \
-                                                                                                                                                                       \
-                       ALLOC_HASHTABLE(Z_OBJPROP_P(z));                                                                                \
-                       zend_hash_init(Z_OBJPROP_P(z), 0, NULL, ZVAL_PTR_DTOR, 0);                              \
+                       ALLOC_HASHTABLE(properties);                                                                                    \
+                       zend_hash_init(properties, 0, NULL, ZVAL_PTR_DTOR, 0);                                  \
                                                                                                                                                                        \
                        ALLOC_ZVAL(handle);                                                                                                             \
                        INIT_PZVAL(handle);                                                                                                             \
                        ZVAL_LONG(handle, zend_list_insert((o), IS_COM));                                               \
                                                                                                                                                                        \
                        zval_copy_ctor(handle);                                                                                                 \
-                       zend_hash_index_update(Z_OBJPROP_P(z), 0, &handle, sizeof(zval *), NULL);       \
+                       zend_hash_index_update(properties, 0, &handle, sizeof(zval *), NULL);   \
+                       object_and_properties_init(z, &com_class_entry, properties);                    \
                }
 
 #define RETVAL_COM(o)  ZVAL_COM(&return_value, o)
index cd05ccdb23760d7b438e8d6dac406531cea35554..0f9bcbd32b7a59cf60ac94ecf25725db0d336735 100644 (file)
@@ -758,6 +758,8 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent,
                                }
                                else
                                {
+                                       TSRMLS_FETCH();
+
                                        ALLOC_COM(obj);
                                        php_COM_set(obj, V_DISPATCH(var_arg), TRUE);