diff options
author | Miles Bader <miles@gnu.org> | 1996-02-14 22:07:04 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1996-02-14 22:07:04 +0000 |
commit | 473aab977cc286839a94d0efe3f011ba71a81a68 (patch) | |
tree | b55076b12e52919372e844bce57f7984e8841995 /boot | |
parent | 5f31d95c75dc3165e4cd8ac11a5c7e238c06575e (diff) |
(init_termstate, restore_termstate, term_sgb, localbits):
Moved here from boot.c
Diffstat (limited to 'boot')
-rw-r--r-- | boot/ux.c | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -241,3 +241,31 @@ printf (const char *fmt, ...) return 0; } + +static struct sgttyb term_sgb; +static int localbits; + +void +init_termstate () +{ + struct sgttyb sgb; + int bits; + ioctl (0, TIOCGETP, &term_sgb); + ioctl (0, TIOCLGET, &localbits); + /* Enter raw made. Rather than try and interpret these bits, + we just do what emacs does in .../emacs/src/sysdep.c for + an old style terminal driver. */ + bits = localbits | LDECCTQ | LLITOUT | LPASS8 | LNOFLSH; + ioctl (0, TIOCLSET, &bits); + sgb = term_sgb; + sgb.sg_flags &= ~ECHO; + sgb.sg_flags |= RAW | ANYP; + ioctl (0, TIOCSETN, &sgb); +} + +void +restore_termstate () +{ + ioctl (0, TIOCLSET, &localbits); + ioctl (0, TIOCSETN, &term_sgb); +} |