TI J721E Imaging User Guide
jsmn.h File Reference

Introduction

A template header for a generic file.

This comment block is intended to be used as a template for all code files. This format should be used for all file header comment blocks.

Go to the source code of this file.

Data Structures

struct  jsmntok_t
 
struct  jsmn_parser
 

Macros

#define JSMN_API   extern
 

Enumerations

enum  jsmntype_t {
  JSMN_UNDEFINED = 0, JSMN_OBJECT = 1 << 0, JSMN_ARRAY = 1 << 1, JSMN_STRING = 1 << 2,
  JSMN_PRIMITIVE = 1 << 3
}
 
enum  jsmnerr { JSMN_ERROR_NOMEM = -1, JSMN_ERROR_INVAL = -2, JSMN_ERROR_PART = -3 }
 

Functions

JSMN_API void jsmn_init (jsmn_parser *parser)
 
JSMN_API int jsmn_parse (jsmn_parser *parser, const char *js, const size_t len, jsmntok_t *tokens, const unsigned int num_tokens)
 
static jsmntok_tjsmn_alloc_token (jsmn_parser *parser, jsmntok_t *tokens, const size_t num_tokens)
 
static void jsmn_fill_token (jsmntok_t *token, const jsmntype_t type, const int start, const int end)
 
static int jsmn_parse_primitive (jsmn_parser *parser, const char *js, const size_t len, jsmntok_t *tokens, const size_t num_tokens)
 
static int jsmn_parse_string (jsmn_parser *parser, const char *js, const size_t len, jsmntok_t *tokens, const size_t num_tokens)
 

Macro Definition Documentation

◆ JSMN_API

#define JSMN_API   extern

Enumeration Type Documentation

◆ jsmntype_t

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_UNDEFINED 
JSMN_OBJECT 
JSMN_ARRAY 
JSMN_STRING 
JSMN_PRIMITIVE 

◆ jsmnerr

enum jsmnerr
Enumerator
JSMN_ERROR_NOMEM 
JSMN_ERROR_INVAL 
JSMN_ERROR_PART 

Function Documentation

◆ jsmn_init()

JSMN_API 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.

◆ jsmn_parse()

JSMN_API 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.

◆ jsmn_alloc_token()

static jsmntok_t* jsmn_alloc_token ( jsmn_parser parser,
jsmntok_t tokens,
const size_t  num_tokens 
)
static

Allocates a fresh unused token from the token pool.

◆ jsmn_fill_token()

static void jsmn_fill_token ( jsmntok_t token,
const jsmntype_t  type,
const int  start,
const int  end 
)
static

Fills token type and boundaries.

◆ jsmn_parse_primitive()

static int jsmn_parse_primitive ( jsmn_parser parser,
const char *  js,
const size_t  len,
jsmntok_t tokens,
const size_t  num_tokens 
)
static

Fills next available token with JSON primitive.

◆ jsmn_parse_string()

static int jsmn_parse_string ( jsmn_parser parser,
const char *  js,
const size_t  len,
jsmntok_t tokens,
const size_t  num_tokens 
)
static

Fills next token with JSON string.