X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fdatabase.cc;h=392e8b2869842130e1372b52d5d9329d0151577e;hp=66ee267fe50ebb89b3e5feda2d4b88089d414800;hb=693ca8d8a80438ce1e361e7e6d22288f52a11c55;hpb=9b60dc3cd9224eddfe9bc5cf74eeaa5f0d599d04 diff --git a/lib/database.cc b/lib/database.cc index 66ee267f..392e8b28 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -97,6 +97,9 @@ typedef struct { * STRING is the name of a file within that * directory for this mail message. * + * property: Has a property with key=value + * FIXME: if no = is present, should match on any value + * * A mail document also has four values: * * TIMESTAMP: The time_t value corresponding to the message's @@ -259,11 +262,12 @@ static prefix_t BOOLEAN_PREFIX_EXTERNAL[] = { { "is", "K" }, { "id", "Q" }, { "path", "P" }, + { "property", "XPROPERTY" }, /* - * Without the ":", since this is a multi-letter prefix, Xapian - * will add a colon itself if the first letter of the path is - * upper-case ASCII. Including the ":" forces there to always be a - * colon, which keeps our own logic simpler. + * Unconditionally add ':' to reduce potential ambiguity with + * overlapping prefixes and/or terms that start with capital + * letters. See Xapian document termprefixes.html for related + * discussion. */ { "folder", "XFOLDER:" }, }; @@ -383,6 +387,22 @@ _notmuch_database_log (notmuch_database_t *notmuch, talloc_free (notmuch->status_string); notmuch->status_string = talloc_vasprintf (notmuch, format, va_args); + va_end (va_args); +} + +void +_notmuch_database_log_append (notmuch_database_t *notmuch, + const char *format, + ...) +{ + va_list va_args; + + va_start (va_args, format); + + if (notmuch->status_string) + notmuch->status_string = talloc_vasprintf_append (notmuch->status_string, format, va_args); + else + notmuch->status_string = talloc_vasprintf (notmuch, format, va_args); va_end (va_args); }