ListG.prepend

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.

|[<!-- language="C" --> // 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.

class ListG
prepend
(
void* data
)

Parameters

data void*

the data for the new element

Return Value

Type: ListG

a pointer to the newly prepended element, which is the new start of the #GList

Meta