summaryrefslogtreecommitdiff
path: root/src/libsystemd/libsystemd-journal-internal/lookup3.h
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-06-07 00:05:00 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-06-07 00:05:00 -0400
commit5c2a4ec88de774007b939796823adc4d7cb3c8dd (patch)
treeaa2724fd2bdeb2d1cb0501f05eddc463f3eec563 /src/libsystemd/libsystemd-journal-internal/lookup3.h
parentce3326f10b8522ff1b1d2d55c76910a67897dbce (diff)
./move.sh
Diffstat (limited to 'src/libsystemd/libsystemd-journal-internal/lookup3.h')
-rw-r--r--src/libsystemd/libsystemd-journal-internal/lookup3.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/libsystemd/libsystemd-journal-internal/lookup3.h b/src/libsystemd/libsystemd-journal-internal/lookup3.h
new file mode 100644
index 0000000000..787921ffbf
--- /dev/null
+++ b/src/libsystemd/libsystemd-journal-internal/lookup3.h
@@ -0,0 +1,22 @@
+#pragma once
+
+#include <inttypes.h>
+#include <sys/types.h>
+
+#include "macro.h"
+
+uint32_t jenkins_hashword(const uint32_t *k, size_t length, uint32_t initval) _pure_;
+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) _pure_;
+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) _pure_;
+
+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;
+}