summaryrefslogtreecommitdiffstats
path: root/src/libutil/hash.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-14 18:28:33 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-14 18:28:33 +0000
commit45384ca0ba44f87a34eb1e1207f6f6b545f457a2 (patch)
tree5c85d4ecf5fdf77a59ad29f9e9e01d8a3df3f753 /src/libutil/hash.h
parent2638d55b61fcbc37693d6e00c98ce3f6c8e671f3 (diff)
downloadrspamd-45384ca0ba44f87a34eb1e1207f6f6b545f457a2.tar.gz
rspamd-45384ca0ba44f87a34eb1e1207f6f6b545f457a2.zip
Fix fuzzy stats
Diffstat (limited to 'src/libutil/hash.h')
-rw-r--r--src/libutil/hash.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/libutil/hash.h b/src/libutil/hash.h
index bb55f2595..62005f9f8 100644
--- a/src/libutil/hash.h
+++ b/src/libutil/hash.h
@@ -12,6 +12,17 @@
struct rspamd_lru_hash_s;
typedef struct rspamd_lru_hash_s rspamd_lru_hash_t;
+typedef struct rspamd_lru_element_s {
+ gpointer data;
+ gpointer key;
+ time_t store_time;
+ guint ttl;
+ rspamd_lru_hash_t *hash;
+ GList *link;
+
+} rspamd_lru_element_t;
+
+
/**
* Create new lru hash
* @param maxsize maximum elements in a hash
@@ -72,13 +83,13 @@ void rspamd_lru_hash_insert (rspamd_lru_hash_t *hash,
void rspamd_lru_hash_destroy (rspamd_lru_hash_t *hash);
/**
- * Get hash table for this lru hash
+ * Get hash table for this lru hash (use rspamd_lru_element_t as data)
*/
GHashTable *rspamd_lru_hash_get_htable (rspamd_lru_hash_t *hash);
/**
- * Get expire queue for this lru hash
+ * Get expire queue for this lru hash (use rspamd_lru_element_t as data)
*/
GQueue *rspamd_lru_hash_get_queue (rspamd_lru_hash_t *hash);