2 +--------------------------------------------------------------------+
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted provided that the conditions mentioned |
7 | in the accompanying LICENSE file are met. |
8 +--------------------------------------------------------------------+
9 | Copyright (c) 2013, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
13 #ifndef PHP_PQ_OBJECT_H
14 #define PHP_PQ_OBJECT_H
16 #define PHP_PQ_OBJ_DECL(_intern_type) \
17 _intern_type intern; \
18 HashTable *prophandler; \
22 typedef struct php_pq_object
{
23 PHP_PQ_OBJ_DECL(void *)
26 static inline void *PHP_PQ_OBJ(zval
*zv
, zend_object
*zo
) {
30 return (void *) (((char *) zo
) - zo
->handlers
->offset
);
33 extern zend_class_entry
*ancestor(zend_class_entry
*ce
);
35 typedef void (*php_pq_object_prophandler_func_t
)(void *o
, zval
*return_value
);
37 typedef struct php_pq_object_prophandler
{
38 php_pq_object_prophandler_func_t read
;
39 php_pq_object_prophandler_func_t write
;
40 php_pq_object_prophandler_func_t gc
;
41 } php_pq_object_prophandler_t
;
43 extern void php_pq_object_prophandler_dtor(zval
*zv
);
45 extern void *php_pq_object_create(zend_class_entry
*ce
, void *intern
, size_t obj_size
, zend_object_handlers
*oh
, HashTable
*ph
);
46 extern void php_pq_object_dtor(zend_object
*obj
);
47 extern void php_pq_object_to_zval(void *o
, zval
*zv
);
48 extern void php_pq_object_to_zval_no_addref(void *o
, zval
*zv
);
49 extern void php_pq_object_addref(void *o
);
50 extern void php_pq_object_delref(void *o
);
52 #if PHP_VERSION_ID >= 80000
53 # define php_pq_object_debug_info php_pq_object_debug_info_80
55 # define php_pq_object_debug_info php_pq_object_debug_info_70
57 extern HashTable
*php_pq_object_debug_info_80(zend_object
*object
, int *temp
);
58 extern HashTable
*php_pq_object_debug_info_70(zval
*object
, int *temp
);
60 #if PHP_VERSION_ID >= 80000
61 # define php_pq_object_properties php_pq_object_properties_80
63 # define php_pq_object_properties php_pq_object_properties_70
65 extern HashTable
*php_pq_object_properties_80(zend_object
*object
);
66 extern HashTable
*php_pq_object_properties_70(zval
*object
);
68 #if PHP_VERSION_ID >= 80000
69 # define php_pq_object_get_gc php_pq_object_get_gc_80
71 # define php_pq_object_get_gc php_pq_object_get_gc_70
73 extern HashTable
*php_pq_object_get_gc_80(zend_object
*object
, zval
**table
, int *n
);
74 extern HashTable
*php_pq_object_get_gc_70(zval
*object
, zval
**table
, int *n
);
76 #if PHP_VERSION_ID >= 80000
77 # define php_pq_object_read_prop php_pq_object_read_prop_80
78 #elif PHP_VERSION_ID >= 70400
79 # define php_pq_object_read_prop php_pq_object_read_prop_74
81 # define php_pq_object_read_prop php_pq_object_read_prop_70
83 extern zval
*php_pq_object_read_prop_80(zend_object
*object
, zend_string
*member
, int type
, void **cache_slot
, zval
*tmp
);
84 extern zval
*php_pq_object_read_prop_74(zval
*object
, zval
*member
, int type
, void **cache_slot
, zval
*tmp
);
85 extern void php_pq_object_read_prop_70(zval
*object
, zval
*member
, int type
, void **cache_slot
, zval
*tmp
);
87 #if PHP_VERSION_ID >= 80000
88 # define php_pq_object_write_prop php_pq_object_write_prop_80
89 #elif PHP_VERSION_ID >= 70400
90 # define php_pq_object_write_prop php_pq_object_write_prop_74
92 # define php_pq_object_write_prop php_pq_object_write_prop_70
94 extern zval
*php_pq_object_write_prop_80(zend_object
*object
, zend_string
*member
, zval
*value
, void **cache_slot
);
95 extern zval
*php_pq_object_write_prop_74(zval
*object
, zval
*member
, zval
*value
, void **cache_slot
);
96 extern void php_pq_object_write_prop_70(zval
*object
, zval
*member
, zval
*value
, void **cache_slot
);
98 #if PHP_VERSION_ID >= 80000
99 # define php_pq_object_get_prop_ptr_null php_pq_object_get_prop_ptr_null_80
101 # define php_pq_object_get_prop_ptr_null php_pq_object_get_prop_ptr_null_70
103 extern zval
*php_pq_object_get_prop_ptr_null_80(zend_object
*object
, zend_string
*member
, int type
, void **cache_slot
);
104 extern zval
*php_pq_object_get_prop_ptr_null_70(zval
*object
, zval
*member
, int type
, void **cache_slot
);
113 * vim600: noet sw=4 ts=4 fdm=marker
114 * vim<600: noet sw=4 ts=4