Commit | Line | Data |
---|---|---|
dcacd52b | 1 | /* |
17914cb4 KB |
2 | * Copyright (c) 1980, 1993 |
3 | * The Regents of the University of California. All rights reserved. | |
4cd7a139 | 4 | * |
abde58c2 | 5 | * %sccs.include.redist.c% |
dcacd52b KM |
6 | */ |
7 | ||
8 | #ifndef lint | |
17914cb4 | 9 | static char sccsid[] = "@(#)query.c 8.1 (Berkeley) %G%"; |
4cd7a139 | 10 | #endif /* not lint */ |
dcacd52b KM |
11 | |
12 | # include "robots.h" | |
13 | ||
14 | /* | |
15 | * query: | |
16 | * Ask a question and get a yes or no answer. Default is "no". | |
17 | */ | |
18 | query(prompt) | |
19 | char *prompt; | |
20 | { | |
21 | register int c, retval; | |
22 | register int y, x; | |
23 | ||
24 | getyx(stdscr, y, x); | |
25 | move(Y_PROMPT, X_PROMPT); | |
26 | addstr(prompt); | |
27 | clrtoeol(); | |
28 | refresh(); | |
29 | retval = ((c = getchar()) == 'y' || c == 'Y'); | |
30 | move(Y_PROMPT, X_PROMPT); | |
31 | clrtoeol(); | |
32 | move(y, x); | |
33 | return retval; | |
34 | } |