]> thyrsus.com Git - comparator.git/commitdiff
Initial revision
authorEric S. Raymond <esr@thyrsus.com>
Mon, 15 Sep 2003 08:46:41 +0000 (08:46 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 15 Sep 2003 08:46:41 +0000 (08:46 +0000)
hash.h [new file with mode: 0644]

diff --git a/hash.h b/hash.h
new file mode 100644 (file)
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 */