Mercurial > hg > toybox
comparison lib/lib.h @ 1295:114ec0ab161c draft
Add free functions for predefined llist types.
author | Rob Landley <rob@landley.net> |
---|---|
date | Wed, 21 May 2014 06:57:43 -0500 |
parents | d48bdc1cb017 |
children | 313980d3d78c |
comparison
equal
deleted
inserted
replaced
1294:88abd5b68a17 | 1295:114ec0ab161c |
---|---|
22 struct double_list { | 22 struct double_list { |
23 struct double_list *next, *prev; | 23 struct double_list *next, *prev; |
24 char *data; | 24 char *data; |
25 }; | 25 }; |
26 | 26 |
27 void llist_traverse(void *list, void (*using)(void *data)); | 27 void llist_free_arg(void *node); |
28 void llist_free_double(void *node); | |
29 void llist_traverse(void *list, void (*using)(void *node)); | |
28 void *llist_pop(void *list); // actually void **list | 30 void *llist_pop(void *list); // actually void **list |
29 void *dlist_pop(void *list); // actually struct double_list **list | 31 void *dlist_pop(void *list); // actually struct double_list **list |
30 void dlist_add_nomalloc(struct double_list **list, struct double_list *new); | 32 void dlist_add_nomalloc(struct double_list **list, struct double_list *new); |
31 struct double_list *dlist_add(struct double_list **list, char *data); | 33 struct double_list *dlist_add(struct double_list **list, char *data); |
32 | 34 |