Next: , Previous: outchannel_close_delete, Up: Internal Functions


A.5.52 read_dpkt_defs

Read data packet field definitions from a binary pipe.

Synopsis

     #include <bpipe/bpipe.h>
     
     
     
static int read_dpkt_defs( BPipe *bpipe, char **buf, size_t *buf_len );

Parameters

BPipe *bpipe
the binary pipe to read
char **buf
the input buffer to use
size_t *buf_len
the length of the input buffer

Description

This routine reads in data packet field definitions from a binary pipe, parses them, and stores th results in the binary pipe structure. It requires a line count variable, which it increments and uses for error output. It uses bpipe_proc_def to parse the input. an empty line is taken to signal the end of the data packet field definition section.

Returns

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

Errors

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

BPEBADPIPE
the header data definitions had errors
BPENOMEM
a memory allocation failed

Warning

The header parameter definitions must be read before this routine is called.