today's work
authorEdward Wang <edward@ucbvax.Berkeley.EDU>
Wed, 20 Jul 1983 11:08:12 +0000 (03:08 -0800)
committerEdward Wang <edward@ucbvax.Berkeley.EDU>
Wed, 20 Jul 1983 11:08:12 +0000 (03:08 -0800)
SCCS-vsn: usr.bin/window/main.c 1.4
SCCS-vsn: usr.bin/window/wwchild.c 1.4
SCCS-vsn: usr.bin/window/wwend.c 1.4
SCCS-vsn: usr.bin/window/wwiomux.c 1.4
SCCS-vsn: usr.bin/window/wwspawn.c 1.4
SCCS-vsn: usr.bin/window/wwinit.c 1.4
SCCS-vsn: usr.bin/window/wwmisc.c 1.4
SCCS-vsn: usr.bin/window/wwopen.c 1.4
SCCS-vsn: usr.bin/window/wwputc.c 1.4
SCCS-vsn: usr.bin/window/wwputs.c 1.4
SCCS-vsn: usr.bin/window/ww.h 1.4
SCCS-vsn: usr.bin/window/cmd.c 1.2
SCCS-vsn: usr.bin/window/cmd1.c 1.2
SCCS-vsn: usr.bin/window/wwtty.c 1.3
SCCS-vsn: usr.bin/window/wwwrite.c 1.3
SCCS-vsn: usr.bin/window/cmd2.c 1.2
SCCS-vsn: usr.bin/window/wwsuspend.c 1.3
SCCS-vsn: usr.bin/window/wwprintf.c 1.3
SCCS-vsn: usr.bin/window/cmd3.c 1.2
SCCS-vsn: usr.bin/window/wwgets.c 1.2
SCCS-vsn: usr.bin/window/wwclose.c 1.2
SCCS-vsn: usr.bin/window/wwframe.c 1.2
SCCS-vsn: usr.bin/window/wwlabel.c 1.2
SCCS-vsn: usr.bin/window/defs.h 1.2

24 files changed:
usr/src/usr.bin/window/cmd.c
usr/src/usr.bin/window/cmd1.c
usr/src/usr.bin/window/cmd2.c
usr/src/usr.bin/window/cmd3.c
usr/src/usr.bin/window/defs.h
usr/src/usr.bin/window/main.c
usr/src/usr.bin/window/ww.h
usr/src/usr.bin/window/wwchild.c
usr/src/usr.bin/window/wwclose.c
usr/src/usr.bin/window/wwend.c
usr/src/usr.bin/window/wwframe.c
usr/src/usr.bin/window/wwgets.c
usr/src/usr.bin/window/wwinit.c
usr/src/usr.bin/window/wwiomux.c
usr/src/usr.bin/window/wwlabel.c
usr/src/usr.bin/window/wwmisc.c
usr/src/usr.bin/window/wwopen.c
usr/src/usr.bin/window/wwprintf.c
usr/src/usr.bin/window/wwputc.c
usr/src/usr.bin/window/wwputs.c
usr/src/usr.bin/window/wwspawn.c
usr/src/usr.bin/window/wwsuspend.c
usr/src/usr.bin/window/wwtty.c
usr/src/usr.bin/window/wwwrite.c

index fca374e..931a442 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)cmd.c       1.1 83/07/18";
+static char *sccsid = "@(#)cmd.c       1.2 83/07/19";
 #endif
 
 #include "defs.h"
 #endif
 
 #include "defs.h"
@@ -50,6 +50,9 @@ top:
                case 'w':
                        dowindow();
                        break;
                case 'w':
                        dowindow();
                        break;
+               case 'Q':
+                       doquery();
+                       break;
                case 'r':
                        selwin->ww_refresh = 0;
                        break;
                case 'r':
                        selwin->ww_refresh = 0;
                        break;
@@ -81,16 +84,14 @@ top:
                        goto out;
                default:
                        Ding();
                        goto out;
                default:
                        Ding();
