char *getstr (prompt,defalt,answer);
char *prompt,*defalt,*answer;
int getstab (prompt,table,defalt);
int getsearch (prompt,table,defalt);
char *prompt,**table,*defalt;
Getstab will print prompt as a message to the user, and ask for an input string. The string typed will be sought within the string table table, and, if found, the index of this string will be returned. If the user types just a carriage return, then the string defalt will be assumed. If nothing in the table matches the input string, or if more than one string matches, then an error message is printed and the prompt-and-response cycle is repeated. The string table may be declared this way:
char *table[] = { "first string", "second string", ... "n-th string", 0};
Getsearch is just like getstab, but performs a heuristic test for the quality of each string match, and returns the index of the best match. If the match is not exact, the user is asked to approve or disapprove the choice of the matching string; if he disapproves, several other closely matching choices are listed.