From da0fa7dd0e9bcac546bf08d9e2d6002c2949e169 Mon Sep 17 00:00:00 2001 From: Ralph Campbell Date: Thu, 10 Mar 1983 00:23:24 -0800 Subject: [PATCH] date and time created 83/03/09 16:23:24 by ralph SCCS-vsn: old/lib2648/ttyinit.c 4.1 --- usr/src/old/lib2648/ttyinit.c | 57 +++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 usr/src/old/lib2648/ttyinit.c diff --git a/usr/src/old/lib2648/ttyinit.c b/usr/src/old/lib2648/ttyinit.c new file mode 100644 index 0000000000..2fe10e6255 --- /dev/null +++ b/usr/src/old/lib2648/ttyinit.c @@ -0,0 +1,57 @@ +/* ttyinit.c 4.1 83/03/09 */ +/* + * sgtty stuff + */ + +#include + +struct sgttyb _ttyb; +struct tchars _otch, _ntch; +int _normf; + +/* + * Routines for dealing with the unix tty modes + */ + +#include "2648.h" + +ttyinit() +{ + if (strcmp(getenv("TERM"), "hp2648") == 0) + _on2648 = 1; + ioctl(fileno(stdin), TIOCGETP, &_ttyb); + ioctl(fileno(stdin), TIOCGETC, &_otch); + _ntch = _otch; + _ntch.t_quitc = _ntch.t_startc = _ntch.t_stopc = -1; + _normf = _ttyb.sg_flags; + _ttyb.sg_flags |= CBREAK; + _ttyb.sg_flags &= ~(ECHO|CRMOD); + ioctl(fileno(stdin), TIOCSETN, &_ttyb); + ioctl(fileno(stdin), TIOCSETC, &_ntch); + gdefault(); + zoomn(1); + zoomon(); + kon(); + rboff(); + _cursoron = 1; /* to force it off */ + _escmode = NONE; + curoff(); + clearg(); + gon(); + aoff(); +} + +done() +{ + goff(); + koff(); + aon(); + sync(); + escseq(NONE); + lowleft(); + printf("\n"); + fflush(stdout); + _ttyb.sg_flags = _normf; + ioctl(fileno(stdin), TIOCSETN, &_ttyb); + ioctl(fileno(stdin), TIOCSETC, &_otch); +} -- 2.20.1