Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libcurses Move setting of __endwin so that we also chang...



details:   https://anonhg.NetBSD.org/src/rev/169de0448b4b
branches:  trunk
changeset: 487956:169de0448b4b
user:      jdc <jdc%NetBSD.org@localhost>
date:      Thu Jun 15 21:20:16 2000 +0000

description:
Move setting of __endwin so that we also change it from the stop handler.

diffstat:

 lib/libcurses/initscr.c |   6 +-
 lib/libcurses/refresh.c |   8 +---
 lib/libcurses/tstp.c    |   6 ++-
 lib/libcurses/tty.c     |  78 +++++++++++++++---------------------------------
 4 files changed, 34 insertions(+), 64 deletions(-)

diffs (truncated from 315 to 300 lines):

diff -r f2a17f2bfaa9 -r 169de0448b4b lib/libcurses/initscr.c
--- a/lib/libcurses/initscr.c   Thu Jun 15 21:07:37 2000 +0000
+++ b/lib/libcurses/initscr.c   Thu Jun 15 21:20:16 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: initscr.c,v 1.18 2000/05/01 12:30:30 blymn Exp $       */
+/*     $NetBSD: initscr.c,v 1.19 2000/06/15 21:20:16 jdc Exp $ */
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)initscr.c  8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: initscr.c,v 1.18 2000/05/01 12:30:30 blymn Exp $");
+__RCSID("$NetBSD: initscr.c,v 1.19 2000/06/15 21:20:16 jdc Exp $");
 #endif
 #endif /* not lint */
 
@@ -64,7 +64,7 @@
        __CTRACE("initscr\n");
 #endif
        __echoit = 1;
-        __pfast = __rawmode = __noqch = __endwin = 0;
+        __pfast = __rawmode = __noqch = 0;
        __nca = A_NORMAL;
 
        if (gettmode() == ERR)
diff -r f2a17f2bfaa9 -r 169de0448b4b lib/libcurses/refresh.c
--- a/lib/libcurses/refresh.c   Thu Jun 15 21:07:37 2000 +0000
+++ b/lib/libcurses/refresh.c   Thu Jun 15 21:20:16 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: refresh.c,v 1.36 2000/06/12 20:51:39 jdc Exp $ */
+/*     $NetBSD: refresh.c,v 1.37 2000/06/15 21:20:16 jdc Exp $ */
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)refresh.c  8.7 (Berkeley) 8/13/94";
 #else
-__RCSID("$NetBSD: refresh.c,v 1.36 2000/06/12 20:51:39 jdc Exp $");
+__RCSID("$NetBSD: refresh.c,v 1.37 2000/06/15 21:20:16 jdc Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -215,10 +215,8 @@
        int      dnum;
 
        /* Check if we need to restart ... */
-       if (__endwin) {
-               __endwin = 0;
+       if (__endwin)
                __restartwin();
-       }
 
        if (curwin)
                win = curscr;
diff -r f2a17f2bfaa9 -r 169de0448b4b lib/libcurses/tstp.c
--- a/lib/libcurses/tstp.c      Thu Jun 15 21:07:37 2000 +0000
+++ b/lib/libcurses/tstp.c      Thu Jun 15 21:20:16 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tstp.c,v 1.20 2000/05/22 05:54:37 jdc Exp $    */
+/*     $NetBSD: tstp.c,v 1.21 2000/06/15 21:20:16 jdc Exp $    */
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)tstp.c     8.3 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: tstp.c,v 1.20 2000/05/22 05:54:37 jdc Exp $");
+__RCSID("$NetBSD: tstp.c,v 1.21 2000/06/15 21:20:16 jdc Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -141,6 +141,8 @@
        (void) fflush(stdout);
        (void) setvbuf(stdout, NULL, _IOLBF, (size_t) 0);
 
+       __endwin = 1;
+
        return (tcsetattr(STDIN_FILENO, __tcaction ?
            TCSASOFT | TCSADRAIN : TCSADRAIN, &__orig_termios) ? ERR : OK);
 }
diff -r f2a17f2bfaa9 -r 169de0448b4b lib/libcurses/tty.c
--- a/lib/libcurses/tty.c       Thu Jun 15 21:07:37 2000 +0000
+++ b/lib/libcurses/tty.c       Thu Jun 15 21:20:16 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tty.c,v 1.21 2000/05/22 05:54:37 jdc Exp $     */
+/*     $NetBSD: tty.c,v 1.22 2000/06/15 21:20:16 jdc Exp $     */
 
 /*-
  * Copyright (c) 1992, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)tty.c      8.6 (Berkeley) 1/10/95";
 #else
-__RCSID("$NetBSD: tty.c,v 1.21 2000/05/22 05:54:37 jdc Exp $");
+__RCSID("$NetBSD: tty.c,v 1.22 2000/06/15 21:20:16 jdc Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -66,12 +66,12 @@
 int    __tcaction = 0;
 #endif
 
-struct termios __orig_termios, __baset;
-int    __endwin;
-static struct termios cbreakt, rawt, *curt;
-static int useraw;
-static int ovmin = 1;
-static int ovtime = 0;
+struct termios __orig_termios, __baset;
+int            __endwin;
+static struct  termios cbreakt, rawt, *curt;
+static int     useraw;
+static int     ovmin = 1;
+static int     ovtime = 0;
 
 #ifndef        OXTABS
 #ifdef XTABS                   /* SMI uses XTABS. */
