From c296b68c99f8c22b0c7db1b072a6cd86f9ac3da9 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: [PATCH] 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. --- ChangeLog | 5 +++++ virt-ctrl/.depend | 2 +- virt-ctrl/vc_domain_ops.ml | 3 +++ virt-ctrl/vc_domain_ops.mli | 17 +++++++++++++---- virt-ctrl/vc_mainwindow.mli | 9 +++++---- 5 files changed, 27 insertions(+), 9 deletions(-) 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 -- 1.8.3.1