TAB(3ast) TAB(3ast)

# [NAME](#NAME)

tab - simple table lookup routines

# [SYNOPSIS](#SYNOPSIS)

#include &lt;ast.h&gt;

int tabindex(const void* tab, int size, const char* name); void* tablook(const void* tab, int size, const char* name);

# [DESCRIPTION](#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.

# [SEE ALSO](#SEE_ALSO)

[hash(3)](/man/os/ksh/hash.3)

---

Document: tab(3ast) from ksh 1.0.10-r37 (Chainguard OS)
Source: https://github.com/ksh93/ksh
