6947f12d4673c951898d3e95ebb880273c01943e
[vpp.git] / src / tools / vppapigen / vppapigen_crc.py
1 # CRC generation
2 import json
3
4 process_imports = True
5
6
7 #
8 # Plugin entry point
9 #
10 def run(args, input_filename, s):
11     j = {}
12     major = 0
13     if 'version' in s['Option']:
14         v = s['Option']['version']
15         (major, minor, patch) = v.split('.')
16     for t in s['Define']:
17         j[t.name] = {'crc': f'{t.crc:#08x}', 'version': major,
18                      'options': t.options}
19     return json.dumps(j, indent=4, separators=(',', ': '))