]>
Commit | Line | Data |
---|---|---|
3e67e5c9 | 1 | #!/usr/bin/env python3 |
5c23128d ZJS |
2 | |
3 | """Generate %-from-name.gperf from %-list.txt | |
4 | """ | |
5 | ||
6 | import sys | |
7 | ||
8 | name, prefix, input = sys.argv[1:] | |
9 | ||
10 | print("""\ | |
11 | struct {}_name {{ const char* name; int id; }}; | |
12 | %null-strings | |
13 | %%""".format(name)) | |
14 | ||
15 | for line in open(input): | |
16 | line = line.rstrip() | |
17 | s = line.replace('_', '-') | |
18 | print("{}, {}{}".format(s, prefix, line)) |