2006-12-01 07:01:19 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
1997-03-23 18:51:21 +00:00
|
|
|
BEGIN {
|
|
|
|
nsig = 0;
|
|
|
|
j = 0;
|
|
|
|
print "/* This file was automatically generated */"
|
|
|
|
print "/* by the awk script \"sigconv.awk\". */\n"
|
|
|
|
print "struct sigdesc {"
|
|
|
|
print " char *name;"
|
|
|
|
print " int number;"
|
|
|
|
print "};\n"
|
|
|
|
print "struct sigdesc sigdesc[] = {"
|
|
|
|
}
|
|
|
|
|
2006-12-01 07:01:19 +00:00
|
|
|
/^#define[ \t][ \t]*SIG[A-Z]+[0-9]*[ \t]/ {
|
1997-03-23 18:51:21 +00:00
|
|
|
|
|
|
|
j = sprintf("%d", $3);
|
|
|
|
str = $2;
|
|
|
|
|
|
|
|
if (nsig < j)
|
|
|
|
nsig = j;
|
|
|
|
|
2006-12-01 07:01:19 +00:00
|
|
|
siglist[j] = sprintf("{ \"%s\",\t%2d },", \
|
1997-03-23 18:51:21 +00:00
|
|
|
substr(str, 4), j);
|
|
|
|
}
|
2006-12-01 07:01:19 +00:00
|
|
|
/^#[ \t]*define[ \t][ \t]*SIG[A-Z]+[0-9]*[ \t]/ {
|
1997-03-23 18:51:21 +00:00
|
|
|
|
|
|
|
j = sprintf("%d", $4);
|
|
|
|
str = $3;
|
|
|
|
|
|
|
|
if (nsig < j)
|
|
|
|
nsig = j;
|
|
|
|
|
2006-12-01 07:01:19 +00:00
|
|
|
siglist[j] = sprintf("{ \"%s\",\t%2d },", \
|
1997-03-23 18:51:21 +00:00
|
|
|
substr(str, 4), j);
|
|
|
|
}
|
2006-12-01 07:01:19 +00:00
|
|
|
/^#[ \t]*define[ \t][ \t]*_SIG[A-Z]+[0-9]*[ \t]/ {
|
1997-03-23 18:51:21 +00:00
|
|
|
|
|
|
|
j = sprintf("%d", $4);
|
|
|
|
str = $3;
|
|
|
|
|
|
|
|
if (nsig < j)
|
|
|
|
nsig = j;
|
|
|
|
|
2006-12-01 07:01:19 +00:00
|
|
|
siglist[j] = sprintf("{ \"%s\",\t%2d },", \
|
1997-03-23 18:51:21 +00:00
|
|
|
substr(str, 5), j);
|
|
|
|
}
|
|
|
|
|
|
|
|
END {
|
|
|
|
for (n = 1; n <= nsig; n++)
|
|
|
|
if (siglist[n] != "")
|
|
|
|
printf(" %s\n", siglist[n]);
|
|
|
|
|
2006-12-01 07:01:19 +00:00
|
|
|
printf(" { NULL,\t 0 }\n};\n");
|
1997-03-23 18:51:21 +00:00
|
|
|
}
|