Next: , Previous: bpipe_delete, Up: BPipe Manipulations


A.1.3 bpipe_map

create transformation maps for data packet fields

Synopsis

     #include <bpipe/bpipe.h>
     
     
     
size_t bpipe_map(BPipe *bpipe);

Parameters

BPipe *bpipe
a pointer to a binary pipe structure

Description

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.

Returns

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.

Errors

Upon error bpipe_errno is set to one of the following:

BPEBADARG

BPEBADPIPE
either all of the input data packet fields were deleted or all of an output channel's data packet fields were deleted.
BPENOMEM
a memory allocation failed