diff options
| author | David Bremner <david@tethera.net> | 2021-08-24 08:17:12 -0700 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2021-09-04 17:07:19 -0700 |
| commit | 34733fa25ed3ad8bd48621d66b7877af3426f544 (patch) | |
| tree | 32ae4c4a2cd2bef4784ddf10c5a15110408c3fa3 /lib/query.cc | |
| parent | a83ad52da40b51b8419cae3c9ce1517ac33e547c (diff) | |
lib: split notmuch_query_create
Most of the function will be re-usable when creating a query from an
s-expression.
Diffstat (limited to 'lib/query.cc')
| -rw-r--r-- | lib/query.cc | 19 |
1 files changed, 16 insertions, 3 deletions
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) { |
