kaa_list_node_t * kaa_list_prev(kaa_list_node_t *it)
Gets iterator to the previous element.
kaa_list_node_t * kaa_list_next(kaa_list_node_t *it)
Gets iterator to the next element.
kaa_error_t
Definition: kaa_error.h:31
void kaa_list_sort(kaa_list_t *list, match_predicate pred)
Sorts list according to predicate condition.
struct kaa_list_t kaa_list_t
Definition: kaa_list.h:30
bool(* match_predicate)(void *data, void *context)
Return false if data doesn't match search criteria.
Definition: kaa_list.h:35
void kaa_list_destroy(kaa_list_t *list, deallocate_list_data deallocator)
Destroys list and all elements.
kaa_error_t kaa_list_remove_first(kaa_list_t *list, match_predicate pred, void *context, deallocate_list_data deallocator)
Removes from the list the first element for which the predicate returns true.
kaa_list_t * kaa_list_create(void)
Creates empty list.
void(* process_data)(void *data, void *context)
Use to process element data.
Definition: kaa_list.h:50
void kaa_list_for_each(kaa_list_node_t *first, kaa_list_node_t *last, process_data process, void *context)
Applies the function process to each of the elements in the range [first,last].
kaa_list_t * kaa_lists_merge(kaa_list_t *destination, kaa_list_t *source)
Merges the source list into the destination list by transferring all of its elements at their respect...
size_t kaa_list_get_size(kaa_list_t *list)
Returns the number of elements in the list.
kaa_list_node_t * kaa_list_find_next(kaa_list_node_t *from, match_predicate pred, void *context)
Returns an iterator to the first element in the list that matches by the predicate.
kaa_list_node_t * kaa_list_push_back(kaa_list_t *list, void *data)
Inserts a new element at the end of the list, after its current last element.
kaa_list_node_t * kaa_list_back(kaa_list_t *list)
Returns an iterator pointing to the last element in the list.
struct kaa_list_node_t kaa_list_node_t
Definition: kaa_list.h:29
int32_t kaa_list_hash(kaa_list_t *list, list_node_hash pred)
Estimate hash from sorted array.
void * kaa_list_get_data(kaa_list_node_t *it)
Gets data from the iterator.
uint64_t list_node_hash(void *item)
Returns list node hash.
Definition: kaa_list.h:45
void(* deallocate_list_data)(void *)
Use to deallocate list node data.
Definition: kaa_list.h:40
void kaa_list_set_data_at(kaa_list_node_t *it, void *data, deallocate_list_data deallocator)
Sets new data to the element.
void kaa_list_clear(kaa_list_t *list, deallocate_list_data deallocator)
Removes all elements from the list (which are destroyed), and leaving the list with a size of 0...
kaa_list_node_t * kaa_list_remove_at(kaa_list_t *list, kaa_list_node_t *it, deallocate_list_data deallocator)
Removes from the list a single element.
kaa_list_node_t * kaa_list_begin(kaa_list_t *list)
Returns an iterator pointing to the first element in the list.
kaa_list_node_t * kaa_list_push_front(kaa_list_t *list, void *data)
Inserts a new element at the beginning of the list, right before its current first element...