Commit | Line | Data |
---|---|---|
ce28727e | 1 | #ifndef lint |
c417b691 | 2 | static char *sccsid = "@(#)cmd4.c 1.3 83/07/22"; |
ce28727e EW |
3 | #endif |
4 | ||
5 | #include "defs.h" | |
6 | ||
7 | struct ww *getwin(); | |
8 | struct ww *openwin(); | |
9 | char *strtime(); | |
10 | ||
11 | doquery() | |
12 | { | |
13 | register i; | |
14 | register struct ww *w = 0; | |
15 | char done_it = 0; | |
16 | ||
17 | for (i = 1; i < 10; i++) { | |
18 | if ((w = wwfind(i)) == 0) | |
19 | continue; | |
20 | done_it++; | |
8c4fb896 | 21 | wwsetcurwin(w); |
c417b691 | 22 | wwsetcursor(w->ww_o.row, w->ww_o.col + 1); |
ce28727e EW |
23 | for (;;) { |
24 | switch (bgetc()) { | |
25 | case '\r': | |
26 | case '\n': | |
27 | break; | |
28 | case CTRL([): | |
29 | setselwin(w); | |
8c4fb896 | 30 | goto out; |
ce28727e EW |
31 | case -1: |
32 | bread(); | |
33 | continue; | |
34 | default: | |
35 | wwputs("\rType return to continue, escape to select.", cmdwin); | |
8c4fb896 | 36 | wwsetcurwin(cmdwin); |
ce28727e EW |
37 | Ding(); |
38 | continue; | |
39 | } | |
40 | break; | |
41 | } | |
42 | } | |
8c4fb896 | 43 | out: |
ce28727e EW |
44 | if (!done_it) |
45 | wwputs("No windows. ", cmdwin); | |
46 | else { | |
8c4fb896 | 47 | wwsetcurwin(cmdwin); |
ce28727e EW |
48 | wwputs("\r\n", cmdwin); |
49 | } | |
50 | } |