summaryrefslogtreecommitdiffstats
path: root/client/main.c
blob: da8ce1ad9df38665a3a37d78595cd68b1e3e81e4 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <sys/syscall.h>
#include <mcheck.h>

#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include <gtk/gtk.h>

#include "interface.h"
#include "support.h"
#include "connection.h"
#include "daemon.h"
#include "mainwin.h"
#include "ruleset.h"

int main (int argc, char *argv[]) {
    mtrace();
    
#ifdef ENABLE_NLS
    bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
    bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
    textdomain (GETTEXT_PACKAGE);
#endif
    
    gtk_set_locale();
    gtk_init(&argc, &argv);
    
    add_pixmap_directory (PACKAGE_DATA_DIR "/" PACKAGE "/pixmaps");
    
    if (daemon_init() < 0)
        goto finish;

    if (ruleset_init() < 0)
        goto finish;

    if (ruleset_initial_load() < 0)
        goto finish;

    if (ruleset_commit() < 0)
        goto finish;

    mainwin_show();
    gtk_main ();
    
finish:
    ruleset_done();
    daemon_done();

    //syscall(SYS_exit, 0);
    
    return 0;
}