src/ucx/cx/array_list.h

changeset 438
22eca559aded
parent 436
1260fad21be7
child 490
d218607f5a7e
--- 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

mercurial