NAME
stabsearch - best-match string table lookup
SYNOPSIS
int stabsearch (string,table,quiet);
char *string,**table;
int quiet;
DESCRIPTION
Stabsearch searches in the string table table, looking for a
string
which best matches string. If exactly one such string is
found,
then the index of that string is returned. If no such
strings are
found, then -1 is returned.
If quiet is false and several
strings match reasonably, the user is
given the option to approve or disapprove of the choice of
matching
strings. If he disapproves, then the few best matches are
listed
and -1 is returned.
If several strings match, then
-2 will be returned. Before
returning, if quiet is 0, then the user will be asked if he
wants a
list of matching strings; if he says "yes", then a
list is printed.
The string table may be declared like this:
char *stable[] = {
"first string",
"second string",
...
"n-th string",
0};
Note that the last entry of the table must be a zero.
SEE ALSO
stablk(3), srchscore(3)
DIAGNOSTICS
If nothing matches at all, or if the user does not approve
the
choice of the best matching string, -1 is returned.