Function

GLibListinsert

Declaration

GList*
g_list_insert (
  GList* list,
  gpointer data,
  gint position
)

Description

Inserts a new element into the list at the given position.

This function is not directly available to language bindings.

Parameters

list

Type: A list of gpointer

A pointer to a GList, this must point to the top of the list.

The data is owned by the caller of the function.
data

Type: gpointer

The data for the new element.

The argument can be NULL.
The data is owned by the caller of the function.
position

Type: gint

The position to insert the element. If this is negative, or is larger than the number of elements in the list, the new element is added on to the end of the list.

Return value

Type: A list of gpointer

The (possibly changed) start of the GList.

The data is owned by the called function.