X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-lib%2Flist.h;h=245a8660780c66c0840c5c5d5bcca0e4cd339df7;hp=2e13fcaf0f21841e4e08b7e834cb7ee9c2e14fa3;hb=1ffe18af5bf2fda6f7dc86c514b56c6a82ec3040;hpb=5291c0f984bad00026e56260c42ebecc2252429f diff --git a/lib-lib/list.h b/lib-lib/list.h index 2e13fca..245a866 100644 --- a/lib-lib/list.h +++ b/lib-lib/list.h @@ -25,6 +25,8 @@ #ifndef MUTT_LIB_LIB_LIST_H #define MUTT_LIB_LIB_LIST_H +#include "str.h" + typedef struct list_t { char *data; struct list_t *next; @@ -57,6 +59,19 @@ static inline LIST *mutt_add_list(LIST *head, const char *data) { *list = item; \ } \ \ + static inline type **prefix##_list_last(type **list) { \ + while (*list) { \ + list = &(*list)->next; \ + } \ + return list; \ + } \ + \ + static inline type **prefix##_list_append(type **list, type *item) { \ + list = prefix##_list_last(list); \ + *list = item; \ + return list; \ + } \ + \ static inline type **prefix##_list_init(type **list) { \ *list = NULL; \ return list; \