-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinklist.h
41 lines (37 loc) · 1.2 KB
/
linklist.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef LINKLIST_H
#define LINKLIST_H
struct Cell{ //vector instead of struct Vector
char dataType[10]; //data type, so we know how to interact
char data; //modified to be character
int color; //default color is green
int capacity; //max capacity it can hold
int size; //current entire capacity
struct Cell* next;
struct Cell* previous;
void* data2;
};
typedef struct Cell cell;
struct List{ //struct to keep track of underlying cell structure
int size;
cell* head;
cell* tail;
void (*print)(void * lista);
void (*destroy)(void * lista);
};
typedef struct List list;
list* listInit(void);
void listDestroyer(void* lista);
void listAppend(void *lista,char strinG);
cell* cellInit(char ch);
void listPrinter(list* lista);
void listInsert(list* lista, char strinG,int location);
char listPop(list* lista, int location);
char listGetIndexValue(list* lista, int index);
char listIndexUpdater( list* lista, char ch ,int index);
//void pointer data2
void listInsertVoid(list* lista, void* strinG,int location);
void* listPopVoid(list* lista, int location);
void listAppendVoid(void *lista, void* strinG);
cell* cellInitVoid(void* ch);
void* listGetIndexValueVoid(list* lista, int index);
#endif