1999-04-08 02:10:10 +08:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| Zend Engine |
|
|
|
|
+----------------------------------------------------------------------+
|
2014-01-03 11:08:10 +08:00
|
|
|
| Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) |
|
1999-04-08 02:10:10 +08:00
|
|
|
+----------------------------------------------------------------------+
|
2001-12-11 23:16:21 +08:00
|
|
|
| This source file is subject to version 2.00 of the Zend license, |
|
1999-07-16 22:58:16 +08:00
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
2003-06-11 04:04:29 +08:00
|
|
|
| available through the world-wide-web at the following url: |
|
2001-12-11 23:16:21 +08:00
|
|
|
| http://www.zend.com/license/2_00.txt. |
|
1999-07-16 22:58:16 +08:00
|
|
|
| If you did not receive a copy of the Zend license and are unable to |
|
|
|
|
| obtain it through the world-wide-web, please send a note to |
|
|
|
|
| license@zend.com so we can mail you a copy immediately. |
|
1999-04-08 02:10:10 +08:00
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| Authors: Andi Gutmans <andi@zend.com> |
|
|
|
|
| Zeev Suraski <zeev@zend.com> |
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
*/
|
|
|
|
|
2003-02-01 09:49:15 +08:00
|
|
|
/* $Id$ */
|
1999-07-16 22:58:16 +08:00
|
|
|
|
2000-07-03 08:55:36 +08:00
|
|
|
#ifndef ZEND_GLOBALS_H
|
|
|
|
#define ZEND_GLOBALS_H
|
1999-04-08 02:10:10 +08:00
|
|
|
|
1999-09-06 03:03:35 +08:00
|
|
|
|
1999-04-08 02:10:10 +08:00
|
|
|
#include <setjmp.h>
|
|
|
|
|
1999-09-06 03:03:35 +08:00
|
|
|
#include "zend_globals_macros.h"
|
|
|
|
|
1999-04-08 02:10:10 +08:00
|
|
|
#include "zend_stack.h"
|
|
|
|
#include "zend_ptr_stack.h"
|
|
|
|
#include "zend_hash.h"
|
|
|
|
#include "zend_llist.h"
|
2002-02-07 22:08:43 +08:00
|
|
|
#include "zend_objects.h"
|
2002-05-31 20:09:19 +08:00
|
|
|
#include "zend_objects_API.h"
|
2004-03-31 02:36:53 +08:00
|
|
|
#include "zend_modules.h"
|
2010-07-09 17:02:14 +08:00
|
|
|
#include "zend_float.h"
|
2008-06-29 16:21:35 +08:00
|
|
|
#include "zend_multibyte.h"
|
|
|
|
|
1999-04-21 11:49:09 +08:00
|
|
|
/* Define ZTS if you want a thread-safe Zend */
|
1999-04-21 23:35:57 +08:00
|
|
|
/*#undef ZTS*/
|
1999-04-08 02:10:10 +08:00
|
|
|
|
|
|
|
#ifdef ZTS
|
1999-04-23 11:32:33 +08:00
|
|
|
|
|
|
|
BEGIN_EXTERN_C()
|
1999-04-25 00:16:11 +08:00
|
|
|
ZEND_API extern int compiler_globals_id;
|
|
|
|
ZEND_API extern int executor_globals_id;
|
1999-04-23 11:32:33 +08:00
|
|
|
END_EXTERN_C()
|
|
|
|
|
1999-04-08 02:10:10 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define SYMTABLE_CACHE_SIZE 32
|
|
|
|
|
|
|
|
|
|
|
|
#include "zend_compile.h"
|
|
|
|
|
1999-10-05 23:13:22 +08:00
|
|
|
/* excpt.h on Digital Unix 4.0 defines function_table */
|
|
|
|
#undef function_table
|
2000-01-25 03:00:30 +08:00
|
|
|
|
2008-03-18 16:36:30 +08:00
|
|
|
#define ZEND_EARLY_BINDING_COMPILE_TIME 0
|
|
|
|
#define ZEND_EARLY_BINDING_DELAYED 1
|
|
|
|
#define ZEND_EARLY_BINDING_DELAYED_ALL 2
|
2000-01-25 03:00:30 +08:00
|
|
|
|
|
|
|
typedef struct _zend_declarables {
|
|
|
|
zval ticks;
|
|
|
|
} zend_declarables;
|
|
|
|
|
2008-01-24 17:41:39 +08:00
|
|
|
typedef struct _zend_vm_stack *zend_vm_stack;
|
2010-08-18 21:58:13 +08:00
|
|
|
typedef struct _zend_ini_entry zend_ini_entry;
|
|
|
|
|
2000-01-25 03:00:30 +08:00
|
|
|
|
1999-04-08 02:10:10 +08:00
|
|
|
struct _zend_compiler_globals {
|
|
|
|
zend_stack bp_stack;
|
|
|
|
zend_stack switch_cond_stack;
|
1999-09-09 22:15:17 +08:00
|
|
|
zend_stack foreach_copy_stack;
|
1999-04-08 02:10:10 +08:00
|
|
|
zend_stack object_stack;
|
2000-01-25 03:00:30 +08:00
|
|
|
zend_stack declare_stack;
|
1999-04-08 02:10:10 +08:00
|
|
|
|
2001-10-30 01:19:02 +08:00
|
|
|
zend_class_entry *active_class_entry;
|
1999-04-08 02:10:10 +08:00
|
|
|
|
|
|
|
/* variables for list() compilation */
|
|
|
|
zend_llist list_llist;
|
|
|
|
zend_llist dimension_llist;
|
2001-07-16 23:48:31 +08:00
|
|
|
zend_stack list_stack;
|
1999-04-08 02:10:10 +08:00
|
|
|
|
|
|
|
zend_stack function_call_stack;
|
|
|
|
|
2014-02-10 14:04:30 +08:00
|
|
|
zend_string *compiled_filename;
|
1999-04-08 02:10:10 +08:00
|
|
|
|
|
|
|
int zend_lineno;
|
2008-04-10 04:50:58 +08:00
|
|
|
|
1999-04-08 02:10:10 +08:00
|
|
|
zend_op_array *active_op_array;
|
|
|
|
|
|
|
|
HashTable *function_table; /* function symbol table */
|
|
|
|
HashTable *class_table; /* class table */
|
|
|
|
|
2000-08-20 01:50:42 +08:00
|
|
|
HashTable filenames_table;
|
1999-04-08 02:10:10 +08:00
|
|
|
|
2001-08-09 01:18:16 +08:00
|
|
|
HashTable *auto_globals;
|
|
|
|
|
2011-06-24 07:00:53 +08:00
|
|
|
zend_bool parse_error;
|
2000-02-04 22:45:58 +08:00
|
|
|
zend_bool in_compilation;
|
1999-07-02 22:10:57 +08:00
|
|
|
zend_bool short_tags;
|
|
|
|
zend_bool asp_tags;
|
1999-04-08 02:10:10 +08:00
|
|
|
|
2000-01-25 03:00:30 +08:00
|
|
|
zend_declarables declarables;
|
|
|
|
|
1999-07-02 22:10:57 +08:00
|
|
|
zend_bool unclean_shutdown;
|
1999-05-22 10:13:01 +08:00
|
|
|
|
2000-10-31 07:19:48 +08:00
|
|
|
zend_bool ini_parser_unbuffered_errors;
|
|
|
|
|
1999-05-22 10:13:01 +08:00
|
|
|
zend_llist open_files;
|
2001-07-15 22:08:58 +08:00
|
|
|
|
2002-01-14 04:21:55 +08:00
|
|
|
long catch_begin;
|
2001-08-30 23:26:30 +08:00
|
|
|
|
2001-08-06 21:48:51 +08:00
|
|
|
struct _zend_ini_parser_param *ini_parser_param;
|
|
|
|
|
2001-07-15 22:08:58 +08:00
|
|
|
int interactive;
|
2001-08-06 22:36:46 +08:00
|
|
|
|
2003-01-06 00:09:59 +08:00
|
|
|
zend_uint start_lineno;
|
2001-08-06 22:36:46 +08:00
|
|
|
zend_bool increment_lineno;
|
2002-03-03 04:38:52 +08:00
|
|
|
|
2003-03-05 19:14:44 +08:00
|
|
|
znode implementing_class;
|
2002-12-07 01:09:44 +08:00
|
|
|
|
2003-02-04 20:12:34 +08:00
|
|
|
zend_uint access_type;
|
2003-04-03 00:51:49 +08:00
|
|
|
|
2014-02-10 14:04:30 +08:00
|
|
|
zend_string *doc_comment;
|
2003-08-11 13:24:42 +08:00
|
|
|
|
2008-03-18 16:36:30 +08:00
|
|
|
zend_uint compiler_options; /* set of ZEND_COMPILE_* constants */
|
|
|
|
|
2014-02-10 14:04:30 +08:00
|
|
|
zval current_namespace;
|
2007-09-29 03:52:53 +08:00
|
|
|
HashTable *current_import;
|
2013-07-17 02:39:33 +08:00
|
|
|
HashTable *current_import_function;
|
2013-07-24 02:21:48 +08:00
|
|
|
HashTable *current_import_const;
|
2008-11-25 17:56:32 +08:00
|
|
|
zend_bool in_namespace;
|
|
|
|
zend_bool has_bracketed_namespaces;
|
2007-09-29 03:52:53 +08:00
|
|
|
|
2013-08-25 05:53:43 +08:00
|
|
|
HashTable const_filenames;
|
|
|
|
|
2010-09-15 15:38:52 +08:00
|
|
|
zend_compiler_context context;
|
|
|
|
zend_stack context_stack;
|
2008-03-28 22:35:01 +08:00
|
|
|
|
2014-02-10 14:04:30 +08:00
|
|
|
zend_string *empty_string;
|
2010-04-20 19:05:54 +08:00
|
|
|
|
|
|
|
HashTable interned_strings;
|
|
|
|
|
2010-12-20 00:36:37 +08:00
|
|
|
const zend_encoding **script_encoding_list;
|
2008-07-25 06:21:41 +08:00
|
|
|
size_t script_encoding_list_size;
|
2010-11-24 13:41:23 +08:00
|
|
|
zend_bool multibyte;
|
2008-06-29 16:21:35 +08:00
|
|
|
zend_bool detect_unicode;
|
2008-07-25 06:21:41 +08:00
|
|
|
zend_bool encoding_declared;
|
2008-06-29 16:21:35 +08:00
|
|
|
|
2005-12-01 19:48:17 +08:00
|
|
|
#ifdef ZTS
|
2010-05-25 01:07:52 +08:00
|
|
|
zval ***static_members_table;
|
2005-12-01 19:48:17 +08:00
|
|
|
int last_static_member;
|
|
|
|
#endif
|
1999-04-08 02:10:10 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct _zend_executor_globals {
|
|
|
|
zval uninitialized_zval;
|
|
|
|
zval error_zval;
|
|
|
|
|
|
|
|
/* symbol table cache */
|
2014-03-18 03:15:22 +08:00
|
|
|
zend_array *symtable_cache[SYMTABLE_CACHE_SIZE];
|
|
|
|
zend_array **symtable_cache_limit;
|
|
|
|
zend_array **symtable_cache_ptr;
|
1999-04-08 02:10:10 +08:00
|
|
|
|
|
|
|
zend_op **opline_ptr;
|
|
|
|
|
2014-03-18 03:15:22 +08:00
|
|
|
zend_array *active_symbol_table;
|
2014-02-10 14:04:30 +08:00
|
|
|
zend_array symbol_table; /* main symbol table */
|
1999-04-08 02:10:10 +08:00
|
|
|
|
2000-03-11 00:36:30 +08:00
|
|
|
HashTable included_files; /* files already included */
|
1999-12-01 04:15:04 +08:00
|
|
|
|
2008-03-19 05:14:28 +08:00
|
|
|
JMP_BUF *bailout;
|
1999-04-08 02:10:10 +08:00
|
|
|
|
|
|
|
int error_reporting;
|
2000-06-30 19:45:32 +08:00
|
|
|
int orig_error_reporting;
|
2000-11-22 12:24:35 +08:00
|
|
|
int exit_status;
|
1999-04-08 02:10:10 +08:00
|
|
|
|
|
|
|
zend_op_array *active_op_array;
|
|
|
|
|
|
|
|
HashTable *function_table; /* function symbol table */
|
|
|
|
HashTable *class_table; /* class table */
|
|
|
|
HashTable *zend_constants; /* constants table */
|
|
|
|
|
2002-03-01 22:27:26 +08:00
|
|
|
zend_class_entry *scope;
|
2007-09-29 15:28:34 +08:00
|
|
|
zend_class_entry *called_scope; /* Scope of the calling class */
|
2001-12-07 01:47:04 +08:00
|
|
|
|
2014-02-10 14:04:30 +08:00
|
|
|
zval This;
|
2002-01-05 23:18:30 +08:00
|
|
|
|
1999-04-08 02:10:10 +08:00
|
|
|
long precision;
|
|
|
|
|
2000-01-25 03:00:30 +08:00
|
|
|
int ticks_count;
|
|
|
|
|
2000-02-04 22:45:58 +08:00
|
|
|
zend_bool in_execution;
|
2004-03-24 22:30:59 +08:00
|
|
|
HashTable *in_autoload;
|
2004-08-24 04:57:40 +08:00
|
|
|
zend_function *autoload_func;
|
2001-10-23 09:23:36 +08:00
|
|
|
zend_bool full_tables_cleanup;
|
2000-02-04 22:45:58 +08:00
|
|
|
|
1999-04-08 02:10:10 +08:00
|
|
|
/* for extended information support */
|
1999-07-29 01:59:55 +08:00
|
|
|
zend_bool no_extensions;
|
1999-04-08 02:10:10 +08:00
|
|
|
|
2000-06-16 22:27:28 +08:00
|
|
|
#ifdef ZEND_WIN32
|
|
|
|
zend_bool timed_out;
|
2009-01-16 08:57:43 +08:00
|
|
|
OSVERSIONINFOEX windows_version_info;
|
2000-06-16 22:27:28 +08:00
|
|
|
#endif
|
|
|
|
|
1999-04-08 02:10:10 +08:00
|
|
|
HashTable regular_list;
|
|
|
|
HashTable persistent_list;
|
|
|
|
|
2008-01-24 17:41:39 +08:00
|
|
|
zend_vm_stack argument_stack;
|
1999-10-04 04:06:21 +08:00
|
|
|
|
2004-01-10 19:43:42 +08:00
|
|
|
int user_error_handler_error_reporting;
|
2014-02-10 14:04:30 +08:00
|
|
|
zval user_error_handler;
|
|
|
|
zval user_exception_handler;
|
2004-01-10 19:43:42 +08:00
|
|
|
zend_stack user_error_handlers_error_reporting;
|
2014-02-10 14:04:30 +08:00
|
|
|
zend_stack user_error_handlers;
|
|
|
|
zend_stack user_exception_handlers;
|
2000-04-19 23:08:06 +08:00
|
|
|
|
2008-03-09 05:54:03 +08:00
|
|
|
zend_error_handling_t error_handling;
|
|
|
|
zend_class_entry *exception_class;
|
|
|
|
|
2000-06-16 09:54:56 +08:00
|
|
|
/* timeout support */
|
|
|
|
int timeout_seconds;
|
|
|
|
|
2000-06-03 09:49:49 +08:00
|
|
|
int lambda_count;
|
|
|
|
|
2002-09-24 01:20:59 +08:00
|
|
|
HashTable *ini_directives;
|
2006-05-15 22:52:35 +08:00
|
|
|
HashTable *modified_ini_directives;
|
2010-08-18 21:58:13 +08:00
|
|
|
zend_ini_entry *error_reporting_ini_entry;
|
2006-05-15 22:52:35 +08:00
|
|
|
|
2002-05-31 20:09:19 +08:00
|
|
|
zend_objects_store objects_store;
|
2014-02-10 14:04:30 +08:00
|
|
|
zend_object *exception, *prev_exception;
|
2004-02-03 20:17:09 +08:00
|
|
|
zend_op *opline_before_exception;
|
2008-01-22 03:39:55 +08:00
|
|
|
zend_op exception_op[3];
|
2000-12-27 23:43:15 +08:00
|
|
|
|
2002-05-03 01:20:48 +08:00
|
|
|
struct _zend_execute_data *current_execute_data;
|
|
|
|
|
2004-03-31 02:36:53 +08:00
|
|
|
struct _zend_module_entry *current_module;
|
2004-02-03 20:17:09 +08:00
|
|
|
|
2003-02-07 18:05:36 +08:00
|
|
|
zend_property_info std_property_info;
|
|
|
|
|
2006-09-11 22:30:08 +08:00
|
|
|
zend_bool active;
|
|
|
|
|
2010-09-15 15:38:52 +08:00
|
|
|
zend_op *start_op;
|
|
|
|
|
2010-07-09 17:02:14 +08:00
|
|
|
void *saved_fpu_cw_ptr;
|
|
|
|
#if XPFPA_HAVE_CW
|
|
|
|
XPFPA_CW_DATATYPE saved_fpu_cw;
|
|
|
|
#endif
|
2009-03-18 18:18:10 +08:00
|
|
|
|
1999-08-16 03:29:39 +08:00
|
|
|
void *reserved[ZEND_MAX_RESERVED_RESOURCES];
|
1999-04-08 02:10:10 +08:00
|
|
|
};
|
|
|
|
|
2008-03-17 05:06:55 +08:00
|
|
|
struct _zend_ini_scanner_globals {
|
2003-02-18 17:37:54 +08:00
|
|
|
zend_file_handle *yy_in;
|
|
|
|
zend_file_handle *yy_out;
|
2008-03-17 05:06:55 +08:00
|
|
|
|
2008-07-25 06:21:41 +08:00
|
|
|
unsigned int yy_leng;
|
|
|
|
unsigned char *yy_start;
|
|
|
|
unsigned char *yy_text;
|
|
|
|
unsigned char *yy_cursor;
|
|
|
|
unsigned char *yy_marker;
|
|
|
|
unsigned char *yy_limit;
|
|
|
|
int yy_state;
|
|
|
|
zend_stack state_stack;
|
2008-03-17 05:06:55 +08:00
|
|
|
|
|
|
|
char *filename;
|
2002-10-15 07:41:32 +08:00
|
|
|
int lineno;
|
2008-03-17 05:06:55 +08:00
|
|
|
|
|
|
|
/* Modes are: ZEND_INI_SCANNER_NORMAL, ZEND_INI_SCANNER_RAW */
|
2007-09-28 10:05:10 +08:00
|
|
|
int scanner_mode;
|
2008-03-17 05:06:55 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _zend_php_scanner_globals {
|
|
|
|
zend_file_handle *yy_in;
|
|
|
|
zend_file_handle *yy_out;
|
2007-09-28 10:05:10 +08:00
|
|
|
|
2008-03-17 05:06:55 +08:00
|
|
|
unsigned int yy_leng;
|
|
|
|
unsigned char *yy_start;
|
|
|
|
unsigned char *yy_text;
|
|
|
|
unsigned char *yy_cursor;
|
|
|
|
unsigned char *yy_marker;
|
|
|
|
unsigned char *yy_limit;
|
|
|
|
int yy_state;
|
|
|
|
zend_stack state_stack;
|
2012-03-31 02:41:44 +08:00
|
|
|
zend_ptr_stack heredoc_label_stack;
|
2008-03-17 05:06:55 +08:00
|
|
|
|
2008-06-29 16:21:35 +08:00
|
|
|
/* original (unfiltered) script */
|
2008-07-25 06:21:41 +08:00
|
|
|
unsigned char *script_org;
|
|
|
|
size_t script_org_size;
|
2008-06-29 16:21:35 +08:00
|
|
|
|
|
|
|
/* filtered script */
|
2008-07-25 06:21:41 +08:00
|
|
|
unsigned char *script_filtered;
|
|
|
|
size_t script_filtered_size;
|
2008-06-29 16:21:35 +08:00
|
|
|
|
2013-07-24 07:55:43 +08:00
|
|
|
/* input/output filters */
|
2008-06-29 16:21:35 +08:00
|
|
|
zend_encoding_filter input_filter;
|
|
|
|
zend_encoding_filter output_filter;
|
2010-12-20 00:36:37 +08:00
|
|
|
const zend_encoding *script_encoding;
|
2014-02-10 14:04:30 +08:00
|
|
|
|
|
|
|
/* initial string length after scanning to first variable */
|
|
|
|
int scanned_string_len;
|
2001-08-06 21:48:51 +08:00
|
|
|
};
|
|
|
|
|
2000-07-03 08:55:36 +08:00
|
|
|
#endif /* ZEND_GLOBALS_H */
|
2003-02-01 09:49:15 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Local variables:
|
|
|
|
* tab-width: 4
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* indent-tabs-mode: t
|
|
|
|
* End:
|
|
|
|
*/
|