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')
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 */
322 * Fix for sun inconsistency. On termio VSUSP and the rest of the
323 * ttychars > NCC are defined. So we undefine them.
325 #if defined(TERMIO) || defined(POSIX)
326 # if defined(POSIX) && defined(NCCS)
332 # endif /* POSIX && NCCS */
337 # endif /* NUMCC <= VINTR */
342 # endif /* NUMCC <= VQUIT */
347 # endif /* NUMCC <= VERASE */
352 # endif /* NUMCC <= VKILL */
357 # endif /* NUMCC <= VEOF */
362 # endif /* NUMCC <= VEOL */
367 # endif /* NUMCC <= VEOL2 */
372 # endif /* NUMCC <= VSWTCH */
375 # if NUMCC <= VDSWTCH
377 # endif /* NUMCC <= VDSWTCH */
378 # endif /* VDSWTCH */
380 # if NUMCC <= VERASE2
382 # endif /* NUMCC <= VERASE2 */
383 # endif /* VERASE2 */
387 # endif /* NUMCC <= VSTART */
392 # endif /* NUMCC <= VSTOP */
395 # if NUMCC <= VWERASE
397 # endif /* NUMCC <= VWERASE */
398 # endif /* VWERASE */
402 # endif /* NUMCC <= VSUSP */
407 # endif /* NUMCC <= VDSUSP */
410 # if NUMCC <= VREPRINT
412 # endif /* NUMCC <= VREPRINT */
413 # endif /* VREPRINT */
415 # if NUMCC <= VDISCARD
417 # endif /* NUMCC <= VDISCARD */
418 # endif /* VDISCARD */
422 # endif /* NUMCC <= VLNEXT */
425 # if NUMCC <= VSTATUS
427 # endif /* NUMCC <= VSTATUS */
428 # endif /* VSTATUS */
430 # if NUMCC <= VCHECKPT
432 # endif /* NUMCC <= VCHECKPT */
433 # endif /* VCHECKPT */
437 # endif /* NUMCC <= VPAGE */
442 # endif /* NUMCC <= VPGOFF */
447 # endif /* NUMCC <= VKILL2 */
452 # endif /* NUMCC <= VBRK */
457 # endif /* NUMCC <= VMIN */
462 # endif /* NUMCC <= VTIME */
468 * fix for hpux10 inconsistency: it has VWERASE, but TIOCSLTC returns
469 * EINVAL if one tries to change it
470 * Also for RH6.2 on the alpha, defined TIOCGLTC, but does not have
473 #if (defined(hpux) && defined(VSUSP) && defined(VDSUSP) && defined(VWERASE) && defined(VLNEXT)) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__) || defined(__QNXNTO__)
474 # undef TIOCGLTC /* not really needed */
505 #define C_SH(A) (1 << (A))
508 * Terminal dependend data structures
513 #else /* !WINNT_NATIVE */
514 # if defined(POSIX) || defined(TERMIO)
523 # endif /* TIOCGETP */
526 # endif /* TIOCGETC */
528 struct ttypagestat d_pc
;
529 # endif /* TIOCGPAGE */
532 # endif /* TIOCLGET */
533 # endif /* POSIX || TERMIO */
535 struct ltchars d_ltc
;
536 # endif /* TIOCGLTC */
537 #endif /* WINNT_NATIVE */
540 #endif /* _h_ed_term */