safec  3.6.0
Safe C Library - ISO TR24731 Bounds Checking Interface
qsort_s.c File Reference
#include "safe_lib.h"
#include <stdlib.h>
#include <string.h>
+ Include dependency graph for qsort_s.c:

Macros

#define ntz(x)   a_ctz_l((x))
 

Typedefs

typedef unsigned long uint64_t
 
typedef int(* cmpfun) (const void *, const void *, void *)
 

Functions

static int a_ctz_64 (uint64_t x)
 
static int a_ctz_l (unsigned long x)
 
static int pntz (size_t p[2])
 
static void cycle (size_t width, unsigned char *ar[], int n)
 
static void shl (size_t p[2], int n)
 
static void shr (size_t p[2], int n)
 
static void sift (unsigned char *head, size_t width, cmpfun cmp, int pshift, size_t lp[], void *ctx)
 
static void trinkle (unsigned char *head, size_t width, cmpfun cmp, size_t pp[2], int pshift, int trusty, size_t lp[], void *ctx)
 
static void qsort_musl (void *base, size_t nel, size_t width, cmpfun cmp, void *ctx)
 
errno_t qsort_s (void *base, rsize_t nmemb, rsize_t size, int(*compar)(const void *k, const void *y, void *context), void *context)
 

Variables

static const char debruijn32 [32]
 

Macro Definition Documentation

◆ ntz

#define ntz (   x)    a_ctz_l((x))

Typedef Documentation

◆ uint64_t

typedef unsigned long uint64_t

◆ cmpfun

typedef int(* cmpfun) (const void *, const void *, void *)

Function Documentation

◆ a_ctz_64()

static int a_ctz_64 ( uint64_t  x)
inlinestatic

◆ a_ctz_l()

static int a_ctz_l ( unsigned long  x)
inlinestatic

◆ pntz()

static int pntz ( size_t  p[2])
inlinestatic

◆ cycle()

static void cycle ( size_t  width,
unsigned char *  ar[],
int  n 
)
static

◆ shl()

static void shl ( size_t  p[2],
int  n 
)
inlinestatic

◆ shr()

static void shr ( size_t  p[2],
int  n 
)
inlinestatic

◆ sift()

static void sift ( unsigned char *  head,
size_t  width,
cmpfun  cmp,
int  pshift,
size_t  lp[],
void *  ctx 
)
static

◆ trinkle()

static void trinkle ( unsigned char *  head,
size_t  width,
cmpfun  cmp,
size_t  pp[2],
int  pshift,
int  trusty,
size_t  lp[],
void *  ctx 
)
static

◆ qsort_musl()

static void qsort_musl ( void *  base,
size_t  nel,
size_t  width,
cmpfun  cmp,
void *  ctx 
)
static

◆ qsort_s()

errno_t qsort_s ( void *  base,
rsize_t  nmemb,
rsize_t  size,
int(*)(const void *k, const void *y, void *context)  compar,
void *  context 
)

Variable Documentation

◆ debruijn32

const char debruijn32[32]
static
Initial value:
= {0, 1, 23, 2, 29, 24, 19, 3, 30, 27, 25,
11, 20, 8, 4, 13, 31, 22, 28, 18, 26, 10,
7, 12, 21, 17, 9, 6, 16, 5, 15, 14}