aboutsummaryrefslogtreecommitdiff
path: root/qlist.h
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2009-11-11 10:48:51 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2009-11-17 08:49:38 -0600
commit033815fe14e9e6254f1483113a6dd6d5b130ef58 (patch)
treeff265c330560540c6ce6b3386b5ac21989ef08f5 /qlist.h
parentc99ca93142391a2461afbe07926fa50f1c8f4d9a (diff)
Add operations to qlist to allow it to be used as a stack
This makes lists no longer invariant. It's a very useful bit of functionality though. To deal with the fact that lists are no longer invariant, introduce a deep copy mechanism for lists. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'qlist.h')
-rw-r--r--qlist.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/qlist.h b/qlist.h
index 3eb1eb83b2..afdc4465bf 100644
--- a/qlist.h
+++ b/qlist.h
@@ -30,9 +30,13 @@ typedef struct QList {
qlist_append_obj(qlist, QOBJECT(obj))
QList *qlist_new(void);
+QList *qlist_copy(QList *src);
void qlist_append_obj(QList *qlist, QObject *obj);
void qlist_iter(const QList *qlist,
void (*iter)(QObject *obj, void *opaque), void *opaque);
+QObject *qlist_pop(QList *qlist);
+QObject *qlist_peek(QList *qlist);
+int qlist_empty(const QList *qlist);
QList *qobject_to_qlist(const QObject *obj);
#endif /* QLIST_H */