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 25F74431FAF
\r
6 for <notmuch@notmuchmail.org>; Wed, 23 May 2012 15:40:51 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\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 R8Na3iaDkc-G for <notmuch@notmuchmail.org>;
\r
16 Wed, 23 May 2012 15:40:50 -0700 (PDT)
\r
17 Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu
\r
19 by olra.theworths.org (Postfix) with ESMTP id 6A6E4431FBC
\r
20 for <notmuch@notmuchmail.org>; Wed, 23 May 2012 15:40:50 -0700 (PDT)
\r
21 Received: from fire-doxen.imss.caltech.edu (localhost [127.0.0.1])
\r
22 by fire-doxen-postvirus (Postfix) with ESMTP id 1332A328043
\r
23 for <notmuch@notmuchmail.org>; Wed, 23 May 2012 15:40:48 -0700 (PDT)
\r
24 X-Spam-Scanned: at Caltech-IMSS on fire-doxen by amavisd-new
\r
25 Received: from finestructure.net (unknown [137.151.175.56])
\r
26 (Authenticated sender: jrollins)
\r
27 by fire-doxen-submit (Postfix) with ESMTP id 45C4E32807F
\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 F0629E3; Wed, 23 May 2012 15:40:45 -0700 (PDT)
\r
31 From: Jameson Graef Rollins <jrollins@finestructure.net>
\r
32 To: Notmuch Mail <notmuch@notmuchmail.org>
\r
33 Subject: [PATCH v4 1/7] cli: use typedef to deal with gmime 2.4/2.6
\r
35 Date: Wed, 23 May 2012 15:40:37 -0700
\r
36 Message-Id: <1337812843-14986-2-git-send-email-jrollins@finestructure.net>
\r
37 X-Mailer: git-send-email 1.7.10
\r
38 In-Reply-To: <1337812843-14986-1-git-send-email-jrollins@finestructure.net>
\r
39 References: <1337812843-14986-1-git-send-email-jrollins@finestructure.net>
\r
40 X-BeenThere: notmuch@notmuchmail.org
\r
41 X-Mailman-Version: 2.1.13
\r
43 List-Id: "Use and development of the notmuch mail system."
\r
44 <notmuch.notmuchmail.org>
\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
46 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
48 List-Post: <mailto:notmuch@notmuchmail.org>
\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
51 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
52 X-List-Received-Date: Wed, 23 May 2012 22:40:51 -0000
\r
54 gmime 2.4 defines GMimeCipherContext, while 2.6 defines
\r
55 GMimeCryptoContext. We can use a typedef to cover this discrepancy
\r
56 and remove a bunch of #ifdefs.
\r
58 mime-node.c | 8 --------
\r
59 notmuch-client.h | 10 ++--------
\r
60 2 files changed, 2 insertions(+), 16 deletions(-)
\r
62 diff --git a/mime-node.c b/mime-node.c
\r
63 index a95bdab..06fdb70 100644
\r
66 @@ -33,11 +33,7 @@ typedef struct mime_node_context {
\r
67 GMimeMessage *mime_message;
\r
69 /* Context provided by the caller. */
\r
70 -#ifdef GMIME_ATLEAST_26
\r
71 GMimeCryptoContext *cryptoctx;
\r
73 - GMimeCipherContext *cryptoctx;
\r
75 notmuch_bool_t decrypt;
\r
76 } mime_node_context_t;
\r
78 @@ -61,11 +57,7 @@ _mime_node_context_free (mime_node_context_t *res)
\r
81 mime_node_open (const void *ctx, notmuch_message_t *message,
\r
82 -#ifdef GMIME_ATLEAST_26
\r
83 GMimeCryptoContext *cryptoctx,
\r
85 - GMimeCipherContext *cryptoctx,
\r
87 notmuch_bool_t decrypt, mime_node_t **root_out)
\r
89 const char *filename = notmuch_message_get_filename (message);
\r
90 diff --git a/notmuch-client.h b/notmuch-client.h
\r
91 index 19b7f01..337409f 100644
\r
92 --- a/notmuch-client.h
\r
93 +++ b/notmuch-client.h
\r
95 * these to check the version number. */
\r
96 #ifdef GMIME_MAJOR_VERSION
\r
97 #define GMIME_ATLEAST_26
\r
99 +typedef GMimeCipherContext GMimeCryptoContext;
\r
102 #include "notmuch.h"
\r
103 @@ -79,11 +81,7 @@ typedef struct notmuch_show_params {
\r
104 notmuch_bool_t omit_excluded;
\r
105 notmuch_bool_t raw;
\r
107 -#ifdef GMIME_ATLEAST_26
\r
108 GMimeCryptoContext* cryptoctx;
\r
110 - GMimeCipherContext* cryptoctx;
\r
112 notmuch_bool_t decrypt;
\r
113 } notmuch_show_params_t;
\r
115 @@ -355,11 +353,7 @@ struct mime_node {
\r
118 mime_node_open (const void *ctx, notmuch_message_t *message,
\r
119 -#ifdef GMIME_ATLEAST_26
\r
120 GMimeCryptoContext *cryptoctx,
\r
122 - GMimeCipherContext *cryptoctx,
\r
124 notmuch_bool_t decrypt, mime_node_t **node_out);
\r
126 /* Return a new MIME node for the requested child part of parent.
\r