1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 #ifndef ZEND_OBJECT_HANDLERS_H
23 #define ZEND_OBJECT_HANDLERS_H
24
25 union _zend_function;
26 struct _zend_property_info;
27 struct _zend_literal;
28
29
30
31
32
33
34 typedef zval *(*zend_object_read_property_t)(zval *object, zval *member, int type, const struct _zend_literal *key TSRMLS_DC);
35
36
37 typedef zval *(*zend_object_read_dimension_t)(zval *object, zval *offset, int type TSRMLS_DC);
38
39
40
41
42
43
44
45
46 typedef void (*zend_object_write_property_t)(zval *object, zval *member, zval *value, const struct _zend_literal *key TSRMLS_DC);
47
48
49 typedef void (*zend_object_write_dimension_t)(zval *object, zval *offset, zval *value TSRMLS_DC);
50
51
52
53 typedef zval **(*zend_object_get_property_ptr_ptr_t)(zval *object, zval *member, int type, const struct _zend_literal *key TSRMLS_DC);
54
55
56
57 typedef void (*zend_object_set_t)(zval **object, zval *value TSRMLS_DC);
58
59
60
61
62 typedef zval* (*zend_object_get_t)(zval *object TSRMLS_DC);
63
64
65
66
67
68
69
70 typedef int (*zend_object_has_property_t)(zval *object, zval *member, int has_set_exists, const struct _zend_literal *key TSRMLS_DC);
71
72
73 typedef int (*zend_object_has_dimension_t)(zval *object, zval *member, int check_empty TSRMLS_DC);
74
75
76 typedef void (*zend_object_unset_property_t)(zval *object, zval *member, const struct _zend_literal *key TSRMLS_DC);
77
78
79 typedef void (*zend_object_unset_dimension_t)(zval *object, zval *offset TSRMLS_DC);
80
81
82 typedef HashTable *(*zend_object_get_properties_t)(zval *object TSRMLS_DC);
83
84 typedef HashTable *(*zend_object_get_debug_info_t)(zval *object, int *is_temp TSRMLS_DC);
85
86
87
88
89
90 typedef int (*zend_object_call_method_t)(const char *method, INTERNAL_FUNCTION_PARAMETERS);
91 typedef union _zend_function *(*zend_object_get_method_t)(zval **object_ptr, char *method, int method_len, const struct _zend_literal *key TSRMLS_DC);
92 typedef union _zend_function *(*zend_object_get_constructor_t)(zval *object TSRMLS_DC);
93
94
95 typedef void (*zend_object_add_ref_t)(zval *object TSRMLS_DC);
96 typedef void (*zend_object_del_ref_t)(zval *object TSRMLS_DC);
97 typedef void (*zend_object_delete_obj_t)(zval *object TSRMLS_DC);
98 typedef zend_object_value (*zend_object_clone_obj_t)(zval *object TSRMLS_DC);
99
100 typedef zend_class_entry *(*zend_object_get_class_entry_t)(const zval *object TSRMLS_DC);
101 typedef int (*zend_object_get_class_name_t)(const zval *object, const char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC);
102 typedef int (*zend_object_compare_t)(zval *object1, zval *object2 TSRMLS_DC);
103 typedef int (*zend_object_compare_zvals_t)(zval *resul, zval *op1, zval *op2 TSRMLS_DC);
104
105
106
107 typedef int (*zend_object_cast_t)(zval *readobj, zval *retval, int type TSRMLS_DC);
108
109
110
111 typedef int (*zend_object_count_elements_t)(zval *object, long *count TSRMLS_DC);
112
113 typedef int (*zend_object_get_closure_t)(zval *obj, zend_class_entry **ce_ptr, union _zend_function **fptr_ptr, zval **zobj_ptr TSRMLS_DC);
114
115 typedef HashTable *(*zend_object_get_gc_t)(zval *object, zval ***table, int *n TSRMLS_DC);
116
117 typedef int (*zend_object_do_operation_t)(zend_uchar opcode, zval *result, zval *op1, zval *op2 TSRMLS_DC);
118
119 struct _zend_object_handlers {
120
121 zend_object_add_ref_t add_ref;
122 zend_object_del_ref_t del_ref;
123 zend_object_clone_obj_t clone_obj;
124
125 zend_object_read_property_t read_property;
126 zend_object_write_property_t write_property;
127 zend_object_read_dimension_t read_dimension;
128 zend_object_write_dimension_t write_dimension;
129 zend_object_get_property_ptr_ptr_t get_property_ptr_ptr;
130 zend_object_get_t get;
131 zend_object_set_t set;
132 zend_object_has_property_t has_property;
133 zend_object_unset_property_t unset_property;
134 zend_object_has_dimension_t has_dimension;
135 zend_object_unset_dimension_t unset_dimension;
136 zend_object_get_properties_t get_properties;
137 zend_object_get_method_t get_method;
138 zend_object_call_method_t call_method;
139 zend_object_get_constructor_t get_constructor;
140 zend_object_get_class_entry_t get_class_entry;
141 zend_object_get_class_name_t get_class_name;
142 zend_object_compare_t compare_objects;
143 zend_object_cast_t cast_object;
144 zend_object_count_elements_t count_elements;
145 zend_object_get_debug_info_t get_debug_info;
146 zend_object_get_closure_t get_closure;
147 zend_object_get_gc_t get_gc;
148 zend_object_do_operation_t do_operation;
149 zend_object_compare_zvals_t compare;
150 };
151
152 extern ZEND_API zend_object_handlers std_object_handlers;
153
154 #define zend_get_function_root_class(fbc) \
155 ((fbc)->common.prototype ? (fbc)->common.prototype->common.scope : (fbc)->common.scope)
156
157 BEGIN_EXTERN_C()
158 ZEND_API union _zend_function *zend_std_get_static_method(zend_class_entry *ce, const char *function_name_strval, int function_name_strlen, const struct _zend_literal *key TSRMLS_DC);
159 ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, const char *property_name, int property_name_len, zend_bool silent, const struct _zend_literal *key TSRMLS_DC);
160 ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, const char *property_name, int property_name_len, const struct _zend_literal *key TSRMLS_DC);
161 ZEND_API union _zend_function *zend_std_get_constructor(zval *object TSRMLS_DC);
162 ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zval *member, int silent TSRMLS_DC);
163 ZEND_API HashTable *zend_std_get_properties(zval *object TSRMLS_DC);
164 ZEND_API HashTable *zend_std_get_debug_info(zval *object, int *is_temp TSRMLS_DC);
165 ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int type TSRMLS_DC);
166 ZEND_API void zend_std_write_property(zval *object, zval *member, zval *value, const struct _zend_literal *key TSRMLS_DC);
167 ZEND_API void rebuild_object_properties(zend_object *zobj);
168
169
170 #define IS_ZEND_STD_OBJECT(z) (Z_TYPE(z) == IS_OBJECT && (Z_OBJ_HT((z))->get_class_entry != NULL))
171 #define HAS_CLASS_ENTRY(z) (Z_OBJ_HT(z)->get_class_entry != NULL)
172
173 ZEND_API int zend_check_private(union _zend_function *fbc, zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC);
174
175 ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope);
176
177 ZEND_API int zend_check_property_access(zend_object *zobj, const char *prop_info_name, int prop_info_name_len TSRMLS_DC);
178
179 ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS);
180 END_EXTERN_C()
181
182 #endif
183
184
185
186
187
188
189
190