NAME
getchr - ask user to type a character

SYNOPSIS
#include <stdio.h>

int getchr (prompt,legals,defalt);
char *prompt,*legals,defalt;

DESCRIPTION
Getchr will print its prompt and ask the user for a single
character. If that character is in the string of legal response
characters (legals), then its index is returned. If a null string
is typed (just a carriage return), then the default character
(defalt) will be assumed and its index returned. If a character is
typed which is not in the string of legal responses, then an error
message is printed and the prompt-and-response cycle is repeated.

SEE ALSO
getbool(3), getstr(3), getstab(3), etc.
chrarg(3)

BUGS
There is no provision for an escape response (e.g. "I don’t like
any of these choices").