00001
00002
00003 #ifndef CDB_MAKE_H
00004 #define CDB_MAKE_H
00005
00006 #ifdef __cplusplus
00007 extern "C" {
00008 #endif
00009
00010 #include "buffer.h"
00011 #include "uint32.h"
00012
00013 #define CDB_HPLIST 1000
00014
00015 struct cdb_hp { uint32 h; uint32 p; } ;
00016
00017 struct cdb_hplist {
00018 struct cdb_hp hp[CDB_HPLIST];
00019 struct cdb_hplist *next;
00020 int num;
00021 } ;
00022
00023 struct cdb_make {
00024 char bspace[8192];
00025 char final[2048];
00026 uint32 count[256];
00027 uint32 start[256];
00028 struct cdb_hplist *head;
00029 struct cdb_hp *split;
00030 struct cdb_hp *hash;
00031 uint32 numentries;
00032 buffer b;
00033 uint32 pos;
00034 int fd;
00035 } ;
00036
00037 extern int cdb_make_start(struct cdb_make *,int);
00038 extern int cdb_make_addbegin(struct cdb_make *,unsigned int,unsigned int);
00039 extern int cdb_make_addend(struct cdb_make *,unsigned int,unsigned int,uint32);
00040 extern int cdb_make_add(struct cdb_make *,char *,unsigned int,char *,unsigned int);
00041 extern int cdb_make_finish(struct cdb_make *);
00042 #ifdef __cplusplus
00043 }
00044 #endif
00045 #endif