unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <tomi.ollila@iki.fi>
To: David Bremner <david@tethera.net>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH 1/3] cli: add insert --must-index option
Date: Thu, 10 Oct 2013 15:30:44 +0300	[thread overview]
Message-ID: <m238o9fguj.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <87zjqhv264.fsf@zancas.localnet>

On Thu, Oct 10 2013, David Bremner <david@tethera.net> wrote:

> Peter Wang <novalazy@gmail.com> writes:
>
>> On Tue, 10 Sep 2013 09:06:00 +0100, Mark Walters <markwalters1009@gmail.com> wrote:
>>> 
>>> Alternatively maybe add notmuch_database_destroy_with_flush or something
>>> which does give a return value. notmuch_database_close is only called 3
>>> times and notmuch_database_destroy lots of times so changing close is
>>> much less intrusive than changing destroy. But I don't know whether we
>>> would break any  bindings or external programs etc.
>>> 
>>> What do you think?
>>
>> I think notmuch_database_close and notmuch_database_destroy should
>> return the status, and we update the three language bindings
>> and bump the soname.
>>
>
> I'm not opposed to doing an SONAME bump for 0.17. Are there other ABI
> breaking changes that we have been holding back on? Can these maybe go
> through at the same time?

Maybe something along these lines...

(Quick draft for the API part; to start discussion before working too much
for something that is going to be dropped...)

diff --git a/lib/notmuch.h b/lib/notmuch.h
index 9dab555..ae52dab 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -106,6 +106,17 @@ typedef enum _notmuch_status {
     NOTMUCH_STATUS_LAST_STATUS
 } notmuch_status_t;
 
+/* Structure to provide logging interface to the notmuch library
+ *
+ * ...
+ */
+
+typedef struct _notmuch_loghook {
+    void (*func)(struct _notmuch_loghook *, int level, int status,
+		 const char * format, ...);
+} notmuch_loghook_t;
+
+
 /* Get a string representation of a notmuch_status_t value.
  *
  * The result is read-only.
@@ -159,7 +170,9 @@ typedef struct _notmuch_filenames notmuch_filenames_t;
  * NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred.
  */
 notmuch_status_t
-notmuch_database_create (const char *path, notmuch_database_t **database);
+notmuch_database_create (const char *path,
+			 notmuch_loghook_t *loghook,
+			 notmuch_database_t **database);
 
 typedef enum {
     NOTMUCH_DATABASE_MODE_READ_ONLY = 0,
@@ -200,6 +213,7 @@ typedef enum {
 notmuch_status_t
 notmuch_database_open (const char *path,
 		       notmuch_database_mode_t mode,
+		       notmuch_loghook_t *loghook,
 		       notmuch_database_t **database);
 
 /* Close the given notmuch database.

>
> d

Tomi

  reply	other threads:[~2013-10-10 12:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-21  0:07 [PATCH 1/3] cli: add insert --must-index option Peter Wang
2013-07-21  0:07 ` [PATCH 2/3] man: document insert --must-index Peter Wang
2013-07-21  0:07 ` [PATCH 3/3] test: test " Peter Wang
2013-07-21  8:31 ` [PATCH 1/3] cli: add insert --must-index option Mark Walters
2013-07-27  5:15   ` Peter Wang
2013-09-10  8:06     ` Mark Walters
2013-09-11 14:13       ` Peter Wang
2013-10-10 10:41         ` David Bremner
2013-10-10 12:30           ` Tomi Ollila [this message]
2013-10-10 14:15             ` David Bremner
2013-10-23 19:05               ` Tomi Ollila
2013-10-23 19:32                 ` Austin Clements
2013-10-23 21:34                   ` Tomi Ollila
2013-10-24  0:05                   ` David Bremner
2013-10-24 10:19                     ` Tomi Ollila

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=m238o9fguj.fsf@guru.guru-group.fi \
    --to=tomi.ollila@iki.fi \
    --cc=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    /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).