Squashed 'third_party/rawrtc/re/' content from commit f3163ce8b
Change-Id: I6a235e6ac0f03269d951026f9d195da05c40fdab
git-subtree-dir: third_party/rawrtc/re
git-subtree-split: f3163ce8b526a13b35ef71ce4dd6f43585064d8a
diff --git a/include/re_hash.h b/include/re_hash.h
new file mode 100644
index 0000000..8858dbc
--- /dev/null
+++ b/include/re_hash.h
@@ -0,0 +1,33 @@
+/**
+ * @file re_hash.h Interface to hashmap table
+ *
+ * Copyright (C) 2010 Creytiv.com
+ */
+
+
+struct hash;
+struct pl;
+
+
+int hash_alloc(struct hash **hp, uint32_t bsize);
+void hash_append(struct hash *h, uint32_t key, struct le *le, void *data);
+void hash_unlink(struct le *le);
+struct le *hash_lookup(const struct hash *h, uint32_t key, list_apply_h *ah,
+ void *arg);
+struct le *hash_apply(const struct hash *h, list_apply_h *ah, void *arg);
+struct list *hash_list(const struct hash *h, uint32_t key);
+uint32_t hash_bsize(const struct hash *h);
+void hash_flush(struct hash *h);
+void hash_clear(struct hash *h);
+uint32_t hash_valid_size(uint32_t size);
+
+
+/* Hash functions */
+uint32_t hash_joaat(const uint8_t *key, size_t len);
+uint32_t hash_joaat_ci(const char *str, size_t len);
+uint32_t hash_joaat_str(const char *str);
+uint32_t hash_joaat_str_ci(const char *str);
+uint32_t hash_joaat_pl(const struct pl *pl);
+uint32_t hash_joaat_pl_ci(const struct pl *pl);
+uint32_t hash_fast(const char *k, size_t len);
+uint32_t hash_fast_str(const char *str);