summaryrefslogtreecommitdiffstats
path: root/src/libutil
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/libutil
parent7e66b3bd08dbca9356013a3777f786076d1dacea (diff)
downloadrspamd-d6643f35d783784911ad2e2ca754bcfed29eb11d.tar.gz
rspamd-d6643f35d783784911ad2e2ca754bcfed29eb11d.zip
Refactor config API.
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/logger.c4
-rw-r--r--src/libutil/logger.h2
-rw-r--r--src/libutil/map.c6
-rw-r--r--src/libutil/map.h10
-rw-r--r--src/libutil/util.c2
-rw-r--r--src/libutil/util.h8
6 files changed, 16 insertions, 16 deletions
diff --git a/src/libutil/logger.c b/src/libutil/logger.c
index 01814d24d..47e308ecd 100644
--- a/src/libutil/logger.c
+++ b/src/libutil/logger.c
@@ -39,7 +39,7 @@
*/
struct rspamd_logger_s {
rspamd_log_func_t log_func;
- struct config_file *cfg;
+ struct rspamd_config *cfg;
struct {
guint32 size;
guint32 used;
@@ -275,7 +275,7 @@ reopen_log (rspamd_logger_t *logger)
* Setup logger
*/
void
-rspamd_set_logger (struct config_file *cfg, GQuark ptype, struct rspamd_main *rspamd)
+rspamd_set_logger (struct rspamd_config *cfg, GQuark ptype, struct rspamd_main *rspamd)
{
gchar **strvec, *p, *err;
gint num, i, k;
diff --git a/src/libutil/logger.h b/src/libutil/logger.h
index b0766b938..4b1c74410 100644
--- a/src/libutil/logger.h
+++ b/src/libutil/logger.h
@@ -15,7 +15,7 @@ typedef struct rspamd_logger_s rspamd_logger_t;
/**
* Init logger
*/
-void rspamd_set_logger (struct config_file *cfg, GQuark ptype, struct rspamd_main *main);
+void rspamd_set_logger (struct rspamd_config *cfg, GQuark ptype, struct rspamd_main *main);
/**
* Open log file or initialize other structures
*/
diff --git a/src/libutil/map.c b/src/libutil/map.c
index 703622585..ffe3a1e6f 100644
--- a/src/libutil/map.c
+++ b/src/libutil/map.c
@@ -943,7 +943,7 @@ http_callback (gint fd, short what, void *ud)
/* Start watching event for all maps */
void
-start_map_watch (struct config_file *cfg, struct event_base *ev_base)
+start_map_watch (struct rspamd_config *cfg, struct event_base *ev_base)
{
GList *cur = cfg->maps;
struct rspamd_map *map;
@@ -983,7 +983,7 @@ start_map_watch (struct config_file *cfg, struct event_base *ev_base)
}
void
-remove_all_maps (struct config_file *cfg)
+remove_all_maps (struct rspamd_config *cfg)
{
g_list_free (cfg->maps);
cfg->maps = NULL;
@@ -1022,7 +1022,7 @@ check_map_proto (const gchar *map_line, gint *res, const gchar **pos)
}
gboolean
-add_map (struct config_file *cfg, const gchar *map_line, const gchar *description,
+add_map (struct rspamd_config *cfg, const gchar *map_line, const gchar *description,
map_cb_t read_callback, map_fin_cb_t fin_callback, void **user_data)
{
struct rspamd_map *new_map;
diff --git a/src/libutil/map.h b/src/libutil/map.h
index 1f34cdcc0..ddb9882e4 100644
--- a/src/libutil/map.h
+++ b/src/libutil/map.h
@@ -51,10 +51,10 @@ typedef void (*map_fin_cb_t)(rspamd_mempool_t *pool, struct map_cb_data *data);
/**
* Common map object
*/
-struct config_file;
+struct rspamd_config;
struct rspamd_map {
rspamd_mempool_t *pool;
- struct config_file *cfg;
+ struct rspamd_config *cfg;
enum fetch_proto protocol;
map_cb_t read_callback;
map_fin_cb_t fin_callback;
@@ -89,18 +89,18 @@ gboolean check_map_proto (const gchar *map_line, gint *res, const gchar **pos);
/**
* Add map from line
*/
-gboolean add_map (struct config_file *cfg, const gchar *map_line, const gchar *description,
+gboolean add_map (struct rspamd_config *cfg, const gchar *map_line, const gchar *description,
map_cb_t read_callback, map_fin_cb_t fin_callback, void **user_data);
/**
* Start watching of maps by adding events to libevent event loop
*/
-void start_map_watch (struct config_file *cfg, struct event_base *ev_base);
+void start_map_watch (struct rspamd_config *cfg, struct event_base *ev_base);
/**
* Remove all maps watched (remove events)
*/
-void remove_all_maps (struct config_file *cfg);
+void remove_all_maps (struct rspamd_config *cfg);
typedef void (*insert_func) (gpointer st, gconstpointer key, gconstpointer value);
diff --git a/src/libutil/util.c b/src/libutil/util.c
index 03b38e087..ec63cabb9 100644
--- a/src/libutil/util.c
+++ b/src/libutil/util.c
@@ -1147,7 +1147,7 @@ fstr_strcase_hash (gconstpointer key)
}
void
-gperf_profiler_init (struct config_file *cfg, const gchar *descr)
+gperf_profiler_init (struct rspamd_config *cfg, const gchar *descr)
{
#if defined(WITH_GPERF_TOOLS)
gchar prof_path[PATH_MAX];
diff --git a/src/libutil/util.h b/src/libutil/util.h
index dfa34a458..a142f15fb 100644
--- a/src/libutil/util.h
+++ b/src/libutil/util.h
@@ -8,11 +8,11 @@
#include "fstring.h"
#include "ucl.h"
-struct config_file;
+struct rspamd_config;
struct rspamd_main;
struct workq;
-struct statfile;
-struct classifier_config;
+struct rspamd_statfile_config;
+struct rspamd_classifier_config;
/**
* Union that is used for storing sockaddrs
@@ -188,7 +188,7 @@ gboolean fstr_strcase_equal (gconstpointer v, gconstpointer v2);
/*
* Google perf-tools initialization function
*/
-void gperf_profiler_init (struct config_file *cfg, const gchar *descr);
+void gperf_profiler_init (struct rspamd_config *cfg, const gchar *descr);
/*
* Workarounds for older versions of glib