### Function

# GLib List sort_with_data

#### Declaration

    GList*
    g_list_sort_with_data (
      GList* list,
      GCompareDataFunc compare_func,
      gpointer user_data
    )

#### Description

Like g_list_sort(), but the comparison function accepts a user data argument.

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.

`compare_func`

  Type: `GCompareDataFunc`

  Comparison function.

`user_data`

  Type: `gpointer`

  User 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 (possibly changed) start of the `GList`.

The data is owned by the called function.