1 /* $NetBSD: cl.h,v 1.2 2013/11/22 15:52:05 christos Exp $ */
3 * Copyright (c) 1993, 1994
4 * The Regents of the University of California. All rights reserved.
5 * Copyright (c) 1993, 1994, 1995, 1996
6 * Keith Bostic. All rights reserved.
8 * See the LICENSE file for redistribution information.
10 * Id: cl.h,v 10.32 2001/08/28 11:33:40 skimo Exp (Berkeley) Date: 2001/08/28 11:33:40
13 /* Avoid clash on OSF1 */
16 #ifdef USE_SLANG_CURSES
19 #ifdef HAVE_NCURSESW_NCURSES_H /* { */
20 #include <ncursesw/ncurses.h>
22 #ifdef HAVE_NCURSES_H /* { */
32 typedef struct _cl_private
{
33 char ibuf
[256]; /* Input keys. */
35 size_t skip
; /* Remaining keys. */
37 CONVWIN cw
; /* Conversion buffer. */
39 int eof_count
; /* EOF count. */
41 struct termios orig
; /* Original terminal values. */
42 struct termios ex_enter
;/* Terminal values to enter ex. */
43 struct termios vi_enter
;/* Terminal values to enter vi. */
45 char *el
; /* Clear to EOL terminal string. */
46 char *cup
; /* Cursor movement terminal string. */
47 char *cuu1
; /* Cursor up terminal string. */
48 char *rmso
, *smso
; /* Inverse video terminal strings. */
49 char *smcup
, *rmcup
; /* Terminal start/stop strings. */
51 char *oname
; /* Original screen window name. */
53 SCR
*focus
; /* Screen that has the "focus". */
55 int killersig
; /* Killer signal. */
60 #define INDX_MAX 4 /* Original signal information. */
61 struct sigaction oact
[INDX_MAX
];
63 enum { /* Tty group write mode. */
64 TGW_UNKNOWN
=0, TGW_SET
, TGW_UNSET
} tgw
;
66 enum { /* Terminal initialization strings. */
67 TE_SENT
=0, TI_SENT
} ti_te
;
69 #define CL_IN_EX 0x0001 /* Currently running ex. */
70 #define CL_LAYOUT 0x0002 /* Screen layout changed. */
71 #define CL_RENAME 0x0004 /* X11 xterm icon/window renamed. */
72 #define CL_RENAME_OK 0x0008 /* User wants the windows renamed. */
73 #define CL_SCR_EX_INIT 0x0010 /* Ex screen initialized. */
74 #define CL_SCR_VI_INIT 0x0020 /* Vi screen initialized. */
75 #define CL_SIGHUP 0x0040 /* SIGHUP arrived. */
76 #define CL_SIGINT 0x0080 /* SIGINT arrived. */
77 #define CL_SIGTERM 0x0100 /* SIGTERM arrived. */
78 #define CL_SIGWINCH 0x0200 /* SIGWINCH arrived. */
79 #define CL_STDIN_TTY 0x0400 /* Talking to a terminal. */
83 #define CLP(sp) ((CL_PRIVATE *)((sp)->gp->cl_private))
84 #define GCLP(gp) ((CL_PRIVATE *)gp->cl_private)
85 #define CLSP(sp) ((WINDOW *)((sp)->cl_private))
87 /* Return possibilities from the keyboard read routine. */
88 typedef enum { INP_OK
=0, INP_EOF
, INP_ERR
, INP_INTR
, INP_TIMEOUT
} input_t
;
90 /* The screen position relative to a specific window. */
92 #define RCNO(sp, cno) (sp)->coff + (cno)
93 #define RLNO(sp, lno) (sp)->roff + (lno)
95 #define RCNO(sp, cno) (cno)
96 #define RLNO(sp, lno) (lno)
100 * Some implementations of curses.h don't define these for us. Used for
101 * compatibility only.
110 #include "cl_extern.h"
112 #ifdef USE_PERL_SETENV
113 #include "perl_api_extern.h"
114 #define cl_setenv(sp,name,val) perl_setenv(sp,name,val)
115 #define cl_unsetenv(sp,name) perl_setenv(sp,name,NULL)
117 #define cl_setenv(sp,name,val) setenv(name,val,1)
118 #define cl_unsetenv(sp,name) unsetenv(name)