Browse Source

add prototypes for traversal api

master
Felix von Leitner 16 years ago
parent
commit
f750c47430
  1. 7
      cdb.h
  2. 2
      cdb/cdb_traverse.c

7
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

2
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) {

Loading…
Cancel
Save