summaryrefslogtreecommitdiff
path: root/main.c
blob: c864b8d267568603498b98318526ae89b2c631e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <locale.h>

#include "config.h"
#include "regexset.h"
#include "channel.h"
#include "user.h"
#include "word.h"
#include "export_xml.h"
#include "nick.h"
#include "parsing.h"

int main(int argc, char **argv) {
	/* Set locale. */
	setlocale(LC_CTYPE, "");

	/* Regex sets must be initialized before config. */
	rs_init();
	channel_init();
	nick_init();
	if(!cfg_init()) {
		/*	Free any registered regex sets and channels when config fails.
			Config will fail if a regex set fails to compile all parts. */
		rs_free();
		channel_free();
		return 1;
	}

	process(ircstats_config.threads);

	nick_free();
	cfg_free();
	channel_free();
	rs_free();

	return 0;
}