diff options
author | Richard Jones <rjones@redhat.com> | 2009-04-09 19:36:07 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-04-09 19:36:07 +0100 |
commit | 01c26253a12ed1e6b1199f8c85f049a7fc4aef28 (patch) | |
tree | 02a9f655430a8e7cf282b7dd9bf042640654f599 /ocaml/guestfs_c_actions.c | |
parent | 0677b12f2273ed266da9dd276c129342d6a939a2 (diff) | |
download | libguestfs-01c26253a12ed1e6b1199f8c85f049a7fc4aef28.tar.gz libguestfs-01c26253a12ed1e6b1199f8c85f049a7fc4aef28.tar.xz libguestfs-01c26253a12ed1e6b1199f8c85f049a7fc4aef28.zip |
Added aug-ls (generated code).
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 f21d63ec..f26226c0 100644 --- a/ocaml/guestfs_c_actions.c +++ b/ocaml/guestfs_c_actions.c @@ -1157,3 +1157,29 @@ ocaml_guestfs_aug_load (value gv) CAMLreturn (rv); } +CAMLprim value +ocaml_guestfs_aug_ls (value gv, value pathv) +{ + CAMLparam2 (gv, pathv); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("aug_ls: used handle after closing it"); + + const char *path = String_val (pathv); + int i; + char **r; + + caml_enter_blocking_section (); + r = guestfs_aug_ls (g, path); + caml_leave_blocking_section (); + if (r == NULL) + ocaml_guestfs_raise_error (g, "aug_ls"); + + rv = caml_copy_string_array ((const char **) r); + for (i = 0; r[i] != NULL; ++i) free (r[i]); + free (r); + CAMLreturn (rv); +} + |