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
universe@390:
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
universe@390:
UcxList * ucx_list_get(const UcxList *list, size_t index)
Returns the list element at the specified index.
Definition: list.c:163
universe@390:
UcxList * ucx_list_append(UcxList *list, void *data)
Inserts an element at the end of the list.
Definition: list.c:87
universe@390:
int(* cmp_func)(const void *, const void *, void *)
Function pointer to a compare function.
Definition: ucx.h:84
universe@390:
UcxList * ucx_list_prepend(UcxList *list, void *data)
Inserts an element at the beginning of the list.
Definition: list.c:110
universe@390:
Main UCX Header providing most common definitions.
universe@390:
UcxList * ucx_list_first(const UcxList *elem)
Returns the first element of a list.
Definition: list.c:307
universe@390:
void ucx_list_free_a(UcxAllocator *allocator, UcxList *list)
Destroys the entire list using a UcxAllocator.
Definition: list.c:70
universe@390:
UCX list structure.
Definition: list.h:71
universe@390:
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
universe@390:
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
universe@390:
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
universe@390:
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
universe@390:
UcxList * ucx_list_concat(UcxList *list1, UcxList *list2)
Concatenates two lists.
Definition: list.c:128
universe@390:
UcxList * ucx_list_last(const UcxList *elem)
Returns the last element of a list.
Definition: list.c:141
universe@390:
UcxList * ucx_list_remove(UcxList *list, UcxList *element)
Removes an element from the list.
Definition: list.c:319
universe@390:
void * data
List element payload.
Definition: list.h:75
universe@390:
ssize_t ucx_list_indexof(const UcxList *list, const UcxList *elem)
Returns the index of an element.
Definition: list.c:151
universe@390:
UcxList * ucx_list_remove_a(UcxAllocator *allocator, UcxList *list, UcxList *element)
Removes an element from the list using a UcxAllocator.
Definition: list.c:323
universe@390:
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
universe@390:
UCX allocator data structure containing memory management functions.
Definition: allocator.h:88
universe@390:
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
universe@390:
UcxList * next
Pointer to the next list element or NULL, if this is the last element.
Definition: list.h:80
universe@390:
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
universe@390:
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
universe@390:
UcxList * ucx_list_sort(UcxList *list, cmp_func cmpfnc, void *data)
Sorts a UcxList with natural merge sort.
Definition: list.c:254
universe@390:
UcxList * ucx_list_clone(const UcxList *list, copy_func cpyfnc, void *data)
Creates an element-wise copy of a list.
Definition: list.c:31
universe@390:
Allocator for custom memory management.
universe@390:
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
universe@390:
void ucx_list_free(UcxList *list)
Destroys the entire list.
Definition: list.c:66
universe@390:
UcxList * prev
Pointer to the previous list element or NULL, if this is the first element.
Definition: list.h:85
universe@390:
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
universe@390:
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
universe@390:
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
universe@390:
size_t ucx_list_size(const UcxList *list)
Returns the element count of the list.
Definition: list.c:198
universe@390:
void(* ucx_destructor)(void *)
A function pointer to a destructor function.
Definition: ucx.h:72
universe@390: