diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-06-29 15:18:17 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-06-29 15:19:10 +0100 |
commit | c6d6f5ae1b76ec9aa5c540906aeed73d25d13eb9 (patch) | |
tree | 3f090396c5b90e0829c3ab25f8c3d8275726a46e /ocaml/guestfs_c_actions.c | |
parent | 4dff42aa13dd726fb6b02843d0f4db4b4b330fe3 (diff) | |
download | libguestfs-c6d6f5ae1b76ec9aa5c540906aeed73d25d13eb9.tar.gz libguestfs-c6d6f5ae1b76ec9aa5c540906aeed73d25d13eb9.tar.xz libguestfs-c6d6f5ae1b76ec9aa5c540906aeed73d25d13eb9.zip |
Generated code for 'initrd-list'.
Diffstat (limited to 'ocaml/guestfs_c_actions.c')
-rw-r--r-- | ocaml/guestfs_c_actions.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/ocaml/guestfs_c_actions.c b/ocaml/guestfs_c_actions.c index a5e18940..6385e806 100644 --- a/ocaml/guestfs_c_actions.c +++ b/ocaml/guestfs_c_actions.c @@ -4611,3 +4611,29 @@ ocaml_guestfs_du (value gv, value pathv) CAMLreturn (rv); } +CAMLprim value +ocaml_guestfs_initrd_list (value gv, value pathv) +{ + CAMLparam2 (gv, pathv); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("initrd_list: used handle after closing it"); + + const char *path = String_val (pathv); + int i; + char **r; + + caml_enter_blocking_section (); + r = guestfs_initrd_list (g, path); + caml_leave_blocking_section (); + if (r == NULL) + ocaml_guestfs_raise_error (g, "initrd_list"); + + rv = caml_copy_string_array ((const char **) r); + for (i = 0; r[i] != NULL; ++i) free (r[i]); + free (r); + CAMLreturn (rv); +} + |