Next: , Previous: bpipe_hdrf_array_add, Up: Header Field Manipulations   [Contents]


A.2.3 bpipe_hdrf_data

Get a pointer to a header field’s data.

Synopsis

#include <bpipe/bpipe.h>

void *bpipe_hdrf_data(
  BPipe *bpipe,
  const char *name,
  size_t index
);

Parameters

BPipe *bpipe

binary pipe with which this field is associated

const char *name

the field’s name

size_t index

the field’s index. set to BPHdrfIdx_LAST to select the last one.

Description

This routine looks up a header data field and returns a pointer to the data in the field. The calling routine may use this pointer to directly change the header field’s data.

Returns

Returns a pointer to the data upon success. If the field doesn’t exist, it returns NULL. If there’s an error, it returns NULL and sets bpipe_errno.

Errors

Upon error bpipe_errno is set to one of the following:

BPEBADARG

the index specified was illegal