PatchworkOS
Loading...
Searching...
No Matches
qsort.c File Reference
#include <stdint.h>
#include <stdlib.h>

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

◆ POP

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

Definition at line 37 of file qsort.c.

◆ PREPARE_STACK

#define PREPARE_STACK
Value:
char* stack[STACKSIZE]; \
char** stackptr = stack
static pmm_stack_t stack
Definition pmm.c:36
#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.

◆ STACKSIZE

#define STACKSIZE   64

Definition at line 45 of file qsort.c.

◆ T

#define T   7

Definition at line 27 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.

Referenced by qsort().

◆ 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.

References memswp(), POP, PREPARE_STACK, PUSH, stack, and T.

Referenced by draw_polygon(), and syscall_table_init().