[Libguestfs] [PATCH 8/8] ruby: Add binding for guestfs_user_cancel.

Richard W.M. Jones rjones at redhat.com
Fri Jul 15 14:24:59 UTC 2011


-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
New in Fedora 11: Fedora Windows cross-compiler. Compile Windows
programs, test, and build Windows installers. Over 70 libraries supprt'd
http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
-------------- next part --------------
>From 1e9e351f178dcb425c4796c90fe7c8c5c250d100 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones at redhat.com>
Date: Fri, 15 Jul 2011 14:57:00 +0100
Subject: [PATCH 8/8] ruby: Add binding for guestfs_user_cancel.

---
 generator/generator_ruby.ml |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/generator/generator_ruby.ml b/generator/generator_ruby.ml
index 7c8788d..a21334a 100644
--- a/generator/generator_ruby.ml
+++ b/generator/generator_ruby.ml
@@ -303,6 +303,26 @@ get_all_event_callbacks (guestfs_h *g, size_t *len_rtn)
   return r;
 }
 
+/*
+ * call-seq:
+ *   g.user_cancel() -> nil
+ *
+ * Call
+ * +guestfs_user_cancel+[http://libguestfs.org/guestfs.3.html#guestfs_user_cancel]
+ * to cancel the current transfer.  This is safe to call from Ruby
+ * signal handlers and threads.
+ */
+static VALUE
+ruby_user_cancel (VALUE gv)
+{
+  guestfs_h *g;
+
+  Data_Get_Struct (gv, guestfs_h, g);
+  if (g)
+    guestfs_user_cancel (g);
+  return Qnil;
+}
+
 ";
 
   List.iter (
@@ -570,6 +590,8 @@ void Init__guestfs ()
                     ruby_set_event_callback, 2);
   rb_define_method (c_guestfs, \"delete_event_callback\",
                     ruby_delete_event_callback, 1);
+  rb_define_method (c_guestfs, \"user_cancel\",
+                    ruby_user_cancel, 0);
 
 ";
 
-- 
1.7.5.2



More information about the Libguestfs mailing list