xref: /PHP-7.2/Zend/zend_globals_macros.h (revision 7a7ec01a)
1 /*
2    +----------------------------------------------------------------------+
3    | Zend Engine                                                          |
4    +----------------------------------------------------------------------+
5    | Copyright (c) 1998-2018 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 
20 /* $Id$ */
21 
22 #ifndef ZEND_GLOBALS_MACROS_H
23 #define ZEND_GLOBALS_MACROS_H
24 
25 typedef struct _zend_compiler_globals zend_compiler_globals;
26 typedef struct _zend_executor_globals zend_executor_globals;
27 typedef struct _zend_php_scanner_globals zend_php_scanner_globals;
28 typedef struct _zend_ini_scanner_globals zend_ini_scanner_globals;
29 
30 BEGIN_EXTERN_C()
31 
32 /* Compiler */
33 #ifdef ZTS
34 # define CG(v) ZEND_TSRMG(compiler_globals_id, zend_compiler_globals *, v)
35 #else
36 # define CG(v) (compiler_globals.v)
37 extern ZEND_API struct _zend_compiler_globals compiler_globals;
38 #endif
39 ZEND_API int zendparse(void);
40 
41 
42 /* Executor */
43 #ifdef ZTS
44 # define EG(v) ZEND_TSRMG(executor_globals_id, zend_executor_globals *, v)
45 #else
46 # define EG(v) (executor_globals.v)
47 extern ZEND_API zend_executor_globals executor_globals;
48 #endif
49 
50 /* Language Scanner */
51 #ifdef ZTS
52 # define LANG_SCNG(v) ZEND_TSRMG(language_scanner_globals_id, zend_php_scanner_globals *, v)
53 extern ZEND_API ts_rsrc_id language_scanner_globals_id;
54 #else
55 # define LANG_SCNG(v) (language_scanner_globals.v)
56 extern ZEND_API zend_php_scanner_globals language_scanner_globals;
57 #endif
58 
59 
60 /* INI Scanner */
61 #ifdef ZTS
62 # define INI_SCNG(v) ZEND_TSRMG(ini_scanner_globals_id, zend_ini_scanner_globals *, v)
63 extern ZEND_API ts_rsrc_id ini_scanner_globals_id;
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 
73 /*
74  * Local variables:
75  * tab-width: 4
76  * c-basic-offset: 4
77  * indent-tabs-mode: t
78  * End:
79  * vim600: sw=4 ts=4 fdm=marker
80  * vim<600: sw=4 ts=4
81  */
82