aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2013-01-09 18:50:49 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2013-01-09 18:50:49 +0400
commitb94138fc387a4ff991738db86a7064221ef25959 (patch)
tree92fa01bcc3c22e020afe3fa97d5a9d9e73205d32 /src/util.h
parent823c263b9d417a9d28344c469b253e0dfe76e640 (diff)
downloadrspamd-b94138fc387a4ff991738db86a7064221ef25959.tar.gz
rspamd-b94138fc387a4ff991738db86a7064221ef25959.zip
Copy hash table utility function.
Slight fix for /symbols handler.
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index bd57ef59b..6bec21f46 100644
--- a/src/util.h
+++ b/src/util.h
@@ -359,4 +359,25 @@ guint32 murmur32_hash (const guint8 *in, gsize len);
*/
void murmur128_hash (const guint8 *in, gsize len, guint64 out[]);
+/**
+ * Deep copy of one hash table to another
+ * @param src source hash
+ * @param dst destination hash
+ * @param key_copy_func function called to copy or modify keys (or NULL)
+ * @param value_copy_func function called to copy or modify values (or NULL)
+ * @param ud user data for copy functions
+ */
+void rspamd_hash_table_copy (GHashTable *src, GHashTable *dst,
+ gpointer (*key_copy_func)(gconstpointer data, gpointer ud),
+ gpointer (*value_copy_func)(gconstpointer data, gpointer ud),
+ gpointer ud);
+
+/**
+ * Utility function to provide mem_pool copy for rspamd_hash_table_copy function
+ * @param data string to copy
+ * @param ud memory pool to use
+ * @return
+ */
+gpointer rspamd_str_pool_copy (gconstpointer data, gpointer ud);
+
#endif