qsort.c

The libc implementation

Author

Martin ‘Solar’ Baute

License

Public Domain

Summary
qsort.cThe libc implementation
Todo’s
Stack usage is log2( nmemb ) (minus what T shaves off the worst case).Worst-case nmemb is platform dependent and should probably be configured through _PDCLIB_config.h.
Functions
qsortSorts an array in memory

Todo’s

Stack usage is log2( nmemb ) (minus what T shaves off the worst case).

Worst-case nmemb is platform dependent and should probably be configured through _PDCLIB_config.h.

Functions

qsort

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

Sorts an array in memory

basepointer to the array
nmembamount of objects in the array
sizeamount of bytes each object takes
comparthe function used to compare items
void qsort(void *base,
size_t nmemb,
size_t size,
int (*compar)( const void *, const void * ))
Sorts an array in memory