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


A.3.8 bpipe_dpktf_init

Initialize a data packet field's core image.

Synopsis

     #include <bpipe/bpipe.h>
     
     
     
void bpipe_dpktf_init( DpktField *field, void *dpkt, void *init );

Parameters

DpktField *field
the field to initialize
void *dpkt
the core image, allocated by the user after calling bpipe_map
void *init
an (optional) initialization data element. Set to NULL to use the default initialization value

Description

This routine will replicate a datatype initialization structure throughout the core image of a data packet field. It is a simple utility routine which replaces calls to bpipe_dpktf_matrix, and bpipe_datatype_init or bpipe_memfill. If the user wants more control over how the data is initialized, these functions should be called instead.

This routine will fill a data packet's field image with either default initialization values (zeroes of the appropriate type) or the data from a user provided data element (which will be replicated for each element in the data packet field's array). It must be called after bpipe_map has been called.