blob: a037c7be3bf04ea9d8d5d526fb5f7703332631e0 (
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
 | #include "music.h"
#include "httpd.h"
#include "command_service.h"
#include "conf.h"
#include <glib.h>
#include <glib-object.h>
#include <signal.h>
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();
	music_init(argv[1]);
	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();
	conf_free();
	return 0;
}
 |