|
|
researchv10 Dan Cross
< ../ADM/defns
<../index/defns
all:V: index.out
pg: index.out
count index.ms index.out
spell:VQ:
dospell index.ms
lp: index.out
$LP $newprereq && touch $target
index.out:D: index.ms
$PREFER $prereq | pic | troff -mpm > $target
index:V:
touch index.ind
pindex:V:
touch index.ind
PAPERS=`cd /usr/vol2;echo [a-z]*`
INDEX=${PAPERS:%=%.index}
incindex:V: $INDEX
%.index:VQ:
cd ../$stem; mk index
PINDEX=${PAPERS:%=%.pindex}
pincindex:V: $PINDEX
%.pindex:VQ:
cd ../$stem; mk pindex
restart:V:
for i in ../[c-z]*
do
cd $i
mk index
done
sindex:VQ:
wc sindex
awk '
/^\.XX/ {
if($2 ~ /[a-z]/){
name=$2
first=$3
str = "..\/" $4 ".pg"
getline <str
last=$1 + first -1
print name " " first " " last
close(str)
}
}' ../contents/contents.ms >contents
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|
awk '
BEGIN {
while((getline<"contents") > 0){
names[$1] = $2
last[$1] = $3
}
FS=" "
}
{if($1 == term){
ck = global = substr($2,2,index($2,",")-2)
if(ck in names){
sub(/^ /, " \\fI", $2)
sub(/,/,"\\fP,", $2)
}
caps=0
if($2 ~ /[A-Z_$][A-Z_$][A-Z_$0-9& ]*/){
if($2 !~ /\\s/)caps=gsub(/[A-Z_$][A-Z_$][A-Z_$0-9& ]*/,"\\s-2&\\s+2")
}
sub(/^ /,"",$2)
rside = ckcw($2,0)
if(NF == 3){
if(global in names){
printit(" \\fI" global "\\fP, " names[global] "-" last[global],1,caps*8)
next
}
}
printit(" " rside, 1, caps*8) #removed space
}
else {
term = $1
caps=0
if(term in names){
newt="\\fI" term "\\fP, " names[term] "-" last[term]
printit(newt, 0, 0)
if($2 ~ /[A-Z_$][A-Z_$][A-Z_$0-9& ]*/){
if($2 !~ /\\s/)caps=gsub(/[A-Z_$][A-Z_$][A-Z_$0-9& ]*/,"\\s-2&\\s+2")
}
sub(/^ /,"",$2)
rside = ckcw($2,0)
printit(" " rside, 1, caps*8) #removed space
}
else {
if($1 ~ /[A-Z_$][A-Z_$][A-Z_$0-9& ]*/){
if($1 !~ /\\s/)caps=gsub(/[A-Z_$][A-Z_$][A-Z_$0-9& ]*/,"\\s-2&\\s+2")
}
lside = ckcw($1,1)
if(NF == 3){
r = substr($2,2,index($2,",")-2)
if(r in names){
printit($1 ", \\fI" r "\\fP, " names[r] "-" last[r],0,caps*8)
next
}
else {
print "term not in names:" r|"cat 1>&2"
sub(/ XXG/,"")
}
}
sub(",","\\fP,",$2)
printit(lside ",\\fI" $2, 0, caps*8)
}
}}
function ckcw(rterm,first){
if((rterm ~ /[\/\.$]/ && rterm !~ /(I\/O)|(Input\/Output)|(reduce)|(TCP)/)||rterm ~ /^-/){
sub(/^-/,"\\(em",rterm)
rterm = "\\f(CW" rterm
if(first)rterm = rterm "\\fP"
if(index(" ",rterm)<index(",",rterm))
sub(/ /,"\\fP ",rterm)
else sub(/,/,"\\fP,",rterm)
caps += 1
}
return(rterm)
}
function printit(line, space, caps){
limit=46+caps
if(length(line)< limit)print line
else {
n=split(line, a, ",")
if(length(a[1])>=limit){
m=split(a[1],b," ")
nline=b[1]
if(space)nline = " " b[1]
for(i=2;i<=m;i++){
nline = nline " " b[i]
if(length(nline)>=limit){
print nline
nline = " "
}
}
for(i=2; i<=n;i++){
if(nline == " ")nline = nline a[i]
else nline = nline "," a[i]
}
print nline
return
}
nline=a[1]
for(i=2;i<=n;i++){
nline = nline "," a[i]
if(length(nline)>= limit-6){
if(i < n)print nline ","
else print nline
if(i < n)nline = " " a[++i]
else nline = ""
}
}
if(length(nline) > 0)print nline
}
}' >sindex
wc sindex
# troff -ms sindex.ms >tr.out
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.