X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fdatabase-private.h;h=0d12ec1efde57b4862f1001facdbfafe3dec54cd;hp=041602cdc6a8911b33531cfa8e0dbd72307b8242;hb=f5d4349921ded021756d6754d347420e68b23111;hpb=a09293793f43b93b7008dd361b192199ad528fca diff --git a/lib/database-private.h b/lib/database-private.h index 041602cd..0d12ec1e 100644 --- a/lib/database-private.h +++ b/lib/database-private.h @@ -32,6 +32,8 @@ #include "notmuch-private.h" +#define ARRAY_SIZE(arr) (sizeof (arr) / sizeof (arr[0])) + #ifdef SILENCE_XAPIAN_DEPRECATION_WARNINGS #define XAPIAN_DEPRECATED(D) D #endif @@ -187,7 +189,11 @@ operator& (notmuch_field_flag_t a, notmuch_field_flag_t b) struct _notmuch_database { bool exception_reported; - char *path; + /* Path to actual database */ + const char *xapian_path; + + /* Path to config loaded, if any */ + const char *config_path; int atomic_nesting; /* true if changes have been made in this atomic section */ @@ -226,6 +232,9 @@ struct _notmuch_database { * here, but at least they are small */ notmuch_string_map_t *user_prefix; notmuch_string_map_t *user_header; + + /* Cached and possibly overridden configuration */ + notmuch_string_map_t *config; }; /* Prior to database version 3, features were implied by the database @@ -263,4 +272,23 @@ _notmuch_database_find_doc_ids (notmuch_database_t *notmuch, const char *value, Xapian::PostingIterator *begin, Xapian::PostingIterator *end); + +#define NOTMUCH_DATABASE_VERSION 3 + +/* features.cc */ + +_notmuch_features +_notmuch_database_parse_features (const void *ctx, const char *features, unsigned int version, + char mode, char **incompat_out); + +char * +_notmuch_database_print_features (const void *ctx, unsigned int features); + +/* prefix.cc */ +notmuch_status_t +_notmuch_database_setup_standard_query_fields (notmuch_database_t *notmuch); + +notmuch_status_t +_notmuch_database_setup_user_query_fields (notmuch_database_t *notmuch); + #endif