4 * Copyright IBM, Corp. 2009
9 * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
10 * See the COPYING.LIB file in the top-level directory.
14 #ifndef QAPI_QMP_JSON_PARSER_H
15 #define QAPI_QMP_JSON_PARSER_H
17 typedef struct JSONLexer {
18 int start_state, state;
23 typedef struct JSONMessageParser {
24 void (*emit)(void *opaque, QObject *json, Error *err);
34 void json_message_parser_init(JSONMessageParser *parser,
35 void (*emit)(void *opaque, QObject *json,
37 void *opaque, va_list *ap);
39 void json_message_parser_feed(JSONMessageParser *parser,
40 const char *buffer, size_t size);
42 void json_message_parser_flush(JSONMessageParser *parser);
44 void json_message_parser_destroy(JSONMessageParser *parser);