-
Notifications
You must be signed in to change notification settings - Fork 6
/
php_tokyo_dystopia.h
183 lines (164 loc) · 6.63 KB
/
php_tokyo_dystopia.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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2003 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| http://www.php.net/license/2_02.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_TOKYO_DYSTOPIA_H
#define PHP_TOKYO_DYSTOPIA_H
#define PHP_TOKYO_DYSTOPIA_VERSION "0.1.0"
#define PHP_TOKYO_DYSTOPIA_EXTNAME "tokyo_dystopia"
#ifdef PHP_WIN32
#define PHP_TOKYO_DYSTOPIA_API __declspec(dllexport)
#else
#define PHP_TOKYO_DYSTOPIA_API
#endif
#ifdef ZTS
#include "TSRM.h"
#endif
#define TOKYO_DYSTOPIA_GET_THIS(ce) (getThis() ? (Z_OBJCE_P(getThis()) == ce ? getThis() : NULL) : NULL)
PHP_MINIT_FUNCTION(tokyo_dystopia);
PHP_MSHUTDOWN_FUNCTION(tokyo_dystopia);
PHP_RINIT_FUNCTION(tokyo_dystopia);
PHP_RSHUTDOWN_FUNCTION(tokyo_dystopia);
PHP_MINFO_FUNCTION(tokyo_dystopia);
/* {{{ function prototype */
PHP_FUNCTION(tokyo_dystopia_core_ctor);
PHP_FUNCTION(tokyo_dystopia_core_open);
PHP_FUNCTION(tokyo_dystopia_core_close);
PHP_FUNCTION(tokyo_dystopia_core_tune);
PHP_FUNCTION(tokyo_dystopia_core_setcache);
PHP_FUNCTION(tokyo_dystopia_core_setfwmmax);
PHP_FUNCTION(tokyo_dystopia_core_get);
PHP_FUNCTION(tokyo_dystopia_core_put);
PHP_FUNCTION(tokyo_dystopia_core_out);
PHP_FUNCTION(tokyo_dystopia_core_search);
PHP_FUNCTION(tokyo_dystopia_core_iterinit);
PHP_FUNCTION(tokyo_dystopia_core_iternext);
PHP_FUNCTION(tokyo_dystopia_core_sync);
PHP_FUNCTION(tokyo_dystopia_core_optimize);
PHP_FUNCTION(tokyo_dystopia_core_vanish);
PHP_FUNCTION(tokyo_dystopia_core_copy);
PHP_FUNCTION(tokyo_dystopia_core_path);
PHP_FUNCTION(tokyo_dystopia_core_rnum);
PHP_FUNCTION(tokyo_dystopia_core_fsiz);
PHP_FUNCTION(tokyo_dystopia_core_ecode);
PHP_FUNCTION(tokyo_dystopia_core_errmsg);
PHP_FUNCTION(tokyo_dystopia_qgram_ctor);
PHP_FUNCTION(tokyo_dystopia_qgram_open);
PHP_FUNCTION(tokyo_dystopia_qgram_close);
PHP_FUNCTION(tokyo_dystopia_qgram_tune);
PHP_FUNCTION(tokyo_dystopia_qgram_setcache);
PHP_FUNCTION(tokyo_dystopia_qgram_setfwmmax);
PHP_FUNCTION(tokyo_dystopia_qgram_put);
PHP_FUNCTION(tokyo_dystopia_qgram_out);
PHP_FUNCTION(tokyo_dystopia_qgram_search);
PHP_FUNCTION(tokyo_dystopia_qgram_sync);
PHP_FUNCTION(tokyo_dystopia_qgram_optimize);
PHP_FUNCTION(tokyo_dystopia_qgram_vanish);
PHP_FUNCTION(tokyo_dystopia_qgram_copy);
PHP_FUNCTION(tokyo_dystopia_qgram_path);
PHP_FUNCTION(tokyo_dystopia_qgram_tnum);
PHP_FUNCTION(tokyo_dystopia_qgram_fsiz);
PHP_FUNCTION(tokyo_dystopia_qgram_ecode);
PHP_FUNCTION(tokyo_dystopia_qgram_errmsg);
PHP_FUNCTION(tokyo_dystopia_simple_ctor);
PHP_FUNCTION(tokyo_dystopia_simple_open);
PHP_FUNCTION(tokyo_dystopia_simple_close);
PHP_FUNCTION(tokyo_dystopia_simple_tune);
PHP_FUNCTION(tokyo_dystopia_simple_setcache);
PHP_FUNCTION(tokyo_dystopia_simple_setfwmmax);
PHP_FUNCTION(tokyo_dystopia_simple_get);
PHP_FUNCTION(tokyo_dystopia_simple_put);
PHP_FUNCTION(tokyo_dystopia_simple_out);
PHP_FUNCTION(tokyo_dystopia_simple_search);
PHP_FUNCTION(tokyo_dystopia_simple_iterinit);
PHP_FUNCTION(tokyo_dystopia_simple_iternext);
PHP_FUNCTION(tokyo_dystopia_simple_sync);
PHP_FUNCTION(tokyo_dystopia_simple_optimize);
PHP_FUNCTION(tokyo_dystopia_simple_vanish);
PHP_FUNCTION(tokyo_dystopia_simple_copy);
PHP_FUNCTION(tokyo_dystopia_simple_path);
PHP_FUNCTION(tokyo_dystopia_simple_rnum);
PHP_FUNCTION(tokyo_dystopia_simple_fsiz);
PHP_FUNCTION(tokyo_dystopia_simple_ecode);
PHP_FUNCTION(tokyo_dystopia_simple_errmsg);
PHP_FUNCTION(tokyo_dystopia_word_ctor);
PHP_FUNCTION(tokyo_dystopia_word_open);
PHP_FUNCTION(tokyo_dystopia_word_close);
PHP_FUNCTION(tokyo_dystopia_word_tune);
PHP_FUNCTION(tokyo_dystopia_word_setcache);
PHP_FUNCTION(tokyo_dystopia_word_setfwmmax);
PHP_FUNCTION(tokyo_dystopia_word_put);
PHP_FUNCTION(tokyo_dystopia_word_out);
PHP_FUNCTION(tokyo_dystopia_word_search);
PHP_FUNCTION(tokyo_dystopia_word_sync);
PHP_FUNCTION(tokyo_dystopia_word_optimize);
PHP_FUNCTION(tokyo_dystopia_word_vanish);
PHP_FUNCTION(tokyo_dystopia_word_copy);
PHP_FUNCTION(tokyo_dystopia_word_path);
PHP_FUNCTION(tokyo_dystopia_word_tnum);
PHP_FUNCTION(tokyo_dystopia_word_fsiz);
PHP_FUNCTION(tokyo_dystopia_word_ecode);
PHP_FUNCTION(tokyo_dystopia_word_errmsg);
/* }}} */
extern zend_module_entry tokyo_dystopia_module_entry;
#define phpext_tokyo_dystopia_ptr &tokyo_dystopia_module_entry
/* {{{ module global */
ZEND_BEGIN_MODULE_GLOBALS(tokyo_dystopia)
ZEND_END_MODULE_GLOBALS(tokyo_dystopia)
#ifdef ZTS
#define TOKYO_DYSTOPIA_G(v) TSRMG(tokyo_dystopia_globals_id, zend_tokyo_dystopia_globals *, v)
#else
#define TOKYO_DYSTOPIA_G(v) (tokyo_dystopia_globals.v)
#endif
ZEND_EXTERN_MODULE_GLOBALS(tokyo_dystopia)
/* }}} */
/* {{{ macro */
#define tokyo_dystopia_objprop_get(zv, key, element, on_error) { \
if (zend_hash_find(Z_OBJPROP(zv), key, strlen(key)+1, (void**)&element) != SUCCESS) { \
php_error_docref(NULL TSRMLS_CC, E_WARNING, "property [%s] is not set", key); \
element = NULL; \
on_error; \
} \
}
#define tokyo_dystopia_objprop_get_p(zv_p, key, element, on_error) tokyo_dystopia_objprop_get(*zv_p, key, element, on_error)
#define tokyo_dystopia_objprop_get_pp(zv_pp, key, element, on_error) tokyo_dystopia_objprop_get(**zv_pp, key, element, on_error)
#define tokyo_dystopia_objprop_is_false(element) (Z_TYPE_PP(element) == IS_BOOL && Z_BVAL_PP(element) == 0)
/* }}} */
/* {{{ inline */
static inline int tokyo_dystopia_objprop_get_long_p(zval *zv_p, char *key) {
zval **element;
tokyo_dystopia_objprop_get_p(zv_p, key, element, return 0);
convert_to_long_ex(element);
return Z_LVAL_PP(element);
}
static inline int tokyo_dystopia_array_get_long_p(zval *zv_p, char *key) {
zval **element;
if (zend_hash_find(Z_ARRVAL_P(zv_p), key, strlen(key)+1, (void**)&element) == SUCCESS) {
convert_to_long_ex(element);
return Z_LVAL_PP(element);
}
return 0;
}
/* }}} */
#endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* indent-tabs-mode: t
* End:
*/