\hypertarget{QSSP_8c}{
\section{QSSP.c File Reference}
\label{QSSP_8c}\index{QSSP.c@{QSSP.c}}
}
Decodes the Science Statistics (Physics) for the handlers. 

{\tt \#include \char`\"{}QSSP\_\-pvtdefs.h\char`\"{}}\par
{\tt \#include \char`\"{}QSSP\_\-efs\-Ctx.h\char`\"{}}\par
{\tt \#include \char`\"{}dprintf.h\char`\"{}}\par
{\tt \#include \char`\"{}QSP/QSP\_\-names.h\char`\"{}}\par
{\tt \#include \char`\"{}QSP/QFCH\_\-cache.h\char`\"{}}\par
{\tt \#include \char`\"{}QSD/QFC\_\-cache.h\char`\"{}}\par
{\tt \#include \char`\"{}QSD/QFR\_\-file.h\char`\"{}}\par
{\tt \#include \char`\"{}LSE/LSEW\_\-ctx\-Tim.h\char`\"{}}\par
{\tt \#include \char`\"{}EFC/EFS\_\-ids.h\char`\"{}}\par
{\tt \#include \char`\"{}EFC/EFS\_\-ctx\-Ctb.h\char`\"{}}\par
{\tt \#include \char`\"{}EFC/EFA\_\-def.h\char`\"{}}\par
{\tt \#include \char`\"{}EDS/EBF\_\-gem.h\char`\"{}}\par
{\tt \#include \char`\"{}LSF/LSF.h\char`\"{}}\par
{\tt \#include \char`\"{}LSF/LSF\_\-scan.h\char`\"{}}\par
{\tt \#include \char`\"{}LSF/LSF\_\-reason.h\char`\"{}}\par
{\tt \#include \char`\"{}LDT/BFU.h\char`\"{}}\par
{\tt \#include $<$string.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par


Include dependency graph for QSSP.c:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=279pt]{QSSP_8c__incl}
\end{center}
\end{figure}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{QSSP_8c_a0}{
\#define {\bf RND\_\-8}(\_\-v)~((\_\-v + 7) \& $\sim$0x7)}
\label{QSSP_8c_a0}

\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
typedef const unsigned int $\ast$($\ast$ \hyperlink{QSSP_8c_a1}{Decode\-Sample} )(\hyperlink{struct__QSSP}{QSSP} $\ast$qssp, \hyperlink{struct__QSSP__sample}{QSSP\_\-sample} $\ast$sample, const unsigned int $\ast$dat, unsigned char bridge)
\begin{CompactList}\small\item\em Signature to decode a statistics sample from the input data. \item\end{CompactList}\item 
typedef void $\ast$($\ast$ \hyperlink{QSSP_8c_a2}{Unpack\-Ctx} )(\hyperlink{struct__QSSP__ctx}{QSSP\_\-ctx} $\ast$qssp, const \hyperlink{union__QSSP__efsCtxBdy}{QSSP\_\-efs\-Ctx\-Bdy} $\ast$bdy)
\begin{CompactList}\small\item\em Callback signature to unpack the statistics context. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
static \_\-\_\-inline \hyperlink{struct__QSSP__fileCache}{QSSP\_\-file\-Cache} $\ast$ \hyperlink{QSSP_8c_a3}{qssp\_\-file\_\-cache\_\-get} (void)
\begin{CompactList}\small\item\em Returns a pointer to the file cache. \item\end{CompactList}\item 
static \_\-\_\-inline void \hyperlink{QSSP_8c_a4}{qssp\_\-unpack\_\-did} (\hyperlink{struct__QSSP__ctxDid}{QSSP\_\-ctx\-Did} $\ast$did, const LSE\_\-did $\ast$src)
\begin{CompactList}\small\item\em Unpacks the {\em did\/} context. \item\end{CompactList}\item 
static \_\-\_\-inline void \hyperlink{QSSP_8c_a5}{qssp\_\-unpack\_\-ctx\_\-v0} (\hyperlink{struct__QSSP__ctx}{QSSP\_\-ctx} $\ast$ctx, const \hyperlink{struct__QSSP__efsCtxBdyV0}{QSSP\_\-efs\-Ctx\-Bdy\-V0} $\ast$v0)
\begin{CompactList}\small\item\em Unpacks version 0 of the context. \item\end{CompactList}\item 
static \_\-\_\-inline void \hyperlink{QSSP_8c_a6}{qssp\_\-unpack\_\-ctx\_\-v1} (\hyperlink{struct__QSSP__ctx}{QSSP\_\-ctx} $\ast$ctx, const \hyperlink{struct__QSSP__efsCtxBdyV1}{QSSP\_\-efs\-Ctx\-Bdy\-V1} $\ast$v1)
\begin{CompactList}\small\item\em Unpacks version 1 of the context. \item\end{CompactList}\item 
static \_\-\_\-inline void \hyperlink{QSSP_8c_a7}{qssp\_\-unpack\_\-ctx\_\-v2} (\hyperlink{struct__QSSP__ctx}{QSSP\_\-ctx} $\ast$ctx, const QSSP\_\-efs\-Ctx\-Bdy\-V2 $\ast$v2)
\begin{CompactList}\small\item\em Unpacks version 2 of the context. \item\end{CompactList}\item 
static \_\-\_\-inline unsigned long int \hyperlink{QSSP_8c_a8}{compute\_\-dsequence} (const \hyperlink{struct__QSSP__point}{QSSP\_\-point} $\ast$points)
\begin{CompactList}\small\item\em Computes the event sample size. \item\end{CompactList}\item 
static \_\-\_\-inline unsigned long long int \hyperlink{QSSP_8c_a9}{compute\_\-dtime} (const \hyperlink{struct__QSSP__point}{QSSP\_\-point} $\ast$points)
\begin{CompactList}\small\item\em Computes the event sample time span. \item\end{CompactList}\item 
static unsigned long long int \hyperlink{QSSP_8c_a10}{compute\_\-time} (const \hyperlink{struct__QSSP__point}{QSSP\_\-point} $\ast$point)
\begin{CompactList}\small\item\em Computes the time, in nanoseconds of the current time. If there is an error, -1 is returned;. \item\end{CompactList}\item 
static \_\-\_\-inline const unsigned int $\ast$ \hyperlink{QSSP_8c_a11}{copy\_\-point} (\hyperlink{struct__QSSP__point}{QSSP\_\-point} $\ast$point, const unsigned int $\ast$dat)
\begin{CompactList}\small\item\em Copies one QSSP\_\-point structure. \item\end{CompactList}\item 
static const unsigned int $\ast$ \hyperlink{QSSP_8c_a12}{decode\_\-points\_\-two} (\hyperlink{struct__QSSP}{QSSP} $\ast$qssp, \hyperlink{struct__QSSP__point}{QSSP\_\-point} $\ast$points, const unsigned int $\ast$dat, unsigned char bridge)
\begin{CompactList}\small\item\em Decodes two headers that are just straight copies. \item\end{CompactList}\item 
static const unsigned int $\ast$ \hyperlink{QSSP_8c_a13}{decode\_\-points\_\-one} (\hyperlink{struct__QSSP}{QSSP} $\ast$qssp, \hyperlink{struct__QSSP__point}{QSSP\_\-point} $\ast$points, const unsigned int $\ast$dat, unsigned char bridge)
\begin{CompactList}\small\item\em Decodes one header that is just a straight copy. \item\end{CompactList}\item 
static const unsigned int $\ast$ \hyperlink{QSSP_8c_a14}{decode\_\-timetone} (QSD\_\-timetone $\ast$timetone, const QSD\_\-timetone $\ast$base, const unsigned int $\ast$dat, int flags)
\begin{CompactList}\small\item\em Decodes one timetone structure based on the differences. \item\end{CompactList}\item 
static \_\-\_\-inline const unsigned int $\ast$ \hyperlink{QSSP_8c_a15}{decode\_\-points\_\-diff} (\hyperlink{struct__QSSP}{QSSP} $\ast$qssp, \hyperlink{struct__QSSP__point}{QSSP\_\-point} $\ast$points, const unsigned int $\ast$dat, unsigned char bridge)
\begin{CompactList}\small\item\em Decodes the sample point information when it is encoded as a difference from the previous point to the current point. \item\end{CompactList}\item 
static const unsigned int $\ast$ \hyperlink{QSSP_8c_a16}{decode\_\-stats\_\-norm} (\hyperlink{struct__QSSP}{QSSP} $\ast$qssp, \hyperlink{struct__QSSP__statistics}{QSSP\_\-statistics} $\ast$stats, const unsigned int $\ast$dat, unsigned char bridge)
\begin{CompactList}\small\item\em Decodes a normal (not differenced) statistics record. \item\end{CompactList}\item 
static const unsigned int $\ast$ \hyperlink{QSSP_8c_a17}{decode\_\-stats\_\-diff} (\hyperlink{struct__QSSP}{QSSP} $\ast$qssp, \hyperlink{struct__QSSP__statistics}{QSSP\_\-statistics} $\ast$stats, const unsigned int $\ast$dat, unsigned char bridge)
\begin{CompactList}\small\item\em Decodes the statistics in difference format. \item\end{CompactList}\item 
static const unsigned int $\ast$ \hyperlink{QSSP_8c_a18}{decode\_\-sample\_\-0} (\hyperlink{struct__QSSP}{QSSP} $\ast$qssp, \hyperlink{struct__QSSP__sample}{QSSP\_\-sample} $\ast$sample, const unsigned int $\ast$dat, unsigned char bridge)
\begin{CompactList}\small\item\em Decodes a format 0 sample record. \item\end{CompactList}\item 
static const unsigned int $\ast$ \hyperlink{QSSP_8c_a19}{decode\_\-sample\_\-1} (\hyperlink{struct__QSSP}{QSSP} $\ast$qssp, \hyperlink{struct__QSSP__sample}{QSSP\_\-sample} $\ast$sample, const unsigned int $\ast$dat, unsigned char bridge)
\begin{CompactList}\small\item\em Decodes a format 1 sample record. \item\end{CompactList}\item 
static const unsigned int $\ast$ \hyperlink{QSSP_8c_a20}{decode\_\-sample\_\-2} (\hyperlink{struct__QSSP}{QSSP} $\ast$qssp, \hyperlink{struct__QSSP__sample}{QSSP\_\-sample} $\ast$sample, const unsigned int $\ast$dat, unsigned char bridge)
\begin{CompactList}\small\item\em Decodes a format 2 sample record. \item\end{CompactList}\item 
static const LSF\_\-contribution $\ast$ \hyperlink{QSSP_8c_a21}{qssp\_\-update\_\-at\_\-datagram} (\hyperlink{struct__QSSP}{QSSP} $\ast$qssp, const LSF\_\-contribution $\ast$ctb, unsigned int hid)
\begin{CompactList}\small\item\em Updates the context for the datagram's contributions. \item\end{CompactList}\item 
\hyperlink{struct__QSSP}{QSSP} $\ast$ \hyperlink{QSSP_8c_a22}{QSSP\_\-alloc} (void $\ast$must\_\-be\_\-null)
\begin{CompactList}\small\item\em Allocates and constructs a QSSP handle. \item\end{CompactList}\item 
\hyperlink{struct__QSSP}{QSSP} $\ast$ \hyperlink{QSSP_8c_a23}{QSSP\_\-construct} (\hyperlink{struct__QSSP}{QSSP} $\ast$qssp, void $\ast$must\_\-be\_\-null)
\begin{CompactList}\small\item\em The constructor for a QSSP control structure. \item\end{CompactList}\item 
void \hyperlink{QSSP_8c_a24}{QSSP\_\-destruct} (\hyperlink{struct__QSSP}{QSSP} $\ast$qssp)
\begin{CompactList}\small\item\em The destructor for a QSSP control structure. \item\end{CompactList}\item 
const \hyperlink{struct__QSSP__ctx}{QSSP\_\-ctx} $\ast$ \hyperlink{QSSP_8c_a25}{QSSP\_\-ctx\-Get} (const \hyperlink{struct__QSSP}{QSSP} $\ast$qssp)
\begin{CompactList}\small\item\em Locates the statistics context (meta-data). \item\end{CompactList}\item 
int \hyperlink{QSSP_8c_a26}{QSSP\_\-sizeof} (void $\ast$must\_\-be\_\-null)
\begin{CompactList}\small\item\em Returns the size, in bytes, of a QSS control structure. \item\end{CompactList}\item 
const LSF\_\-contribution $\ast$ \hyperlink{QSSP_8c_a27}{QSSP\_\-update\-At\-Datagram} (\hyperlink{struct__QSSP}{QSSP} $\ast$qssp, const LSF\_\-datagram $\ast$dgm)
\begin{CompactList}\small\item\em Updates the context at datagram time. \item\end{CompactList}\item 
int \hyperlink{QSSP_8c_a28}{QSSP\_\-update\-At\-Contribution} (\hyperlink{struct__QSSP}{QSSP} $\ast$qssp, const LSF\_\-contribution $\ast$ctb)
\begin{CompactList}\small\item\em Updates the context at datagram time. \item\end{CompactList}\item 
static \_\-\_\-inline void \hyperlink{QSSP_8c_a29}{qssp\_\-sample\_\-add} (\hyperlink{struct__QSSP__sample}{QSSP\_\-sample} $\ast$dst, const \hyperlink{struct__QSSP__sample}{QSSP\_\-sample} $\ast$src)
\begin{CompactList}\small\item\em Adds the source sample to the destination sample. \item\end{CompactList}\item 
static \_\-\_\-inline int \hyperlink{QSSP_8c_a30}{qssp\_\-sample\_\-decode} (\hyperlink{struct__QSSP}{QSSP} $\ast$qssp, unsigned int type\_\-id, unsigned char bridge, const unsigned int $\ast$dat)
\begin{CompactList}\small\item\em Decodes the statistics data. \item\end{CompactList}\item 
int \hyperlink{QSSP_8c_a31}{QSSP\_\-update\-At\-Record} (\hyperlink{struct__QSSP}{QSSP} $\ast$qssp, const LSF\_\-record $\ast$rec)
\begin{CompactList}\small\item\em Updates the context at record time. \item\end{CompactList}\item 
const \hyperlink{struct__QSSP__sample}{QSSP\_\-sample} $\ast$ \hyperlink{QSSP_8c_a32}{QSSP\_\-retrieve} (const \hyperlink{struct__QSSP}{QSSP} $\ast$qssp)
\begin{CompactList}\small\item\em Retrieves the most recent sample, global or incremental that was processed. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Decodes the Science Statistics (Physics) for the handlers. 

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


\footnotesize\begin{verbatim}   CVS $Id: QSSP.c,v 1.1.1.1 2008/04/02 01:19:25 russell Exp $
\end{verbatim}
\normalsize


\subsection{Typedef Documentation}
\hypertarget{QSSP_8c_a1}{
\index{QSSP.c@{QSSP.c}!DecodeSample@{DecodeSample}}
\index{DecodeSample@{DecodeSample}!QSSP.c@{QSSP.c}}
\subsubsection[DecodeSample]{\setlength{\rightskip}{0pt plus 5cm}const unsigned int $\ast$($\ast$ \hyperlink{QSSP_8c_a1}{Decode\-Sample})(\hyperlink{struct__QSSP}{QSSP} $\ast$qssp, \hyperlink{struct__QSSP__sample}{QSSP\_\-sample} $\ast$sample, const unsigned int $\ast$dat, unsigned char bridge)}}
\label{QSSP_8c_a1}


Signature to decode a statistics sample from the input data. 

\begin{Desc}
\item[Returns:]The next decode location\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qssp}]The QSSP context handle \item[{\em sample}]The structure to receive the decoded data from \item[{\em dat}]The input data \item[{\em bridge}]The bridge word, contains decoding options\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a2}{
\index{QSSP.c@{QSSP.c}!UnpackCtx@{UnpackCtx}}
\index{UnpackCtx@{UnpackCtx}!QSSP.c@{QSSP.c}}
\subsubsection[UnpackCtx]{\setlength{\rightskip}{0pt plus 5cm}typedef void($\ast$ \hyperlink{QSSP_8c_a2}{Unpack\-Ctx})(\hyperlink{struct__QSSP__ctx}{QSSP\_\-ctx} $\ast$qssp, const \hyperlink{union__QSSP__efsCtxBdy}{QSSP\_\-efs\-Ctx\-Bdy} $\ast$bdy)}}
\label{QSSP_8c_a2}


Callback signature to unpack the statistics context. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qssp}]The destination context block to receive the unpacked dat \item[{\em bdy}]The source context block\end{description}
\end{Desc}


\subsection{Function Documentation}
\hypertarget{QSSP_8c_a8}{
\index{QSSP.c@{QSSP.c}!compute_dsequence@{compute\_\-dsequence}}
\index{compute_dsequence@{compute\_\-dsequence}!QSSP.c@{QSSP.c}}
\subsubsection[compute\_\-dsequence]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline unsigned long int compute\_\-dsequence (const \hyperlink{struct__QSSP__point}{QSSP\_\-point} $\ast$ {\em points})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSSP_8c_a8}


Computes the event sample size. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em points}]The beginning and ending event sample points\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a9}{
\index{QSSP.c@{QSSP.c}!compute_dtime@{compute\_\-dtime}}
\index{compute_dtime@{compute\_\-dtime}!QSSP.c@{QSSP.c}}
\subsubsection[compute\_\-dtime]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline unsigned long long int compute\_\-dtime (const \hyperlink{struct__QSSP__point}{QSSP\_\-point} $\ast$ {\em points})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSSP_8c_a9}


Computes the event sample time span. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em points}]The beginning and ending event sample points\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a10}{
\index{QSSP.c@{QSSP.c}!compute_time@{compute\_\-time}}
\index{compute_time@{compute\_\-time}!QSSP.c@{QSSP.c}}
\subsubsection[compute\_\-time]{\setlength{\rightskip}{0pt plus 5cm}static unsigned long long int compute\_\-time (const \hyperlink{struct__QSSP__point}{QSSP\_\-point} $\ast$ {\em point})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSSP_8c_a10}


Computes the time, in nanoseconds of the current time. If there is an error, -1 is returned;. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em point}]The sample point header to compute the time of\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a11}{
\index{QSSP.c@{QSSP.c}!copy_point@{copy\_\-point}}
\index{copy_point@{copy\_\-point}!QSSP.c@{QSSP.c}}
\subsubsection[copy\_\-point]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline unsigned int $\ast$ copy\_\-point (\hyperlink{struct__QSSP__point}{QSSP\_\-point} $\ast$ {\em point}, const unsigned int $\ast$ {\em dat})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSSP_8c_a11}


Copies one QSSP\_\-point structure. 

\begin{Desc}
\item[Returns:]Pointer to the next decode address\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em point}]The target sample point structure \item[{\em dat}]The source data\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a15}{
\index{QSSP.c@{QSSP.c}!decode_points_diff@{decode\_\-points\_\-diff}}
\index{decode_points_diff@{decode\_\-points\_\-diff}!QSSP.c@{QSSP.c}}
\subsubsection[decode\_\-points\_\-diff]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline const unsigned int $\ast$ decode\_\-points\_\-diff (\hyperlink{struct__QSSP}{QSSP} $\ast$ {\em qssp}, \hyperlink{struct__QSSP__point}{QSSP\_\-point} $\ast$ {\em points}, const unsigned int $\ast$ {\em dat}, unsigned char {\em bridge})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSSP_8c_a15}


Decodes the sample point information when it is encoded as a difference from the previous point to the current point. 

\begin{Desc}
\item[Returns:]The next location to continue the decoding\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qssp}]The decoding context \item[{\em points}]The structure to receive the sample points \item[{\em dat}]The input data to decode from \item[{\em bridge}]The record's bridge word\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a13}{
\index{QSSP.c@{QSSP.c}!decode_points_one@{decode\_\-points\_\-one}}
\index{decode_points_one@{decode\_\-points\_\-one}!QSSP.c@{QSSP.c}}
\subsubsection[decode\_\-points\_\-one]{\setlength{\rightskip}{0pt plus 5cm}static const unsigned int decode\_\-points\_\-one (\hyperlink{struct__QSSP}{QSSP} $\ast$ {\em qssp}, \hyperlink{struct__QSSP__point}{QSSP\_\-point} $\ast$ {\em points}, const unsigned int $\ast$ {\em dat}, unsigned char {\em bridge})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSSP_8c_a13}


