From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id kII4I8OSG2RSbwEASxT56A (envelope-from ) for ; Thu, 23 Mar 2023 00:44:03 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id OFj8IsOSG2St0QAAauVa8A (envelope-from ) for ; Thu, 23 Mar 2023 00:44:03 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (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 4B842D50C for ; Thu, 23 Mar 2023 00:44:03 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 9FC785F771; Wed, 22 Mar 2023 23:43:54 +0000 (UTC) Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) by mail.notmuchmail.org (Postfix) with ESMTPS id D74CA5F42B for ; Wed, 22 Mar 2023 23:43:51 +0000 (UTC) Received: by mail-ot1-x336.google.com with SMTP id x8-20020a9d3788000000b0069f922cd5ceso2875524otb.12 for ; Wed, 22 Mar 2023 16:43:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679528630; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=B50IDb7oiZ8fL+xdGpxRnyw4QR8KtEM4atqgsH7OqhQ=; b=bDgOostA+xJ4wLXyKQ6sJrTlbxn2Ll0RN1lTMnm7cMKuc3c6mTaD3tbDfrKwfgefTA GfP2bRIcKQ6DqaeU37H3Qe1/PvV+zrRbVrZyfjres6Ev1KcxdLkrey6jEleJ2KhXDbGf LhH6QcjExo3/m9IjE8Mv2pU+oG7akegh2+6wotTVypPE8n/lXE0JjhF/qTfXdXbP9s5f EuSLI2xp29LBlHcmZFvI6EK+iTpTEGoOT+JiGFAGZomyLxUGg7KYRsRFDlyaY15VB7zi EUm8JlFIV99Akw7o+TzejJDSeETZ9Zi9fCVjNhSdV6sQQ1fGaYdk219H8dpj2iVbo3WG M0oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679528630; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=B50IDb7oiZ8fL+xdGpxRnyw4QR8KtEM4atqgsH7OqhQ=; b=KGC5Q+FJ6Zj85Ze328yiEV2bBOC/C9u5fW3FtGPKcfvQGPLf72LfxVUfCMWgJHbBM/ 6KXlIKXYR2+IgYyqdTtzLiNdTCeiduhlUhzNRoXFiPrSL56QApVYyL1gaFUOQX+22+rU 6vkvLI97yB/n3pGQd9aGD+a3Z2P1ZAI6X+WHfZrcdbVsNjYZ7Ntz3+8DnsQ0o7ega2i2 wHGdGbA+A3qvXLLlKNwuBUUum2jCCWeSV8XPeGDcXUCPU25hZs8WqPKKQsj/tD5BtfWS TC1FwG7CjHivxUJqACuDQTaQMyXdLBARkcDhn6FR1z6vCLGru/3rgiVwqlTDip8EUvtR l3NA== X-Gm-Message-State: AO0yUKUzJOPVVoVgJOFHmFBrjw9YWKt1ACGvnERQMd4zsLvf8vFGjEnS jLP3uElx5/7aWF503odat5ppV3/PHvs= X-Google-Smtp-Source: AK7set97bfi3NfPgO1KCkjKtsPqf/vyBMW+HFVfWcFmsE3lF2yefIH033QmiHUYGnsRk650kTrmEfg== X-Received: by 2002:a9d:6d14:0:b0:690:d928:af4c with SMTP id o20-20020a9d6d14000000b00690d928af4cmr2213554otp.20.1679528630160; Wed, 22 Mar 2023 16:43:50 -0700 (PDT) Received: from localhost ([2806:2f0:4060:fff1:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id v8-20020a9d69c8000000b0069f951899e1sm1655651oto.24.2023.03.22.16.43.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Mar 2023 16:43:49 -0700 (PDT) From: Felipe Contreras To: notmuch@notmuchmail.org Subject: [PATCH 1/3] ruby: add tags helper Date: Wed, 22 Mar 2023 17:43:44 -0600 Message-Id: <20230322234346.70537-2-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.39.2.13.g1fb56cf030 In-Reply-To: <20230322234346.70537-1-felipe.contreras@gmail.com> References: <20230322234346.70537-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Message-ID-Hash: 25NBYMDW32G253CPFORZ24YOK4WBTCES X-Message-ID-Hash: 25NBYMDW32G253CPFORZ24YOK4WBTCES X-MailFrom: felipe.contreras@gmail.com 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; digests; suspicious-header CC: arcnmx X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Country: DE X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1679528643; a=rsa-sha256; cv=none; b=YYjHHFQHY78ZS+Bddy8QfQmiljzoHejsF/TzgY1leutuS0HUmPIPBZ9himQaIwSoEFXLpD MjLhZQOaaQIi0PTyscqNW0Pr0tjfKy/ITn1+Fr48x9RyZrBPI6MwtMzUAPFU2EqhYYCev0 QqLhwUSowEWZrSRhHQuzu7zjRG2Nv/FAhszYXCqBw21r6lRTgcS6LKNnsx3Owef+qhFca8 950U090L2+xHkyAyCFh6rkA0ZAym3lu7qag2EcVeacthxJizZylizzZegknHr3pJ4Oy5BO gbBK1yd23xDjjAht/KhqlfX/02epr4av0zOeHh3ZFtlWV2ZuM0NX2995jX9Big== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=bDgOostA; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1679528643; 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-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=VROr79Xt2/urBERevqRHRtWIJAHpYyk22L/cQLbFgRo=; b=CE+QOC/pnKZwp+66bl5c6Pwo+Zr8N+jsrlOtJGtuRAQocesbGiOIBvQNmW2x3tGBDfXOgm 17w2ayAComovkW5lPXUpEFcSb3OGzn7jQze6r9RTcKudPjxDCtmpYPQLQZ9iKy1EGqmYt5 ETdTg8CaFrQcZZa+/nX0bg2z/d6xuGKP3BnoLiTpUz2ZGmgqiGQV0q3G4FIlnqHqN1Gl2V ahGUxO3+sqcvMKF7wwGp5WoBBLbT8aHgSAxz3VyotgWkBVy4CWijAcEyeis9stbjV7/7VW J7jNzhhBDlzjFLeQOW0qXkpPXywM06tufaBSU+XJcLcLP/hJX6cHzSyBQYkmRw== Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=bDgOostA; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: 0.37 X-Spam-Score: 0.37 X-Migadu-Queue-Id: 4B842D50C X-TUID: 1O4+NDqV6UpQ Right now it doesn't do much, but it will help for further reorganization. Signed-off-by: Felipe Contreras --- bindings/ruby/database.c | 2 +- bindings/ruby/defs.h | 3 +++ bindings/ruby/message.c | 2 +- bindings/ruby/messages.c | 2 +- bindings/ruby/tags.c | 6 ++++++ bindings/ruby/thread.c | 2 +- 6 files changed, 13 insertions(+), 4 deletions(-) diff --git a/bindings/ruby/database.c b/bindings/ruby/database.c index 9c3dbd96..9cac6005 100644 --- a/bindings/ruby/database.c +++ b/bindings/ruby/database.c @@ -408,7 +408,7 @@ notmuch_rb_database_get_all_tags (VALUE self) rb_raise (notmuch_rb_eBaseError, "%s", msg); } - return Data_Wrap_Notmuch_Object (notmuch_rb_cTags, ¬much_rb_tags_type, tags); + return notmuch_rb_tags_get (tags); } /* diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h index e2541e8f..9454658b 100644 --- a/bindings/ruby/defs.h +++ b/bindings/ruby/defs.h @@ -369,6 +369,9 @@ VALUE notmuch_rb_message_thaw (VALUE self); /* tags.c */ +VALUE +notmuch_rb_tags_get (notmuch_tags_t *tags); + VALUE notmuch_rb_tags_destroy (VALUE self); diff --git a/bindings/ruby/message.c b/bindings/ruby/message.c index f45c95cc..81085f75 100644 --- a/bindings/ruby/message.c +++ b/bindings/ruby/message.c @@ -221,7 +221,7 @@ notmuch_rb_message_get_tags (VALUE self) if (!tags) rb_raise (notmuch_rb_eMemoryError, "Out of memory"); - return Data_Wrap_Notmuch_Object (notmuch_rb_cTags, ¬much_rb_tags_type, tags); + return notmuch_rb_tags_get (tags); } /* diff --git a/bindings/ruby/messages.c b/bindings/ruby/messages.c index ca5b10d0..6369d052 100644 --- a/bindings/ruby/messages.c +++ b/bindings/ruby/messages.c @@ -71,5 +71,5 @@ notmuch_rb_messages_collect_tags (VALUE self) if (!tags) rb_raise (notmuch_rb_eMemoryError, "Out of memory"); - return Data_Wrap_Notmuch_Object (notmuch_rb_cTags, ¬much_rb_tags_type, tags); + return notmuch_rb_tags_get (tags); } diff --git a/bindings/ruby/tags.c b/bindings/ruby/tags.c index 2af85e36..cc6ea59e 100644 --- a/bindings/ruby/tags.c +++ b/bindings/ruby/tags.c @@ -20,6 +20,12 @@ #include "defs.h" +VALUE +notmuch_rb_tags_get (notmuch_tags_t *tags) +{ + return Data_Wrap_Notmuch_Object (notmuch_rb_cTags, ¬much_rb_tags_type, tags); +} + /* * call-seq: TAGS.destroy! => nil * diff --git a/bindings/ruby/thread.c b/bindings/ruby/thread.c index 7cb2a3dc..b20ed893 100644 --- a/bindings/ruby/thread.c +++ b/bindings/ruby/thread.c @@ -204,5 +204,5 @@ notmuch_rb_thread_get_tags (VALUE self) if (!tags) rb_raise (notmuch_rb_eMemoryError, "Out of memory"); - return Data_Wrap_Notmuch_Object (notmuch_rb_cTags, ¬much_rb_tags_type, tags); + return notmuch_rb_tags_get (tags); } -- 2.39.2.13.g1fb56cf030