-/** @brief Remove a slice of the dynar, sliding the rest of the values to the left
- *
- * This function removes an n-sized slice that starts at element idx. It is equivalent to xbt_dynar_remove_at with a
- * nullptr object argument if n equals to 1.
- *
- * Each of the removed elements is freed using the free_f function passed at dynar creation.
- */
-void xbt_dynar_remove_n_at(xbt_dynar_t const dynar, const unsigned int n, const int idx)
-{
- if (not n)
- return;
-
- _sanity_check_dynar(dynar);
- _check_inbound_idx(dynar, idx);
- _check_inbound_idx(dynar, idx + n - 1);
-
- if (dynar->free_f) {
- for (unsigned long cur = idx; cur < idx + n; cur++) {
- dynar->free_f(_xbt_dynar_elm(dynar, cur));
- }
- }
-
- unsigned long nb_shift = dynar->used - n - idx;
-
- if (nb_shift) {
- unsigned long offset = nb_shift * dynar->elmsize;
- memmove(_xbt_dynar_elm(dynar, idx), _xbt_dynar_elm(dynar, idx + n), offset);
- }
-
- dynar->used -= n;
-}
-
-/** @brief Returns the position of the element in the dynar
- *
- * Beware that if your dynar contains pointed values (such as strings) instead of scalar, this function compares the
- * pointer value, not what's pointed. The only solution to search for a pointed value is then to write the foreach loop
- * yourself:
- * @code
- * signed int position = -1;
- * xbt_dynar_foreach(dynar, iter, elem) {
- * if (not memcmp(elem, searched_element, sizeof(*elem))) {
- * position = iter;
- * break;
- * }
- * }
- * @endcode
- *
- * Raises not_found_error if not found. If you have less than 2 millions elements, you probably want to use
- * #xbt_dynar_search_or_negative() instead, so that you don't have to TRY/CATCH on element not found.
- */
-unsigned int xbt_dynar_search(xbt_dynar_t const dynar, void* const elem)
-{
- unsigned long it;
-
- for (it = 0; it < dynar->used; it++)
- if (not memcmp(_xbt_dynar_elm(dynar, it), elem, dynar->elmsize)) {
- return it;
- }
-
- THROWF(not_found_error, 0, "Element %p not part of dynar %p", elem, dynar);
-}
-
-/** @brief Returns the position of the element in the dynar (or -1 if not found)
- *
- * Beware that if your dynar contains pointed values (such as strings) instead of scalar, this function is probably not
- * what you want. Check the documentation of xbt_dynar_search() for more info.
- *
- * Note that usually, the dynar indices are unsigned integers. If you have more than 2 million elements in your dynar,
- * this very function will not work (but the other will).
- */
-signed int xbt_dynar_search_or_negative(xbt_dynar_t const dynar, void* const elem)
-{
- unsigned long it;
-
- for (it = 0; it < dynar->used; it++)
- if (not memcmp(_xbt_dynar_elm(dynar, it), elem, dynar->elmsize)) {
- return it;
- }
-
- return -1;
-}
-