mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 12:23:53 -06:00
qapi: qapi-types.py, native list support
Teach type generators about native types so they can generate the appropriate linked list types. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Amos Kong <akong@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
parent
95de21a430
commit
c0afa9c5f7
2 changed files with 65 additions and 3 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue