Files
odwetalibc/include/list.h
T
2023-12-22 00:39:17 +01:00

27 lines
791 B
C

/*
* What is this?
*
* A list (as I interpret it in this library)
* is a `vector_t` of other `vector_t`s, where
* every inner `vector_t` can be of any type ->
* this means a Python-like list
*/
#include <odweta/vector.h>
typedef long unsigned int size_t;
typedef struct {
size_t size; // number of elements that are inside the list
size_t capacity; // how many elements can be put inside
vector_t* data; // vector of vectors
} list_t;
list_t* listInit(); // returns a new list
void listPush(list_t* l, dataType_e type, void* element); // appends an element at the end of a list
void listPrint(list_t* l); // prints a list
void listCleanup(list_t* l); // freeing pointers