Kernel part of bluetooth stack ported by Dmitry Komissaroff. Very much work
[dragonfly.git] / contrib / tcsh / ed.term.h
blob6e6455037ccabfa12fd243b0a4afeb3b6dd33888
1 /*
2 * $Header: /src/pub/tcsh/ed.term.h,v 1.16 2002/07/06 22:28:13 christos Exp $
3 * $DragonFly: src/contrib/tcsh/Attic/ed.term.h,v 1.2 2003/10/13 21:24:29 dillon Exp $
4 */
5 /*
6 * ed.term.h: Local terminal header
7 */
8 /*-
9 * Copyright (c) 1980, 1991 The Regents of the University of California.
10 * All rights reserved.
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 * 3. 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
34 * SUCH DAMAGE.
36 #ifndef _h_ed_term
37 #define _h_ed_term
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)
58 # define VSTART VSTRT
59 # endif /* VSTRT && ! VSTART */
61 # if defined(VSTAT) && !defined(VSTATUS)
62 # define VSTATUS VSTAT
63 # endif /* VSTAT && ! VSTATUS */
65 # ifndef ONLRET
66 # define ONLRET 0
67 # endif /* ONLRET */
69 # ifndef TAB3
70 # ifdef OXTABS
71 # define TAB3 OXTABS
72 # else
73 # define TAB3 0
74 # endif /* OXTABS */
75 # endif /* !TAB3 */
77 # if defined(OXTABS) && !defined(XTABS)
78 # define XTABS OXTABS
79 # endif /* OXTABS && !XTABS */
81 # ifndef ONLCR
82 # define ONLCR 0
83 # endif /* ONLCR */
85 # ifndef IEXTEN
86 # define IEXTEN 0
87 # endif /* IEXTEN */
90 * emx garbage
92 # ifndef IDEFAULT
93 # define IDEFAULT 0
94 # endif /* IDEFAULT */
96 # ifndef IDELETE
97 # define IDELETE 0
98 # endif /* IDELETE */
100 # ifndef ECHOCTL
101 # define ECHOCTL 0
102 # endif /* ECHOCTL */
104 # ifndef PARENB
105 # define PARENB 0
106 # endif /* PARENB */
108 # ifndef EXTPROC
109 # define EXTPROC 0
110 # endif /* EXTPROC */
112 # ifndef FLUSHO
113 # define FLUSHO 0
114 # endif /* FLUSHO */
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
123 * XCASE!
125 # ifdef ISC
126 # if defined(IEXTEN) && defined(XCASE)
127 # if IEXTEN == XCASE
128 # undef IEXTEN
129 # define IEXTEN 0
130 # endif /* IEXTEN == XCASE */
131 # endif /* IEXTEN && XCASE */
132 # if defined(IEXTEN) && !defined(XCASE)
133 # define XCASE IEXTEN
134 # undef IEXTEN
135 # define IEXTEN 0
136 # endif /* IEXTEN && !XCASE */
137 # endif /* ISC */
140 * Work around convex weirdness where turning off IEXTEN makes us
141 * lose all postprocessing!
143 #ifdef convex
144 # if defined(IEXTEN) && IEXTEN != 0
145 # undef IEXTEN
146 # define IEXTEN 0
147 # endif /* IEXTEN != 0 */
148 #endif /* convex */
151 # else /* SGTTY */
153 # ifndef LPASS8
154 # define LPASS8 0
155 # endif /* LPASS8 */
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)
180 # undef CINTR
181 # define CINTR 0177 /* ^? */
182 # undef CQUIT
183 # undef CERASE
184 # define CERASE TO_CONTROL('h')
185 # undef CKILL
186 # undef CEOF
187 # undef CEOL
188 # undef CEOL2
189 # undef CSWTCH
190 # define CSWTCH TO_CONTROL('z')
191 # undef CDSWTCH
192 # undef CERASE2
193 # undef CSTART
194 # undef CSTOP
195 # undef CWERASE
196 # undef CSUSP
197 # undef CDSUSP
198 # undef CREPRINT
199 # undef CDISCARD
200 # undef CLNEXT
201 # undef CSTATUS
202 # undef CCHECKPT
203 # undef CPAGE
204 # undef CPGOFF
205 # undef CKILL2
206 # undef CBRK
207 # undef CMIN
208 # undef CTIME
209 #endif /* __STDC__ && IRIS4D */
212 #ifndef CINTR
213 # define CINTR TO_CONTROL('c')
214 #endif /* CINTR */
215 #ifndef CQUIT
216 # define CQUIT 034 /* ^\ */
217 #endif /* CQUIT */
218 #ifndef CERASE
219 # define CERASE 0177 /* ^? */
220 #endif /* CERASE */
221 #ifndef CKILL
222 # define CKILL TO_CONTROL('u')
223 #endif /* CKILL */
224 #ifndef CEOF
225 # define CEOF TO_CONTROL('d')
226 #endif /* CEOF */
227 #ifndef CEOL
228 # define CEOL _POSIX_VDISABLE
229 #endif /* CEOL */
230 #ifndef CEOL2
231 # define CEOL2 _POSIX_VDISABLE
232 #endif /* CEOL2 */
233 #ifndef CSWTCH
234 # define CSWTCH _POSIX_VDISABLE
235 #endif /* CSWTCH */
236 #ifndef CDSWTCH
237 # define CDSWTCH _POSIX_VDISABLE
238 #endif /* CDSWTCH */
239 #ifndef CERASE2
240 # define CERASE2 _POSIX_VDISABLE
241 #endif /* CERASE2 */
242 #ifndef CSTART
243 # define CSTART TO_CONTROL('q')
244 #endif /* CSTART */
245 #ifndef CSTOP
246 # define CSTOP TO_CONTROL('s')
247 #endif /* CSTOP */
248 #ifndef CSUSP
249 # define CSUSP TO_CONTROL('z')
250 #endif /* CSUSP */
251 #ifndef CDSUSP
252 # define CDSUSP TO_CONTROL('y')
253 #endif /* CDSUSP */
255 #ifdef hpux
257 # ifndef CREPRINT
258 # define CREPRINT _POSIX_VDISABLE
259 # endif /* CREPRINT */
260 # ifndef CDISCARD
261 # define CDISCARD _POSIX_VDISABLE
262 # endif /* CDISCARD */
263 # ifndef CLNEXT
264 # define CLNEXT _POSIX_VDISABLE
265 # endif /* CLNEXT */
266 # ifndef CWERASE
267 # define CWERASE _POSIX_VDISABLE
268 # endif /* CWERASE */
270 #else /* !hpux */
272 # ifndef CREPRINT
273 # define CREPRINT TO_CONTROL('r')
274 # endif /* CREPRINT */
275 # ifndef CDISCARD
276 # define CDISCARD TO_CONTROL('o')
277 # endif /* CDISCARD */
278 # ifndef CLNEXT
279 # define CLNEXT TO_CONTROL('v')
280 # endif /* CLNEXT */
281 # ifndef CWERASE
282 # define CWERASE TO_CONTROL('w')
283 # endif /* CWERASE */
285 #endif /* hpux */
287 #ifndef CSTATUS
288 # define CSTATUS TO_CONTROL('t')
289 #endif /* CSTATUS */
290 #ifndef CCHECKPT
291 # define CCHECKPT TO_CONTROL('e')
292 #endif /* CCHECKPT */
293 #ifndef CPAGE
294 # define CPAGE ' '
295 #endif /* CPAGE */
296 #ifndef CPGOFF
297 # define CPGOFF TO_CONTROL('m')
298 #endif /* CPGOFF */
299 #ifndef CKILL2
300 # define CKILL2 _POSIX_VDISABLE
301 #endif /* CKILL2 */
302 #ifndef CBRK
303 # ifndef masscomp
304 # define CBRK 0377
305 # else
306 # define CBRK '\0'
307 # endif /* masscomp */
308 #endif /* CBRK */
309 #ifndef CMIN
310 # define CMIN CEOF
311 #endif /* CMIN */
312 #ifndef CTIME
313 # define CTIME CEOL
314 #endif /* CTIME */
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)
322 # define NUMCC NCCS
323 # else
324 # ifdef NCC
325 # define NUMCC NCC
326 # endif /* NCC */
327 # endif /* POSIX && NCCS */
328 # ifdef NUMCC
329 # ifdef VINTR
330 # if NUMCC <= VINTR
331 # undef VINTR
332 # endif /* NUMCC <= VINTR */
333 # endif /* VINTR */
334 # ifdef VQUIT
335 # if NUMCC <= VQUIT
336 # undef VQUIT
337 # endif /* NUMCC <= VQUIT */
338 # endif /* VQUIT */
339 # ifdef VERASE
340 # if NUMCC <= VERASE
341 # undef VERASE
342 # endif /* NUMCC <= VERASE */
343 # endif /* VERASE */
344 # ifdef VKILL
345 # if NUMCC <= VKILL
346 # undef VKILL
347 # endif /* NUMCC <= VKILL */
348 # endif /* VKILL */
349 # ifdef VEOF
350 # if NUMCC <= VEOF
351 # undef VEOF
352 # endif /* NUMCC <= VEOF */
353 # endif /* VEOF */
354 # ifdef VEOL
355 # if NUMCC <= VEOL
356 # undef VEOL
357 # endif /* NUMCC <= VEOL */
358 # endif /* VEOL */
359 # ifdef VEOL2
360 # if NUMCC <= VEOL2
361 # undef VEOL2
362 # endif /* NUMCC <= VEOL2 */
363 # endif /* VEOL2 */
364 # ifdef VSWTCH
365 # if NUMCC <= VSWTCH
366 # undef VSWTCH
367 # endif /* NUMCC <= VSWTCH */
368 # endif /* VSWTCH */
369 # ifdef VDSWTCH
370 # if NUMCC <= VDSWTCH
371 # undef VDSWTCH
372 # endif /* NUMCC <= VDSWTCH */
373 # endif /* VDSWTCH */
374 # ifdef VERASE2
375 # if NUMCC <= VERASE2
376 # undef VERASE2
377 # endif /* NUMCC <= VERASE2 */
378 # endif /* VERASE2 */
379 # ifdef VSTART
380 # if NUMCC <= VSTART
381 # undef VSTART
382 # endif /* NUMCC <= VSTART */
383 # endif /* VSTART */
384 # ifdef VSTOP
385 # if NUMCC <= VSTOP
386 # undef VSTOP
387 # endif /* NUMCC <= VSTOP */
388 # endif /* VSTOP */
389 # ifdef VWERASE
390 # if NUMCC <= VWERASE
391 # undef VWERASE
392 # endif /* NUMCC <= VWERASE */
393 # endif /* VWERASE */
394 # ifdef VSUSP
395 # if NUMCC <= VSUSP
396 # undef VSUSP
397 # endif /* NUMCC <= VSUSP */
398 # endif /* VSUSP */
399 # ifdef VDSUSP
400 # if NUMCC <= VDSUSP
401 # undef VDSUSP
402 # endif /* NUMCC <= VDSUSP */
403 # endif /* VDSUSP */
404 # ifdef VREPRINT
405 # if NUMCC <= VREPRINT
406 # undef VREPRINT
407 # endif /* NUMCC <= VREPRINT */
408 # endif /* VREPRINT */
409 # ifdef VDISCARD
410 # if NUMCC <= VDISCARD
411 # undef VDISCARD
412 # endif /* NUMCC <= VDISCARD */
413 # endif /* VDISCARD */
414 # ifdef VLNEXT
415 # if NUMCC <= VLNEXT
416 # undef VLNEXT
417 # endif /* NUMCC <= VLNEXT */
418 # endif /* VLNEXT */
419 # ifdef VSTATUS
420 # if NUMCC <= VSTATUS
421 # undef VSTATUS
422 # endif /* NUMCC <= VSTATUS */
423 # endif /* VSTATUS */
424 # ifdef VCHECKPT
425 # if NUMCC <= VCHECKPT
426 # undef VCHECKPT
427 # endif /* NUMCC <= VCHECKPT */
428 # endif /* VCHECKPT */
429 # ifdef VPAGE
430 # if NUMCC <= VPAGE
431 # undef VPAGE
432 # endif /* NUMCC <= VPAGE */
433 # endif /* VPAGE */
434 # ifdef VPGOFF
435 # if NUMCC <= VPGOFF
436 # undef VPGOFF
437 # endif /* NUMCC <= VPGOFF */
438 # endif /* VPGOFF */
439 # ifdef VKILL2
440 # if NUMCC <= VKILL2
441 # undef VKILL2
442 # endif /* NUMCC <= VKILL2 */
443 # endif /* VKILL2 */
444 # ifdef VBRK
445 # if NUMCC <= VBRK
446 # undef VBRK
447 # endif /* NUMCC <= VBRK */
448 # endif /* VBRK */
449 # ifdef VMIN
450 # if NUMCC <= VMIN
451 # undef VMIN
452 # endif /* NUMCC <= VMIN */
453 # endif /* VMIN */
454 # ifdef VTIME
455 # if NUMCC <= VTIME
456 # undef VTIME
457 # endif /* NUMCC <= VTIME */
458 # endif /* VTIME */
459 # endif /* NUMCC */
460 #endif /* !POSIX */
463 * fix for hpux10 inconsistency: it has VWERASE, but TIOCSLTC returns
464 * EINVAL if one tries to change it
465 * Also for RH6.2 on the alpha, defined TIOCGLTC, but does not have
466 * struct ltchars
468 #if (defined(hpux) && defined(VSUSP) && defined(VDSUSP) && defined(VWERASE) && defined(VLNEXT)) || defined(__linux__)
469 # undef TIOCGLTC /* not really needed */
470 # undef TIOCSLTC
471 #endif
473 #define C_INTR 0
474 #define C_QUIT 1
475 #define C_ERASE 2
476 #define C_KILL 3
477 #define C_EOF 4
478 #define C_EOL 5
479 #define C_EOL2 6
480 #define C_SWTCH 7
481 #define C_DSWTCH 8
482 #define C_ERASE2 9
483 #define C_START 10
484 #define C_STOP 11
485 #define C_WERASE 12
486 #define C_SUSP 13
487 #define C_DSUSP 14
488 #define C_REPRINT 15
489 #define C_DISCARD 16
490 #define C_LNEXT 17
491 #define C_STATUS 18
492 #define C_PAGE 19
493 #define C_PGOFF 20
494 #define C_KILL2 21
495 #define C_BRK 22
496 #define C_MIN 23
497 #define C_TIME 24
498 #define C_CHECKPT 25
499 #define C_NCC 26
500 #define C_SH(A) (1 << (A))
503 * Terminal dependend data structures
505 typedef struct {
506 #ifdef WINNT_NATIVE
507 int dummy;
508 #else /* !WINNT_NATIVE */
509 # if defined(POSIX) || defined(TERMIO)
510 # ifdef POSIX
511 struct termios d_t;
512 # else
513 struct termio d_t;
514 # endif /* POSIX */
515 # else /* SGTTY */
516 # ifdef TIOCGETP
517 struct sgttyb d_t;
518 # endif /* TIOCGETP */
519 # ifdef TIOCGETC
520 struct tchars d_tc;
521 # endif /* TIOCGETC */
522 # ifdef TIOCGPAGE
523 struct ttypagestat d_pc;
524 # endif /* TIOCGPAGE */
525 # ifdef TIOCLGET
526 int d_lb;
527 # endif /* TIOCLGET */
528 # endif /* POSIX || TERMIO */
529 # ifdef TIOCGLTC
530 struct ltchars d_ltc;
531 # endif /* TIOCGLTC */
532 #endif /* WINNT_NATIVE */
533 } ttydata_t;
535 #endif /* _h_ed_term */