Graphviz 13.0.0~dev.20241220.2304
|
qsort
with carried along context
More...
#include <assert.h>
#include <stdlib.h>
Go to the source code of this file.
Macros | |
#define | TLS /* nothing */ |
thread-local storage specifier | |
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 | |
Variables | |
static TLS int(* | gv_sort_compar )(const void *, const void *, void *) |
static TLS 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 35 of file sort.h.
References gv_sort_arg, gv_sort_compar, gv_sort_compar_wrapper(), and NULL.
Referenced by arrayRects(), find_closest_pairs(), quicksort_place(), quicksort_place(), and quicksort_placef().
|
inlinestatic |
Definition at line 29 of file sort.h.
References gv_sort_arg, gv_sort_compar, and NULL.
Referenced by gv_sort().
|
static |
Definition at line 27 of file sort.h.
Referenced by gv_sort(), and gv_sort_compar_wrapper().
|
static |
Definition at line 26 of file sort.h.
Referenced by gv_sort(), and gv_sort_compar_wrapper().