From: Richard W.M. Jones <"Richard W.M. Jones "> Date: Tue, 8 Jan 2008 14:43:14 +0000 (+0000) Subject: Type Vc_domain_ops.dops_callback_fn for clarity. X-Git-Tag: 1.0.4~70 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=c296b68c99f8c22b0c7db1b072a6cd86f9ac3da9;p=virt-top.git Type Vc_domain_ops.dops_callback_fn for clarity. * virt-ctrl/vc_domain_ops.mli, virt-ctrl/vc_domain_ops.ml, virt-ctrl/vc_mainwindow.mli: Give a type name to the domain_ops callback type, for extra clarity. --- diff --git a/ChangeLog b/ChangeLog index a76dbca..4d8fd69 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2008-01-08 Richard Jones + Type Vc_domain_ops.dops_callback_fn for clarity. + * virt-ctrl/vc_domain_ops.mli, virt-ctrl/vc_domain_ops.ml, + virt-ctrl/vc_mainwindow.mli: Give a type name to the domain_ops + callback type, for extra clarity. + Change comments virt-manager -> virt-ctrl. * virt-ctrl/*.ml, virt-ctrl/*.mli: Change comments virt-manager -> virt-ctrl. diff --git a/virt-ctrl/.depend b/virt-ctrl/.depend index 8e2cdb6..b8cd19e 100644 --- a/virt-ctrl/.depend +++ b/virt-ctrl/.depend @@ -1,7 +1,7 @@ vc_connections.cmi: ../libvirt/libvirt.cmi vc_domain_ops.cmi: vc_connections.cmi vc_helpers.cmi: ../libvirt/libvirt.cmi -vc_mainwindow.cmi: vc_connections.cmi +vc_mainwindow.cmi: vc_domain_ops.cmi vc_connections.cmo: vc_helpers.cmi ../libvirt/libvirt.cmi vc_connections.cmi vc_connections.cmx: vc_helpers.cmx ../libvirt/libvirt.cmx vc_connections.cmi vc_domain_ops.cmo: vc_connections.cmi ../libvirt/libvirt.cmi \ diff --git a/virt-ctrl/vc_domain_ops.ml b/virt-ctrl/vc_domain_ops.ml index fbd7f28..74540be 100644 --- a/virt-ctrl/vc_domain_ops.ml +++ b/virt-ctrl/vc_domain_ops.ml @@ -67,6 +67,9 @@ let get_domain (tree : GTree.view) (model : GTree.tree_store) prerr_endline (Libvirt.Virterror.to_string err); None +type dops_callback_fn = + GTree.view -> GTree.tree_store -> Vc_connections.columns -> unit -> unit + let start_domain tree model columns () = match get_domain tree model columns with | None -> () diff --git a/virt-ctrl/vc_domain_ops.mli b/virt-ctrl/vc_domain_ops.mli index 5bfa0b8..661ede3 100644 --- a/virt-ctrl/vc_domain_ops.mli +++ b/virt-ctrl/vc_domain_ops.mli @@ -19,7 +19,16 @@ Domain operations buttons. *) -val start_domain : GTree.view -> GTree.tree_store -> Vc_connections.columns -> unit -> unit -val pause_domain : GTree.view -> GTree.tree_store -> Vc_connections.columns -> unit -> unit -val resume_domain : GTree.view -> GTree.tree_store -> Vc_connections.columns -> unit -> unit -val shutdown_domain : GTree.view -> GTree.tree_store -> Vc_connections.columns -> unit -> unit +type dops_callback_fn = + GTree.view -> GTree.tree_store -> Vc_connections.columns -> unit -> unit + (** Domain ops callback function type. + + The parameters are: tree (view), model, columns. + The extra unit parameter is there to make it easier to + turn into a callback. + *) + +val start_domain : dops_callback_fn +val pause_domain : dops_callback_fn +val resume_domain : dops_callback_fn +val shutdown_domain : dops_callback_fn diff --git a/virt-ctrl/vc_mainwindow.mli b/virt-ctrl/vc_mainwindow.mli index fb7f152..1f3a176 100644 --- a/virt-ctrl/vc_mainwindow.mli +++ b/virt-ctrl/vc_mainwindow.mli @@ -23,7 +23,8 @@ callback functions to wire everything up. *) val make : open_connection:(unit -> unit) -> - start_domain:(GTree.view -> GTree.tree_store -> Vc_connections.columns -> unit -> unit) -> - pause_domain:(GTree.view -> GTree.tree_store -> Vc_connections.columns -> unit -> unit) -> - resume_domain:(GTree.view -> GTree.tree_store -> Vc_connections.columns -> unit -> unit) -> - shutdown_domain:(GTree.view -> GTree.tree_store -> Vc_connections.columns -> unit -> unit) -> unit + start_domain:Vc_domain_ops.dops_callback_fn -> + pause_domain:Vc_domain_ops.dops_callback_fn -> + resume_domain:Vc_domain_ops.dops_callback_fn -> + shutdown_domain:Vc_domain_ops.dops_callback_fn -> + unit