\hypertarget{ESX_8c}{
\section{ESX.c File Reference}
\label{ESX_8c}\index{ESX.c@{ESX.c}}
}
EBF Selection and Extract utilities. 

{\tt \#include \char`\"{}EDS/EBF\_\-dir.h\char`\"{}}\par
{\tt \#include \char`\"{}EDS/io/ESX.h\char`\"{}}\par
{\tt \#include \char`\"{}EDS/io/EBF\_\-stream.h\char`\"{}}\par
{\tt \#include $<$string.h$>$}\par
{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par


Include dependency graph for ESX.c:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=260pt]{ESX_8c__incl}
\end{center}
\end{figure}
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct \hyperlink{struct__ESX__ctl}{\_\-ESX\_\-ctl}
\begin{CompactList}\small\item\em Output file context. \item\end{CompactList}\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{ESX_8c_a0}{
typedef \hyperlink{struct__ESX__ctl}{\_\-ESX\_\-ctl} {\bf ESX\_\-ctl}}
\label{ESX_8c_a0}

\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
static unsigned int \hyperlink{ESX_8c_a1}{get\_\-number} (const char $\ast$s)
\begin{CompactList}\small\item\em Parses the input string, returning the integer equivalent. \item\end{CompactList}\item 
\hypertarget{ESX_8c_a2}{
unsigned int {\bf ESX\_\-sizeof} (void)}
\label{ESX_8c_a2}

\item 
\hypertarget{ESX_8c_a3}{
void {\bf ESX\_\-construct} (\hyperlink{struct__ESX__ctl}{ESX\_\-ctl} $\ast$esx)}
\label{ESX_8c_a3}

\item 
\hypertarget{ESX_8c_a4}{
unsigned int {\bf ESX\_\-set\_\-verbose} (\hyperlink{struct__ESX__ctl}{ESX\_\-ctl} $\ast$esx, unsigned int verbose)}
\label{ESX_8c_a4}

\item 
\hypertarget{ESX_8c_a5}{
void {\bf ESX\_\-parse\_\-oname} (\hyperlink{struct__ESX__ctl}{ESX\_\-ctl} $\ast$esx, const char $\ast$oname)}
\label{ESX_8c_a5}

\item 
\hypertarget{ESX_8c_a6}{
void {\bf ESX\_\-parse\_\-ochunk} (\hyperlink{struct__ESX__ctl}{ESX\_\-ctl} $\ast$esx, const char $\ast$s)}
\label{ESX_8c_a6}

\item 
\hypertarget{ESX_8c_a7}{
void {\bf ESX\_\-parse\_\-ichunk} (\hyperlink{struct__ESX__ctl}{ESX\_\-ctl} $\ast$esx, const char $\ast$s)}
\label{ESX_8c_a7}

\item 
\hypertarget{ESX_8c_a8}{
void {\bf ESX\_\-parse\_\-bsize} (\hyperlink{struct__ESX__ctl}{ESX\_\-ctl} $\ast$esx, const char $\ast$s)}
\label{ESX_8c_a8}

\item 
\hypertarget{ESX_8c_a9}{
void {\bf ESX\_\-parse\_\-osize} (\hyperlink{struct__ESX__ctl}{ESX\_\-ctl} $\ast$esx, const char $\ast$s)}
\label{ESX_8c_a9}

\item 
\hypertarget{ESX_8c_a10}{
int {\bf ESX\_\-update\_\-osize} (\hyperlink{struct__ESX__ctl}{ESX\_\-ctl} $\ast$esx, unsigned int size)}
\label{ESX_8c_a10}

\item 
void \hyperlink{ESX_8c_a11}{ESX\_\-close} (\hyperlink{struct__ESX__ctl}{ESX\_\-ctl} $\ast$esx)
\begin{CompactList}\small\item\em Closes the output stream. \item\end{CompactList}\item 
\hypertarget{ESX_8c_a12}{
unsigned int {\bf ESX\_\-establish} (\hyperlink{struct__ESX__ctl}{ESX\_\-ctl} $\ast$esx)}
\label{ESX_8c_a12}

\item 
int \hyperlink{ESX_8c_a13}{ESX\_\-change} (\hyperlink{struct__ESX__ctl}{ESX\_\-ctl} $\ast$esx)
\begin{CompactList}\small\item\em Creates a new output file. \item\end{CompactList}\item 
int \_\-\_\-inline \hyperlink{ESX_8c_a14}{ESX\_\-evt\_\-declare} (\hyperlink{struct__ESX__ctl}{ESX\_\-ctl} $\ast$esx)
\begin{CompactList}\small\item\em Declares an input event has been seen. This information is used to determine whether to trigger the creation of a new output file. \item\end{CompactList}\item 
int \hyperlink{ESX_8c_a15}{ESX\_\-dir\_\-write} (\hyperlink{struct__ESX__ctl}{ESX\_\-ctl} $\ast$esx, \hyperlink{struct__EBF__dir}{EBF\_\-dir} $\ast$dir)
\begin{CompactList}\small\item\em Writes the event. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
EBF Selection and Extract utilities. 

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


\footnotesize\begin{verbatim}   CVS $Id: ESX.c,v 1.2 2007/04/08 19:12:41 russell Exp $
\end{verbatim}
\normalsize


\subsection{Function Documentation}
\hypertarget{ESX_8c_a13}{
\index{ESX.c@{ESX.c}!ESX_change@{ESX\_\-change}}
\index{ESX_change@{ESX\_\-change}!ESX.c@{ESX.c}}
\subsubsection[ESX\_\-change]{\setlength{\rightskip}{0pt plus 5cm}int \hyperlink{struct__EBF__stream}{EBF\_\-stream} ESX\_\-change (\hyperlink{struct__ESX__ctl}{ESX\_\-ctl} $\ast$ {\em esx})}}
\label{ESX_8c_a13}


Creates a new output file. 

\begin{Desc}
\item[Returns:]A pointer to the stream\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em esx}]The control structure\end{description}
\end{Desc}
\hypertarget{ESX_8c_a11}{
\index{ESX.c@{ESX.c}!ESX_close@{ESX\_\-close}}
\index{ESX_close@{ESX\_\-close}!ESX.c@{ESX.c}}
\subsubsection[ESX\_\-close]{\setlength{\rightskip}{0pt plus 5cm}void ESX\_\-close (\hyperlink{struct__ESX__ctl}{ESX\_\-ctl} $\ast$ {\em esx})}}
\label{ESX_8c_a11}


Closes the output stream. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em esx}]The control block\end{description}
\end{Desc}
\hypertarget{ESX_8c_a15}{
\index{ESX.c@{ESX.c}!ESX_dir_write@{ESX\_\-dir\_\-write}}
\index{ESX_dir_write@{ESX\_\-dir\_\-write}!ESX.c@{ESX.c}}
\subsubsection[ESX\_\-dir\_\-write]{\setlength{\rightskip}{0pt plus 5cm}int ESX\_\-dir\_\-write (\hyperlink{struct__ESX__ctl}{ESX\_\-ctl} $\ast$ {\em esx}, \hyperlink{struct__EBF__dir}{EBF\_\-dir} $\ast$ {\em dir})}}
\label{ESX_8c_a15}


