initial list.h commit
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* 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
|
||||
Reference in New Issue
Block a user