Annotation of 43BSDTahoe/new/X/doc/Xlib/fixindex.awk, revision 1.1

1.1     ! root        1: BEGIN {
        !             2:        FS = "\t";
        !             3: }
        !             4: 
        !             5: NR == 1 {
        !             6:        if ($3 != "")
        !             7:                printf(".Ib \"%s\"\n", $2);
        !             8:        major = $2;
        !             9:        minor = $3;
        !            10:        pageno = $1;
        !            11:        pagelist = $1;
        !            12: }
        !            13: 
        !            14: NR != 1 {
        !            15:        if ($2 == major && $3 == minor)         # neither has changed
        !            16:        {
        !            17:                if ($1 != pageno)               # new page number, append
        !            18:                        pagelist = pagelist "," $1;
        !            19:        }
        !            20:        else                                    # one has changed
        !            21:        {
        !            22:                if (minor != "")                # dump full record
        !            23:                        printf(".I< \"%s\" \"%s\" \"%s\"\n", major, minor, pagelist);
        !            24:                else
        !            25:                        printf(".I> \"%s\" \"%s\"\n", major, pagelist);
        !            26:                pagelist = $1;                  # restart pagelist
        !            27:                if ($2 != major && $3 != "")    # major has changed, minor not null
        !            28:                        printf(".Ib \"%s\"\n", $2);
        !            29:        }
        !            30:        major = $2;
        !            31:        minor = $3;
        !            32:        pageno = $1;
        !            33: }
        !            34: 
        !            35: END {
        !            36:        if (minor != "")                        # dump full record
        !            37:                printf(".I< \"%s\" \"%s\" \"%s\"\n", major, minor, pagelist);
        !            38:        else
        !            39:                printf(".I> \"%s\" \"%s\"\n", major, pagelist);
        !            40: }

unix.superglobalmegacorp.com

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