From: David Bremner Date: Sun, 7 Jun 2015 15:01:56 +0000 (+0200) Subject: [PATCH 03/10] lib: add public accessor for database from query X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8b53a231d9733940f2280a3815525a2a66a3c18e;p=notmuch-archives.git [PATCH 03/10] lib: add public accessor for database from query --- diff --git a/36/7d1cc08856bad9e2ca1635967134cdc22dba98 b/36/7d1cc08856bad9e2ca1635967134cdc22dba98 new file mode 100644 index 000000000..c9a3bdfeb --- /dev/null +++ b/36/7d1cc08856bad9e2ca1635967134cdc22dba98 @@ -0,0 +1,102 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id 213026DE158D + for ; Sun, 7 Jun 2015 08:05:40 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: 0.217 +X-Spam-Level: +X-Spam-Status: No, score=0.217 tagged_above=-999 required=5 tests=[AWL=0.207, + T_HEADER_FROM_DIFFERENT_DOMAINS=0.01] autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id MmdXu6vCCVV8 for ; + Sun, 7 Jun 2015 08:05:38 -0700 (PDT) +Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net + [87.98.215.224]) + by arlo.cworth.org (Postfix) with ESMTPS id 57FF36DE1502 + for ; Sun, 7 Jun 2015 08:05:38 -0700 (PDT) +Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim + 4.80) (envelope-from ) + id 1Z1c88-0004qU-Pv; Sun, 07 Jun 2015 15:04:56 +0000 +Received: (nullmailer pid 7854 invoked by uid 1000); Sun, 07 Jun 2015 + 15:02:11 -0000 +From: David Bremner +To: notmuch@notmuchmail.org +Subject: [PATCH 03/10] lib: add public accessor for database from query +Date: Sun, 7 Jun 2015 17:01:56 +0200 +Message-Id: <1433689323-7520-4-git-send-email-david@tethera.net> +X-Mailer: git-send-email 2.1.4 +In-Reply-To: <1433689323-7520-1-git-send-email-david@tethera.net> +References: <1433689323-7520-1-git-send-email-david@tethera.net> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.18 +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: Sun, 07 Jun 2015 15:05:40 -0000 + +This is to make it easier for clients of the library to update to the +new error code returning versions of notmuch_query_search_messages +--- + lib/Makefile.local | 2 +- + lib/notmuch.h | 6 ++++++ + lib/query.cc | 6 ++++++ + 3 files changed, 13 insertions(+), 1 deletion(-) + +diff --git a/lib/Makefile.local b/lib/Makefile.local +index f9ecd50..aa76b61 100644 +--- a/lib/Makefile.local ++++ b/lib/Makefile.local +@@ -11,7 +11,7 @@ LIBNOTMUCH_VERSION_MAJOR = 4 + # the time of release for any additions to the library interface, + # (and when it is incremented, the release version of the library should + # be reset to 0). +-LIBNOTMUCH_VERSION_MINOR = 2 ++LIBNOTMUCH_VERSION_MINOR = 3 + + # The release version the library interface. This should be incremented at + # the time of release if there have been no changes to the interface, (but +diff --git a/lib/notmuch.h b/lib/notmuch.h +index c2ada4b..46115c8 100644 +--- a/lib/notmuch.h ++++ b/lib/notmuch.h +@@ -708,6 +708,12 @@ const char * + notmuch_query_get_query_string (notmuch_query_t *query); + + /** ++ * Return the notmuch database of this query. See notmuch_query_create. ++ */ ++notmuch_database_t * ++notmuch_query_get_database (notmuch_query_t *query); ++ ++/** + * Exclude values for notmuch_query_set_omit_excluded. The strange + * order is to maintain backward compatibility: the old FALSE/TRUE + * options correspond to the new +diff --git a/lib/query.cc b/lib/query.cc +index 9cedb6a..5275b5a 100644 +--- a/lib/query.cc ++++ b/lib/query.cc +@@ -654,3 +654,9 @@ notmuch_query_count_threads (notmuch_query_t *query) + + return count; + } ++ ++notmuch_database_t * ++notmuch_query_get_database (notmuch_query_t *query) ++{ ++ return query->notmuch; ++} +-- +2.1.4 +