Function

GLibSListinsert_sorted_with_data

since: 2.10

Declaration

GSList*
g_slist_insert_sorted_with_data (
  GSList* list,
  gpointer data,
  GCompareDataFunc func,
  gpointer user_data
)

Description

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

Available since: 2.10

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: GCompareDataFunc

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.

user_data

Type: gpointer

Data to pass to comparison function.

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

Return value

Type: A list of gpointer

The new start of the GSList.

The data is owned by the called function.