break out special local mail processing (e.g., mapping to the
[unix-history] / usr / src / usr.bin / window / win.c
index 5de1f85..18cbaaa 100644 (file)
@@ -1,22 +1,15 @@
 /*
 /*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ *     The Regents of the University of California.  All rights reserved.
  *
  *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley.  The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ * This code is derived from software contributed to Berkeley by
+ * Edward Wang at The University of California, Berkeley.
+ *
+ * %sccs.include.redist.c%
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)win.c      3.20 (Berkeley) %G%";
+static char sccsid[] = "@(#)win.c      8.1 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "defs.h"
 #endif /* not lint */
 
 #include "defs.h"
@@ -76,8 +69,6 @@ char *shf, **sh;
        setselwin((struct ww *)0);
        addwin(w, 0);
        setselwin(w);
        setselwin((struct ww *)0);
        addwin(w, 0);
        setselwin(w);
-       wwupdate();
-       wwflush();
        if (wwspawn(w, shf, sh) < 0) {
                error("Can't execute %s: %s.", shf, wwerror());
                closewin(w);
        if (wwspawn(w, shf, sh) < 0) {
                error("Can't execute %s: %s.", shf, wwerror());
                closewin(w);
@@ -167,7 +158,6 @@ char *label;
        (void) setlabel(w, label);
        addwin(w, 1);
        reframe();
        (void) setlabel(w, label);
        addwin(w, 1);
        reframe();
-       wwupdate();
        return w;
 }
 
        return w;
 }
 
@@ -285,17 +275,19 @@ register struct ww *w;
 stopwin(w)
        register struct ww *w;
 {
 stopwin(w)
        register struct ww *w;
 {
-       w->ww_stopped = 1;
-       if (w->ww_pty >= 0 && w->ww_ispty)
-               (void) ioctl(w->ww_pty, TIOCSTOP, (char *)0);
+       if (w->ww_pty >= 0 && w->ww_ispty && wwstoptty(w->ww_pty) < 0)
+               error("Can't stop output: %s.", wwerror());
+       else
+               w->ww_stopped = 1;
 }
 
 startwin(w)
        register struct ww *w;
 {
 }
 
 startwin(w)
        register struct ww *w;
 {
-       w->ww_stopped = 0;
-       if (w->ww_pty >= 0 && w->ww_ispty)
-               (void) ioctl(w->ww_pty, TIOCSTART, (char *)0);
+       if (w->ww_pty >= 0 && w->ww_ispty && wwstarttty(w->ww_pty) < 0)
+               error("Can't start output: %s.", wwerror());
+       else
+               w->ww_stopped = 0;
 }
 
 sizewin(w, nrow, ncol)
 }
 
 sizewin(w, nrow, ncol)