Table of Contents
#include <ubf.h>
long Bneeded(BFLDOCC nrfields, BFLDLEN totsize);
Link with -lubf -lnstd -lm -lpthread
Estimate the buffer size which is needed for storing nrfields number of fields for which total size in bytes would be a totsize. Function basically adds to result the size of UBF header and adds alignment byte sizes. Estimation is done on CARRAY field bases, because it has a largest metadata area (i.e. length property).
On success, Bneeded() returns estimated buffer size; on error, -1 is returned, with Berror set to indicate the error.
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, nrfields is less or equal to zero, totsize is less or equal to zero.
Report bugs to support@mavimax.com