From 4fc57d14ec322bbba0c39ae7c9a2196039757bc2 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Fri, 1 Aug 2014 22:10:03 +2000 Subject: [PATCH] [PATCH v3 13/13] lib: Update doc of notmuch_database_{needs_upgrade, upgrade} --- bf/07cafc549f169346b99e7da939672196d88e9a | 124 ++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 bf/07cafc549f169346b99e7da939672196d88e9a diff --git a/bf/07cafc549f169346b99e7da939672196d88e9a b/bf/07cafc549f169346b99e7da939672196d88e9a new file mode 100644 index 000000000..c81edf86d --- /dev/null +++ b/bf/07cafc549f169346b99e7da939672196d88e9a @@ -0,0 +1,124 @@ +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 7706B431FD5 + for ; Thu, 31 Jul 2014 19:11:01 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -2.3 +X-Spam-Level: +X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_MED=-2.3] 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 taErLlEpHcjI for ; + Thu, 31 Jul 2014 19:10:57 -0700 (PDT) +Received: from dmz-mailsec-scanner-5.mit.edu (dmz-mailsec-scanner-5.mit.edu + [18.7.68.34]) + by olra.theworths.org (Postfix) with ESMTP id 6EC8D431FD7 + for ; Thu, 31 Jul 2014 19:10:20 -0700 (PDT) +X-AuditID: 12074422-f79be6d000007518-94-53daf70b24de +Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) + (using TLS with cipher AES256-SHA (256/256 bits)) + (Client did not present a certificate) + by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP + id 8B.05.29976.C07FAD35; Thu, 31 Jul 2014 22:10:20 -0400 (EDT) +Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) + by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id s712A8fe014706; + Thu, 31 Jul 2014 22:10:09 -0400 +Received: from drake.dyndns.org + (216-15-114-40.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com + [216.15.114.40]) (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s712A7Ze029995 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Thu, 31 Jul 2014 22:10:08 -0400 +Received: from amthrax by drake.dyndns.org with local (Exim 4.77) + (envelope-from ) + id 1XD2II-000341-9v; Thu, 31 Jul 2014 22:10:06 -0400 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH v3 13/13] lib: Update doc of notmuch_database_{needs_upgrade, + upgrade} +Date: Thu, 31 Jul 2014 22:10:03 -0400 +Message-Id: <1406859003-11561-14-git-send-email-amdragon@mit.edu> +X-Mailer: git-send-email 2.0.0 +In-Reply-To: <1406859003-11561-1-git-send-email-amdragon@mit.edu> +References: <1406859003-11561-1-git-send-email-amdragon@mit.edu> +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFtrLIsWRmVeSWpSXmKPExsUixCmqrMvz/VawwfIJzBar5/JYXL85k9mB + yWPnrLvsHs9W3WIOYIrisklJzcksSy3St0vgyrj6/xdbwX6BisvNt1kaGA/wdjFyckgImEhc + +7GZEcIWk7hwbz1bFyMXh5DAbCaJ2bd7GSGcjYwSu84uhHLuMEmsnvOTCcKZyyjReGciM0g/ + m4CGxLb9y8FmiQhIS+y8O5sVxGYWcJT4vH8RG4gtLBAqsX/WNCYQm0VAVeLqlNVgNi9QzdtV + nSwQd8hJNNz4BFbPCRT//28B2BwhAQeJ1tNbmScw8i9gZFjFKJuSW6Wbm5iZU5yarFucnJiX + l1qka6qXm1mil5pSuokRFErsLko7GH8eVDrEKMDBqMTD6xB6K1iINbGsuDL3EKMkB5OSKK/N + R6AQX1J+SmVGYnFGfFFpTmrxIUYJDmYlEd6XH4ByvCmJlVWpRfkwKWkOFiVx3rfWVsFCAumJ + JanZqakFqUUwWRkODiUJ3jNfgRoFi1LTUyvSMnNKENJMHJwgw3mAhl8DqeEtLkjMLc5Mh8if + YlSUEufdA5IQAElklObB9cJi/RWjONArwrwPQap4gGkCrvsV0GAmoMHPb10HGVySiJCSamBk + YjdvWmTGzyLlNPXhzOplVzfVCfftvfDSfMYpkYgTM9am9KRdV/g2W6jV+eHOtW6Jn+KS1rY1 + iXKUrp+71jmmV7fcWzS70k17tXfIuSNMMoFvQ83PXfitGLz888NzYdXt7dn3eX5kaBceu1fP + b/VhimPcJQO/J11B99YtLJx2+P09Tgnt0ENKLMUZiYZazEXFiQAa6VQJ0AIAAA== +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: Fri, 01 Aug 2014 02:11:02 -0000 + +Clients are no longer required to call these functions after opening a +database in read/write mode (which is good, because almost none of +them do!). +--- + lib/notmuch.h | 21 ++++++++++++--------- + 1 file changed, 12 insertions(+), 9 deletions(-) + +diff --git a/lib/notmuch.h b/lib/notmuch.h +index cbf2ba5..d771eb2 100644 +--- a/lib/notmuch.h ++++ b/lib/notmuch.h +@@ -352,22 +352,25 @@ unsigned int + notmuch_database_get_version (notmuch_database_t *database); + + /** +- * Does this database need to be upgraded before writing to it? ++ * Is the database behind the latest supported database version? + * +- * If this function returns TRUE then no functions that modify the +- * database (notmuch_database_add_message, notmuch_message_add_tag, +- * notmuch_directory_set_mtime, etc.) will work unless the function +- * notmuch_database_upgrade is called successfully first. ++ * If this function returns TRUE, then the caller may call ++ * notmuch_database_upgrade to upgrade the database. If the caller ++ * does not upgrade an out-of-date database, then some functions may ++ * fail with NOTMUCH_STATUS_UPGRADE_REQUIRED. + */ + notmuch_bool_t + notmuch_database_needs_upgrade (notmuch_database_t *database); + + /** +- * Upgrade the current database. ++ * Upgrade the current database to the latest supported version. + * +- * After opening a database in read-write mode, the client should +- * check if an upgrade is needed (notmuch_database_needs_upgrade) and +- * if so, upgrade with this function before making any modifications. ++ * This ensures that all current notmuch functionality will be ++ * available on the database. After opening a database in read-write ++ * mode, it is recommended that clients check if an upgrade is needed ++ * (notmuch_database_needs_upgrade) and if so, upgrade with this ++ * function before making any modifications. If ++ * notmuch_database_needs_upgrade returns FALSE, this will be a no-op. + * + * The optional progress_notify callback can be used by the caller to + * provide progress indication to the user. If non-NULL it will be +-- +2.0.0 + -- 2.26.2