]> git.ipfire.org Git - thirdparty/systemd.git/blame - tools/generate-gperfs.py
test-network: use wait-online in NetworkdBondTests
[thirdparty/systemd.git] / tools / generate-gperfs.py
CommitLineData
3e67e5c9 1#!/usr/bin/env python3
87421ff5 2# SPDX-License-Identifier: LGPL-2.1+
5c23128d 3
87421ff5
YW
4"""
5Generate %-from-name.gperf from %-list.txt
5c23128d
ZJS
6"""
7
8import sys
9
10name, prefix, input = sys.argv[1:]
11
4831981d
SL
12print("""\
13%{
14#if __GNUC__ >= 7
15_Pragma("GCC diagnostic ignored \\"-Wimplicit-fallthrough\\"")
16#endif
17%}""")
5c23128d
ZJS
18print("""\
19struct {}_name {{ const char* name; int id; }};
20%null-strings
21%%""".format(name))
22
23for line in open(input):
24 print("{0}, {1}{0}".format(line.rstrip(), prefix))