--- a/src/ucx/cx/array_list.h Sun Nov 20 12:43:44 2022 +0100 +++ b/src/ucx/cx/array_list.h Sat Nov 26 17:07:08 2022 +0100 @@ -132,6 +132,22 @@ struct cx_array_reallocator_s *reallocator ) __attribute__((__nonnull__(1, 2, 5))); + +/** + * Swaps two array elements. + * + * @param arr the array + * @param elem_size the element size + * @param idx1 index of first element + * @param idx2 index of second element + */ +void cx_array_swap( + void *arr, + size_t elem_size, + size_t idx1, + size_t idx2 +) __attribute__((__nonnull__)); + /** * Allocates an array list for storing elements with \p item_size bytes each. * @@ -150,7 +166,7 @@ #ifdef __cplusplus -} /* extern "C" */ +} // extern "C" #endif -#endif /* UCX_ARRAY_LIST_H */ +#endif // UCX_ARRAY_LIST_H