5 * JSON type identifier. Basic types are:
9 * o Other primitive: number, boolean (true/false) or null
19 /* Not enough tokens were provided */
20 JSMN_ERROR_NOMEM
= -1,
21 /* Invalid character inside JSON string */
22 JSMN_ERROR_INVAL
= -2,
23 /* The string is not a full JSON packet, more bytes expected */
25 /* Everything was fine */
30 * JSON token description.
31 * @param type type (object, array, string etc.)
32 * @param start start position in JSON data string
33 * @param end end position in JSON data string
43 * JSON parser. Contains an array of token blocks available. Also stores
44 * the string being parsed now and current position in that string
47 unsigned int pos
; /* offset in the JSON string */
48 int toknext
; /* next token to allocate */
49 int toksuper
; /* superior token node, e.g parent object or array */
53 * Create JSON parser over an array of tokens
55 void jsmn_init(jsmn_parser
*parser
);
58 * Run JSON parser. It parses a JSON data string into and array of tokens,
59 * each describing a single JSON object.
61 jsmnerr_t
jsmn_parse(jsmn_parser
*parser
, const char *js
,
63 jsmntok_t
*tokens
, unsigned int num_tokens
);
65 const char *jsmn_strerror(jsmnerr_t err
);
67 #endif /* __JSMN_H_ */