\hypertarget{CDFP_8c}{
\section{CDFP.c File Reference}
\label{CDFP_8c}\index{CDFP.c@{CDFP.c}}
}
Generic compression routines.  


{\tt \#include $<$LSEP/LSEP\_\-ids.h$>$}\par
{\tt \#include $<$CDFP.h$>$}\par
{\tt \#include $<$CDFP\_\-def.h$>$}\par
{\tt \#include $<$LSE/CDF\_\-esb.h$>$}\par
{\tt \#include $<$LSE/CDF\_\-gem.h$>$}\par
{\tt \#include $<$LSE/CDF\_\-acd.h$>$}\par
{\tt \#include $<$LSE/CDF\_\-cal.h$>$}\par
{\tt \#include $<$LSE/CDF\_\-tkr.h$>$}\par
{\tt \#include $<$LSE/CDF\_\-dgn.h$>$}\par
{\tt \#include $<$LSE/CDF\_\-err.h$>$}\par
{\tt \#include $<$LDT/HDE.h$>$}\par
{\tt \#include $<$PBI/PTR.h$>$}\par
{\tt \#include $<$string.h$>$}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{CDFP_8c_a81786130c3c12617fb7aeff2e7408a9}{
\#define \textbf{RND8N}(\_\-n)~PTR\_\-RND (\_\-n, 8)}
\label{CDFP_8c_a81786130c3c12617fb7aeff2e7408a9}

\item 
\hypertarget{CDFP_8c_fa56f1aeb167c47bc00e8f6c2f31acc5}{
\#define \textbf{RND8P}(\_\-p)~((void $\ast$)(PTR\_\-RND (\_\-p, 8)))}
\label{CDFP_8c_fa56f1aeb167c47bc00e8f6c2f31acc5}

\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
static \_\-\_\-inline unsigned int $\ast$ \hyperlink{CDFP_8c_f39a62b3f0e76aa678ceb05d592b378c}{composeCtb} (\hyperlink{struct__CDFP__ctxCtb}{CDFP\_\-ctxCtb} $\ast$ctb, const \hyperlink{struct__CDFP__ctx}{CDFP\_\-ctx} $\ast$cdfp)
\begin{CompactList}\small\item\em Composes the CDF LSF contribution. \item\end{CompactList}\item 
int \hyperlink{CDFP_8c_3ff2ed8c5457589e295cb85cb0a07a64}{CDFP\_\-cfg\_\-sizeof} (int level)
\begin{CompactList}\small\item\em Returns the size, in bytes, of the compression configuration needed to support the specified compression level. \item\end{CompactList}\item 
int \hyperlink{CDFP_8c_1d002a5dec5a83237225e474d2f92a37}{CDFP\_\-cfg\_\-construct} (\hyperlink{struct__CDFP__cfg}{CDFP\_\-cfg} $\ast$cfg, int level)
\begin{CompactList}\small\item\em Constructs (initializes) the compression configuration for the appropriate level. \item\end{CompactList}\item 
int \hyperlink{CDFP_8c_159f9b4936e044f34ec6baad8f42b5bf}{CDFP\_\-sizeof} (int level, void $\ast$cfg)
\begin{CompactList}\small\item\em Returns the size, in bytes, of the compression structure needed to supprot the specified compression level. \item\end{CompactList}\item 
int \hyperlink{CDFP_8c_8f0a2b41ac9b8a3d96a2d1a450e64eb0}{CDFP\_\-construct} (\hyperlink{struct__CDFP__ctx}{CDFP\_\-ctx} $\ast$cdfp, int level, const \hyperlink{struct__CDFP__cfg}{CDFP\_\-cfg} $\ast$cfg, LSEW\_\-dgmFw $\ast$dgmFw, \hyperlink{struct__LSEPW}{LSEPW} $\ast$lsepw)
\begin{CompactList}\small\item\em Constructs (initializes) the compression structure for the appropriate level. \item\end{CompactList}\item 
unsigned int $\ast$ \hyperlink{CDFP_8c_abfd56d3c96ccfd1637f9f8b746014c4}{CDFP\_\-begin\_\-add} (\hyperlink{struct__CDFP__ctx}{CDFP\_\-ctx} $\ast$cdfp, unsigned int $\ast$beg, unsigned int len32)
\begin{CompactList}\small\item\em Begin datagram callback routine. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Generic compression routines. 

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


\footnotesize\begin{verbatim}

   CVS $Id: CDFP.c,v 1.5 2011/03/26 23:32:30 russell Exp $
\end{verbatim}
\normalsize
 

\subsection{Function Documentation}
\hypertarget{CDFP_8c_abfd56d3c96ccfd1637f9f8b746014c4}{
\index{CDFP.c@{CDFP.c}!CDFP\_\-begin\_\-add@{CDFP\_\-begin\_\-add}}
\index{CDFP\_\-begin\_\-add@{CDFP\_\-begin\_\-add}!CDFP.c@{CDFP.c}}
\subsubsection[{CDFP\_\-begin\_\-add}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int$\ast$ CDFP\_\-begin\_\-add ({\bf CDFP\_\-ctx} $\ast$ {\em cdfp}, \/  unsigned int $\ast$ {\em beg}, \/  unsigned int {\em len32})}}
\label{CDFP_8c_abfd56d3c96ccfd1637f9f8b746014c4}


Begin datagram callback routine. 

\begin{Desc}
\item[Returns:]Pointer to the next write location\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cdfp}]The Compressed Data Format handle \item[{\em beg}]The output buffer \item[{\em len32}]The amount of space, in 32-bit words, available in the output buffer \end{description}
\end{Desc}


References \_\-CDFP\_\-ctxCtb::bdy, \_\-CDFP\_\-ctx::ctb, \_\-CDFP\_\-ctxBdy::gem, \_\-CDFP\_\-ctx::gem, and \_\-CDFP\_\-ctxCtb::hdr.

Referenced by beg8\_\-add().\hypertarget{CDFP_8c_1d002a5dec5a83237225e474d2f92a37}{
\index{CDFP.c@{CDFP.c}!CDFP\_\-cfg\_\-construct@{CDFP\_\-cfg\_\-construct}}
\index{CDFP\_\-cfg\_\-construct@{CDFP\_\-cfg\_\-construct}!CDFP.c@{CDFP.c}}
\subsubsection[{CDFP\_\-cfg\_\-construct}]{\setlength{\rightskip}{0pt plus 5cm}int CDFP\_\-cfg\_\-construct ({\bf CDFP\_\-cfg} $\ast$ {\em cfg}, \/  int {\em level})}}
\label{CDFP_8c_1d002a5dec5a83237225e474d2f92a37}


Constructs (initializes) the compression configuration for the appropriate level. 

\begin{Desc}
\item[Returns:]Status\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cfg}]The compression configuratin to initialize \item[{\em level}]The maximum compression level that needs supporting\end{description}
\end{Desc}
\begin{Desc}
\item[Warning:]It is assumed that the caller has used CDFP\_\-cfg\_\-sizeof to determine the amount of storage that is needed and, thus, has assured that the {\em cfg\/} structure is adequately sized. \end{Desc}


References \_\-CDFP\_\-cfg::acd, \_\-CDFP\_\-cfg::cal, \_\-CDFP\_\-cfg::dgn, \_\-CDFP\_\-cfg::err, \_\-CDFP\_\-cfg::esb, \_\-CDFP\_\-cfg::gem, and \_\-CDFP\_\-cfg::tkr.\hypertarget{CDFP_8c_3ff2ed8c5457589e295cb85cb0a07a64}{
\index{CDFP.c@{CDFP.c}!CDFP\_\-cfg\_\-sizeof@{CDFP\_\-cfg\_\-sizeof}}
\index{CDFP\_\-cfg\_\-sizeof@{CDFP\_\-cfg\_\-sizeof}!CDFP.c@{CDFP.c}}
\subsubsection[{CDFP\_\-cfg\_\-sizeof}]{\setlength{\rightskip}{0pt plus 5cm}int CDFP\_\-cfg\_\-sizeof (int {\em level})}}
\label{CDFP_8c_3ff2ed8c5457589e295cb85cb0a07a64}


Returns the size, in bytes, of the compression configuration needed to support the specified compression level. 

\begin{Desc}
\item[Returns:]The size, in bytes, of the compression configuration\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em level}]The maximum compression level to support \end{description}
\end{Desc}
\hypertarget{CDFP_8c_8f0a2b41ac9b8a3d96a2d1a450e64eb0}{
\index{CDFP.c@{CDFP.c}!CDFP\_\-construct@{CDFP\_\-construct}}
\index{CDFP\_\-construct@{CDFP\_\-construct}!CDFP.c@{CDFP.c}}
\subsubsection[{CDFP\_\-construct}]{\setlength{\rightskip}{0pt plus 5cm}int CDFP\_\-construct ({\bf CDFP\_\-ctx} $\ast$ {\em cdfp}, \/  int {\em level}, \/  const {\bf CDFP\_\-cfg} $\ast$ {\em cfg}, \/  LSEW\_\-dgmFw $\ast$ {\em dgmFw}, \/  {\bf LSEPW} $\ast$ {\em lsepw})}}
\label{CDFP_8c_8f0a2b41ac9b8a3d96a2d1a450e64eb0}


Constructs (initializes) the compression structure for the appropriate level. 

\begin{Desc}
\item[Returns:]Status\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cdfp}]The compression context to initialize \item[{\em level}]The maximum compression level that needs supporting \item[{\em cfg}]Target specific configuration parameter \item[{\em dgmFw}]The datagram framework handle \item[{\em lsepw}]The generic LSEPW services\end{description}
\end{Desc}
\begin{Desc}
\item[Warning:]It is assumed that the called has used CDFP\_\-sizeof to determine the amount of storage that is needed and, thus, has assured that the {\em cmp\/} structure is adequately sized. \end{Desc}


References \_\-CDFP\_\-cfg::acd, \_\-CDFP\_\-ctx::acd, \_\-CDFP\_\-cfg::cal, \_\-CDFP\_\-ctx::cal, composeCtb(), \_\-CDFP\_\-ctx::ctb, \_\-CDFP\_\-cfg::dgn, \_\-CDFP\_\-ctx::dgn, \_\-CDFP\_\-cfg::err, \_\-CDFP\_\-ctx::err, \_\-CDFP\_\-cfg::esb, \_\-CDFP\_\-ctx::esb, \_\-CDFP\_\-cfg::gem, \_\-CDFP\_\-ctx::gem, \_\-CDFP\_\-ctx::lsepw, \_\-CDFP\_\-cfg::tkr, and \_\-CDFP\_\-ctx::tkr.

Referenced by LSEPW\_\-evt0\_\-construct().\hypertarget{CDFP_8c_159f9b4936e044f34ec6baad8f42b5bf}{
\index{CDFP.c@{CDFP.c}!CDFP\_\-sizeof@{CDFP\_\-sizeof}}
\index{CDFP\_\-sizeof@{CDFP\_\-sizeof}!CDFP.c@{CDFP.c}}
\subsubsection[{CDFP\_\-sizeof}]{\setlength{\rightskip}{0pt plus 5cm}int CDFP\_\-sizeof (int {\em level}, \/  void $\ast$ {\em cfg})}}
\label{CDFP_8c_159f9b4936e044f34ec6baad8f42b5bf}


Returns the size, in bytes, of the compression structure needed to supprot the specified compression level. 

\begin{Desc}
\item[Returns:]The size, in bytes, of the compression structure\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em level}]The maximum compression level to support \item[{\em cfg}]Level specific configuration parameter \end{description}
\end{Desc}


Referenced by LSEPW\_\-evt0\_\-sizeof().\hypertarget{CDFP_8c_f39a62b3f0e76aa678ceb05d592b378c}{
\index{CDFP.c@{CDFP.c}!composeCtb@{composeCtb}}
\index{composeCtb@{composeCtb}!CDFP.c@{CDFP.c}}
\subsubsection[{composeCtb}]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline unsigned int $\ast$ composeCtb ({\bf CDFP\_\-ctxCtb} $\ast$ {\em ctb}, \/  const {\bf CDFP\_\-ctx} $\ast$ {\em cdfp})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{CDFP_8c_f39a62b3f0e76aa678ceb05d592b378c}


Composes the CDF LSF contribution. 

\begin{Desc}
\item[Returns:]Pointer to the next fill location\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ctb}]The contribution to fill \item[{\em cdfp}]The Compression Data Formatting Physics context \end{description}
\end{Desc}


References \_\-CDFP\_\-ctxBdy::acd, \_\-CDFP\_\-ctx::acd, \_\-CDFP\_\-ctxCtb::bdy, \_\-CDFP\_\-ctxBdy::cal, \_\-CDFP\_\-ctx::cal, \_\-CDFP\_\-ctxBdy::gem, \_\-CDFP\_\-ctx::gem, \_\-CDFP\_\-ctxCtb::hdr, LSEP\_\-CDF\_\-K\_\-VERSION, LSEP\_\-ID\_\-K\_\-CDF, \_\-CDFP\_\-ctxBdy::tkr, and \_\-CDFP\_\-ctx::tkr.

Referenced by CDFP\_\-construct().