Next: , Previous: bpipe_dpktf_data, Up: Data Packet Field Manipulations


A.3.6 bpipe_dpktf_datap

return a pointer to a data packet field's data.

Synopsis

     #include <bpipe/bpipe.h>
     
     
     
void *bpipe_dpktf_datap( BPipe *bpipe, void *core_image, const char *name, BPDataType type );

Parameters

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 a BPDataType 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

Description

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.

Returns

It returns a pointer to the data in the data packet. Upon error it returns NULL and sets bpipe_errno.

Errors

Upon error bpipe_errno is set to one of the following:

BPEBADARG
the requested data packet field doesn't exist
BPEBADPIPE
the data types didn't match