Version 0.1.1.
[guestfs-browser.git] / utils.mli
index 0df3a43..1bc1669 100644 (file)
--- a/utils.mli
+++ b/utils.mli
@@ -28,6 +28,9 @@ 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 (//) : string -> string -> string
+  (** Concatenate two paths. *)
+
 val verbose : unit -> bool
 val set_verbose_flag : unit -> unit
   (** If this contains [true] then {!debug} will send debugging
@@ -35,11 +38,6 @@ val set_verbose_flag : unit -> unit
 
       This is set through the --verbose command line option. *)
 
-val write_flag : unit -> bool
-val set_write_flag : unit -> unit
-  (** Writes are prevented unless the user sets this to [true]
-      through the command line option --write. *)
-
 val debug : ('a, unit, string, unit) format4 -> 'a
   (** A printf-like function for writing debugging messages. *)
 
@@ -48,7 +46,64 @@ val failwith : ('a, unit, string, 'b) format4 -> 'a
       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_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
-  (** Convert a number (of 1K blocks) into a human readable 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 mklabel : string -> GObj.widget
+  (** Convenience function to make a label containing some text.  It is
+      returned as a generic widget. *)
+
+val markup_escape : string -> string
+  (** Call g_markup_escape. *)
+
+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. *)
+
+val is_socket : int64 -> bool
+val is_symlink : int64 -> bool
+val is_regular_file : int64 -> bool
+val is_block : int64 -> bool
+val is_directory : int64 -> bool
+val is_char : int64 -> bool
+val is_fifo : int64 -> bool
+  (** File type tests. *)
+
+val is_suid : int64 -> bool
+val is_sgid : int64 -> bool
+val is_svtx : int64 -> bool
+  (** File setuid, setgid, sticky bit tests. *)
+
+val is_ru : int64 -> bool
+val is_wu : int64 -> bool
+val is_xu : int64 -> bool
+val is_rg : int64 -> bool
+val is_wg : int64 -> bool
+val is_xg : int64 -> bool
+val is_ro : int64 -> bool
+val is_wo : int64 -> bool
+val is_xo : int64 -> bool
+  (** rwx/ugo bits. *)