src/cx/linked_list.h

changeset 1111
78eeeb950883
parent 1100
2ca6fa71e55e
child 1113
dce04550fbef
equal deleted inserted replaced
1110:a0e9be7ed131 1111:78eeeb950883
50 extern const unsigned cx_linked_list_swap_sbo_size; 50 extern const unsigned cx_linked_list_swap_sbo_size;
51 51
52 /** 52 /**
53 * Allocates a linked list for storing elements with @p elem_size bytes each. 53 * Allocates a linked list for storing elements with @p elem_size bytes each.
54 * 54 *
55 * If @p elem_size is CX_STORE_POINTERS, the created list will be created as if 55 * If @p elem_size is #CX_STORE_POINTERS, the created list stores pointers instead of
56 * cxListStorePointers() was called immediately after creation and the compare 56 * copies of the added elements and the compare function will be automatically set
57 * function will be automatically set to cx_cmp_ptr(), if none is given. 57 * to cx_cmp_ptr(), if none is given.
58 * 58 *
59 * @param allocator the allocator for allocating the list nodes 59 * @param allocator the allocator for allocating the list nodes
60 * (if @c NULL, a default stdlib allocator will be used) 60 * (if @c NULL, a default stdlib allocator will be used)
61 * @param comparator the comparator for the elements 61 * @param comparator the comparator for the elements
62 * (if @c NULL, and the list is not storing pointers, sort and find 62 * (if @c NULL, and the list is not storing pointers, sort and find
78 * 78 *
79 * The list will use cxDefaultAllocator and no comparator function. If you want 79 * The list will use cxDefaultAllocator and no comparator function. If you want
80 * to call functions that need a comparator, you must either set one immediately 80 * to call functions that need a comparator, you must either set one immediately
81 * after list creation or use cxLinkedListCreate(). 81 * after list creation or use cxLinkedListCreate().
82 * 82 *
83 * If @p elem_size is CX_STORE_POINTERS, the created list will be created as if 83 * If @p elem_size is #CX_STORE_POINTERS, the created list stores pointers instead of
84 * cxListStorePointers() was called immediately after creation and the compare 84 * copies of the added elements and the compare function will be automatically set
85 * function will be automatically set to cx_cmp_ptr(). 85 * to cx_cmp_ptr(), if none is given.
86 * 86 *
87 * @param elem_size (@c size_t) the size of each element in bytes 87 * @param elem_size (@c size_t) the size of each element in bytes
88 * @return (@c CxList*) the created list 88 * @return (@c CxList*) the created list
89 */ 89 */
90 #define cxLinkedListCreateSimple(elem_size) \ 90 #define cxLinkedListCreateSimple(elem_size) \

mercurial