diff options
-rw-r--r-- | servers.c | 12 | ||||
-rw-r--r-- | servers.h | 1 |
2 files changed, 13 insertions, 0 deletions
@@ -18,6 +18,18 @@ gboolean server_add(const gchar *host, const guint16 port) { return TRUE; } +gboolean server_remove(struct server *server) { + gint pos = g_slist_index(servers, server); + + if(pos == -1) { + return FALSE; + } + + servers = g_slist_remove(servers, server); + + return TRUE; +} + void server_clear() { for(GSList *node = servers; node; node = g_slist_next(node)) { struct server *s = node->data; @@ -9,6 +9,7 @@ struct server { }; gboolean server_add(const gchar *host, const guint16 port); +gboolean server_remove(struct server *server); void server_clear(); #endif |