src/cx/linked_list.h

changeset 629
6c81ee4f11ad
parent 628
1e2be40f0cb5
child 639
309e8b08c60e
equal deleted inserted replaced
628:1e2be40f0cb5 629:6c81ee4f11ad
78 CxAllocator const *allocator, 78 CxAllocator const *allocator,
79 CxListComparator comparator 79 CxListComparator comparator
80 ) __attribute__((__nonnull__)); 80 ) __attribute__((__nonnull__));
81 81
82 /** 82 /**
83 * Creates a linked list using the data from an array.
84 *
85 * @remark Elements added to the list are copied, therefore a possible destructor
86 * MUST NOT free the memory pointed to by its argument.
87 *
88 * @param allocator the allocator for allocating the list nodes
89 * @param comparator the comparator for the elements
90 * @param item_size the size of one item in the array
91 * @param num_items the number of items
92 * @param array the array data
93 * @return the created list
94 */
95 CxList *cxLinkedListFromArray(
96 CxAllocator const *allocator,
97 CxListComparator comparator,
98 size_t item_size,
99 size_t num_items,
100 void const *array
101 ) __attribute__((__nonnull__));
102
103 /**
104 * Finds the node at a certain index. 83 * Finds the node at a certain index.
105 * 84 *
106 * This function can be used to start at an arbitrary position within the list. 85 * This function can be used to start at an arbitrary position within the list.
107 * If the search index is large than the start index, \p loc_advance must denote 86 * If the search index is large than the start index, \p loc_advance must denote
108 * the location of some sort of \c next pointer (i.e. a pointer to the next node). 87 * the location of some sort of \c next pointer (i.e. a pointer to the next node).

mercurial