-
Notifications
You must be signed in to change notification settings - Fork 0
/
list.h
29 lines (25 loc) · 796 Bytes
/
list.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
/**
* Defines the List struct and all the function headers related to it.
* @author Marcelo F. Cabral ([email protected])
*/
#include"cell.c"
#ifndef LIST_H
#define LIST_H
/**
* struct List: a doubly linked list. Holds the pointers to the first and last cells (Cell*) of the list.
* Also holds an integer (n) that is always equal to the number of cells (and tasks) in the list.
*/
typedef struct List{
Cell *first, *last;
int n;
}List;
List* createList();
Cell* removeList(List *l, int op);
Task* removeFront(List *l, int op);
Task* removeEnd(List *l, int op);
Cell* searchForCell(List *l, char *name);
Task* searchForTask(List *l, char *name);
int insertTask(List *l, Task *ta, int op);
Task* removeTaskFromList(List *l, char *name, int op);
void printList(List *l);
#endif