diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-09-14 19:11:19 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-09-14 19:11:19 +0400 |
commit | a0f41f7c5712e73e8aa521f2064bc53be3315d0a (patch) | |
tree | 147e4d8956a5a3b85e0ecc15b9fcbe29742e4e5c /src/cfg_file.h | |
parent | a90c7d7a12561845e3371efc6803b1ecf6ad7d89 (diff) | |
download | rspamd-a0f41f7c5712e73e8aa521f2064bc53be3315d0a.tar.gz rspamd-a0f41f7c5712e73e8aa521f2064bc53be3315d0a.zip |
* New system of classifiers interface and statfiles processing
* Fix sample config
* Fix compile warnings
* Fix building without lua support
* Fix bugs with nrcpt header parsing and symbols cache loading (by Anton Nekhoroshikh)
Diffstat (limited to 'src/cfg_file.h')
-rw-r--r-- | src/cfg_file.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/cfg_file.h b/src/cfg_file.h index 3e932fc10..527c3f7c6 100644 --- a/src/cfg_file.h +++ b/src/cfg_file.h @@ -130,17 +130,25 @@ struct statfile_autolearn_params { * Statfile config definition */ struct statfile { - char *alias; /**< alias of statfile */ - char *pattern; /**< filesystem pattern (with %r or %f) */ - double weight; /**< weight scale */ - char *metric; /**< metric name */ + char *symbol; /**< symbol of statfile */ + char *path; /**< filesystem pattern (with %r or %f) */ size_t size; /**< size of statfile */ - struct tokenizer *tokenizer; /**< tokenizer used for statfile */ GList *sections; /**< list of sections in statfile */ struct statfile_autolearn_params *autolearn; /**< autolearn params */ }; /** + * Classifier config definition + */ +struct classifier_config { + GList *statfiles; /**< statfiles list */ + char *metric; /**< metric of this classifier */ + struct classifier *classifier; /**< classifier interface */ + struct tokenizer *tokenizer; /**< tokenizer used for classifier */ + GHashTable *opts; /**< other options */ +}; + +/** * Config option for importing to script module */ struct config_scalar { @@ -223,7 +231,8 @@ struct config_file { GHashTable* factors; /**< hash of factors indexed by symbol name */ GHashTable* c_modules; /**< hash of c modules indexed by module name */ GHashTable* composite_symbols; /**< hash of composite symbols indexed by its name */ - GHashTable* statfiles; /**< hash of defined statfiles indexed by alias */ + GList *classifiers; /**< list of all classifiers defined */ + GHashTable *classifiers_symbols; /**< hashtable indexed by symbol name of classifiers */ GHashTable* cfg_params; /**< all cfg params indexed by its name in this structure */ int clock_res; /**< resolution of clock used */ GList *views; /**< views */ @@ -314,7 +323,7 @@ void post_load_config (struct config_file *cfg); void unescape_quotes (char *line); GList* parse_comma_list (memory_pool_t *pool, char *line); - +struct classifier_config* check_classifier_cfg (struct config_file *cfg, struct classifier_config *c); int yylex (void); int yyparse (void); |