remove references to [sg]tty
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 30 Jun 1989 10:28:37 +0000 (02:28 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 30 Jun 1989 10:28:37 +0000 (02:28 -0800)
SCCS-vsn: lib/libcurses/curses.h 5.5
SCCS-vsn: lib/libcurses/tstp.c 5.4
SCCS-vsn: lib/libcurses/setterm.c 5.6

usr/src/lib/libcurses/curses.h
usr/src/lib/libcurses/setterm.c
usr/src/lib/libcurses/tstp.c

index 5841552..184e506 100644 (file)
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)curses.h    5.4 (Berkeley) %G%
+ *     @(#)curses.h    5.5 (Berkeley) %G%
  */
 
 # ifndef WINDOW
 
 # include      <stdio.h>
  
  */
 
 # ifndef WINDOW
 
 # include      <stdio.h>
  
-# include      <sgtty.h>
+# include      <sys/ioctl.h>
 
 # define       bool    char
 # define       reg     register
 
 # define       bool    char
 # define       reg     register
@@ -158,18 +158,28 @@ int       __void__;
 #define        getyx(win,y,x)   y = win->_cury, x = win->_curx
 #define        winch(win)       (win->_y[win->_cury][win->_curx] & 0177)
 
 #define        getyx(win,y,x)   y = win->_cury, x = win->_curx
 #define        winch(win)       (win->_y[win->_cury][win->_curx] & 0177)
 
-#define raw()   (_tty.sg_flags|=RAW, _pfast=_rawmode=TRUE, stty(_tty_ch,&_tty))
-#define noraw()         (_tty.sg_flags&=~RAW,_rawmode=FALSE,_pfast=!(_tty.sg_flags&CRMOD),stty(_tty_ch,&_tty))
-#define cbreak() (_tty.sg_flags |= CBREAK, _rawmode = TRUE, stty(_tty_ch,&_tty))
-#define nocbreak() (_tty.sg_flags &= ~CBREAK,_rawmode=FALSE,stty(_tty_ch,&_tty))
+#define raw()   (_tty.sg_flags|=RAW, _pfast=_rawmode=TRUE, \
+       ioctl(_tty_ch, TIOCSETP, &_tty))
+#define noraw()         (_tty.sg_flags&=~RAW,_rawmode=FALSE,\
+       _pfast=!(_tty.sg_flags&CRMOD),ioctl(_tty_ch, TIOCSETP, &_tty))
+#define cbreak() (_tty.sg_flags |= CBREAK, _rawmode = TRUE, \
+       ioctl(_tty_ch, TIOCSETP, &_tty))
+#define nocbreak() (_tty.sg_flags &= ~CBREAK,_rawmode=FALSE, \
+       ioctl(_tty_ch, TIOCSETP, &_tty))
 #define crmode() cbreak()      /* backwards compatability */
 #define nocrmode() nocbreak()  /* backwards compatability */
 #define crmode() cbreak()      /* backwards compatability */
 #define nocrmode() nocbreak()  /* backwards compatability */
-#define echo()  (_tty.sg_flags |= ECHO, _echoit = TRUE, stty(_tty_ch, &_tty))
-#define noecho() (_tty.sg_flags &= ~ECHO, _echoit = FALSE, stty(_tty_ch, &_tty))
-#define nl()    (_tty.sg_flags |= CRMOD,_pfast = _rawmode,stty(_tty_ch, &_tty))
-#define nonl()  (_tty.sg_flags &= ~CRMOD, _pfast = TRUE, stty(_tty_ch, &_tty))
-#define        savetty() ((void) gtty(_tty_ch, &_tty), _res_flg = _tty.sg_flags)
-#define        resetty() (_tty.sg_flags = _res_flg, (void) stty(_tty_ch, &_tty))
+#define echo()  (_tty.sg_flags |= ECHO, _echoit = TRUE, \
+       ioctl(_tty_ch, TIOCSETP, &_tty))
+#define noecho() (_tty.sg_flags &= ~ECHO, _echoit = FALSE, \
+       ioctl(_tty_ch, TIOCSETP, &_tty))
+#define nl()    (_tty.sg_flags |= CRMOD,_pfast = _rawmode, \
+       ioctl(_tty_ch, TIOCSETP, &_tty))
+#define nonl()  (_tty.sg_flags &= ~CRMOD, _pfast = TRUE, \
+       ioctl(_tty_ch, TIOCSETP, &_tty))
+#define        savetty() ((void) ioctl(_tty_ch, TIOCGETP, &_tty), \
+       _res_flg = _tty.sg_flags)
+#define        resetty() (_tty.sg_flags = _res_flg, \
+       (void) ioctl(_tty_ch, TIOCSETP, &_tty))
 
 #define        erasechar()     (_tty.sg_erase)
 #define        killchar()      (_tty.sg_kill)
 
 #define        erasechar()     (_tty.sg_erase)
 #define        killchar()      (_tty.sg_kill)
