Annotation of GNUtools/libg++/libio/dbz/byteflip.c, revision 1.1

1.1     ! root        1: #include <stdio.h>
        !             2: 
        !             3: #define        MAXWORD 32
        !             4: 
        !             5: main(argc, argv)
        !             6: int argc;
        !             7: char *argv[];
        !             8: {
        !             9:        register int len;
        !            10:        int inmap[MAXWORD];
        !            11:        int outmap[MAXWORD];
        !            12:        char in[MAXWORD];
        !            13:        char out[MAXWORD];
        !            14:        register int i;
        !            15:        register int a;
        !            16: 
        !            17:        a = 1;
        !            18:        len = atoi(argv[a++]);
        !            19:        if (len > MAXWORD)
        !            20:                abort();        /* kind of drastic... */
        !            21:        for (i = 0; i < len; i++)
        !            22:                inmap[i] = atoi(argv[a++]);
        !            23:        if (atoi(argv[a++]) != len)
        !            24:                abort();
        !            25:        for (i = 0; i < len; i++)
        !            26:                outmap[i] = atoi(argv[a++]);
        !            27: 
        !            28:        while (fread(in, 1, len, stdin) == len) {
        !            29:                for (i = 0; i < len; i++)
        !            30:                        out[outmap[i]] = in[inmap[i]];
        !            31:                fwrite(out, 1, len, stdout);
        !            32:        }
        !            33: #ifdef DBZ_FINISH
        !            34:        DBZ_FINISH;
        !            35: #endif
        !            36:        exit(0);
        !            37: }

unix.superglobalmegacorp.com

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