summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-02-14 22:07:04 +0000
committerMiles Bader <miles@gnu.org>1996-02-14 22:07:04 +0000
commit473aab977cc286839a94d0efe3f011ba71a81a68 (patch)
treeb55076b12e52919372e844bce57f7984e8841995 /boot
parent5f31d95c75dc3165e4cd8ac11a5c7e238c06575e (diff)
(init_termstate, restore_termstate, term_sgb, localbits):
Moved here from boot.c
Diffstat (limited to 'boot')
-rw-r--r--boot/ux.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/boot/ux.c b/boot/ux.c
index 46e2f130..0a34b25f 100644
--- a/boot/ux.c
+++ b/boot/ux.c
@@ -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);
+}