Implement IT_END operator.

Add missing IT_LAST operator
This commit is contained in:
Patrick Pelissier committed 2017-03-13 10:32:57 +01:00
1 parent c09ce9c949
commit eaf3af8c07
6 files changed
+94

No files matched your search

+25
View File
@@ -72,6 +72,8 @@ typedef struct ilist_head_s {
IT_TYPE(M_C3(ilist_it_,name,_t)), \
IT_FIRST(M_C3(ilist_,name,_it)), \
IT_SET(M_C3(ilist_,name,_it_set)), \
IT_LAST(M_C3(ilist_,name,_it_last)), \
IT_END(M_C3(ilist_,name,_it_end)), \
IT_END_P(M_C3(ilist_,name,_end_p)), \
IT_LAST_P(M_C3(ilist_,name,_last_p)), \
IT_EQUAL_P(M_C3(ilist_,name,_it_equal_p)), \
@@ -242,6 +244,29 @@ typedef struct ilist_head_s {
it->previous = cit->previous; \
} \
\
static inline void \
M_C3(ilist_, name, _it_last)(M_C3(ilist_it_, name,_t) it, \
M_C3(ilist_, name,_t) list) \
{ \
assert (it != NULL && list != NULL); \
assert (list->name.next != NULL && list->name.next->next != NULL); \
it->head = &list->name; \
it->current = list->name.prev; \
it->next = &list->name; \
it->previous = list->name.prev->prev; \
} \
\
static inline void \
M_C3(ilist_, name, _it_end)(M_C3(ilist_it_, name,_t) it, \
M_C3(ilist_, name,_t) list) \
{ \
assert (it != NULL && list != NULL); \
it->head = &list->name; \
it->current = &list->name; \
it->next = list->name.next; \
it->previous = list->name.prev; \
} \
\
static inline bool \
M_C3(ilist_, name, _end_p)(const M_C3(ilist_it_, name,_t) it) \
{ \