Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 378 lines (321 sloc) 14.207 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 again,...
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
80bdd19 @zsuraski Fine tune Andi's patch
zsuraski authored
87 #ifndef ZEND_WIN32
573b460 @andigutmans Zend Library
andigutmans authored
88 #define DLEXPORT
89 #endif
90
e062843 *** empty log message ***
Andrei Zmievski authored
91 ZEND_API int zend_startup_module(zend_module_entry *module);
573b460 @andigutmans Zend Library
andigutmans authored
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 CVS...
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);
b995d2c Added add_property_unset() and add_property_bool().
Andrei Zmievski authored
135 ZEND_API int add_property_unset(zval *arg, char *key);
136 ZEND_API int add_property_bool(zval *arg, char *key, int b);
446e5d0 added add_property_resource
Thies C. Arntzen authored
137 ZEND_API int add_property_resource(zval *arg, char *key, long r);
573b460 @andigutmans Zend Library
andigutmans authored
138 ZEND_API int add_property_double(zval *arg, char *key, double d);
139 ZEND_API int add_property_string(zval *arg, char *key, char *str, int duplicate);
140 ZEND_API int add_property_stringl(zval *arg, char *key, char *str, uint length, int duplicate);
141
f962a35 Added zend_set_hash_symbol() function.
Andrei Zmievski authored
142 ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
143 int is_ref, int num_symbol_tables, ...);
144
573b460 @andigutmans Zend Library
andigutmans authored
145 #define add_method(arg,key,method) add_assoc_function((arg),(key),(method))
146
af22085 added ZVAL_*() macros.
Thies C. Arntzen authored
147 #define ZVAL_RESOURCE(z,l) { \
148 (z)->type = IS_RESOURCE; \
149 (z)->value.lval = l; \
150 }
151 #define ZVAL_BOOL(z,b) { \
152 (z)->type = IS_BOOL; \
153 (z)->value.lval = b; \
154 }
155 #define ZVAL_NULL(z) { \
156 (z)->type = IS_NULL; \
157 }
158 #define ZVAL_LONG(z,l) { \
159 (z)->type = IS_LONG; \
160 (z)->value.lval = l; \
161 }
162 #define ZVAL_DOUBLE(z,d) { \
163 (z)->type = IS_DOUBLE; \
164 (z)->value.dval = d; \
165 }
166 #define ZVAL_STRING(z,s,duplicate) { \
167 char *__s=(s); \
168 (z)->value.str.len = strlen(__s); \
169 (z)->value.str.val = (duplicate?estrndup(__s,(z)->value.str.len):__s); \
170 (z)->type = IS_STRING; \
171 }
172 #define ZVAL_STRINGL(z,s,l,duplicate) { \
173 char *__s=(s); int __l=l; \
174 (z)->value.str.len = __l; \
175 (z)->value.str.val = (duplicate?estrndup(__s,__l):__s); \
176 (z)->type = IS_STRING; \
177 }
178
179 #define ZVAL_EMPTY_STRING(z) { \
180 (z)->value.str.len = 0; \
181 (z)->value.str.val = empty_string \
182 (z)->type = IS_STRING; \
183 }
184
185 #define ZVAL_FALSE { (z)->value.lval = 0; (z)->type = IS_BOOL; }
186 #define ZVAL_TRUE { (z)->value.lval = 1; (z)->type = IS_BOOL; }
187
eb5c6da added RETVAL_RESOURCE and RETURN_RESOURCE
Thies C. Arntzen authored
188 #define RETVAL_RESOURCE(l) { \
189 return_value->type = IS_RESOURCE;\
190 return_value->value.lval = l; \
191 }
1fe57c9 @zsuraski - Fix function_exists()
zsuraski authored
192 #define RETVAL_BOOL(b) { \
193 return_value->type = IS_BOOL; \
194 return_value->value.lval = b; \
195 }
fb6a1b8 RETURN_NULL -> RETURN_NULL() // we don't want macros without an argumnet
Thies C. Arntzen authored
196 #define RETVAL_NULL() { \
bdefd5d @andigutmans - Change IS_UNSET -> IS_NULL
andigutmans authored
197 return_value->type = IS_NULL; \
f2d703e @zsuraski - Nuke undefined_variable_string
zsuraski authored
198 }
1f985ed @zsuraski Moved all #define's for SET_ and RETURN_ to zend_API.h
zsuraski authored
199 #define RETVAL_LONG(l) { \
200 return_value->type = IS_LONG; \
201 return_value->value.lval = l; \
202 }
203 #define RETVAL_DOUBLE(d) { \
204 return_value->type = IS_DOUBLE; \
205 return_value->value.dval = d; \
206 }
207 #define RETVAL_STRING(s,duplicate) { \
208 char *__s=(s); \
209 return_value->value.str.len = strlen(__s); \
210 return_value->value.str.val = (duplicate?estrndup(__s,return_value->value.str.len):__s); \
211 return_value->type = IS_STRING; \
212 }
213 #define RETVAL_STRINGL(s,l,duplicate) { \
214 char *__s=(s); int __l=l; \
215 return_value->value.str.len = __l; \
216 return_value->value.str.val = (duplicate?estrndup(__s,__l):__s); \
217 return_value->type = IS_STRING; \
218 }
219
af22085 added ZVAL_*() macros.
Thies C. Arntzen authored
220 #define RETVAL_EMPTY_STRING() { \
221 return_value->value.str.len = 0; \
222 return_value->value.str.val = empty_string \
223 return_value->type = IS_STRING; \
224 }
225
1f985ed @zsuraski Moved all #define's for SET_ and RETURN_ to zend_API.h
zsuraski authored
226 #define RETVAL_FALSE { return_value->value.lval = 0; return_value->type = IS_BOOL; }
227 #define RETVAL_TRUE { return_value->value.lval = 1; return_value->type = IS_BOOL; }
228
eb5c6da added RETVAL_RESOURCE and RETURN_RESOURCE
Thies C. Arntzen authored
229 #define RETURN_RESOURCE(l) { \
230 return_value->type = IS_RESOURCE;\
231 return_value->value.lval = l; \
232 return; \
233 }
1fe57c9 @zsuraski - Fix function_exists()
zsuraski authored
234
235 #define RETURN_BOOL(b) { \
236 return_value->type = IS_BOOL; \
237 return_value->value.lval = b; \
238 return; \
239 }
240
fb6a1b8 RETURN_NULL -> RETURN_NULL() // we don't want macros without an argumnet
Thies C. Arntzen authored
241 #define RETURN_NULL() { \
bdefd5d @andigutmans - Change IS_UNSET -> IS_NULL
andigutmans authored
242 return_value->type = IS_NULL; \
f2d703e @zsuraski - Nuke undefined_variable_string
zsuraski authored
243 return; \
244 }
245
1f985ed @zsuraski Moved all #define's for SET_ and RETURN_ to zend_API.h
zsuraski authored
246 #define RETURN_LONG(l) { \
247 return_value->type = IS_LONG; \
248 return_value->value.lval = l; \
249 return; \
250 }
251 #define RETURN_DOUBLE(d) { \
252 return_value->type = IS_DOUBLE; \
253 return_value->value.dval = d; \
254 return; \
255 }
256 #define RETURN_STRING(s,duplicate) { \
257 char *__s=(s); \
258 return_value->value.str.len = strlen(__s); \
259 return_value->value.str.val = (duplicate?estrndup(__s,return_value->value.str.len):__s); \
260 return_value->type = IS_STRING; \
261 return; \
262 }
263 #define RETURN_STRINGL(s,l,duplicate) { \
264 char *__s=(s); int __l=l; \
265 return_value->value.str.len = __l; \
266 return_value->value.str.val = (duplicate?estrndup(__s,__l):__s); \
267 return_value->type = IS_STRING; \
268 return; \
269 }
270
af22085 added ZVAL_*() macros.
Thies C. Arntzen authored
271 #define RETURN_EMPTY_STRING() { \
272 return_value->value.str.len = 0; \
273 return_value->value.str.val = empty_string \
274 return_value->type = IS_STRING; \
275 return; \
276 }
277
1f985ed @zsuraski Moved all #define's for SET_ and RETURN_ to zend_API.h
zsuraski authored
278 #define RETURN_FALSE { RETVAL_FALSE; return; }
279 #define RETURN_TRUE { RETVAL_TRUE; return; }
280
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's properl...
zsuraski authored
281 #define SET_VAR_STRING(n,v) { \
282 { \
235386b @zsuraski Change ALLOC_ZVAL() semantics
zsuraski authored
283 zval *var; \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's properl...
zsuraski authored
284 char *str=(v); /* prevent 'v' from being evaluated more than once */ \
285 \
235386b @zsuraski Change ALLOC_ZVAL() semantics
zsuraski authored
286 ALLOC_ZVAL(var); \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's properl...
zsuraski authored
287 var->value.str.val = (str); \
288 var->value.str.len = strlen((str)); \
289 var->type = IS_STRING; \
6393ab1 @zsuraski Now that's an annoying bug.
zsuraski authored
290 ZEND_SET_GLOBAL_VAR(n, var); \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's properl...
zsuraski authored
291 } \
1f985ed @zsuraski Moved all #define's for SET_ and RETURN_ to zend_API.h
zsuraski authored
292 }
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's properl...
zsuraski authored
293
294 #define SET_VAR_STRINGL(n,v,l) { \
295 { \
235386b @zsuraski Change ALLOC_ZVAL() semantics
zsuraski authored
296 zval *var; \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's properl...
zsuraski authored
297 \
235386b @zsuraski Change ALLOC_ZVAL() semantics
zsuraski authored
298 ALLOC_ZVAL(var); \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's properl...
zsuraski authored
299 var->value.str.val = (v); \
300 var->value.str.len = (l); \
301 var->type = IS_STRING; \
302 ZEND_SET_GLOBAL_VAR(n, var); \
303 } \
1f985ed @zsuraski Moved all #define's for SET_ and RETURN_ to zend_API.h
zsuraski authored
304 }
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's properl...
zsuraski authored
305
306 #define SET_VAR_LONG(n,v) { \
307 { \
235386b @zsuraski Change ALLOC_ZVAL() semantics
zsuraski authored
308 zval *var; \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's properl...
zsuraski authored
309 \
235386b @zsuraski Change ALLOC_ZVAL() semantics
zsuraski authored
310 ALLOC_ZVAL(var); \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's properl...
zsuraski authored
311 var->value.lval = (v); \
312 var->type = IS_LONG; \
313 ZEND_SET_GLOBAL_VAR(n, var); \
314 } \
1f985ed @zsuraski Moved all #define's for SET_ and RETURN_ to zend_API.h
zsuraski authored
315 }
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's properl...
zsuraski authored
316
317 #define SET_VAR_DOUBLE(n,v) { \
318 { \
235386b @zsuraski Change ALLOC_ZVAL() semantics
zsuraski authored
319 zval *var; \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's properl...
zsuraski authored
320 \
235386b @zsuraski Change ALLOC_ZVAL() semantics
zsuraski authored
321 ALLOC_ZVAL(var); \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's properl...
zsuraski authored
322 var->value.dval = (v); \
323 var->type = IS_DOUBLE; \
324 ZEND_SET_GLOBAL_VAR(n, var); \
325 } \
1f985ed @zsuraski Moved all #define's for SET_ and RETURN_ to zend_API.h
zsuraski authored
326 }
327
328
c34560b @andigutmans - Remove _EX and make it the old _LENGTH
andigutmans authored
329 #define ZEND_SET_SYMBOL(symtable, name, var) \
330 { \
331 char *_name = (name); \
332 \
4c8259b @andigutmans - Call ZEND_SET_SYMBOL_WITH_LENGTH() with refcount 1 from the standard
andigutmans authored
333 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 properl...
zsuraski authored
334 }
335
c34560b @andigutmans - Remove _EX and make it the old _LENGTH
andigutmans authored
336 #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 properl...
zsuraski authored
337 { \
338 zval **orig_var; \
339 \
620d013 @zsuraski Support symbols in any symbol table, not just the active one
zsuraski authored
340 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 properl...
zsuraski authored
341 && PZVAL_IS_REF(*orig_var)) { \
158088c @zsuraski Allow to set the reference count explicitly for ZEND_SET_SYMBOL_WITH_LEN...
zsuraski authored
342 (var)->refcount = (*orig_var)->refcount; \
52a30fd Be safe, use ().
Andrei Zmievski authored
343 (var)->is_ref = 1; \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's properl...
zsuraski authored
344 \
2ddc4fe @zsuraski Make it possible to explicitly set refcount in ZEND_SET_SYMBOL_WITH_LENG...
zsuraski authored
345 if (_refcount) { \
346 (var)->refcount += _refcount-1; \
347 } \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's properl...
zsuraski authored
348 zval_dtor(*orig_var); \
158088c @zsuraski Allow to set the reference count explicitly for ZEND_SET_SYMBOL_WITH_LEN...
zsuraski authored
349 **orig_var = *(var); \
62b2087 @andigutmans - Create two new macro's. ALLOC_ZVAL() and FREE_ZVAL(z) and make Zend us...
andigutmans authored
350 FREE_ZVAL(var); \
48ffdd7 @zsuraski * Setting variables in the global scope wasn't handling is_ref's properl...
zsuraski authored
351 } else { \
2f5efbd @andigutmans - Add _EX macro for Andrei
andigutmans authored
352 (var)->is_ref = _is_ref; \
158088c @zsuraski Allow to set the reference count explicitly for ZEND_SET_SYMBOL_WITH_LEN...
zsuraski authored
353 if (_refcount) { \
354 (var)->refcount = _refcount; \
355 } \
356 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 properl...
zsuraski authored
357 } \
358 }
359
620d013 @zsuraski Support symbols in any symbol table, not just the active one
zsuraski authored
360
361 #define ZEND_SET_GLOBAL_VAR(name, var) \
362 ZEND_SET_SYMBOL(&EG(symbol_table), name, var)
363
e345066 *** empty log message ***
Andrei Zmievski authored
364 #define ZEND_SET_GLOBAL_VAR_WITH_LENGTH(name, name_length, var, _refcount, _is_ref) \
365 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
366
06a18f1 @andigutmans - Add some internal functions to Zend
andigutmans authored
367 #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
368 #define ZVAL_IS_NULL(z) ((z)->type==IS_NULL)
06a18f1 @andigutmans - Add some internal functions to Zend
andigutmans authored
369
f962a35 Added zend_set_hash_symbol() function.
Andrei Zmievski authored
370 #endif /* _ZEND_API_H */
573b460 @andigutmans Zend Library
andigutmans authored
371
372 /*
373 * Local variables:
374 * tab-width: 4
375 * c-basic-offset: 4
376 * End:
377 */
Something went wrong with that request. Please try again.