1 /* $Header: /src/pub/tcsh/ed.term.h,v 1.13 1996/09/24 16:57:20 christos Exp $ */
3 * ed.term.h: Local terminal header
6 * Copyright (c) 1980, 1991 The Regents of the University of California.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40 #define TO_CONTROL(A) ((A) & 037)
42 #if defined(TERMIO) || defined(POSIX)
44 * Aix compatible names
46 # if defined(VWERSE) && !defined(VWERASE)
47 # define VWERASE VWERSE
48 # endif /* VWERSE && !VWERASE */
50 # if defined(VDISCRD) && !defined(VDISCARD)
51 # define VDISCARD VDISCRD
52 # endif /* VDISCRD && !VDISCARD */
54 # if defined(VFLUSHO) && !defined(VDISCARD)
55 # define VDISCARD VFLUSHO
56 # endif /* VFLUSHO && VDISCARD */
58 # if defined(VSTRT) && !defined(VSTART)
60 # endif /* VSTRT && ! VSTART */
62 # if defined(VSTAT) && !defined(VSTATUS)
63 # define VSTATUS VSTAT
64 # endif /* VSTAT && ! VSTATUS */
78 # if defined(OXTABS) && !defined(XTABS)
80 # endif /* OXTABS && !XTABS */
95 # endif /* IDEFAULT */
103 # endif /* ECHOCTL */
111 # endif /* EXTPROC */
118 # if defined(VDISABLE) && !defined(_POSIX_VDISABLE)
119 # define _POSIX_VDISABLE VDISABLE
120 # endif /* VDISABLE && ! _POSIX_VDISABLE */
123 * Work around ISC's definition of IEXTEN which is
127 # if defined(IEXTEN) && defined(XCASE)
131 # endif /* IEXTEN == XCASE */
132 # endif /* IEXTEN && XCASE */
133 # if defined(IEXTEN) && !defined(XCASE)
134 # define XCASE IEXTEN
137 # endif /* IEXTEN && !XCASE */
141 * Work around convex weirdness where turning off IEXTEN makes us
142 * lose all postprocessing!
145 # if defined(IEXTEN) && IEXTEN != 0
148 # endif /* IEXTEN != 0 */
158 #endif /* TERMIO || POSIX */
160 #ifndef _POSIX_VDISABLE
161 # define _POSIX_VDISABLE ((unsigned char) -1)
162 #endif /* _POSIX_VDISABLE */
165 #if !defined(CREPRINT) && defined(CRPRNT)
166 # define CREPRINT CRPRNT
167 #endif /* !CREPRINT && CRPRNT */
168 #if !defined(CDISCARD) && defined(CFLUSH)
169 # define CDISCARD CFLUSH
170 #endif /* !CDISCARD && CFLUSH */
171 #if !defined(CDISCARD) && defined(CFLUSHO)
172 # define CDISCARD CFLUSHO
173 #endif /* !CDISCARD && CFLUSHO */
176 * IRIX4.0 control macro is broken!
177 * Ignore and undef all default tty chars defined and redefine only
178 * the ones that are different in the IRIX file.
180 #if __STDC__ && defined(IRIS4D)
182 # define CINTR 0177 /* ^? */
185 # define CERASE TO_CONTROL('h')
191 # define CSWTCH TO_CONTROL('z')
209 #endif /* __STDC__ && IRIS4D */
213 # define CINTR TO_CONTROL('c')
216 # define CQUIT 034 /* ^\ */
219 # define CERASE 0177 /* ^? */
222 # define CKILL TO_CONTROL('u')
225 # define CEOF TO_CONTROL('d')
228 # define CEOL _POSIX_VDISABLE
231 # define CEOL2 _POSIX_VDISABLE
234 # define CSWTCH _POSIX_VDISABLE
237 # define CDSWTCH _POSIX_VDISABLE
240 # define CERASE2 _POSIX_VDISABLE
243 # define CSTART TO_CONTROL('q')
246 # define CSTOP TO_CONTROL('s')
249 # define CSUSP TO_CONTROL('z')
252 # define CDSUSP TO_CONTROL('y')
258 # define CREPRINT _POSIX_VDISABLE
259 # endif /* CREPRINT */
261 # define CDISCARD _POSIX_VDISABLE
262 # endif /* CDISCARD */
264 # define CLNEXT _POSIX_VDISABLE
267 # define CWERASE _POSIX_VDISABLE
268 # endif /* CWERASE */
273 # define CREPRINT TO_CONTROL('r')
274 # endif /* CREPRINT */
276 # define CDISCARD TO_CONTROL('o')
277 # endif /* CDISCARD */
279 # define CLNEXT TO_CONTROL('v')
282 # define CWERASE TO_CONTROL('w')
283 # endif /* CWERASE */
288 # define CSTATUS TO_CONTROL('t')
294 # define CPGOFF TO_CONTROL('m')
297 # define CKILL2 _POSIX_VDISABLE
304 # endif /* masscomp */
314 * Fix for sun inconsistency. On termio VSUSP and the rest of the
315 * ttychars > NCC are defined. So we undefine them.
317 #if defined(TERMIO) || defined(POSIX)
318 # if defined(POSIX) && defined(NCCS)
324 # endif /* POSIX && NCCS */
329 # endif /* NUMCC <= VINTR */
334 # endif /* NUMCC <= VQUIT */
339 # endif /* NUMCC <= VERASE */
344 # endif /* NUMCC <= VKILL */
349 # endif /* NUMCC <= VEOF */
354 # endif /* NUMCC <= VEOL */
359 # endif /* NUMCC <= VEOL2 */
364 # endif /* NUMCC <= VSWTCH */
367 # if NUMCC <= VDSWTCH
369 # endif /* NUMCC <= VDSWTCH */
370 # endif /* VDSWTCH */
372 # if NUMCC <= VERASE2
374 # endif /* NUMCC <= VERASE2 */
375 # endif /* VERASE2 */
379 # endif /* NUMCC <= VSTART */
384 # endif /* NUMCC <= VSTOP */
387 # if NUMCC <= VWERASE
389 # endif /* NUMCC <= VWERASE */
390 # endif /* VWERASE */
394 # endif /* NUMCC <= VSUSP */
399 # endif /* NUMCC <= VDSUSP */
402 # if NUMCC <= VREPRINT
404 # endif /* NUMCC <= VREPRINT */
405 # endif /* VREPRINT */
407 # if NUMCC <= VDISCARD
409 # endif /* NUMCC <= VDISCARD */
410 # endif /* VDISCARD */
414 # endif /* NUMCC <= VLNEXT */
417 # if NUMCC <= VSTATUS
419 # endif /* NUMCC <= VSTATUS */
420 # endif /* VSTATUS */
424 # endif /* NUMCC <= VPAGE */
429 # endif /* NUMCC <= VPGOFF */
434 # endif /* NUMCC <= VKILL2 */
439 # endif /* NUMCC <= VBRK */
444 # endif /* NUMCC <= VMIN */
449 # endif /* NUMCC <= VTIME */
455 * fix for hpux10 inconsistency: it has VWERASE, but TIOCSLTC returns
456 * EINVAL if one tries to change it
458 #if defined(hpux) && defined(VSUSP) && defined(VDSUSP) && defined(VWERASE) && d
460 # undef TIOCGLTC /* not really needed */
490 #define C_SH(A) (1 << (A))
492 #endif /* _h_ed_term */