-                       wwputs("Type ? for help.  ", cmdwin);
+                       wwprintf(cmdwin, "(%x) Type ? for help.  ", c);
                        break;
                }
        }
        wwputs("Command: ", cmdwin);
        wwsetcursor(WCurRow(cmdwin->ww_win), WCurCol(cmdwin->ww_win));
                        break;
                }
        }
        wwputs("Command: ", cmdwin);
        wwsetcursor(WCurRow(cmdwin->ww_win), WCurCol(cmdwin->ww_win));
-       while (bpeekc() < 0) {
-               wwflush();
+       while (bpeekc() < 0)
                bread();
                bread();
-       }
        goto top;
 out:
        if (!quit)
        goto top;
 out:
        if (!quit)
@@ -104,10 +105,8 @@ getwin()
        register int c;
        struct ww *w;
 
        register int c;
        struct ww *w;
 
-       while ((c = bgetc()) < 0) {
-               wwflush();
+       while ((c = bgetc()) < 0)
                bread();
                bread();
-       }
        if (c < '1' || c > '9') {
                Ding();
                return 0;
        if (c < '1' || c > '9') {
                Ding();
                return 0;
index 4417601..47ad0ad 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)cmd1.c      1.1 83/07/18";
+static char *sccsid = "@(#)cmd1.c      1.2 83/07/19";
 #endif
 
 #include "defs.h"
 #endif
 
 #include "defs.h"
@@ -30,14 +30,13 @@ dowindow()
        row = 1;
        for (;;) {
                wwsetcursor(row, col);
        row = 1;
        for (;;) {
                wwsetcursor(row, col);
-               while (bpeekc() < 0) {
-                       wwflush();
+               while (bpeekc() < 0)
                        bread();
                        bread();
-               }
                switch (getpos(&row, &col, 0, 0)) {
                case -1:
                        WBoxActive = 0;
                switch (getpos(&row, &col, 0, 0)) {
                case -1:
                        WBoxActive = 0;
-                       goto out;
+                       wwputs("\r\nCancelled.  ", cmdwin);
+                       return;
                case 1:
                        break;
                case 0:
                case 1:
                        break;
                case 0:
@@ -45,21 +44,20 @@ dowindow()
                }
                break;
        }
                }
                break;
        }
-       wwprintf(cmdwin, "%d %d.  Upper left corner: ", col, row);
+       wwputs("\r\nLower right corner: ", cmdwin);
        xcol = col + 1;
        xrow = row + 1;
        for (;;) {
                Wbox(col, row, xcol - col + 1, xrow - row + 1);
                wwsetcursor(xrow, xcol);
                wwflush();
        xcol = col + 1;
        xrow = row + 1;
        for (;;) {
                Wbox(col, row, xcol - col + 1, xrow - row + 1);
                wwsetcursor(xrow, xcol);
                wwflush();
-               while (bpeekc() < 0) {
-                       wwflush();
+               while (bpeekc() < 0)
                        bread();
                        bread();
-               }
                switch (getpos(&xrow, &xcol, row + 1, col + 1)) {
                case -1:
                        WBoxActive = 0;
                switch (getpos(&xrow, &xcol, row + 1, col + 1)) {
                case -1:
                        WBoxActive = 0;
-                       goto out;
+                       wwputs("\r\nCancelled.  ", cmdwin);
+                       return;
                case 1:
                        break;
                case 0:
                case 1:
                        break;
                case 0:
@@ -68,9 +66,9 @@ dowindow()
                break;
        }
        WBoxActive = 0;
                break;
        }
        WBoxActive = 0;
-       wwprintf(cmdwin, "%d %d.  ", xcol, xrow);
+       wwputs("\r\n", cmdwin);
        if ((w = wwopen(WW_PTY, id, xrow-row+1, xcol-col+1, row, col)) == 0) {
        if ((w = wwopen(WW_PTY, id, xrow-row+1, xcol-col+1, row, col)) == 0) {
-               wwprintf(cmdwin, "Can't open window.  ");
+               wwputs("Can't open window.  ", cmdwin);
                return;
        }
        wwframe(w);
                return;
        }
        wwframe(w);
@@ -94,8 +92,6 @@ dowindow()
                setselwin(w);
        else
                wwsetcurrent(cmdwin);
                setselwin(w);
        else
                wwsetcurrent(cmdwin);
-out:
-       wwputs("\r\n", cmdwin);
 }
 
 getpos(row, col, minrow, mincol)
 }
 
 getpos(row, col, minrow, mincol)
@@ -148,6 +144,7 @@ register int *row, *col, minrow, mincol;
                case '\r':
                        return 1;
                default:
                case '\r':
                        return 1;
                default:
+                       wwputs("\r\nType [hjklHJKL] to move, return to enter position, escape to cancel.", cmdwin);
                        Ding();
                }
        }
                        Ding();
                }
        }
