]> git.lizzy.rs Git - dragonblocks_alpha.git/blob - linkedlist.h
Replace gcc by cc in Makefile
[dragonblocks_alpha.git] / linkedlist.h
1 #ifndef _LINKEDLIST_H_
2 #define _LINKEDLIST_H_
3
4 #define ITERATE_LINKEDLIST(list, pair) for (LinkedListPair *pair = list->first; pair != NULL; pair = pair->next)
5
6 typedef struct LinkedListPair
7 {
8         struct LinkedListPair *next;
9         const char *key;
10         const char *value;
11 } LinkedListPair;
12
13 typedef struct
14 {
15         LinkedListPair *first;
16 } LinkedList;
17
18 LinkedList linked_list_create();
19 void linked_list_clear(LinkedList *list);
20
21 void linked_list_put(LinkedList *list, const char *key, const char *value); // ToDo
22 void linked_list_get(LinkedList *list, const char *key); // ToDo
23 void linked_list_delete(LinkedList *list, const char *key); // ToDo
24
25 void linked_list_serialize(int fd); // ToDo
26 void linked_list_deserialize(int fd, LinkedList *); // ToDo
27
28 #endif