Re: [PATCH v2 4/7] Add internal functions to search for alternate doc types

Subject: Re: [PATCH v2 4/7] Add internal functions to search for alternate doc types

Date: Tue, 05 Apr 2016 22:52:22 -0300

To: Daniel Kahn Gillmor, Notmuch Mail

Cc:

From: David Bremner


Daniel Kahn Gillmor <dkg@fifthhorseman.net> 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

Thread: