Reference

tab(3)

simple table lookup routines

NAME

tab - simple table lookup routines

SYNOPSIS

$1$2#include <ast.h>#include <ast.h>#include <ast.h>#include <ast.h>#include <ast.h>#include <ast.h>#include <ast.h>#include <ast.h>

$1$2int tabindex(const void* tab, int size, const char* name);int tabindex(const void* tab, int size, const char* name);int tabindex(const void* tab, int size, const char* name);int tabindex(const void* tab, int size, const char* name);int tabindex(const void* tab, int size, const char* name);int tabindex(const void* tab, int size, const char* name);int tabindex(const void* tab, int size, const char* name);int tabindex(const void* tab, int size, const char* name); $1$2void* tablook(const void* tab, int size, const char* name);void* tablook(const void* tab, int size, const char* name);void* tablook(const void* tab, int size, const char* name);void* tablook(const void* tab, int size, const char* name);void* tablook(const void* tab, int size, const char* name);void* tablook(const void* tab, int size, const char* name);void* tablook(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 $1$2sizesizesizesizesizesizesizesize bytes and the beginning of the element points to a name that is matched by the lookup routines.

$1$2tabindextabindextabindextabindextabindextabindextabindextabindex returns the index of the table element in $1$2tabtabtabtabtabtabtabtab that matches $1$2namenamenamenamenamenamenamename If there is no match then $1$2-1-1-1-1-1-1-1-1 is returned.

$1$2tablooktablooktablooktablooktablooktablooktablooktablook returns a pointer to the table element in $1$2tabtabtabtabtabtabtabtab that matches $1$2namenamenamenamenamenamenamename If there is no match then $1$200000000 is returned.

SEE ALSO

hash(3)