In contrast with g_slist_copy(), this function uses func to make a copy of
each list element, in addition to copying the list container itself.
func, as a GCopyFunc, takes two arguments, the data to be copied
and a user_data pointer. On common processor architectures, it's safe to
pass NULL as user_data if the copy function takes only one argument. You
may get compiler warnings from this though if compiling with GCC’s
-Wcast-function-type warning.
For instance, if list holds a list of GObjects, you can do:
Makes a full (deep) copy of a GSList
In contrast with g_slist_copy(), this function uses func to make a copy of each list element, in addition to copying the list container itself.
func, as a GCopyFunc, takes two arguments, the data to be copied and a user_data pointer. On common processor architectures, it's safe to pass NULL as user_data if the copy function takes only one argument. You may get compiler warnings from this though if compiling with GCC’s -Wcast-function-type warning.
For instance, if list holds a list of GObjects, you can do:
And, to entirely free the new list, you could do: