diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-05-01 12:16:08 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-05-01 12:16:08 +0100 |
commit | f47dafd23186938a22d41739d9bc695c7760b912 (patch) | |
tree | a6e5bf03a63cae2eeca269505724ae5c5ba11020 /ruby/ext | |
parent | d9ea3e8d979c3ade1b21f27083788fd33fa3b1fa (diff) | |
download | libguestfs-f47dafd23186938a22d41739d9bc695c7760b912.tar.gz libguestfs-f47dafd23186938a22d41739d9bc695c7760b912.tar.xz libguestfs-f47dafd23186938a22d41739d9bc695c7760b912.zip |
Generated code for 'equal' command.
Diffstat (limited to 'ruby/ext')
-rw-r--r-- | ruby/ext/guestfs/_guestfs.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/ruby/ext/guestfs/_guestfs.c b/ruby/ext/guestfs/_guestfs.c index eed0b80e..83486e75 100644 --- a/ruby/ext/guestfs/_guestfs.c +++ b/ruby/ext/guestfs/_guestfs.c @@ -2715,6 +2715,31 @@ static VALUE ruby_guestfs_ping_daemon (VALUE gv) return Qnil; } +static VALUE ruby_guestfs_equal (VALUE gv, VALUE file1v, VALUE file2v) +{ + guestfs_h *g; + Data_Get_Struct (gv, guestfs_h, g); + if (!g) + rb_raise (rb_eArgError, "%s: used handle after closing it", "equal"); + + const char *file1 = StringValueCStr (file1v); + if (!file1) + rb_raise (rb_eTypeError, "expected string for parameter %s of %s", + "file1", "equal"); + const char *file2 = StringValueCStr (file2v); + if (!file2) + rb_raise (rb_eTypeError, "expected string for parameter %s of %s", + "file2", "equal"); + + int r; + + r = guestfs_equal (g, file1, file2); + if (r == -1) + rb_raise (e_Error, "%s", guestfs_last_error (g)); + + return INT2NUM (r); +} + /* Initialize the module. */ void Init__guestfs () { @@ -2951,4 +2976,6 @@ void Init__guestfs () ruby_guestfs_dmesg, 0); rb_define_method (c_guestfs, "ping_daemon", ruby_guestfs_ping_daemon, 0); + rb_define_method (c_guestfs, "equal", + ruby_guestfs_equal, 2); } |