src/cx/linked_list.h

changeset 677
b09aae58bba4
parent 670
4ad8ea3aee49
child 699
35b2b99ee523
equal deleted inserted replaced
676:d0680a23d850 677:b09aae58bba4
64 * @param item_size the size of each element in bytes 64 * @param item_size the size of each element in bytes
65 * @return the created list 65 * @return the created list
66 */ 66 */
67 CxList *cxLinkedListCreate( 67 CxList *cxLinkedListCreate(
68 CxAllocator const *allocator, 68 CxAllocator const *allocator,
69 CxListComparator comparator, 69 cx_compare_func comparator,
70 size_t item_size 70 size_t item_size
71 ); 71 );
72 72
73 /** 73 /**
74 * Allocates a linked list for storing elements with \p item_size bytes each. 74 * Allocates a linked list for storing elements with \p item_size bytes each.
122 */ 122 */
123 size_t cx_linked_list_find( 123 size_t cx_linked_list_find(
124 void const *start, 124 void const *start,
125 ptrdiff_t loc_advance, 125 ptrdiff_t loc_advance,
126 ptrdiff_t loc_data, 126 ptrdiff_t loc_data,
127 CxListComparator cmp_func, 127 cx_compare_func cmp_func,
128 void const *elem 128 void const *elem
129 ) __attribute__((__nonnull__)); 129 ) __attribute__((__nonnull__));
130 130
131 /** 131 /**
132 * Finds the first node in a linked list. 132 * Finds the first node in a linked list.
366 void **begin, 366 void **begin,
367 void **end, 367 void **end,
368 ptrdiff_t loc_prev, 368 ptrdiff_t loc_prev,
369 ptrdiff_t loc_next, 369 ptrdiff_t loc_next,
370 ptrdiff_t loc_data, 370 ptrdiff_t loc_data,
371 CxListComparator cmp_func 371 cx_compare_func cmp_func
372 ) __attribute__((__nonnull__(1, 6))); 372 ) __attribute__((__nonnull__(1, 6)));
373 373
374 374
375 /** 375 /**
376 * Compares two lists element wise. 376 * Compares two lists element wise.
388 int cx_linked_list_compare( 388 int cx_linked_list_compare(
389 void const *begin_left, 389 void const *begin_left,
390 void const *begin_right, 390 void const *begin_right,
391 ptrdiff_t loc_advance, 391 ptrdiff_t loc_advance,
392 ptrdiff_t loc_data, 392 ptrdiff_t loc_data,
393 CxListComparator cmp_func 393 cx_compare_func cmp_func
394 ) __attribute__((__nonnull__(5))); 394 ) __attribute__((__nonnull__(5)));
395 395
396 /** 396 /**
397 * Reverses the order of the nodes in a linked list. 397 * Reverses the order of the nodes in a linked list.
398 * 398 *

mercurial