diff -r 8fa43b732980 -r 86ebc3745e62 src/linked_list.c --- a/src/linked_list.c Sun Feb 07 21:14:39 2021 +0100 +++ b/src/linked_list.c Sun Feb 07 21:26:48 2021 +0100 @@ -135,12 +135,19 @@ return 0; } +void *cx_ll_last(cx_list *list) { + cx_linked_list *ll = list->listdata; + struct cx_linked_list_node *last = cx_linked_list_last( + NULL, &ll->end, offsetof(struct cx_linked_list_node, next)); + return &last->payload; +} cx_list_class cx_linked_list_class = { cx_ll_add, cx_ll_insert, cx_ll_remove, - cx_ll_find + cx_ll_find, + cx_ll_last }; CxList cxLinkedListCreate(CxAllocator allocator, CxListComparator comparator, size_t itemsize) {