Main Page | Namespace List | Class List | File List | Class Members | File Members | Related Pages

cdb.h

Go to the documentation of this file.
00001 /* Public domain. */
00002 
00003 #ifndef CDB_H
00004 #define CDB_H
00005 
00006 #ifdef __cplusplus
00007 extern "C" {
00008 #endif
00009 
00010 #include "uint32.h"
00011 
00012 #define CDB_HASHSTART 5381
00013 extern uint32 cdb_hashadd(uint32,unsigned char);
00014 extern uint32 cdb_hash(char *,unsigned int);
00015 
00016 struct cdb {
00017   char *map; /* 0 if no map is available */
00018   int fd;
00019   uint32 size; /* initialized if map is nonzero */
00020   uint32 loop; /* number of hash slots searched under this key */
00021   uint32 khash; /* initialized if loop is nonzero */
00022   uint32 kpos; /* initialized if loop is nonzero */
00023   uint32 hpos; /* initialized if loop is nonzero */
00024   uint32 hslots; /* initialized if loop is nonzero */
00025   uint32 dpos; /* initialized if cdb_findnext() returns 1 */
00026   uint32 dlen; /* initialized if cdb_findnext() returns 1 */
00027 } ;
00028 
00029 extern void cdb_free(struct cdb *);
00030 extern void cdb_init(struct cdb *,int fd);
00031 
00032 extern int cdb_read(struct cdb *,char *,unsigned int,uint32);
00033 
00034 extern void cdb_findstart(struct cdb *);
00035 extern int cdb_findnext(struct cdb *,char *,unsigned int);
00036 extern int cdb_find(struct cdb *,char *,unsigned int);
00037 
00038 #ifdef __cplusplus
00039 }
00040 #endif
00041 #endif

Generated on Mon Apr 26 09:49:22 2004 for ConstantDataStore by doxygen 1.3.6-20040222