\section{oggz\+\_\+table.\+h File Reference}
\label{oggz__table_8h}\index{oggz\+\_\+table.\+h@{oggz\+\_\+table.\+h}}


A lookup table.  


\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
\mbox{\label{oggz__table_8h_a72c5d21d2254089d192176e1c310b023}} 
typedef void \textbf{ Oggz\+Table}
\begin{DoxyCompactList}\small\item\em A table of key-\/value pairs. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ Oggz\+Table} $\ast$ \textbf{ oggz\+\_\+table\+\_\+new} (void)
\begin{DoxyCompactList}\small\item\em Instantiate a new Oggz\+Table. \end{DoxyCompactList}\item 
void \textbf{ oggz\+\_\+table\+\_\+delete} (\textbf{ Oggz\+Table} $\ast$table)
\begin{DoxyCompactList}\small\item\em Delete an Oggz\+Table. \end{DoxyCompactList}\item 
void $\ast$ \textbf{ oggz\+\_\+table\+\_\+insert} (\textbf{ Oggz\+Table} $\ast$table, long key, void $\ast$data)
\begin{DoxyCompactList}\small\item\em Insert an element into a table. \end{DoxyCompactList}\item 
int \textbf{ oggz\+\_\+table\+\_\+remove} (\textbf{ Oggz\+Table} $\ast$table, long key)
\begin{DoxyCompactList}\small\item\em Remove the element of an Oggz\+Table indexed by a given key. \end{DoxyCompactList}\item 
void $\ast$ \textbf{ oggz\+\_\+table\+\_\+lookup} (\textbf{ Oggz\+Table} $\ast$table, long key)
\begin{DoxyCompactList}\small\item\em Retrieve the element of an Oggz\+Table indexed by a given key. \end{DoxyCompactList}\item 
int \textbf{ oggz\+\_\+table\+\_\+size} (\textbf{ Oggz\+Table} $\ast$table)
\begin{DoxyCompactList}\small\item\em Query the number of elements in an Oggz\+Table. \end{DoxyCompactList}\item 
void $\ast$ \textbf{ oggz\+\_\+table\+\_\+nth} (\textbf{ Oggz\+Table} $\ast$table, int n, long $\ast$key)
\begin{DoxyCompactList}\small\item\em Retrieve the nth element of an Oggz\+Table, and optionally its key. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
A lookup table. 

Oggz\+Table is provided for convenience to allow the storage of serialno-\/specific data. 

\subsection{Function Documentation}
\mbox{\label{oggz__table_8h_a989e307feecf2adc2ebe905c067051c4}} 
\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()}
{\footnotesize\ttfamily void oggz\+\_\+table\+\_\+delete (\begin{DoxyParamCaption}\item[{\textbf{ Oggz\+Table} $\ast$}]{table }\end{DoxyParamCaption})}



Delete an Oggz\+Table. 


\begin{DoxyParams}{Parameters}
{\em table} & An Oggz\+Table \\
\hline
\end{DoxyParams}
\mbox{\label{oggz__table_8h_adbcdb0cdf6e8392c78956e911cbf6634}} 
\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()}
{\footnotesize\ttfamily void$\ast$ oggz\+\_\+table\+\_\+insert (\begin{DoxyParamCaption}\item[{\textbf{ Oggz\+Table} $\ast$}]{table,  }\item[{long}]{key,  }\item[{void $\ast$}]{data }\end{DoxyParamCaption})}



Insert an element into a table. 

If a previous value existed for this key, it is overwritten with the new data element. 
\begin{DoxyParams}{Parameters}
{\em table} & An Oggz\+Table \\
\hline
{\em key} & Key to access this data element \\
\hline
{\em data} & The new element to add \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em data} & If the element was successfully added \\
\hline
{\em N\+U\+LL} & If adding the element failed due to a realloc() error \\
\hline
\end{DoxyRetVals}
\mbox{\label{oggz__table_8h_a92ea55bffd5657be29cf1972f33364e3}} 
\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()}
{\footnotesize\ttfamily void$\ast$ oggz\+\_\+table\+\_\+lookup (\begin{DoxyParamCaption}\item[{\textbf{ Oggz\+Table} $\ast$}]{table,  }\item[{long}]{key }\end{DoxyParamCaption})}



Retrieve the element of an Oggz\+Table indexed by a given key. 


\begin{DoxyParams}{Parameters}
{\em table} & An Oggz\+Table \\
\hline
{\em key} & a key \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The element indexed by {\itshape key} 
\end{DoxyReturn}

\begin{DoxyRetVals}{Return values}
{\em N\+U\+LL} & {\itshape table} is undefined, or no element is indexed by {\itshape key} \\
\hline
\end{DoxyRetVals}
\mbox{\label{oggz__table_8h_a40772505443484de93526882c48f0dd8}} 
\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()}
{\footnotesize\ttfamily \textbf{ Oggz\+Table}$\ast$ oggz\+\_\+table\+\_\+new (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Instantiate a new Oggz\+Table. 

\begin{DoxyReturn}{Returns}
A new Oggz\+Table 
\end{DoxyReturn}

\begin{DoxyRetVals}{Return values}
{\em N\+U\+LL} & Could not allocate memory for table \\
\hline
\end{DoxyRetVals}
\mbox{\label{oggz__table_8h_a285c3cbdb46e9b8c2a831728182856f1}} 
\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()}
{\footnotesize\ttfamily void$\ast$ oggz\+\_\+table\+\_\+nth (\begin{DoxyParamCaption}\item[{\textbf{ Oggz\+Table} $\ast$}]{table,  }\item[{int}]{n,  }\item[{long $\ast$}]{key }\end{DoxyParamCaption})}



Retrieve the nth element of an Oggz\+Table, and optionally its key. 


\begin{DoxyParams}{Parameters}
{\em table} & An Oggz\+Table \\
\hline
{\em n} & An index into the {\itshape table} \\
\hline
{\em key} & Return pointer for key corresponding to nth data element of {\itshape table}. Ignored if N\+U\+LL. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The nth data element of {\itshape table} 
\end{DoxyReturn}

\begin{DoxyRetVals}{Return values}
{\em N\+U\+LL} & {\itshape table} is undefined, or {\itshape n} is out of range \\
\hline
\end{DoxyRetVals}
\mbox{\label{oggz__table_8h_ac137e535f1da63ee52266b47f114020f}} 
\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()}
{\footnotesize\ttfamily int oggz\+\_\+table\+\_\+remove (\begin{DoxyParamCaption}\item[{\textbf{ Oggz\+Table} $\ast$}]{table,  }\item[{long}]{key }\end{DoxyParamCaption})}



Remove the element of an Oggz\+Table indexed by a given key. 


\begin{DoxyParams}{Parameters}
{\em table} & An Oggz\+Table \\
\hline
{\em key} & a key \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em 0} & Success \\
\hline
{\em -\/1} & Not found \\
\hline
\end{DoxyRetVals}
\mbox{\label{oggz__table_8h_a62db2037df45db88a75b89b8a8ac7766}} 
\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()}
{\footnotesize\ttfamily int oggz\+\_\+table\+\_\+size (\begin{DoxyParamCaption}\item[{\textbf{ Oggz\+Table} $\ast$}]{table }\end{DoxyParamCaption})}



Query the number of elements in an Oggz\+Table. 


\begin{DoxyParams}{Parameters}
{\em table} & An Oggz\+Table \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the number of elements in {\itshape table} 
\end{DoxyReturn}
