qlist: add qlist_first()/qlist_next()
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
This commit is contained in:
parent
e18df14185
commit
54d83804a1
11
qlist.h
11
qlist.h
|
@ -16,6 +16,7 @@
|
||||||
#include "qobject.h"
|
#include "qobject.h"
|
||||||
#include "qemu-queue.h"
|
#include "qemu-queue.h"
|
||||||
#include "qemu-common.h"
|
#include "qemu-common.h"
|
||||||
|
#include "qemu-queue.h"
|
||||||
|
|
||||||
typedef struct QListEntry {
|
typedef struct QListEntry {
|
||||||
QObject *value;
|
QObject *value;
|
||||||
|
@ -50,4 +51,14 @@ QObject *qlist_peek(QList *qlist);
|
||||||
int qlist_empty(const QList *qlist);
|
int qlist_empty(const QList *qlist);
|
||||||
QList *qobject_to_qlist(const QObject *obj);
|
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 */
|
#endif /* QLIST_H */
|
||||||
|
|
Reference in New Issue