Decodes one header that is just a straight copy. 

\begin{Desc}
\item[Returns:]The next address to decode from\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qssp}]The decoding context \item[{\em points}]The structure to receive the sample points \item[{\em dat}]The input data to decode from \item[{\em bridge}]The record's bridge word\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a12}{
\index{QSSP.c@{QSSP.c}!decode_points_two@{decode\_\-points\_\-two}}
\index{decode_points_two@{decode\_\-points\_\-two}!QSSP.c@{QSSP.c}}
\subsubsection[decode\_\-points\_\-two]{\setlength{\rightskip}{0pt plus 5cm}static const unsigned int decode\_\-points\_\-two (\hyperlink{struct__QSSP}{QSSP} $\ast$ {\em qssp}, \hyperlink{struct__QSSP__point}{QSSP\_\-point} $\ast$ {\em points}, const unsigned int $\ast$ {\em dat}, unsigned char {\em bridge})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSSP_8c_a12}


Decodes two headers that are just straight copies. 

\begin{Desc}
\item[Returns:]The next address to decode from\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qssp}]The decoding context \item[{\em points}]The structures to receive the decode sample points \item[{\em dat}]The input data to decode from \item[{\em bridge}]The record's bridge word\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a18}{
\index{QSSP.c@{QSSP.c}!decode_sample_0@{decode\_\-sample\_\-0}}
\index{decode_sample_0@{decode\_\-sample\_\-0}!QSSP.c@{QSSP.c}}
\subsubsection[decode\_\-sample\_\-0]{\setlength{\rightskip}{0pt plus 5cm}static const unsigned int $\ast$ decode\_\-sample\_\-0 (\hyperlink{struct__QSSP}{QSSP} $\ast$ {\em qssp}, \hyperlink{struct__QSSP__sample}{QSSP\_\-sample} $\ast$ {\em sample}, const unsigned int $\ast$ {\em dat}, unsigned char {\em bridge})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSSP_8c_a18}


