GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > EDS / V2-10-0
Constituent: ebf2c     Tag: linux-gcc
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "EDS/io/EBF_swap.h"
#include "EDS/io/EBF_stream.h"
#include "EDS/io/EBF_evts.h"
#include "EDS/EBF_evt.h"

Classes | |
| struct | _Ctl |
| Collections all the control parameters together. These are essentially the interpretted command line options. More... | |
Defines | |
| #define | _ADVANCE(_ptr, _nbytes) (typeof (_ptr))((unsigned char *)(_ptr) + (_nbytes)) |
| Advances _ptr by _nbytes. The return value is always recast to the type of _ptr. | |
Typedefs | |
| typedef struct _Ctl | Ctl |
| Typedef for struct _Ctl. | |
Functions | |
| int | main (int argc, char **argv) |
| Entry point for filter. | |
| static int | fillCtl (int argc, char *argv[], Ctl *ctl) |
| Examines the command line parameters and fills the print control structure. | |
| static void | printCtl (const Ctl *ctl) |
| Prints the contents of the print control context. | |
| static int | convert (const Ctl *ctl) |
| converts the .ebf to an output .c file | |
| static void | reportUsage (void) |
| Describes the command line parameters for daqeb_print. | |
| static const char * | constructCname (const char *iname) |
| Returns a pointer to the name of the output file. | |
| static const char * | constructDname (const char *cname) |
| Returns a pointer to the name of data structure. | |
| static __inline EBF_evts | setupEvents (EBF_evts evts, int maxevts, int nskip, int *nevts) |
| Skips to the first event to be output. | |
| static void | printHeader (FILE *cfile, const char *iname, const char *dname, int totsize) |
| Prints the C file heading. | |
| static void | printEvents (FILE *cfile, EBF_evts evts, int nevts) |
| Writes out the data, ASCII, for the each event. | |
| static void | printTrailer (FILE *cfile) |
| Adds the trailer to words to the output file. | |
| static __inline const unsigned int * | printWrds (FILE *cfile, const unsigned int *wrds, int nwrds) |
| Prints the array of 32-bit words in to the output file. | |
CVS $Id: ebf2c.c,v 1.3 2005/10/13 22:01:00 russell Exp $
| #define _ADVANCE | ( | _ptr, | |||
| _nbytes | ) | (typeof (_ptr))((unsigned char *)(_ptr) + (_nbytes)) |
Advances _ptr by _nbytes. The return value is always recast to the type of _ptr.
| _ptr | The pointer to advance | |
| _nbytes | The number of nbytes to advance _ptr by. |
| static const char * constructCname | ( | const char * | iname | ) | [static] |
Returns a pointer to the name of the output file.
| iname | The name of the input file |
| static const char * constructDname | ( | const char * | cname | ) | [static] |
Returns a pointer to the name of data structure.
| cname | The name of the output "C" file |
| static int convert | ( | const Ctl * | ctl | ) | [static] |
converts the .ebf to an output .c file
| ctl | The control parameters, assumed to be already filled in |
| static int fillCtl | ( | int | argc, | |
| char * | argv[], | |||
| Ctl * | ctl | |||
| ) | [static] |
Examines the command line parameters and fills the print control structure.
| argc | The number of command line parameters. | |
| argv | The array of pointers to the command line parameters. | |
| ctl | The run time parameters control block to be filled. |
| 0,Everything | is okay. | |
| -1,Incorrect | command usage. Usually this means that the input file name was absent. |
$> ebf2c -n10 -s5 -c my_file.c my_file.ebf
Skips 5 events, then processes the next 10 of my_file.ebf. The output is rewritten to my_file.c
| int main | ( | int | argc, | |
| char ** | argv | |||
| ) |
Entry point for filter.
| argc | Standard argument count. | |
| argv | Standard vector of command line parameter strings. |
| 0,if | successful -1, if the file does not exist or some other internal error. |
| static void printCtl | ( | const Ctl * | ctl | ) | [static] |
Prints the contents of the print control context.
| ctl | Pointer to the print control context block. |
| static void printEvents | ( | FILE * | cfile, | |
| EBF_evts | evts, | |||
| int | nevts | |||
| ) | [static] |
Writes out the data, ASCII, for the each event.
| cfile | The output file stream. | |
| evts | The array of events to write out | |
| nevts | The number of events to write out |
| static void printHeader | ( | FILE * | cfile, | |
| const char * | iname, | |||
| const char * | dname, | |||
| int | esize | |||
| ) | [static] |
Prints the C file heading.
| cfile | The output file stream | |
| iname | The name of the input file | |
| dname | The name of the output data structure | |
| esize | The size, in bytes, of the output data |
| static void printTrailer | ( | FILE * | cfile | ) | [static] |
Adds the trailer to words to the output file.
| cfile | The output file stream. |
| static const unsigned int * printWrds | ( | FILE * | cfile, | |
| const unsigned int * | wrds, | |||
| int | nwrds | |||
| ) | [static] |
Prints the array of 32-bit words in to the output file.
| cfile | The file handle | |
| wrds | The array of words to format | |
| nwrds | The number of words to format |
| static __inline EBF_evts setupEvents | ( | EBF_evts | evts, | |
| int | maxevts, | |||
| int | nskip, | |||
| int * | nevts | |||
| ) | [static] |
Skips to the first event to be output.
| evts | The events | |
| maxevts | The maximum number of events to process, if -1, do all | |
| nskip | The number of events to skip | |
| nevts | Returned as the number of events to process |
1.5.3