--- a/src/cx/array_list.h Sun Nov 20 16:28:03 2022 +0100 +++ b/src/cx/array_list.h Sun Nov 20 16:58:51 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. *