diff options
author | Richard Jones <rjones@redhat.com> | 2009-06-08 17:44:18 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-06-08 17:44:18 +0100 |
commit | 460d139e6a52da67a4f1947035b1978610349f78 (patch) | |
tree | 798177aa71bc9615074cd1a9a351ff4b38165c7c /ruby | |
parent | 3de234656bc61a2d35b0f1a9ccb1e6ef7535166b (diff) | |
download | libguestfs-460d139e6a52da67a4f1947035b1978610349f78.tar.gz libguestfs-460d139e6a52da67a4f1947035b1978610349f78.tar.xz libguestfs-460d139e6a52da67a4f1947035b1978610349f78.zip |
Generated code for ntfs_3g_probe command.
Diffstat (limited to 'ruby')
-rw-r--r-- | ruby/ext/guestfs/_guestfs.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/ruby/ext/guestfs/_guestfs.c b/ruby/ext/guestfs/_guestfs.c index 661e3716..38256dc0 100644 --- a/ruby/ext/guestfs/_guestfs.c +++ b/ruby/ext/guestfs/_guestfs.c @@ -3981,6 +3981,28 @@ static VALUE ruby_guestfs_sleep (VALUE gv, VALUE secsv) return Qnil; } +static VALUE ruby_guestfs_ntfs_3g_probe (VALUE gv, VALUE rwv, VALUE devicev) +{ + guestfs_h *g; + Data_Get_Struct (gv, guestfs_h, g); + if (!g) + rb_raise (rb_eArgError, "%s: used handle after closing it", "ntfs_3g_probe"); + + int rw = RTEST (rwv); + const char *device = StringValueCStr (devicev); + if (!device) + rb_raise (rb_eTypeError, "expected string for parameter %s of %s", + "device", "ntfs_3g_probe"); + + int r; + + r = guestfs_ntfs_3g_probe (g, rw, device); + if (r == -1) + rb_raise (e_Error, "%s", guestfs_last_error (g)); + + return INT2NUM (r); +} + /* Initialize the module. */ void Init__guestfs () { @@ -4313,4 +4335,6 @@ void Init__guestfs () ruby_guestfs_e2fsck_f, 1); rb_define_method (c_guestfs, "sleep", ruby_guestfs_sleep, 1); + rb_define_method (c_guestfs, "ntfs_3g_probe", + ruby_guestfs_ntfs_3g_probe, 2); } |