Decodes a format 0 sample record. 

\begin{Desc}
\item[Returns:]The next address to decode from\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qssp}]The decoding context \item[{\em sample}]The data structure to receive the decoded statistics \item[{\em dat}]The statistics data \item[{\em bridge}]The record's bridge word\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a19}{
\index{QSSP.c@{QSSP.c}!decode_sample_1@{decode\_\-sample\_\-1}}
\index{decode_sample_1@{decode\_\-sample\_\-1}!QSSP.c@{QSSP.c}}
\subsubsection[decode\_\-sample\_\-1]{\setlength{\rightskip}{0pt plus 5cm}static const unsigned int $\ast$ decode\_\-sample\_\-1 (\hyperlink{struct__QSSP}{QSSP} $\ast$ {\em qssp}, \hyperlink{struct__QSSP__sample}{QSSP\_\-sample} $\ast$ {\em sample}, const unsigned int $\ast$ {\em dat}, unsigned char {\em bridge})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSSP_8c_a19}


Decodes a format 1 sample record. 

\begin{Desc}
\item[Returns:]The next address to decode from\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qssp}]The decoding context \item[{\em sample}]The data structure to receive the decoded statistics \item[{\em dat}]The statistics data \item[{\em bridge}]The record's bridge word\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a20}{
\index{QSSP.c@{QSSP.c}!decode_sample_2@{decode\_\-sample\_\-2}}
\index{decode_sample_2@{decode\_\-sample\_\-2}!QSSP.c@{QSSP.c}}
\subsubsection[decode\_\-sample\_\-2]{\setlength{\rightskip}{0pt plus 5cm}static const unsigned int $\ast$ decode\_\-sample\_\-2 (\hyperlink{struct__QSSP}{QSSP} $\ast$ {\em qssp}, \hyperlink{struct__QSSP__sample}{QSSP\_\-sample} $\ast$ {\em sample}, const unsigned int $\ast$ {\em dat}, unsigned char {\em bridge})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSSP_8c_a20}


