| 49 * If @p elem_size is #CX_STORE_POINTERS, the created list stores pointers instead of |
49 * If @p elem_size is #CX_STORE_POINTERS, the created list stores pointers instead of |
| 50 * copies of the added elements and the compare function will be automatically set |
50 * copies of the added elements and the compare function will be automatically set |
| 51 * to cx_cmp_ptr(), if none is given. |
51 * to cx_cmp_ptr(), if none is given. |
| 52 * |
52 * |
| 53 * @param allocator the allocator for allocating the list nodes |
53 * @param allocator the allocator for allocating the list nodes |
| 54 * (if @c NULL, a default stdlib allocator will be used) |
54 * (if @c NULL, the cxDefaultAllocator will be used) |
| 55 * @param comparator the comparator for the elements |
55 * @param comparator the comparator for the elements |
| 56 * (if @c NULL, and the list is not storing pointers, sort and find |
56 * (if @c NULL, and the list is not storing pointers, sort and find |
| 57 * functions will not work) |
57 * functions will not work) |
| 58 * @param elem_size the size of each element in bytes |
58 * @param elem_size the size of each element in bytes |
| 59 * @return the created list |
59 * @return the created list |
| 75 * to call functions that need a comparator, you must either set one immediately |
75 * to call functions that need a comparator, you must either set one immediately |
| 76 * after list creation or use cxLinkedListCreate(). |
76 * after list creation or use cxLinkedListCreate(). |
| 77 * |
77 * |
| 78 * If @p elem_size is #CX_STORE_POINTERS, the created list stores pointers instead of |
78 * If @p elem_size is #CX_STORE_POINTERS, the created list stores pointers instead of |
| 79 * copies of the added elements and the compare function will be automatically set |
79 * copies of the added elements and the compare function will be automatically set |
| 80 * to cx_cmp_ptr(), if none is given. |
80 * to cx_cmp_ptr(). |
| 81 * |
81 * |
| 82 * @param elem_size (@c size_t) the size of each element in bytes |
82 * @param elem_size (@c size_t) the size of each element in bytes |
| 83 * @return (@c CxList*) the created list |
83 * @return (@c CxList*) the created list |
| 84 */ |
84 */ |
| 85 #define cxLinkedListCreateSimple(elem_size) \ |
85 #define cxLinkedListCreateSimple(elem_size) \ |
| 391 * |
391 * |
| 392 * The following combinations of arguments are valid (more arguments are optional): |
392 * The following combinations of arguments are valid (more arguments are optional): |
| 393 * @li @p loc_next and @p loc_prev (ancestor node is determined by using the prev pointer, overall O(1) performance) |
393 * @li @p loc_next and @p loc_prev (ancestor node is determined by using the prev pointer, overall O(1) performance) |
| 394 * @li @p loc_next and @p begin (ancestor node is determined by list traversal, overall O(n) performance) |
394 * @li @p loc_next and @p begin (ancestor node is determined by list traversal, overall O(n) performance) |
| 395 * |
395 * |
| 396 * @remark The @c next and @c prev pointers of the removed node are not cleared by this function and may still be used |
396 * @remark The @c next and @c prev pointers of the removed chain are not cleared by this function and may still be used |
| 397 * to traverse to a former adjacent node in the list, or within the chain. |
397 * to traverse to a former adjacent node in the list, or within the chain. |
| 398 * |
398 * |
| 399 * @param begin a pointer to the beginning node pointer (optional) |
399 * @param begin a pointer to the beginning node pointer (optional) |
| 400 * @param end a pointer to the end node pointer (optional) |
400 * @param end a pointer to the end node pointer (optional) |
| 401 * @param loc_prev the location of a @c prev pointer within your node struct (negative if your struct does not have one) |
401 * @param loc_prev the location of a @c prev pointer within your node struct (negative if your struct does not have one) |