lib: split notmuch_query_create

Most of the function will be re-usable when creating a query from an
s-expression.
This commit is contained in:
David Bremner 2021-08-24 08:17:12 -07:00
parent a83ad52da4
commit 34733fa25e

View file

@ -84,9 +84,9 @@ _notmuch_query_destructor (notmuch_query_t *query)
return 0; return 0;
} }
notmuch_query_t * static notmuch_query_t *
notmuch_query_create (notmuch_database_t *notmuch, _notmuch_query_constructor (notmuch_database_t *notmuch,
const char *query_string) const char *query_string)
{ {
notmuch_query_t *query; notmuch_query_t *query;
@ -116,6 +116,19 @@ notmuch_query_create (notmuch_database_t *notmuch,
return query; 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 static notmuch_status_t
_notmuch_query_ensure_parsed (notmuch_query_t *query) _notmuch_query_ensure_parsed (notmuch_query_t *query)
{ {