Function

GLibSListinsert_sorted

Declaration

GSList*
g_slist_insert_sorted (
  GSList* list,
  gpointer data,
  GCompareFunc func
)

Description

Inserts a new element into the list, using the given comparison function to determine its position.

This function is not directly available to language bindings.

Parameters

list

Type: A list of gpointer

A GSList.

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

Type: GCompareFunc

The function to compare elements in the list. It should return a number > 0 if the first parameter comes after the second parameter in the sort order.

Return value

Type: A list of gpointer

The new start of the GSList.

The data is owned by the called function.