2021-04-15 18:59:26 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#ifndef FF_INCLUDED_FFLIST
|
|
|
|
|
#define FF_INCLUDED_FFLIST
|
|
|
|
|
|
2021-05-07 14:55:43 +02:00
|
|
|
#include <stdbool.h>
|
2021-04-15 18:59:26 +02:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
#define FF_LIST_DEFAULT_ALLOC 16
|
|
|
|
|
|
|
|
|
|
typedef struct FFlist
|
|
|
|
|
{
|
2021-04-24 21:42:48 +02:00
|
|
|
char* data;
|
2021-04-15 18:59:26 +02:00
|
|
|
uint32_t elementSize;
|
|
|
|
|
uint32_t length;
|
|
|
|
|
uint32_t capacity;
|
|
|
|
|
} FFlist;
|
|
|
|
|
|
|
|
|
|
void ffListInit(FFlist* list, uint32_t elementSize);
|
|
|
|
|
void ffListInitA(FFlist* list, uint32_t elementSize, uint32_t capacity);
|
|
|
|
|
|
2021-05-23 19:40:34 +02:00
|
|
|
void* ffListGet(const FFlist* list, uint32_t index);
|
2021-04-15 18:59:26 +02:00
|
|
|
|
|
|
|
|
void* ffListAdd(FFlist* list);
|
|
|
|
|
|
2021-05-23 19:40:34 +02:00
|
|
|
uint32_t ffListFirstIndexComp(const FFlist* list, void* compElement, bool(*compFunc)(const void*, const void*));
|
2021-05-07 14:55:43 +02:00
|
|
|
|
2021-04-15 18:59:26 +02:00
|
|
|
void ffListDestroy(FFlist* list);
|
|
|
|
|
|
|
|
|
|
#endif
|