From ace5434a15c9eb9c237a96d18b921afc74cb9dd5 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 17 Jan 2008 18:46:39 +0100 Subject: [PATCH] add prefix##_list_next_cycle --- list.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/list.h b/list.h index 3a3133bb7..45f211124 100644 --- a/list.h +++ b/list.h @@ -113,6 +113,17 @@ tmp = *prefix##_list_last(list); \ return tmp; \ } \ + static inline type *prefix##_list_next_cycle(type **list, type *item) \ + { \ + if(item) \ + { \ + if(item->next) \ + return item->next; \ + else \ + return *list; \ + } \ + return NULL; \ + } \ static inline void prefix##_list_detach(type **list, type *item) \ { \ type *prev = prefix##_list_prev(list, item); \