From 0d60175bd684cf6a14f750579d82dbd1ba97fcbc Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Wed, 6 Mar 2013 01:11:59 -0800 Subject: contrib/qemu: Import qemu block source code This qemu block format source code and its minimal dependency files will be used in the next patch to implement a qemu-block format translator. Change-Id: Ic87638972f7ea9b3df84d7a0539512a250c11c1c BUG: 986775 Signed-off-by: Anand Avati Reviewed-on: http://review.gluster.org/5366 Tested-by: Gluster Build System Reviewed-by: Brian Foster --- contrib/qemu/include/qapi/qmp/json-streamer.h | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 contrib/qemu/include/qapi/qmp/json-streamer.h (limited to 'contrib/qemu/include/qapi/qmp/json-streamer.h') diff --git a/contrib/qemu/include/qapi/qmp/json-streamer.h b/contrib/qemu/include/qapi/qmp/json-streamer.h new file mode 100644 index 000000000..823f7d7fa --- /dev/null +++ b/contrib/qemu/include/qapi/qmp/json-streamer.h @@ -0,0 +1,40 @@ +/* + * JSON streaming support + * + * Copyright IBM, Corp. 2009 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. + * See the COPYING.LIB file in the top-level directory. + * + */ + +#ifndef QEMU_JSON_STREAMER_H +#define QEMU_JSON_STREAMER_H + +#include "qapi/qmp/qlist.h" +#include "qapi/qmp/json-lexer.h" + +typedef struct JSONMessageParser +{ + void (*emit)(struct JSONMessageParser *parser, QList *tokens); + JSONLexer lexer; + int brace_count; + int bracket_count; + QList *tokens; + uint64_t token_size; +} JSONMessageParser; + +void json_message_parser_init(JSONMessageParser *parser, + void (*func)(JSONMessageParser *, QList *)); + +int json_message_parser_feed(JSONMessageParser *parser, + const char *buffer, size_t size); + +int json_message_parser_flush(JSONMessageParser *parser); + +void json_message_parser_destroy(JSONMessageParser *parser); + +#endif -- cgit