src/cx/linked_list.h

changeset 466
28bc3e10ac28
parent 456
227c2eabbef8
child 467
95e42a963520
     1.1 --- a/src/cx/linked_list.h	Tue Oct 05 12:25:23 2021 +0200
     1.2 +++ b/src/cx/linked_list.h	Tue Oct 05 13:03:45 2021 +0200
     1.3 @@ -45,8 +45,36 @@
     1.4  extern "C" {
     1.5  #endif
     1.6  
     1.7 +/**
     1.8 + * Allocates a linked list for storing elements with \p item_size bytes each.
     1.9 + *
    1.10 + * Elements added to the list are copied.
    1.11 + *
    1.12 + * @param allocator the allocator for allocating the list nodes
    1.13 + * @param comparator the comparator for the elements
    1.14 + * @param item_size the size of each element in bytes
    1.15 + * @return the created list
    1.16 + */
    1.17  CxList cxLinkedListCreate(CxAllocator allocator, CxListComparator comparator, size_t item_size);
    1.18  
    1.19 +/**
    1.20 + * Allocates a linked list for storing pointers.
    1.21 + *
    1.22 + * If you want to store the elements directly in this list, use cxLinkedListCreate().
    1.23 + *
    1.24 + * @param allocator the allocator for allocating the list nodes
    1.25 + * @param comparator the comparator for the elements
    1.26 + * @return the created list
    1.27 + */
    1.28 +CxList cxPointerLinkedListCreate(CxAllocator allocator, CxListComparator comparator);
    1.29 +
    1.30 +/**
    1.31 + * Deallocates the memory of the entire list.
    1.32 + *
    1.33 + * \attention If this is a pointer list, the memory the pointers are referring to is \em not freed.
    1.34 + *
    1.35 + * @param list the list
    1.36 + */
    1.37  void cxLinkedListDestroy(CxList list);
    1.38  
    1.39  size_t cxLinkedListRecalculateSize(CxList list);

mercurial