Bnext — Iterate over the UBF buffer
#include <ubf.h>
int Bnext (UBFH *p_ub, BFLDID *bfldid, BFLDOCC *occ, char *buf, BFLDLEN *len);
Link with -lubf -lnstd -lm -lpthread
Iterate over the UBF buffer pointed by p_ub. To start (or restart) loop over the buffer, bfldid value must be set to BFIRSTFLDID. If function succeeds it returns field id in bfldid, occurrence in occ and data value in buf/len pair. buf and len both are optional fields. len on input indicate the buffer length, on output it indicates the the length of data loaded. If len is set to NULL, then it is assumed that on input buffer is large enough to store data. The state of iteration is stored in thread local storage (TLS).
On success, Bnext() return 1, if End Of Buffer reached, then 0 is returned; on error, -1 is returned, with Berror set to indicate the error.