MeterLogger
Data Structures | Macros | Functions
jsonparse.h File Reference
#include "c_types.h"
#include "json/json.h"
Include dependency graph for jsonparse.h:

Go to the source code of this file.

Data Structures

struct  jsonparse_state
 

Macros

#define JSONPARSE_MAX_DEPTH   10
 

Functions

void jsonparse_setup (struct jsonparse_state *state, const char *json, int len)
 Initialize a JSON parser state. More...
 
int jsonparse_next (struct jsonparse_state *state)
 
int jsonparse_copy_value (struct jsonparse_state *state, char *buf, int buf_size)
 
int jsonparse_get_value_as_int (struct jsonparse_state *state)
 
long jsonparse_get_value_as_long (struct jsonparse_state *state)
 
unsigned long jsonparse_get_value_as_ulong (struct jsonparse_state *state)
 
int jsonparse_get_len (struct jsonparse_state *state)
 
int jsonparse_get_type (struct jsonparse_state *state)
 
int jsonparse_strcmp_value (struct jsonparse_state *state, const char *str)
 

Macro Definition Documentation

◆ JSONPARSE_MAX_DEPTH

#define JSONPARSE_MAX_DEPTH   10

Definition at line 41 of file jsonparse.h.

Function Documentation

◆ jsonparse_copy_value()

int jsonparse_copy_value ( struct jsonparse_state state,
char *  buf,
int  buf_size 
)

◆ jsonparse_get_len()

int jsonparse_get_len ( struct jsonparse_state state)

◆ jsonparse_get_type()

int jsonparse_get_type ( struct jsonparse_state state)

◆ jsonparse_get_value_as_int()

int jsonparse_get_value_as_int ( struct jsonparse_state state)

◆ jsonparse_get_value_as_long()

long jsonparse_get_value_as_long ( struct jsonparse_state state)

◆ jsonparse_get_value_as_ulong()

unsigned long jsonparse_get_value_as_ulong ( struct jsonparse_state state)

◆ jsonparse_next()

int jsonparse_next ( struct jsonparse_state state)

◆ jsonparse_setup()

void jsonparse_setup ( struct jsonparse_state state,
const char *  json,
int  len 
)

Initialize a JSON parser state.

Parameters
stateA pointer to a JSON parser state
jsonThe string to parse as JSON
lenThe length of the string to parse
        This function initializes a JSON parser state for
        parsing a string as JSON.

◆ jsonparse_strcmp_value()

int jsonparse_strcmp_value ( struct jsonparse_state state,
const char *  str 
)