User Tools

Site Tools


Sidebar

Table Of Contents

endurox:v8.0.x:api:ubf:cbfind.3

cbfind

Name

CBfind — find field in UBF buffer and convert value to user specified type

Synopsis

#include <ubf.h>

char * CBfind (UBFH *p_ub, BFLDID bfldid, BFLDOCC occ, BFLDLEN *len, int usrtype);

Link with -lubf -lnstd -lm -lpthread

DESCRIPTION

Function on success returns pointer to data field present in UBF buffer, converted to user type specified in usrtype. p_ub is pointer to UBF buffer, bfldid is field id, occ is field occurrence at buffer, which needs to be found. len is output parameter for indicating the type length in bytes. Then len is optional. Returned pointer is valid only until next UBF operation call, as the converted value is stored in thread local storage used for various UBF operations.

Function operations on field types BFLD_UBF and BFLD_VIEW are not supported. This includes type of bfldid or usrtype having any unsupported field types for this function.

RETURN VALUE

On success, CBfind() return ptr to data found; 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.

BMALLOC Failed to allocate type conversion buffer.

BEBADOP Operation not supported (e.g. work with BFLD_UBF or BFLD_VIEW type fields).

BBADFLD Invalid field id passed.

EXAMPLE

See ubftest/test_find.c for sample code.

BUGS

Report bugs to support@mavimax.com

COPYING

© Mavimax, Ltd