2 * ed.term.h: Local terminal header
5 * Copyright (c) 1980, 1991 The Regents of the University of California.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the University nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 #define TO_CONTROL(A) ((A) & 037)
37 #if defined(TERMIO) || defined(POSIX)
39 * Aix compatible names
41 # if defined(VWERSE) && !defined(VWERASE)
42 # define VWERASE VWERSE
43 # endif /* VWERSE && !VWERASE */
45 # if defined(VDISCRD) && !defined(VDISCARD)
46 # define VDISCARD VDISCRD
47 # endif /* VDISCRD && !VDISCARD */
49 # if defined(VFLUSHO) && !defined(VDISCARD)
50 # define VDISCARD VFLUSHO
51 # endif /* VFLUSHO && VDISCARD */
53 # if defined(VSTRT) && !defined(VSTART)
55 # endif /* VSTRT && ! VSTART */
57 # if defined(VSTAT) && !defined(VSTATUS)
58 # define VSTATUS VSTAT
59 # endif /* VSTAT && ! VSTATUS */
73 # if defined(OXTABS) && !defined(XTABS)
75 # endif /* OXTABS && !XTABS */
90 # endif /* IDEFAULT */
106 # endif /* EXTPROC */
113 # if defined(VDISABLE) && !defined(_POSIX_VDISABLE)
114 # define _POSIX_VDISABLE VDISABLE
115 # endif /* VDISABLE && ! _POSIX_VDISABLE */
118 * Work around ISC's definition of IEXTEN which is
122 # if defined(IEXTEN) && defined(XCASE)
126 # endif /* IEXTEN == XCASE */
127 # endif /* IEXTEN && XCASE */
128 # if defined(IEXTEN) && !defined(XCASE)
129 # define XCASE IEXTEN
132 # endif /* IEXTEN && !XCASE */
136 * Work around convex weirdness where turning off IEXTEN makes us
137 * lose all postprocessing!
140 # if defined(IEXTEN) && IEXTEN != 0
143 # endif /* IEXTEN != 0 */
153 #endif /* TERMIO || POSIX */
155 #ifndef _POSIX_VDISABLE
156 # define _POSIX_VDISABLE ((unsigned char) -1)
157 #endif /* _POSIX_VDISABLE */
160 #if !defined(CREPRINT) && defined(CRPRNT)
161 # define CREPRINT CRPRNT
162 #endif /* !CREPRINT && CRPRNT */
163 #if !defined(CDISCARD) && defined(CFLUSH)
164 # define CDISCARD CFLUSH
165 #endif /* !CDISCARD && CFLUSH */
166 #if !defined(CDISCARD) && defined(CFLUSHO)
167 # define CDISCARD CFLUSHO
168 #endif /* !CDISCARD && CFLUSHO */
171 * IRIX4.0 control macro is broken!
172 * Ignore and undef all default tty chars defined and redefine only
173 * the ones that are different in the IRIX file.
175 #if __STDC__ && defined(IRIS4D)
177 # define CINTR 0177 /* ^? */
180 # define CERASE TO_CONTROL('h')
186 # define CSWTCH TO_CONTROL('z')
204 #endif /* __STDC__ && IRIS4D */
208 # define CINTR TO_CONTROL('c')
211 # define CQUIT 034 /* ^\ */
214 # define CERASE 0177 /* ^? */
217 # define CKILL TO_CONTROL('u')
220 # define CEOF TO_CONTROL('d')
223 # define CEOL _POSIX_VDISABLE
226 # define CEOL2 _POSIX_VDISABLE
229 # define CSWTCH _POSIX_VDISABLE
232 # define CDSWTCH _POSIX_VDISABLE
235 # define CERASE2 _POSIX_VDISABLE
238 # define CSTART TO_CONTROL('q')
241 # define CSTOP TO_CONTROL('s')
244 # define CSUSP TO_CONTROL('z')
247 # define CDSUSP TO_CONTROL('y')
253 # define CREPRINT _POSIX_VDISABLE
254 # endif /* CREPRINT */
256 # define CDISCARD _POSIX_VDISABLE
257 # endif /* CDISCARD */
259 # define CLNEXT _POSIX_VDISABLE
262 # define CWERASE _POSIX_VDISABLE
263 # endif /* CWERASE */
268 # define CREPRINT TO_CONTROL('r')
269 # endif /* CREPRINT */
271 # define CDISCARD TO_CONTROL('o')
272 # endif /* CDISCARD */
274 # define CLNEXT TO_CONTROL('v')
277 # define CWERASE TO_CONTROL('w')
278 # endif /* CWERASE */
283 # define CSTATUS TO_CONTROL('t')
289 # define CPGOFF TO_CONTROL('m')
292 # define CKILL2 _POSIX_VDISABLE
299 # 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 */
427 # endif /* NUMCC <= VPAGE */
432 # endif /* NUMCC <= VPGOFF */
437 # endif /* NUMCC <= VKILL2 */
442 # endif /* NUMCC <= VBRK */
447 # endif /* NUMCC <= VMIN */
452 # endif /* NUMCC <= VTIME */
458 * fix for hpux10 inconsistency: it has VWERASE, but TIOCSLTC returns
459 * EINVAL if one tries to change it
460 * Also for RH6.2 on the alpha, defined TIOCGLTC, but does not have
463 #if (defined(hpux) && defined(VSUSP) && defined(VDSUSP) && defined(VWERASE) && defined(VLNEXT)) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__) || defined(__QNXNTO__)
464 # undef TIOCGLTC /* not really needed */
494 #define C_SH(A) (1 << (A))
497 * Terminal dependend data structures
502 #else /* !WINNT_NATIVE */
503 # if defined(POSIX) || defined(TERMIO)
512 # endif /* TIOCGETP */
515 # endif /* TIOCGETC */
517 struct ttypagestat d_pc;
518 # endif /* TIOCGPAGE */
521 # endif /* TIOCLGET */
522 # endif /* POSIX || TERMIO */
524 struct ltchars d_ltc;
525 # endif /* TIOCGLTC */
526 #endif /* WINNT_NATIVE */
529 #endif /* _h_ed_term */