From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 72EE5431FB6 for ; Tue, 27 Sep 2011 06:26:08 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.789 X-Spam-Level: X-Spam-Status: No, score=-0.789 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, T_MIME_NO_TEXT=0.01] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nJkkUSBOQ66e for ; Tue, 27 Sep 2011 06:26:07 -0700 (PDT) Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id A1130431FD0 for ; Tue, 27 Sep 2011 06:26:07 -0700 (PDT) Received: by bkbzt12 with SMTP id zt12so8092089bkb.26 for ; Tue, 27 Sep 2011 06:26:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:user-agent:date:message-id:mime-version :content-type; bh=HELc+KGfmnlqmI9DWaY54Si7LgvYRR6gZ9bSsDDABaQ=; b=U++RcXhrpS4x6zuYmSys0jd/S/2lcj6H+74Oenol1UL+LAdhUuljwH65sHRJuOzw2f Ke/u4riJoPzy5AhPDc2o1txi41m6xh++ualn1/N4bVogOVqEIVVUuNoVIRNriKyMyN9I 19S2K+uc8RYlv7yzi50XS7TqiEMeOg+X0DXJQ= Received: by 10.204.135.20 with SMTP id l20mr3738272bkt.390.1317129966255; Tue, 27 Sep 2011 06:26:06 -0700 (PDT) Received: from localhost ([88.251.189.177]) by mx.google.com with ESMTPS id e14sm10820384bka.0.2011.09.27.06.26.03 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 27 Sep 2011 06:26:04 -0700 (PDT) From: Ali Polatel To: notmuch@notmuchmail.org Subject: Concerns regarding some library functions User-Agent: Notmuch/0.8-39-gdd7cb35 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Tue, 27 Sep 2011 16:25:58 +0300 Message-ID: <871uv2unfd.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 13:26:09 -0000 --=-=-= Hello, Being the maintainer of Ruby bindings, I've been watching the development of API changes closely. Ruby bindings are nearly complete with the exception of two functions which I think are poorly implemented in terms of error handling. The two functions I've mentioned above are notmuch_database_find_message() and notmuch_database_find_message_by_filename(). The problem with their design is NULL return may both mean an error condition and "message not found". However, we already have a similar function which does not have such a flaw, namely notmuch_database_add_message(). In my humble opinion it is a good idea to modify these functions to return 'notmuch_status_t' and add an argument 'notmuch_message_t **' which will be initialized to the message object upon successful return. This is just like notmuch_database_add_message() which provides both consistency and proper error reporting. I vaguely remember this question was raised on the list for notmuch_database_find_message() before. Seeing the recent addition of notmuch_database_find_message_by_filename(), I wanted to bring this up again in the hope to get it fixed as soon as possible. I am not providing a patch here considering the simplicity of the problem but if anyone needs elaboration, I will be happy to submit a patch. P.S.: Ruby bindings don't have wrappers for these functions but I am not sure about Python bindings and how they solve, or 'hack around', this problem. CC'ing Sebastian for comments so we can have consistency between bindings. -alip --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) iEYEARECAAYFAk6BzugACgkQQU4yORhF8iBaUACfcG9+Up3mCInBBgK4PE4RXhSs ltIAn1qlRsBwdOKKHOLyN2lvOUOs6/5s =EvXu -----END PGP SIGNATURE----- --=-=-=--