diff --git a/cdb.h b/cdb.h index eaf0863..67142d5 100644 --- a/cdb.h +++ b/cdb.h @@ -29,7 +29,14 @@ extern void cdb_findstart(struct cdb *); extern int cdb_findnext(struct cdb *,const unsigned char *,unsigned long int); extern int cdb_find(struct cdb *,const unsigned char *,unsigned long int); +extern int cdb_firstkey(struct cdb *c,uint32 *kpos); +extern int cdb_nextkey(struct cdb *c,uint32 *kpos); + +extern int cdb_successor(struct cdb *c,const unsigned char *,unsigned long int); + #define cdb_datapos(c) ((c)->dpos) #define cdb_datalen(c) ((c)->dlen) +#define cdb_keypos(c) ((c)->kpos) +#define cdb_keylen(c) ((c)->dpos-(c)->kpos) #endif diff --git a/cdb/cdb_traverse.c b/cdb/cdb_traverse.c index 81bfd50..f393585 100644 --- a/cdb/cdb_traverse.c +++ b/cdb/cdb_traverse.c @@ -27,7 +27,7 @@ int cdb_nextkey(struct cdb *c,uint32 *kpos) { return doit(c,kpos); } -int cdb_successor(struct cdb *c,unsigned char *key,unsigned long int klen) { +int cdb_successor(struct cdb *c,const unsigned char *key,unsigned long int klen) { int r; uint32 kpos; if (key) {