list.h (548B)
1 struct list { 2 struct item *items, *last; 3 void (*freedata)(void *); 4 }; 5 6 struct item { 7 struct item *next, *prev; 8 void *data; 9 }; 10 11 struct item *newitem(void *data); 12 void freeitem(struct item *item); 13 struct list *newlist(void (*freedata)(void *)); 14 void freelist(struct list *list); 15 void linkitem(struct item *item, struct item *to); 16 void unlinkitem(struct item *item); 17 void additem(struct item *item, struct list *list, struct item *pos); 18 void removeitem(struct item *item, struct list *list); 19 void deleteitem(struct item *item, struct list *list);