Lines Matching +full:default +full:- +full:state
10 * See the COPYING.LIB file in the top-level directory.
16 #include "qobject/json-parser.h"
17 #include "qobject/json-writer.h"
36 assert(!s->result || !s->err); in consume_json()
38 if (s->result) { in consume_json()
39 qobject_unref(s->result); in consume_json()
40 s->result = NULL; in consume_json()
41 error_setg(&s->err, "Expecting at most one JSON value"); in consume_json()
43 if (s->err) { in consume_json()
48 s->result = json; in consume_json()
49 s->err = err; in consume_json()
54 * If @ap is non-null, interpolate %-escapes.
65 JSONParsingState state = {}; in qobject_from_jsonv() local
67 json_message_parser_init(&state.parser, consume_json, &state, ap); in qobject_from_jsonv()
68 json_message_parser_feed(&state.parser, string, strlen(string)); in qobject_from_jsonv()
69 json_message_parser_flush(&state.parser); in qobject_from_jsonv()
70 json_message_parser_destroy(&state.parser); in qobject_from_jsonv()
72 if (!state.result && !state.err) { in qobject_from_jsonv()
73 error_setg(&state.err, "Expecting a JSON value"); in qobject_from_jsonv()
76 error_propagate(errp, state.err); in qobject_from_jsonv()
77 return state.result; in qobject_from_jsonv()
86 * Parse @string as JSON value with %-escapes interpolated.
105 * Parse @string as JSON value with %-escapes interpolated.
122 * Parse @string as JSON object with %-escapes interpolated.
136 * Parse @string as JSON object with %-escapes interpolated.
161 switch (val->kind) { in to_json()
163 json_writer_int64(writer, name, val->u.i64); in to_json()
166 json_writer_uint64(writer, name, val->u.u64); in to_json()
169 json_writer_double(writer, name, val->u.dbl); in to_json()
171 default: in to_json()
216 default: in to_json()