Add define for Kirk Smith's USR Courier driver. Change default baud
[unix-history] / usr / src / usr.bin / window / lcmd1.c
index bb8bd46..0d05789 100644 (file)
@@ -1,7 +1,13 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)lcmd1.c    3.28 %G%";
+static char sccsid[] = "@(#)lcmd1.c    3.30 %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 "string.h"
 #include "value.h"
 #include "defs.h"
 #include "string.h"
 #include "value.h"
@@ -103,7 +109,7 @@ register struct value *v, *a;
        v->v_num = selwin ? selwin->ww_id + 1 : -1;
        if (a->v_type == V_ERR)
                return;
        v->v_num = selwin ? selwin->ww_id + 1 : -1;
        if (a->v_type == V_ERR)
                return;
-       if ((w = vtowin(a)) == 0)
+       if ((w = vtowin(a, (struct ww *)0)) == 0)
                return;
        setselwin(w);
 }
                return;
        setselwin(w);
 }
@@ -118,7 +124,7 @@ register struct value *v, *a;
 {
        v->v_type = V_NUM;
        v->v_num = debug;
 {
        v->v_type = V_NUM;
        v->v_num = debug;
-       debug = vtobool(a, 1, debug);
+       debug = vtobool(a, debug, debug);
 }
 
 struct lcmd_arg arg_escape[] = {
 }
 
 struct lcmd_arg arg_escape[] = {
@@ -155,7 +161,7 @@ register struct value *a;
 {
        struct ww *w;
 
 {
        struct ww *w;
 
-       if ((w = vtowin(a)) == 0)
+       if ((w = vtowin(a, selwin)) == 0)
                return;
        if ((++a)->v_type != V_ERR && setlabel(w, a->v_str) < 0)
                error("Out of memory.");
                return;
        if ((++a)->v_type != V_ERR && setlabel(w, a->v_str) < 0)
                error("Out of memory.");
@@ -174,11 +180,11 @@ register struct value *v, *a;
        struct ww *w;
        char flag;
 
        struct ww *w;
        char flag;
 
-       if ((w = vtowin(a)) == 0)
+       if ((w = vtowin(a, selwin)) == 0)
                return;
        v->v_type = V_NUM;
        v->v_num = isfg(w);
                return;
        v->v_type = V_NUM;
        v->v_num = isfg(w);
-       flag = vtobool(++a, 1, v->v_num);
+       flag = vtobool(++a, v->v_num, v->v_num);
        if (flag == v->v_num)
                return;
        deletewin(w);
        if (flag == v->v_num)
                return;
        deletewin(w);
@@ -196,7 +202,7 @@ register struct value *v, *a;
 {
        v->v_type = V_NUM;
        v->v_num = terse;
 {
        v->v_type = V_NUM;
        v->v_num = terse;
-       setterse(vtobool(a, 1, terse));
+       setterse(vtobool(a, terse, terse));
 }
 
 struct lcmd_arg arg_source[] = {
 }
 
 struct lcmd_arg arg_source[] = {
@@ -229,7 +235,7 @@ register struct value *a;
        char buf[20];
        struct ww *w;
 
        char buf[20];
        struct ww *w;
 
-       if ((w = vtowin(a++)) == 0)
+       if ((w = vtowin(a++, selwin)) == 0)
                return;
        while (a->v_type != V_ERR) {
                if (a->v_type == V_NUM) {
                return;
        while (a->v_type != V_ERR) {
                if (a->v_type == V_NUM) {
@@ -254,11 +260,11 @@ register struct value *a;
 {
        struct ww *w;
 
 {
        struct ww *w;
 
-       if (a->v_type == V_STR && str_match(a->v_str, "all", 1))
+       if (a->v_type == V_STR && str_match(a->v_str, "all", 3))
                c_close((struct ww *)0);
        else
                for (; a->v_type != V_ERR; a++)
                c_close((struct ww *)0);
        else
                for (; a->v_type != V_ERR; a++)
-                       if ((w = vtowin(a)) != 0)
+                       if ((w = vtowin(a, (struct ww *)0)) != 0)
                                c_close(w);
 }
 
                                c_close(w);
 }
 
@@ -303,13 +309,14 @@ register struct value *v, *a;
 }
 
 struct ww *
 }
 
 struct ww *
-vtowin(v)
+vtowin(v, w)
 register struct value *v;
 register struct value *v;
+struct ww *w;
 {
 {
-       struct ww *w;
-
        switch (v->v_type) {
        case V_ERR:
        switch (v->v_type) {
        case V_ERR:
+               if (w != 0)
+                       return w;
                error("No window specified.");
                return 0;
        case V_STR:
                error("No window specified.");
                return 0;
        case V_STR: