Back to index

php5  5.3.10
php_embed.h
Go to the documentation of this file.
00001 /*
00002    +----------------------------------------------------------------------+
00003    | PHP Version 5                                                        |
00004    +----------------------------------------------------------------------+
00005    | Copyright (c) 1997-2012 The PHP Group                                |
00006    +----------------------------------------------------------------------+
00007    | This source file is subject to version 3.01 of the PHP license,      |
00008    | that is bundled with this package in the file LICENSE, and is        |
00009    | available through the world-wide-web at the following url:           |
00010    | http://www.php.net/license/3_01.txt                                  |
00011    | If you did not receive a copy of the PHP license and are unable to   |
00012    | obtain it through the world-wide-web, please send a note to          |
00013    | license@php.net so we can mail you a copy immediately.               |
00014    +----------------------------------------------------------------------+
00015    | Author: Edin Kadribasic <edink@php.net>                              |
00016    +----------------------------------------------------------------------+
00017 */
00018 /* $Id: php_embed.h 321634 2012-01-01 13:15:04Z felipe $ */
00019 
00020 #ifndef _PHP_EMBED_H_
00021 #define _PHP_EMBED_H_
00022 
00023 #include <main/php.h>
00024 #include <main/SAPI.h>
00025 #include <main/php_main.h>
00026 #include <main/php_variables.h>
00027 #include <main/php_ini.h>
00028 #include <zend_ini.h>
00029 
00030 #ifdef ZTS
00031 #define PTSRMLS_D        void ****ptsrm_ls
00032 #define PTSRMLS_DC       , PTSRMLS_D
00033 #define PTSRMLS_C        &tsrm_ls
00034 #define PTSRMLS_CC       , PTSRMLS_C
00035 
00036 #define PHP_EMBED_START_BLOCK(x,y) { \
00037     void ***tsrm_ls; \
00038     php_embed_init(x, y PTSRMLS_CC); \
00039     zend_first_try {
00040 
00041 #else
00042 #define PTSRMLS_D
00043 #define PTSRMLS_DC
00044 #define PTSRMLS_C
00045 #define PTSRMLS_CC
00046 
00047 #define PHP_EMBED_START_BLOCK(x,y) { \
00048     php_embed_init(x, y); \
00049     zend_first_try {
00050 
00051 #endif
00052 
00053 #define PHP_EMBED_END_BLOCK() \
00054   } zend_catch { \
00055     /* int exit_status = EG(exit_status); */ \
00056   } zend_end_try(); \
00057   php_embed_shutdown(TSRMLS_C); \
00058 }
00059 
00060 #ifndef PHP_WIN32
00061     #define EMBED_SAPI_API SAPI_API
00062 #else
00063     #define EMBED_SAPI_API 
00064 #endif 
00065 
00066 BEGIN_EXTERN_C() 
00067 EMBED_SAPI_API int php_embed_init(int argc, char **argv PTSRMLS_DC);
00068 EMBED_SAPI_API void php_embed_shutdown(TSRMLS_D);
00069 extern EMBED_SAPI_API sapi_module_struct php_embed_module;
00070 END_EXTERN_C()
00071 
00072 
00073 #endif /* _PHP_EMBED_H_ */