From owner-cvs-all Thu Jan 3 3:42:20 2002 Delivered-To: cvs-all@freebsd.org Received: from mailhub.fokus.gmd.de (mailhub.fokus.gmd.de [193.174.154.14]) by hub.freebsd.org (Postfix) with ESMTP id 33FFE37B41C; Thu, 3 Jan 2002 03:42:11 -0800 (PST) Received: from beagle (beagle [193.175.132.100]) by mailhub.fokus.gmd.de (8.11.6/8.11.6) with ESMTP id g03Bg2h17640; Thu, 3 Jan 2002 12:42:02 +0100 (MET) Date: Thu, 3 Jan 2002 12:42:02 +0100 (CET) From: Harti Brandt To: Poul-Henning Kamp Cc: Julian Elischer , Stephen McKay , John Baldwin , , , Julian Elischer , Greg Lehey Subject: Re: cvs commit: src/share/man/man3 queue.3 In-Reply-To: <951.1010057694@critter.freebsd.dk> Message-ID: <20020103124044.C7957-100000@beagle.fokus.gmd.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, 3 Jan 2002, Poul-Henning Kamp wrote: PK>In message , Ju PK>lian Elischer writes: PK> PK>>> >how about explicitly detailing that it's NULL at the end? PK>>> >Doesn't that also work? PK>>> PK>>> I don't think we should document that. PK>>> PK>>> There are types of lists/queues which doesn't naturally end with PK>>> that condition. That is why we have the FOO_EMPTY() clause, although PK>>> people tend to also rely on PK>>> PK>>> if (FOO_FIRST(...) == NULL) PK>>> /* nothing to do */ PK>> PK>>Since TAILQ_FIRST== NULL is a termination (it's empty) PK>>condition (as is TAILQ_NEXT() == NULL) PK>>it makes PERFECT sense that a completed set of iterations ends up PK>>with the pointer being NULL. PK> PK>If for instance we (re)introduce CIRCLEQ or certain other queue PK>types, it is by no means obvious that the continuation clause PK>of the FOREACH() will be "!= NULL". That means, that the "== NULL" should be documented exactly for those queue types for which this is true. harti -- harti brandt, http://www.fokus.gmd.de/research/cc/cats/employees/hartmut.brandt/private brandt@fokus.fhg.de To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message