add prefix##_list_next_cycle

This commit is contained in:
Julien Danjou 2008-01-17 18:46:39 +01:00
parent 3b1526ea5b
commit ace5434a15
1 changed files with 11 additions and 0 deletions

11
list.h
View File

@ -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); \