\hypertarget{BFC_8h}{
\section{BFC.h File Reference}
\label{BFC_8h}\index{BFC.h@{BFC.h}}
}
Balloon Flight Control, Interface. 


{\tt \#include \char`\"{}BBC/LLI.h\char`\"{}}\par
{\tt \#include \char`\"{}BFU/BFI.h\char`\"{}}\par
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct \hyperlink{struct__BFC__msg}{\_\-BFC\_\-msg}
\begin{CompactList}\small\item\em A standard BFC message.\item\end{CompactList}\item 
struct \hyperlink{struct__BFC__msgStream}{\_\-BFC\_\-msg\-Stream}
\begin{CompactList}\small\item\em Defines a BFC message stream.\item\end{CompactList}\item 
struct \hyperlink{struct__BFC__runInfo}{\_\-BFC\_\-run\-Info}
\begin{CompactList}\small\item\em The publically defined portion of the run control structure.\item\end{CompactList}\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
typedef enum \hyperlink{BFC_8h_a65}{\_\-BFC\_\-run\-State} \hyperlink{BFC_8h_a0}{BFC\_\-run\-State}
\begin{CompactList}\small\item\em Typedef for the enum \_\-BFC\_\-run\-State.\item\end{CompactList}\item 
typedef enum \hyperlink{BFC_8h_a66}{\_\-BFC\_\-status} \hyperlink{BFC_8h_a1}{BFC\_\-status}
\begin{CompactList}\small\item\em Typedef of enum \_\-BFC\_\-status.\item\end{CompactList}\item 
typedef \hyperlink{struct__BFC__runCtl}{\_\-BFC\_\-run\-Ctl} \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl}
\begin{CompactList}\small\item\em Typedef for struct \hyperlink{struct__BFC__runCtl}{\_\-BFC\_\-run\-Ctl}.\item\end{CompactList}\item 
typedef enum \hyperlink{BFC_8h_a67}{\_\-BFC\_\-quantity} \hyperlink{BFC_8h_a3}{BFC\_\-quantity}
\begin{CompactList}\small\item\em Typedef of the enum \_\-BFC\_\-quantity.\item\end{CompactList}\item 
typedef \hyperlink{struct__BFC__runInfo}{\_\-BFC\_\-run\-Info} \hyperlink{BFC_8h_a4}{BFC\_\-run\-Info}
\begin{CompactList}\small\item\em Typedef of struct \hyperlink{struct__BFC__runInfo}{\_\-BFC\_\-run\-Info}.\item\end{CompactList}\item 
typedef enum \hyperlink{BFC_8h_a68}{\_\-BFC\_\-msg\-State} \hyperlink{BFC_8h_a5}{BFC\_\-msg\-State}
\begin{CompactList}\small\item\em Typedef for the enum \_\-BFC\_\-msg\-State.\item\end{CompactList}\item 
typedef \hyperlink{struct__BFC__msgStream}{\_\-BFC\_\-msg\-Stream} \hyperlink{BFC_8h_a6}{BFC\_\-msg\-Stream}
\begin{CompactList}\small\item\em Typedef for struct \hyperlink{struct__BFC__msgStream}{\_\-BFC\_\-msg\-Stream}.\item\end{CompactList}\item 
typedef \hyperlink{struct__BFC__msg}{\_\-BFC\_\-msg} \hyperlink{BFC_8h_a7}{BFC\_\-msg}
\begin{CompactList}\small\item\em Typedef for struct \hyperlink{struct__BFC__msg}{\_\-BFC\_\-msg}.\item\end{CompactList}\item 
typedef int($\ast$ \hyperlink{BFC_8h_a8}{BFC\_\-run\-Usr\-Rtn} )(void $\ast$prm1, void $\ast$prm2)
\begin{CompactList}\small\item\em Signature for a state transition user callback routine.\item\end{CompactList}\end{CompactItemize}
\subsection*{Enumerations}
\begin{CompactItemize}
\item 
enum \hyperlink{BFC_8h_a65}{\_\-BFC\_\-run\-State} \{ \hyperlink{BFC_8h_a65a9}{BFC\_\-K\_\-STATE\_\-FAILED} =  0x00, 
\hyperlink{BFC_8h_a65a10}{BFC\_\-K\_\-STATE\_\-INITING} =  0x01, 
\hyperlink{BFC_8h_a65a11}{BFC\_\-K\_\-STATE\_\-READY} =  0x02, 
\hyperlink{BFC_8h_a65a12}{BFC\_\-K\_\-STATE\_\-STARTING} =  0x03, 
\hyperlink{BFC_8h_a65a13}{BFC\_\-K\_\-STATE\_\-STARTED} =  0x04, 
\hyperlink{BFC_8h_a65a14}{BFC\_\-K\_\-STATE\_\-PAUSING} =  0x05, 
\hyperlink{BFC_8h_a65a15}{BFC\_\-K\_\-STATE\_\-PAUSED} =  0x06, 
\hyperlink{BFC_8h_a65a16}{BFC\_\-K\_\-STATE\_\-RESUMING} =  0x07, 
\hyperlink{BFC_8h_a65a17}{BFC\_\-K\_\-STATE\_\-UNUSED} =  0x08, 
\hyperlink{BFC_8h_a65a18}{BFC\_\-K\_\-STATE\_\-STOPPING} =  0x09, 
\hyperlink{BFC_8h_a65a19}{BFC\_\-K\_\-STATE\_\-STOPPED} =  0x0a
 \}
\begin{CompactList}\small\item\em Indicates the current state of the run.\item\end{CompactList}\item 
enum \hyperlink{BFC_8h_a66}{\_\-BFC\_\-status} \{ \hyperlink{BFC_8h_a66a20}{BFC\_\-C\_\-SUCCESS} =  0, 
\hyperlink{BFC_8h_a66a21}{BFC\_\-C\_\-WRONG\_\-STATE} =  0x\-FFFF8000, 
\hyperlink{BFC_8h_a66a22}{BFC\_\-C\_\-BAD\_\-NAME} =  0x\-FFFF8020, 
\hyperlink{BFC_8h_a66a23}{BFC\_\-C\_\-MSG\_\-ERROR} =  0x\-FFFF8021
 \}
\begin{CompactList}\small\item\em Enumeration of the return status codes.\item\end{CompactList}\item 
enum \hyperlink{BFC_8h_a67}{\_\-BFC\_\-quantity} \{ \hyperlink{BFC_8h_a67a24}{BFC\_\-K\_\-QUANTITY\_\-MIN} =  0, 
\hyperlink{BFC_8h_a67a25}{BFC\_\-K\_\-QUANTITY\_\-BLIMIT} =  1, 
\hyperlink{BFC_8h_a67a26}{BFC\_\-K\_\-QUANTITY\_\-ELIMIT} =  2, 
\hyperlink{BFC_8h_a67a27}{BFC\_\-K\_\-QUANTITY\_\-TLIMIT} =  3, 
\hyperlink{BFC_8h_a67a28}{BFC\_\-K\_\-QUANTITY\_\-RUN\_\-NUMBER} =  4, 
\hyperlink{BFC_8h_a67a29}{BFC\_\-K\_\-QUANTITY\_\-MAX} =  5
 \}
\begin{CompactList}\small\item\em The names of various run control parameters/quantities.\item\end{CompactList}\item 
enum \hyperlink{BFC_8h_a68}{\_\-BFC\_\-msg\-State} \{ \hyperlink{BFC_8h_a68a30}{BFC\_\-K\_\-MSGSTATE\_\-FREE} =  0, 
\hyperlink{BFC_8h_a68a31}{BFC\_\-K\_\-MSGSTATE\_\-ALLOCATED} =  1, 
\hyperlink{BFC_8h_a68a32}{BFC\_\-K\_\-MSGSTATE\_\-SENT} =  2, 
\hyperlink{BFC_8h_a68a33}{BFC\_\-K\_\-MSGSTATE\_\-RECEIVED} =  3, 
\hyperlink{BFC_8h_a68a34}{BFC\_\-K\_\-MSGSTATE\_\-ACKNOWLEDGED} =  4, 
\hyperlink{BFC_8h_a68a35}{BFC\_\-K\_\-MSGSTATE\_\-RETURNED} =  5
 \}
\begin{CompactList}\small\item\em Enumerates the current state of the message.\item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{BFC_8h_a36}{BFC\_\-msg\-Stream\-Init} (\hyperlink{BFC_8h_a6}{BFC\_\-msg\-Stream} $\ast$mstrm, \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, int ack\-To)
\begin{CompactList}\small\item\em Initializes a message stream.\item\end{CompactList}\item 
\hyperlink{BFC_8h_a7}{BFC\_\-msg} $\ast$ \hyperlink{BFC_8h_a37}{BFC\_\-msg\-Allocate} (\hyperlink{BFC_8h_a6}{BFC\_\-msg\-Stream} $\ast$mstrm, int timeout)
\begin{CompactList}\small\item\em Allocates a command message.\item\end{CompactList}\item 
int \hyperlink{BFC_8h_a38}{BFC\_\-msg\-Que} (\hyperlink{BFC_8h_a6}{BFC\_\-msg\-Stream} $\ast$mstrm, \hyperlink{BFC_8h_a7}{BFC\_\-msg} $\ast$msg, unsigned int type, unsigned int prm)
\begin{CompactList}\small\item\em Ques a previously allocate message.\item\end{CompactList}\item 
int \hyperlink{BFC_8h_a39}{BFC\_\-msg\-Send} (\hyperlink{BFC_8h_a6}{BFC\_\-msg\-Stream} $\ast$mstrm, unsigned int type, unsigned int prm)
\begin{CompactList}\small\item\em Sends a message to the event taking task.\item\end{CompactList}\item 
\hyperlink{BFC_8h_a7}{BFC\_\-msg} $\ast$ \hyperlink{BFC_8h_a40}{BFC\_\-msg\-Receive} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc)
\begin{CompactList}\small\item\em Returns the message at the head of the send message que.\item\end{CompactList}\item 
int \hyperlink{BFC_8h_a41}{BFC\_\-msg\-Acknowledge} (\hyperlink{BFC_8h_a7}{BFC\_\-msg} $\ast$msg, int status)
\begin{CompactList}\small\item\em Acknowledges the receipt of the specified message.\item\end{CompactList}\item 
int \hyperlink{BFC_8h_a42}{BFC\_\-configure} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, unsigned int elimit, unsigned int tlimit, unsigned int blimit)
\begin{CompactList}\small\item\em Convenience routine to set up some of the initial parameters.\item\end{CompactList}\item 
\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ \hyperlink{BFC_8h_a43}{BFC\_\-get} (void)
\begin{CompactList}\small\item\em Return a handle to the run control structure.\item\end{CompactList}\item 
int \hyperlink{BFC_8h_a44}{BFC\_\-init} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, \hyperlink{BFI_8h_a11}{BFI\_\-group} group, unsigned int rto\_\-signal, unsigned int msg\_\-signal, int nmsgs, int msg\-Size)
\begin{CompactList}\small\item\em Initializes a previously allocated BFC run control structure.\item\end{CompactList}\item 
int \hyperlink{BFC_8h_a45}{BFC\_\-quantity\-Set} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, \hyperlink{BFC_8h_a3}{BFC\_\-quantity} name, unsigned int value)
\begin{CompactList}\small\item\em Sets one of the run control quantities.\item\end{CompactList}\item 
int \hyperlink{BFC_8h_a46}{BFC\_\-blimit\-Set} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, unsigned int nbytes)
\begin{CompactList}\small\item\em Sets the byte limit for the run duration.\item\end{CompactList}\item 
int \hyperlink{BFC_8h_a47}{BFC\_\-elimit\-Set} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, unsigned int nevts)
\begin{CompactList}\small\item\em Sets the event limit for the run duration.\item\end{CompactList}\item 
int \hyperlink{BFC_8h_a48}{BFC\_\-tlimit\-Set} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, unsigned int msecs)
\begin{CompactList}\small\item\em Sets the time limit for the run duration.\item\end{CompactList}\item 
int \hyperlink{BFC_8h_a49}{BFC\_\-max\-Blimit\-Set} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, unsigned int nbytes)
\begin{CompactList}\small\item\em Sets the max byte limit for files.\item\end{CompactList}\item 
int \hyperlink{BFC_8h_a50}{BFC\_\-run\-Number\-Set} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, unsigned int run\-Number)
\begin{CompactList}\small\item\em Assigns the number to be to designate the next run.\item\end{CompactList}\item 
int \hyperlink{BFC_8h_a51}{BFC\_\-run\-Update} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, unsigned int nevts, unsigned int nbytes)
\begin{CompactList}\small\item\em Updates the number of bytes of data taken during this run.\item\end{CompactList}\item 
int \hyperlink{BFC_8h_a52}{BFC\_\-run\-Start} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, \hyperlink{BFC_8h_a8}{BFC\_\-run\-Usr\-Rtn} usr, void $\ast$prm1, void $\ast$prm2)
\begin{CompactList}\small\item\em Starts a run.\item\end{CompactList}\item 
int \hyperlink{BFC_8h_a53}{BFC\_\-run\-Pause} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, \hyperlink{BFC_8h_a8}{BFC\_\-run\-Usr\-Rtn} usr, void $\ast$prm1, void $\ast$prm2)
\begin{CompactList}\small\item\em Pause a run.\item\end{CompactList}\item 
int \hyperlink{BFC_8h_a54}{BFC\_\-run\-Resume} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, \hyperlink{BFC_8h_a8}{BFC\_\-run\-Usr\-Rtn} usr, void $\ast$prm1, void $\ast$prm2)
\begin{CompactList}\small\item\em Pause a run.\item\end{CompactList}\item 
int \hyperlink{BFC_8h_a55}{BFC\_\-run\-Stop} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, \hyperlink{BFC_8h_a8}{BFC\_\-run\-Usr\-Rtn} usr, void $\ast$prm1, void $\ast$prm2)
\begin{CompactList}\small\item\em Stops a run.\item\end{CompactList}\item 
\hyperlink{BFC_8h_a0}{BFC\_\-run\-State} \hyperlink{BFC_8h_a56}{BFC\_\-run\-State\-Get} (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc)
\begin{CompactList}\small\item\em Returns the current run state.\item\end{CompactList}\item 
int \hyperlink{BFC_8h_a57}{BFC\_\-run\-Is\-Active} (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc)
\begin{CompactList}\small\item\em Indicates whether the specified run state occurs while a run is active.\item\end{CompactList}\item 
const \hyperlink{BFC_8h_a4}{BFC\_\-run\-Info} $\ast$ \hyperlink{BFC_8h_a58}{BFC\_\-run\-Info\-Get} (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc)
\item 
int \hyperlink{BFC_8h_a59}{BFC\_\-tlimit\-Get} (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc)
\begin{CompactList}\small\item\em Returns the run time limit in ticks.\item\end{CompactList}\item 
int \hyperlink{BFC_8h_a60}{BFC\_\-time\-Left\-Get} (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc)
\begin{CompactList}\small\item\em Returns the time left in the current run.\item\end{CompactList}\item 
int \hyperlink{BFC_8h_a61}{BFC\_\-nbytes\-Left\-Get} (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc)
\begin{CompactList}\small\item\em Returns the number of bytes to be accumulated before the current run is finished.\item\end{CompactList}\item 
int \hyperlink{BFC_8h_a62}{BFC\_\-nevts\-Left\-Get} (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc)
\begin{CompactList}\small\item\em Returns the number of events to be accumulated before the current run is finished.\item\end{CompactList}\item 
int \hyperlink{BFC_8h_a63}{BFC\_\-max\-Blimit\-Get} (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc)
\begin{CompactList}\small\item\em Returns the max number of bytes one can ever write.\item\end{CompactList}\item 
unsigned int \hyperlink{BFC_8h_a64}{BFC\_\-run\-Number\-Get} (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc)
\begin{CompactList}\small\item\em Returns the current run state.\item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Balloon Flight Control, Interface.



