CBfind — find type field and return user type specified value pointer
#include <ubf.h>
char * CBfind (UBFH *p_ub, BFLDID bfldid, BFLDOCC occ, BFLDLEN *len, int usrtype);
Link with -lubf -lnstd -lm -lpthread
Function on success returns pointer to data field present in UBF buffer, converted to user type specified in usrtype. p_ub is pointer to UBF buffer, bfldid is field id, occ is field occurrence at buffer, which needs to be found. len is output paramter for indicating the type length in bytes. Then len is optional. Returned pointer is valid only until next UBF operation call, as the converted value is stored in thread local storage used for varous UBF operations.
On success, CBfind() return zero; on error, -1 is returned, with Berror set to indicate the error.
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.
BNOTPRES Field not present.
BMALLOC Failed to allocate type conversion buffer.