|
TeoCCl library
0.1.7
|
#include <limits.h>#include <stdlib.h>#include <string.h>#include "teoccl/array_list.h"#include "teoccl/memory.h"Macros | |
| #define | SIZE_T_MAX ((size_t)-1) |
Functions | |
| ccl_array_list_t * | cclArrayListNew (array_list_free_fn *free_fn) |
| Create new Array-List. More... | |
| int | cclArrayListFree (ccl_array_list_t *tal) |
| Free memory allocated for Array-List. More... | |
| void * | cclArrayListGetIdx (ccl_array_list_t *tal, size_t i) |
| Get element of Array-List by index. More... | |
| int | cclArrayListDelIdx (ccl_array_list_t *tal, size_t i, size_t count) |
| Delete range of elements of Array-List since index. More... | |
| int | cclArrayListAdd (ccl_array_list_t *tal, void *data) |
| Add element to Array-List. More... | |
| size_t | cclArrayListLength (ccl_array_list_t *tal) |
| Get count of elements in Array-List. More... | |
| void | cclArrayListSort (ccl_array_list_t *tal, int(*compar)(const void *, const void *)) |
| Run Qsort for array-list. More... | |
| void * | cclArrayListBSearch (ccl_array_list_t *tal, const void **key, int(*compar)(const void *, const void *)) |
| Binary search for array-list. More... | |
| #define SIZE_T_MAX ((size_t)-1) |
| int cclArrayListAdd | ( | ccl_array_list_t * | tal, |
| void * | data | ||
| ) |
Add element to Array-List.
| [in] | tal | - Pointer to ccl_array_list_t |
| [in] | data | - Pointer to the data to be added |
References ccl_array_list::length.
| void* cclArrayListBSearch | ( | ccl_array_list_t * | tal, |
| const void ** | key, | ||
| int(*)(const void *, const void *) | compar | ||
| ) |
Binary search for array-list.
| tal | - array list |
| key | - what we want to find |
| compar | - pointer to comparator |
References ccl_array_list::array, and ccl_array_list::length.
| int cclArrayListDelIdx | ( | ccl_array_list_t * | tal, |
| size_t | i, | ||
| size_t | count | ||
| ) |
Delete range of elements of Array-List since index.
| [in] | tal | - Pointer to ccl_array_list_t |
| [in] | i | - Delete from this index |
| [in] | count | - Count of deleting elements |
References ccl_array_list::array, ccl_array_list::free_fn, and ccl_array_list::length.
| int cclArrayListFree | ( | ccl_array_list_t * | tal | ) |
Free memory allocated for Array-List.
| [in] | tal | - Pointer to ccl_array_list_t |
References ccl_array_list::array, ccl_array_list::free_fn, and ccl_array_list::length.
| void* cclArrayListGetIdx | ( | ccl_array_list_t * | tal, |
| size_t | i | ||
| ) |
Get element of Array-List by index.
| [out] | tal | - Pointer to ccl_array_list_t |
| [in] | i | - index in ccl_array_list_t |
References ccl_array_list::array, and ccl_array_list::length.
| size_t cclArrayListLength | ( | ccl_array_list_t * | tal | ) |
Get count of elements in Array-List.
| [in] | tal | - Pointer to ccl_array_list_t |
References ccl_array_list::length.
| ccl_array_list_t* cclArrayListNew | ( | array_list_free_fn * | free_fn | ) |
Create new Array-List.
| [in] | free_fn | - Pointer to free-callback function |
References ccl_array_list::array, ARRAY_LIST_DEFAULT_SIZE, ccl_calloc(), ccl_malloc(), ccl_array_list::free_fn, ccl_array_list::length, and ccl_array_list::size.
| void cclArrayListSort | ( | ccl_array_list_t * | tal, |
| int(*)(const void *, const void *) | compar | ||
| ) |
Run Qsort for array-list.
| tal | - array list |
| compar | - pointer to comparator |
References ccl_array_list::array, and ccl_array_list::length.