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


A.3.5 bpipe_dpktf_data

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

Synopsis

     #include <bpipe.h>
     
     
     
char *bpipe_dpktf_data( DpktField *dpktf, void *core_image, );

Parameters

DpktField *dpktf
A data packet field handle obtained from either bpipe_dpktf or bpipe_dpktf_next.
void *core_image
A pointer to memory which holds the core image of the data packet.

Description

This C preprocessor macro will be replaced by a pointer to the starting location in the specified core image of the data for the specified data packet field. The invoking routine may use this pointer to directly access the field's data. In this case it should be first be cast to the appropriate C type (see Intrinsic Data Types). However, see bpipe_dpktf_arr for a cleaner approach. This routine is generally used when the pointer need not be cast to the appropriate type (for example, when using bpipe_sprintf).

Each of the arguments to the macro is used only once, so complex expressions with side effects will not result in unsavory results. While this “function” has been coded as a macro for efficiency, if possible it should be used outside of a loop. All arguments are assumed to be legal.