summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/hashtable.c11
-rw-r--r--src/utils/hashtable.h3
2 files changed, 14 insertions, 0 deletions
diff --git a/src/utils/hashtable.c b/src/utils/hashtable.c
index c2ff8ce..f1dc076 100644
--- a/src/utils/hashtable.c
+++ b/src/utils/hashtable.c
@@ -16,6 +16,8 @@
#endif
#include "utils/hashtable.h"
+#include <libwapcaplet/libwapcaplet.h>
+
/* The hash table entry */
struct _dom_hash_entry {
void *key; /**< The key pointer */
@@ -353,6 +355,15 @@ dom_hash_func _dom_hash_get_func(struct dom_hash_table *ht)
return ht->hash;
}
+/*-----------------------------------------------------------------------*/
+/* The hash function for lwc_string type */
+unsigned int _dom_hash_hash_lwcstring(void *key)
+{
+ lwc_string *lstr = (lwc_string *) key;
+
+ return lwc_string_hash_value(lstr);
+}
+
/* A simple test rig. To compile, use:
* gcc -g -o hashtest -I../ -I../../include -DTEST_RIG hashtable.c
*
diff --git a/src/utils/hashtable.h b/src/utils/hashtable.h
index 3cfe95d..625e440 100644
--- a/src/utils/hashtable.h
+++ b/src/utils/hashtable.h
@@ -39,4 +39,7 @@ unsigned int _dom_hash_get_length(struct dom_hash_table *ht);
unsigned int _dom_hash_get_chains(struct dom_hash_table *ht);
dom_hash_func _dom_hash_get_func(struct dom_hash_table *ht);
+/*-----------------------------------------------------------------------*/
+unsigned int _dom_hash_hash_lwcstring(void *key);
+
#endif