#include "music.h" #include "httpd.h" #include "command_service.h" #include "conf.h" #include "servers.h" #include "control_service.h" #include #include #include GMainLoop *main_loop; static void sig_handler(int sig) { g_debug("caught signal %d", sig); g_main_loop_quit(main_loop); } int main(int argc, char **argv) { g_type_init(); conf_load(); control_service_start(); servers_init(); music_init(); music_scan_root(); server_start(); httpd_start(); signal(SIGINT, sig_handler); main_loop = g_main_loop_new(NULL, FALSE); g_main_loop_run(main_loop); g_main_loop_unref(main_loop); httpd_stop(); server_stop(); music_free(); servers_free(); control_service_stop(); conf_free(); return 0; }