From patchwork Tue Jun 14 02:31:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 100229 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 29B6CB6F9D for ; Tue, 14 Jun 2011 12:35:51 +1000 (EST) Received: from localhost ([::1]:54755 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWJTn-0005ON-Do for incoming@patchwork.ozlabs.org; Mon, 13 Jun 2011 22:35:47 -0400 Received: from eggs.gnu.org ([140.186.70.92]:52127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWJQO-0005Nu-3c for qemu-devel@nongnu.org; Mon, 13 Jun 2011 22:32:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QWJQM-0005vw-FK for qemu-devel@nongnu.org; Mon, 13 Jun 2011 22:32:15 -0400 Received: from mout.perfora.net ([74.208.4.194]:60895) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWJQM-0005vr-5r for qemu-devel@nongnu.org; Mon, 13 Jun 2011 22:32:14 -0400 Received: from localhost.localdomain ([32.97.110.59]) by mrelay.perfora.net (node=mrus0) with ESMTP (Nemesis) id 0MEGcy-1QLM7y1Nai-00GHlQ; Mon, 13 Jun 2011 22:32:13 -0400 From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 13 Jun 2011 21:31:07 -0500 Message-Id: <1308018686-8235-3-git-send-email-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1308018686-8235-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1308018686-8235-1-git-send-email-mdroth@linux.vnet.ibm.com> X-Provags-ID: V02:K0:uenKEPACTs/vCGNJHxKYQRUM8lW3PfZdPK3F+HZ/gX1 kaDMQwPt3Cll3ULe6SviajMcTo5zxe5qHfzC0tYQ1UJENWROVH 9xavDoe5NnvbrK8kVI0rus0S4H5nJubwSiVEIvdXUYUxoubLbp 0JPyBaM34mQflkqigRjs+eAes0WJuUDGNqQEgiGBCIjPgX/oDO dBGc2AQP8tuO/dkgPnry7TlACLDluEHsOSszHRpIdQ= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.208.4.194 Cc: aliguori@linux.vnet.ibm.com, Jes.Sorensen@redhat.com, agl@linux.vnet.ibm.com, mdroth@linux.vnet.ibm.com, lcapitulino@redhat.com Subject: [Qemu-devel] [PATCH v3 02/21] qlist: add qlist_first()/qlist_next() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Michael Roth --- qlist.h | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) 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 */