summaryrefslogtreecommitdiff
path: root/src/journal/lookup3.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-10-07 21:06:39 +0200
committerLennart Poettering <lennart@poettering.net>2011-10-07 22:02:05 +0200
commit87d2c1ff6a7375f03476767e6f59454bcc5cd04b (patch)
tree26824a2485942702b3472cc73191c01e78c622d1 /src/journal/lookup3.h
parent9a36607584bbd1d78775353e022a51794b4e27b1 (diff)
journal: add preliminary incomplete implementation
Diffstat (limited to 'src/journal/lookup3.h')
-rw-r--r--src/journal/lookup3.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/journal/lookup3.h b/src/journal/lookup3.h
new file mode 100644
index 0000000000..31cc2f57b0
--- /dev/null
+++ b/src/journal/lookup3.h
@@ -0,0 +1,25 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+#ifndef foolookup3hfoo
+#define foolookup3hfoo
+
+#include <inttypes.h>
+#include <sys/types.h>
+
+uint32_t jenkins_hashword(const uint32_t *k, size_t length, uint32_t initval);
+void jenkins_hashword2(const uint32_t *k, size_t length, uint32_t *pc, uint32_t *pb);
+
+uint32_t jenkins_hashlittle(const void *key, size_t length, uint32_t initval);
+void jenkins_hashlittle2(const void *key, size_t length, uint32_t *pc, uint32_t *pb);
+
+uint32_t jenkins_hashbig(const void *key, size_t length, uint32_t initval);
+
+static inline uint64_t hash64(const void *data, size_t length) {
+ uint32_t a = 0, b = 0;
+
+ jenkins_hashlittle2(data, length, &a, &b);
+
+ return ((uint64_t) a << 32ULL) | (uint64_t) b;
+}
+
+#endif