@@ -140,10 +140,8 @@
 raw(void)
 {
        /* Check if we need to restart ... */
-       if (__endwin) {
+       if (__endwin)
                __endwin = 0;
-               __restartwin();
-       }
 
        useraw = __pfast = __rawmode = 1;
        curt = &rawt;
@@ -155,10 +153,8 @@
 noraw(void)
 {
        /* Check if we need to restart ... */
-       if (__endwin) {
+       if (__endwin)
                __endwin = 0;
-               __restartwin();
-       }
 
        useraw = __pfast = __rawmode = 0;
        curt = &__baset;
@@ -170,10 +166,8 @@
 cbreak(void)
 {
        /* Check if we need to restart ... */
-       if (__endwin) {
+       if (__endwin)
                __endwin = 0;
-               __restartwin();
-       }
 
        __rawmode = 1;
        curt = useraw ? &rawt : &cbreakt;
@@ -185,10 +179,8 @@
 nocbreak(void)
 {
        /* Check if we need to restart ... */
-       if (__endwin) {
+       if (__endwin)
                __endwin = 0;
-               __restartwin();
-       }
 
        __rawmode = 0;
        curt = useraw ? &rawt : &__baset;
@@ -200,10 +192,8 @@
 __delay(void)
  {
        /* Check if we need to restart ... */
-       if (__endwin) {
+       if (__endwin)
                __endwin = 0;
-               __restartwin();
-       }
 
        rawt.c_cc[VMIN] = 1;
        rawt.c_cc[VTIME] = 0;
@@ -220,10 +210,8 @@
 __nodelay(void)
 {
        /* Check if we need to restart ... */
-       if (__endwin) {
+       if (__endwin)
                __endwin = 0;
-               __restartwin();
-       }
 
        rawt.c_cc[VMIN] = 0;
        rawt.c_cc[VTIME] = 0;
@@ -240,10 +228,8 @@
 __save_termios(void)
 {
        /* Check if we need to restart ... */
-       if (__endwin) {
+       if (__endwin)
                __endwin = 0;
-               __restartwin();
-       }
 
        ovmin = cbreakt.c_cc[VMIN];
        ovtime = cbreakt.c_cc[VTIME];
@@ -253,10 +239,8 @@
 __restore_termios(void)
 {
        /* Check if we need to restart ... */
-       if (__endwin) {
+       if (__endwin)
                __endwin = 0;
-               __restartwin();
-       }
 
        rawt.c_cc[VMIN] = ovmin;
        rawt.c_cc[VTIME] = ovtime;
@@ -270,10 +254,8 @@
 __timeout(int delay)
 {
        /* Check if we need to restart ... */
-       if (__endwin) {
+       if (__endwin)
                __endwin = 0;
-               __restartwin();
-       }
 
        ovmin = cbreakt.c_cc[VMIN];
        ovtime = cbreakt.c_cc[VTIME];
@@ -292,10 +274,8 @@
 __notimeout(void)
 {
        /* Check if we need to restart ... */
-       if (__endwin) {
+       if (__endwin)
                __endwin = 0;
-               __restartwin();
-       }
 
        rawt.c_cc[VMIN] = 1;
        rawt.c_cc[VTIME] = 0;
@@ -312,10 +292,8 @@
 echo(void)
 {
        /* Check if we need to restart ... */
-       if (__endwin) {
+       if (__endwin)
                __endwin = 0;
-               __restartwin();
-       }
 
        __echoit = 1;
        return (OK);
@@ -325,10 +303,8 @@
 noecho(void)
 {
        /* Check if we need to restart ... */
-       if (__endwin) {
+       if (__endwin)
                __endwin = 0;
-               __restartwin();
-       }
 
        __echoit = 0;
        return (OK);
@@ -338,10 +314,8 @@
 nl(void)
 {
        /* Check if we need to restart ... */
-       if (__endwin) {
+       if (__endwin)
                __endwin = 0;
-               __restartwin();
-       }
 
        rawt.c_iflag |= ICRNL;
        rawt.c_oflag |= ONLCR;
@@ -359,10 +333,8 @@
 nonl(void)
 {
        /* Check if we need to restart ... */
-       if (__endwin) {
+       if (__endwin)
                __endwin = 0;
-               __restartwin();
-       }
 
        rawt.c_iflag &= ~ICRNL;
        rawt.c_oflag &= ~ONLCR;
@@ -380,10 +352,8 @@
 intrflush(WINDOW *win, bool bf)        /*ARGSUSED*/
 {
        /* Check if we need to restart ... */
-       if (__endwin) {
+       if (__endwin)
                __endwin = 0;
-               __restartwin();
-       }
 
        if (bf) {



Home | Main Index | Thread Index | Old Index