xref: /PHP-8.2/ext/sqlite3/sqlite3_arginfo.h (revision 148ac364)
1 /* This is a generated file, edit the .stub.php file instead.
2  * Stub hash: 61f4a2611ed8cef37003610991e357b0f227bec9 */
3 
4 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3___construct, 0, 0, 1)
5 	ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
6 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE")
7 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encryptionKey, IS_STRING, 0, "\"\"")
8 ZEND_END_ARG_INFO()
9 
10 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3_open, 0, 1, IS_VOID, 0)
11 	ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
12 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE")
13 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encryptionKey, IS_STRING, 0, "\"\"")
14 ZEND_END_ARG_INFO()
15 
16 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3_close, 0, 0, 0)
17 ZEND_END_ARG_INFO()
18 
19 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3_version, 0, 0, IS_ARRAY, 0)
20 ZEND_END_ARG_INFO()
21 
22 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3_lastInsertRowID, 0, 0, IS_LONG, 0)
23 ZEND_END_ARG_INFO()
24 
25 #define arginfo_class_SQLite3_lastErrorCode arginfo_class_SQLite3_lastInsertRowID
26 
27 #define arginfo_class_SQLite3_lastExtendedErrorCode arginfo_class_SQLite3_lastInsertRowID
28 
29 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3_lastErrorMsg, 0, 0, IS_STRING, 0)
30 ZEND_END_ARG_INFO()
31 
32 #define arginfo_class_SQLite3_changes arginfo_class_SQLite3_lastInsertRowID
33 
34 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3_busyTimeout, 0, 1, _IS_BOOL, 0)
35 	ZEND_ARG_TYPE_INFO(0, milliseconds, IS_LONG, 0)
36 ZEND_END_ARG_INFO()
37 
38 #if !defined(SQLITE_OMIT_LOAD_EXTENSION)
39 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3_loadExtension, 0, 1, _IS_BOOL, 0)
40 	ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
41 ZEND_END_ARG_INFO()
42 #endif
43 
44 #if SQLITE_VERSION_NUMBER >= 3006011
45 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3_backup, 0, 1, _IS_BOOL, 0)
46 	ZEND_ARG_OBJ_INFO(0, destination, SQLite3, 0)
47 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, sourceDatabase, IS_STRING, 0, "\"main\"")
48 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, destinationDatabase, IS_STRING, 0, "\"main\"")
49 ZEND_END_ARG_INFO()
50 #endif
51 
52 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3_escapeString, 0, 1, IS_STRING, 0)
53 	ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
54 ZEND_END_ARG_INFO()
55 
56 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_SQLite3_prepare, 0, 1, SQLite3Stmt, MAY_BE_FALSE)
57 	ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0)
58 ZEND_END_ARG_INFO()
59 
60 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3_exec, 0, 1, _IS_BOOL, 0)
61 	ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0)
62 ZEND_END_ARG_INFO()
63 
64 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_SQLite3_query, 0, 1, SQLite3Result, MAY_BE_FALSE)
65 	ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0)
66 ZEND_END_ARG_INFO()
67 
68 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3_querySingle, 0, 1, IS_MIXED, 0)
69 	ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0)
70 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, entireRow, _IS_BOOL, 0, "false")
71 ZEND_END_ARG_INFO()
72 
73 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3_createFunction, 0, 2, _IS_BOOL, 0)
74 	ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
75 	ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0)
76 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, argCount, IS_LONG, 0, "-1")
77 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
78 ZEND_END_ARG_INFO()
79 
80 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3_createAggregate, 0, 3, _IS_BOOL, 0)
81 	ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
82 	ZEND_ARG_TYPE_INFO(0, stepCallback, IS_CALLABLE, 0)
83 	ZEND_ARG_TYPE_INFO(0, finalCallback, IS_CALLABLE, 0)
84 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, argCount, IS_LONG, 0, "-1")
85 ZEND_END_ARG_INFO()
86 
87 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3_createCollation, 0, 2, _IS_BOOL, 0)
88 	ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
89 	ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0)
90 ZEND_END_ARG_INFO()
91 
92 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3_openBlob, 0, 0, 3)
93 	ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0)
94 	ZEND_ARG_TYPE_INFO(0, column, IS_STRING, 0)
95 	ZEND_ARG_TYPE_INFO(0, rowid, IS_LONG, 0)
96 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, database, IS_STRING, 0, "\"main\"")
97 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "SQLITE3_OPEN_READONLY")
98 ZEND_END_ARG_INFO()
99 
100 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3_enableExceptions, 0, 0, _IS_BOOL, 0)
101 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enable, _IS_BOOL, 0, "false")
102 ZEND_END_ARG_INFO()
103 
104 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3_enableExtendedResultCodes, 0, 0, _IS_BOOL, 0)
105 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enable, _IS_BOOL, 0, "true")
106 ZEND_END_ARG_INFO()
107 
108 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3_setAuthorizer, 0, 1, _IS_BOOL, 0)
109 	ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 1)
110 ZEND_END_ARG_INFO()
111 
112 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3Stmt___construct, 0, 0, 2)
113 	ZEND_ARG_OBJ_INFO(0, sqlite3, SQLite3, 0)
114 	ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0)
115 ZEND_END_ARG_INFO()
116 
117 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3Stmt_bindParam, 0, 2, _IS_BOOL, 0)
118 	ZEND_ARG_TYPE_MASK(0, param, MAY_BE_STRING|MAY_BE_LONG, NULL)
119 	ZEND_ARG_TYPE_INFO(1, var, IS_MIXED, 0)
120 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "SQLITE3_TEXT")
121 ZEND_END_ARG_INFO()
122 
123 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3Stmt_bindValue, 0, 2, _IS_BOOL, 0)
124 	ZEND_ARG_TYPE_MASK(0, param, MAY_BE_STRING|MAY_BE_LONG, NULL)
125 	ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
126 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "SQLITE3_TEXT")
127 ZEND_END_ARG_INFO()
128 
129 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SQLite3Stmt_clear, 0, 0, _IS_BOOL, 0)
130 ZEND_END_ARG_INFO()
131 
132 #define arginfo_class_SQLite3Stmt_close arginfo_class_SQLite3Stmt_clear
133 
134 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_SQLite3Stmt_execute, 0, 0, SQLite3Result, MAY_BE_FALSE)
135 ZEND_END_ARG_INFO()
136 
137 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_SQLite3Stmt_getSQL, 0, 0, MAY_BE_STRING|MAY_BE_FALSE)
138 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, expand, _IS_BOOL, 0, "false")
139 ZEND_END_ARG_INFO()
140 
141 #define arginfo_class_SQLite3Stmt_paramCount arginfo_class_SQLite3_lastInsertRowID
142 
143 #define arginfo_class_SQLite3Stmt_readOnly arginfo_class_SQLite3Stmt_clear
144 
145 #define arginfo_class_SQLite3Stmt_reset arginfo_class_SQLite3Stmt_clear
146 
147 #define arginfo_class_SQLite3Result___construct arginfo_class_SQLite3_close
148 
149 #define arginfo_class_SQLite3Result_numColumns arginfo_class_SQLite3_lastInsertRowID
150 
151 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_SQLite3Result_columnName, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
152 	ZEND_ARG_TYPE_INFO(0, column, IS_LONG, 0)
153 ZEND_END_ARG_INFO()
154 
155 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_SQLite3Result_columnType, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
156 	ZEND_ARG_TYPE_INFO(0, column, IS_LONG, 0)
157 ZEND_END_ARG_INFO()
158 
159 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_SQLite3Result_fetchArray, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE)
160 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "SQLITE3_BOTH")
161 ZEND_END_ARG_INFO()
162 
163 #define arginfo_class_SQLite3Result_reset arginfo_class_SQLite3Stmt_clear
164 
165 #define arginfo_class_SQLite3Result_finalize arginfo_class_SQLite3_close
166 
167 
168 ZEND_METHOD(SQLite3, open);
169 ZEND_METHOD(SQLite3, close);
170 ZEND_METHOD(SQLite3, version);
171 ZEND_METHOD(SQLite3, lastInsertRowID);
172 ZEND_METHOD(SQLite3, lastErrorCode);
173 ZEND_METHOD(SQLite3, lastExtendedErrorCode);
174 ZEND_METHOD(SQLite3, lastErrorMsg);
175 ZEND_METHOD(SQLite3, changes);
176 ZEND_METHOD(SQLite3, busyTimeout);
177 #if !defined(SQLITE_OMIT_LOAD_EXTENSION)
178 ZEND_METHOD(SQLite3, loadExtension);
179 #endif
180 #if SQLITE_VERSION_NUMBER >= 3006011
181 ZEND_METHOD(SQLite3, backup);
182 #endif
183 ZEND_METHOD(SQLite3, escapeString);
184 ZEND_METHOD(SQLite3, prepare);
185 ZEND_METHOD(SQLite3, exec);
186 ZEND_METHOD(SQLite3, query);
187 ZEND_METHOD(SQLite3, querySingle);
188 ZEND_METHOD(SQLite3, createFunction);
189 ZEND_METHOD(SQLite3, createAggregate);
190 ZEND_METHOD(SQLite3, createCollation);
191 ZEND_METHOD(SQLite3, openBlob);
192 ZEND_METHOD(SQLite3, enableExceptions);
193 ZEND_METHOD(SQLite3, enableExtendedResultCodes);
194 ZEND_METHOD(SQLite3, setAuthorizer);
195 ZEND_METHOD(SQLite3Stmt, __construct);
196 ZEND_METHOD(SQLite3Stmt, bindParam);
197 ZEND_METHOD(SQLite3Stmt, bindValue);
198 ZEND_METHOD(SQLite3Stmt, clear);
199 ZEND_METHOD(SQLite3Stmt, close);
200 ZEND_METHOD(SQLite3Stmt, execute);
201 ZEND_METHOD(SQLite3Stmt, getSQL);
202 ZEND_METHOD(SQLite3Stmt, paramCount);
203 ZEND_METHOD(SQLite3Stmt, readOnly);
204 ZEND_METHOD(SQLite3Stmt, reset);
205 ZEND_METHOD(SQLite3Result, __construct);
206 ZEND_METHOD(SQLite3Result, numColumns);
207 ZEND_METHOD(SQLite3Result, columnName);
208 ZEND_METHOD(SQLite3Result, columnType);
209 ZEND_METHOD(SQLite3Result, fetchArray);
210 ZEND_METHOD(SQLite3Result, reset);
211 ZEND_METHOD(SQLite3Result, finalize);
212 
213 
214 static const zend_function_entry class_SQLite3_methods[] = {
215 	ZEND_MALIAS(SQLite3, __construct, open, arginfo_class_SQLite3___construct, ZEND_ACC_PUBLIC)
216 	ZEND_ME(SQLite3, open, arginfo_class_SQLite3_open, ZEND_ACC_PUBLIC)
217 	ZEND_ME(SQLite3, close, arginfo_class_SQLite3_close, ZEND_ACC_PUBLIC)
218 	ZEND_ME(SQLite3, version, arginfo_class_SQLite3_version, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
219 	ZEND_ME(SQLite3, lastInsertRowID, arginfo_class_SQLite3_lastInsertRowID, ZEND_ACC_PUBLIC)
220 	ZEND_ME(SQLite3, lastErrorCode, arginfo_class_SQLite3_lastErrorCode, ZEND_ACC_PUBLIC)
221 	ZEND_ME(SQLite3, lastExtendedErrorCode, arginfo_class_SQLite3_lastExtendedErrorCode, ZEND_ACC_PUBLIC)
222 	ZEND_ME(SQLite3, lastErrorMsg, arginfo_class_SQLite3_lastErrorMsg, ZEND_ACC_PUBLIC)
223 	ZEND_ME(SQLite3, changes, arginfo_class_SQLite3_changes, ZEND_ACC_PUBLIC)
224 	ZEND_ME(SQLite3, busyTimeout, arginfo_class_SQLite3_busyTimeout, ZEND_ACC_PUBLIC)
225 #if !defined(SQLITE_OMIT_LOAD_EXTENSION)
226 	ZEND_ME(SQLite3, loadExtension, arginfo_class_SQLite3_loadExtension, ZEND_ACC_PUBLIC)
227 #endif
228 #if SQLITE_VERSION_NUMBER >= 3006011
229 	ZEND_ME(SQLite3, backup, arginfo_class_SQLite3_backup, ZEND_ACC_PUBLIC)
230 #endif
231 	ZEND_ME(SQLite3, escapeString, arginfo_class_SQLite3_escapeString, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
232 	ZEND_ME(SQLite3, prepare, arginfo_class_SQLite3_prepare, ZEND_ACC_PUBLIC)
233 	ZEND_ME(SQLite3, exec, arginfo_class_SQLite3_exec, ZEND_ACC_PUBLIC)
234 	ZEND_ME(SQLite3, query, arginfo_class_SQLite3_query, ZEND_ACC_PUBLIC)
235 	ZEND_ME(SQLite3, querySingle, arginfo_class_SQLite3_querySingle, ZEND_ACC_PUBLIC)
236 	ZEND_ME(SQLite3, createFunction, arginfo_class_SQLite3_createFunction, ZEND_ACC_PUBLIC)
237 	ZEND_ME(SQLite3, createAggregate, arginfo_class_SQLite3_createAggregate, ZEND_ACC_PUBLIC)
238 	ZEND_ME(SQLite3, createCollation, arginfo_class_SQLite3_createCollation, ZEND_ACC_PUBLIC)
239 	ZEND_ME(SQLite3, openBlob, arginfo_class_SQLite3_openBlob, ZEND_ACC_PUBLIC)
240 	ZEND_ME(SQLite3, enableExceptions, arginfo_class_SQLite3_enableExceptions, ZEND_ACC_PUBLIC)
241 	ZEND_ME(SQLite3, enableExtendedResultCodes, arginfo_class_SQLite3_enableExtendedResultCodes, ZEND_ACC_PUBLIC)
242 	ZEND_ME(SQLite3, setAuthorizer, arginfo_class_SQLite3_setAuthorizer, ZEND_ACC_PUBLIC)
243 	ZEND_FE_END
244 };
245 
246 
247 static const zend_function_entry class_SQLite3Stmt_methods[] = {
248 	ZEND_ME(SQLite3Stmt, __construct, arginfo_class_SQLite3Stmt___construct, ZEND_ACC_PRIVATE)
249 	ZEND_ME(SQLite3Stmt, bindParam, arginfo_class_SQLite3Stmt_bindParam, ZEND_ACC_PUBLIC)
250 	ZEND_ME(SQLite3Stmt, bindValue, arginfo_class_SQLite3Stmt_bindValue, ZEND_ACC_PUBLIC)
251 	ZEND_ME(SQLite3Stmt, clear, arginfo_class_SQLite3Stmt_clear, ZEND_ACC_PUBLIC)
252 	ZEND_ME(SQLite3Stmt, close, arginfo_class_SQLite3Stmt_close, ZEND_ACC_PUBLIC)
253 	ZEND_ME(SQLite3Stmt, execute, arginfo_class_SQLite3Stmt_execute, ZEND_ACC_PUBLIC)
254 	ZEND_ME(SQLite3Stmt, getSQL, arginfo_class_SQLite3Stmt_getSQL, ZEND_ACC_PUBLIC)
255 	ZEND_ME(SQLite3Stmt, paramCount, arginfo_class_SQLite3Stmt_paramCount, ZEND_ACC_PUBLIC)
256 	ZEND_ME(SQLite3Stmt, readOnly, arginfo_class_SQLite3Stmt_readOnly, ZEND_ACC_PUBLIC)
257 	ZEND_ME(SQLite3Stmt, reset, arginfo_class_SQLite3Stmt_reset, ZEND_ACC_PUBLIC)
258 	ZEND_FE_END
259 };
260 
261 
262 static const zend_function_entry class_SQLite3Result_methods[] = {
263 	ZEND_ME(SQLite3Result, __construct, arginfo_class_SQLite3Result___construct, ZEND_ACC_PRIVATE)
264 	ZEND_ME(SQLite3Result, numColumns, arginfo_class_SQLite3Result_numColumns, ZEND_ACC_PUBLIC)
265 	ZEND_ME(SQLite3Result, columnName, arginfo_class_SQLite3Result_columnName, ZEND_ACC_PUBLIC)
266 	ZEND_ME(SQLite3Result, columnType, arginfo_class_SQLite3Result_columnType, ZEND_ACC_PUBLIC)
267 	ZEND_ME(SQLite3Result, fetchArray, arginfo_class_SQLite3Result_fetchArray, ZEND_ACC_PUBLIC)
268 	ZEND_ME(SQLite3Result, reset, arginfo_class_SQLite3Result_reset, ZEND_ACC_PUBLIC)
269 	ZEND_ME(SQLite3Result, finalize, arginfo_class_SQLite3Result_finalize, ZEND_ACC_PUBLIC)
270 	ZEND_FE_END
271 };
272 
register_sqlite3_symbols(int module_number)273 static void register_sqlite3_symbols(int module_number)
274 {
275 	REGISTER_LONG_CONSTANT("SQLITE3_ASSOC", PHP_SQLITE3_ASSOC, CONST_PERSISTENT);
276 	REGISTER_LONG_CONSTANT("SQLITE3_NUM", PHP_SQLITE3_NUM, CONST_PERSISTENT);
277 	REGISTER_LONG_CONSTANT("SQLITE3_BOTH", PHP_SQLITE3_BOTH, CONST_PERSISTENT);
278 	REGISTER_LONG_CONSTANT("SQLITE3_INTEGER", SQLITE_INTEGER, CONST_PERSISTENT);
279 	REGISTER_LONG_CONSTANT("SQLITE3_FLOAT", SQLITE_FLOAT, CONST_PERSISTENT);
280 	REGISTER_LONG_CONSTANT("SQLITE3_TEXT", SQLITE3_TEXT, CONST_PERSISTENT);
281 	REGISTER_LONG_CONSTANT("SQLITE3_BLOB", SQLITE_BLOB, CONST_PERSISTENT);
282 	REGISTER_LONG_CONSTANT("SQLITE3_NULL", SQLITE_NULL, CONST_PERSISTENT);
283 	REGISTER_LONG_CONSTANT("SQLITE3_OPEN_READONLY", SQLITE_OPEN_READONLY, CONST_PERSISTENT);
284 	REGISTER_LONG_CONSTANT("SQLITE3_OPEN_READWRITE", SQLITE_OPEN_READWRITE, CONST_PERSISTENT);
285 	REGISTER_LONG_CONSTANT("SQLITE3_OPEN_CREATE", SQLITE_OPEN_CREATE, CONST_PERSISTENT);
286 #if defined(SQLITE_DETERMINISTIC)
287 	REGISTER_LONG_CONSTANT("SQLITE3_DETERMINISTIC", SQLITE_DETERMINISTIC, CONST_PERSISTENT);
288 #endif
289 }
290 
register_class_SQLite3(void)291 static zend_class_entry *register_class_SQLite3(void)
292 {
293 	zend_class_entry ce, *class_entry;
294 
295 	INIT_CLASS_ENTRY(ce, "SQLite3", class_SQLite3_methods);
296 	class_entry = zend_register_internal_class_ex(&ce, NULL);
297 	class_entry->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE;
298 
299 	zval const_OK_value;
300 	ZVAL_LONG(&const_OK_value, SQLITE_OK);
301 	zend_string *const_OK_name = zend_string_init_interned("OK", sizeof("OK") - 1, 1);
302 	zend_declare_class_constant_ex(class_entry, const_OK_name, &const_OK_value, ZEND_ACC_PUBLIC, NULL);
303 	zend_string_release(const_OK_name);
304 
305 	zval const_DENY_value;
306 	ZVAL_LONG(&const_DENY_value, SQLITE_DENY);
307 	zend_string *const_DENY_name = zend_string_init_interned("DENY", sizeof("DENY") - 1, 1);
308 	zend_declare_class_constant_ex(class_entry, const_DENY_name, &const_DENY_value, ZEND_ACC_PUBLIC, NULL);
309 	zend_string_release(const_DENY_name);
310 
311 	zval const_IGNORE_value;
312 	ZVAL_LONG(&const_IGNORE_value, SQLITE_IGNORE);
313 	zend_string *const_IGNORE_name = zend_string_init_interned("IGNORE", sizeof("IGNORE") - 1, 1);
314 	zend_declare_class_constant_ex(class_entry, const_IGNORE_name, &const_IGNORE_value, ZEND_ACC_PUBLIC, NULL);
315 	zend_string_release(const_IGNORE_name);
316 
317 	zval const_CREATE_INDEX_value;
318 	ZVAL_LONG(&const_CREATE_INDEX_value, SQLITE_CREATE_INDEX);
319 	zend_string *const_CREATE_INDEX_name = zend_string_init_interned("CREATE_INDEX", sizeof("CREATE_INDEX") - 1, 1);
320 	zend_declare_class_constant_ex(class_entry, const_CREATE_INDEX_name, &const_CREATE_INDEX_value, ZEND_ACC_PUBLIC, NULL);
321 	zend_string_release(const_CREATE_INDEX_name);
322 
323 	zval const_CREATE_TABLE_value;
324 	ZVAL_LONG(&const_CREATE_TABLE_value, SQLITE_CREATE_TABLE);
325 	zend_string *const_CREATE_TABLE_name = zend_string_init_interned("CREATE_TABLE", sizeof("CREATE_TABLE") - 1, 1);
326 	zend_declare_class_constant_ex(class_entry, const_CREATE_TABLE_name, &const_CREATE_TABLE_value, ZEND_ACC_PUBLIC, NULL);
327 	zend_string_release(const_CREATE_TABLE_name);
328 
329 	zval const_CREATE_TEMP_INDEX_value;
330 	ZVAL_LONG(&const_CREATE_TEMP_INDEX_value, SQLITE_CREATE_TEMP_INDEX);
331 	zend_string *const_CREATE_TEMP_INDEX_name = zend_string_init_interned("CREATE_TEMP_INDEX", sizeof("CREATE_TEMP_INDEX") - 1, 1);
332 	zend_declare_class_constant_ex(class_entry, const_CREATE_TEMP_INDEX_name, &const_CREATE_TEMP_INDEX_value, ZEND_ACC_PUBLIC, NULL);
333 	zend_string_release(const_CREATE_TEMP_INDEX_name);
334 
335 	zval const_CREATE_TEMP_TABLE_value;
336 	ZVAL_LONG(&const_CREATE_TEMP_TABLE_value, SQLITE_CREATE_TEMP_TABLE);
337 	zend_string *const_CREATE_TEMP_TABLE_name = zend_string_init_interned("CREATE_TEMP_TABLE", sizeof("CREATE_TEMP_TABLE") - 1, 1);
338 	zend_declare_class_constant_ex(class_entry, const_CREATE_TEMP_TABLE_name, &const_CREATE_TEMP_TABLE_value, ZEND_ACC_PUBLIC, NULL);
339 	zend_string_release(const_CREATE_TEMP_TABLE_name);
340 
341 	zval const_CREATE_TEMP_TRIGGER_value;
342 	ZVAL_LONG(&const_CREATE_TEMP_TRIGGER_value, SQLITE_CREATE_TEMP_TRIGGER);
343 	zend_string *const_CREATE_TEMP_TRIGGER_name = zend_string_init_interned("CREATE_TEMP_TRIGGER", sizeof("CREATE_TEMP_TRIGGER") - 1, 1);
344 	zend_declare_class_constant_ex(class_entry, const_CREATE_TEMP_TRIGGER_name, &const_CREATE_TEMP_TRIGGER_value, ZEND_ACC_PUBLIC, NULL);
345 	zend_string_release(const_CREATE_TEMP_TRIGGER_name);
346 
347 	zval const_CREATE_TEMP_VIEW_value;
348 	ZVAL_LONG(&const_CREATE_TEMP_VIEW_value, SQLITE_CREATE_TEMP_VIEW);
349 	zend_string *const_CREATE_TEMP_VIEW_name = zend_string_init_interned("CREATE_TEMP_VIEW", sizeof("CREATE_TEMP_VIEW") - 1, 1);
350 	zend_declare_class_constant_ex(class_entry, const_CREATE_TEMP_VIEW_name, &const_CREATE_TEMP_VIEW_value, ZEND_ACC_PUBLIC, NULL);
351 	zend_string_release(const_CREATE_TEMP_VIEW_name);
352 
353 	zval const_CREATE_TRIGGER_value;
354 	ZVAL_LONG(&const_CREATE_TRIGGER_value, SQLITE_CREATE_TRIGGER);
355 	zend_string *const_CREATE_TRIGGER_name = zend_string_init_interned("CREATE_TRIGGER", sizeof("CREATE_TRIGGER") - 1, 1);
356 	zend_declare_class_constant_ex(class_entry, const_CREATE_TRIGGER_name, &const_CREATE_TRIGGER_value, ZEND_ACC_PUBLIC, NULL);
357 	zend_string_release(const_CREATE_TRIGGER_name);
358 
359 	zval const_CREATE_VIEW_value;
360 	ZVAL_LONG(&const_CREATE_VIEW_value, SQLITE_CREATE_VIEW);
361 	zend_string *const_CREATE_VIEW_name = zend_string_init_interned("CREATE_VIEW", sizeof("CREATE_VIEW") - 1, 1);
362 	zend_declare_class_constant_ex(class_entry, const_CREATE_VIEW_name, &const_CREATE_VIEW_value, ZEND_ACC_PUBLIC, NULL);
363 	zend_string_release(const_CREATE_VIEW_name);
364 
365 	zval const_DELETE_value;
366 	ZVAL_LONG(&const_DELETE_value, SQLITE_DELETE);
367 	zend_string *const_DELETE_name = zend_string_init_interned("DELETE", sizeof("DELETE") - 1, 1);
368 	zend_declare_class_constant_ex(class_entry, const_DELETE_name, &const_DELETE_value, ZEND_ACC_PUBLIC, NULL);
369 	zend_string_release(const_DELETE_name);
370 
371 	zval const_DROP_INDEX_value;
372 	ZVAL_LONG(&const_DROP_INDEX_value, SQLITE_DROP_INDEX);
373 	zend_string *const_DROP_INDEX_name = zend_string_init_interned("DROP_INDEX", sizeof("DROP_INDEX") - 1, 1);
374 	zend_declare_class_constant_ex(class_entry, const_DROP_INDEX_name, &const_DROP_INDEX_value, ZEND_ACC_PUBLIC, NULL);
375 	zend_string_release(const_DROP_INDEX_name);
376 
377 	zval const_DROP_TABLE_value;
378 	ZVAL_LONG(&const_DROP_TABLE_value, SQLITE_DROP_TABLE);
379 	zend_string *const_DROP_TABLE_name = zend_string_init_interned("DROP_TABLE", sizeof("DROP_TABLE") - 1, 1);
380 	zend_declare_class_constant_ex(class_entry, const_DROP_TABLE_name, &const_DROP_TABLE_value, ZEND_ACC_PUBLIC, NULL);
381 	zend_string_release(const_DROP_TABLE_name);
382 
383 	zval const_DROP_TEMP_INDEX_value;
384 	ZVAL_LONG(&const_DROP_TEMP_INDEX_value, SQLITE_DROP_TEMP_INDEX);
385 	zend_string *const_DROP_TEMP_INDEX_name = zend_string_init_interned("DROP_TEMP_INDEX", sizeof("DROP_TEMP_INDEX") - 1, 1);
386 	zend_declare_class_constant_ex(class_entry, const_DROP_TEMP_INDEX_name, &const_DROP_TEMP_INDEX_value, ZEND_ACC_PUBLIC, NULL);
387 	zend_string_release(const_DROP_TEMP_INDEX_name);
388 
389 	zval const_DROP_TEMP_TABLE_value;
390 	ZVAL_LONG(&const_DROP_TEMP_TABLE_value, SQLITE_DROP_TEMP_TABLE);
391 	zend_string *const_DROP_TEMP_TABLE_name = zend_string_init_interned("DROP_TEMP_TABLE", sizeof("DROP_TEMP_TABLE") - 1, 1);
392 	zend_declare_class_constant_ex(class_entry, const_DROP_TEMP_TABLE_name, &const_DROP_TEMP_TABLE_value, ZEND_ACC_PUBLIC, NULL);
393 	zend_string_release(const_DROP_TEMP_TABLE_name);
394 
395 	zval const_DROP_TEMP_TRIGGER_value;
396 	ZVAL_LONG(&const_DROP_TEMP_TRIGGER_value, SQLITE_DROP_TEMP_TRIGGER);
397 	zend_string *const_DROP_TEMP_TRIGGER_name = zend_string_init_interned("DROP_TEMP_TRIGGER", sizeof("DROP_TEMP_TRIGGER") - 1, 1);
398 	zend_declare_class_constant_ex(class_entry, const_DROP_TEMP_TRIGGER_name, &const_DROP_TEMP_TRIGGER_value, ZEND_ACC_PUBLIC, NULL);
399 	zend_string_release(const_DROP_TEMP_TRIGGER_name);
400 
401 	zval const_DROP_TEMP_VIEW_value;
402 	ZVAL_LONG(&const_DROP_TEMP_VIEW_value, SQLITE_DROP_TEMP_VIEW);
403 	zend_string *const_DROP_TEMP_VIEW_name = zend_string_init_interned("DROP_TEMP_VIEW", sizeof("DROP_TEMP_VIEW") - 1, 1);
404 	zend_declare_class_constant_ex(class_entry, const_DROP_TEMP_VIEW_name, &const_DROP_TEMP_VIEW_value, ZEND_ACC_PUBLIC, NULL);
405 	zend_string_release(const_DROP_TEMP_VIEW_name);
406 
407 	zval const_DROP_TRIGGER_value;
408 	ZVAL_LONG(&const_DROP_TRIGGER_value, SQLITE_DROP_TRIGGER);
409 	zend_string *const_DROP_TRIGGER_name = zend_string_init_interned("DROP_TRIGGER", sizeof("DROP_TRIGGER") - 1, 1);
410 	zend_declare_class_constant_ex(class_entry, const_DROP_TRIGGER_name, &const_DROP_TRIGGER_value, ZEND_ACC_PUBLIC, NULL);
411 	zend_string_release(const_DROP_TRIGGER_name);
412 
413 	zval const_DROP_VIEW_value;
414 	ZVAL_LONG(&const_DROP_VIEW_value, SQLITE_DROP_VIEW);
415 	zend_string *const_DROP_VIEW_name = zend_string_init_interned("DROP_VIEW", sizeof("DROP_VIEW") - 1, 1);
416 	zend_declare_class_constant_ex(class_entry, const_DROP_VIEW_name, &const_DROP_VIEW_value, ZEND_ACC_PUBLIC, NULL);
417 	zend_string_release(const_DROP_VIEW_name);
418 
419 	zval const_INSERT_value;
420 	ZVAL_LONG(&const_INSERT_value, SQLITE_INSERT);
421 	zend_string *const_INSERT_name = zend_string_init_interned("INSERT", sizeof("INSERT") - 1, 1);
422 	zend_declare_class_constant_ex(class_entry, const_INSERT_name, &const_INSERT_value, ZEND_ACC_PUBLIC, NULL);
423 	zend_string_release(const_INSERT_name);
424 
425 	zval const_PRAGMA_value;
426 	ZVAL_LONG(&const_PRAGMA_value, SQLITE_PRAGMA);
427 	zend_string *const_PRAGMA_name = zend_string_init_interned("PRAGMA", sizeof("PRAGMA") - 1, 1);
428 	zend_declare_class_constant_ex(class_entry, const_PRAGMA_name, &const_PRAGMA_value, ZEND_ACC_PUBLIC, NULL);
429 	zend_string_release(const_PRAGMA_name);
430 
431 	zval const_READ_value;
432 	ZVAL_LONG(&const_READ_value, SQLITE_READ);
433 	zend_string *const_READ_name = zend_string_init_interned("READ", sizeof("READ") - 1, 1);
434 	zend_declare_class_constant_ex(class_entry, const_READ_name, &const_READ_value, ZEND_ACC_PUBLIC, NULL);
435 	zend_string_release(const_READ_name);
436 
437 	zval const_SELECT_value;
438 	ZVAL_LONG(&const_SELECT_value, SQLITE_SELECT);
439 	zend_string *const_SELECT_name = zend_string_init_interned("SELECT", sizeof("SELECT") - 1, 1);
440 	zend_declare_class_constant_ex(class_entry, const_SELECT_name, &const_SELECT_value, ZEND_ACC_PUBLIC, NULL);
441 	zend_string_release(const_SELECT_name);
442 
443 	zval const_TRANSACTION_value;
444 	ZVAL_LONG(&const_TRANSACTION_value, SQLITE_TRANSACTION);
445 	zend_string *const_TRANSACTION_name = zend_string_init_interned("TRANSACTION", sizeof("TRANSACTION") - 1, 1);
446 	zend_declare_class_constant_ex(class_entry, const_TRANSACTION_name, &const_TRANSACTION_value, ZEND_ACC_PUBLIC, NULL);
447 	zend_string_release(const_TRANSACTION_name);
448 
449 	zval const_UPDATE_value;
450 	ZVAL_LONG(&const_UPDATE_value, SQLITE_UPDATE);
451 	zend_string *const_UPDATE_name = zend_string_init_interned("UPDATE", sizeof("UPDATE") - 1, 1);
452 	zend_declare_class_constant_ex(class_entry, const_UPDATE_name, &const_UPDATE_value, ZEND_ACC_PUBLIC, NULL);
453 	zend_string_release(const_UPDATE_name);
454 
455 	zval const_ATTACH_value;
456 	ZVAL_LONG(&const_ATTACH_value, SQLITE_ATTACH);
457 	zend_string *const_ATTACH_name = zend_string_init_interned("ATTACH", sizeof("ATTACH") - 1, 1);
458 	zend_declare_class_constant_ex(class_entry, const_ATTACH_name, &const_ATTACH_value, ZEND_ACC_PUBLIC, NULL);
459 	zend_string_release(const_ATTACH_name);
460 
461 	zval const_DETACH_value;
462 	ZVAL_LONG(&const_DETACH_value, SQLITE_DETACH);
463 	zend_string *const_DETACH_name = zend_string_init_interned("DETACH", sizeof("DETACH") - 1, 1);
464 	zend_declare_class_constant_ex(class_entry, const_DETACH_name, &const_DETACH_value, ZEND_ACC_PUBLIC, NULL);
465 	zend_string_release(const_DETACH_name);
466 
467 	zval const_ALTER_TABLE_value;
468 	ZVAL_LONG(&const_ALTER_TABLE_value, SQLITE_ALTER_TABLE);
469 	zend_string *const_ALTER_TABLE_name = zend_string_init_interned("ALTER_TABLE", sizeof("ALTER_TABLE") - 1, 1);
470 	zend_declare_class_constant_ex(class_entry, const_ALTER_TABLE_name, &const_ALTER_TABLE_value, ZEND_ACC_PUBLIC, NULL);
471 	zend_string_release(const_ALTER_TABLE_name);
472 
473 	zval const_REINDEX_value;
474 	ZVAL_LONG(&const_REINDEX_value, SQLITE_REINDEX);
475 	zend_string *const_REINDEX_name = zend_string_init_interned("REINDEX", sizeof("REINDEX") - 1, 1);
476 	zend_declare_class_constant_ex(class_entry, const_REINDEX_name, &const_REINDEX_value, ZEND_ACC_PUBLIC, NULL);
477 	zend_string_release(const_REINDEX_name);
478 
479 	zval const_ANALYZE_value;
480 	ZVAL_LONG(&const_ANALYZE_value, SQLITE_ANALYZE);
481 	zend_string *const_ANALYZE_name = zend_string_init_interned("ANALYZE", sizeof("ANALYZE") - 1, 1);
482 	zend_declare_class_constant_ex(class_entry, const_ANALYZE_name, &const_ANALYZE_value, ZEND_ACC_PUBLIC, NULL);
483 	zend_string_release(const_ANALYZE_name);
484 
485 	zval const_CREATE_VTABLE_value;
486 	ZVAL_LONG(&const_CREATE_VTABLE_value, SQLITE_CREATE_VTABLE);
487 	zend_string *const_CREATE_VTABLE_name = zend_string_init_interned("CREATE_VTABLE", sizeof("CREATE_VTABLE") - 1, 1);
488 	zend_declare_class_constant_ex(class_entry, const_CREATE_VTABLE_name, &const_CREATE_VTABLE_value, ZEND_ACC_PUBLIC, NULL);
489 	zend_string_release(const_CREATE_VTABLE_name);
490 
491 	zval const_DROP_VTABLE_value;
492 	ZVAL_LONG(&const_DROP_VTABLE_value, SQLITE_DROP_VTABLE);
493 	zend_string *const_DROP_VTABLE_name = zend_string_init_interned("DROP_VTABLE", sizeof("DROP_VTABLE") - 1, 1);
494 	zend_declare_class_constant_ex(class_entry, const_DROP_VTABLE_name, &const_DROP_VTABLE_value, ZEND_ACC_PUBLIC, NULL);
495 	zend_string_release(const_DROP_VTABLE_name);
496 
497 	zval const_FUNCTION_value;
498 	ZVAL_LONG(&const_FUNCTION_value, SQLITE_FUNCTION);
499 	zend_string *const_FUNCTION_name = zend_string_init_interned("FUNCTION", sizeof("FUNCTION") - 1, 1);
500 	zend_declare_class_constant_ex(class_entry, const_FUNCTION_name, &const_FUNCTION_value, ZEND_ACC_PUBLIC, NULL);
501 	zend_string_release(const_FUNCTION_name);
502 
503 	zval const_SAVEPOINT_value;
504 	ZVAL_LONG(&const_SAVEPOINT_value, SQLITE_SAVEPOINT);
505 	zend_string *const_SAVEPOINT_name = zend_string_init_interned("SAVEPOINT", sizeof("SAVEPOINT") - 1, 1);
506 	zend_declare_class_constant_ex(class_entry, const_SAVEPOINT_name, &const_SAVEPOINT_value, ZEND_ACC_PUBLIC, NULL);
507 	zend_string_release(const_SAVEPOINT_name);
508 
509 	zval const_COPY_value;
510 	ZVAL_LONG(&const_COPY_value, SQLITE_COPY);
511 	zend_string *const_COPY_name = zend_string_init_interned("COPY", sizeof("COPY") - 1, 1);
512 	zend_declare_class_constant_ex(class_entry, const_COPY_name, &const_COPY_value, ZEND_ACC_PUBLIC, NULL);
513 	zend_string_release(const_COPY_name);
514 #if defined(SQLITE_RECURSIVE)
515 
516 	zval const_RECURSIVE_value;
517 	ZVAL_LONG(&const_RECURSIVE_value, SQLITE_RECURSIVE);
518 	zend_string *const_RECURSIVE_name = zend_string_init_interned("RECURSIVE", sizeof("RECURSIVE") - 1, 1);
519 	zend_declare_class_constant_ex(class_entry, const_RECURSIVE_name, &const_RECURSIVE_value, ZEND_ACC_PUBLIC, NULL);
520 	zend_string_release(const_RECURSIVE_name);
521 #endif
522 
523 	return class_entry;
524 }
525 
register_class_SQLite3Stmt(void)526 static zend_class_entry *register_class_SQLite3Stmt(void)
527 {
528 	zend_class_entry ce, *class_entry;
529 
530 	INIT_CLASS_ENTRY(ce, "SQLite3Stmt", class_SQLite3Stmt_methods);
531 	class_entry = zend_register_internal_class_ex(&ce, NULL);
532 	class_entry->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE;
533 
534 	return class_entry;
535 }
536 
register_class_SQLite3Result(void)537 static zend_class_entry *register_class_SQLite3Result(void)
538 {
539 	zend_class_entry ce, *class_entry;
540 
541 	INIT_CLASS_ENTRY(ce, "SQLite3Result", class_SQLite3Result_methods);
542 	class_entry = zend_register_internal_class_ex(&ce, NULL);
543 	class_entry->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE;
544 
545 	return class_entry;
546 }
547