\begin{Desc}
\item[Author: ]\par
JJRussell - \href{mailto:russell@slac.stanford.edu}{\tt russell@slac.stanford.edu}\end{Desc}
This defines what is commonly thought of as run control for the Balloon Flight.



\subsection{Typedef Documentation}
\hypertarget{BFC_8h_a7}{
\index{BFC.h@{BFC.h}!BFC_msg@{BFC\_\-msg}}
\index{BFC_msg@{BFC\_\-msg}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-msg]{\setlength{\rightskip}{0pt plus 5cm}BFC\_\-msg}}
\label{BFC_8h_a7}


Typedef for struct \hyperlink{struct__BFC__msg}{\_\-BFC\_\-msg}.



 While this is not strictly part of run control, it is used almost exclusively to when sending a run control message between a command interpreter and the command action routine. See \hyperlink{BFC_8h_a37}{BFC\_\-msg\-Allocate}(), VFC\_\-msg\-Que(), \hyperlink{BFC_8h_a40}{BFC\_\-msg\-Receive}(), BFC\_\-msg\-Send (). \hypertarget{BFC_8h_a5}{
\index{BFC.h@{BFC.h}!BFC_msgState@{BFC\_\-msgState}}
\index{BFC_msgState@{BFC\_\-msgState}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-msgState]{\setlength{\rightskip}{0pt plus 5cm}BFC\_\-msg\-State}}
\label{BFC_8h_a5}


