Function

GLibqsort_with_data

Declaration

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

Description

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

This is guaranteed to be a stable sort since version 2.32.

This function is not directly available to language bindings

Parameters

pbase gconstpointer
 

Start of array to sort.

 The data is owned by the caller of the function.
total_elems gint
 

Elements in the array.

size gsize
 

Size of each element.

compare_func GCompareDataFunc
 

Function to compare elements.

user_data gpointer
 

Data to pass to compare_func.

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