aboutsummaryrefslogtreecommitdiffstats
path: root/src/classifiers/classifiers.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-04-30 13:26:51 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-04-30 13:26:51 +0100
commitd6643f35d783784911ad2e2ca754bcfed29eb11d (patch)
tree55554d57d4439e278788a261eb5ad7e5016a1372 /src/classifiers/classifiers.h
parent7e66b3bd08dbca9356013a3777f786076d1dacea (diff)
downloadrspamd-d6643f35d783784911ad2e2ca754bcfed29eb11d.tar.gz
rspamd-d6643f35d783784911ad2e2ca754bcfed29eb11d.zip
Refactor config API.
Diffstat (limited to 'src/classifiers/classifiers.h')
-rw-r--r--src/classifiers/classifiers.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/classifiers/classifiers.h b/src/classifiers/classifiers.h
index 3f7b755f4..2b36d8c02 100644
--- a/src/classifiers/classifiers.h
+++ b/src/classifiers/classifiers.h
@@ -10,14 +10,14 @@
/* Consider this value as 0 */
#define ALPHA 0.0001
-struct classifier_config;
+struct rspamd_classifier_config;
struct rspamd_task;
struct classifier_ctx {
rspamd_mempool_t *pool;
GHashTable *results;
gboolean debug;
- struct classifier_config *cfg;
+ struct rspamd_classifier_config *cfg;
};
struct classify_weight {
@@ -28,7 +28,7 @@ struct classify_weight {
/* Common classifier structure */
struct classifier {
char *name;
- struct classifier_ctx* (*init_func)(rspamd_mempool_t *pool, struct classifier_config *cf);
+ struct classifier_ctx* (*init_func)(rspamd_mempool_t *pool, struct rspamd_classifier_config *cf);
gboolean (*classify_func)(struct classifier_ctx* ctx, statfile_pool_t *pool, GTree *input, struct rspamd_task *task, lua_State *L);
gboolean (*learn_func)(struct classifier_ctx* ctx, statfile_pool_t *pool,
const char *symbol, GTree *input, gboolean in_class,
@@ -42,7 +42,7 @@ struct classifier {
struct classifier* get_classifier (const char *name);
/* Winnow algorithm */
-struct classifier_ctx* winnow_init (rspamd_mempool_t *pool, struct classifier_config *cf);
+struct classifier_ctx* winnow_init (rspamd_mempool_t *pool, struct rspamd_classifier_config *cf);
gboolean winnow_classify (struct classifier_ctx* ctx, statfile_pool_t *pool, GTree *input, struct rspamd_task *task, lua_State *L);
gboolean winnow_learn (struct classifier_ctx* ctx, statfile_pool_t *pool, const char *symbol, GTree *input,
gboolean in_class, double *sum, double multiplier, GError **err);
@@ -51,7 +51,7 @@ gboolean winnow_learn_spam (struct classifier_ctx* ctx, statfile_pool_t *pool,
GList *winnow_weights (struct classifier_ctx* ctx, statfile_pool_t *pool, GTree *input, struct rspamd_task *task);
/* Bayes algorithm */
-struct classifier_ctx* bayes_init (rspamd_mempool_t *pool, struct classifier_config *cf);
+struct classifier_ctx* bayes_init (rspamd_mempool_t *pool, struct rspamd_classifier_config *cf);
gboolean bayes_classify (struct classifier_ctx* ctx, statfile_pool_t *pool, GTree *input, struct rspamd_task *task, lua_State *L);
gboolean bayes_learn (struct classifier_ctx* ctx, statfile_pool_t *pool, const char *symbol, GTree *input,
gboolean in_class, double *sum, double multiplier, GError **err);