Typedef for the enum \_\-BFC\_\-msg\-State.



 A message can be in one of a number of states. This is meant primarily as a debugging aid, but could prove useful to recover timed out messages.

The normal lifecycle of a message is \par
 FREE - It is on the free list \par
 ALLOCATED - It has been allocated and is being composed \par
 SENT - It is now composed and being sent \par
 RECEIVED - It has been received a the destination \par
 ACKNOWLEDGED - It has been acted upon and is being returned \par
 RETURNED - It has been returned.

The routines responsiblbe for these state transitions are \par
 FREE =$>$ ALLOCATED \hyperlink{BFC_8h_a37}{BFC\_\-msg\-Allocate}() \par
 ALLOCATED =$>$ SENT \hyperlink{BFC_8h_a39}{BFC\_\-msg\-Send}(), \hyperlink{BFC_8h_a38}{BFC\_\-msg\-Que}() \par
 SENT =$>$ RECEIVED \hyperlink{BFC_8h_a40}{BFC\_\-msg\-Receive}() \par
 RECEIVED =$>$ ACKNOWLEDGED \hyperlink{BFC_8h_a41}{BFC\_\-msg\-Acknowledge}() \par
 ACKNOWLEDGED =$>$ RETURNED \hyperlink{BFC_8h_a39}{BFC\_\-msg\-Send}(), \hyperlink{BFC_8h_a38}{BFC\_\-msg\-Que}() (completion) \par
 RETURNED =$>$ FREE \hyperlink{BFC_8h_a39}{BFC\_\-msg\-Send}(), \hyperlink{BFC_8h_a38}{BFC\_\-msg\-Que}() (completion) \par


Because of the synchronous nature of some the protocal, some of these state transitions can only be seen during the execution of the BFC\_\-msg routines. For example, when a message is returned, it goes from ACKNOWLEDGED =$>$ RETURNED =$>$ FREE within \hyperlink{BFC_8h_a39}{BFC\_\-msg\-Send}() or \hyperlink{BFC_8h_a38}{BFC\_\-msg\-Que}(). \hypertarget{BFC_8h_a6}{
\index{BFC.h@{BFC.h}!BFC_msgStream@{BFC\_\-msgStream}}
\index{BFC_msgStream@{BFC\_\-msgStream}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-msgStream]{\setlength{\rightskip}{0pt plus 5cm}BFC\_\-msg\-Stream}}
\label{BFC_8h_a6}


Typedef for struct \hyperlink{struct__BFC__msgStream}{\_\-BFC\_\-msg\-Stream}.



 A BFC message stream is used to establish a full duplex communication path between a sender and a receiver. The receiver in this case is the application which fields run control requests. The sender is any application which wishes to send a run control request. Since the exchange of information is deemed to be synchronous, a application must send a request to the command handler. The sender then is blocked until the this request has been handled. After handling the request, the command handler returns the original message to the sender along with the completion status of the command. This unblocks the sender.

The message stuff is strictly not part of the Run Control, but finds its must usage there. This stuff should really be split off to its own facility, but there is no time at this point. \hypertarget{BFC_8h_a3}{
\index{BFC.h@{BFC.h}!BFC_quantity@{BFC\_\-quantity}}
\index{BFC_quantity@{BFC\_\-quantity}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-quantity]{\setlength{\rightskip}{0pt plus 5cm}BFC\_\-quantity}}
\label{BFC_8h_a3}


Typedef of the enum \_\-BFC\_\-quantity.



 This enumeration is used to specify which quantity is being set when using the generic \hyperlink{BFC_8h_a45}{BFC\_\-quantity\-Set}() routine. \hypertarget{BFC_8h_a2}{
\index{BFC.h@{BFC.h}!BFC_runCtl@{BFC\_\-runCtl}}
\index{BFC_runCtl@{BFC\_\-runCtl}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-runCtl]{\setlength{\rightskip}{0pt plus 5cm}BFC\_\-run\-Ctl}}
\label{BFC_8h_a2}


Typedef for struct \hyperlink{struct__BFC__runCtl}{\_\-BFC\_\-run\-Ctl}.



 This contains all the information, both dynamic and static needed to control a run. It includes state information and the control structures needed to pass requests and acknowledgements between processes.

Access to this structure is strictly controlled via a call interface, although one of the calls allows direct readout only access to the state information. \hypertarget{BFC_8h_a4}{
\index{BFC.h@{BFC.h}!BFC_runInfo@{BFC\_\-runInfo}}
\index{BFC_runInfo@{BFC\_\-runInfo}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-runInfo]{\setlength{\rightskip}{0pt plus 5cm}BFC\_\-run\-Info}}
\label{BFC_8h_a4}


Typedef of struct \hyperlink{struct__BFC__runInfo}{\_\-BFC\_\-run\-Info}.



 Readonly access to this structure is obtained using \hyperlink{BFC_8h_a58}{BFC\_\-run\-Info\-Get}(). The caller is then allowed to examine the current state of the run control parameters, but not set them. Setting them requires going through one of the more formal interfaces, such as \hyperlink{BFC_8h_a46}{BFC\_\-blimit\-Set}() or the generic \hyperlink{BFC_8h_a45}{BFC\_\-quantity\-Set}(). Given that these are dynamic quantities, the caller is encouraged to use them wisely and to understand the conditions and environment to determine viability. \hypertarget{BFC_8h_a0}{
\index{BFC.h@{BFC.h}!BFC_runState@{BFC\_\-runState}}
\index{BFC_runState@{BFC\_\-runState}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-runState]{\setlength{\rightskip}{0pt plus 5cm}BFC\_\-run\-State}}
\label{BFC_8h_a0}


Typedef for the enum \_\-BFC\_\-run\-State.



 This enumerates the state of the run. The group breaks into two distinct classes, resting states and transitory states. One normally finds the run in one of the resting states, either STARTED, PAUSED or STOPPED. The transitory states capture the transition of one state to the next. This is useful because it may take a finite amount to time to make the transition. Until the transition is complete, the meaning of some variables may be undefined. \hypertarget{BFC_8h_a8}{
\index{BFC.h@{BFC.h}!BFC_runUsrRtn@{BFC\_\-runUsrRtn}}
\index{BFC_runUsrRtn@{BFC\_\-runUsrRtn}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-runUsrRtn]{\setlength{\rightskip}{0pt plus 5cm}BFC\_\-run\-Usr\-Rtn}}
\label{BFC_8h_a8}