index 2dff99d..088b5a5 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)cmd2.c      1.1 83/07/18";
+static char *sccsid = "@(#)cmd2.c      1.2 83/07/19";
 #endif
 
 #include "defs.h"
 #endif
 
 #include "defs.h"
@@ -12,14 +12,16 @@ dohelp()
 {
        register struct ww *w;
 
 {
        register struct ww *w;
 
-       if ((w = openwin(20, "Help")) == 0)
+       if ((w = openwin(22, "Help")) == 0)
                return;
        wwprintf(w, "The escape character is ^P, which gets you into command mode.\r\n");
        wwprintf(w, "The commands are:\r\n");
                return;
        wwprintf(w, "The escape character is ^P, which gets you into command mode.\r\n");
        wwprintf(w, "The commands are:\r\n");
-       wwprintf(w, "%%[1-9]  select window [1-9]\r\n");
        wwprintf(w, "[1-9]   select window [1-9] and exit command mode\r\n");
        wwprintf(w, "[1-9]   select window [1-9] and exit command mode\r\n");
+       wwprintf(w, "%%[1-9]  select window [1-9]\r\n");
        wwprintf(w, "c[1-9]  close window [1-9]\r\n");
        wwprintf(w, "C       close all empty windows\r\n");
        wwprintf(w, "c[1-9]  close window [1-9]\r\n");
        wwprintf(w, "C       close all empty windows\r\n");
+       wwprintf(w, "Z       close all windows\r\n");
+       wwprintf(w, "Q       show all windows in sequence\r\n");
        wwprintf(w, "R       force refresh after every newline in current window\r\n");
        wwprintf(w, "r       don't refresh every line\r\n");
        wwprintf(w, "w       open a new window\r\n");
        wwprintf(w, "R       force refresh after every newline in current window\r\n");
        wwprintf(w, "r       don't refresh every line\r\n");
        wwprintf(w, "w       open a new window\r\n");
@@ -30,6 +32,7 @@ dohelp()
        wwprintf(w, "^L      redraw screen\r\n");
        wwprintf(w, "^Z      suspend\r\n");
        wwprintf(w, ".       quit\r\n");
        wwprintf(w, "^L      redraw screen\r\n");
        wwprintf(w, "^Z      suspend\r\n");
        wwprintf(w, ".       quit\r\n");
+       waitnl(w);
        closewin(w);
 }
 
        closewin(w);
 }
 
@@ -39,7 +42,7 @@ dotime(flag)
        struct rusage rusage;
        struct timeval timeval;
 
        struct rusage rusage;
        struct timeval timeval;
 
-       if ((w = openwin(9, "Time")) == 0)
+       if ((w = openwin(8, "Time")) == 0)
                return;
 
        gettimeofday(&timeval, &timezone);
                return;
 
        gettimeofday(&timeval, &timezone);
