\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
\subsection*{Functions}
\begin{CompactItemize}
\item 
unsigned int \hyperlink{LCBR_8c_da0bf9551035dfd00933eaf3e7a314c4}{LCBR\_\-process} (const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ri, const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$end, \hyperlink{LCBR_8h_b554bae4e2a6f51e050d24b73d31f76e}{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_cc2afe46c148553746441e098f3544f7}{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_778cc23a80af140c22f7d20e8f0e6ffb}{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 
static unsigned int \hyperlink{LCBR_8c_9b51528fc346d593d1318002f65b632c}{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_f2e1ea7c3b83f0da926a5ca308df98ea}{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_cc2afe46c148553746441e098f3544f7}{
\index{LCBR.c@{LCBR.c}!LCBR_check@{LCBR\_\-check}}
\index{LCBR_check@{LCBR\_\-check}!LCBR.c@{LCBR.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf LCB\_\-ri}$\ast$ LCBR\_\-check (const {\bf LCB\_\-ri} $\ast$ {\em ri}, const {\bf LCB\_\-ri} $\ast$ {\em end})}}
\label{LCBR_8c_cc2afe46c148553746441e098f3544f7}


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_778cc23a80af140c22f7d20e8f0e6ffb}{
\index{LCBR.c@{LCBR.c}!LCBR_error_get@{LCBR\_\-error\_\-get}}
\index{LCBR_error_get@{LCBR\_\-error\_\-get}!LCBR.c@{LCBR.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBR\_\-error\_\-get (const {\bf LCB\_\-ri} $\ast$ {\em ri})}}
\label{LCBR_8c_778cc23a80af140c22f7d20e8f0e6ffb}


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_da0bf9551035dfd00933eaf3e7a314c4}{
\index{LCBR.c@{LCBR.c}!LCBR_process@{LCBR\_\-process}}
\index{LCBR_process@{LCBR\_\-process}!LCBR.c@{LCBR.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBR\_\-process (const {\bf LCB\_\-ri} $\ast$ {\em ri}, const {\bf LCB\_\-ri} $\ast$ {\em end}, {\bf LCBR\_\-processor} {\em rtn}, void $\ast$ {\em prm})}}
\label{LCBR_8c_da0bf9551035dfd00933eaf3e7a314c4}


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}
\hypertarget{LCBR_8c_f2e1ea7c3b83f0da926a5ca308df98ea}{
\index{LCBR.c@{LCBR.c}!LCBR_show@{LCBR\_\-show}}
\index{LCBR_show@{LCBR\_\-show}!LCBR.c@{LCBR.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void LCBR\_\-show (unsigned int {\em options}, const {\bf LCB\_\-ri} $\ast$ {\em beg}, const {\bf LCB\_\-ri} $\ast$ {\em end})}}
\label{LCBR_8c_f2e1ea7c3b83f0da926a5ca308df98ea}


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}
\hypertarget{LCBR_8c_9b51528fc346d593d1318002f65b632c}{
\index{LCBR.c@{LCBR.c}!show@{show}}
\index{show@{show}!LCBR.c@{LCBR.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static unsigned int show (void $\ast$ {\em prm}, const {\bf LCB\_\-ri} $\ast$ {\em ri})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{LCBR_8c_9b51528fc346d593d1318002f65b632c}


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. 