static int node(struct cql_node *cn, void(*pr)(const char *buf, void *client_data), void *client_data)
struct json_parser_s * json_parser_t
JSON parser (opaque)
void json_parser_destroy(json_parser_t p)
destroys JSON parser
const char * json_parser_get_errmsg(json_parser_t p)
returns parser error
void json_parser_subst(json_parser_t p, int idx, struct json_node *n)
configure subst rule
struct json_node * json_parser_parse(json_parser_t p, const char *json_str)
parses JSON string
void json_write_wrbuf(struct json_node *node, WRBUF result)
converts JSON tree to JSON string
void json_write_wrbuf_pretty(struct json_node *node, WRBUF result)
writes JSON tree with indentation (pretty print)
size_t json_parser_get_position(json_parser_t p)
returns parser position
struct json_node * json_parse(const char *json_str, const char **errmsg)
parses JSON string
struct json_node * json_parse2(const char *json_str, const char **errmsg, size_t *pos)
parses JSON string
int json_count_children(struct json_node *n)
returns number of children (array or object)
struct json_node * json_get_object(struct json_node *n, const char *name)
gets object pair value for some name
struct json_node * json_get_elem(struct json_node *n, int idx)
gets array element
void json_remove_node(struct json_node *n)
destroys JSON tree node and its children
struct json_node * json_detach_object(struct json_node *n, const char *name)
gets object value and detaches from existing tree
json_node_type
JSON node type for json_node.
json_parser_t json_parser_create(void)
create JSON parser
int json_append_array(struct json_node *dst, struct json_node *src)
appends array to another
struct json_node * link[2]
Header for WRBUF (growing buffer)