Commit 83135e8f authored by Wayne Davison's avatar Wayne Davison

Updated hashtable structures.

parent 36923392
......@@ -491,11 +491,26 @@ enum msgcode {
# define SIZEOF_INT64 SIZEOF_OFF_T
#endif
struct idev_node {
int64 key;
struct hashtable {
void *nodes;
int32 size, entries;
uint32 node_size;
};
struct ht_int32_node {
void *data;
int32 key;
};
struct ht_int64_node {
void *data;
int64 key;
};
#define HT_NODE(tbl, bkts, i) ((void*)((char*)(bkts) + (i)*(tbl)->node_size))
#define HT_KEY(node, k64) ((k64)? ((struct ht_int64_node*)(node))->key \
: (int64)((struct ht_int32_node*)(node))->key)
#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment