src/cx/linked_list.h

changeset 500
eb9e7bd40a8e
parent 489
af6be1e123aa
child 503
a89857072ace
equal deleted inserted replaced
499:3dc9075df822 500:eb9e7bd40a8e
53 * @param allocator the allocator for allocating the list nodes 53 * @param allocator the allocator for allocating the list nodes
54 * @param comparator the comparator for the elements 54 * @param comparator the comparator for the elements
55 * @param item_size the size of each element in bytes 55 * @param item_size the size of each element in bytes
56 * @return the created list 56 * @return the created list
57 */ 57 */
58 CxList cxLinkedListCreate( 58 CxList *cxLinkedListCreate(
59 CxAllocator allocator, 59 CxAllocator *allocator,
60 CxListComparator comparator, 60 CxListComparator comparator,
61 size_t item_size 61 size_t item_size
62 ) __attribute__((__nonnull__)); 62 ) __attribute__((__nonnull__));
63 63
64 /** 64 /**
68 * 68 *
69 * @param allocator the allocator for allocating the list nodes 69 * @param allocator the allocator for allocating the list nodes
70 * @param comparator the comparator for the elements 70 * @param comparator the comparator for the elements
71 * @return the created list 71 * @return the created list
72 */ 72 */
73 CxList cxPointerLinkedListCreate( 73 CxList *cxPointerLinkedListCreate(
74 CxAllocator allocator, 74 CxAllocator *allocator,
75 CxListComparator comparator 75 CxListComparator comparator
76 ) __attribute__((__nonnull__)); 76 ) __attribute__((__nonnull__));
77 77
78 /** 78 /**
79 * Creates a linked list using the data from an array. 79 * Creates a linked list using the data from an array.
83 * @param item_size the size of one item in the array 83 * @param item_size the size of one item in the array
84 * @param num_items the number of items 84 * @param num_items the number of items
85 * @param array the array data 85 * @param array the array data
86 * @return the created list 86 * @return the created list
87 */ 87 */
88 CxList cxLinkedListFromArray( 88 CxList *cxLinkedListFromArray(
89 CxAllocator allocator, 89 CxAllocator *allocator,
90 CxListComparator comparator, 90 CxListComparator comparator,
91 size_t item_size, 91 size_t item_size,
92 size_t num_items, 92 size_t num_items,
93 void const *array 93 void const *array
94 ) __attribute__((__nonnull__)); 94 ) __attribute__((__nonnull__));
98 * 98 *
99 * \attention If this is a pointer list, the memory the pointers are referring to is \em not freed. 99 * \attention If this is a pointer list, the memory the pointers are referring to is \em not freed.
100 * 100 *
101 * @param list the list 101 * @param list the list
102 */ 102 */
103 void cxLinkedListDestroy(CxList list) __attribute__((__nonnull__)); 103 void cxLinkedListDestroy(CxList *list) __attribute__((__nonnull__));
104 104
105 /** 105 /**
106 * Finds the node at a certain index. 106 * Finds the node at a certain index.
107 * 107 *
108 * This function can be used to start at an arbitrary position within the list. 108 * This function can be used to start at an arbitrary position within the list.

mercurial