php_embed.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 7 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2018 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 3.01 of the PHP 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.php.net/license/3_01.txt |
  11. | If you did not receive a copy of the PHP license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@php.net so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. | Author: Edin Kadribasic <edink@php.net> |
  16. +----------------------------------------------------------------------+
  17. */
  18. #ifndef _PHP_EMBED_H_
  19. #define _PHP_EMBED_H_
  20. #include <main/php.h>
  21. #include <main/SAPI.h>
  22. #include <main/php_main.h>
  23. #include <main/php_variables.h>
  24. #include <main/php_ini.h>
  25. #include <zend_ini.h>
  26. #define PHP_EMBED_START_BLOCK(x,y) { \
  27. php_embed_init(x, y); \
  28. zend_first_try {
  29. #define PHP_EMBED_END_BLOCK() \
  30. } zend_catch { \
  31. /* int exit_status = EG(exit_status); */ \
  32. } zend_end_try(); \
  33. php_embed_shutdown(); \
  34. }
  35. #ifndef PHP_WIN32
  36. #define EMBED_SAPI_API SAPI_API
  37. #else
  38. #define EMBED_SAPI_API
  39. #endif
  40. #ifdef ZTS
  41. ZEND_TSRMLS_CACHE_EXTERN()
  42. #endif
  43. BEGIN_EXTERN_C()
  44. EMBED_SAPI_API int php_embed_init(int argc, char **argv);
  45. EMBED_SAPI_API void php_embed_shutdown(void);
  46. extern EMBED_SAPI_API sapi_module_struct php_embed_module;
  47. END_EXTERN_C()
  48. #endif /* _PHP_EMBED_H_ */