Re: [PATCH v4 02/16] Move crypto.c into libutil

Subject: Re: [PATCH v4 02/16] Move crypto.c into libutil

Date: Sat, 13 Aug 2016 17:27:17 +0900

To: Tomi Ollila, Daniel Kahn Gillmor, Notmuch Mail

Cc:

From: David Bremner


Tomi Ollila <tomi.ollila@iki.fi> writes:

> On Fri, Aug 12 2016, David Bremner <david@tethera.net> wrote:
>
>> Daniel Kahn Gillmor <dkg@fifthhorseman.net> 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

Thread: