User Tools

Site Tools


Sidebar

Table Of Contents

endurox:v7.5.x:api:ubf:bnext.3

bnext

Name

Bnext — Iterate over the UBF buffer

Synopsis

#include <ubf.h>

int Bnext (UBFH *p_ub, BFLDID *bfldid, BFLDOCC *occ, char *buf, BFLDLEN *len);

Link with -lubf -lnstd -lm -lpthread

DESCRIPTION

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).

RETURN VALUE

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.

ERRORS

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.

EXAMPLE

See ubftest/test_bnext.c for sample code.

BUGS

Report bugs to support@mavimax.com

COPYING

© Mavimax, Ltd