6 #define JSMN_PARENT_LINKS
13 * JSON type identifier. Basic types are:
17 * o Other primitive: number, boolean (true/false) or null
27 /* Not enough tokens were provided */
28 JSMN_ERROR_NOMEM = -1,
29 /* Invalid character inside JSON string */
30 JSMN_ERROR_INVAL = -2,
31 /* The string is not a full JSON packet, more bytes expected */
36 * JSON token description.
37 * @param type type (object, array, string etc.)
38 * @param start start position in JSON data string
39 * @param end end position in JSON data string
46 #ifdef JSMN_PARENT_LINKS
52 * JSON parser. Contains an array of token blocks available. Also stores
53 * the string being parsed now and current position in that string
56 unsigned int pos; /* offset in the JSON string */
57 unsigned int toknext; /* next token to allocate */
58 int toksuper; /* superior token node, e.g parent object or array */
62 * Create JSON parser over an array of tokens
64 void jsmn_init(jsmn_parser huge *parser);
67 * Run JSON parser. It parses a JSON data string into and array of tokens, each describing
68 * a single JSON object.
70 jsmnerr_t jsmn_parse(jsmn_parser huge *parser, const char huge *js, size_t len,
71 jsmntok_t huge *tokens, unsigned int num_tokens);
77 #endif /* __FARJSMN_H_ */