User Tools

Site Tools


Sidebar

Table Of Contents

endurox:v7.5.x:api:ubf:bread.3

bread

Name

Bread — Read the UBF buffer from Bwrite(3) serialized format

Synopsis

#include <ubf.h>

int Bread (UBFH *p_ub, FILE *inf);

Link with -lubf -lnstd -lm -lpthread

DESCRIPTION

Bread() function reads the buffer from input stream (inf). Buffer is restored into p_ub. The used/free space is updated accordingly. The buffer format is in machine architecture dependent (LSB/MSB, integer size). The p_fb shall have enough space allocated before this function call.

RETURN VALUE

On success, Bread() return zero; on error, -1 is returned, with Berror set to indicate the error.

ERRORS

Note that Bstrerror() returns generic error message plus custom message with debug info from last function call.

BALIGNERR Corrupted buffer or pointing to not aligned memory area.

BNOTFLD Buffer not fielded, not correctly allocated or corrupted.

BEINVAL inf is NULL.

BEUNIX Failed to read from stream.

EXAMPLE

See ubftest/test_readwrite.c for sample code.

BUGS

Report bugs to support@mavimax.com

COPYING

© Mavimax, Ltd