NAME
getbool - ask user to type boolean value
SYNOPSIS
#include <stdio.h>
#include <c.h>
int getbool (prompt,defalt);
char *prompt;
int defalt;
DESCRIPTION
Getbool is used to ask the user to type "yes" or
"no". Prompt is a
string containing a message which will be printed; the user
types
"yes", "y", etc., or "no",
"n", etc. in response to the question.
Getbool returns 1 if "yes" (etc.) is typed, 0 for
"no". If the
user types just a carriage return, then defalt is
returned.
SEE ALSO
getint(3), etc.
boolarg(3)
DIAGNOSTICS
The user is informed if his response is not valid (e.g.
"maybe"),
and the prompt-and-response cycle is repeated.
BUGS
There is no provision for an "escape" answer (e.g.
"I don’t
care").