GLib.qsort_with_data
Description: Reference for GLib.qsort_with_data

### Function

# GLibqsort_with_data

deprecated: 2.82

#### Declaration [src]

    void
    g_qsort_with_data (
      gconstpointer pbase,
      gint total_elems,
      gsize size,
      GCompareDataFunc compare_func,
      gpointer user_data
    )

#### Description [src]

This is just like the standard C `qsort()` function, but the comparison routine accepts a user data argument (like `qsort_r()`).

Unlike `qsort()`, this is guaranteed to be a stable sort (since GLib 2.32).

Deprecated since: 2.82

`total_elems` is too small to represent larger arrays; use `g_sort_array()` instead.

#### Parameters

`pbase`

  Type: `gconstpointer`

  Start of array to sort.

  The data is owned by the caller of the function.

`total_elems`

  Type: `gint`

  Elements in the array.

`size`

  Type: `gsize`

  Size of each element.

`compare_func`

  Type: `GCompareDataFunc`

  Function to compare elements.

`user_data`

  Type: `gpointer`

  Data to pass to `compare_func`.

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