xref: /freebsd/contrib/tcsh/ed.term.h (revision 6560ac57ce879857203bc456cdc3849808dc0700)
1c80476e4SDavid E. O'Brien /*
2c80476e4SDavid E. O'Brien  * ed.term.h: Local terminal header
3c80476e4SDavid E. O'Brien  */
4c80476e4SDavid E. O'Brien /*-
5c80476e4SDavid E. O'Brien  * Copyright (c) 1980, 1991 The Regents of the University of California.
6c80476e4SDavid E. O'Brien  * All rights reserved.
7c80476e4SDavid E. O'Brien  *
8c80476e4SDavid E. O'Brien  * Redistribution and use in source and binary forms, with or without
9c80476e4SDavid E. O'Brien  * modification, are permitted provided that the following conditions
10c80476e4SDavid E. O'Brien  * are met:
11c80476e4SDavid E. O'Brien  * 1. Redistributions of source code must retain the above copyright
12c80476e4SDavid E. O'Brien  *    notice, this list of conditions and the following disclaimer.
13c80476e4SDavid E. O'Brien  * 2. Redistributions in binary form must reproduce the above copyright
14c80476e4SDavid E. O'Brien  *    notice, this list of conditions and the following disclaimer in the
15c80476e4SDavid E. O'Brien  *    documentation and/or other materials provided with the distribution.
1629301572SMark Peek  * 3. Neither the name of the University nor the names of its contributors
17c80476e4SDavid E. O'Brien  *    may be used to endorse or promote products derived from this software
18c80476e4SDavid E. O'Brien  *    without specific prior written permission.
19c80476e4SDavid E. O'Brien  *
20c80476e4SDavid E. O'Brien  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21c80476e4SDavid E. O'Brien  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22c80476e4SDavid E. O'Brien  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23c80476e4SDavid E. O'Brien  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24c80476e4SDavid E. O'Brien  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25c80476e4SDavid E. O'Brien  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26c80476e4SDavid E. O'Brien  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27c80476e4SDavid E. O'Brien  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28c80476e4SDavid E. O'Brien  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29c80476e4SDavid E. O'Brien  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30c80476e4SDavid E. O'Brien  * SUCH DAMAGE.
31c80476e4SDavid E. O'Brien  */
32c80476e4SDavid E. O'Brien #ifndef _h_ed_term
33c80476e4SDavid E. O'Brien #define _h_ed_term
34c80476e4SDavid E. O'Brien 
35c80476e4SDavid E. O'Brien #define TO_CONTROL(A)	((A) & 037)
36c80476e4SDavid E. O'Brien 
37c80476e4SDavid E. O'Brien #if defined(TERMIO) || defined(POSIX)
38c80476e4SDavid E. O'Brien /*
39c80476e4SDavid E. O'Brien  * Aix compatible names
40c80476e4SDavid E. O'Brien  */
41c80476e4SDavid E. O'Brien # if defined(VWERSE) && !defined(VWERASE)
42c80476e4SDavid E. O'Brien #  define VWERASE VWERSE
43c80476e4SDavid E. O'Brien # endif /* VWERSE && !VWERASE */
44c80476e4SDavid E. O'Brien 
45c80476e4SDavid E. O'Brien # if defined(VDISCRD) && !defined(VDISCARD)
46c80476e4SDavid E. O'Brien #  define VDISCARD VDISCRD
47c80476e4SDavid E. O'Brien # endif /* VDISCRD && !VDISCARD */
48c80476e4SDavid E. O'Brien 
49c80476e4SDavid E. O'Brien # if defined(VFLUSHO) && !defined(VDISCARD)
50c80476e4SDavid E. O'Brien #  define VDISCARD VFLUSHO
51c80476e4SDavid E. O'Brien # endif  /* VFLUSHO && VDISCARD */
52c80476e4SDavid E. O'Brien 
53c80476e4SDavid E. O'Brien # if defined(VSTRT) && !defined(VSTART)
54c80476e4SDavid E. O'Brien #  define VSTART VSTRT
55c80476e4SDavid E. O'Brien # endif /* VSTRT && ! VSTART */
56c80476e4SDavid E. O'Brien 
57c80476e4SDavid E. O'Brien # if defined(VSTAT) && !defined(VSTATUS)
58c80476e4SDavid E. O'Brien #  define VSTATUS VSTAT
59c80476e4SDavid E. O'Brien # endif /* VSTAT && ! VSTATUS */
60c80476e4SDavid E. O'Brien 
61c80476e4SDavid E. O'Brien # ifndef ONLRET
62c80476e4SDavid E. O'Brien #  define ONLRET 0
63c80476e4SDavid E. O'Brien # endif /* ONLRET */
64c80476e4SDavid E. O'Brien 
65c80476e4SDavid E. O'Brien # ifndef TAB3
66c80476e4SDavid E. O'Brien #  ifdef OXTABS
67c80476e4SDavid E. O'Brien #   define TAB3 OXTABS
68c80476e4SDavid E. O'Brien #  else
69c80476e4SDavid E. O'Brien #   define TAB3 0
70c80476e4SDavid E. O'Brien #  endif /* OXTABS */
71c80476e4SDavid E. O'Brien # endif /* !TAB3 */
72c80476e4SDavid E. O'Brien 
73c80476e4SDavid E. O'Brien # if defined(OXTABS) && !defined(XTABS)
74c80476e4SDavid E. O'Brien #  define XTABS OXTABS
75c80476e4SDavid E. O'Brien # endif /* OXTABS && !XTABS */
76c80476e4SDavid E. O'Brien 
77c80476e4SDavid E. O'Brien # ifndef ONLCR
78c80476e4SDavid E. O'Brien #  define ONLCR 0
79c80476e4SDavid E. O'Brien # endif /* ONLCR */
80c80476e4SDavid E. O'Brien 
81c80476e4SDavid E. O'Brien # ifndef IEXTEN
82c80476e4SDavid E. O'Brien #  define IEXTEN 0
83c80476e4SDavid E. O'Brien # endif /* IEXTEN */
84c80476e4SDavid E. O'Brien 
85c80476e4SDavid E. O'Brien /*
86c80476e4SDavid E. O'Brien  * emx garbage
87c80476e4SDavid E. O'Brien  */
88c80476e4SDavid E. O'Brien # ifndef IDEFAULT
89c80476e4SDavid E. O'Brien #  define IDEFAULT 0
90c80476e4SDavid E. O'Brien # endif /* IDEFAULT */
91c80476e4SDavid E. O'Brien 
92c80476e4SDavid E. O'Brien # ifndef IDELETE
93c80476e4SDavid E. O'Brien #  define IDELETE 0
94c80476e4SDavid E. O'Brien # endif /* IDELETE */
95c80476e4SDavid E. O'Brien 
96c80476e4SDavid E. O'Brien # ifndef ECHOCTL
97c80476e4SDavid E. O'Brien #  define ECHOCTL 0
98c80476e4SDavid E. O'Brien # endif /* ECHOCTL */
99c80476e4SDavid E. O'Brien 
100c80476e4SDavid E. O'Brien # ifndef PARENB
101c80476e4SDavid E. O'Brien #  define PARENB 0
102c80476e4SDavid E. O'Brien # endif /* PARENB */
103c80476e4SDavid E. O'Brien 
104c80476e4SDavid E. O'Brien # ifndef EXTPROC
105c80476e4SDavid E. O'Brien #  define EXTPROC 0
106c80476e4SDavid E. O'Brien # endif /* EXTPROC */
107c80476e4SDavid E. O'Brien 
108c80476e4SDavid E. O'Brien # ifndef FLUSHO
109c80476e4SDavid E. O'Brien #  define FLUSHO  0
110c80476e4SDavid E. O'Brien # endif /* FLUSHO */
111c80476e4SDavid E. O'Brien 
112c80476e4SDavid E. O'Brien 
113c80476e4SDavid E. O'Brien # if defined(VDISABLE) && !defined(_POSIX_VDISABLE)
114c80476e4SDavid E. O'Brien #  define _POSIX_VDISABLE VDISABLE
115c80476e4SDavid E. O'Brien # endif /* VDISABLE && ! _POSIX_VDISABLE */
116c80476e4SDavid E. O'Brien 
117c80476e4SDavid E. O'Brien /*
118c80476e4SDavid E. O'Brien  * Work around ISC's definition of IEXTEN which is
119c80476e4SDavid E. O'Brien  * XCASE!
120c80476e4SDavid E. O'Brien  */
121c80476e4SDavid E. O'Brien # ifdef ISC
122c80476e4SDavid E. O'Brien #  if defined(IEXTEN) && defined(XCASE)
123c80476e4SDavid E. O'Brien #   if IEXTEN == XCASE
124c80476e4SDavid E. O'Brien #    undef IEXTEN
125c80476e4SDavid E. O'Brien #    define IEXTEN 0
126c80476e4SDavid E. O'Brien #   endif /* IEXTEN == XCASE */
127c80476e4SDavid E. O'Brien #  endif /* IEXTEN && XCASE */
128c80476e4SDavid E. O'Brien #  if defined(IEXTEN) && !defined(XCASE)
129c80476e4SDavid E. O'Brien #   define XCASE IEXTEN
130c80476e4SDavid E. O'Brien #   undef IEXTEN
131c80476e4SDavid E. O'Brien #   define IEXTEN 0
132c80476e4SDavid E. O'Brien #  endif /* IEXTEN && !XCASE */
133c80476e4SDavid E. O'Brien # endif /* ISC */
134c80476e4SDavid E. O'Brien 
135c80476e4SDavid E. O'Brien /*
136c80476e4SDavid E. O'Brien  * Work around convex weirdness where turning off IEXTEN makes us
137c80476e4SDavid E. O'Brien  * lose all postprocessing!
138c80476e4SDavid E. O'Brien  */
139c80476e4SDavid E. O'Brien #ifdef convex
140c80476e4SDavid E. O'Brien # if defined(IEXTEN) && IEXTEN != 0
141c80476e4SDavid E. O'Brien #  undef IEXTEN
142c80476e4SDavid E. O'Brien #  define IEXTEN 0
143c80476e4SDavid E. O'Brien # endif /* IEXTEN != 0 */
144c80476e4SDavid E. O'Brien #endif /* convex */
145c80476e4SDavid E. O'Brien 
146c80476e4SDavid E. O'Brien 
147c80476e4SDavid E. O'Brien # else /* SGTTY */
148c80476e4SDavid E. O'Brien 
149c80476e4SDavid E. O'Brien # ifndef LPASS8
150c80476e4SDavid E. O'Brien #  define LPASS8  0
151c80476e4SDavid E. O'Brien # endif /* LPASS8 */
152c80476e4SDavid E. O'Brien 
153c80476e4SDavid E. O'Brien #endif /* TERMIO || POSIX */
154c80476e4SDavid E. O'Brien 
155c80476e4SDavid E. O'Brien #ifndef _POSIX_VDISABLE
156c80476e4SDavid E. O'Brien # define _POSIX_VDISABLE ((unsigned char) -1)
157c80476e4SDavid E. O'Brien #endif /* _POSIX_VDISABLE */
158c80476e4SDavid E. O'Brien 
159c80476e4SDavid E. O'Brien 
160c80476e4SDavid E. O'Brien #if !defined(CREPRINT) && defined(CRPRNT)
161c80476e4SDavid E. O'Brien # define CREPRINT CRPRNT
162c80476e4SDavid E. O'Brien #endif /* !CREPRINT && CRPRNT */
163c80476e4SDavid E. O'Brien #if !defined(CDISCARD) && defined(CFLUSH)
164c80476e4SDavid E. O'Brien # define CDISCARD CFLUSH
165c80476e4SDavid E. O'Brien #endif /* !CDISCARD && CFLUSH */
166c80476e4SDavid E. O'Brien #if !defined(CDISCARD) && defined(CFLUSHO)
167c80476e4SDavid E. O'Brien # define CDISCARD CFLUSHO
168c80476e4SDavid E. O'Brien #endif /* !CDISCARD && CFLUSHO */
169c80476e4SDavid E. O'Brien 
170c80476e4SDavid E. O'Brien /*
171c80476e4SDavid E. O'Brien  * IRIX4.0 control macro is broken!
172c80476e4SDavid E. O'Brien  * Ignore and undef all default tty chars defined and redefine only
173c80476e4SDavid E. O'Brien  * the ones that are different in the IRIX file.
174c80476e4SDavid E. O'Brien  */
175c80476e4SDavid E. O'Brien #if __STDC__ && defined(IRIS4D)
176c80476e4SDavid E. O'Brien # undef  CINTR
177c80476e4SDavid E. O'Brien # define CINTR		0177	/* ^? */
178c80476e4SDavid E. O'Brien # undef  CQUIT
179c80476e4SDavid E. O'Brien # undef  CERASE
180c80476e4SDavid E. O'Brien # define CERASE		TO_CONTROL('h')
181c80476e4SDavid E. O'Brien # undef  CKILL
182c80476e4SDavid E. O'Brien # undef  CEOF
183c80476e4SDavid E. O'Brien # undef  CEOL
184c80476e4SDavid E. O'Brien # undef  CEOL2
185c80476e4SDavid E. O'Brien # undef  CSWTCH
186c80476e4SDavid E. O'Brien # define CSWTCH		TO_CONTROL('z')
187c80476e4SDavid E. O'Brien # undef  CDSWTCH
188c80476e4SDavid E. O'Brien # undef  CERASE2
189c80476e4SDavid E. O'Brien # undef  CSTART
190c80476e4SDavid E. O'Brien # undef  CSTOP
191c80476e4SDavid E. O'Brien # undef  CWERASE
192c80476e4SDavid E. O'Brien # undef  CSUSP
193c80476e4SDavid E. O'Brien # undef  CDSUSP
194c80476e4SDavid E. O'Brien # undef  CREPRINT
195c80476e4SDavid E. O'Brien # undef  CDISCARD
196c80476e4SDavid E. O'Brien # undef  CLNEXT
197c80476e4SDavid E. O'Brien # undef  CSTATUS
198c80476e4SDavid E. O'Brien # undef  CPAGE
199c80476e4SDavid E. O'Brien # undef  CPGOFF
200c80476e4SDavid E. O'Brien # undef  CKILL2
201c80476e4SDavid E. O'Brien # undef  CBRK
202c80476e4SDavid E. O'Brien # undef  CMIN
203c80476e4SDavid E. O'Brien # undef  CTIME
204c80476e4SDavid E. O'Brien #endif /* __STDC__ && IRIS4D */
205c80476e4SDavid E. O'Brien 
206c80476e4SDavid E. O'Brien 
207c80476e4SDavid E. O'Brien #ifndef CINTR
208c80476e4SDavid E. O'Brien # define CINTR		TO_CONTROL('c')
209c80476e4SDavid E. O'Brien #endif /* CINTR */
210c80476e4SDavid E. O'Brien #ifndef CQUIT
211c80476e4SDavid E. O'Brien # define CQUIT		034	/* ^\ */
212c80476e4SDavid E. O'Brien #endif /* CQUIT */
213c80476e4SDavid E. O'Brien #ifndef CERASE
214c80476e4SDavid E. O'Brien # define CERASE		0177	/* ^? */
215c80476e4SDavid E. O'Brien #endif /* CERASE */
216c80476e4SDavid E. O'Brien #ifndef CKILL
217c80476e4SDavid E. O'Brien # define CKILL		TO_CONTROL('u')
218c80476e4SDavid E. O'Brien #endif /* CKILL */
219c80476e4SDavid E. O'Brien #ifndef CEOF
220c80476e4SDavid E. O'Brien # define CEOF		TO_CONTROL('d')
221c80476e4SDavid E. O'Brien #endif /* CEOF */
222c80476e4SDavid E. O'Brien #ifndef CEOL
223c80476e4SDavid E. O'Brien # define CEOL		_POSIX_VDISABLE
224c80476e4SDavid E. O'Brien #endif /* CEOL */
225c80476e4SDavid E. O'Brien #ifndef CEOL2
226c80476e4SDavid E. O'Brien # define CEOL2		_POSIX_VDISABLE
227c80476e4SDavid E. O'Brien #endif /* CEOL2 */
228c80476e4SDavid E. O'Brien #ifndef CSWTCH
229c80476e4SDavid E. O'Brien # define CSWTCH		_POSIX_VDISABLE
230c80476e4SDavid E. O'Brien #endif /* CSWTCH */
231c80476e4SDavid E. O'Brien #ifndef CDSWTCH
232c80476e4SDavid E. O'Brien # define CDSWTCH	_POSIX_VDISABLE
233c80476e4SDavid E. O'Brien #endif /* CDSWTCH */
234c80476e4SDavid E. O'Brien #ifndef CERASE2
235c80476e4SDavid E. O'Brien # define CERASE2	_POSIX_VDISABLE
236c80476e4SDavid E. O'Brien #endif /* CERASE2 */
237c80476e4SDavid E. O'Brien #ifndef CSTART
238c80476e4SDavid E. O'Brien # define CSTART		TO_CONTROL('q')
239c80476e4SDavid E. O'Brien #endif /* CSTART */
240c80476e4SDavid E. O'Brien #ifndef CSTOP
241c80476e4SDavid E. O'Brien # define CSTOP		TO_CONTROL('s')
242c80476e4SDavid E. O'Brien #endif /* CSTOP */
243c80476e4SDavid E. O'Brien #ifndef CSUSP
244c80476e4SDavid E. O'Brien # define CSUSP		TO_CONTROL('z')
245c80476e4SDavid E. O'Brien #endif /* CSUSP */
246c80476e4SDavid E. O'Brien #ifndef CDSUSP
247c80476e4SDavid E. O'Brien # define CDSUSP		TO_CONTROL('y')
248c80476e4SDavid E. O'Brien #endif /* CDSUSP */
249c80476e4SDavid E. O'Brien 
250c80476e4SDavid E. O'Brien #ifdef hpux
251c80476e4SDavid E. O'Brien 
252c80476e4SDavid E. O'Brien # ifndef CREPRINT
253c80476e4SDavid E. O'Brien #  define CREPRINT	_POSIX_VDISABLE
254c80476e4SDavid E. O'Brien # endif /* CREPRINT */
255c80476e4SDavid E. O'Brien # ifndef CDISCARD
256c80476e4SDavid E. O'Brien #  define CDISCARD	_POSIX_VDISABLE
257c80476e4SDavid E. O'Brien # endif /* CDISCARD */
258c80476e4SDavid E. O'Brien # ifndef CLNEXT
259c80476e4SDavid E. O'Brien #  define CLNEXT	_POSIX_VDISABLE
260c80476e4SDavid E. O'Brien # endif /* CLNEXT */
261c80476e4SDavid E. O'Brien # ifndef CWERASE
262c80476e4SDavid E. O'Brien #  define CWERASE	_POSIX_VDISABLE
263c80476e4SDavid E. O'Brien # endif /* CWERASE */
264c80476e4SDavid E. O'Brien 
265c80476e4SDavid E. O'Brien #else /* !hpux */
266c80476e4SDavid E. O'Brien 
267c80476e4SDavid E. O'Brien # ifndef CREPRINT
268c80476e4SDavid E. O'Brien #  define CREPRINT	TO_CONTROL('r')
269c80476e4SDavid E. O'Brien # endif /* CREPRINT */
270c80476e4SDavid E. O'Brien # ifndef CDISCARD
271c80476e4SDavid E. O'Brien #  define CDISCARD	TO_CONTROL('o')
272c80476e4SDavid E. O'Brien # endif /* CDISCARD */
273c80476e4SDavid E. O'Brien # ifndef CLNEXT
274c80476e4SDavid E. O'Brien #  define CLNEXT	TO_CONTROL('v')
275c80476e4SDavid E. O'Brien # endif /* CLNEXT */
276c80476e4SDavid E. O'Brien # ifndef CWERASE
277c80476e4SDavid E. O'Brien #  define CWERASE	TO_CONTROL('w')
278c80476e4SDavid E. O'Brien # endif /* CWERASE */
279c80476e4SDavid E. O'Brien 
280c80476e4SDavid E. O'Brien #endif /* hpux */
281c80476e4SDavid E. O'Brien 
282c80476e4SDavid E. O'Brien #ifndef CSTATUS
283c80476e4SDavid E. O'Brien # define CSTATUS	TO_CONTROL('t')
284c80476e4SDavid E. O'Brien #endif /* CSTATUS */
285c80476e4SDavid E. O'Brien #ifndef CPAGE
286c80476e4SDavid E. O'Brien # define CPAGE		' '
287c80476e4SDavid E. O'Brien #endif /* CPAGE */
288c80476e4SDavid E. O'Brien #ifndef CPGOFF
289c80476e4SDavid E. O'Brien # define CPGOFF		TO_CONTROL('m')
290c80476e4SDavid E. O'Brien #endif /* CPGOFF */
291c80476e4SDavid E. O'Brien #ifndef CKILL2
292c80476e4SDavid E. O'Brien # define CKILL2		_POSIX_VDISABLE
293c80476e4SDavid E. O'Brien #endif /* CKILL2 */
294c80476e4SDavid E. O'Brien #ifndef CBRK
295c80476e4SDavid E. O'Brien # ifndef masscomp
296c80476e4SDavid E. O'Brien #  define CBRK		0377
297c80476e4SDavid E. O'Brien # else
298c80476e4SDavid E. O'Brien #  define CBRK		'\0'
299c80476e4SDavid E. O'Brien # endif /* masscomp */
300c80476e4SDavid E. O'Brien #endif /* CBRK */
301c80476e4SDavid E. O'Brien #ifndef CMIN
302*19d2e3deSDmitry Chagin # if VMIN == VEOF
303c80476e4SDavid E. O'Brien #  define CMIN		CEOF
304*19d2e3deSDmitry Chagin # else
305*19d2e3deSDmitry Chagin #  define CMIN		1
306*19d2e3deSDmitry Chagin # endif
307c80476e4SDavid E. O'Brien #endif /* CMIN */
308c80476e4SDavid E. O'Brien #ifndef CTIME
309*19d2e3deSDmitry Chagin # if VTIME == VEOL
310c80476e4SDavid E. O'Brien #  define CTIME		CEOL
311*19d2e3deSDmitry Chagin # else
312*19d2e3deSDmitry Chagin #  define CTIME		0
313*19d2e3deSDmitry Chagin # endif
314c80476e4SDavid E. O'Brien #endif /* CTIME */
315c80476e4SDavid E. O'Brien 
316c80476e4SDavid E. O'Brien /*
317c80476e4SDavid E. O'Brien  * Fix for sun inconsistency. On termio VSUSP and the rest of the
318c80476e4SDavid E. O'Brien  * ttychars > NCC are defined. So we undefine them.
319c80476e4SDavid E. O'Brien  */
320c80476e4SDavid E. O'Brien #if defined(TERMIO) || defined(POSIX)
321c80476e4SDavid E. O'Brien # if defined(POSIX) && defined(NCCS)
322c80476e4SDavid E. O'Brien #  define NUMCC		NCCS
323c80476e4SDavid E. O'Brien # else
324c80476e4SDavid E. O'Brien #  ifdef NCC
325c80476e4SDavid E. O'Brien #   define NUMCC	NCC
326c80476e4SDavid E. O'Brien #  endif /* NCC */
327c80476e4SDavid E. O'Brien # endif /* POSIX && NCCS */
328c80476e4SDavid E. O'Brien # ifdef NUMCC
329c80476e4SDavid E. O'Brien #  ifdef VINTR
330c80476e4SDavid E. O'Brien #   if NUMCC <= VINTR
331c80476e4SDavid E. O'Brien #    undef VINTR
332c80476e4SDavid E. O'Brien #   endif /* NUMCC <= VINTR */
333c80476e4SDavid E. O'Brien #  endif /* VINTR */
334c80476e4SDavid E. O'Brien #  ifdef VQUIT
335c80476e4SDavid E. O'Brien #   if NUMCC <= VQUIT
336c80476e4SDavid E. O'Brien #    undef VQUIT
337c80476e4SDavid E. O'Brien #   endif /* NUMCC <= VQUIT */
338c80476e4SDavid E. O'Brien #  endif /* VQUIT */
339c80476e4SDavid E. O'Brien #  ifdef VERASE
340c80476e4SDavid E. O'Brien #   if NUMCC <= VERASE
341c80476e4SDavid E. O'Brien #    undef VERASE
342c80476e4SDavid E. O'Brien #   endif /* NUMCC <= VERASE */
343c80476e4SDavid E. O'Brien #  endif /* VERASE */
344c80476e4SDavid E. O'Brien #  ifdef VKILL
345c80476e4SDavid E. O'Brien #   if NUMCC <= VKILL
346c80476e4SDavid E. O'Brien #    undef VKILL
347c80476e4SDavid E. O'Brien #   endif /* NUMCC <= VKILL */
348c80476e4SDavid E. O'Brien #  endif /* VKILL */
349c80476e4SDavid E. O'Brien #  ifdef VEOF
350c80476e4SDavid E. O'Brien #   if NUMCC <= VEOF
351c80476e4SDavid E. O'Brien #    undef VEOF
352c80476e4SDavid E. O'Brien #   endif /* NUMCC <= VEOF */
353c80476e4SDavid E. O'Brien #  endif /* VEOF */
354c80476e4SDavid E. O'Brien #  ifdef VEOL
355c80476e4SDavid E. O'Brien #   if NUMCC <= VEOL
356c80476e4SDavid E. O'Brien #    undef VEOL
357c80476e4SDavid E. O'Brien #   endif /* NUMCC <= VEOL */
358c80476e4SDavid E. O'Brien #  endif /* VEOL */
359c80476e4SDavid E. O'Brien #  ifdef VEOL2
360c80476e4SDavid E. O'Brien #   if NUMCC <= VEOL2
361c80476e4SDavid E. O'Brien #    undef VEOL2
362c80476e4SDavid E. O'Brien #   endif /* NUMCC <= VEOL2 */
363c80476e4SDavid E. O'Brien #  endif /* VEOL2 */
364c80476e4SDavid E. O'Brien #  ifdef VSWTCH
365c80476e4SDavid E. O'Brien #   if NUMCC <= VSWTCH
366c80476e4SDavid E. O'Brien #    undef VSWTCH
367c80476e4SDavid E. O'Brien #   endif /* NUMCC <= VSWTCH */
368c80476e4SDavid E. O'Brien #  endif /* VSWTCH */
369c80476e4SDavid E. O'Brien #  ifdef VDSWTCH
370c80476e4SDavid E. O'Brien #   if NUMCC <= VDSWTCH
371c80476e4SDavid E. O'Brien #    undef VDSWTCH
372c80476e4SDavid E. O'Brien #   endif /* NUMCC <= VDSWTCH */
373c80476e4SDavid E. O'Brien #  endif /* VDSWTCH */
374c80476e4SDavid E. O'Brien #  ifdef VERASE2
375c80476e4SDavid E. O'Brien #   if NUMCC <= VERASE2
376c80476e4SDavid E. O'Brien #    undef VERASE2
377c80476e4SDavid E. O'Brien #   endif /* NUMCC <= VERASE2 */
378c80476e4SDavid E. O'Brien #  endif /* VERASE2 */
379c80476e4SDavid E. O'Brien #  ifdef VSTART
380c80476e4SDavid E. O'Brien #   if NUMCC <= VSTART
381c80476e4SDavid E. O'Brien #    undef VSTART
382c80476e4SDavid E. O'Brien #   endif /* NUMCC <= VSTART */
383c80476e4SDavid E. O'Brien #  endif /* VSTART */
384c80476e4SDavid E. O'Brien #  ifdef VSTOP
385c80476e4SDavid E. O'Brien #   if NUMCC <= VSTOP
386c80476e4SDavid E. O'Brien #    undef VSTOP
387c80476e4SDavid E. O'Brien #   endif /* NUMCC <= VSTOP */
388c80476e4SDavid E. O'Brien #  endif /* VSTOP */
389c80476e4SDavid E. O'Brien #  ifdef VWERASE
390c80476e4SDavid E. O'Brien #   if NUMCC <= VWERASE
391c80476e4SDavid E. O'Brien #    undef VWERASE
392c80476e4SDavid E. O'Brien #   endif /* NUMCC <= VWERASE */
393c80476e4SDavid E. O'Brien #  endif /* VWERASE */
394c80476e4SDavid E. O'Brien #  ifdef VSUSP
395c80476e4SDavid E. O'Brien #   if NUMCC <= VSUSP
396c80476e4SDavid E. O'Brien #    undef VSUSP
397c80476e4SDavid E. O'Brien #   endif /* NUMCC <= VSUSP */
398c80476e4SDavid E. O'Brien #  endif /* VSUSP */
399c80476e4SDavid E. O'Brien #  ifdef VDSUSP
400c80476e4SDavid E. O'Brien #   if NUMCC <= VDSUSP
401c80476e4SDavid E. O'Brien #    undef VDSUSP
402c80476e4SDavid E. O'Brien #   endif /* NUMCC <= VDSUSP */
403c80476e4SDavid E. O'Brien #  endif /* VDSUSP */
404c80476e4SDavid E. O'Brien #  ifdef VREPRINT
405c80476e4SDavid E. O'Brien #   if NUMCC <= VREPRINT
406c80476e4SDavid E. O'Brien #    undef VREPRINT
407c80476e4SDavid E. O'Brien #   endif /* NUMCC <= VREPRINT */
408c80476e4SDavid E. O'Brien #  endif /* VREPRINT */
409c80476e4SDavid E. O'Brien #  ifdef VDISCARD
410c80476e4SDavid E. O'Brien #   if NUMCC <= VDISCARD
411c80476e4SDavid E. O'Brien #    undef VDISCARD
412c80476e4SDavid E. O'Brien #   endif /* NUMCC <= VDISCARD */
413c80476e4SDavid E. O'Brien #  endif /* VDISCARD */
414c80476e4SDavid E. O'Brien #  ifdef VLNEXT
415c80476e4SDavid E. O'Brien #   if NUMCC <= VLNEXT
416c80476e4SDavid E. O'Brien #    undef VLNEXT
417c80476e4SDavid E. O'Brien #   endif /* NUMCC <= VLNEXT */
418c80476e4SDavid E. O'Brien #  endif /* VLNEXT */
419c80476e4SDavid E. O'Brien #  ifdef VSTATUS
420c80476e4SDavid E. O'Brien #   if NUMCC <= VSTATUS
421c80476e4SDavid E. O'Brien #    undef VSTATUS
422c80476e4SDavid E. O'Brien #   endif /* NUMCC <= VSTATUS */
423c80476e4SDavid E. O'Brien #  endif /* VSTATUS */
424c80476e4SDavid E. O'Brien #  ifdef VPAGE
425c80476e4SDavid E. O'Brien #   if NUMCC <= VPAGE
426c80476e4SDavid E. O'Brien #    undef VPAGE
427c80476e4SDavid E. O'Brien #   endif /* NUMCC <= VPAGE */
428c80476e4SDavid E. O'Brien #  endif /* VPAGE */
429c80476e4SDavid E. O'Brien #  ifdef VPGOFF
430c80476e4SDavid E. O'Brien #   if NUMCC <= VPGOFF
431c80476e4SDavid E. O'Brien #    undef VPGOFF
432c80476e4SDavid E. O'Brien #   endif /* NUMCC <= VPGOFF */
433c80476e4SDavid E. O'Brien #  endif /* VPGOFF */
434c80476e4SDavid E. O'Brien #  ifdef VKILL2
435c80476e4SDavid E. O'Brien #   if NUMCC <= VKILL2
436c80476e4SDavid E. O'Brien #    undef VKILL2
437c80476e4SDavid E. O'Brien #   endif /* NUMCC <= VKILL2 */
438c80476e4SDavid E. O'Brien #  endif /* VKILL2 */
439c80476e4SDavid E. O'Brien #  ifdef VBRK
440c80476e4SDavid E. O'Brien #   if NUMCC <= VBRK
441c80476e4SDavid E. O'Brien #    undef VBRK
442c80476e4SDavid E. O'Brien #   endif /* NUMCC <= VBRK */
443c80476e4SDavid E. O'Brien #  endif /* VBRK */
444c80476e4SDavid E. O'Brien #  ifdef VMIN
445c80476e4SDavid E. O'Brien #   if NUMCC <= VMIN
446c80476e4SDavid E. O'Brien #    undef VMIN
447c80476e4SDavid E. O'Brien #   endif /* NUMCC <= VMIN */
448c80476e4SDavid E. O'Brien #  endif /* VMIN */
449c80476e4SDavid E. O'Brien #  ifdef VTIME
450c80476e4SDavid E. O'Brien #   if NUMCC <= VTIME
451c80476e4SDavid E. O'Brien #    undef VTIME
452c80476e4SDavid E. O'Brien #   endif /* NUMCC <= VTIME */
453c80476e4SDavid E. O'Brien #  endif /* VTIME */
454c80476e4SDavid E. O'Brien # endif /* NUMCC */
455c80476e4SDavid E. O'Brien #endif /* !POSIX */
456c80476e4SDavid E. O'Brien 
457c80476e4SDavid E. O'Brien /*
458c80476e4SDavid E. O'Brien  * fix for hpux10 inconsistency: it has VWERASE, but TIOCSLTC returns
459c80476e4SDavid E. O'Brien  * EINVAL if one tries to change it
46029301572SMark Peek  * Also for RH6.2 on the alpha, defined TIOCGLTC, but does not have
46129301572SMark Peek  * struct ltchars
462c80476e4SDavid E. O'Brien  */
463a15e6f9aSMark Peek #if (defined(hpux) && defined(VSUSP) && defined(VDSUSP) && defined(VWERASE) && defined(VLNEXT)) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__) || defined(__QNXNTO__)
464c80476e4SDavid E. O'Brien # undef TIOCGLTC       /* not really needed */
465c80476e4SDavid E. O'Brien # undef TIOCSLTC
466c80476e4SDavid E. O'Brien #endif
467c80476e4SDavid E. O'Brien 
468c80476e4SDavid E. O'Brien #define C_INTR		 0
469c80476e4SDavid E. O'Brien #define C_QUIT		 1
470c80476e4SDavid E. O'Brien #define C_ERASE		 2
471c80476e4SDavid E. O'Brien #define C_KILL		 3
472c80476e4SDavid E. O'Brien #define C_EOF		 4
473c80476e4SDavid E. O'Brien #define C_EOL		 5
474c80476e4SDavid E. O'Brien #define C_EOL2		 6
475c80476e4SDavid E. O'Brien #define C_SWTCH		 7
476c80476e4SDavid E. O'Brien #define C_DSWTCH	 8
477c80476e4SDavid E. O'Brien #define C_ERASE2	 9
478c80476e4SDavid E. O'Brien #define C_START		10
479c80476e4SDavid E. O'Brien #define C_STOP		11
480c80476e4SDavid E. O'Brien #define C_WERASE	12
481c80476e4SDavid E. O'Brien #define C_SUSP		13
482c80476e4SDavid E. O'Brien #define C_DSUSP		14
483c80476e4SDavid E. O'Brien #define C_REPRINT	15
484c80476e4SDavid E. O'Brien #define C_DISCARD	16
485c80476e4SDavid E. O'Brien #define C_LNEXT		17
486c80476e4SDavid E. O'Brien #define C_STATUS	18
487c80476e4SDavid E. O'Brien #define C_PAGE		19
488c80476e4SDavid E. O'Brien #define C_PGOFF		20
489c80476e4SDavid E. O'Brien #define C_KILL2		21
490c80476e4SDavid E. O'Brien #define C_BRK		22
491c80476e4SDavid E. O'Brien #define C_MIN		23
492c80476e4SDavid E. O'Brien #define C_TIME		24
493c80476e4SDavid E. O'Brien #define C_NCC		25
494c80476e4SDavid E. O'Brien #define C_SH(A)		(1 << (A))
495c80476e4SDavid E. O'Brien 
49629301572SMark Peek /*
49729301572SMark Peek  * Terminal dependend data structures
49829301572SMark Peek  */
49929301572SMark Peek typedef struct {
50029301572SMark Peek #ifdef WINNT_NATIVE
50129301572SMark Peek     int dummy;
50229301572SMark Peek #else /* !WINNT_NATIVE */
50329301572SMark Peek # if defined(POSIX) || defined(TERMIO)
50429301572SMark Peek #  ifdef POSIX
50529301572SMark Peek     struct termios d_t;
50629301572SMark Peek #  else
50729301572SMark Peek     struct termio d_t;
50829301572SMark Peek #  endif /* POSIX */
50929301572SMark Peek # else /* SGTTY */
51029301572SMark Peek #  ifdef TIOCGETP
51129301572SMark Peek     struct sgttyb d_t;
51229301572SMark Peek #  endif /* TIOCGETP */
51329301572SMark Peek #  ifdef TIOCGETC
51429301572SMark Peek     struct tchars d_tc;
51529301572SMark Peek #  endif /* TIOCGETC */
51629301572SMark Peek #  ifdef TIOCGPAGE
51729301572SMark Peek     struct ttypagestat d_pc;
51829301572SMark Peek #  endif /* TIOCGPAGE */
51929301572SMark Peek #  ifdef TIOCLGET
52029301572SMark Peek     int d_lb;
52129301572SMark Peek #  endif /* TIOCLGET */
52229301572SMark Peek # endif /* POSIX || TERMIO */
52329301572SMark Peek # ifdef TIOCGLTC
52429301572SMark Peek     struct ltchars d_ltc;
52529301572SMark Peek # endif /* TIOCGLTC */
52629301572SMark Peek #endif /* WINNT_NATIVE */
52729301572SMark Peek } ttydata_t;
52829301572SMark Peek 
529c80476e4SDavid E. O'Brien #endif /* _h_ed_term */
530