From owner-cvs-all Thu Apr 27 18:57:59 2000 Delivered-To: cvs-all@freebsd.org Received: from io.yi.org (24.67.218.186.bc.wave.home.com [24.67.218.186]) by hub.freebsd.org (Postfix) with ESMTP id 6430537BCC9; Thu, 27 Apr 2000 18:57:53 -0700 (PDT) (envelope-from jburkhol@home.com) Received: from io.yi.org (localhost.gvcl1.bc.wave.home.com [127.0.0.1]) by io.yi.org (Postfix) with ESMTP id A7AD0BCA7; Thu, 27 Apr 2000 18:57:54 -0700 (PDT) X-Mailer: exmh version 2.1.1 10/15/1999 To: Archie Cobbs Cc: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, jake@io.yi.org Subject: Re: cvs commit: src/sys/sys queue.h In-Reply-To: Message from Archie Cobbs of "Thu, 27 Apr 2000 15:50:13 PDT." <200004272250.PAA26982@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 27 Apr 2000 18:57:54 -0700 From: Jake Burkholder Message-Id: <20000428015754.A7AD0BCA7@io.yi.org> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > archie 2000/04/27 15:50:13 PDT > > Modified files: > sys/sys queue.h > Log: > Add a new macro CIRCLEQ_FOREACH_REVERSE for traversing through a > circle queue in the reverse direction (from tail to head). > > Revision Changes Path > 1.34 +6 -1 src/sys/sys/queue.h Any reason not to do the same for TAILQ? I think the following works: for (var = TAILQ_LAST(head, headname); var; var = TAILQ_PREV(elm, headname, field)) Also, how about something like FOOQ_FOREACH_COND(var, head, field, cond)? i.e. for (var = FOOQ_FIRST(head); var && cond; var = FOOQ_NEXT(var, field)) When I was cleaning up the files in sys/kern to use the macros more consistently I noticed a lot of places that traverse lists but can't use the FOREACH because there's another condition in the loop. Jake To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message