From 95f4c7cb4a9f0a30ab9d78852725a45688a97512 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Sun, 22 Nov 2009 03:00:54 +0100 Subject: Added support for using pthreads. Data processing (parsing) moved to parsing.c. The line parsing code is moved to its own function which is called from one or more threads (depends on the "threads" setting in the config file). --- config.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'config.c') diff --git a/config.c b/config.c index 6cc5aad..b9123b8 100644 --- a/config.c +++ b/config.c @@ -3,11 +3,13 @@ #include +#include "config.h" #include "regexset.h" #include "channel.h" #include "nick.h" config_t config; +struct ircstats_config_t ircstats_config; int cfg_init() { config_init(&config); @@ -25,6 +27,10 @@ int cfg_init() { return 0; } + if(!config_lookup_int(&config, "threads", &ircstats_config.threads)) { + ircstats_config.threads = 1; + } + config_setting_t *regexes_setting = config_lookup(&config, "regexes"); if(!config_setting_is_aggregate(regexes_setting)) { fprintf(stderr, "Setting \"regexes\" must be an aggregate type.\n"); -- cgit v1.2.3