Skip to content
Newer
Older
100644 294 lines (210 sloc) 6.59 KB
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
1 /*
2 +----------------------------------------------------------------------+
3 | Zend Engine |
4 +----------------------------------------------------------------------+
13a78ac @sebastianbergmann sed -i "s#1998-2009#1998-2010#g" **/*.c **/*.h **/*.php
sebastianbergmann authored Jan 5, 2010
5 | Copyright (c) 1998-2010 Zend Technologies Ltd. (http://www.zend.com) |
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
6 +----------------------------------------------------------------------+
d863d52 @sebastianbergmann Update headers.
sebastianbergmann authored Dec 11, 2001
7 | This source file is subject to version 2.00 of the Zend license, |
b5b1117 @zsuraski License update
zsuraski authored Jul 16, 1999
8 | that is bundled with this package in the file LICENSE, and is |
f68c7ff updating license information in the headers.
James Cox authored Jun 10, 2003
9 | available through the world-wide-web at the following url: |
d863d52 @sebastianbergmann Update headers.
sebastianbergmann authored Dec 11, 2001
10 | http://www.zend.com/license/2_00.txt. |
b5b1117 @zsuraski License update
zsuraski authored Jul 16, 1999
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 Apr 7, 1999
14 +----------------------------------------------------------------------+
15 | Authors: Andi Gutmans <andi@zend.com> |
16 | Zeev Suraski <zeev@zend.com> |
17 +----------------------------------------------------------------------+
18 */
19
333406b - Added some missing CVS $Id$ tags, headers and footers.
foobar authored Feb 1, 2003
20 /* $Id$ */
b5b1117 @zsuraski License update
zsuraski authored Jul 16, 1999
21
a617217 Replace macros which begin with an underscore through an appropiately
Sascha Schumann authored Jul 3, 2000
22 #ifndef ZEND_GLOBALS_H
23 #define ZEND_GLOBALS_H
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
24
99947a2 @andigutmans - Shift around header files.
andigutmans authored Sep 5, 1999
25
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
26 #include <setjmp.h>
27
99947a2 @andigutmans - Shift around header files.
andigutmans authored Sep 5, 1999
28 #include "zend_globals_macros.h"
29
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
30 #include "zend_stack.h"
31 #include "zend_ptr_stack.h"
32 #include "zend_hash.h"
33 #include "zend_llist.h"
6608f07 @smalyshev Mega-commit: Enter the new object model
smalyshev authored Feb 7, 2002
34 #include "zend_objects.h"
f75f3cf @smalyshev Generalize object storage and reference bookkeeping
smalyshev authored May 31, 2002
35 #include "zend_objects_API.h"
5230321 - Fix Reflection class names
Marcus Boerger authored Mar 30, 2004
36 #include "zend_modules.h"
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
37
ab9dcec @fujimoto - added script encoding support to Zend Engine 2.
fujimoto authored Aug 11, 2003
38 #ifdef ZEND_MULTIBYTE
39 #include "zend_multibyte.h"
40 #endif /* ZEND_MULTIBYTE */
41
7a87fcb @zsuraski Thread safety patch. We're still not quite there but it compiles agai…
zsuraski authored Apr 21, 1999
42 /* Define ZTS if you want a thread-safe Zend */
52fcaa4 @zsuraski Thread-safe project
zsuraski authored Apr 21, 1999
43 /*#undef ZTS*/
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
44
45 #ifdef ZTS
1aa2c5c @zsuraski Ok, call me crazy, because I probably am.
zsuraski authored Apr 23, 1999
46
47 BEGIN_EXTERN_C()
e06a1ed @zsuraski Thread safety fixes
zsuraski authored Apr 24, 1999
48 ZEND_API extern int compiler_globals_id;
49 ZEND_API extern int executor_globals_id;
1aa2c5c @zsuraski Ok, call me crazy, because I probably am.
zsuraski authored Apr 23, 1999
50 END_EXTERN_C()
51
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
52 #endif
53
54 #define SYMTABLE_CACHE_SIZE 32
55
56
57 #include "zend_compile.h"
58
b510a6d More portability stuff
Sascha Schumann authored Oct 5, 1999
59 /* excpt.h on Digital Unix 4.0 defines function_table */
60 #undef function_table
fafbf6d @zsuraski - Implement declare() with declarables framework
zsuraski authored Jan 24, 2000
61
62
63 typedef struct _zend_declarables {
64 zval ticks;
65 } zend_declarables;
66
67
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
68 struct _zend_compiler_globals {
69 zend_stack bp_stack;
70 zend_stack switch_cond_stack;
22f066e @andigutmans - Add foreach() freeing code.
andigutmans authored Sep 9, 1999
71 zend_stack foreach_copy_stack;
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
72 zend_stack object_stack;
fafbf6d @zsuraski - Implement declare() with declarables framework
zsuraski authored Jan 24, 2000
73 zend_stack declare_stack;
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
74
26578c3 @andigutmans - Initial support for nested class definitions
andigutmans authored Oct 29, 2001
75 zend_class_entry *active_class_entry;
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
76
77 /* variables for list() compilation */
78 zend_llist list_llist;
79 zend_llist dimension_llist;
43ebb86 @zsuraski Fix bug #10287 - avoid crashing under a bogus usage of list()
zsuraski authored Jul 16, 2001
80 zend_stack list_stack;
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
81
82 zend_stack function_call_stack;
83
84 char *compiled_filename;
85
86 int zend_lineno;
86a0efc @zsuraski Fix #2744
zsuraski authored Nov 22, 1999
87 int comment_start_line;
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
88 char *heredoc;
89 int heredoc_len;
90
91 zend_op_array *active_op_array;
92
93 HashTable *function_table; /* function symbol table */
94 HashTable *class_table; /* class table */
95
c34f41b @zsuraski Eliminate run-time leak with eval()'s
zsuraski authored Aug 19, 2000
96 HashTable filenames_table;
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
97
9d11db1 @andigutmans - Merge new $_GET, $_POST etc. patch from Engine 1 tree
andigutmans authored Aug 8, 2001
98 HashTable *auto_globals;
99
b6197bc @zsuraski Maintain a state of whether we're compiling and/or executing
zsuraski authored Feb 4, 2000
100 zend_bool in_compilation;
9ece796 @zsuraski define zend_bool
zsuraski authored Jul 2, 1999
101 zend_bool short_tags;
102 zend_bool asp_tags;
ced9cee @zsuraski - Implement return by reference:
zsuraski authored Dec 15, 1999
103 zend_bool allow_call_time_pass_reference;
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
104
fafbf6d @zsuraski - Implement declare() with declarables framework
zsuraski authored Jan 24, 2000
105 zend_declarables declarables;
106
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
107 /* For extensions support */
9ece796 @zsuraski define zend_bool
zsuraski authored Jul 2, 1999
108 zend_bool extended_info; /* generate extension information for debugger/profiler */
109 zend_bool handle_op_arrays; /* run op_arrays through op_array handlers */
1aa2c5c @zsuraski Ok, call me crazy, because I probably am.
zsuraski authored Apr 23, 1999
110
9ece796 @zsuraski define zend_bool
zsuraski authored Jul 2, 1999
111 zend_bool unclean_shutdown;
87ba08d @zsuraski Avoid leaking fd's in case of failures
zsuraski authored May 22, 1999
112
9596255 @zsuraski Final touches on the INI parser
zsuraski authored Oct 30, 2000
113 zend_bool ini_parser_unbuffered_errors;
114
87ba08d @zsuraski Avoid leaking fd's in case of failures
zsuraski authored May 22, 1999
115 zend_llist open_files;
85b4df5 @zsuraski Improved interactive mode - it is now available in all builds, withou…
zsuraski authored Jul 15, 2001
116
f1e8815 @andigutmans - Change exception handling to use the Java-like catch(MyException $e…
andigutmans authored Jan 13, 2002
117 long catch_begin;
29f5dbe @andigutmans - Initial support for exceptions.
andigutmans authored Aug 30, 2001
118
609d58a @zsuraski Merge from branch - move to standard C scanners in thread safe mode
zsuraski authored Aug 6, 2001
119 struct _zend_ini_parser_param *ini_parser_param;
120
85b4df5 @zsuraski Improved interactive mode - it is now available in all builds, withou…
zsuraski authored Jul 15, 2001
121 int interactive;
7ade3b3 @zsuraski Fix an off by one lineno issue, in case of an implicit ;
zsuraski authored Aug 6, 2001
122
cf05f34 @zsuraski MFZE1 - lineno fix
zsuraski authored Jan 5, 2003
123 zend_uint start_lineno;
7ade3b3 @zsuraski Fix an off by one lineno issue, in case of an implicit ;
zsuraski authored Aug 6, 2001
124 zend_bool increment_lineno;
b90d80b @andigutmans - Initial patch to support importing from class scopes (for Stig).
andigutmans authored Mar 2, 2002
125
26dd849 @zsuraski Add support for interfaces
zsuraski authored Mar 5, 2003
126 znode implementing_class;
e062dff @zsuraski - Implement public/protected/private methods.
zsuraski authored Dec 6, 2002
127
471947b @zsuraski Reimplement PPP properties
zsuraski authored Feb 4, 2003
128 zend_uint access_type;
bdd3b60 Implement a different way to catch documentation comments.
Andrei Zmievski authored Apr 2, 2003
129
130 char *doc_comment;
131 zend_uint doc_comment_len;
ab9dcec @fujimoto - added script encoding support to Zend Engine 2.
fujimoto authored Aug 11, 2003
132
133 #ifdef ZEND_MULTIBYTE
134 zend_encoding **script_encoding_list;
135 int script_encoding_list_size;
a8c6b99 Fixed bug #35147 (__HALT_COMPILER() breaks with --enable-zend-multibyte)
Dmitry Stogov authored Nov 15, 2005
136 zend_bool detect_unicode;
ab9dcec @fujimoto - added script encoding support to Zend Engine 2.
fujimoto authored Aug 11, 2003
137
138 zend_encoding *internal_encoding;
139
140 /* multibyte utility functions */
141 zend_encoding_detector encoding_detector;
142 zend_encoding_converter encoding_converter;
143 zend_encoding_oddlen encoding_oddlen;
144 #endif /* ZEND_MULTIBYTE */
8768ab9 Fixed bug #34729 (Crash in ZTS mode under Apache)
Dmitry Stogov authored Dec 1, 2005
145
146 #ifdef ZTS
147 HashTable **static_members;
148 int last_static_member;
149 #endif
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
150 };
151
152
153 struct _zend_executor_globals {
ced9cee @zsuraski - Implement return by reference:
zsuraski authored Dec 15, 1999
154 zval **return_value_ptr_ptr;
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
155
156 zval uninitialized_zval;
157 zval *uninitialized_zval_ptr;
158
159 zval error_zval;
160 zval *error_zval_ptr;
161
162 zend_function_state *function_state_ptr;
163 zend_ptr_stack arg_types_stack;
223c674 @zsuraski - Made things work again (Thies, everybody - please check the latest …
zsuraski authored Dec 19, 1999
164
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
165 /* symbol table cache */
166 HashTable *symtable_cache[SYMTABLE_CACHE_SIZE];
167 HashTable **symtable_cache_limit;
168 HashTable **symtable_cache_ptr;
169
170 zend_op **opline_ptr;
171
172 HashTable *active_symbol_table;
173 HashTable symbol_table; /* main symbol table */
174
5951b16 @andigutmans - Quick way of supporting include_once().
andigutmans authored Mar 10, 2000
175 HashTable included_files; /* files already included */
5463dd5 @andigutmans - Add use support (behaves like require, but will not use the same fi…
andigutmans authored Nov 30, 1999
176
14f6b91 Optimized zend_try/zend_catch macroses (eliminated memcpy())
Dmitry Stogov authored May 19, 2006
177 jmp_buf *bailout;
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
178
179 int error_reporting;
fde2e61 @zsuraski error_reporting fix
zsuraski authored Jun 30, 2000
180 int orig_error_reporting;
2ef6b68 Pass on the exit status
Sascha Schumann authored Nov 22, 2000
181 int exit_status;
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
182
183 zend_op_array *active_op_array;
184
185 HashTable *function_table; /* function symbol table */
186 HashTable *class_table; /* class table */
187 HashTable *zend_constants; /* constants table */
188
90bd453 @andigutmans - Remove use of C++ reserved words namespace/this
andigutmans authored Mar 1, 2002
189 zend_class_entry *scope;
4248619 @andigutmans - Initial work on changing namespace scope. Only methods & variables
andigutmans authored Dec 6, 2001
190
90bd453 @andigutmans - Remove use of C++ reserved words namespace/this
andigutmans authored Mar 1, 2002
191 zval *This;
a4248dd @andigutmans - Significantly improve the performance of method calls and $this->me…
andigutmans authored Jan 5, 2002
192
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
193 long precision;
194
fafbf6d @zsuraski - Implement declare() with declarables framework
zsuraski authored Jan 24, 2000
195 int ticks_count;
196
b6197bc @zsuraski Maintain a state of whether we're compiling and/or executing
zsuraski authored Feb 4, 2000
197 zend_bool in_execution;
55cf45a New autoload protection schema was implemented (Using HashTable inste…
Dmitry Stogov authored Mar 24, 2004
198 HashTable *in_autoload;
b7a8297 - Boost up __autoload() calls by caching the lookup
Marcus Boerger authored Aug 23, 2004
199 zend_function *autoload_func;
aecd5b8 @zsuraski MFZE1
zsuraski authored Oct 23, 2001
200 zend_bool full_tables_cleanup;
51d4958 @zsuraski Restore ZE1 compatibility mode (Zend Engine part - the modules patches
zsuraski authored Jun 5, 2006
201 zend_bool ze1_compatibility_mode;
b6197bc @zsuraski Maintain a state of whether we're compiling and/or executing
zsuraski authored Feb 4, 2000
202
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
203 /* for extended information support */
741ca16 @andigutmans - Fixed various inheritance problems & Andrey's leak
andigutmans authored Jul 28, 1999
204 zend_bool no_extensions;
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
205
84eb48f @zsuraski Ok, this time here's some real Win32 system programming :)
zsuraski authored Jun 16, 2000
206 #ifdef ZEND_WIN32
207 zend_bool timed_out;
208 #endif
209
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
210 HashTable regular_list;
211 HashTable persistent_list;
212
39a7f4c @zsuraski This patch is a go. Not fully optimized yet, but working properly.
zsuraski authored Apr 12, 1999
213 zend_ptr_stack argument_stack;
1c0f136 @andigutmans - Hooray. This might actually work. (I hope)
andigutmans authored Oct 3, 1999
214
a72c1ab @zsuraski Added error mask to set_error_handler()
zsuraski authored Jan 10, 2004
215 int user_error_handler_error_reporting;
67f6974 @zsuraski Initial support for trapping errors (not complete and disabled; will …
zsuraski authored Apr 19, 2000
216 zval *user_error_handler;
04788f9 @- Added set_exception_handler() function for registering a global,
Stig Bakken authored Aug 16, 2002
217 zval *user_exception_handler;
a72c1ab @zsuraski Added error mask to set_error_handler()
zsuraski authored Jan 10, 2004
218 zend_stack user_error_handlers_error_reporting;
34c2b0a @zsuraski - Add restore_error_handler()
zsuraski authored Jun 17, 2000
219 zend_ptr_stack user_error_handlers;
04788f9 @- Added set_exception_handler() function for registering a global,
Stig Bakken authored Aug 16, 2002
220 zend_ptr_stack user_exception_handlers;
67f6974 @zsuraski Initial support for trapping errors (not complete and disabled; will …
zsuraski authored Apr 19, 2000
221
ef0bd3d @zsuraski - Move timeout code to Zend
zsuraski authored Jun 16, 2000
222 /* timeout support */
223 int timeout_seconds;
224
0b7a9ce @zsuraski - Fix Win32 compilation (Use winsock2.h from now on)
zsuraski authored Jun 3, 2000
225 int lambda_count;
226
8831b9c @andigutmans - MFZE1.
andigutmans authored Sep 23, 2002
227 HashTable *ini_directives;
14cad8f Optimized shutdown sequence to iterate only over modified ini directives
Dmitry Stogov authored May 15, 2006
228 HashTable *modified_ini_directives;
229
f75f3cf @smalyshev Generalize object storage and reference bookkeeping
smalyshev authored May 31, 2002
230 zend_objects_store objects_store;
29f5dbe @andigutmans - Initial support for exceptions.
andigutmans authored Aug 30, 2001
231 zval *exception;
9e60cb5 @zsuraski Rewrote exception support. Fixes a few limitations and bugs in the old
zsuraski authored Feb 3, 2004
232 zend_op *opline_before_exception;
54d5305 @zsuraski Make the INI mechanism thread safe (or at least thread safer :)
zsuraski authored Dec 27, 2000
233
7e5ec2d @andigutmans Initial support for built-in backtracing.
andigutmans authored May 2, 2002
234 struct _zend_execute_data *current_execute_data;
235
5230321 - Fix Reflection class names
Marcus Boerger authored Mar 30, 2004
236 struct _zend_module_entry *current_module;
9e60cb5 @zsuraski Rewrote exception support. Fixes a few limitations and bugs in the old
zsuraski authored Feb 3, 2004
237
fce275e @zsuraski Improve PPP handling of properties
zsuraski authored Feb 7, 2003
238 zend_property_info std_property_info;
239
d6ee9d4 @tony2001 MFH: fix #38779 (engine crashes when require()'ing file with syntax e…
tony2001 authored Sep 11, 2006
240 zend_bool active;
241
b5f5e9a @andigutmans - Optimize the execute stack a bit.
andigutmans authored Aug 15, 1999
242 void *reserved[ZEND_MAX_RESERVED_RESOURCES];
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
243 };
244
609d58a @zsuraski Merge from branch - move to standard C scanners in thread safe mode
zsuraski authored Aug 6, 2001
245 struct _zend_scanner_globals {
e52aac9 @wez Implement simple stream support in the ZE scanners.
wez authored Feb 18, 2003
246 zend_file_handle *yy_in;
247 zend_file_handle *yy_out;
609d58a @zsuraski Merge from branch - move to standard C scanners in thread safe mode
zsuraski authored Aug 6, 2001
248 int yy_leng;
249 char *yy_text;
250 struct yy_buffer_state *current_buffer;
251 char *c_buf_p;
252 int init;
253 int start;
fac8eaf MFZE1
Ilia Alshanetsky authored Oct 14, 2002
254 int lineno;
1735281 @zsuraski MFZE1
zsuraski authored Sep 22, 2001
255 char _yy_hold_char;
256 int yy_n_chars;
257 int _yy_did_buffer_switch_on_eof;
e42ab2c @zsuraski MFZE1
zsuraski authored Sep 22, 2001
258 int _yy_last_accepting_state; /* Must be of the same type as yy_state_type,
259 * if for whatever reason it's no longer int!
260 */
1735281 @zsuraski MFZE1
zsuraski authored Sep 22, 2001
261 char *_yy_last_accepting_cpos;
262 int _yy_more_flag;
263 int _yy_more_len;
0bb780b @zsuraski MFZE1
zsuraski authored Aug 15, 2002
264 int yy_start_stack_ptr;
265 int yy_start_stack_depth;
266 int *yy_start_stack;
ab9dcec @fujimoto - added script encoding support to Zend Engine 2.
fujimoto authored Aug 11, 2003
267
268 #ifdef ZEND_MULTIBYTE
269 /* original (unfiltered) script */
270 char *script_org;
271 int script_org_size;
272
273 /* filtered script */
274 char *script_filtered;
275 int script_filtered_size;
276
277 /* input/ouput filters */
278 zend_encoding_filter input_filter;
279 zend_encoding_filter output_filter;
280 zend_encoding *script_encoding;
281 zend_encoding *internal_encoding;
282 #endif /* ZEND_MULTIBYTE */
609d58a @zsuraski Merge from branch - move to standard C scanners in thread safe mode
zsuraski authored Aug 6, 2001
283 };
284
a617217 Replace macros which begin with an underscore through an appropiately
Sascha Schumann authored Jul 3, 2000
285 #endif /* ZEND_GLOBALS_H */
333406b - Added some missing CVS $Id$ tags, headers and footers.
foobar authored Feb 1, 2003
286
287 /*
288 * Local variables:
289 * tab-width: 4
290 * c-basic-offset: 4
291 * indent-tabs-mode: t
292 * End:
293 */
Something went wrong with that request. Please try again.