Annotation of researchv10dc/vol2/index/mkfile, revision 1.1

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 ../setup ../snocone ../spin ../streams ../[t-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/^ //' -e 's/  / /' ../[a-z]*/*.ind|sed 's/      \([^A-Za-z]\)/   \1/'|sort -f|sed -e 's/         /      /' -e 's/\b//'|
        !            57:        awk  '
        !            58:        #single
        !            59:        #s
        !            60:        #Sfor cw
        !            61:        #p for 1cw
        !            62:        #r for 2cw
        !            63:        #t for 4cw
        !            64:        #q for 3cw
        !            65:        #x for 4&6
        !            66:        #y for 1&3
        !            67:        #z for 2&4
        !            68:        #Z for 3&5
        !            69:        #Y for 1,2,&4
        !            70:        #
        !            71:        #global
        !            72:        #g
        !            73:        #G for CW
        !            74:        #P for 1cw
        !            75:        #R for 2cw
        !            76:        #
        !            77:        #c cw
        !            78:        #f 1st cw
        !            79:        #C paper name to cw
        !            80:        BEGIN   {
        !            81:                while((getline<"contents") > 0){
        !            82:                        names[$1] = $2
        !            83:                        last[$1] = $3
        !            84:                }
        !            85:                FS="    "
        !            86:        }
        !            87:        {
        !            88:                junk=$0
        !            89:                caps=gsub(/[A-HJ-Z]/,"",junk)
        !            90:                constant=0
        !            91:                control=0
        !            92:                if($1 == term){
        !            93:                ck = global = substr($2,2,index($2,",")-2)
        !            94:                if(ck in names && ((NF>2 && $NF !~ /C/)||NF < 3)){
        !            95:                        sub(/^ /, " \\fI", $2)
        !            96:                        sub(/,/,"\\fP,", $2)
        !            97:                }
        !            98:                if($2 ~ /[A-Z_$][A-Z_][A-Z_$0-9& ]*/){
        !            99:                        if($2 !~ /[a-z]/)caps = caps/2
        !           100:                        control=8*gsub(/[A-Z_$][A-Z_$][A-Z_$0-9& ]*/,"\\s-2&\\s+2")
        !           101:                }
        !           102:                sub(/^ /,"",$2)
        !           103:                if(NF == 3){
        !           104:                        rside = ckcw($2,0,$NF)
        !           105:                        if(global in names){
        !           106:                        if( $3~ /[gGPR]/)
        !           107:                        printit("    \\fI" global "\\fP, " names[global] "-" last[global],1,control)
        !           108:                        else if($2 ~ /\\fI/)printit("    " $2, 1, control)
        !           109:                        else printit("    " rside, 1, control)
        !           110:                                next
        !           111:                        }
        !           112:                }
        !           113:                else rside = $2
        !           114:                printit("    " rside, 1, control)       #removed space
        !           115:        }
        !           116:        else {
        !           117:                term = $1
        !           118:                control=0
        !           119:                if(hadamatch){
        !           120:                        printf("\n")
        !           121:                }
        !           122:                if(term in names){
        !           123:                        if(!hadamatch)printf("\n")
        !           124:                        hadamatch=1
        !           125:                        newt="\\fI" term "\\fP, " names[term] "-" last[term]
        !           126:                        printit(newt, 0, 0)
        !           127:                        if($2 ~ /[A-Z_$][A-Z_$][A-Z_$0-9& ]*/){
        !           128:                                if($2 !~ /[a-z]/)caps /= 2
        !           129:                                control=8*gsub(/[A-Z_$][A-Z_$][A-Z_$0-9& ]*/,"\\s-2&\\s+2")
        !           130:                        }
        !           131:                        sub(/^ /,"",$2)
        !           132:                        if(NF == 3)
        !           133:                                rside = ckcw($2,0,$NF)
        !           134:                        else rside = $2
        !           135:                        printit("    " rside, 1, control)       #removed space
        !           136:                }
        !           137:                else {
        !           138:                        hadamatch=0
        !           139:                        if($1 ~ /[A-Z_$][A-Z_$][A-Z_$0-9& ]*/){
        !           140:                                control=8*gsub(/[A-Z_$][A-Z_$][A-Z_$0-9& ]*/,"\\s-2&\\s+2")
        !           141:                        }
        !           142:                        lside = $1
        !           143:                        if(NF == 3){
        !           144:                                lside = ckcw($1,1,$NF)
        !           145:                                if($NF ~ /[gGPR]/){
        !           146:                                r = substr($2,2,index($2,",")-2)
        !           147:                                if(r in names ){
        !           148:                                        control += 6
        !           149:                                        printit(lside ", \\fI" r "\\fP, " names[r] "-" last[r],0,control)
        !           150:                                        next
        !           151:                                }
        !           152:                                else {
        !           153:                                        print "term not in names:" r|"cat 1>&2"
        !           154:                                        sub(/   ./,"")
        !           155:                                }
        !           156:                                }
        !           157:                        }
        !           158:                        control += 6
        !           159:                        sub(",","\\fP,",$2)
        !           160:                        printit(lside ",\\fI" $2, 0, control)
        !           161:                }
        !           162:        }}
        !           163:        function ckcw(rterm,first,code){
        !           164:                constant=0
        !           165:                savit=rterm
        !           166:                if(rterm ~ /^-/){
        !           167:                        control += 2
        !           168:                        sub(/^-/,"\\(em",rterm)
        !           169:                }
        !           170:                if(rterm ~ /^\./){
        !           171:                        control += 2
        !           172:                        sub(/^\./,"\\\\&&",rterm)
        !           173:                }
        !           174:                if(code ~ /[gs]/)return(rterm)
        !           175:                if(code ~ /[GcSC]/){
        !           176:                        if(first)rterm = addit(rterm)
        !           177:                        else {
        !           178:                                constant = index(rterm,",")-1
        !           179:                                if(rterm ~ /s[-+]2/){
        !           180:                                        constant -= 8
        !           181:                                        gsub(/s\+2/,"s+1", rterm)
        !           182:                                        gsub(/s\-2/,"s-1", rterm)
        !           183:                                        rterm = "\\s-1\\f(CW" rterm
        !           184:                                        sub(/,/,"\\fP\\s+1,",rterm)
        !           185:                                }
        !           186:                                else {
        !           187:                                        rterm = "\\s-1\\f(CW" rterm
        !           188:                                        sub(/,/,"\\fP\\s+1,",rterm)
        !           189:                                }
        !           190:                        }
        !           191:                }
        !           192:                else if(code ~ /[pPf]/){
        !           193:                        constant = index(rterm," ")-1
        !           194:                        if(rterm ~ /s[-+]2/){
        !           195:                                constant -= 8
        !           196:                                gsub(/s\+2/,"s+1", rterm)
        !           197:                                gsub(/s\-2/,"s-1", rterm)
        !           198:                                rterm = "\\s-1\\f(CW" rterm
        !           199:                                sub(/ /,"\\fP\\s+1 ", rterm)
        !           200:                        }
        !           201:                        else {
        !           202:                                rterm = "\\s-1\\f(CW" rterm
        !           203:                                sub(/ /,"\\fP\\s+1 ", rterm)
        !           204:                        }
        !           205:                }
        !           206:                else{
        !           207:                        n=split(rterm, arr, " ")
        !           208:                        if(code ~ /[Yy]/)rterm = addit(arr[1])
        !           209:                        else rterm = arr[1]
        !           210:                        for(i=2;i<=n;i++){
        !           211:                                if(i==2 && code~/[rRzY]/)rterm = rterm " " addit(arr[i])
        !           212:                                else if(i==3 && code~/[qyZ]/)rterm=rterm " " addit(arr[i])
        !           213:                                else if(i==4 && code~/[txzY]/)rterm=rterm " " addit(arr[i])
        !           214:                                else if(i==5 && code~/[Z]/)rterm=rterm " " addit(arr[i])
        !           215:                                else if(i==6 && code~/x/)rterm=rterm " " addit(arr[i])
        !           216:                                else {
        !           217:                                        if(arr[i] ~ /s\+2/)sub(/s\+2/,"s+1",arr[i])
        !           218:                                        rterm = rterm " " arr[i]
        !           219:                                }
        !           220:                        }
        !           221:                }
        !           222:                if(code ~ /[xyz]/)control+=16
        !           223:                control += 16
        !           224:                return(rterm)
        !           225:        }
        !           226:        function addit(string){
        !           227:                constant += length(string)
        !           228:                if(string ~ /s[-+]2/){
        !           229:                        constant -= 8
        !           230:                        gsub(/s\+2/,"s+1", string)
        !           231:                        gsub(/s\-2/,"s-1", string)
        !           232:                        return("\\s-1\\f(CW" string "\\fP\\s+1")
        !           233:                }
        !           234:                else return("\\s-1\\f(CW" string "\\fP\\s+1")
        !           235:        }
        !           236:        function printit(line, space, control){
        !           237:        if(!constant)
        !           238:                limit=43+control - caps*.5                      #was 46 at 8 pt - 43 with italic change
        !           239:        else limit = 43 - constant*.4 + 1 + control - caps*.5
        !           240:        print "lim " limit " leng " length(line) " cons:ctl:caps " constant ":" control ":" caps " " line|"cat 1>&2"
        !           241:        if(space == 0)limit += 2
        !           242:        if(length(line)< limit)print line
        !           243:        else {
        !           244:                n=split(line, a, ",")
        !           245:                if(length(a[1])>=limit-6 || space){                     #adjust for italic change
        !           246:                        if(!space)limit -=6
        !           247:                        m=split(a[1],b," ")
        !           248:                        nline=b[1]
        !           249:                        if(space)nline = "    " b[1]
        !           250:                        if(m > 1)for(i=2;i<=m;i++){
        !           251:                                if(length(nline)+length(b[i])+1>=limit){
        !           252:                                        if(nline ~ /s-2/ && nline !~ /s+2/){
        !           253:                                                print nline "\\s+2"
        !           254:                                                nline = "      \\s-2" b[i]
        !           255:                                        }
        !           256:                                        else {
        !           257:                                                print nline
        !           258:                                                nline = "      " b[i]
        !           259:                                        }
        !           260:                                }
        !           261:                                else nline = nline " " b[i]
        !           262:                        }
        !           263:                        for(i=2; i<=n;i++){
        !           264:                                leng=length(a[i])
        !           265:                                if(a[i] ~ /-/)leng--
        !           266:                                if(length(nline)+leng >= limit){
        !           267:                                        print nline ","
        !           268:                                        nline = "      " a[i]
        !           269:                                }
        !           270:                                else nline = nline "," a[i]
        !           271:                        }
        !           272:                        print nline
        !           273:                        return
        !           274:                }
        !           275:                nline=a[1]
        !           276:                for(i=2;i<=n;i++){
        !           277:                        if(length(nline)+ length(a[i])>= limit){        #used to be -6
        !           278:                                print nline ","
        !           279:                                nline = "      " a[i]
        !           280:                        }
        !           281:                        else nline = nline "," a[i]
        !           282:                }
        !           283:                if(length(nline) > 0)print nline
        !           284:        }
        !           285:        }' 2>/dev/null|finddups >sindex
        !           286:        wc sindex
        !           287: #      troff sindex.ms >tr.out
        !           288: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.