NCURSES_SP_NAME(set_curterm) (NCURSES_SP_DCLx TERMINAL * termp) { TERMINAL *oldterm; T((T_CALLED("set_curterm(%p)"), (void *) termp)); _nc_lock_global(curses); oldterm = cur_term; if (SP_PARM) SP_PARM->_term = termp; #if USE_REENTRANT CurTerm = termp; #else cur_term = termp; #endif if (termp != 0) { #ifdef USE_TERM_DRIVER TERMINAL_CONTROL_BLOCK *TCB = (TERMINAL_CONTROL_BLOCK *) termp; ospeed = (NCURSES_OSPEED) _nc_ospeed(termp->_baudrate); if (TCB->drv->isTerminfo && termp->type.Strings) { PC = (char) ((pad_char != NULL) ? pad_char[0] : 0); } TCB->csp = SP_PARM; #else ospeed = (NCURSES_OSPEED) _nc_ospeed(termp->_baudrate); if (termp->type.Strings) { PC = (char) ((pad_char != NULL) ? pad_char[0] : 0); } #endif } _nc_unlock_global(curses); T((T_RETURN("%p"), (void *) oldterm)); return (oldterm); }
set_curterm(TERMINAL * termp) { TERMINAL *oldterm; T((T_CALLED("set_curterm(%p)"), termp)); _nc_lock_global(curses); oldterm = cur_term; if (SP) SP->_term = termp; #if BROKEN_LINKER || USE_REENTRANT _nc_prescreen._cur_term = termp; #else cur_term = termp; #endif if (termp != 0) { ospeed = _nc_ospeed(termp->_baudrate); if (termp->type.Strings) { PC = (char) ((pad_char != NULL) ? pad_char[0] : 0); } } _nc_unlock_global(curses); T((T_RETURN("%p"), oldterm)); return (oldterm); }
set_curterm(TERMINAL * termp) { TERMINAL *oldterm = cur_term; if ((cur_term = termp) != 0) { ospeed = _nc_ospeed(cur_term->_baudrate); PC = (pad_char != NULL) ? pad_char[0] : 0; } return oldterm; }
NCURSES_SP_NAME(baudrate) (NCURSES_SP_DCL0) { int result; T((T_CALLED("baudrate(%p)"), (void *) SP_PARM)); /* * In debugging, allow the environment symbol to override when we're * redirecting to a file, so we can construct repeatable test-cases * that take into account costs that depend on baudrate. */ #ifdef TRACE if (IsValidTIScreen(SP_PARM) && !NC_ISATTY(fileno(SP_PARM ? SP_PARM->_ofp : stdout)) && getenv("BAUDRATE") != 0) { int ret; if ((ret = _nc_getenv_num("BAUDRATE")) <= 0) ret = 9600; ospeed = (NCURSES_OSPEED) _nc_ospeed(ret); returnCode(ret); } #endif if (IsValidTIScreen(SP_PARM)) { #ifdef USE_OLD_TTY result = (int) cfgetospeed(&(TerminalOf(SP_PARM)->Nttyb)); ospeed = (NCURSES_OSPEED) _nc_ospeed(result); #else /* !USE_OLD_TTY */ #ifdef TERMIOS ospeed = (NCURSES_OSPEED) cfgetospeed(&(TerminalOf(SP_PARM)->Nttyb)); #else ospeed = (NCURSES_OSPEED) TerminalOf(SP_PARM)->Nttyb.sg_ospeed; #endif result = _nc_baudrate(ospeed); #endif TerminalOf(SP_PARM)->_baudrate = result; } else { result = ERR; } returnCode(result); }
baudrate(void) { int result; T((T_CALLED("baudrate()"))); /* * In debugging, allow the environment symbol to override when we're * redirecting to a file, so we can construct repeatable test-cases * that take into account costs that depend on baudrate. */ #ifdef TRACE if (!isatty(fileno(SP ? SP->_ofp : stdout)) && getenv("BAUDRATE") != 0) { int ret; if ((ret = _nc_getenv_num("BAUDRATE")) <= 0) ret = 9600; ospeed = _nc_ospeed(ret); returnCode(ret); } #endif if (cur_term != 0) { #ifdef USE_OLD_TTY result = cfgetospeed(&cur_term->Nttyb); ospeed = _nc_ospeed(result); #else /* !USE_OLD_TTY */ #ifdef TERMIOS ospeed = cfgetospeed(&cur_term->Nttyb); #else ospeed = cur_term->Nttyb.sg_ospeed; #endif result = _nc_baudrate(ospeed); #endif cur_term->_baudrate = result; } else { result = ERR; } returnCode(result); }
set_curterm(TERMINAL * termp) { TERMINAL *oldterm = cur_term; T((T_CALLED("set_curterm(%p)"), termp)); if ((cur_term = termp) != 0) { ospeed = _nc_ospeed(cur_term->_baudrate); PC = (pad_char != NULL) ? pad_char[0] : 0; } T((T_RETURN("%p"), oldterm)); return (oldterm); }