|
|
1.1 root 1: < ../ADM/defns
2: <../index/defns
3:
4: all:V: index.out
5:
6: pg: index.out
7: count index.ms index.out
8:
9: spell:VQ:
10: dospell index.ms
11:
12: lp: index.out
13: $LP $newprereq && touch $target
14:
15: index.out:D: index.ms
16: $PREFER $prereq | pic | troff -mpm > $target
17:
18: index:V:
19: touch index.ind
20: pindex:V:
21: touch index.ind
22:
23: PAPERS=`cd /usr/vol2;echo [a-z]*`
24: INDEX=${PAPERS:%=%.index}
25: incindex:V: $INDEX
26:
27: %.index:VQ:
28: cd ../$stem; mk index
29: PINDEX=${PAPERS:%=%.pindex}
30: pincindex:V: $PINDEX
31:
32: %.pindex:VQ:
33: cd ../$stem; mk pindex
34:
35: restart:V:
36: for i in ../[c-z]*
37: do
38: cd $i
39: mk index
40: done
41:
42: sindex:VQ:
43: wc sindex
44: awk '
45: /^\.XX/ {
46: if($2 ~ /[a-z]/){
47: name=$2
48: first=$3
49: str = "..\/" $4 ".pg"
50: getline <str
51: last=$1 + first -1
52: print name " " first " " last
53: close(str)
54: }
55: }' ../contents/contents.ms >contents
56: sed -e 's/\\f(..//g' -e 's/\\f[a-z0-9A-Z]//g' -e 's/\\em//' -e 's/ ,/,/' -e 's/\\\&//g' -e 's/,/ /' -e 's/^ //' ../[a-z]*/*.ind|sort -f|
57: awk '
58: BEGIN {
59: while((getline<"contents") > 0){
60: names[$1] = $2
61: last[$1] = $3
62: }
63: FS=" "
64: }
65: {if($1 == term){
66: ck = global = substr($2,2,index($2,",")-2)
67: if(ck in names){
68: sub(/^ /, " \\fI", $2)
69: sub(/,/,"\\fP,", $2)
70: }
71: caps=0
72: if($2 ~ /[A-Z_$][A-Z_$][A-Z_$0-9& ]*/){
73: if($2 !~ /\\s/)caps=gsub(/[A-Z_$][A-Z_$][A-Z_$0-9& ]*/,"\\s-2&\\s+2")
74: }
75: sub(/^ /,"",$2)
76: rside = ckcw($2,0)
77: if(NF == 3){
78: if(global in names){
79: printit(" \\fI" global "\\fP, " names[global] "-" last[global],1,caps*8)
80: next
81: }
82: }
83: printit(" " rside, 1, caps*8) #removed space
84: }
85: else {
86: term = $1
87: caps=0
88: if(term in names){
89: newt="\\fI" term "\\fP, " names[term] "-" last[term]
90: printit(newt, 0, 0)
91: if($2 ~ /[A-Z_$][A-Z_$][A-Z_$0-9& ]*/){
92: if($2 !~ /\\s/)caps=gsub(/[A-Z_$][A-Z_$][A-Z_$0-9& ]*/,"\\s-2&\\s+2")
93: }
94: sub(/^ /,"",$2)
95: rside = ckcw($2,0)
96: printit(" " rside, 1, caps*8) #removed space
97: }
98: else {
99: if($1 ~ /[A-Z_$][A-Z_$][A-Z_$0-9& ]*/){
100: if($1 !~ /\\s/)caps=gsub(/[A-Z_$][A-Z_$][A-Z_$0-9& ]*/,"\\s-2&\\s+2")
101: }
102: lside = ckcw($1,1)
103: if(NF == 3){
104: r = substr($2,2,index($2,",")-2)
105: if(r in names){
106: printit($1 ", \\fI" r "\\fP, " names[r] "-" last[r],0,caps*8)
107: next
108: }
109: else {
110: print "term not in names:" r|"cat 1>&2"
111: sub(/ XXG/,"")
112: }
113: }
114: sub(",","\\fP,",$2)
115: printit(lside ",\\fI" $2, 0, caps*8)
116: }
117: }}
118: function ckcw(rterm,first){
119: if((rterm ~ /[\/\.$]/ && rterm !~ /(I\/O)|(Input\/Output)|(reduce)|(TCP)/)||rterm ~ /^-/){
120: sub(/^-/,"\\(em",rterm)
121: rterm = "\\f(CW" rterm
122: if(first)rterm = rterm "\\fP"
123: if(index(" ",rterm)<index(",",rterm))
124: sub(/ /,"\\fP ",rterm)
125: else sub(/,/,"\\fP,",rterm)
126: caps += 1
127: }
128: return(rterm)
129: }
130: function printit(line, space, caps){
131: limit=46+caps
132: if(length(line)< limit)print line
133: else {
134: n=split(line, a, ",")
135: if(length(a[1])>=limit){
136: m=split(a[1],b," ")
137: nline=b[1]
138: if(space)nline = " " b[1]
139: for(i=2;i<=m;i++){
140: nline = nline " " b[i]
141: if(length(nline)>=limit){
142: print nline
143: nline = " "
144: }
145: }
146: for(i=2; i<=n;i++){
147: if(nline == " ")nline = nline a[i]
148: else nline = nline "," a[i]
149: }
150: print nline
151: return
152: }
153: nline=a[1]
154: for(i=2;i<=n;i++){
155: nline = nline "," a[i]
156: if(length(nline)>= limit-6){
157: if(i < n)print nline ","
158: else print nline
159: if(i < n)nline = " " a[++i]
160: else nline = ""
161: }
162: }
163: if(length(nline) > 0)print nline
164: }
165: }' >sindex
166: wc sindex
167: # troff -ms sindex.ms >tr.out
168:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.