User Tools

Site Tools


Sidebar

Table Of Contents

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

cbfind

Name

Bfinds — find the field and convert it to *BFLD_STRING*

Synopsis

#include <ubf.h>

char * Bfinds (UBFH *p_ub, BFLDID bfldid, BFLDOCC occ);

Link with -lubf -lnstd -lm -lpthread

DESCRIPTION

Function on success returns pointer to data field present in UBF buffer, converted to BFLD_STRING. p_ub is pointer to UBF buffer, bfldid is field id, occ is field occurrence at buffer, which needs to be found. Returned pointer is valid only until next UBF operation call, as the converted value is stored in thread local storage used for varous UBF operations.

The function in practice invokes CBfind(3) with user type BFLD_STRING and len set to NULL.

RETURN VALUE

On success, Bfinds() return zero; 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.

BNOTPRES Field not present.

BMALLOC Failed to allocate type conversion buffer.

EXAMPLE

See ubftest/test_macro.c for sample code.

BUGS

Report bugs to support@mavimax.com

COPYING

© Mavimax, Ltd