src/ucx/cx/linked_list.h

changeset 438
22eca559aded
parent 415
d938228c382e
child 490
d218607f5a7e
equal deleted inserted replaced
437:545010bc5e71 438:22eca559aded
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).
442 ptrdiff_t loc_prev, 421 ptrdiff_t loc_prev,
443 ptrdiff_t loc_next 422 ptrdiff_t loc_next
444 ) __attribute__((__nonnull__(1))); 423 ) __attribute__((__nonnull__(1)));
445 424
446 #ifdef __cplusplus 425 #ifdef __cplusplus
447 } /* extern "C" */ 426 } // extern "C"
448 #endif 427 #endif
449 428
450 #endif /* UCX_LINKED_LIST_H */ 429 #endif // UCX_LINKED_LIST_H

mercurial