1 /* $NetBSD: ip_screen.c,v 1.2 2013/11/22 15:52:05 christos Exp $ */
4 * Keith Bostic. All rights reserved.
6 * See the LICENSE file for redistribution information.
12 static const char sccsid
[] = "Id: ip_screen.c,v 8.8 2001/06/25 15:19:24 skimo Exp (Berkeley) Date: 2001/06/25 15:19:24 ";
15 #include <sys/types.h>
16 #include <sys/queue.h>
18 #include <bitstring.h>
21 #include "../common/common.h"
22 #include "../ipc/ip.h"
26 * Initialize/shutdown the IP screen.
28 * PUBLIC: int ip_screen __P((SCR *, u_int32_t));
31 ip_screen(SCR
*sp
, u_int32_t flags
)
39 /* See if the current information is incorrect. */
40 if (F_ISSET(gp
, G_SRESTART
)) {
43 F_CLR(gp
, G_SRESTART
);
46 /* See if we're already in the right mode. */
47 if ((LF_ISSET(SC_EX
) && F_ISSET(sp
, SC_SCR_EX
)) ||
48 (LF_ISSET(SC_VI
) && F_ISSET(sp
, SC_SCR_VI
)))
51 /* Ex isn't possible if there is no terminal. */
52 if (LF_ISSET(SC_EX
) && ipp
->t_fd
== -1)
55 if (F_ISSET(sp
, SC_SCR_EX
))
58 if (F_ISSET(sp
, SC_SCR_VI
))
61 if (LF_ISSET(SC_EX
)) {
64 /* Initialize terminal based information. */
69 F_SET(ipp
, IP_SCR_VI_INIT
);
76 * Shutdown the screens.
78 * PUBLIC: int ip_quit __P((WIN *));
86 /* Clean up the terminal mappings. */
87 rval
= ip_term_end(wp
->gp
);
90 F_CLR(ipp
, IP_SCR_VI_INIT
);