summaryrefslogtreecommitdiffstats
path: root/lib/libncurses/lib_endwin.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libncurses/lib_endwin.c')
-rw-r--r--lib/libncurses/lib_endwin.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/lib/libncurses/lib_endwin.c b/lib/libncurses/lib_endwin.c
new file mode 100644
index 0000000..4e07e8f
--- /dev/null
+++ b/lib/libncurses/lib_endwin.c
@@ -0,0 +1,50 @@
+
+/* 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().
+**
+*/
+
+#include "terminfo.h"
+#include "curses.priv.h"
+
+int isendwin()
+{
+ if (SP == NULL)
+ return FALSE;
+ return SP->_endwin;
+}
+
+int
+endwin()
+{
+ T(("endwin() called"));
+
+ SP->_endwin = TRUE;
+
+ if (change_scroll_region)
+ putp(tparm(change_scroll_region, 0, lines - 1));
+
+ mvcur(-1, -1, lines - 1, 0);
+
+ if (exit_ca_mode)
+ putp(exit_ca_mode);
+
+ if (SP->_coloron == TRUE)
+ putp(orig_pair);
+
+ if (curscr && (curscr->_attrs != A_NORMAL))
+ vidattr(curscr->_attrs = A_NORMAL);
+
+ if (SP->_cursor != 1)
+ putp(cursor_normal);
+
+ fflush(SP->_ofp);
+
+ return(reset_shell_mode());
+}
OpenPOWER on IntegriCloud