Badd — Add field to UBF buffer
#include <ubf.h>
int Badd (UBFH *p_ub, BFLDID bfldid, char *buf, BFLDLEN len);
Link with -lubf -lnstd -lm -lpthread
Add field to UBF buffer. The UBF buffer pointer is passed by p_ub, field id in bfldid. The user value is passed in buf. The len is used only if filed type is BFLD_CARRAY, for which length cannot be detected from passed data. The data type for buf must match with bfldid type.
Badd() requires double pointer in buf if setting the BFLD_PTR field, i.e. pointer to pointer of XATMI buffer needs to be passed to the function. In case if using Fadd() or Fadd32() wrappers, buf accepts direct pointer to XATMI buffer.
On success, Badd() return zero; on error, -1 is returned, with Berror set to indicate the error.