0001 BFPRINT(3)
0002 ==========
0003 :doctype: manpage
0004
0005
0006 NAME
0007 ----
0008 Bfprint - Print the buffer output in human readable form to specified io stream
0009
0010
0011 SYNOPSIS
0012 --------
0013
0014 #include <ubf.h>
0015
0016 int Bfprint (UBFH *'p_ub', FILE *'outf');
0017
0018 Link with '-lubf -lnstd -lm -lpthread'
0019
0020 DESCRIPTION
0021 -----------
0022 Function prints the 'p_ub' buffer content to io stream at 'outf'. The format of
0023 the output is "<FIELD><TAB><VALUE><NEW_LINE>". The *BFLD_CARRAY*
0024 fields are printed in the way that non readable characters are
0025 printed in hex-decimal format, prefixed with \. If value
0026 contains \ char, then it is printed as \\. Example:
0027
0028 --------------------------------------------------------------------------------
0029 T_SHORT_FLD 1765
0030 T_LONG_FLD 3333111
0031 T_LONG_FLD 2
0032 T_CHAR_FLD A
0033 T_FLOAT_FLD 1.33000
0034 T_DOUBLE_FLD 1111.220000
0035 T_DOUBLE_FLD 333.000000
0036 T_DOUBLE_FLD 444.000000
0037 T_STRING_FLD HELLO WORLD
0038 T_CARRAY_FLD \00\01\02\03HELLO BINARY\04\05\00
0039 --------------------------------------------------------------------------------
0040
0041 RETURN VALUE
0042 ------------
0043 On success, *Bfprint()* return zero; on error, -1 is returned, with
0044 *Berror* set to indicate the error.
0045
0046 ERRORS
0047 ------
0048 Note that *Bstrerror()* returns generic error message plus custom message
0049 with debug info from last function call.
0050
0051 *BALIGNERR* Corrupted buffer or pointing to not aligned memory area.
0052
0053 *BNOTFLD* Buffer not fielded, not correctly allocated or corrupted.
0054
0055 *BEINVAL* 'outf' is NULL.
0056
0057 EXAMPLE
0058 -------
0059 See *ubftest/test_print.c* for sample code.
0060
0061 BUGS
0062 ----
0063 Report bugs to support@mavimax.com
0064
0065 SEE ALSO
0066 --------
0067 *Bfprintcb(3)* *Bextread(3)* *Bprint(3)* *Bread(3)* *Bwrite(3)*
0068
0069 COPYING
0070 -------
0071 (C) Mavimax, Ltd
0072