diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-05-01 11:00:46 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-05-01 11:00:46 +0100 |
commit | ac286b26df1aabceca26dac66c325a3676ace4cc (patch) | |
tree | e35289262967573c2ceb56ce67f66d7e678dba41 /ocaml/guestfs_c_actions.c | |
parent | 3cb794463a62239e36d730bc5d2d3eb4c7a66096 (diff) | |
download | libguestfs-ac286b26df1aabceca26dac66c325a3676ace4cc.tar.gz libguestfs-ac286b26df1aabceca26dac66c325a3676ace4cc.tar.xz libguestfs-ac286b26df1aabceca26dac66c325a3676ace4cc.zip |
Generated code for cp, cp-a and mv commands.
Diffstat (limited to 'ocaml/guestfs_c_actions.c')
-rw-r--r-- | ocaml/guestfs_c_actions.c | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/ocaml/guestfs_c_actions.c b/ocaml/guestfs_c_actions.c index 0656e726..f4c18088 100644 --- a/ocaml/guestfs_c_actions.c +++ b/ocaml/guestfs_c_actions.c @@ -2870,3 +2870,75 @@ ocaml_guestfs_grub_install (value gv, value rootv, value devicev) CAMLreturn (rv); } +CAMLprim value +ocaml_guestfs_cp (value gv, value srcv, value destv) +{ + CAMLparam3 (gv, srcv, destv); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("cp: used handle after closing it"); + + const char *src = String_val (srcv); + const char *dest = String_val (destv); + int r; + + caml_enter_blocking_section (); + r = guestfs_cp (g, src, dest); + caml_leave_blocking_section (); + if (r == -1) + ocaml_guestfs_raise_error (g, "cp"); + + rv = Val_unit; + CAMLreturn (rv); +} + +CAMLprim value +ocaml_guestfs_cp_a (value gv, value srcv, value destv) +{ + CAMLparam3 (gv, srcv, destv); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("cp_a: used handle after closing it"); + + const char *src = String_val (srcv); + const char *dest = String_val (destv); + int r; + + caml_enter_blocking_section (); + r = guestfs_cp_a (g, src, dest); + caml_leave_blocking_section (); + if (r == -1) + ocaml_guestfs_raise_error (g, "cp_a"); + + rv = Val_unit; + CAMLreturn (rv); +} + +CAMLprim value +ocaml_guestfs_mv (value gv, value srcv, value destv) +{ + CAMLparam3 (gv, srcv, destv); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("mv: used handle after closing it"); + + const char *src = String_val (srcv); + const char *dest = String_val (destv); + int r; + + caml_enter_blocking_section (); + r = guestfs_mv (g, src, dest); + caml_leave_blocking_section (); + if (r == -1) + ocaml_guestfs_raise_error (g, "mv"); + + rv = Val_unit; + CAMLreturn (rv); +} + |