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