1# Edited version of Src/signames1.awk.
2#
3# This is an awk script which finds out what the possibilities for
4# the error names are, and dumps them out so that cpp can turn them
5# into numbers.  Since we don't need to decide here what the
6# real signals are, we can afford to be generous about definitions,
7# in case the definitions are in terms of other definitions.
8# However, we need to avoid definitions with parentheses, which will
9# mess up the syntax.
10BEGIN { printf "#include <errno.h>\n\n" }
11
12/^[\t ]*#[\t ]*define[\t ]*E[A-Z0-9]*[\t ][\t ]*[^(\t ]/ { 
13    eindex = index($0, "E")
14    etail = substr($0, eindex, 80)
15    split(etail, tmp)
16    enam = substr(tmp[1], 2, 20)
17    printf("XXNAMES XXE%s E%s\n", enam, enam)
18}
19