File: errnames1.awk

package info (click to toggle)
zsh-beta 4.3.2-dev-1%2B20061127-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 13,260 kB
  • ctags: 6,846
  • sloc: ansic: 83,534; sh: 5,094; makefile: 781; perl: 746; awk: 364; sed: 16
file content (18 lines) | stat: -rw-r--r-- 726 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Edited version of Src/signames1.awk.
#
# This is an awk script which finds out what the possibilities for
# the error names are, and dumps them out so that cpp can turn them
# into numbers.  Since we don't need to decide here what the
# real signals are, we can afford to be generous about definitions,
# in case the definitions are in terms of other definitions.
# However, we need to avoid definitions with parentheses, which will
# mess up the syntax.
BEGIN { printf "#include <errno.h>\n\n" }

/^[\t ]*#[\t ]*define[\t ]*E[A-Z0-9]*[\t ][\t ]*[^(\t ]/ { 
    eindex = index($0, "E")
    etail = substr($0, eindex, 80)
    split(etail, tmp)
    enam = substr(tmp[1], 2, 20)
    printf("XXNAMES XXE%s E%s\n", enam, enam)
}