1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
#ifndef CDBMAKE_H
#define CDBMAKE_H
#include "uint32.h"
#define CDBMAKE_HPLIST 1000
struct cdbmake_hp { uint32 h; uint32 p; } ;
struct cdbmake_hplist {
struct cdbmake_hp hp[CDBMAKE_HPLIST];
struct cdbmake_hplist *next;
int num;
} ;
struct cdbmake {
char final[2048];
uint32 count[256];
uint32 start[256];
struct cdbmake_hplist *head;
struct cdbmake_hp *split; /* includes space for hash */
struct cdbmake_hp *hash;
uint32 numentries;
} ;
typedef char *(*cdbmake_alloc_cb)(unsigned int);
extern void cdbmake_pack(unsigned char *, uint32);
#define CDBMAKE_HASHSTART ((uint32) 5381)
extern uint32 cdbmake_hashadd(uint32, unsigned int);
extern void cdbmake_init(struct cdbmake *);
extern int cdbmake_add(struct cdbmake *, uint32, uint32, cdbmake_alloc_cb);
extern int cdbmake_split(struct cdbmake *, cdbmake_alloc_cb);
extern uint32 cdbmake_throw(struct cdbmake *, uint32, int);
#endif
|