26763: fix problem on failed cd -s to relative path
[zsh.git] / Src / signames1.awk
blob27d21ac7b354d076df4be3c712b0be25754cc8fd
1 # This is an awk script which finds out what the possibilities for
2 # the signal names are, and dumps them out so that cpp can turn them
3 # into numbers. Since we don't need to decide here what the
4 # real signals are, we can afford to be generous about definitions,
5 # in case the definitions are in terms of other definitions.
6 # However, we need to avoid definitions with parentheses, which will
7 # mess up the syntax.
8 BEGIN { printf "#include <signal.h>\n\n" }
10 /^[\t ]*#[\t ]*define[\t _]*SIG[A-Z][A-Z0-9]*[\t ][\t ]*[^(\t ]/ {
11 sigindex = index($0, "SIG")
12 sigtail = substr($0, sigindex, 80)
13 split(sigtail, tmp)
14 signam = substr(tmp[1], 4, 20)
15 if (substr($0, sigindex-1, 1) == "_")
16 printf("XXNAMES XXSIG%s _SIG%s\n", signam, signam)
17 else
18 printf("XXNAMES XXSIG%s SIG%s\n", signam, signam)