unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Sebastian Spaeth <sebastian@sspaeth.de>
To: Ali Polatel <polatel@gmail.com>, notmuch@notmuchmail.org
Subject: Re: Concerns regarding some library functions
Date: Wed, 28 Sep 2011 17:42:01 +0200	[thread overview]
Message-ID: <87ipocoera.fsf@SSpaeth.de> (raw)
In-Reply-To: <871uv2unfd.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 925 bytes --]

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().
> 
> 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().

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

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

      parent reply	other threads:[~2011-09-28 15:42 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-27 13:25 Concerns regarding some library functions Ali Polatel
2011-09-27 16:59 ` David Bremner
2011-09-27 22:46   ` Austin Clements
2011-09-28  7:53     ` Ali Polatel
2011-09-29 14:51       ` Austin Clements
2011-09-29 19:59         ` David Bremner
2011-09-29 20:15           ` Austin Clements
2011-10-04 11:18             ` David Bremner
2011-10-04 13:40               ` Tomi Ollila
2011-10-04 19:36               ` libnotmuch SONAME bumped David Bremner
2011-09-30  6:47         ` Concerns regarding some library functions Ali Polatel
2011-10-01  8:12           ` [PATCH] lib: make find_message{,by_filename) report errors Ali Polatel
2011-10-01  8:12             ` Ali Polatel
2011-10-05 13:42               ` Sebastian Spaeth
2011-10-03 16:49             ` [PATCH v1 0/1] " Ali Polatel
2011-10-03 16:49               ` [PATCH v1 1/1] " Ali Polatel
2011-10-03 17:43                 ` Austin Clements
2011-10-03 20:38                   ` [PATCH v1 1/1] lib: make find_message{, by_filename) " Ali Polatel
2011-10-03 20:40                     ` [PATCH v2 0/2] Better error handling Ali Polatel
2011-10-03 20:40                       ` [PATCH v2 1/2] lib: destroy message object after message removal Ali Polatel
2011-10-03 20:40                       ` [PATCH v2 2/2] lib: make find_message{,by_filename) report errors Ali Polatel
2011-10-03 20:53                       ` [PATCH v2 0/2] Better error handling Ali Polatel
2011-10-03 21:03                       ` Austin Clements
2011-10-04  1:10             ` [PATCH] lib: make find_message{,by_filename) report errors David Bremner
2011-10-04  5:00               ` Ali Polatel
2011-10-04  5:06                 ` [PATCH v3 0/2] Better error handling Ali Polatel
2011-10-04  5:06                   ` [PATCH v3 1/2] lib: destroy message object after message removal Ali Polatel
2011-10-04  5:06                   ` [PATCH v3 2/2] lib: make find_message{,by_filename) report errors Ali Polatel
2011-10-04 10:43                   ` [PATCH v3 0/2] Better error handling David Bremner
2011-09-28 15:42 ` Sebastian Spaeth [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ipocoera.fsf@SSpaeth.de \
    --to=sebastian@sspaeth.de \
    --cc=notmuch@notmuchmail.org \
    --cc=polatel@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).