From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 5B2076DE35D3 for ; Sat, 13 Aug 2016 01:30:15 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.007 X-Spam-Level: X-Spam-Status: No, score=-0.007 tagged_above=-999 required=5 tests=[AWL=0.004, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7FETDSsmjqZD for ; Sat, 13 Aug 2016 01:30:07 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 8A7886DE1914 for ; Sat, 13 Aug 2016 01:27:29 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1bYUI4-0000iM-Sz; Sat, 13 Aug 2016 04:27:36 -0400 Received: (nullmailer pid 25690 invoked by uid 1000); Sat, 13 Aug 2016 08:27:17 -0000 From: David Bremner To: Tomi Ollila , Daniel Kahn Gillmor , Notmuch Mail Subject: Re: [PATCH v4 02/16] Move crypto.c into libutil In-Reply-To: References: <1467970047-8013-1-git-send-email-dkg@fifthhorseman.net> <1467970047-8013-3-git-send-email-dkg@fifthhorseman.net> <874m6qqznr.fsf@maritornes.cs.unb.ca> User-Agent: Notmuch/0.22.1+61~g2ce0f13 (https://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Sat, 13 Aug 2016 17:27:17 +0900 Message-ID: <87h9ap5b16.fsf@maritornes.cs.unb.ca> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2016 08:30:15 -0000 Tomi Ollila writes: > On Fri, Aug 12 2016, David Bremner wrote: > >> Daniel Kahn Gillmor writes: >>> +++ b/util/crypto.c >>> @@ -0,0 +1,138 @@ >> >>> +#include "notmuch.h" >> >> It feels wrong to me for a file in util/ to include notmuch.h. It seems >> the same situation holds with search-path.h. There it seems we use >> notmuch_bool_t (although I'm not convinced that's the right return >> type). If that's the only reason maybe we should either factor out the >> definition or just return ints. > > util/search-path.c is easy, change to int or bool (and include stdbool.h, > as parse-time-string.c does) > > util/crypto.c is harder. it uses many more \bnotmuch_.* types. perhaps this > could be moved to lib/ instead ? I guess the issue is we don't want to export these functions as ppart of the API, but we do want to use them in the CLI. I _thought_ that util/crypto.c only (or mainly) used _notmuch_crypto_t, which is defined in crypto.h. Given the various constraints, I think that is probably OK. Some kind of purism about naming things in util/ might suggest they not be called notmuch, but that is probably silly (although I admit I had that thought). d