PipeWire 0.3.77
Loading...
Searching...
No Matches
json.h File Reference

spa/utils/json.h More...

Go to the source code of this file.

Data Structures

struct  spa_json
 

Macros

#define SPA_JSON_INIT(data, size)   ((struct spa_json) { (data), (data)+(size), })
 
#define SPA_JSON_ENTER(iter)   ((struct spa_json) { (iter)->cur, (iter)->end, (iter), })
 
#define SPA_JSON_SAVE(iter)   ((struct spa_json) { (iter)->cur, (iter)->end, })
 
#define __PUT(c)   { if (len < size) *str++ = c; len++; }
 

Functions

static void spa_json_init (struct spa_json *iter, const char *data, size_t size)
 
static void spa_json_enter (struct spa_json *iter, struct spa_json *sub)
 
static int spa_json_next (struct spa_json *iter, const char **value)
 Get the next token. More...
 
static int spa_json_enter_container (struct spa_json *iter, struct spa_json *sub, char type)
 
static int spa_json_is_container (const char *val, int len)
 
static int spa_json_container_len (struct spa_json *iter, const char *value, int len)
 
static int spa_json_is_object (const char *val, int len)
 
static int spa_json_enter_object (struct spa_json *iter, struct spa_json *sub)
 
static bool spa_json_is_array (const char *val, int len)
 
static int spa_json_enter_array (struct spa_json *iter, struct spa_json *sub)
 
static bool spa_json_is_null (const char *val, int len)
 
static int spa_json_parse_float (const char *val, int len, float *result)
 
static bool spa_json_is_float (const char *val, int len)
 
static int spa_json_get_float (struct spa_json *iter, float *res)
 
static char * spa_json_format_float (char *str, int size, float val)
 
static int spa_json_parse_int (const char *val, int len, int *result)
 
static bool spa_json_is_int (const char *val, int len)
 
static int spa_json_get_int (struct spa_json *iter, int *res)
 
static bool spa_json_is_true (const char *val, int len)
 
static bool spa_json_is_false (const char *val, int len)
 
static bool spa_json_is_bool (const char *val, int len)
 
static int spa_json_parse_bool (const char *val, int len, bool *result)
 
static int spa_json_get_bool (struct spa_json *iter, bool *res)
 
static bool spa_json_is_string (const char *val, int len)
 
static int spa_json_parse_hex (const char *p, int num, uint32_t *res)
 
static int spa_json_parse_stringn (const char *val, int len, char *result, int maxlen)
 
static int spa_json_parse_string (const char *val, int len, char *result)
 
static int spa_json_get_string (struct spa_json *iter, char *res, int maxlen)
 
static int spa_json_encode_string (char *str, int size, const char *val)
 

Detailed Description

Macro Definition Documentation

◆ __PUT

#define __PUT (   c)    { if (len < size) *str++ = c; len++; }