diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-11-01 17:29:31 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-11-01 17:29:31 +0300 |
commit | d194a7d577985268ff5f7f29379c90d694a8f230 (patch) | |
tree | 8627220fcdd5d44091b3bdb34bcea9ca82b77143 /src/kvstorage.h | |
parent | 48e621e0c0fcaa3bbb788147ccd4fc302c6c929b (diff) | |
download | rspamd-d194a7d577985268ff5f7f29379c90d694a8f230.tar.gz rspamd-d194a7d577985268ff5f7f29379c90d694a8f230.zip |
* Add array operations
Fix memory freeing for elements in kvstorage.
Diffstat (limited to 'src/kvstorage.h')
-rw-r--r-- | src/kvstorage.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/kvstorage.h b/src/kvstorage.h index 5bacc7c6b..4c2f0ef5c 100644 --- a/src/kvstorage.h +++ b/src/kvstorage.h @@ -135,11 +135,22 @@ gboolean rspamd_kv_storage_replace (struct rspamd_kv_storage *storage, gpointer struct rspamd_kv_element* rspamd_kv_storage_lookup (struct rspamd_kv_storage *storage, gpointer key, time_t now); /** Expire an element from kv storage */ -gboolean rspamd_kv_storage_delete (struct rspamd_kv_storage *storage, gpointer key); +struct rspamd_kv_element* rspamd_kv_storage_delete (struct rspamd_kv_storage *storage, gpointer key); /** Destroy kv storage */ void rspamd_kv_storage_destroy (struct rspamd_kv_storage *storage); +/** Insert array */ +gboolean rspamd_kv_storage_insert_array (struct rspamd_kv_storage *storage, gpointer key, guint elt_size, gpointer data, gsize len, gint flags, guint expire); + +/** Set element inside array */ +gboolean rspamd_kv_storage_set_array (struct rspamd_kv_storage *storage, gpointer key, guint elt_num, + gpointer data, gsize len, time_t now); + +/** Get element inside array */ +gboolean rspamd_kv_storage_get_array (struct rspamd_kv_storage *storage, gpointer key, guint elt_num, + gpointer *data, gsize *len, time_t now); + /** * LRU expire */ |