1 #ifndef CDBMAKE_H 2 #define CDBMAKE_H 3 4 /* placed in the public domain by dbj@pobox.com, 5 * ANSIfied by uwe@ohse.de 6 */ 7 8 /* #include "uint32.h" */ 9 #include "typesize.h" 10 #define uint32 uo_uint32 11 12 #define CDBMAKE_HPLIST 1000 13 14 struct cdbmake_hp { uint32 h; uint32 p; } ; 15 16 struct cdbmake_hplist { 17 struct cdbmake_hp hp[CDBMAKE_HPLIST]; 18 struct cdbmake_hplist *next; 19 int num; 20 } ; 21 22 struct cdbmake { 23 unsigned char final[2048]; 24 uint32 count[256]; 25 uint32 start[256]; 26 struct cdbmake_hplist *head; 27 struct cdbmake_hp *split; /* includes space for hash */ 28 struct cdbmake_hp *hash; 29 uint32 numentries; 30 } ; 31 32 extern void cdbmake_pack P__((unsigned char *,uint32)); 33 #define CDBMAKE_HASHSTART ((uint32) 5381) 34 extern uint32 cdbmake_hashadd P__((uint32,unsigned int)); 35 36 extern void cdbmake_init P__((struct cdbmake *)); 37 extern int cdbmake_add P__((struct cdbmake *cdbm,uint32 h,uint32 p, void *(*alloc)(size_t))); 38 extern int cdbmake_split P__((struct cdbmake *cdbm, void *(*alloc)(size_t))); 39 extern uint32 cdbmake_throw P__((struct cdbmake *cdbm,uint32 pos,int b)); 40 41 #endif 42