Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/stdlib/qsort_r.c
/* | /* | ||||
* This file is in the public domain. Originally written by Garrett | * This file is in the public domain. Originally written by Garrett | ||||
* A. Wollman. | * A. Wollman. | ||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#include "block_abi.h" | #include "block_abi.h" | ||||
#define I_AM_QSORT_R | #define I_AM_QSORT_R | ||||
#include "qsort.c" | #include "qsort.c" | ||||
typedef DECLARE_BLOCK(int, qsort_block, const void *, const void *); | typedef DECLARE_BLOCK(int, qsort_block, const void *, const void *); | ||||
void | void | ||||
qsort_b(void *base, size_t nel, size_t width, qsort_block compar) | qsort_b(void *base, size_t nel, size_t width, qsort_block compar) | ||||
{ | { | ||||
qsort_r(base, nel, width, compar, | __old_qsort_r(base, nel, width, compar, | ||||
(int (*)(void *, const void *, const void *)) | (int (*)(void *, const void *, const void *)) | ||||
GET_BLOCK_FUNCTION(compar)); | GET_BLOCK_FUNCTION(compar)); | ||||
} | } |