diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2013-05-23 14:16:34 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-05-23 14:16:35 -0500 |
commit | 64afc2b4d48fb21e085517c38a59a3f61a11283c (patch) | |
tree | bd5bb47861b2fa77d81d37dd684e1be46005ceec /scripts/qapi.py | |
parent | 95de21a430f7bc4166a153b1f69b1425c8a99c7b (diff) | |
parent | 70e098af88f79340d420992af526254866a42ddd (diff) | |
download | hqemu-64afc2b4d48fb21e085517c38a59a3f61a11283c.zip hqemu-64afc2b4d48fb21e085517c38a59a3f61a11283c.tar.gz |
Merge remote-tracking branch 'luiz/queue/qmp' into staging
# By Michael Roth (10) and others
# Via Luiz Capitulino
* luiz/queue/qmp:
monitor: allow to disable the default monitor
ui/input.c: replace magic numbers with macros
qapi: add native list coverage for QMP input visitor tests
qapi: add native list coverage for QMP output visitor tests
qapi: add native list coverage for visitor serialization tests
qapi: fix visitor serialization tests for numbers/doubles
qapi: add QMP input test for large integers
json-parser: fix handling of large whole number values
qapi: enable generation of native list code
qapi: qapi-visit.py, native list support
qapi: qapi-visit.py, fix list handling for union types
qapi: qapi-types.py, native list support
Message-id: 1369333232-24145-1-git-send-email-lcapitulino@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'scripts/qapi.py')
-rw-r--r-- | scripts/qapi.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/qapi.py b/scripts/qapi.py index afc5f32..02ad668 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -11,6 +11,12 @@ from ordereddict import OrderedDict +builtin_types = [ + 'str', 'int', 'number', 'bool', + 'int8', 'int16', 'int32', 'int64', + 'uint8', 'uint16', 'uint32', 'uint64' +] + def tokenize(data): while len(data): ch = data[0] @@ -242,3 +248,20 @@ def guardname(filename): for substr in [".", " ", "-"]: guard = guard.replace(substr, "_") return guard.upper() + '_H' + +def guardstart(name): + return mcgen(''' + +#ifndef %(name)s +#define %(name)s + +''', + name=guardname(name)) + +def guardend(name): + return mcgen(''' + +#endif /* %(name)s */ + +''', + name=guardname(name)) |