Function

GLibListlength

Declaration

guint
g_list_length (
  GList* list
)

Description

Gets the number of elements in a GList.

This function iterates over the whole list to count its elements. Use a GQueue instead of a GList if you regularly need the number of items. To check whether the list is non-empty, it is faster to check list against NULL.

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.

Return value

Type: guint

The number of elements in the GList.