Deleted Added
full compact
tty.h (26926) tty.h (84260)
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

--- 20 unchanged lines hidden (view full) ---

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
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

--- 20 unchanged lines hidden (view full) ---

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 * $NetBSD: tty.h,v 1.7 1999/09/26 14:37:47 lukem Exp $
38 * $FreeBSD: head/lib/libedit/tty.h 84260 2001-10-01 08:41:27Z obrien $
37 */
38
39/*
40 * el.tty.h: Local terminal header
41 */
42#ifndef _h_el_tty
39 */
40
41/*
42 * el.tty.h: Local terminal header
43 */
44#ifndef _h_el_tty
43#define _h_el_tty
45#define _h_el_tty
44
45#include "histedit.h"
46#include <termios.h>
46
47#include "histedit.h"
48#include <termios.h>
49#include <unistd.h>
47
48/* Define our own since everyone gets it wrong! */
50
51/* Define our own since everyone gets it wrong! */
49#define CONTROL(A) ((A) & 037)
52#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

--- 342 unchanged lines hidden (view full) ---

400# ifdef VTIME
401# if NUMCC <= VTIME
402# undef VTIME
403# endif /* NUMCC <= VTIME */
404# endif /* VTIME */
405# endif /* NUMCC */
406#endif /* !POSIX */
407
53
54/*
55 * Aix compatible names
56 */
57# if defined(VWERSE) && !defined(VWERASE)
58# define VWERASE VWERSE
59# endif /* VWERSE && !VWERASE */
60

--- 342 unchanged lines hidden (view full) ---

403# ifdef VTIME
404# if NUMCC <= VTIME
405# undef VTIME
406# endif /* NUMCC <= VTIME */
407# endif /* VTIME */
408# endif /* NUMCC */
409#endif /* !POSIX */
410
408#define C_INTR 0
409#define C_QUIT 1
410#define C_ERASE 2
411#define C_KILL 3
412#define C_EOF 4
413#define C_EOL 5
414#define C_EOL2 6
415#define C_SWTCH 7
416#define C_DSWTCH 8
417#define C_ERASE2 9
418#define C_START 10
419#define C_STOP 11
420#define C_WERASE 12
421#define C_SUSP 13
422#define C_DSUSP 14
423#define C_REPRINT 15
424#define C_DISCARD 16
425#define C_LNEXT 17
426#define C_STATUS 18
427#define C_PAGE 19
428#define C_PGOFF 20
429#define C_KILL2 21
430#define C_BRK 22
431#define C_MIN 23
432#define C_TIME 24
433#define C_NCC 25
434#define C_SH(A) (1 << (A))
411#define C_INTR 0
412#define C_QUIT 1
413#define C_ERASE 2
414#define C_KILL 3
415#define C_EOF 4
416#define C_EOL 5
417#define C_EOL2 6
418#define C_SWTCH 7
419#define C_DSWTCH 8
420#define C_ERASE2 9
421#define C_START 10
422#define C_STOP 11
423#define C_WERASE 12
424#define C_SUSP 13
425#define C_DSUSP 14
426#define C_REPRINT 15
427#define C_DISCARD 16
428#define C_LNEXT 17
429#define C_STATUS 18
430#define C_PAGE 19
431#define C_PGOFF 20
432#define C_KILL2 21
433#define C_BRK 22
434#define C_MIN 23
435#define C_TIME 24
436#define C_NCC 25
437#define C_SH(A) (1 << (A))
435
436/*
437 * Terminal dependend data structures
438 */
438
439/*
440 * Terminal dependend data structures
441 */
439#define EX_IO 0 /* while we are executing */
440#define ED_IO 1 /* while we are editing */
441#define TS_IO 2 /* new mode from terminal */
442#define QU_IO 2 /* used only for quoted chars */
443#define NN_IO 3 /* The number of entries */
442#define EX_IO 0 /* while we are executing */
443#define ED_IO 1 /* while we are editing */
444#define TS_IO 2 /* new mode from terminal */
445#define QU_IO 2 /* used only for quoted chars */
446#define NN_IO 3 /* The number of entries */
444
447
445#define M_INP 0
446#define M_OUT 1
447#define M_CTL 2
448#define M_LIN 3
449#define M_CHAR 4
450#define M_NN 5
448#define MD_INP 0
449#define MD_OUT 1
450#define MD_CTL 2
451#define MD_LIN 3
452#define MD_CHAR 4
453#define MD_NN 5
451
452typedef struct {
454
455typedef struct {
453 char *t_name;
454 u_int t_setmask;
455 u_int t_clrmask;
456} ttyperm_t[NN_IO][M_NN];
456 char *t_name;
457 u_int t_setmask;
458 u_int t_clrmask;
459} ttyperm_t[NN_IO][MD_NN];
457
458typedef unsigned char ttychar_t[NN_IO][C_NCC];
459
460
461typedef unsigned char ttychar_t[NN_IO][C_NCC];
462
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));
463protected int tty_init(EditLine *);
464protected void tty_end(EditLine *);
465protected int tty_stty(EditLine *, int, char**);
466protected int tty_rawmode(EditLine *);
467protected int tty_cookedmode(EditLine *);
468protected int tty_quotemode(EditLine *);
469protected int tty_noquotemode(EditLine *);
470protected void tty_bind_char(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 */
471
472typedef struct {
473 ttyperm_t t_t;
474 ttychar_t t_c;
475 struct termios t_ex, t_ed, t_ts;
476 int t_tabs;
477 int t_eight;
478 speed_t t_speed;
479 int t_mode;
480 unsigned char t_vdisable;
481} el_tty_t;
482
483
484#endif /* _h_el_tty */