blob: 6d97899986b4d6b3177f9a147b2b673e74c591c4 [file] [log] [blame]
paul718e3742002-12-13 20:15:29 +00001
2#ifndef _LINKLIST_H_
3#define _LINKLIST_H_
4
5struct linklist_node
6{
7 struct linklist_node *prev;
8 struct linklist_node *next;
9
10 void *data;
11};
12
13struct linklist
14{
15 int count;
16 struct linklist_node *head;
17 struct linklist_node *tail;
18
19 int (*cmp) (void *, void *);
20};
21
22void *linklist_lookup (void *data, struct linklist *linklist);
23int linklist_add (void *data, struct linklist *linklist);
24int linklist_remove (void *data, struct linklist *linklist);
25void linklist_remove_all (struct linklist *linklist);
26
27void linklist_head (struct linklist *linklist, struct linklist_node *node);
28int linklist_end (struct linklist_node *node);
29void linklist_next (struct linklist_node *node);
30
31struct linklist *linklist_create ();
32void linklist_delete (struct linklist *);
33
34#endif /*_LINKLIST_H_*/
35