the script used to extract a release
[nvi.git] / cl / cl.h
blob016e94c88afd5c14966e19a0fc29fcdac95aed54
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.25 2000/09/02 12:31:42 skimo Exp $ (Berkeley) $Date: 2000/09/02 12:31:42 $
11 #ifdef USE_SLANG_CURSES
12 #include <slcurses.h>
13 #else
14 #ifdef HAVE_NCURSES_H
15 #include <ncurses.h>
16 #else
17 #include <curses.h>
18 #endif
19 #endif
21 typedef struct _cl_private {
22 CHAR_T ibuf[256]; /* Input keys. */
24 int eof_count; /* EOF count. */
26 struct termios orig; /* Original terminal values. */
27 struct termios ex_enter;/* Terminal values to enter ex. */
28 struct termios vi_enter;/* Terminal values to enter vi. */
30 char *el; /* Clear to EOL terminal string. */
31 char *cup; /* Cursor movement terminal string. */
32 char *cuu1; /* Cursor up terminal string. */
33 char *rmso, *smso; /* Inverse video terminal strings. */
34 char *smcup, *rmcup; /* Terminal start/stop strings. */
36 char *oname; /* Original screen window name. */
38 int killersig; /* Killer signal. */
39 #define INDX_HUP 0
40 #define INDX_INT 1
41 #define INDX_TERM 2
42 #define INDX_WINCH 3
43 #define INDX_MAX 4 /* Original signal information. */
44 struct sigaction oact[INDX_MAX];
46 enum { /* Tty group write mode. */
47 TGW_UNKNOWN=0, TGW_SET, TGW_UNSET } tgw;
49 enum { /* Terminal initialization strings. */
50 TE_SENT=0, TI_SENT } ti_te;
52 #define CL_IN_EX 0x0001 /* Currently running ex. */
53 #define CL_LAYOUT 0x0002 /* Screen layout changed. */
54 #define CL_RENAME 0x0004 /* X11 xterm icon/window renamed. */
55 #define CL_RENAME_OK 0x0008 /* User wants the windows renamed. */
56 #define CL_SCR_EX_INIT 0x0010 /* Ex screen initialized. */
57 #define CL_SCR_VI_INIT 0x0020 /* Vi screen initialized. */
58 #define CL_SIGHUP 0x0040 /* SIGHUP arrived. */
59 #define CL_SIGINT 0x0080 /* SIGINT arrived. */
60 #define CL_SIGTERM 0x0100 /* SIGTERM arrived. */
61 #define CL_SIGWINCH 0x0200 /* SIGWINCH arrived. */
62 #define CL_STDIN_TTY 0x0400 /* Talking to a terminal. */
63 u_int32_t flags;
64 } CL_PRIVATE;
66 #define CLP(sp) ((CL_PRIVATE *)((sp)->gp->cl_private))
67 #define GCLP(gp) ((CL_PRIVATE *)gp->cl_private)
68 #define CLSP(sp) ((WINDOW *)((sp)->cl_private))
70 /* Return possibilities from the keyboard read routine. */
71 typedef enum { INP_OK=0, INP_EOF, INP_ERR, INP_INTR, INP_TIMEOUT } input_t;
73 /* The screen position relative to a specific window. */
75 #define RCNO(sp, cno) (sp)->coff + (cno)
76 #define RLNO(sp, lno) (sp)->roff + (lno)
78 #define RCNO(sp, cno) (cno)
79 #define RLNO(sp, lno) (lno)
82 * XXX
83 * Some implementations of curses.h don't define these for us. Used for
84 * compatibility only.
86 #ifndef TRUE
87 #define TRUE 1
88 #endif
89 #ifndef FALSE
90 #define FALSE 0
91 #endif
93 #include "extern.h"