GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > ASC / dev
Constituent: test_ascOes     Tag: sun-gcc
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "PBS/TMR.h"
#include "PBS/PTS.h"
#include "PBS/MBA.h"
#include "ASC/ASC.h"
#include "ASC/ASC_dbg.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include "PBI/Endianness.h"
Include dependency graph for test_asc.c:
Data Structures | |
struct | _AscTiming |
Keep track of the elapsed times. More... | |
struct | _GetCtx |
Structure to hold the context for retrieving a pointer to the next input file. More... | |
struct | _Ctl |
Collections all the control parameters together. These are essentially the interpretted command line options. More... | |
struct | _EBF_file |
Internal structure used to control the access to a EBF file. More... | |
Defines | |
#define | _ADVANCE(_ptr, _nbytes) (void *)((unsigned char *)(_ptr) + (_nbytes)) |
Advances _ptr by _nbytes. The return value is always recast to the type of _ptr. | |
Typedefs | |
typedef _EBF_file | EBF_file |
Typedef for struct _EBF_file. | |
typedef _AscTiming | AscTiming |
Typedef for struct _AscTiming. | |
typedef _Ctl | Ctl |
Typedef for struct _Ctl. | |
typedef const char *(* | Get_filename )(void *ctx) |
Typedef of the callback routine to retrieve the next input file name. | |
typedef _GetCtx | GetCtx |
Typedef for struct _GetCtx. | |
Functions | |
_EBF_file * | EBF_open (const char *fileName, int segment_size) |
Opens a EBF file for reading. | |
_EBF_file * | EBF_dmap (unsigned int *ebd) |
Prepares an in memory data structure to be read. | |
int | EBF_read (EBF_file *ebf) |
Reads the EBF file associated with the event file handle ebf. | |
int | EBF_close (EBF_file *ebf) |
Closes the file after it has been read. | |
int | EBF_free (EBF_file *ebf) |
Frees the memory associated with the contents of the file. | |
unsigned int | EBF_esize (const EBF_file *ebf) |
Returns the size of the event data (in bytes). | |
const unsigned int * | EBF_edata (const EBF_file *ebf) |
Returns a pointer to the first event. | |
static int | do_it (Ctl *ctl) |
Simple driver program to setup, accumulate and print the statistics. | |
static int | accumulate (ASC_counters *counters, AscTiming *timing, Ctl *ctl) |
Loops through the input files one at a time, calling the accumulation routine. | |
static int | finalize (ASC_counters *counters) |
Completes the statistics arrays by performing one time summary operations. | |
static void | print (unsigned int options, const ASC_counters *counters, const AscTiming *timing) |
Prints the statistics and timing information. | |
static void | printTiming (const AscTiming *timing) |
Prints the timing information. | |
static int | acc_acd_stats (ASC_counters *counters, AscTiming *timing, struct _ASC_acd *acd, const unsigned int *edata, int esize, int ecnt, int eoffset) |
Accumulates the statistics for the specified array of events. | |
static int | fill_ctl (Ctl *ctl, int argc, char *const argv[]) |
Examines the command line parameters and fills the print control structure. | |
static const char * | get_filename (GetCtx *ctx) |
User provide callback routine to retrieve the next input file. | |
int | main (int argc, char *const argv[]) |
Usual entry point for the test_asc. | |
Variables | |
const unsigned int | EbfData [] |
A small set of test data. |
* $ test_asc -n <number_of_events> <input_files> *
* CVS $Id: test_asc.c,v 1.1.1.1 2005/12/01 21:55:31 ebacho Exp $ * *
|
Advances _ptr by _nbytes. The return value is always recast to the type of _ptr.
|
|
Accumulates the statistics for the specified array of events.
|
|
Loops through the input files one at a time, calling the accumulation routine.
|
|
Simple driver program to setup, accumulate and print the statistics.
|
|
Closes the file after it has been read. This function only closes the file after its contents have been read into memory. To free the memory associated with the contents of the file, the user must call EBF_free(). |
|
Prepares an in memory data structure to be read.
|
|
Returns a pointer to the first event. This function is called after EBF_read to locate the first event. Subsequent events are found by advancing this pointer by the size of the event. The size of the event is stored in the first 32-bit word of the event. |
|
Frees the memory associated with the contents of the file.
|
|
Opens a EBF file for reading.
|
|
Reads the EBF file associated with the event file handle ebf.
|
|
Examines the command line parameters and fills the print control structure.
|
|
Completes the statistics arrays by performing one time summary operations.
|
|
User provide callback routine to retrieve the next input file.
|
|
Usual entry point for the test_asc.
* $ test_asc myEventFile.ebf 4 * * Accumulates the statistics for the the 4 events * * |
|
Prints the statistics and timing information.
|
|
Prints the timing information.
|