summaryrefslogtreecommitdiffstats
path: root/perl/Guestfs.xs
diff options
context:
space:
mode:
Diffstat (limited to 'perl/Guestfs.xs')
-rw-r--r--perl/Guestfs.xs54
1 files changed, 54 insertions, 0 deletions
diff --git a/perl/Guestfs.xs b/perl/Guestfs.xs
index e95b2746..ce697c54 100644
--- a/perl/Guestfs.xs
+++ b/perl/Guestfs.xs
@@ -1699,3 +1699,57 @@ PREINIT:
OUTPUT:
RETVAL
+void
+strings (g, path)
+ guestfs_h *g;
+ char *path;
+PREINIT:
+ char **stringsout;
+ int i, n;
+ PPCODE:
+ stringsout = guestfs_strings (g, path);
+ if (stringsout == NULL)
+ croak ("strings: %s", guestfs_last_error (g));
+ for (n = 0; stringsout[n] != NULL; ++n) /**/;
+ EXTEND (SP, n);
+ for (i = 0; i < n; ++i) {
+ PUSHs (sv_2mortal (newSVpv (stringsout[i], 0)));
+ free (stringsout[i]);
+ }
+ free (stringsout);
+
+void
+strings_e (g, encoding, path)
+ guestfs_h *g;
+ char *encoding;
+ char *path;
+PREINIT:
+ char **stringsout;
+ int i, n;
+ PPCODE:
+ stringsout = guestfs_strings_e (g, encoding, path);
+ if (stringsout == NULL)
+ croak ("strings_e: %s", guestfs_last_error (g));
+ for (n = 0; stringsout[n] != NULL; ++n) /**/;
+ EXTEND (SP, n);
+ for (i = 0; i < n; ++i) {
+ PUSHs (sv_2mortal (newSVpv (stringsout[i], 0)));
+ free (stringsout[i]);
+ }
+ free (stringsout);
+
+SV *
+hexdump (g, path)
+ guestfs_h *g;
+ char *path;
+PREINIT:
+ char *dump;
+ CODE:
+ dump = guestfs_hexdump (g, path);
+ if (dump == NULL)
+ croak ("hexdump: %s", guestfs_last_error (g));
+ RETVAL = newSVpv (dump, 0);
+ free (dump);
+ OUTPUT:
+ RETVAL
+