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.0 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 C52B71F461 for ; Tue, 14 May 2019 19:50:35 +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:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=WKP05nRWK7HPYq3q jWrUXB8QVrjHivDaYcvnmTprwSPtu5itBplUm9HYqJVbVhIL/COgaw5hRg2nRPhI sB4chKQIzsTPnEAJcgLoG1wNL5x2hL66cZbidtM2mqvWkJcDydZzWlrLQ+6zxCh/ tMsutqqZ25yDfTEXZET0W+dCV4Y= 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:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=1Mq2db+b3nVx3GgJo/XR8w xCFfs=; b=FAiDEt24lVCV/8LCNpO/H6oH9T/2bOh2kKawBZxNo9F2nus1vrmy4a H1HTF4lgXa5kDQwqtKVdXeDc1b3eKTiRZgOnzRcP8ZGOuzwA567C3Qs6fe7RQZpB XDUTrLMzPHcfSmFVnp3orlmlCLz3zKUmZjaRGVrFwIDSXyoVjj5ZI= Received: (qmail 2301 invoked by alias); 14 May 2019 19:50:33 -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 2289 invoked by uid 89); 14 May 2019 19:50:33 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mail-vs1-f44.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Kuy41ybccgBpRDm8tAtY5McI6J9vkWxrJgV65bt/WxE=; b=PpCIXVYC8NZJV47IPmyvCghUQb+VJpU9w7bZ2blsbDLAvtz6aQKdkl874q/3mIsAjt 59TZuWpx8qmIaYoWTJ4aS94LHNXt4NJRRkmHJkqlI8VsfIUVu9IHQPbW1xJ410ozSHTf bYIBL2fk/SOvnSSg/gX+ySdJEqPznqUAqPkmlqFV621MkYmb/VqVOAllI7AorviOvf0A gLtzoLKJG30SGelLBm4ygzbmd5Y2DfCWouIYAGB3vUXTyDcpOQ+kRD2bZ5zthx6Q9Sjr U0rUMf7R24EVCSnduFqBnIGN6Uc67CD+Fvb7I0Qo6iRWwyqY5KmCxSChiWPqzIdzERto MV6w== Subject: Re: I'm unhappy about twalk_r To: libc-alpha@sourceware.org References: From: Adhemerval Zanella Openpgp: preference=signencrypt Message-ID: <582d5a19-a3db-ee35-d041-16f3d749afa0@linaro.org> Date: Tue, 14 May 2019 16:50:27 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 14/05/2019 15:22, DJ Delorie wrote: > > 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. > So should we still provide a twalk_r or aim to just add a more sane interface and work with POSIX to promote it?