diff options
-rw-r--r-- | main.c | 5 | ||||
-rw-r--r-- | servers.c | 11 | ||||
-rw-r--r-- | servers.h | 3 |
3 files changed, 17 insertions, 2 deletions
@@ -2,6 +2,7 @@ #include "httpd.h" #include "command_service.h" #include "conf.h" +#include "servers.h" #include <glib.h> #include <glib-object.h> @@ -20,6 +21,8 @@ int main(int argc, char **argv) { conf_load(); + servers_init(); + music_init(); music_scan_root(); @@ -36,6 +39,8 @@ int main(int argc, char **argv) { server_stop(); music_free(); + servers_free(); + conf_free(); return 0; @@ -1,4 +1,5 @@ #include "servers.h" +#include "conf.h" static GSList *servers = NULL; @@ -30,7 +31,15 @@ gboolean server_remove(struct server *server) { return TRUE; } -void server_clear() { +void servers_init() { + gsize length; + gchar **s = conf_get_string_list("audist", "servers", &length); + for(int i = 0; i < length; i++) { + g_debug(" server %d: %s", i, s[i]); + } +} + +void server_free() { for(GSList *node = servers; node; node = g_slist_next(node)) { struct server *s = node->data; g_free(s->host); @@ -10,6 +10,7 @@ struct server { gboolean server_add(const gchar *host, const guint16 port); gboolean server_remove(struct server *server); -void server_clear(); +void servers_init(); +void servers_free(); #endif |