Data Structures | |
| struct | s_array |
Typedefs | |
| typedef s_array | t_array |
Functions | |
| void | array_init (t_array *ary, size_t element_size, void(*array_destroy)(void *)) |
| void | array_push (t_array *ary, const void *element) |
| void * | array_pop (t_array *ary) |
| void * | array_shift (t_array *ary) |
| void | array_unshift (t_array *ary, const void *element) |
| void | array_sort (t_array *ary, int(*compar)(const void *, const void *)) |
| void * | array_bsearch (t_array *ary, const void *key, int(*compar)(const void *, const void *)) |
| void * | array_element_at (t_array *ary, size_t index) |
| void | array_destroy (t_array *ary) |
|
|
Array "class". This struct contains all necessary information about the array |
|
||||||||||||||||
|
This function does a binary search on the array. Has to be sorted first!
|
|
|
This function destroys an array. It calls the destroy function specified to array_init() for each argument and then free()s the array itself.
|
|
||||||||||||
|
This function returns an element at a specified position.
|
|
||||||||||||||||
|
This function initializes an array structure (it could be the constructor)
|
|
|
This function deletes the last element in the array.
|
|
||||||||||||
|
This function pushes an element to the end of the array. The element is being copied via a memdup() function, which only is a malloc() with a memcpy().
|
|
|
This function deletes the first element in the array
|
|
||||||||||||
|
This function sorts an array via the quick sort algorithm
|
|
||||||||||||
|
This function inserts an element at the beginning of the array.
|
1.3.5