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. All advertising materials mentioning features or use of this software
17
* must display the following acknowledgement:
18
* This product includes software developed by the University of
19
* California, Berkeley and its contributors.
20
* 4. Neither the name of the University nor the names of its contributors
21
* may be used to endorse or promote products derived from this software
22
* without specific prior written permission.
24
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39
#define TO_CONTROL(A) ((A) & 037)
41
#if defined(TERMIO) || defined(POSIX)
43
* Aix compatible names
45
# if defined(VWERSE) && !defined(VWERASE)
46
# define VWERASE VWERSE
47
# endif /* VWERSE && !VWERASE */
49
# if defined(VDISCRD) && !defined(VDISCARD)
50
# define VDISCARD VDISCRD
51
# endif /* VDISCRD && !VDISCARD */
53
# if defined(VFLUSHO) && !defined(VDISCARD)
54
# define VDISCARD VFLUSHO
55
# endif /* VFLUSHO && VDISCARD */
57
# if defined(VSTRT) && !defined(VSTART)
59
# endif /* VSTRT && ! VSTART */
61
# if defined(VSTAT) && !defined(VSTATUS)
62
# define VSTATUS VSTAT
63
# endif /* VSTAT && ! VSTATUS */
77
# if defined(OXTABS) && !defined(XTABS)
79
# endif /* OXTABS && !XTABS */
94
# endif /* IDEFAULT */
102
# endif /* ECHOCTL */
110
# endif /* EXTPROC */
117
# if defined(VDISABLE) && !defined(_POSIX_VDISABLE)
118
# define _POSIX_VDISABLE VDISABLE
119
# endif /* VDISABLE && ! _POSIX_VDISABLE */
122
* Work around ISC's definition of IEXTEN which is
126
# if defined(IEXTEN) && defined(XCASE)
130
# endif /* IEXTEN == XCASE */
131
# endif /* IEXTEN && XCASE */
132
# if defined(IEXTEN) && !defined(XCASE)
133
# define XCASE IEXTEN
136
# endif /* IEXTEN && !XCASE */
140
* Work around convex weirdness where turning off IEXTEN makes us
141
* lose all postprocessing!
144
# if defined(IEXTEN) && IEXTEN != 0
147
# endif /* IEXTEN != 0 */
157
#endif /* TERMIO || POSIX */
159
#ifndef _POSIX_VDISABLE
160
# define _POSIX_VDISABLE ((unsigned char) -1)
161
#endif /* _POSIX_VDISABLE */
164
#if !defined(CREPRINT) && defined(CRPRNT)
165
# define CREPRINT CRPRNT
166
#endif /* !CREPRINT && CRPRNT */
167
#if !defined(CDISCARD) && defined(CFLUSH)
168
# define CDISCARD CFLUSH
169
#endif /* !CDISCARD && CFLUSH */
170
#if !defined(CDISCARD) && defined(CFLUSHO)
171
# define CDISCARD CFLUSHO
172
#endif /* !CDISCARD && CFLUSHO */
175
* IRIX4.0 control macro is broken!
176
* Ignore and undef all default tty chars defined and redefine only
177
* the ones that are different in the IRIX file.
179
#if __STDC__ && defined(IRIS4D)
181
# define CINTR 0177 /* ^? */
184
# define CERASE TO_CONTROL('h')
190
# define CSWTCH TO_CONTROL('z')
208
#endif /* __STDC__ && IRIS4D */
212
# define CINTR TO_CONTROL('c')
215
# define CQUIT 034 /* ^\ */
218
# define CERASE 0177 /* ^? */
221
# define CKILL TO_CONTROL('u')
224
# define CEOF TO_CONTROL('d')
227
# define CEOL _POSIX_VDISABLE
230
# define CEOL2 _POSIX_VDISABLE
233
# define CSWTCH _POSIX_VDISABLE
236
# define CDSWTCH _POSIX_VDISABLE
239
# define CERASE2 _POSIX_VDISABLE
242
# define CSTART TO_CONTROL('q')
245
# define CSTOP TO_CONTROL('s')
248
# define CSUSP TO_CONTROL('z')
251
# define CDSUSP TO_CONTROL('y')
257
# define CREPRINT _POSIX_VDISABLE
258
# endif /* CREPRINT */
260
# define CDISCARD _POSIX_VDISABLE
261
# endif /* CDISCARD */
263
# define CLNEXT _POSIX_VDISABLE
266
# define CWERASE _POSIX_VDISABLE
267
# endif /* CWERASE */
272
# define CREPRINT TO_CONTROL('r')
273
# endif /* CREPRINT */
275
# define CDISCARD TO_CONTROL('o')
276
# endif /* CDISCARD */
278
# define CLNEXT TO_CONTROL('v')
281
# define CWERASE TO_CONTROL('w')
282
# endif /* CWERASE */
287
# define CSTATUS TO_CONTROL('t')
293
# define CPGOFF TO_CONTROL('m')
296
# define CKILL2 _POSIX_VDISABLE
303
# endif /* masscomp */
313
* Fix for sun inconsistency. On termio VSUSP and the rest of the
314
* ttychars > NCC are defined. So we undefine them.
316
#if defined(TERMIO) || defined(POSIX)
317
# if defined(POSIX) && defined(NCCS)
323
# endif /* POSIX && NCCS */
328
# endif /* NUMCC <= VINTR */
333
# endif /* NUMCC <= VQUIT */
338
# endif /* NUMCC <= VERASE */
343
# endif /* NUMCC <= VKILL */
348
# endif /* NUMCC <= VEOF */
353
# endif /* NUMCC <= VEOL */
358
# endif /* NUMCC <= VEOL2 */
363
# endif /* NUMCC <= VSWTCH */
366
# if NUMCC <= VDSWTCH
368
# endif /* NUMCC <= VDSWTCH */
369
# endif /* VDSWTCH */
371
# if NUMCC <= VERASE2
373
# endif /* NUMCC <= VERASE2 */
374
# endif /* VERASE2 */
378
# endif /* NUMCC <= VSTART */
383
# endif /* NUMCC <= VSTOP */
386
# if NUMCC <= VWERASE
388
# endif /* NUMCC <= VWERASE */
389
# endif /* VWERASE */
393
# endif /* NUMCC <= VSUSP */
398
# endif /* NUMCC <= VDSUSP */
401
# if NUMCC <= VREPRINT
403
# endif /* NUMCC <= VREPRINT */
404
# endif /* VREPRINT */
406
# if NUMCC <= VDISCARD
408
# endif /* NUMCC <= VDISCARD */
409
# endif /* VDISCARD */
413
# endif /* NUMCC <= VLNEXT */
416
# if NUMCC <= VSTATUS
418
# endif /* NUMCC <= VSTATUS */
419
# endif /* VSTATUS */
423
# endif /* NUMCC <= VPAGE */
428
# endif /* NUMCC <= VPGOFF */
433
# endif /* NUMCC <= VKILL2 */
438
# endif /* NUMCC <= VBRK */
443
# endif /* NUMCC <= VMIN */
448
# endif /* NUMCC <= VTIME */
454
* fix for hpux10 inconsistency: it has VWERASE, but TIOCSLTC returns
455
* EINVAL if one tries to change it
457
#if defined(hpux) && defined(VSUSP) && defined(VDSUSP) && defined(VWERASE) && d
459
# undef TIOCGLTC /* not really needed */
489
#define C_SH(A) (1 << (A))
491
#endif /* _h_ed_term */