xref: /original-bsd/lib/libedit/tty.h (revision f5b291e3)
1c04cbc9dSbostic /*-
2*f5b291e3Sbostic  * Copyright (c) 1992, 1993
3*f5b291e3Sbostic  *	The Regents of the University of California.  All rights reserved.
4c04cbc9dSbostic  *
5c04cbc9dSbostic  * This code is derived from software contributed to Berkeley by
6c04cbc9dSbostic  * Christos Zoulas of Cornell University.
7c04cbc9dSbostic  *
8c04cbc9dSbostic  * %sccs.include.redist.c%
9c04cbc9dSbostic  *
10*f5b291e3Sbostic  *	@(#)tty.h	8.1 (Berkeley) 06/04/93
11c04cbc9dSbostic  */
12c04cbc9dSbostic 
13c04cbc9dSbostic /*
14c04cbc9dSbostic  * el.tty.h: Local terminal header
15c04cbc9dSbostic  */
16c04cbc9dSbostic #ifndef _h_el_tty
17c04cbc9dSbostic #define _h_el_tty
18c04cbc9dSbostic 
19965a069bSmarc #include "histedit.h"
20c04cbc9dSbostic #include <termios.h>
21c04cbc9dSbostic 
22c04cbc9dSbostic /* Define our own since everyone gets it wrong! */
23c04cbc9dSbostic #define CONTROL(A)	((A) & 037)
24c04cbc9dSbostic 
25c04cbc9dSbostic /*
26c04cbc9dSbostic  * Aix compatible names
27c04cbc9dSbostic  */
28c04cbc9dSbostic # if defined(VWERSE) && !defined(VWERASE)
29c04cbc9dSbostic #  define VWERASE VWERSE
30c04cbc9dSbostic # endif /* VWERSE && !VWERASE */
31c04cbc9dSbostic 
32c04cbc9dSbostic # if defined(VDISCRD) && !defined(VDISCARD)
33c04cbc9dSbostic #  define VDISCARD VDISCRD
34c04cbc9dSbostic # endif /* VDISCRD && !VDISCARD */
35c04cbc9dSbostic 
36c04cbc9dSbostic # if defined(VFLUSHO) && !defined(VDISCARD)
37c04cbc9dSbostic #  define VDISCARD VFLUSHO
38c04cbc9dSbostic # endif  /* VFLUSHO && VDISCARD */
39c04cbc9dSbostic 
40c04cbc9dSbostic # if defined(VSTRT) && !defined(VSTART)
41c04cbc9dSbostic #  define VSTART VSTRT
42c04cbc9dSbostic # endif /* VSTRT && ! VSTART */
43c04cbc9dSbostic 
44c04cbc9dSbostic # if defined(VSTAT) && !defined(VSTATUS)
45c04cbc9dSbostic #  define VSTATUS VSTAT
46c04cbc9dSbostic # endif /* VSTAT && ! VSTATUS */
47c04cbc9dSbostic 
48c04cbc9dSbostic # ifndef ONLRET
49c04cbc9dSbostic #  define ONLRET 0
50c04cbc9dSbostic # endif /* ONLRET */
51c04cbc9dSbostic 
52c04cbc9dSbostic # ifndef TAB3
53c04cbc9dSbostic #  ifdef OXTABS
54c04cbc9dSbostic #   define TAB3 OXTABS
55c04cbc9dSbostic #  else
56c04cbc9dSbostic #   define TAB3 0
57c04cbc9dSbostic #  endif /* OXTABS */
58c04cbc9dSbostic # endif /* !TAB3 */
59c04cbc9dSbostic 
60c04cbc9dSbostic # if defined(OXTABS) && !defined(XTABS)
61c04cbc9dSbostic #  define XTABS OXTABS
62c04cbc9dSbostic # endif /* OXTABS && !XTABS */
63c04cbc9dSbostic 
64c04cbc9dSbostic # ifndef ONLCR
65c04cbc9dSbostic #  define ONLCR 0
66c04cbc9dSbostic # endif /* ONLCR */
67c04cbc9dSbostic 
68c04cbc9dSbostic # ifndef IEXTEN
69c04cbc9dSbostic #  define IEXTEN 0
70c04cbc9dSbostic # endif /* IEXTEN */
71c04cbc9dSbostic 
72c04cbc9dSbostic # ifndef ECHOCTL
73c04cbc9dSbostic #  define ECHOCTL 0
74c04cbc9dSbostic # endif /* ECHOCTL */
75c04cbc9dSbostic 
76c04cbc9dSbostic # ifndef PARENB
77c04cbc9dSbostic #  define PARENB 0
78c04cbc9dSbostic # endif /* PARENB */
79c04cbc9dSbostic 
80c04cbc9dSbostic # ifndef EXTPROC
81c04cbc9dSbostic #  define EXTPROC 0
82c04cbc9dSbostic # endif /* EXTPROC */
83c04cbc9dSbostic 
84c04cbc9dSbostic # ifndef FLUSHO
85c04cbc9dSbostic #  define FLUSHO  0
86c04cbc9dSbostic # endif /* FLUSHO */
87c04cbc9dSbostic 
88c04cbc9dSbostic 
89c04cbc9dSbostic # if defined(VDISABLE) && !defined(_POSIX_VDISABLE)
90c04cbc9dSbostic #  define _POSIX_VDISABLE VDISABLE
91c04cbc9dSbostic # endif /* VDISABLE && ! _POSIX_VDISABLE */
92c04cbc9dSbostic 
93c04cbc9dSbostic /*
94c04cbc9dSbostic  * Work around ISC's definition of IEXTEN which is
95c04cbc9dSbostic  * XCASE!
96c04cbc9dSbostic  */
97c04cbc9dSbostic # ifdef ISC
98c04cbc9dSbostic #  if defined(IEXTEN) && defined(XCASE)
99c04cbc9dSbostic #   if IEXTEN == XCASE
100c04cbc9dSbostic #    undef IEXTEN
101c04cbc9dSbostic #    define IEXTEN 0
102c04cbc9dSbostic #   endif /* IEXTEN == XCASE */
103c04cbc9dSbostic #  endif /* IEXTEN && XCASE */
104c04cbc9dSbostic #  if defined(IEXTEN) && !defined(XCASE)
105c04cbc9dSbostic #   define XCASE IEXTEN
106c04cbc9dSbostic #   undef IEXTEN
107c04cbc9dSbostic #   define IEXTEN 0
108c04cbc9dSbostic #  endif /* IEXTEN && !XCASE */
109c04cbc9dSbostic # endif /* ISC */
110c04cbc9dSbostic 
111c04cbc9dSbostic /*
112c04cbc9dSbostic  * Work around convex weirdness where turning off IEXTEN makes us
113c04cbc9dSbostic  * lose all postprocessing!
114c04cbc9dSbostic  */
115c04cbc9dSbostic #if defined(convex) || defined(__convex__)
116c04cbc9dSbostic # if defined(IEXTEN) && IEXTEN != 0
117c04cbc9dSbostic #  undef IEXTEN
118c04cbc9dSbostic #  define IEXTEN 0
119c04cbc9dSbostic # endif /* IEXTEN != 0 */
120c04cbc9dSbostic #endif /* convex || __convex__ */
121c04cbc9dSbostic 
122c04cbc9dSbostic 
123c04cbc9dSbostic 
124c04cbc9dSbostic #ifndef _POSIX_VDISABLE
125c04cbc9dSbostic # define _POSIX_VDISABLE ((unsigned char) -1)
126c04cbc9dSbostic #endif /* _POSIX_VDISABLE */
127c04cbc9dSbostic 
128c04cbc9dSbostic #if !defined(CREPRINT) && defined(CRPRNT)
129c04cbc9dSbostic # define CREPRINT CRPRNT
130c04cbc9dSbostic #endif /* !CREPRINT && CRPRNT */
131c04cbc9dSbostic #if !defined(CDISCARD) && defined(CFLUSH)
132c04cbc9dSbostic # define CDISCARD CFLUSH
133c04cbc9dSbostic #endif /* !CDISCARD && CFLUSH */
134c04cbc9dSbostic 
135c04cbc9dSbostic #ifndef CINTR
136c04cbc9dSbostic # define CINTR		CONTROL('c')
137c04cbc9dSbostic #endif /* CINTR */
138c04cbc9dSbostic #ifndef CQUIT
139c04cbc9dSbostic # define CQUIT		034	/* ^\ */
140c04cbc9dSbostic #endif /* CQUIT */
141c04cbc9dSbostic #ifndef CERASE
142c04cbc9dSbostic # define CERASE		0177	/* ^? */
143c04cbc9dSbostic #endif /* CERASE */
144c04cbc9dSbostic #ifndef CKILL
145c04cbc9dSbostic # define CKILL		CONTROL('u')
146c04cbc9dSbostic #endif /* CKILL */
147c04cbc9dSbostic #ifndef CEOF
148c04cbc9dSbostic # define CEOF		CONTROL('d')
149c04cbc9dSbostic #endif /* CEOF */
150c04cbc9dSbostic #ifndef CEOL
151c04cbc9dSbostic # define CEOL		_POSIX_VDISABLE
152c04cbc9dSbostic #endif /* CEOL */
153c04cbc9dSbostic #ifndef CEOL2
154c04cbc9dSbostic # define CEOL2		_POSIX_VDISABLE
155c04cbc9dSbostic #endif /* CEOL2 */
156c04cbc9dSbostic #ifndef CSWTCH
157c04cbc9dSbostic # define CSWTCH		_POSIX_VDISABLE
158c04cbc9dSbostic #endif /* CSWTCH */
159c04cbc9dSbostic #ifndef CDSWTCH
160c04cbc9dSbostic # define CDSWTCH	_POSIX_VDISABLE
161c04cbc9dSbostic #endif /* CDSWTCH */
162c04cbc9dSbostic #ifndef CERASE2
163c04cbc9dSbostic # define CERASE2	_POSIX_VDISABLE
164c04cbc9dSbostic #endif /* CERASE2 */
165c04cbc9dSbostic #ifndef CSTART
166c04cbc9dSbostic # define CSTART		CONTROL('q')
167c04cbc9dSbostic #endif /* CSTART */
168c04cbc9dSbostic #ifndef CSTOP
169c04cbc9dSbostic # define CSTOP		CONTROL('s')
170c04cbc9dSbostic #endif /* CSTOP */
171c04cbc9dSbostic #ifndef CSUSP
172c04cbc9dSbostic # define CSUSP		CONTROL('z')
173c04cbc9dSbostic #endif /* CSUSP */
174c04cbc9dSbostic #ifndef CDSUSP
175c04cbc9dSbostic # define CDSUSP		CONTROL('y')
176c04cbc9dSbostic #endif /* CDSUSP */
177c04cbc9dSbostic 
178c04cbc9dSbostic #ifdef hpux
179c04cbc9dSbostic 
180c04cbc9dSbostic # ifndef CREPRINT
181c04cbc9dSbostic #  define CREPRINT	_POSIX_VDISABLE
182c04cbc9dSbostic # endif /* CREPRINT */
183c04cbc9dSbostic # ifndef CDISCARD
184c04cbc9dSbostic #  define CDISCARD	_POSIX_VDISABLE
185c04cbc9dSbostic # endif /* CDISCARD */
186c04cbc9dSbostic # ifndef CLNEXT
187c04cbc9dSbostic #  define CLNEXT	_POSIX_VDISABLE
188c04cbc9dSbostic # endif /* CLNEXT */
189c04cbc9dSbostic # ifndef CWERASE
190c04cbc9dSbostic #  define CWERASE	_POSIX_VDISABLE
191c04cbc9dSbostic # endif /* CWERASE */
192c04cbc9dSbostic 
193c04cbc9dSbostic #else /* !hpux */
194c04cbc9dSbostic 
195c04cbc9dSbostic # ifndef CREPRINT
196c04cbc9dSbostic #  define CREPRINT	CONTROL('r')
197c04cbc9dSbostic # endif /* CREPRINT */
198c04cbc9dSbostic # ifndef CDISCARD
199c04cbc9dSbostic #  define CDISCARD	CONTROL('o')
200c04cbc9dSbostic # endif /* CDISCARD */
201c04cbc9dSbostic # ifndef CLNEXT
202c04cbc9dSbostic #  define CLNEXT	CONTROL('v')
203c04cbc9dSbostic # endif /* CLNEXT */
204c04cbc9dSbostic # ifndef CWERASE
205c04cbc9dSbostic #  define CWERASE	CONTROL('w')
206c04cbc9dSbostic # endif /* CWERASE */
207c04cbc9dSbostic 
208c04cbc9dSbostic #endif /* hpux */
209c04cbc9dSbostic 
210c04cbc9dSbostic #ifndef CSTATUS
211c04cbc9dSbostic # define CSTATUS	CONTROL('t')
212c04cbc9dSbostic #endif /* CSTATUS */
213c04cbc9dSbostic #ifndef CPAGE
214c04cbc9dSbostic # define CPAGE		' '
215c04cbc9dSbostic #endif /* CPAGE */
216c04cbc9dSbostic #ifndef CPGOFF
217c04cbc9dSbostic # define CPGOFF		CONTROL('m')
218c04cbc9dSbostic #endif /* CPGOFF */
219c04cbc9dSbostic #ifndef CKILL2
220c04cbc9dSbostic # define CKILL2		_POSIX_VDISABLE
221c04cbc9dSbostic #endif /* CKILL2 */
222c04cbc9dSbostic #ifndef CBRK
223c04cbc9dSbostic # ifndef masscomp
224c04cbc9dSbostic #  define CBRK		0377
225c04cbc9dSbostic # else
226c04cbc9dSbostic #  define CBRK		'\0'
227c04cbc9dSbostic # endif /* masscomp */
228c04cbc9dSbostic #endif /* CBRK */
229c04cbc9dSbostic #ifndef CMIN
230c04cbc9dSbostic # define CMIN		CEOF
231c04cbc9dSbostic #endif /* CMIN */
232c04cbc9dSbostic #ifndef CTIME
233c04cbc9dSbostic # define CTIME		CEOL
234c04cbc9dSbostic #endif /* CTIME */
235c04cbc9dSbostic 
236c04cbc9dSbostic /*
237c04cbc9dSbostic  * Fix for sun inconsistency. On termio VSUSP and the rest of the
238c04cbc9dSbostic  * ttychars > NCC are defined. So we undefine them.
239c04cbc9dSbostic  */
240c04cbc9dSbostic #if defined(TERMIO) || defined(POSIX)
241c04cbc9dSbostic # if defined(POSIX) && defined(NCCS)
242c04cbc9dSbostic #  define NUMCC		NCCS
243c04cbc9dSbostic # else
244c04cbc9dSbostic #  ifdef NCC
245c04cbc9dSbostic #   define NUMCC	NCC
246c04cbc9dSbostic #  endif /* NCC */
247c04cbc9dSbostic # endif /* POSIX && NCCS */
248c04cbc9dSbostic # ifdef NUMCC
249c04cbc9dSbostic #  ifdef VINTR
250c04cbc9dSbostic #   if NUMCC <= VINTR
251c04cbc9dSbostic #    undef VINTR
252c04cbc9dSbostic #   endif /* NUMCC <= VINTR */
253c04cbc9dSbostic #  endif /* VINTR */
254c04cbc9dSbostic #  ifdef VQUIT
255c04cbc9dSbostic #   if NUMCC <= VQUIT
256c04cbc9dSbostic #    undef VQUIT
257c04cbc9dSbostic #   endif /* NUMCC <= VQUIT */
258c04cbc9dSbostic #  endif /* VQUIT */
259c04cbc9dSbostic #  ifdef VERASE
260c04cbc9dSbostic #   if NUMCC <= VERASE
261c04cbc9dSbostic #    undef VERASE
262c04cbc9dSbostic #   endif /* NUMCC <= VERASE */
263c04cbc9dSbostic #  endif /* VERASE */
264c04cbc9dSbostic #  ifdef VKILL
265c04cbc9dSbostic #   if NUMCC <= VKILL
266c04cbc9dSbostic #    undef VKILL
267c04cbc9dSbostic #   endif /* NUMCC <= VKILL */
268c04cbc9dSbostic #  endif /* VKILL */
269c04cbc9dSbostic #  ifdef VEOF
270c04cbc9dSbostic #   if NUMCC <= VEOF
271c04cbc9dSbostic #    undef VEOF
272c04cbc9dSbostic #   endif /* NUMCC <= VEOF */
273c04cbc9dSbostic #  endif /* VEOF */
274c04cbc9dSbostic #  ifdef VEOL
275c04cbc9dSbostic #   if NUMCC <= VEOL
276c04cbc9dSbostic #    undef VEOL
277c04cbc9dSbostic #   endif /* NUMCC <= VEOL */
278c04cbc9dSbostic #  endif /* VEOL */
279c04cbc9dSbostic #  ifdef VEOL2
280c04cbc9dSbostic #   if NUMCC <= VEOL2
281c04cbc9dSbostic #    undef VEOL2
282c04cbc9dSbostic #   endif /* NUMCC <= VEOL2 */
283c04cbc9dSbostic #  endif /* VEOL2 */
284c04cbc9dSbostic #  ifdef VSWTCH
285c04cbc9dSbostic #   if NUMCC <= VSWTCH
286c04cbc9dSbostic #    undef VSWTCH
287c04cbc9dSbostic #   endif /* NUMCC <= VSWTCH */
288c04cbc9dSbostic #  endif /* VSWTCH */
289c04cbc9dSbostic #  ifdef VDSWTCH
290c04cbc9dSbostic #   if NUMCC <= VDSWTCH
291c04cbc9dSbostic #    undef VDSWTCH
292c04cbc9dSbostic #   endif /* NUMCC <= VDSWTCH */
293c04cbc9dSbostic #  endif /* VDSWTCH */
294c04cbc9dSbostic #  ifdef VERASE2
295c04cbc9dSbostic #   if NUMCC <= VERASE2
296c04cbc9dSbostic #    undef VERASE2
297c04cbc9dSbostic #   endif /* NUMCC <= VERASE2 */
298c04cbc9dSbostic #  endif /* VERASE2 */
299c04cbc9dSbostic #  ifdef VSTART
300c04cbc9dSbostic #   if NUMCC <= VSTART
301c04cbc9dSbostic #    undef VSTART
302c04cbc9dSbostic #   endif /* NUMCC <= VSTART */
303c04cbc9dSbostic #  endif /* VSTART */
304c04cbc9dSbostic #  ifdef VSTOP
305c04cbc9dSbostic #   if NUMCC <= VSTOP
306c04cbc9dSbostic #    undef VSTOP
307c04cbc9dSbostic #   endif /* NUMCC <= VSTOP */
308c04cbc9dSbostic #  endif /* VSTOP */
309c04cbc9dSbostic #  ifdef VWERASE
310c04cbc9dSbostic #   if NUMCC <= VWERASE
311c04cbc9dSbostic #    undef VWERASE
312c04cbc9dSbostic #   endif /* NUMCC <= VWERASE */
313c04cbc9dSbostic #  endif /* VWERASE */
314c04cbc9dSbostic #  ifdef VSUSP
315c04cbc9dSbostic #   if NUMCC <= VSUSP
316c04cbc9dSbostic #    undef VSUSP
317c04cbc9dSbostic #   endif /* NUMCC <= VSUSP */
318c04cbc9dSbostic #  endif /* VSUSP */
319c04cbc9dSbostic #  ifdef VDSUSP
320c04cbc9dSbostic #   if NUMCC <= VDSUSP
321c04cbc9dSbostic #    undef VDSUSP
322c04cbc9dSbostic #   endif /* NUMCC <= VDSUSP */
323c04cbc9dSbostic #  endif /* VDSUSP */
324c04cbc9dSbostic #  ifdef VREPRINT
325c04cbc9dSbostic #   if NUMCC <= VREPRINT
326c04cbc9dSbostic #    undef VREPRINT
327c04cbc9dSbostic #   endif /* NUMCC <= VREPRINT */
328c04cbc9dSbostic #  endif /* VREPRINT */
329c04cbc9dSbostic #  ifdef VDISCARD
330c04cbc9dSbostic #   if NUMCC <= VDISCARD
331c04cbc9dSbostic #    undef VDISCARD
332c04cbc9dSbostic #   endif /* NUMCC <= VDISCARD */
333c04cbc9dSbostic #  endif /* VDISCARD */
334c04cbc9dSbostic #  ifdef VLNEXT
335c04cbc9dSbostic #   if NUMCC <= VLNEXT
336c04cbc9dSbostic #    undef VLNEXT
337c04cbc9dSbostic #   endif /* NUMCC <= VLNEXT */
338c04cbc9dSbostic #  endif /* VLNEXT */
339c04cbc9dSbostic #  ifdef VSTATUS
340c04cbc9dSbostic #   if NUMCC <= VSTATUS
341c04cbc9dSbostic #    undef VSTATUS
342c04cbc9dSbostic #   endif /* NUMCC <= VSTATUS */
343c04cbc9dSbostic #  endif /* VSTATUS */
344c04cbc9dSbostic #  ifdef VPAGE
345c04cbc9dSbostic #   if NUMCC <= VPAGE
346c04cbc9dSbostic #    undef VPAGE
347c04cbc9dSbostic #   endif /* NUMCC <= VPAGE */
348c04cbc9dSbostic #  endif /* VPAGE */
349c04cbc9dSbostic #  ifdef VPGOFF
350c04cbc9dSbostic #   if NUMCC <= VPGOFF
351c04cbc9dSbostic #    undef VPGOFF
352c04cbc9dSbostic #   endif /* NUMCC <= VPGOFF */
353c04cbc9dSbostic #  endif /* VPGOFF */
354c04cbc9dSbostic #  ifdef VKILL2
355c04cbc9dSbostic #   if NUMCC <= VKILL2
356c04cbc9dSbostic #    undef VKILL2
357c04cbc9dSbostic #   endif /* NUMCC <= VKILL2 */
358c04cbc9dSbostic #  endif /* VKILL2 */
359c04cbc9dSbostic #  ifdef VBRK
360c04cbc9dSbostic #   if NUMCC <= VBRK
361c04cbc9dSbostic #    undef VBRK
362c04cbc9dSbostic #   endif /* NUMCC <= VBRK */
363c04cbc9dSbostic #  endif /* VBRK */
364c04cbc9dSbostic #  ifdef VMIN
365c04cbc9dSbostic #   if NUMCC <= VMIN
366c04cbc9dSbostic #    undef VMIN
367c04cbc9dSbostic #   endif /* NUMCC <= VMIN */
368c04cbc9dSbostic #  endif /* VMIN */
369c04cbc9dSbostic #  ifdef VTIME
370c04cbc9dSbostic #   if NUMCC <= VTIME
371c04cbc9dSbostic #    undef VTIME
372c04cbc9dSbostic #   endif /* NUMCC <= VTIME */
373c04cbc9dSbostic #  endif /* VTIME */
374c04cbc9dSbostic # endif /* NUMCC */
375c04cbc9dSbostic #endif /* !POSIX */
376c04cbc9dSbostic 
377c04cbc9dSbostic #define C_INTR		 0
378c04cbc9dSbostic #define C_QUIT		 1
379c04cbc9dSbostic #define C_ERASE		 2
380c04cbc9dSbostic #define C_KILL		 3
381c04cbc9dSbostic #define C_EOF		 4
382c04cbc9dSbostic #define C_EOL		 5
383c04cbc9dSbostic #define C_EOL2		 6
384c04cbc9dSbostic #define C_SWTCH		 7
385c04cbc9dSbostic #define C_DSWTCH	 8
386c04cbc9dSbostic #define C_ERASE2	 9
387c04cbc9dSbostic #define C_START		10
388c04cbc9dSbostic #define C_STOP		11
389c04cbc9dSbostic #define C_WERASE	12
390c04cbc9dSbostic #define C_SUSP		13
391c04cbc9dSbostic #define C_DSUSP		14
392c04cbc9dSbostic #define C_REPRINT	15
393c04cbc9dSbostic #define C_DISCARD	16
394c04cbc9dSbostic #define C_LNEXT		17
395c04cbc9dSbostic #define C_STATUS	18
396c04cbc9dSbostic #define C_PAGE		19
397c04cbc9dSbostic #define C_PGOFF		20
398c04cbc9dSbostic #define C_KILL2		21
399c04cbc9dSbostic #define C_BRK		22
400c04cbc9dSbostic #define C_MIN		23
401c04cbc9dSbostic #define C_TIME		24
402c04cbc9dSbostic #define C_NCC		25
403c04cbc9dSbostic #define C_SH(A)		(1 << (A))
404c04cbc9dSbostic 
405c04cbc9dSbostic /*
406c04cbc9dSbostic  * Terminal dependend data structures
407c04cbc9dSbostic  */
408c04cbc9dSbostic #define EX_IO	0	/* while we are executing	*/
409c04cbc9dSbostic #define ED_IO	1	/* while we are editing		*/
410c04cbc9dSbostic #define TS_IO	2	/* new mode from terminal	*/
411c04cbc9dSbostic #define QU_IO	2	/* used only for quoted chars	*/
412c04cbc9dSbostic #define NN_IO	3	/* The number of entries	*/
413c04cbc9dSbostic 
414c04cbc9dSbostic #define M_INP	0
415c04cbc9dSbostic #define M_OUT	1
416c04cbc9dSbostic #define M_CTL	2
417c04cbc9dSbostic #define M_LIN	3
418c04cbc9dSbostic #define M_CHAR	4
419c04cbc9dSbostic #define M_NN	5
420c04cbc9dSbostic 
421c04cbc9dSbostic typedef struct {
422c04cbc9dSbostic     char *t_name;
423c04cbc9dSbostic     int  t_setmask;
424c04cbc9dSbostic     int  t_clrmask;
425c04cbc9dSbostic } ttyperm_t[NN_IO][M_NN];
426c04cbc9dSbostic 
427c04cbc9dSbostic typedef unsigned char ttychar_t[NN_IO][C_NCC];
428c04cbc9dSbostic 
429c04cbc9dSbostic protected int	tty_init	__P((EditLine *));
430c04cbc9dSbostic protected void	tty_end		__P((EditLine *));
431c04cbc9dSbostic protected int	tty_stty	__P((EditLine *, int, char**));
432c04cbc9dSbostic protected int	tty_rawmode	__P((EditLine *));
433c04cbc9dSbostic protected int	tty_cookedmode	__P((EditLine *));
434c04cbc9dSbostic protected int	tty_quotemode	__P((EditLine *));
435c04cbc9dSbostic protected int	tty_noquotemode	__P((EditLine *));
4364835d4c2Schristos protected void	tty_bind_char	__P((EditLine *, int));
437c04cbc9dSbostic 
438c04cbc9dSbostic typedef struct {
439c04cbc9dSbostic     ttyperm_t t_t;
440c04cbc9dSbostic     ttychar_t t_c;
441c04cbc9dSbostic     struct termios t_ex, t_ed, t_ts;
442c04cbc9dSbostic     int t_tabs;
443c04cbc9dSbostic     int t_eight;
444c04cbc9dSbostic     speed_t t_speed;
445c04cbc9dSbostic     int t_mode;
446c04cbc9dSbostic     unsigned char t_vdisable;
447c04cbc9dSbostic } el_tty_t;
448c04cbc9dSbostic 
449c04cbc9dSbostic 
450c04cbc9dSbostic #endif /* _h_el_tty */
451