Signature for a state transition user callback routine.



 A user start transition callback routine is activitated when one of the run control routines, \hyperlink{BFC_8h_a52}{BFC\_\-run\-Start}(), \hyperlink{BFC_8h_a53}{BFC\_\-run\-Pause}(), \hyperlink{BFC_8h_a54}{BFC\_\-run\-Resume}() or \hyperlink{BFC_8h_a55}{BFC\_\-run\-Stop}() is called. This allows these routines to perform a set of integrity checks to determine if the transition is permitted, call an action routine to perform user specific actions associated with the transition, then complete the transition upon success. \hypertarget{BFC_8h_a1}{
\index{BFC.h@{BFC.h}!BFC_status@{BFC\_\-status}}
\index{BFC_status@{BFC\_\-status}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-status]{\setlength{\rightskip}{0pt plus 5cm}BFC\_\-status}}
\label{BFC_8h_a1}


Typedef of enum \_\-BFC\_\-status.



 A modest attempt at providing semi-unique status codes for BFC. 

\subsection{Enumeration Type Documentation}
\hypertarget{BFC_8h_a68}{
\index{BFC.h@{BFC.h}!_BFC_msgState@{\_\-BFC\_\-msgState}}
\index{_BFC_msgState@{\_\-BFC\_\-msgState}!BFC.h@{BFC.h}}
\subsubsection[\_\-BFC\_\-msgState]{\setlength{\rightskip}{0pt plus 5cm}enum \_\-BFC\_\-msg\-State}}
\label{BFC_8h_a68}


Enumerates the current state of the message.

\begin{Desc}
\item[Enumeration values:]\par
\begin{description}
\index{BFC_K_MSGSTATE_FREE@{BFC\_\-K\_\-MSGSTATE\_\-FREE}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_K_MSGSTATE_FREE@{BFC\_\-K\_\-MSGSTATE\_\-FREE}}\item[{\em 
\hypertarget{BFC_8h_a68a30}{
{\em BFC\_\-K\_\-MSGSTATE\_\-FREE}}
\label{BFC_8h_a68a30}
}]Message is on the free list \index{BFC_K_MSGSTATE_ALLOCATED@{BFC\_\-K\_\-MSGSTATE\_\-ALLOCATED}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_K_MSGSTATE_ALLOCATED@{BFC\_\-K\_\-MSGSTATE\_\-ALLOCATED}}\item[{\em 
\hypertarget{BFC_8h_a68a31}{
{\em BFC\_\-K\_\-MSGSTATE\_\-ALLOCATED}}
\label{BFC_8h_a68a31}
}]Message has been allocated \index{BFC_K_MSGSTATE_SENT@{BFC\_\-K\_\-MSGSTATE\_\-SENT}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_K_MSGSTATE_SENT@{BFC\_\-K\_\-MSGSTATE\_\-SENT}}\item[{\em 
\hypertarget{BFC_8h_a68a32}{
{\em BFC\_\-K\_\-MSGSTATE\_\-SENT}}
\label{BFC_8h_a68a32}
}]Message has been sent \index{BFC_K_MSGSTATE_RECEIVED@{BFC\_\-K\_\-MSGSTATE\_\-RECEIVED}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_K_MSGSTATE_RECEIVED@{BFC\_\-K\_\-MSGSTATE\_\-RECEIVED}}\item[{\em 
\hypertarget{BFC_8h_a68a33}{
{\em BFC\_\-K\_\-MSGSTATE\_\-RECEIVED}}
\label{BFC_8h_a68a33}
}]Message has been received \index{BFC_K_MSGSTATE_ACKNOWLEDGED@{BFC\_\-K\_\-MSGSTATE\_\-ACKNOWLEDGED}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_K_MSGSTATE_ACKNOWLEDGED@{BFC\_\-K\_\-MSGSTATE\_\-ACKNOWLEDGED}}\item[{\em 
\hypertarget{BFC_8h_a68a34}{
{\em BFC\_\-K\_\-MSGSTATE\_\-ACKNOWLEDGED}}
\label{BFC_8h_a68a34}
}]Message has been acknowledged \index{BFC_K_MSGSTATE_RETURNED@{BFC\_\-K\_\-MSGSTATE\_\-RETURNED}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_K_MSGSTATE_RETURNED@{BFC\_\-K\_\-MSGSTATE\_\-RETURNED}}\item[{\em 
\hypertarget{BFC_8h_a68a35}{
{\em BFC\_\-K\_\-MSGSTATE\_\-RETURNED}}
\label{BFC_8h_a68a35}
}]Message has been returned \end{description}
\end{Desc}

\hypertarget{BFC_8h_a67}{
\index{BFC.h@{BFC.h}!_BFC_quantity@{\_\-BFC\_\-quantity}}
\index{_BFC_quantity@{\_\-BFC\_\-quantity}!BFC.h@{BFC.h}}
\subsubsection[\_\-BFC\_\-quantity]{\setlength{\rightskip}{0pt plus 5cm}enum \_\-BFC\_\-quantity}}
\label{BFC_8h_a67}


The names of various run control parameters/quantities.

\begin{Desc}
\item[Enumeration values:]\par
\begin{description}
\index{BFC_K_QUANTITY_MIN@{BFC\_\-K\_\-QUANTITY\_\-MIN}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_K_QUANTITY_MIN@{BFC\_\-K\_\-QUANTITY\_\-MIN}}\item[{\em 
\hypertarget{BFC_8h_a67a24}{
{\em BFC\_\-K\_\-QUANTITY\_\-MIN}}
\label{BFC_8h_a67a24}
}]Anything LE this is invalid \index{BFC_K_QUANTITY_BLIMIT@{BFC\_\-K\_\-QUANTITY\_\-BLIMIT}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_K_QUANTITY_BLIMIT@{BFC\_\-K\_\-QUANTITY\_\-BLIMIT}}\item[{\em 
\hypertarget{BFC_8h_a67a25}{
{\em BFC\_\-K\_\-QUANTITY\_\-BLIMIT}}
\label{BFC_8h_a67a25}
}]Byte limit \index{BFC_K_QUANTITY_ELIMIT@{BFC\_\-K\_\-QUANTITY\_\-ELIMIT}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_K_QUANTITY_ELIMIT@{BFC\_\-K\_\-QUANTITY\_\-ELIMIT}}\item[{\em 
\hypertarget{BFC_8h_a67a26}{
{\em BFC\_\-K\_\-QUANTITY\_\-ELIMIT}}
\label{BFC_8h_a67a26}
}]Event limit \index{BFC_K_QUANTITY_TLIMIT@{BFC\_\-K\_\-QUANTITY\_\-TLIMIT}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_K_QUANTITY_TLIMIT@{BFC\_\-K\_\-QUANTITY\_\-TLIMIT}}\item[{\em 
\hypertarget{BFC_8h_a67a27}{
{\em BFC\_\-K\_\-QUANTITY\_\-TLIMIT}}
\label{BFC_8h_a67a27}
}]Time limit \index{BFC_K_QUANTITY_RUN_NUMBER@{BFC\_\-K\_\-QUANTITY\_\-RUN\_\-NUMBER}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_K_QUANTITY_RUN_NUMBER@{BFC\_\-K\_\-QUANTITY\_\-RUN\_\-NUMBER}}\item[{\em 
\hypertarget{BFC_8h_a67a28}{
{\em BFC\_\-K\_\-QUANTITY\_\-RUN\_\-NUMBER}}
\label{BFC_8h_a67a28}
}]Run number \index{BFC_K_QUANTITY_MAX@{BFC\_\-K\_\-QUANTITY\_\-MAX}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_K_QUANTITY_MAX@{BFC\_\-K\_\-QUANTITY\_\-MAX}}\item[{\em 
\hypertarget{BFC_8h_a67a29}{
{\em BFC\_\-K\_\-QUANTITY\_\-MAX}}
\label{BFC_8h_a67a29}
}]Anything GE this is invalid \end{description}
\end{Desc}

\hypertarget{BFC_8h_a65}{
\index{BFC.h@{BFC.h}!_BFC_runState@{\_\-BFC\_\-runState}}
\index{_BFC_runState@{\_\-BFC\_\-runState}!BFC.h@{BFC.h}}
\subsubsection[\_\-BFC\_\-runState]{\setlength{\rightskip}{0pt plus 5cm}enum \_\-BFC\_\-run\-State}}
\label{BFC_8h_a65}


Indicates the current state of the run.

