diff options
Diffstat (limited to 'src/stdlib/qsort.c')
-rw-r--r-- | src/stdlib/qsort.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/stdlib/qsort.c b/src/stdlib/qsort.c new file mode 100644 index 00000000..da4c5c15 --- /dev/null +++ b/src/stdlib/qsort.c @@ -0,0 +1,24 @@ +#include <stdlib.h> + +/** sort an array **/ + +void qsort(void * base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)) +{ + (void)base; (void)nmemb; (void)size; (void)compar; + /* TODO */ +} + +/*** +sorts the array at ARGUMENT(base), which consists of ARGUMENT(nmemb) elements +of ARGUMENT(size) bytes each. + +The sorting is performed by calling ARGUMENT(compar) with two elements of the +array. The function must return less than 0 if the first argument is less +than the second, 0 if they are equal, and greater than 0 if the first argument +is greater than the second. +***/ + +/* +UNSPECIFIED(The order of equal elements) +STDC(1) +*/ |