| 1 | /* debugging */ |
| 2 | #define INSTALL 1 |
| 3 | //#define NO_BUILTIN_XML 1 |
| 4 | /* end debugging */ |
| 5 | |
| 6 | #include <gio/gio.h> |
| 7 | #include "config.c" |
| 8 | #include "interfaces/hostnamed/hostnamed.c" |
| 9 | //#include "main.h" |
| 10 | |
| 11 | #ifdef INSTALL |
| 12 | static gboolean install_conf() { |
| 13 | |
| 14 | } |
| 15 | #endif |
| 16 | |
| 17 | int main() { |
| 18 | //TODO cleanup |
| 19 | #ifdef INSTALL |
| 20 | if(!config_init()) { |
| 21 | g_printf("%s\n", "FAILED to install configs in /etc/!"); |
| 22 | return 1; |
| 23 | } |
| 24 | #endif |
| 25 | |
| 26 | //TODO cleanup |
| 27 | #if (defined NO_BUILTIN_XML && defined INSTALL) |
| 28 | if(!config_init()) { |
| 29 | g_printf("%s\n", "FAILED to install xml configs!"); |
| 30 | return 1; |
| 31 | } |
| 32 | #else |
| 33 | #endif |
| 34 | |
| 35 | GMainLoop *mloop = NULL; |
| 36 | |
| 37 | mloop = g_main_loop_new(NULL, FALSE); |
| 38 | hostnamed_init(); |
| 39 | g_main_loop_run(mloop); |
| 40 | |
| 41 | return 0; |
| 42 | } |
| 43 | |