Annotation of researchv10no/ncurses/screen/meta.c, revision 1.1.1.1

1.1       root        1: #include "curses.ext"
                      2: /*     @(#) meta.c: 1.1 10/15/83       (1.19   3/17/83)        */
                      3: 
                      4: /*
                      5:  * TRUE => all 8 bits of input character should be passed through.
                      6:  */
                      7: meta(win,bf)
                      8: WINDOW *win; int bf;
                      9: {
                     10:        int _outch();
                     11: 
                     12:        if (!has_meta_key)
                     13:                return ERR;
                     14:        /*
                     15:         * Do the appropriate fiddling with the tty driver to make it send
                     16:         * all 8 bits through.  On USG this means clearing ISTRIP, on
                     17:         * V7 you have to resort to RAW mode.
                     18:         */
                     19: #ifdef USG
                     20:        if (bf) {
                     21:                (cur_term->Nttyb).c_iflag &= ~ISTRIP;
                     22:                (cur_term->Nttyb).c_cflag &= ~CSIZE;
                     23:                (cur_term->Nttyb).c_cflag |= CS8;
                     24:                (cur_term->Nttyb).c_cflag &= ~PARENB;
                     25:        } else {
                     26:                (cur_term->Nttyb).c_iflag |= ISTRIP;
                     27:                (cur_term->Nttyb).c_cflag &= ~CSIZE;
                     28:                (cur_term->Nttyb).c_cflag |= CS7;
                     29:                (cur_term->Nttyb).c_cflag |= PARENB;
                     30:        }
                     31: #else
                     32:        if (bf)
                     33:                raw();
                     34:        else
                     35:                noraw();
                     36: #endif
                     37:        reset_prog_mode();
                     38: 
                     39:        /*
                     40:         * Do whatever is needed to put the terminal into meta-mode.
                     41:         */
                     42:        if (bf)
                     43:                tputs(meta_on, 1, _outch);
                     44:        else
                     45:                tputs(meta_off, 1, _outch);
                     46: 
                     47:        /* Keep track internally. */
                     48:        win->_use_meta = bf;
                     49: 
                     50:        return OK;
                     51: }

unix.superglobalmegacorp.com

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