1 Return-Path: <tomi.ollila@iki.fi>
\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 CAFE3431FBC
\r
6 for <notmuch@notmuchmail.org>; Fri, 25 May 2012 11:14:39 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\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 x4FxynFFTFVq for <notmuch@notmuchmail.org>;
\r
16 Fri, 25 May 2012 11:14:38 -0700 (PDT)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 84D49431FB6
\r
19 for <notmuch@notmuchmail.org>; Fri, 25 May 2012 11:14:38 -0700 (PDT)
\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)
\r
21 id 23D04100641; Fri, 25 May 2012 21:14:49 +0300 (EEST)
\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
23 To: Jameson Graef Rollins <jrollins@finestructure.net>,
\r
24 Austin Clements <amdragon@MIT.EDU>
\r
25 Subject: Re: [PATCH v4 1/7] cli: use typedef to deal with gmime 2.4/2.6
\r
27 In-Reply-To: <87wr40s1n4.fsf@servo.finestructure.net>
\r
28 References: <1337812843-14986-1-git-send-email-jrollins@finestructure.net>
\r
29 <1337812843-14986-2-git-send-email-jrollins@finestructure.net>
\r
30 <20120525144136.GB11804@mit.edu>
\r
31 <87wr40s1n4.fsf@servo.finestructure.net>
\r
32 User-Agent: Notmuch/0.13+38~g944a859 (http://notmuchmail.org) Emacs/23.1.1
\r
33 (x86_64-redhat-linux-gnu)
\r
34 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
35 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
36 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
37 Date: Fri, 25 May 2012 21:14:49 +0300
\r
38 Message-ID: <m2zk8wku06.fsf@guru.guru-group.fi>
\r
40 Content-Type: text/plain; charset=us-ascii
\r
41 Cc: Notmuch Mail <notmuch@notmuchmail.org>
\r
42 X-BeenThere: notmuch@notmuchmail.org
\r
43 X-Mailman-Version: 2.1.13
\r
45 List-Id: "Use and development of the notmuch mail system."
\r
46 <notmuch.notmuchmail.org>
\r
47 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
48 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
50 List-Post: <mailto:notmuch@notmuchmail.org>
\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
52 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
53 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
54 X-List-Received-Date: Fri, 25 May 2012 18:14:39 -0000
\r
56 On Fri, May 25 2012, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
\r
58 > On Fri, May 25 2012, Austin Clements <amdragon@MIT.EDU> wrote:
\r
59 >>> diff --git a/notmuch-client.h b/notmuch-client.h
\r
60 >>> index 19b7f01..337409f 100644
\r
61 >>> --- a/notmuch-client.h
\r
62 >>> +++ b/notmuch-client.h
\r
63 >>> @@ -36,6 +36,8 @@
\r
64 >>> * these to check the version number. */
\r
65 >>> #ifdef GMIME_MAJOR_VERSION
\r
66 >>> #define GMIME_ATLEAST_26
\r
68 >>> +typedef GMimeCipherContext GMimeCryptoContext;
\r
70 >> I like the typedef idea, but I don't think we should overload
\r
71 >> GMimeCryptoContext like this. If someone is reading through the GMime
\r
72 >> 2.4 code and sees this, they're going to assume that it's a GMime
\r
73 >> structure, go looking for it, find that it's only in 2.6 and be
\r
74 >> baffled. Instead, how about providing a typedef to abstract *both*
\r
75 >> cases? Something like
\r
77 >> #ifdef GMIME_MAJOR_VERSION
\r
78 >> #define GMIME_ATLEAST_26
\r
79 >> typedef notmuch_crypto_context_t GMimeCipherContext;
\r
81 >> typedef notmuch_crypto_context_t GMimeCryptoContext;
\r
84 > Hey, Austin. I briefly thought about this, but it seemed kind of heavy
\r
85 > handed given that I hope these ifdefs will go away in the
\r
86 > not-too-distant future. Do we really have a lot of gmime 2.4 readers
\r
87 > that would not have access to gmime 2.6 documentation? I'm pretty sure
\r
88 > that I would personally end up looking at documentation for both
\r
91 > But anyway, if this really is a concern, I guess it's not *that* much
\r
92 > effort to support a new typedef indefinitely to alleviate any potential
\r
95 > Any other opinions?
\r
97 I like Austin's suggestion; as long as gmime 2.4 is supported it is clearer
\r
98 that the type name is not just a little different -- someone browsing gmime
\r
99 2.4 code may experience some WTF:s (or was it FTW, cannot remember ;) when
\r
100 they try to locate GMimeCipherContext there...
\r
102 and, in if in some day gmime 2.4 support is dropped, M-x tags-query-replace
\r
103 can be used to drop the notmuch_crypto_context_t type.
\r
105 I personally am using gmime 2.4 as it has much less other requirements
\r
106 (i.e. ./configure --prefix=... && make install does it -- gmime 2.6
\r
107 requires some other "nondefault" libraries also) and I don't plan to update
\r
108 that (and not the least reason is that I keep testing 2.4 compatibility
\r
109 all the time when new commits appear to my git tree)
\r