diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-11-06 10:48:37 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-11-06 10:49:32 +0000 |
commit | 79125c4dea9c69d08b522ed7c85f26dc6ee1bcb3 (patch) | |
tree | f17bff35f18aab05c5e74ebd91ca051aa575647a /ocaml | |
parent | e1f5472395b08033c60054e8f87f3c61126c4fa4 (diff) | |
download | libguestfs-79125c4dea9c69d08b522ed7c85f26dc6ee1bcb3.tar.gz libguestfs-79125c4dea9c69d08b522ed7c85f26dc6ee1bcb3.tar.xz libguestfs-79125c4dea9c69d08b522ed7c85f26dc6ee1bcb3.zip |
ocaml: General improvements to generated code.
Diffstat (limited to 'ocaml')
-rw-r--r-- | ocaml/guestfs_c.c | 11 | ||||
-rw-r--r-- | ocaml/guestfs_c.h | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/ocaml/guestfs_c.c b/ocaml/guestfs_c.c index 80dcf995..f7d8dff8 100644 --- a/ocaml/guestfs_c.c +++ b/ocaml/guestfs_c.c @@ -93,6 +93,17 @@ ocaml_guestfs_raise_error (guestfs_h *g, const char *func) CAMLnoreturn; } +void +ocaml_guestfs_raise_closed (const char *func) +{ + CAMLparam0 (); + CAMLlocal1 (v); + + v = caml_copy_string (func); + caml_raise_with_arg (*caml_named_value ("ocaml_guestfs_closed"), v); + CAMLnoreturn; +} + /* Guestfs.create */ CAMLprim value ocaml_guestfs_create (void) diff --git a/ocaml/guestfs_c.h b/ocaml/guestfs_c.h index b4a76617..cd1d73b1 100644 --- a/ocaml/guestfs_c.h +++ b/ocaml/guestfs_c.h @@ -22,6 +22,8 @@ #define Guestfs_val(v) (*((guestfs_h **)Data_custom_val(v))) extern void ocaml_guestfs_raise_error (guestfs_h *g, const char *func) Noreturn; +extern void ocaml_guestfs_raise_closed (const char *func) + Noreturn; extern char **ocaml_guestfs_strings_val (guestfs_h *g, value sv); extern void ocaml_guestfs_free_strings (char **r); |