User Tools

Site Tools


Sidebar

Table Of Contents

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

bflddbget

Name

Bflddbget — extract data from UBF database record

Synopsis

#include <ubf.h>

int Bflddbget(EDB_val *data, short *p_fldtype, BFLDID *p_bfldno, BFLDID *p_bfldid, char *fldname, int fldname_bufsz);

Link with -lubf -lnstd -lm -lpthread

DESCRIPTION

Function extracts UBF field data from database record. The record can be extracted either from id database or name (nm) database. The field type is stored in p_fldtype which corresponds to BFLD_MIN…BFLD_MAX field types. Field number (non compiled) is return in p_bfldno, field id (compiled) is returned in p_bfldid. Field name is returned in fldname for which buffer size is specified in fldname_bufsz.

RETURN VALUE

On success, Bflddbget() return zero; on error, -1 is returned, with Berror set to indicate the error.

ERRORS

In case of error Berror will be non 0. Note that Bstrerror() returns generic error message plus custom message with debug info from last function call.

BEINVAL data is NULL, p_bfldno is NULL, p_bfldid is NULL, p_fldtype is NULL, fldname is NULL, fldname_bufsz less than or equal to 0. Error can be generated also if data is corrupted (size does not match the stored object size).

EXAMPLE

See xadmin/cmd_pubfdb.c for sample code.

BUGS

Report bugs to support@mavimax.com

COPYING

© Mavimax, Ltd