1 /* $Header: /p/tcsh/cvsroot/tcsh/ed.term.h,v 1.19 2015/03/25 19:53:16 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')
205 #endif /* __STDC__ && IRIS4D */
209 # define CINTR TO_CONTROL('c')
212 # define CQUIT 034 /* ^\ */
215 # define CERASE 0177 /* ^? */
218 # define CKILL TO_CONTROL('u')
221 # define CEOF TO_CONTROL('d')
224 # define CEOL _POSIX_VDISABLE
227 # define CEOL2 _POSIX_VDISABLE
230 # define CSWTCH _POSIX_VDISABLE
233 # define CDSWTCH _POSIX_VDISABLE
236 # define CERASE2 _POSIX_VDISABLE
239 # define CSTART TO_CONTROL('q')
242 # define CSTOP TO_CONTROL('s')
245 # define CSUSP TO_CONTROL('z')
248 # define CDSUSP TO_CONTROL('y')
254 # define CREPRINT _POSIX_VDISABLE
255 # endif /* CREPRINT */
257 # define CDISCARD _POSIX_VDISABLE
258 # endif /* CDISCARD */
260 # define CLNEXT _POSIX_VDISABLE
263 # define CWERASE _POSIX_VDISABLE
264 # endif /* CWERASE */
269 # define CREPRINT TO_CONTROL('r')
270 # endif /* CREPRINT */
272 # define CDISCARD TO_CONTROL('o')
273 # endif /* CDISCARD */
275 # define CLNEXT TO_CONTROL('v')
278 # define CWERASE TO_CONTROL('w')
279 # endif /* CWERASE */
284 # define CSTATUS TO_CONTROL('t')
290 # define CPGOFF TO_CONTROL('m')
293 # define CKILL2 _POSIX_VDISABLE
300 # endif /* masscomp */
318 * Fix for sun inconsistency. On termio VSUSP and the rest of the
319 * ttychars > NCC are defined. So we undefine them.
321 #if defined(TERMIO) || defined(POSIX)
322 # if defined(POSIX) && defined(NCCS)
328 # endif /* POSIX && NCCS */
333 # endif /* NUMCC <= VINTR */
338 # endif /* NUMCC <= VQUIT */
343 # endif /* NUMCC <= VERASE */
348 # endif /* NUMCC <= VKILL */
353 # endif /* NUMCC <= VEOF */
358 # endif /* NUMCC <= VEOL */
363 # endif /* NUMCC <= VEOL2 */
368 # endif /* NUMCC <= VSWTCH */
371 # if NUMCC <= VDSWTCH
373 # endif /* NUMCC <= VDSWTCH */
374 # endif /* VDSWTCH */
376 # if NUMCC <= VERASE2
378 # endif /* NUMCC <= VERASE2 */
379 # endif /* VERASE2 */
383 # endif /* NUMCC <= VSTART */
388 # endif /* NUMCC <= VSTOP */
391 # if NUMCC <= VWERASE
393 # endif /* NUMCC <= VWERASE */
394 # endif /* VWERASE */
398 # endif /* NUMCC <= VSUSP */
403 # endif /* NUMCC <= VDSUSP */
406 # if NUMCC <= VREPRINT
408 # endif /* NUMCC <= VREPRINT */
409 # endif /* VREPRINT */
411 # if NUMCC <= VDISCARD
413 # endif /* NUMCC <= VDISCARD */
414 # endif /* VDISCARD */
418 # endif /* NUMCC <= VLNEXT */
421 # if NUMCC <= VSTATUS
423 # endif /* NUMCC <= VSTATUS */
424 # endif /* VSTATUS */
428 # endif /* NUMCC <= VPAGE */
433 # endif /* NUMCC <= VPGOFF */
438 # endif /* NUMCC <= VKILL2 */
443 # endif /* NUMCC <= VBRK */
448 # endif /* NUMCC <= VMIN */
453 # endif /* NUMCC <= VTIME */
459 * fix for hpux10 inconsistency: it has VWERASE, but TIOCSLTC returns
460 * EINVAL if one tries to change it
461 * Also for RH6.2 on the alpha, defined TIOCGLTC, but does not have
464 #if (defined(hpux) && defined(VSUSP) && defined(VDSUSP) && defined(VWERASE) && defined(VLNEXT)) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__) || defined(__QNXNTO__)
465 # undef TIOCGLTC /* not really needed */
495 #define C_SH(A) (1 << (A))
498 * Terminal dependend data structures
503 #else /* !WINNT_NATIVE */
504 # if defined(POSIX) || defined(TERMIO)
513 # endif /* TIOCGETP */
516 # endif /* TIOCGETC */
518 struct ttypagestat d_pc;
519 # endif /* TIOCGPAGE */
522 # endif /* TIOCLGET */
523 # endif /* POSIX || TERMIO */
525 struct ltchars d_ltc;
526 # endif /* TIOCGLTC */
527 #endif /* WINNT_NATIVE */
530 #endif /* _h_ed_term */