Add define for Kirk Smith's USR Courier driver. Change default baud
[unix-history] / usr / src / usr.bin / window / cmd3.c
CommitLineData
57f965d5 1#ifndef lint
60de5df9 2static char sccsid[] = "@(#)cmd3.c 3.13 %G%";
57f965d5
EW
3#endif
4
60de5df9
EW
5/*
6 * Copyright (c) 1983 Regents of the University of California,
7 * All rights reserved. Redistribution permitted subject to
8 * the terms of the Berkeley Software License Agreement.
9 */
10
57f965d5 11#include "defs.h"
b2618f9d 12#include "string.h"
57f965d5 13
85af59e4 14c_close(w)
c417b691 15register struct ww *w;
57f965d5 16{
c417b691 17 char didit = 0;
85af59e4 18 register i;
57f965d5 19
c0893e4e 20 if (w != 0) {
85af59e4 21 closewin(w);
c417b691 22 didit++;
c0893e4e 23 } else {
85af59e4
EW
24 for (i = 0; i < NWINDOW; i++) {
25 if ((w = window[i]) == 0)
c0893e4e 26 continue;
a4c3bba5 27 closewin(w);
85af59e4 28 didit++;
57f965d5 29 }
57f965d5
EW
30 }
31 if (selwin == 0) {
7c0483b9
EW
32 if (lastselwin != 0)
33 setselwin(lastselwin);
34 else {
35 for (i = 0; i < NWINDOW && window[i] == 0; i++)
36 ;
37 if (i < NWINDOW)
38 setselwin(window[i]);
39 }
57f965d5 40 }
c417b691
EW
41 if (didit)
42 reframe();
57f965d5 43}
0de7ca29 44
0de7ca29
EW
45setescape(esc)
46register char *esc;
47{
48 if (*esc == '^') {
49 if (esc[1] != 0)
50 escapec = esc[1] & 0x1f;
51 else
52 escapec = '^';
53 } else
54 escapec = *esc;
55}
c0893e4e 56
c0893e4e
EW
57setlabel(w, label)
58register struct ww *w;
59char *label;
60{
61 if (w->ww_label != 0)
b2618f9d
EW
62 str_free(w->ww_label);
63 if ((w->ww_label = str_cpy(label)) == 0)
85af59e4 64 return -1;
85af59e4 65 return 0;
c0893e4e 66}