Annotation of 42BSD/usr.lib/lib2648/printg.c, revision 1.1.1.1

1.1       root        1: /*     printg.c        4.1     83/03/09        */
                      2: 
                      3: #include "2648.h"
                      4: 
                      5: printg()
                      6: {
                      7:        int oldvid = _video;
                      8:        int c, c2;
                      9: 
                     10:        if (oldvid==INVERSE)
                     11:                togvid();
                     12:        sync();
                     13:        escseq(NONE);
                     14:        outstr("\33&p4d5u0C");
                     15:        outchar('\21'); /* test handshaking fix */
                     16: 
                     17:        /*
                     18:         * The terminal sometimes sends back S<cr> or F<cr>.
                     19:         * Ignore them.
                     20:         */
                     21:        fflush(stdout);
                     22:        c = getchar();
                     23:        if (c=='F' || c=='S') {
                     24:                c2 = getchar();
                     25:                if (c2 != '\r' && c2 != '\n')
                     26:                        ungetc(c2, stdin);
                     27:        } else {
                     28:                ungetc(c, stdin);
                     29:        }
                     30: 
                     31:        if (oldvid==INVERSE)
                     32:                togvid();
                     33: }

unix.superglobalmegacorp.com

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