only clean out gs when last window goes
[nvi.git] / cl / cl.h
blob5fb63ea403d090d9df83df9e343a5b523d7ea3b2
1 /*-
2 * Copyright (c) 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 * Copyright (c) 1993, 1994, 1995, 1996
5 * Keith Bostic. All rights reserved.
7 * See the LICENSE file for redistribution information.
9 * $Id: cl.h,v 10.23 2000/05/07 19:49:39 skimo Exp $ (Berkeley) $Date: 2000/05/07 19:49:39 $
12 typedef struct _cl_private {
13 CHAR_T ibuf[256]; /* Input keys. */
15 int eof_count; /* EOF count. */
17 struct termios orig; /* Original terminal values. */
18 struct termios ex_enter;/* Terminal values to enter ex. */
19 struct termios vi_enter;/* Terminal values to enter vi. */
21 char *el; /* Clear to EOL terminal string. */
22 char *cup; /* Cursor movement terminal string. */
23 char *cuu1; /* Cursor up terminal string. */
24 char *rmso, *smso; /* Inverse video terminal strings. */
25 char *smcup, *rmcup; /* Terminal start/stop strings. */
27 char *oname; /* Original screen window name. */
29 int killersig; /* Killer signal. */
30 #define INDX_HUP 0
31 #define INDX_INT 1
32 #define INDX_TERM 2
33 #define INDX_WINCH 3
34 #define INDX_MAX 4 /* Original signal information. */
35 struct sigaction oact[INDX_MAX];
37 enum { /* Tty group write mode. */
38 TGW_UNKNOWN=0, TGW_SET, TGW_UNSET } tgw;
40 enum { /* Terminal initialization strings. */
41 TE_SENT=0, TI_SENT } ti_te;
43 #define CL_IN_EX 0x0001 /* Currently running ex. */
44 #define CL_LAYOUT 0x0002 /* Screen layout changed. */
45 #define CL_RENAME 0x0004 /* X11 xterm icon/window renamed. */
46 #define CL_RENAME_OK 0x0008 /* User wants the windows renamed. */
47 #define CL_SCR_EX_INIT 0x0010 /* Ex screen initialized. */
48 #define CL_SCR_VI_INIT 0x0020 /* Vi screen initialized. */
49 #define CL_SIGHUP 0x0040 /* SIGHUP arrived. */
50 #define CL_SIGINT 0x0080 /* SIGINT arrived. */
51 #define CL_SIGTERM 0x0100 /* SIGTERM arrived. */
52 #define CL_SIGWINCH 0x0200 /* SIGWINCH arrived. */
53 #define CL_STDIN_TTY 0x0400 /* Talking to a terminal. */
54 u_int32_t flags;
55 } CL_PRIVATE;
57 #define CLP(sp) ((CL_PRIVATE *)((sp)->gp->cl_private))
58 #define GCLP(gp) ((CL_PRIVATE *)gp->cl_private)
59 #define CLSP(sp) ((WINDOW *)((sp)->cl_private))
61 /* Return possibilities from the keyboard read routine. */
62 typedef enum { INP_OK=0, INP_EOF, INP_ERR, INP_INTR, INP_TIMEOUT } input_t;
64 /* The screen position relative to a specific window. */
66 #define RCNO(sp, cno) (sp)->coff + (cno)
67 #define RLNO(sp, lno) (sp)->roff + (lno)
69 #define RCNO(sp, cno) (cno)
70 #define RLNO(sp, lno) (lno)
73 * XXX
74 * Some implementations of curses.h don't define these for us. Used for
75 * compatibility only.
77 #ifndef TRUE
78 #define TRUE 1
79 #endif
80 #ifndef FALSE
81 #define FALSE 0
82 #endif
84 #include "extern.h"