\begin{Desc}
\item[Enumeration values:]\par
\begin{description}
\index{BFC_K_STATE_FAILED@{BFC\_\-K\_\-STATE\_\-FAILED}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_K_STATE_FAILED@{BFC\_\-K\_\-STATE\_\-FAILED}}\item[{\em 
\hypertarget{BFC_8h_a65a9}{
{\em BFC\_\-K\_\-STATE\_\-FAILED}}
\label{BFC_8h_a65a9}
}]Initialization failed \index{BFC_K_STATE_INITING@{BFC\_\-K\_\-STATE\_\-INITING}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_K_STATE_INITING@{BFC\_\-K\_\-STATE\_\-INITING}}\item[{\em 
\hypertarget{BFC_8h_a65a10}{
{\em BFC\_\-K\_\-STATE\_\-INITING}}
\label{BFC_8h_a65a10}
}]Run state is being initialized \index{BFC_K_STATE_READY@{BFC\_\-K\_\-STATE\_\-READY}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_K_STATE_READY@{BFC\_\-K\_\-STATE\_\-READY}}\item[{\em 
\hypertarget{BFC_8h_a65a11}{
{\em BFC\_\-K\_\-STATE\_\-READY}}
\label{BFC_8h_a65a11}
}]Ready to run \index{BFC_K_STATE_STARTING@{BFC\_\-K\_\-STATE\_\-STARTING}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_K_STATE_STARTING@{BFC\_\-K\_\-STATE\_\-STARTING}}\item[{\em 
\hypertarget{BFC_8h_a65a12}{
{\em BFC\_\-K\_\-STATE\_\-STARTING}}
\label{BFC_8h_a65a12}
}]Run is being started \index{BFC_K_STATE_STARTED@{BFC\_\-K\_\-STATE\_\-STARTED}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_K_STATE_STARTED@{BFC\_\-K\_\-STATE\_\-STARTED}}\item[{\em 
\hypertarget{BFC_8h_a65a13}{
{\em BFC\_\-K\_\-STATE\_\-STARTED}}
\label{BFC_8h_a65a13}
}]Running \index{BFC_K_STATE_PAUSING@{BFC\_\-K\_\-STATE\_\-PAUSING}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_K_STATE_PAUSING@{BFC\_\-K\_\-STATE\_\-PAUSING}}\item[{\em 
\hypertarget{BFC_8h_a65a14}{
{\em BFC\_\-K\_\-STATE\_\-PAUSING}}
\label{BFC_8h_a65a14}
}]Run is being paused \index{BFC_K_STATE_PAUSED@{BFC\_\-K\_\-STATE\_\-PAUSED}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_K_STATE_PAUSED@{BFC\_\-K\_\-STATE\_\-PAUSED}}\item[{\em 
\hypertarget{BFC_8h_a65a15}{
{\em BFC\_\-K\_\-STATE\_\-PAUSED}}
\label{BFC_8h_a65a15}
}]Paused, basically run in progress, but triggers temporarily disabled \index{BFC_K_STATE_RESUMING@{BFC\_\-K\_\-STATE\_\-RESUMING}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_K_STATE_RESUMING@{BFC\_\-K\_\-STATE\_\-RESUMING}}\item[{\em 
\hypertarget{BFC_8h_a65a16}{
{\em BFC\_\-K\_\-STATE\_\-RESUMING}}
\label{BFC_8h_a65a16}
}]Run is being resumed \index{BFC_K_STATE_UNUSED@{BFC\_\-K\_\-STATE\_\-UNUSED}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_K_STATE_UNUSED@{BFC\_\-K\_\-STATE\_\-UNUSED}}\item[{\em 
\hypertarget{BFC_8h_a65a17}{
{\em BFC\_\-K\_\-STATE\_\-UNUSED}}
\label{BFC_8h_a65a17}
}]Not used (resumed == STARTED) \index{BFC_K_STATE_STOPPING@{BFC\_\-K\_\-STATE\_\-STOPPING}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_K_STATE_STOPPING@{BFC\_\-K\_\-STATE\_\-STOPPING}}\item[{\em 
\hypertarget{BFC_8h_a65a18}{
{\em BFC\_\-K\_\-STATE\_\-STOPPING}}
\label{BFC_8h_a65a18}
}]Run is being stopped \index{BFC_K_STATE_STOPPED@{BFC\_\-K\_\-STATE\_\-STOPPED}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_K_STATE_STOPPED@{BFC\_\-K\_\-STATE\_\-STOPPED}}\item[{\em 
\hypertarget{BFC_8h_a65a19}{
{\em BFC\_\-K\_\-STATE\_\-STOPPED}}
\label{BFC_8h_a65a19}
}]Run is stopped \end{description}
\end{Desc}

\hypertarget{BFC_8h_a66}{
\index{BFC.h@{BFC.h}!_BFC_status@{\_\-BFC\_\-status}}
\index{_BFC_status@{\_\-BFC\_\-status}!BFC.h@{BFC.h}}
\subsubsection[\_\-BFC\_\-status]{\setlength{\rightskip}{0pt plus 5cm}enum \_\-BFC\_\-status}}
\label{BFC_8h_a66}


Enumeration of the return status codes.

\begin{Desc}
\item[Enumeration values:]\par
\begin{description}
\index{BFC_C_SUCCESS@{BFC\_\-C\_\-SUCCESS}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_C_SUCCESS@{BFC\_\-C\_\-SUCCESS}}\item[{\em 
\hypertarget{BFC_8h_a66a20}{
{\em BFC\_\-C\_\-SUCCESS}}
\label{BFC_8h_a66a20}
}]Call was successful \index{BFC_C_WRONG_STATE@{BFC\_\-C\_\-WRONG\_\-STATE}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_C_WRONG_STATE@{BFC\_\-C\_\-WRONG\_\-STATE}}\item[{\em 
\hypertarget{BFC_8h_a66a21}{
{\em BFC\_\-C\_\-WRONG\_\-STATE}}
\label{BFC_8h_a66a21}
}]System was in the wrong state low 4 bits give the state \index{BFC_C_BAD_NAME@{BFC\_\-C\_\-BAD\_\-NAME}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_C_BAD_NAME@{BFC\_\-C\_\-BAD\_\-NAME}}\item[{\em 
\hypertarget{BFC_8h_a66a22}{
{\em BFC\_\-C\_\-BAD\_\-NAME}}
\label{BFC_8h_a66a22}
}]Bad name,quantity set/get routines \index{BFC_C_MSG_ERROR@{BFC\_\-C\_\-MSG\_\-ERROR}!BFC.h@{BFC.h}}\index{BFC.h@{BFC.h}!BFC_C_MSG_ERROR@{BFC\_\-C\_\-MSG\_\-ERROR}}\item[{\em 
\hypertarget{BFC_8h_a66a23}{
{\em BFC\_\-C\_\-MSG\_\-ERROR}}
\label{BFC_8h_a66a23}
}]Error in sending a message \end{description}
\end{Desc}



\subsection{Function Documentation}
\hypertarget{BFC_8h_a46}{
\index{BFC.h@{BFC.h}!BFC_blimitSet@{BFC\_\-blimitSet}}
\index{BFC_blimitSet@{BFC\_\-blimitSet}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-blimitSet]{\setlength{\rightskip}{0pt plus 5cm}int BFC\_\-blimit\-Set (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ {\em rc}, unsigned int {\em nbytes})}}
\label{BFC_8h_a46}


Sets the byte limit for the run duration.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
rc}]The run control structure. \item[{\em 
nbytes}]The byte limit. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
0, if}]successful \item[{\em 
BFC\_\-C\_\-WRONG\_\-STATE, if}]run is in the incorrect state. The low nibble gives the state it is in.\end{description}
\end{Desc}
The byte limit can only be set when a run is not in progress. Attempts to set the time limit when the run is in progress will be rejected. The run will be automatically ended when the byte limit is exceeded. Given that data is written to disk in units of complete events, one should not expect that precisely this number of bytes will be written. The run will be ended as soon as this threshold is crossed.

