\hypertarget{state_8h}{
\section{state.h File Reference}
\label{state_8h}\index{state.h@{state.h}}
}
Definition of state structure and declaration of associated functions. 

{\tt \#include \char`\"{}XLX/stack.h\char`\"{}}\par


Include dependency graph for state.h:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=100pt]{state_8h__incl}
\end{center}
\end{figure}


This graph shows which files directly or indirectly include this file:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=187pt]{state_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct \hyperlink{struct__XLX__state}{\_\-XLX\_\-state}
\begin{CompactList}\small\item\em Current state of the parsing - stack pointing to current element and address of leaf on the configuration tree. \item\end{CompactList}\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{state_8h_a0}{
typedef \hyperlink{struct__XLX__state}{\_\-XLX\_\-state} \hyperlink{state_8h_a0}{XLX\_\-state}}
\label{state_8h_a0}

\begin{CompactList}\small\item\em Forward declaration of the state structure. \item\end{CompactList}\item 
\hypertarget{state_8h_a1}{
typedef void($\ast$ \hyperlink{state_8h_a1}{XLX\_\-p\-Character} )(\hyperlink{struct__XLX__state}{XLX\_\-state} $\ast$, const char $\ast$, int)}
\label{state_8h_a1}

\begin{CompactList}\small\item\em Pointer to function called to perform unique actions inside a char tag. \item\end{CompactList}\item 
\hypertarget{state_8h_a2}{
typedef void($\ast$ \hyperlink{state_8h_a2}{XLX\_\-p\-Enter} )(\hyperlink{struct__XLX__state}{XLX\_\-state} $\ast$, const char $\ast$$\ast$)}
\label{state_8h_a2}

\begin{CompactList}\small\item\em Pointer to function called to perform additional (attribute parsing) actions on entry to a tag. \item\end{CompactList}\item 
\hypertarget{state_8h_a3}{
typedef void($\ast$ \hyperlink{state_8h_a3}{XLX\_\-p\-Exit} )(\hyperlink{struct__XLX__state}{XLX\_\-state} $\ast$)}
\label{state_8h_a3}

\begin{CompactList}\small\item\em Pointer to function called to perform additional actions on exit from a tag. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{state_8h_a4}{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_8h_a5}{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_8h_a6}{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_8h_a7}{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_8h_a8}{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_8h_a9}{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_8h_a10}{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_8h_a11}{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_8h_a12}{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_8h_a13}{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}
Definition of state structure and declaration of associated functions. 

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


\subsection{Function Documentation}
\hypertarget{state_8h_a7}{
\index{state.h@{state.h}!XLX_character@{XLX\_\-character}}
\index{XLX_character@{XLX\_\-character}!state.h@{state.h}}
\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_8h_a7}


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}
\hypertarget{state_8h_a10}{
\index{state.h@{state.h}!XLX_character_noop@{XLX\_\-character\_\-noop}}
\index{XLX_character_noop@{XLX\_\-character\_\-noop}!state.h@{state.h}}
\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_8h_a10}


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_8h_a13}{
\index{state.h@{state.h}!XLX_character_tag@{XLX\_\-character\_\-tag}}
\index{XLX_character_tag@{XLX\_\-character\_\-tag}!state.h@{state.h}}
\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_8h_a13}


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.\hypertarget{state_8h_a6}{
\index{state.h@{state.h}!XLX_end@{XLX\_\-end}}
\index{XLX_end@{XLX\_\-end}!state.h@{state.h}}
\subsubsection[XLX\_\-end]{\setlength{\rightskip}{0pt plus 5cm}void XLX\_\-end (void $\ast$ {\em data}, const char $\ast$ {\em element})}}
\label{state_8h_a6}


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}
\hypertarget{state_8h_a11}{
\index{state.h@{state.h}!XLX_enter_noop@{XLX\_\-enter\_\-noop}}
\index{XLX_enter_noop@{XLX\_\-enter\_\-noop}!state.h@{state.h}}
\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_8h_a11}


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_8h_a12}{
\index{state.h@{state.h}!XLX_exit_noop@{XLX\_\-exit\_\-noop}}
\index{XLX_exit_noop@{XLX\_\-exit\_\-noop}!state.h@{state.h}}
\subsubsection[XLX\_\-exit\_\-noop]{\setlength{\rightskip}{0pt plus 5cm}void XLX\_\-exit\_\-noop (\hyperlink{struct__XLX__state}{XLX\_\-state} $\ast$ {\em state})}}
\label{state_8h_a12}


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_8h_a4}{
\index{state.h@{state.h}!XLX_initState@{XLX\_\-initState}}
\index{XLX_initState@{XLX\_\-initState}!state.h@{state.h}}
\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_8h_a4}


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}
\hypertarget{state_8h_a8}{
\index{state.h@{state.h}!XLX_printout_down@{XLX\_\-printout\_\-down}}
\index{XLX_printout_down@{XLX\_\-printout\_\-down}!state.h@{state.h}}
\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_8h_a8}


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_8h_a9}{
\index{state.h@{state.h}!XLX_printout_up@{XLX\_\-printout\_\-up}}
\index{XLX_printout_up@{XLX\_\-printout\_\-up}!state.h@{state.h}}
\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_8h_a9}


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_8h_a5}{
\index{state.h@{state.h}!XLX_start@{XLX\_\-start}}
\index{XLX_start@{XLX\_\-start}!state.h@{state.h}}
\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_8h_a5}


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}
