X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-lib%2Flist.h;h=245a8660780c66c0840c5c5d5bcca0e4cd339df7;hp=2d6e2283c7707312a06cd2d7f99afa1340bd44f8;hb=b68ee108ca7aed9fd3fdfe5eefc1cf284a32fb17;hpb=871a94fc21c9d349bb0fe8851e0f2e3a07527ed5 diff --git a/lib-lib/list.h b/lib-lib/list.h index 2d6e228..245a866 100644 --- a/lib-lib/list.h +++ b/lib-lib/list.h @@ -59,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; \