Re: [PATCH v4 02/16] Move crypto.c into libutil
authorDavid Bremner <david@tethera.net>
Sat, 13 Aug 2016 08:27:17 +0000 (17:27 +0900)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 23:22:24 +0000 (16:22 -0700)
00/f4a36759edacd2fae1c01b0a5b007cee1a1414 [new file with mode: 0644]

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