@@ -64,6 +67,7 @@ dotime(flag)
                rusage.ru_msgsnd, rusage.ru_msgrcv, rusage.ru_nsignals,
                rusage.ru_nvcsw, rusage.ru_nivcsw);
 
                rusage.ru_msgsnd, rusage.ru_msgrcv, rusage.ru_nsignals,
                rusage.ru_nvcsw, rusage.ru_nivcsw);
 
+       waitnl(w);
        closewin(w);
 }
 
        closewin(w);
 }
 
@@ -112,15 +116,18 @@ char *label;
        return w;
 }
 
        return w;
 }
 
-closewin(w)
+waitnl(w)
 register struct ww *w;
 {
        wwprintf(w, "\r\nType return to continue: ");
        wwsetcursor(WCurRow(w->ww_win), WCurCol(w->ww_win));
 register struct ww *w;
 {
        wwprintf(w, "\r\nType return to continue: ");
        wwsetcursor(WCurRow(w->ww_win), WCurCol(w->ww_win));
-       while (bgetc() < 0) {
-               wwflush();
+       while (bgetc() < 0)
                bread();
                bread();
-       }
+}
+
+closewin(w)
+register struct ww *w;
+{
        wwclose(w);
        wwsetcurrent(cmdwin);
 }
        wwclose(w);
        wwsetcurrent(cmdwin);
 }
index faa87b8..e43cb7b 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)cmd3.c      1.1 83/07/18";
+static char *sccsid = "@(#)cmd3.c      1.2 83/07/19";
 #endif
 
 #include "defs.h"
 #endif
 
 #include "defs.h"
@@ -29,7 +29,12 @@ doclose(c)
                                w = (w1 = w)->ww_next;
                                if (w1 == selwin)
                                        setselwin(0);
                                w = (w1 = w)->ww_next;
                                if (w1 == selwin)
                                        setselwin(0);
-                               wwclose(w1);
+                               if (w->ww_state == WW_HASPROC && w->ww_pid == 0)
+                               {
+                                       wwprintf(cmdwin, "%d: pid == 0.  ",
+                                               w->ww_ident);
+                               } else
+                                       wwclose(w1);
                        } else
                                w = w->ww_next;
                }
                        } else
                                w = w->ww_next;
                }
index 8c0fc2d..4bde8f9 100644 (file)
@@ -1,4 +1,4 @@
-/*     @(#)defs.h      1.1 83/07/18            */
+/*     @(#)defs.h      1.2 83/07/19            */
 
 #include "ww.h"
 #include <signal.h>
 
 #include "ww.h"
 #include <signal.h>
index ba40fab..fac601c 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)main.c      1.3 83/07/18";
+static char *sccsid = "@(#)main.c      1.4 83/07/19";
 #endif
 
 #include "defs.h"
 #endif
 
 #include "defs.h"
@@ -32,32 +32,44 @@ main()
                        docmd();
                        continue;
                }
                        docmd();
                        continue;
                }
+               /*
+                * Loop until we get some keyboard input.
+                */
                while (ibufc == 0) {
                        wwsetcursor(WCurRow(curwin->ww_win),
                                WCurCol(curwin->ww_win));
                        wwflush();
                while (ibufc == 0) {
                        wwsetcursor(WCurRow(curwin->ww_win),
                                WCurCol(curwin->ww_win));
                        wwflush();
-                       imask = 1<<0;
-                       wwforce(&imask);
-                       if ((imask & 1<<0) == 0)
+                       imask = 1 << 0;
+                       while (wwforce(&imask) < 0)
+                               ;
+                       if ((imask & 1 << 0) == 0)
                                continue;
                                continue;
-                       if (ibufc == 0)
-                               ibufp = ibuf;
-                       p = ibufp + ibufc;
-                       n = read(0, p, ibuf + sizeof ibuf - p);
-                       if (n > 0)
-                               ibufc = n;
-               }
-               for (p = ibufp, n = ibufc; n-- > 0 && *p != ESCAPE; p++)
-                       ;
-               if ((n = p - ibufp) > 0) {
-                       write(curwin->ww_pty, ibufp, n);
-                       ibufp = p;
-                       ibufc -= n;
+                       /* NOTE: ibufc == 0 */
+                       ibufp = ibuf;
+                       if ((ibufc = read(0, ibuf, sizeof ibuf)) < 0)
+                               ibufc = 0;
                }
                }
