Bneeded — Allocated UBF buffer
#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.