summaryrefslogtreecommitdiff
path: root/src/core/misc.c
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2015-02-12 00:07:22 +0100
committerLemonBoy <thatlemon@gmail.com>2015-05-05 23:14:26 +0200
commit2d7030a84445ee4547af43970cfb252b36246e62 (patch)
tree3ab0cfc3cde4243decd42145e0a9122aa931c09c /src/core/misc.c
parentc122a2a226363114e11f32072395e2f06ad6a450 (diff)
downloadirssi-2d7030a84445ee4547af43970cfb252b36246e62.zip
Implement support for IRCv3.1 CAP negotiation
Diffstat (limited to 'src/core/misc.c')
-rw-r--r--src/core/misc.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/core/misc.c b/src/core/misc.c
index ef8501d5..395e47ad 100644
--- a/src/core/misc.c
+++ b/src/core/misc.c
@@ -211,6 +211,30 @@ void *gslist_foreach_find(GSList *list, FOREACH_FIND_FUNC func, const void *data
return NULL;
}
+void gslist_free_full (GSList *list, GDestroyNotify free_func)
+{
+ GSList *tmp;
+
+ if (!list)
+ return;
+
+ for (tmp = list; tmp != NULL; tmp = tmp->next)
+ free_func(tmp->data);
+
+ g_slist_free(list);
+}
+
+GSList *gslist_remove_string (GSList *list, const char *str)
+{
+ GSList *l;
+
+ l = g_slist_find_custom(list, str, (GCompareFunc) g_strcmp0);
+ if (l != NULL)
+ return g_slist_remove_link(list, l);
+
+ return list;
+}
+
/* `list' contains pointer to structure with a char* to string. */
char *gslistptr_to_string(GSList *list, int offset, const char *delimiter)
{