Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 629 lines (476 sloc) 19.036 kb
573b4602 » andigutmans
1999-04-07 Zend Library
1 /*
2 +----------------------------------------------------------------------+
3 | Zend Engine |
4 +----------------------------------------------------------------------+
5e55e47f » zsuraski
2000-03-06 It's official now...
5 | Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
573b4602 » andigutmans
1999-04-07 Zend Library
6 +----------------------------------------------------------------------+
5e55e47f » zsuraski
2000-03-06 It's official now...
7 | This source file is subject to version 0.92 of the Zend license, |
b5b11177 » zsuraski
1999-07-16 License update
8 | that is bundled with this package in the file LICENSE, and is |
9 | available at through the world-wide-web at |
5e55e47f » zsuraski
2000-03-06 It's official now...
10 | http://www.zend.com/license/0_92.txt. |
b5b11177 » zsuraski
1999-07-16 License update
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. |
573b4602 » andigutmans
1999-04-07 Zend Library
14 +----------------------------------------------------------------------+
15 | Authors: Andi Gutmans <andi@zend.com> |
16 | Zeev Suraski <zeev@zend.com> |
17 +----------------------------------------------------------------------+
18 */
19
b5b11177 » zsuraski
1999-07-16 License update
20
a6172174 » Sascha Schumann
2000-07-03 Replace macros which begin with an underscore through an appropiately
21 #ifndef ZEND_COMPILE_H
22 #define ZEND_COMPILE_H
573b4602 » andigutmans
1999-04-07 Zend Library
23
24 #include "zend.h"
fa76f0c9 » zsuraski
1999-04-14 Compile fix
25
009025e0 » Stig S. Bakken
1999-09-06 * header file cleanup
26 #ifdef HAVE_STDARG_H
27 # include <stdarg.h>
fa76f0c9 » zsuraski
1999-04-14 Compile fix
28 #endif
29
e95220e7 » andigutmans
2000-07-11 - Include iostream.h in C++.
30 #ifdef __cplusplus
f4e2a900 » andigutmans
2000-07-11 - Oops. Too early in the morning
31 #include <istream.h>
e95220e7 » andigutmans
2000-07-11 - Include iostream.h in C++.
32 #endif
33
573b4602 » andigutmans
1999-04-07 Zend Library
34 #include "zend_llist.h"
35
36 #define DEBUG_ZEND 0
fcaf734f » andigutmans
1999-05-02 - Don't support interactive mode when thread safe.
37
38 #ifndef ZTS
009025e0 » Stig S. Bakken
1999-09-06 * header file cleanup
39 # define SUPPORT_INTERACTIVE 1
fcaf734f » andigutmans
1999-05-02 - Don't support interactive mode when thread safe.
40 #else
009025e0 » Stig S. Bakken
1999-09-06 * header file cleanup
41 # define SUPPORT_INTERACTIVE 0
fcaf734f » andigutmans
1999-05-02 - Don't support interactive mode when thread safe.
42 #endif
573b4602 » andigutmans
1999-04-07 Zend Library
43
44 #define FREE_PNODE(znode) zval_dtor(&znode->u.constant);
45 #define FREE_OP(op, should_free) if (should_free) zval_dtor(&Ts[(op)->u.var].tmp_var);
46
47
48 #if SUPPORT_INTERACTIVE
49 #define INC_BPC(op_array) ((op_array)->backpatch_count++)
50 #define DEC_BPC(op_array) ((op_array)->backpatch_count--)
51 #define HANDLE_INTERACTIVE() if (EG(interactive)) { execute_new_code(CLS_C); }
52 #else
53 #define INC_BPC(op_array)
54 #define DEC_BPC(op_array)
55 #define HANDLE_INTERACTIVE()
56 #endif
57
58 typedef struct _zend_op_array zend_op_array;
59
1250c43a » zsuraski
1999-05-22 * Add struct name to all typedef's so that they can be debugged with …
60 typedef struct _znode {
573b4602 » andigutmans
1999-04-07 Zend Library
61 int op_type;
62 union {
63 zval constant;
64
e92f6f15 » andigutmans
2000-03-13 - define zend_uint and zend_uchar and use them in a few places
65 zend_uint var;
232b9045 » zsuraski
2000-04-10 Clean up last/size definitions
66 zend_uint opline_num; /* Needs to be signed */
69eb908f » andigutmans
2000-05-03 - Change fetch_type to be zend_uint
67 zend_uint fetch_type;
573b4602 » andigutmans
1999-04-07 Zend Library
68 zend_op_array *op_array;
69 struct {
e92f6f15 » andigutmans
2000-03-13 - define zend_uint and zend_uchar and use them in a few places
70 zend_uint var; /* dummy */
71 zend_uint type;
573b4602 » andigutmans
1999-04-07 Zend Library
72 } EA;
73 } u;
74 } znode;
75
76
77 typedef struct _zend_op {
e92f6f15 » andigutmans
2000-03-13 - define zend_uint and zend_uchar and use them in a few places
78 zend_uchar opcode;
573b4602 » andigutmans
1999-04-07 Zend Library
79 znode result;
80 znode op1;
81 znode op2;
39a7f4c3 » zsuraski
1999-04-12 This patch is a go. Not fully optimized yet, but working properly.
82 ulong extended_value;
573b4602 » andigutmans
1999-04-07 Zend Library
83 uint lineno;
84 } zend_op;
85
86
1250c43a » zsuraski
1999-05-22 * Add struct name to all typedef's so that they can be debugged with …
87 typedef struct _zend_brk_cont_element {
573b4602 » andigutmans
1999-04-07 Zend Library
88 int cont;
89 int brk;
90 int parent;
91 } zend_brk_cont_element;
92
93
94 struct _zend_op_array {
e92f6f15 » andigutmans
2000-03-13 - define zend_uint and zend_uchar and use them in a few places
95 zend_uchar type; /* MUST be the first element of this struct! */
573b4602 » andigutmans
1999-04-07 Zend Library
96
e92f6f15 » andigutmans
2000-03-13 - define zend_uint and zend_uchar and use them in a few places
97 zend_uchar *arg_types; /* MUST be the second element of this struct! */
7f35cfda » zsuraski
1999-10-25 *** empty log message ***
98 char *function_name; /* MUST be the third element of this struct! */
573b4602 » andigutmans
1999-04-07 Zend Library
99
e92f6f15 » andigutmans
2000-03-13 - define zend_uint and zend_uchar and use them in a few places
100 zend_uint *refcount;
573b4602 » andigutmans
1999-04-07 Zend Library
101
102 zend_op *opcodes;
232b9045 » zsuraski
2000-04-10 Clean up last/size definitions
103 zend_uint last, size;
573b4602 » andigutmans
1999-04-07 Zend Library
104
e92f6f15 » andigutmans
2000-03-13 - define zend_uint and zend_uchar and use them in a few places
105 zend_uint T;
573b4602 » andigutmans
1999-04-07 Zend Library
106
107 zend_brk_cont_element *brk_cont_array;
e92f6f15 » andigutmans
2000-03-13 - define zend_uint and zend_uchar and use them in a few places
108 zend_uint last_brk_cont;
109 zend_uint current_brk_cont;
110 zend_bool uses_globals;
573b4602 » andigutmans
1999-04-07 Zend Library
111
112 /* static variables support */
113 HashTable *static_variables;
114
115 #if SUPPORT_INTERACTIVE
116 int start_op_number, end_op_number;
117 int last_executed_op_number;
118 int backpatch_count;
119 #endif
ced9cee1 » zsuraski
1999-12-15 - Implement return by reference:
120 zend_bool return_reference;
42d15298 » zsuraski
2000-04-29 Fix possible bug with extension dtors being called without the ctors …
121 zend_bool done_pass_two;
573b4602 » andigutmans
1999-04-07 Zend Library
122
c06692e9 » zsuraski
2000-08-09 The patch we promised - redesigned the compilation/execution API:
123 char *filename;
124
b5f5e9a6 » andigutmans
1999-08-15 - Optimize the execute stack a bit.
125 void *reserved[ZEND_MAX_RESERVED_RESOURCES];
573b4602 » andigutmans
1999-04-07 Zend Library
126 };
127
128
1250c43a » zsuraski
1999-05-22 * Add struct name to all typedef's so that they can be debugged with …
129 typedef struct _zend_internal_function {
e92f6f15 » andigutmans
2000-03-13 - define zend_uint and zend_uchar and use them in a few places
130 zend_uchar type; /* MUST be the first element of this struct! */
573b4602 » andigutmans
1999-04-07 Zend Library
131
e92f6f15 » andigutmans
2000-03-13 - define zend_uint and zend_uchar and use them in a few places
132 zend_uchar *arg_types; /* MUST be the second element of this struct */
7f35cfda » zsuraski
1999-10-25 *** empty log message ***
133 char *function_name; /* MUST be the third element of this struct */
573b4602 » andigutmans
1999-04-07 Zend Library
134
135 void (*handler)(INTERNAL_FUNCTION_PARAMETERS);
136 } zend_internal_function;
137
138
e663d856 » zsuraski
2000-04-10 Fix object overloading support
139 typedef struct _zend_overloaded_function {
140 zend_uchar type; /* MUST be the first element of this struct! */
141
142 zend_uchar *arg_types; /* MUST be the second element of this struct */
143 char *function_name; /* MUST be the third element of this struct */
144
145 zend_uint var;
146 } zend_overloaded_function;
147
148
1250c43a » zsuraski
1999-05-22 * Add struct name to all typedef's so that they can be debugged with …
149 typedef union _zend_function {
e92f6f15 » andigutmans
2000-03-13 - define zend_uint and zend_uchar and use them in a few places
150 zend_uchar type; /* MUST be the first element of this struct! */
573b4602 » andigutmans
1999-04-07 Zend Library
151 struct {
e92f6f15 » andigutmans
2000-03-13 - define zend_uint and zend_uchar and use them in a few places
152 zend_uchar type; /* never used */
153 zend_uchar *arg_types;
7f35cfda » zsuraski
1999-10-25 *** empty log message ***
154 char *function_name;
573b4602 » andigutmans
1999-04-07 Zend Library
155 } common;
156
157 zend_op_array op_array;
158 zend_internal_function internal_function;
e663d856 » zsuraski
2000-04-10 Fix object overloading support
159 zend_overloaded_function overloaded_function;
573b4602 » andigutmans
1999-04-07 Zend Library
160 } zend_function;
161
162
9cb2cf13 » zsuraski
1999-05-20 Optimize allocations into uninitialized_zval assignments
163 typedef struct _zend_function_state {
573b4602 » andigutmans
1999-04-07 Zend Library
164 HashTable *function_symbol_table;
165 zend_function *function;
b5f5e9a6 » andigutmans
1999-08-15 - Optimize the execute stack a bit.
166 void *reserved[ZEND_MAX_RESERVED_RESOURCES];
573b4602 » andigutmans
1999-04-07 Zend Library
167 } zend_function_state;
168
169
1250c43a » zsuraski
1999-05-22 * Add struct name to all typedef's so that they can be debugged with …
170 typedef struct _zend_switch_entry {
573b4602 » andigutmans
1999-04-07 Zend Library
171 znode cond;
172 int default_case;
173 int control_var;
174 } zend_switch_entry;
175
176
1250c43a » zsuraski
1999-05-22 * Add struct name to all typedef's so that they can be debugged with …
177 typedef struct _list_llist_element {
573b4602 » andigutmans
1999-04-07 Zend Library
178 znode var;
179 zend_llist dimensions;
180 znode value;
181 } list_llist_element;
182
183
39f9487e » andigutmans
1999-04-14 -Tiny patches
184 typedef struct _zend_file_handle {
61379fe0 » andigutmans
2000-03-13 - Another zend_uchar
185 zend_uchar type;
573b4602 » andigutmans
1999-04-07 Zend Library
186 char *filename;
5463dd5b » andigutmans
1999-11-30 - Add use support (behaves like require, but will not use the same fi…
187 char *opened_path;
573b4602 » andigutmans
1999-04-07 Zend Library
188 union {
189 int fd;
190 FILE *fp;
191 #ifdef __cplusplus
192 istream *is;
193 #endif
194 } handle;
9baad804 » zsuraski
1999-12-04 - Break the zend->PHP dependency introduced by the .php extension for…
195 zend_bool free_filename;
573b4602 » andigutmans
1999-04-07 Zend Library
196 } zend_file_handle;
197
198
199
200 #define IS_CONST (1<<0)
201 #define IS_TMP_VAR (1<<1)
202 #define IS_VAR (1<<2)
203 #define IS_UNUSED (1<<3) /* Unused variable */
204
205
206 #define EXT_TYPE_UNUSED (1<<0)
207
df74f1df » Sascha Schumann
2000-06-13 Add optional support for C0x inline semantics.
208 #include "zend_globals.h"
209
ad115d20 » zsuraski
2000-01-29 Fix require()
210 BEGIN_EXTERN_C()
211
573b4602 » andigutmans
1999-04-07 Zend Library
212 void init_compiler(CLS_D ELS_DC);
213 void shutdown_compiler(CLS_D);
214
7795aca4 » zsuraski
2000-08-15 Fix warning issue (compile errors inside require()'d files were incor…
215 extern ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type CLS_DC);
573b4602 » andigutmans
1999-04-07 Zend Library
216
ed06a70f » zsuraski
1999-06-05 * Centralized shutdown
217 void zend_activate(CLS_D ELS_DC);
218 void zend_deactivate(CLS_D ELS_DC);
3b88c31b » Thies C. Arntzen
2000-03-19 kill warning
219 void zend_activate_modules(void);
a8b0d960 » andigutmans
2000-05-21 - Fix Apache php source highlighting mode. It was crashing due to the
220 void zend_deactivate_modules(void);
dc0e6632 » zsuraski
2000-01-16 Allow module startup to be separate from the compiler/executor startup
221
ed06a70f » zsuraski
1999-06-05 * Centralized shutdown
222
573b4602 » andigutmans
1999-04-07 Zend Library
223 int lex_scan(zval *zendlval CLS_DC);
224 void startup_scanner(CLS_D);
225 void shutdown_scanner(CLS_D);
226
07e08855 » andigutmans
1999-08-02 Make set_compiled_filename() return a pointer to the allocated file name
227 ZEND_API char *zend_set_compiled_filename(char *new_compiled_filename);
573b4602 » andigutmans
1999-04-07 Zend Library
228 ZEND_API void zend_restore_compiled_filename(char *original_compiled_filename);
b6197bcf » zsuraski
2000-02-04 Maintain a state of whether we're compiling and/or executing
229 ZEND_API char *zend_get_compiled_filename(CLS_D);
230 ZEND_API int zend_get_compiled_lineno(CLS_D);
573b4602 » andigutmans
1999-04-07 Zend Library
231
1aa2c5c0 » zsuraski
1999-04-23 Ok, call me crazy, because I probably am.
232 #ifdef ZTS
233 const char *zend_get_zendtext(CLS_D);
234 int zend_get_zendleng(CLS_D);
235 #endif
236
573b4602 » andigutmans
1999-04-07 Zend Library
237
238 /* parser-driven code generators */
239 void do_binary_op(int op, znode *result, znode *op1, znode *op2 CLS_DC);
240 void do_unary_op(int op, znode *result, znode *op1 CLS_DC);
241 void do_binary_assign_op(int op, znode *result, znode *op1, znode *op2 CLS_DC);
242 void do_assign(znode *result, znode *variable, znode *value CLS_DC);
243 void do_assign_ref(znode *result, znode *lvar, znode *rvar CLS_DC);
244 void fetch_simple_variable(znode *result, znode *varname, int bp CLS_DC);
82c8a9e7 » andigutmans
1999-09-20 - Indirect references had all of the fetches by mistakenly backpatched.
245 void fetch_simple_variable_ex(znode *result, znode *varname, int bp, int op CLS_DC);
573b4602 » andigutmans
1999-04-07 Zend Library
246 void do_indirect_references(znode *result, znode *num_references, znode *variable CLS_DC);
247 void do_fetch_global_or_static_variable(znode *varname, znode *static_assignment, int fetch_type CLS_DC);
7a87fcbb » zsuraski
1999-04-21 Thread safety patch. We're still not quite there but it compiles agai…
248 void do_fetch_globals(znode *varname CLS_DC);
573b4602 » andigutmans
1999-04-07 Zend Library
249
250 void fetch_array_begin(znode *result, znode *varname, znode *first_dim CLS_DC);
251 void fetch_array_dim(znode *result, znode *parent, znode *dim CLS_DC);
7663e4f6 » andigutmans
2000-01-29 - Add parser support for string offsets. This added three shift/reduce
252 void fetch_string_offset(znode *result, znode *parent, znode *offset CLS_DC);
573b4602 » andigutmans
1999-04-07 Zend Library
253 void do_print(znode *result, znode *arg CLS_DC);
254 void do_echo(znode *arg CLS_DC);
88029643 » Sascha Schumann
1999-05-30 * fix some casts
255 typedef int (*unary_op_type)(zval *, zval *);
256 ZEND_API unary_op_type get_unary_op(int opcode);
573b4602 » andigutmans
1999-04-07 Zend Library
257 ZEND_API void *get_binary_op(int opcode);
258
259 void do_while_cond(znode *expr, znode *close_bracket_token CLS_DC);
260 void do_while_end(znode *while_token, znode *close_bracket_token CLS_DC);
261 void do_do_while_begin(CLS_D);
400ee6ca » andigutmans
1999-12-31 - Fix bug #3073. continue in do..while() loops should work now
262 void do_do_while_end(znode *do_token, znode *expr_open_bracket, znode *expr CLS_DC);
573b4602 » andigutmans
1999-04-07 Zend Library
263
264
265 void do_if_cond(znode *cond, znode *closing_bracket_token CLS_DC);
266 void do_if_after_statement(znode *closing_bracket_token, unsigned char initialize CLS_DC);
267 void do_if_end(CLS_D);
268
269 void do_for_cond(znode *expr, znode *second_semicolon_token CLS_DC);
270 void do_for_before_statement(znode *cond_start, znode *second_semicolon_token CLS_DC);
271 void do_for_end(znode *second_semicolon_token CLS_DC);
272
273 void do_pre_incdec(znode *result, znode *op1, int op CLS_DC);
274 void do_post_incdec(znode *result, znode *op1, int op CLS_DC);
275
276 void do_begin_variable_parse(CLS_D);
06d04d15 » andigutmans
1999-09-29 - Fix SEND_VAR problem after fetch'ing a variable and not knowing the…
277 void do_end_variable_parse(int type, int arg_offset CLS_DC);
573b4602 » andigutmans
1999-04-07 Zend Library
278
1b6fae10 » zsuraski
1999-07-24 Thoroughly fix the SWITCH problem. No RETURN handling yet.
279 void do_free(znode *op1 CLS_DC);
573b4602 » andigutmans
1999-04-07 Zend Library
280
7a87fcbb » zsuraski
1999-04-21 Thread safety patch. We're still not quite there but it compiles agai…
281 void do_init_string(znode *result CLS_DC);
573b4602 » andigutmans
1999-04-07 Zend Library
282 void do_add_char(znode *result, znode *op1, znode *op2 CLS_DC);
283 void do_add_string(znode *result, znode *op1, znode *op2 CLS_DC);
284 void do_add_variable(znode *result, znode *op1, znode *op2 CLS_DC);
285
ced9cee1 » zsuraski
1999-12-15 - Implement return by reference:
286 void do_begin_function_declaration(znode *function_token, znode *function_name, int is_method, int return_reference CLS_DC);
573b4602 » andigutmans
1999-04-07 Zend Library
287 void do_end_function_declaration(znode *function_token CLS_DC);
288 void do_receive_arg(int op, znode *var, znode *offset, znode *initialization, unsigned char pass_type CLS_DC);
739132e5 » andigutmans
1999-07-29 - Fixed a leak when doing inheritance. The parent class name wasn't b…
289 int do_begin_function_call(znode *function_name CLS_DC);
573b4602 » andigutmans
1999-04-07 Zend Library
290 void do_begin_dynamic_function_call(znode *function_name CLS_DC);
291 void do_begin_class_member_function_call(znode *class_name, znode *function_name CLS_DC);
739132e5 » andigutmans
1999-07-29 - Fixed a leak when doing inheritance. The parent class name wasn't b…
292 void do_end_function_call(znode *function_name, znode *result, znode *argument_list, int is_method, int is_dynamic_fcall CLS_DC);
7fe808ea » andigutmans
1999-12-17 - By mistake commited this to the branch. It fixes a bug we introduce…
293 void do_return(znode *expr, int do_end_vparse CLS_DC);
ef5b7e21 » zsuraski
1999-08-14 Generate better warnings for class/function redefinitions
294 ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_table, HashTable *class_table, int compile_time);
eb0e6946 » andigutmans
2000-06-09 - Andrei, this is for you!
295 void do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce);
b0bfa458 » zsuraski
1999-05-15 * Fix all hash checks that checked Bucket.arKey for NULL, when it was…
296 void do_early_binding(CLS_D);
573b4602 » andigutmans
1999-04-07 Zend Library
297
298 void do_pass_param(znode *param, int op, int offset CLS_DC);
299
300
301 void do_boolean_or_begin(znode *expr1, znode *op_token CLS_DC);
302 void do_boolean_or_end(znode *result, znode *expr1, znode *expr2, znode *op_token CLS_DC);
303 void do_boolean_and_begin(znode *expr1, znode *op_token CLS_DC);
304 void do_boolean_and_end(znode *result, znode *expr1, znode *expr2, znode *op_token CLS_DC);
305
306 void do_brk_cont(int op, znode *expr CLS_DC);
307
308 void do_switch_cond(znode *cond CLS_DC);
309 void do_switch_end(znode *case_list CLS_DC);
310 void do_case_before_statement(znode *case_list, znode *case_token, znode *case_expr CLS_DC);
311 void do_case_after_statement(znode *result, znode *case_token CLS_DC);
312 void do_default_before_statement(znode *case_list, znode *default_token CLS_DC);
313
314 void do_begin_class_declaration(znode *class_name, znode *parent_class_name CLS_DC);
315 void do_end_class_declaration(CLS_D);
316 void do_declare_property(znode *var_name, znode *value CLS_DC);
317
318 void do_fetch_property(znode *result, znode *object, znode *property CLS_DC);
319
320
321 void do_push_object(znode *object CLS_DC);
322 void do_pop_object(znode *object CLS_DC);
323
324
8f51f72d » andigutmans
1999-07-26 - Fix the new operator incompatibility.
325 void do_begin_new_object(znode *new_token, znode *class_name CLS_DC);
326 void do_end_new_object(znode *result, znode *class_name, znode *new_token, znode *argument_list CLS_DC);
573b4602 » andigutmans
1999-04-07 Zend Library
327
328 void do_fetch_constant(znode *result, znode *constant_name, int mode CLS_DC);
329
330 void do_shell_exec(znode *result, znode *cmd CLS_DC);
331
03d354dc » andigutmans
1999-10-01 - For Andrei. Implement references in array() initializations
332 void do_init_array(znode *result, znode *expr, znode *offset, int is_ref CLS_DC);
333 void do_add_array_element(znode *result, znode *expr, znode *offset, int is_ref CLS_DC);
7ed49234 » andigutmans
1999-06-09 - Fix the static array() initializing
334 void do_add_static_array_element(znode *result, znode *offset, znode *expr);
fdcaba40 » zsuraski
1999-12-02 Solve a couple of compile issues
335 void do_list_init(CLS_D);
573b4602 » andigutmans
1999-04-07 Zend Library
336 void do_list_end(znode *result, znode *expr CLS_DC);
337 void do_add_list_element(znode *element CLS_DC);
338 void do_new_list_begin(CLS_D);
339 void do_new_list_end(CLS_D);
340
341 void do_cast(znode *result, znode *expr, int type CLS_DC);
342 void do_include_or_eval(int type, znode *result, znode *op1 CLS_DC);
343
344 void do_unset(znode *variable CLS_DC);
345 void do_isset_or_isempty(int type, znode *result, znode *variable CLS_DC);
346
e5015ed5 » andigutmans
2000-08-10 @ Fix problem with nested foreach()'s (Andi, Zend Engine)
347 void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_token, znode *as_token, int variable CLS_DC);
573b4602 » andigutmans
1999-04-07 Zend Library
348 void do_foreach_cont(znode *value, znode *key, znode *as_token CLS_DC);
349 void do_foreach_end(znode *foreach_token, znode *open_brackets_token CLS_DC);
350
fafbf6d8 » zsuraski
2000-01-24 - Implement declare() with declarables framework
351 void do_declare_begin(CLS_D);
352 void do_declare_stmt(znode *var, znode *val CLS_DC);
353 void do_declare_end(CLS_D);
354
573b4602 » andigutmans
1999-04-07 Zend Library
355 void do_end_heredoc(CLS_D);
356
357 void do_exit(znode *result, znode *message CLS_DC);
358
359 void do_begin_silence(znode *strudel_token CLS_DC);
360 void do_end_silence(znode *strudel_token CLS_DC);
361
362 void do_begin_qm_op(znode *cond, znode *qm_token CLS_DC);
363 void do_qm_true(znode *true_value, znode *qm_token, znode *colon_token CLS_DC);
364 void do_qm_false(znode *result, znode *false_value, znode *qm_token, znode *colon_token CLS_DC);
365
366 void do_extended_info(CLS_D);
367 void do_extended_fcall_begin(CLS_D);
368 void do_extended_fcall_end(CLS_D);
369
fafbf6d8 » zsuraski
2000-01-24 - Implement declare() with declarables framework
370 void do_ticks(CLS_D);
371
727398b2 » andigutmans
2000-06-13 Add to the API
372 ZEND_API void function_add_ref(zend_function *function);
0b7a9cea » zsuraski
2000-06-03 - Fix Win32 compilation (Use winsock2.h from now on)
373
7c4a0838 » zsuraski
1999-04-26 Various thread safety fixes and DLL updates
374 #define INITIAL_OP_ARRAY_SIZE 64
375
573b4602 » andigutmans
1999-04-07 Zend Library
376
7b0d92dd » zsuraski
2000-10-29 Unify the names of these last 3 files...
377 /* helper functions in zend_language_scanner.l */
7795aca4 » zsuraski
2000-08-15 Fix warning issue (compile errors inside require()'d files were incor…
378 ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type CLS_DC);
5286b397 » zsuraski
2000-09-12 Make compile_string() accept a description of the code
379 ZEND_API zend_op_array *compile_string(zval *source_string, char *filename CLS_DC);
4b6594c5 » zsuraski
2000-04-27 Change to using the #define's
380 ZEND_API zend_op_array *compile_filename(int type, zval *filename CLS_DC ELS_DC);
c06692e9 » zsuraski
2000-08-09 The patch we promised - redesigned the compilation/execution API:
381 ZEND_API int zend_execute_scripts(int type CLS_DC ELS_DC, int file_count, ...);
1877b077 » Sascha Schumann
1999-10-05 This causes link problems with anything higher than -O0.
382 ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC);
c06692e9 » zsuraski
2000-08-09 The patch we promised - redesigned the compilation/execution API:
383 ZEND_API void init_op_array(zend_op_array *op_array, int type, int initial_ops_size CLS_DC);
573b4602 » andigutmans
1999-04-07 Zend Library
384 ZEND_API void destroy_op_array(zend_op_array *op_array);
5090b1e8 » smalyshev
2000-08-13 Fix zend_fiel_handle handling. Should fix URL include
385 ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle CLS_DC);
386 ZEND_API void zend_file_handle_dtor(zend_file_handle *fh);
573b4602 » andigutmans
1999-04-07 Zend Library
387
62114c18 » zsuraski
2000-01-17 Destructors no longer return ints, the low level problem it was inten…
388 ZEND_API void destroy_zend_function(zend_function *function);
389 ZEND_API void destroy_zend_class(zend_class_entry *ce);
7c4a0838 » zsuraski
1999-04-26 Various thread safety fixes and DLL updates
390 void zend_class_add_ref(zend_class_entry *ce);
391
62114c18 » zsuraski
2000-01-17 Destructors no longer return ints, the low level problem it was inten…
392 #define ZEND_FUNCTION_DTOR (void (*)(void *)) destroy_zend_function
393 #define ZEND_CLASS_DTOR (void (*)(void *)) destroy_zend_class
81d901b1 » zsuraski
1999-07-09 Step 1 in nuking the garbage collector:
394
573b4602 » andigutmans
1999-04-07 Zend Library
395 zend_op *get_next_op(zend_op_array *op_array CLS_DC);
babad269 » andigutmans
1999-09-20 - First step in fixing locking problem. Array fetches are now always …
396 void init_op(zend_op *op CLS_DC);
573b4602 » andigutmans
1999-04-07 Zend Library
397 int get_next_op_number(zend_op_array *op_array);
398 int print_class(zend_class_entry *class_entry);
399 void print_op_array(zend_op_array *op_array, int optimizations);
400 int pass_two(zend_op_array *op_array);
401 zend_brk_cont_element *get_next_brk_cont_element(zend_op_array *op_array);
b6197bcf » zsuraski
2000-02-04 Maintain a state of whether we're compiling and/or executing
402 ZEND_API zend_bool zend_is_compiling(void);
5286b397 » zsuraski
2000-09-12 Make compile_string() accept a description of the code
403 ZEND_API char *zend_make_compiled_string_description(char *name);
573b4602 » andigutmans
1999-04-07 Zend Library
404
405 int zendlex(znode *zendlval CLS_DC);
406
407 #define ZEND_NOP 0
408
409 #define ZEND_ADD 1
410 #define ZEND_SUB 2
411 #define ZEND_MUL 3
412 #define ZEND_DIV 4
413 #define ZEND_MOD 5
414 #define ZEND_SL 6
415 #define ZEND_SR 7
416 #define ZEND_CONCAT 8
417 #define ZEND_BW_OR 9
418 #define ZEND_BW_AND 10
419 #define ZEND_BW_XOR 11
420 #define ZEND_BW_NOT 12
421 #define ZEND_BOOL_NOT 13
422 #define ZEND_BOOL_XOR 14
98f02543 » andigutmans
1999-10-19 - Move IS_IDENTICAL next to IS_EQUAL
423 #define ZEND_IS_IDENTICAL 15
521c8af6 » Torben Wilson
2000-03-29 Added !== (is not identical) operator.
424 #define ZEND_IS_NOT_IDENTICAL 16
425 #define ZEND_IS_EQUAL 17
426 #define ZEND_IS_NOT_EQUAL 18
427 #define ZEND_IS_SMALLER 19
428 #define ZEND_IS_SMALLER_OR_EQUAL 20
429 #define ZEND_CAST 21
430 #define ZEND_QM_ASSIGN 22
431
432 #define ZEND_ASSIGN_ADD 23
433 #define ZEND_ASSIGN_SUB 24
434 #define ZEND_ASSIGN_MUL 25
435 #define ZEND_ASSIGN_DIV 26
436 #define ZEND_ASSIGN_MOD 27
437 #define ZEND_ASSIGN_SL 28
438 #define ZEND_ASSIGN_SR 29
439 #define ZEND_ASSIGN_CONCAT 30
440 #define ZEND_ASSIGN_BW_OR 31
441 #define ZEND_ASSIGN_BW_AND 32
442 #define ZEND_ASSIGN_BW_XOR 33
573b4602 » andigutmans
1999-04-07 Zend Library
443
521c8af6 » Torben Wilson
2000-03-29 Added !== (is not identical) operator.
444 #define ZEND_PRE_INC 34
445 #define ZEND_PRE_DEC 35
446 #define ZEND_POST_INC 36
447 #define ZEND_POST_DEC 37
448
449 #define ZEND_ASSIGN 38
450 #define ZEND_ASSIGN_REF 39
451
452 #define ZEND_ECHO 40
453 #define ZEND_PRINT 41
454
455 #define ZEND_JMP 42
456 #define ZEND_JMPZ 43
457 #define ZEND_JMPNZ 44
458 #define ZEND_JMPZNZ 45
459 #define ZEND_JMPZ_EX 46
460 #define ZEND_JMPNZ_EX 47
461 #define ZEND_CASE 48
462 #define ZEND_SWITCH_FREE 49
463 #define ZEND_BRK 50
464 #define ZEND_CONT 51
465 #define ZEND_BOOL 52
466
467 #define ZEND_INIT_STRING 53
468 #define ZEND_ADD_CHAR 54
469 #define ZEND_ADD_STRING 55
470 #define ZEND_ADD_VAR 56
471
472 #define ZEND_BEGIN_SILENCE 57
473 #define ZEND_END_SILENCE 58
474
475 #define ZEND_INIT_FCALL_BY_NAME 59
476 #define ZEND_DO_FCALL 60
477 #define ZEND_DO_FCALL_BY_NAME 61
478 #define ZEND_RETURN 62
479
480 #define ZEND_RECV 63
481 #define ZEND_RECV_INIT 64
573b4602 » andigutmans
1999-04-07 Zend Library
482
521c8af6 » Torben Wilson
2000-03-29 Added !== (is not identical) operator.
483 #define ZEND_SEND_VAL 65
484 #define ZEND_SEND_VAR 66
485 #define ZEND_SEND_REF 67
573b4602 » andigutmans
1999-04-07 Zend Library
486
521c8af6 » Torben Wilson
2000-03-29 Added !== (is not identical) operator.
487 #define ZEND_NEW 68
488 #define ZEND_JMP_NO_CTOR 69
489 #define ZEND_FREE 70
573b4602 » andigutmans
1999-04-07 Zend Library
490
521c8af6 » Torben Wilson
2000-03-29 Added !== (is not identical) operator.
491 #define ZEND_INIT_ARRAY 71
492 #define ZEND_ADD_ARRAY_ELEMENT 72
573b4602 » andigutmans
1999-04-07 Zend Library
493
521c8af6 » Torben Wilson
2000-03-29 Added !== (is not identical) operator.
494 #define ZEND_INCLUDE_OR_EVAL 73
573b4602 » andigutmans
1999-04-07 Zend Library
495
521c8af6 » Torben Wilson
2000-03-29 Added !== (is not identical) operator.
496 #define ZEND_UNSET_VAR 74
497 #define ZEND_UNSET_DIM_OBJ 75
498 #define ZEND_ISSET_ISEMPTY 76
573b4602 » andigutmans
1999-04-07 Zend Library
499
521c8af6 » Torben Wilson
2000-03-29 Added !== (is not identical) operator.
500 #define ZEND_FE_RESET 77
501 #define ZEND_FE_FETCH 78
573b4602 » andigutmans
1999-04-07 Zend Library
502
521c8af6 » Torben Wilson
2000-03-29 Added !== (is not identical) operator.
503 #define ZEND_EXIT 79
573b4602 » andigutmans
1999-04-07 Zend Library
504
505
7fa17e8e » andigutmans
2000-02-14 - Put in the infrastructure for the unset() fix. Right now it has the…
506 /* the following 18 opcodes are 6 groups of 3 opcodes each, and must
573b4602 » andigutmans
1999-04-07 Zend Library
507 * remain in that order!
508 */
521c8af6 » Torben Wilson
2000-03-29 Added !== (is not identical) operator.
509 #define ZEND_FETCH_R 80
510 #define ZEND_FETCH_DIM_R 81
511 #define ZEND_FETCH_OBJ_R 82
512 #define ZEND_FETCH_W 83
513 #define ZEND_FETCH_DIM_W 84
514 #define ZEND_FETCH_OBJ_W 85
515 #define ZEND_FETCH_RW 86
516 #define ZEND_FETCH_DIM_RW 87
517 #define ZEND_FETCH_OBJ_RW 88
518 #define ZEND_FETCH_IS 89
519 #define ZEND_FETCH_DIM_IS 90
520 #define ZEND_FETCH_OBJ_IS 91
521 #define ZEND_FETCH_FUNC_ARG 92
522 #define ZEND_FETCH_DIM_FUNC_ARG 93
523 #define ZEND_FETCH_OBJ_FUNC_ARG 94
524 #define ZEND_FETCH_UNSET 95
525 #define ZEND_FETCH_DIM_UNSET 96
526 #define ZEND_FETCH_OBJ_UNSET 97
527
528 #define ZEND_FETCH_DIM_TMP_VAR 98
529 #define ZEND_FETCH_CONSTANT 99
530
531 #define ZEND_DECLARE_FUNCTION_OR_CLASS 100
532
533 #define ZEND_EXT_STMT 101
534 #define ZEND_EXT_FCALL_BEGIN 102
535 #define ZEND_EXT_FCALL_END 103
536 #define ZEND_EXT_NOP 104
537
538 #define ZEND_TICKS 105
fafbf6d8 » zsuraski
2000-01-24 - Implement declare() with declarables framework
539
573b4602 » andigutmans
1999-04-07 Zend Library
540 /* end of block */
541
542
543
544
545 /* global/local fetches */
546 #define ZEND_FETCH_GLOBAL 0
547 #define ZEND_FETCH_LOCAL 1
548 #define ZEND_FETCH_STATIC 2
549
550 /* var status for backpatching */
06d04d15 » andigutmans
1999-09-29 - Fix SEND_VAR problem after fetch'ing a variable and not knowing the…
551 #define BP_VAR_R 0
552 #define BP_VAR_W 1
553 #define BP_VAR_RW 2
554 #define BP_VAR_IS 3
555 #define BP_VAR_NA 4 /* if not applicable */
556 #define BP_VAR_FUNC_ARG 5
7fa17e8e » andigutmans
2000-02-14 - Put in the infrastructure for the unset() fix. Right now it has the…
557 #define BP_VAR_UNSET 6
573b4602 » andigutmans
1999-04-07 Zend Library
558
559
560 #define ZEND_INTERNAL_FUNCTION 1
561 #define ZEND_USER_FUNCTION 2
562 #define ZEND_OVERLOADED_FUNCTION 3
2493f680 » zsuraski
1999-04-27 * Fix debugger+interactive mode bug
563 #define ZEND_EVAL_CODE 4
573b4602 » andigutmans
1999-04-07 Zend Library
564
565 #define ZEND_INTERNAL_CLASS 1
566 #define ZEND_USER_CLASS 2
567
568 #define ZEND_EVAL (1<<0)
569 #define ZEND_INCLUDE (1<<1)
9cc70442 » andigutmans
2000-03-10 - Cleanup old IMPORT stuff
570 #define ZEND_INCLUDE_ONCE (1<<2)
67b4b3a6 » zsuraski
1999-12-23 - require() of a dynamic expression now has the standard require() se…
571 #define ZEND_REQUIRE (1<<3)
c06692e9 » zsuraski
2000-08-09 The patch we promised - redesigned the compilation/execution API:
572 #define ZEND_REQUIRE_ONCE (1<<4)
573b4602 » andigutmans
1999-04-07 Zend Library
573
574 #define ZEND_ISSET (1<<0)
575 #define ZEND_ISEMPTY (1<<1)
576
577 #define ZEND_CT (1<<0)
578 #define ZEND_RT (1<<1)
579
580
58153dfe » zsuraski
1999-11-26 - Improve the file handle closing code
581 #define ZEND_HANDLE_FILENAME 0
582 #define ZEND_HANDLE_FD 1
583 #define ZEND_HANDLE_FP 2
584 #define ZEND_HANDLE_STDIOSTREAM 3
585 #define ZEND_HANDLE_FSTREAM 4
573b4602 » andigutmans
1999-04-07 Zend Library
586
d894cf44 » zsuraski
1999-07-08 Support definition of classes that are derived from classes that are …
587 #define ZEND_DECLARE_CLASS 1
588 #define ZEND_DECLARE_FUNCTION 2
589 #define ZEND_DECLARE_INHERITED_CLASS 3
b0bfa458 » zsuraski
1999-05-15 * Fix all hash checks that checked Bucket.arKey for NULL, when it was…
590
1250c43a » zsuraski
1999-05-22 * Add struct name to all typedef's so that they can be debugged with …
591 #define ZEND_FETCH_STANDARD 0
cccd2445 » zsuraski
1999-07-10 Get rid of AiCount completely
592 #define ZEND_FETCH_ADD_LOCK 1
1250c43a » zsuraski
1999-05-22 * Add struct name to all typedef's so that they can be debugged with …
593
741b8161 » zsuraski
1999-05-28 * Support getThis() for internal functions.
594 #define ZEND_MEMBER_FUNC_CALL 1<<0
595 #define ZEND_CTOR_CALL 1<<1
596
6ec1acbe » zsuraski
1999-07-09 Phase 3:
597
59d5462a » andigutmans
1999-09-28 - Stop using the locking mechanism and start using refcount.
598 #define AI_USE_PTR(ai) \
599 if ((ai).ptr_ptr) { \
600 (ai).ptr = *((ai).ptr_ptr); \
601 (ai).ptr_ptr = &((ai).ptr); \
602 } else { \
603 (ai).ptr = NULL; \
604 }
605
6d988ec6 » andigutmans
1999-11-03 - Add support for BYREF_FORCE_REST
606 /* Lost In Stupid Parentheses */
607 #define ARG_SHOULD_BE_SENT_BY_REF(offset, conduct_check, arg_types) \
608 ( \
609 conduct_check \
610 && arg_types \
611 && \
612 ( \
613 ( \
614 offset<=arg_types[0] \
615 && arg_types[offset]==BYREF_FORCE \
616 ) \
617 || ( \
618 offset>=arg_types[0] \
619 && arg_types[arg_types[0]]==BYREF_FORCE_REST \
620 ) \
621 ) \
622 )
623
ced9cee1 » zsuraski
1999-12-15 - Implement return by reference:
624 #define ZEND_RETURN_VAL 0
625 #define ZEND_RETURN_REF 1
626
ad115d20 » zsuraski
2000-01-29 Fix require()
627 END_EXTERN_C()
628
a6172174 » Sascha Schumann
2000-07-03 Replace macros which begin with an underscore through an appropiately
629 #endif /* ZEND_COMPILE_H */
Something went wrong with that request. Please try again.