Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
API: Use string type instead of u8.
[vpp.git]
/
src
/
tools
/
vppapigen
/
vppapigen_json.py
diff --git
a/src/tools/vppapigen/vppapigen_json.py
b/src/tools/vppapigen/vppapigen_json.py
index
2991bec
..
a4707c0
100644
(file)
--- a/
src/tools/vppapigen/vppapigen_json.py
+++ b/
src/tools/vppapigen/vppapigen_json.py
@@
-32,19
+32,18
@@
def walk_defs(s):
d = []
d.append(t.name)
for b in t.block:
d = []
d.append(t.name)
for b in t.block:
- f = []
if b.type == 'Field':
if b.type == 'Field':
- f = [b.fieldtype, b.fieldname]
+ d.append([b.fieldtype, b.fieldname])
elif b.type == 'Array':
if b.lengthfield:
elif b.type == 'Array':
if b.lengthfield:
- f = [b.fieldtype, b.fieldname, b.length, b.lengthfield]
+ d.append([b.fieldtype, b.fieldname, b.length, b.lengthfield])
else:
else:
- f = [b.fieldtype, b.fieldname, b.length]
+ d.append([b.fieldtype, b.fieldname, b.length])
elif b.type == 'Union':
elif b.type == 'Union':
- p
rint('UNION')
+ p
ass
else:
raise ValueError("Error in processing array type %s" % b)
else:
raise ValueError("Error in processing array type %s" % b)
- d.append(f)
+
if t.crc:
c = {}
c['crc'] = "{0:#0{1}x}".format(t.crc, 10)
if t.crc:
c = {}
c['crc'] = "{0:#0{1}x}".format(t.crc, 10)
@@
-65,5
+64,6
@@
def run(filename, s, file_crc):
j['unions'] = walk_defs([o for o in s['types'] if o.__class__.__name__ == 'Union'])
j['enums'] = walk_enums([o for o in s['types'] if o.__class__.__name__ == 'Enum'])
j['services'] = walk_services(s['Service'])
j['unions'] = walk_defs([o for o in s['types'] if o.__class__.__name__ == 'Union'])
j['enums'] = walk_enums([o for o in s['types'] if o.__class__.__name__ == 'Enum'])
j['services'] = walk_services(s['Service'])
+ j['aliases'] = s['Alias']
j['vl_api_version'] = hex(file_crc)
return json.dumps(j, indent=4, separators=(',', ': '))
j['vl_api_version'] = hex(file_crc)
return json.dumps(j, indent=4, separators=(',', ': '))