-               if (*p == ESCAPE) {
-                       ibufp++;
-                       ibufc--;
-                       wwsetcurrent(cmdwin);
+               /*
+                * Weird loop.  Copy the buffer to the pty stopping
+                * on the escape character in a hopefully efficient
+                * way.
+                * Probably a good thing to make ibufc == 1 a special
+                * case.
+                */
+               for (p = ibufp, n = ibufc;;) {
+                       if (--n < 0) {
+                               write(curwin->ww_pty, ibufp, ibufc);
+                               ibufp = ibuf;
+                               ibufc = 0;
+                               break;
+                       } else if (*p++ == ESCAPE) {
+                               if ((n = p - ibufp) > 1)
+                                       write(curwin->ww_pty, ibufp, n - 1);
+                               ibufp = p;
+                               ibufc -= n;
+                               wwsetcurrent(cmdwin);
+                               break;
+                       }
                }
        }
 bad:
                }
        }
 bad:
index d6f39fe..b91227a 100644 (file)
@@ -1,4 +1,4 @@
-/*     @(#)ww.h        1.3 83/07/18            */
+/*     @(#)ww.h        1.4 83/07/19            */
 
 #include <stdio.h>
 #include <sgtty.h>
 
 #include <stdio.h>
 #include <sgtty.h>
index 8695eda..f4f2cbb 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)wwchild.c   1.3 83/07/18";
+static char *sccsid = "@(#)wwchild.c   1.4 83/07/19";
 #endif
 
 #include "ww.h"
 #endif
 
 #include "ww.h"
index a0d27c4..c7cf5b3 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)wwclose.c   1.1 83/07/18";
+static char *sccsid = "@(#)wwclose.c   1.2 83/07/19";
 #endif
 
 #include "ww.h"
 #endif
 
 #include "ww.h"
index c883064..d997283 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)wwend.c     1.3 83/07/18";
+static char *sccsid = "@(#)wwend.c     1.4 83/07/19";
 #endif
 
 #include "ww.h"
 #endif
 
 #include "ww.h"
index 0b87793..6bbfece 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)wwframe.c   1.1 83/07/18";
+static char *sccsid = "@(#)wwframe.c   1.2 83/07/19";
 #endif
 
 #include "ww.h"
 #endif
 
 #include "ww.h"
index c2b8c22..260e07e 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)wwgets.c    1.1 83/07/18";
+static char *sccsid = "@(#)wwgets.c    1.2 83/07/19";
 #endif
 
 #include "defs.h"
 #endif
 
 #include "defs.h"
@@ -9,15 +9,24 @@ char *ibufp = ibuf;
 bread()
 {
        register n;
 bread()
 {
        register n;
+       register char *p;
        int imask;
 
        int imask;
 
-       imask = 1 << 0;
-       wwforce(&imask);
-       if ((imask & 1<<0) == 0)
-               return;
-       if (ibufc == 0)
-               ibufp = ibuf;
-       n = read(0, ibufp + ibufc, ibuf + sizeof ibuf - ibufp - ibufc);
-       if (n > 0)
-               ibufc += n;
+       while (ibufc == 0) {
+               wwflush();
+               imask = 1 << 0;
+               while (wwforce(&imask) < 0)
+                       ;
+               if ((imask & 1 << 0) == 0)
+                       continue;
+               if (ibufc == 0) {
+                       p = ibufp = ibuf;
+                       n = sizeof ibuf;
+               } else {
+                       p = ibufp + ibufc;
+                       n = (ibuf + sizeof ibuf) - p;
+               }
+               if ((n = read(0, p, n)) > 0)
+                       ibufc += n;
+       }
 }
 }
