src/cx/linked_list.h

changeset 1423
9a72258446cd
parent 1419
e46406fd1b3c
equal deleted inserted replaced
1422:8bfccb342895 1423:9a72258446cd
446 * Inserts a chain of nodes into a sorted linked list, avoiding duplicates. 446 * Inserts a chain of nodes into a sorted linked list, avoiding duplicates.
447 * The chain must not be part of any list yet. 447 * The chain must not be part of any list yet.
448 * 448 *
449 * If either the list starting with the node pointed to by @p begin or the list 449 * If either the list starting with the node pointed to by @p begin or the list
450 * starting with @p insert_begin is not sorted, the behavior is undefined. 450 * starting with @p insert_begin is not sorted, the behavior is undefined.
451 * Also, the chain to be inserted must not contain duplicates within itself.
452 * 451 *
453 * @attention In contrast to cx_linked_list_insert_sorted(), not all nodes of the 452 * @attention In contrast to cx_linked_list_insert_sorted(), not all nodes of the
454 * chain might be added. This function returns a new chain consisting of all the duplicates. 453 * chain might be added. This function returns a new chain consisting of all the duplicates.
455 * 454 *
456 * @param begin a pointer to the beginning node pointer (required) 455 * @param begin a pointer to the beginning node pointer (required)
457 * @param end a pointer to the end node pointer (if your list has one) 456 * @param end a pointer to the end node pointer (if your list has one)
458 * @param loc_prev the location of a @c prev pointer within your node struct (negative if your struct does not have one) 457 * @param loc_prev the location of a @c prev pointer within your node struct (negative if your struct does not have one)
459 * @param loc_next the location of a @c next pointer within your node struct (required) 458 * @param loc_next the location of a @c next pointer within your node struct (required)
460 * @param insert_begin a pointer to the first node of the chain that shall be inserted 459 * @param insert_begin a pointer to the first node of the chain that shall be inserted
461 * @param cmp_func a compare function that will receive the node pointers 460 * @param cmp_func a compare function that will receive the node pointers
462 * @return a pointer to a new chain with all duplicates which were not inserted (or @c NULL when there were no duplicates) 461 * @return a pointer to a new chain with all duplicates that were not inserted (or @c NULL when there were no duplicates)
463 */ 462 */
464 cx_attr_nonnull_arg(1, 5, 6) 463 cx_attr_nonnull_arg(1, 5, 6)
465 cx_attr_nodiscard 464 cx_attr_nodiscard
466 cx_attr_export 465 cx_attr_export
467 void *cx_linked_list_insert_unique_chain( 466 void *cx_linked_list_insert_unique_chain(

mercurial