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