-
-static UcxList* ucx_list_setoperation_a(UcxAllocator *allocator,
- UcxList const *left, UcxList const *right,
- cmp_func cmpfnc, void* cmpdata,
- copy_func cpfnc, void* cpdata,
- int op) {
-
- UcxList *res = NULL;
- UcxList *cur = NULL;
- const UcxList *src = left;
-
- do {
- UCX_FOREACH(node, src) {
- void* elem = node->data;
- if (
- (op == 0 && !ucx_list_contains(res, elem, cmpfnc, cmpdata)) ||
- (op == 1 && ucx_list_contains(right, elem, cmpfnc, cmpdata)) ||
- (op == 2 && !ucx_list_contains(right, elem, cmpfnc, cmpdata))) {
- UcxList *nl = almalloc(allocator, sizeof(UcxList));
- nl->prev = cur;
- nl->next = NULL;
- if (cpfnc) {
- nl->data = cpfnc(elem, cpdata);
- } else {
- nl->data = elem;
- }
- if (cur != NULL)
- cur->next = nl;
- cur = nl;
- if (res == NULL)
- res = cur;
- }
- }
- if (op == 0 && src == left)
- src = right;
- else
- src = NULL;
- } while (src != NULL);
-
- return res;
+static int cx_emptyl_compare(
+ __attribute__((__unused__)) struct cx_list_s const *list,
+ struct cx_list_s const *other
+) {
+ if (other->size == 0) return 0;
+ return -1;