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')
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')
287 # define CCHECKPT TO_CONTROL('e')
288 #endif /* CCHECKPT */
293 # define CPGOFF TO_CONTROL('m')
296 # define CKILL2 _POSIX_VDISABLE
303 # endif /* masscomp */
321 * Fix for sun inconsistency. On termio VSUSP and the rest of the
322 * ttychars > NCC are defined. So we undefine them.
324 #if defined(TERMIO) || defined(POSIX)
325 # if defined(POSIX) && defined(NCCS)
331 # endif /* POSIX && NCCS */
336 # endif /* NUMCC <= VINTR */
341 # endif /* NUMCC <= VQUIT */
346 # endif /* NUMCC <= VERASE */
351 # endif /* NUMCC <= VKILL */
356 # endif /* NUMCC <= VEOF */
361 # endif /* NUMCC <= VEOL */
366 # endif /* NUMCC <= VEOL2 */
371 # endif /* NUMCC <= VSWTCH */
374 # if NUMCC <= VDSWTCH
376 # endif /* NUMCC <= VDSWTCH */
377 # endif /* VDSWTCH */
379 # if NUMCC <= VERASE2
381 # endif /* NUMCC <= VERASE2 */
382 # endif /* VERASE2 */
386 # endif /* NUMCC <= VSTART */
391 # endif /* NUMCC <= VSTOP */
394 # if NUMCC <= VWERASE
396 # endif /* NUMCC <= VWERASE */
397 # endif /* VWERASE */
401 # endif /* NUMCC <= VSUSP */
406 # endif /* NUMCC <= VDSUSP */
409 # if NUMCC <= VREPRINT
411 # endif /* NUMCC <= VREPRINT */
412 # endif /* VREPRINT */
414 # if NUMCC <= VDISCARD
416 # endif /* NUMCC <= VDISCARD */
417 # endif /* VDISCARD */
421 # endif /* NUMCC <= VLNEXT */
424 # if NUMCC <= VSTATUS
426 # endif /* NUMCC <= VSTATUS */
427 # endif /* VSTATUS */
429 # if NUMCC <= VCHECKPT
431 # endif /* NUMCC <= VCHECKPT */
432 # endif /* VCHECKPT */
436 # endif /* NUMCC <= VPAGE */
441 # endif /* NUMCC <= VPGOFF */
446 # endif /* NUMCC <= VKILL2 */
451 # endif /* NUMCC <= VBRK */
456 # endif /* NUMCC <= VMIN */
461 # endif /* NUMCC <= VTIME */
467 * fix for hpux10 inconsistency: it has VWERASE, but TIOCSLTC returns
468 * EINVAL if one tries to change it
469 * Also for RH6.2 on the alpha, defined TIOCGLTC, but does not have
472 #if (defined(hpux) && defined(VSUSP) && defined(VDSUSP) && defined(VWERASE) && defined(VLNEXT)) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__) || defined(__QNXNTO__)
473 # undef TIOCGLTC /* not really needed */
504 #define C_SH(A) (1 << (A))
507 * Terminal dependend data structures
512 #else /* !WINNT_NATIVE */
513 # if defined(POSIX) || defined(TERMIO)
522 # endif /* TIOCGETP */
525 # endif /* TIOCGETC */
527 struct ttypagestat d_pc
;
528 # endif /* TIOCGPAGE */
531 # endif /* TIOCLGET */
532 # endif /* POSIX || TERMIO */
534 struct ltchars d_ltc
;
535 # endif /* TIOCGLTC */
536 #endif /* WINNT_NATIVE */
539 #endif /* _h_ed_term */