From owner-freebsd-arch Thu Jan 4 15:44:17 2001 From owner-freebsd-arch@FreeBSD.ORG Thu Jan 4 15:44:15 2001 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id D14AE37B400 for ; Thu, 4 Jan 2001 15:44:15 -0800 (PST) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id f04Ni4B13059; Thu, 4 Jan 2001 15:44:04 -0800 (PST) Date: Thu, 4 Jan 2001 15:44:04 -0800 From: Alfred Perlstein To: Tony Finch Cc: arch@FreeBSD.ORG Subject: Re: Reinstatement of CIRCLEQ Message-ID: <20010104154404.F292@fw.wintelcom.net> References: <20010104001943.T292@fw.wintelcom.net> <200101041708.JAA05731@beastie.mckusick.com> <20010104222519.Y2140@hand.dotat.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010104222519.Y2140@hand.dotat.at>; from dot@dotat.at on Thu, Jan 04, 2001 at 10:25:19PM +0000 Sender: bright@fw.wintelcom.net Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Tony Finch [010104 14:25] wrote: > Kirk McKusick wrote: > > From: Alfred Perlstein > > > > You're right, I'm wondering though, would it be possible > > to change TAILQ_PREV(elm, headname, field) to TAILQ_PREV(elm, > > field) by using the offset of 'field' into the struct? > > You could subtract the offset of 'field' from the tqe_prev > > of the next struct right? > > > >You are correct that your suggested change is exactly the > >unportability/headache that I am trying to avoid. > > The Apache Group needed a linked list structure that would allow > insertions before and after a given element without knowing the > address of the list header. Although I wanted to use sys/queue.h it > didn't quite have that functionality so I wrote some "ring" macros > based on code by Dean Gaudet. Why not just use "LIST" then? -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message