summaryrefslogtreecommitdiff
path: root/include/parserutils/utils/hash.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/parserutils/utils/hash.h')
-rw-r--r--include/parserutils/utils/hash.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/include/parserutils/utils/hash.h b/include/parserutils/utils/hash.h
new file mode 100644
index 0000000..129c6f6
--- /dev/null
+++ b/include/parserutils/utils/hash.h
@@ -0,0 +1,31 @@
+/*
+ * This file is part of LibParserUtils.
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2008 John-Mark Bell <jmb@netsurf-browser.org>
+ */
+
+#ifndef parserutils_utils_hash_h_
+#define parserutils_utils_hash_h_
+
+#include <parserutils/errors.h>
+#include <parserutils/functypes.h>
+
+typedef struct parserutils_hash_entry {
+ size_t len;
+ const uint8_t *data;
+} parserutils_hash_entry;
+
+struct parserutils_hash;
+typedef struct parserutils_hash parserutils_hash;
+
+parserutils_error parserutils_hash_create(parserutils_alloc alloc, void *pw,
+ parserutils_hash **hash);
+parserutils_error parserutils_hash_destroy(parserutils_hash *hash);
+
+parserutils_error parserutils_hash_insert(parserutils_hash *hash,
+ const uint8_t *data, size_t len,
+ const parserutils_hash_entry **inserted);
+
+#endif
+