Build libvirt and examples on Windows (MinGW).
[virt-top.git] / virt-top / virt_top_utils.mli
1 (* 'top'-like tool for libvirt domains.
2    (C) Copyright 2007 Richard W.M. Jones, Red Hat Inc.
3    http://libvirt.org/
4
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 2 of the License, or
8    (at your option) any later version.
9
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with this program; if not, write to the Free Software
17    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19    This file contains utility functions.
20 *)
21
22 (* Filename concatenation. *)
23 val (//) : string -> string -> string
24
25 (* Read a configuration file as a list of (lineno, key, value) pairs.
26  * If the config file is missing this returns an empty list.
27  *)
28 val read_config_file : string -> (int * string * string) list
29
30 (* Pad or truncate a string to a fixed width. *)
31 val pad : int -> string -> string
32
33 (* Int64 operators for convenience. *)
34 val (+^) : int64 -> int64 -> int64
35 val (-^) : int64 -> int64 -> int64
36 val ( *^ ) : int64 -> int64 -> int64
37 val (/^) : int64 -> int64 -> int64
38
39 (* Utility functions for formating numbers as short strings. *)
40 module Show : sig
41   val percent : float -> string
42   val int64_option : int64 option -> string
43   val int64 : int64 -> string
44   val time : int64 -> string
45 end
46
47 (* Helpers for manipulating block_stats & interface_stats. *)
48 open Libvirt.Domain
49
50 val sum_block_stats : block_stats list -> block_stats
51 val diff_block_stats : block_stats -> block_stats -> block_stats
52
53 val sum_interface_stats : interface_stats list -> interface_stats
54 val diff_interface_stats : interface_stats -> interface_stats -> interface_stats