From: Tomi Ollila Date: Tue, 3 Dec 2013 14:11:36 +0000 (+0200) Subject: Re: [PATCH 2/2] lib: introduce notmuch_database_new for initializing a database handle X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cc5bce5f10d99b038121716dcac1406650f53a90;p=notmuch-archives.git Re: [PATCH 2/2] lib: introduce notmuch_database_new for initializing a database handle --- diff --git a/09/4edf79f70aa252689eb71d478c9734930af8f0 b/09/4edf79f70aa252689eb71d478c9734930af8f0 new file mode 100644 index 000000000..2893fe060 --- /dev/null +++ b/09/4edf79f70aa252689eb71d478c9734930af8f0 @@ -0,0 +1,103 @@ +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 4813E431FD2 + for ; Tue, 3 Dec 2013 06:11:54 -0800 (PST) +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 qxMmLHund6jY for ; + Tue, 3 Dec 2013 06:11:46 -0800 (PST) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id A2626431FC2 + for ; Tue, 3 Dec 2013 06:11:46 -0800 (PST) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id B50AF100086; + Tue, 3 Dec 2013 16:11:36 +0200 (EET) +From: Tomi Ollila +To: David Bremner , Jani Nikula , + notmuch@notmuchmail.org +Subject: Re: [PATCH 2/2] lib: introduce notmuch_database_new for initializing + a database handle +In-Reply-To: <87wqjm2m2q.fsf@zancas.localnet> +References: + + <87wqjm2m2q.fsf@zancas.localnet> +User-Agent: Notmuch/0.17~rc1+17~ga2e1a2f (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain +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: Tue, 03 Dec 2013 14:11:54 -0000 + +On Tue, Dec 03 2013, David Bremner wrote: + +> The first patch looks ok. I like the new API overall. +> +> As far as breaking contrib/notmuch-deliver, I'd rather fix +> notmuch-insert than put effort into notmuch-deliver at this point. I +> guess it could be a rough transition for people running notmuch-deliver +> from git. +> +> Jani Nikula writes: +> +>> +/* +>> + * XXX: error handling should clean up *all* state created! +>> + */ +> is this a warning to future hackers or some current problem? +> +>> notmuch_status_t +>> -notmuch_database_open (const char *path, +>> - notmuch_database_mode_t mode, +>> - notmuch_database_t **database) +>> +notmuch_database_open (notmuch_database_t *notmuch, const char *path, +>> + notmuch_database_mode_t mode) +>> +>> +/* Initialize a new, empty database handle. +>> + * +> +> I wondered about making the new documentation adhere to doxygen? +> +> +>> + if (notmuch_database_open (notmuch, +>> + notmuch_config_get_database_path (config), +>> + NOTMUCH_DATABASE_MODE_READ_ONLY)) +> +> Would it make any sense to migrate the mode argument to an option +> setting while we're messing with the API? + +if that, then also database_path to options ? + +I also like this suggestion best of all seen so far, but what if: + + #define NOTMUCH_MAJOR_VERSION 0 + #define NOTMUCH_MINOR_VERSION 17 + -#define NOTMUCH_MICRO_VERSION 0 + +#define NOTMUCH_MICRO_VERSION 90 + +until changed API/ABI is set into stone (i.e. 0.18.0 at freeze time). + + +Tomi