Next: bpipe_dpktf_init, Previous: bpipe_dpktf_datap, Up: Data Packet Field Manipulations
Delete a data packet field.
#include <bpipe/bpipe.h>int bpipe_dpktf_delete( BPipe *bpipe, const char *name, BPDataSite site, BPipeOutput *channel );
BPipe *bpipe
- the binary pipe with which the data packet is associated
const char *name
- the name of the field to delete
BPDataSite site
- the data site from which to delete the field
Possible values for aBPDataSite
are as follows:BPDSite_INPUT
,BPDSite_CORE
,BPDSite_OUTPUT
BPipeOutput *channel
- the output channel for which to delete this field. (only relevant for deletion from output sites)
This routine deletes a field from the definition of either the core
or output images of a data packet. The site
argument
specifies the data site from which to delete the field, and should
be either of the constants BPDSite_CORE
or
BPDSite_OUTPUT
(denoting the core and output images,
respectively). In the latter case, it is deleted from the specified
output channel. If the output channel is the constant
BPOutputChannel_ALL
(or NULL
), the field is deleted from
all output channels.
Note that once a field is deleted from the core image, it's gone! If a field of the same name is added, it's a completely new field, not the one that was in the input image.
It returns ‘0’ if the deletion was successful, ‘1’ if the
field doesn't exist. Upon error it returns ‘-1’ and
sets bpipe_errno
.
Upon error bpipe_errno
is set to one of the following:
BPEBADARG
BPipe
has been mapped
BPENOMEM