chiark / gitweb /
resolved: fix notification iteration logic when transactions are completed
[elogind.git] / src / basic / set.h
index f8e86478cb83b905b8e26f4bd744114c95c325b7..170f0c44692296bb22d5b90fce9c9744d8c1b0cd 100644 (file)
@@ -130,6 +130,9 @@ int set_put_strdupv(Set *s, char **l);
 #define SET_FOREACH(e, s, i) \
         for ((i) = ITERATOR_FIRST; set_iterate((s), &(i), (void**)&(e)); )
 
+#define SET_FOREACH_MOVE(e, d, s)                                       \
+        for (; ({ e = set_first(s); assert_se(!e || set_move_one(d, s, e) >= 0); e; }); )
+
 DEFINE_TRIVIAL_CLEANUP_FUNC(Set*, set_free);
 DEFINE_TRIVIAL_CLEANUP_FUNC(Set*, set_free_free);