|
|
1.1 root 1: /*
2: * Copyright (c) 1983 Regents of the University of California.
3: * All rights reserved.
4: *
5: * Redistribution and use in source and binary forms are permitted
6: * provided that the above copyright notice and this paragraph are
7: * duplicated in all such forms and that any documentation,
8: * advertising materials, and other materials related to such
9: * distribution and use acknowledge that the software was developed
10: * by the University of California, Berkeley. The name of the
11: * University may not be used to endorse or promote products derived
12: * from this software without specific prior written permission.
13: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15: * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16: */
17:
18: #ifndef lint
19: static char sccsid[] = "@(#)cmd7.c 3.5 (Berkeley) 6/29/88";
20: #endif /* not lint */
21:
22: #include "defs.h"
23:
24: /*
25: * Window size.
26: */
27:
28: c_size(w)
29: register struct ww *w;
30: {
31: int col, row;
32:
33: if (!terse)
34: wwputs("New window size (lower right corner): ", cmdwin);
35: col = MIN(w->ww_w.r, wwncol) - 1;
36: row = MIN(w->ww_w.b, wwnrow) - 1;
37: wwadd(boxwin, framewin->ww_back);
38: for (;;) {
39: wwbox(boxwin, w->ww_w.t - 1, w->ww_w.l - 1,
40: row - w->ww_w.t + 3, col - w->ww_w.l + 3);
41: wwsetcursor(row, col);
42: while (wwpeekc() < 0)
43: wwiomux();
44: switch (getpos(&row, &col, w->ww_w.t, w->ww_w.l,
45: wwnrow - 1, wwncol - 1)) {
46: case 3:
47: wwunbox(boxwin);
48: wwdelete(boxwin);
49: return;
50: case 2:
51: wwunbox(boxwin);
52: break;
53: case 1:
54: wwunbox(boxwin);
55: case 0:
56: continue;
57: }
58: break;
59: }
60: wwdelete(boxwin);
61: if (!terse)
62: wwputc('\n', cmdwin);
63: wwcurtowin(cmdwin);
64: sizewin(w, row - w->ww_w.t + 1, col - w->ww_w.l + 1);
65: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.