User Tools

Site Tools


Sidebar

Table Of Contents

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

balloc

Name

Balloc — Allocated UBF buffer

Synopsis

#include <ubf.h>

UBFH * Balloc (BFLDOCC f, BFLDLEN v);

Link with -lubf -lnstd -lm -lpthread

DESCRIPTION

Allocates UBF buffer to store the number of fields of f with total data storage in bytes of v. The v must also include the size for terminating zero bytes for strings if any string is added to buffer.

RETURN VALUE

On success, Balloc() returns pointer to UBF buffer; 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.

BEINVAL The total size of bigger than MAXUBFLEN.

BMALLOC Malloc failed.

EXAMPLE

See ubftest/test_mem.c for sample code.

BUGS

Report bugs to support@mavimax.com

COPYING

© Mavimax, Ltd