X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-lib%2Flist.h;h=4f54d32432d15db1ff70f1f5b5981175819afbc0;hp=bba82b1f1a6fcc58321efb657e3c52553559f7e9;hb=cfd5f411041c7ef44087b032751792fadc74586d;hpb=926c11d6cc2cf92ec20792edaef2608d3f3b198b diff --git a/lib-lib/list.h b/lib-lib/list.h index bba82b1..4f54d32 100644 --- a/lib-lib/list.h +++ b/lib-lib/list.h @@ -51,6 +51,13 @@ list = prefix##_list_last(list); \ *list = item; \ return list; \ + } \ + static inline type *prefix##_list_rev(type *list) { \ + type *l = NULL; \ + while (list) { \ + prefix##_list_push(&l, prefix##_list_pop(&list)); \ + } \ + return l; \ } \ \ static inline type **prefix##_list_init(type **list) { \ @@ -80,6 +87,8 @@ DO_SLIST(string_list_t, string, string_item_delete); string_list_t *string_list_dup(const string_list_t *); int string_list_contains(const string_list_t *, const char *, const char *); +void string_list_add(string_list_t **, const char *); +void string_list_remove(string_list_t **l, const char *str); /* FIXME: b0rken API's, replace that at any cost */ /* add an element to a list */