User Tools

Site Tools


Sidebar

Table Of Contents

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

badd

Name

Badd — Add field to UBF buffer

Synopsis

#include <ubf.h>

int Badd (UBFH *p_ub, BFLDID bfldid, char *buf, BFLDLEN len);

Link with -lubf -lnstd -lm -lpthread

DESCRIPTION

Add field to UBF buffer. The UBF buffer pointer is passed by p_ub, field id in bfldid. The user value is passed in buf. The len is used only if filed type is BFLD_CARRAY, for which length cannot be detected from passed data. The data type for buf must batch with bfldid type.

RETURN VALUE

On success, Badd() 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 buffer for string data.

EXAMPLE

See ubftest/test_get.c for sample code.

BUGS

Report bugs to support@mavimax.com

COPYING

© Mavimax, Ltd