distrib: run libtoolize
[nvi.git] / cl / cl.h
blob3d714105cbe43f504607bc676e266a8284be5910
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.32 2001/08/28 11:33:40 skimo Exp $ (Berkeley) $Date: 2001/08/28 11:33:40 $
12 /* Avoid clash on OSF1 */
13 #undef DB
15 #ifdef USE_SLANG_CURSES
16 #include <slcurses.h>
17 #else
18 #ifdef HAVE_NCURSESW_NCURSES_H /* { */
19 #include <ncursesw/ncurses.h>
20 #else /* } { */
21 #ifdef HAVE_NCURSES_H /* { */
22 #include <ncurses.h>
23 #else /* } { */
24 #include <curses.h>
25 #endif /* } */
26 #endif
27 #endif
29 typedef struct _cl_private {
30 char ibuf[256]; /* Input keys. */
32 size_t skip; /* Remaining keys. */
34 CONVWIN cw; /* Conversion buffer. */
36 int eof_count; /* EOF count. */
38 struct termios orig; /* Original terminal values. */
39 struct termios ex_enter;/* Terminal values to enter ex. */
40 struct termios vi_enter;/* Terminal values to enter vi. */
42 char *el; /* Clear to EOL terminal string. */
43 char *cup; /* Cursor movement terminal string. */
44 char *cuu1; /* Cursor up terminal string. */
45 char *rmso, *smso; /* Inverse video terminal strings. */
46 char *smcup, *rmcup; /* Terminal start/stop strings. */
48 char *oname; /* Original screen window name. */
50 SCR *focus; /* Screen that has the "focus". */
52 int killersig; /* Killer signal. */
53 #define INDX_HUP 0
54 #define INDX_INT 1
55 #define INDX_TERM 2
56 #define INDX_WINCH 3
57 #define INDX_MAX 4 /* Original signal information. */
58 struct sigaction oact[INDX_MAX];
60 enum { /* Tty group write mode. */
61 TGW_UNKNOWN=0, TGW_SET, TGW_UNSET } tgw;
63 enum { /* Terminal initialization strings. */
64 TE_SENT=0, TI_SENT } ti_te;
66 #define CL_IN_EX 0x0001 /* Currently running ex. */
67 #define CL_LAYOUT 0x0002 /* Screen layout changed. */
68 #define CL_RENAME 0x0004 /* X11 xterm icon/window renamed. */
69 #define CL_RENAME_OK 0x0008 /* User wants the windows renamed. */
70 #define CL_SCR_EX_INIT 0x0010 /* Ex screen initialized. */
71 #define CL_SCR_VI_INIT 0x0020 /* Vi screen initialized. */
72 #define CL_SIGHUP 0x0040 /* SIGHUP arrived. */
73 #define CL_SIGINT 0x0080 /* SIGINT arrived. */
74 #define CL_SIGTERM 0x0100 /* SIGTERM arrived. */
75 #define CL_SIGWINCH 0x0200 /* SIGWINCH arrived. */
76 #define CL_STDIN_TTY 0x0400 /* Talking to a terminal. */
77 u_int32_t flags;
78 } CL_PRIVATE;
80 #define CLP(sp) ((CL_PRIVATE *)((sp)->gp->cl_private))
81 #define GCLP(gp) ((CL_PRIVATE *)gp->cl_private)
82 #define CLSP(sp) ((WINDOW *)((sp)->cl_private))
84 /* Return possibilities from the keyboard read routine. */
85 typedef enum { INP_OK=0, INP_EOF, INP_ERR, INP_INTR, INP_TIMEOUT } input_t;
87 /* The screen position relative to a specific window. */
89 #define RCNO(sp, cno) (sp)->coff + (cno)
90 #define RLNO(sp, lno) (sp)->roff + (lno)
92 #define RCNO(sp, cno) (cno)
93 #define RLNO(sp, lno) (lno)
96 * XXX
97 * Some implementations of curses.h don't define these for us. Used for
98 * compatibility only.
100 #ifndef TRUE
101 #define TRUE 1
102 #endif
103 #ifndef FALSE
104 #define FALSE 0
105 #endif
107 #include "extern.h"
109 #ifdef USE_PERL_SETENV
110 #include "../perl_api/extern.h"
111 #define cl_setenv(sp,name,val) perl_setenv(sp,name,val)
112 #define cl_unsetenv(sp,name) perl_setenv(sp,name,NULL)
113 #else
114 #define cl_setenv(sp,name,val) setenv(name,val,1)
115 #define cl_unsetenv(sp,name) unsetenv(name)
116 #endif