diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-12-14 15:38:46 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-12-14 15:38:46 +0000 |
commit | 3c9e040a7c97120ddf38c7c7629a267e576bf514 (patch) | |
tree | 69611e33ce6887f9507d80a262537ef2ea6ce17b /src/libutil | |
parent | 830eff6a124fbcfc7d9cedd781b2ae261388503b (diff) | |
download | rspamd-3c9e040a7c97120ddf38c7c7629a267e576bf514.tar.gz rspamd-3c9e040a7c97120ddf38c7c7629a267e576bf514.zip |
Add methods to extract internal fields from LRU hash
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/hash.c | 13 | ||||
-rw-r--r-- | src/libutil/hash.h | 11 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/libutil/hash.c b/src/libutil/hash.c index 04f87d7a1..51cc4207c 100644 --- a/src/libutil/hash.c +++ b/src/libutil/hash.c @@ -228,6 +228,19 @@ rspamd_lru_hash_destroy (rspamd_lru_hash_t *hash) g_slice_free1 (sizeof (rspamd_lru_hash_t), hash); } + +GHashTable * +rspamd_lru_hash_get_htable (rspamd_lru_hash_t *hash) +{ + return hash->tbl; +} + +GQueue * +rspamd_lru_hash_get_queue (rspamd_lru_hash_t *hash) +{ + return hash->exp; +} + /* * vi:ts=4 */ diff --git a/src/libutil/hash.h b/src/libutil/hash.h index 022548f3c..bb55f2595 100644 --- a/src/libutil/hash.h +++ b/src/libutil/hash.h @@ -71,6 +71,17 @@ 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 + */ +GHashTable *rspamd_lru_hash_get_htable (rspamd_lru_hash_t *hash); + + +/** + * Get expire queue for this lru hash + */ +GQueue *rspamd_lru_hash_get_queue (rspamd_lru_hash_t *hash); + #endif /* |