Next: bpipe_dpktf_delete, Previous: bpipe_dpktf_data, Up: Data Packet Field Manipulations
return a pointer to a data packet field's data.
#include <bpipe/bpipe.h>void *bpipe_dpktf_datap( BPipe *bpipe, void *core_image, const char *name, BPDataType type );
BPipe *bpipe
- the binary pipe that contains the data packet
void *core_image
- a pointer to the core image of the data packet
const char *name
- the name of the field
BPDataType type
- the suspected data type of the field
Possible values for aBPDataType
are as follows:BPDType_char
,BPDType_double
,BPDType_int
,BPDType_uint
,BPDType_DVector2
,BPDType_DVector3
,BPDType_IVector2
,BPDType_IVector3
,BPDType_UIVector2
,BPDType_UIVector3
,BPDType_DComplex
,BPDType_DCVector2
,BPDType_DCVector3
This routine returns a pointer to the location in the specified core
image of the specified data packet field. It is passed the name of
the field (rather than a handle to it, as required by
bpipe_dpktf_data
) and the required data type. If the passed
type does not match the actual type in the data packet, an error is
returned.
Unlike bpipe_dpktf_data
, bpipe_dpktf_datap
is a
function, not a C preprocessor macro.
It returns a pointer to the data in the data packet. Upon error it
returns NULL
and sets bpipe_errno
.
Upon error bpipe_errno
is set to one of the following:
BPEBADARG
BPEBADPIPE