\section{oggz\_\-table.h File Reference}
\label{oggz__table_8h}\index{oggz\_\-table.h@{oggz\_\-table.h}}
A lookup table.  


\subsection*{Typedefs}
\begin{CompactItemize}
\item 
typedef void {\bf OggzTable}\label{oggz__table_8h_72c5d21d2254089d192176e1c310b023}

\begin{CompactList}\small\item\em A table of key-value pairs. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
{\bf OggzTable} $\ast$ {\bf oggz\_\-table\_\-new} (void)
\begin{CompactList}\small\item\em Instantiate a new OggzTable. \item\end{CompactList}\item 
void {\bf oggz\_\-table\_\-delete} ({\bf OggzTable} $\ast$table)
\begin{CompactList}\small\item\em Delete an OggzTable. \item\end{CompactList}\item 
void $\ast$ {\bf oggz\_\-table\_\-insert} ({\bf OggzTable} $\ast$table, long key, void $\ast$data)
\begin{CompactList}\small\item\em Insert an element into a table. \item\end{CompactList}\item 
int {\bf oggz\_\-table\_\-remove} ({\bf OggzTable} $\ast$table, long key)
\begin{CompactList}\small\item\em Remove the element of an OggzTable indexed by a given key. \item\end{CompactList}\item 
void $\ast$ {\bf oggz\_\-table\_\-lookup} ({\bf OggzTable} $\ast$table, long key)
\begin{CompactList}\small\item\em Retrieve the element of an OggzTable indexed by a given key. \item\end{CompactList}\item 
int {\bf oggz\_\-table\_\-size} ({\bf OggzTable} $\ast$table)
\begin{CompactList}\small\item\em Query the number of elements in an OggzTable. \item\end{CompactList}\item 
void $\ast$ {\bf oggz\_\-table\_\-nth} ({\bf OggzTable} $\ast$table, int n, long $\ast$key)
\begin{CompactList}\small\item\em Retrieve the nth element of an OggzTable, and optionally its key. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
A lookup table. 

OggzTable is provided for convenience to allow the storage of serialno-specific data. 

\subsection{Function Documentation}
\index{oggz\_\-table.h@{oggz\_\-table.h}!oggz\_\-table\_\-delete@{oggz\_\-table\_\-delete}}
\index{oggz\_\-table\_\-delete@{oggz\_\-table\_\-delete}!oggz_table.h@{oggz\_\-table.h}}
\subsubsection[{oggz\_\-table\_\-delete}]{\setlength{\rightskip}{0pt plus 5cm}void oggz\_\-table\_\-delete ({\bf OggzTable} $\ast$ {\em table})}\label{oggz__table_8h_989e307feecf2adc2ebe905c067051c4}


Delete an OggzTable. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em table}]An OggzTable \end{description}
\end{Desc}
\index{oggz\_\-table.h@{oggz\_\-table.h}!oggz\_\-table\_\-insert@{oggz\_\-table\_\-insert}}
\index{oggz\_\-table\_\-insert@{oggz\_\-table\_\-insert}!oggz_table.h@{oggz\_\-table.h}}
\subsubsection[{oggz\_\-table\_\-insert}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ oggz\_\-table\_\-insert ({\bf OggzTable} $\ast$ {\em table}, \/  long {\em key}, \/  void $\ast$ {\em data})}\label{oggz__table_8h_dbcdb0cdf6e8392c78956e911cbf6634}


Insert an element into a table. 

If a previous value existed for this key, it is overwritten with the new data element. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em table}]An OggzTable \item[{\em key}]Key to access this data element \item[{\em data}]The new element to add \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em data}]If the element was successfully added \item[{\em NULL}]If adding the element failed due to a realloc() error \end{description}
\end{Desc}
\index{oggz\_\-table.h@{oggz\_\-table.h}!oggz\_\-table\_\-lookup@{oggz\_\-table\_\-lookup}}
\index{oggz\_\-table\_\-lookup@{oggz\_\-table\_\-lookup}!oggz_table.h@{oggz\_\-table.h}}
\subsubsection[{oggz\_\-table\_\-lookup}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ oggz\_\-table\_\-lookup ({\bf OggzTable} $\ast$ {\em table}, \/  long {\em key})}\label{oggz__table_8h_92ea55bffd5657be29cf1972f33364e3}


