src/cx/linked_list.h

changeset 763
741a2040fa33
parent 759
475335643af4
child 764
ccbdbd088455
equal deleted inserted replaced
762:4523f6d42512 763:741a2040fa33
52 52
53 /** 53 /**
54 * Allocates a linked list for storing elements with \p item_size bytes each. 54 * Allocates a linked list for storing elements with \p item_size bytes each.
55 * 55 *
56 * If \p item_size is CX_STORE_POINTERS, the created list will be created as if 56 * If \p item_size is CX_STORE_POINTERS, the created list will be created as if
57 * cxListStorePointers() was called immediately after creation. 57 * cxListStorePointers() was called immediately after creation and the compare
58 * function will be automatically set to cx_cmp_ptr(), if none is given.
58 * 59 *
59 * @param allocator the allocator for allocating the list nodes 60 * @param allocator the allocator for allocating the list nodes
60 * (if \c NULL the cxDefaultAllocator will be used) 61 * (if \c NULL the cxDefaultAllocator will be used)
61 * @param comparator the comparator for the elements 62 * @param comparator the comparator for the elements
62 * (if \c NULL sort and find functions will not work) 63 * (if \c NULL, and the list is not storing pointers, sort and find
64 * functions will not work)
63 * @param item_size the size of each element in bytes 65 * @param item_size the size of each element in bytes
64 * @return the created list 66 * @return the created list
65 */ 67 */
66 CxList *cxLinkedListCreate( 68 CxList *cxLinkedListCreate(
67 CxAllocator const *allocator, 69 CxAllocator const *allocator,
75 * The list will use cxDefaultAllocator and no comparator function. If you want 77 * The list will use cxDefaultAllocator and no comparator function. If you want
76 * to call functions that need a comparator, you must either set one immediately 78 * to call functions that need a comparator, you must either set one immediately
77 * after list creation or use cxLinkedListCreate(). 79 * after list creation or use cxLinkedListCreate().
78 * 80 *
79 * If \p item_size is CX_STORE_POINTERS, the created list will be created as if 81 * If \p item_size is CX_STORE_POINTERS, the created list will be created as if
80 * cxListStorePointers() was called immediately after creation. 82 * cxListStorePointers() was called immediately after creation and the compare
83 * function will be automatically set to cx_cmp_ptr().
81 * 84 *
82 * @param item_size the size of each element in bytes 85 * @param item_size the size of each element in bytes
83 * @return the created list 86 * @return the created list
84 */ 87 */
85 #define cxLinkedListCreateSimple(item_size) \ 88 #define cxLinkedListCreateSimple(item_size) \

mercurial