summaryrefslogtreecommitdiffstats
path: root/ruby
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2009-06-29 12:26:11 +0100
committerRichard W.M. Jones <rjones@redhat.com>2009-06-29 12:26:11 +0100
commitb2ed0f4c55c2bd3d07341ba2207f0cb238eb4e18 (patch)
tree1a8afad7895f932501ff806a5dd3bfc9f2ed5f26 /ruby
parent405cf2a5772611ea05cca9fefa843154a9bc64a3 (diff)
downloadlibguestfs-b2ed0f4c55c2bd3d07341ba2207f0cb238eb4e18.tar.gz
libguestfs-b2ed0f4c55c2bd3d07341ba2207f0cb238eb4e18.tar.xz
libguestfs-b2ed0f4c55c2bd3d07341ba2207f0cb238eb4e18.zip
Generated code for df / df-h.
Diffstat (limited to 'ruby')
-rw-r--r--ruby/ext/guestfs/_guestfs.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/ruby/ext/guestfs/_guestfs.c b/ruby/ext/guestfs/_guestfs.c
index a48ecabb..336a3a42 100644
--- a/ruby/ext/guestfs/_guestfs.c
+++ b/ruby/ext/guestfs/_guestfs.c
@@ -4521,6 +4521,44 @@ static VALUE ruby_guestfs_tail_n (VALUE gv, VALUE nrlinesv, VALUE pathv)
return rv;
}
+static VALUE ruby_guestfs_df (VALUE gv)
+{
+ guestfs_h *g;
+ Data_Get_Struct (gv, guestfs_h, g);
+ if (!g)
+ rb_raise (rb_eArgError, "%s: used handle after closing it", "df");
+
+
+ char *r;
+
+ r = guestfs_df (g);
+ if (r == NULL)
+ rb_raise (e_Error, "%s", guestfs_last_error (g));
+
+ VALUE rv = rb_str_new2 (r);
+ free (r);
+ return rv;
+}
+
+static VALUE ruby_guestfs_df_h (VALUE gv)
+{
+ guestfs_h *g;
+ Data_Get_Struct (gv, guestfs_h, g);
+ if (!g)
+ rb_raise (rb_eArgError, "%s: used handle after closing it", "df_h");
+
+
+ char *r;
+
+ r = guestfs_df_h (g);
+ if (r == NULL)
+ rb_raise (e_Error, "%s", guestfs_last_error (g));
+
+ VALUE rv = rb_str_new2 (r);
+ free (r);
+ return rv;
+}
+
/* Initialize the module. */
void Init__guestfs ()
{
@@ -4883,4 +4921,8 @@ void Init__guestfs ()
ruby_guestfs_tail, 1);
rb_define_method (c_guestfs, "tail_n",
ruby_guestfs_tail_n, 2);
+ rb_define_method (c_guestfs, "df",
+ ruby_guestfs_df, 0);
+ rb_define_method (c_guestfs, "df_h",
+ ruby_guestfs_df_h, 0);
}