Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / 1d / 320e3ee0ddf76845579953597c945efab5b1c9
1 Return-Path: <jrollins@finestructure.net>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 6A262431FBD\r
6         for <notmuch@notmuchmail.org>; Wed, 23 May 2012 15:40:49 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -2.3\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id 8VN-o23rXbBH for <notmuch@notmuchmail.org>;\r
16         Wed, 23 May 2012 15:40:48 -0700 (PDT)\r
17 Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
18         [131.215.239.19])\r
19         by olra.theworths.org (Postfix) with ESMTP id B4C55431FB6\r
20         for <notmuch@notmuchmail.org>; Wed, 23 May 2012 15:40:48 -0700 (PDT)\r
21 Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
22         by earth-doxen-postvirus (Postfix) with ESMTP id 6C46066E017C\r
23         for <notmuch@notmuchmail.org>; Wed, 23 May 2012 15:40:48 -0700 (PDT)\r
24 X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new\r
25 Received: from finestructure.net (unknown [137.151.175.56])\r
26         (Authenticated sender: jrollins)\r
27         by earth-doxen-submit (Postfix) with ESMTP id 4B79166E01A5\r
28         for <notmuch@notmuchmail.org>; Wed, 23 May 2012 15:40:46 -0700 (PDT)\r
29 Received: by finestructure.net (Postfix, from userid 1000)\r
30         id 0447E1F1; Wed, 23 May 2012 15:40:46 -0700 (PDT)\r
31 From: Jameson Graef Rollins <jrollins@finestructure.net>\r
32 To: Notmuch Mail <notmuch@notmuchmail.org>\r
33 Subject: [PATCH v4 4/7] cli: modify mime_node_open to take new crypto struct\r
34         as argument\r
35 Date: Wed, 23 May 2012 15:40:40 -0700\r
36 Message-Id: <1337812843-14986-5-git-send-email-jrollins@finestructure.net>\r
37 X-Mailer: git-send-email 1.7.10\r
38 In-Reply-To: <1337812843-14986-4-git-send-email-jrollins@finestructure.net>\r
39 References: <1337812843-14986-1-git-send-email-jrollins@finestructure.net>\r
40         <1337812843-14986-2-git-send-email-jrollins@finestructure.net>\r
41         <1337812843-14986-3-git-send-email-jrollins@finestructure.net>\r
42         <1337812843-14986-4-git-send-email-jrollins@finestructure.net>\r
43 X-BeenThere: notmuch@notmuchmail.org\r
44 X-Mailman-Version: 2.1.13\r
45 Precedence: list\r
46 List-Id: "Use and development of the notmuch mail system."\r
47         <notmuch.notmuchmail.org>\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
51 List-Post: <mailto:notmuch@notmuchmail.org>\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
55 X-List-Received-Date: Wed, 23 May 2012 22:40:49 -0000\r
56 \r
57 This simplifies the interface considerably, getting rid of #ifdefs\r
58 along the way.\r
59 ---\r
60  mime-node.c      |    7 +++----\r
61  notmuch-client.h |   10 +++++-----\r
62  notmuch-reply.c  |    6 ++----\r
63  notmuch-show.c   |    3 +--\r
64  4 files changed, 11 insertions(+), 15 deletions(-)\r
65 \r
66 diff --git a/mime-node.c b/mime-node.c\r
67 index 06fdb70..ba3a01b 100644\r
68 --- a/mime-node.c\r
69 +++ b/mime-node.c\r
70 @@ -57,8 +57,7 @@ _mime_node_context_free (mime_node_context_t *res)\r
71  \r
72  notmuch_status_t\r
73  mime_node_open (const void *ctx, notmuch_message_t *message,\r
74 -               GMimeCryptoContext *cryptoctx,\r
75 -               notmuch_bool_t decrypt, mime_node_t **root_out)\r
76 +               notmuch_crypto_t *crypto, mime_node_t **root_out)\r
77  {\r
78      const char *filename = notmuch_message_get_filename (message);\r
79      mime_node_context_t *mctx;\r
80 @@ -110,8 +109,8 @@ mime_node_open (const void *ctx, notmuch_message_t *message,\r
81         goto DONE;\r
82      }\r
83  \r
84 -    mctx->cryptoctx = cryptoctx;\r
85 -    mctx->decrypt = decrypt;\r
86 +    mctx->cryptoctx = crypto->gpgctx;\r
87 +    mctx->decrypt = crypto->decrypt;\r
88  \r
89      /* Create the root node */\r
90      root->part = GMIME_OBJECT (mctx->mime_message);\r
91 diff --git a/notmuch-client.h b/notmuch-client.h\r
92 index 9f44dc9..8d92d41 100644\r
93 --- a/notmuch-client.h\r
94 +++ b/notmuch-client.h\r
95 @@ -349,9 +349,10 @@ struct mime_node {\r
96  };\r
97  \r
98  /* Construct a new MIME node pointing to the root message part of\r
99 - * message.  If cryptoctx is non-NULL, it will be used to verify\r
100 - * signatures on any child parts.  If decrypt is true, then cryptoctx\r
101 - * will additionally be used to decrypt any encrypted child parts.\r
102 + * message.  If crypto->gpgctx is non-NULL, it will be used to verify\r
103 + * signatures on any child parts.  If crypto->decrypt is true, then\r
104 + * crypto.gpgctx will additionally be used to decrypt any encrypted\r
105 + * child parts.\r
106   *\r
107   * Return value:\r
108   *\r
109 @@ -363,8 +364,7 @@ struct mime_node {\r
110   */\r
111  notmuch_status_t\r
112  mime_node_open (const void *ctx, notmuch_message_t *message,\r
113 -               GMimeCryptoContext *cryptoctx,\r
114 -               notmuch_bool_t decrypt, mime_node_t **node_out);\r
115 +               notmuch_crypto_t *crypto, mime_node_t **node_out);\r
116  \r
117  /* Return a new MIME node for the requested child part of parent.\r
118   * parent will be used as the talloc context for the returned child\r
119 diff --git a/notmuch-reply.c b/notmuch-reply.c\r
120 index 41b18e4..148152c 100644\r
121 --- a/notmuch-reply.c\r
122 +++ b/notmuch-reply.c\r
123 @@ -544,8 +544,7 @@ notmuch_reply_format_default(void *ctx,\r
124         g_object_unref (G_OBJECT (reply));\r
125         reply = NULL;\r
126  \r
127 -       if (mime_node_open (ctx, message, params->crypto.gpgctx, params->crypto.decrypt,\r
128 -                           &root) == NOTMUCH_STATUS_SUCCESS) {\r
129 +       if (mime_node_open (ctx, message, &(params->crypto), &root) == NOTMUCH_STATUS_SUCCESS) {\r
130             format_part_reply (root);\r
131             talloc_free (root);\r
132         }\r
133 @@ -574,8 +573,7 @@ notmuch_reply_format_json(void *ctx,\r
134  \r
135      messages = notmuch_query_search_messages (query);\r
136      message = notmuch_messages_get (messages);\r
137 -    if (mime_node_open (ctx, message, params->crypto.gpgctx, params->crypto.decrypt,\r
138 -                       &node) != NOTMUCH_STATUS_SUCCESS)\r
139 +    if (mime_node_open (ctx, message, &(params->crypto), &node) != NOTMUCH_STATUS_SUCCESS)\r
140         return 1;\r
141  \r
142      reply = create_reply_message (ctx, config, message, reply_all);\r
143 diff --git a/notmuch-show.c b/notmuch-show.c\r
144 index cc509a6..fb5e9b6 100644\r
145 --- a/notmuch-show.c\r
146 +++ b/notmuch-show.c\r
147 @@ -810,8 +810,7 @@ show_message (void *ctx,\r
148      mime_node_t *root, *part;\r
149      notmuch_status_t status;\r
150  \r
151 -    status = mime_node_open (local, message, params->crypto.gpgctx,\r
152 -                            params->crypto.decrypt, &root);\r
153 +    status = mime_node_open (local, message, &(params->crypto), &root);\r
154      if (status)\r
155         goto DONE;\r
156      part = mime_node_seek_dfs (root, (params->part < 0 ? 0 : params->part));\r
157 -- \r
158 1.7.10\r
159 \r