home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 15 / AACD15.ISO / AACD / Magazine / HomeAutomation / Apache / include / php / Zend / zend_globals.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-30  |  5.2 KB  |  222 lines

  1. /*
  2.    +----------------------------------------------------------------------+
  3.    | Zend Engine                                                          |
  4.    +----------------------------------------------------------------------+
  5.    | Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
  6.    +----------------------------------------------------------------------+
  7.    | This source file is subject to version 0.92 of the Zend license,     |
  8.    | that is bundled with this package in the file LICENSE, and is        | 
  9.    | available at through the world-wide-web at                           |
  10.    | http://www.zend.com/license/0_92.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.  
  20.  
  21. #ifndef _T_GLOBALS_H
  22. #define _T_GLOBALS_H
  23.  
  24.  
  25. #include <setjmp.h>
  26.  
  27. #include "zend_globals_macros.h"
  28.  
  29. #include "zend_stack.h"
  30. #include "zend_ptr_stack.h"
  31. #include "zend_hash.h"
  32. #include "zend_llist.h"
  33. #include "zend_fast_cache.h"
  34.  
  35. /* Define ZTS if you want a thread-safe Zend */
  36. /*#undef ZTS*/
  37.  
  38. #ifdef ZTS
  39. #include "../TSRM/TSRM.h"
  40.  
  41. #ifdef __cplusplus
  42. class ZendFlexLexer;
  43. #endif
  44.  
  45. BEGIN_EXTERN_C()
  46. ZEND_API extern int compiler_globals_id;
  47. ZEND_API extern int executor_globals_id;
  48. ZEND_API extern int alloc_globals_id;
  49. END_EXTERN_C()
  50.  
  51. #endif
  52.  
  53. #define SYMTABLE_CACHE_SIZE 32
  54.  
  55.  
  56. #include "zend_compile.h"
  57.  
  58. /* excpt.h on Digital Unix 4.0 defines function_table */
  59. #undef function_table
  60.  
  61.  
  62. typedef struct _zend_declarables {
  63.     zval ticks;
  64. } zend_declarables;
  65.  
  66.  
  67. struct _zend_compiler_globals {
  68.     zend_stack bp_stack;
  69.     zend_stack switch_cond_stack;
  70.     zend_stack foreach_copy_stack;
  71.     zend_stack object_stack;
  72.     zend_stack declare_stack;
  73.  
  74.     zend_class_entry class_entry, *active_class_entry;
  75.  
  76.     /* variables for list() compilation */
  77.     zend_llist list_llist;
  78.     zend_llist dimension_llist;
  79.  
  80.     zend_stack function_call_stack;
  81.  
  82.     char *compiled_filename;
  83.  
  84.     int zend_lineno;
  85.     int comment_start_line;
  86.     char *heredoc;
  87.     int heredoc_len;
  88.  
  89.     zend_op_array *active_op_array;
  90.  
  91.     HashTable *function_table;    /* function symbol table */
  92.     HashTable *class_table;        /* class table */
  93.  
  94.     HashTable used_files;        /* files already included using 'use' */
  95.  
  96.     zend_llist filenames_list;
  97.  
  98.     zend_bool in_compilation;
  99.     zend_bool short_tags;
  100.     zend_bool asp_tags;
  101.     zend_bool allow_call_time_pass_reference;
  102.  
  103.     zend_declarables declarables;
  104.  
  105.     /* For extensions support */
  106.     zend_bool extended_info;    /* generate extension information for debugger/profiler */
  107.     zend_bool handle_op_arrays;    /* run op_arrays through op_array handlers */
  108.  
  109.     zend_bool unclean_shutdown;
  110.  
  111.     zend_llist open_files;
  112. #ifdef ZTS
  113. #ifdef __cplusplus
  114.     ZendFlexLexer *ZFL;
  115. #else
  116.     void *ZFL;
  117. #endif
  118. #endif
  119. };
  120.  
  121.  
  122. struct _zend_executor_globals {
  123.     zval **return_value_ptr_ptr;
  124.  
  125.     zval uninitialized_zval;
  126.     zval *uninitialized_zval_ptr;
  127.  
  128.     zval error_zval;
  129.     zval *error_zval_ptr;
  130.  
  131.     zend_function_state *function_state_ptr;
  132.     zend_ptr_stack arg_types_stack;
  133.  
  134.     /* for global return() support */
  135.     zval *global_return_value_ptr;
  136.     zval global_return_value;
  137.  
  138.     /* symbol table cache */
  139.     HashTable *symtable_cache[SYMTABLE_CACHE_SIZE];
  140.     HashTable **symtable_cache_limit;
  141.     HashTable **symtable_cache_ptr;
  142.  
  143.     zend_op **opline_ptr;
  144.  
  145.     HashTable *active_symbol_table;
  146.     HashTable symbol_table;        /* main symbol table */
  147.  
  148.     HashTable included_files;    /* files already included */
  149.  
  150.     jmp_buf bailout;
  151.  
  152.     int error_reporting;
  153.  
  154.     zend_op_array *active_op_array;
  155.     zend_op_array *main_op_array;
  156.  
  157.     HashTable *function_table;    /* function symbol table */
  158.     HashTable *class_table;        /* class table */
  159.     HashTable *zend_constants;    /* constants table */
  160.  
  161.     long precision;
  162.  
  163.     int ticks_count;
  164.  
  165.     zend_bool in_execution;
  166.  
  167.     /* for extended information support */
  168.     zend_bool no_extensions;
  169.  
  170. #ifdef ZEND_WIN32
  171.     zend_bool timed_out;
  172. #endif
  173.  
  174.     HashTable regular_list;
  175.     HashTable persistent_list;
  176.  
  177.     zend_ptr_stack argument_stack;
  178.     int free_op1, free_op2;
  179.     int (*unary_op)(zval *result, zval *op1);
  180.     int (*binary_op)(zval *result, zval *op1, zval *op2);
  181.  
  182.     zval *garbage[4];
  183.     int garbage_ptr;
  184.  
  185.     zval *user_error_handler;
  186.     zend_ptr_stack user_error_handlers;
  187.  
  188.     /* timeout support */
  189.     int timeout_seconds;
  190.  
  191.     int lambda_count;
  192.  
  193.     void *reserved[ZEND_MAX_RESERVED_RESOURCES];
  194. #if SUPPORT_INTERACTIVE
  195.     int interactive;
  196. #endif
  197.  
  198.     int orig_error_reporting;
  199. };
  200.  
  201.  
  202. struct _zend_alloc_globals {
  203.     zend_mem_header *head;        /* standard list */
  204.     zend_mem_header *phead;        /* persistent list */
  205.     void *cache[MAX_CACHED_MEMORY][MAX_CACHED_ENTRIES];
  206.     unsigned int cache_count[MAX_CACHED_MEMORY];
  207.     void *fast_cache_list_head[MAX_FAST_CACHE_TYPES];
  208.  
  209. #if ZEND_DEBUG
  210.     /* for performance tuning */
  211.     int cache_stats[MAX_CACHED_MEMORY][2];
  212.     int fast_cache_stats[MAX_FAST_CACHE_TYPES][2];
  213. #endif
  214. #if MEMORY_LIMIT
  215.     unsigned int memory_limit;
  216.     unsigned int allocated_memory;
  217.     unsigned char memory_exhausted;
  218. #endif
  219. };
  220.  
  221. #endif /* _T_GLOBALS_H */
  222.