\section{/home/pere/src/debiancvs/pkg-discover/discover/trunk/lib/stack.c File Reference}
\label{stack_8c}\index{/home/pere/src/debiancvs/pkg-discover/discover/trunk/lib/stack.c@{/home/pere/src/debiancvs/pkg-discover/discover/trunk/lib/stack.c}}
Stack routines for Discover. 

{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$assert.h$>$}\par
{\tt \#include $<$stdbool.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$discover/utils.h$>$}\par
{\tt \#include $<$discover/stack.h$>$}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
discover\_\-xml\_\-stack $\ast$ {\bf discover\_\-xml\_\-stack\_\-new} ()
\item 
void {\bf discover\_\-xml\_\-stack\_\-destroy} (discover\_\-xml\_\-stack $\ast$stack)
\item 
void {\bf discover\_\-xml\_\-stack\_\-push} (discover\_\-xml\_\-stack $\ast$$\ast$stack, void $\ast$data)
\item 
void $\ast$ {\bf discover\_\-xml\_\-stack\_\-pop} (discover\_\-xml\_\-stack $\ast$$\ast$stack)
\item 
void $\ast$ {\bf discover\_\-xml\_\-stack\_\-get} (discover\_\-xml\_\-stack $\ast$stack)
\item 
void $\ast$ {\bf discover\_\-xml\_\-stack\_\-getbynum} (discover\_\-xml\_\-stack $\ast$stack, int i)
\end{CompactItemize}


\subsection{Detailed Description}
Stack routines for Discover. 

This is a generic stack routine that Discover uses. The stack is needed because there wasn't a good way to track the traversal depth through the XML data. These routines brought much sanity to the XML parsing process. They are generic enough that they can be used for any number of applications. 

Definition in file {\bf stack.c}.

\subsection{Function Documentation}
\index{stack.c@{stack.c}!discover_xml_stack_destroy@{discover\_\-xml\_\-stack\_\-destroy}}
\index{discover_xml_stack_destroy@{discover\_\-xml\_\-stack\_\-destroy}!stack.c@{stack.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void discover\_\-xml\_\-stack\_\-destroy (discover\_\-xml\_\-stack $\ast$ {\em stack})}\label{stack_8c_a1}


Routine responsible for destroying the stack base once we're done 

Definition at line 62 of file stack.c.

Referenced by discover\_\-xml\_\-stack\_\-pop().\index{stack.c@{stack.c}!discover_xml_stack_get@{discover\_\-xml\_\-stack\_\-get}}
\index{discover_xml_stack_get@{discover\_\-xml\_\-stack\_\-get}!stack.c@{stack.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ discover\_\-xml\_\-stack\_\-get (discover\_\-xml\_\-stack $\ast$ {\em stack})}\label{stack_8c_a4}


Return the top item without popping it. 

Definition at line 103 of file stack.c.\index{stack.c@{stack.c}!discover_xml_stack_getbynum@{discover\_\-xml\_\-stack\_\-getbynum}}
\index{discover_xml_stack_getbynum@{discover\_\-xml\_\-stack\_\-getbynum}!stack.c@{stack.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ discover\_\-xml\_\-stack\_\-getbynum (discover\_\-xml\_\-stack $\ast$ {\em stack}, int {\em i})}\label{stack_8c_a5}


Return the item at depth i on the stack. 

Definition at line 109 of file stack.c.\index{stack.c@{stack.c}!discover_xml_stack_new@{discover\_\-xml\_\-stack\_\-new}}
\index{discover_xml_stack_new@{discover\_\-xml\_\-stack\_\-new}!stack.c@{stack.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}discover\_\-xml\_\-stack$\ast$ discover\_\-xml\_\-stack\_\-new ()}\label{stack_8c_a0}


Routine responsible for creating the base of the stack 

Definition at line 48 of file stack.c.

Referenced by discover\_\-xml\_\-stack\_\-push().\index{stack.c@{stack.c}!discover_xml_stack_pop@{discover\_\-xml\_\-stack\_\-pop}}
\index{discover_xml_stack_pop@{discover\_\-xml\_\-stack\_\-pop}!stack.c@{stack.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ discover\_\-xml\_\-stack\_\-pop (discover\_\-xml\_\-stack $\ast$$\ast$ {\em stack})}\label{stack_8c_a3}


Pop an item from the stack. 

Definition at line 83 of file stack.c.

References discover\_\-xml\_\-stack\_\-destroy().\index{stack.c@{stack.c}!discover_xml_stack_push@{discover\_\-xml\_\-stack\_\-push}}
\index{discover_xml_stack_push@{discover\_\-xml\_\-stack\_\-push}!stack.c@{stack.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void discover\_\-xml\_\-stack\_\-push (discover\_\-xml\_\-stack $\ast$$\ast$ {\em stack}, void $\ast$ {\em data})}\label{stack_8c_a2}


Push an item onto the stack. 

Definition at line 69 of file stack.c.

References discover\_\-xml\_\-stack\_\-new().