From: Michael Roth Date: Tue, 19 Jul 2011 19:50:30 +0000 (-0500) Subject: qlist: add qlist_first()/qlist_next() X-Git-Tag: TizenStudio_2.0_p2.3.2~208^2~5636^2~4^2~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=54d83804a1f69e932e014842e7e7a4744334123d;p=sdk%2Femulator%2Fqemu.git qlist: add qlist_first()/qlist_next() Signed-off-by: Michael Roth Signed-off-by: Luiz Capitulino --- diff --git a/qlist.h b/qlist.h index dbe7b92..d426bd4 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 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 */