From d39c84c4d04de373c9bc5ad959d3947a725e2bf0 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Wed, 30 Jul 2014 12:48:12 +2000 Subject: [PATCH] [PATCH v2 14/14] lib: Update doc of notmuch_database_{needs_upgrade, upgrade} --- 4a/77714a5e451a96e95b9774788caef203a90260 | 125 ++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 4a/77714a5e451a96e95b9774788caef203a90260 diff --git a/4a/77714a5e451a96e95b9774788caef203a90260 b/4a/77714a5e451a96e95b9774788caef203a90260 new file mode 100644 index 000000000..f6b98b959 --- /dev/null +++ b/4a/77714a5e451a96e95b9774788caef203a90260 @@ -0,0 +1,125 @@ +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 A8CCA431FAE + for ; Tue, 29 Jul 2014 09:48:59 -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 A0LqXMlR2Izp for ; + Tue, 29 Jul 2014 09:48:54 -0700 (PDT) +Received: from dmz-mailsec-scanner-2.mit.edu (dmz-mailsec-scanner-2.mit.edu + [18.9.25.13]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id A8069431FD5 + for ; Tue, 29 Jul 2014 09:48:23 -0700 (PDT) +X-AuditID: 1209190d-f79c06d000002f07-87-53d7d057ad7b +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-2.mit.edu (Symantec Messaging Gateway) with SMTP + id 2C.0D.12039.750D7D35; Tue, 29 Jul 2014 12:48:23 -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 s6TGmMHg003485; + Tue, 29 Jul 2014 12:48:22 -0400 +Received: from drake.dyndns.org (31-33-71.wireless.csail.mit.edu + [128.31.33.71]) (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s6TGmFph030276 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Tue, 29 Jul 2014 12:48:21 -0400 +Received: from amthrax by drake.dyndns.org with local (Exim 4.77) + (envelope-from ) + id 1XCAZT-0007HD-2K; Tue, 29 Jul 2014 12:48:15 -0400 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH v2 14/14] lib: Update doc of notmuch_database_{needs_upgrade, + upgrade} +Date: Tue, 29 Jul 2014 12:48:12 -0400 +Message-Id: <1406652492-27803-15-git-send-email-amdragon@mit.edu> +X-Mailer: git-send-email 2.0.0 +In-Reply-To: <1406652492-27803-1-git-send-email-amdragon@mit.edu> +References: <1406652492-27803-1-git-send-email-amdragon@mit.edu> +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFtrNIsWRmVeSWpSXmKPExsUixCmqrBt+4XqwQe8DeYvVc3ksrt+cyezA + 5LFz1l12j2erbjEHMEVx2aSk5mSWpRbp2yVwZVz9/4utYL9AxeXm2ywNjAd4uxg5OSQETCQW + 7lrDDGGLSVy4t56ti5GLQ0hgNpPE/bY1rCAJIYGNjBLTNkRDJI4xSZz//JcFIjGXUWJLUwqI + zSagIbFt/3JGEFtEQFpi593ZYM3MAo4Sn/cvYgOxhQVCJVr+rwWrYRFQleiYfBtsMy9QzZ5b + 91ghrpCTaLjxCayeEyh+695dJohdDhKHZm1mmcDIv4CRYRWjbEpulW5uYmZOcWqybnFyYl5e + apGukV5uZoleakrpJkZwGEny7mB8d1DpEKMAB6MSDy/HgmvBQqyJZcWVuYcYJTmYlER59fZd + DxbiS8pPqcxILM6ILyrNSS0+xCjBwawkwst3FijHm5JYWZValA+TkuZgURLnfWttFSwkkJ5Y + kpqdmlqQWgSTleHgUJLgXXseqFGwKDU9tSItM6cEIc3EwQkynAdo+D6QGt7igsTc4sx0iPwp + RkUpcd7sc0AJAZBERmkeXC8szl8xigO9IszbBtLOA0wRcN2vgAYzAQ1mdQEbXJKIkJJqYKws + KA/MTOm7lPzjXsGW8sTztUwZtU8sTsqxZNzzbfEtSwrI2F/C4s/0KueHrcAPtepQJjWf7Cbu + V78sfPTPpbnMLOF4YLzIxSfkzYPY7zuYXA9ve5n74rP+drmFR1dHdJxY9NjQ9eKu6v8FieLt + Ky/41pTevTnnh1uw6VGWh/bOxm/bWN9eVWIpzkg01GIuKk4EAC6sQn/OAgAA +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, 29 Jul 2014 16:48:59 -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