"Fossies" - the Fresh Open Source Software Archive 
Member "afio-2.5.2/exten_make.awk" (30 Nov 2018, 1042 Bytes) of package /linux/misc/afio-2.5.2.tgz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) (G)AWK source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
1 # Generates default list of -E extensions from manpage.
2 # Does this by looking for the special comments
3 # 'br START_EXT_LIST
4 # and
5 # 'br END_EXT_LIST
6 # in the manpage, and for all lines in between, recording every
7 # word on each line, except for the first word each line, as an extension,
8 # where a word is a whitespace-separated string of characters.
9 # See also the manpage comments surrounding the extension list.
10 $0 ~ "'br END_EXT_LIST" { p=0; }
11 p==1 {
12 for(i=2; i<=NF; i++) { ex[nx++]=$i; }
13 }
14 $0 ~ "'br START_EXT_LIST" { p=1; }
15 END {
16 print "/* This file was auto-generated by the Makefile, from the afio.1 manpage file */"
17 for(i=0; i<nx; i++)
18 {
19 #a just-in-case consistency check.
20 if((ex[i]==".I")||(ex[i]!~"^\\.")) {
21 print "Questionable extention:"ex[i];
22 print "Editing of afio.1 probably made it incompatible with"
23 print "the parsing rules used by the exten_make.awk script.";
24 exit 1;
25 }
26 print "struct extnode de"i+1"={ \""ex[i]"\", "(i?"&de"i:"NULL")" };";
27 }
28 print "struct extnode *compexts=&de"nx";";
29
30 }