Add _reverse for I-LIST

This commit is contained in:
Patrick Pelissier committed 2018-10-01 21:22:19 +02:00
1 parent 46c2e33096
commit 4f3dad4bea
2 files changed
+23

No files matched your search

+16
View File
@@ -570,6 +570,22 @@ typedef struct ilist_head_s {
e->name.prev->next = &e->name; \
ILISTI_CONTRACT(name, d); \
ILISTI_CONTRACT(name, e); \
} \
\
static inline void \
M_C(name, _reverse)(list_t list) \
{ \
ILISTI_CONTRACT(name, list); \
struct ilist_head_s *next, *it; \
for(it = list->name.next ; it != &list->name; it = next) { \
next = it->next; \
it->next = it->prev; \
it->prev = next; \
} \
next = it->next; \
it->next = it->prev; \
it->prev = next; \
ILISTI_CONTRACT(name, list); \
} \
#endif