Whole document tree
    

Whole document tree

Berkeley DB: DB->set_append_recno

DB->set_append_recno

APIRef

#include <db.h>

int DB->set_append_recno(DB *, int (*db_append_recno_fcn)(DB *dbp, DBT *data, db_recno_t recno));

Description

When using the DB_APPEND option of the DB->put method, it may be useful to modify the stored data based on the generated key. If a callback function is specified using the DB->set_append_recno function, it will be called after the record number has been selected but before the data has been stored. The callback function must return 0 on success and errno or a value outside of the Berkeley DB error name space on failure.

The called function must take three arguments: a reference to the enclosing database handle, the data DBT to be stored and the selected record number. The called function may then modify the data DBT.

The DB->set_append_recno interface may only be used to configure Berkeley DB before the DB->open interface is called.

The DB->set_append_recno function returns a non-zero error value on failure and 0 on success.

See Also

DBENV->close, db_env_create, DBENV->open, DBENV->remove, DBENV->err, db_strerror, db_version, DBENV->set_cachesize, DBENV->set_errcall, DBENV->set_errfile, DBENV->set_errpfx, DBENV->set_flags, DBENV->set_mutexlocks, DBENV->set_paniccall, and DBENV->set_verbose.

APIRef

Copyright Sleepycat Software