GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EDS / V2-11-5 > ebf_extract / rhel5-32


Interface   Data Structures   File List   Data Fields   Globals  

ebf_extract.c File Reference

Read an EBF file and extracts events with, potentially, a different packet size. More...

#include <EDS/ESS.h>
#include <EDS/EDS_fw.h>
#include <EDS/EBF_siv.h>
#include <EDS/EBF_dir.h>
#include <EDS/EBF_edw.h>
#include <EDS/LCBV.h>
#include <EDS/io/LCBP.h>
#include <EDS/io/ESX.h>
#include <EDS/io/EBF_stream.h>
#include <stdlib.h>
#include <stdio.h>

Classes

struct  _Ctl
 Collections all the control parameters together. These are essentially the interpretted command line options. More...
struct  _Ctx
 The file writing context. More...

Typedefs

typedef struct _EBF_dir EBF_dir
typedef struct _Ctl Ctl
 Typedef for struct _Ctl.
typedef struct _Ctx Ctx
 Typedef for struct _Ctx.

Functions

static unsigned int ebf_extract (Ctl *ctl)
 Finishes the platform common setup and initalization, starts the packet flow.
static void report_usage (int verbose)
 Brief explanation on ebf_extract usage.
static int fill_ctl (Ctl *ctl, int argc, char *const argv[])
 Examines the command line parameters and fills the print control structure.
static int extract (Ctx *ctx, unsigned int edw, EBF_pkt *pkt)
 Writes each event to the output stream.
int main (int argc, char *const argv[])
 Usual entry point for the readtest.


Detailed Description

Read an EBF file and extracts events with, potentially, a different packet size.

Author:
JJRussell - russell@slac.stanford.edu
$ ebf_extract -n<# of events> -s<# to skip> -b<block_size> -o<out.ebf> <in.ebf>
   
    CVS $Id: ebf_extract.c,v 1.4 2011/03/25 22:16:56 russell Exp $
   

Function Documentation

static unsigned int ebf_extract ( Ctl ctl  )  [static]

Finishes the platform common setup and initalization, starts the packet flow.

Parameters:
ctl The control structure

References _Ctx::dir, _Ctl::ess, _Ctx::ess, _Ctl::esx, _Ctx::esx, extract(), _Ctl::inames, _Ctx::n_ievts, _Ctx::n_oevts, _Ctx::siv, _Ctl::to_process, _Ctl::to_skip, _Ctl::to_write, _Ctx::to_write, and _Ctl::verbose.

Referenced by main().

int extract ( Ctx ctx,
unsigned int  edw,
EBF_pkt pkt 
) [static]

Writes each event to the output stream.

Parameters:
ctx Context structure, holding the current buffer state, buffer contents and output stream handle
edw Event Builder Word
pkt The packet to process

References _Ctx::dir, EBF__edwPktSize(), _Ctx::ess, _Ctx::esx, _EBF_dirRedux::evt_len, _Ctx::n_ievts, _Ctx::n_oevts, _EBF_dirTruncated::npktDscs, _EBF_dir::redux, _Ctx::siv, _Ctx::to_write, and _EBF_dir::truncated.

Referenced by ebf_extract().

static int fill_ctl ( Ctl ctl,
int  argc,
char *const   argv[] 
) [static]

Examines the command line parameters and fills the print control structure.

Parameters:
ctl The parameter control block.
argc The number of command line parameters.
argv The array of pointers to the command line parameters.
Return values:
0,Everything is okay.
-1,Incorrect command usage. Usually this means that the input file name was absent.

References _Ctl::bsize, _Ctl::ess, ESS_LOGIC_K_AND, _Ctl::esx, _Ctl::inames, report_usage(), _Ctl::to_process, _Ctl::to_skip, _Ctl::to_write, and _Ctl::verbose.

Referenced by main().

int main ( int  argc,
char *const   argv[] 
)

Usual entry point for the readtest.

Parameters:
argc The number of arguments
argv The vector of arguments.
For usage type ebf_extract with no arguments

References ebf_extract(), and fill_ctl().


Generated on Tue Nov 29 19:49:25 2011 by  doxygen 1.5.8