X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fdirectory.cc;h=2540ca7647fa99e976593d052fed6b55437c9380;hp=bb6314ad7610b992726c8396251df1b64fa32606;hb=d064bd696ccc443a7ece9cfc8816999c69943223;hpb=0ea5f3fc0e0336921ba670a28201b59d2c977cfb diff --git a/lib/directory.cc b/lib/directory.cc index bb6314ad..2540ca76 100644 --- a/lib/directory.cc +++ b/lib/directory.cc @@ -21,8 +21,6 @@ #include "notmuch-private.h" #include "database-private.h" -#include - struct _notmuch_filenames { Xapian::TermIterator iterator; Xapian::TermIterator end; @@ -52,7 +50,7 @@ _notmuch_filenames_destructor (notmuch_filenames_t *filenames) * iterating over the non-prefixed portion of terms sharing a common * prefix. */ -notmuch_filenames_t * +static notmuch_filenames_t * _notmuch_filenames_create (void *ctx, notmuch_database_t *notmuch, const char *prefix) @@ -79,7 +77,7 @@ _notmuch_filenames_create (void *ctx, } notmuch_bool_t -notmuch_filenames_has_more (notmuch_filenames_t *filenames) +notmuch_filenames_valid (notmuch_filenames_t *filenames) { if (filenames == NULL) return NULL; @@ -105,7 +103,7 @@ notmuch_filenames_get (notmuch_filenames_t *filenames) } void -notmuch_filenames_advance (notmuch_filenames_t *filenames) +notmuch_filenames_move_to_next (notmuch_filenames_t *filenames) { if (filenames == NULL) return; @@ -231,7 +229,8 @@ _notmuch_directory_create (notmuch_database_t *notmuch, directory->doc.add_value (NOTMUCH_VALUE_TIMESTAMP, Xapian::sortable_serialise (0)); - directory->document_id = db->add_document (directory->doc); + directory->document_id = _notmuch_database_generate_doc_id (notmuch); + db->replace_document (directory->document_id, directory->doc); talloc_free (local); }