summaryrefslogtreecommitdiff
path: root/glist.c
diff options
context:
space:
mode:
Diffstat (limited to 'glist.c')
-rw-r--r--glist.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/glist.c b/glist.c
index eaa77d82c..ee9ad695c 100644
--- a/glist.c
+++ b/glist.c
@@ -274,6 +274,32 @@ g_list_remove_link (GList *list,
}
GList*
+g_list_copy (GList *list)
+{
+ GList *new_list = NULL;
+
+ if (list)
+ {
+ GList *last;
+
+ new_list = g_list_alloc ();
+ new_list->data = list->data;
+ last = new_list;
+ list = list->next;
+ while (list)
+ {
+ last->next = g_list_alloc ();
+ last->next->prev = last;
+ last = last->next;
+ last->data = list->data;
+ list = list->next;
+ }
+ }
+
+ return new_list;
+}
+
+GList*
g_list_reverse (GList *list)
{
GList *last;