|
@ -55,11 +55,6 @@ const jsmntok_t *json_get_member(const char *buffer, const jsmntok_t tok[], |
|
|
/* Get index'th array member. */ |
|
|
/* Get index'th array member. */ |
|
|
const jsmntok_t *json_get_arr(const jsmntok_t tok[], size_t index); |
|
|
const jsmntok_t *json_get_arr(const jsmntok_t tok[], size_t index); |
|
|
|
|
|
|
|
|
/* Guide is a string with . for members, [] around indexes. */ |
|
|
|
|
|
const jsmntok_t *json_delve(const char *buffer, |
|
|
|
|
|
const jsmntok_t *tok, |
|
|
|
|
|
const char *guide); |
|
|
|
|
|
|
|
|
|
|
|
/* If input is complete and valid, return tokens. */ |
|
|
/* If input is complete and valid, return tokens. */ |
|
|
jsmntok_t *json_parse_input(const char *input, int len, bool *valid); |
|
|
jsmntok_t *json_parse_input(const char *input, int len, bool *valid); |
|
|
|
|
|
|
|
@ -91,9 +86,6 @@ void json_add_escaped_string(struct json_result *result, |
|
|
void json_add_literal(struct json_result *result, const char *fieldname, |
|
|
void json_add_literal(struct json_result *result, const char *fieldname, |
|
|
const char *literal, int len); |
|
|
const char *literal, int len); |
|
|
/* '"fieldname" : value' or 'value' if fieldname is NULL */ |
|
|
/* '"fieldname" : value' or 'value' if fieldname is NULL */ |
|
|
void json_add_snum(struct json_result *result, const char *fieldname, |
|
|
|
|
|
int value); |
|
|
|
|
|
/* '"fieldname" : value' or 'value' if fieldname is NULL */ |
|
|
|
|
|
void json_add_double(struct json_result *result, const char *fieldname, |
|
|
void json_add_double(struct json_result *result, const char *fieldname, |
|
|
double value); |
|
|
double value); |
|
|
/* '"fieldname" : value' or 'value' if fieldname is NULL */ |
|
|
/* '"fieldname" : value' or 'value' if fieldname is NULL */ |
|
@ -105,8 +97,6 @@ void json_add_u64(struct json_result *result, const char *fieldname, |
|
|
/* '"fieldname" : true|false' or 'true|false' if fieldname is NULL */ |
|
|
/* '"fieldname" : true|false' or 'true|false' if fieldname is NULL */ |
|
|
void json_add_bool(struct json_result *result, const char *fieldname, |
|
|
void json_add_bool(struct json_result *result, const char *fieldname, |
|
|
bool value); |
|
|
bool value); |
|
|
/* '"fieldname" : null' or 'null' if fieldname is NULL */ |
|
|
|
|
|
void json_add_null(struct json_result *result, const char *fieldname); |
|
|
|
|
|
/* '"fieldname" : "0189abcdef..."' or "0189abcdef..." if fieldname is NULL */ |
|
|
/* '"fieldname" : "0189abcdef..."' or "0189abcdef..." if fieldname is NULL */ |
|
|
void json_add_hex(struct json_result *result, const char *fieldname, |
|
|
void json_add_hex(struct json_result *result, const char *fieldname, |
|
|
const void *data, size_t len); |
|
|
const void *data, size_t len); |
|
|