Go to the documentation of this file.
16 static void array_copy_slice(
t_array *array,
t_array *aux,
size_t lo,
size_t hi)
28 static void array_merge(
t_array *array,
t_array *aux,
size_t lo,
size_t sz)
37 hi = mi + sz > array->
size ? array->
size : mi + sz;
52 array_copy_slice(array, aux, lo, hi);
61 while (sz < array->size)
64 while (lo < array->size - sz)
66 array_merge(array, aux, lo, sz);
84 array_merge_sort_iter(array, aux);
void * array_get(const t_array *array, size_t index)
Returns the item at the specified position in this list.
int(* cmp)(const void *, const void *)
(optional) A function ponter used to compare members of this data type
void array_insertion_sort(t_array *array)
Sorts this array using insertion sort.
void array_merge_sort(t_array *array)
Sorts this array using merge sort.
const t_type * type
The type of items in this array.
t_array * array_zeros(const t_type *type, size_t size)
Initializes a new array of the specified size, filled with zeros.
void array_delete(t_array *array)
Deletes this array and free all its items and the associated data.
size_t size
The number of items in this array.
void array_set(t_array *array, size_t index, const void *content)
Replaces the element at the specified position in this array with a copy of the specified element.
void ds_exit_set(int err)
Set errno to the specified value, print the error message, and exit the process.