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_LEXER_H
15 #define QEMU_JSON_LEXER_H
17 #include "qapi/qmp/qstring.h"
18 #include "qapi/qmp/qlist.h"
20 typedef enum json_token_type
{
31 typedef struct JSONLexer JSONLexer
;
33 typedef void (JSONLexerEmitter
)(JSONLexer
*, QString
*, JSONTokenType
, int x
, int y
);
37 JSONLexerEmitter
*emit
;
43 void json_lexer_init(JSONLexer
*lexer
, JSONLexerEmitter func
);
45 int json_lexer_feed(JSONLexer
*lexer
, const char *buffer
, size_t size
);
47 int json_lexer_flush(JSONLexer
*lexer
);
49 void json_lexer_destroy(JSONLexer
*lexer
);