diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-07-23 12:57:31 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-07-23 12:57:31 +0100 |
commit | 379055dbbb4af997b4d3ffb161d447872d7ca357 (patch) | |
tree | 3774553d470f93e12ddeb454aad9b3b607cf8918 /src/libserver/symbols_cache.h | |
parent | 602ae7a0b7e215ba2677131b8fdc70abc156b3ca (diff) | |
download | rspamd-379055dbbb4af997b4d3ffb161d447872d7ca357.tar.gz rspamd-379055dbbb4af997b4d3ffb161d447872d7ca357.zip |
Unify style without sorting headers.
Diffstat (limited to 'src/libserver/symbols_cache.h')
-rw-r--r-- | src/libserver/symbols_cache.h | 55 |
1 files changed, 39 insertions, 16 deletions
diff --git a/src/libserver/symbols_cache.h b/src/libserver/symbols_cache.h index b3835824d..e1fd3286f 100644 --- a/src/libserver/symbols_cache.h +++ b/src/libserver/symbols_cache.h @@ -32,7 +32,7 @@ struct cache_item { struct dynamic_map_item *networks; guint32 networks_number; gboolean is_dynamic; - + /* Callback data */ symbol_func_t func; gpointer user_data; @@ -53,7 +53,7 @@ struct symbols_cache { /* Items that have negative weights */ GList *negative_items; - + /* Radix map of dynamic rules with ip mappings */ radix_tree_t *dynamic_map; radix_tree_t *negative_dynamic_map; @@ -77,8 +77,11 @@ struct symbols_cache { /** * Load symbols cache from file, must be called _after_ init_symbols_cache */ -gboolean init_symbols_cache (rspamd_mempool_t *pool, struct symbols_cache *cache, struct rspamd_config *cfg, - const gchar *filename, gboolean ignore_checksum); +gboolean init_symbols_cache (rspamd_mempool_t *pool, + struct symbols_cache *cache, + struct rspamd_config *cfg, + const gchar *filename, + gboolean ignore_checksum); /** * Register function for symbols parsing @@ -86,15 +89,20 @@ gboolean init_symbols_cache (rspamd_mempool_t *pool, struct symbols_cache *cache * @param func pointer to handler * @param user_data pointer to user_data */ -void register_symbol (struct symbols_cache **cache, const gchar *name, double weight, - symbol_func_t func, gpointer user_data); +void register_symbol (struct symbols_cache **cache, + const gchar *name, + double weight, + symbol_func_t func, + gpointer user_data); /** * Register virtual symbol * @param name name of symbol */ -void register_virtual_symbol (struct symbols_cache **cache, const gchar *name, double weight); +void register_virtual_symbol (struct symbols_cache **cache, + const gchar *name, + double weight); /** * Register callback function for symbols parsing @@ -102,8 +110,11 @@ void register_virtual_symbol (struct symbols_cache **cache, const gchar *name, d * @param func pointer to handler * @param user_data pointer to user_data */ -void register_callback_symbol (struct symbols_cache **cache, const gchar *name, double weight, - symbol_func_t func, gpointer user_data); +void register_callback_symbol (struct symbols_cache **cache, + const gchar *name, + double weight, + symbol_func_t func, + gpointer user_data); /** * Register function for symbols parsing with strict priority @@ -111,8 +122,12 @@ void register_callback_symbol (struct symbols_cache **cache, const gchar *name, * @param func pointer to handler * @param user_data pointer to user_data */ -void register_callback_symbol_priority (struct symbols_cache **cache, const gchar *name, double weight, - gint priority, symbol_func_t func, gpointer user_data); +void register_callback_symbol_priority (struct symbols_cache **cache, + const gchar *name, + double weight, + gint priority, + symbol_func_t func, + gpointer user_data); /** * Register function for dynamic symbols parsing @@ -120,9 +135,13 @@ void register_callback_symbol_priority (struct symbols_cache **cache, const gcha * @param func pointer to handler * @param user_data pointer to user_data */ -void register_dynamic_symbol (rspamd_mempool_t *pool, struct symbols_cache **cache, const gchar *name, - double weight, symbol_func_t func, - gpointer user_data, GList *networks); +void register_dynamic_symbol (rspamd_mempool_t *pool, + struct symbols_cache **cache, + const gchar *name, + double weight, + symbol_func_t func, + gpointer user_data, + GList *networks); /** * Call function for cached symbol using saved callback @@ -130,7 +149,9 @@ void register_dynamic_symbol (rspamd_mempool_t *pool, struct symbols_cache **cac * @param cache symbols cache * @param saved_item pointer to currently saved item */ -gboolean call_symbol_callback (struct rspamd_task *task, struct symbols_cache *cache, gpointer *save); +gboolean call_symbol_callback (struct rspamd_task *task, + struct symbols_cache *cache, + gpointer *save); /** * Remove all dynamic rules from cache @@ -144,7 +165,9 @@ void remove_dynamic_rules (struct symbols_cache *cache); * @param cfg configuration * @param strict do strict checks - symbols MUST be described in metrics */ -gboolean validate_cache (struct symbols_cache *cache, struct rspamd_config *cfg, gboolean strict); +gboolean validate_cache (struct symbols_cache *cache, + struct rspamd_config *cfg, + gboolean strict); #endif |