1 /* $Header: /p/tcsh/cvsroot/tcsh/ed.term.h,v 1.17 2004/12/25 21:15:06 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. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 #define TO_CONTROL(A) ((A) & 037)
38 #if defined(TERMIO) || defined(POSIX)
40 * Aix compatible names
42 # if defined(VWERSE) && !defined(VWERASE)
43 # define VWERASE VWERSE
44 # endif /* VWERSE && !VWERASE */
46 # if defined(VDISCRD) && !defined(VDISCARD)
47 # define VDISCARD VDISCRD
48 # endif /* VDISCRD && !VDISCARD */
50 # if defined(VFLUSHO) && !defined(VDISCARD)
51 # define VDISCARD VFLUSHO
52 # endif /* VFLUSHO && VDISCARD */
54 # if defined(VSTRT) && !defined(VSTART)
56 # endif /* VSTRT && ! VSTART */
58 # if defined(VSTAT) && !defined(VSTATUS)
59 # define VSTATUS VSTAT
60 # endif /* VSTAT && ! VSTATUS */
74 # if defined(OXTABS) && !defined(XTABS)
76 # endif /* OXTABS && !XTABS */
91 # endif /* IDEFAULT */
107 # endif /* EXTPROC */
114 # if defined(VDISABLE) && !defined(_POSIX_VDISABLE)
115 # define _POSIX_VDISABLE VDISABLE
116 # endif /* VDISABLE && ! _POSIX_VDISABLE */
119 * Work around ISC's definition of IEXTEN which is
123 # if defined(IEXTEN) && defined(XCASE)
127 # endif /* IEXTEN == XCASE */
128 # endif /* IEXTEN && XCASE */
129 # if defined(IEXTEN) && !defined(XCASE)
130 # define XCASE IEXTEN
133 # endif /* IEXTEN && !XCASE */
137 * Work around convex weirdness where turning off IEXTEN makes us
138 * lose all postprocessing!
141 # if defined(IEXTEN) && IEXTEN != 0
144 # endif /* IEXTEN != 0 */
154 #endif /* TERMIO || POSIX */
156 #ifndef _POSIX_VDISABLE
157 # define _POSIX_VDISABLE ((unsigned char) -1)
158 #endif /* _POSIX_VDISABLE */
161 #if !defined(CREPRINT) && defined(CRPRNT)
162 # define CREPRINT CRPRNT
163 #endif /* !CREPRINT && CRPRNT */
164 #if !defined(CDISCARD) && defined(CFLUSH)
165 # define CDISCARD CFLUSH
166 #endif /* !CDISCARD && CFLUSH */
167 #if !defined(CDISCARD) && defined(CFLUSHO)
168 # define CDISCARD CFLUSHO
169 #endif /* !CDISCARD && CFLUSHO */
172 * IRIX4.0 control macro is broken!
173 * Ignore and undef all default tty chars defined and redefine only
174 * the ones that are different in the IRIX file.
176 #if __STDC__ && defined(IRIS4D)
178 # define CINTR 0177 /* ^? */
181 # define CERASE TO_CONTROL('h')
187 # define CSWTCH TO_CONTROL('z')
206 #endif /* __STDC__ && IRIS4D */
210 # define CINTR TO_CONTROL('c')
213 # define CQUIT 034 /* ^\ */
216 # define CERASE 0177 /* ^? */
219 # define CKILL TO_CONTROL('u')
222 # define CEOF TO_CONTROL('d')
225 # define CEOL _POSIX_VDISABLE
228 # define CEOL2 _POSIX_VDISABLE
231 # define CSWTCH _POSIX_VDISABLE
234 # define CDSWTCH _POSIX_VDISABLE
237 # define CERASE2 _POSIX_VDISABLE
240 # define CSTART TO_CONTROL('q')
243 # define CSTOP TO_CONTROL('s')
246 # define CSUSP TO_CONTROL('z')
249 # define CDSUSP TO_CONTROL('y')
255 # define CREPRINT _POSIX_VDISABLE
256 # endif /* CREPRINT */
258 # define CDISCARD _POSIX_VDISABLE
259 # endif /* CDISCARD */
261 # define CLNEXT _POSIX_VDISABLE
264 # define CWERASE _POSIX_VDISABLE
265 # endif /* CWERASE */
270 # define CREPRINT TO_CONTROL('r')
271 # endif /* CREPRINT */
273 # define CDISCARD TO_CONTROL('o')
274 # endif /* CDISCARD */
276 # define CLNEXT TO_CONTROL('v')
279 # define CWERASE TO_CONTROL('w')
280 # endif /* CWERASE */
285 # define CSTATUS TO_CONTROL('t')
288 # define CCHECKPT TO_CONTROL('e')
289 #endif /* CCHECKPT */
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 */
422 # if NUMCC <= VCHECKPT
424 # endif /* NUMCC <= VCHECKPT */
425 # endif /* VCHECKPT */
429 # endif /* NUMCC <= VPAGE */
434 # endif /* NUMCC <= VPGOFF */
439 # endif /* NUMCC <= VKILL2 */
444 # endif /* NUMCC <= VBRK */
449 # endif /* NUMCC <= VMIN */
454 # endif /* NUMCC <= VTIME */
460 * fix for hpux10 inconsistency: it has VWERASE, but TIOCSLTC returns
461 * EINVAL if one tries to change it
462 * Also for RH6.2 on the alpha, defined TIOCGLTC, but does not have
465 #if (defined(hpux) && defined(VSUSP) && defined(VDSUSP) && defined(VWERASE) && defined(VLNEXT)) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)
466 # undef TIOCGLTC /* not really needed */
497 #define C_SH(A) (1 << (A))
500 * Terminal dependend data structures
505 #else /* !WINNT_NATIVE */
506 # if defined(POSIX) || defined(TERMIO)
515 # endif /* TIOCGETP */
518 # endif /* TIOCGETC */
520 struct ttypagestat d_pc
;
521 # endif /* TIOCGPAGE */
524 # endif /* TIOCLGET */
525 # endif /* POSIX || TERMIO */
527 struct ltchars d_ltc
;
528 # endif /* TIOCGLTC */
529 #endif /* WINNT_NATIVE */
532 #endif /* _h_ed_term */