59 #define UCX_FOREACH(elem,list) \ 60 for (UcxList* elem = (UcxList*) list ; elem != NULL ; elem = elem->next) void *(* copy_func)(const void *, void *)
Function pointer to a copy function.
Definition: ucx.h:106
UcxList * ucx_list_append_a(UcxAllocator *allocator, UcxList *list, void *data)
Inserts an element at the end of the list using a UcxAllocator.
Definition: list.c:91
UcxList * ucx_list_get(const UcxList *list, size_t index)
Returns the list element at the specified index.
Definition: list.c:163
UcxList * ucx_list_append(UcxList *list, void *data)
Inserts an element at the end of the list.
Definition: list.c:87
int(* cmp_func)(const void *, const void *, void *)
Function pointer to a compare function.
Definition: ucx.h:84
UcxList * ucx_list_prepend(UcxList *list, void *data)
Inserts an element at the beginning of the list.
Definition: list.c:110
Main UCX Header providing most common definitions.
UcxList * ucx_list_first(const UcxList *elem)
Returns the first element of a list.
Definition: list.c:307
void ucx_list_free_a(UcxAllocator *allocator, UcxList *list)
Destroys the entire list using a UcxAllocator.
Definition: list.c:70
UCX list structure.
Definition: list.h:71
ssize_t ucx_list_find(const UcxList *list, void *elem, cmp_func cmpfnc, void *data)
Returns the index of an element containing the specified data.
Definition: list.c:175
UcxList * ucx_list_difference_a(UcxAllocator *allocator, const UcxList *left, const UcxList *right, cmp_func cmpfnc, void *cmpdata, copy_func cpfnc, void *cpdata)
Returns the difference of two lists.
Definition: list.c:421
UcxList * ucx_list_clone_a(UcxAllocator *allocator, const UcxList *list, copy_func cpyfnc, void *data)
Creates an element-wise copy of a list using a UcxAllocator.
Definition: list.c:35
UcxList * ucx_list_union(const UcxList *left, const UcxList *right, cmp_func cmpfnc, void *cmpdata, copy_func cpfnc, void *cpdata)
Returns the union of two lists.
Definition: list.c:382
UcxList * ucx_list_concat(UcxList *list1, UcxList *list2)
Concatenates two lists.
Definition: list.c:128
UcxList * ucx_list_last(const UcxList *elem)
Returns the last element of a list.
Definition: list.c:141
UcxList * ucx_list_remove(UcxList *list, UcxList *element)
Removes an element from the list.
Definition: list.c:319
void * data
List element payload.
Definition: list.h:75
ssize_t ucx_list_indexof(const UcxList *list, const UcxList *elem)
Returns the index of an element.
Definition: list.c:151
UcxList * ucx_list_remove_a(UcxAllocator *allocator, UcxList *list, UcxList *element)
Removes an element from the list using a UcxAllocator.
Definition: list.c:323
UcxList * ucx_list_difference(const UcxList *left, const UcxList *right, cmp_func cmpfnc, void *cmpdata, copy_func cpfnc, void *cpdata)
Returns the difference of two lists.
Definition: list.c:414
UCX allocator data structure containing memory management functions.
Definition: allocator.h:88
void ucx_list_free_content(UcxList *list, ucx_destructor destr)
Destroys the contents of the specified list by calling the specified destructor on each of them...
Definition: list.c:79
UcxList * next
Pointer to the next list element or NULL, if this is the last element.
Definition: list.h:80
UcxList * ucx_list_intersection_a(UcxAllocator *allocator, const UcxList *left, const UcxList *right, cmp_func cmpfnc, void *cmpdata, copy_func cpfnc, void *cpdata)
Returns the intersection of two lists.
Definition: list.c:405
UcxList * ucx_list_intersection(const UcxList *left, const UcxList *right, cmp_func cmpfnc, void *cmpdata, copy_func cpfnc, void *cpdata)
Returns the intersection of two lists.
Definition: list.c:398
UcxList * ucx_list_sort(UcxList *list, cmp_func cmpfnc, void *data)
Sorts a UcxList with natural merge sort.
Definition: list.c:254
UcxList * ucx_list_clone(const UcxList *list, copy_func cpyfnc, void *data)
Creates an element-wise copy of a list.
Definition: list.c:31
Allocator for custom memory management.
UcxList * ucx_list_prepend_a(UcxAllocator *allocator, UcxList *list, void *data)
Inserts an element at the beginning of the list using a UcxAllocator.
Definition: list.c:114
void ucx_list_free(UcxList *list)
Destroys the entire list.
Definition: list.c:66
UcxList * prev
Pointer to the previous list element or NULL, if this is the first element.
Definition: list.h:85
UcxList * ucx_list_union_a(UcxAllocator *allocator, const UcxList *left, const UcxList *right, cmp_func cmpfnc, void *cmpdata, copy_func cpfnc, void *cpdata)
Returns the union of two lists.
Definition: list.c:389
int ucx_list_equals(const UcxList *list1, const UcxList *list2, cmp_func cmpfnc, void *data)
Compares two UCX lists element-wise by using a compare function.
Definition: list.c:49
int ucx_list_contains(const UcxList *list, void *elem, cmp_func cmpfnc, void *data)
Checks, if a list contains a specific element.
Definition: list.c:193
size_t ucx_list_size(const UcxList *list)
Returns the element count of the list.
Definition: list.c:198
void(* ucx_destructor)(void *)
A function pointer to a destructor function.
Definition: ucx.h:72