PatchworkOS  966e257
A non-POSIX operating system.
Loading...
Searching...
No Matches
qsort.c File Reference
#include <stdint.h>
#include <stdlib.h>
Include dependency graph for qsort.c:

Go to the source code of this file.

Macros

#define T   7
 
#define PREPARE_STACK
 
#define PUSH(base, limit)
 
#define POP(base, limit)
 
#define STACKSIZE   64
 

Functions

static _INLINE void memswp (char *i, char *j, size_t size)
 
void qsort (void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *))
 

Macro Definition Documentation

◆ T

#define T   7

Definition at line 27 of file qsort.c.

◆ PREPARE_STACK

#define PREPARE_STACK
Value:
char* stack[STACKSIZE]; \
char** stackptr = stack
static pmm_stack_t stack
Definition pmm.c:38
#define STACKSIZE
Definition qsort.c:45

Definition at line 30 of file qsort.c.

◆ PUSH

#define PUSH (   base,
  limit 
)
Value:
stackptr[0] = base; \
stackptr[1] = limit; \
stackptr += 2

Definition at line 33 of file qsort.c.

◆ POP

#define POP (   base,
  limit 
)
Value:
stackptr -= 2; \
base = stackptr[0]; \
limit = stackptr[1]

Definition at line 37 of file qsort.c.

◆ STACKSIZE

#define STACKSIZE   64

Definition at line 45 of file qsort.c.

Function Documentation

◆ memswp()

static _INLINE void memswp ( char *  i,
char *  j,
size_t  size 
)
static

Definition at line 12 of file qsort.c.

Here is the caller graph for this function:

◆ qsort()

void qsort ( void *  base,
size_t  nmemb,
size_t  size,
int(*)(const void *, const void *)  compar 
)

Definition at line 47 of file qsort.c.

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