User Tools

Site Tools


Sidebar

Table Of Contents

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

bgets

Name

Bgets — Get the field value converted to *BFLD_STRING*

Synopsis

#include <ubf.h>

int Bgets (UBFH *p_ub, BFLDID bfldid, BFLDOCC occ, char *buf);

Link with -lubf -lnstd -lm -lpthread

DESCRIPTION

Function is used to get field data from UBF buffer. p_ub is pointer to UBF buffer, bfldid is field id, occ is field occurrence at buffer, which needs to be read. buf is buffer where to output the data, data is automatically converted to BFDL_STRING. It is assumed that space in buf is large enougth to store the value.

This is macro function and it invokes CBget(3) with field type BFLD_STRING and length 0.

RETURN VALUE

On success, Bgets() 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.

BNOSPACE No space in buf.

BMALLOC Failed to allocate type conversion buffer.

BBADFLD Invalid field id passed.

BNOTPRES Field not present.

EXAMPLE

See ubftest/test_macro.c for sample code.

BUGS

Report bugs to support@mavimax.com

COPYING

© Mavimax, Ltd