Add list _splice_back

This commit is contained in:
Patrick Pelissier committed 2017-08-12 10:10:28 +02:00
1 parent 4b11521145
commit 980170d88f
1 file changed
+15 -1
+15 -1
View File
@@ -406,8 +406,22 @@ typedef struct ilist_head_s {
list2->name.prev = &list2->name; \ list2->name.prev = &list2->name; \
ILISTI_CONTRACT(name, list1); \ ILISTI_CONTRACT(name, list1); \
ILISTI_CONTRACT(name, list2); \ ILISTI_CONTRACT(name, list2); \
} \
\
static inline void \
M_C(name, _splice_back)(list_t nv, list_t ov, list_it_t it) \
{ \
ILISTI_CONTRACT(name, nv); \
ILISTI_CONTRACT(name, ov); \
assert (it != NULL); \
(void) ov; \
type *obj = M_C(name, _ref)(it); \
M_C(name, _unlink)(obj); \
M_C(name, _push_back)(nv, obj); \
ILISTI_CONTRACT(name, nv); \
ILISTI_CONTRACT(name, ov); \
} \ } \
// TODO: splice_back & it_insert // TODO: it_insert
#endif #endif