summaryrefslogtreecommitdiff
path: root/gslist.c
diff options
context:
space:
mode:
Diffstat (limited to 'gslist.c')
-rw-r--r--gslist.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gslist.c b/gslist.c
index e95290024..6a76d22a6 100644
--- a/gslist.c
+++ b/gslist.c
@@ -256,6 +256,31 @@ g_slist_remove_link (GSList *list,
}
GSList*
+g_slist_copy (GSList *list)
+{
+ GSList *new_list = NULL;
+
+ if (list)
+ {
+ GSList *last;
+
+ new_list = g_slist_alloc ();
+ new_list->data = list->data;
+ last = new_list;
+ list = list->next;
+ while (list)
+ {
+ last->next = g_slist_alloc ();
+ last = last->next;
+ last->data = list->data;
+ list = list->next;
+ }
+ }
+
+ return new_list;
+}
+
+GSList*
g_slist_reverse (GSList *list)
{
GSList *tmp;