\hypertarget{state_8c}{
\section{state.c File Reference}
\label{state_8c}\index{state.c@{state.c}}
}
Change of state on entering and leaving an element.  


{\tt \#include \char`\"{}XLX/state.h\char`\"{}}\par
{\tt \#include \char`\"{}XLX/parent\_\-tag.h\char`\"{}}\par
{\tt \#include \char`\"{}XLX/util.h\char`\"{}}\par
{\tt \#include \char`\"{}XLX/XLX\_\-msgs.h\char`\"{}}\par
{\tt \#include \char`\"{}MSG/MSG\_\-pubdefs.h\char`\"{}}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$string.h$>$}\par


Include dependency graph for state.c:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=346pt]{state_8c__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{state_8c_a0}{XLX\_\-init\-State} (\hyperlink{struct__XLX__state}{XLX\_\-state} $\ast$state, unsigned stack\-Limit, void $\ast$stack\-Seed, \hyperlink{state_8h_a2}{XLX\_\-p\-Enter} enter, \hyperlink{state_8h_a3}{XLX\_\-p\-Exit} exit, \hyperlink{state_8h_a1}{XLX\_\-p\-Character} character, int verbose)
\begin{CompactList}\small\item\em Initialises the state of the parser. \item\end{CompactList}\item 
void \hyperlink{state_8c_a1}{XLX\_\-start} (void $\ast$data, const char $\ast$element, const char $\ast$$\ast$attribute)
\begin{CompactList}\small\item\em Handles a start tag. \item\end{CompactList}\item 
void \hyperlink{state_8c_a2}{XLX\_\-end} (void $\ast$data, const char $\ast$element)
\begin{CompactList}\small\item\em Handles an end tag. \item\end{CompactList}\item 
void \hyperlink{state_8c_a3}{XLX\_\-character} (void $\ast$data, const char $\ast$element, int len)
\begin{CompactList}\small\item\em Handles a character element. \item\end{CompactList}\item 
void \hyperlink{state_8c_a4}{XLX\_\-printout\_\-down} (\hyperlink{struct__XLX__state}{XLX\_\-state} $\ast$state, const char $\ast$element)
\begin{CompactList}\small\item\em Print an starting tag. \item\end{CompactList}\item 
void \hyperlink{state_8c_a5}{XLX\_\-printout\_\-up} (\hyperlink{struct__XLX__state}{XLX\_\-state} $\ast$state, const char $\ast$element)
\begin{CompactList}\small\item\em Print an ending tag. \item\end{CompactList}\item 
void \hyperlink{state_8c_a6}{XLX\_\-character\_\-noop} (\hyperlink{struct__XLX__state}{XLX\_\-state} $\ast$state, const char $\ast$element, int len)
\begin{CompactList}\small\item\em No-op character element handler. \item\end{CompactList}\item 
void \hyperlink{state_8c_a7}{XLX\_\-enter\_\-noop} (\hyperlink{struct__XLX__state}{XLX\_\-state} $\ast$state, const char $\ast$$\ast$attribute)
\begin{CompactList}\small\item\em No-op enter element handler. \item\end{CompactList}\item 
void \hyperlink{state_8c_a8}{XLX\_\-exit\_\-noop} (\hyperlink{struct__XLX__state}{XLX\_\-state} $\ast$state)
\begin{CompactList}\small\item\em No-op exit element handler. \item\end{CompactList}\item 
void \hyperlink{state_8c_a9}{XLX\_\-character\_\-tag} (\hyperlink{struct__XLX__state}{XLX\_\-state} $\ast$state, const char $\ast$element, int len)
\begin{CompactList}\small\item\em Handles a character element inside a parent tag by delegating the work to the first child. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Change of state on entering and leaving an element. 

\begin{Desc}
\item[Author:]James Swain -- \href{mailto:jswain@slac.stanford.edu}{\tt jswain@slac.stanford.edu} \end{Desc}


\subsection{Function Documentation}
\hypertarget{state_8c_a3}{
\index{state.c@{state.c}!XLX_character@{XLX\_\-character}}
\index{XLX_character@{XLX\_\-character}!state.c@{state.c}}
\subsubsection[XLX\_\-character]{\setlength{\rightskip}{0pt plus 5cm}void XLX\_\-character (void $\ast$ {\em data}, const char $\ast$ {\em element}, int {\em len})}}
\label{state_8c_a3}


Handles a character element. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em data}]Current state of the parser \item[{\em element}]Charater element \item[{\em len}]Length of the character element \end{description}
\end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=121pt]{state_8c_a3_cgraph}
\end{center}
\end{figure}
\hypertarget{state_8c_a6}{
\index{state.c@{state.c}!XLX_character_noop@{XLX\_\-character\_\-noop}}
\index{XLX_character_noop@{XLX\_\-character\_\-noop}!state.c@{state.c}}
\subsubsection[XLX\_\-character\_\-noop]{\setlength{\rightskip}{0pt plus 5cm}void XLX\_\-character\_\-noop (\hyperlink{struct__XLX__state}{XLX\_\-state} $\ast$ {\em state}, const char $\ast$ {\em element}, int {\em len})}}
\label{state_8c_a6}


No-op character element handler. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em state}]Pointer to the current state of the parser \item[{\em element}]The text string from the current element \item[{\em len}]Length of element \end{description}
\end{Desc}
\hypertarget{state_8c_a9}{
\index{state.c@{state.c}!XLX_character_tag@{XLX\_\-character\_\-tag}}
\index{XLX_character_tag@{XLX\_\-character\_\-tag}!state.c@{state.c}}
\subsubsection[XLX\_\-character\_\-tag]{\setlength{\rightskip}{0pt plus 5cm}void XLX\_\-character\_\-tag (\hyperlink{struct__XLX__state}{XLX\_\-state} $\ast$ {\em state}, const char $\ast$ {\em element}, int {\em len})}}
\label{state_8c_a9}


