view src/list.h @ 12:d359966ed8de

Added trie
author Eris Caffee <discordia@eldalin.com>
date Mon, 01 Oct 2012 15:50:30 -0500
parents 68f85ffc6029
children
line source
1 #ifndef LIST_H_
2 #define LIST_H_
4 #include <stddef.h>
6 struct list;
7 struct list_iterator;
9 struct list * list_new(void);
10 void list_delete(struct list * l);
12 size_t list_size(struct list * l);
13 void * list_push_back(struct list * l, void * elem);
14 void * list_pop_back(struct list * l);
15 void * list_push_front(struct list * l, void * elem);
16 void * list_pop_front(struct list * l);
18 // The iterators are different than their c++ STL counterparts.
19 // They are bi-directional, and list_end points to the last element, not the empty space beyond the last elem.
20 struct list_iterator * list_begin (struct list * l);
21 struct list_iterator * list_end (struct list * l);
22 struct list_iterator * list_next (struct list_iterator * lit);
23 struct list_iterator * list_prev (struct list_iterator * lit);
24 struct list_iterator * list_find (struct list_iterator * it, void * data);
25 void * list_remove (struct list_iterator * lit);
26 void * list_value (struct list_iterator * lit);
28 struct list_iterator * list_insert_after (struct list_iterator * lit, void * elem);
29 struct list_iterator * list_insert_before (struct list_iterator * lit, void * elem);
31 #endif