made work: multi-dimensional lists

This commit is contained in:
Odweta
2023-12-25 01:05:42 +01:00
parent 7233f8c8af
commit a52cdc0c7f
7 changed files with 135 additions and 59 deletions
+2 -2
View File
@@ -8,8 +8,7 @@
*/
#include <odweta/vector.h>
typedef long unsigned int size_t;
#include <odweta/util.h>
typedef struct {
size_t size; // number of elements that are inside the list
@@ -22,6 +21,7 @@ list_t* listInit(); // r
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 _listPrintRecursive(list_t* l, int depth);
void listCleanup(list_t* l); // freeing pointers
+10
View File
@@ -1,6 +1,16 @@
#ifndef UTIL_H
#define UTIL_H
typedef long unsigned int size_t;
typedef enum {
INT = 0,
FLOAT = 1,
CHAR = 2,
VECTOR = 3, // allows for multi-dimensional arrays
LIST = 4
} dataType_e;
char* intToString(int x); // convert an int into a string
long pow(int x, int n); // x^n
+1 -8
View File
@@ -1,14 +1,7 @@
#ifndef VECTOR_H
#define VECTOR_H
typedef long unsigned int size_t;
typedef enum {
INT = 0,
FLOAT = 1,
CHAR = 2,
VECTOR = 3 // allows for multi-dimensional arrays
} dataType_e;
#include <odweta/util.h>
typedef struct {
dataType_e type;