From: Eric S. Raymond Date: Mon, 15 Sep 2003 08:46:41 +0000 (+0000) Subject: Initial revision X-Git-Tag: 1.6~8 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=ccf71480726d53ea600815ae92475cece9eb2a90;p=comparator.git Initial revision --- diff --git a/hash.h b/hash.h new file mode 100644 index 0000000..ac49cf9 --- /dev/null +++ b/hash.h @@ -0,0 +1,17 @@ +/* interface file for comparator hash function */ + +#ifdef CUSTOM_HASH +#define HASHSIZE 8 +typedef unsigned long long hashval_t; +#define hash_compare(s, t) ((s) - (t)) +#else +#define HASHSIZE 16 +typedef unsigned char hashval_t[HASHSIZE]; +#define hash_compare(s, t) memcmp((s), (t), HASHSIZE) +#endif + +void hash_init(void); +void hash_update(unsigned char *buffer, const int len); +void hash_complete(hashval_t *hp); + +/* hash.h ends */