From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 6B6EA1F461 for ; Tue, 14 May 2019 18:22:26 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:in-reply-to:date:message-id :mime-version:content-type; q=dns; s=default; b=BnrjHzrVQsixss74 i76E52CleZYycjoMw2VkQL8M4nX41gU8bRLV64ptlcqxKF1ZLnvkGMwL5Th+3bkT Izy7qzWE1cfY/o5zdHIuRIk6lNKiAT2wTdUbHK4E29JwXMI2o/BKOyJqtAczYhKn BbjFW5dCoSk4bj8SQojpyvf33A4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:in-reply-to:date:message-id :mime-version:content-type; s=default; bh=flo3ThcjLKK4ytZmh+T300 zcM+A=; b=Ogf9We2utk9YbzhPvMt0JBzxY8Ci8GraAASUMQJknjkKQA0WYaLJRf txTtkU87GbzPMPpPh2nb3hbUAThBe7dgeEXMAoBx4rGZyB0nWShHFJDG69spyDdJ ogPsQEEd7tiiReO/lj2wrujDqkO9ULOmORTqR/ItdX42BKQ6PWl8s= Received: (qmail 130828 invoked by alias); 14 May 2019 18:22:23 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 130819 invoked by uid 89); 14 May 2019 18:22:23 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mx1.redhat.com From: DJ Delorie To: Florian Weimer Cc: libc-alpha@sourceware.org Subject: Re: I'm unhappy about twalk_r In-Reply-To: <874l5x44tb.fsf@oldenburg2.str.redhat.com> (message from Florian Weimer on Tue, 14 May 2019 14:08:00 +0200) Date: Tue, 14 May 2019 14:22:18 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Florian Weimer writes: > Exposing this information using the VISIT argument seems wrong to me. I agree. It would be more useful if the binary-ness of the tree were *more* exposed, so the user could take advatage of the walk-order, but we don't expose it. > I think this is much more useful: It avoids pointless repeated calls to > ACTION, and it allows premature termination of the iteration. twalk() is defined by POSIX. If we have a *_r version of it, it should conform to the POSIX definition as closely as we can, despite these inefficiencies. Perhaps we could add a twalk_find_r() function that does something between twalk and tfind? Or twalk_sorted_r()? Or something else not called twalk_r()? Of course, that assumes that we have a need for a walk-no-find function that isn't already solved by either twalk or tfind.