PandA-2024.02
Macros | Typedefs | Functions
qsort.c File Reference
#include "atomic.h"
Include dependency graph for qsort.c:

Go to the source code of this file.

Macros

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

Typedefs

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

Functions

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, int(*cmp)(const void *, const void *), int pshift, size_t lp[])
 
static void trinkle (unsigned char *head, size_t width, int(*cmp)(const void *, const void *), size_t pp[2], int pshift, int trusty, size_t lp[])
 
void qsort (void *base, size_t nel, size_t width, int(*cmp)(const void *, const void *))
 

Macro Definition Documentation

◆ ntz

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

Definition at line 27 of file qsort.c.

Referenced by pntz().

Typedef Documentation

◆ cmpfun

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

Definition at line 29 of file qsort.c.

◆ size_t

typedef unsigned int size_t

Definition at line 24 of file qsort.c.

Function Documentation

◆ cycle()

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

Definition at line 39 of file qsort.c.

Referenced by sift(), and trinkle().

Here is the caller graph for this function:

◆ pntz()

static int pntz ( size_t  p[2])
inlinestatic

Definition at line 31 of file qsort.c.

References ntz.

Referenced by qsort(), and trinkle().

Here is the caller graph for this function:

◆ qsort()

void qsort ( void *  base,
size_t  nel,
size_t  width,
int(*)(const void *, const void *)  cmp 
)

Definition at line 152 of file qsort.c.

References pntz(), shl(), shr(), sift(), and trinkle().

Referenced by test().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shl()

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

Definition at line 62 of file qsort.c.

Referenced by qsort().

Here is the caller graph for this function:

◆ shr()

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

Definition at line 74 of file qsort.c.

Referenced by qsort(), and trinkle().

Here is the caller graph for this function:

◆ sift()

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

Definition at line 86 of file qsort.c.

References cycle().

Referenced by qsort(), and trinkle().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ trinkle()

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

Definition at line 113 of file qsort.c.

References cycle(), pntz(), shr(), and sift().

Referenced by qsort().

Here is the call graph for this function:
Here is the caller graph for this function:

Generated on Mon Feb 12 2024 13:02:58 for PandA-2024.02 by doxygen 1.8.13