#include "compat.h"#include "sys.h"#include "tty.h"#include "el.h"#include "errno.h"#include "stdio.h"Go to the source code of this file.
Classes | |
| struct | TTYModes_t |
| struct | TTYMap_t |
Defines | |
| #define | tty_getty(el, td) tcgetattr((el)->fInFD, (td)) |
| #define | tty_setty(el, td) tcsetattr((el)->fInFD, TCSADRAIN, (td)) |
| #define | tty__gettabs(td) ((((td)->c_oflag & TAB3) == TAB3) ? 0 : 1) |
| #define | tty__geteightbit(td) (((td)->c_cflag & CSIZE) == CS8) |
| #define | tty__cooked_mode(td) ((td)->c_lflag & ICANON) |
| #define | t_qu t_ts |
Functions | |
| el_private void | tty__getchar (struct termios *, unsigned char *) |
| el_private void | tty__setchar (struct termios *, unsigned char *) |
| el_private speed_t | tty__getspeed (struct termios *) |
| el_private int | tty_setup (EditLine_t *) |
| int | tty_can_output (void) |
| el_protected int | tty_init (EditLine_t *el) |
| el_protected void | tty_end (EditLine_t *) |
| el_protected void | tty_bind_char (EditLine_t *el, int force) |
| el_protected int | tty_rawmode (EditLine_t *el) |
| el_protected int | tty_cookedmode (EditLine_t *el) |
| el_protected int | tty_quotemode (EditLine_t *el) |
| el_protected int | tty_noquotemode (EditLine_t *el) |
| el_protected int | tty_stty (EditLine_t *el, int, const char **cargv) |
Variables | |
| el_private const TTYPerm_t | ttyperm |
| el_private const TTYChar_t | ttychar |
| el_private const TTYMap_t | tty_map [] |
| el_private const TTYModes_t | ttymodes [] |
| bool | tty_need_to_run_setup = false |
| #define tty__cooked_mode | ( | td | ) | ((td)->c_lflag & ICANON) |
| #define tty__geteightbit | ( | td | ) | (((td)->c_cflag & CSIZE) == CS8) |
| #define tty__gettabs | ( | td | ) | ((((td)->c_oflag & TAB3) == TAB3) ? 0 : 1) |
| #define tty_getty | ( | el, | |||
| td | ) | tcgetattr((el)->fInFD, (td)) |
| #define tty_setty | ( | el, | |||
| td | ) | tcsetattr((el)->fInFD, TCSADRAIN, (td)) |
Definition at line 456 of file tty.cxx.
Referenced by tty_cookedmode(), tty_noquotemode(), and tty_quotemode().
| el_private void tty__getchar | ( | struct termios * | , | |
| unsigned char * | ||||
| ) |
Definition at line 627 of file tty.cxx.
References C_DISCARD, C_DSUSP, C_DSWTCH, C_EOF, C_EOL, C_EOL2, C_ERASE, C_ERASE2, C_INTR, C_KILL, C_KILL2, C_LNEXT, C_MIN, C_PAGE, C_PGOFF, C_QUIT, C_REPRINT, C_START, C_STATUS, C_STOP, C_SUSP, C_SWTCH, C_TIME, and C_WERASE.
Referenced by tty_rawmode(), and tty_setup().
| el_private speed_t tty__getspeed | ( | struct termios * | ) |
| el_private void tty__setchar | ( | struct termios * | , | |
| unsigned char * | ||||
| ) |
| el_protected void tty_bind_char | ( | EditLine_t * | el, | |
| int | force | |||
| ) |
Definition at line 787 of file tty.cxx.
References ED_IO, ElMap_t::fAlt, TTYMap_t::fBind, ElMap_t::fEmacs, ElMap_t::fKey, EditLine_t::fMap, TTYMap_t::fNCh, TTYMap_t::fOCh, EditLine_t::fTTY, ElMap_t::fType, ElMap_t::fVic, ElMap_t::fVii, if(), key_clear(), MAP_VI, NULL, and ElTTY_t::t_c.
Referenced by map_init_emacs(), map_init_vi(), and tty_rawmode().
| int tty_can_output | ( | void | ) |
Definition at line 474 of file tty.cxx.
References STDOUT_FILENO.
Referenced by prompt_print(), sig_handler(), and tty_setup().
| el_protected int tty_cookedmode | ( | EditLine_t * | el | ) |
Definition at line 1013 of file tty.cxx.
References EDIT_DISABLED, EX_IO, EditLine_t::fErrFile, EditLine_t::fFlags, fprintf(), EditLine_t::fTTY, strerror(), ElTTY_t::t_mode, tty_setty, tty_setup(), and void.
Referenced by el_reset(), readline(), and sig_handler().
| el_protected void tty_end | ( | EditLine_t * | ) |
| el_protected int tty_init | ( | EditLine_t * | el | ) |
Definition at line 590 of file tty.cxx.
References _POSIX_VDISABLE, EX_IO, EditLine_t::fTTY, ElTTY_t::t_c, ElTTY_t::t_mode, ElTTY_t::t_t, ElTTY_t::t_vdisable, tty_setup(), ttyperm, and void.
Referenced by el_init().
| el_protected int tty_noquotemode | ( | EditLine_t * | el | ) |
Definition at line 1086 of file tty.cxx.
References ED_IO, EditLine_t::fErrFile, fprintf(), EditLine_t::fTTY, QU_IO, strerror(), ElTTY_t::t_mode, tty_setty, tty_setup(), and void.
Referenced by ed_quoted_insert(), and setEcho().
| el_protected int tty_quotemode | ( | EditLine_t * | el | ) |
Definition at line 1045 of file tty.cxx.
References EditLine_t::fErrFile, fprintf(), EditLine_t::fTTY, MD_CTL, MD_INP, MD_LIN, MD_OUT, QU_IO, strerror(), TTYPerm_t::t_clrmask, ElTTY_t::t_mode, TTYPerm_t::t_setmask, ElTTY_t::t_t, tty_setty, tty_setup(), and void.
Referenced by ed_quoted_insert(), and setEcho().
| el_protected int tty_rawmode | ( | EditLine_t * | el | ) |
Definition at line 835 of file tty.cxx.
References C_NCC, C_SH, ED_IO, EDIT_DISABLED, EL_CAN_TAB, EX_IO, EditLine_t::fErrFile, EditLine_t::fFlags, fprintf(), EditLine_t::fTTY, i, MD_CHAR, MD_CTL, MD_INP, MD_LIN, MD_OUT, QU_IO, strerror(), ElTTY_t::t_c, TTYPerm_t::t_clrmask, ElTTY_t::t_eight, ElTTY_t::t_mode, TTYPerm_t::t_setmask, ElTTY_t::t_speed, ElTTY_t::t_t, ElTTY_t::t_tabs, ElTTY_t::t_ts, ElTTY_t::t_vdisable, TS_IO, tty__cooked_mode, tty__getchar(), tty__geteightbit, tty__getspeed(), tty__gettabs, tty__setchar(), tty_bind_char(), tty_getty, tty_setup(), and void.
Referenced by readline(), and sig_handler().
| el_private int tty_setup | ( | EditLine_t * | ) |
Definition at line 485 of file tty.cxx.
References C_NCC, ED_IO, EX_IO, EditLine_t::fErrFile, fprintf(), EditLine_t::fTTY, MD_CTL, MD_INP, MD_LIN, MD_OUT, strerror(), ElTTY_t::t_c, TTYPerm_t::t_clrmask, ElTTY_t::t_eight, TTYPerm_t::t_setmask, ElTTY_t::t_speed, ElTTY_t::t_t, ElTTY_t::t_tabs, ElTTY_t::t_ts, ElTTY_t::t_vdisable, TS_IO, tty__cooked_mode, tty__getchar(), tty__geteightbit, tty__getspeed(), tty__gettabs, tty_can_output(), tty_getty, and void.
Referenced by tty_cookedmode(), tty_init(), tty_noquotemode(), tty_quotemode(), and tty_rawmode().
| el_protected int tty_stty | ( | EditLine_t * | el, | |
| int | , | |||
| const char ** | cargv | |||
| ) |
Definition at line 1114 of file tty.cxx.
References d, ED_IO, EX_IO, EditLine_t::fErrFile, ElCoord_t::fH, EditLine_t::fOutFile, fprintf(), ElTerm_t::fSize, EditLine_t::fTerm, EditLine_t::fTTY, i, if(), len, m, name, NULL, QU_IO, s, TTYPerm_t::t_clrmask, TTYPerm_t::t_name, TTYPerm_t::t_setmask, ElTTY_t::t_t, void, and x.
Referenced by el_builtins_init(), el_get(), and el_set().
| bool tty_need_to_run_setup = false |
Initial value:
{
{
CINTR, CQUIT, CERASE, CKILL,
CEOF, CEOL, CEOL2, CSWTCH,
CDSWTCH, CERASE2, CSTART, CSTOP,
CWERASE, CSUSP, CDSUSP, CREPRINT,
CDISCARD, CLNEXT, CSTATUS, CPAGE,
CPGOFF, CKILL2, CBRK, CMIN,
CTIME
},
{
CINTR, CQUIT, CERASE, CKILL,
_POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE,
_POSIX_VDISABLE, CERASE2, CSTART, CSTOP,
_POSIX_VDISABLE, CSUSP, _POSIX_VDISABLE, _POSIX_VDISABLE,
CDISCARD, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE,
_POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, 1,
0
},
{
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0
}
}
| el_private const TTYModes_t ttymodes[] |
Initial value:
{
{
{ "iflag:", ICRNL, (INLCR | IGNCR) },
{ "oflag:", (OPOST | ONLCR), ONLRET },
{ "cflag:", 0, 0 },
{ "lflag:", (ISIG | ICANON | ECHO | ECHOE | ECHOCTL | IEXTEN),
(NOFLSH | ECHONL | EXTPROC | FLUSHO) },
{ "chars:", 0, 0 },
},
{
{ "iflag:", (INLCR | ICRNL), IGNCR },
{ "oflag:", (OPOST | ONLCR), ONLRET },
{ "cflag:", 0, 0 },
{ "lflag:", ISIG,
(NOFLSH | ICANON | ECHO | ECHOK | ECHONL | EXTPROC | IEXTEN | FLUSHO) },
{ "chars:", (C_SH(C_MIN) | C_SH(C_TIME) | C_SH(C_SWTCH) | C_SH(C_DSWTCH) |
C_SH(C_SUSP) | C_SH(C_DSUSP) | C_SH(C_EOL) | C_SH(C_DISCARD) |
C_SH(C_PGOFF) | C_SH(C_PAGE) | C_SH(C_STATUS)), 0 }
},
{
{ "iflag:", 0, IXON | IXOFF | INLCR | ICRNL },
{ "oflag:", 0, 0 },
{ "cflag:", 0, 0 },
{ "lflag:", 0, ISIG | IEXTEN },
{ "chars:", 0, 0 },
}
}
Definition at line 71 of file tty.cxx.
Referenced by tty_init().
1.5.1