table of contents
TAB(3) | Library Functions Manual | TAB(3) |
NAME¶
tab - simple table lookup routines
SYNOPSIS¶
#include <ast.h>
int tabindex(const void* tab, int size, const char* name); void* tablook(const void* tab, int size, const char* name);
DESCRIPTION¶
These routines do linear lookups in small tables (on the order of 32 elements). Each table element has a size of size bytes and the beginning of the element points to a name that is matched by the lookup routines.
tabindex returns the index of the table element in tab that matches name. If there is no match then -1 is returned.
tablook returns a pointer to the table element in tab that matches name. If there is no match then 0 is returned.