1: /*
   2:  * Copyright (c) 1980 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  */
   6: 
   7: #ifndef lint
   8: static char sccsid[] = "@(#)ttyinit.c	5.1 (Berkeley) 4/26/85";
   9: #endif not lint
  10: 
  11: /*
  12:  * sgtty stuff
  13:  */
  14: 
  15: #include <sgtty.h>
  16: 
  17: struct  sgttyb  _ttyb;
  18: struct  tchars  _otch, _ntch;
  19: int _normf;
  20: 
  21: /*
  22:  * Routines for dealing with the unix tty modes
  23:  */
  24: 
  25: #include "2648.h"
  26: 
  27: ttyinit()
  28: {
  29:     if (strcmp(getenv("TERM"), "hp2648") == 0)
  30:         _on2648 = 1;
  31:     ioctl(fileno(stdin), TIOCGETP, &_ttyb);
  32:     ioctl(fileno(stdin), TIOCGETC, &_otch);
  33:     _ntch = _otch;
  34:     _ntch.t_quitc = _ntch.t_startc = _ntch.t_stopc = -1;
  35:     _normf = _ttyb.sg_flags;
  36:     _ttyb.sg_flags |= CBREAK;
  37:     _ttyb.sg_flags &= ~(ECHO|CRMOD);
  38:     ioctl(fileno(stdin), TIOCSETN, &_ttyb);
  39:     ioctl(fileno(stdin), TIOCSETC, &_ntch);
  40:     gdefault();
  41:     zoomn(1);
  42:     zoomon();
  43:     kon();
  44:     rboff();
  45:     _cursoron = 1;  /* to force it off */
  46:     _escmode = NONE;
  47:     curoff();
  48:     clearg();
  49:     gon();
  50:     aoff();
  51: }
  52: 
  53: done()
  54: {
  55:     goff();
  56:     koff();
  57:     aon();
  58:     sync();
  59:     escseq(NONE);
  60:     lowleft();
  61:     printf("\n");
  62:     fflush(stdout);
  63:     _ttyb.sg_flags = _normf;
  64:     ioctl(fileno(stdin), TIOCSETN, &_ttyb);
  65:     ioctl(fileno(stdin), TIOCSETC, &_otch);
  66: }

Defined functions

done defined in line 53; never used
ttyinit defined in line 27; used 1 times

Defined variables

_normf defined in line 19; used 2 times
_ntch defined in line 18; used 5 times
_otch defined in line 18; used 3 times
_ttyb defined in line 17; used 7 times
sccsid defined in line 8; never used
Last modified: 1985-04-26
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 968
Valid CSS Valid XHTML 1.0 Strict