diff options
Diffstat (limited to 'src/tools/vppapigen/vppapigen_c.py')
-rw-r--r-- | src/tools/vppapigen/vppapigen_c.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/tools/vppapigen/vppapigen_c.py b/src/tools/vppapigen/vppapigen_c.py index b56e0722122..2a66ff3159e 100644 --- a/src/tools/vppapigen/vppapigen_c.py +++ b/src/tools/vppapigen/vppapigen_c.py @@ -94,7 +94,7 @@ def duplicate_wrapper_tail(): return '#endif\n\n' -def typedefs(objs, filename): +def typedefs(objs, aliases, filename): name = filename.replace('.', '_') output = '''\ @@ -106,6 +106,15 @@ def typedefs(objs, filename): #define included_{module} ''' output = output.format(module=name) + + for k, v in aliases.items(): + output += duplicate_wrapper_head(k) + if 'length' in v: + output += 'typedef %s vl_api_%s_t[%s];\n' % (v['type'], k, v['length']) + else: + output += 'typedef %s vl_api_%s_t;\n' % (v['type'], k) + output += duplicate_wrapper_tail() + for o in objs: tname = o.__class__.__name__ output += duplicate_wrapper_head(o.name) @@ -276,7 +285,7 @@ def run(input_filename, s, file_crc): output += msg_ids(s) output += msg_names(s) output += msg_name_crc_list(s, filename) - output += typedefs(s['types'] + s['Define'], filename + file_extension) + output += typedefs(s['types'] + s['Define'], s['Alias'], filename + file_extension) output += printfun(s['types'] + s['Define']) output += endianfun(s['types'] + s['Define']) output += version_tuple(s, basename) |