(* Virt-resize UI. * Copyright (C) 2011 Red Hat Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *) (** General-purpose utility code used everywhere. *) val (+^) : int64 -> int64 -> int64 val (-^) : int64 -> int64 -> int64 val ( *^ ) : int64 -> int64 -> int64 val (/^) : int64 -> int64 -> int64 val (&^) : int64 -> int64 -> int64 (** Int64 arithmetic operators. *) type ('a, 'b) either = Left of 'a | Right of 'b (** A value which is either an ['a] or a ['b], just like Haskell's "Either" type. *) val verbose : unit -> bool val set_verbose_flag : unit -> unit (** If this contains [true] then {!debug} will send debugging messages to stderr, else debugging messages are dropped. This is set through the --verbose command line option. *) val debug : ('a, unit, string, unit) format4 -> 'a (** A printf-like function for writing debugging messages. *) val failwith : ('a, unit, string, 'b) format4 -> 'a (** Replacement for standard OCaml [failwith] function. This can take a printf-like argument list, and also logs errors on stderr when verbose is enabled. *) val trace : unit -> bool val set_trace_flag : unit -> unit (** If this contains [true] then calls to libguestfs are traced. This is set through the [-x] command line option. *) val connect_uri : unit -> string option val set_connect_uri : string option -> unit (** The libvirt connection URI. This is set through the [--connect] command line option. *) val utf8_copyright : string (** UTF-8 copyright symbol *) val utf8_rarrow : string (** UTF-8 RIGHTWARDS ARROW *) val human_size : int64 -> string (** Convert a number of bytes into a human readable string. *) val human_size_1k : int64 -> string (** Same as {!human_size} but the argument is 1KB blocks (used for disk usage). *) val unique : unit -> int (** Return a new integer each time called. *) val find_map : ('a -> 'b option) -> 'a list -> 'b (** [find_map f xs] calls function [f] on each member of [xs] in order. If [f] returns [Some b] then we stop and return [b]. If all calls to [f] return [None] then this raises [Not_found]. *) val markup_escape : string -> string (** Like g_markup_escape but with extra protection for strings containing \0 characters. *) val libguestfs_version_string : unit -> string (** Return the version of libguestfs as a string. *) val libvirt_version_string : unit -> string (** Return the version of libvirt as a string. *)