From: Wayne Davison Date: Mon, 3 Sep 2007 04:59:05 +0000 (+0000) Subject: Updated hashtable structures. X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/83135e8f6a093ac619f7cc6ae35260b0c5d75d9c Updated hashtable structures. --- diff --git a/rsync.h b/rsync.h index 6da67e81..bb530bd2 100644 --- a/rsync.h +++ b/rsync.h @@ -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