]> git.notmuchmail.org Git - notmuch/blobdiff - lib/database-private.h
lib: Implement versioning in the database and provide upgrade function.
[notmuch] / lib / database-private.h
index 79c7916a088da6ebd22c2d007da4ff7c9720088c..5891584ec978e5f2868e5c87533462bff083b775 100644 (file)
 #include <xapian.h>
 
 struct _notmuch_database {
+    notmuch_bool_t exception_reported;
     char *path;
     notmuch_database_mode_t mode;
     Xapian::Database *xapian_db;
     Xapian::QueryParser *query_parser;
     Xapian::TermGenerator *term_gen;
+    Xapian::ValueRangeProcessor *value_range_processor;
+
+    notmuch_bool_t needs_upgrade;
 };
 
+/* Convert tags from Xapian internal format to notmuch format.
+ *
+ * The function gets a TermIterator as argument and uses that iterator to find
+ * all tag terms in the object. The tags are then converted to a
+ * notmuch_tags_t list and returned. The function needs to allocate memory for
+ * the resulting list and it uses the argument ctx as talloc context.
+ *
+ * The function returns NULL on failure.
+ */
+notmuch_tags_t *
+_notmuch_convert_tags (void *ctx, Xapian::TermIterator &i,
+                      Xapian::TermIterator &end);
+
 #endif