Get rid of remaining tabs and replace them with spaces.
[srvx.git] / src / main-win32.c
1 #include "common.h"
2 #include "conf.h"
3 #include "gline.h"
4 #include "ioset.h"
5 #include "modcmd.h"
6 #include "saxdb.h"
7 #include "mail.h"
8 #include "timeq.h"
9
10 #include "chanserv.h"
11 #include "global.h"
12 #include "modules.h"
13 #include "opserv.h"
14
15 #define sleep(x) Sleep((x) * 1000)
16 #include "main-common.c"
17
18 #include <windows.h>
19
20 int APIENTRY WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nCmdShow)
21 {
22     tools_init();
23     /* TODO: parse lpCmdLine */
24     log_module(MAIN_LOG, LOG_INFO, "Initializing daemon...");
25
26     if (!conf_read(services_config)) {
27         log_module(MAIN_LOG, LOG_FATAL, "Unable to read %s.", services_config);
28         exit(0);
29     }
30
31     boot_time = time(&now);
32     conf_register_reload(uplink_compile);
33     atexit(call_exit_funcs);
34     reg_exit_func(main_shutdown);
35
36     log_init();
37     MAIN_LOG = log_register_type("srvx", "file:main.log");
38     ioset_init();
39     init_structs();
40     init_parse();
41     modcmd_init();
42     saxdb_init();
43     gline_init();
44     mail_init();
45     helpfile_init();
46     conf_globals();
47     conf_rlimits();
48     modules_init();
49     message_register_table(msgtab);
50     modcmd_finalize();
51     saxdb_finalize();
52     helpfile_finalize();
53     modules_finalize();
54     reg_exit_func(saxdb_write_all);
55     srand(time(&now));
56     ioset_run();
57
58     return quit_services;
59     (void)hInst; (void)hPrevInst; (void)nCmdShow;
60 }
61