Annotation of 41BSD/lib/libcurses/getch.c, revision 1.1.1.1

1.1       root        1: # include      "curses.ext"
                      2: 
                      3: /*
                      4:  *     This routine reads in a character from the window.
                      5:  */
                      6: wgetch(win)
                      7: reg WINDOW     *win; {
                      8: 
                      9:        reg bool        weset = FALSE;
                     10:        reg char        inp;
                     11: 
                     12:        if (!win->_scroll && (win->_flags&_FULLWIN)
                     13:            && win->_curx == win->_maxx && win->_cury == win->_maxy)
                     14:                return ERR;
                     15: # ifdef DEBUG
                     16:        fprintf(outf, "WGETCH: _echoit = %c, _rawmode = %c\n", _echoit ? 'T' : 'F', _rawmode ? 'T' : 'F');
                     17: # endif
                     18:        if (_echoit && !_rawmode) {
                     19:                raw();
                     20:                weset++;
                     21:        }
                     22:        inp = getchar();
                     23: # ifdef DEBUG
                     24:        fprintf(outf,"WGETCH got '%s'\n",unctrl(inp));
                     25: # endif
                     26:        if (_echoit) {
                     27:                mvwaddch(curscr, win->_cury, win->_curx, inp);
                     28:                waddch(win, inp);
                     29:        }
                     30:        if (weset)
                     31:                noraw();
                     32:        return inp;
                     33: }

unix.superglobalmegacorp.com

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