Mercurial > hg > toybox
comparison lib/lib.h @ 624:1e8b9acdafeb
Genericize llist code a bit: rename llist_free() to llist_traverse(), and no longer accept NULL as a synonym for free.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sun, 15 Jul 2012 17:22:04 -0500 |
parents | f51beec92738 |
children | 77d94b36aff0 |
comparison
equal
deleted
inserted
replaced
623:f51beec92738 | 624:1e8b9acdafeb |
---|---|
33 struct double_list { | 33 struct double_list { |
34 struct double_list *next, *prev; | 34 struct double_list *next, *prev; |
35 char *data; | 35 char *data; |
36 }; | 36 }; |
37 | 37 |
38 void llist_free(void *list, void (*freeit)(void *data)); | 38 void llist_traverse(void *list, void (*using)(void *data)); |
39 void *llist_pop(void *list); // actually void **list, but the compiler's dumb | 39 void *llist_pop(void *list); // actually void **list, but the compiler's dumb |
40 void dlist_add_nomalloc(struct double_list **list, struct double_list *new); | 40 void dlist_add_nomalloc(struct double_list **list, struct double_list *new); |
41 struct double_list *dlist_add(struct double_list **list, char *data); | 41 struct double_list *dlist_add(struct double_list **list, char *data); |
42 | 42 |
43 // args.c | 43 // args.c |