Next: , Previous: bpipe_read_dpkts, Up: BPipe Manipulations


A.1.8 bpipe_write_dpkt_n

Write data packets to a binary pipe's output channels.

Synopsis

     #include <bpipe/bpipe.h>
     
     
     
size_t bpipe_write_dpkt_n( BPipe *bpipe, void *buf, size_t n_pkts, BPipeOutput *bpo );

Parameters

BPipe *bpipe
the binary bpipe to which to write the packets
void *buf
a pointer to a user-provided memory buffer containing the data packets to be written
size_t n_pkts
the number of data packets to write
BPipeOutput *bpo
the output channel to which to write the packets.

Description

bpipe_write_dpkt_n writes a user specified number of data packets to one or all of a binary pipe's output channels. It must be called after a call to bpipe_write_hdr. It converts the packets' core images into output images.

If channel is the constant BPOutputChannel_ALL (or NULL), the packets are written to all of the output channels. It is much more efficient to call bpipe_write_dpkt or bpipe_write_dpkts if the situation warrants it.

Returns

It returns zero upon success, non-zero upon failure.