Deleted Added
full compact
tty.h (148834) tty.h (276881)
1/* $NetBSD: tty.h,v 1.15 2014/05/19 19:54:12 christos Exp $ */
2
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

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

25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * @(#)tty.h 8.1 (Berkeley) 6/4/93
3/*-
4 * Copyright (c) 1992, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * Christos Zoulas of Cornell University.
9 *
10 * Redistribution and use in source and binary forms, with or without

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

27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)tty.h 8.1 (Berkeley) 6/4/93
33 * $NetBSD: tty.h,v 1.11 2005/06/01 11:37:52 lukem Exp $
34 * $FreeBSD: head/lib/libedit/tty.h 148834 2005-08-07 20:55:59Z stefanf $
35 * $FreeBSD: head/lib/libedit/tty.h 276881 2015-01-09 07:40:56Z bapt $
35 */
36
37/*
38 * el.tty.h: Local terminal header
39 */
40#ifndef _h_el_tty
41#define _h_el_tty
42
36 */
37
38/*
39 * el.tty.h: Local terminal header
40 */
41#ifndef _h_el_tty
42#define _h_el_tty
43
44#include "sys.h"
43#include "histedit.h"
44#include <termios.h>
45#include <unistd.h>
46
47/* Define our own since everyone gets it wrong! */
48#define CONTROL(A) ((A) & 037)
49
50/*

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

425#define C_STATUS 18
426#define C_PAGE 19
427#define C_PGOFF 20
428#define C_KILL2 21
429#define C_BRK 22
430#define C_MIN 23
431#define C_TIME 24
432#define C_NCC 25
45#include "histedit.h"
46#include <termios.h>
47#include <unistd.h>
48
49/* Define our own since everyone gets it wrong! */
50#define CONTROL(A) ((A) & 037)
51
52/*

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

427#define C_STATUS 18
428#define C_PAGE 19
429#define C_PGOFF 20
430#define C_KILL2 21
431#define C_BRK 22
432#define C_MIN 23
433#define C_TIME 24
434#define C_NCC 25
433#define C_SH(A) (1 << (A))
435#define C_SH(A) ((unsigned int)(1 << (A)))
434
435/*
436 * Terminal dependend data structures
437 */
438#define EX_IO 0 /* while we are executing */
439#define ED_IO 1 /* while we are editing */
440#define TS_IO 2 /* new mode from terminal */
441#define QU_IO 2 /* used only for quoted chars */
442#define NN_IO 3 /* The number of entries */
443
436
437/*
438 * Terminal dependend data structures
439 */
440#define EX_IO 0 /* while we are executing */
441#define ED_IO 1 /* while we are editing */
442#define TS_IO 2 /* new mode from terminal */
443#define QU_IO 2 /* used only for quoted chars */
444#define NN_IO 3 /* The number of entries */
445
446/* Don't re-order */
444#define MD_INP 0
445#define MD_OUT 1
446#define MD_CTL 2
447#define MD_LIN 3
448#define MD_CHAR 4
449#define MD_NN 5
450
451typedef struct {
452 const char *t_name;
453 unsigned int t_setmask;
454 unsigned int t_clrmask;
455} ttyperm_t[NN_IO][MD_NN];
456
457typedef unsigned char ttychar_t[NN_IO][C_NCC];
458
459protected int tty_init(EditLine *);
460protected void tty_end(EditLine *);
447#define MD_INP 0
448#define MD_OUT 1
449#define MD_CTL 2
450#define MD_LIN 3
451#define MD_CHAR 4
452#define MD_NN 5
453
454typedef struct {
455 const char *t_name;
456 unsigned int t_setmask;
457 unsigned int t_clrmask;
458} ttyperm_t[NN_IO][MD_NN];
459
460typedef unsigned char ttychar_t[NN_IO][C_NCC];
461
462protected int tty_init(EditLine *);
463protected void tty_end(EditLine *);
461protected int tty_stty(EditLine *, int, const char **);
464protected int tty_stty(EditLine *, int, const Char **);
462protected int tty_rawmode(EditLine *);
463protected int tty_cookedmode(EditLine *);
464protected int tty_quotemode(EditLine *);
465protected int tty_noquotemode(EditLine *);
466protected void tty_bind_char(EditLine *, int);
467
468typedef struct {
469 ttyperm_t t_t;
470 ttychar_t t_c;
465protected int tty_rawmode(EditLine *);
466protected int tty_cookedmode(EditLine *);
467protected int tty_quotemode(EditLine *);
468protected int tty_noquotemode(EditLine *);
469protected void tty_bind_char(EditLine *, int);
470
471typedef struct {
472 ttyperm_t t_t;
473 ttychar_t t_c;
471 struct termios t_ex, t_ed, t_ts;
474 struct termios t_or, t_ex, t_ed, t_ts;
472 int t_tabs;
473 int t_eight;
474 speed_t t_speed;
475 int t_mode;
476 unsigned char t_vdisable;
477} el_tty_t;
478
479
480#endif /* _h_el_tty */
475 int t_tabs;
476 int t_eight;
477 speed_t t_speed;
478 int t_mode;
479 unsigned char t_vdisable;
480} el_tty_t;
481
482
483#endif /* _h_el_tty */