From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 08F996DE0243 for ; Tue, 5 Apr 2016 18:52:33 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.02 X-Spam-Level: X-Spam-Status: No, score=-0.02 tagged_above=-999 required=5 tests=[AWL=-0.009, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-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 jl9omuCsEOpl for ; Tue, 5 Apr 2016 18:52:25 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 0BD0C6DE01F7 for ; Tue, 5 Apr 2016 18:52:24 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.84) (envelope-from ) id 1anceQ-0005T3-DU; Tue, 05 Apr 2016 21:52:58 -0400 Received: (nullmailer pid 22103 invoked by uid 1000); Wed, 06 Apr 2016 01:52:22 -0000 From: David Bremner To: Daniel Kahn Gillmor , Notmuch Mail Subject: Re: [PATCH v2 4/7] Add internal functions to search for alternate doc types In-Reply-To: <1459606541-23889-4-git-send-email-dkg@fifthhorseman.net> References: <1459445693-3900-1-git-send-email-dkg@fifthhorseman.net> <1459606541-23889-1-git-send-email-dkg@fifthhorseman.net> <1459606541-23889-4-git-send-email-dkg@fifthhorseman.net> User-Agent: Notmuch/0.21+74~g6c60fb1 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Tue, 05 Apr 2016 22:52:22 -0300 Message-ID: <87shyzfqqx.fsf@zancas.localnet> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.20 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: Wed, 06 Apr 2016 01:52:33 -0000 Daniel Kahn Gillmor writes: > Publicly we are only exposing the non-ghost documents (of "type" > "mail"). But internally we might want to inspect the ghost messages > as well. > > This changeset adds two new private interfaces to queries to recover > information about alternate document types. > --- > lib/notmuch-private.h | 10 ++++++++++ > lib/query.cc | 18 ++++++++++++++++-- > 2 files changed, 26 insertions(+), 2 deletions(-) > > diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h > index 5dd4770..cbfc144 100644 > --- a/lib/notmuch-private.h > +++ b/lib/notmuch-private.h > @@ -477,6 +477,16 @@ void > _notmuch_doc_id_set_remove (notmuch_doc_id_set_t *doc_ids, > unsigned int doc_id); > > +notmuch_status_t > +_notmuch_query_search_messages_type_st (notmuch_query_t *query, > + const char *type, > + notmuch_messages_t **out); > + > +notmuch_status_t > +_notmuch_query_count_messages_type_st (notmuch_query_t *query, > + const char *type, > + unsigned *count_out); I was wondering if we should follow Xapian nomenclature and call these functions _notmuch_query_{search, count}_documents This assumes only going with the status returning versions