Back to index

php5  5.3.10
zend_globals.h
Go to the documentation of this file.
00001 /*
00002    +----------------------------------------------------------------------+
00003    | Zend Engine                                                          |
00004    +----------------------------------------------------------------------+
00005    | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
00006    +----------------------------------------------------------------------+
00007    | This source file is subject to version 2.00 of the Zend license,     |
00008    | that is bundled with this package in the file LICENSE, and is        | 
00009    | available through the world-wide-web at the following url:           |
00010    | http://www.zend.com/license/2_00.txt.                                |
00011    | If you did not receive a copy of the Zend license and are unable to  |
00012    | obtain it through the world-wide-web, please send a note to          |
00013    | license@zend.com so we can mail you a copy immediately.              |
00014    +----------------------------------------------------------------------+
00015    | Authors: Andi Gutmans <andi@zend.com>                                |
00016    |          Zeev Suraski <zeev@zend.com>                                |
00017    +----------------------------------------------------------------------+
00018 */
00019 
00020 /* $Id: zend_globals.h 321634 2012-01-01 13:15:04Z felipe $ */
00021 
00022 #ifndef ZEND_GLOBALS_H
00023 #define ZEND_GLOBALS_H
00024 
00025 
00026 #include <setjmp.h>
00027 
00028 #include "zend_globals_macros.h"
00029 
00030 #include "zend_stack.h"
00031 #include "zend_ptr_stack.h"
00032 #include "zend_hash.h"
00033 #include "zend_llist.h"
00034 #include "zend_objects.h"
00035 #include "zend_objects_API.h"
00036 #include "zend_modules.h"
00037 
00038 #ifdef ZEND_MULTIBYTE
00039 #include "zend_multibyte.h"
00040 #endif /* ZEND_MULTIBYTE */
00041 
00042 /* Define ZTS if you want a thread-safe Zend */
00043 /*#undef ZTS*/
00044 
00045 #ifdef ZTS
00046 
00047 BEGIN_EXTERN_C()
00048 ZEND_API extern int compiler_globals_id;
00049 ZEND_API extern int executor_globals_id;
00050 END_EXTERN_C()
00051 
00052 #endif
00053 
00054 #define SYMTABLE_CACHE_SIZE 32
00055 
00056 
00057 #include "zend_compile.h"
00058 
00059 /* excpt.h on Digital Unix 4.0 defines function_table */
00060 #undef function_table
00061 
00062 #define ZEND_EARLY_BINDING_COMPILE_TIME 0
00063 #define ZEND_EARLY_BINDING_DELAYED      1
00064 #define ZEND_EARLY_BINDING_DELAYED_ALL  2
00065 
00066 typedef struct _zend_declarables {
00067        zval ticks;
00068 } zend_declarables;
00069 
00070 typedef struct _zend_vm_stack *zend_vm_stack;
00071 
00072 struct _zend_compiler_globals {
00073        zend_stack bp_stack;
00074        zend_stack switch_cond_stack;
00075        zend_stack foreach_copy_stack;
00076        zend_stack object_stack;
00077        zend_stack declare_stack;
00078 
00079        zend_class_entry *active_class_entry;
00080 
00081        /* variables for list() compilation */
00082        zend_llist list_llist;
00083        zend_llist dimension_llist;
00084        zend_stack list_stack;
00085 
00086        zend_stack function_call_stack;
00087 
00088        char *compiled_filename;
00089 
00090        int zend_lineno;
00091 
00092        char *heredoc;
00093        int heredoc_len;
00094 
00095        zend_op_array *active_op_array;
00096 
00097        HashTable *function_table;  /* function symbol table */
00098        HashTable *class_table;            /* class table */
00099 
00100        HashTable filenames_table;
00101 
00102        HashTable *auto_globals;
00103 
00104        zend_bool in_compilation;
00105        zend_bool short_tags;
00106        zend_bool asp_tags;
00107        zend_bool allow_call_time_pass_reference;
00108 
00109        zend_declarables declarables;
00110 
00111        zend_bool unclean_shutdown;
00112 
00113        zend_bool ini_parser_unbuffered_errors;
00114 
00115        zend_llist open_files;
00116 
00117        long catch_begin;
00118 
00119        struct _zend_ini_parser_param *ini_parser_param;
00120 
00121        int interactive;
00122 
00123        zend_uint start_lineno;
00124        zend_bool increment_lineno;
00125 
00126        znode implementing_class;
00127 
00128        zend_uint access_type;
00129 
00130        char *doc_comment;
00131        zend_uint doc_comment_len;
00132 
00133        zend_uint compiler_options; /* set of ZEND_COMPILE_* constants */
00134 
00135        zval      *current_namespace;
00136        HashTable *current_import;
00137        zend_bool  in_namespace;
00138        zend_bool  has_bracketed_namespaces;
00139 
00140        HashTable *labels;
00141        zend_stack labels_stack;
00142 
00143 #ifdef ZEND_MULTIBYTE
00144        zend_encoding **script_encoding_list;
00145        size_t script_encoding_list_size;
00146        zend_bool detect_unicode;
00147        zend_bool encoding_declared;
00148 
00149        zend_encoding *internal_encoding;
00150 
00151        /* multibyte utility functions */
00152        zend_encoding_detector encoding_detector;
00153        zend_encoding_converter encoding_converter;
00154        zend_encoding_oddlen encoding_oddlen;
00155 #endif /* ZEND_MULTIBYTE */
00156 
00157 #ifdef ZTS
00158        HashTable **static_members;
00159        int last_static_member;
00160 #endif
00161 };
00162 
00163 
00164 struct _zend_executor_globals {
00165        zval **return_value_ptr_ptr;
00166 
00167        zval uninitialized_zval;
00168        zval *uninitialized_zval_ptr;
00169 
00170        zval error_zval;
00171        zval *error_zval_ptr;
00172 
00173        zend_ptr_stack arg_types_stack;
00174 
00175        /* symbol table cache */
00176        HashTable *symtable_cache[SYMTABLE_CACHE_SIZE];
00177        HashTable **symtable_cache_limit;
00178        HashTable **symtable_cache_ptr;
00179 
00180        zend_op **opline_ptr;
00181 
00182        HashTable *active_symbol_table;
00183        HashTable symbol_table;            /* main symbol table */
00184 
00185        HashTable included_files;   /* files already included */
00186 
00187        JMP_BUF *bailout;
00188 
00189        int error_reporting;
00190        int orig_error_reporting;
00191        int exit_status;
00192 
00193        zend_op_array *active_op_array;
00194 
00195        HashTable *function_table;  /* function symbol table */
00196        HashTable *class_table;            /* class table */
00197        HashTable *zend_constants;  /* constants table */
00198 
00199        zend_class_entry *scope;
00200        zend_class_entry *called_scope; /* Scope of the calling class */
00201 
00202        zval *This;
00203 
00204        long precision;
00205 
00206        int ticks_count;
00207 
00208        zend_bool in_execution;
00209        HashTable *in_autoload;
00210        zend_function *autoload_func;
00211        zend_bool full_tables_cleanup;
00212 
00213        /* for extended information support */
00214        zend_bool no_extensions;
00215 
00216 #ifdef ZEND_WIN32
00217        zend_bool timed_out;
00218        OSVERSIONINFOEX windows_version_info;
00219 #endif
00220 
00221        HashTable regular_list;
00222        HashTable persistent_list;
00223 
00224        zend_vm_stack argument_stack;
00225 
00226        int user_error_handler_error_reporting;
00227        zval *user_error_handler;
00228        zval *user_exception_handler;
00229        zend_stack user_error_handlers_error_reporting;
00230        zend_ptr_stack user_error_handlers;
00231        zend_ptr_stack user_exception_handlers;
00232 
00233        zend_error_handling_t  error_handling;
00234        zend_class_entry      *exception_class;
00235 
00236        /* timeout support */
00237        int timeout_seconds;
00238 
00239        int lambda_count;
00240 
00241        HashTable *ini_directives;
00242        HashTable *modified_ini_directives;
00243 
00244        zend_objects_store objects_store;
00245        zval *exception, *prev_exception;
00246        zend_op *opline_before_exception;
00247        zend_op exception_op[3];
00248 
00249        struct _zend_execute_data *current_execute_data;
00250 
00251        struct _zend_module_entry *current_module;
00252 
00253        zend_property_info std_property_info;
00254 
00255        zend_bool active; 
00256 
00257        void *saved_fpu_cw;
00258 
00259        void *reserved[ZEND_MAX_RESERVED_RESOURCES];
00260 };
00261 
00262 struct _zend_ini_scanner_globals {
00263        zend_file_handle *yy_in;
00264        zend_file_handle *yy_out;
00265 
00266        unsigned int yy_leng;
00267        unsigned char *yy_start;
00268        unsigned char *yy_text;
00269        unsigned char *yy_cursor;
00270        unsigned char *yy_marker;
00271        unsigned char *yy_limit;
00272        int yy_state;
00273        zend_stack state_stack;
00274 
00275        char *filename;
00276        int lineno;
00277 
00278        /* Modes are: ZEND_INI_SCANNER_NORMAL, ZEND_INI_SCANNER_RAW */
00279        int scanner_mode;
00280 };
00281 
00282 struct _zend_php_scanner_globals {
00283        zend_file_handle *yy_in;
00284        zend_file_handle *yy_out;
00285 
00286        unsigned int yy_leng;
00287        unsigned char *yy_start;
00288        unsigned char *yy_text;
00289        unsigned char *yy_cursor;
00290        unsigned char *yy_marker;
00291        unsigned char *yy_limit;
00292        int yy_state;
00293        zend_stack state_stack;
00294        
00295 #ifdef ZEND_MULTIBYTE
00296        /* original (unfiltered) script */
00297        unsigned char *script_org;
00298        size_t script_org_size;
00299 
00300        /* filtered script */
00301        unsigned char *script_filtered;
00302        size_t script_filtered_size;
00303 
00304        /* input/ouput filters */
00305        zend_encoding_filter input_filter;
00306        zend_encoding_filter output_filter;
00307        zend_encoding *script_encoding;
00308        zend_encoding *internal_encoding;
00309 #endif /* ZEND_MULTIBYTE */
00310 };
00311 
00312 #endif /* ZEND_GLOBALS_H */
00313 
00314 /*
00315  * Local variables:
00316  * tab-width: 4
00317  * c-basic-offset: 4
00318  * indent-tabs-mode: t
00319  * End:
00320  */