Adds g_list_copy_deep and g_slist_copy_deep

They make a full (deep) copy of a list.

In contrast with g_[s]list_copy(), these functions take a function as a argument
to make a copy of each list element, in addition to copying the list container itself.

The functions g_[s]list_copy() were reimplemented to just call the new functions
with NULL as the function argument, which will behave like current implementation.

https://bugzilla.gnome.org/show_bug.cgi?id=675024
This commit is contained in:
Jonh Wendell
2012-06-21 12:23:23 -03:00
parent e0f4b2b03b
commit 2fd6eb7e1c
7 changed files with 136 additions and 6 deletions

View File

@@ -2051,6 +2051,7 @@ g_list_free1
<SUBSECTION>
g_list_length
g_list_copy
g_list_copy_deep
g_list_reverse
g_list_sort
GCompareFunc
@@ -2101,6 +2102,7 @@ g_slist_free1
<SUBSECTION>
g_slist_length
g_slist_copy
g_slist_copy_deep
g_slist_reverse
g_slist_insert_sorted_with_data
g_slist_sort