diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2008-01-08 14:43:14 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2008-01-08 14:43:14 +0000 |
commit | c296b68c99f8c22b0c7db1b072a6cd86f9ac3da9 (patch) | |
tree | c52962a7b8a22853b79298ba3a8821f9981bd437 /virt-ctrl | |
parent | 474e8b8e2e98b61d5d01a58f843b9338754ecf2f (diff) | |
download | virt-top-c296b68c99f8c22b0c7db1b072a6cd86f9ac3da9.tar.gz virt-top-c296b68c99f8c22b0c7db1b072a6cd86f9ac3da9.tar.xz virt-top-c296b68c99f8c22b0c7db1b072a6cd86f9ac3da9.zip |
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.
Diffstat (limited to 'virt-ctrl')
-rw-r--r-- | virt-ctrl/.depend | 2 | ||||
-rw-r--r-- | virt-ctrl/vc_domain_ops.ml | 3 | ||||
-rw-r--r-- | virt-ctrl/vc_domain_ops.mli | 17 | ||||
-rw-r--r-- | virt-ctrl/vc_mainwindow.mli | 9 |
4 files changed, 22 insertions, 9 deletions
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 |