If this number is specified as 0, then no byte limit will be imposed. This number is ultimately limited by the 'max\_\-blimit'. This is limiting is not down until a run is actually started. This preserves the set value for as long as possible. This is somewhat of a kludge. The right way to handle this sort of problem is to have a {\em current} limit and an {\em active} limit. The current limit is only set be this routine. The active limit is meaningful only when a run is in progress and would be the minimum of the current and maximum. \hypertarget{BFC_8h_a42}{
\index{BFC.h@{BFC.h}!BFC_configure@{BFC\_\-configure}}
\index{BFC_configure@{BFC\_\-configure}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-configure]{\setlength{\rightskip}{0pt plus 5cm}int BFC\_\-configure (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ {\em rc}, unsigned int {\em elimit}, unsigned int {\em tlimit}, unsigned int {\em blimit})}}
\label{BFC_8h_a42}


Convenience routine to set up some of the initial parameters.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
rc}]The run control structure.  \item[{\em 
elimit}]The run duration, in number of events, May be specified as 0, in which case there is no time limit on the run. \item[{\em 
tlimit}]The run duration, in milliseconds. May be specified as 0, in which case there is no time limit on the run. \item[{\em 
blimit}]The run duration, in bytes. May be specified as as 0, in which case there is no byte limit on the run.\end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
-1, if}]unsuccessful. \item[{\em 
0, if}]successful.\end{description}
\end{Desc}
This is merely a convenience routine to set parameters which are relatively stable. These values can all be set via other means. This routine can only be called when a run is not in progress.

The byte limit parameter is used to set both the current limit and the maximum limit. If the user wishes to set the limit for the current run, \hyperlink{BFC_8h_a46}{BFC\_\-blimit\-Set}() should be called. \hypertarget{BFC_8h_a47}{
\index{BFC.h@{BFC.h}!BFC_elimitSet@{BFC\_\-elimitSet}}
\index{BFC_elimitSet@{BFC\_\-elimitSet}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-elimitSet]{\setlength{\rightskip}{0pt plus 5cm}int BFC\_\-elimit\-Set (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ {\em rc}, unsigned int {\em nevts})}}
\label{BFC_8h_a47}


Sets the event limit for the run duration.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
rc}]The run control structure. \item[{\em 
nevts}]The event limit. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
0, if}]successful \item[{\em 
BFC\_\-C\_\-WRONG\_\-STATE, if}]run is in the incorrect state. The low nibble gives the state it is in.\end{description}
\end{Desc}
The event limit can only be set when a run is not in progress. Attempts to set the event limit when the run is in progress will be rejected. The run will be automatically ended when the event limit is exceeded. Given that triggers cannot not be stopped precisely, one should not expect that precisely this number of bytes will be written. The run will be ended as soon as this threshold is crossed.

If this number is specified as 0, then no event limit will be imposed. \hypertarget{BFC_8h_a43}{
\index{BFC.h@{BFC.h}!BFC_get@{BFC\_\-get}}
\index{BFC_get@{BFC\_\-get}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-get]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ BFC\_\-get (void)}}
\label{BFC_8h_a43}


Return a handle to the run control structure.

\begin{Desc}
\item[Returns: ]\par
A handle to the run control structure.\end{Desc}
This routine only returns a handle to the run control structure. It does not initialize or muck with it in anyway. \hypertarget{BFC_8h_a44}{
\index{BFC.h@{BFC.h}!BFC_init@{BFC\_\-init}}
\index{BFC_init@{BFC\_\-init}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-init]{\setlength{\rightskip}{0pt plus 5cm}int BFC\_\-init (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ {\em rc}, \hyperlink{BFI_8h_a11}{BFI\_\-group} {\em group}, unsigned int {\em rto\_\-signal}, unsigned int {\em msg\_\-signal}, int {\em nmsgs}, int {\em msg\-Size})}}
\label{BFC_8h_a44}


Initializes a previously allocated BFC run control structure.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
rc}]The run control structure to initialize. \item[{\em 
group}]The BFI synchronization group to be notified for changes in state. \item[{\em 
rto\_\-signal}]The software {\em signals} to use when requesting stop run. \item[{\em 
msg\_\-signal}]The software {\em signals} to use when sending a message.  \item[{\em 
nmsgs}]The number of messages to be used to buffer requests. \item[{\em 
msg\-Size}]The size, in bytes, of a single message. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
-1, if}]failed to initialize \item[{\em 
0, if}]successful \end{description}
\end{Desc}
\hypertarget{BFC_8h_a63}{
\index{BFC.h@{BFC.h}!BFC_maxBlimitGet@{BFC\_\-maxBlimitGet}}
\index{BFC_maxBlimitGet@{BFC\_\-maxBlimitGet}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-maxBlimitGet]{\setlength{\rightskip}{0pt plus 5cm}int BFC\_\-max\-Blimit\-Get (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ {\em rc})}}
\label{BFC_8h_a63}


Returns the max number of bytes one can ever write.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
rc}]The run control structure. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
The}]run time limit in ticks. \end{description}
\end{Desc}
\hypertarget{BFC_8h_a49}{
\index{BFC.h@{BFC.h}!BFC_maxBlimitSet@{BFC\_\-maxBlimitSet}}
\index{BFC_maxBlimitSet@{BFC\_\-maxBlimitSet}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-maxBlimitSet]{\setlength{\rightskip}{0pt plus 5cm}int BFC\_\-max\-Blimit\-Set (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ {\em rc}, unsigned int {\em nbytes})}}
\label{BFC_8h_a49}


Sets the max byte limit for files.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
rc}]The run control structure. \item[{\em 
nbytes}]The byte limit. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
0, if}]successful\end{description}
\end{Desc}
This number can be set anytime, but only takes effect when the next run begins. See also \hyperlink{BFC_8h_a49}{BFC\_\-max\-Blimit\-Set}()

If this number is specified as 0, there is no maximum in effect. \hypertarget{BFC_8h_a41}{
\index{BFC.h@{BFC.h}!BFC_msgAcknowledge@{BFC\_\-msgAcknowledge}}
\index{BFC_msgAcknowledge@{BFC\_\-msgAcknowledge}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-msgAcknowledge]{\setlength{\rightskip}{0pt plus 5cm}int BFC\_\-msg\-Acknowledge (\hyperlink{BFC_8h_a7}{BFC\_\-msg} $\ast$ {\em msg}, int {\em status})}}
\label{BFC_8h_a41}


Acknowledges the receipt of the specified message.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
msg}]The message to acknowledge. \item[{\em 
status}]The disposition status of the message\end{description}
\end{Desc}
The specified message is acknowledged as being received and acted upon. The caller is able to specify the disposition status of the message. This routine also returns the message to the free pool. The natural consequence of this is that the user may no longer reference the the message. \hypertarget{BFC_8h_a37}{
\index{BFC.h@{BFC.h}!BFC_msgAllocate@{BFC\_\-msgAllocate}}
\index{BFC_msgAllocate@{BFC\_\-msgAllocate}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-msgAllocate]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{BFC_8h_a7}{BFC\_\-msg} $\ast$ BFC\_\-msg\-Allocate (\hyperlink{BFC_8h_a6}{BFC\_\-msg\-Stream} $\ast$ {\em mstrm}, int {\em timeout})}}
\label{BFC_8h_a37}


Allocates a command message.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
mstrm}]The message stream to allocate the message from \item[{\em 
timeout}]How long to wait. (-1 =$>$ wait forever). \end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
The allocate message \end{Desc}
\hypertarget{BFC_8h_a38}{
\index{BFC.h@{BFC.h}!BFC_msgQue@{BFC\_\-msgQue}}
\index{BFC_msgQue@{BFC\_\-msgQue}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-msgQue]{\setlength{\rightskip}{0pt plus 5cm}int BFC\_\-msg\-Que (\hyperlink{BFC_8h_a6}{BFC\_\-msg\-Stream} $\ast$ {\em mstrm}, \hyperlink{BFC_8h_a7}{BFC\_\-msg} $\ast$ {\em msg}, unsigned int {\em type}, unsigned int {\em prm})}}
\label{BFC_8h_a38}


