\hypertarget{LCBR_8c}{
\section{LCBR.c File Reference}
\label{LCBR_8c}\index{LCBR.c@{LCBR.c}}
}
Implements the LCB result list/item scanning parsing routines.  


{\tt \#include \char`\"{}LCBD/LCBR.h\char`\"{}}\par
{\tt \#include \char`\"{}LCBD/LATP.h\char`\"{}}\par
{\tt \#include \char`\"{}LCBD/LCB\_\-cr.h\char`\"{}}\par
{\tt \#include $<$stdio.h$>$}\par


Include dependency graph for LCBR.c:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=216pt]{LCBR_8c__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{CompactItemize}
\item 
unsigned int \hyperlink{LCBR_8c_a0}{LCBR\_\-process} (const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ri, const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$end, \hyperlink{LCBR_8h_a7}{LCBR\_\-processor} rtn, void $\ast$prm)
\begin{CompactList}\small\item\em Executes the user specified handler for each result item in the range {\em ri\/} to {\em end\/}. \item\end{CompactList}\item 
const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ \hyperlink{LCBR_8c_a1}{LCBR\_\-check} (const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ri, const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$end)
\begin{CompactList}\small\item\em Checks the specified range of result items for errors. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBR_8c_a2}{LCBR\_\-error\_\-get} (const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ri)
\begin{CompactList}\small\item\em Returns the 16-bit error word of {\em ri\/}. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBR_8c_a3}{show} (void $\ast$prm, const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ri)
\begin{CompactList}\small\item\em Shows (prints) a single result item. \item\end{CompactList}\item 
void \hyperlink{LCBR_8c_a4}{LCBR\_\-show} (unsigned int options, const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$beg, const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$end)
\begin{CompactList}\small\item\em Dumps the result items to stdout. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Implements the LCB result list/item scanning parsing routines. 

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


\footnotesize\begin{verbatim}
  CVS $Id
\end{verbatim}\normalsize


\subsection{Function Documentation}
\hypertarget{LCBR_8c_a1}{
\index{LCBR.c@{LCBR.c}!LCBR_check@{LCBR\_\-check}}
\index{LCBR_check@{LCBR\_\-check}!LCBR.c@{LCBR.c}}
\subsubsection[LCBR\_\-check]{\setlength{\rightskip}{0pt plus 5cm}const \hyperlink{union__LCB__ri}{LCB\_\-ri}$\ast$ LCBR\_\-check (const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ {\em ri}, const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ {\em end})}}
\label{LCBR_8c_a1}


Checks the specified range of result items for errors. 

\begin{Desc}
\item[Returns:]Pointer to the last item successfully checked. If successful, end should be returned. \end{Desc}
A convience method to quickly scan a result list for any errors. If any result item has an error, a pointer to that result item is returned.

If anything of than a pointer to {\em end\/} is returned, then an error in the result list has occurred. There are two offending conditions

\begin{enumerate}
\item The error code in the result item is anything but successful\item A result item has an undefined OPCODE making it impossible to advance.\end{enumerate}


The low 2 bits of the returned pointer contain the error syndrome. Currently only these two cases are defined

\begin{itemize}
\item low 2 bits 0, error is from the error field in the result item\item low 2 bits 1, error is because of a bad opcode. \end{itemize}
\hypertarget{LCBR_8c_a2}{
\index{LCBR.c@{LCBR.c}!LCBR_error_get@{LCBR\_\-error\_\-get}}
\index{LCBR_error_get@{LCBR\_\-error\_\-get}!LCBR.c@{LCBR.c}}
\subsubsection[LCBR\_\-error\_\-get]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBR\_\-error\_\-get (const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ {\em ri})}}
\label{LCBR_8c_a2}


Returns the 16-bit error word of {\em ri\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ri}]Pointer to result item structure \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The error code. If the opcode is not recognized, the value LCB\_\-RCV\_\-ERR\_\-UNDEFINED\_\-7 is returned. \end{Desc}
\hypertarget{LCBR_8c_a0}{
\index{LCBR.c@{LCBR.c}!LCBR_process@{LCBR\_\-process}}
\index{LCBR_process@{LCBR\_\-process}!LCBR.c@{LCBR.c}}
\subsubsection[LCBR\_\-process]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBR\_\-process (const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ {\em ri}, const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ {\em end}, \hyperlink{LCBR_8h_a7}{LCBR\_\-processor} {\em rtn}, void $\ast$ {\em prm})}}
\label{LCBR_8c_a0}


Executes the user specified handler for each result item in the range {\em ri\/} to {\em end\/}. 

\begin{Desc}
\item[Returns:]The status of the last processing call\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ri}]The first result item to process \item[{\em end}]One past the last result item to process \item[{\em rtn}]User provided callback routine to process one item \item[{\em prm}]User provided parameter passed to {\em rtn\/} \end{description}
\end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=125pt]{LCBR_8c_a0_cgraph}
\end{center}
\end{figure}
\hypertarget{LCBR_8c_a4}{
\index{LCBR.c@{LCBR.c}!LCBR_show@{LCBR\_\-show}}
\index{LCBR_show@{LCBR\_\-show}!LCBR.c@{LCBR.c}}
\subsubsection[LCBR\_\-show]{\setlength{\rightskip}{0pt plus 5cm}void LCBR\_\-show (unsigned int {\em options}, const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ {\em beg}, const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ {\em end})}}
\label{LCBR_8c_a4}


Dumps the result items to stdout. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em options}]Show options \item[{\em beg}]Pointer to the first result descriptor to show \item[{\em end}]Pointer to one past the lst result descriptor to show \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]void \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=190pt]{LCBR_8c_a4_cgraph}
\end{center}
\end{figure}
\hypertarget{LCBR_8c_a3}{
\index{LCBR.c@{LCBR.c}!show@{show}}
\index{show@{show}!LCBR.c@{LCBR.c}}
\subsubsection[show]{\setlength{\rightskip}{0pt plus 5cm}static unsigned int show (void $\ast$ {\em prm}, const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ {\em ri})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{LCBR_8c_a3}


Shows (prints) a single result item. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em prm}]Arbitrary user parameter, unused \item[{\em ri}]Pointer to result item\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]0 \end{Desc}
Useful when passed to LCBR\_\-process () to print all result items. 

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