src/cx/linked_list.h

changeset 528
4fbfac557df8
parent 526
b070ef465313
child 552
4373c2a90066
equal deleted inserted replaced
527:08539b8273fa 528:4fbfac557df8
46 #endif 46 #endif
47 47
48 /** 48 /**
49 * Allocates a linked list for storing elements with \p item_size bytes each. 49 * Allocates a linked list for storing elements with \p item_size bytes each.
50 * 50 *
51 * @remark Elements added to the list are copied, therefore a possible cx_list_s.content_destructor 51 * @remark Elements added to the list are copied, therefore a possible destructor
52 * MUST NOT free the memory pointed to by its argument. 52 * MUST NOT free the memory pointed to by its argument.
53 * 53 *
54 * @param allocator the allocator for allocating the list nodes 54 * @param allocator the allocator for allocating the list nodes
55 * @param comparator the comparator for the elements 55 * @param comparator the comparator for the elements
56 * @param item_size the size of each element in bytes 56 * @param item_size the size of each element in bytes
65 /** 65 /**
66 * Allocates a linked list for storing pointers. 66 * Allocates a linked list for storing pointers.
67 * 67 *
68 * If you want to store the elements directly in this list, use cxLinkedListCreate(). 68 * If you want to store the elements directly in this list, use cxLinkedListCreate().
69 * 69 *
70 * @remark Since only pointers are stored in this list, a possible cx_list_s.content_destructor 70 * @remark Since only pointers are stored in this list, a possible destructor
71 * MAY free the memory pointed to by its argument in order to prevent memory leaks. 71 * MAY free the memory pointed to by its argument in order to prevent memory leaks.
72 * 72 *
73 * @param allocator the allocator for allocating the list nodes 73 * @param allocator the allocator for allocating the list nodes
74 * @param comparator the comparator for the elements 74 * @param comparator the comparator for the elements
75 * @return the created list 75 * @return the created list
80 ) __attribute__((__nonnull__)); 80 ) __attribute__((__nonnull__));
81 81
82 /** 82 /**
83 * Creates a linked list using the data from an array. 83 * Creates a linked list using the data from an array.
84 * 84 *
85 * @remark Elements added to the list are copied, therefore a possible cx_list_s.content_destructor 85 * @remark Elements added to the list are copied, therefore a possible destructor
86 * MUST NOT free the memory pointed to by its argument. 86 * MUST NOT free the memory pointed to by its argument.
87 * 87 *
88 * @param allocator the allocator for allocating the list nodes 88 * @param allocator the allocator for allocating the list nodes
89 * @param comparator the comparator for the elements 89 * @param comparator the comparator for the elements
90 * @param item_size the size of one item in the array 90 * @param item_size the size of one item in the array

mercurial