src/cx/linked_list.h

changeset 552
4373c2a90066
parent 528
4fbfac557df8
child 628
1e2be40f0cb5
     1.1 --- a/src/cx/linked_list.h	Sat May 21 11:22:47 2022 +0200
     1.2 +++ b/src/cx/linked_list.h	Sat May 21 12:10:25 2022 +0200
     1.3 @@ -402,25 +402,31 @@
     1.4  /**
     1.5   * Compares two lists element wise.
     1.6   *
     1.7 + * The \c follow_ptr flags have the following meaning: if \c false, the pointer denoted by \p loc_data shall
     1.8 + * directly be passed to the \p cmp_func.
     1.9 + * If \c true, the data at \p loc_data is assumed to be a pointer, dereferenced, and then passed to \p cmp_func.
    1.10 + *
    1.11   * \note Both list must have the same structure.
    1.12   *
    1.13   * @param begin_left the begin of the left list (\c NULL denotes an empty list)
    1.14   * @param begin_right the begin of the right list  (\c NULL denotes an empty list)
    1.15   * @param loc_advance the location of the pointer to advance
    1.16   * @param loc_data the location of the \c data pointer within your node struct
    1.17 - * @param follow_ptr \c false if the pointer denoted by \p loc_data shall be passed to the \p cmp_func.
    1.18 - * If \c true, the data at \p loc_data is assumed to be a pointer, dereferenced, and then passed to \p cmp_func.
    1.19 + * @param follow_ptr_left indicates whether pointers in the left list shall be dereferenced
    1.20 + * @param follow_ptr_right indicates whether pointers in the right list shall be dereferenced
    1.21   * @param cmp_func the function to compare the elements
    1.22 - * @return
    1.23 + * @return the first non-zero result of invoking \p cmp_func or: negative if the left list is smaller than the
    1.24 + * right list, positive if the left list is larger than the right list, zero if both lists are equal.
    1.25   */
    1.26  int cx_linked_list_compare(
    1.27          void const *begin_left,
    1.28          void const *begin_right,
    1.29          ptrdiff_t loc_advance,
    1.30          ptrdiff_t loc_data,
    1.31 -        bool follow_ptr,
    1.32 +        bool follow_ptr_left,
    1.33 +        bool follow_ptr_right,
    1.34          CxListComparator cmp_func
    1.35 -) __attribute__((__nonnull__(6)));
    1.36 +) __attribute__((__nonnull__(7)));
    1.37  
    1.38  /**
    1.39   * Reverses the order of the nodes in a linked list.

mercurial