index 0624298..ad3db3d 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)wwinit.c    1.3 83/07/18";
+static char *sccsid = "@(#)wwinit.c    1.4 83/07/19";
 #endif
 
 #include "ww.h"
 #endif
 
 #include "ww.h"
@@ -11,6 +11,7 @@ struct ww_tty wwnewtty = {
        { -1, -1, -1, -1, -1, -1 },
        0, 0, 0
 };
        { -1, -1, -1, -1, -1, -1 },
        0, 0, 0
 };
+int _wwdtablesize;
 
 wwinit()
 {
 
 wwinit()
 {
@@ -19,6 +20,7 @@ wwinit()
        if (done)
                return 0;
        done++;
        if (done)
                return 0;
        done++;
+       _wwdtablesize = getdtablesize();
        if (wwgettty(0, &wwoldtty) < 0)
                return -1;
        wwnewtty.ww_sgttyb.sg_flags = wwoldtty.ww_sgttyb.sg_flags;
        if (wwgettty(0, &wwoldtty) < 0)
                return -1;
        wwnewtty.ww_sgttyb.sg_flags = wwoldtty.ww_sgttyb.sg_flags;
index f9a21ba..e46a879 100644 (file)
@@ -1,9 +1,11 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)wwiomux.c   1.3 83/07/18";
+static char *sccsid = "@(#)wwiomux.c   1.4 83/07/19";
 #endif
 
 #include "ww.h"
 
 #endif
 
 #include "ww.h"
 
+extern int _wwdtablesize;
+
 wwforce(imask)
 register int *imask;
 {
 wwforce(imask)
 register int *imask;
 {
@@ -14,7 +16,7 @@ register int *imask;
        for (w = wwhead; w; w = w->ww_next)
                if (w->ww_pty >= 0)
                        *imask |= 1 << w->ww_pty;
        for (w = wwhead; w; w = w->ww_next)
                if (w->ww_pty >= 0)
                        *imask |= 1 << w->ww_pty;
-       n = select(getdtablesize(), imask,
+       n = select(_wwdtablesize, imask,
                (int *)0, (int *)0, (struct timeval *)0);
        if (n <= 0)
                return -1;
                (int *)0, (int *)0, (struct timeval *)0);
        if (n <= 0)
                return -1;
index fb3c385..8c61245 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)wwlabel.c   1.1 83/07/18";
+static char *sccsid = "@(#)wwlabel.c   1.2 83/07/19";
 #endif
 
 #include "ww.h"
 #endif
 
 #include "ww.h"
index 9db15e0..42f1305 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)wwmisc.c    1.3 83/07/18";
+static char *sccsid = "@(#)wwmisc.c    1.4 83/07/19";
 #endif
 
 #include "ww.h"
 #endif
 
 #include "ww.h"
index 549bb1d..3390440 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)wwopen.c    1.3 83/07/18";
+static char *sccsid = "@(#)wwopen.c    1.4 83/07/19";
 #endif
 
 #include "ww.h"
 #endif
 
 #include "ww.h"
@@ -7,7 +7,7 @@ static  char *sccsid = "@(#)wwopen.c    1.3 83/07/18";
 #include <sys/stat.h>
 
 struct ww *
 #include <sys/stat.h>
 
 struct ww *
