Browse Source

Add methods to extract internal fields from LRU hash

tags/1.1.0
Vsevolod Stakhov 8 years ago
parent
commit
3c9e040a7c
2 changed files with 24 additions and 0 deletions
  1. 13
    0
      src/libutil/hash.c
  2. 11
    0
      src/libutil/hash.h

+ 13
- 0
src/libutil/hash.c View File

@@ -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
*/

+ 11
- 0
src/libutil/hash.h View File

@@ -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

/*

Loading…
Cancel
Save