Dumb-ways-to-memorize
2D game
|
#include "jsmn.h"
Go to the source code of this file.
Functions | |
static jsmntok_t * | jsmn_alloc_token (jsmn_parser *parser, jsmntok_t *tokens, size_t num_tokens) |
static void | jsmn_fill_token (jsmntok_t *token, jsmntype_t type, int start, int end) |
static int | jsmn_parse_primitive (jsmn_parser *parser, const char *js, size_t len, jsmntok_t *tokens, size_t num_tokens) |
static int | jsmn_parse_string (jsmn_parser *parser, const char *js, size_t len, jsmntok_t *tokens, size_t num_tokens) |
int | jsmn_parse (jsmn_parser *parser, const char *js, size_t len, jsmntok_t *tokens, unsigned int num_tokens) |
void | jsmn_init (jsmn_parser *parser) |
|
static |
Allocates a fresh unused token from the token pull.
Definition at line 6 of file jsmn.c.
References jsmntok_t::end, jsmntok_t::size, jsmntok_t::start, and jsmn_parser::toknext.
Referenced by jsmn_parse(), jsmn_parse_primitive(), and jsmn_parse_string().
|
static |
Fills token type and boundaries.
Definition at line 24 of file jsmn.c.
References jsmntok_t::end, jsmntok_t::size, jsmntok_t::start, and jsmntok_t::type.
Referenced by jsmn_parse_primitive(), and jsmn_parse_string().
void jsmn_init | ( | jsmn_parser * | parser | ) |
Creates a new parser based over a given buffer with an array of tokens available.
Definition at line 306 of file jsmn.c.
References jsmn_parser::pos, jsmn_parser::toknext, and jsmn_parser::toksuper.
Referenced by ConvertFileToUseable().
int jsmn_parse | ( | jsmn_parser * | parser, |
const char * | js, | ||
size_t | len, | ||
jsmntok_t * | tokens, | ||
unsigned int | num_tokens | ||
) |
Parse JSON string and fill tokens.
Definition at line 151 of file jsmn.c.
References jsmntok_t::end, jsmn_alloc_token(), JSMN_ARRAY, JSMN_ERROR_INVAL, JSMN_ERROR_NOMEM, JSMN_ERROR_PART, JSMN_OBJECT, jsmn_parse_primitive(), jsmn_parse_string(), JSMN_STRING, jsmn_parser::pos, jsmntok_t::size, jsmntok_t::start, jsmn_parser::toknext, jsmn_parser::toksuper, and jsmntok_t::type.
Referenced by ConvertFileToUseable().
|
static |
Fills next available token with JSON primitive.
Definition at line 35 of file jsmn.c.
References jsmn_alloc_token(), JSMN_ERROR_INVAL, JSMN_ERROR_NOMEM, JSMN_ERROR_PART, jsmn_fill_token(), JSMN_PRIMITIVE, jsmn_parser::pos, and jsmn_parser::toksuper.
Referenced by jsmn_parse().
|
static |
Fills next token with JSON string.
Definition at line 84 of file jsmn.c.
References jsmn_alloc_token(), JSMN_ERROR_INVAL, JSMN_ERROR_NOMEM, JSMN_ERROR_PART, jsmn_fill_token(), JSMN_STRING, jsmn_parser::pos, and jsmn_parser::toksuper.
Referenced by jsmn_parse().