Next: bpipe_map_alloc, Previous: bpipe_delete, Up: BPipe Manipulations
create transformation maps for data packet fields
#include <bpipe/bpipe.h>size_t bpipe_map(BPipe *bpipe);
BPipe *bpipe
- a pointer to a binary pipe structure
bpipe_map
creates transformation maps between the input,
core, and output images of a data packet. It should be called after
all manipulations of data packet field definitions are complete. If
the binary pipe has output channels, it must be called before
writing the header information to the outputs, and should not be
called afterwards. It must be called prior to any data packet input
or output activity on the binary pipe, and should not be called
after any such activity.
This routine should only be called once. It will not re-map an
already mapped Bpipe
.
It returns the size of the core image in bytes, which should be used
by the caller to allocate space for the data packets. Upon error it
returns ‘0’ and sets bpipe_errno
.
Upon error bpipe_errno
is set to one of the following:
BPEBADARG
BPipe
has already been mapped
BPipe
has an input stream and data packets
are defined on the input stream, yet all of the
data packet fields have been deleted
BPEBADPIPE
BPENOMEM