#include <libkern/libkern.h>
Go to the source code of this file.
|
#define | min(a, b) (a) < (b) ? a : b |
|
#define | swap(a, b) |
|
#define | swapcode(TYPE, parmi, parmj, n) |
|
#define | SWAPINIT(a, es) |
|
#define | vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n, swaptype) |
|
|
static char * | med3 (char *, char *, char *, int(*)(const void *, const void *)) |
|
void | qsort (void *a, size_t n, size_t es, int(*cmp)(const void *, const void *)) |
|
static void | swapfunc (char *, char *, int, int) |
|
◆ min
#define min |
( |
|
a, |
|
|
|
b |
|
) |
| (a) < (b) ? a : b |
◆ swap
Value: if (swaptype == 0) { \
*(
long *)(
a) = *(
long *)(
b); \
Definition at line 111 of file qsort.h.
◆ swapcode
#define swapcode |
( |
|
TYPE, |
|
|
|
parmi, |
|
|
|
parmj, |
|
|
|
n |
|
) |
| |
Value: { \
long
i = (
n) /
sizeof (
TYPE); \
TYPE *pi = (
TYPE *) (parmi); \
TYPE *pj = (
TYPE *) (parmj); \
do { \
*pi++ = *pj; \
}
Definition at line 88 of file qsort.h.
◆ SWAPINIT
#define SWAPINIT |
( |
|
a, |
|
|
|
es |
|
) |
| |
Value: swaptype = ((
char *)
a - (
char *)0) %
sizeof(
long) || \
es %
sizeof(
long) ? 2 : es ==
sizeof(
long)? 0 : 1;
Definition at line 99 of file qsort.h.
◆ vecswap
◆ med3()
static char * med3 |
( |
char * |
a, |
|
|
char * |
b, |
|
|
char * |
c, |
|
|
int(*)(const void *, const void *) |
cmp |
|
) |
| |
|
inlinestatic |
◆ qsort()
void qsort |
( |
void * |
a, |
|
|
size_t |
n, |
|
|
size_t |
es, |
|
|
int(*)(const void *, const void *) |
cmp |
|
) |
| |
◆ swapfunc()
static void swapfunc |
( |
char * |
a, |
|
|
char * |
b, |
|
|
int |
n, |
|
|
int |
swaptype |
|
) |
| |
|
inlinestatic |