Annotation of researchv10no/cmd/qsnap/qbright.c, revision 1.1

1.1     ! root        1: #include <stdio.h>
        !             2: 
        !             3: char nq[9] = { 36, 58, 81, 103, 126, 148, 171, 193, 220 };
        !             4:              
        !             5: main(argc, argv)
        !             6:        char **argv;
        !             7: {
        !             8:        char buf[256];
        !             9:        int i=1, j, k=0;
        !            10:        int oval;
        !            11:        extern int flag;
        !            12: 
        !            13:        qreset();
        !            14:        qpause();
        !            15:        if (argc > 1)
        !            16:        {       while (argc-- > 1 && k < 9)
        !            17:                {       sscanf(argv[i++], "%d", &j);
        !            18:                        nq[k++] = (j<36)?36:(j>220)?220:j;      
        !            19:                }
        !            20:        qpause();
        !            21:                qcmd("\072", 1);
        !            22:        qpause();
        !            23:                qpause();
        !            24:                qwrite(nq,   9);
        !            25:        qpause();
        !            26:                qpause();
        !            27:                printf("N.B. new values take effect after the recalibration\n");
        !            28:                printf("     completes: wait for unix prompt or ready light\n");
        !            29:                fflush(stdout);
        !            30:                oval = flag;
        !            31:                qcmd("\047", 1);
        !            32:        qpause();
        !            33:                qpause();
        !            34:                while (flag == oval)
        !            35:                        sleep(30);
        !            36:                printf("ready\n");
        !            37:        }
        !            38:        qcmd("\073", 1);
        !            39:        qpause();
        !            40:        qread(buf, 10);
        !            41:        printf("Levels:");
        !            42:        for(i = 0; i < buf[0]; i++)
        !            43:                printf("  %d~%d", i, buf[i+1]&0xFF);
        !            44:        printf("\n");
        !            45: 
        !            46: }

unix.superglobalmegacorp.com

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