root / qlist.h @ 658788c5
History | View | Annotate | Download (1014 Bytes)
1 | a6fd08eb | Luiz Capitulino | /*
|
---|---|---|---|
2 | a6fd08eb | Luiz Capitulino | * QList data type header.
|
3 | a6fd08eb | Luiz Capitulino | *
|
4 | a6fd08eb | Luiz Capitulino | * Copyright (C) 2009 Red Hat Inc.
|
5 | a6fd08eb | Luiz Capitulino | *
|
6 | a6fd08eb | Luiz Capitulino | * Authors:
|
7 | a6fd08eb | Luiz Capitulino | * Luiz Capitulino <lcapitulino@redhat.com>
|
8 | a6fd08eb | Luiz Capitulino | *
|
9 | a6fd08eb | Luiz Capitulino | * This work is licensed under the terms of the GNU GPL, version 2. See
|
10 | a6fd08eb | Luiz Capitulino | * the COPYING file in the top-level directory.
|
11 | a6fd08eb | Luiz Capitulino | */
|
12 | a6fd08eb | Luiz Capitulino | #ifndef QLIST_H
|
13 | a6fd08eb | Luiz Capitulino | #define QLIST_H
|
14 | a6fd08eb | Luiz Capitulino | |
15 | a6fd08eb | Luiz Capitulino | #include "qobject.h" |
16 | a6fd08eb | Luiz Capitulino | #include "qemu-queue.h" |
17 | a6fd08eb | Luiz Capitulino | #include "qemu-common.h" |
18 | a6fd08eb | Luiz Capitulino | |
19 | a6fd08eb | Luiz Capitulino | typedef struct QListEntry { |
20 | a6fd08eb | Luiz Capitulino | QObject *value; |
21 | a6fd08eb | Luiz Capitulino | QTAILQ_ENTRY(QListEntry) next; |
22 | a6fd08eb | Luiz Capitulino | } QListEntry; |
23 | a6fd08eb | Luiz Capitulino | |
24 | a6fd08eb | Luiz Capitulino | typedef struct QList { |
25 | a6fd08eb | Luiz Capitulino | QObject_HEAD; |
26 | a6fd08eb | Luiz Capitulino | QTAILQ_HEAD(,QListEntry) head; |
27 | a6fd08eb | Luiz Capitulino | } QList; |
28 | a6fd08eb | Luiz Capitulino | |
29 | a6fd08eb | Luiz Capitulino | #define qlist_append(qlist, obj) \
|
30 | a6fd08eb | Luiz Capitulino | qlist_append_obj(qlist, QOBJECT(obj)) |
31 | a6fd08eb | Luiz Capitulino | |
32 | a6fd08eb | Luiz Capitulino | QList *qlist_new(void);
|
33 | 033815fe | Anthony Liguori | QList *qlist_copy(QList *src); |
34 | a6fd08eb | Luiz Capitulino | void qlist_append_obj(QList *qlist, QObject *obj);
|
35 | a6fd08eb | Luiz Capitulino | void qlist_iter(const QList *qlist, |
36 | a6fd08eb | Luiz Capitulino | void (*iter)(QObject *obj, void *opaque), void *opaque); |
37 | 033815fe | Anthony Liguori | QObject *qlist_pop(QList *qlist); |
38 | 033815fe | Anthony Liguori | QObject *qlist_peek(QList *qlist); |
39 | 033815fe | Anthony Liguori | int qlist_empty(const QList *qlist); |
40 | a6fd08eb | Luiz Capitulino | QList *qobject_to_qlist(const QObject *obj);
|
41 | a6fd08eb | Luiz Capitulino | |
42 | a6fd08eb | Luiz Capitulino | #endif /* QLIST_H */ |