ttwrite added
[unix-history] / usr / src / usr.bin / window / win.c
index 43365c3..3c3adab 100644 (file)
@@ -1,7 +1,13 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)win.c       3.8 84/04/08";
+static char sccsid[] = "@(#)win.c      3.14 %G%";
 #endif
 
 #endif
 
+/*
+ * Copyright (c) 1983 Regents of the University of California,
+ * All rights reserved.  Redistribution permitted subject to
+ * the terms of the Berkeley Software License Agreement.
+ */
+
 #include "defs.h"
 #include "char.h"
 
 #include "defs.h"
 #include "char.h"
 
@@ -47,10 +53,7 @@ char *shf, **sh;
        w->ww_id = id;
        window[id] = w;
        w->ww_hasframe = hasframe;
        w->ww_id = id;
        window[id] = w;
        w->ww_hasframe = hasframe;
-       w->ww_altpos.r = 1;
-       w->ww_altpos.c = 0;
-       if (!haspty)
-               w->ww_mapnl = 1;
+       w->ww_alt = w->ww_w;
        if (label != 0 && setlabel(w, label) < 0)
                error("No memory for label.");
        wwcursor(w, 1);
        if (label != 0 && setlabel(w, label) < 0)
                error("No memory for label.");
        wwcursor(w, 1);
@@ -225,6 +228,36 @@ 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, (int)TIOCSTOP, (char *)0);
+}
+
+startwin(w)
+       register struct ww *w;
+{
+       w->ww_stopped = 0;
+       if (w->ww_pty >= 0 && w->ww_ispty)
+               (void) ioctl(w->ww_pty, (int)TIOCSTART, (char *)0);
+}
+
+sizewin(w, nrow, ncol)
+register struct ww *w;
+{
+       struct ww *back = w->ww_back;
+
+       w->ww_alt.nr = w->ww_w.nr;
+       w->ww_alt.nc = w->ww_w.nc;
+       wwdelete(w);
+       if (wwsize(w, nrow, ncol) < 0)
+               error("Can't resize window: %s.", wwerror());
+       wwadd(w, back);
+       reframe();
+}
+
 waitnl(w)
 struct ww *w;
 {
 waitnl(w)
 struct ww *w;
 {