diff options
author | Evgeny Vereshchagin <evvers@ya.ru> | 2017-04-25 16:10:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-25 16:10:15 +0300 |
commit | d5d5e06086734f6406b3ccc522c4951cdc18ca21 (patch) | |
tree | 55cc62ab712a9ef82600cafbc8755c589f49d71f /src/basic/generate-gperfs.py | |
parent | caf222104afe2d12f3a188a6bfee3a35f2d04fc6 (diff) | |
parent | d730e2d16452d522d3b130071847b75198f42c45 (diff) |
Merge pull request #5704 from keszybz/meson
meson: build systemd using meson
Diffstat (limited to 'src/basic/generate-gperfs.py')
-rw-r--r-- | src/basic/generate-gperfs.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/basic/generate-gperfs.py b/src/basic/generate-gperfs.py new file mode 100644 index 0000000000..2e7d8931dd --- /dev/null +++ b/src/basic/generate-gperfs.py @@ -0,0 +1,16 @@ +#!/usr/bin/python3 + +"""Generate %-from-name.gperf from %-list.txt +""" + +import sys + +name, prefix, input = sys.argv[1:] + +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)) |