GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EDS / V2-11-5 > ebfio / rhel4-32
#include <EDS/io/EBF_stream.h>
#include <EDS/io/EBF_evts.h>
#include <EDS/io/EBF_pkts.h>
#include <EDS/io/EBF_pkt.ih>
#include <EDS/io/LCBP.h>
#include <EDS/EBF_dir.h>
#include <EDS/EBF_cid.h>
#include <EDS/LCBV.h>
#include <EDS/EBF_pkt.h>
#include <PBI/Endianness.h>
#include <PBI/PTR.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
Classes | |
struct | _streamCloseCbp |
Structure to bind the close callback routine with a parameter. More... | |
struct | _EBF_streamHeader |
Standard header for both input and output streams. More... | |
struct | _EBF_istreamBody |
Internal structure used to control the input access to an EBF file or data section. More... | |
struct | _EBF_ostreamBody |
Context for an output event/packet stream. More... | |
union | _EBF_streamBody |
Union of all the stream types. More... | |
union | _EBF_stream |
Standard EBF stream handle. More... | |
struct | _RestartPkt |
Defines an EBF restart packet. More... | |
Defines | |
#define | MAX_EVT_SIZE 0x10000 |
The maximum size, in bytes, of the data portion of an event. This includes the 8 word header but not any other overheads such restart headers and cells. | |
Typedefs | |
typedef enum _EBF_STREAM_DIR_K | EBF_STREAM_DIR_K |
Typedef for enum _EBF_STREAM_DIR_K. | |
typedef enum _EBF_STREAM_DIR_K | EBF_streamDir |
Typedef for enum _EBF_STREAM_DIR_K. | |
typedef enum _EBF_STREAM_BOUNDS_K | EBF_STREAM_BOUNDS_K |
Typedef for enum _EBF_STREAM_BOUNDS_K. | |
typedef int(* | streamClose )(void *file) |
Generic stream close function signature. | |
typedef struct _streamCloseCbp | streamCloseCbp |
Typedef for struct _streamCloseCbp. | |
typedef struct _EBF_streamHeader | EBF_streamHeader |
Typedef for struct _EBF_streamHeader. | |
typedef struct _EBF_istreamBody | EBF_istreamBody |
Typedef for struct _EBF_streamFileBody. | |
typedef struct _EBF_ostreamBody | EBF_ostreamBody |
Typedef for struct _EBF_ostreamBody. | |
typedef union _EBF_streamBody | EBF_streamBody |
Typedef for union _EBF_streamBody. | |
typedef struct _EBF_stream | EBF_stream |
Typedef for struct _EBF_stream. | |
typedef struct _RestartPkt | RestartPkt |
Typedef for struct _RestartPkt. | |
Enumerations | |
enum | _EBF_STREAM_DIR_K { EBF_STREAM_DIR_K_READ = 0, EBF_STREAM_DIR_K_WRITE = 1 } |
Enumeration of the IO direction, i.e. read or write. More... | |
enum | _EBF_STREAM_BOUNDS_K { EBF_STREAM_BOUNDS_K_MAXEVT = 1 << 16, EBF_STREAM_BOUNDS_K_MAXPKT = 1 << 12, EBF_STREAM_BOUNDS_K_LOWER = EBF_STREAM_BOUNDS_K_MAXEVT, EBF_STREAM_BOUNDS_K_UPPER = 1 << 25, EBF_STREAM_BOUNDS_K_OVERFLOW = EBF_STREAM_BOUNDS_K_MAXPKT } |
Upper and lower bounds on the segment size. More... | |
Functions | |
static EBF_stream * | fileOpen (EBF_streamType type, const char *fileName, int segment_size) |
Opens a EBF file for reading. | |
static EBF_stream * | map (unsigned int *ebf_data) |
Prepares an in memory data structure to be read. | |
static void * | mem_alloc (unsigned int nbytes) |
Wraps the 'real' allocator. | |
static void | mem_free (void *ptr) |
Wraps the 'real' deallocator. | |
static __inline int | max_pkt_size (unsigned int maxPktSize, unsigned int defPktSize) |
Returns the maximum packet size that can actually be realized. | |
static __inline unsigned char * | copy_event (unsigned char *cur, const EBF_dir *dir) |
Composes the output event by, potentially copying the data from the original event to the output descriptor. | |
EBF_stream * | EBF_streamOpen (EBF_streamType type, const void *name, int segment) |
Opens a EBF file or data for reading. | |
static int | fileRead (EBF_stream *stream, unsigned int *ptr, size_t nbytes) |
Reads the specified number of bytes. | |
static int | fileProcess (EBF_stream *stream, EBF_streamUnit evtsPkts, int nskip, int nprocess, LCBV_pktCb process, void *processPrm) |
Processes the specified stream of as events or packets. | |
int | EBF_streamRead (EBF_stream *stream) |
Reads the EBF file associated with the event stream handle istream. | |
int | EBF_streamRewind (EBF_stream *stream) |
Sets the read pointer back to the initial point. | |
int | EBF_streamClose (EBF_stream *stream) |
Closes the file after it has been read. | |
int | EBF_streamFree (EBF_stream *stream) |
Frees the memory associated with the contents of the file. | |
EBF_pkts | EBF_streamLocate (const EBF_stream *stream) |
Returns a packets iterator. | |
int | EBF_streamChange (EBF_stream *stream, const char *name) |
Changes the stream to the new file. | |
EBF_stream * | EBF_streamCreate (EBF_streamType type, const char *name, int maxPktSize) |
Creates a file to receive the EBF data. | |
int | EBF_streamProcess (EBF_stream *stream, EBF_streamUnit evtsPkts, int nskip, int nprocess, LCBV_pktCb process, void *processPrm) |
Processes the specified stream of as events or packets. | |
int | EBF_streamWrite (EBF_stream *stream, const unsigned int *data, int nwrds) |
Writes the specified data to the output fil. | |
static __inline unsigned int | restart_construct (RestartPkt *restart, const EBF_evt *evt) |
Constructs a template of the packet restart header. This includes both the 8 word header and the 4 word restart cell. | |
int | EBF_streamEvtSize (const EBF_stream *stream, int evt_size, int maxPktSize) |
For a given event size (includes the initialize packet header) returns the size, in bytes, of the output packet. | |
int | EBF_streamDirWrite (EBF_stream *stream, const EBF_dir *dir, int maxPktSize) |
Writes the event described by the event directory to the output stream. | |
int | EBF_streamDirCopy (EBF_stream *stream, const EBF_dir *dir, int maxPktSize) |
Copies the packets ASIS to the output stream. | |
int | EBF_streamDirCopySize (const EBF_stream *stream, const EBF_dir *dir, int maxPktSize) |
Checks if the directory packets can be copied asis. If they can routine returns the size, in bytes, of the output event. | |
int | EBF_streamDirWriteSize (const EBF_stream *stream, const EBF_dir *dir, int maxPktSize) |
Checks if the directory event can be written using the maximum packet size as a constraint. If it can, the routine returns the size, in bytes, of the output event. | |
int | EBF_streamEvtWrite (EBF_stream *stream, const void *ebf_evt, int len) |
Routine to an event to the output stream. | |
int | EBF_streamEvtxWrite (EBF_stream *stream, const void *ebf_evt, int len, int maxPktSize) |
Routine to an event to the output stream. | |
int | EBF_streamPktSizeFind (const EBF_stream *stream, int evtSize, int maxPktCnt, int maxPktSize) |
Returns the packet size, in bytes, required to accommodate an output event. |
Reads/Writes an Event Builder File or data section and makes it look like the in-memory representation of data from the event builder.
CVS $Id
Typedef for enum _EBF_STREAM_BOUNDS_K.
The lower bound must be constrained to be at least the size of the largest event.
The upper bound is really only a default used and can be easily overridden. The upper bound must be at least the size of a maximally sized event, but really is set by purely practical considerations. Since this is unit of a read, on very large files, there can be a considerable delay if this read is very large. This is annoying, particularly in the case where one working interactively and just processing the first few events. So this size is set to be something that is large enough to be accommodate most files, but small enough to keep the read latency to something tolerable on human timescales.
The overflow region is provided as an area where discontigious events may be reassembled into a contigious block of memory. As such, it must be at least the size of a maximally sized event.
enum _EBF_STREAM_BOUNDS_K |
Upper and lower bounds on the segment size.
enum _EBF_STREAM_DIR_K |
int EBF_streamChange | ( | EBF_stream * | stream, | |
const char * | name | |||
) |
Changes the stream to the new file.
stream | The stream handle | |
name | The name of the new file |
References _EBF_stream::bdy, _EBF_streamHeader::close, _EBF_ostreamBody::file, _EBF_stream::hdr, _EBF_ostreamBody::name, _EBF_streamBody::out, and _streamCloseCbp::prm.
Referenced by ESX_change().
int EBF_streamClose | ( | EBF_stream * | stream | ) |
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().
References _EBF_streamHeader::close, _EBF_stream::hdr, _streamCloseCbp::prm, and _streamCloseCbp::rtn.
Referenced by ESX_close().
EBF_stream* EBF_streamCreate | ( | EBF_streamType | type, | |
const char * | name, | |||
int | maxPktSize | |||
) |
Creates a file to receive the EBF data.
type | The type of stream to open EBF_STREAM_TYPE_K_FILE or EBF_STREAM_TYPE_K_DATA | |
name | The name of the section or file to create | |
maxPktSize | The maximum number of byte to write per packet. This number will be rounded up to the nearest 128 byte boundary in keeping with how the hardware writes data. If 0 this defaults to 4096 - 128. If greater than 4096 - 128, it defaults to 4096-128 |
References _EBF_stream::bdy, _EBF_streamHeader::close, _EBF_streamHeader::dir, EBF_STREAM_DIR_K_WRITE, EBF_STREAM_TYPE_K_DATA, EBF_STREAM_TYPE_K_FILE, _EBF_ostreamBody::file, _EBF_streamHeader::free, _EBF_stream::hdr, max_pkt_size(), _EBF_ostreamBody::maxPktSize, mem_alloc(), _EBF_ostreamBody::name, _EBF_streamBody::out, _streamCloseCbp::prm, _streamCloseCbp::rtn, and _EBF_streamHeader::type.
int EBF_streamDirCopy | ( | EBF_stream * | stream, | |
const EBF_dir * | dir, | |||
int | maxPktSize | |||
) |
Copies the packets ASIS to the output stream.
stream | The output stream handle | |
dir | The directory | |
maxPktSize | May be used to override the packet size, |
References _EBF_stream::bdy, EBF_streamDirWrite(), EBF_streamWrite(), max_pkt_size(), _EBF_ostreamBody::maxPktSize, _EBF_dirPktDsc::nbytes, _EBF_dirTruncated::npktDscs, _EBF_streamBody::out, _EBF_dirPktDsc::pkt, _EBF_dirTruncated::pktDscs, and _EBF_dir::truncated.
Referenced by ESX_dir_write().
int EBF_streamDirCopySize | ( | const EBF_stream * | stream, | |
const EBF_dir * | dir, | |||
int | maxPktSize | |||
) |
Checks if the directory packets can be copied asis. If they can routine returns the size, in bytes, of the output event.
==-1 Event cannot be committed as is
stream | The output stream handle | |
dir | The directory | |
maxPktSize | Limits the maximum packet size, |
References _EBF_stream::bdy, max_pkt_size(), _EBF_ostreamBody::maxPktSize, _EBF_dirPktDsc::nbytes, _EBF_dirTruncated::npktDscs, _EBF_streamBody::out, _EBF_dirTruncated::pktDscs, and _EBF_dir::truncated.
Referenced by ESX_dir_write().
int EBF_streamDirWrite | ( | EBF_stream * | stream, | |
const EBF_dir * | dir, | |||
int | maxPktSize | |||
) |
Writes the event described by the event directory to the output stream.
stream | The output event stream | |
dir | The event directory | |
maxPktSize | May be used to override the streams packet size, |
References copy_event(), EBF_streamEvtxWrite(), _EBF_dir::evt, _EBF_dirRedux::evt_len, MAX_EVT_SIZE, _EBF_dirTruncated::npktDscs, _EBF_dir::redux, and _EBF_dir::truncated.
Referenced by EBF_streamDirCopy(), and ESX_dir_write().
int EBF_streamDirWriteSize | ( | const EBF_stream * | stream, | |
const EBF_dir * | dir, | |||
int | maxPktSize | |||
) |
Checks if the directory event can be written using the maximum packet size as a constraint. If it can, the routine returns the size, in bytes, of the output event.
==-1 Event cannot be committed as is
stream | The output stream handle | |
dir | The directory | |
maxPktSize | Limits the maximum packet size, |
References EBF_streamEvtSize(), _EBF_dirRedux::evt_len, and _EBF_dir::redux.
Referenced by ESX_dir_write().
int EBF_streamEvtSize | ( | const EBF_stream * | stream, | |
int | evt_size, | |||
int | maxPktSize | |||
) |
For a given event size (includes the initialize packet header) returns the size, in bytes, of the output packet.
stream | The output stream | |
evt_size | The size, in bytes, of the event. This is defined to be the sum of all the contributors + the packet header | |
maxPktSize | May be used to override the streams packet size, |
References _EBF_stream::bdy, max_pkt_size(), _EBF_ostreamBody::maxPktSize, and _EBF_streamBody::out.
Referenced by EBF_streamDirWriteSize().
int EBF_streamEvtWrite | ( | EBF_stream * | stream, | |
const void * | ebf_evt, | |||
int | len | |||
) |
Routine to an event to the output stream.
0 | on success | |
errno | on failure |
stream | The output stream | |
ebf_evt | The event to write | |
len | The length, in bytes, of the event |
This routine differs from EBF_streamEvtxWrite in that it defaults the maximum packet size to that specified in the stream handle.
References EBF_streamEvtxWrite().
int EBF_streamEvtxWrite | ( | EBF_stream * | stream, | |
const void * | ebf_evt, | |||
int | len, | |||
int | maxPktSize | |||
) |
Routine to an event to the output stream.
0 | on success | |
errno | on failure |
stream | The output stream | |
ebf_evt | The event to write | |
len | The length, in bytes, of the event | |
maxPktSize | May be used to override the streams packet size > 0 use this as the packet size == 0 use packet size specified in the stream handle
|
References _EBF_stream::bdy, _EBF_ebw::bf, _EBF_edw::bf, _RestartPkt::cell, EBF_EDW_RSTATUS_K_PACKET_TRUNCATED, EBF_EDW_RSTATUS_K_SUCCESS, EBF_EDW_XSTATUS_K_SUCCESS, EBF_streamWrite(), _EBF_pktRestartCell::ebw, _EBF_ostreamBody::file, _RestartPkt::hdr, _EBF_evt::hdr, _EBF_edw_bf::len, max_pkt_size(), _EBF_ostreamBody::maxPktSize, _EBF_streamBody::out, restart_construct(), _EBF_edw_bf::rstatus, _EBF_ebw::ui, _EBF_edw::ui, _EBF_pktHdr::undef, and _EBF_edw_bf::xstatus.
Referenced by EBF_streamDirWrite(), and EBF_streamEvtWrite().
int EBF_streamFree | ( | EBF_stream * | stream | ) |
Frees the memory associated with the contents of the file.
stream | The event builder stream handle |
References _EBF_streamHeader::free, _EBF_stream::hdr, and mem_free().
Referenced by ESX_close().
EBF_pkts EBF_streamLocate | ( | const EBF_stream * | stream | ) |
Returns a packets iterator.
stream | The event builder stream handle |
References _EBF_stream::bdy, _EBF_streamBody::in, _EBF_pkts_u::p, and _EBF_istreamBody::pkts.
Referenced by EBF_streamProcess().
EBF_stream* EBF_streamOpen | ( | EBF_streamType | type, | |
const void * | name, | |||
int | segment | |||
) |
Opens a EBF file or data for reading.
type | The type of stream to open
| |
name | The name of the EBF file or the address of data section to open | |
segment | Interpretation is dependent on type. If type is
|
References EBF_STREAM_TYPE_K_DATA, EBF_STREAM_TYPE_K_FILE, EBF_STREAM_TYPE_K_FILESEG, fileOpen(), and map().
int EBF_streamPktSizeFind | ( | const EBF_stream * | stream, | |
int | evtSize, | |||
int | maxPktCnt, | |||
int | maxPktSize | |||
) |
Returns the packet size, in bytes, required to accommodate an output event.
stream | The output stream | |
evtSize | The number of bytes in the event to be output. Includes the initial event header. | |
maxPktCnt | The maximum number of packets allowed | |
maxPktSize | If, this value is greater than the minimum need, use this value > 0 use this as the packet size == 0 use packet size specified in the stream handle
|
References _EBF_stream::bdy, max_pkt_size(), _EBF_ostreamBody::maxPktSize, and _EBF_streamBody::out.
Referenced by ESX_dir_write().
int EBF_streamProcess | ( | EBF_stream * | stream, | |
EBF_streamUnit | evtsPkts, | |||
int | nskip, | |||
int | nprocess, | |||
LCBV_pktCb | process, | |||
void * | processPrm | |||
) |
Processes the specified stream of as events or packets.
=0 | Processed all values requested, either hit EOF or application requested to stop | |
<0 | Error, an errno value | |
=1 | Application requested a pause, caller is expected to recall EBF_streamProcess to resume processing |
stream | The stream of packets to process | |
evtsPkts | When positioning the stream, position in units of packets (EBF_STREAM_UNIT_K_PKTS) or events (EBF_STREAM_UNIT_K_EVTS). | |
nskip | The number of packets/events to skip | |
nprocess | The number of packets/events to process | |
process | The LCBV processing routine | |
processPrm | The processing parameter |
References _EBF_stream::bdy, EBF__evtsFromPkts(), EBF__evtsToPkts(), EBF_evtsSetup(), EBF_pktsSetup(), EBF_STREAM_UNIT_K_PKTS, EBF_streamLocate(), EBF_streamRead(), _EBF_istreamBody::fate, fileProcess(), _EBF_streamBody::in, _EBF_istreamBody::lcb, LCBP_create(), LCBP_edm_reset(), LCBP_evt_cb_set(), LCBP_evt_enable(), LCBP_pktsConnect(), LCBP_pktsDeliver(), LCBV_PKT_FATE_M_EOF, LCBV_PKT_FATE_M_IOERR, LCBV_PKT_FATE_M_PAUSE, and _EBF_istreamBody::status.
int EBF_streamRead | ( | EBF_stream * | stream | ) |
Reads the EBF file associated with the event stream handle istream.
stream | A previously opened event builder stream handle |
0,if | successful | |
-1,if | not |
References _EBF_stream::bdy, _EBF_istreamBody::buf, EBF_STREAM_TYPE_K_FILE, fileRead(), _EBF_stream::hdr, _EBF_streamBody::in, _EBF_pkts_ps::pkt, _EBF_istreamBody::pkts, _EBF_pkts_u::ps, _EBF_istreamBody::seg_size, _EBF_pkts_ps::size, and _EBF_streamHeader::type.
Referenced by EBF_streamProcess().
int EBF_streamRewind | ( | EBF_stream * | stream | ) |
Sets the read pointer back to the initial point.
References _EBF_stream::bdy, _EBF_istreamBody::cur_pkt, _EBF_istreamBody::cur_size, _EBF_streamHeader::dir, EBF_STREAM_DIR_K_READ, EBF_STREAM_DIR_K_WRITE, EBF_STREAM_TYPE_K_FILE, _EBF_istreamBody::fate, _EBF_istreamBody::fd, _EBF_ostreamBody::file, _EBF_stream::hdr, _EBF_streamBody::in, _EBF_istreamBody::nprocess, _EBF_streamBody::out, _EBF_istreamBody::tot_left, _EBF_istreamBody::tot_size, _EBF_streamHeader::type, and _EBF_istreamBody::which.
int EBF_streamWrite | ( | EBF_stream * | stream, | |
const unsigned int * | data, | |||
int | nwrds | |||
) |
Writes the specified data to the output fil.
stream | The output stream handle | |
data | The data to write | |
nwrds | The number of 32-bit words to write |
References _EBF_stream::bdy, _EBF_ostreamBody::buf, _EBF_ostreamBody::file, and _EBF_streamBody::out.
Referenced by EBF_streamDirCopy(), and EBF_streamEvtxWrite().
static EBF_stream * fileOpen | ( | EBF_streamType | type, | |
const char * | fileName, | |||
int | segmentSize | |||
) | [static] |
Opens a EBF file for reading.
type | The stream type, must be either
| |
fileName | The name of the EBF file to open | |
segmentSize | The largest portion of the file that will be buffered on a read.
|
References _EBF_stream::bdy, _EBF_istreamBody::buf, _EBF_streamHeader::close, _EBF_istreamBody::cur_pkt, _EBF_istreamBody::cur_size, _EBF_streamHeader::dir, EBF_STREAM_BOUNDS_K_LOWER, EBF_STREAM_BOUNDS_K_OVERFLOW, EBF_STREAM_BOUNDS_K_UPPER, EBF_STREAM_DIR_K_READ, EBF_STREAM_TYPE_K_FILE, _EBF_istreamBody::fate, _EBF_istreamBody::fd, _EBF_streamHeader::free, _EBF_stream::hdr, _EBF_streamBody::in, _EBF_istreamBody::lcb, LCBP_construct(), LCBP_sizeof(), mem_alloc(), _EBF_istreamBody::name, _EBF_istreamBody::nprocess, _streamCloseCbp::prm, _streamCloseCbp::rtn, _EBF_istreamBody::seg_size, _EBF_istreamBody::tot_left, _EBF_istreamBody::tot_size, _EBF_streamHeader::type, and _EBF_istreamBody::which.
Referenced by EBF_streamOpen().
static int fileProcess | ( | EBF_stream * | stream, | |
EBF_streamUnit | evtsPkts, | |||
int | nskip, | |||
int | nprocess, | |||
LCBV_pktCb | process, | |||
void * | processPrm | |||
) | [static] |
Processes the specified stream of as events or packets.
stream | The stream of packets to process | |
evtsPkts | When positioning the stream, position in units of packets (EBF_STREAM_UNIT_K_PKTS) or events (EBF_STREAM_UNIT_K_EVTS). | |
nskip | The number of packets/events to skip | |
nprocess | The number of packets/events to process | |
process | The LCBV processing routine | |
processPrm | The processing parameter |
References _EBF_stream::bdy, _EBF_edw::bf, _EBF_istreamBody::buf, _EBF_istreamBody::cur_pkt, _EBF_istreamBody::cur_size, EBF__pktAdvance(), EBF__pktSize(), EBF_EDW_RSTATUS_K_PACKET_TRUNCATED, EBF_STREAM_UNIT_K_PKTS, _EBF_istreamBody::error, _EBF_istreamBody::fate, fileRead(), _EBF_streamBody::in, LCBV_PKT_FATE_M_ABORT, LCBV_PKT_FATE_M_EOF, LCBV_PKT_FATE_M_IOERR, LCBV_PKT_FATE_M_NO_MORE, LCBV_PKT_FATE_M_PAUSE, _EBF_istreamBody::nprocess, _EBF_edw_bf::rstatus, _EBF_istreamBody::seg_size, _EBF_istreamBody::tot_left, _EBF_edw::ui, and _EBF_istreamBody::which.
Referenced by EBF_streamProcess().
static int fileRead | ( | EBF_stream * | stream, | |
unsigned int * | ptr, | |||
size_t | nbytes | |||
) | [static] |
Reads the specified number of bytes.
References _EBF_stream::bdy, _EBF_istreamBody::fd, _EBF_streamBody::in, and _EBF_istreamBody::name.
Referenced by EBF_streamRead(), and fileProcess().
static EBF_stream * map | ( | unsigned int * | data | ) | [static] |
Prepares an in memory data structure to be read.
data | Pointer to the in memory data structure. |
References _EBF_stream::bdy, _EBF_streamHeader::close, _EBF_streamHeader::dir, EBF_STREAM_DIR_K_READ, EBF_STREAM_TYPE_K_DATA, _EBF_streamHeader::free, _EBF_stream::hdr, _EBF_streamBody::in, mem_alloc(), _EBF_pkts_ps::pkt, _EBF_istreamBody::pkts, _streamCloseCbp::prm, _EBF_pkts_u::ps, _streamCloseCbp::rtn, _EBF_pkts_ps::size, and _EBF_streamHeader::type.
Referenced by EBF_streamOpen().
static __inline int max_pkt_size | ( | unsigned int | maxPktSize, | |
unsigned int | defPktSize | |||
) | [static] |
Returns the maximum packet size that can actually be realized.
maxPktSize | The maximum packet size as specified by the user. If
| |
defPktSize | The default packet size to use. This should include EBF_pktHdr. |
Referenced by EBF_streamCreate(), EBF_streamDirCopy(), EBF_streamDirCopySize(), EBF_streamEvtSize(), EBF_streamEvtxWrite(), and EBF_streamPktSizeFind().
static void * mem_alloc | ( | unsigned int | nbytes | ) | [static] |
Wraps the 'real' allocator.
nbytes | The number of bytes |
Referenced by EBF_streamCreate(), fileOpen(), and map().
static void mem_free | ( | void * | ptr | ) | [static] |
Wraps the 'real' deallocator.
ptr | Pointer to the memory to free |
Referenced by EBF_streamFree().
static __inline unsigned int restart_construct | ( | RestartPkt * | restart, | |
const EBF_evt * | evt | |||
) | [static] |
Constructs a template of the packet restart header. This includes both the 8 word header and the 4 word restart cell.
restart | The target restart packet | |
evt | The event to derive the information from |
References _EBF_ebw::bf, _RestartPkt::cell, _EBF_evt::ctb, _EBF_pktRestartCell::ebw, _EBF_ctbHdr::ebw, _EBF_ctb::hdr, _EBF_evt::hdr, _RestartPkt::hdr, _EBF_pktRestartCell::mbz, and _EBF_ebw::ui.
Referenced by EBF_streamEvtxWrite().