4 //
\83C
\83\93\83N
\83\8b\81[
\83h
5 /////////////////////////////////////////////////////////////
12 /////////////////////////////////////////////////////////////
16 ///json
\89ð
\90Í
\83I
\83u
\83W
\83F
\83N
\83g
\83|
\83C
\83\93\83^
18 typedef struct jsonparser_t *JSONParser_P;
24 typedef wchar_t JSONChar;
27 ///json
\95¶
\8e\9a\97ñ
\83|
\83C
\83\93\83^
29 typedef JSONChar *JSONChar_P;
38 typedef intptr_t JSONInt;
39 typedef uintptr_t JSONUInt;
44 typedef double JSONDouble;
49 typedef JSONUInt JSONBool;
56 typedef void JSONVoid;
60 ///
\83R
\81[
\83\8b\83o
\83b
\83N
\83p
\83\89\81[
\83\81\81[
\83^
\8c^
62 typedef JSONUInt JSONParameter;
68 typedef JSONUInt JSONResult;
72 ///
\8d\
\91¢
\91Ì
\89ð
\90Í
\8e\9e\83R
\81[
\83\8b\83o
\83b
\83N
74 typedef JSONVoid (*JSONStructEventHandler)(JSONVoid *,JSONUInt,JSONUInt,JSONChar_P);
78 ///
\8d\
\91¢
\91Ì
\83f
\81[
\83^
\89ð
\90Í
\8e\9e\83R
\81[
\83\8b\83o
\83b
\83N
80 typedef JSONVoid (*JSONDataEventHandler)(JSONVoid *,JSONUInt,JSONUInt,JSONChar_P,JSONParameter);
83 ///
\8d\
\91¢
\91Ì
\8fI
\92[
\89ð
\90Í
\8e\9e\83R
\81[
\83\8b\83o
\83b
\83N
85 typedef JSONVoid (*JSONStructEndEventHandler)(JSONVoid *,JSONUInt,JSONUInt,JSONChar_P);
94 /////////////////////////////////////////////////////////////////////////
101 #define JSON_ERR_OK ((JSONResult)0)
103 ///
\8ew
\92è
\82µ
\82½
\83G
\83\93\83R
\81[
\83h
\83^
\83C
\83v
\82ª
\92è
\8b`
\82³
\82ê
\82Ä
\82¢
\82È
\82¢
104 #define JSON_ERR_ENCODE_UNKNOWN ((JSONResult)1)
106 ///json
\8d\
\95¶
\83G
\83\89\81[
107 #define JSON_ERR_SYNTAX ((JSONResult)2)
109 ///
\95Ï
\8a·
\83G
\83\89\81[
110 #define JSON_ERR_CONVERT ((JSONResult)3)
114 ///rslt
\82ª
\8f\89\8aú
\89»
\82³
\82ê
\82Ä
\82¢
\82È
\82¢
115 #define JSON_ERR_NOTINIT ((JSONResult)UINTPTR_MAX)
128 //
\83G
\83\93\83R
\81[
\83h
\83\82\81[
\83h
129 //
\8c»
\8dÝ
\82ÍUTF8
\82Ì
\82Ý
132 #define JSON_ENCODE_UTF8 ((JSONParameter)0)
142 #define JSONTrue ((JSONBool)1)
146 #define JSONFalse ((JSONBool)0)
154 #define JSONTypeRoot ((JSONUInt)0)
156 ///
\83I
\83u
\83W
\83F
\83N
\83g
157 #define JSONTypeObject ((JSONUInt)1)
160 #define JSONTypeArray ((JSONUInt)2)
163 #define JSONTypeBool ((JSONUInt)3)
166 #define JSONTypeString ((JSONUInt)4)
169 #define JSONTypeDecimal ((JSONUInt)5)
172 #define JSONNull ((JSONUInt)6)
183 //////////////////////////////////////////////////////////////////////////
192 ///
\83p
\81[
\83T
\83I
\83u
\83W
\83F
\83N
\83g
\90¶
\90¬
194 extern JSONParser_P JSONParser_new();
197 ///
\83p
\81[
\83T
\83I
\83u
\83W
\83F
\83N
\83g
\94j
\8aü
199 extern JSONVoid JSONParser_delete(JSONParser_P *parser);
202 ///
\8d\
\91¢
\91Ì
\83C
\83x
\83\93\83g
\83n
\83\93\83h
\83\89
204 extern JSONVoid JSONParser_setStructHandler(JSONParser_P parser,JSONStructEventHandler handler);
207 ///
\83I
\83u
\83W
\83F
\83N
\83g
\83C
\83x
\83\93\83g
\83n
\83\93\83h
\83\89\82ð
\83Z
\83b
\83g
209 extern JSONVoid JSONParser_setDataEventHandler(JSONParser_P parser,JSONDataEventHandler handler);
214 ///
\83I
\83u
\83W
\83F
\83N
\83g
\8fI
\92[
\83C
\83x
\83\93\83g
\83n
\83\93\83h
\83\89\82ð
\83Z
\83b
\83g
216 extern JSONVoid JSONParser_setDataEndEventHandler(JSONParser_P parser,JSONStructEndEventHandler handler);
220 ///
\83I
\83u
\83W
\83F
\83N
\83g
\8aJ
\8en
\81E
\8fI
\92[
\83n
\83\93\83h
\83\89\82ð
\83Z
\83b
\83g
222 extern JSONVoid JSONParser_setEventHandler(JSONParser_P parser,JSONStructEventHandler structHandler,JSONDataEventHandler dataHandler,JSONStructEndEventHandler endHandler);
228 extern JSONResult JSONParser_Parse(JSONParser_P parser,const JSONVoid *jsontext,JSONParameter encode,JSONVoid *option);