From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id SCKdKt4RImSHEAAASxT56A (envelope-from ) for ; Mon, 27 Mar 2023 23:59:58 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id cLafKt4RImTLyQAA9RJhRA (envelope-from ) for ; Mon, 27 Mar 2023 23:59:58 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (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 8076725C8D for ; Mon, 27 Mar 2023 23:59:58 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 040795F6BF; Mon, 27 Mar 2023 21:59:50 +0000 (UTC) Received: from mail-oo1-xc2b.google.com (mail-oo1-xc2b.google.com [IPv6:2607:f8b0:4864:20::c2b]) by mail.notmuchmail.org (Postfix) with ESMTPS id 32BD25F378 for ; Mon, 27 Mar 2023 21:59:47 +0000 (UTC) Received: by mail-oo1-xc2b.google.com with SMTP id o26-20020a4ad49a000000b0053964a84b0fso1584845oos.7 for ; Mon, 27 Mar 2023 14:59:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679954385; 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=IfEgf+X4r+ELkFcz2W/3Mnlw6Z4hYUdPMBQkKUjCIfU=; b=ddBDyRz6dcHBCaBZeLABLb9JgpgqpGUwwTQ9dD/+AKOTNVbeyRUadPdX4JsCnNa1jH W6DR+NPkkS8S6mpDamaIAjCJYiB6GUCSArqfuV2Nok+AQGUXm0PNBuweSHrU19LKbaEF BiTkDbIpzoigpwCxMH8csKZT7JSNv8RkXHauraHXVgekRET/tUayiQBjuXfmtMqrwyeG cTR6RnN21GRyIGH6ReKlTSPo/qM1WqSvofJfJudmAcnRI+ot/lGyqJfPqjSmPgbiuNmX TyaREqSlUFkidraTnmKoSxjzXf31/fKzZ8n9cy6NbTZBpcjDrp/gZu5uAfM96ayzrlwd 2jvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679954385; 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=IfEgf+X4r+ELkFcz2W/3Mnlw6Z4hYUdPMBQkKUjCIfU=; b=d2kE2VES++BCWK0dgDu7vwQjIab4zhwmDRFOdWUj/yVrW8RRGBdb9htaemZHbFpuxV /3HHFT3ZUZD0aNt4+eMG7OP0edM+Dx1HPT6zRu2z+J23cnflyXmQxnmHSR+5EVYZLA6v OltSlhyoLpQKBzLI4xgPTTcJBcK1/sbLP8+eclRZEghXPiT7dGKIskmx0Fr/YjzpqUnH gjmDdWPZ38Ei5SOwS4zb605RKQQZcSO7s3GGbAsFoMTAwtk08h0c/M/4pdWBiX2wXDwU suWIUWgXJ58l/mS4/hDazSS7ZFTCa339wi/UrP54GhDga3V6Gua9ZbEPmIqdtzAmOgkz Uffg== X-Gm-Message-State: AO0yUKV4s9jcba8pPVNDq2kU+tDv9pB9fzT9iNyRgpd9YAC8v6CTw7bR /PGL0m/0zGiXAejjt5LTVmLWPu7UtqI= X-Google-Smtp-Source: AK7set8fAQK8CSFqqSzvHL4hDQxxVEVL1XRIhYBBbr0pmmOWL3JTJ/+7iAmC7UI4jBVofoALbpC+hQ== X-Received: by 2002:a4a:498a:0:b0:525:129c:6165 with SMTP id z132-20020a4a498a000000b00525129c6165mr7110900ooa.6.1679954385605; Mon, 27 Mar 2023 14:59:45 -0700 (PDT) Received: from localhost ([2806:2f0:4060:fff1:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id x3-20020a4a97c3000000b00524fe20aee5sm11843901ooi.34.2023.03.27.14.59.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 14:59:44 -0700 (PDT) From: Felipe Contreras To: notmuch@notmuchmail.org Subject: [PATCH 1/3] ruby: add filenames helper Date: Mon, 27 Mar 2023 15:59:40 -0600 Message-Id: <20230327215942.13286-2-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.39.2.13.g1fb56cf030 In-Reply-To: <20230327215942.13286-1-felipe.contreras@gmail.com> References: <20230327215942.13286-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Message-ID-Hash: QT5PQTMS3UAUJIBCMHLUYQ3NB2Q3DMIA X-Message-ID-Hash: QT5PQTMS3UAUJIBCMHLUYQ3NB2Q3DMIA 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 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=1679954398; a=rsa-sha256; cv=none; b=Xi9ziIalHv7LAKOKCe5xeCyQXuH/u/LBCLbGxhHms2C62MC6VphxK9zde4xITN/4ZjiB1E aZOI/jf2cGa79w2gR5wfFXohMA2uzKDGeGTXdC3Aoszwe5uPF9qsgvVSARo5tjwJj+u+g6 Spjz5HSD2UXpPaD528dk0ZDidKhWNL2vsfHqPWmjxFwSsMMfm8obmqY1ZdE2nvXf5A2waL siBm+YdXOuWTBztBlz01/vKDheqMuKvU7NPGgO2aoe24l569xTpLQ42y+5ghlxgls02LJa QD6ufGSHOpY0hvq/VpR5ZL+kljro73HbyCwNm0qD6SgAryuenLIiHrquidqNpw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=ddBDyRz6; 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 2a01:4f9:c011:7a79::1 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=1679954398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to: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=4/F2ARA04wgmxo4G0Y/CIVUhwpTtnFedFfobm6DL8nA=; b=T8Ru9vtDtpdAdDGA0UugJNdvSy9KOzWPXZEBz9Imp4AflVTV3SpaX0yvDjI18T3EWr+4kw SN6ISY1V6O1bZudq+PWcfz55U2DjjezVP61jTQSXAPgDTzVQvxUvapm8DL3pitziEyZnFW kWA951JSpKMxUvBjRN+ilz1N4Qhha1qjlfHIp9Ghml36eRx12vlfT0UBTQLzoPvb+bf3dS u+tYUBtq8Gjb4cCp1zlIWZEdvp0KrdYYh2SCp/ge4O8mir8raJRN0uW+2vZN0DI5iq8L62 a9KsMDolP2+adH6aAKKIP776OOUCN204IlpEzvY0+dIAQxkly44TYoUsR4emJA== Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=ddBDyRz6; 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 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -0.60 X-Spam-Score: -0.60 X-Migadu-Queue-Id: 8076725C8D X-TUID: csol0RJDxapv Right now it doesn't do much, but it will help for further reorganization. Signed-off-by: Felipe Contreras --- bindings/ruby/defs.h | 3 +++ bindings/ruby/directory.c | 4 ++-- bindings/ruby/filenames.c | 6 ++++++ bindings/ruby/message.c | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h index e2541e8f..216380d4 100644 --- a/bindings/ruby/defs.h +++ b/bindings/ruby/defs.h @@ -225,6 +225,9 @@ VALUE notmuch_rb_directory_get_child_directories (VALUE self); /* filenames.c */ +VALUE +notmuch_rb_filenames_get (notmuch_filenames_t *fnames); + VALUE notmuch_rb_filenames_destroy (VALUE self); diff --git a/bindings/ruby/directory.c b/bindings/ruby/directory.c index 910f0a99..f267d82f 100644 --- a/bindings/ruby/directory.c +++ b/bindings/ruby/directory.c @@ -87,7 +87,7 @@ notmuch_rb_directory_get_child_files (VALUE self) fnames = notmuch_directory_get_child_files (dir); - return Data_Wrap_Notmuch_Object (notmuch_rb_cFileNames, ¬much_rb_filenames_type, fnames); + return notmuch_rb_filenames_get (fnames); } /* @@ -106,5 +106,5 @@ notmuch_rb_directory_get_child_directories (VALUE self) fnames = notmuch_directory_get_child_directories (dir); - return Data_Wrap_Notmuch_Object (notmuch_rb_cFileNames, ¬much_rb_filenames_type, fnames); + return notmuch_rb_filenames_get (fnames); } diff --git a/bindings/ruby/filenames.c b/bindings/ruby/filenames.c index 0dec1952..17873393 100644 --- a/bindings/ruby/filenames.c +++ b/bindings/ruby/filenames.c @@ -20,6 +20,12 @@ #include "defs.h" +VALUE +notmuch_rb_filenames_get (notmuch_filenames_t *fnames) +{ + return Data_Wrap_Notmuch_Object (notmuch_rb_cFileNames, ¬much_rb_filenames_type, fnames); +} + /* * call-seq: FILENAMES.destroy! => nil * diff --git a/bindings/ruby/message.c b/bindings/ruby/message.c index f45c95cc..0d83567c 100644 --- a/bindings/ruby/message.c +++ b/bindings/ruby/message.c @@ -120,7 +120,7 @@ notmuch_rb_message_get_filenames (VALUE self) fnames = notmuch_message_get_filenames (message); - return Data_Wrap_Notmuch_Object (notmuch_rb_cFileNames, ¬much_rb_filenames_type, fnames); + return notmuch_rb_filenames_get (fnames); } /* -- 2.39.2.13.g1fb56cf030