Adds macro QTAILQ_FOREACH_CONTINUE to support incremental list traversal. Signed-off-by: Lluís Vilanova <vilan...@ac.upc.edu> --- include/qemu/queue.h | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/include/qemu/queue.h b/include/qemu/queue.h index c2b6c81..4d57166 100644 --- a/include/qemu/queue.h +++ b/include/qemu/queue.h @@ -414,6 +414,11 @@ struct { \ (var); \ (var) = ((var)->field.tqe_next)) +#define QTAILQ_FOREACH_CONTINUE(var, field) \ + for ((var) = ((var)->field.tqe_next); \ + (var); \ + (var) = ((var)->field.tqe_next)) + #define QTAILQ_FOREACH_SAFE(var, head, field, next_var) \ for ((var) = ((head)->tqh_first); \ (var) && ((next_var) = ((var)->field.tqe_next), 1); \