NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_DCLx TTY * buf) { int result = OK; if (buf == 0 || SP_PARM == 0) { result = ERR; } else { TERMINAL *termp = TerminalOf(SP_PARM); if (0 == termp) { result = ERR; } else { #ifdef USE_TERM_DRIVER result = CallDriver_2(SP_PARM, sgmode, FALSE, buf); #else for (;;) { if (GET_TTY(termp->Filedes, buf) != 0) { if (errno == EINTR) continue; result = ERR; } break; } #endif } if (result == ERR) memset(buf, 0, sizeof(*buf)); TR(TRACE_BITS, ("_nc_get_tty_mode(%d): %s", termp ? termp->Filedes : -1, _nc_trace_ttymode(buf))); } return (result); }
_nc_set_tty_mode(TTY * buf) { if (cur_term == 0 || SET_TTY(cur_term->Filedes, buf) != 0) return (ERR); TR(TRACE_BITS, ("_nc_set_tty_mode(%d): %s", cur_term->Filedes, _nc_trace_ttymode(buf))); return (OK); }
_nc_get_tty_mode(TTY * buf) { if (cur_term == 0 || GET_TTY(cur_term->Filedes, buf) != 0) { memset(buf, 0, sizeof(*buf)); return (ERR); } TR(TRACE_BITS, ("_nc_get_tty_mode(%d): %s", cur_term->Filedes, _nc_trace_ttymode(buf))); return (OK); }
_nc_set_tty_mode(TTY * buf) { if (cur_term == 0 || SET_TTY(cur_term->Filedes, buf) != 0) { if ((errno == ENOTTY) && (SP != 0)) SP->_notty = TRUE; return (ERR); } TR(TRACE_BITS, ("_nc_set_tty_mode(%d): %s", cur_term->Filedes, _nc_trace_ttymode(buf))); return (OK); }
NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_DCLx TTY * buf) { int result = OK; if (buf == 0 || SP_PARM == 0) { result = ERR; } else { TERMINAL *termp = TerminalOf(SP_PARM); if (0 == termp) { result = ERR; } else { #ifdef USE_TERM_DRIVER result = CallDriver_2(SP_PARM, sgmode, TRUE, buf); #else for (;;) { if ((SET_TTY(termp->Filedes, buf) != 0) #if USE_KLIBC_KBD && !isatty(termp->Filedes) #endif ) { if (errno == EINTR) continue; if ((errno == ENOTTY) && (SP_PARM != 0)) SP_PARM->_notty = TRUE; result = ERR; } break; } #endif } TR(TRACE_BITS, ("_nc_set_tty_mode(%d): %s", termp ? termp->Filedes : -1, _nc_trace_ttymode(buf))); } return (result); }
_nc_tracebits(void) { return _nc_trace_ttymode(&(cur_term->Nttyb)); }