diff -r 6a86ad3d8c03 -r d7ca126eab7f src/linked_list.c --- a/src/linked_list.c Mon Dec 27 17:16:32 2021 +0100 +++ b/src/linked_list.c Tue Dec 28 14:16:04 2021 +0100 @@ -396,6 +396,28 @@ } } +int cx_linked_list_compare( + void *begin_left, + void *begin_right, + ptrdiff_t loc_advance, + ptrdiff_t loc_data, + int follow_ptr, + CxListComparator cmp_func +) { + void *left = begin_left, *right = begin_right; + + while (left != NULL && right != NULL) { + int result = cmp_func(ll_data(left), ll_data(right)); + if (result != 0) return result; + left = ll_advance(left); + right = ll_advance(right); + } + + if (left != NULL) { return 1; } + else if (right != NULL) { return -1; } + else { return 0; } +} + void cx_linked_list_reverse( void **begin, void **end,