2 /* Adapted from DJB's original cdb-0.75 package */
9 #define CDB_HASHSTART 5381
10 extern uint32 cdb_hashadd(uint32,unsigned char);
11 extern uint32 cdb_hash(char *,unsigned int);
14 char *map; /* 0 if no map is available */
16 uint32 size; /* initialized if map is nonzero */
17 uint32 loop; /* number of hash slots searched under this key */
18 uint32 khash; /* initialized if loop is nonzero */
19 uint32 kpos; /* initialized if loop is nonzero */
20 uint32 hpos; /* initialized if loop is nonzero */
21 uint32 hslots; /* initialized if loop is nonzero */
22 uint32 dpos; /* initialized if cdb_findnext() returns 1 */
23 uint32 dlen; /* initialized if cdb_findnext() returns 1 */
26 extern void cdb_free(struct cdb *);
27 extern void cdb_init(struct cdb *,int fd);
29 extern int cdb_read(struct cdb *,char *,unsigned int,uint32);
31 extern void cdb_findstart(struct cdb *);
32 extern int cdb_findnext(struct cdb *,char *,unsigned int);
33 extern int cdb_find(struct cdb *,char *,unsigned int);
35 #define cdb_datapos(c) ((c)->dpos)
36 #define cdb_datalen(c) ((c)->dlen)