Next: , Previous: read_hdr_defs, Up: Internal Functions


A.5.54 read_hdr

Read the header section of a binary pipe data stream.

Synopsis

     #include <bpipe/bpipe.h>
     
     
     
static int read_hdr(BPipe *bpipe);

Parameters

BPipe *bpipe
the binary pipe from which to read

Description

This routine reads and parses the header information of a binary pipe input data stream. The header consists of header parameter and data packets field definitions and header parameter data. The pipe I/O channel must already have been opened.

Returns

It returns zero upon success, non-zero otherwise. Upon error bpipe_errno is set.

Errors

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

BPEBADPIPE
the header data definitions had errors
BPEIOERROR
an error occurred whilst reading the pipe
BPENOMEM
a memory allocation failed