1 /* $NetBSD: ip_screen.c,v 1.3 2014/01/26 21:43:45 christos Exp $ */
4 * Keith Bostic. All rights reserved.
6 * See the LICENSE file for redistribution information.
11 #include <sys/cdefs.h>
14 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 ";
17 __RCSID("$NetBSD: ip_screen.c,v 1.3 2014/01/26 21:43:45 christos Exp $");
20 #include <sys/types.h>
21 #include <sys/queue.h>
23 #include <bitstring.h>
26 #include "../common/common.h"
27 #include "../ipc/ip.h"
31 * Initialize/shutdown the IP screen.
33 * PUBLIC: int ip_screen __P((SCR *, u_int32_t));
36 ip_screen(SCR
*sp
, u_int32_t flags
)
44 /* See if the current information is incorrect. */
45 if (F_ISSET(gp
, G_SRESTART
)) {
48 F_CLR(gp
, G_SRESTART
);
51 /* See if we're already in the right mode. */
52 if ((LF_ISSET(SC_EX
) && F_ISSET(sp
, SC_SCR_EX
)) ||
53 (LF_ISSET(SC_VI
) && F_ISSET(sp
, SC_SCR_VI
)))
56 /* Ex isn't possible if there is no terminal. */
57 if (LF_ISSET(SC_EX
) && ipp
->t_fd
== -1)
60 if (F_ISSET(sp
, SC_SCR_EX
))
63 if (F_ISSET(sp
, SC_SCR_VI
))
66 if (LF_ISSET(SC_EX
)) {
69 /* Initialize terminal based information. */
74 F_SET(ipp
, IP_SCR_VI_INIT
);
81 * Shutdown the screens.
83 * PUBLIC: int ip_quit __P((WIN *));
91 /* Clean up the terminal mappings. */
92 rval
= ip_term_end(wp
->gp
);
95 F_CLR(ipp
, IP_SCR_VI_INIT
);