2 * $Header: /src/pub/tcsh/ed.term.h,v 1.16 2002/07/06 22:28:13 christos Exp $
3 * $DragonFly: src/contrib/tcsh/Attic/ed.term.h,v 1.2 2003/10/13 21:24:29 dillon Exp $
6 * ed.term.h: Local terminal header
9 * Copyright (c) 1980, 1991 The Regents of the University of California.
10 * All rights reserved.
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 * 3. Neither the name of the University nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 #define TO_CONTROL(A) ((A) & 037)
41 #if defined(TERMIO) || defined(POSIX)
43 * Aix compatible names
45 # if defined(VWERSE) && !defined(VWERASE)
46 # define VWERASE VWERSE
47 # endif /* VWERSE && !VWERASE */
49 # if defined(VDISCRD) && !defined(VDISCARD)
50 # define VDISCARD VDISCRD
51 # endif /* VDISCRD && !VDISCARD */
53 # if defined(VFLUSHO) && !defined(VDISCARD)
54 # define VDISCARD VFLUSHO
55 # endif /* VFLUSHO && VDISCARD */
57 # if defined(VSTRT) && !defined(VSTART)
59 # endif /* VSTRT && ! VSTART */
61 # if defined(VSTAT) && !defined(VSTATUS)
62 # define VSTATUS VSTAT
63 # endif /* VSTAT && ! VSTATUS */
77 # if defined(OXTABS) && !defined(XTABS)
79 # endif /* OXTABS && !XTABS */
94 # endif /* IDEFAULT */
102 # endif /* ECHOCTL */
110 # endif /* EXTPROC */
117 # if defined(VDISABLE) && !defined(_POSIX_VDISABLE)
118 # define _POSIX_VDISABLE VDISABLE
119 # endif /* VDISABLE && ! _POSIX_VDISABLE */
122 * Work around ISC's definition of IEXTEN which is
126 # if defined(IEXTEN) && defined(XCASE)
130 # endif /* IEXTEN == XCASE */
131 # endif /* IEXTEN && XCASE */
132 # if defined(IEXTEN) && !defined(XCASE)
133 # define XCASE IEXTEN
136 # endif /* IEXTEN && !XCASE */
140 * Work around convex weirdness where turning off IEXTEN makes us
141 * lose all postprocessing!
144 # if defined(IEXTEN) && IEXTEN != 0
147 # endif /* IEXTEN != 0 */
157 #endif /* TERMIO || POSIX */
159 #ifndef _POSIX_VDISABLE
160 # define _POSIX_VDISABLE ((unsigned char) -1)
161 #endif /* _POSIX_VDISABLE */
164 #if !defined(CREPRINT) && defined(CRPRNT)
165 # define CREPRINT CRPRNT
166 #endif /* !CREPRINT && CRPRNT */
167 #if !defined(CDISCARD) && defined(CFLUSH)
168 # define CDISCARD CFLUSH
169 #endif /* !CDISCARD && CFLUSH */
170 #if !defined(CDISCARD) && defined(CFLUSHO)
171 # define CDISCARD CFLUSHO
172 #endif /* !CDISCARD && CFLUSHO */
175 * IRIX4.0 control macro is broken!
176 * Ignore and undef all default tty chars defined and redefine only
177 * the ones that are different in the IRIX file.
179 #if __STDC__ && defined(IRIS4D)
181 # define CINTR 0177 /* ^? */
184 # define CERASE TO_CONTROL('h')
190 # 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')
291 # define CCHECKPT TO_CONTROL('e')
292 #endif /* CCHECKPT */
297 # define CPGOFF TO_CONTROL('m')
300 # define CKILL2 _POSIX_VDISABLE
307 # endif /* masscomp */
317 * Fix for sun inconsistency. On termio VSUSP and the rest of the
318 * ttychars > NCC are defined. So we undefine them.
320 #if defined(TERMIO) || defined(POSIX)
321 # if defined(POSIX) && defined(NCCS)
327 # endif /* POSIX && NCCS */
332 # endif /* NUMCC <= VINTR */
337 # endif /* NUMCC <= VQUIT */
342 # endif /* NUMCC <= VERASE */
347 # endif /* NUMCC <= VKILL */
352 # endif /* NUMCC <= VEOF */
357 # endif /* NUMCC <= VEOL */
362 # endif /* NUMCC <= VEOL2 */
367 # endif /* NUMCC <= VSWTCH */
370 # if NUMCC <= VDSWTCH
372 # endif /* NUMCC <= VDSWTCH */
373 # endif /* VDSWTCH */
375 # if NUMCC <= VERASE2
377 # endif /* NUMCC <= VERASE2 */
378 # endif /* VERASE2 */
382 # endif /* NUMCC <= VSTART */
387 # endif /* NUMCC <= VSTOP */
390 # if NUMCC <= VWERASE
392 # endif /* NUMCC <= VWERASE */
393 # endif /* VWERASE */
397 # endif /* NUMCC <= VSUSP */
402 # endif /* NUMCC <= VDSUSP */
405 # if NUMCC <= VREPRINT
407 # endif /* NUMCC <= VREPRINT */
408 # endif /* VREPRINT */
410 # if NUMCC <= VDISCARD
412 # endif /* NUMCC <= VDISCARD */
413 # endif /* VDISCARD */
417 # endif /* NUMCC <= VLNEXT */
420 # if NUMCC <= VSTATUS
422 # endif /* NUMCC <= VSTATUS */
423 # endif /* VSTATUS */
425 # if NUMCC <= VCHECKPT
427 # endif /* NUMCC <= VCHECKPT */
428 # endif /* VCHECKPT */
432 # endif /* NUMCC <= VPAGE */
437 # endif /* NUMCC <= VPGOFF */
442 # endif /* NUMCC <= VKILL2 */
447 # endif /* NUMCC <= VBRK */
452 # endif /* NUMCC <= VMIN */
457 # endif /* NUMCC <= VTIME */
463 * fix for hpux10 inconsistency: it has VWERASE, but TIOCSLTC returns
464 * EINVAL if one tries to change it
465 * Also for RH6.2 on the alpha, defined TIOCGLTC, but does not have
468 #if (defined(hpux) && defined(VSUSP) && defined(VDSUSP) && defined(VWERASE) && defined(VLNEXT)) || defined(__linux__)
469 # undef TIOCGLTC /* not really needed */
500 #define C_SH(A) (1 << (A))
503 * Terminal dependend data structures
508 #else /* !WINNT_NATIVE */
509 # if defined(POSIX) || defined(TERMIO)
518 # endif /* TIOCGETP */
521 # endif /* TIOCGETC */
523 struct ttypagestat d_pc
;
524 # endif /* TIOCGPAGE */
527 # endif /* TIOCLGET */
528 # endif /* POSIX || TERMIO */
530 struct ltchars d_ltc
;
531 # endif /* TIOCGLTC */
532 #endif /* WINNT_NATIVE */
535 #endif /* _h_ed_term */