Updated this file with new <^< operator, should probably delete it.
[virt-df.git] / lib / diskimage_utils.mli
index 5e91520..9eccf64 100644 (file)
@@ -29,7 +29,8 @@ class virtual device :
     method read : Int63.t -> Int63.t -> string
     method read_bitstring : Int63.t -> Int63.t -> Bitmatch.bitstring
     method virtual blocksize : Int63.t
-    method virtual mapblock : Int63.t -> (device * Int63.t) list
+    method virtual map_block : Int63.t -> (device * Int63.t) list
+    method virtual contiguous : Int63.t -> Int63.t
   end
 
 class block_device : string -> Int63.t ->
@@ -39,7 +40,8 @@ class block_device : string -> Int63.t ->
     method read : Int63.t -> Int63.t -> string
     method read_bitstring : Int63.t -> Int63.t -> Bitmatch.bitstring
     method blocksize : Int63.t
-    method mapblock : Int63.t -> (device * Int63.t) list
+    method map_block : Int63.t -> (device * Int63.t) list
+    method contiguous : Int63.t -> Int63.t
     method close : unit -> unit
   end
 
@@ -50,7 +52,8 @@ class offset_device : string -> Int63.t -> Int63.t -> Int63.t -> device ->
     method read : Int63.t -> Int63.t -> string
     method read_bitstring : Int63.t -> Int63.t -> Bitmatch.bitstring
     method blocksize : Int63.t
-    method mapblock : Int63.t -> (device * Int63.t) list
+    method map_block : Int63.t -> (device * Int63.t) list
+    method contiguous : Int63.t -> Int63.t
   end
 
 class blocksize_overlay : Int63.t -> device ->
@@ -60,7 +63,8 @@ class blocksize_overlay : Int63.t -> device ->
     method read : Int63.t -> Int63.t -> string
     method read_bitstring : Int63.t -> Int63.t -> Bitmatch.bitstring
     method blocksize : Int63.t
-    method mapblock : Int63.t -> (device * Int63.t) list
+    method map_block : Int63.t -> (device * Int63.t) list
+    method contiguous : Int63.t -> Int63.t
   end
 
 val null_device : device
@@ -87,6 +91,7 @@ and disk_content =
 
 and partitions = {
   parts_plugin_id : parts_plugin_id;
+  parts_dev : device;
   parts : partition list;
 }
 and partition = {
@@ -120,6 +125,7 @@ and filesystem = {
 
 and pv = {
   lvm_plugin_id : lvm_plugin_id;
+  pv_dev : device;
   pv_uuid : string;
 }
 and lv = {
@@ -138,6 +144,14 @@ val canonical_uuid : string -> string
 val group_by : ?cmp:('a -> 'a -> int) -> ('a * 'b) list -> ('a * 'b list) list
 (** Group a sorted list of pairs by the first element of the pair. *)
 
+val sort_uniq : ?cmp:('a -> 'a -> int) -> 'a list -> 'a list
+(** [sort_uniq xs] returns the list [xs], sorted and with all duplicate
+    elements removed. *)
+
+val uniq : ?cmp:('a -> 'a -> int) -> 'a list -> 'a list
+(** [uniq xs] removes adjacent duplicate elements from a list, like
+    the Unix uniq(1) command. *)
+
 val range : int -> int -> int list
 (** [range a b] returns the list of integers [a <= i < b].
     If [a >= b] then the empty list is returned.