diff options
author | joerg <joerg@FreeBSD.org> | 1997-03-23 18:51:21 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1997-03-23 18:51:21 +0000 |
commit | 1b9d0472b72177a604d3c5dd26d25eec00049bd2 (patch) | |
tree | 1409de2219944c7c90248988b70ac693cf71206d /contrib/top/sigconv.awk | |
download | FreeBSD-src-1b9d0472b72177a604d3c5dd26d25eec00049bd2.zip FreeBSD-src-1b9d0472b72177a604d3c5dd26d25eec00049bd2.tar.gz |
This is the long-awaited import of top into the base system (actually,
the src/contrib/top part right now). This tools is simply too system-
dependant to maintain it in the ports collection.
Diffstat (limited to 'contrib/top/sigconv.awk')
-rw-r--r-- | contrib/top/sigconv.awk | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/contrib/top/sigconv.awk b/contrib/top/sigconv.awk new file mode 100644 index 0000000..8c90d8d --- /dev/null +++ b/contrib/top/sigconv.awk @@ -0,0 +1,53 @@ +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[] = {" + } + +/^#define[ \t][ \t]*SIG[A-Z]/ { + + j = sprintf("%d", $3); + str = $2; + + if (nsig < j) + nsig = j; + + siglist[j] = sprintf("\"%s\",\t%2d,", \ + substr(str, 4), j); + } +/^#[ \t]*define[ \t][ \t]*SIG[A-Z]/ { + + j = sprintf("%d", $4); + str = $3; + + if (nsig < j) + nsig = j; + + siglist[j] = sprintf("\"%s\",\t%2d,", \ + substr(str, 4), j); + } +/^#[ \t]*define[ \t][ \t]*_SIG[A-Z]/ { + + j = sprintf("%d", $4); + str = $3; + + if (nsig < j) + nsig = j; + + siglist[j] = sprintf("\"%s\",\t%2d,", \ + substr(str, 5), j); + } + +END { + for (n = 1; n <= nsig; n++) + if (siglist[n] != "") + printf(" %s\n", siglist[n]); + + printf(" NULL,\t 0\n};\n"); + } |