Next: , Previous: bpipe_hdrf_data, Up: Header Field Manipulations


A.2.4 bpipe_hdrf_delete

Remove a header field.

Synopsis

     #include <bpipe/bpipe.h>
     
     
     
int bpipe_hdrf_delete( BPipe *bpipe, char *name, size_t index );

Parameters

BPipe *bpipe
binary pipe with which this field is associated
char *name
the field's name
size_t index
the field's index. set to BPHdrfIdx_LAST to delete the last one, BPHdrfIdx_ALL to delete all of them

Description

This routine will remove a field from the header and free the memory used by the header data. It does not renumber the indices of the fields which have the same name as the field. If requested, it can delete all of the fields of a given name.

Returns

It returns zero upon success, non-zero if the field didn't exist. If an error occurs (the index was bad), it returns non-zero and sets bpipe_errno.

Errors

Upon error bpipe_errno is set to one of the following:

BPEBADARG
the index specified was illegal