GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> GRBP / dev > grbstream / linux-gcc
Typedefs | |
typedef enum _GRB_STREAM_TYPE_K | GRB_STREAM_TYPE_K |
Standard typedef for _enum GRB_STREAM_TYPE_K. | |
typedef enum _GRB_STREAM_TYPE_K | GRB_streamType |
Typedef for _enum GRB_STREAM_TYPE_K, used in procedure calls. | |
typedef enum _GRB_STREAM_UNIT_K | GRB_STREAM_UNIT_K |
Typedef for enum _GRB_STREAM_UNIT_K. | |
typedef enum _GRB_STREAM_UNIT_K | GRB_streamUnit |
Typedef for enum _GRB_streamUnit. | |
Enumerations | |
enum | _GRB_STREAM_TYPE_K { GRB_STREAM_TYPE_K_FILE = 0, GRB_STREAM_TYPE_K_DATA = 1, GRB_STREAM_TYPE_K_FILESEG = 2 } |
enum | _GRB_STREAM_UNIT_K { GRB_STREAM_UNIT_K_PKTS = 0, GRB_STREAM_UNIT_K_EVTS = 1 } |
Enumeration of how to treat the input stream, as packets or events. More... | |
enum | _GRB_STREAM_PKT_SIZE_K_MAX { GRB_STREAM_PKT_SIZE_K_MAX = -1, GRB_STREAM_PKT_SIZE_K_DEF = 0 } |
Enumerates the sentinal values used when specifying a packet size. More... | |
Functions | |
GRB_stream * | GRB_streamOpen (GRB_streamType type, const void *name, int segment) |
Opens a GRB file or data for reading. | |
int | GRB_streamRead (GRB_stream *stream) |
Reads the GRB file associated with the event stream handle istream. | |
const GRB_pktHdr * | GRB_streamLocate (GRB_stream *stream, int advance) |
Returns a pointer to the current packet and, optionally, advances the current packet to the next packet. | |
GRB_stream * | GRB_streamCreate (GRB_streamType type, const char *name, int rsvd_mbz) |
Creates a file to receive the GRB data packets. | |
int | GRB_streamPktWrite (GRB_stream *stream, const GRB_pktHdr *pkt) |
Writes the specified packet to the output file. | |
int | GRB_streamClose (GRB_stream *stream) |
Closes the file after it has been read. | |
int | GRB_streamFree (GRB_stream *stream) |
Frees the memory associated with the contents of the file. | |
Variables | |
enum _GRB_STREAM_PKT_SIZE_K_MAX | GRB_STREAM_PKT_SIZE_K |
CVS $Id: GRB_stream.h,v 1.1.1.1 2007/06/18 00:42:58 russell Exp $
enum _GRB_STREAM_TYPE_K |
enum _GRB_STREAM_UNIT_K |
int GRB_streamClose | ( | GRB_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 GRB_streamFree().
References _GRB_streamHeader::close, _GRB_stream::hdr, _streamCloseCbp::prm, and _streamCloseCbp::rtn.
GRB_stream* GRB_streamCreate | ( | GRB_streamType | type, | |
const char * | name, | |||
int | rsvd_mbz | |||
) |
Creates a file to receive the GRB data packets.
type | The type of stream to open GRB_STREAM_TYPE_K_FILE or GRB_STREAM_TYPE_K_DATA | |
name | The name of the section or file to create | |
rsvd_mbz | Reserved, must be 0 |
References _GRB_stream::bdy, _GRB_streamHeader::close, _GRB_streamHeader::dir, _GRB_ostreamBody::file, _GRB_streamHeader::free, GRB_STREAM_DIR_K_WRITE, GRB_STREAM_TYPE_K_DATA, GRB_STREAM_TYPE_K_FILE, _GRB_stream::hdr, mem_alloc(), _GRB_ostreamBody::name, _GRB_streamBody::out, _streamCloseCbp::prm, _streamCloseCbp::rtn, and _GRB_streamHeader::type.
int GRB_streamFree | ( | GRB_stream * | stream | ) |
Frees the memory associated with the contents of the file.
stream | The event builder stream handle |
References _GRB_streamHeader::free, _GRB_stream::hdr, and mem_free().
const GRB_pktHdr* GRB_streamLocate | ( | GRB_stream * | stream, | |
int | advance | |||
) |
Returns a pointer to the current packet and, optionally, advances the current packet to the next packet.
stream | The stream handle | |
advance | If non-zero, advance to the internal next packet pointer to the next packet. This is the normal way one would serially read a file of packets |
References _GRB_stream::bdy, _GRB_istreamBody::cur_pkt, _GRB_streamBody::in, and _GRB_istreamBody::lst_pkt.
GRB_stream* GRB_streamOpen | ( | GRB_streamType | type, | |
const void * | name, | |||
int | segment | |||
) |
Opens a GRB file or data for reading.
type | The type of stream to open
| |
name | The name of the GRB file or the address of data section to open | |
segment | Interpretation is dependent on type. If type is
|
References fileOpen(), GRB_STREAM_TYPE_K_DATA, GRB_STREAM_TYPE_K_FILE, GRB_STREAM_TYPE_K_FILESEG, and map().
int GRB_streamPktWrite | ( | GRB_stream * | stream, | |
const GRB_pktHdr * | pkt | |||
) |
Writes the specified packet to the output file.
stream | The output stream handle | |
pkt | The packet to write |
int GRB_streamRead | ( | GRB_stream * | stream | ) |
Reads the GRB file associated with the event stream handle istream.
stream | A previously opened event builder stream handle |
0,if | successful | |
-1,if | not |
References _GRB_stream::bdy, _GRB_istreamBody::buf, _GRB_istreamBody::cur_pkt, fileRead(), GRB_STREAM_TYPE_K_FILE, _GRB_stream::hdr, _GRB_streamBody::in, _GRB_istreamBody::lst_pkt, _GRB_istreamBody::seg_size, and _GRB_streamHeader::type.