5 * Keith Bostic. All rights reserved.
7 * See the LICENSE file for redistribution information.
13 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";
16 #include <sys/types.h>
17 #include <sys/queue.h>
19 #include <bitstring.h>
22 #include "../common/common.h"
23 #include "../ipc/ip.h"
28 * Initialize/shutdown the IP screen.
30 * PUBLIC: int ip_screen __P((SCR *, u_int32_t));
33 ip_screen(SCR
*sp
, u_int32_t flags
)
41 /* See if the current information is incorrect. */
42 if (F_ISSET(gp
, G_SRESTART
)) {
45 F_CLR(gp
, G_SRESTART
);
48 /* See if we're already in the right mode. */
49 if (LF_ISSET(SC_EX
) && F_ISSET(sp
, SC_SCR_EX
) ||
50 LF_ISSET(SC_VI
) && F_ISSET(sp
, SC_SCR_VI
))
53 /* Ex isn't possible if there is no terminal. */
54 if (LF_ISSET(SC_EX
) && ipp
->t_fd
== -1)
57 if (F_ISSET(sp
, SC_SCR_EX
))
60 if (F_ISSET(sp
, SC_SCR_VI
))
63 if (LF_ISSET(SC_EX
)) {
66 /* Initialize terminal based information. */
71 F_SET(ipp
, IP_SCR_VI_INIT
);
78 * Shutdown the screens.
80 * PUBLIC: int ip_quit __P((WIN *));
88 /* Clean up the terminal mappings. */
89 rval
= ip_term_end(wp
->gp
);
92 F_CLR(ipp
, IP_SCR_VI_INIT
);