You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
458 B
29 lines
458 B
#ifndef _HASHTABLE_H
|
|
|
|
#define H_DEFAULT_BLOCKSIZE 255
|
|
|
|
#define H_FLAG_EXCHECK (1<<0) //don't check the hash, check the key itself
|
|
|
|
struct h_kvpair {
|
|
unsigned char fillbit;
|
|
unsigned int32_t crc32;
|
|
unsigned char data[];
|
|
};
|
|
|
|
struct h_page {
|
|
struct h_page* next;
|
|
struct h_kvpair pairs[]; //blocksize
|
|
};
|
|
|
|
typedef struct {
|
|
size_t keysize;
|
|
size_t valuesize;
|
|
size_t blocksize;
|
|
|
|
unsigned int flags;
|
|
|
|
h_page* page0;
|
|
} hashtable_t;
|
|
|
|
#endif /* _HASHTABLE_H */
|