2 /***************************************************************************
4 ****************************************************************************
5 * ncurses is copyright (C) 1992-1995 *
7 * zmbenhal@netcom.com *
9 * esr@snark.thyrsus.com *
11 * Permission is hereby granted to reproduce and distribute ncurses *
12 * by any means and for any fee, whether alone or as part of a *
13 * larger distribution, in source or in binary form, PROVIDED *
14 * this notice is included with any such distribution, and is not *
15 * removed from any of its header files. Mention of ncurses in any *
16 * applications linked with it is highly appreciated. *
18 * ncurses comes AS IS with no warranty, implied or expressed. *
20 ***************************************************************************/
26 * Misc. low-level routines:
36 * The baudrate() and delay_output() functions could logically live here,
37 * but are in other modules to reduce the static-link size of programs
38 * that use only these facilities.
41 #include <curses.priv.h>
42 #include <term.h> /* cur_term */
44 MODULE_ID("$Id: lib_kernel.c,v 1.13 1997/02/02 00:33:14 tom Exp $")
48 T((T_CALLED("napms(%d)"), ms));
50 usleep(1000*(unsigned)ms);
54 int reset_prog_mode(void)
56 T((T_CALLED("reset_prog_mode()")));
58 SET_TTY(cur_term->Filedes, &cur_term->Nttyb);
59 if (SP && stdscr && stdscr->_use_keypad)
66 int reset_shell_mode(void)
68 T((T_CALLED("reset_shell_mode()")));
76 SET_TTY(cur_term->Filedes, &cur_term->Ottyb);
83 * Return erase character as given in cur_term->Ottyb.
90 T((T_CALLED("erasechar()")));
93 returnCode(cur_term->Ottyb.c_cc[VERASE]);
95 returnCode(cur_term->Ottyb.sg_erase);
105 * Return kill character as given in cur_term->Ottyb.
112 T((T_CALLED("killchar()")));
115 returnCode(cur_term->Ottyb.c_cc[VKILL]);
117 returnCode(cur_term->Ottyb.sg_kill);
126 * Flush any input on cur_term->Filedes
132 T((T_CALLED("flushinp()")));
135 tcflush(cur_term->Filedes, TCIFLUSH);
139 ioctl(cur_term->Filedes, TIOCFLUSH, 0);
153 ** savetty() and resetty()
161 T((T_CALLED("savetty()")));
163 GET_TTY(cur_term->Filedes, &buf);
169 T((T_CALLED("resetty()")));
171 SET_TTY(cur_term->Filedes, &buf);