5
* \brief GIS Library - Yes/No functions.
7
* (C) 2001-2008 by the GRASS Development Team
9
* This program is free software under the GNU General Public License
10
* (>=v2). Read the file COPYING that comes with GRASS for details.
12
* \author GRASS GIS Development Team
18
#include <grass/gis.h>
22
* \brief Ask a yes/no question.
24
* This routine prints a <b>question</b> to the user, and expects the user to
25
* respond either yes or no. (Invalid responses are rejected and the process is
26
* repeated until the user answers yes or no.)<br>
27
* The <b>default</b> indicates what the RETURN key alone should mean. A
28
* <b>default</b> of 1 indicates that RETURN means yes, 0 indicates that RETURN
29
* means no. The <b>question</b> will be appended with ''(y/n) '', and,
30
* if <b>default</b> is not -1, with ''[y] '' or ''[n] '', depending on
31
* the <b>default.</b><br>
39
int G_yes(const char *question, int dflt)
46
fprintf(stderr, "%s", question);
49
fprintf(stderr, "(y/n) ");
51
fprintf(stderr, dflt == 0 ? "[n] " : "[y] ");