Retrieve the element of an OggzTable indexed by a given key. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em table}]An OggzTable \item[{\em key}]a key \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The element indexed by {\em key\/} \end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em NULL}]{\em table\/} is undefined, or no element is indexed by {\em key\/} \end{description}
\end{Desc}
\index{oggz\_\-table.h@{oggz\_\-table.h}!oggz\_\-table\_\-new@{oggz\_\-table\_\-new}}
\index{oggz\_\-table\_\-new@{oggz\_\-table\_\-new}!oggz_table.h@{oggz\_\-table.h}}
\subsubsection[{oggz\_\-table\_\-new}]{\setlength{\rightskip}{0pt plus 5cm}{\bf OggzTable}$\ast$ oggz\_\-table\_\-new (void)}\label{oggz__table_8h_40772505443484de93526882c48f0dd8}


Instantiate a new OggzTable. 

\begin{Desc}
\item[Returns:]A new OggzTable \end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em NULL}]Could not allocate memory for table \end{description}
\end{Desc}
\index{oggz\_\-table.h@{oggz\_\-table.h}!oggz\_\-table\_\-nth@{oggz\_\-table\_\-nth}}
\index{oggz\_\-table\_\-nth@{oggz\_\-table\_\-nth}!oggz_table.h@{oggz\_\-table.h}}
\subsubsection[{oggz\_\-table\_\-nth}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ oggz\_\-table\_\-nth ({\bf OggzTable} $\ast$ {\em table}, \/  int {\em n}, \/  long $\ast$ {\em key})}\label{oggz__table_8h_285c3cbdb46e9b8c2a831728182856f1}


Retrieve the nth element of an OggzTable, and optionally its key. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em table}]An OggzTable \item[{\em n}]An index into the {\em table\/} \item[{\em key}]Return pointer for key corresponding to nth data element of {\em table\/}. Ignored if NULL. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The nth data element of {\em table\/} \end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em NULL}]{\em table\/} is undefined, or {\em n\/} is out of range \end{description}
\end{Desc}
\index{oggz\_\-table.h@{oggz\_\-table.h}!oggz\_\-table\_\-remove@{oggz\_\-table\_\-remove}}
\index{oggz\_\-table\_\-remove@{oggz\_\-table\_\-remove}!oggz_table.h@{oggz\_\-table.h}}
\subsubsection[{oggz\_\-table\_\-remove}]{\setlength{\rightskip}{0pt plus 5cm}int oggz\_\-table\_\-remove ({\bf OggzTable} $\ast$ {\em table}, \/  long {\em key})}\label{oggz__table_8h_c137e535f1da63ee52266b47f114020f}


Remove the element of an OggzTable indexed by a given key. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em table}]An OggzTable \item[{\em key}]a key \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em 0}]Success \item[{\em -1}]Not found \end{description}
\end{Desc}
\index{oggz\_\-table.h@{oggz\_\-table.h}!oggz\_\-table\_\-size@{oggz\_\-table\_\-size}}
\index{oggz\_\-table\_\-size@{oggz\_\-table\_\-size}!oggz_table.h@{oggz\_\-table.h}}
\subsubsection[{oggz\_\-table\_\-size}]{\setlength{\rightskip}{0pt plus 5cm}int oggz\_\-table\_\-size ({\bf OggzTable} $\ast$ {\em table})}\label{oggz__table_8h_62db2037df45db88a75b89b8a8ac7766}


Query the number of elements in an OggzTable. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em table}]An OggzTable \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the number of elements in {\em table\/} \end{Desc}
