-notmuch_filenames_t *
-_notmuch_filenames_create (void *ctx,
- notmuch_database_t *notmuch,
- const char *prefix)
-{
- notmuch_filenames_t *filenames;
-
- filenames = talloc (ctx, notmuch_filenames_t);
- if (unlikely (filenames == NULL))
- return NULL;
-
- new (&filenames->iterator) Xapian::TermIterator ();
- new (&filenames->end) Xapian::TermIterator ();
-
- talloc_set_destructor (filenames, _notmuch_filenames_destructor);
-
- filenames->iterator = notmuch->xapian_db->allterms_begin (prefix);
- filenames->end = notmuch->xapian_db->allterms_end (prefix);
-
- filenames->prefix_len = strlen (prefix);
-
- filenames->filename = NULL;
-
- return filenames;
-}
-
-notmuch_bool_t
-notmuch_filenames_has_more (notmuch_filenames_t *filenames)
-{
- if (filenames == NULL)
- return NULL;
-
- return (filenames->iterator != filenames->end);
-}
-
-const char *
-notmuch_filenames_get (notmuch_filenames_t *filenames)
+static notmuch_filenames_t *
+_create_filenames_for_terms_with_prefix (void *ctx,
+ notmuch_database_t *notmuch,
+ const char *prefix)