Added ssl fingerprint support for testing purposes
[jimb.git] / src / main.c
blobfdd1d4949cc283bd96d3640cc9737fcbbc46a3d5
1 /**
2 * JIMCI (Jabber Instant Messaging Connection Interface)
3 * This file is part of JIMB.
5 * JIMCI is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License Version 3
7 * as published by the Free Software Foundation.
9 * JIMCI is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License Version 3
15 * along with JIMCI; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 * File: Main
19 * Package: JIMCI
20 * Author: Martin Kelm <martinkelm@idxsolutions.de>
22 #include "main.h"
23 #include "config.h"
24 #include "mysql.h"
25 #include "connection.h"
26 #include "services.h"
29 * Execute program
31 int main(int argv, char**argc) {
32 int check;
33 debug("Started");
34 // initialize configiuration structures with values
35 if (cfg_initialize(0) == 1) {
36 // connect to database
37 check = mysql_connect(
38 cfg_mysql.server, cfg_mysql.user, cfg_mysql.password, cfg_mysql.database
40 if (check > 0) {
41 services_init(
42 cfg_services.actions_exec, cfg_services.actions_script, cfg_services.actions_interval,
43 cfg_services.updates_exec, cfg_services.updates_script, cfg_services.updates_interval,
44 cfg_services.queue_message
46 conn_create(
47 cfg_jabber.host, cfg_jabber.port, cfg_jabber.ssl, cfg_jabber.ssl_fingerprint,
48 cfg_jabber.user, cfg_jabber.resource, cfg_jabber.password
51 // disconnect from database
52 mysql_disconnect();
54 return 1;