User Tools

Site Tools


Sidebar

Table Of Contents

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

bprint

Name

Bprint — Print the buffer output in human readable form to *stdout*

Synopsis

#include <ubf.h>

int Bprint (UBFH *p_ub);

Link with -lubf -lnstd -lm -lpthread

DESCRIPTION

Function prints the p_ub buffer content to stdout. The format of the output is "<FIELD><TAB><VALUE><NEW LINE>". The BFLD_CARRAY fields are printed in the way that non readable characters are printed in hex-decimal format, prefixed with \. If value contains \ char, then it is printed as \\. Example:

T_SHORT_FLD     1765
T_LONG_FLD      3333111
T_LONG_FLD      2
T_CHAR_FLD      A
T_FLOAT_FLD     1.33000
T_DOUBLE_FLD    1111.220000
T_DOUBLE_FLD    333.000000
T_DOUBLE_FLD    444.000000
T_STRING_FLD    HELLO WORLD
T_CARRAY_FLD    \00\01\02\03HELLO BINARY\04\05\00

Floating point values are printed with 6 symbols after decimal separator.

RETURN VALUE

On success, Bprint() 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.

EXAMPLE

See ubftest/test_print.c for sample code.

BUGS

Report bugs to support@mavimax.com

COPYING

© Mavimax, Ltd