Decodes a format 2 sample record. 

\begin{Desc}
\item[Returns:]The next address to decode from\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qssp}]The decoding context \item[{\em sample}]The data structure to receive the decoded statistics \item[{\em dat}]The statistics data \item[{\em bridge}]The record's bridge word\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a17}{
\index{QSSP.c@{QSSP.c}!decode_stats_diff@{decode\_\-stats\_\-diff}}
\index{decode_stats_diff@{decode\_\-stats\_\-diff}!QSSP.c@{QSSP.c}}
\subsubsection[decode\_\-stats\_\-diff]{\setlength{\rightskip}{0pt plus 5cm}static const unsigned int $\ast$ decode\_\-stats\_\-diff (\hyperlink{struct__QSSP}{QSSP} $\ast$ {\em qssp}, \hyperlink{struct__QSSP__statistics}{QSSP\_\-statistics} $\ast$ {\em stats}, const unsigned int $\ast$ {\em dat}, unsigned char {\em bridge})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSSP_8c_a17}


Decodes the statistics in difference format. 

\begin{Desc}
\item[Returns:]The next address to decode from\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qssp}]The decoding context \item[{\em stats}]The data structure to receive the decoded statistics \item[{\em dat}]The statistics data \item[{\em bridge}]The record's bridge word\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a16}{
\index{QSSP.c@{QSSP.c}!decode_stats_norm@{decode\_\-stats\_\-norm}}
\index{decode_stats_norm@{decode\_\-stats\_\-norm}!QSSP.c@{QSSP.c}}
\subsubsection[decode\_\-stats\_\-norm]{\setlength{\rightskip}{0pt plus 5cm}static const unsigned int $\ast$ decode\_\-stats\_\-norm (\hyperlink{struct__QSSP}{QSSP} $\ast$ {\em qssp}, \hyperlink{struct__QSSP__statistics}{QSSP\_\-statistics} $\ast$ {\em stats}, const unsigned int $\ast$ {\em dat}, unsigned char {\em bridge})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSSP_8c_a16}


