2 * Copyright (C) 2010 Red Hat Inc.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 (** General-purpose utility code used everywhere. *)
21 val (+^) : int64 -> int64 -> int64
22 val (-^) : int64 -> int64 -> int64
23 val ( *^ ) : int64 -> int64 -> int64
24 val (/^) : int64 -> int64 -> int64
25 (** Int64 arithmetic operators. *)
27 type ('a, 'b) either = Left of 'a | Right of 'b
28 (** A value which is either an ['a] or a ['b], just like Haskell's
31 val verbose : unit -> bool
32 val set_verbose_flag : unit -> unit
33 (** If this contains [true] then {!debug} will send debugging
34 messages to stderr, else debugging messages are dropped.
36 This is set through the --verbose command line option. *)
38 val debug : ('a, unit, string, unit) format4 -> 'a
39 (** A printf-like function for writing debugging messages. *)
41 val failwith : ('a, unit, string, 'b) format4 -> 'a
42 (** Replacement for standard OCaml [failwith] function. This can
43 take a printf-like argument list, and also logs errors on stderr
44 when verbose is enabled. *)
46 val utf8_rarrow : string (** UTF-8 RIGHTWARDS ARROW *)
48 val human_size_1k : int64 -> string
49 (** Convert a number (of 1K blocks) into a human readable string. *)
51 val unique : unit -> int
52 (** Return a new integer each time called. *)
54 val mklabel : string -> GObj.widget
55 (** Convenience function to make a label containing some text. It is
56 returned as a generic widget. *)
58 val libguestfs_version_string : unit -> string
59 (** Return the version of libguestfs as a string. *)
61 val libvirt_version_string : unit -> string
62 (** Return the version of libvirt as a string. *)
64 val (//) : string -> string -> string
65 (** Concatenate two paths. *)