Ques a previously allocate message.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
mstrm}]The message stream to que the message to. \item[{\em 
msg}]The message to que. \item[{\em 
type}]The message type. \item[{\em 
prm}]An arbitrary parameter to pass along with the message. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
BFC\_\-C\_\-WRONG\_\-STATE, if}]run is in the incorrect state. The low nibble gives the state it is in. \item[{\em 
BFC\_\-C\_\-MSG\_\-ERROR, if}]unsuccessful, protocol error. \item[{\em 
0, if}]successful \end{description}
\end{Desc}
\hypertarget{BFC_8h_a40}{
\index{BFC.h@{BFC.h}!BFC_msgReceive@{BFC\_\-msgReceive}}
\index{BFC_msgReceive@{BFC\_\-msgReceive}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-msgReceive]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{BFC_8h_a7}{BFC\_\-msg} $\ast$ BFC\_\-msg\-Receive (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ {\em rc})}}
\label{BFC_8h_a40}


Returns the message at the head of the send message que.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
rc}]The run control structure. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
A pointer to the message or NULL if no message is available.\end{Desc}
Fetches the message at the head of the que. If one only uses this routine in response to a signal that the queue is not empty, it will deliver at message. However, to be safe, the user should check for NULL. \hypertarget{BFC_8h_a39}{
\index{BFC.h@{BFC.h}!BFC_msgSend@{BFC\_\-msgSend}}
\index{BFC_msgSend@{BFC\_\-msgSend}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-msgSend]{\setlength{\rightskip}{0pt plus 5cm}int BFC\_\-msg\-Send (\hyperlink{BFC_8h_a6}{BFC\_\-msg\-Stream} $\ast$ {\em mstrm}, unsigned int {\em type}, unsigned int {\em prm})}}
\label{BFC_8h_a39}


Sends a message to the event taking task.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
mstrm}]The message stream to send the message on \item[{\em 
type}]The message type. \item[{\em 
prm}]An arbitrary parameter to pass along with the message. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
BFC\_\-C\_\-MSG\_\-ERROR, if}]unsuccessful, protocol error. \item[{\em 
0, if}]successful \end{description}
\end{Desc}
\hypertarget{BFC_8h_a36}{
\index{BFC.h@{BFC.h}!BFC_msgStreamInit@{BFC\_\-msgStreamInit}}
\index{BFC_msgStreamInit@{BFC\_\-msgStreamInit}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-msgStreamInit]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{BFC_8h_a7}{BFC\_\-msg} $\ast$ BFC\_\-msg\-Stream\-Init (\hyperlink{BFC_8h_a6}{BFC\_\-msg\-Stream} $\ast$ {\em mstrm}, \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ {\em rc}, int {\em ack\-To})}}
\label{BFC_8h_a36}


Initializes a message stream.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
mstrm}]The message stream to initialize. \item[{\em 
rc}]The run control structure. This determines the destination of the message \item[{\em 
timeout}]How long to wait, in milliseconds. (-1 =$>$ wait forever). \end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
Status. \end{Desc}
\hypertarget{BFC_8h_a61}{
\index{BFC.h@{BFC.h}!BFC_nbytesLeftGet@{BFC\_\-nbytesLeftGet}}
\index{BFC_nbytesLeftGet@{BFC\_\-nbytesLeftGet}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-nbytesLeftGet]{\setlength{\rightskip}{0pt plus 5cm}int BFC\_\-nbytes\-Left\-Get (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ {\em rc})}}
\label{BFC_8h_a61}


Returns the number of bytes to be accumulated before the current run is finished.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
rc}]The run control structure. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
$>$0, the}]remaining bytes. \item[{\em 
-1, indicates}]no byte limit or outside a run. \end{description}
\end{Desc}
\hypertarget{BFC_8h_a62}{
\index{BFC.h@{BFC.h}!BFC_nevtsLeftGet@{BFC\_\-nevtsLeftGet}}
\index{BFC_nevtsLeftGet@{BFC\_\-nevtsLeftGet}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-nevtsLeftGet]{\setlength{\rightskip}{0pt plus 5cm}int BFC\_\-nevts\-Left\-Get (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ {\em rc})}}
\label{BFC_8h_a62}


Returns the number of events to be accumulated before the current run is finished.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
rc}]The run control structure. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
$>$0, the}]remaining time, in ticks. \item[{\em 
-1, indicates}]no event limit or outside a run. \end{description}
\end{Desc}
\hypertarget{BFC_8h_a45}{
\index{BFC.h@{BFC.h}!BFC_quantitySet@{BFC\_\-quantitySet}}
\index{BFC_quantitySet@{BFC\_\-quantitySet}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-quantitySet]{\setlength{\rightskip}{0pt plus 5cm}int BFC\_\-quantity\-Set (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ {\em rc}, \hyperlink{BFC_8h_a3}{BFC\_\-quantity} {\em name}, unsigned int {\em value})}}
\label{BFC_8h_a45}


Sets one of the run control quantities.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
rc}]The run control structure. \item[{\em 
name}]The name of the quantity to set. \item[{\em 
value}]The value of the quantity to set. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
0, if}]successful \item[{\em 
BFC\_\-C\_\-WRONG\_\-STATE, if}]run is in the incorrect state. The low nibble gives the state it is in. \item[{\em 
BFC\_\-C\_\-BAD\_\-NAME, if}]unsuccessful because of invalid name.\end{description}
\end{Desc}
These values can only be when a run is not in progress. Attempts to set them when the run is in progress will be rejected. The exact meaning of the value depends on the quantity being set. See the individual routines for the this meaning.

Note that this is only a convenience routine. The more specific set routines should be used when possible. This routine supports a more generic 'set' interface routine such as that found in a command parser. \hypertarget{BFC_8h_a58}{
\index{BFC.h@{BFC.h}!BFC_runInfoGet@{BFC\_\-runInfoGet}}
\index{BFC_runInfoGet@{BFC\_\-runInfoGet}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-runInfoGet]{\setlength{\rightskip}{0pt plus 5cm}const \hyperlink{BFC_8h_a4}{BFC\_\-run\-Info} $\ast$ BFC\_\-run\-Info\-Get (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ {\em rc})}}
\label{BFC_8h_a58}


\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
rc}]The run control structure. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
A pointer to the run information block. \end{Desc}
\hypertarget{BFC_8h_a57}{
\index{BFC.h@{BFC.h}!BFC_runIsActive@{BFC\_\-runIsActive}}
\index{BFC_runIsActive@{BFC\_\-runIsActive}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-runIsActive]{\setlength{\rightskip}{0pt plus 5cm}int BFC\_\-run\-Is\-Active (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ {\em rc})}}
\label{BFC_8h_a57}


Indicates whether the specified run state occurs while a run is active.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
rc}]The run control structure. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
0, if}]the run state does not occur when a run is active \item[{\em 
!=0, if}]the run state does occur when a run is active.\end{description}
\end{Desc}
A run is considered active is its state is one of STARTING, STARTED, PAUSING, PAUSED or RESUMING. \hypertarget{BFC_8h_a64}{
\index{BFC.h@{BFC.h}!BFC_runNumberGet@{BFC\_\-runNumberGet}}
\index{BFC_runNumberGet@{BFC\_\-runNumberGet}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-runNumberGet]{\setlength{\rightskip}{0pt plus 5cm}unsigned int BFC\_\-run\-Number\-Get (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ {\em rc})}}
\label{BFC_8h_a64}


Returns the current run state.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
rc}]The run control structure. \end{description}
\end{Desc}
\hypertarget{BFC_8h_a50}{
\index{BFC.h@{BFC.h}!BFC_runNumberSet@{BFC\_\-runNumberSet}}
\index{BFC_runNumberSet@{BFC\_\-runNumberSet}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-runNumberSet]{\setlength{\rightskip}{0pt plus 5cm}int BFC\_\-run\-Number\-Set (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ {\em rc}, unsigned int {\em run\-Number})}}
\label{BFC_8h_a50}


