|
Graphviz 16.1.2~dev.20261110.1602
|
qsort with carried along context
More...
#include <assert.h>#include <stdlib.h>Go to the source code of this file.
Functions | |
| static int | gv_sort_compar_wrapper (const void *a, const void *b) |
| static void | gv_sort (void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *, void *), void *arg) |
qsort with an extra state parameter, ala qsort_r | |
| static int | sort_place_cmp (const void *a, const void *b, void *context) |
comparator for sort_place | |
| static void | sort_place (double *place, int *ordering, size_t size) |
| sort an array of doubles based on an list of their desired order | |
Variables | |
| static _Thread_local int(* | gv_sort_compar )(const void *, const void *, void *) |
| static _Thread_local void * | gv_sort_arg |
The non-standard qsort_r, Windows’ qsort_s, and C11’s qsort_s provide a qsort alternative with an extra state parameter. Unfortunately none of these are easily usable portably in Graphviz. This header implements an alternative that hopefully is.
Definition in file sort.h.
|
inlinestatic |
Definition at line 24 of file sort.h.
References gv_sort_arg, gv_sort_compar, gv_sort_compar_wrapper(), and NULL.
Referenced by arrayRects(), find_closest_pairs(), quicksort_placef(), sort_place(), and vector_ordering().
|
inlinestatic |
Definition at line 18 of file sort.h.
References gv_sort_arg, gv_sort_compar, and NULL.
Referenced by gv_sort().
|
inlinestatic |
Definition at line 57 of file sort.h.
References gv_sort(), and sort_place_cmp().
Referenced by maxmatch(), rescale_layout_polarFocus(), and set_active_levels().
|
inlinestatic |
Definition at line 42 of file sort.h.
Referenced by sort_place().
|
static |
Definition at line 16 of file sort.h.
Referenced by gv_sort(), and gv_sort_compar_wrapper().
|
static |
Definition at line 15 of file sort.h.
Referenced by gv_sort(), and gv_sort_compar_wrapper().