Skip to content

Commit be739cf

Browse files
author
Harald Radi
committed
MFH - andis object model change
1 parent 52e1ff4 commit be739cf

File tree

2 files changed

+32
-36
lines changed

2 files changed

+32
-36
lines changed

ext/com/com.h

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,27 @@ typedef struct comval_ {
2323

2424
END_EXTERN_C()
2525

26-
#define ZVAL_COM(z,o) { \
27-
zval *handle; \
28-
\
29-
/* OBJECTS_FIXME */ \
30-
Z_TYPE_P(z) = IS_OBJECT; \
31-
Z_OBJCE_P(z) = &COM_class_entry; \
32-
\
33-
ALLOC_HASHTABLE(Z_OBJPROP_P(z)); \
34-
zend_hash_init(Z_OBJPROP_P(z), 0, NULL, ZVAL_PTR_DTOR, 0); \
35-
\
36-
ALLOC_ZVAL(handle); \
37-
INIT_PZVAL(handle); \
38-
ZVAL_LONG(handle, zend_list_insert((o), IS_COM)); \
39-
\
40-
zval_copy_ctor(handle); \
41-
zend_hash_index_update(Z_OBJPROP_P(z), 0, &handle, sizeof(zval *), NULL); \
26+
#define ZVAL_COM(z,o) { \
27+
zval *handle; \
28+
HashTable *properties; \
29+
\
30+
ALLOC_HASHTABLE(properties); \
31+
zend_hash_init(properties, 0, NULL, ZVAL_PTR_DTOR, 0); \
32+
\
33+
ALLOC_ZVAL(handle); \
34+
INIT_PZVAL(handle); \
35+
ZVAL_LONG(handle, zend_list_insert((o), IS_COM)); \
36+
\
37+
zval_copy_ctor(handle); \
38+
zend_hash_index_update(properties, 0, &handle, sizeof(zval *), NULL); \
39+
object_and_properties_init(z, &COM_class_entry, properties); \
4240
}
4341

4442
#define RETVAL_COM(o) ZVAL_COM(&return_value, o);
45-
#define RETURN_COM(o) RETVAL_COM(o) \
43+
#define RETURN_COM(o) RETVAL_COM(o) \
4644
return;
4745

48-
#define ALLOC_COM(z) (z) = (comval *) emalloc(sizeof(comval)); \
46+
#define ALLOC_COM(z) (z) = (comval *) emalloc(sizeof(comval)); \
4947
C_REFCOUNT(z) = 0;
5048

5149
#define FREE_COM(z) efree(z);

ext/rpc/com/com_wrapper.h

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,27 @@ typedef struct comval_ {
2323

2424
END_EXTERN_C()
2525

26-
#define ZVAL_COM(z,o) { \
27-
zval *handle; \
28-
\
29-
/* OBJECTS_FIXME */ \
30-
Z_TYPE_P(z) = IS_OBJECT; \
31-
Z_OBJCE_P(z) = &COM_class_entry; \
32-
\
33-
ALLOC_HASHTABLE(Z_OBJPROP_P(z)); \
34-
zend_hash_init(Z_OBJPROP_P(z), 0, NULL, ZVAL_PTR_DTOR, 0); \
35-
\
36-
ALLOC_ZVAL(handle); \
37-
INIT_PZVAL(handle); \
38-
ZVAL_LONG(handle, zend_list_insert((o), IS_COM)); \
39-
\
40-
zval_copy_ctor(handle); \
41-
zend_hash_index_update(Z_OBJPROP_P(z), 0, &handle, sizeof(zval *), NULL); \
26+
#define ZVAL_COM(z,o) { \
27+
zval *handle; \
28+
HashTable *properties; \
29+
\
30+
ALLOC_HASHTABLE(properties); \
31+
zend_hash_init(properties, 0, NULL, ZVAL_PTR_DTOR, 0); \
32+
\
33+
ALLOC_ZVAL(handle); \
34+
INIT_PZVAL(handle); \
35+
ZVAL_LONG(handle, zend_list_insert((o), IS_COM)); \
36+
\
37+
zval_copy_ctor(handle); \
38+
zend_hash_index_update(properties, 0, &handle, sizeof(zval *), NULL); \
39+
object_and_properties_init(z, &COM_class_entry, properties); \
4240
}
4341

4442
#define RETVAL_COM(o) ZVAL_COM(&return_value, o);
45-
#define RETURN_COM(o) RETVAL_COM(o) \
43+
#define RETURN_COM(o) RETVAL_COM(o) \
4644
return;
4745

48-
#define ALLOC_COM(z) (z) = (comval *) emalloc(sizeof(comval)); \
46+
#define ALLOC_COM(z) (z) = (comval *) emalloc(sizeof(comval)); \
4947
C_REFCOUNT(z) = 0;
5048

5149
#define FREE_COM(z) efree(z);

0 commit comments

Comments
 (0)