Commit 76d3f5af authored by Felix Hamann's avatar Felix Hamann

database records are correctly sorted now...

parent 038e5055
......@@ -83,6 +83,21 @@ PRINT_DB_INFO (sam_db_t *self)
*/
static int
bt_compare_int (
DB *dbp UU,
const DBT *a,
const DBT *b,
size_t *size UU)
{
int
ai = *(int *) a->data,
bi = *(int *) b->data;
return ai - bi;
}
// --------------------------------------------------------------------------
/// Generic error handler invoked by DB.
static void
......@@ -184,6 +199,8 @@ sam_db_new (
return NULL;
}
self->dbp->set_bt_compare (self->dbp, bt_compare_int);
rc = self->dbp->open (
self->dbp,
NULL, // transaction pointer
......@@ -199,7 +216,6 @@ sam_db_new (
return NULL;
}
stat_db_size (self);
self->dbp->set_errcall (self->dbp, db_error_handler);
return self;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment