[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2][ 02/21] qlist: add qlist_first()/qlist_next()
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH v2][ 02/21] qlist: add qlist_first()/qlist_next() |
Date: |
Fri, 3 Jun 2011 17:33:00 -0500 |
Signed-off-by: Michael Roth <address@hidden>
---
qlist.h | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/qlist.h b/qlist.h
index dbe7b92..cd2d23e 100644
--- a/qlist.h
+++ b/qlist.h
@@ -16,6 +16,7 @@
#include "qobject.h"
#include "qemu-queue.h"
#include "qemu-common.h"
+#include "qemu-queue.h"
typedef struct QListEntry {
QObject *value;
@@ -50,4 +51,14 @@ QObject *qlist_peek(QList *qlist);
int qlist_empty(const QList *qlist);
QList *qobject_to_qlist(const QObject *obj);
+static inline QListEntry *qlist_first(QList *qlist)
+{
+ return QTAILQ_FIRST(&qlist->head);
+}
+
+static inline QListEntry *qlist_next(QListEntry *entry)
+{
+ return QTAILQ_NEXT(entry, next);
+}
+
#endif /* QLIST_H */
--
1.7.0.4
- [Qemu-devel] [QAPI+QGA 2/3] QAPI code generation infrastructure v2, Michael Roth, 2011/06/03
- [Qemu-devel] [PATCH v2][ 01/21] Add hard build dependency on glib, Michael Roth, 2011/06/03
- [Qemu-devel] [PATCH v2][ 02/21] qlist: add qlist_first()/qlist_next(),
Michael Roth <=
- [Qemu-devel] [PATCH v2][ 03/21] qapi: add module init types for qapi, Michael Roth, 2011/06/03
- [Qemu-devel] [PATCH v2][ 04/21] qapi: add ordereddict/qapi.py helper libraries, Michael Roth, 2011/06/03
- [Qemu-devel] [PATCH v2][ 05/21] qapi: add qapi-types.py code generator, Michael Roth, 2011/06/03
- Re: [Qemu-devel] [PATCH v2][ 05/21] qapi: add qapi-types.py code generator, Luiz Capitulino, 2011/06/09