configure: Detect camlp4 and bail if not available.
[guestfs-browser.git] / utils.mli
index ad14dd0..ceff484 100644 (file)
--- a/utils.mli
+++ b/utils.mli
@@ -22,6 +22,7 @@ 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
@@ -58,6 +59,15 @@ val set_connect_uri : string option -> unit
 
       This is set through the [--connect] command line option. *)
 
+val pretty_string_of_exn : exn -> string * string
+  (** Pretty string from exception.
+
+      Returns a title and a detailed message, for use in message dialogs.
+
+      To get raw exception string, use {!Printexc.to_string} from the
+      standard library. *)
+
+val utf8_copyright : string (** UTF-8 copyright symbol *)
 val utf8_rarrow : string (** UTF-8 RIGHTWARDS ARROW *)
 
 val human_size : int64 -> string
@@ -109,23 +119,35 @@ val is_wo : int64 -> bool
 val is_xo : int64 -> bool
   (** rwx/ugo bits. *)
 
+val file_permissions_string : int64 -> string
+  (** Convert [0755] to [-rwxr-xr-x] etc. *)
+
 val tmpdir : unit -> string
   (** [tmpdir ()] returns a newly created temporary directory.  The
       tmp directory is automatically removed when the program exits.
       Note that a fresh temporary directory is returned each time you
       call this function. *)
 
-val i32_of_string_le : string -> int32
-  (** [i32_of_string_le str] treats the 4 character string [str] as
-      a little endian 32 bit int.  NB. The string {b must} be
-      4 characters or longer. *)
+val windows_string_to_utf8 : string -> string
+  (** Convert a UTF16LE string to UTF8.  This also removes the final
+      \0 word if there is one.
+
+      This may fail in multiple ways, raising a Camomile exception
+      which you probably need to catch. *)
+
+val printable_hivex_value : ?split_long_lines:bool -> Hivex.hive_type -> string -> string
+  (** [printable_hivex_value t v] converts raw registry value
+      [v] of type [t] to a printable string. *)
+
+val local_file_exists : string -> bool
+  (** Returns true if the (local) file exists. *)
 
-val i32_of_string_be : string -> int32
-  (** [i32_of_string_le str] treats the 4 character string [str] as
-      a big endian 32 bit int.  NB. The string {b must} be
-      4 characters or longer. *)
+val basename : string -> string
+  (** Get the basename of a file, using path conventions which are valid
+      for libguestfs.  So {!Filename.basename} won't necessarily work
+      because it will use host path conventions. *)
 
-val i64_of_string_le : string -> int64
-  (** [i64_of_string_le str] treats the 8 character string [str] as
-      a little endian 64 bit int.  NB. The string {b must} be
-      8 characters or longer. *)
+val extension : string -> string
+  (** Get the extension of a file using libguestfs path conventions,
+      including the leading point (eg. [.txt]).  Might return an empty
+      string if there is no extension. *)