MonkOS  v0.1
A simple 64-bit operating system (x86_64)
stdlib.h File Reference

General utilities library. More...

#include <core.h>

Go to the source code of this file.

Typedefs

typedef int(* sortcmp) (const void *a, const void *b)
 Comparison function pointer type for use with the qsort function. More...
 

Functions

void qsort (void *base, size_t num, size_t size, sortcmp cmp)
 Sort the elements of an array using a sort comparison function. More...
 

Detailed Description

General utilities library.

Definition in file stdlib.h.

Typedef Documentation

typedef int(* sortcmp) (const void *a, const void *b)

Comparison function pointer type for use with the qsort function.

Parameters
[in]aPointer to first element to be compared.
[in]bPointer to second element to be compared.
Returns
<0 if the element pointed to by a should go before the element pointed to by b.

0 if the elements sort equivalently.

>0 if the element pointed to by a should go after the element pointed to by b.

Definition at line 28 of file stdlib.h.

Function Documentation

void qsort ( void *  base,
size_t  num,
size_t  size,
sortcmp  cmp 
)

Sort the elements of an array using a sort comparison function.

Sorts a contiguous array of num elements pointed to by base, where each element is size bytes long.

Parameters
[in]basePointer to the first element in the array.
[in]numNumber of element in the array to be sorted.
[in]sizeSize of each element in bytes.
[in]cmpPointer to a function that compares two elements.

Referenced by kshell(), and normalize().