// Fetch the next item in a sequential search. Returns a pointer to a
// cdbdata structure, or NULL if we've hit the end.
-struct cdbdata bdb_next_item(int cdb) {
- struct cdbdata cdbret;
+struct cdbkeyval bdb_next_item(int cdb) {
+ struct cdbkeyval kv;
int ret = 0;
- memset(&cdbret, 0, sizeof(struct cdbdata));
+ memset(&kv, 0, sizeof(struct cdbkeyval));
// reuse memory from the previous call.
TSD->dbkey[cdb].flags = DB_DBT_MALLOC;
bdb_abort();
}
bdb_close_cursor(cdb);
- return(cdbret); // presumably, we are at the end
+ return(kv); // presumably, we are at the end
}
bdb_decompress_if_necessary(&TSD->dbdata[cdb]);
- cdbret.len = TSD->dbdata[cdb].size;
- cdbret.ptr = TSD->dbdata[cdb].data;
-
- return (cdbret);
+ kv.key.len = TSD->dbkey[cdb].size;
+ kv.key.ptr = TSD->dbkey[cdb].data;
+ kv.val.len = TSD->dbdata[cdb].size;
+ kv.val.ptr = TSD->dbdata[cdb].data;
+ return (kv);
}