summaryrefslogtreecommitdiffstats
path: root/ocaml/guestfs_c_actions.c
diff options
context:
space:
mode:
authorRichard Jones <rjones@trick.home.annexia.org>2009-06-22 08:20:42 +0100
committerRichard Jones <rjones@trick.home.annexia.org>2009-06-22 08:20:42 +0100
commitad8a256f54a6cb99f89bb444c8597a152a793dce (patch)
treef82b1ef05fe745c9cb2ec93275b9d0909f1a882e /ocaml/guestfs_c_actions.c
parent05c34c1c1479bb07b31cfbf912743a8cf014a636 (diff)
downloadlibguestfs-ad8a256f54a6cb99f89bb444c8597a152a793dce.tar.gz
libguestfs-ad8a256f54a6cb99f89bb444c8597a152a793dce.tar.xz
libguestfs-ad8a256f54a6cb99f89bb444c8597a152a793dce.zip
Generated code for 'glob-expand'.
Diffstat (limited to 'ocaml/guestfs_c_actions.c')
-rw-r--r--ocaml/guestfs_c_actions.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/ocaml/guestfs_c_actions.c b/ocaml/guestfs_c_actions.c
index e4dc5099..1ce55f0a 100644
--- a/ocaml/guestfs_c_actions.c
+++ b/ocaml/guestfs_c_actions.c
@@ -4248,3 +4248,29 @@ ocaml_guestfs_sh_lines (value gv, value commandv)
CAMLreturn (rv);
}
+CAMLprim value
+ocaml_guestfs_glob_expand (value gv, value patternv)
+{
+ CAMLparam2 (gv, patternv);
+ CAMLlocal1 (rv);
+
+ guestfs_h *g = Guestfs_val (gv);
+ if (g == NULL)
+ caml_failwith ("glob_expand: used handle after closing it");
+
+ const char *pattern = String_val (patternv);
+ int i;
+ char **r;
+
+ caml_enter_blocking_section ();
+ r = guestfs_glob_expand (g, pattern);
+ caml_leave_blocking_section ();
+ if (r == NULL)
+ ocaml_guestfs_raise_error (g, "glob_expand");
+
+ rv = caml_copy_string_array ((const char **) r);
+ for (i = 0; r[i] != NULL; ++i) free (r[i]);
+ free (r);
+ CAMLreturn (rv);
+}
+