GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
Macros | Enumerations | Functions
gp_json_common.h File Reference

Common JSON reader/writer definitions. More...

Go to the source code of this file.

Macros

#define GP_JSON_ERR_MAX   128
 Maximal error message length.
 
#define GP_JSON_ID_MAX   64
 Maximal id string lenght including terminating null element.
 
#define GP_JSON_RECURSION_MAX   128
 Maximal recursion depth allowed.
 

Enumerations

enum  gp_json_type {
  GP_JSON_VOID = 0 , GP_JSON_INT , GP_JSON_FLOAT , GP_JSON_BOOL ,
  GP_JSON_NULL , GP_JSON_STR , GP_JSON_OBJ , GP_JSON_ARR
}
 A JSON data type. More...
 

Functions

const char * gp_json_type_name (enum gp_json_type type)
 Returns type name.
 
void gp_json_err_handler (void *print_priv, const char *line)
 Default error print handler.
 

Detailed Description

Common JSON reader/writer definitions.

Definition in file gp_json_common.h.

Enumeration Type Documentation

◆ gp_json_type

A JSON data type.

Enumerator
GP_JSON_VOID 

No type. Returned when parser finishes.

GP_JSON_INT 

An integer.

GP_JSON_FLOAT 

A floating point.

GP_JSON_BOOL 

A boolean.

GP_JSON_NULL 

NULL.

GP_JSON_STR 

A string.

GP_JSON_OBJ 

A JSON object.

GP_JSON_ARR 

A JSON array.

Definition at line 27 of file gp_json_common.h.

Function Documentation

◆ gp_json_err_handler()

void gp_json_err_handler ( void *  print_priv,
const char *  line 
)

Default error print handler.

Parameters
print_privA json buffer print_priv pointer.
lineA line to be printed.

◆ gp_json_type_name()

const char * gp_json_type_name ( enum gp_json_type  type)

Returns type name.

Parameters
typeA json type.
Returns
A type name.