User Tools

Site Tools


Sidebar

Table Of Contents

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

bfind

Name

Bfind — Find the field in UBF buffer, return raw pointer to value

Synopsis

#include <ubf.h>

char * Bfind (UBFH *p_ub, BFLDID bfldid, BFLDOCC occ, BFLDLEN *p_len);

Link with -lubf -lnstd -lm -lpthread

DESCRIPTION

Function on success returns pointer to data field present in UBF buffer. p_ub is pointer to UBF buffer, bfldid is field id, occ is field occurrence at buffer, which needs to be found. p_len is output parameter for indicating the type length in bytes. Then len is optional. Note that pointer to field is valid only that time while the buffer is not changed. If changes occur, then returned pointer might become invalid (point wrong data area).

RETURN VALUE

On success, Bfind() non NULL value is returned; on error, NULL 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.

BNOTPRES Field not present.

EXAMPLE

See ubftest/test_find.c for sample code.

BUGS

Report bugs to support@mavimax.com

COPYING

© Mavimax, Ltd