-
Notifications
You must be signed in to change notification settings - Fork 0
/
php_alone.h
167 lines (140 loc) · 4.68 KB
/
php_alone.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/*
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef PHP_ALONE_H
#define PHP_ALONE_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <php.h>
#include <php_ini.h>
#include <SAPI.h>
#ifdef ZTS
# include "TSRM.h"
#endif
#include <ext/standard/info.h>
#include <ext/standard/base64.h>
#include <ext/standard/basic_functions.h>
#include <ext/standard/php_var.h>
#include <ext/standard/php_smart_string.h>
#include <Zend/zend_extensions.h>
#include <Zend/zend_hash.h>
#include <Zend/zend_interfaces.h>
#include <Zend/zend_smart_str.h>
#ifdef __cplusplus
} /* extern "C" */
#endif
#include <yaml.h>
#define ALONE_STRING_INI "ini"
#define ALONE_STRING_PHP "php"
#define ALONE_STRING_XML "xml"
#define ALONE_CONFIG_FILENAME "_filename"
#define alone_config_t zval
extern zend_module_entry alone_module_entry;
#define phpext_alone_ptr &alone_module_entry
#define PHP_ALONE_VERSION "0.1.0" /* Replace with version number for your extension */
#ifdef ZTS
#define ALONE_BG(v) ZEND_TSRMG(alone_globals_id, zend_alone_globals *, v)
#else
#define ALONE_BG(v) (alone_globals.v)
#endif
#define ALONE_STARTUP_FUNCTION(module) ZEND_MINIT_FUNCTION(alone_##module)
#define ALONE_RINIT_FUNCTION(module) ZEND_RINIT_FUNCTION(alone_##module)
#define ALONE_STARTUP(module) ZEND_MODULE_STARTUP_N(alone_##module)(INIT_FUNC_ARGS_PASSTHRU)
#define ALONE_SHUTDOWN_FUNCTION(module) ZEND_MSHUTDOWN_FUNCTION(alone_##module)
#define ALONE_SHUTDOWN(module) ZEND_MODULE_SHUTDOWN_N(alone_##module)(INIT_FUNC_ARGS_PASSTHRU)
#ifdef PHP_WIN32
# define PHP_ALONE_API __declspec(dllexport)
#elif defined(__GNUC__) && __GNUC__ >= 4
# define PHP_ALONE_API __attribute__ ((visibility("default")))
#else
# define PHP_ALONE_API
#endif
#ifdef ZTS
#include "TSRM.h"
#endif
/*
Declare any global variables you may need between the BEGIN
and END macros here:
*/
ZEND_BEGIN_MODULE_GLOBALS(alone)
zend_bool decode_binary;
zend_long decode_timestamp;
zend_bool decode_php;
zval *timestamp_decoder;
zend_bool output_canonical;
zend_long output_indent;
zend_long output_width;
zend_string *ext;
zend_string *base_uri;
zend_string *directory;
zend_string *local_library;
zend_string *local_namespaces;
zend_string *view_directory;
zend_string *view_ext;
zend_string *default_module;
zend_string *default_controller;
zend_string *default_action;
zend_string *bootstrap;
char *global_library;
char *environ_name;
char *name_separator;
size_t name_separator_len;
zend_bool lowcase_path;
zend_bool use_spl_autoload;
zend_bool throw_exception;
zend_bool action_prefer;
zend_bool name_suffix;
zend_bool autoload_started;
zend_bool running;
zend_bool in_exception;
zend_bool catch_exception;
zend_bool suppressing_warning;
/* {{{ This only effects internally */
zend_bool st_compatible;
/* }}} */
long forward_limit;
HashTable *configs;
zval modules;
zval *default_route;
zval active_ini_file_section;
zval *ini_wanted_section;
uint parsing_flag;
zend_bool use_namespace;
ZEND_END_MODULE_GLOBALS(alone)
extern ZEND_DECLARE_MODULE_GLOBALS(alone);
/* Always refer to the globals in your function as ALONE_G(variable).
You are encouraged to rename these macros something shorter, see
examples in any other php module directory.
*/
#define ALONE_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(alone, v)
#if defined(ZTS) && defined(COMPILE_DL_ALONE)
ZEND_TSRMLS_CACHE_EXTERN()
#endif
#endif /* PHP_ALONE_H */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/