1994-10-07 08:58:58 +00:00
|
|
|
|
|
|
|
/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for *
|
|
|
|
* details. If they are missing then this copy is in violation of *
|
|
|
|
* the copyright conditions. */
|
|
|
|
|
|
|
|
/*
|
|
|
|
** lib_endwin.c
|
|
|
|
**
|
|
|
|
** The routine endwin().
|
|
|
|
**
|
|
|
|
*/
|
|
|
|
|
1994-12-02 06:40:24 +00:00
|
|
|
#include "terminfo.h"
|
1994-10-07 08:58:58 +00:00
|
|
|
#include "curses.priv.h"
|
|
|
|
|
|
|
|
int isendwin()
|
|
|
|
{
|
1994-12-02 06:40:24 +00:00
|
|
|
if (SP == NULL)
|
|
|
|
return FALSE;
|
|
|
|
return SP->_endwin;
|
1994-10-07 08:58:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
endwin()
|
|
|
|
{
|
|
|
|
T(("endwin() called"));
|
|
|
|
|
1994-12-02 06:40:24 +00:00
|
|
|
SP->_endwin = TRUE;
|
1994-10-07 08:58:58 +00:00
|
|
|
|
1994-12-02 07:35:48 +00:00
|
|
|
if (change_scroll_region)
|
|
|
|
putp(tparm(change_scroll_region, 0, lines - 1));
|
|
|
|
|
1994-10-07 08:58:58 +00:00
|
|
|
mvcur(-1, -1, lines - 1, 0);
|
|
|
|
|
|
|
|
if (exit_ca_mode)
|
1994-12-02 06:40:24 +00:00
|
|
|
putp(exit_ca_mode);
|
1994-10-07 08:58:58 +00:00
|
|
|
|
1994-12-02 06:40:24 +00:00
|
|
|
if (SP->_coloron == TRUE)
|
|
|
|
putp(orig_pair);
|
1994-10-07 08:58:58 +00:00
|
|
|
|
1995-05-30 05:51:47 +00:00
|
|
|
if (curscr && (curscr->_attrs != A_NORMAL))
|
1994-10-07 08:58:58 +00:00
|
|
|
vidattr(curscr->_attrs = A_NORMAL);
|
|
|
|
|
1994-12-02 06:40:24 +00:00
|
|
|
if (SP->_cursor != 1)
|
|
|
|
putp(cursor_normal);
|
|
|
|
|
1994-10-07 08:58:58 +00:00
|
|
|
fflush(SP->_ofp);
|
|
|
|
|
|
|
|
return(reset_shell_mode());
|
|
|
|
}
|