1 /* 2 +----------------------------------------------------------------------+ 3 | Zend Engine | 4 +----------------------------------------------------------------------+ 5 | Copyright (c) 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@php.net> | 16 | Zeev Suraski <zeev@php.net> | 17 +----------------------------------------------------------------------+ 18 */ 19 20 #ifndef ZEND_GLOBALS_MACROS_H 21 #define ZEND_GLOBALS_MACROS_H 22 23 typedef struct _zend_compiler_globals zend_compiler_globals; 24 typedef struct _zend_executor_globals zend_executor_globals; 25 typedef struct _zend_php_scanner_globals zend_php_scanner_globals; 26 typedef struct _zend_ini_scanner_globals zend_ini_scanner_globals; 27 28 BEGIN_EXTERN_C() 29 30 /* Compiler */ 31 #ifdef ZTS 32 # define CG(v) ZEND_TSRMG_FAST(compiler_globals_offset, zend_compiler_globals *, v) 33 #else 34 # define CG(v) (compiler_globals.v) 35 extern ZEND_API struct _zend_compiler_globals compiler_globals; 36 #endif 37 ZEND_API int zendparse(void); 38 39 40 /* Executor */ 41 #ifdef ZTS 42 # define EG(v) ZEND_TSRMG_FAST(executor_globals_offset, zend_executor_globals *, v) 43 #else 44 # define EG(v) (executor_globals.v) 45 extern ZEND_API zend_executor_globals executor_globals; 46 #endif 47 48 /* Language Scanner */ 49 #ifdef ZTS 50 # define LANG_SCNG(v) ZEND_TSRMG_FAST(language_scanner_globals_offset, zend_php_scanner_globals *, v) 51 extern ZEND_API ts_rsrc_id language_scanner_globals_id; 52 extern ZEND_API size_t language_scanner_globals_offset; 53 #else 54 # define LANG_SCNG(v) (language_scanner_globals.v) 55 extern ZEND_API zend_php_scanner_globals language_scanner_globals; 56 #endif 57 58 59 /* INI Scanner */ 60 #ifdef ZTS 61 # define INI_SCNG(v) ZEND_TSRMG_FAST(ini_scanner_globals_offset, zend_ini_scanner_globals *, v) 62 extern ZEND_API ts_rsrc_id ini_scanner_globals_id; 63 extern ZEND_API size_t ini_scanner_globals_offset; 64 #else 65 # define INI_SCNG(v) (ini_scanner_globals.v) 66 extern ZEND_API zend_ini_scanner_globals ini_scanner_globals; 67 #endif 68 69 END_EXTERN_C() 70 71 #endif /* ZEND_GLOBALS_MACROS_H */ 72