Prepends a new element on to the start of the list.
Note that the return value is the new start of the list, which will have changed, so make sure you store the new value.
// Notice that it is initialized to the empty list. GList *list = NULL; list = g_list_prepend (list, "last"); list = g_list_prepend (list, "first");
Do not use this function to prepend a new element to a different element than the start of the list. Use g_list_insert_before() instead.
the data for the new element
a pointer to the newly prepended element, which is the new start of the GList
Prepends a new element on to the start of the list.
Note that the return value is the new start of the list, which will have changed, so make sure you store the new value.
Do not use this function to prepend a new element to a different element than the start of the list. Use g_list_insert_before() instead.