From patchwork Thu Jul 21 20:00:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 106145 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 23C9FB6F62 for ; Fri, 22 Jul 2011 06:03:55 +1000 (EST) Received: from localhost ([::1]:38548 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjzTE-0003JJ-5U for incoming@patchwork.ozlabs.org; Thu, 21 Jul 2011 16:03:44 -0400 Received: from eggs.gnu.org ([140.186.70.92]:39572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjzSz-00034K-0Q for qemu-devel@nongnu.org; Thu, 21 Jul 2011 16:03:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QjzSx-00019u-IZ for qemu-devel@nongnu.org; Thu, 21 Jul 2011 16:03:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11971) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjzSx-00019p-5Y for qemu-devel@nongnu.org; Thu, 21 Jul 2011 16:03:27 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6LK3OEn003586 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 21 Jul 2011 16:03:24 -0400 Received: from localhost (ovpn-113-126.phx2.redhat.com [10.3.113.126]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p6LK3NLS012717; Thu, 21 Jul 2011 16:03:24 -0400 From: Luiz Capitulino To: aliguori@us.ibm.com Date: Thu, 21 Jul 2011 17:00:54 -0300 Message-Id: <1311278474-24336-6-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1311278474-24336-1-git-send-email-lcapitulino@redhat.com> References: <1311278474-24336-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Luiz Capitulino , qemu-devel@nongnu.org, Michael Roth Subject: [Qemu-devel] [PATCH 05/25] 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 From: Michael Roth Signed-off-by: Michael Roth Signed-off-by: Luiz Capitulino --- 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 */