X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=ocaml%2Fguestfs_c_actions.c;h=beb41d777f9c1583c5cc6c3f7469f89549612f37;hp=f4079564db3f246f40ac5f7f0574b5f74f4fea18;hb=f450ce75b754fb869b34433c0126f7bb592b141b;hpb=62ccc07e744d5ebfb45d9344827d36f9f61699f4 diff --git a/ocaml/guestfs_c_actions.c b/ocaml/guestfs_c_actions.c index f407956..beb41d7 100644 --- a/ocaml/guestfs_c_actions.c +++ b/ocaml/guestfs_c_actions.c @@ -4367,3 +4367,72 @@ ocaml_guestfs_mkdtemp (value gv, value templatev) CAMLreturn (rv); } +CAMLprim value +ocaml_guestfs_wc_l (value gv, value pathv) +{ + CAMLparam2 (gv, pathv); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("wc_l: used handle after closing it"); + + const char *path = String_val (pathv); + int r; + + caml_enter_blocking_section (); + r = guestfs_wc_l (g, path); + caml_leave_blocking_section (); + if (r == -1) + ocaml_guestfs_raise_error (g, "wc_l"); + + rv = Val_int (r); + CAMLreturn (rv); +} + +CAMLprim value +ocaml_guestfs_wc_w (value gv, value pathv) +{ + CAMLparam2 (gv, pathv); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("wc_w: used handle after closing it"); + + const char *path = String_val (pathv); + int r; + + caml_enter_blocking_section (); + r = guestfs_wc_w (g, path); + caml_leave_blocking_section (); + if (r == -1) + ocaml_guestfs_raise_error (g, "wc_w"); + + rv = Val_int (r); + CAMLreturn (rv); +} + +CAMLprim value +ocaml_guestfs_wc_c (value gv, value pathv) +{ + CAMLparam2 (gv, pathv); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("wc_c: used handle after closing it"); + + const char *path = String_val (pathv); + int r; + + caml_enter_blocking_section (); + r = guestfs_wc_c (g, path); + caml_leave_blocking_section (); + if (r == -1) + ocaml_guestfs_raise_error (g, "wc_c"); + + rv = Val_int (r); + CAMLreturn (rv); +} +