index 2e59850..a75da4c 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)setterm.c  5.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)setterm.c  5.6 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -60,10 +60,10 @@ short       ospeed = -1;
 
 gettmode() {
 
 
 gettmode() {
 
-       if (gtty(_tty_ch, &_tty) < 0)
+       if (ioctl(_tty_ch, TIOCGETP, &_tty) < 0)
                return;
        savetty();
                return;
        savetty();
-       if (stty(_tty_ch, &_tty) < 0)
+       if (ioctl(_tty_ch, TIOCSETP, &_tty) < 0)
                _tty.sg_flags = _res_flg;
        ospeed = _tty.sg_ospeed;
        _res_flg = _tty.sg_flags;
                _tty.sg_flags = _res_flg;
        ospeed = _tty.sg_ospeed;
        _res_flg = _tty.sg_flags;
@@ -71,7 +71,7 @@ gettmode() {
        GT = ((_tty.sg_flags & XTABS) == 0);
        NONL = ((_tty.sg_flags & CRMOD) == 0);
        _tty.sg_flags &= ~XTABS;
        GT = ((_tty.sg_flags & XTABS) == 0);
        NONL = ((_tty.sg_flags & CRMOD) == 0);
        _tty.sg_flags &= ~XTABS;
-       stty(_tty_ch, &_tty);
+       ioctl(_tty_ch, TIOCSETP, &_tty);
 # ifdef DEBUG
        fprintf(outf, "GETTMODE: UPPERCASE = %s\n", UPPERCASE ? "TRUE":"FALSE");
        fprintf(outf, "GETTMODE: GT = %s\n", GT ? "TRUE" : "FALSE");
 # ifdef DEBUG
        fprintf(outf, "GETTMODE: UPPERCASE = %s\n", UPPERCASE ? "TRUE":"FALSE");
        fprintf(outf, "GETTMODE: GT = %s\n", GT ? "TRUE" : "FALSE");
index edfb80b..2263895 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)tstp.c     5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)tstp.c     5.4 (Berkeley) %G%";
 #endif /* not lint */
 
 # include      <signal.h>
 #endif /* not lint */
 
 # include      <signal.h>
@@ -26,7 +26,7 @@ static char sccsid[] = "@(#)tstp.c    5.3 (Berkeley) %G%";
 /*
  * handle stop and start signals
  *
 /*
  * handle stop and start signals
  *
- * @(#)tstp.c  5.3 (Berkeley) %G%
+ * @(#)tstp.c  5.4 (Berkeley) %G%
  */
 tstp() {
 
  */
 tstp() {
 
@@ -50,7 +50,7 @@ tstp() {
        sigblock(mask(SIGTSTP));
        signal(SIGTSTP, tstp);
        _tty = tty;
        sigblock(mask(SIGTSTP));
        signal(SIGTSTP, tstp);
        _tty = tty;
-       stty(_tty_ch, &_tty);
+       ioctl(_tty_ch, TIOCSETP, &_tty);
        wrefresh(curscr);
 # endif        SIGTSTP
 }
        wrefresh(curscr);
 # endif        SIGTSTP
 }