diff options
author | 2018-11-28 20:19:41 +0900 | |
---|---|---|
committer | 2018-11-28 20:19:41 +0900 | |
commit | 6ec439fd4b93ecb660b7cc8bc15f8a59ecc530bd (patch) | |
tree | 570ca5d2adf369c6441ac6deada4ea1b2b5f5610 /tools | |
parent | tree-wide: more IOVEC_MAKE() conversions (diff) | |
download | systemd-6ec439fd4b93ecb660b7cc8bc15f8a59ecc530bd.tar.gz systemd-6ec439fd4b93ecb660b7cc8bc15f8a59ecc530bd.tar.bz2 systemd-6ec439fd4b93ecb660b7cc8bc15f8a59ecc530bd.zip |
tools: move generate-gperfs.py to tools/
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/generate-gperfs.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/generate-gperfs.py b/tools/generate-gperfs.py new file mode 100755 index 000000000..aca9ab1fe --- /dev/null +++ b/tools/generate-gperfs.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 + +"""Generate %-from-name.gperf from %-list.txt +""" + +import sys + +name, prefix, input = sys.argv[1:] + +print("""\ +%{ +#if __GNUC__ >= 7 +_Pragma("GCC diagnostic ignored \\"-Wimplicit-fallthrough\\"") +#endif +%}""") +print("""\ +struct {}_name {{ const char* name; int id; }}; +%null-strings +%%""".format(name)) + +for line in open(input): + print("{0}, {1}{0}".format(line.rstrip(), prefix)) |