Generated code for 'wc_*' commands.
[libguestfs.git] / perl / Guestfs.xs
index 8a6c4bb..1dc634f 100644 (file)
@@ -2583,3 +2583,112 @@ PREINIT:
       }
       free (lines);
 
+void
+glob_expand (g, pattern)
+      guestfs_h *g;
+      char *pattern;
+PREINIT:
+      char **paths;
+      int i, n;
+ PPCODE:
+      paths = guestfs_glob_expand (g, pattern);
+      if (paths == NULL)
+        croak ("glob_expand: %s", guestfs_last_error (g));
+      for (n = 0; paths[n] != NULL; ++n) /**/;
+      EXTEND (SP, n);
+      for (i = 0; i < n; ++i) {
+        PUSHs (sv_2mortal (newSVpv (paths[i], 0)));
+        free (paths[i]);
+      }
+      free (paths);
+
+void
+scrub_device (g, device)
+      guestfs_h *g;
+      char *device;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_scrub_device (g, device);
+      if (r == -1)
+        croak ("scrub_device: %s", guestfs_last_error (g));
+
+void
+scrub_file (g, file)
+      guestfs_h *g;
+      char *file;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_scrub_file (g, file);
+      if (r == -1)
+        croak ("scrub_file: %s", guestfs_last_error (g));
+
+void
+scrub_freespace (g, dir)
+      guestfs_h *g;
+      char *dir;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_scrub_freespace (g, dir);
+      if (r == -1)
+        croak ("scrub_freespace: %s", guestfs_last_error (g));
+
+SV *
+mkdtemp (g, template)
+      guestfs_h *g;
+      char *template;
+PREINIT:
+      char *dir;
+   CODE:
+      dir = guestfs_mkdtemp (g, template);
+      if (dir == NULL)
+        croak ("mkdtemp: %s", guestfs_last_error (g));
+      RETVAL = newSVpv (dir, 0);
+      free (dir);
+ OUTPUT:
+      RETVAL
+
+SV *
+wc_l (g, path)
+      guestfs_h *g;
+      char *path;
+PREINIT:
+      int lines;
+   CODE:
+      lines = guestfs_wc_l (g, path);
+      if (lines == -1)
+        croak ("wc_l: %s", guestfs_last_error (g));
+      RETVAL = newSViv (lines);
+ OUTPUT:
+      RETVAL
+
+SV *
+wc_w (g, path)
+      guestfs_h *g;
+      char *path;
+PREINIT:
+      int words;
+   CODE:
+      words = guestfs_wc_w (g, path);
+      if (words == -1)
+        croak ("wc_w: %s", guestfs_last_error (g));
+      RETVAL = newSViv (words);
+ OUTPUT:
+      RETVAL
+
+SV *
+wc_c (g, path)
+      guestfs_h *g;
+      char *path;
+PREINIT:
+      int chars;
+   CODE:
+      chars = guestfs_wc_c (g, path);
+      if (chars == -1)
+        croak ("wc_c: %s", guestfs_last_error (g));
+      RETVAL = newSViv (chars);
+ OUTPUT:
+      RETVAL
+