Writes the event. 

\begin{Desc}
\item[Returns:]Status\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em esx}]The control structure \item[{\em dir}]The directory of the event to write out\end{description}
\end{Desc}
\hypertarget{ESX_8c_a14}{
\index{ESX.c@{ESX.c}!ESX_evt_declare@{ESX\_\-evt\_\-declare}}
\index{ESX_evt_declare@{ESX\_\-evt\_\-declare}!ESX.c@{ESX.c}}
\subsubsection[ESX\_\-evt\_\-declare]{\setlength{\rightskip}{0pt plus 5cm}int \_\-\_\-inline ESX\_\-evt\_\-declare (\hyperlink{struct__ESX__ctl}{ESX\_\-ctl} $\ast$ {\em esx})}}
\label{ESX_8c_a14}


Declares an input event has been seen. This information is used to determine whether to trigger the creation of a new output file. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em esx}]The control structure\end{description}
\end{Desc}
\hypertarget{ESX_8c_a1}{
\index{ESX.c@{ESX.c}!get_number@{get\_\-number}}
\index{get_number@{get\_\-number}!ESX.c@{ESX.c}}
\subsubsection[get\_\-number]{\setlength{\rightskip}{0pt plus 5cm}static unsigned int get\_\-number (const char $\ast$ {\em s})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{ESX_8c_a1}


Parses the input string, returning the integer equivalent. 

\begin{Desc}
\item[Returns:]The integer equivalent\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em s}]The string to parse\end{description}
\end{Desc}
The string must be in the form of a conventionally specified C integer and may optionally be followed by the suffix K, M, C. These give the scaling or units

-K Hexadecimal kilobytes (scale by 1024) -M Hexadecimal megabytes (scale by 1024 $\ast$ 1024) -B LCB blocks (scale by 128, max of 31) Examples\par
 s result\par
 \char`\"{}100\char`\"{} 100\par
 \char`\"{}100K\char`\"{} 100$\ast$1024\par
 \char`\"{}100M\char`\"{} 100$\ast$1024$\ast$124\par
 \char`\"{}31C 31$\ast$128\par
