diff --git a/src/twc-list.h b/src/twc-list.h index 80e0ae7..6d602b9 100644 --- a/src/twc-list.h +++ b/src/twc-list.h @@ -84,5 +84,10 @@ twc_list_get(struct t_twc_list *list, size_t index); item; \ item = item->next_item, ++index) +#define twc_list_foreach_reverse(list, index, item) \ + for (item = list->tail, index = list->count - 1; \ + item; \ + item = item->prev_item, --index) + #endif // TOX_WEECHAT_LIST_H