jsmn#
Defines
-
JSMN_API#
Typedefs
-
typedef struct jsmntok jsmntok_t#
JSON token description. type type (object, array, string etc.) start start position in JSON data string end end position in JSON data string
-
typedef struct jsmn_parser jsmn_parser#
JSON parser. Contains an array of token blocks available. Also stores the string being parsed now and current position in that string.
Enums
Functions
-
void jsmn_init(jsmn_parser *parser)#
Create JSON parser over an array of tokens
Creates a new parser based over a given buffer with an array of tokens available.
-
int jsmn_parse(jsmn_parser *parser, const char *js, const size_t len, jsmntok_t *tokens, const unsigned int num_tokens)#
Run JSON parser. It parses a JSON data string into and array of tokens, each describing a single JSON object.
Parse JSON string and fill tokens.
-
static jsmntok_t *jsmn_alloc_token(jsmn_parser *parser, jsmntok_t *tokens, const size_t num_tokens)#
Allocates a fresh unused token from the token pool.
-
static void jsmn_fill_token(jsmntok_t *token, const jsmntype_t type, const int start, const int end)#
Fills token type and boundaries.
-
static int jsmn_parse_primitive(jsmn_parser *parser, const char *js, const size_t len, jsmntok_t *tokens, const size_t num_tokens)#
Fills next available token with JSON primitive.
-
static int jsmn_parse_string(jsmn_parser *parser, const char *js, const size_t len, jsmntok_t *tokens, const size_t num_tokens)#
Fills next token with JSON string.
-
struct jsmntok#
- #include <jsmn.h>
JSON token description. type type (object, array, string etc.) start start position in JSON data string end end position in JSON data string
-
struct jsmn_parser
- #include <jsmn.h>
JSON parser. Contains an array of token blocks available. Also stores the string being parsed now and current position in that string.