--- a/ucx/cx/list.h Sun May 21 11:52:06 2023 +0200 +++ b/ucx/cx/list.h Sun May 21 16:34:58 2023 +0200 @@ -70,6 +70,9 @@ 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); @@ -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