1 /* Public domain. */ 2 3 #ifndef CDB_MAKE_H 4 #define CDB_MAKE_H 5 6 #include "buffer.h" 7 #include "uint32.h" 8 9 #define CDB_HPLIST 1000 10 11 struct cdb_hp { uint32 h; uint32 p; } ; 12 13 struct cdb_hplist { 14 struct cdb_hp hp[CDB_HPLIST]; 15 struct cdb_hplist *next; 16 int num; 17 } ; 18 19 struct cdb_make { 20 char bspace[8192]; 21 char final[2048]; 22 uint32 count[256]; 23 uint32 start[256]; 24 struct cdb_hplist *head; 25 struct cdb_hp *split; /* includes space for hash */ 26 struct cdb_hp *hash; 27 uint32 numentries; 28 buffer b; 29 uint32 pos; 30 int fd; 31 } ; 32 33 extern int cdb_make_start(struct cdb_make *,int); 34 extern int cdb_make_addbegin(struct cdb_make *,unsigned int,unsigned int); 35 extern int cdb_make_addend(struct cdb_make *,unsigned int,unsigned int,uint32); 36 extern int cdb_make_add(struct cdb_make *,const char *,unsigned int,const char *,unsigned int); 37 extern int cdb_make_finish(struct cdb_make *); 38 39 #endif 40