Skip to content
ListDeleteLast

ListDeleteLast

Description

Delete the last element of the list.

Parameters

Name Direction Description
l in,out List handle.

Success

Returns to the caller. The tail node is unlinked and freed; list length shrinks by one. When copy_deinit is configured it is invoked on the dropped element.

Failure

Function cannot fail. Calling on an empty list is a caller bug and aborts via LOG_FATAL.

Usage example (Cross-references)

Usage examples (Cross-references)
        result = result && list_matches(GENERIC_LIST(&list), (const int[]) {1, 5, 6}, 3);
    
        ListDeleteLast(&list);
        result = result && list_matches(GENERIC_LIST(&list), (const int[]) {1, 5}, 2);
Last updated on