+static notmuch_status_t
+_sexp_parse_wildcard (notmuch_database_t *notmuch,
+ const _sexp_prefix_t *parent,
+ std::string match,
+ Xapian::Query &output)
+{
+
+ std::string term_prefix = parent ? _find_prefix (parent->name) : "";
+
+ if (parent && ! (parent->flags & SEXP_FLAG_WILDCARD)) {
+ _notmuch_database_log (notmuch, "'%s' does not support wildcard queries\n", parent->name);
+ return NOTMUCH_STATUS_BAD_QUERY_SYNTAX;
+ }
+
+ output = Xapian::Query (Xapian::Query::OP_WILDCARD,
+ term_prefix + Xapian::Unicode::tolower (match));
+ return NOTMUCH_STATUS_SUCCESS;
+}
+