0001 BGET(3)
0002 =======
0003 :doctype: manpage
0004
0005
0006 NAME
0007 ----
0008 Bget - Get data from UBF buffer
0009
0010
0011 SYNOPSIS
0012 --------
0013
0014 #include <ubf.h>
0015
0016 int Bget (UBFH *'p_ub', BFLDID 'bfldid', BFLDOCC 'occ', char *'buf', BFLDLEN
0017 *'buflen');
0018
0019 Link with '-lubf -lnstd -lm -lpthread'
0020
0021 DESCRIPTION
0022 -----------
0023 Function is used to get field data from UBF buffer. 'p_ub' is pointer to UBF
0024 buffer, 'bfldid' is field id, 'occ' is field occurrence at buffer, which needs
0025 to be read. 'buf' is buffer where to output the data. 'len' is used as *input*
0026 for indicating the length of the bytes for the target buffer ('buf'). If the
0027 data is larger than 'len' indicates, then error of *BNOSPACE*. Then 'len' is
0028 optional. If set to NULL, then no such checks are made. 'len' is used for
0029 *BFLD_STRING*, *BFLD_CARRAY*, *BFLD_UBF* and *BFLD_VIEW*. On output 'len' (if not NULL),
0030 indicates the length of data loaded in bytes. 'buf' pointed data type must match the field
0031 type in buffer.
0032
0033 When 'bfldid' data type is *BFLD_VIEW*, it is expected that 'buf' points to
0034 *BVIEWFLD* structure, where 'BVIEWFLD.data' pointers it set to are where data
0035 shall be unloaded. The 'BVIEWFLD.vname' is set to view name, 'vflags' currently
0036 is not used. When processing *BFLD_VIEW* field, 'len' on input indicates the
0037 area size of 'BVIEWFLD.data'.
0038
0039 RETURN VALUE
0040 ------------
0041 On success, *Bget()* return zero; on error, -1 is returned, with *Berror* set to
0042 indicate the error.
0043
0044 ERRORS
0045 ------
0046 Note that *Bstrerror()* returns generic error message plus custom message with
0047 debug info from last function call.
0048
0049 *BALIGNERR* Corrupted buffer or pointing to not aligned memory area.
0050
0051 *BNOTFLD* Buffer not fielded, not correctly allocated or corrupted.
0052
0053 *BNOSPACE* No space in 'buf'.
0054
0055 *BBADFLD* Invalid field id passed.
0056
0057 *BNOTPRES* Field not present.
0058
0059 EXAMPLE
0060 -------
0061 See *ubftest/test_get.c* for sample code.
0062
0063 BUGS
0064 ----
0065 Report bugs to support@mavimax.com
0066
0067 SEE ALSO
0068 --------
0069 *Bchg(3)* *Badd(3)* *CBadd(3)* *CBget(3)*
0070
0071 COPYING
0072 -------
0073 (C) Mavimax, Ltd
0074