Concerns regarding some library functions

Sebastian Spaeth sebastian at sspaeth.de
Wed Sep 28 08:42:01 PDT 2011


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20110928/5af145cd/attachment.pgp>


More information about the notmuch mailing list