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
40 #ifdef JSMN_PARENT_LINKS
46 * JSON parser. Contains an array of token blocks available. Also stores
47 * the string being parsed now and current position in that string
50 unsigned int pos; /* offset in the JSON string */
51 int toknext; /* next token to allocate */
52 int toksuper; /* superior token node, e.g parent object or array */
56 * Create JSON parser over an array of tokens
58 void jsmn_init(jsmn_parser *parser);
61 * Run JSON parser. It parses a JSON data string into and array of tokens, each describing
62 * a single JSON object.
64 jsmnerr_t jsmn_parse(jsmn_parser *parser, const char *js,
65 jsmntok_t *tokens, unsigned int num_tokens);
67 #endif /* __JSMN_H_ */