Function

GLibListposition

Declaration

gint
g_list_position (
  GList* list,
  GList* llink
)

Description

Gets the position of the given element in the GList (starting from 0).

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.
llink

Type: A list of gpointer

An element in the GList.

The data is owned by the caller of the function.

Return value

Type: gint

The position of the element in the GList, or -1 if the element is not found.