xref: /PHP-7.3/Zend/zend_globals_macros.h (revision 9afce019)
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@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(compiler_globals_id, 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(executor_globals_id, 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(language_scanner_globals_id, zend_php_scanner_globals *, v)
51 extern ZEND_API ts_rsrc_id language_scanner_globals_id;
52 #else
53 # define LANG_SCNG(v) (language_scanner_globals.v)
54 extern ZEND_API zend_php_scanner_globals language_scanner_globals;
55 #endif
56 
57 
58 /* INI Scanner */
59 #ifdef ZTS
60 # define INI_SCNG(v) ZEND_TSRMG(ini_scanner_globals_id, zend_ini_scanner_globals *, v)
61 extern ZEND_API ts_rsrc_id ini_scanner_globals_id;
62 #else
63 # define INI_SCNG(v) (ini_scanner_globals.v)
64 extern ZEND_API zend_ini_scanner_globals ini_scanner_globals;
65 #endif
66 
67 END_EXTERN_C()
68 
69 #endif /* ZEND_GLOBALS_MACROS_H */
70 
71 /*
72  * Local variables:
73  * tab-width: 4
74  * c-basic-offset: 4
75  * indent-tabs-mode: t
76  * End:
77  * vim600: sw=4 ts=4 fdm=marker
78  * vim<600: sw=4 ts=4
79  */
80