Decodes a normal (not differenced) statistics record. 

\begin{Desc}
\item[Returns:]The next address to decode from\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qssp}]The decoding context \item[{\em stats}]The data structure to receive the decoded statistics \item[{\em dat}]The statistics data \item[{\em bridge}]The record's bridge word\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a14}{
\index{QSSP.c@{QSSP.c}!decode_timetone@{decode\_\-timetone}}
\index{decode_timetone@{decode\_\-timetone}!QSSP.c@{QSSP.c}}
\subsubsection[decode\_\-timetone]{\setlength{\rightskip}{0pt plus 5cm}static const unsigned int $\ast$ decode\_\-timetone (QSD\_\-timetone $\ast$ {\em timetone}, const QSD\_\-timetone $\ast$ {\em base}, const unsigned int $\ast$ {\em dat}, int {\em flags})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSSP_8c_a14}


Decodes one timetone structure based on the differences. 

\begin{Desc}
\item[Returns:]The next address to decode from\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em timetone}]The target timetone record \item[{\em base}]The base timetone record. The decoded differences will be added to this structure \item[{\em dat}]The data to be decoded \item[{\em flags}]Flags used to interpret the data to be decoded\begin{itemize}
\item Bit 0 indicates the absolute Spectrum-Astro Epoch time in seconds is encoded in the the data\item Bit 1 indicates the time actual timetone flags are stored in the data\end{itemize}
\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a22}{
\index{QSSP.c@{QSSP.c}!QSSP_alloc@{QSSP\_\-alloc}}
\index{QSSP_alloc@{QSSP\_\-alloc}!QSSP.c@{QSSP.c}}
\subsubsection[QSSP\_\-alloc]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{struct__QSSP}{QSSP} $\ast$ QSSP\_\-alloc (void $\ast$ {\em must\_\-be\_\-null})}}
\label{QSSP_8c_a22}


