xref: /php-src/ext/random/random_arginfo.h (revision db545767)
1 /* This is a generated file, edit the .stub.php file instead.
2  * Stub hash: fad14b8b8abaf9f33d7837ba8f6190c5d10ff63f */
3 
4 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_lcg_value, 0, 0, IS_DOUBLE, 0)
5 ZEND_END_ARG_INFO()
6 
7 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mt_srand, 0, 0, IS_VOID, 0)
8 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, seed, IS_LONG, 1, "null")
9 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "MT_RAND_MT19937")
10 ZEND_END_ARG_INFO()
11 
12 #define arginfo_srand arginfo_mt_srand
13 
14 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_rand, 0, 0, IS_LONG, 0)
15 	ZEND_ARG_TYPE_INFO(0, min, IS_LONG, 0)
16 	ZEND_ARG_TYPE_INFO(0, max, IS_LONG, 0)
17 ZEND_END_ARG_INFO()
18 
19 #define arginfo_mt_rand arginfo_rand
20 
21 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mt_getrandmax, 0, 0, IS_LONG, 0)
22 ZEND_END_ARG_INFO()
23 
24 #define arginfo_getrandmax arginfo_mt_getrandmax
25 
26 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_random_bytes, 0, 1, IS_STRING, 0)
27 	ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0)
28 ZEND_END_ARG_INFO()
29 
30 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_random_int, 0, 2, IS_LONG, 0)
31 	ZEND_ARG_TYPE_INFO(0, min, IS_LONG, 0)
32 	ZEND_ARG_TYPE_INFO(0, max, IS_LONG, 0)
33 ZEND_END_ARG_INFO()
34 
35 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Random_Engine_Mt19937___construct, 0, 0, 0)
36 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, seed, IS_LONG, 1, "null")
37 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "MT_RAND_MT19937")
38 ZEND_END_ARG_INFO()
39 
40 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Random_Engine_Mt19937_generate, 0, 0, IS_STRING, 0)
41 ZEND_END_ARG_INFO()
42 
43 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Random_Engine_Mt19937___serialize, 0, 0, IS_ARRAY, 0)
44 ZEND_END_ARG_INFO()
45 
46 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Random_Engine_Mt19937___unserialize, 0, 1, IS_VOID, 0)
47 	ZEND_ARG_TYPE_INFO(0, data, IS_ARRAY, 0)
48 ZEND_END_ARG_INFO()
49 
50 #define arginfo_class_Random_Engine_Mt19937___debugInfo arginfo_class_Random_Engine_Mt19937___serialize
51 
52 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Random_Engine_PcgOneseq128XslRr64___construct, 0, 0, 0)
53 	ZEND_ARG_TYPE_MASK(0, seed, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_NULL, "null")
54 ZEND_END_ARG_INFO()
55 
56 #define arginfo_class_Random_Engine_PcgOneseq128XslRr64_generate arginfo_class_Random_Engine_Mt19937_generate
57 
58 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Random_Engine_PcgOneseq128XslRr64_jump, 0, 1, IS_VOID, 0)
59 	ZEND_ARG_TYPE_INFO(0, advance, IS_LONG, 0)
60 ZEND_END_ARG_INFO()
61 
62 #define arginfo_class_Random_Engine_PcgOneseq128XslRr64___serialize arginfo_class_Random_Engine_Mt19937___serialize
63 
64 #define arginfo_class_Random_Engine_PcgOneseq128XslRr64___unserialize arginfo_class_Random_Engine_Mt19937___unserialize
65 
66 #define arginfo_class_Random_Engine_PcgOneseq128XslRr64___debugInfo arginfo_class_Random_Engine_Mt19937___serialize
67 
68 #define arginfo_class_Random_Engine_Xoshiro256StarStar___construct arginfo_class_Random_Engine_PcgOneseq128XslRr64___construct
69 
70 #define arginfo_class_Random_Engine_Xoshiro256StarStar_generate arginfo_class_Random_Engine_Mt19937_generate
71 
72 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Random_Engine_Xoshiro256StarStar_jump, 0, 0, IS_VOID, 0)
73 ZEND_END_ARG_INFO()
74 
75 #define arginfo_class_Random_Engine_Xoshiro256StarStar_jumpLong arginfo_class_Random_Engine_Xoshiro256StarStar_jump
76 
77 #define arginfo_class_Random_Engine_Xoshiro256StarStar___serialize arginfo_class_Random_Engine_Mt19937___serialize
78 
79 #define arginfo_class_Random_Engine_Xoshiro256StarStar___unserialize arginfo_class_Random_Engine_Mt19937___unserialize
80 
81 #define arginfo_class_Random_Engine_Xoshiro256StarStar___debugInfo arginfo_class_Random_Engine_Mt19937___serialize
82 
83 #define arginfo_class_Random_Engine_Secure_generate arginfo_class_Random_Engine_Mt19937_generate
84 
85 #define arginfo_class_Random_Engine_generate arginfo_class_Random_Engine_Mt19937_generate
86 
87 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Random_Randomizer___construct, 0, 0, 0)
88 	ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(0, engine, Random\\Engine, 1, "null")
89 ZEND_END_ARG_INFO()
90 
91 #define arginfo_class_Random_Randomizer_nextInt arginfo_mt_getrandmax
92 
93 #define arginfo_class_Random_Randomizer_nextFloat arginfo_lcg_value
94 
95 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Random_Randomizer_getFloat, 0, 2, IS_DOUBLE, 0)
96 	ZEND_ARG_TYPE_INFO(0, min, IS_DOUBLE, 0)
97 	ZEND_ARG_TYPE_INFO(0, max, IS_DOUBLE, 0)
98 	ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(0, boundary, Random\\IntervalBoundary, 0, "Random\\IntervalBoundary::ClosedOpen")
99 ZEND_END_ARG_INFO()
100 
101 #define arginfo_class_Random_Randomizer_getInt arginfo_random_int
102 
103 #define arginfo_class_Random_Randomizer_getBytes arginfo_random_bytes
104 
105 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Random_Randomizer_getBytesFromString, 0, 2, IS_STRING, 0)
106 	ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
107 	ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0)
108 ZEND_END_ARG_INFO()
109 
110 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Random_Randomizer_shuffleArray, 0, 1, IS_ARRAY, 0)
111 	ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0)
112 ZEND_END_ARG_INFO()
113 
114 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Random_Randomizer_shuffleBytes, 0, 1, IS_STRING, 0)
115 	ZEND_ARG_TYPE_INFO(0, bytes, IS_STRING, 0)
116 ZEND_END_ARG_INFO()
117 
118 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Random_Randomizer_pickArrayKeys, 0, 2, IS_ARRAY, 0)
119 	ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0)
120 	ZEND_ARG_TYPE_INFO(0, num, IS_LONG, 0)
121 ZEND_END_ARG_INFO()
122 
123 #define arginfo_class_Random_Randomizer___serialize arginfo_class_Random_Engine_Mt19937___serialize
124 
125 #define arginfo_class_Random_Randomizer___unserialize arginfo_class_Random_Engine_Mt19937___unserialize
126 
127 ZEND_FUNCTION(lcg_value);
128 ZEND_FUNCTION(mt_srand);
129 ZEND_FUNCTION(rand);
130 ZEND_FUNCTION(mt_rand);
131 ZEND_FUNCTION(mt_getrandmax);
132 ZEND_FUNCTION(random_bytes);
133 ZEND_FUNCTION(random_int);
134 ZEND_METHOD(Random_Engine_Mt19937, __construct);
135 ZEND_METHOD(Random_Engine_Mt19937, generate);
136 ZEND_METHOD(Random_Engine_Mt19937, __serialize);
137 ZEND_METHOD(Random_Engine_Mt19937, __unserialize);
138 ZEND_METHOD(Random_Engine_Mt19937, __debugInfo);
139 ZEND_METHOD(Random_Engine_PcgOneseq128XslRr64, __construct);
140 ZEND_METHOD(Random_Engine_PcgOneseq128XslRr64, jump);
141 ZEND_METHOD(Random_Engine_Xoshiro256StarStar, __construct);
142 ZEND_METHOD(Random_Engine_Xoshiro256StarStar, jump);
143 ZEND_METHOD(Random_Engine_Xoshiro256StarStar, jumpLong);
144 ZEND_METHOD(Random_Randomizer, __construct);
145 ZEND_METHOD(Random_Randomizer, nextInt);
146 ZEND_METHOD(Random_Randomizer, nextFloat);
147 ZEND_METHOD(Random_Randomizer, getFloat);
148 ZEND_METHOD(Random_Randomizer, getInt);
149 ZEND_METHOD(Random_Randomizer, getBytes);
150 ZEND_METHOD(Random_Randomizer, getBytesFromString);
151 ZEND_METHOD(Random_Randomizer, shuffleArray);
152 ZEND_METHOD(Random_Randomizer, shuffleBytes);
153 ZEND_METHOD(Random_Randomizer, pickArrayKeys);
154 ZEND_METHOD(Random_Randomizer, __serialize);
155 ZEND_METHOD(Random_Randomizer, __unserialize);
156 
157 static const zend_function_entry ext_functions[] = {
158 	ZEND_RAW_FENTRY("lcg_value", zif_lcg_value, arginfo_lcg_value, ZEND_ACC_DEPRECATED, NULL, NULL)
159 	ZEND_FE(mt_srand, arginfo_mt_srand)
160 	ZEND_RAW_FENTRY("srand", zif_mt_srand, arginfo_srand, 0, NULL, NULL)
161 	ZEND_FE(rand, arginfo_rand)
162 	ZEND_FE(mt_rand, arginfo_mt_rand)
163 	ZEND_FE(mt_getrandmax, arginfo_mt_getrandmax)
164 	ZEND_RAW_FENTRY("getrandmax", zif_mt_getrandmax, arginfo_getrandmax, 0, NULL, NULL)
165 	ZEND_FE(random_bytes, arginfo_random_bytes)
166 	ZEND_FE(random_int, arginfo_random_int)
167 	ZEND_FE_END
168 };
169 
170 static const zend_function_entry class_Random_Engine_Mt19937_methods[] = {
171 	ZEND_ME(Random_Engine_Mt19937, __construct, arginfo_class_Random_Engine_Mt19937___construct, ZEND_ACC_PUBLIC)
172 	ZEND_ME(Random_Engine_Mt19937, generate, arginfo_class_Random_Engine_Mt19937_generate, ZEND_ACC_PUBLIC)
173 	ZEND_ME(Random_Engine_Mt19937, __serialize, arginfo_class_Random_Engine_Mt19937___serialize, ZEND_ACC_PUBLIC)
174 	ZEND_ME(Random_Engine_Mt19937, __unserialize, arginfo_class_Random_Engine_Mt19937___unserialize, ZEND_ACC_PUBLIC)
175 	ZEND_ME(Random_Engine_Mt19937, __debugInfo, arginfo_class_Random_Engine_Mt19937___debugInfo, ZEND_ACC_PUBLIC)
176 	ZEND_FE_END
177 };
178 
179 static const zend_function_entry class_Random_Engine_PcgOneseq128XslRr64_methods[] = {
180 	ZEND_ME(Random_Engine_PcgOneseq128XslRr64, __construct, arginfo_class_Random_Engine_PcgOneseq128XslRr64___construct, ZEND_ACC_PUBLIC)
181 	ZEND_RAW_FENTRY("generate", zim_Random_Engine_Mt19937_generate, arginfo_class_Random_Engine_PcgOneseq128XslRr64_generate, ZEND_ACC_PUBLIC, NULL, NULL)
182 	ZEND_ME(Random_Engine_PcgOneseq128XslRr64, jump, arginfo_class_Random_Engine_PcgOneseq128XslRr64_jump, ZEND_ACC_PUBLIC)
183 	ZEND_RAW_FENTRY("__serialize", zim_Random_Engine_Mt19937___serialize, arginfo_class_Random_Engine_PcgOneseq128XslRr64___serialize, ZEND_ACC_PUBLIC, NULL, NULL)
184 	ZEND_RAW_FENTRY("__unserialize", zim_Random_Engine_Mt19937___unserialize, arginfo_class_Random_Engine_PcgOneseq128XslRr64___unserialize, ZEND_ACC_PUBLIC, NULL, NULL)
185 	ZEND_RAW_FENTRY("__debugInfo", zim_Random_Engine_Mt19937___debugInfo, arginfo_class_Random_Engine_PcgOneseq128XslRr64___debugInfo, ZEND_ACC_PUBLIC, NULL, NULL)
186 	ZEND_FE_END
187 };
188 
189 static const zend_function_entry class_Random_Engine_Xoshiro256StarStar_methods[] = {
190 	ZEND_ME(Random_Engine_Xoshiro256StarStar, __construct, arginfo_class_Random_Engine_Xoshiro256StarStar___construct, ZEND_ACC_PUBLIC)
191 	ZEND_RAW_FENTRY("generate", zim_Random_Engine_Mt19937_generate, arginfo_class_Random_Engine_Xoshiro256StarStar_generate, ZEND_ACC_PUBLIC, NULL, NULL)
192 	ZEND_ME(Random_Engine_Xoshiro256StarStar, jump, arginfo_class_Random_Engine_Xoshiro256StarStar_jump, ZEND_ACC_PUBLIC)
193 	ZEND_ME(Random_Engine_Xoshiro256StarStar, jumpLong, arginfo_class_Random_Engine_Xoshiro256StarStar_jumpLong, ZEND_ACC_PUBLIC)
194 	ZEND_RAW_FENTRY("__serialize", zim_Random_Engine_Mt19937___serialize, arginfo_class_Random_Engine_Xoshiro256StarStar___serialize, ZEND_ACC_PUBLIC, NULL, NULL)
195 	ZEND_RAW_FENTRY("__unserialize", zim_Random_Engine_Mt19937___unserialize, arginfo_class_Random_Engine_Xoshiro256StarStar___unserialize, ZEND_ACC_PUBLIC, NULL, NULL)
196 	ZEND_RAW_FENTRY("__debugInfo", zim_Random_Engine_Mt19937___debugInfo, arginfo_class_Random_Engine_Xoshiro256StarStar___debugInfo, ZEND_ACC_PUBLIC, NULL, NULL)
197 	ZEND_FE_END
198 };
199 
200 static const zend_function_entry class_Random_Engine_Secure_methods[] = {
201 	ZEND_RAW_FENTRY("generate", zim_Random_Engine_Mt19937_generate, arginfo_class_Random_Engine_Secure_generate, ZEND_ACC_PUBLIC, NULL, NULL)
202 	ZEND_FE_END
203 };
204 
205 static const zend_function_entry class_Random_Engine_methods[] = {
206 	ZEND_RAW_FENTRY("generate", NULL, arginfo_class_Random_Engine_generate, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT, NULL, NULL)
207 	ZEND_FE_END
208 };
209 
210 static const zend_function_entry class_Random_Randomizer_methods[] = {
211 	ZEND_ME(Random_Randomizer, __construct, arginfo_class_Random_Randomizer___construct, ZEND_ACC_PUBLIC)
212 	ZEND_ME(Random_Randomizer, nextInt, arginfo_class_Random_Randomizer_nextInt, ZEND_ACC_PUBLIC)
213 	ZEND_ME(Random_Randomizer, nextFloat, arginfo_class_Random_Randomizer_nextFloat, ZEND_ACC_PUBLIC)
214 	ZEND_ME(Random_Randomizer, getFloat, arginfo_class_Random_Randomizer_getFloat, ZEND_ACC_PUBLIC)
215 	ZEND_ME(Random_Randomizer, getInt, arginfo_class_Random_Randomizer_getInt, ZEND_ACC_PUBLIC)
216 	ZEND_ME(Random_Randomizer, getBytes, arginfo_class_Random_Randomizer_getBytes, ZEND_ACC_PUBLIC)
217 	ZEND_ME(Random_Randomizer, getBytesFromString, arginfo_class_Random_Randomizer_getBytesFromString, ZEND_ACC_PUBLIC)
218 	ZEND_ME(Random_Randomizer, shuffleArray, arginfo_class_Random_Randomizer_shuffleArray, ZEND_ACC_PUBLIC)
219 	ZEND_ME(Random_Randomizer, shuffleBytes, arginfo_class_Random_Randomizer_shuffleBytes, ZEND_ACC_PUBLIC)
220 	ZEND_ME(Random_Randomizer, pickArrayKeys, arginfo_class_Random_Randomizer_pickArrayKeys, ZEND_ACC_PUBLIC)
221 	ZEND_ME(Random_Randomizer, __serialize, arginfo_class_Random_Randomizer___serialize, ZEND_ACC_PUBLIC)
222 	ZEND_ME(Random_Randomizer, __unserialize, arginfo_class_Random_Randomizer___unserialize, ZEND_ACC_PUBLIC)
223 	ZEND_FE_END
224 };
225 
register_random_symbols(int module_number)226 static void register_random_symbols(int module_number)
227 {
228 	REGISTER_LONG_CONSTANT("MT_RAND_MT19937", MT_RAND_MT19937, CONST_PERSISTENT);
229 	REGISTER_LONG_CONSTANT("MT_RAND_PHP", MT_RAND_PHP, CONST_PERSISTENT | CONST_DEPRECATED);
230 
231 
232 	zend_attribute *attribute_Deprecated_func_lcg_value_0 = zend_add_function_attribute(zend_hash_str_find_ptr(CG(function_table), "lcg_value", sizeof("lcg_value") - 1), ZSTR_KNOWN(ZEND_STR_DEPRECATED_CAPITALIZED), 2);
233 	zval attribute_Deprecated_func_lcg_value_0_arg0;
234 	zend_string *attribute_Deprecated_func_lcg_value_0_arg0_str = zend_string_init("8.4", strlen("8.4"), 1);
235 	ZVAL_STR(&attribute_Deprecated_func_lcg_value_0_arg0, attribute_Deprecated_func_lcg_value_0_arg0_str);
236 	ZVAL_COPY_VALUE(&attribute_Deprecated_func_lcg_value_0->args[0].value, &attribute_Deprecated_func_lcg_value_0_arg0);
237 	attribute_Deprecated_func_lcg_value_0->args[0].name = ZSTR_KNOWN(ZEND_STR_SINCE);
238 	zval attribute_Deprecated_func_lcg_value_0_arg1;
239 	zend_string *attribute_Deprecated_func_lcg_value_0_arg1_str = zend_string_init("use \\Random\\Randomizer::getFloat() instead", strlen("use \\Random\\Randomizer::getFloat() instead"), 1);
240 	ZVAL_STR(&attribute_Deprecated_func_lcg_value_0_arg1, attribute_Deprecated_func_lcg_value_0_arg1_str);
241 	ZVAL_COPY_VALUE(&attribute_Deprecated_func_lcg_value_0->args[1].value, &attribute_Deprecated_func_lcg_value_0_arg1);
242 	attribute_Deprecated_func_lcg_value_0->args[1].name = ZSTR_KNOWN(ZEND_STR_MESSAGE);
243 }
244 
register_class_Random_Engine_Mt19937(zend_class_entry * class_entry_Random_Engine)245 static zend_class_entry *register_class_Random_Engine_Mt19937(zend_class_entry *class_entry_Random_Engine)
246 {
247 	zend_class_entry ce, *class_entry;
248 
249 	INIT_NS_CLASS_ENTRY(ce, "Random\\Engine", "Mt19937", class_Random_Engine_Mt19937_methods);
250 	class_entry = zend_register_internal_class_with_flags(&ce, NULL, ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES);
251 	zend_class_implements(class_entry, 1, class_entry_Random_Engine);
252 
253 	return class_entry;
254 }
255 
register_class_Random_Engine_PcgOneseq128XslRr64(zend_class_entry * class_entry_Random_Engine)256 static zend_class_entry *register_class_Random_Engine_PcgOneseq128XslRr64(zend_class_entry *class_entry_Random_Engine)
257 {
258 	zend_class_entry ce, *class_entry;
259 
260 	INIT_NS_CLASS_ENTRY(ce, "Random\\Engine", "PcgOneseq128XslRr64", class_Random_Engine_PcgOneseq128XslRr64_methods);
261 	class_entry = zend_register_internal_class_with_flags(&ce, NULL, ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES);
262 	zend_class_implements(class_entry, 1, class_entry_Random_Engine);
263 
264 	return class_entry;
265 }
266 
register_class_Random_Engine_Xoshiro256StarStar(zend_class_entry * class_entry_Random_Engine)267 static zend_class_entry *register_class_Random_Engine_Xoshiro256StarStar(zend_class_entry *class_entry_Random_Engine)
268 {
269 	zend_class_entry ce, *class_entry;
270 
271 	INIT_NS_CLASS_ENTRY(ce, "Random\\Engine", "Xoshiro256StarStar", class_Random_Engine_Xoshiro256StarStar_methods);
272 	class_entry = zend_register_internal_class_with_flags(&ce, NULL, ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES);
273 	zend_class_implements(class_entry, 1, class_entry_Random_Engine);
274 
275 	return class_entry;
276 }
277 
register_class_Random_Engine_Secure(zend_class_entry * class_entry_Random_CryptoSafeEngine)278 static zend_class_entry *register_class_Random_Engine_Secure(zend_class_entry *class_entry_Random_CryptoSafeEngine)
279 {
280 	zend_class_entry ce, *class_entry;
281 
282 	INIT_NS_CLASS_ENTRY(ce, "Random\\Engine", "Secure", class_Random_Engine_Secure_methods);
283 	class_entry = zend_register_internal_class_with_flags(&ce, NULL, ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE);
284 	zend_class_implements(class_entry, 1, class_entry_Random_CryptoSafeEngine);
285 
286 	return class_entry;
287 }
288 
register_class_Random_Engine(void)289 static zend_class_entry *register_class_Random_Engine(void)
290 {
291 	zend_class_entry ce, *class_entry;
292 
293 	INIT_NS_CLASS_ENTRY(ce, "Random", "Engine", class_Random_Engine_methods);
294 	class_entry = zend_register_internal_interface(&ce);
295 
296 	return class_entry;
297 }
298 
register_class_Random_CryptoSafeEngine(zend_class_entry * class_entry_Random_Engine)299 static zend_class_entry *register_class_Random_CryptoSafeEngine(zend_class_entry *class_entry_Random_Engine)
300 {
301 	zend_class_entry ce, *class_entry;
302 
303 	INIT_NS_CLASS_ENTRY(ce, "Random", "CryptoSafeEngine", NULL);
304 	class_entry = zend_register_internal_interface(&ce);
305 	zend_class_implements(class_entry, 1, class_entry_Random_Engine);
306 
307 	return class_entry;
308 }
309 
register_class_Random_Randomizer(void)310 static zend_class_entry *register_class_Random_Randomizer(void)
311 {
312 	zend_class_entry ce, *class_entry;
313 
314 	INIT_NS_CLASS_ENTRY(ce, "Random", "Randomizer", class_Random_Randomizer_methods);
315 	class_entry = zend_register_internal_class_with_flags(&ce, NULL, ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES);
316 
317 	zval property_engine_default_value;
318 	ZVAL_UNDEF(&property_engine_default_value);
319 	zend_string *property_engine_name = zend_string_init("engine", sizeof("engine") - 1, 1);
320 	zend_string *property_engine_class_Random_Engine = zend_string_init("Random\\Engine", sizeof("Random\\Engine")-1, 1);
321 	zend_declare_typed_property(class_entry, property_engine_name, &property_engine_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_READONLY, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_engine_class_Random_Engine, 0, 0));
322 	zend_string_release(property_engine_name);
323 
324 	return class_entry;
325 }
326 
register_class_Random_IntervalBoundary(void)327 static zend_class_entry *register_class_Random_IntervalBoundary(void)
328 {
329 	zend_class_entry *class_entry = zend_register_internal_enum("Random\\IntervalBoundary", IS_UNDEF, NULL);
330 
331 	zend_enum_add_case_cstr(class_entry, "ClosedOpen", NULL);
332 
333 	zend_enum_add_case_cstr(class_entry, "ClosedClosed", NULL);
334 
335 	zend_enum_add_case_cstr(class_entry, "OpenClosed", NULL);
336 
337 	zend_enum_add_case_cstr(class_entry, "OpenOpen", NULL);
338 
339 	return class_entry;
340 }
341 
register_class_Random_RandomError(zend_class_entry * class_entry_Error)342 static zend_class_entry *register_class_Random_RandomError(zend_class_entry *class_entry_Error)
343 {
344 	zend_class_entry ce, *class_entry;
345 
346 	INIT_NS_CLASS_ENTRY(ce, "Random", "RandomError", NULL);
347 	class_entry = zend_register_internal_class_with_flags(&ce, class_entry_Error, ZEND_ACC_NO_DYNAMIC_PROPERTIES);
348 
349 	return class_entry;
350 }
351 
register_class_Random_BrokenRandomEngineError(zend_class_entry * class_entry_Random_RandomError)352 static zend_class_entry *register_class_Random_BrokenRandomEngineError(zend_class_entry *class_entry_Random_RandomError)
353 {
354 	zend_class_entry ce, *class_entry;
355 
356 	INIT_NS_CLASS_ENTRY(ce, "Random", "BrokenRandomEngineError", NULL);
357 	class_entry = zend_register_internal_class_with_flags(&ce, class_entry_Random_RandomError, ZEND_ACC_NO_DYNAMIC_PROPERTIES);
358 
359 	return class_entry;
360 }
361 
register_class_Random_RandomException(zend_class_entry * class_entry_Exception)362 static zend_class_entry *register_class_Random_RandomException(zend_class_entry *class_entry_Exception)
363 {
364 	zend_class_entry ce, *class_entry;
365 
366 	INIT_NS_CLASS_ENTRY(ce, "Random", "RandomException", NULL);
367 	class_entry = zend_register_internal_class_with_flags(&ce, class_entry_Exception, ZEND_ACC_NO_DYNAMIC_PROPERTIES);
368 
369 	return class_entry;
370 }
371