GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
yes.c File Reference

GIS Library - Yes/No functions. More...

#include <stdio.h>
#include <grass/gis.h>
Include dependency graph for yes.c:

Go to the source code of this file.

Functions

int G_yes (const char *question, int dflt)
 Ask a yes/no question. More...
 

Detailed Description

GIS Library - Yes/No functions.

(C) 2001-2008 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
GRASS GIS Development Team
Date
1999-2008

Definition in file yes.c.

Function Documentation

int G_yes ( const char *  question,
int  dflt 
)

Ask a yes/no question.

This routine prints a question to the user, and expects the user to respond either yes or no. (Invalid responses are rejected and the process is repeated until the user answers yes or no.)
The default indicates what the RETURN key alone should mean. A default of 1 indicates that RETURN means yes, 0 indicates that RETURN means no. The question will be appended with ''(y/n) '', and, if default is not -1, with ''[y] '' or ''[n] '', depending on the default.

Parameters
[in]question
[in]dflt
Returns
0 for No
1 for Yes

Definition at line 39 of file yes.c.

References G_gets(), and G_strip().

Referenced by E_edit_cellhd(), GPJ_ask_datum_params(), main(), make_location(), and mapset_question().