2 * Copyright (C) 2013 Andrea Mazzoleni
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
15 #ifndef __RAID_HELPER_H
16 #define __RAID_HELPER_H
19 * Inserts an integer in a sorted vector.
21 * This function can be used to insert indexes in order, ready to be used for
24 * @n Number of integers currently in the vector.
25 * @v Vector of integers already sorted.
26 * It must have extra space for the new elemet at the end.
29 void raid_insert(int n, int *v, int i);
32 * Sorts a small vector of integers.
34 * If you have indexes not in order, you can use this function to sort them
35 * before calling raid_rec().
37 * @n Number of integers. No more than RAID_PARITY_MAX.
38 * @v Vector of integers.
40 void raid_sort(int n, int *v);