added dbiGetFirstKey()
CVS patchset: 2602 CVS date: 1998/12/15 05:48:11
This commit is contained in:
parent
2bbb5a8f93
commit
033797c0ef
|
@ -29,6 +29,22 @@ void dbiSyncIndex(dbiIndex * dbi) {
|
|||
dbi->db->sync(dbi->db, 0);
|
||||
}
|
||||
|
||||
int dbiGetFirstKey(dbiIndex * dbi, char ** keyp) {
|
||||
DBT key, data;
|
||||
int rc;
|
||||
|
||||
rc = dbi->db->seq(dbi->db, &key, &data, R_FIRST);
|
||||
if (rc) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
*keyp = malloc(key.size + 1);
|
||||
memcpy(*keyp, key.data, key.size);
|
||||
(*keyp)[key.size] = '\0';
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dbiSearchIndex(dbiIndex * dbi, char * str, dbiIndexSet * set) {
|
||||
DBT key, data;
|
||||
int rc;
|
||||
|
|
|
@ -41,6 +41,7 @@ int dbiRemoveIndexRecord(dbiIndexSet * set, dbiIndexRecord rec);
|
|||
/* 0 on success - fails if rec is not found */
|
||||
dbiIndexSet dbiCreateIndexRecord(void);
|
||||
void dbiFreeIndexRecord(dbiIndexSet set);
|
||||
int dbiGetFirstKey(dbiIndex * dbi, char ** key);
|
||||
|
||||
extern inline int dbiIndexSetCount(dbiIndexSet set);
|
||||
extern inline int dbiIndexSetCount(dbiIndexSet set) {
|
||||
|
|
Loading…
Reference in New Issue