User Tools

Site Tools


Sidebar

Table Of Contents

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

bwrite

Name

Bwrite — Write the UBF buffer in binary form to stream

Synopsis

#include <ubf.h>

int Bwrite (UBFH *p_ub, FILE *outf);

Link with -lubf -lnstd -lm -lpthread

DESCRIPTION

Write the UBF buffer p_ub to output stream (outf). The output buffer format is in machine architecture dependent (LSB/MSB, integer size). To output only used space of the UBF buffer is streamed.

RETURN VALUE

On success, Bwrite() 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 outf is NULL.

BEUNIX Failed to read from stream.

BNOSPACE No space in p_ub.

EXAMPLE

See ubftest/test_readwrite.c for sample code.

BUGS

Report bugs to support@mavimax.com

COPYING

© Mavimax, Ltd