sharesec: Check if share exists in configuration
[samba.git] / lib / util / stable_sort.h
blob17329b81ac7909b479240877dc4c27ab7f0e360c
1 #ifndef HAVE_STABLE_SORT_H
2 #define HAVE_STABLE_SORT_H 1
4 #ifdef __COMPAR_FN_T
5 typedef __compar_fn_t samba_compare_fn_t;
7 #ifdef __USE_GNU
8 /* glibc defines __compar_d_fn_t for qsort_r */
9 typedef __compar_d_fn_t samba_compare_with_context_fn_t;
10 #endif
12 #else
13 typedef int (*samba_compare_fn_t) (const void *, const void *);
14 typedef int (*samba_compare_with_context_fn_t) (const void *, const void *, void *);
15 #endif
19 bool stable_sort_r(void *array, void *aux,
20 size_t n,
21 size_t s,
22 samba_compare_with_context_fn_t cmpfn,
23 void *opaque);
25 bool stable_sort(void *array, void *aux,
26 size_t n,
27 size_t s,
28 samba_compare_fn_t cmpfn);
31 bool stable_sort_talloc_r(TALLOC_CTX *mem_ctx,
32 void *array,
33 size_t n,
34 size_t s,
35 samba_compare_with_context_fn_t cmpfn,
36 void *opaque);
39 bool stable_sort_talloc(TALLOC_CTX *mem_ctx,
40 void *array,
41 size_t n,
42 size_t s,
43 samba_compare_fn_t cmpfn);
46 #endif /* HAVE_STABLE_SORT_H */