/
githubmirror
/
kmod
Обзор
Документация
Войти
/
githubmirror
/
kmod
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
shared/array.h
22 строки
645 B
Tobias Stoeckmann
shared: switch array API to size_t
16 авг 2024, 08:00
16 авг 2024, 08:00
6ef3643
Код
Авторство
О чём код?
#pragma once #include <stddef.h> /* * Declaration of struct array is in header because we may want to embed the * structure into another, so we need to know its size */ struct array { void **array; size_t count; size_t total; size_t step; }; void array_init(struct array *array, size_t step); int array_append(struct array *array, const void *element); int array_append_unique(struct array *array, const void *element); void array_pop(struct array *array); void array_free_array(struct array *array); void array_sort(struct array *array, int (*cmp)(const void *a, const void *b)); int array_remove_at(struct array *array, size_t pos);