diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-01-05 15:20:28 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-01-05 15:20:28 +0000 |
commit | 603f3664584a2942b718a16a2c303212fdc4871a (patch) | |
tree | 4989a602effc84988e1bd378918e615aa02a1108 /src/libstat/stat_internal.h | |
parent | 57a464ab523700fc7f2ab3f116724cd198799da8 (diff) | |
download | rspamd-603f3664584a2942b718a16a2c303212fdc4871a.tar.gz rspamd-603f3664584a2942b718a16a2c303212fdc4871a.zip |
Start rework
Diffstat (limited to 'src/libstat/stat_internal.h')
-rw-r--r-- | src/libstat/stat_internal.h | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/src/libstat/stat_internal.h b/src/libstat/stat_internal.h index 640196788..18d412ce3 100644 --- a/src/libstat/stat_internal.h +++ b/src/libstat/stat_internal.h @@ -69,10 +69,20 @@ struct rspamd_classifier_runtime { gboolean skipped; }; -struct rspamd_token_result { - double value; - struct rspamd_statfile_runtime *st_runtime; - struct rspamd_classifier_runtime *cl_runtime; +/* Common classifier structure */ +struct rspamd_classifier { + struct rspamd_stat_cache *cache; + gpointer cachecf; + GArray *statfiles_ids; + struct rspamd_classifier_config *cfg; +}; + +struct rspamd_statfile { + gint id; + struct rspamd_statfile_config *stcf; + struct rspamd_classifier *classifier; + struct rspamd_stat_backend *backend; + gpointer bkcf; }; #define RSPAMD_MAX_TOKEN_LEN 16 @@ -80,10 +90,11 @@ typedef struct token_node_s { guchar data[RSPAMD_MAX_TOKEN_LEN]; guint window_idx; guint datalen; - GArray *results; + gdouble values[1]; } rspamd_token_t; struct rspamd_stat_ctx { + /* Subroutines for all objects */ struct rspamd_stat_classifier *classifiers; guint classifiers_count; struct rspamd_stat_tokenizer *tokenizers; @@ -93,8 +104,12 @@ struct rspamd_stat_ctx { struct rspamd_stat_cache *caches; guint caches_count; - guint statfiles; + /* Runtime configuration */ + GPtrArray *statfiles; /* struct statfile */ struct rspamd_config *cfg; + /* Global tokenizer */ + struct rspamd_stat_tokenizer *tokenizer; + gpointer tkcf; }; typedef enum rspamd_learn_cache_result { |