Microchip® Advanced Software Framework

jsmn.h File Reference

Definition of the JSMN (Jasmine) JSON parser.

For more information on JSMN:

See Also
http://zserge.com/jsmn.html
#include <stddef.h>

Data Structures

struct  jsmn_parser
 JSON parser. More...
 
struct  jsmntok_t
 JSON token description. More...
 

Macros

#define JSMN_STRICT
 

Enumerations

enum  jsmnerr_t {
  JSMN_ERROR_NOMEM = -1,
  JSMN_ERROR_INVAL = -2,
  JSMN_ERROR_PART = -3
}
 
enum  jsmntype_t {
  JSMN_PRIMITIVE = 0,
  JSMN_OBJECT = 1,
  JSMN_ARRAY = 2,
  JSMN_STRING = 3
}
 JSON type identifier. More...
 

Functions

void jsmn_init (jsmn_parser *parser)
 Create JSON parser over an array of tokens. More...
 
jsmnerr_t jsmn_parse (jsmn_parser *parser, const char *js, size_t len, jsmntok_t *tokens, unsigned int num_tokens)
 Run JSON parser. More...
 

#define JSMN_STRICT

enum jsmnerr_t
Enumerator
JSMN_ERROR_NOMEM 
JSMN_ERROR_INVAL 
JSMN_ERROR_PART 
enum jsmntype_t

JSON type identifier.

Basic types are: o Object o Array o String o Other primitive: number, boolean (true/false) or null

Enumerator
JSMN_PRIMITIVE 
JSMN_OBJECT 
JSMN_ARRAY 
JSMN_STRING 

void jsmn_init ( jsmn_parser parser)

Create JSON parser over an array of tokens.

Create JSON parser over an array of tokens.

References jsmn_parser::pos, jsmn_parser::toknext, and jsmn_parser::toksuper.

Referenced by extractClientToken(), isJsonValidAndParse(), and isReceivedJsonValid().

jsmnerr_t jsmn_parse ( jsmn_parser parser,
const char *  js,
size_t  len,
jsmntok_t tokens,
unsigned int  num_tokens 
)