Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id A34DC431FD0 for ; Wed, 28 Sep 2011 08:42:06 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.09 X-Spam-Level: X-Spam-Status: No, score=-0.09 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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 7z1NKsRW8n7J for ; Wed, 28 Sep 2011 08:42:06 -0700 (PDT) Received: from homiemail-a76.g.dreamhost.com (caiajhbdccac.dreamhost.com [208.97.132.202]) by olra.theworths.org (Postfix) with ESMTP id 37E16431FB6 for ; Wed, 28 Sep 2011 08:42:06 -0700 (PDT) Received: from homiemail-a76.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a76.g.dreamhost.com (Postfix) with ESMTP id 866F9458083; Wed, 28 Sep 2011 08:42:05 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sspaeth.de; h=from:to:subject :in-reply-to:references:date:message-id:mime-version: content-type; q=dns; s=sspaeth.de; b=kS93x1u2UoMUDWDA63rTx4YjcQ2 xQXuDUevADTlGwjgni5T35YnGqGSmaAhiN1TgS/YwR5T4V84SXVgfn8BaK9q7e/i qVQbcm0GJ0DovBPnxfwl3Z5zYVf4BqQXQF/ieVAYO2r9txvr6/Sne7VCYkLwaDIU EobNZGA7xKlNrDkU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sspaeth.de; h=from:to :subject:in-reply-to:references:date:message-id:mime-version: content-type; s=sspaeth.de; bh=fTLc8jTBu5McJGdLkNyU5uaxZvI=; b=A RCMVvTPgyZG9T66wCzMeOCJ3KK62rEQnfHFTuDAK4RyqTFDNuzmEYxhXhk/d75kz +3I8HUjcJvlwT0pBpT7Q8Y3g7yScIFGEfixhFL15APuumZTadYkDVVPTw2FKZjwJ cnDao2V7IZFU1Jx4qAOGHWtL1Yh5ZY86DliqoplyEg= Received: from spaetzbook.sspaeth.de (mtec-hg-docking-2-dhcp-194.ethz.ch [82.130.121.194]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: fax@sspaeth.de) by homiemail-a76.g.dreamhost.com (Postfix) with ESMTPSA id 7720A458081; Wed, 28 Sep 2011 08:42:03 -0700 (PDT) Received: by spaetzbook.sspaeth.de (sSMTP sendmail emulation); Wed, 28 Sep 2011 17:42:01 +0200 From: Sebastian Spaeth To: Ali Polatel , notmuch@notmuchmail.org Subject: Re: Concerns regarding some library functions In-Reply-To: <871uv2unfd.fsf@gmail.com> References: <871uv2unfd.fsf@gmail.com> User-Agent: Notmuch/0.7-19-gee4579a (http://notmuchmail.org) Emacs/23.2.1 (x86_64-pc-linux-gnu) Date: Wed, 28 Sep 2011 17:42:01 +0200 Message-ID: <87ipocoera.fsf@SSpaeth.de> 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: Wed, 28 Sep 2011 15:42:06 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable On Tue, 27 Sep 2011 16:25:58 +0300, Ali Polatel wrote: > The two functions I've mentioned above are > notmuch_database_find_message() and > notmuch_database_find_message_by_filename(). >=20 > 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_mes= sage(). Yes, this is because NULL used to mean message not found and NULL means error was tacked on later (because cworth did not expect that xapian would actually throw errors that often (such as database modified and whatnot). So the meaning of NULL is, ahhem, suboptimal... ERROR or really not there? There are mails from me, commenting on that. I would welcome receiving back a notmuch_status_t value and have a separate notmuch_message_t parameter which receives the actual message. Sebastian --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk6DQEkACgkQVYX1jMgnoGL3IQCfRiU9//SCkK1nfbE0/cZRotKZ iJYAnA5GSWb3tmvY/ulL7OcF7lhePC0B =GzPU -----END PGP SIGNATURE----- --=-=-=--