Allocates and constructs a QSSP handle. 

\begin{Desc}
\item[Returns:]Pointer to the allocated handle\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em must\_\-be\_\-null}]Reserved for future use.\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a23}{
\index{QSSP.c@{QSSP.c}!QSSP_construct@{QSSP\_\-construct}}
\index{QSSP_construct@{QSSP\_\-construct}!QSSP.c@{QSSP.c}}
\subsubsection[QSSP\_\-construct]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{struct__QSSP}{QSSP} $\ast$ QSSP\_\-construct (\hyperlink{struct__QSSP}{QSSP} $\ast$ {\em qssp}, void $\ast$ {\em must\_\-be\_\-null})}}
\label{QSSP_8c_a23}


The constructor for a QSSP control structure. 

\begin{Desc}
\item[Returns:]Pointer to the QSS control structure\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qssp}]The control structure to be constructed. If NULL, a control structure will be allocated \item[{\em must\_\-be\_\-null}]Reserved for future use.\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a25}{
\index{QSSP.c@{QSSP.c}!QSSP_ctxGet@{QSSP\_\-ctxGet}}
\index{QSSP_ctxGet@{QSSP\_\-ctxGet}!QSSP.c@{QSSP.c}}
\subsubsection[QSSP\_\-ctxGet]{\setlength{\rightskip}{0pt plus 5cm}const \hyperlink{struct__QSSP__ctx}{QSSP\_\-ctx} $\ast$ QSSP\_\-ctx\-Get (const \hyperlink{struct__QSSP}{QSSP} $\ast$ {\em qssp})}}
\label{QSSP_8c_a25}


Locates the statistics context (meta-data). 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qssp}]The statistics context\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a24}{
\index{QSSP.c@{QSSP.c}!QSSP_destruct@{QSSP\_\-destruct}}
\index{QSSP_destruct@{QSSP\_\-destruct}!QSSP.c@{QSSP.c}}
\subsubsection[QSSP\_\-destruct]{\setlength{\rightskip}{0pt plus 5cm}void QSSP\_\-destruct (\hyperlink{struct__QSSP}{QSSP} $\ast$ {\em qssp})}}
\label{QSSP_8c_a24}


The destructor for a QSSP control structure. 

\begin{Desc}
\item[Returns:]Pointer to the QSS control structure\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qssp}]The control structure to be destructed.\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a3}{
\index{QSSP.c@{QSSP.c}!qssp_file_cache_get@{qssp\_\-file\_\-cache\_\-get}}
\index{qssp_file_cache_get@{qssp\_\-file\_\-cache\_\-get}!QSSP.c@{QSSP.c}}
\subsubsection[qssp\_\-file\_\-cache\_\-get]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline \hyperlink{struct__QSSP__fileCache}{QSSP\_\-file\-Cache} $\ast$ qssp\_\-file\_\-cache\_\-get (void)\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSSP_8c_a3}


Returns a pointer to the file cache. 

