unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Concerns regarding some library functions
@ 2011-09-27 13:25 Ali Polatel
  2011-09-27 16:59 ` David Bremner
  2011-09-28 15:42 ` Concerns regarding some library functions Sebastian Spaeth
  0 siblings, 2 replies; 30+ messages in thread
From: Ali Polatel @ 2011-09-27 13:25 UTC (permalink / raw)
  To: notmuch

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

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

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

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2011-10-05 13:43 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` Concerns regarding some library functions Sebastian Spaeth

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