summaryrefslogtreecommitdiff
path: root/hash.h
diff options
context:
space:
mode:
authorvenaas <venaas>2008-08-21 11:39:35 +0000
committervenaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf>2008-08-21 11:39:35 +0000
commit924eb6a12fa17c4ebbff5c8a15bd266358c16b09 (patch)
tree5abb938ad8f69355d37d0a3b8f59c8ac20120064 /hash.h
parent0821c152301b03565125e823f580deef4812d554 (diff)
adding hash type, changed tls configs to hash
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@352 e88ac4ed-0b26-0410-9574-a7f39faa03bf
Diffstat (limited to 'hash.h')
-rw-r--r--hash.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/hash.h b/hash.h
new file mode 100644
index 0000000..f9268ea
--- /dev/null
+++ b/hash.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2008 Stig Venaas <venaas@uninett.no>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ */
+
+#include <stdint.h>
+
+struct hash {
+ struct list *hashlist;
+ pthread_mutex_t mutex;
+};
+
+/* allocates and initialises hash structure; returns NULL if malloc fails */
+struct hash *hash_create();
+
+/* frees all memory associated with the hash */
+void hash_destroy(struct hash *hash);
+
+/* insert entry in hash; returns 1 if ok, 0 if malloc fails */
+int hash_insert(struct hash *hash, void *key, uint32_t keylen, void *data);
+
+/* reads entry from hash */
+void *hash_read(struct hash *hash, void *key, uint32_t keylen);