From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id cFc0O96U82DrFgAAgWs5BA (envelope-from ) for ; Sun, 18 Jul 2021 04:41:34 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id QAvRNt6U82A+XwAA1q6Kng (envelope-from ) for ; Sun, 18 Jul 2021 02:41:34 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8B9601E806 for ; Sun, 18 Jul 2021 04:41:34 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 4D4012992D; Sat, 17 Jul 2021 22:41:05 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id D3B6729093 for ; Sat, 17 Jul 2021 22:40:39 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id CAD635FD21; Sat, 17 Jul 2021 22:40:39 -0400 (EDT) Received: (nullmailer pid 3853922 invoked by uid 1000); Sun, 18 Jul 2021 02:40:27 -0000 From: David Bremner To: notmuch@notmuchmail.org Cc: David Bremner Subject: [PATCH 02/25] lib: split notmuch_query_create Date: Sat, 17 Jul 2021 23:39:58 -0300 Message-Id: <20210718024021.3850340-3-david@tethera.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210718024021.3850340-1-david@tethera.net> References: <20210718024021.3850340-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: F2VKG54YFSQOD5JECOTO5AL4LTEQLWA3 X-Message-ID-Hash: F2VKG54YFSQOD5JECOTO5AL4LTEQLWA3 X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1626576094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=hb9RaqpWsTlevcxFvpglPVwMFyAJeKZ7u3vCGv1yTSo=; b=ecN3ct330yn0HCkzTG0o2dmMmaW/oluIKc16p3rTpLnfxuTq6IkL5lvriDsM9xhjvsBCrD c36zdYtTYFBJcAmUFMyoxlEi9aPXz8ppaEkWPUxh8cMmRYfqABPMFKK/8GMUdVe4gSdudd +mVY9VEOmvb+D6Oaw9BGEo5tMd84CR/UMTQdepEU+FcWOvbGu6yIQSSsZBKmupD6Re/8o4 XmJDI8ij4AZ+cbPJLml/2g7LOV0rsAnK5mBXHdRnSYrut69lI1U8NBnbT97q3d2K7C/Wv2 XA0vfkLBCwa1BNnQjvyKkRU10+0wo1ftPESBbi8tALZbsDNgHEmrEgH2up344w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626576094; a=rsa-sha256; cv=none; b=cwPcAlQKfTepO6M6eA4MPNCTBU74M3ZtpMirJ6WkAGDFcXyu07zCwUXaaYYpWUQ6Yqx3tC ZXXQ97G0VqTuIxhKoHu49gdZUfxr6vW6NZa3YnR2DIv398/QvbelOvAGnFlxjoYBonClQr EAqrwuFle/e70BrApwM/ffEKW8xUJe/rA3iS5XdiU/D4WCsqAbRwEBwCSw0I/ir8cSn2HY ZV1i1km4/i8+pYbDmXDIqzkMedQpB0qoowZZvOUDsxwj4YEwpMl5rDNUxXtK0SITrXqFVs j83HHyD/fLCvs+v6HPYnSl2jCSPY2PW9nv3oSePZQvWyU52BEw1VtbVEjqLPww== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.07 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 8B9601E806 X-Spam-Score: -1.07 X-Migadu-Scanner: scn0.migadu.com X-TUID: AjX/ufA+pnCq Most of the function will be re-usable when creating a query from an s-expression. --- lib/query.cc | 19 ++++++++++++++++--- 1 file 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) { -- 2.30.2