home · contact · privacy
MAJOR re-write. Split plomrogue into a server and a client. Re-wrote large parts
[plomrogue] / src / client / main.c
1 /* main.c */
2
3 #include <stdlib.h> /* exit() */
4 #include "../common/rexit.h" /* set_cleanup_func() */
5 #include "cleanup.h" /* cleanup() */
6 #include "command_db.h" /* init_command_db() */
7 #include "io.h" /* io_loop(), try_send() */
8 #include "misc.h" /* load_interface_conf() */
9 #include "windows.h" /* init_win_meta(); */
10 #include "world.h" /* struct World */
11
12
13
14 struct World world;
15
16
17
18 int main()
19 {
20     /* Declare hard-coded paths here. */
21     world.path_server_in = "server/in";
22
23     /* So error exits also go through the client's cleanup() function. */
24     set_cleanup_func(cleanup);
25
26     /* Initialize the whole interface. */
27     init_win_meta();
28     keypad(world.wmeta.screen, TRUE);
29     init_command_db();
30     load_interface_conf();
31
32     /* This is where most everything happens. */
33     char * quit_msg = io_loop();
34
35     /* Leave properly. */
36     cleanup();
37     printf("%s\n", quit_msg);
38     exit(EXIT_SUCCESS);
39 }