da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.fp 5 CW
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.de Af
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.ds ;G \\*(;G\\f\\$1\\$3\\f\\$2
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.if !\\$4 .Af \\$2 \\$1 "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin..
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.de aF
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.ie \\$3 .ft \\$1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.el \{\
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.ds ;G \&
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.nr ;G \\n(.f
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin\\*(;G
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.ft \\n(;G \}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin..
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.de L
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin..
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.de LR
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin..
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.de RL
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin..
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.de EX \" start example
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.ta 1i 2i 3i 4i 5i 6i
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.PP
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.RS
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.PD 0
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.ft 5
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.nf
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin..
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.de EE \" end example
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.fi
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.ft
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.PD
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.RE
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.PP
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin..
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.TH TAB 3
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.SH NAME
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chintab \- simple table lookup routines
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.SH SYNOPSIS
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L "#include <ast.h>"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.sp
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L "int tabindex(const void* tab, int size, const char* name);"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L "void* tablook(const void* tab, int size, const char* name);"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.SH DESCRIPTION
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinThese routines do linear lookups in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.I small
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chintables (on the order of 32 elements).
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinEach table element has a size of
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L size
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinbytes and the beginning of the element points to a name that is
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinmatched by the lookup routines.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.PP
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L tabindex
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinreturns the index of the table element in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L tab
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinthat matches
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.LR name .
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinIf there is no match then
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L \-1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinis returned.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.PP
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L tablook
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinreturns a pointer to the table element in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L tab
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinthat matches
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.LR name .
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinIf there is no match then
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L 0
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinis returned.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.SH "SEE ALSO"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinhash(3)