CBFIND(3)


Table of Contents

1. NAME
2. SYNOPSIS
3. DESCRIPTION
4. RETURN VALUE
5. ERRORS
6. EXAMPLE
7. BUGS
8. SEE ALSO
9. COPYING

1. NAME

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

2. SYNOPSIS

#include <ubf.h>

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

Link with -lubf -lnstd -lm -lpthread

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

4. RETURN VALUE

On success, CBfind() return ptr to data found; on error, NULL is returned, with Berror set to indicate the error.

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

6. EXAMPLE

See ubftest/test_find.c for sample code.

7. BUGS

Report bugs to support@mavimax.com

8. SEE ALSO

Bchg(3) Badd(3) CBadd(3) Bfind(3) CBfindocc(3) CBfindlast(3)

9. COPYING

© Mavimax, Ltd