Handles a character element inside a parent tag by delegating the work to the first child. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em state}]Current state of the parser \item[{\em element}]Charater element \item[{\em len}]Length of the character element \end{description}
\end{Desc}
/para If there are valid characters in the character element then the first child of the current tag is pushed onto the stack and then XLX\_\-character is called to handle the character parsing. After the parsing is complete the child is popped off the stack. 

Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=194pt]{state_8c_a9_cgraph}
\end{center}
\end{figure}
\hypertarget{state_8c_a2}{
\index{state.c@{state.c}!XLX_end@{XLX\_\-end}}
\index{XLX_end@{XLX\_\-end}!state.c@{state.c}}
\subsubsection[XLX\_\-end]{\setlength{\rightskip}{0pt plus 5cm}void XLX\_\-end (void $\ast$ {\em data}, const char $\ast$ {\em element})}}
\label{state_8c_a2}


Handles an end tag. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em data}]Current state of the parser \item[{\em element}]Element name from end tag \end{description}
\end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=127pt]{state_8c_a2_cgraph}
\end{center}
\end{figure}
\hypertarget{state_8c_a7}{
\index{state.c@{state.c}!XLX_enter_noop@{XLX\_\-enter\_\-noop}}
\index{XLX_enter_noop@{XLX\_\-enter\_\-noop}!state.c@{state.c}}
\subsubsection[XLX\_\-enter\_\-noop]{\setlength{\rightskip}{0pt plus 5cm}void XLX\_\-enter\_\-noop (\hyperlink{struct__XLX__state}{XLX\_\-state} $\ast$ {\em state}, const char $\ast$$\ast$ {\em attribute})}}
\label{state_8c_a7}


