Bgets — Get the field value converted to *BFLD_STRING*
#include <ubf.h>
int Bgets (UBFH *p_ub, BFLDID bfldid, BFLDOCC occ, char *buf);
Link with -lubf -lnstd -lm -lpthread
Function is used to get field data from UBF buffer. p_ub is pointer to UBF buffer, bfldid is field id, occ is field occurrence at buffer, which needs to be read. buf is buffer where to output the data, data is automatically converted to BFDL_STRING. It is assumed that space in buf is large enougth to store the value.
This is macro function and it invokes CBget(3) with field type BFLD_STRING and length 0.
On success, Bgets() 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.
BNOSPACE No space in buf.
BMALLOC Failed to allocate type conversion buffer.
BBADFLD Invalid field id passed.
BNOTPRES Field not present.