X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fdirectory.cc;h=f576e33673bec51e2c5912c6a78447634416ba71;hp=461c0cc367801b72819f429013a214552efc279d;hb=67c3bc9db48c9e12d648df4792c706cae723676c;hpb=f93b7218c3e2d11c5b3cdd4c367a42ca7a7ede77 diff --git a/lib/directory.cc b/lib/directory.cc index 461c0cc3..f576e336 100644 --- a/lib/directory.cc +++ b/lib/directory.cc @@ -52,7 +52,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 +79,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 +105,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; @@ -213,7 +213,7 @@ _notmuch_directory_create (notmuch_database_t *notmuch, Xapian::docid parent_id; char *term = talloc_asprintf (local, "%s%s", _find_prefix ("directory"), db_path); - directory->doc.add_term (term); + directory->doc.add_term (term, 0); directory->doc.set_data (path); @@ -225,13 +225,14 @@ _notmuch_directory_create (notmuch_database_t *notmuch, term = talloc_asprintf (local, "%s%u:%s", _find_prefix ("directory-direntry"), parent_id, basename); - directory->doc.add_term (term); + directory->doc.add_term (term, 0); } 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); }