User Tools

Site Tools


Sidebar

Table Of Contents

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

blen

Name

Blen — Return field length

Synopsis

#include <ubf.h>

int Blen (UBFH *p_ub, BFLDID bfldid, BFLDOCC occ);

Link with -lubf -lnstd -lm -lpthread

DESCRIPTION

Return the field length in bytes for given field at given occurrence. p_ub is pointer to UBF buffer (allocated with tpalloc(3), buffer type "UBF", "FML" or "FML32"). bfldid is UBF buffer field id (which is generated by mkfldhdr(8)), occ is field occurrence in buffer.

RETURN VALUE

On success, Blen() returns field length in bytes; on error, -1 is returned, with Berror set to indicate the error.

ERRORS

Bstrerror(3) can give more description for error (for last call).

BALIGNERR Corrupted buffer or pointing to not aligned memory area.

BNOTFLD Buffer not fielded, not correctly allocated or corrupted. p_ub is NULL.

BBADFLD Invalid field id passed.

BNOTPRES Field not present.

EXAMPLE

See ubftest/ubfunit1.c for sample code.

BUGS

Report bugs to support@mavimax.com

COPYING

© Mavimax, Ltd