Next: , Previous: BPipe Manipulations, Up: BPipe Manipulations


A.1.1 bpipe_input

attach an input stream to a binary pipe

Synopsis

     #include <bpipe/bpipe.h>
     
     
     
int bpipe_input( BPipe *bpipe, char *path );

Parameters

BPipe *bpipe
a pointer to the binary pipe structure
char *path
a pointer to a string describing the input file or device to associate with the input channel

Description

bpipe_input attaches an input stream to a binary pipe, opens it and reads the data stream's header.

The parameter input is a string describing the input file or device associated with the input channel. If it is the string `stdin', the input channel is associated with UNIX standard input.

Returns

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

Errors

Upon error bpipe_errno is set to one of the following errors:

BPEBADARG
the passed path could not be opened. Check errno for more information.
BPEBADPIPE
the header data definitions had errors
BPEIOERROR
an error occurred whilst reading the pipe
BPENOMEM
a memory allocation failed