Macros | Functions
qsort.h File Reference
#include <libkern/libkern.h>
Include dependency graph for qsort.h:

Go to the source code of this file.

Macros

#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)
 

Functions

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)
 

Macro Definition Documentation

◆ min

#define min (   a,
  b 
)    (a) < (b) ? a : b

Definition at line 83 of file qsort.h.

◆ swap

#define swap (   a,
  b 
)
Value:
if (swaptype == 0) { \
long t = *(long *)(a); \
*(long *)(a) = *(long *)(b); \
*(long *)(b) = t; \
swapfunc(a, b, es, swaptype)

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 { \
TYPE t = *pi; \
*pi++ = *pj; \
*pj++ = t; \
} while (--i > 0); \
}

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

#define vecswap (   a,
  b,
  n 
)    if ((n) > 0) swapfunc(a, b, n, swaptype)

Definition at line 119 of file qsort.h.

Function Documentation

◆ med3()

static char * med3 ( char *  a,
char *  b,
char *  c,
int(*)(const void *, const void *)  cmp 
)
inlinestatic

Definition at line 122 of file qsort.h.

◆ qsort()

void qsort ( void *  a,
size_t  n,
size_t  es,
int(*)(const void *, const void *)  cmp 
)

Definition at line 130 of file qsort.h.

◆ swapfunc()

static void swapfunc ( char *  a,
char *  b,
int  n,
int  swaptype 
)
inlinestatic

Definition at line 103 of file qsort.h.

a
int a
Definition: abseil-cpp/absl/container/internal/hash_policy_traits_test.cc:88
swapfunc
static void swapfunc(char *, char *, int, int)
Definition: qsort.h:103
b
uint64_t b
Definition: abseil-cpp/absl/container/internal/layout_test.cc:53
n
int n
Definition: abseil-cpp/absl/container/btree_test.cc:1080
absl::str_format_internal::LengthMod::t
@ t
TYPE
#define TYPE(u, l)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.c:8202
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
google::protobuf.internal.decoder.long
long
Definition: bloaty/third_party/protobuf/python/google/protobuf/internal/decoder.py:89


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:27