aboutsummaryrefslogtreecommitdiff
path: root/stdlib/stdlib.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-11-13 17:21:43 +0000
committerUlrich Drepper <drepper@redhat.com>2007-11-13 17:21:43 +0000
commite458144c99ddc00769ffa6bd367c21d37e879d83 (patch)
tree55e549e9ab2672a3ebf613ca698f622c97aece8c /stdlib/stdlib.h
parentbd63f380d8760a643dfa17d1907692f39e63195e (diff)
downloadglibc-e458144c99ddc00769ffa6bd367c21d37e879d83.zip
glibc-e458144c99ddc00769ffa6bd367c21d37e879d83.tar.gz
glibc-e458144c99ddc00769ffa6bd367c21d37e879d83.tar.bz2
* stdlib/stdlib.h: Define __compar_d_fn_t. Declare qsort_r.
* include/stdlib.h: Add hidden_proto for qsort_t and adjust protoype for _quicksort. * stdlib/msort.c (qsort): Now a wrapper around qsort_r. (qsort_r): Renamed from qsort. Take additional parameter and pass it on as third parameter to compare function and _quicksort. * stdlib/qsort.c (_quicksort): Take additional parameter and pass on to the compare function. * stdlib/Versions [libc] (GLIBC_2.8): Add qsort_r. * Versions.def: Add GLIBC_2.8 for libc.
Diffstat (limited to 'stdlib/stdlib.h')
-rw-r--r--stdlib/stdlib.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h
index 3c2ea72..732e7d6 100644
--- a/stdlib/stdlib.h
+++ b/stdlib/stdlib.h
@@ -673,6 +673,9 @@ typedef int (*__compar_fn_t) (__const void *, __const void *);
typedef __compar_fn_t comparison_fn_t;
# endif
#endif
+#ifdef __USE_GNU
+typedef int (*__compar_d_fn_t) (__const void *, __const void *, void *);
+#endif
__BEGIN_NAMESPACE_STD
/* Do a binary search for KEY in BASE, which consists of NMEMB elements
@@ -685,6 +688,11 @@ extern void *bsearch (__const void *__key, __const void *__base,
using COMPAR to perform the comparisons. */
extern void qsort (void *__base, size_t __nmemb, size_t __size,
__compar_fn_t __compar) __nonnull ((1, 4));
+#ifdef __USE_GNU
+extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
+ __compar_d_fn_t __compar, void *__arg)
+ __nonnull ((1, 4));
+#endif
/* Return the absolute value of X. */