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 4FB3A431FBD for ; Thu, 10 Oct 2013 05:30:55 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 xkUp3OYO8RUd for ; Thu, 10 Oct 2013 05:30:49 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by olra.theworths.org (Postfix) with ESMTP id CA038431FAE for ; Thu, 10 Oct 2013 05:30:48 -0700 (PDT) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id 37B36100030; Thu, 10 Oct 2013 15:30:44 +0300 (EEST) From: Tomi Ollila To: David Bremner Subject: Re: [PATCH 1/3] cli: add insert --must-index option In-Reply-To: <87zjqhv264.fsf@zancas.localnet> References: <1374365254-13227-1-git-send-email-novalazy@gmail.com> <87ip048gbj.fsf@qmul.ac.uk> <20130727151510.GA13750@hili.localdomain> <87hadtxfrr.fsf@qmul.ac.uk> <20130912001349.GA18821@hili.localdomain> <87zjqhv264.fsf@zancas.localnet> User-Agent: Notmuch/0.16+87~g451fefe (http://notmuchmail.org) Emacs/24.3.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain Cc: notmuch@notmuchmail.org 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: Thu, 10 Oct 2013 12:30:55 -0000 On Thu, Oct 10 2013, David Bremner wrote: > Peter Wang writes: > >> On Tue, 10 Sep 2013 09:06:00 +0100, Mark Walters 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