src/cx/linked_list.h

changeset 466
28bc3e10ac28
parent 456
227c2eabbef8
child 467
95e42a963520
equal deleted inserted replaced
465:1e3cb39815f8 466:28bc3e10ac28
43 43
44 #ifdef __cplusplus 44 #ifdef __cplusplus
45 extern "C" { 45 extern "C" {
46 #endif 46 #endif
47 47
48 /**
49 * Allocates a linked list for storing elements with \p item_size bytes each.
50 *
51 * Elements added to the list are copied.
52 *
53 * @param allocator the allocator for allocating the list nodes
54 * @param comparator the comparator for the elements
55 * @param item_size the size of each element in bytes
56 * @return the created list
57 */
48 CxList cxLinkedListCreate(CxAllocator allocator, CxListComparator comparator, size_t item_size); 58 CxList cxLinkedListCreate(CxAllocator allocator, CxListComparator comparator, size_t item_size);
49 59
60 /**
61 * Allocates a linked list for storing pointers.
62 *
63 * If you want to store the elements directly in this list, use cxLinkedListCreate().
64 *
65 * @param allocator the allocator for allocating the list nodes
66 * @param comparator the comparator for the elements
67 * @return the created list
68 */
69 CxList cxPointerLinkedListCreate(CxAllocator allocator, CxListComparator comparator);
70
71 /**
72 * Deallocates the memory of the entire list.
73 *
74 * \attention If this is a pointer list, the memory the pointers are referring to is \em not freed.
75 *
76 * @param list the list
77 */
50 void cxLinkedListDestroy(CxList list); 78 void cxLinkedListDestroy(CxList list);
51 79
52 size_t cxLinkedListRecalculateSize(CxList list); 80 size_t cxLinkedListRecalculateSize(CxList list);
53 81
54 82

mercurial