-wwopen(flag, id, nrow, ncol, row, col)
+wwopen(mode, id, nrow, ncol, row, col)
 {
        register struct ww *w = 0;
 
 {
        register struct ww *w = 0;
 
@@ -15,7 +15,7 @@ wwopen(flag, id, nrow, ncol, row, col)
        if (w == 0)
                goto bad;
        w->ww_pty = w->ww_tty = -1;
        if (w == 0)
                goto bad;
        w->ww_pty = w->ww_tty = -1;
-       switch (flag) {
+       switch (mode) {
        case WW_PTY:
                if (wwgetpty(w) < 0)
                        goto bad;
        case WW_PTY:
                if (wwgetpty(w) < 0)
                        goto bad;
@@ -32,6 +32,7 @@ wwopen(flag, id, nrow, ncol, row, col)
        if ((w->ww_win = Wopen(id, col, row, ncol, nrow, ncol, nrow)) == 0)
                goto bad;
        Woncursor(w->ww_win, 0);                /* don't show cursor */
        if ((w->ww_win = Wopen(id, col, row, ncol, nrow, ncol, nrow)) == 0)
                goto bad;
        Woncursor(w->ww_win, 0);                /* don't show cursor */
+       w->ww_mode = mode;
        w->ww_ident = id;
        w->ww_icol = w->ww_col = col;
        w->ww_irow = w->ww_row = row;
        w->ww_ident = id;
        w->ww_icol = w->ww_col = col;
        w->ww_irow = w->ww_row = row;
index dd0a130..40f58fe 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)wwprintf.c  1.2 83/07/18";
+static char *sccsid = "@(#)wwprintf.c  1.3 83/07/19";
 #endif
 
 #include "ww.h"
 #endif
 
 #include "ww.h"
@@ -24,7 +24,7 @@ char *fmt;
        return wwwrite(w, buf, _wwbuf._ptr - buf);
 }
 
        return wwwrite(w, buf, _wwbuf._ptr - buf);
 }
 
-#ifdef notdef
+/*
 wwprintf(w, fmt, args)
 struct ww *w;
 char *fmt;
 wwprintf(w, fmt, args)
 struct ww *w;
 char *fmt;
@@ -54,4 +54,4 @@ register struct ww *file;
                adjust--;
        }
 }
                adjust--;
        }
 }
-#endif
+*/
index 61062d7..781f297 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)wwputc.c    1.3 83/07/18";
+static char *sccsid = "@(#)wwputc.c    1.4 83/07/19";
 #endif
 
 #include "ww.h"
 #endif
 
 #include "ww.h"
index 1313b01..718d0a7 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)wwputs.c    1.3 83/07/18";
+static char *sccsid = "@(#)wwputs.c    1.4 83/07/19";
 #endif
 
 #include "ww.h"
 #endif
 
 #include "ww.h"
index 90df36a..cd7c0fd 100644 (file)
@@ -1,9 +1,11 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)wwspawn.c   1.3 83/07/18";
+static char *sccsid = "@(#)wwspawn.c   1.4 83/07/19";
 #endif
 
 #include "ww.h"
 
 #endif
 
 #include "ww.h"
 
+extern int _wwdtablesize;
+
 wwfork(wp)
 register struct ww *wp;
 {
 wwfork(wp)
 register struct ww *wp;
 {
@@ -42,7 +44,7 @@ register struct ww *wp;
        dup2(wp->ww_tty, 0);
        dup2(wp->ww_tty, 1);
        dup2(wp->ww_tty, 2);
        dup2(wp->ww_tty, 0);
        dup2(wp->ww_tty, 1);
        dup2(wp->ww_tty, 2);
-       for (i = getdtablesize() - 1; i > 2; i--)
+       for (i = _wwdtablesize - 1; i > 2; i--)
                close(i);
        /*
        i = open("/dev/tty");
                close(i);
        /*
        i = open("/dev/tty");
index d27f951..9c3cca7 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)wwsuspend.c 1.2 83/07/18";
+static char *sccsid = "@(#)wwsuspend.c 1.3 83/07/19";
 #endif
 
 #include "ww.h"
 #endif
 
 #include "ww.h"
index 8364bc5..5ede134 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)wwtty.c     1.2 83/07/18";
+static char *sccsid = "@(#)wwtty.c     1.3 83/07/19";
 #endif
 
 #include "ww.h"
 #endif
 
 #include "ww.h"
index ce19499..6e656f7 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)wwwrite.c   1.2 83/07/18";
+static char *sccsid = "@(#)wwwrite.c   1.3 83/07/19";
 #endif
 
 #include "ww.h"
 #endif
 
 #include "ww.h"