1 Return-Path: <polatel@gmail.com>
\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 72EE5431FB6
\r
6 for <notmuch@notmuchmail.org>; Tue, 27 Sep 2011 06:26:08 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.789 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, T_MIME_NO_TEXT=0.01]
\r
15 Received: from olra.theworths.org ([127.0.0.1])
\r
16 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id nJkkUSBOQ66e for <notmuch@notmuchmail.org>;
\r
18 Tue, 27 Sep 2011 06:26:07 -0700 (PDT)
\r
19 Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com
\r
20 [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
21 (No client certificate requested)
\r
22 by olra.theworths.org (Postfix) with ESMTPS id A1130431FD0
\r
23 for <notmuch@notmuchmail.org>; Tue, 27 Sep 2011 06:26:07 -0700 (PDT)
\r
24 Received: by bkbzt12 with SMTP id zt12so8092089bkb.26
\r
25 for <notmuch@notmuchmail.org>; Tue, 27 Sep 2011 06:26:06 -0700 (PDT)
\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
\r
27 h=from:to:cc:subject:user-agent:date:message-id:mime-version
\r
28 :content-type; bh=HELc+KGfmnlqmI9DWaY54Si7LgvYRR6gZ9bSsDDABaQ=;
\r
29 b=U++RcXhrpS4x6zuYmSys0jd/S/2lcj6H+74Oenol1UL+LAdhUuljwH65sHRJuOzw2f
\r
30 Ke/u4riJoPzy5AhPDc2o1txi41m6xh++ualn1/N4bVogOVqEIVVUuNoVIRNriKyMyN9I
\r
31 19S2K+uc8RYlv7yzi50XS7TqiEMeOg+X0DXJQ=
\r
32 Received: by 10.204.135.20 with SMTP id l20mr3738272bkt.390.1317129966255;
\r
33 Tue, 27 Sep 2011 06:26:06 -0700 (PDT)
\r
34 Received: from localhost ([88.251.189.177])
\r
35 by mx.google.com with ESMTPS id e14sm10820384bka.0.2011.09.27.06.26.03
\r
36 (version=TLSv1/SSLv3 cipher=OTHER);
\r
37 Tue, 27 Sep 2011 06:26:04 -0700 (PDT)
\r
38 From: Ali Polatel <polatel@gmail.com>
\r
39 To: notmuch@notmuchmail.org
\r
40 Subject: Concerns regarding some library functions
\r
41 User-Agent: Notmuch/0.8-39-gdd7cb35 (http://notmuchmail.org) Emacs/23.3.1
\r
42 (x86_64-pc-linux-gnu)
\r
43 Date: Tue, 27 Sep 2011 16:25:58 +0300
\r
44 Message-ID: <871uv2unfd.fsf@gmail.com>
\r
46 Content-Type: multipart/signed; boundary="=-=-=";
\r
47 micalg=pgp-sha1; protocol="application/pgp-signature"
\r
48 X-BeenThere: notmuch@notmuchmail.org
\r
49 X-Mailman-Version: 2.1.13
\r
51 List-Id: "Use and development of the notmuch mail system."
\r
52 <notmuch.notmuchmail.org>
\r
53 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
54 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
55 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
56 List-Post: <mailto:notmuch@notmuchmail.org>
\r
57 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
58 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
59 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
60 X-List-Received-Date: Tue, 27 Sep 2011 13:26:09 -0000
\r
66 Being the maintainer of Ruby bindings, I've been watching the
\r
67 development of API changes closely. Ruby bindings are nearly complete
\r
68 with the exception of two functions which I think are poorly implemented
\r
69 in terms of error handling.
\r
71 The two functions I've mentioned above are
\r
72 notmuch_database_find_message() and
\r
73 notmuch_database_find_message_by_filename().
\r
75 The problem with their design is NULL return may both mean an error
\r
76 condition and "message not found". However, we already have a similar
\r
77 function which does not have such a flaw, namely notmuch_database_add_message().
\r
79 In my humble opinion it is a good idea to modify these functions to
\r
80 return 'notmuch_status_t' and add an argument 'notmuch_message_t **'
\r
81 which will be initialized to the message object upon successful return.
\r
82 This is just like notmuch_database_add_message() which provides both
\r
83 consistency and proper error reporting.
\r
85 I vaguely remember this question was raised on the list for
\r
86 notmuch_database_find_message() before. Seeing the recent addition of
\r
87 notmuch_database_find_message_by_filename(), I wanted to bring this up
\r
88 again in the hope to get it fixed as soon as possible.
\r
90 I am not providing a patch here considering the simplicity of the
\r
91 problem but if anyone needs elaboration, I will be happy to submit a
\r
94 P.S.: Ruby bindings don't have wrappers for these functions but I am not
\r
95 sure about Python bindings and how they solve, or 'hack around', this
\r
96 problem. CC'ing Sebastian for comments so we can have consistency
\r
102 Content-Type: application/pgp-signature
\r
104 -----BEGIN PGP SIGNATURE-----
\r
105 Version: GnuPG v2.0.18 (GNU/Linux)
\r
107 iEYEARECAAYFAk6BzugACgkQQU4yORhF8iBaUACfcG9+Up3mCInBBgK4PE4RXhSs
\r
108 ltIAn1qlRsBwdOKKHOLyN2lvOUOs6/5s
\r
110 -----END PGP SIGNATURE-----
\r