- More object macros

This commit is contained in:
Andi Gutmans 2001-07-28 19:23:21 +00:00
parent 13d4670c84
commit 5c5178b2f4
4 changed files with 20 additions and 20 deletions

View File

@ -20,21 +20,21 @@ typedef struct comval_ {
} comval;
#define ZVAL_COM(z,o) { \
pval *handle; \
zval *handle; \
\
/* OBJECTS_FIXME */ \
Z_TYPE_P(z) = IS_OBJECT; \
(z)->value.obj.ce = &com_class_entry; \
Z_OBJCE_P(z) = &com_class_entry; \
\
ALLOC_HASHTABLE((z)->value.obj.properties); \
zend_hash_init((z)->value.obj.properties, 0, NULL, ZVAL_PTR_DTOR, 0); \
ALLOC_HASHTABLE(Z_OBJPROP_P(z)); \
zend_hash_init(Z_OBJPROP_P(z), 0, NULL, ZVAL_PTR_DTOR, 0); \
\
ALLOC_ZVAL(handle); \
INIT_PZVAL(handle); \
ZVAL_LONG(handle, zend_list_insert((o), IS_COM)); \
\
pval_copy_constructor(handle); \
zend_hash_index_update((z)->value.obj.properties, 0, \
&handle, sizeof(pval *), NULL); \
zval_copy_ctor(handle); \
zend_hash_index_update(Z_OBJPROP_P(z), 0, &handle, sizeof(zval *), NULL); \
}
#define RETVAL_COM(o) ZVAL_COM(&return_value, o)

View File

@ -386,7 +386,7 @@ static void pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, int type, int c
pval **var_handle;
/* fetch the VARIANT structure */
zend_hash_index_find(pval_arg->value.obj.properties, 0, (void **) &var_handle);
zend_hash_index_find(Z_OBJPROP_P(pval_arg), 0, (void **) &var_handle);
V_VT(var_arg) = VT_VARIANT|VT_BYREF;
V_VARIANTREF(var_arg) = (VARIANT FAR*) zend_list_find(Z_LVAL_P(*var_handle), &tp);
@ -900,8 +900,8 @@ static void comval_to_variant(pval *pval_arg, VARIANT *var_arg)
int type;
/* fetch the comval structure */
zend_hash_index_find(pval_arg->value.obj.properties, 0, (void **) &comval_handle);
obj = (comval *)zend_list_find(Z_LVAL_P(*comval_handle), &type);
zend_hash_index_find(Z_OBJPROP_P(pval_arg), 0, (void **) &comval_handle);
obj = (comval *) zend_list_find(Z_LVAL_P(*comval_handle), &type);
if(!obj || (type != IS_COM) || !C_ISREFD(obj))
{
VariantInit(var_arg);

View File

@ -20,21 +20,21 @@ typedef struct comval_ {
} comval;
#define ZVAL_COM(z,o) { \
pval *handle; \
zval *handle; \
\
/* OBJECTS_FIXME */ \
Z_TYPE_P(z) = IS_OBJECT; \
(z)->value.obj.ce = &com_class_entry; \
Z_OBJCE_P(z) = &com_class_entry; \
\
ALLOC_HASHTABLE((z)->value.obj.properties); \
zend_hash_init((z)->value.obj.properties, 0, NULL, ZVAL_PTR_DTOR, 0); \
ALLOC_HASHTABLE(Z_OBJPROP_P(z)); \
zend_hash_init(Z_OBJPROP_P(z), 0, NULL, ZVAL_PTR_DTOR, 0); \
\
ALLOC_ZVAL(handle); \
INIT_PZVAL(handle); \
ZVAL_LONG(handle, zend_list_insert((o), IS_COM)); \
\
pval_copy_constructor(handle); \
zend_hash_index_update((z)->value.obj.properties, 0, \
&handle, sizeof(pval *), NULL); \
zval_copy_ctor(handle); \
zend_hash_index_update(Z_OBJPROP_P(z), 0, &handle, sizeof(zval *), NULL); \
}
#define RETVAL_COM(o) ZVAL_COM(&return_value, o)

View File

@ -386,7 +386,7 @@ static void pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, int type, int c
pval **var_handle;
/* fetch the VARIANT structure */
zend_hash_index_find(pval_arg->value.obj.properties, 0, (void **) &var_handle);
zend_hash_index_find(Z_OBJPROP_P(pval_arg), 0, (void **) &var_handle);
V_VT(var_arg) = VT_VARIANT|VT_BYREF;
V_VARIANTREF(var_arg) = (VARIANT FAR*) zend_list_find(Z_LVAL_P(*var_handle), &tp);
@ -900,8 +900,8 @@ static void comval_to_variant(pval *pval_arg, VARIANT *var_arg)
int type;
/* fetch the comval structure */
zend_hash_index_find(pval_arg->value.obj.properties, 0, (void **) &comval_handle);
obj = (comval *)zend_list_find(Z_LVAL_P(*comval_handle), &type);
zend_hash_index_find(Z_OBJPROP_P(pval_arg), 0, (void **) &comval_handle);
obj = (comval *) zend_list_find(Z_LVAL_P(*comval_handle), &type);
if(!obj || (type != IS_COM) || !C_ISREFD(obj))
{
VariantInit(var_arg);