aboutsummaryrefslogtreecommitdiff
path: root/lib/notmuch.h
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2021-08-24 08:17:13 -0700
committerDavid Bremner <david@tethera.net>2021-09-04 17:07:19 -0700
commitc4f2f33a50643b41e6dbf0519c563ae7db48beab (patch)
tree9e26ea82062efea11e4131244f378d9b8719bc6f /lib/notmuch.h
parent34733fa25ed3ad8bd48621d66b7877af3426f544 (diff)
lib: define notmuch_query_create_with_syntax
Set the parsing syntax when the (notmuch) query object is created. Initially the library always returns a trivial query that matches all messages when using s-expression syntax. It seems better to select the syntax at query creation time because the lazy parsing is an implementation detail.
Diffstat (limited to 'lib/notmuch.h')
-rw-r--r--lib/notmuch.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/notmuch.h b/lib/notmuch.h
index ef11ed1b..2f1ee951 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -961,6 +961,16 @@ notmuch_query_t *
notmuch_query_create (notmuch_database_t *database,
const char *query_string);
+typedef enum {
+ NOTMUCH_QUERY_SYNTAX_XAPIAN,
+ NOTMUCH_QUERY_SYNTAX_SEXP
+} notmuch_query_syntax_t;
+
+notmuch_status_t
+notmuch_query_create_with_syntax (notmuch_database_t *database,
+ const char *query_string,
+ notmuch_query_syntax_t syntax,
+ notmuch_query_t **output);
/**
* Sort values for notmuch_query_set_sort.
*/