\begin{Desc}
\item[Returns:]The file cache\end{Desc}
This routine return the handle, creating it if necessary. This not really the right architecture. This needs to be part of a QSS global environment. This can't be accomplished at this time because it would require a backwardly incompatiable change to QSSP\_\-construct.\hypertarget{QSSP_8c_a32}{
\index{QSSP.c@{QSSP.c}!QSSP_retrieve@{QSSP\_\-retrieve}}
\index{QSSP_retrieve@{QSSP\_\-retrieve}!QSSP.c@{QSSP.c}}
\subsubsection[QSSP\_\-retrieve]{\setlength{\rightskip}{0pt plus 5cm}const \hyperlink{struct__QSSP__sample}{QSSP\_\-sample} $\ast$ QSSP\_\-retrieve (const \hyperlink{struct__QSSP}{QSSP} $\ast$ {\em qssp})}}
\label{QSSP_8c_a32}


Retrieves the most recent sample, global or incremental that was processed. 

\begin{Desc}
\item[Returns:]Pointer to the sample\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qssp}]The statistics context\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a29}{
\index{QSSP.c@{QSSP.c}!qssp_sample_add@{qssp\_\-sample\_\-add}}
\index{qssp_sample_add@{qssp\_\-sample\_\-add}!QSSP.c@{QSSP.c}}
\subsubsection[qssp\_\-sample\_\-add]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline void qssp\_\-sample\_\-add (\hyperlink{struct__QSSP__sample}{QSSP\_\-sample} $\ast$ {\em dst}, const \hyperlink{struct__QSSP__sample}{QSSP\_\-sample} $\ast$ {\em src})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSSP_8c_a29}


Adds the source sample to the destination sample. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dst}]The destination sample \item[{\em src}]The source sample\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a30}{
\index{QSSP.c@{QSSP.c}!qssp_sample_decode@{qssp\_\-sample\_\-decode}}
\index{qssp_sample_decode@{qssp\_\-sample\_\-decode}!QSSP.c@{QSSP.c}}
\subsubsection[qssp\_\-sample\_\-decode]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline int qssp\_\-sample\_\-decode (\hyperlink{struct__QSSP}{QSSP} $\ast$ {\em qssp}, unsigned int {\em type\_\-id}, unsigned char {\em bridge}, const unsigned int $\ast$ {\em dat})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSSP_8c_a30}


Decodes the statistics data. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em If}]not negative, then the sample type (QSSP\_\-TYPE\_\-K) \item[{\em If}]negative\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qssp}]The QSSP context handle \item[{\em type\_\-id}]0 = just the set of values 1 = the difference between the current and last set \item[{\em bridge}]bit 0 0 = normal record; 1 = global record \item[{\em dat}]The statistics data\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a26}{
\index{QSSP.c@{QSSP.c}!QSSP_sizeof@{QSSP\_\-sizeof}}
\index{QSSP_sizeof@{QSSP\_\-sizeof}!QSSP.c@{QSSP.c}}
\subsubsection[QSSP\_\-sizeof]{\setlength{\rightskip}{0pt plus 5cm}int QSSP\_\-sizeof (void $\ast$ {\em must\_\-be\_\-null})}}
\label{QSSP_8c_a26}


Returns the size, in bytes, of a QSS control structure. 

\begin{Desc}
\item[Returns:]The size, in bytes, of a QSS control structure\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em must\_\-be\_\-null}]Parameter reserved for future use\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a5}{
\index{QSSP.c@{QSSP.c}!qssp_unpack_ctx_v0@{qssp\_\-unpack\_\-ctx\_\-v0}}
\index{qssp_unpack_ctx_v0@{qssp\_\-unpack\_\-ctx\_\-v0}!QSSP.c@{QSSP.c}}
\subsubsection[qssp\_\-unpack\_\-ctx\_\-v0]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline void qssp\_\-unpack\_\-ctx\_\-v0 (\hyperlink{struct__QSSP__ctx}{QSSP\_\-ctx} $\ast$ {\em ctx}, const \hyperlink{struct__QSSP__efsCtxBdyV0}{QSSP\_\-efs\-Ctx\-Bdy\-V0} $\ast$ {\em v0})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSSP_8c_a5}


Unpacks version 0 of the context. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ctx}]The destination context \item[{\em v0}]The source context\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a6}{
\index{QSSP.c@{QSSP.c}!qssp_unpack_ctx_v1@{qssp\_\-unpack\_\-ctx\_\-v1}}
\index{qssp_unpack_ctx_v1@{qssp\_\-unpack\_\-ctx\_\-v1}!QSSP.c@{QSSP.c}}
\subsubsection[qssp\_\-unpack\_\-ctx\_\-v1]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline void qssp\_\-unpack\_\-ctx\_\-v1 (\hyperlink{struct__QSSP__ctx}{QSSP\_\-ctx} $\ast$ {\em ctx}, const \hyperlink{struct__QSSP__efsCtxBdyV1}{QSSP\_\-efs\-Ctx\-Bdy\-V1} $\ast$ {\em v1})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSSP_8c_a6}


Unpacks version 1 of the context. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ctx}]The destination context \item[{\em v1}]The source context\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a7}{
\index{QSSP.c@{QSSP.c}!qssp_unpack_ctx_v2@{qssp\_\-unpack\_\-ctx\_\-v2}}
\index{qssp_unpack_ctx_v2@{qssp\_\-unpack\_\-ctx\_\-v2}!QSSP.c@{QSSP.c}}
\subsubsection[qssp\_\-unpack\_\-ctx\_\-v2]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline void qssp\_\-unpack\_\-ctx\_\-v2 (\hyperlink{struct__QSSP__ctx}{QSSP\_\-ctx} $\ast$ {\em ctx}, const QSSP\_\-efs\-Ctx\-Bdy\-V2 $\ast$ {\em v2})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSSP_8c_a7}


