xref: /PHP-8.2/ext/ffi/ffi_arginfo.h (revision 148ac364)
1 /* This is a generated file, edit the .stub.php file instead.
2  * Stub hash: dd91ae1826acbc9b89cd74477edf8784216f1a63 */
3 
4 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_cdef, 0, 0, FFI, 0)
5 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, code, IS_STRING, 0, "\"\"")
6 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, lib, IS_STRING, 1, "null")
7 ZEND_END_ARG_INFO()
8 
9 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_load, 0, 1, FFI, 1)
10 	ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
11 ZEND_END_ARG_INFO()
12 
13 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_scope, 0, 1, FFI, 0)
14 	ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
15 ZEND_END_ARG_INFO()
16 
17 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_new, 0, 1, FFI\\CData, 1)
18 	ZEND_ARG_OBJ_TYPE_MASK(0, type, FFI\\CType, MAY_BE_STRING, NULL)
19 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, owned, _IS_BOOL, 0, "true")
20 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, persistent, _IS_BOOL, 0, "false")
21 ZEND_END_ARG_INFO()
22 
23 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_FFI_free, 0, 1, IS_VOID, 0)
24 	ZEND_ARG_OBJ_INFO(ZEND_SEND_PREFER_REF, ptr, FFI\\CData, 0)
25 ZEND_END_ARG_INFO()
26 
27 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_cast, 0, 2, FFI\\CData, 1)
28 	ZEND_ARG_OBJ_TYPE_MASK(0, type, FFI\\CType, MAY_BE_STRING, NULL)
29 	ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, ptr)
30 ZEND_END_ARG_INFO()
31 
32 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_type, 0, 1, FFI\\CType, 1)
33 	ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0)
34 ZEND_END_ARG_INFO()
35 
36 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_typeof, 0, 1, FFI\\CType, 0)
37 	ZEND_ARG_OBJ_INFO(ZEND_SEND_PREFER_REF, ptr, FFI\\CData, 0)
38 ZEND_END_ARG_INFO()
39 
40 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_arrayType, 0, 2, FFI\\CType, 0)
41 	ZEND_ARG_OBJ_INFO(0, type, FFI\\CType, 0)
42 	ZEND_ARG_TYPE_INFO(0, dimensions, IS_ARRAY, 0)
43 ZEND_END_ARG_INFO()
44 
45 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_addr, 0, 1, FFI\\CData, 0)
46 	ZEND_ARG_OBJ_INFO(ZEND_SEND_PREFER_REF, ptr, FFI\\CData, 0)
47 ZEND_END_ARG_INFO()
48 
49 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_FFI_sizeof, 0, 1, IS_LONG, 0)
50 	ZEND_ARG_OBJ_TYPE_MASK(ZEND_SEND_PREFER_REF, ptr, FFI\\CData|FFI\\CType, 0, NULL)
51 ZEND_END_ARG_INFO()
52 
53 #define arginfo_class_FFI_alignof arginfo_class_FFI_sizeof
54 
55 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_FFI_memcpy, 0, 3, IS_VOID, 0)
56 	ZEND_ARG_OBJ_INFO(ZEND_SEND_PREFER_REF, to, FFI\\CData, 0)
57 	ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, from)
58 	ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0)
59 ZEND_END_ARG_INFO()
60 
61 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_FFI_memcmp, 0, 3, IS_LONG, 0)
62 	ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, ptr1)
63 	ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, ptr2)
64 	ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0)
65 ZEND_END_ARG_INFO()
66 
67 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_FFI_memset, 0, 3, IS_VOID, 0)
68 	ZEND_ARG_OBJ_INFO(ZEND_SEND_PREFER_REF, ptr, FFI\\CData, 0)
69 	ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0)
70 	ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0)
71 ZEND_END_ARG_INFO()
72 
73 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_FFI_string, 0, 1, IS_STRING, 0)
74 	ZEND_ARG_OBJ_INFO(ZEND_SEND_PREFER_REF, ptr, FFI\\CData, 0)
75 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, size, IS_LONG, 1, "null")
76 ZEND_END_ARG_INFO()
77 
78 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_FFI_isNull, 0, 1, _IS_BOOL, 0)
79 	ZEND_ARG_OBJ_INFO(ZEND_SEND_PREFER_REF, ptr, FFI\\CData, 0)
80 ZEND_END_ARG_INFO()
81 
82 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_FFI_CType_getName, 0, 0, IS_STRING, 0)
83 ZEND_END_ARG_INFO()
84 
85 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_FFI_CType_getKind, 0, 0, IS_LONG, 0)
86 ZEND_END_ARG_INFO()
87 
88 #define arginfo_class_FFI_CType_getSize arginfo_class_FFI_CType_getKind
89 
90 #define arginfo_class_FFI_CType_getAlignment arginfo_class_FFI_CType_getKind
91 
92 #define arginfo_class_FFI_CType_getAttributes arginfo_class_FFI_CType_getKind
93 
94 #define arginfo_class_FFI_CType_getEnumKind arginfo_class_FFI_CType_getKind
95 
96 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_CType_getArrayElementType, 0, 0, FFI\\CType, 0)
97 ZEND_END_ARG_INFO()
98 
99 #define arginfo_class_FFI_CType_getArrayLength arginfo_class_FFI_CType_getKind
100 
101 #define arginfo_class_FFI_CType_getPointerType arginfo_class_FFI_CType_getArrayElementType
102 
103 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_FFI_CType_getStructFieldNames, 0, 0, IS_ARRAY, 0)
104 ZEND_END_ARG_INFO()
105 
106 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_FFI_CType_getStructFieldOffset, 0, 1, IS_LONG, 0)
107 	ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
108 ZEND_END_ARG_INFO()
109 
110 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_CType_getStructFieldType, 0, 1, FFI\\CType, 0)
111 	ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
112 ZEND_END_ARG_INFO()
113 
114 #define arginfo_class_FFI_CType_getFuncABI arginfo_class_FFI_CType_getKind
115 
116 #define arginfo_class_FFI_CType_getFuncReturnType arginfo_class_FFI_CType_getArrayElementType
117 
118 #define arginfo_class_FFI_CType_getFuncParameterCount arginfo_class_FFI_CType_getKind
119 
120 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_CType_getFuncParameterType, 0, 1, FFI\\CType, 0)
121 	ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0)
122 ZEND_END_ARG_INFO()
123 
124 
125 ZEND_METHOD(FFI, cdef);
126 ZEND_METHOD(FFI, load);
127 ZEND_METHOD(FFI, scope);
128 ZEND_METHOD(FFI, new);
129 ZEND_METHOD(FFI, free);
130 ZEND_METHOD(FFI, cast);
131 ZEND_METHOD(FFI, type);
132 ZEND_METHOD(FFI, typeof);
133 ZEND_METHOD(FFI, arrayType);
134 ZEND_METHOD(FFI, addr);
135 ZEND_METHOD(FFI, sizeof);
136 ZEND_METHOD(FFI, alignof);
137 ZEND_METHOD(FFI, memcpy);
138 ZEND_METHOD(FFI, memcmp);
139 ZEND_METHOD(FFI, memset);
140 ZEND_METHOD(FFI, string);
141 ZEND_METHOD(FFI, isNull);
142 ZEND_METHOD(FFI_CType, getName);
143 ZEND_METHOD(FFI_CType, getKind);
144 ZEND_METHOD(FFI_CType, getSize);
145 ZEND_METHOD(FFI_CType, getAlignment);
146 ZEND_METHOD(FFI_CType, getAttributes);
147 ZEND_METHOD(FFI_CType, getEnumKind);
148 ZEND_METHOD(FFI_CType, getArrayElementType);
149 ZEND_METHOD(FFI_CType, getArrayLength);
150 ZEND_METHOD(FFI_CType, getPointerType);
151 ZEND_METHOD(FFI_CType, getStructFieldNames);
152 ZEND_METHOD(FFI_CType, getStructFieldOffset);
153 ZEND_METHOD(FFI_CType, getStructFieldType);
154 ZEND_METHOD(FFI_CType, getFuncABI);
155 ZEND_METHOD(FFI_CType, getFuncReturnType);
156 ZEND_METHOD(FFI_CType, getFuncParameterCount);
157 ZEND_METHOD(FFI_CType, getFuncParameterType);
158 
159 
160 static const zend_function_entry class_FFI_methods[] = {
161 	ZEND_ME(FFI, cdef, arginfo_class_FFI_cdef, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
162 	ZEND_ME(FFI, load, arginfo_class_FFI_load, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
163 	ZEND_ME(FFI, scope, arginfo_class_FFI_scope, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
164 	ZEND_ME(FFI, new, arginfo_class_FFI_new, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
165 	ZEND_ME(FFI, free, arginfo_class_FFI_free, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
166 	ZEND_ME(FFI, cast, arginfo_class_FFI_cast, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
167 	ZEND_ME(FFI, type, arginfo_class_FFI_type, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
168 	ZEND_ME(FFI, typeof, arginfo_class_FFI_typeof, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
169 	ZEND_ME(FFI, arrayType, arginfo_class_FFI_arrayType, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
170 	ZEND_ME(FFI, addr, arginfo_class_FFI_addr, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
171 	ZEND_ME(FFI, sizeof, arginfo_class_FFI_sizeof, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
172 	ZEND_ME(FFI, alignof, arginfo_class_FFI_alignof, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
173 	ZEND_ME(FFI, memcpy, arginfo_class_FFI_memcpy, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
174 	ZEND_ME(FFI, memcmp, arginfo_class_FFI_memcmp, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
175 	ZEND_ME(FFI, memset, arginfo_class_FFI_memset, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
176 	ZEND_ME(FFI, string, arginfo_class_FFI_string, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
177 	ZEND_ME(FFI, isNull, arginfo_class_FFI_isNull, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
178 	ZEND_FE_END
179 };
180 
181 
182 static const zend_function_entry class_FFI_CData_methods[] = {
183 	ZEND_FE_END
184 };
185 
186 
187 static const zend_function_entry class_FFI_CType_methods[] = {
188 	ZEND_ME(FFI_CType, getName, arginfo_class_FFI_CType_getName, ZEND_ACC_PUBLIC)
189 	ZEND_ME(FFI_CType, getKind, arginfo_class_FFI_CType_getKind, ZEND_ACC_PUBLIC)
190 	ZEND_ME(FFI_CType, getSize, arginfo_class_FFI_CType_getSize, ZEND_ACC_PUBLIC)
191 	ZEND_ME(FFI_CType, getAlignment, arginfo_class_FFI_CType_getAlignment, ZEND_ACC_PUBLIC)
192 	ZEND_ME(FFI_CType, getAttributes, arginfo_class_FFI_CType_getAttributes, ZEND_ACC_PUBLIC)
193 	ZEND_ME(FFI_CType, getEnumKind, arginfo_class_FFI_CType_getEnumKind, ZEND_ACC_PUBLIC)
194 	ZEND_ME(FFI_CType, getArrayElementType, arginfo_class_FFI_CType_getArrayElementType, ZEND_ACC_PUBLIC)
195 	ZEND_ME(FFI_CType, getArrayLength, arginfo_class_FFI_CType_getArrayLength, ZEND_ACC_PUBLIC)
196 	ZEND_ME(FFI_CType, getPointerType, arginfo_class_FFI_CType_getPointerType, ZEND_ACC_PUBLIC)
197 	ZEND_ME(FFI_CType, getStructFieldNames, arginfo_class_FFI_CType_getStructFieldNames, ZEND_ACC_PUBLIC)
198 	ZEND_ME(FFI_CType, getStructFieldOffset, arginfo_class_FFI_CType_getStructFieldOffset, ZEND_ACC_PUBLIC)
199 	ZEND_ME(FFI_CType, getStructFieldType, arginfo_class_FFI_CType_getStructFieldType, ZEND_ACC_PUBLIC)
200 	ZEND_ME(FFI_CType, getFuncABI, arginfo_class_FFI_CType_getFuncABI, ZEND_ACC_PUBLIC)
201 	ZEND_ME(FFI_CType, getFuncReturnType, arginfo_class_FFI_CType_getFuncReturnType, ZEND_ACC_PUBLIC)
202 	ZEND_ME(FFI_CType, getFuncParameterCount, arginfo_class_FFI_CType_getFuncParameterCount, ZEND_ACC_PUBLIC)
203 	ZEND_ME(FFI_CType, getFuncParameterType, arginfo_class_FFI_CType_getFuncParameterType, ZEND_ACC_PUBLIC)
204 	ZEND_FE_END
205 };
206 
207 
208 static const zend_function_entry class_FFI_Exception_methods[] = {
209 	ZEND_FE_END
210 };
211 
212 
213 static const zend_function_entry class_FFI_ParserException_methods[] = {
214 	ZEND_FE_END
215 };
216 
register_class_FFI(void)217 static zend_class_entry *register_class_FFI(void)
218 {
219 	zend_class_entry ce, *class_entry;
220 
221 	INIT_CLASS_ENTRY(ce, "FFI", class_FFI_methods);
222 	class_entry = zend_register_internal_class_ex(&ce, NULL);
223 	class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NOT_SERIALIZABLE;
224 
225 	zval const___BIGGEST_ALIGNMENT___value;
226 	ZVAL_LONG(&const___BIGGEST_ALIGNMENT___value, __BIGGEST_ALIGNMENT__);
227 	zend_string *const___BIGGEST_ALIGNMENT___name = zend_string_init_interned("__BIGGEST_ALIGNMENT__", sizeof("__BIGGEST_ALIGNMENT__") - 1, 1);
228 	zend_declare_class_constant_ex(class_entry, const___BIGGEST_ALIGNMENT___name, &const___BIGGEST_ALIGNMENT___value, ZEND_ACC_PUBLIC, NULL);
229 	zend_string_release(const___BIGGEST_ALIGNMENT___name);
230 
231 	return class_entry;
232 }
233 
register_class_FFI_CData(void)234 static zend_class_entry *register_class_FFI_CData(void)
235 {
236 	zend_class_entry ce, *class_entry;
237 
238 	INIT_NS_CLASS_ENTRY(ce, "FFI", "CData", class_FFI_CData_methods);
239 	class_entry = zend_register_internal_class_ex(&ce, NULL);
240 	class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NOT_SERIALIZABLE;
241 
242 	return class_entry;
243 }
244 
register_class_FFI_CType(void)245 static zend_class_entry *register_class_FFI_CType(void)
246 {
247 	zend_class_entry ce, *class_entry;
248 
249 	INIT_NS_CLASS_ENTRY(ce, "FFI", "CType", class_FFI_CType_methods);
250 	class_entry = zend_register_internal_class_ex(&ce, NULL);
251 	class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NOT_SERIALIZABLE;
252 
253 	zval const_TYPE_VOID_value;
254 	ZVAL_LONG(&const_TYPE_VOID_value, ZEND_FFI_TYPE_VOID);
255 	zend_string *const_TYPE_VOID_name = zend_string_init_interned("TYPE_VOID", sizeof("TYPE_VOID") - 1, 1);
256 	zend_declare_class_constant_ex(class_entry, const_TYPE_VOID_name, &const_TYPE_VOID_value, ZEND_ACC_PUBLIC, NULL);
257 	zend_string_release(const_TYPE_VOID_name);
258 
259 	zval const_TYPE_FLOAT_value;
260 	ZVAL_LONG(&const_TYPE_FLOAT_value, ZEND_FFI_TYPE_FLOAT);
261 	zend_string *const_TYPE_FLOAT_name = zend_string_init_interned("TYPE_FLOAT", sizeof("TYPE_FLOAT") - 1, 1);
262 	zend_declare_class_constant_ex(class_entry, const_TYPE_FLOAT_name, &const_TYPE_FLOAT_value, ZEND_ACC_PUBLIC, NULL);
263 	zend_string_release(const_TYPE_FLOAT_name);
264 
265 	zval const_TYPE_DOUBLE_value;
266 	ZVAL_LONG(&const_TYPE_DOUBLE_value, ZEND_FFI_TYPE_DOUBLE);
267 	zend_string *const_TYPE_DOUBLE_name = zend_string_init_interned("TYPE_DOUBLE", sizeof("TYPE_DOUBLE") - 1, 1);
268 	zend_declare_class_constant_ex(class_entry, const_TYPE_DOUBLE_name, &const_TYPE_DOUBLE_value, ZEND_ACC_PUBLIC, NULL);
269 	zend_string_release(const_TYPE_DOUBLE_name);
270 #if defined(HAVE_LONG_DOUBLE)
271 
272 	zval const_TYPE_LONGDOUBLE_value;
273 	ZVAL_LONG(&const_TYPE_LONGDOUBLE_value, ZEND_FFI_TYPE_LONGDOUBLE);
274 	zend_string *const_TYPE_LONGDOUBLE_name = zend_string_init_interned("TYPE_LONGDOUBLE", sizeof("TYPE_LONGDOUBLE") - 1, 1);
275 	zend_declare_class_constant_ex(class_entry, const_TYPE_LONGDOUBLE_name, &const_TYPE_LONGDOUBLE_value, ZEND_ACC_PUBLIC, NULL);
276 	zend_string_release(const_TYPE_LONGDOUBLE_name);
277 #endif
278 
279 	zval const_TYPE_UINT8_value;
280 	ZVAL_LONG(&const_TYPE_UINT8_value, ZEND_FFI_TYPE_UINT8);
281 	zend_string *const_TYPE_UINT8_name = zend_string_init_interned("TYPE_UINT8", sizeof("TYPE_UINT8") - 1, 1);
282 	zend_declare_class_constant_ex(class_entry, const_TYPE_UINT8_name, &const_TYPE_UINT8_value, ZEND_ACC_PUBLIC, NULL);
283 	zend_string_release(const_TYPE_UINT8_name);
284 
285 	zval const_TYPE_SINT8_value;
286 	ZVAL_LONG(&const_TYPE_SINT8_value, ZEND_FFI_TYPE_SINT8);
287 	zend_string *const_TYPE_SINT8_name = zend_string_init_interned("TYPE_SINT8", sizeof("TYPE_SINT8") - 1, 1);
288 	zend_declare_class_constant_ex(class_entry, const_TYPE_SINT8_name, &const_TYPE_SINT8_value, ZEND_ACC_PUBLIC, NULL);
289 	zend_string_release(const_TYPE_SINT8_name);
290 
291 	zval const_TYPE_UINT16_value;
292 	ZVAL_LONG(&const_TYPE_UINT16_value, ZEND_FFI_TYPE_UINT16);
293 	zend_string *const_TYPE_UINT16_name = zend_string_init_interned("TYPE_UINT16", sizeof("TYPE_UINT16") - 1, 1);
294 	zend_declare_class_constant_ex(class_entry, const_TYPE_UINT16_name, &const_TYPE_UINT16_value, ZEND_ACC_PUBLIC, NULL);
295 	zend_string_release(const_TYPE_UINT16_name);
296 
297 	zval const_TYPE_SINT16_value;
298 	ZVAL_LONG(&const_TYPE_SINT16_value, ZEND_FFI_TYPE_SINT16);
299 	zend_string *const_TYPE_SINT16_name = zend_string_init_interned("TYPE_SINT16", sizeof("TYPE_SINT16") - 1, 1);
300 	zend_declare_class_constant_ex(class_entry, const_TYPE_SINT16_name, &const_TYPE_SINT16_value, ZEND_ACC_PUBLIC, NULL);
301 	zend_string_release(const_TYPE_SINT16_name);
302 
303 	zval const_TYPE_UINT32_value;
304 	ZVAL_LONG(&const_TYPE_UINT32_value, ZEND_FFI_TYPE_UINT32);
305 	zend_string *const_TYPE_UINT32_name = zend_string_init_interned("TYPE_UINT32", sizeof("TYPE_UINT32") - 1, 1);
306 	zend_declare_class_constant_ex(class_entry, const_TYPE_UINT32_name, &const_TYPE_UINT32_value, ZEND_ACC_PUBLIC, NULL);
307 	zend_string_release(const_TYPE_UINT32_name);
308 
309 	zval const_TYPE_SINT32_value;
310 	ZVAL_LONG(&const_TYPE_SINT32_value, ZEND_FFI_TYPE_SINT32);
311 	zend_string *const_TYPE_SINT32_name = zend_string_init_interned("TYPE_SINT32", sizeof("TYPE_SINT32") - 1, 1);
312 	zend_declare_class_constant_ex(class_entry, const_TYPE_SINT32_name, &const_TYPE_SINT32_value, ZEND_ACC_PUBLIC, NULL);
313 	zend_string_release(const_TYPE_SINT32_name);
314 
315 	zval const_TYPE_UINT64_value;
316 	ZVAL_LONG(&const_TYPE_UINT64_value, ZEND_FFI_TYPE_UINT64);
317 	zend_string *const_TYPE_UINT64_name = zend_string_init_interned("TYPE_UINT64", sizeof("TYPE_UINT64") - 1, 1);
318 	zend_declare_class_constant_ex(class_entry, const_TYPE_UINT64_name, &const_TYPE_UINT64_value, ZEND_ACC_PUBLIC, NULL);
319 	zend_string_release(const_TYPE_UINT64_name);
320 
321 	zval const_TYPE_SINT64_value;
322 	ZVAL_LONG(&const_TYPE_SINT64_value, ZEND_FFI_TYPE_SINT64);
323 	zend_string *const_TYPE_SINT64_name = zend_string_init_interned("TYPE_SINT64", sizeof("TYPE_SINT64") - 1, 1);
324 	zend_declare_class_constant_ex(class_entry, const_TYPE_SINT64_name, &const_TYPE_SINT64_value, ZEND_ACC_PUBLIC, NULL);
325 	zend_string_release(const_TYPE_SINT64_name);
326 
327 	zval const_TYPE_ENUM_value;
328 	ZVAL_LONG(&const_TYPE_ENUM_value, ZEND_FFI_TYPE_ENUM);
329 	zend_string *const_TYPE_ENUM_name = zend_string_init_interned("TYPE_ENUM", sizeof("TYPE_ENUM") - 1, 1);
330 	zend_declare_class_constant_ex(class_entry, const_TYPE_ENUM_name, &const_TYPE_ENUM_value, ZEND_ACC_PUBLIC, NULL);
331 	zend_string_release(const_TYPE_ENUM_name);
332 
333 	zval const_TYPE_BOOL_value;
334 	ZVAL_LONG(&const_TYPE_BOOL_value, ZEND_FFI_TYPE_BOOL);
335 	zend_string *const_TYPE_BOOL_name = zend_string_init_interned("TYPE_BOOL", sizeof("TYPE_BOOL") - 1, 1);
336 	zend_declare_class_constant_ex(class_entry, const_TYPE_BOOL_name, &const_TYPE_BOOL_value, ZEND_ACC_PUBLIC, NULL);
337 	zend_string_release(const_TYPE_BOOL_name);
338 
339 	zval const_TYPE_CHAR_value;
340 	ZVAL_LONG(&const_TYPE_CHAR_value, ZEND_FFI_TYPE_CHAR);
341 	zend_string *const_TYPE_CHAR_name = zend_string_init_interned("TYPE_CHAR", sizeof("TYPE_CHAR") - 1, 1);
342 	zend_declare_class_constant_ex(class_entry, const_TYPE_CHAR_name, &const_TYPE_CHAR_value, ZEND_ACC_PUBLIC, NULL);
343 	zend_string_release(const_TYPE_CHAR_name);
344 
345 	zval const_TYPE_POINTER_value;
346 	ZVAL_LONG(&const_TYPE_POINTER_value, ZEND_FFI_TYPE_POINTER);
347 	zend_string *const_TYPE_POINTER_name = zend_string_init_interned("TYPE_POINTER", sizeof("TYPE_POINTER") - 1, 1);
348 	zend_declare_class_constant_ex(class_entry, const_TYPE_POINTER_name, &const_TYPE_POINTER_value, ZEND_ACC_PUBLIC, NULL);
349 	zend_string_release(const_TYPE_POINTER_name);
350 
351 	zval const_TYPE_FUNC_value;
352 	ZVAL_LONG(&const_TYPE_FUNC_value, ZEND_FFI_TYPE_FUNC);
353 	zend_string *const_TYPE_FUNC_name = zend_string_init_interned("TYPE_FUNC", sizeof("TYPE_FUNC") - 1, 1);
354 	zend_declare_class_constant_ex(class_entry, const_TYPE_FUNC_name, &const_TYPE_FUNC_value, ZEND_ACC_PUBLIC, NULL);
355 	zend_string_release(const_TYPE_FUNC_name);
356 
357 	zval const_TYPE_ARRAY_value;
358 	ZVAL_LONG(&const_TYPE_ARRAY_value, ZEND_FFI_TYPE_ARRAY);
359 	zend_string *const_TYPE_ARRAY_name = zend_string_init_interned("TYPE_ARRAY", sizeof("TYPE_ARRAY") - 1, 1);
360 	zend_declare_class_constant_ex(class_entry, const_TYPE_ARRAY_name, &const_TYPE_ARRAY_value, ZEND_ACC_PUBLIC, NULL);
361 	zend_string_release(const_TYPE_ARRAY_name);
362 
363 	zval const_TYPE_STRUCT_value;
364 	ZVAL_LONG(&const_TYPE_STRUCT_value, ZEND_FFI_TYPE_STRUCT);
365 	zend_string *const_TYPE_STRUCT_name = zend_string_init_interned("TYPE_STRUCT", sizeof("TYPE_STRUCT") - 1, 1);
366 	zend_declare_class_constant_ex(class_entry, const_TYPE_STRUCT_name, &const_TYPE_STRUCT_value, ZEND_ACC_PUBLIC, NULL);
367 	zend_string_release(const_TYPE_STRUCT_name);
368 
369 	zval const_ATTR_CONST_value;
370 	ZVAL_LONG(&const_ATTR_CONST_value, ZEND_FFI_ATTR_CONST);
371 	zend_string *const_ATTR_CONST_name = zend_string_init_interned("ATTR_CONST", sizeof("ATTR_CONST") - 1, 1);
372 	zend_declare_class_constant_ex(class_entry, const_ATTR_CONST_name, &const_ATTR_CONST_value, ZEND_ACC_PUBLIC, NULL);
373 	zend_string_release(const_ATTR_CONST_name);
374 
375 	zval const_ATTR_INCOMPLETE_TAG_value;
376 	ZVAL_LONG(&const_ATTR_INCOMPLETE_TAG_value, ZEND_FFI_ATTR_INCOMPLETE_TAG);
377 	zend_string *const_ATTR_INCOMPLETE_TAG_name = zend_string_init_interned("ATTR_INCOMPLETE_TAG", sizeof("ATTR_INCOMPLETE_TAG") - 1, 1);
378 	zend_declare_class_constant_ex(class_entry, const_ATTR_INCOMPLETE_TAG_name, &const_ATTR_INCOMPLETE_TAG_value, ZEND_ACC_PUBLIC, NULL);
379 	zend_string_release(const_ATTR_INCOMPLETE_TAG_name);
380 
381 	zval const_ATTR_VARIADIC_value;
382 	ZVAL_LONG(&const_ATTR_VARIADIC_value, ZEND_FFI_ATTR_VARIADIC);
383 	zend_string *const_ATTR_VARIADIC_name = zend_string_init_interned("ATTR_VARIADIC", sizeof("ATTR_VARIADIC") - 1, 1);
384 	zend_declare_class_constant_ex(class_entry, const_ATTR_VARIADIC_name, &const_ATTR_VARIADIC_value, ZEND_ACC_PUBLIC, NULL);
385 	zend_string_release(const_ATTR_VARIADIC_name);
386 
387 	zval const_ATTR_INCOMPLETE_ARRAY_value;
388 	ZVAL_LONG(&const_ATTR_INCOMPLETE_ARRAY_value, ZEND_FFI_ATTR_INCOMPLETE_ARRAY);
389 	zend_string *const_ATTR_INCOMPLETE_ARRAY_name = zend_string_init_interned("ATTR_INCOMPLETE_ARRAY", sizeof("ATTR_INCOMPLETE_ARRAY") - 1, 1);
390 	zend_declare_class_constant_ex(class_entry, const_ATTR_INCOMPLETE_ARRAY_name, &const_ATTR_INCOMPLETE_ARRAY_value, ZEND_ACC_PUBLIC, NULL);
391 	zend_string_release(const_ATTR_INCOMPLETE_ARRAY_name);
392 
393 	zval const_ATTR_VLA_value;
394 	ZVAL_LONG(&const_ATTR_VLA_value, ZEND_FFI_ATTR_VLA);
395 	zend_string *const_ATTR_VLA_name = zend_string_init_interned("ATTR_VLA", sizeof("ATTR_VLA") - 1, 1);
396 	zend_declare_class_constant_ex(class_entry, const_ATTR_VLA_name, &const_ATTR_VLA_value, ZEND_ACC_PUBLIC, NULL);
397 	zend_string_release(const_ATTR_VLA_name);
398 
399 	zval const_ATTR_UNION_value;
400 	ZVAL_LONG(&const_ATTR_UNION_value, ZEND_FFI_ATTR_UNION);
401 	zend_string *const_ATTR_UNION_name = zend_string_init_interned("ATTR_UNION", sizeof("ATTR_UNION") - 1, 1);
402 	zend_declare_class_constant_ex(class_entry, const_ATTR_UNION_name, &const_ATTR_UNION_value, ZEND_ACC_PUBLIC, NULL);
403 	zend_string_release(const_ATTR_UNION_name);
404 
405 	zval const_ATTR_PACKED_value;
406 	ZVAL_LONG(&const_ATTR_PACKED_value, ZEND_FFI_ATTR_PACKED);
407 	zend_string *const_ATTR_PACKED_name = zend_string_init_interned("ATTR_PACKED", sizeof("ATTR_PACKED") - 1, 1);
408 	zend_declare_class_constant_ex(class_entry, const_ATTR_PACKED_name, &const_ATTR_PACKED_value, ZEND_ACC_PUBLIC, NULL);
409 	zend_string_release(const_ATTR_PACKED_name);
410 
411 	zval const_ATTR_MS_STRUCT_value;
412 	ZVAL_LONG(&const_ATTR_MS_STRUCT_value, ZEND_FFI_ATTR_MS_STRUCT);
413 	zend_string *const_ATTR_MS_STRUCT_name = zend_string_init_interned("ATTR_MS_STRUCT", sizeof("ATTR_MS_STRUCT") - 1, 1);
414 	zend_declare_class_constant_ex(class_entry, const_ATTR_MS_STRUCT_name, &const_ATTR_MS_STRUCT_value, ZEND_ACC_PUBLIC, NULL);
415 	zend_string_release(const_ATTR_MS_STRUCT_name);
416 
417 	zval const_ATTR_GCC_STRUCT_value;
418 	ZVAL_LONG(&const_ATTR_GCC_STRUCT_value, ZEND_FFI_ATTR_GCC_STRUCT);
419 	zend_string *const_ATTR_GCC_STRUCT_name = zend_string_init_interned("ATTR_GCC_STRUCT", sizeof("ATTR_GCC_STRUCT") - 1, 1);
420 	zend_declare_class_constant_ex(class_entry, const_ATTR_GCC_STRUCT_name, &const_ATTR_GCC_STRUCT_value, ZEND_ACC_PUBLIC, NULL);
421 	zend_string_release(const_ATTR_GCC_STRUCT_name);
422 
423 	zval const_ABI_DEFAULT_value;
424 	ZVAL_LONG(&const_ABI_DEFAULT_value, ZEND_FFI_ABI_DEFAULT);
425 	zend_string *const_ABI_DEFAULT_name = zend_string_init_interned("ABI_DEFAULT", sizeof("ABI_DEFAULT") - 1, 1);
426 	zend_declare_class_constant_ex(class_entry, const_ABI_DEFAULT_name, &const_ABI_DEFAULT_value, ZEND_ACC_PUBLIC, NULL);
427 	zend_string_release(const_ABI_DEFAULT_name);
428 
429 	zval const_ABI_CDECL_value;
430 	ZVAL_LONG(&const_ABI_CDECL_value, ZEND_FFI_ABI_CDECL);
431 	zend_string *const_ABI_CDECL_name = zend_string_init_interned("ABI_CDECL", sizeof("ABI_CDECL") - 1, 1);
432 	zend_declare_class_constant_ex(class_entry, const_ABI_CDECL_name, &const_ABI_CDECL_value, ZEND_ACC_PUBLIC, NULL);
433 	zend_string_release(const_ABI_CDECL_name);
434 
435 	zval const_ABI_FASTCALL_value;
436 	ZVAL_LONG(&const_ABI_FASTCALL_value, ZEND_FFI_ABI_FASTCALL);
437 	zend_string *const_ABI_FASTCALL_name = zend_string_init_interned("ABI_FASTCALL", sizeof("ABI_FASTCALL") - 1, 1);
438 	zend_declare_class_constant_ex(class_entry, const_ABI_FASTCALL_name, &const_ABI_FASTCALL_value, ZEND_ACC_PUBLIC, NULL);
439 	zend_string_release(const_ABI_FASTCALL_name);
440 
441 	zval const_ABI_THISCALL_value;
442 	ZVAL_LONG(&const_ABI_THISCALL_value, ZEND_FFI_ABI_THISCALL);
443 	zend_string *const_ABI_THISCALL_name = zend_string_init_interned("ABI_THISCALL", sizeof("ABI_THISCALL") - 1, 1);
444 	zend_declare_class_constant_ex(class_entry, const_ABI_THISCALL_name, &const_ABI_THISCALL_value, ZEND_ACC_PUBLIC, NULL);
445 	zend_string_release(const_ABI_THISCALL_name);
446 
447 	zval const_ABI_STDCALL_value;
448 	ZVAL_LONG(&const_ABI_STDCALL_value, ZEND_FFI_ABI_STDCALL);
449 	zend_string *const_ABI_STDCALL_name = zend_string_init_interned("ABI_STDCALL", sizeof("ABI_STDCALL") - 1, 1);
450 	zend_declare_class_constant_ex(class_entry, const_ABI_STDCALL_name, &const_ABI_STDCALL_value, ZEND_ACC_PUBLIC, NULL);
451 	zend_string_release(const_ABI_STDCALL_name);
452 
453 	zval const_ABI_PASCAL_value;
454 	ZVAL_LONG(&const_ABI_PASCAL_value, ZEND_FFI_ABI_PASCAL);
455 	zend_string *const_ABI_PASCAL_name = zend_string_init_interned("ABI_PASCAL", sizeof("ABI_PASCAL") - 1, 1);
456 	zend_declare_class_constant_ex(class_entry, const_ABI_PASCAL_name, &const_ABI_PASCAL_value, ZEND_ACC_PUBLIC, NULL);
457 	zend_string_release(const_ABI_PASCAL_name);
458 
459 	zval const_ABI_REGISTER_value;
460 	ZVAL_LONG(&const_ABI_REGISTER_value, ZEND_FFI_ABI_REGISTER);
461 	zend_string *const_ABI_REGISTER_name = zend_string_init_interned("ABI_REGISTER", sizeof("ABI_REGISTER") - 1, 1);
462 	zend_declare_class_constant_ex(class_entry, const_ABI_REGISTER_name, &const_ABI_REGISTER_value, ZEND_ACC_PUBLIC, NULL);
463 	zend_string_release(const_ABI_REGISTER_name);
464 
465 	zval const_ABI_MS_value;
466 	ZVAL_LONG(&const_ABI_MS_value, ZEND_FFI_ABI_MS);
467 	zend_string *const_ABI_MS_name = zend_string_init_interned("ABI_MS", sizeof("ABI_MS") - 1, 1);
468 	zend_declare_class_constant_ex(class_entry, const_ABI_MS_name, &const_ABI_MS_value, ZEND_ACC_PUBLIC, NULL);
469 	zend_string_release(const_ABI_MS_name);
470 
471 	zval const_ABI_SYSV_value;
472 	ZVAL_LONG(&const_ABI_SYSV_value, ZEND_FFI_ABI_SYSV);
473 	zend_string *const_ABI_SYSV_name = zend_string_init_interned("ABI_SYSV", sizeof("ABI_SYSV") - 1, 1);
474 	zend_declare_class_constant_ex(class_entry, const_ABI_SYSV_name, &const_ABI_SYSV_value, ZEND_ACC_PUBLIC, NULL);
475 	zend_string_release(const_ABI_SYSV_name);
476 
477 	zval const_ABI_VECTORCALL_value;
478 	ZVAL_LONG(&const_ABI_VECTORCALL_value, ZEND_FFI_ABI_VECTORCALL);
479 	zend_string *const_ABI_VECTORCALL_name = zend_string_init_interned("ABI_VECTORCALL", sizeof("ABI_VECTORCALL") - 1, 1);
480 	zend_declare_class_constant_ex(class_entry, const_ABI_VECTORCALL_name, &const_ABI_VECTORCALL_value, ZEND_ACC_PUBLIC, NULL);
481 	zend_string_release(const_ABI_VECTORCALL_name);
482 
483 	return class_entry;
484 }
485 
register_class_FFI_Exception(zend_class_entry * class_entry_Error)486 static zend_class_entry *register_class_FFI_Exception(zend_class_entry *class_entry_Error)
487 {
488 	zend_class_entry ce, *class_entry;
489 
490 	INIT_NS_CLASS_ENTRY(ce, "FFI", "Exception", class_FFI_Exception_methods);
491 	class_entry = zend_register_internal_class_ex(&ce, class_entry_Error);
492 
493 	return class_entry;
494 }
495 
register_class_FFI_ParserException(zend_class_entry * class_entry_FFI_Exception)496 static zend_class_entry *register_class_FFI_ParserException(zend_class_entry *class_entry_FFI_Exception)
497 {
498 	zend_class_entry ce, *class_entry;
499 
500 	INIT_NS_CLASS_ENTRY(ce, "FFI", "ParserException", class_FFI_ParserException_methods);
501 	class_entry = zend_register_internal_class_ex(&ce, class_entry_FFI_Exception);
502 	class_entry->ce_flags |= ZEND_ACC_FINAL;
503 
504 	return class_entry;
505 }
506