made work: multi-dimensional lists
This commit is contained in:
+2
-2
@@ -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
|
||||
|
||||
|
||||
@@ -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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user