]> git.ipfire.org Git - thirdparty/kmod.git/blob - libkmod/libkmod-array.h
python: module: fix versions -> info typo in Module._info_get() error message.
[thirdparty/kmod.git] / libkmod / libkmod-array.h
1 #pragma once
2
3 /*
4 * Declaration of struct array is in header because we may want to embed the
5 * structure into another, so we need to know its size
6 */
7 struct array {
8 void **array;
9 size_t count;
10 size_t total;
11 size_t step;
12 };
13
14 void array_init(struct array *array, size_t step);
15 int array_append(struct array *array, const void *element);
16 int array_append_unique(struct array *array, const void *element);
17 void array_pop(struct array *array);
18 void array_free_array(struct array *array);
19 void array_sort(struct array *array, int (*cmp)(const void *a, const void *b));
20 int array_remove_at(struct array *array, unsigned int pos);