yes.c File Reference

#include <grass/gis.h>
#include <stdio.h>

Include dependency graph for yes.c:

Go to the source code of this file.

Functions

int G_yes (char *question, int dflt)
 ask a yes/no question


Function Documentation

int G_yes ( 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, and -1 indicates that RETURN alone is not a valid response. The question will be appended with ''(y/n) '', and, if default is not -1, with ''[y] '' or ''[n] '', depending on the default. G_yes (~) returns 1 if the user said yes, and 0 if the user said no.

Parameters:
question 
default 
Returns:
int

Definition at line 35 of file yes.c.

References G_gets(), and G_strip().


Generated on Sun Apr 6 17:32:27 2008 for GRASS by  doxygen 1.5.5