1 /* 2 * Copyright (c) 1980 Regents of the University of California. 3 * All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 */ 7 8 #ifndef lint 9 static char sccsid[] = "@(#)query.c 5.4 (Berkeley) 06/01/90"; 10 #endif /* not lint */ 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 } 35