summaryrefslogtreecommitdiffstats
path: root/lib/libncurses/lib_endwin.c
blob: b32af2de5de37e6c242098904b7b6b0790efaea9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

/* 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 <nterm.h>
#include "curses.priv.h"

int _isendwin;

int isendwin()
{
	return _isendwin;
}

int
endwin()
{
	T(("endwin() called"));

	_isendwin = 1;

	mvcur(-1, -1, lines - 1, 0);

	if (exit_ca_mode)
	    tputs(exit_ca_mode, 1, _outc);

	if (_coloron == 1)
		tputs(orig_pair, 1, _outc);

	if (curscr  &&  (curscr->_attrs != A_NORMAL)) 
	    vidattr(curscr->_attrs = A_NORMAL);

	fflush(SP->_ofp);

	return(reset_shell_mode());
}
OpenPOWER on IntegriCloud