From: David Bremner Date: Tue, 3 Dec 2013 11:47:09 +0000 (+2000) 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=5763042c9224395d55c221f6c8c5a735914e6e69;p=notmuch-archives.git Re: [PATCH 2/2] lib: introduce notmuch_database_new for initializing a database handle --- diff --git a/42/8ff00ce2aefd947a3aefa5cf24e2352aae249e b/42/8ff00ce2aefd947a3aefa5cf24e2352aae249e new file mode 100644 index 000000000..f04a40bce --- /dev/null +++ b/42/8ff00ce2aefd947a3aefa5cf24e2352aae249e @@ -0,0 +1,89 @@ +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 2C4CE431FC3 + for ; Tue, 3 Dec 2013 03:47:21 -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 RPQzgARGDlFd for ; + Tue, 3 Dec 2013 03:47:17 -0800 (PST) +Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155]) + (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 095D5431FB6 + for ; Tue, 3 Dec 2013 03:47:17 -0800 (PST) +Received: from remotemail by yantan.tethera.net with local (Exim 4.80) + (envelope-from ) + id 1VnoRd-0003P6-8j; Tue, 03 Dec 2013 07:47:13 -0400 +Received: (nullmailer pid 7517 invoked by uid 1000); Tue, 03 Dec 2013 + 11:47:09 -0000 +From: David Bremner +To: Jani Nikula , notmuch@notmuchmail.org +Subject: Re: [PATCH 2/2] lib: introduce notmuch_database_new for initializing + a database handle +In-Reply-To: + +References: + +User-Agent: Notmuch/0.17~rc2 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-pc-linux-gnu) +Date: Tue, 03 Dec 2013 07:47:09 -0400 +Message-ID: <87wqjm2m2q.fsf@zancas.localnet> +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 11:47:21 -0000 + + +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? +