|
@@ -3,52 +3,30 @@
|
|
|
|
|
|
#include "core/Types.h"
|
|
|
|
|
|
-struct CoreListT {
|
|
|
+struct ListT {
|
|
|
size_t length;
|
|
|
size_t capacity;
|
|
|
size_t dataSize;
|
|
|
void* data;
|
|
|
};
|
|
|
-typedef struct CoreListT CoreList;
|
|
|
+typedef struct ListT List;
|
|
|
|
|
|
-void coreInitList(CoreList* l, size_t dataSize);
|
|
|
-void coreDestroyList(CoreList* l);
|
|
|
-void coreReserveListEntries(CoreList* l, size_t n);
|
|
|
-void coreAddListData(CoreList* l, const void* data);
|
|
|
-#define coreAddListType(l, type, ...) coreAddListData(l, &(type){__VA_ARGS__})
|
|
|
-void coreAddLastListData(CoreList* l);
|
|
|
-void* coreAddEmptyListData(CoreList* l);
|
|
|
-void* coreGetListIndex(const CoreList* l, size_t index);
|
|
|
-#define coreGetTypedListIndex(l, index, type) \
|
|
|
- (*(type*)coreGetListIndex(l, index))
|
|
|
-void* coreGetListLast(const CoreList* l);
|
|
|
-#define coreGetTypedListLast(l, type) (*(type*)coreGetListLast(l))
|
|
|
-void coreClearList(CoreList* l);
|
|
|
-void coreRemoveListIndexBySwap(CoreList* l, size_t index);
|
|
|
-void coreRemoveListIndex(CoreList* l, size_t index);
|
|
|
-void coreRemoveListLast(CoreList* l);
|
|
|
-void* coreGetListStart(const CoreList* l);
|
|
|
-void* coreGetListEnd(const CoreList* l);
|
|
|
-
|
|
|
-#ifdef IMPORT_CORE
|
|
|
-#define List CoreList
|
|
|
-#define initList coreInitList
|
|
|
-#define destroyList coreDestroyList
|
|
|
-#define reserveListEntries coreReserveListEntries
|
|
|
-#define addListData coreAddListData
|
|
|
-#define addListType coreAddListType
|
|
|
-#define addLastListData coreAddLastListData
|
|
|
-#define addEmptyListData coreAddEmptyListData
|
|
|
-#define getListIndex coreGetListIndex
|
|
|
-#define getTypedListIndex coreGetTypedListIndex
|
|
|
-#define getListLast coreGetListLast
|
|
|
-#define getTypedListLast coreGetTypedListLast
|
|
|
-#define clearList coreClearList
|
|
|
-#define removeListIndexBySwap coreRemoveListIndexBySwap
|
|
|
-#define removeListIndex coreRemoveListIndex
|
|
|
-#define removeListLast coreRemoveListLast
|
|
|
-#define getListStart coreGetListStart
|
|
|
-#define getListEnd coreGetListEnd
|
|
|
-#endif
|
|
|
+void initList(List* l, size_t dataSize);
|
|
|
+void destroyList(List* l);
|
|
|
+void reserveListEntries(List* l, size_t n);
|
|
|
+void addListData(List* l, const void* data);
|
|
|
+#define addListType(l, type, ...) addListData(l, &(type){__VA_ARGS__})
|
|
|
+void addLastListData(List* l);
|
|
|
+void* addEmptyListData(List* l);
|
|
|
+void* getListIndex(const List* l, size_t index);
|
|
|
+#define getTypedListIndex(l, index, type) (*(type*)getListIndex(l, index))
|
|
|
+void* getListLast(const List* l);
|
|
|
+#define getTypedListLast(l, type) (*(type*)getListLast(l))
|
|
|
+void clearList(List* l);
|
|
|
+void removeListIndexBySwap(List* l, size_t index);
|
|
|
+void removeListIndex(List* l, size_t index);
|
|
|
+void removeListLast(List* l);
|
|
|
+void* getListStart(const List* l);
|
|
|
+void* getListEnd(const List* l);
|
|
|
|
|
|
#endif
|