From: David Bremner Date: Tue, 24 Aug 2021 15:17:12 +0000 (-0700) Subject: lib: split notmuch_query_create X-Git-Tag: archive/debian/0.34_rc0-1~62 X-Git-Url: https://git.notmuchmail.org/git?a=commitdiff_plain;h=34733fa25ed3ad8bd48621d66b7877af3426f544;p=notmuch lib: split notmuch_query_create Most of the function will be re-usable when creating a query from an s-expression. --- diff --git a/lib/query.cc b/lib/query.cc index 792aba21..39b85e91 100644 --- a/lib/query.cc +++ b/lib/query.cc @@ -84,9 +84,9 @@ _notmuch_query_destructor (notmuch_query_t *query) return 0; } -notmuch_query_t * -notmuch_query_create (notmuch_database_t *notmuch, - const char *query_string) +static notmuch_query_t * +_notmuch_query_constructor (notmuch_database_t *notmuch, + const char *query_string) { notmuch_query_t *query; @@ -116,6 +116,19 @@ notmuch_query_create (notmuch_database_t *notmuch, return query; } +notmuch_query_t * +notmuch_query_create (notmuch_database_t *notmuch, + const char *query_string) +{ + + notmuch_query_t *query = _notmuch_query_constructor (notmuch, query_string); + + if (! query) + return NULL; + + return query; +} + static notmuch_status_t _notmuch_query_ensure_parsed (notmuch_query_t *query) {