June 2001
Intermediate to advanced
688 pages
19h 18m
English
#include <db_cxx.h> int Db::set_append_recno( int (*db_append_recno_fcn)(DB *dbp, Dbt *data, db_recno_t recno));
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 method is specified using the Db::set_append_recno method, 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 ...