diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-05-09 21:25:23 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-05-09 21:25:23 +0100 |
commit | 22f603e83dd4fe3fc6d3e9e18b19bc87d57af235 (patch) | |
tree | cecceb5ebef41c6219071b4ea55c5d5c9b492294 /src/libserver/rspamd_symcache.h | |
parent | d0d9673d38dbb2e8aa93ae60bbbc9193e9646902 (diff) | |
download | rspamd-22f603e83dd4fe3fc6d3e9e18b19bc87d57af235.tar.gz rspamd-22f603e83dd4fe3fc6d3e9e18b19bc87d57af235.zip |
[Rework] Use dynamic items for calling callbacks
It is trivial to get a static item by dynamic item by just subtracting
pointers. So there is no need in other complications.
Diffstat (limited to 'src/libserver/rspamd_symcache.h')
-rw-r--r-- | src/libserver/rspamd_symcache.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/libserver/rspamd_symcache.h b/src/libserver/rspamd_symcache.h index e47ea3edd..d1a9c41fe 100644 --- a/src/libserver/rspamd_symcache.h +++ b/src/libserver/rspamd_symcache.h @@ -31,11 +31,12 @@ struct rspamd_task; struct rspamd_config; struct rspamd_symcache; struct rspamd_worker; +struct rspamd_symcache_dynamic_item; struct rspamd_symcache_item; struct rspamd_config_settings_elt; typedef void (*symbol_func_t) (struct rspamd_task *task, - struct rspamd_symcache_item *item, + struct rspamd_symcache_dynamic_item *item, gpointer user_data); enum rspamd_symbol_type { @@ -219,7 +220,7 @@ void* rspamd_symcache_start_refresh (struct rspamd_symcache *cache, * @param cache * @param symbol */ -void rspamd_symcache_inc_frequency (struct rspamd_symcache *cache, +void rspamd_symcache_inc_frequency (struct rspamd_symcache *_cache, struct rspamd_symcache_item *item); /** @@ -333,7 +334,7 @@ void rspamd_symcache_foreach (struct rspamd_symcache *cache, * @param task * @return */ -struct rspamd_symcache_item *rspamd_symcache_get_cur_item (struct rspamd_task *task); +struct rspamd_symcache_dynamic_item *rspamd_symcache_get_cur_item (struct rspamd_task *task); /** * Replaces the current item being processed. @@ -342,21 +343,21 @@ struct rspamd_symcache_item *rspamd_symcache_get_cur_item (struct rspamd_task *t * @param item * @return */ -struct rspamd_symcache_item *rspamd_symcache_set_cur_item (struct rspamd_task *task, - struct rspamd_symcache_item *item); +struct rspamd_symcache_dynamic_item *rspamd_symcache_set_cur_item (struct rspamd_task *task, + struct rspamd_symcache_dynamic_item *item); /** * Finalize the current async element potentially calling its deps */ void rspamd_symcache_finalize_item (struct rspamd_task *task, - struct rspamd_symcache_item *item); + struct rspamd_symcache_dynamic_item *item); /* * Increase number of async events pending for an item */ guint rspamd_symcache_item_async_inc_full (struct rspamd_task *task, - struct rspamd_symcache_item *item, + struct rspamd_symcache_dynamic_item *item, const gchar *subsystem, const gchar *loc); @@ -367,7 +368,7 @@ guint rspamd_symcache_item_async_inc_full (struct rspamd_task *task, * Decrease number of async events pending for an item, asserts if no events pending */ guint rspamd_symcache_item_async_dec_full (struct rspamd_task *task, - struct rspamd_symcache_item *item, + struct rspamd_symcache_dynamic_item *item, const gchar *subsystem, const gchar *loc); @@ -382,7 +383,7 @@ guint rspamd_symcache_item_async_dec_full (struct rspamd_task *task, * @return */ gboolean rspamd_symcache_item_async_dec_check_full (struct rspamd_task *task, - struct rspamd_symcache_item *item, + struct rspamd_symcache_dynamic_item *item, const gchar *subsystem, const gchar *loc); |