June 2001
Intermediate to advanced
688 pages
19h 18m
English
#include <db.h> int DB→set_dup_compare(DB *db, int (*dup_compare_fcn)(DB *, const DBT *, const DBT *));
Set the duplicate data item comparison function. The comparison function is called when it is necessary to compare a data item specified by the application with a data item currently stored in the tree. The first argument to the comparison function is the DBT representing the application’s data item; the second is the current tree’s data item.
The comparison function must return an integer value less than, equal to, or greater than zero if the first data item argument is considered to be respectively less than, equal to, or greater than the second data item argument. In addition, the comparison function must ...