snapraid/raid/helper.h
Andrea Mazzoleni ca459e9fb0
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-arm32 (push) Waiting to run
Build / build-win (push) Waiting to run
Build / build-freebsd (push) Waiting to run
Build / build-musl (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
Remove leading double underscores from header include guards
2026-10-13 11:20:19 +02:00

31 lines
782 B
C

// SPDX-License-Identifier: GPL-2.0-or-later
// Copyright (C) 2013 Andrea Mazzoleni
#ifndef RAID_HELPER_H
#define RAID_HELPER_H
/**
* Inserts an integer in a sorted vector.
*
* This function can be used to insert indexes in order, ready to be used for
* calling raid_rec().
*
* @n Number of integers currently in the vector.
* @v Vector of integers already sorted.
* It must have extra space for the new element at the end.
* @i Value to insert.
*/
void raid_insert(int n, int *v, int i);
/**
* Sorts a small vector of integers.
*
* If you have indexes not in order, you can use this function to sort them
* before calling raid_rec().
*
* @n Number of integers. No more than RAID_PARITY_MAX.
* @v Vector of integers.
*/
void raid_sort(int n, int *v);
#endif