0001 BFIND(3)
0002 ========
0003 :doctype: manpage
0004
0005
0006 NAME
0007 ----
0008 Bfind - Find the field in UBF buffer, return raw pointer to value
0009
0010
0011 SYNOPSIS
0012 --------
0013
0014 #include <ubf.h>
0015
0016 char * Bfind (UBFH *'p_ub', BFLDID 'bfldid', BFLDOCC 'occ', BFLDLEN *'p_len');
0017
0018 Link with '-lubf -lnstd -lm -lpthread'
0019
0020 DESCRIPTION
0021 -----------
0022 Function on success returns pointer to data field present in UBF buffer.
0023 'p_ub' is pointer to UBF buffer, 'bfldid' is field id, 'occ' is field occurrence
0024 at buffer, which needs to be found. 'p_len' is output parameter for indicating
0025 the type length in bytes. Then 'len' is optional. Note that pointer to field
0026 is valid only that time while the buffer is not changed. If changes occur,
0027 then returned pointer might become invalid (point wrong data area).
0028
0029 When Bfind() returns result for *BFLD_VIEW* field, the return value points
0030 to *BVIEWFLD* structure which resits in thread-local storage. The *data* field
0031 of structure pointers to UBF buffers actual view data.
0032
0033 RETURN VALUE
0034 ------------
0035 On success, *Bfind()* non NULL value is returned; on error, NULL is returned,
0036 with *Berror* set to indicate the error.
0037
0038 ERRORS
0039 ------
0040 Note that *Bstrerror()* returns generic error message plus custom message
0041 with debug 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 *BNOTPRES* Field not present.
0048
0049 *BBADFLD* Invalid field id passed.
0050
0051 EXAMPLE
0052 -------
0053 See *ubftest/test_find.c* for sample code.
0054
0055 BUGS
0056 ----
0057 Report bugs to support@mavimax.com
0058
0059 SEE ALSO
0060 --------
0061 *Bchg(3)* *Badd(3)* *CBadd(3)* *CBfind(3)* *Bfindlast(3)*
0062
0063 COPYING
0064 -------
0065 (C) Mavimax, Ltd
0066