Mercurial > hg > th-libs
diff th_datastruct.h @ 754:d91d1174cfd8
Add th_llist_reverse() for reversing a linked list.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 01 Feb 2023 13:02:35 +0200 |
parents | 64cb2b1777a9 |
children | 2ab2fece83ea |
line wrap: on
line diff
--- a/th_datastruct.h Thu Jan 26 07:23:12 2023 +0200 +++ b/th_datastruct.h Wed Feb 01 13:02:35 2023 +0200 @@ -42,6 +42,7 @@ th_llist_t * th_llist_get_nth(th_llist_t *list, const size_t n); size_t th_llist_length(const th_llist_t *list); ssize_t th_llist_position(const th_llist_t *list, const th_llist_t *node); +void th_llist_reverse(th_llist_t **list); void th_llist_foreach(th_llist_t *list, void (*func)(th_llist_t *node, void *userdata), void *data); int th_llist_foreach_cond(th_llist_t *list, int (*func)(th_llist_t *node, void *userdata), void *data, th_llist_t **res);