Function

GLibListnth_data

Declaration [src]

gpointer
g_list_nth_data (
  GList* list,
  guint n
)

Description [src]

Gets the data of the element at the given position.

This iterates over the list until it reaches the n-th position. If you intend to iterate over every element, it is better to use a for-loop as described in the GList introduction.

This function is not directly available to language bindings.

Parameters

list

Type: A list of gpointer

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

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

Type: guint

The position of the element.

Return value

Type: gpointer

The element’s data, or NULL if the position is off the end of the GList.

The data is owned by the called function.
The return value can be NULL.