Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 376 lines (319 sloc) 14.083 kB
573b460 @andigutmans Zend Library
andigutmans authored
1 /*
2 +----------------------------------------------------------------------+
3 | Zend Engine |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
6 +----------------------------------------------------------------------+
8d1de13 @zsuraski 0.91 update
zsuraski authored
7 | This source file is subject to version 0.91 of the Zend license, |
b5b1117 @zsuraski License update
zsuraski authored
8 | that is bundled with this package in the file LICENSE, and is |
9 | available at through the world-wide-web at |
8d1de13 @zsuraski 0.91 update
zsuraski authored
10 | http://www.zend.com/license/0_91.txt. |
b5b1117 @zsuraski License update
zsuraski authored
11 | If you did not receive a copy of the Zend license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@zend.com so we can mail you a copy immediately. |
573b460 @andigutmans Zend Library
andigutmans authored
14 +----------------------------------------------------------------------+
15 | Authors: Andi Gutmans <andi@zend.com> |
16 | Zeev Suraski <zeev@zend.com> |
17 +----------------------------------------------------------------------+
18 */
19
b5b1117 @zsuraski License update
zsuraski authored
20
573b460 @andigutmans Zend Library
andigutmans authored
21 #ifndef _ZEND_API_H
22 #define _ZEND_API_H
23
24 #include "modules.h"
25 #include "zend_list.h"
b7a5b3c @zsuraski - Generalize the fast cache mechanism
zsuraski authored
26 #include "zend_fast_cache.h"
573b460 @andigutmans Zend Library
andigutmans authored
27
28
342c6e0 @zsuraski Whatnot:
zsuraski authored
29 #define ZEND_NAMED_FUNCTION(name) void name(INTERNAL_FUNCTION_PARAMETERS)
30 #define ZEND_FUNCTION(name) ZEND_NAMED_FUNCTION(zend_if_##name)
31
32 #define ZEND_NAMED_FE(runtime_name, name, arg_types) { #runtime_name, name, arg_types },
33 #define ZEND_FE(name, arg_types) ZEND_NAMED_FE(name, zend_if_##name, arg_types)
34
35
741b816 @zsuraski * Support getThis() for internal functions.
zsuraski authored
36 #define INIT_CLASS_ENTRY(class_container, class_name, functions) \
37 { \
38 class_container.name = strdup(class_name); \
39 class_container.name_length = sizeof(class_name)-1; \
40 class_container.builtin_functions = functions; \
41 class_container.handle_function_call = NULL; \
42 class_container.handle_property_get = NULL; \
43 class_container.handle_property_set = NULL; \
44 }
45
46 #define INIT_OVERLOADED_CLASS_ENTRY(class_container, class_name, functions, handle_fcall, handle_propget, handle_propset) \
47 { \
48 class_container.name = strdup(class_name); \
49 class_container.name_length = sizeof(class_name)-1; \
50 class_container.builtin_functions = functions; \
51 class_container.handle_function_call = handle_fcall; \
52 class_container.handle_property_get = handle_propget; \
53 class_container.handle_property_set = handle_propset; \
54 }
55
56
57
573b460 @andigutmans Zend Library
andigutmans authored
58 int zend_next_free_module(void);
59
cd7d554 @zsuraski - Introduce ZEND_NUM_ARGS(), to replace ARG_COUNT(ht)
zsuraski authored
60 ZEND_API int zend_get_parameters(int ht, int param_count,...);
61 ZEND_API int zend_get_parameters_array(int ht, int param_count, zval **argument_array);
62 ZEND_API int zend_get_parameters_ex(int param_count,...);
63 ZEND_API int zend_get_parameters_array_ex(int param_count, zval ***argument_array);
39f9487 @andigutmans -Tiny patches
andigutmans authored
64
9deab41 @andigutmans Add a couple of ZEND_API's
andigutmans authored
65 ZEND_API int ParameterPassedByReference(int ht, uint n);
39f9487 @andigutmans -Tiny patches
andigutmans authored
66
741b816 @zsuraski * Support getThis() for internal functions.
zsuraski authored
67 int zend_register_functions(zend_function_entry *functions, HashTable *function_table);
68 void zend_unregister_functions(zend_function_entry *functions, int count, HashTable *function_table);
7a87fcb @zsuraski Thread safety patch. We're still not quite there but it compiles aga…
zsuraski authored
69 ZEND_API int zend_register_module(zend_module_entry *module_entry);
bfbe861 @zsuraski Almost forgot to commit those
zsuraski authored
70 ZEND_API zend_class_entry *register_internal_class(zend_class_entry *class_entry);
71 ZEND_API zend_module_entry *zend_get_module(int module_number);
573b460 @andigutmans Zend Library
andigutmans authored
72
73 ZEND_API void wrong_param_count(void);
74
741b816 @zsuraski * Support getThis() for internal functions.
zsuraski authored
75 #define getThis() (this_ptr)
76
573b460 @andigutmans Zend Library
andigutmans authored
77 #define WRONG_PARAM_COUNT { wrong_param_count(); return; }
78 #define WRONG_PARAM_COUNT_WITH_RETVAL(ret) { wrong_param_count(); return ret; }
a1ad287 @zsuraski - The tree compiles again
zsuraski authored
79 #define ARG_COUNT(dummy) (ht)
80 #define ZEND_NUM_ARGS() (ht)
573b460 @andigutmans Zend Library
andigutmans authored
81
82 #define BYREF_NONE 0
83 #define BYREF_FORCE 1
84 #define BYREF_ALLOW 2
6d988ec @andigutmans - Add support for BYREF_FORCE_REST
andigutmans authored
85 #define BYREF_FORCE_REST 3
573b460 @andigutmans Zend Library
andigutmans authored
86
9108abc @zsuraski Minor updates (mostly __declspec() stuff)
zsuraski authored
87 #if !(WIN32||WINNT)
573b460 @andigutmans Zend Library
andigutmans authored
88 #define DLEXPORT
89 #endif
90
91 int zend_startup_module(zend_module_entry *module);
92
93 ZEND_API int array_init(zval *arg);
94 ZEND_API int object_init(zval *arg);
95 ZEND_API int object_init_ex(zval *arg, zend_class_entry *ce);
6847fef added add_*_resource() and add_*_bool() functions
Thies C. Arntzen authored
96
97 /* no longer supported */
98 ZEND_API int add_assoc_function(zval *arg, char *key,void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS));
99
573b460 @andigutmans Zend Library
andigutmans authored
100 ZEND_API int add_assoc_long(zval *arg, char *key, long n);
f2d703e @zsuraski - Nuke undefined_variable_string
zsuraski authored
101 ZEND_API int add_assoc_unset(zval *arg, char *key);
6847fef added add_*_resource() and add_*_bool() functions
Thies C. Arntzen authored
102 ZEND_API int add_assoc_bool(zval *arg, char *key, int b);
103 ZEND_API int add_assoc_resource(zval *arg, char *key, int r);
573b460 @andigutmans Zend Library
andigutmans authored
104 ZEND_API int add_assoc_double(zval *arg, char *key, double d);
105 ZEND_API int add_assoc_string(zval *arg, char *key, char *str, int duplicate);
106 ZEND_API int add_assoc_stringl(zval *arg, char *key, char *str, uint length, int duplicate);
6847fef added add_*_resource() and add_*_bool() functions
Thies C. Arntzen authored
107
573b460 @andigutmans Zend Library
andigutmans authored
108 ZEND_API int add_index_long(zval *arg, uint idx, long n);
f2d703e @zsuraski - Nuke undefined_variable_string
zsuraski authored
109 ZEND_API int add_index_unset(zval *arg, uint idx);
6847fef added add_*_resource() and add_*_bool() functions
Thies C. Arntzen authored
110 ZEND_API int add_index_bool(zval *arg, uint idx, int b);
111 ZEND_API int add_index_resource(zval *arg, uint idx, int r);
573b460 @andigutmans Zend Library
andigutmans authored
112 ZEND_API int add_index_double(zval *arg, uint idx, double d);
113 ZEND_API int add_index_string(zval *arg, uint idx, char *str, int duplicate);
114 ZEND_API int add_index_stringl(zval *arg, uint idx, char *str, uint length, int duplicate);
6847fef added add_*_resource() and add_*_bool() functions
Thies C. Arntzen authored
115
573b460 @andigutmans Zend Library
andigutmans authored
116 ZEND_API int add_next_index_long(zval *arg, long n);
f2d703e @zsuraski - Nuke undefined_variable_string
zsuraski authored
117 ZEND_API int add_next_index_unset(zval *arg);
6847fef added add_*_resource() and add_*_bool() functions
Thies C. Arntzen authored
118 ZEND_API int add_next_index_bool(zval *arg, int b);
119 ZEND_API int add_next_index_resource(zval *arg, int r);
573b460 @andigutmans Zend Library
andigutmans authored
120 ZEND_API int add_next_index_double(zval *arg, double d);
121 ZEND_API int add_next_index_string(zval *arg, char *str, int duplicate);
122 ZEND_API int add_next_index_stringl(zval *arg, char *str, uint length, int duplicate);
123
124 ZEND_API int add_get_index_long(zval *arg, uint idx, long l, void **dest);
125 ZEND_API int add_get_index_double(zval *arg, uint idx, double d, void **dest);
6847fef added add_*_resource() and add_*_bool() functions
Thies C. Arntzen authored
126 ZEND_API int add_get_assoc_string(zval *arg, char *key, char *str, void **dest, int duplicate);
127 ZEND_API int add_get_assoc_stringl(zval *arg, char *key, char *str, uint length, void **dest, int duplicate);
573b460 @andigutmans Zend Library
andigutmans authored
128 ZEND_API int add_get_index_string(zval *arg, uint idx, char *str, void **dest, int duplicate);
129 ZEND_API int add_get_index_stringl(zval *arg, uint idx, char *str, uint length, void **dest, int duplicate);
130
223c674 @zsuraski - Made things work again (Thies, everybody - please check the latest …
zsuraski authored
131 ZEND_API int call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, int param_count, zval *params[]);
132 ZEND_API int call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval **retval_ptr_ptr, int param_count, zval **params[], int no_separation);
573b460 @andigutmans Zend Library
andigutmans authored
133
134 ZEND_API int add_property_long(zval *arg, char *key, long l);
446e5d0 added add_property_resource
Thies C. Arntzen authored
135 ZEND_API int add_property_resource(zval *arg, char *key, long r);
573b460 @andigutmans Zend Library
andigutmans authored
136 ZEND_API int add_property_double(zval *arg, char *key, double d);
137 ZEND_API int add_property_string(zval *arg, char *key, char *str, int duplicate);
138 ZEND_API int add_property_stringl(zval *arg, char *key, char *str, uint length, int duplicate);
139
f962a35 Added zend_set_hash_symbol() function.
Andrei Zmievski authored
140 ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
141 int is_ref, int num_symbol_tables, ...);
142
573b460 @andigutmans Zend Library
andigutmans authored
143 #define add_method(arg,key,method) add_assoc_function((arg),(key),(method))
144
af22085 added ZVAL_*() macros.
Thies C. Arntzen authored
145 #define ZVAL_RESOURCE(z,l) { \
146 (z)->type = IS_RESOURCE; \
147 (z)->value.lval = l; \
148 }
149 #define ZVAL_BOOL(z,b) { \
150 (z)->type = IS_BOOL; \
151 (z)->value.lval = b; \
152 }
153 #define ZVAL_NULL(z) { \
154 (z)->type = IS_NULL; \
155 }
156 #define ZVAL_LONG(z,l) { \
157 (z)->type = IS_LONG; \
158 (z)->value.lval = l; \
159 }
160 #define ZVAL_DOUBLE(z,d) { \
161 (z)->type = IS_DOUBLE; \
162 (z)->value.dval = d; \
163 }
164 #define ZVAL_STRING(z,s,duplicate) { \
165 char *__s=(s); \
166 (z)->value.str.len = strlen(__s); \
167 (z)->value.str.val = (duplicate?estrndup(__s,(z)->value.str.len):__s); \
168 (z)->type = IS_STRING; \
169 }
170 #define ZVAL_STRINGL(z,s,l,duplicate) { \
171 char *__s=(s); int __l=l; \
172 (z)->value.str.len = __l; \
173 (z)->value.str.val = (duplicate?estrndup(__s,__l):__s); \
174 (z)->type = IS_STRING; \
175 }
176
177 #define ZVAL_EMPTY_STRING(z) { \
178 (z)->value.str.len = 0; \
179 (z)->value.str.val = empty_string \
180 (z)->type = IS_STRING; \
181 }
182
183 #define ZVAL_FALSE { (z)->value.lval = 0; (z)->type = IS_BOOL; }
184 #define ZVAL_TRUE { (z)->value.lval = 1; (z)->type = IS_BOOL; }
185
eb5c6da added RETVAL_RESOURCE and RETURN_RESOURCE
Thies C. Arntzen authored
186 #define RETVAL_RESOURCE(l) { \
187 return_value->type = IS_RESOURCE;\
188 return_value->value.lval = l; \
189 }
1fe57c9 @zsuraski - Fix function_exists()
zsuraski authored
190 #define RETVAL_BOOL(b) { \
191 return_value->type = IS_BOOL; \
192 return_value->value.lval = b; \
193 }
bc6811e renamed RET???_UNSET -> RET???_NULL
Thies C. Arntzen authored
194 #define RETVAL_NULL() { \
bdefd5d @andigutmans - Change IS_UNSET -> IS_NULL
andigutmans authored
195 return_value->type = IS_NULL; \
f2d703e @zsuraski - Nuke undefined_variable_string
zsuraski authored
196 }
1f985ed @zsuraski Moved all #define's for SET_ and RETURN_ to zend_API.h
zsuraski authored
197 #define RETVAL_LONG(l) { \
198 return_value->type = IS_LONG; \
199 return_value->value.lval = l; \
200 }
201 #define RETVAL_DOUBLE(d) { \
202 return_value->type = IS_DOUBLE; \
203 return_value->value.dval = d; \
204 }
205 #define RETVAL_STRING(s,duplicate) { \
206 char *__s=(s); \
207 return_value->value.str.len = strlen(__s); \
208 return_value->value.str.val = (duplicate?estrndup(__s,return_value->value.str.len):__s); \
209 return_value->type = IS_STRING; \
210 }
211 #define RETVAL_STRINGL(s,l,duplicate) { \
212 char *__s=(s); int __l=l; \
213 return_value->value.str.len = __l; \
214 return_value->value.str.val = (duplicate?estrndup(__s,__l):__s); \
215 return_value->type = IS_STRING; \
216 }
217
af22085 added ZVAL_*() macros.
Thies C. Arntzen authored
218 #define RETVAL_EMPTY_STRING() { \
219 return_value->value.str.len = 0; \
220 return_value->value.str.val = empty_string \
221 return_value->type = IS_STRING; \
222 }
223
1f985ed @zsuraski Moved all #define's for SET_ and RETURN_ to zend_API.h
zsuraski authored
224 #define RETVAL_FALSE { return_value->value.lval = 0; return_value->type = IS_BOOL; }
225 #define RETVAL_TRUE { return_value->value.lval = 1; return_value->type = IS_BOOL; }
226
eb5c6da added RETVAL_RESOURCE and RETURN_RESOURCE
Thies C. Arntzen authored
227 #define RETURN_RESOURCE(l) { \
228 return_value->type = IS_RESOURCE;\
229 return_value->value.lval = l; \
230 return; \
231 }
1fe57c9 @zsuraski - Fix function_exists()
zsuraski authored
232
233 #define RETURN_BOOL(b) { \
234 return_value->type = IS_BOOL; \
235 return_value->value.lval = b; \
236 return; \
237 }
238
bc6811e renamed RET???_UNSET -> RET???_NULL
Thies C. Arntzen authored
239 #define RETURN_NULL() { \
bdefd5d @andigutmans - Change IS_UNSET -> IS_NULL
andigutmans authored
240 return_value->type = IS_NULL; \
f2d703e @zsuraski - Nuke undefined_variable_string
zsuraski authored
241 return; \
242 }
243
1f985ed @zsuraski Moved all #define's for SET_ and RETURN_ to zend_API.h
zsuraski authored
244 #define RETURN_LONG(l) { \
245 return_value->type = IS_LONG; \
246 return_value->value.lval = l; \
247 return; \
248 }
249 #define RETURN_DOUBLE(d) { \
250 return_value->type = IS_DOUBLE; \
251 return_value->value.dval = d; \
252 return; \
253 }
254 #define RETURN_STRING(s,duplicate) { \
255 char *__s=(s); \
256 return_value->value.str.len = strlen(__s); \
257 return_value->value.str.val = (duplicate?estrndup(__s,return_value->value.str.len):__s); \
258 return_value->type = IS_STRING; \
259 return; \
260 }
261 #define RETURN_STRINGL(s,l,duplicate) { \
262 char *__s=(s); int __l=l; \
263 return_value->value.str.len = __l; \
264 return_value->value.str.val = (duplicate?estrndup(__s,__l):__s); \
265 return_value->type = IS_STRING; \
266 return; \
267 }
268
af22085 added ZVAL_*() macros.
Thies C. Arntzen authored
269 #define RETURN_EMPTY_STRING() { \
270 return_value->value.str.len = 0; \
271 return_value->value.str.val = empty_string \
272 return_value->type = IS_STRING; \
273 return; \
274 }
275
1f985ed @zsuraski Moved all #define's for SET_ and RETURN_ to zend_API.h
zsuraski authored
276 #define RETURN_FALSE { RETVAL_FALSE; return; }
277 #define RETURN_TRUE { RETVAL_TRUE; return; }
278
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's prop…
zsuraski authored
279 #define SET_VAR_STRING(n,v) { \
280 { \
235386b @zsuraski Change ALLOC_ZVAL() semantics
zsuraski authored
281 zval *var; \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's prop…
zsuraski authored
282 char *str=(v); /* prevent 'v' from being evaluated more than once */ \
283 \
235386b @zsuraski Change ALLOC_ZVAL() semantics
zsuraski authored
284 ALLOC_ZVAL(var); \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's prop…
zsuraski authored
285 var->value.str.val = (str); \
286 var->value.str.len = strlen((str)); \
287 var->type = IS_STRING; \
6393ab1 @zsuraski Now that's an annoying bug.
zsuraski authored
288 ZEND_SET_GLOBAL_VAR(n, var); \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's prop…
zsuraski authored
289 } \
1f985ed @zsuraski Moved all #define's for SET_ and RETURN_ to zend_API.h
zsuraski authored
290 }
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's prop…
zsuraski authored
291
292 #define SET_VAR_STRINGL(n,v,l) { \
293 { \
235386b @zsuraski Change ALLOC_ZVAL() semantics
zsuraski authored
294 zval *var; \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's prop…
zsuraski authored
295 \
235386b @zsuraski Change ALLOC_ZVAL() semantics
zsuraski authored
296 ALLOC_ZVAL(var); \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's prop…
zsuraski authored
297 var->value.str.val = (v); \
298 var->value.str.len = (l); \
299 var->type = IS_STRING; \
300 ZEND_SET_GLOBAL_VAR(n, var); \
301 } \
1f985ed @zsuraski Moved all #define's for SET_ and RETURN_ to zend_API.h
zsuraski authored
302 }
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's prop…
zsuraski authored
303
304 #define SET_VAR_LONG(n,v) { \
305 { \
235386b @zsuraski Change ALLOC_ZVAL() semantics
zsuraski authored
306 zval *var; \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's prop…
zsuraski authored
307 \
235386b @zsuraski Change ALLOC_ZVAL() semantics
zsuraski authored
308 ALLOC_ZVAL(var); \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's prop…
zsuraski authored
309 var->value.lval = (v); \
310 var->type = IS_LONG; \
311 ZEND_SET_GLOBAL_VAR(n, var); \
312 } \
1f985ed @zsuraski Moved all #define's for SET_ and RETURN_ to zend_API.h
zsuraski authored
313 }
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's prop…
zsuraski authored
314
315 #define SET_VAR_DOUBLE(n,v) { \
316 { \
235386b @zsuraski Change ALLOC_ZVAL() semantics
zsuraski authored
317 zval *var; \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's prop…
zsuraski authored
318 \
235386b @zsuraski Change ALLOC_ZVAL() semantics
zsuraski authored
319 ALLOC_ZVAL(var); \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's prop…
zsuraski authored
320 var->value.dval = (v); \
321 var->type = IS_DOUBLE; \
322 ZEND_SET_GLOBAL_VAR(n, var); \
323 } \
1f985ed @zsuraski Moved all #define's for SET_ and RETURN_ to zend_API.h
zsuraski authored
324 }
325
326
c34560b @andigutmans - Remove _EX and make it the old _LENGTH
andigutmans authored
327 #define ZEND_SET_SYMBOL(symtable, name, var) \
328 { \
329 char *_name = (name); \
330 \
4c8259b @andigutmans - Call ZEND_SET_SYMBOL_WITH_LENGTH() with refcount 1 from the standard
andigutmans authored
331 ZEND_SET_SYMBOL_WITH_LENGTH(symtable, _name, strlen(_name)+1, var, 1, 0); \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's prop…
zsuraski authored
332 }
333
c34560b @andigutmans - Remove _EX and make it the old _LENGTH
andigutmans authored
334 #define ZEND_SET_SYMBOL_WITH_LENGTH(symtable, name, name_length, var, _refcount, _is_ref) \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's prop…
zsuraski authored
335 { \
336 zval **orig_var; \
337 \
620d013 @zsuraski Support symbols in any symbol table, not just the active one
zsuraski authored
338 if (zend_hash_find(symtable, (name), (name_length), (void **) &orig_var)==SUCCESS \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's prop…
zsuraski authored
339 && PZVAL_IS_REF(*orig_var)) { \
158088c @zsuraski Allow to set the reference count explicitly for ZEND_SET_SYMBOL_WITH_…
zsuraski authored
340 (var)->refcount = (*orig_var)->refcount; \
52a30fd Be safe, use ().
Andrei Zmievski authored
341 (var)->is_ref = 1; \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's prop…
zsuraski authored
342 \
2ddc4fe @zsuraski Make it possible to explicitly set refcount in ZEND_SET_SYMBOL_WITH_L…
zsuraski authored
343 if (_refcount) { \
344 (var)->refcount += _refcount-1; \
345 } \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's prop…
zsuraski authored
346 zval_dtor(*orig_var); \
158088c @zsuraski Allow to set the reference count explicitly for ZEND_SET_SYMBOL_WITH_…
zsuraski authored
347 **orig_var = *(var); \
62b2087 @andigutmans - Create two new macro's. ALLOC_ZVAL() and FREE_ZVAL(z) and make Zend…
andigutmans authored
348 FREE_ZVAL(var); \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's prop…
zsuraski authored
349 } else { \
2f5efbd @andigutmans - Add _EX macro for Andrei
andigutmans authored
350 (var)->is_ref = _is_ref; \
158088c @zsuraski Allow to set the reference count explicitly for ZEND_SET_SYMBOL_WITH_…
zsuraski authored
351 if (_refcount) { \
352 (var)->refcount = _refcount; \
353 } \
354 zend_hash_update(symtable, (name), (name_length), &(var), sizeof(zval *), NULL); \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's prop…
zsuraski authored
355 } \
356 }
357
620d013 @zsuraski Support symbols in any symbol table, not just the active one
zsuraski authored
358
359 #define ZEND_SET_GLOBAL_VAR(name, var) \
360 ZEND_SET_SYMBOL(&EG(symbol_table), name, var)
361
e345066 *** empty log message ***
Andrei Zmievski authored
362 #define ZEND_SET_GLOBAL_VAR_WITH_LENGTH(name, name_length, var, _refcount, _is_ref) \
363 ZEND_SET_SYMBOL_WITH_LENGTH(&EG(symbol_table), name, name_length, var, _refcount, _is_ref)
fec413c Added ZEND_SET_GLOBAL_VAR_WITH_LENGTH_EX() macro.
Andrei Zmievski authored
364
06a18f1 @andigutmans - Add some internal functions to Zend
andigutmans authored
365 #define HASH_OF(p) ((p)->type==IS_ARRAY ? (p)->value.ht : (((p)->type==IS_OBJECT ? (p)->value.obj.properties : NULL)))
af22085 added ZVAL_*() macros.
Thies C. Arntzen authored
366 #define ZVAL_IS_NULL(z) ((z)->type==IS_NULL)
06a18f1 @andigutmans - Add some internal functions to Zend
andigutmans authored
367
f962a35 Added zend_set_hash_symbol() function.
Andrei Zmievski authored
368 #endif /* _ZEND_API_H */
573b460 @andigutmans Zend Library
andigutmans authored
369
370 /*
371 * Local variables:
372 * tab-width: 4
373 * c-basic-offset: 4
374 * End:
375 */
Something went wrong with that request. Please try again.