int stabarg (ptr,brk,prompt,table,defalt);
char **ptr,*brk,*prompt,**table,*defalt;
int searcharg (ptr,brk,prompt,table,defalt);
char **ptr,*brk,*prompt,**table,*defalt;
Stabarg will attempt to parse an argument in the same way. If there is an argument, and it matches exactly one string in the string array table, then the index of the matching string is returned by stabarg. If there is no argument, or if it matches nothing in the table or many entries of the table, then an error message is printed and the remaining arguments (prompt, table, and defalt) are passed into getstab(3). The value returned by getstab is then returned by stabarg.
Searcharg is just like stabarg, but performs a heuristic test for the best string match within the table, and allows the user to approve or disapprove this choice if it is not a perfect match. If the user does not approve the choice, several other good matches are listed.
Strarg, stabarg, and searcharg are especially useful for parsing strings from argument lists in programs using the command interpreter, ci(3).