No-op enter element handler. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em state}]Pointer to the current state of the parser \item[{\em attribute}]Attribute list for the current element \end{description}
\end{Desc}
\hypertarget{state_8c_a8}{
\index{state.c@{state.c}!XLX_exit_noop@{XLX\_\-exit\_\-noop}}
\index{XLX_exit_noop@{XLX\_\-exit\_\-noop}!state.c@{state.c}}
\subsubsection[XLX\_\-exit\_\-noop]{\setlength{\rightskip}{0pt plus 5cm}void XLX\_\-exit\_\-noop (\hyperlink{struct__XLX__state}{XLX\_\-state} $\ast$ {\em state})}}
\label{state_8c_a8}


No-op exit element handler. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em state}]Pointer to the current state of the parser \end{description}
\end{Desc}
\hypertarget{state_8c_a0}{
\index{state.c@{state.c}!XLX_initState@{XLX\_\-initState}}
\index{XLX_initState@{XLX\_\-initState}!state.c@{state.c}}
\subsubsection[XLX\_\-initState]{\setlength{\rightskip}{0pt plus 5cm}void XLX\_\-init\-State (\hyperlink{struct__XLX__state}{XLX\_\-state} $\ast$ {\em state}, unsigned {\em stack\-Limit}, void $\ast$ {\em stack\-Seed}, \hyperlink{state_8h_a2}{XLX\_\-p\-Enter} {\em enter}, \hyperlink{state_8h_a3}{XLX\_\-p\-Exit} {\em exit}, \hyperlink{state_8h_a1}{XLX\_\-p\-Character} {\em character}, int {\em verbose})}}
\label{state_8c_a0}


Initialises the state of the parser. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em state}]State to initialise \item[{\em stack\-Limit}]Initial depth of the stack \item[{\em stack\-Seed}]Initial item on the stack \item[{\em enter}]Parser default action on encountering an enter tag \item[{\em exit}]Parser default action on encountering an exit tag \item[{\em character}]Parser default action on encountering a character tag \item[{\em verbose}]Vebosity level of the parser, 0 is quiet, non-zero is not \end{description}
\end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=128pt]{state_8c_a0_cgraph}
\end{center}
\end{figure}
\hypertarget{state_8c_a4}{
\index{state.c@{state.c}!XLX_printout_down@{XLX\_\-printout\_\-down}}
\index{XLX_printout_down@{XLX\_\-printout\_\-down}!state.c@{state.c}}
\subsubsection[XLX\_\-printout\_\-down]{\setlength{\rightskip}{0pt plus 5cm}void XLX\_\-printout\_\-down (\hyperlink{struct__XLX__state}{XLX\_\-state} $\ast$ {\em state}, const char $\ast$ {\em element})}}
\label{state_8c_a4}


Print an starting tag. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em state}]Current state of the parser \item[{\em element}]Text string from the current tag \end{description}
\end{Desc}
\hypertarget{state_8c_a5}{
\index{state.c@{state.c}!XLX_printout_up@{XLX\_\-printout\_\-up}}
\index{XLX_printout_up@{XLX\_\-printout\_\-up}!state.c@{state.c}}
\subsubsection[XLX\_\-printout\_\-up]{\setlength{\rightskip}{0pt plus 5cm}void XLX\_\-printout\_\-up (\hyperlink{struct__XLX__state}{XLX\_\-state} $\ast$ {\em state}, const char $\ast$ {\em element})}}
\label{state_8c_a5}


Print an ending tag. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em state}]Current state of the parser \item[{\em element}]Text string from the current tag \end{description}
\end{Desc}
\hypertarget{state_8c_a1}{
\index{state.c@{state.c}!XLX_start@{XLX\_\-start}}
\index{XLX_start@{XLX\_\-start}!state.c@{state.c}}
\subsubsection[XLX\_\-start]{\setlength{\rightskip}{0pt plus 5cm}void XLX\_\-start (void $\ast$ {\em data}, const char $\ast$ {\em element}, const char $\ast$$\ast$ {\em attribute})}}
\label{state_8c_a1}


Handles a start tag. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em data}]Current state of the parser \item[{\em element}]Element name from start tag \item[{\em attribute}]Attribute list from the start tag \end{description}
\end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=135pt]{state_8c_a1_cgraph}
\end{center}
\end{figure}
