Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 192 lines (136 sloc) 4.751 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
551fe77 @zsuraski Make token names uniform, they all begin with T_ now.
zsuraski authored
21 #ifndef _T_GLOBALS_H
22 #define _T_GLOBALS_H
573b460 @andigutmans Zend Library
andigutmans authored
23
99947a2 @andigutmans - Shift around header files.
andigutmans authored
24
573b460 @andigutmans Zend Library
andigutmans authored
25 #include <setjmp.h>
26
99947a2 @andigutmans - Shift around header files.
andigutmans authored
27 #include "zend_globals_macros.h"
28
573b460 @andigutmans Zend Library
andigutmans authored
29 #include "zend_stack.h"
30 #include "zend_ptr_stack.h"
31 #include "zend_hash.h"
32 #include "zend_llist.h"
33
7a87fcb @zsuraski Thread safety patch. We're still not quite there but it compiles again,...
zsuraski authored
34 /* Define ZTS if you want a thread-safe Zend */
52fcaa4 @zsuraski Thread-safe project
zsuraski authored
35 /*#undef ZTS*/
573b460 @andigutmans Zend Library
andigutmans authored
36
37 #ifdef ZTS
7a87fcb @zsuraski Thread safety patch. We're still not quite there but it compiles again,...
zsuraski authored
38 #include "../TSRM/TSRM.h"
573b460 @andigutmans Zend Library
andigutmans authored
39
1aa2c5c @zsuraski Ok, call me crazy, because I probably am.
zsuraski authored
40 #ifdef __cplusplus
41 class ZendFlexLexer;
42 #endif
43
44 BEGIN_EXTERN_C()
e06a1ed @zsuraski Thread safety fixes
zsuraski authored
45 ZEND_API extern int compiler_globals_id;
46 ZEND_API extern int executor_globals_id;
7a87fcb @zsuraski Thread safety patch. We're still not quite there but it compiles again,...
zsuraski authored
47 extern int alloc_globals_id;
1aa2c5c @zsuraski Ok, call me crazy, because I probably am.
zsuraski authored
48 END_EXTERN_C()
49
573b460 @andigutmans Zend Library
andigutmans authored
50 #endif
51
52 #define SYMTABLE_CACHE_SIZE 32
53
54
55 #include "zend_compile.h"
56 #include "zend_execute.h"
57
b510a6d More portability stuff
Sascha Schumann authored
58 /* excpt.h on Digital Unix 4.0 defines function_table */
59 #undef function_table
60
573b460 @andigutmans Zend Library
andigutmans authored
61 struct _zend_compiler_globals {
62 zend_stack bp_stack;
63 zend_stack switch_cond_stack;
22f066e @andigutmans - Add foreach() freeing code.
andigutmans authored
64 zend_stack foreach_copy_stack;
573b460 @andigutmans Zend Library
andigutmans authored
65 zend_stack object_stack;
66
67 zend_class_entry class_entry, *active_class_entry;
68
69 /* variables for list() compilation */
70 zend_llist list_llist;
71 zend_llist dimension_llist;
72
73 zend_stack function_call_stack;
74
75 char *compiled_filename;
76
77 int zend_lineno;
86a0efc @zsuraski Fix #2744
zsuraski authored
78 int comment_start_line;
573b460 @andigutmans Zend Library
andigutmans authored
79 char *heredoc;
80 int heredoc_len;
81
82 zend_op_array *active_op_array;
83
84 HashTable *function_table; /* function symbol table */
85 HashTable *class_table; /* class table */
86
5463dd5 @andigutmans - Add use support (behaves like require, but will not use the same file ...
andigutmans authored
87 HashTable used_files; /* files already included using 'use' */
88
573b460 @andigutmans Zend Library
andigutmans authored
89 zend_llist filenames_list;
90
9ece796 @zsuraski define zend_bool
zsuraski authored
91 zend_bool short_tags;
92 zend_bool asp_tags;
ced9cee @zsuraski - Implement return by reference:
zsuraski authored
93 zend_bool allow_call_time_pass_reference;
573b460 @andigutmans Zend Library
andigutmans authored
94
95 /* For extensions support */
9ece796 @zsuraski define zend_bool
zsuraski authored
96 zend_bool extended_info; /* generate extension information for debugger/profiler */
97 zend_bool handle_op_arrays; /* run op_arrays through op_array handlers */
1aa2c5c @zsuraski Ok, call me crazy, because I probably am.
zsuraski authored
98
9ece796 @zsuraski define zend_bool
zsuraski authored
99 zend_bool unclean_shutdown;
87ba08d @zsuraski Avoid leaking fd's in case of failures
zsuraski authored
100
101 zend_llist open_files;
1aa2c5c @zsuraski Ok, call me crazy, because I probably am.
zsuraski authored
102 #ifdef ZTS
103 #ifdef __cplusplus
104 ZendFlexLexer *ZFL;
105 #else
106 void *ZFL;
107 #endif
108 #endif
573b460 @andigutmans Zend Library
andigutmans authored
109 };
110
111
112 struct _zend_executor_globals {
ced9cee @zsuraski - Implement return by reference:
zsuraski authored
113 zval **return_value_ptr_ptr;
573b460 @andigutmans Zend Library
andigutmans authored
114
115 zval uninitialized_zval;
116 zval *uninitialized_zval_ptr;
117
118 zval error_zval;
119 zval *error_zval_ptr;
120
121 zend_function_state *function_state_ptr;
122 zend_ptr_stack arg_types_stack;
123 zend_stack overloaded_objects_stack;
223c674 @zsuraski - Made things work again (Thies, everybody - please check the latest CVS...
zsuraski authored
124
125 /* for global return() support */
126 zval *global_return_value_ptr;
127 zval global_return_value;
573b460 @andigutmans Zend Library
andigutmans authored
128
129 /* symbol table cache */
130 HashTable *symtable_cache[SYMTABLE_CACHE_SIZE];
131 HashTable **symtable_cache_limit;
132 HashTable **symtable_cache_ptr;
133
134 zend_op **opline_ptr;
135
136 HashTable *active_symbol_table;
137 HashTable symbol_table; /* main symbol table */
138
5463dd5 @andigutmans - Add use support (behaves like require, but will not use the same file ...
andigutmans authored
139 HashTable imported_files; /* files already included using 'import' */
140
573b460 @andigutmans Zend Library
andigutmans authored
141 jmp_buf bailout;
142
143 int error_reporting;
144
145 zend_op_array *active_op_array;
146 zend_op_array *main_op_array;
147
148 HashTable *function_table; /* function symbol table */
149 HashTable *class_table; /* class table */
150 HashTable *zend_constants; /* constants table */
151
152 long precision;
153
154 /* for extended information support */
741ca16 @andigutmans - Fixed various inheritance problems & Andrey's leak
andigutmans authored
155 zend_bool no_extensions;
573b460 @andigutmans Zend Library
andigutmans authored
156
157 HashTable regular_list;
158 HashTable persistent_list;
159
39a7f4c @zsuraski This patch is a go. Not fully optimized yet, but working properly.
zsuraski authored
160 zend_ptr_stack argument_stack;
b5f5e9a @andigutmans - Optimize the execute stack a bit.
andigutmans authored
161 int free_op1, free_op2;
162 int (*unary_op)(zval *result, zval *op1);
163 int (*binary_op)(zval *result, zval *op1, zval *op2);
39a7f4c @zsuraski This patch is a go. Not fully optimized yet, but working properly.
zsuraski authored
164
1c0f136 @andigutmans - Hooray. This might actually work. (I hope)
andigutmans authored
165 zval *garbage[4];
166 int garbage_ptr;
ced9cee @zsuraski - Implement return by reference:
zsuraski authored
167 zend_bool suspend_garbage;
1c0f136 @andigutmans - Hooray. This might actually work. (I hope)
andigutmans authored
168
b5f5e9a @andigutmans - Optimize the execute stack a bit.
andigutmans authored
169 void *reserved[ZEND_MAX_RESERVED_RESOURCES];
573b460 @andigutmans Zend Library
andigutmans authored
170 #if SUPPORT_INTERACTIVE
171 int interactive;
172 #endif
173 };
174
175
176
177 struct _zend_alloc_globals {
178 mem_header *head; /* standard list */
179 mem_header *phead; /* persistent list */
180 void *cache[MAX_CACHED_MEMORY][MAX_CACHED_ENTRIES];
181 unsigned char cache_count[MAX_CACHED_MEMORY];
182
2e9886d @zsuraski Get rid of php3_ini in Zend
zsuraski authored
183 #if MEMORY_LIMIT
184 unsigned int memory_limit;
573b460 @andigutmans Zend Library
andigutmans authored
185 unsigned int allocated_memory;
186 unsigned char memory_exhausted;
187 #endif
188 };
189
190
551fe77 @zsuraski Make token names uniform, they all begin with T_ now.
zsuraski authored
191 #endif /* _T_GLOBALS_H */
Something went wrong with that request. Please try again.