src/cx/linked_list.h

changeset 662
d0d95740071b
parent 647
2e6e9d9f2159
child 669
dce9b8450656
     1.1 --- a/src/cx/linked_list.h	Thu Feb 23 22:27:41 2023 +0100
     1.2 +++ b/src/cx/linked_list.h	Thu Feb 23 22:43:13 2023 +0100
     1.3 @@ -54,9 +54,6 @@
     1.4  /**
     1.5   * Allocates a linked list for storing elements with \p item_size bytes each.
     1.6   *
     1.7 - * @remark Elements added to the list are copied, therefore a possible destructor
     1.8 - * MUST NOT free the memory pointed to by its argument.
     1.9 - *
    1.10   * @param allocator the allocator for allocating the list nodes
    1.11   * @param comparator the comparator for the elements
    1.12   * @param item_size the size of each element in bytes
    1.13 @@ -69,6 +66,18 @@
    1.14  ) __attribute__((__nonnull__));
    1.15  
    1.16  /**
    1.17 + * Allocates a linked list for storing elements with \p item_size bytes each.
    1.18 + *
    1.19 + * The list will use cxDefaultAllocator and no comparator function. If you want
    1.20 + * to call functions that need a comparator, you must either set one immediately
    1.21 + * after list creation or use cxLinkedListCreate().
    1.22 + *
    1.23 + * @param item_size the size of each element in bytes
    1.24 + * @return the created list
    1.25 + */
    1.26 +CxList *cxLinkedListCreateSimple(size_t item_size);
    1.27 +
    1.28 +/**
    1.29   * Finds the node at a certain index.
    1.30   *
    1.31   * This function can be used to start at an arbitrary position within the list.

mercurial