Assigns the number to be to designate the next run.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
rc}]The run control structure. \item[{\em 
run\-Number}]The run number to use. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
0, if}]successful \item[{\em 
-1, if}]unsuccessful \item[{\em 
BFC\_\-C\_\-WRONG\_\-STATE, if}]run is in the incorrect state. The low nibble gives the state it is in.\end{description}
\end{Desc}
The run number can only be set when a run is not in progress. Attempts to set the run number when the run is in progress will be rejected. \hypertarget{BFC_8h_a53}{
\index{BFC.h@{BFC.h}!BFC_runPause@{BFC\_\-runPause}}
\index{BFC_runPause@{BFC\_\-runPause}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-runPause]{\setlength{\rightskip}{0pt plus 5cm}int BFC\_\-run\-Pause (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ {\em rc}, \hyperlink{BFC_8h_a8}{BFC\_\-run\-Usr\-Rtn} {\em usr}, void $\ast$ {\em prm1}, void $\ast$ {\em prm2})}}
\label{BFC_8h_a53}


Pause a run.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
rc}]The run control structure. \item[{\em 
usr}]A user callback routine to perform pause run actions. \item[{\em 
prm1}]A parameter passed tranparently to the user pause run  routine. \item[{\em 
prm2}]A parameter passed tranparently to the user pause run  routine. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
0, if}]successful \item[{\em 
BFC\_\-C\_\-WRONG\_\-STATE, if}]run is in the incorrect state. The low nibble gives the state it is in. \end{description}
\end{Desc}
\hypertarget{BFC_8h_a54}{
\index{BFC.h@{BFC.h}!BFC_runResume@{BFC\_\-runResume}}
\index{BFC_runResume@{BFC\_\-runResume}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-runResume]{\setlength{\rightskip}{0pt plus 5cm}int BFC\_\-run\-Resume (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ {\em rc}, \hyperlink{BFC_8h_a8}{BFC\_\-run\-Usr\-Rtn} {\em usr}, void $\ast$ {\em prm1}, void $\ast$ {\em prm2})}}
\label{BFC_8h_a54}


Pause a run.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
rc}]The run control structure. \item[{\em 
usr}]A user callback routine to perform resume run actions. \item[{\em 
prm1}]A parameter passed tranparently to the user pause run  routine. \item[{\em 
prm2}]A parameter passed tranparently to the user pause run  routine. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
0, if}]successful \item[{\em 
BFC\_\-C\_\-WRONG\_\-STATE, if}]run is in the incorrect state. The low nibble gives the state it is in. \end{description}
\end{Desc}
\hypertarget{BFC_8h_a52}{
\index{BFC.h@{BFC.h}!BFC_runStart@{BFC\_\-runStart}}
\index{BFC_runStart@{BFC\_\-runStart}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-runStart]{\setlength{\rightskip}{0pt plus 5cm}int BFC\_\-run\-Start (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ {\em rc}, \hyperlink{BFC_8h_a8}{BFC\_\-run\-Usr\-Rtn} {\em usr}, void $\ast$ {\em prm1}, void $\ast$ {\em prm2})}}
\label{BFC_8h_a52}


Starts a run.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
rc}]The run control structure. \item[{\em 
usr}]A user callback routine to perform start-up actions. \item[{\em 
prm1}]A parameter passed tranparently to the user start-up routine. \item[{\em 
prm2}]A parameter passed tranparently to the user start-up routine. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
0, if}]successful \item[{\em 
BFC\_\-C\_\-WRONG\_\-STATE, if}]run is in the incorrect state. The low nibble gives the state it is in. \end{description}
\end{Desc}
\hypertarget{BFC_8h_a56}{
\index{BFC.h@{BFC.h}!BFC_runStateGet@{BFC\_\-runStateGet}}
\index{BFC_runStateGet@{BFC\_\-runStateGet}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-runStateGet]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{BFC_8h_a0}{BFC\_\-run\-State} BFC\_\-run\-State\-Get (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ {\em rc})}}
\label{BFC_8h_a56}


Returns the current run state.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
rc}]The run control structure. \end{description}
\end{Desc}
\hypertarget{BFC_8h_a55}{
\index{BFC.h@{BFC.h}!BFC_runStop@{BFC\_\-runStop}}
\index{BFC_runStop@{BFC\_\-runStop}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-runStop]{\setlength{\rightskip}{0pt plus 5cm}int BFC\_\-run\-Stop (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ {\em rc}, \hyperlink{BFC_8h_a8}{BFC\_\-run\-Usr\-Rtn} {\em usr}, void $\ast$ {\em prm1}, void $\ast$ {\em prm2})}}
\label{BFC_8h_a55}


Stops a run.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
rc}]The run control structure. \item[{\em 
usr}]A user callback routine to perform end run actions. \item[{\em 
prm1}]A parameter passed tranparently to the user end run  routine. \item[{\em 
prm2}]A parameter passed tranparently to the user end run  routine. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
0, if}]successful \item[{\em 
BFC\_\-C\_\-WRONG\_\-STATE, if}]run is in the incorrect state. The low nibble gives the state it is in. \end{description}
\end{Desc}
\hypertarget{BFC_8h_a51}{
\index{BFC.h@{BFC.h}!BFC_runUpdate@{BFC\_\-runUpdate}}
\index{BFC_runUpdate@{BFC\_\-runUpdate}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-runUpdate]{\setlength{\rightskip}{0pt plus 5cm}int BFC\_\-run\-Update (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ {\em rc}, unsigned int {\em nevts}, unsigned int {\em nbytes})}}
\label{BFC_8h_a51}


Updates the number of bytes of data taken during this run.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
rc}]The run control structure. \item[{\em 
nevts}]The number of events to add to the current total. \item[{\em 
nbytes}]The number of bytes to add to the current total. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
BFC\_\-C\_\-WRONG\_\-STATE, if}]run is in the incorrect state. The low nibble gives the state it is in. \item[{\em 
0, the}]request was honored, still under the limit. \item[{\em 
1, the}]request was honored, the total number of events now exceeds the requested limit. \item[{\em 
2, the}]request was honored, the total number of bytes now exceeds the requested limit. \item[{\em 
3, the}]request was honored, the total number of events and bytes now exceeds the requested limit.\end{description}
\end{Desc}
The number of events/bytes can only be updated when a run is in progress. Attempts to update these numbers when a run is not in progress will be rejected. \hypertarget{BFC_8h_a60}{
\index{BFC.h@{BFC.h}!BFC_timeLeftGet@{BFC\_\-timeLeftGet}}
\index{BFC_timeLeftGet@{BFC\_\-timeLeftGet}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-timeLeftGet]{\setlength{\rightskip}{0pt plus 5cm}int BFC\_\-time\-Left\-Get (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ {\em rc})}}
\label{BFC_8h_a60}


Returns the time left in the current run.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
rc}]The run control structure. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
$>$0, the}]remaining time, in ticks. \item[{\em 
-1, indicates}]no time limit or outside a run. \end{description}
\end{Desc}
\hypertarget{BFC_8h_a59}{
\index{BFC.h@{BFC.h}!BFC_tlimitGet@{BFC\_\-tlimitGet}}
\index{BFC_tlimitGet@{BFC\_\-tlimitGet}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-tlimitGet]{\setlength{\rightskip}{0pt plus 5cm}int BFC\_\-tlimit\-Get (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ {\em rc})}}
\label{BFC_8h_a59}


Returns the run time limit in ticks.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
rc}]The run control structure. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
The}]run time limit in ticks. \end{description}
\end{Desc}
\hypertarget{BFC_8h_a48}{
\index{BFC.h@{BFC.h}!BFC_tlimitSet@{BFC\_\-tlimitSet}}
\index{BFC_tlimitSet@{BFC\_\-tlimitSet}!BFC.h@{BFC.h}}
\subsubsection[BFC\_\-tlimitSet]{\setlength{\rightskip}{0pt plus 5cm}int BFC\_\-tlimit\-Set (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ {\em rc}, unsigned int {\em msecs})}}
\label{BFC_8h_a48}


Sets the time limit for the run duration.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
rc}]The run control structure. \item[{\em 
msecs}]The time limit, in milliseconds \end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
0, if}]successful \item[{\em 
BFC\_\-C\_\-WRONG\_\-STATE, if}]run is in the incorrect state. The low nibble gives the state it is in.\end{description}
\end{Desc}
The time limit can only be when a run is not in progress. Attempts to set the time limit when the run is in progress will be rejected. If this number is specified as 0, then no time limit will be imposed. 