xref: /php-src/ext/json/json_arginfo.h (revision 53cb8967)
1 /* This is a generated file, edit the .stub.php file instead.
2  * Stub hash: 0ceb50047401c4b9e878c09cc518eacc274f7fff */
3 
4 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_json_encode, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
5 	ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
6 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
7 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, depth, IS_LONG, 0, "512")
8 ZEND_END_ARG_INFO()
9 
10 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_json_decode, 0, 1, IS_MIXED, 0)
11 	ZEND_ARG_TYPE_INFO(0, json, IS_STRING, 0)
12 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, associative, _IS_BOOL, 1, "null")
13 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, depth, IS_LONG, 0, "512")
14 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
15 ZEND_END_ARG_INFO()
16 
17 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_json_validate, 0, 1, _IS_BOOL, 0)
18 	ZEND_ARG_TYPE_INFO(0, json, IS_STRING, 0)
19 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, depth, IS_LONG, 0, "512")
20 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
21 ZEND_END_ARG_INFO()
22 
23 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_json_last_error, 0, 0, IS_LONG, 0)
24 ZEND_END_ARG_INFO()
25 
26 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_json_last_error_msg, 0, 0, IS_STRING, 0)
27 ZEND_END_ARG_INFO()
28 
29 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_JsonSerializable_jsonSerialize, 0, 0, IS_MIXED, 0)
30 ZEND_END_ARG_INFO()
31 
32 ZEND_FUNCTION(json_encode);
33 ZEND_FUNCTION(json_decode);
34 ZEND_FUNCTION(json_validate);
35 ZEND_FUNCTION(json_last_error);
36 ZEND_FUNCTION(json_last_error_msg);
37 
38 static const zend_function_entry ext_functions[] = {
39 	ZEND_FE(json_encode, arginfo_json_encode)
40 	ZEND_FE(json_decode, arginfo_json_decode)
41 	ZEND_FE(json_validate, arginfo_json_validate)
42 	ZEND_FE(json_last_error, arginfo_json_last_error)
43 	ZEND_FE(json_last_error_msg, arginfo_json_last_error_msg)
44 	ZEND_FE_END
45 };
46 
47 static const zend_function_entry class_JsonSerializable_methods[] = {
48 	ZEND_RAW_FENTRY("jsonSerialize", NULL, arginfo_class_JsonSerializable_jsonSerialize, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT, NULL, NULL)
49 	ZEND_FE_END
50 };
51 
register_json_symbols(int module_number)52 static void register_json_symbols(int module_number)
53 {
54 	REGISTER_LONG_CONSTANT("JSON_HEX_TAG", PHP_JSON_HEX_TAG, CONST_PERSISTENT);
55 	REGISTER_LONG_CONSTANT("JSON_HEX_AMP", PHP_JSON_HEX_AMP, CONST_PERSISTENT);
56 	REGISTER_LONG_CONSTANT("JSON_HEX_APOS", PHP_JSON_HEX_APOS, CONST_PERSISTENT);
57 	REGISTER_LONG_CONSTANT("JSON_HEX_QUOT", PHP_JSON_HEX_QUOT, CONST_PERSISTENT);
58 	REGISTER_LONG_CONSTANT("JSON_FORCE_OBJECT", PHP_JSON_FORCE_OBJECT, CONST_PERSISTENT);
59 	REGISTER_LONG_CONSTANT("JSON_NUMERIC_CHECK", PHP_JSON_NUMERIC_CHECK, CONST_PERSISTENT);
60 	REGISTER_LONG_CONSTANT("JSON_UNESCAPED_SLASHES", PHP_JSON_UNESCAPED_SLASHES, CONST_PERSISTENT);
61 	REGISTER_LONG_CONSTANT("JSON_PRETTY_PRINT", PHP_JSON_PRETTY_PRINT, CONST_PERSISTENT);
62 	REGISTER_LONG_CONSTANT("JSON_UNESCAPED_UNICODE", PHP_JSON_UNESCAPED_UNICODE, CONST_PERSISTENT);
63 	REGISTER_LONG_CONSTANT("JSON_PARTIAL_OUTPUT_ON_ERROR", PHP_JSON_PARTIAL_OUTPUT_ON_ERROR, CONST_PERSISTENT);
64 	REGISTER_LONG_CONSTANT("JSON_PRESERVE_ZERO_FRACTION", PHP_JSON_PRESERVE_ZERO_FRACTION, CONST_PERSISTENT);
65 	REGISTER_LONG_CONSTANT("JSON_UNESCAPED_LINE_TERMINATORS", PHP_JSON_UNESCAPED_LINE_TERMINATORS, CONST_PERSISTENT);
66 	REGISTER_LONG_CONSTANT("JSON_OBJECT_AS_ARRAY", PHP_JSON_OBJECT_AS_ARRAY, CONST_PERSISTENT);
67 	REGISTER_LONG_CONSTANT("JSON_BIGINT_AS_STRING", PHP_JSON_BIGINT_AS_STRING, CONST_PERSISTENT);
68 	REGISTER_LONG_CONSTANT("JSON_INVALID_UTF8_IGNORE", PHP_JSON_INVALID_UTF8_IGNORE, CONST_PERSISTENT);
69 	REGISTER_LONG_CONSTANT("JSON_INVALID_UTF8_SUBSTITUTE", PHP_JSON_INVALID_UTF8_SUBSTITUTE, CONST_PERSISTENT);
70 	REGISTER_LONG_CONSTANT("JSON_THROW_ON_ERROR", PHP_JSON_THROW_ON_ERROR, CONST_PERSISTENT);
71 	REGISTER_LONG_CONSTANT("JSON_ERROR_NONE", PHP_JSON_ERROR_NONE, CONST_PERSISTENT);
72 	REGISTER_LONG_CONSTANT("JSON_ERROR_DEPTH", PHP_JSON_ERROR_DEPTH, CONST_PERSISTENT);
73 	REGISTER_LONG_CONSTANT("JSON_ERROR_STATE_MISMATCH", PHP_JSON_ERROR_STATE_MISMATCH, CONST_PERSISTENT);
74 	REGISTER_LONG_CONSTANT("JSON_ERROR_CTRL_CHAR", PHP_JSON_ERROR_CTRL_CHAR, CONST_PERSISTENT);
75 	REGISTER_LONG_CONSTANT("JSON_ERROR_SYNTAX", PHP_JSON_ERROR_SYNTAX, CONST_PERSISTENT);
76 	REGISTER_LONG_CONSTANT("JSON_ERROR_UTF8", PHP_JSON_ERROR_UTF8, CONST_PERSISTENT);
77 	REGISTER_LONG_CONSTANT("JSON_ERROR_RECURSION", PHP_JSON_ERROR_RECURSION, CONST_PERSISTENT);
78 	REGISTER_LONG_CONSTANT("JSON_ERROR_INF_OR_NAN", PHP_JSON_ERROR_INF_OR_NAN, CONST_PERSISTENT);
79 	REGISTER_LONG_CONSTANT("JSON_ERROR_UNSUPPORTED_TYPE", PHP_JSON_ERROR_UNSUPPORTED_TYPE, CONST_PERSISTENT);
80 	REGISTER_LONG_CONSTANT("JSON_ERROR_INVALID_PROPERTY_NAME", PHP_JSON_ERROR_INVALID_PROPERTY_NAME, CONST_PERSISTENT);
81 	REGISTER_LONG_CONSTANT("JSON_ERROR_UTF16", PHP_JSON_ERROR_UTF16, CONST_PERSISTENT);
82 	REGISTER_LONG_CONSTANT("JSON_ERROR_NON_BACKED_ENUM", PHP_JSON_ERROR_NON_BACKED_ENUM, CONST_PERSISTENT);
83 }
84 
register_class_JsonSerializable(void)85 static zend_class_entry *register_class_JsonSerializable(void)
86 {
87 	zend_class_entry ce, *class_entry;
88 
89 	INIT_CLASS_ENTRY(ce, "JsonSerializable", class_JsonSerializable_methods);
90 	class_entry = zend_register_internal_interface(&ce);
91 
92 	return class_entry;
93 }
94 
register_class_JsonException(zend_class_entry * class_entry_Exception)95 static zend_class_entry *register_class_JsonException(zend_class_entry *class_entry_Exception)
96 {
97 	zend_class_entry ce, *class_entry;
98 
99 	INIT_CLASS_ENTRY(ce, "JsonException", NULL);
100 	class_entry = zend_register_internal_class_with_flags(&ce, class_entry_Exception, 0);
101 
102 	return class_entry;
103 }
104