BSD 3 development
[unix-history] / usr / src / cmd / ex / ex_tty.h
CommitLineData
27704fe4
BJ
1/* Copyright (c) 1979 Regents of the University of California */
2/*
3 * Capabilities from termcap
4 *
5 * The description of terminals is a difficult business, and we only
6 * attempt to summarize the capabilities here; for a full description
7 * see the paper describing termcap.
8 *
9 * Capabilities from termcap are of three kinds - string valued options,
10 * numeric valued options, and boolean options. The string valued options
11 * are the most complicated, since they may include padding information,
12 * which we describe now.
13 *
14 * Intelligent terminals often require padding on intelligent operations
15 * at high (and sometimes even low) speed. This is specified by
16 * a number before the string in the capability, and has meaning for the
17 * capabilities which have a P at the front of their comment.
18 * This normally is a number of milliseconds to pad the operation.
19 * In the current system which has no true programmible delays, we
20 * do this by sending a sequence of pad characters (normally nulls, but
21 * specifiable as "pc"). In some cases, the pad is better computed
22 * as some number of milliseconds times the number of affected lines
23 * (to bottom of screen usually, except when terminals have insert modes
24 * which will shift several lines.) This is specified as '12*' e.g.
25 * before the capability to say 12 milliseconds per affected whatever
26 * (currently always line). Capabilities where this makes sense say P*.
27 */
28char tspace[256]; /* Space for capability strings */
29char *aoftspace; /* Address of tspace for relocation */
30
31char *AL; /* P* Add new blank line */
32char *BC; /* Back cursor */
33char *BT; /* P Back tab */
34char *CD; /* P* Clear to end of display */
35char *CE; /* P Clear to end of line */
36char *CL; /* P* Clear screen */
37char *CM; /* P Cursor motion */
38char *DC; /* P* Delete character */
39char *DL; /* P* Delete line sequence */
40char *DM; /* Delete mode (enter) */
41char *DO; /* Down line sequence */
42char *ED; /* End delete mode */
43char *EI; /* End insert mode */
44char *F0,*F1,*F2,*F3,*F4,*F5,*F6,*F7,*F8,*F9;
45 /* Strings sent by various function keys */
46char *HO; /* Home cursor */
47char *IC; /* P Insert character */
48char *IM; /* Insert mode (give as ':im=:' if 'ic' */
49char *IP; /* P* Insert pad after char ins'd using IM+IE */
50char *KD; /* Keypad down arrow */
51char *KE; /* Keypad don't xmit */
52char *KH; /* Keypad home key */
53char *KL; /* Keypad left arrow */
54char *KR; /* Keypad right arrow */
55char *KS; /* Keypad start xmitting */
56char *KU; /* Keypad up arrow */
57char *LL; /* Quick to last line, column 0 */
58char *ND; /* Non-destructive space */
59char PC; /* Pad character */
60char *SE; /* Standout end (may leave space) */
61char *SF; /* P Scroll forwards */
62char *SO; /* Stand out begin (may leave space) */
63char *SR; /* P Scroll backwards */
64char *TA; /* P Tab (other than ^I or with padding) */
65char *TE; /* Terminal end sequence */
66char *TI; /* Terminal initial sequence */
67char *UP; /* Upline */
68char *VB; /* Visible bell */
69char *VE; /* Visual end sequence */
70char *VS; /* Visual start sequence */
71bool AM; /* Automatic margins */
72bool BS; /* Backspace works */
73bool CA; /* Cursor addressible */
74bool DA; /* Display may be retained above */
75bool DB; /* Display may be retained below */
76bool EO; /* Can erase overstrikes with ' ' */
77bool GT; /* Gtty indicates tabs */
78bool HC; /* Hard copy terminal */
79bool HZ; /* Hazeltine ~ braindamage */
80bool IN; /* Insert-null blessing */
81bool MI; /* can move in insert mode */
82bool NC; /* No Cr - \r snds \r\n then eats \n (dm2500) */
83bool OS; /* Overstrike works */
84bool UL; /* Underlining works even though !os */
85bool XN; /* A newline gets eaten after wrap (concept) */
86bool XT; /* Tabs are destructive */
87 /* X? is reserved for severely nauseous glitches */
88 /* If there are enough of these we may need bit masks! */
89
90/*
91 * From the tty modes...
92 */
93bool NONL; /* Terminal can't hack linefeeds doing a CR */
94bool UPPERCASE; /* Ick! */
95short LINES; /* Number of lines on screen */
96short COLUMNS;
97short OCOLUMNS; /* Save COLUMNS for a hack in open mode */
98
99short outcol; /* Where the cursor is */
100short outline;
101
102short destcol; /* Where the cursor should be */
103short destline;
104
105#ifdef TIOCSETC
106struct tchars ottyc, nttyc; /* For V7 character masking */
107#endif
108struct sgttyb tty; /* Always stty/gtty using this one structure */
109bool normtty; /* Have to restor normal mode from normf */
110int normf; /* Restore tty flags to this (someday) */
111
112short WBOT;
113short WECHO;
114
115short costCM;
116
117#define MAXNOMACS 32 /* max number of macros */
118#define MAXCHARMACS 512 /* max # of chars total in macros */
119struct maps {
120 char *cap; /* pressing button that sends this.. */
121 char *mapto; /* .. maps to this string */
122 char *descr; /* legible description of key */
123};
124struct maps arrows[MAXNOMACS]; /* macro defs - 1st 5 built in */
125char mapspace[MAXCHARMACS];
126char *msnext; /* next free location in mapspace */