Bfinds — find the field and convert it to *BFLD_STRING*
#include <ubf.h>
char * Bfinds (UBFH *p_ub, BFLDID bfldid, BFLDOCC occ);
Link with -lubf -lnstd -lm -lpthread
Function on success returns pointer to data field present in UBF buffer, converted to BFLD_STRING. p_ub is pointer to UBF buffer, bfldid is field id, occ is field occurrence at buffer, which needs to be found. 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.
The function in practice invokes CBfind(3) with user type BFLD_STRING and len set to NULL.
On success, Bfinds() 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.