#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/libkern.h>
Go to the source code of this file.
|
#define | min(a, b) (a) < (b) ? (a) : (b) |
|
#define | swapcode(TYPE, parmi, parmj, n) |
|
#define | SWAPINIT(a, es) |
|
#define | swap(a, b) |
|
#define | vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n, swaptype) |
|
#define | CMP(t, x, y) (cmp((x), (y))) |
|
#define | thunk NULL |
|
|
typedef int | cmp_t(const void *, const void *) |
|
|
| __FBSDID ("$BSDSUniX$") |
|
static __inline char * | med3 (char *, char *, char *, cmp_t *, void *) |
|
static __inline void | swapfunc (char *, char *, int, int) |
|
static __inline char * | med3 (char *a, char *b, char *c, cmp_t *cmp, void *thunk __unused) |
|
void | qsort (void *a, size_t n, size_t es, cmp_t *cmp) |
|
#define CMP |
( |
|
t, |
|
|
|
x, |
|
|
|
y |
|
) |
| (cmp((x), (y))) |
#define min |
( |
|
a, |
|
|
|
b |
|
) |
| (a) < (b) ? (a) : (b) |
Value:if (swaptype == 0) { \
long t = *(long *)(a); \
*(long *)(a) = *(long *)(b); \
*(long *)(b) = t; \
static __inline void swapfunc(char *, char *, int, int)
Definition at line 72 of file qsort.c.
Referenced by qsort().
#define swapcode |
( |
|
TYPE, |
|
|
|
parmi, |
|
|
|
parmj, |
|
|
|
n |
|
) |
| |
Value:{ \
long i = (n) / sizeof (TYPE); \
register TYPE *pi = (TYPE *) (parmi); \
register TYPE *pj = (TYPE *) (parmj); \
do { \
register TYPE t = *pi; \
*pi++ = *pj; \
*pj++ = t; \
} while (--i > 0); \
}
Definition at line 49 of file qsort.c.
Referenced by swapfunc().
#define SWAPINIT |
( |
|
a, |
|
|
|
es |
|
) |
| |
Value:swaptype = ((char *)a - (char *)0) % sizeof(long) || \
es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1;
Definition at line 60 of file qsort.c.
Referenced by qsort().
#define vecswap |
( |
|
a, |
|
|
|
b, |
|
|
|
n |
|
) |
| if ((n) > 0) swapfunc(a, b, n, swaptype) |
typedef int cmp_t(const void *, const void *) |
__FBSDID |
( |
"$BSDSUniX$" |
| ) |
|
static __inline char* med3 |
( |
char * |
, |
|
|
char * |
, |
|
|
char * |
, |
|
|
cmp_t * |
, |
|
|
void * |
|
|
) |
| |
|
static |
static __inline char* med3 |
( |
char * |
a, |
|
|
char * |
b, |
|
|
char * |
c, |
|
|
cmp_t * |
cmp, |
|
|
void *thunk |
__unused |
|
) |
| |
|
static |
void qsort |
( |
void * |
a, |
|
|
size_t |
n, |
|
|
size_t |
es, |
|
|
cmp_t * |
cmp |
|
) |
| |
static __inline void swapfunc |
( |
char * |
a, |
|
|
char * |
b, |
|
|
int |
n, |
|
|
int |
swaptype |
|
) |
| |
|
static |