Annotation of 42BSD/usr.lib/lib2648/rawchar.c, revision 1.1

1.1     ! root        1: /*     rawchar.c       4.1     83/03/09        */
        !             2: /*
        !             3:  * get a character from the terminal, with no line buffering.
        !             4:  */
        !             5: 
        !             6: #include "2648.h"
        !             7: 
        !             8: rawchar()
        !             9: {
        !            10:        char c;
        !            11: 
        !            12:        sync();
        !            13:        escseq(NONE);
        !            14:        fflush(stdout);
        !            15:        if (_pb_front && _on2648) {
        !            16:                c = *_pb_front++;
        !            17: #ifdef TRACE
        !            18:                if (trace)
        !            19:                        fprintf(trace, "%s from queue, front=%d, back=%d\n", rdchar(c), _pb_front-_pushback, _pb_back-_pushback);
        !            20: #endif
        !            21:                if (_pb_front > _pb_back) {
        !            22:                        _pb_front = _pb_back = NULL;
        !            23: #ifdef TRACE
        !            24:                        if (trace)
        !            25:                                fprintf(trace, "reset pushback to null\n");
        !            26: #endif
        !            27:                }
        !            28:                return (c);
        !            29:        }
        !            30:        _outcount = 0;
        !            31:        c = getchar();
        !            32: #ifdef TRACE
        !            33:        if (trace)
        !            34:                fprintf(trace, "rawchar '%s'\n", rdchar(c));
        !            35: #endif
        !            36:        return (c);
        !            37: }

unix.superglobalmegacorp.com

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