1/*- 2 * Copyright (c) 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Christos Zoulas of Cornell University. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 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. 23 * 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. 35 * 36 * @(#)tty.h 8.1 (Berkeley) 6/4/93 37 */ 38 39/* 40 * el.tty.h: Local terminal header 41 */ 42#ifndef _h_el_tty 43#define _h_el_tty 44 45#include "histedit.h" 46#include <termios.h> 47 48/* Define our own since everyone gets it wrong! */ 49#define CONTROL(A) ((A) & 037) 50 51/* 52 * Aix compatible names 53 */ 54# if defined(VWERSE) && !defined(VWERASE) 55# define VWERASE VWERSE 56# endif /* VWERSE && !VWERASE */ 57 58# if defined(VDISCRD) && !defined(VDISCARD) 59# define VDISCARD VDISCRD 60# endif /* VDISCRD && !VDISCARD */ 61 62# if defined(VFLUSHO) && !defined(VDISCARD) 63# define VDISCARD VFLUSHO 64# endif /* VFLUSHO && VDISCARD */ 65 66# if defined(VSTRT) && !defined(VSTART) 67# define VSTART VSTRT 68# endif /* VSTRT && ! VSTART */ 69 70# if defined(VSTAT) && !defined(VSTATUS) 71# define VSTATUS VSTAT 72# endif /* VSTAT && ! VSTATUS */ 73 74# ifndef ONLRET 75# define ONLRET 0 76# endif /* ONLRET */ 77 78# ifndef TAB3 79# ifdef OXTABS 80# define TAB3 OXTABS 81# else 82# define TAB3 0 83# endif /* OXTABS */ 84# endif /* !TAB3 */ 85 86# if defined(OXTABS) && !defined(XTABS) 87# define XTABS OXTABS 88# endif /* OXTABS && !XTABS */ 89 90# ifndef ONLCR 91# define ONLCR 0 92# endif /* ONLCR */ 93 94# ifndef IEXTEN 95# define IEXTEN 0 96# endif /* IEXTEN */ 97 98# ifndef ECHOCTL 99# define ECHOCTL 0 100# endif /* ECHOCTL */ 101 102# ifndef PARENB 103# define PARENB 0 104# endif /* PARENB */ 105 106# ifndef EXTPROC 107# define EXTPROC 0 108# endif /* EXTPROC */ 109 110# ifndef FLUSHO 111# define FLUSHO 0 112# endif /* FLUSHO */ 113 114 115# if defined(VDISABLE) && !defined(_POSIX_VDISABLE) 116# define _POSIX_VDISABLE VDISABLE 117# endif /* VDISABLE && ! _POSIX_VDISABLE */ 118 119/* 120 * Work around ISC's definition of IEXTEN which is 121 * XCASE! 122 */ 123# ifdef ISC 124# if defined(IEXTEN) && defined(XCASE) 125# if IEXTEN == XCASE 126# undef IEXTEN 127# define IEXTEN 0 128# endif /* IEXTEN == XCASE */ 129# endif /* IEXTEN && XCASE */ 130# if defined(IEXTEN) && !defined(XCASE) 131# define XCASE IEXTEN 132# undef IEXTEN 133# define IEXTEN 0 134# endif /* IEXTEN && !XCASE */ 135# endif /* ISC */ 136 137/* 138 * Work around convex weirdness where turning off IEXTEN makes us 139 * lose all postprocessing! 140 */ 141#if defined(convex) || defined(__convex__) 142# if defined(IEXTEN) && IEXTEN != 0 143# undef IEXTEN 144# define IEXTEN 0 145# endif /* IEXTEN != 0 */ 146#endif /* convex || __convex__ */ 147
| 1/*- 2 * Copyright (c) 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Christos Zoulas of Cornell University. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 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. 23 * 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. 35 * 36 * @(#)tty.h 8.1 (Berkeley) 6/4/93 37 */ 38 39/* 40 * el.tty.h: Local terminal header 41 */ 42#ifndef _h_el_tty 43#define _h_el_tty 44 45#include "histedit.h" 46#include <termios.h> 47 48/* Define our own since everyone gets it wrong! */ 49#define CONTROL(A) ((A) & 037) 50 51/* 52 * Aix compatible names 53 */ 54# if defined(VWERSE) && !defined(VWERASE) 55# define VWERASE VWERSE 56# endif /* VWERSE && !VWERASE */ 57 58# if defined(VDISCRD) && !defined(VDISCARD) 59# define VDISCARD VDISCRD 60# endif /* VDISCRD && !VDISCARD */ 61 62# if defined(VFLUSHO) && !defined(VDISCARD) 63# define VDISCARD VFLUSHO 64# endif /* VFLUSHO && VDISCARD */ 65 66# if defined(VSTRT) && !defined(VSTART) 67# define VSTART VSTRT 68# endif /* VSTRT && ! VSTART */ 69 70# if defined(VSTAT) && !defined(VSTATUS) 71# define VSTATUS VSTAT 72# endif /* VSTAT && ! VSTATUS */ 73 74# ifndef ONLRET 75# define ONLRET 0 76# endif /* ONLRET */ 77 78# ifndef TAB3 79# ifdef OXTABS 80# define TAB3 OXTABS 81# else 82# define TAB3 0 83# endif /* OXTABS */ 84# endif /* !TAB3 */ 85 86# if defined(OXTABS) && !defined(XTABS) 87# define XTABS OXTABS 88# endif /* OXTABS && !XTABS */ 89 90# ifndef ONLCR 91# define ONLCR 0 92# endif /* ONLCR */ 93 94# ifndef IEXTEN 95# define IEXTEN 0 96# endif /* IEXTEN */ 97 98# ifndef ECHOCTL 99# define ECHOCTL 0 100# endif /* ECHOCTL */ 101 102# ifndef PARENB 103# define PARENB 0 104# endif /* PARENB */ 105 106# ifndef EXTPROC 107# define EXTPROC 0 108# endif /* EXTPROC */ 109 110# ifndef FLUSHO 111# define FLUSHO 0 112# endif /* FLUSHO */ 113 114 115# if defined(VDISABLE) && !defined(_POSIX_VDISABLE) 116# define _POSIX_VDISABLE VDISABLE 117# endif /* VDISABLE && ! _POSIX_VDISABLE */ 118 119/* 120 * Work around ISC's definition of IEXTEN which is 121 * XCASE! 122 */ 123# ifdef ISC 124# if defined(IEXTEN) && defined(XCASE) 125# if IEXTEN == XCASE 126# undef IEXTEN 127# define IEXTEN 0 128# endif /* IEXTEN == XCASE */ 129# endif /* IEXTEN && XCASE */ 130# if defined(IEXTEN) && !defined(XCASE) 131# define XCASE IEXTEN 132# undef IEXTEN 133# define IEXTEN 0 134# endif /* IEXTEN && !XCASE */ 135# endif /* ISC */ 136 137/* 138 * Work around convex weirdness where turning off IEXTEN makes us 139 * lose all postprocessing! 140 */ 141#if defined(convex) || defined(__convex__) 142# if defined(IEXTEN) && IEXTEN != 0 143# undef IEXTEN 144# define IEXTEN 0 145# endif /* IEXTEN != 0 */ 146#endif /* convex || __convex__ */ 147
|
451} ttyperm_t[NN_IO][M_NN]; 452 453typedef unsigned char ttychar_t[NN_IO][C_NCC]; 454 455protected int tty_init __P((EditLine *)); 456protected void tty_end __P((EditLine *)); 457protected int tty_stty __P((EditLine *, int, char**)); 458protected int tty_rawmode __P((EditLine *)); 459protected int tty_cookedmode __P((EditLine *)); 460protected int tty_quotemode __P((EditLine *)); 461protected int tty_noquotemode __P((EditLine *)); 462protected void tty_bind_char __P((EditLine *, int)); 463 464typedef struct { 465 ttyperm_t t_t; 466 ttychar_t t_c; 467 struct termios t_ex, t_ed, t_ts; 468 int t_tabs; 469 int t_eight; 470 speed_t t_speed; 471 int t_mode; 472 unsigned char t_vdisable; 473} el_tty_t; 474 475 476#endif /* _h_el_tty */
| 456} ttyperm_t[NN_IO][M_NN]; 457 458typedef unsigned char ttychar_t[NN_IO][C_NCC]; 459 460protected int tty_init __P((EditLine *)); 461protected void tty_end __P((EditLine *)); 462protected int tty_stty __P((EditLine *, int, char**)); 463protected int tty_rawmode __P((EditLine *)); 464protected int tty_cookedmode __P((EditLine *)); 465protected int tty_quotemode __P((EditLine *)); 466protected int tty_noquotemode __P((EditLine *)); 467protected void tty_bind_char __P((EditLine *, int)); 468 469typedef struct { 470 ttyperm_t t_t; 471 ttychar_t t_c; 472 struct termios t_ex, t_ed, t_ts; 473 int t_tabs; 474 int t_eight; 475 speed_t t_speed; 476 int t_mode; 477 unsigned char t_vdisable; 478} el_tty_t; 479 480 481#endif /* _h_el_tty */
|