File: name.sh

package info (click to toggle)
input-utils 1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 348 kB
  • sloc: ansic: 1,217; sh: 37; makefile: 7
file content (22 lines) | stat: -rwxr-xr-x 474 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

TYPE="$1"
if test -f "/usr/include/linux/input-event-codes.h" -a "$TYPE" != "BUS"; then
	INPUT="/usr/include/linux/input-event-codes.h"
else
	INPUT="/usr/include/linux/input.h"
fi

awk "
	/KEY_MIN_INTERESTING/	{next};
	/EV_VERSION/	{ next };
	/_MAX/		{ next };
	/_CNT/		{ next };
	/#define $1_/	{ 
		name = \$2;
                if (\"$TYPE\" != \"BTN\") {
			sub(\"^${TYPE}_\", \"\", name);
		}
		printf(\"\t[ %-16s ] = \\\"%s\\\",\n\", \$2, name);
	}
" < $INPUT