\hypertarget{BFA_8c}{
\section{BFA.c File Reference}
\label{BFA_8c}\index{BFA.c@{BFA.c}}
}
Balloon Flight Allocation Routines. 


{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$string.h$>$}\par
{\tt \#include \char`\"{}BBC/BUG.h\char`\"{}}\par
{\tt \#include \char`\"{}BBC/RNG.h\char`\"{}}\par
{\tt \#include \char`\"{}BFU/BFA.h\char`\"{}}\par
{\tt \#include \char`\"{}BFU/BFU\_\-file\-Dsc.h\char`\"{}}\par
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct \hyperlink{struct__BFA__acb}{\_\-BFA\_\-acb}
\begin{CompactList}\small\item\em Balloon Flight Allocation Control Block.\item\end{CompactList}\item 
struct \hyperlink{struct__BFA__rcb}{\_\-BFA\_\-rcb}
\begin{CompactList}\small\item\em Underlying ring buffer.\item\end{CompactList}\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{BFA_8c_a0}{
\index{BFA_rcb@{BFA\_\-rcb}!BFA.c@{BFA.c}}\index{BFA.c@{BFA.c}!BFA_rcb@{BFA\_\-rcb}}
typedef \hyperlink{struct__BFA__rcb}{\_\-BFA\_\-rcb} \hyperlink{BFA_8c_a0}{BFA\_\-rcb}}
\label{BFA_8c_a0}

\begin{CompactList}\small\item\em Typedef for stuct \hyperlink{struct__BFA__rcb}{\_\-BFA\_\-rcb}.\item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{BFA_8c_a1}{init\-Bfa} (\hyperlink{BFA_8c_a0}{BFA\_\-rcb} $\ast$brcb, struct \_\-RNG\_\-rcb $\ast$rcb, unsigned char $\ast$pool, int pool\_\-size, int max\_\-alloc\_\-size)
\begin{CompactList}\small\item\em Initializes a BFA ring buffer control structure.\item\end{CompactList}\item 
\hypertarget{BFA_8c_a2}{
\index{BFA_copy@{BFA\_\-copy}!BFA.c@{BFA.c}}\index{BFA.c@{BFA.c}!BFA_copy@{BFA\_\-copy}}
int {\bf BFA\_\-copy} (\hyperlink{BFA_8h_a0}{BFA\_\-acb} $\ast$acb, void $\ast$eop)}
\label{BFA_8c_a2}

\item 
\hypertarget{BFA_8c_a3}{
\index{BFA_get@{BFA\_\-get}!BFA.c@{BFA.c}}\index{BFA.c@{BFA.c}!BFA_get@{BFA\_\-get}}
\hyperlink{struct__BFU__fileDsc}{\_\-BFU\_\-file\-Dsc} $\ast$ {\bf BFA\_\-get} (\hyperlink{BFA_8h_a0}{BFA\_\-acb} $\ast$acb, int nevts, int nsums, int nbytes)}
\label{BFA_8c_a3}

\item 
\hypertarget{BFA_8c_a4}{
\index{BFA_open@{BFA\_\-open}!BFA.c@{BFA.c}}\index{BFA.c@{BFA.c}!BFA_open@{BFA\_\-open}}
\hyperlink{BFA_8h_a0}{BFA\_\-acb} $\ast$ {\bf BFA\_\-open} (int dsc\_\-pool\_\-size, int dsc\_\-max\_\-alloc\_\-size, int evt\_\-pool\_\-size, int evt\_\-max\_\-alloc\_\-size)}
\label{BFA_8c_a4}

\item 
\hypertarget{BFA_8c_a5}{
\index{BFA_evtRcbGet@{BFA\_\-evtRcbGet}!BFA.c@{BFA.c}}\index{BFA.c@{BFA.c}!BFA_evtRcbGet@{BFA\_\-evt\-Rcb\-Get}}
\_\-RNG\_\-rcb $\ast$ {\bf BFA\_\-evt\-Rcb\-Get} (const \hyperlink{BFA_8h_a0}{BFA\_\-acb} $\ast$acb)}
\label{BFA_8c_a5}

\item 
\hypertarget{BFA_8c_a6}{
\index{BFA_dscRcbGet@{BFA\_\-dscRcbGet}!BFA.c@{BFA.c}}\index{BFA.c@{BFA.c}!BFA_dscRcbGet@{BFA\_\-dsc\-Rcb\-Get}}
\_\-RNG\_\-rcb $\ast$ {\bf BFA\_\-dsc\-Rcb\-Get} (const \hyperlink{BFA_8h_a0}{BFA\_\-acb} $\ast$acb)}
\label{BFA_8c_a6}

\item 
\hypertarget{BFA_8c_a7}{
\index{BFA_evtRcbReset@{BFA\_\-evtRcbReset}!BFA.c@{BFA.c}}\index{BFA.c@{BFA.c}!BFA_evtRcbReset@{BFA\_\-evt\-Rcb\-Reset}}
int {\bf BFA\_\-evt\-Rcb\-Reset} (\hyperlink{BFA_8h_a0}{BFA\_\-acb} $\ast$acb)}
\label{BFA_8c_a7}

\item 
\hypertarget{BFA_8c_a8}{
\index{BFA_dscRcbReset@{BFA\_\-dscRcbReset}!BFA.c@{BFA.c}}\index{BFA.c@{BFA.c}!BFA_dscRcbReset@{BFA\_\-dsc\-Rcb\-Reset}}
int {\bf BFA\_\-dsc\-Rcb\-Reset} (\hyperlink{BFA_8h_a0}{BFA\_\-acb} $\ast$acb)}
\label{BFA_8c_a8}

\end{CompactItemize}


\subsection{Detailed Description}
Balloon Flight Allocation Routines.



\begin{Desc}
\item[Author: ]\par
JJRussell - \href{mailto:russell@slac.stanford.edu}{\tt russell@slac.stanford.edu}\end{Desc}
{\bf ABSTRACT} \par
 {\bf --------} \par
 Provides the Balloon Flight DAQ memory manager

{\bf DESCRIPTION} \par
 {\bf -----------} \par
 The memory manager is just a thin layer on top of the Ring Buffer Management routines. Its basic value added is to manage the copying of data when it spills into the overflow area of the ring buffer.



\subsection{Function Documentation}
\hypertarget{BFA_8c_a1}{
\index{BFA.c@{BFA.c}!initBfa@{initBfa}}
\index{initBfa@{initBfa}!BFA.c@{BFA.c}}
\subsubsection[initBfa]{\setlength{\rightskip}{0pt plus 5cm}int init\-Bfa (\hyperlink{BFA_8c_a0}{BFA\_\-rcb} $\ast$ {\em brcb}, struct \_\-RNG\_\-rcb $\ast$ {\em rcb}, unsigned char $\ast$ {\em pool}, int {\em pool\_\-size}, int {\em max\_\-alloc\_\-size})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{BFA_8c_a1}


Initializes a BFA ring buffer control structure.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
brcb}]The BFA ring buffer control structure to initialize \item[{\em 
rcb}]The underlying ring buffer control structure \item[{\em 
pool\_\-size}]The event descriptor pool size. \item[{\em 
max\_\-alloc\_\-size}]The size, in bytes, of the maximum allocation. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
If successful, a handle to the pool, else NULL. \end{Desc}
