Debian Codegraph @

src/udev/generate-keyboard-keys-gperf.sh

raw
1 #!/bin/sh
2 # SPDX-License-Identifier: LGPL-2.1-or-later
3 set -eu
4
5 # shellcheck disable=SC1004
6 awk '
7 BEGIN {
8 print "%{\n\
9 _Pragma(\"GCC diagnostic ignored \\\"-Wimplicit-fallthrough\\\"\")\n\
10 #if __GNUC__ >= 15\n\
11 _Pragma(\"GCC diagnostic ignored \\\"-Wzero-as-null-pointer-constant\\\"\")\n\
12 #endif\n\
13 #include <linux/input.h>\n\
14 %}"
15 print "struct key_name { const char* name; unsigned short id; };"
16 print "%null-strings"
17 print "%%"
18 }
19
20 /^KEY_/ { print tolower(substr($1 ,5)) ", " $1 }
21 { print tolower($1) ", " $1 }
22 ' <"${1:?}"