diff -r aeaf7db26fac -r c094afcdfb27 src/ucx/cx/list.h --- a/src/ucx/cx/list.h Sun Jul 09 15:14:26 2023 +0200 +++ b/src/ucx/cx/list.h Mon Jul 10 18:39:24 2023 +0200 @@ -70,11 +70,14 @@ struct cx_list_class_s { /** * Destructor function. + * + * Implementations SHALL invoke the content destructor functions if provided + * and SHALL deallocate the list memory, if an allocator is provided. */ void (*destructor)(struct cx_list_s *list); /** - * Member function for inserting a single elements. + * Member function for inserting a single element. * Implementors SHOULD see to performant implementations for corner cases. */ int (*insert_element)( @@ -142,7 +145,7 @@ ); /** - * Member function for sorting the list in place. + * Member function for sorting the list in-place. */ void (*sort)(struct cx_list_s *list); @@ -581,7 +584,7 @@ } /** - * Sorts the list in place. + * Sorts the list in-place. * * \remark The underlying sort algorithm is implementation defined. * @@ -632,6 +635,14 @@ __attribute__((__nonnull__)) void cxListDestroy(CxList *list); +/** + * A shared instance of an empty list. + * + * Writing to that list is undefined. + */ +extern CxList * const cxEmptyList; + + #ifdef __cplusplus } // extern "C" #endif