zend_globals.h 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. /*
  2. +----------------------------------------------------------------------+
  3. | Zend Engine |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1998-2016 Zend Technologies Ltd. (http://www.zend.com) |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 2.00 of the Zend license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available through the world-wide-web at the following url: |
  10. | http://www.zend.com/license/2_00.txt. |
  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. |
  14. +----------------------------------------------------------------------+
  15. | Authors: Andi Gutmans <andi@zend.com> |
  16. | Zeev Suraski <zeev@zend.com> |
  17. +----------------------------------------------------------------------+
  18. */
  19. /* $Id$ */
  20. #ifndef ZEND_GLOBALS_H
  21. #define ZEND_GLOBALS_H
  22. #include <setjmp.h>
  23. #include "zend_globals_macros.h"
  24. #include "zend_stack.h"
  25. #include "zend_ptr_stack.h"
  26. #include "zend_hash.h"
  27. #include "zend_llist.h"
  28. #include "zend_objects.h"
  29. #include "zend_objects_API.h"
  30. #include "zend_modules.h"
  31. #include "zend_float.h"
  32. #include "zend_multibyte.h"
  33. /* Define ZTS if you want a thread-safe Zend */
  34. /*#undef ZTS*/
  35. #ifdef ZTS
  36. BEGIN_EXTERN_C()
  37. ZEND_API extern int compiler_globals_id;
  38. ZEND_API extern int executor_globals_id;
  39. END_EXTERN_C()
  40. #endif
  41. #define SYMTABLE_CACHE_SIZE 32
  42. #include "zend_compile.h"
  43. /* excpt.h on Digital Unix 4.0 defines function_table */
  44. #undef function_table
  45. #define ZEND_EARLY_BINDING_COMPILE_TIME 0
  46. #define ZEND_EARLY_BINDING_DELAYED 1
  47. #define ZEND_EARLY_BINDING_DELAYED_ALL 2
  48. typedef struct _zend_declarables {
  49. zval ticks;
  50. } zend_declarables;
  51. typedef struct _zend_vm_stack *zend_vm_stack;
  52. typedef struct _zend_ini_entry zend_ini_entry;
  53. struct _zend_compiler_globals {
  54. zend_stack bp_stack;
  55. zend_stack switch_cond_stack;
  56. zend_stack foreach_copy_stack;
  57. zend_stack object_stack;
  58. zend_stack declare_stack;
  59. zend_class_entry *active_class_entry;
  60. /* variables for list() compilation */
  61. zend_llist list_llist;
  62. zend_llist dimension_llist;
  63. zend_stack list_stack;
  64. zend_stack function_call_stack;
  65. char *compiled_filename;
  66. int zend_lineno;
  67. zend_op_array *active_op_array;
  68. HashTable *function_table; /* function symbol table */
  69. HashTable *class_table; /* class table */
  70. HashTable filenames_table;
  71. HashTable *auto_globals;
  72. zend_bool parse_error;
  73. zend_bool in_compilation;
  74. zend_bool short_tags;
  75. zend_bool asp_tags;
  76. zend_declarables declarables;
  77. zend_bool unclean_shutdown;
  78. zend_bool ini_parser_unbuffered_errors;
  79. zend_llist open_files;
  80. long catch_begin;
  81. struct _zend_ini_parser_param *ini_parser_param;
  82. int interactive;
  83. zend_uint start_lineno;
  84. zend_bool increment_lineno;
  85. znode implementing_class;
  86. zend_uint access_type;
  87. char *doc_comment;
  88. zend_uint doc_comment_len;
  89. zend_uint compiler_options; /* set of ZEND_COMPILE_* constants */
  90. zval *current_namespace;
  91. HashTable *current_import;
  92. HashTable *current_import_function;
  93. HashTable *current_import_const;
  94. zend_bool in_namespace;
  95. zend_bool has_bracketed_namespaces;
  96. HashTable const_filenames;
  97. zend_compiler_context context;
  98. zend_stack context_stack;
  99. /* interned strings */
  100. char *interned_strings_start;
  101. char *interned_strings_end;
  102. char *interned_strings_top;
  103. char *interned_strings_snapshot_top;
  104. #ifndef ZTS
  105. char *interned_empty_string;
  106. #endif
  107. HashTable interned_strings;
  108. const zend_encoding **script_encoding_list;
  109. size_t script_encoding_list_size;
  110. zend_bool multibyte;
  111. zend_bool detect_unicode;
  112. zend_bool encoding_declared;
  113. #ifdef ZTS
  114. zval ***static_members_table;
  115. int last_static_member;
  116. #endif
  117. };
  118. struct _zend_executor_globals {
  119. zval **return_value_ptr_ptr;
  120. zval uninitialized_zval;
  121. zval *uninitialized_zval_ptr;
  122. zval error_zval;
  123. zval *error_zval_ptr;
  124. /* symbol table cache */
  125. HashTable *symtable_cache[SYMTABLE_CACHE_SIZE];
  126. HashTable **symtable_cache_limit;
  127. HashTable **symtable_cache_ptr;
  128. zend_op **opline_ptr;
  129. HashTable *active_symbol_table;
  130. HashTable symbol_table; /* main symbol table */
  131. HashTable included_files; /* files already included */
  132. JMP_BUF *bailout;
  133. int error_reporting;
  134. int orig_error_reporting;
  135. int exit_status;
  136. zend_op_array *active_op_array;
  137. HashTable *function_table; /* function symbol table */
  138. HashTable *class_table; /* class table */
  139. HashTable *zend_constants; /* constants table */
  140. zend_class_entry *scope;
  141. zend_class_entry *called_scope; /* Scope of the calling class */
  142. zval *This;
  143. long precision;
  144. int ticks_count;
  145. zend_bool in_execution;
  146. HashTable *in_autoload;
  147. zend_function *autoload_func;
  148. zend_bool full_tables_cleanup;
  149. /* for extended information support */
  150. zend_bool no_extensions;
  151. #ifdef ZEND_WIN32
  152. zend_bool timed_out;
  153. OSVERSIONINFOEX windows_version_info;
  154. #endif
  155. HashTable regular_list;
  156. HashTable persistent_list;
  157. zend_vm_stack argument_stack;
  158. int user_error_handler_error_reporting;
  159. zval *user_error_handler;
  160. zval *user_exception_handler;
  161. zend_stack user_error_handlers_error_reporting;
  162. zend_ptr_stack user_error_handlers;
  163. zend_ptr_stack user_exception_handlers;
  164. zend_error_handling_t error_handling;
  165. zend_class_entry *exception_class;
  166. /* timeout support */
  167. int timeout_seconds;
  168. int lambda_count;
  169. HashTable *ini_directives;
  170. HashTable *modified_ini_directives;
  171. zend_ini_entry *error_reporting_ini_entry;
  172. zend_objects_store objects_store;
  173. zval *exception, *prev_exception;
  174. zend_op *opline_before_exception;
  175. zend_op exception_op[3];
  176. struct _zend_execute_data *current_execute_data;
  177. struct _zend_module_entry *current_module;
  178. zend_property_info std_property_info;
  179. zend_bool active;
  180. zend_op *start_op;
  181. void *saved_fpu_cw_ptr;
  182. #if XPFPA_HAVE_CW
  183. XPFPA_CW_DATATYPE saved_fpu_cw;
  184. #endif
  185. void *reserved[ZEND_MAX_RESERVED_RESOURCES];
  186. };
  187. struct _zend_ini_scanner_globals {
  188. zend_file_handle *yy_in;
  189. zend_file_handle *yy_out;
  190. unsigned int yy_leng;
  191. unsigned char *yy_start;
  192. unsigned char *yy_text;
  193. unsigned char *yy_cursor;
  194. unsigned char *yy_marker;
  195. unsigned char *yy_limit;
  196. int yy_state;
  197. zend_stack state_stack;
  198. char *filename;
  199. int lineno;
  200. /* Modes are: ZEND_INI_SCANNER_NORMAL, ZEND_INI_SCANNER_RAW, ZEND_INI_SCANNER_TYPED */
  201. int scanner_mode;
  202. };
  203. struct _zend_php_scanner_globals {
  204. zend_file_handle *yy_in;
  205. zend_file_handle *yy_out;
  206. unsigned int yy_leng;
  207. unsigned char *yy_start;
  208. unsigned char *yy_text;
  209. unsigned char *yy_cursor;
  210. unsigned char *yy_marker;
  211. unsigned char *yy_limit;
  212. int yy_state;
  213. zend_stack state_stack;
  214. zend_ptr_stack heredoc_label_stack;
  215. /* original (unfiltered) script */
  216. unsigned char *script_org;
  217. size_t script_org_size;
  218. /* filtered script */
  219. unsigned char *script_filtered;
  220. size_t script_filtered_size;
  221. /* input/output filters */
  222. zend_encoding_filter input_filter;
  223. zend_encoding_filter output_filter;
  224. const zend_encoding *script_encoding;
  225. };
  226. #endif /* ZEND_GLOBALS_H */
  227. /*
  228. * Local variables:
  229. * tab-width: 4
  230. * c-basic-offset: 4
  231. * indent-tabs-mode: t
  232. * End:
  233. */