-
Notifications
You must be signed in to change notification settings - Fork 0
/
list.h
26 lines (23 loc) · 1.41 KB
/
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
struct Node{
void *data;
struct Node *next;
};
struct Performance{
unsigned int reads;
unsigned int writes;
unsigned int mallocs;
unsigned int frees;
};
struct Performance *newPerformance();
void push(struct Performance *performance, struct Node **list_ptr, void *src, unsigned int width);
void readHead(struct Performance *performance, struct Node **list_ptr, void *dest, unsigned int width);
void pop(struct Performance *performance, struct Node **list_ptr, void *dest, unsigned int width);
struct Node **next(struct Performance *performance, struct Node **list_ptr);
int isEmpty(struct Performance *performance, struct Node **list_ptr);
void freeList(struct Performance *performance, struct Node **list_ptr);
void readItem(struct Performance *performance, struct Node **list_ptr, unsigned int index, void *dest, unsigned int width);
void appendItem(struct Performance *performance, struct Node **list_ptr, void *src, unsigned int width);
void insertItem(struct Performance *performance, struct Node **list_ptr, unsigned int index, void *src, unsigned int width);
void prependItem(struct Performance *performance, struct Node **list_ptr, void *src, unsigned int width);
void deleteItem(struct Performance *performance, struct Node **list_ptr, unsigned int index);
int findItem(struct Performance *performance, struct Node **list_ptr, int (*compar)(const void *, const void *), void *target, unsigned int width);