1 /* $Header: /src/pub/tcsh/ed.term.h,v 1.13 1996/09/24 16:57:20 christos Exp $ */ 2 /* 3 * ed.term.h: Local terminal header 4 */ 5 /*- 6 * Copyright (c) 1980, 1991 The Regents of the University of California. 7 * All rights reserved. 8 * 9 * Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions 11 * are met: 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. All advertising materials mentioning features or use of this software 18 * must display the following acknowledgement: 19 * This product includes software developed by the University of 20 * California, Berkeley and its contributors. 21 * 4. Neither the name of the University nor the names of its contributors 22 * may be used to endorse or promote products derived from this software 23 * without specific prior written permission. 24 * 25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 */ 37 #ifndef _h_ed_term 38 #define _h_ed_term 39 40 #define TO_CONTROL(A) ((A) & 037) 41 42 #if defined(TERMIO) || defined(POSIX) 43 /* 44 * Aix compatible names 45 */ 46 # if defined(VWERSE) && !defined(VWERASE) 47 # define VWERASE VWERSE 48 # endif /* VWERSE && !VWERASE */ 49 50 # if defined(VDISCRD) && !defined(VDISCARD) 51 # define VDISCARD VDISCRD 52 # endif /* VDISCRD && !VDISCARD */ 53 54 # if defined(VFLUSHO) && !defined(VDISCARD) 55 # define VDISCARD VFLUSHO 56 # endif /* VFLUSHO && VDISCARD */ 57 58 # if defined(VSTRT) && !defined(VSTART) 59 # define VSTART VSTRT 60 # endif /* VSTRT && ! VSTART */ 61 62 # if defined(VSTAT) && !defined(VSTATUS) 63 # define VSTATUS VSTAT 64 # endif /* VSTAT && ! VSTATUS */ 65 66 # ifndef ONLRET 67 # define ONLRET 0 68 # endif /* ONLRET */ 69 70 # ifndef TAB3 71 # ifdef OXTABS 72 # define TAB3 OXTABS 73 # else 74 # define TAB3 0 75 # endif /* OXTABS */ 76 # endif /* !TAB3 */ 77 78 # if defined(OXTABS) && !defined(XTABS) 79 # define XTABS OXTABS 80 # endif /* OXTABS && !XTABS */ 81 82 # ifndef ONLCR 83 # define ONLCR 0 84 # endif /* ONLCR */ 85 86 # ifndef IEXTEN 87 # define IEXTEN 0 88 # endif /* IEXTEN */ 89 90 /* 91 * emx garbage 92 */ 93 # ifndef IDEFAULT 94 # define IDEFAULT 0 95 # endif /* IDEFAULT */ 96 97 # ifndef IDELETE 98 # define IDELETE 0 99 # endif /* IDELETE */ 100 101 # ifndef ECHOCTL 102 # define ECHOCTL 0 103 # endif /* ECHOCTL */ 104 105 # ifndef PARENB 106 # define PARENB 0 107 # endif /* PARENB */ 108 109 # ifndef EXTPROC 110 # define EXTPROC 0 111 # endif /* EXTPROC */ 112 113 # ifndef FLUSHO 114 # define FLUSHO 0 115 # endif /* FLUSHO */ 116 117 118 # if defined(VDISABLE) && !defined(_POSIX_VDISABLE) 119 # define _POSIX_VDISABLE VDISABLE 120 # endif /* VDISABLE && ! _POSIX_VDISABLE */ 121 122 /* 123 * Work around ISC's definition of IEXTEN which is 124 * XCASE! 125 */ 126 # ifdef ISC 127 # if defined(IEXTEN) && defined(XCASE) 128 # if IEXTEN == XCASE 129 # undef IEXTEN 130 # define IEXTEN 0 131 # endif /* IEXTEN == XCASE */ 132 # endif /* IEXTEN && XCASE */ 133 # if defined(IEXTEN) && !defined(XCASE) 134 # define XCASE IEXTEN 135 # undef IEXTEN 136 # define IEXTEN 0 137 # endif /* IEXTEN && !XCASE */ 138 # endif /* ISC */ 139 140 /* 141 * Work around convex weirdness where turning off IEXTEN makes us 142 * lose all postprocessing! 143 */ 144 #ifdef convex 145 # if defined(IEXTEN) && IEXTEN != 0 146 # undef IEXTEN 147 # define IEXTEN 0 148 # endif /* IEXTEN != 0 */ 149 #endif /* convex */ 150 151 152 # else /* SGTTY */ 153 154 # ifndef LPASS8 155 # define LPASS8 0 156 # endif /* LPASS8 */ 157 158 #endif /* TERMIO || POSIX */ 159 160 #ifndef _POSIX_VDISABLE 161 # define _POSIX_VDISABLE ((unsigned char) -1) 162 #endif /* _POSIX_VDISABLE */ 163 164 165 #if !defined(CREPRINT) && defined(CRPRNT) 166 # define CREPRINT CRPRNT 167 #endif /* !CREPRINT && CRPRNT */ 168 #if !defined(CDISCARD) && defined(CFLUSH) 169 # define CDISCARD CFLUSH 170 #endif /* !CDISCARD && CFLUSH */ 171 #if !defined(CDISCARD) && defined(CFLUSHO) 172 # define CDISCARD CFLUSHO 173 #endif /* !CDISCARD && CFLUSHO */ 174 175 /* 176 * IRIX4.0 control macro is broken! 177 * Ignore and undef all default tty chars defined and redefine only 178 * the ones that are different in the IRIX file. 179 */ 180 #if __STDC__ && defined(IRIS4D) 181 # undef CINTR 182 # define CINTR 0177 /* ^? */ 183 # undef CQUIT 184 # undef CERASE 185 # define CERASE TO_CONTROL('h') 186 # undef CKILL 187 # undef CEOF 188 # undef CEOL 189 # undef CEOL2 190 # undef CSWTCH 191 # define CSWTCH TO_CONTROL('z') 192 # undef CDSWTCH 193 # undef CERASE2 194 # undef CSTART 195 # undef CSTOP 196 # undef CWERASE 197 # undef CSUSP 198 # undef CDSUSP 199 # undef CREPRINT 200 # undef CDISCARD 201 # undef CLNEXT 202 # undef CSTATUS 203 # undef CPAGE 204 # undef CPGOFF 205 # undef CKILL2 206 # undef CBRK 207 # undef CMIN 208 # undef CTIME 209 #endif /* __STDC__ && IRIS4D */ 210 211 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 */ 254 255 #ifdef hpux 256 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 */ 269 270 #else /* !hpux */ 271 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 */ 284 285 #endif /* hpux */ 286 287 #ifndef CSTATUS 288 # define CSTATUS TO_CONTROL('t') 289 #endif /* CSTATUS */ 290 #ifndef CPAGE 291 # define CPAGE ' ' 292 #endif /* CPAGE */ 293 #ifndef CPGOFF 294 # define CPGOFF TO_CONTROL('m') 295 #endif /* CPGOFF */ 296 #ifndef CKILL2 297 # define CKILL2 _POSIX_VDISABLE 298 #endif /* CKILL2 */ 299 #ifndef CBRK 300 # ifndef masscomp 301 # define CBRK 0377 302 # else 303 # define CBRK '\0' 304 # endif /* masscomp */ 305 #endif /* CBRK */ 306 #ifndef CMIN 307 # define CMIN CEOF 308 #endif /* CMIN */ 309 #ifndef CTIME 310 # define CTIME CEOL 311 #endif /* CTIME */ 312 313 /* 314 * Fix for sun inconsistency. On termio VSUSP and the rest of the 315 * ttychars > NCC are defined. So we undefine them. 316 */ 317 #if defined(TERMIO) || defined(POSIX) 318 # if defined(POSIX) && defined(NCCS) 319 # define NUMCC NCCS 320 # else 321 # ifdef NCC 322 # define NUMCC NCC 323 # endif /* NCC */ 324 # endif /* POSIX && NCCS */ 325 # ifdef NUMCC 326 # ifdef VINTR 327 # if NUMCC <= VINTR 328 # undef VINTR 329 # endif /* NUMCC <= VINTR */ 330 # endif /* VINTR */ 331 # ifdef VQUIT 332 # if NUMCC <= VQUIT 333 # undef VQUIT 334 # endif /* NUMCC <= VQUIT */ 335 # endif /* VQUIT */ 336 # ifdef VERASE 337 # if NUMCC <= VERASE 338 # undef VERASE 339 # endif /* NUMCC <= VERASE */ 340 # endif /* VERASE */ 341 # ifdef VKILL 342 # if NUMCC <= VKILL 343 # undef VKILL 344 # endif /* NUMCC <= VKILL */ 345 # endif /* VKILL */ 346 # ifdef VEOF 347 # if NUMCC <= VEOF 348 # undef VEOF 349 # endif /* NUMCC <= VEOF */ 350 # endif /* VEOF */ 351 # ifdef VEOL 352 # if NUMCC <= VEOL 353 # undef VEOL 354 # endif /* NUMCC <= VEOL */ 355 # endif /* VEOL */ 356 # ifdef VEOL2 357 # if NUMCC <= VEOL2 358 # undef VEOL2 359 # endif /* NUMCC <= VEOL2 */ 360 # endif /* VEOL2 */ 361 # ifdef VSWTCH 362 # if NUMCC <= VSWTCH 363 # undef VSWTCH 364 # endif /* NUMCC <= VSWTCH */ 365 # endif /* VSWTCH */ 366 # ifdef VDSWTCH 367 # if NUMCC <= VDSWTCH 368 # undef VDSWTCH 369 # endif /* NUMCC <= VDSWTCH */ 370 # endif /* VDSWTCH */ 371 # ifdef VERASE2 372 # if NUMCC <= VERASE2 373 # undef VERASE2 374 # endif /* NUMCC <= VERASE2 */ 375 # endif /* VERASE2 */ 376 # ifdef VSTART 377 # if NUMCC <= VSTART 378 # undef VSTART 379 # endif /* NUMCC <= VSTART */ 380 # endif /* VSTART */ 381 # ifdef VSTOP 382 # if NUMCC <= VSTOP 383 # undef VSTOP 384 # endif /* NUMCC <= VSTOP */ 385 # endif /* VSTOP */ 386 # ifdef VWERASE 387 # if NUMCC <= VWERASE 388 # undef VWERASE 389 # endif /* NUMCC <= VWERASE */ 390 # endif /* VWERASE */ 391 # ifdef VSUSP 392 # if NUMCC <= VSUSP 393 # undef VSUSP 394 # endif /* NUMCC <= VSUSP */ 395 # endif /* VSUSP */ 396 # ifdef VDSUSP 397 # if NUMCC <= VDSUSP 398 # undef VDSUSP 399 # endif /* NUMCC <= VDSUSP */ 400 # endif /* VDSUSP */ 401 # ifdef VREPRINT 402 # if NUMCC <= VREPRINT 403 # undef VREPRINT 404 # endif /* NUMCC <= VREPRINT */ 405 # endif /* VREPRINT */ 406 # ifdef VDISCARD 407 # if NUMCC <= VDISCARD 408 # undef VDISCARD 409 # endif /* NUMCC <= VDISCARD */ 410 # endif /* VDISCARD */ 411 # ifdef VLNEXT 412 # if NUMCC <= VLNEXT 413 # undef VLNEXT 414 # endif /* NUMCC <= VLNEXT */ 415 # endif /* VLNEXT */ 416 # ifdef VSTATUS 417 # if NUMCC <= VSTATUS 418 # undef VSTATUS 419 # endif /* NUMCC <= VSTATUS */ 420 # endif /* VSTATUS */ 421 # ifdef VPAGE 422 # if NUMCC <= VPAGE 423 # undef VPAGE 424 # endif /* NUMCC <= VPAGE */ 425 # endif /* VPAGE */ 426 # ifdef VPGOFF 427 # if NUMCC <= VPGOFF 428 # undef VPGOFF 429 # endif /* NUMCC <= VPGOFF */ 430 # endif /* VPGOFF */ 431 # ifdef VKILL2 432 # if NUMCC <= VKILL2 433 # undef VKILL2 434 # endif /* NUMCC <= VKILL2 */ 435 # endif /* VKILL2 */ 436 # ifdef VBRK 437 # if NUMCC <= VBRK 438 # undef VBRK 439 # endif /* NUMCC <= VBRK */ 440 # endif /* VBRK */ 441 # ifdef VMIN 442 # if NUMCC <= VMIN 443 # undef VMIN 444 # endif /* NUMCC <= VMIN */ 445 # endif /* VMIN */ 446 # ifdef VTIME 447 # if NUMCC <= VTIME 448 # undef VTIME 449 # endif /* NUMCC <= VTIME */ 450 # endif /* VTIME */ 451 # endif /* NUMCC */ 452 #endif /* !POSIX */ 453 454 /* 455 * fix for hpux10 inconsistency: it has VWERASE, but TIOCSLTC returns 456 * EINVAL if one tries to change it 457 */ 458 #if defined(hpux) && defined(VSUSP) && defined(VDSUSP) && defined(VWERASE) && d 459 efined(VLNEXT) 460 # undef TIOCGLTC /* not really needed */ 461 # undef TIOCSLTC 462 #endif 463 464 #define C_INTR 0 465 #define C_QUIT 1 466 #define C_ERASE 2 467 #define C_KILL 3 468 #define C_EOF 4 469 #define C_EOL 5 470 #define C_EOL2 6 471 #define C_SWTCH 7 472 #define C_DSWTCH 8 473 #define C_ERASE2 9 474 #define C_START 10 475 #define C_STOP 11 476 #define C_WERASE 12 477 #define C_SUSP 13 478 #define C_DSUSP 14 479 #define C_REPRINT 15 480 #define C_DISCARD 16 481 #define C_LNEXT 17 482 #define C_STATUS 18 483 #define C_PAGE 19 484 #define C_PGOFF 20 485 #define C_KILL2 21 486 #define C_BRK 22 487 #define C_MIN 23 488 #define C_TIME 24 489 #define C_NCC 25 490 #define C_SH(A) (1 << (A)) 491 492 #endif /* _h_ed_term */ 493