xref: /freebsd-src/lib/libc/stdlib/qsort_r_compat.c (revision b3e7694832e81d7a904a10f525f8797b753bf0d3)
1*af3c7888SEd Schouten /*
2*af3c7888SEd Schouten  * This file is in the public domain.  Originally written by Garrett
3*af3c7888SEd Schouten  * A. Wollman.
4*af3c7888SEd Schouten  */
5*af3c7888SEd Schouten #include "block_abi.h"
6*af3c7888SEd Schouten #define I_AM_QSORT_R_COMPAT
7*af3c7888SEd Schouten #include "qsort.c"
8*af3c7888SEd Schouten 
9*af3c7888SEd Schouten typedef DECLARE_BLOCK(int, qsort_block, const void *, const void *);
10*af3c7888SEd Schouten 
11*af3c7888SEd Schouten void
qsort_b(void * base,size_t nel,size_t width,qsort_block compar)12*af3c7888SEd Schouten qsort_b(void *base, size_t nel, size_t width, qsort_block compar)
13*af3c7888SEd Schouten {
14*af3c7888SEd Schouten 	__qsort_r_compat(base, nel, width, compar,
15*af3c7888SEd Schouten 		(int (*)(void *, const void *, const void *))
16*af3c7888SEd Schouten 		GET_BLOCK_FUNCTION(compar));
17*af3c7888SEd Schouten }
18*af3c7888SEd Schouten 
19*af3c7888SEd Schouten __sym_compat(qsort_r, __qsort_r_compat, FBSD_1.0);
20