X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;ds=sidebyside;f=ocaml%2Fguestfs.ml;h=2504b45edf2578b87ae9a27fc926691acd8d71c0;hb=a2e1d51acda406fd4193f121ac9f879e60cf4302;hp=ba6f0d64d5e9835fc22d51b67d13c8fddf25922d;hpb=4144e2106cc70ad8f1e081b57da09f9c1e276812;p=libguestfs.git diff --git a/ocaml/guestfs.ml b/ocaml/guestfs.ml index ba6f0d6..2504b45 100644 --- a/ocaml/guestfs.ml +++ b/ocaml/guestfs.ml @@ -22,19 +22,10 @@ type t exception Error of string external create : unit -> t = "ocaml_guestfs_create" -external close : t -> unit = "ocaml_guestfs_create" -external launch : t -> unit = "ocaml_guestfs_launch" -external wait_ready : t -> unit = "ocaml_guestfs_wait_ready" -external kill_subprocess : t -> unit = "ocaml_guestfs_kill_subprocess" -external add_drive : t -> string -> unit = "ocaml_guestfs_add_drive" -external add_cdrom : t -> string -> unit = "ocaml_guestfs_add_cdrom" -external config : t -> string -> string option -> unit = "ocaml_guestfs_config" -external set_path : t -> string option -> unit = "ocaml_guestfs_set_path" -external get_path : t -> string = "ocaml_guestfs_get_path" -external set_autosync : t -> bool -> unit = "ocaml_guestfs_set_autosync" -external get_autosync : t -> bool = "ocaml_guestfs_get_autosync" -external set_verbose : t -> bool -> unit = "ocaml_guestfs_set_verbose" -external get_verbose : t -> bool = "ocaml_guestfs_get_verbose" +external close : t -> unit = "ocaml_guestfs_close" + +let () = + Callback.register_exception "ocaml_guestfs_error" (Error "") type lvm_pv = { pv_name : string; @@ -94,17 +85,30 @@ type lvm_lv = { modules : string; } -external cat : t -> string -> string = "ocaml_guestfs_cat" -external list_devices : t -> string list = "ocaml_guestfs_list_devices" -external list_partitions : t -> string list = "ocaml_guestfs_list_partitions" -external ll : t -> string -> string = "ocaml_guestfs_ll" -external ls : t -> string -> string list = "ocaml_guestfs_ls" -external lvs : t -> string list = "ocaml_guestfs_lvs" -external lvs_full : t -> lvm_lv list = "ocaml_guestfs_lvs_full" +external launch : t -> unit = "ocaml_guestfs_launch" +external wait_ready : t -> unit = "ocaml_guestfs_wait_ready" +external kill_subprocess : t -> unit = "ocaml_guestfs_kill_subprocess" +external add_drive : t -> string -> unit = "ocaml_guestfs_add_drive" +external add_cdrom : t -> string -> unit = "ocaml_guestfs_add_cdrom" +external config : t -> string -> string option -> unit = "ocaml_guestfs_config" +external set_path : t -> string -> unit = "ocaml_guestfs_set_path" +external get_path : t -> string = "ocaml_guestfs_get_path" +external set_autosync : t -> bool -> unit = "ocaml_guestfs_set_autosync" +external get_autosync : t -> bool = "ocaml_guestfs_get_autosync" +external set_verbose : t -> bool -> unit = "ocaml_guestfs_set_verbose" +external get_verbose : t -> bool = "ocaml_guestfs_get_verbose" external mount : t -> string -> string -> unit = "ocaml_guestfs_mount" -external pvs : t -> string list = "ocaml_guestfs_pvs" -external pvs_full : t -> lvm_pv list = "ocaml_guestfs_pvs_full" external sync : t -> unit = "ocaml_guestfs_sync" external touch : t -> string -> unit = "ocaml_guestfs_touch" -external vgs : t -> string list = "ocaml_guestfs_vgs" -external vgs_full : t -> lvm_vg list = "ocaml_guestfs_vgs_full" +external cat : t -> string -> string = "ocaml_guestfs_cat" +external ll : t -> string -> string = "ocaml_guestfs_ll" +external ls : t -> string -> string array = "ocaml_guestfs_ls" +external list_devices : t -> string array = "ocaml_guestfs_list_devices" +external list_partitions : t -> string array = "ocaml_guestfs_list_partitions" +external pvs : t -> string array = "ocaml_guestfs_pvs" +external vgs : t -> string array = "ocaml_guestfs_vgs" +external lvs : t -> string array = "ocaml_guestfs_lvs" +external pvs_full : t -> lvm_pv array = "ocaml_guestfs_pvs_full" +external vgs_full : t -> lvm_vg array = "ocaml_guestfs_vgs_full" +external lvs_full : t -> lvm_lv array = "ocaml_guestfs_lvs_full" +external read_lines : t -> string -> string array = "ocaml_guestfs_read_lines"