From patchwork Tue Jul 19 19:50:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 105539 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 69FDDB6F68 for ; Wed, 20 Jul 2011 06:52:31 +1000 (EST) Received: from localhost ([::1]:48096 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjHHF-0004Rw-Eb for incoming@patchwork.ozlabs.org; Tue, 19 Jul 2011 16:52:25 -0400 Received: from eggs.gnu.org ([140.186.70.92]:35210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjGPC-0007Kp-P6 for qemu-devel@nongnu.org; Tue, 19 Jul 2011 15:56:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QjGP9-0007PD-Uo for qemu-devel@nongnu.org; Tue, 19 Jul 2011 15:56:34 -0400 Received: from mout.perfora.net ([74.208.4.194]:53083) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjGP9-0007P8-J3 for qemu-devel@nongnu.org; Tue, 19 Jul 2011 15:56:31 -0400 Received: from localhost.localdomain ([32.97.110.59]) by mrelay.perfora.net (node=mrus2) with ESMTP (Nemesis) id 0MYwFH-1QwebK2bvX-00Vos0; Tue, 19 Jul 2011 15:51:12 -0400 From: Michael Roth To: qemu-devel@nongnu.org Date: Tue, 19 Jul 2011 14:50:30 -0500 Message-Id: <1311105046-29458-3-git-send-email-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1311105046-29458-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1311105046-29458-1-git-send-email-mdroth@linux.vnet.ibm.com> X-Provags-ID: V02:K0:Cb7FWzCRRHz9OvIo6G0bv12vOsQY3QwmleF/dJ5VxG3 TV67cp3jJmVZh3/oh9B8wfRNwvrng70xo6iUQqSDcvbPJEowP6 SZ0ah+xADX3kKlmGLTbd6G+yRw2fDEHnhysW8JxBQLKHIIvA5Z c3PyynGW6Ea90yXDTPJTrM/OZuh8MSwmTS1iYaKbGJCaOX0XYM b5aALMTPI05b53Kni/fbNi/pOfC/tCPpSdaKU+9hPw= 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 v7 02/18] 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 */