STABLK

Section: C Library Functions (3)
Updated: 5/22/80
Index Return to Main Contents
 

NAME

stablk - string table lookup  

SYNOPSIS

int stablk (string,table,quiet);
char *string,**table;
int quiet;  

DESCRIPTION

Stablk searches in the string table table, looking for a string whose initial characters match string. If exactly one such string is found, then the index of that string is returned. If no such strings are found, or if more than one string matches, then an error indication is returned.

If no strings match string, then -1 will be returned. Before returning, if quiet is FALSE, then the user will be asked if he wants a list of the strings in the table; if he says "yes", then a list is printed.

If several strings match but one is an exact match while the others are prefix matches, the index of the exact match is returned. Otherwise, when several strings match, -2 will be returned. Before returning, if quiet is FALSE, 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

stlmatch(3)  

DIAGNOSTICS

If nothing matches, -1 is returned; if more than one string matches, then -2 is returned.  

BUGS

A maximum of 500 strings are allowed in the table.


 

Index

NAME
SYNOPSIS
DESCRIPTION
SEE ALSO
DIAGNOSTICS
BUGS

This document was created by man2html, using the manual pages.
Time: 11:12:47 GMT, November 04, 2022