BALLOC(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

Balloc - Allocated UBF buffer

2. SYNOPSIS

#include <ubf.h>

UBFH * Balloc (BFLDOCC f, BFLDLEN v);

Link with -lubf -lnstd -lm -lpthread

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

4. RETURN VALUE

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

BEINVAL The total size of bigger than MAXUBFLEN.

BMALLOC Malloc failed.

6. EXAMPLE

See ubftest/test_mem.c for sample code.

7. BUGS

Report bugs to support@mavimax.com

8. SEE ALSO

Bfree(3) Brealloc(3) Binit(3) Bneeded(3)

9. COPYING

© Mavimax, Ltd