raw(void) { int result = ERR; T((T_CALLED("raw()"))); if (SP != 0 && cur_term != 0) { TTY buf; BEFORE("raw"); _nc_setmode(O_BINARY); buf = cur_term->Nttyb; #ifdef TERMIOS buf.c_lflag &= ~(ICANON | ISIG | IEXTEN); buf.c_iflag &= ~(COOKED_INPUT); buf.c_cc[VMIN] = 1; buf.c_cc[VTIME] = 0; #else buf.sg_flags |= RAW; #endif if ((result = _nc_set_tty_mode(&buf)) == OK) { SP->_raw = TRUE; SP->_cbreak = 1; cur_term->Nttyb = buf; } AFTER("raw"); } returnCode(result); }
nocbreak(void) { int result = ERR; T((T_CALLED("nocbreak()"))); if (SP != 0 && cur_term != 0) { TTY buf; BEFORE("nocbreak"); _nc_setmode(O_TEXT); buf = cur_term->Nttyb; #ifdef TERMIOS buf.c_lflag |= ICANON; buf.c_iflag |= ICRNL; #else buf.sg_flags &= ~CBREAK; #endif if ((result = _nc_set_tty_mode(&buf)) == OK) { SP->_cbreak = 0; cur_term->Nttyb = buf; } AFTER("nocbreak"); } returnCode(result); }
noraw(void) { int result = ERR; T((T_CALLED("noraw()"))); if (SP != 0 && cur_term != 0) { TTY buf; BEFORE("noraw"); _nc_setmode(O_TEXT); buf = cur_term->Nttyb; #ifdef TERMIOS buf.c_lflag |= ISIG | ICANON | (cur_term->Ottyb.c_lflag & IEXTEN); buf.c_iflag |= COOKED_INPUT; #else buf.sg_flags &= ~(RAW | CBREAK); #endif if ((result = _nc_set_tty_mode(&buf)) == OK) { SP->_raw = FALSE; SP->_cbreak = 0; cur_term->Nttyb = buf; } AFTER("noraw"); } returnCode(result); }
cbreak(void) { int result = ERR; T((T_CALLED("cbreak()"))); if (SP != 0 && cur_term != 0) { TTY buf; BEFORE("cbreak"); _nc_setmode(O_BINARY); buf = cur_term->Nttyb; #ifdef TERMIOS buf.c_lflag &= ~ICANON; buf.c_iflag &= ~ICRNL; buf.c_lflag |= ISIG; buf.c_cc[VMIN] = 1; buf.c_cc[VTIME] = 0; #else buf.sg_flags |= CBREAK; #endif if ((result = _nc_set_tty_mode(&buf)) == OK) { SP->_cbreak = 1; cur_term->Nttyb = buf; } AFTER("cbreak"); } returnCode(result); }
qiflush(void) { int result = ERR; T((T_CALLED("qiflush()"))); if (cur_term != 0) { TTY buf; BEFORE("qiflush"); buf = cur_term->Nttyb; #ifdef TERMIOS buf.c_lflag &= ~(NOFLSH); result = _nc_set_tty_mode(&buf); #else /* FIXME */ #endif if (result == OK) cur_term->Nttyb = buf; AFTER("qiflush"); } returnVoid; }
NCURSES_SP_NAME(noqiflush) (NCURSES_SP_DCL0) { int result = ERR; T((T_CALLED("noqiflush()"))); if (cur_term != 0) { TTY buf; BEFORE("noqiflush"); buf = cur_term->Nttyb; #ifdef TERMIOS buf.c_lflag |= NOFLSH; result = _nc_set_tty_mode(&buf); #else /* FIXME */ #endif if (result == OK) { cur_term->Nttyb = buf; } AFTER("noqiflush"); } returnVoid; }