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 aDVADptKJ2TxEQEASxT56A (envelope-from ) for ; Fri, 31 Mar 2023 23:03:23 +0200 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 wC4cDptKJ2QdIQEAauVa8A (envelope-from ) for ; Fri, 31 Mar 2023 23:03:23 +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 0D50731C23 for ; Fri, 31 Mar 2023 23:03:22 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id A2B765F850; Fri, 31 Mar 2023 20:53:49 +0000 (UTC) Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) by mail.notmuchmail.org (Postfix) with ESMTPS id DD76D5F845 for ; Fri, 31 Mar 2023 20:53:45 +0000 (UTC) Received: by mail-oi1-x22a.google.com with SMTP id r16so17566000oij.5 for ; Fri, 31 Mar 2023 13:53:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680296024; 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=7WYraP0/9PSUd/S8kaZWMiFIvtDG9lCYjPRhFLXJxxU=; b=DfzVWftLw297z8tPlEVBGdC6ewjXIyuJeVakrAa8gPFL9xhnvLdZBqLEPLerTsMqQO jLLupfxk1Jcnof595DPaYJnaRl53Zep51Lqg+slYsRzT7I9ZYOhgSKJnanB/tNgX344e GMgJDorcVnf+AIJdME5Q+WMENU26EDgQtvwVMSZY8PKrkgm5ovEooqcic+5QMRRnkqSj DX31/8q2YFTqqyOZpLrrlLYSSokVffCngRWMfDGNGMFeRgYwUM9mqLWA5bujmBoy7cXq CIEqP7mnA8o4i2gv20x0FOOqmUFC1lcyQRAcGPpMcFW1DSupAfddGKWmLFYDkSSxUyml kL5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680296024; 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=7WYraP0/9PSUd/S8kaZWMiFIvtDG9lCYjPRhFLXJxxU=; b=TNKi+lX90gqLxY/HgwuDsVMCnm+RXJ6nyGeMOZMuZOwtVcCmXt/rYZPEaHgpoS/NcP sm5rwzi8eEq2hfJD0sjf8yG87AhFUoftWWyrQQew0oiI0z30JNltDoj/YMTk+KAlQHGb 2HCupOItZreFQ9i76eBRn22Nqu2sryPg/lK422i0zC4/qwDVpUjoOmN6oGnB+SZayNK0 tIwMyKAJXq4VyGYhzduByDaFAq9YQA/81FiFNx21f4Olu41v1SyuwVuSt2nXUFeWzk2U Bt4DpiM1oNx+zmomLHdnX9km8WTZRYdY7rxMyUEfMnB0EFYHgA6xkumaJK1QVHQbz0Zm E/Zw== X-Gm-Message-State: AAQBX9fEltAIl6/NHVCeMc23GuoKYqkMA8rCXFLUzyF7z5KaIPtlle3m CZaMv/p9j+zgeD4EVTGGwv2ObcTQdMg= X-Google-Smtp-Source: AKy350aUhEqbX72JG1Be2UT3bE3N3weWGhX1Q/Qe1K5mn9gGB9MW7aqcK/FL/5dSSmT/bXJ7KwXSUw== X-Received: by 2002:aca:1b18:0:b0:389:f9c6:bc41 with SMTP id b24-20020aca1b18000000b00389f9c6bc41mr1323604oib.22.1680296024403; Fri, 31 Mar 2023 13:53:44 -0700 (PDT) Received: from localhost ([2806:2f0:4060:fff1:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id k2-20020a056808068200b00383d9700294sm1367310oig.40.2023.03.31.13.53.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Mar 2023 13:53:43 -0700 (PDT) From: Felipe Contreras To: notmuch@notmuchmail.org Subject: [PATCH 2/3] ruby: add directory.delete Date: Fri, 31 Mar 2023 14:53:37 -0600 Message-Id: <20230331205338.174779-3-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230331205338.174779-1-felipe.contreras@gmail.com> References: <20230331205338.174779-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Message-ID-Hash: FGI33FL2K2FDSIR34LZLWRHIHPFPE5RM X-Message-ID-Hash: FGI33FL2K2FDSIR34LZLWRHIHPFPE5RM 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=1680296603; a=rsa-sha256; cv=none; b=kf6b8Pl96M2EsTiwvct4iUAYwvZhPkivI/ijZRUdZ1bFiO8TcyY6vZju5rFVMtHnHdHJKY vHUGRMP5UZ6WvqoTQTOLQdv7Kx7z7lMxlJyct7D7uJj/3O8HW3w0dJFENgdMlVCaaETZ6w UpEIQcyMFC1cLHuPWBbzSH0tCLMw9WqWAZK+V4E6sNQ2lYj5fj8BkR6Mf1e0K45EnGRhgS xcZVzZEPgvlYlKUEoaw0AwyHtNfn6cWbG3XgiHj03o4YY10v257j1iTrIFf24d0wygFjzZ V9fqRTCwzj9j5oG4RprSFEpTwSXmUs0Nm4QTaImG5JeWSflZM3RGyobROqOEBA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=DfzVWftL; 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=1680296603; 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=cTvAxKahgp08m1X6leljB2TKkPRP74N5LHSpK2JfFP4=; b=Emf+dAhrGV10H6Vhh7w9is33J4sTbYyrmIgSGhE2hEqAofUa5QJ6ufE+z8YJsaXZlrFlxg q51BetTDP+9Sxmf69w1O5NT6RgJqU/7xNaqOVjPKm8PEkFMIBN+/sR4wnKkLzqaLJHZNTg /N6ITqhwMRFFEdTwRiV2jLTC2ETw5VTKEvaoFLzqpxbXTLiEhHl4MuuKd+NwxgCqVlDM4T 4dgSgpWbLwEGeUeiKx5wzcbCAims9jbwmqiT2WiO1pkr7UXBji3oCnTwwdbFJ23Oo9ZVy0 dz6GAazRgp5D660VpsThuUyrGJAhiSNtb8uwQD22zJ3X6GA7lhlN87i42hQ/Gg== Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=DfzVWftL; 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: scn0.migadu.com X-Migadu-Spam-Score: -1.17 X-Spam-Score: -1.17 X-Migadu-Queue-Id: 0D50731C23 X-TUID: 6J3XSU8PIY97 Signed-off-by: Felipe Contreras --- bindings/ruby/defs.h | 3 +++ bindings/ruby/directory.c | 19 +++++++++++++++++++ bindings/ruby/init.c | 1 + 3 files changed, 23 insertions(+) diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h index c4943681..3ef228b7 100644 --- a/bindings/ruby/defs.h +++ b/bindings/ruby/defs.h @@ -227,6 +227,9 @@ notmuch_rb_directory_get_child_files (VALUE self); VALUE notmuch_rb_directory_get_child_directories (VALUE self); +VALUE +notmuch_rb_directory_delete (VALUE self); + /* filenames.c */ VALUE notmuch_rb_filenames_destroy (VALUE self); diff --git a/bindings/ruby/directory.c b/bindings/ruby/directory.c index 910f0a99..2fb22c70 100644 --- a/bindings/ruby/directory.c +++ b/bindings/ruby/directory.c @@ -108,3 +108,22 @@ notmuch_rb_directory_get_child_directories (VALUE self) return Data_Wrap_Notmuch_Object (notmuch_rb_cFileNames, ¬much_rb_filenames_type, fnames); } + +/* + * call-seq: DIR.delete => nil + * + * Delete directory from the database. + */ +VALUE +notmuch_rb_directory_delete (VALUE self) +{ + notmuch_directory_t *dir; + notmuch_status_t ret; + + Data_Get_Notmuch_Directory (self, dir); + + ret = notmuch_directory_delete (dir); + notmuch_rb_status_raise (ret); + + return Qnil; +} diff --git a/bindings/ruby/init.c b/bindings/ruby/init.c index c78242a0..625c6c4d 100644 --- a/bindings/ruby/init.c +++ b/bindings/ruby/init.c @@ -297,6 +297,7 @@ Init_notmuch (void) rb_define_method (notmuch_rb_cDirectory, "mtime=", notmuch_rb_directory_set_mtime, 1); /* in directory.c */ rb_define_method (notmuch_rb_cDirectory, "child_files", notmuch_rb_directory_get_child_files, 0); /* in directory.c */ rb_define_method (notmuch_rb_cDirectory, "child_directories", notmuch_rb_directory_get_child_directories, 0); /* in directory.c */ + rb_define_method (notmuch_rb_cDirectory, "delete", notmuch_rb_directory_delete, 0); /* in directory.c */ /* * Document-class: Notmuch::FileNames -- 2.40.0