From 0bb60e51e2fbf29c3270d412453c3cccf2c67782 Mon Sep 17 00:00:00 2001 From: Michael Roth Date: Mon, 5 Mar 2012 17:43:44 -0500 Subject: [PATCH 17/98] qlist: add qlist_first()/qlist_next() Signed-off-by: Michael Roth Signed-off-by: Luiz Capitulino (cherry picked from commit 54d83804a1f69e932e014842e7e7a4744334123d) Signed-off-by: Jeff Cody Signed-off-by: Michal Novotny --- qlist.h | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/qlist.h b/qlist.h index a3261e1..cef5ea0 100644 --- a/qlist.h +++ b/qlist.h @@ -15,6 +15,7 @@ #include "qobject.h" #include "qemu-queue.h" #include "qemu-common.h" +#include "qemu-queue.h" typedef struct QListEntry { QObject *value; @@ -49,4 +50,14 @@ QObject *qlist_peek(QList *qlist); int qlist_empty(const QList *qlist); QList *qobject_to_qlist(const QObject *obj); +static inline const QListEntry *qlist_first(const QList *qlist) +{ + return QTAILQ_FIRST(&qlist->head); +} + +static inline const QListEntry *qlist_next(const QListEntry *entry) +{ + return QTAILQ_NEXT(entry, next); +} + #endif /* QLIST_H */ -- 1.7.7.6