zend_globals_macros.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. #ifndef ZEND_GLOBALS_MACROS_H
  20. #define ZEND_GLOBALS_MACROS_H
  21. typedef struct _zend_compiler_globals zend_compiler_globals;
  22. typedef struct _zend_executor_globals zend_executor_globals;
  23. typedef struct _zend_php_scanner_globals zend_php_scanner_globals;
  24. typedef struct _zend_ini_scanner_globals zend_ini_scanner_globals;
  25. BEGIN_EXTERN_C()
  26. /* Compiler */
  27. #ifdef ZTS
  28. # define CG(v) ZEND_TSRMG_FAST(compiler_globals_offset, zend_compiler_globals *, v)
  29. #else
  30. # define CG(v) (compiler_globals.v)
  31. extern ZEND_API struct _zend_compiler_globals compiler_globals;
  32. #endif
  33. ZEND_API int zendparse(void);
  34. /* Executor */
  35. #ifdef ZTS
  36. # define EG(v) ZEND_TSRMG_FAST(executor_globals_offset, zend_executor_globals *, v)
  37. #else
  38. # define EG(v) (executor_globals.v)
  39. extern ZEND_API zend_executor_globals executor_globals;
  40. #endif
  41. /* Language Scanner */
  42. #ifdef ZTS
  43. # define LANG_SCNG(v) ZEND_TSRMG_FAST(language_scanner_globals_offset, zend_php_scanner_globals *, v)
  44. extern ZEND_API ts_rsrc_id language_scanner_globals_id;
  45. extern ZEND_API size_t language_scanner_globals_offset;
  46. #else
  47. # define LANG_SCNG(v) (language_scanner_globals.v)
  48. extern ZEND_API zend_php_scanner_globals language_scanner_globals;
  49. #endif
  50. /* INI Scanner */
  51. #ifdef ZTS
  52. # define INI_SCNG(v) ZEND_TSRMG_FAST(ini_scanner_globals_offset, zend_ini_scanner_globals *, v)
  53. extern ZEND_API ts_rsrc_id ini_scanner_globals_id;
  54. extern ZEND_API size_t ini_scanner_globals_offset;
  55. #else
  56. # define INI_SCNG(v) (ini_scanner_globals.v)
  57. extern ZEND_API zend_ini_scanner_globals ini_scanner_globals;
  58. #endif
  59. END_EXTERN_C()
  60. #endif /* ZEND_GLOBALS_MACROS_H */