Unpacks version 2 of the context. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ctx}]The destination context \item[{\em v2}]The source context\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a4}{
\index{QSSP.c@{QSSP.c}!qssp_unpack_did@{qssp\_\-unpack\_\-did}}
\index{qssp_unpack_did@{qssp\_\-unpack\_\-did}!QSSP.c@{QSSP.c}}
\subsubsection[qssp\_\-unpack\_\-did]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline void qssp\_\-unpack\_\-did (\hyperlink{struct__QSSP__ctxDid}{QSSP\_\-ctx\-Did} $\ast$ {\em did}, const LSE\_\-did $\ast$ {\em src})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSSP_8c_a4}


Unpacks the {\em did\/} context. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em did}]The destination {\em did\/} \item[{\em src}]The source {\em did\/} \end{description}
\end{Desc}
\hypertarget{QSSP_8c_a21}{
\index{QSSP.c@{QSSP.c}!qssp_update_at_datagram@{qssp\_\-update\_\-at\_\-datagram}}
\index{qssp_update_at_datagram@{qssp\_\-update\_\-at\_\-datagram}!QSSP.c@{QSSP.c}}
\subsubsection[qssp\_\-update\_\-at\_\-datagram]{\setlength{\rightskip}{0pt plus 5cm}static const LSF\_\-contribution $\ast$ qssp\_\-update\_\-at\_\-datagram (\hyperlink{struct__QSSP}{QSSP} $\ast$ {\em qssp}, const LSF\_\-contribution $\ast$ {\em ctb}, unsigned int {\em hid})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSSP_8c_a21}


Updates the context for the datagram's contributions. 

\begin{Desc}
\item[Returns:]Pointer to the next contribution after the datagram's contributions\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qssp}]The QSSP context handle \item[{\em ctb}]The datagram's contributions \item[{\em hid}]The handler identity\end{description}
\end{Desc}
\begin{Desc}
\item[]This routine processes the contributions that rightfully belong to the datagram. In the QSEP datagrams, these are called the root contributions. For the QSSP datagrams, I rethought this issue and decided that while the root contribution is a good idea, I had implemented incorrectly. What QSSP does is let the update at datagram time consume those contributes it believes rightfully belong to it.\end{Desc}
\begin{Desc}
\item[]So that the user knows that these have been processed, this routine returns the next contribution after the datagram's contributions.\end{Desc}
\hypertarget{QSSP_8c_a28}{
\index{QSSP.c@{QSSP.c}!QSSP_updateAtContribution@{QSSP\_\-updateAtContribution}}
\index{QSSP_updateAtContribution@{QSSP\_\-updateAtContribution}!QSSP.c@{QSSP.c}}
\subsubsection[QSSP\_\-updateAtContribution]{\setlength{\rightskip}{0pt plus 5cm}int QSSP\_\-update\-At\-Contribution (\hyperlink{struct__QSSP}{QSSP} $\ast$ {\em qssp}, const LSF\_\-contribution $\ast$ {\em ctb})}}
\label{QSSP_8c_a28}


Updates the context at datagram time. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em If}]have a statistics sample contribution, the number of records in the contribution. \item[{\em $>$0,if}]have a record contributor \item[{\em =0,if}]have the contribution context \item[{\em -1,if}]unrecognized\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qssp}]The statistics context to update. \item[{\em ctb}]The statistics contribution\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a27}{
\index{QSSP.c@{QSSP.c}!QSSP_updateAtDatagram@{QSSP\_\-updateAtDatagram}}
\index{QSSP_updateAtDatagram@{QSSP\_\-updateAtDatagram}!QSSP.c@{QSSP.c}}
\subsubsection[QSSP\_\-updateAtDatagram]{\setlength{\rightskip}{0pt plus 5cm}const LSF\_\-contribution $\ast$ QSSP\_\-update\-At\-Datagram (\hyperlink{struct__QSSP}{QSSP} $\ast$ {\em qssp}, const LSF\_\-datagram $\ast$ {\em dgm})}}
\label{QSSP_8c_a27}


Updates the context at datagram time. 

\begin{Desc}
\item[Returns:]The contribution to resume processsing at\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qssp}]The statistics context to update. \item[{\em dgm}]The statistics datagram\end{description}
\end{Desc}
\hypertarget{QSSP_8c_a31}{
\index{QSSP.c@{QSSP.c}!QSSP_updateAtRecord@{QSSP\_\-updateAtRecord}}
\index{QSSP_updateAtRecord@{QSSP\_\-updateAtRecord}!QSSP.c@{QSSP.c}}
\subsubsection[QSSP\_\-updateAtRecord]{\setlength{\rightskip}{0pt plus 5cm}int QSSP\_\-update\-At\-Record (\hyperlink{struct__QSSP}{QSSP} $\ast$ {\em qssp}, const LSF\_\-record $\ast$ {\em rec})}}
\label{QSSP_8c_a31}


Updates the context at record time. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em Non-negative}]values indicate are one of the QSSP\_\-type's \item[{\em Negative}]values indicate an unsuccessful update\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qssp}]The statistics context to update. \item[{\em rec}]The statistics record\end{description}
\end{Desc}
