src/cx/array_list.h

changeset 623
21082350a590
parent 617
cec11387c1be
child 628
1e2be40f0cb5
     1.1 --- a/src/cx/array_list.h	Sun Nov 20 16:28:03 2022 +0100
     1.2 +++ b/src/cx/array_list.h	Sun Nov 20 16:58:51 2022 +0100
     1.3 @@ -132,6 +132,22 @@
     1.4          struct cx_array_reallocator_s *reallocator
     1.5  ) __attribute__((__nonnull__(1, 2, 5)));
     1.6  
     1.7 +
     1.8 +/**
     1.9 + * Swaps two array elements.
    1.10 + *
    1.11 + * @param arr the array
    1.12 + * @param elem_size the element size
    1.13 + * @param idx1 index of first element
    1.14 + * @param idx2 index of second element
    1.15 + */
    1.16 +void cx_array_swap(
    1.17 +        void *arr,
    1.18 +        size_t elem_size,
    1.19 +        size_t idx1,
    1.20 +        size_t idx2
    1.21 +) __attribute__((__nonnull__));
    1.22 +
    1.23  /**
    1.24   * Allocates an array list for storing elements with \p item_size bytes each.
    1.25   *

mercurial