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