Skip to content
Newer
Older
100644 211 lines (150 sloc) 5.03 KB
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
1 /*
2 +----------------------------------------------------------------------+
3 | Zend Engine |
4 +----------------------------------------------------------------------+
5e55e47 @zsuraski It's official now...
zsuraski authored Mar 6, 2000
5 | Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
6 +----------------------------------------------------------------------+
5e55e47 @zsuraski It's official now...
zsuraski authored Mar 6, 2000
7 | This source file is subject to version 0.92 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 |
9 | available at through the world-wide-web at |
5e55e47 @zsuraski It's official now...
zsuraski authored Mar 6, 2000
10 | http://www.zend.com/license/0_92.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
b5b1117 @zsuraski License update
zsuraski authored Jul 16, 1999
20
551fe77 @zsuraski Make token names uniform, they all begin with T_ now.
zsuraski authored Apr 22, 1999
21 #ifndef _T_GLOBALS_H
22 #define _T_GLOBALS_H
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
23
99947a2 @andigutmans - Shift around header files.
andigutmans authored Sep 5, 1999
24
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
25 #include <setjmp.h>
26
99947a2 @andigutmans - Shift around header files.
andigutmans authored Sep 5, 1999
27 #include "zend_globals_macros.h"
28
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
29 #include "zend_stack.h"
30 #include "zend_ptr_stack.h"
31 #include "zend_hash.h"
32 #include "zend_llist.h"
b7a5b3c @zsuraski - Generalize the fast cache mechanism
zsuraski authored Dec 27, 1999
33 #include "zend_fast_cache.h"
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
34
7a87fcb @zsuraski Thread safety patch. We're still not quite there but it compiles agai…
zsuraski authored Apr 21, 1999
35 /* Define ZTS if you want a thread-safe Zend */
52fcaa4 @zsuraski Thread-safe project
zsuraski authored Apr 21, 1999
36 /*#undef ZTS*/
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
37
38 #ifdef ZTS
7a87fcb @zsuraski Thread safety patch. We're still not quite there but it compiles agai…
zsuraski authored Apr 21, 1999
39 #include "../TSRM/TSRM.h"
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
40
1aa2c5c @zsuraski Ok, call me crazy, because I probably am.
zsuraski authored Apr 23, 1999
41 #ifdef __cplusplus
42 class ZendFlexLexer;
43 #endif
44
45 BEGIN_EXTERN_C()
e06a1ed @zsuraski Thread safety fixes
zsuraski authored Apr 24, 1999
46 ZEND_API extern int compiler_globals_id;
47 ZEND_API extern int executor_globals_id;
5864b57 @zsuraski This should enable people to use ALLOC_ZVAL() in code outside the php…
zsuraski authored Dec 30, 1999
48 ZEND_API extern int alloc_globals_id;
1aa2c5c @zsuraski Ok, call me crazy, because I probably am.
zsuraski authored Apr 23, 1999
49 END_EXTERN_C()
50
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
51 #endif
52
53 #define SYMTABLE_CACHE_SIZE 32
54
55
56 #include "zend_compile.h"
57 #include "zend_execute.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
75 zend_class_entry class_entry, *active_class_entry;
76
77 /* variables for list() compilation */
78 zend_llist list_llist;
79 zend_llist dimension_llist;
80
81 zend_stack function_call_stack;
82
83 char *compiled_filename;
84
85 int zend_lineno;
86a0efc @zsuraski Fix #2744
zsuraski authored Nov 22, 1999
86 int comment_start_line;
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
87 char *heredoc;
88 int heredoc_len;
89
90 zend_op_array *active_op_array;
91
92 HashTable *function_table; /* function symbol table */
93 HashTable *class_table; /* class table */
94
5463dd5 @andigutmans - Add use support (behaves like require, but will not use the same fi…
andigutmans authored Nov 30, 1999
95 HashTable used_files; /* files already included using 'use' */
96
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
97 zend_llist filenames_list;
98
b6197bc @zsuraski Maintain a state of whether we're compiling and/or executing
zsuraski authored Feb 4, 2000
99 zend_bool in_compilation;
9ece796 @zsuraski define zend_bool
zsuraski authored Jul 2, 1999
100 zend_bool short_tags;
101 zend_bool asp_tags;
ced9cee @zsuraski - Implement return by reference:
zsuraski authored Dec 15, 1999
102 zend_bool allow_call_time_pass_reference;
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
103
fafbf6d @zsuraski - Implement declare() with declarables framework
zsuraski authored Jan 24, 2000
104 zend_declarables declarables;
105
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
106 /* For extensions support */
9ece796 @zsuraski define zend_bool
zsuraski authored Jul 2, 1999
107 zend_bool extended_info; /* generate extension information for debugger/profiler */
108 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
109
9ece796 @zsuraski define zend_bool
zsuraski authored Jul 2, 1999
110 zend_bool unclean_shutdown;
87ba08d @zsuraski Avoid leaking fd's in case of failures
zsuraski authored May 22, 1999
111
112 zend_llist open_files;
1aa2c5c @zsuraski Ok, call me crazy, because I probably am.
zsuraski authored Apr 23, 1999
113 #ifdef ZTS
114 #ifdef __cplusplus
115 ZendFlexLexer *ZFL;
116 #else
117 void *ZFL;
118 #endif
119 #endif
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
120 };
121
122
123 struct _zend_executor_globals {
ced9cee @zsuraski - Implement return by reference:
zsuraski authored Dec 15, 1999
124 zval **return_value_ptr_ptr;
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
125
126 zval uninitialized_zval;
127 zval *uninitialized_zval_ptr;
128
129 zval error_zval;
130 zval *error_zval_ptr;
131
132 zend_function_state *function_state_ptr;
133 zend_ptr_stack arg_types_stack;
134 zend_stack overloaded_objects_stack;
223c674 @zsuraski - Made things work again (Thies, everybody - please check the latest …
zsuraski authored Dec 19, 1999
135
136 /* for global return() support */
137 zval *global_return_value_ptr;
138 zval global_return_value;
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
139
140 /* symbol table cache */
141 HashTable *symtable_cache[SYMTABLE_CACHE_SIZE];
142 HashTable **symtable_cache_limit;
143 HashTable **symtable_cache_ptr;
144
145 zend_op **opline_ptr;
146
147 HashTable *active_symbol_table;
148 HashTable symbol_table; /* main symbol table */
149
5951b16 @andigutmans - Quick way of supporting include_once().
andigutmans authored Mar 10, 2000
150 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
151
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
152 jmp_buf bailout;
153
154 int error_reporting;
155
156 zend_op_array *active_op_array;
157 zend_op_array *main_op_array;
158
159 HashTable *function_table; /* function symbol table */
160 HashTable *class_table; /* class table */
161 HashTable *zend_constants; /* constants table */
162
163 long precision;
164
fafbf6d @zsuraski - Implement declare() with declarables framework
zsuraski authored Jan 24, 2000
165 int ticks_count;
166
b6197bc @zsuraski Maintain a state of whether we're compiling and/or executing
zsuraski authored Feb 4, 2000
167 zend_bool in_execution;
168
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
169 /* for extended information support */
741ca16 @andigutmans - Fixed various inheritance problems & Andrey's leak
andigutmans authored Jul 28, 1999
170 zend_bool no_extensions;
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
171
172 HashTable regular_list;
173 HashTable persistent_list;
174
39a7f4c @zsuraski This patch is a go. Not fully optimized yet, but working properly.
zsuraski authored Apr 12, 1999
175 zend_ptr_stack argument_stack;
b5f5e9a @andigutmans - Optimize the execute stack a bit.
andigutmans authored Aug 15, 1999
176 int free_op1, free_op2;
177 int (*unary_op)(zval *result, zval *op1);
178 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 Apr 12, 1999
179
1c0f136 @andigutmans - Hooray. This might actually work. (I hope)
andigutmans authored Oct 3, 1999
180 zval *garbage[4];
181 int garbage_ptr;
182
b5f5e9a @andigutmans - Optimize the execute stack a bit.
andigutmans authored Aug 15, 1999
183 void *reserved[ZEND_MAX_RESERVED_RESOURCES];
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
184 #if SUPPORT_INTERACTIVE
185 int interactive;
186 #endif
187 };
188
189
190 struct _zend_alloc_globals {
c517633 @zsuraski namespace protection
zsuraski authored Dec 26, 1999
191 zend_mem_header *head; /* standard list */
192 zend_mem_header *phead; /* persistent list */
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
193 void *cache[MAX_CACHED_MEMORY][MAX_CACHED_ENTRIES];
194 unsigned char cache_count[MAX_CACHED_MEMORY];
b7a5b3c @zsuraski - Generalize the fast cache mechanism
zsuraski authored Dec 27, 1999
195 void *fast_cache_list_head[MAX_FAST_CACHE_TYPES];
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
196
ebd4445 @zsuraski Add cache statistics support
zsuraski authored Dec 27, 1999
197 #if ZEND_DEBUG
198 /* for performance tuning */
199 int cache_stats[MAX_CACHED_MEMORY][2];
b7a5b3c @zsuraski - Generalize the fast cache mechanism
zsuraski authored Dec 27, 1999
200 int fast_cache_stats[MAX_FAST_CACHE_TYPES][2];
ebd4445 @zsuraski Add cache statistics support
zsuraski authored Dec 27, 1999
201 #endif
2e9886d @zsuraski Get rid of php3_ini in Zend
zsuraski authored Apr 10, 1999
202 #if MEMORY_LIMIT
203 unsigned int memory_limit;
573b460 @andigutmans Zend Library
andigutmans authored Apr 7, 1999
204 unsigned int allocated_memory;
205 unsigned char memory_exhausted;
206 #endif
207 };
208
209
551fe77 @zsuraski Make token names uniform, they all begin with T_ now.
zsuraski authored Apr 22, 1999
210 #endif /* _T_GLOBALS_H */
Something went wrong with that request. Please try again.