c807365a2c1a31292ef7fd96e61313c808f406a4
[virt-mem.git] / lib / virt_mem.mli
1 (** Memory info for virtual domains. *)
2 (* Memory info for virtual domains.
3    (C) Copyright 2008 Richard W.M. Jones, Red Hat Inc.
4    http://libvirt.org/
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2 of the License, or
9    (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  *)
20
21 val register :
22   ?external_cmd:bool ->
23   ?extra_args:(Arg.key * Arg.spec * Arg.doc) list ->
24   ?argcheck:(bool -> unit) ->
25   ?beforeksyms:(bool -> Virt_mem_types.image0 list -> unit) ->
26   ?beforeutsname:(bool -> Virt_mem_types.image1 -> unit) ->
27   ?run:(bool -> Virt_mem_types.image2 -> unit) ->
28   string -> string -> Arg.usage_msg ->
29   unit
30   (** Tools register themselves with this call.
31
32       The anonymous parameters are:
33       - tool name (eg. "uname")
34       - short summary
35       - full usage message
36
37       The optional callback functions are:
38       - [?argcheck] called after arguments have been fully parsed
39       so that the program can do any additional checks needed (eg.
40       on [extra_args]),
41       - [?beforeksyms] called after images are loaded and before
42       kernel symbols are analyzed,
43       - [?beforeutsname] called after kernel symbols are analyzed
44       and before the kernel version is detected
45       - [?run] called after everything
46       (almost all tools supply this callback function).
47
48       Pass [~external_cmd:false] if this tool doesn't have an
49       external 'virt-tool' link.
50
51       Pass [~extra_args:...] if this tool needs extra command
52       line options.
53   *)
54
55 val main : unit -> unit
56   (** Entry point for the combined virt-mem executable. *)