2 * JSON streaming support
4 * Copyright IBM, Corp. 2009
7 * Anthony Liguori <aliguori@us.ibm.com>
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 QEMU_JSON_STREAMER_H
15 #define QEMU_JSON_STREAMER_H
17 #include "qapi/qmp/json-lexer.h"
19 typedef struct JSONToken
{
26 typedef struct JSONMessageParser
28 void (*emit
)(struct JSONMessageParser
*parser
, GQueue
*tokens
);
36 void json_message_parser_init(JSONMessageParser
*parser
,
37 void (*func
)(JSONMessageParser
*, GQueue
*));
39 int json_message_parser_feed(JSONMessageParser
*parser
,
40 const char *buffer
, size_t size
);
42 int json_message_parser_flush(JSONMessageParser
*parser
);
44 void json_message_parser_destroy(JSONMessageParser
*parser
);