Change bitmatch -> bitstring
[virt-df.git] / diskzip / diskzip.ml
index 55094e7..0eed721 100644 (file)
@@ -311,7 +311,7 @@ and go_decompress ?output extcompress args =
 
 
 
-(* Since we have the wonderful pa_bitmatch, might as well use it to
+(* Since we have the wonderful pa_bitstring, might as well use it to
  * define a robust binary format for the compressed files.
  *
  * These functions are in matched pairs "write_foo" / "read_foo" so
@@ -359,9 +359,9 @@ and write_header disks =
        0xD152 : 16; 0x01 : 8; 0x00 : 8; (* file magic, version 1.0 *)
        nr_disks : 8                    (* number of disks being packed *)
       } in
-      let len = Bitmatch.bitstring_length bs in
+      let len = Bitstring.bitstring_length bs in
       assert (len land 7 = 0);
-      Bitmatch.string_of_bitstring bs in
+      Bitstring.string_of_bitstring bs in
     let names = List.map (
       fun name ->
        let bs =
@@ -369,9 +369,9 @@ and write_header disks =
            String.length name : 16;
            name : -1 : string
          } in
-       let len = Bitmatch.bitstring_length bs in
+       let len = Bitstring.bitstring_length bs in
        assert (len land 7 = 0);
-       Bitmatch.string_of_bitstring bs
+       Bitstring.string_of_bitstring bs
     ) names in
 
     (* Construct the final header. *)
@@ -382,7 +382,7 @@ and write_header disks =
 (*  
 and read_header () =
   (* Diskzip headers are limited to overall max size of 1024 bytes. *)
-  let bs = Bitmatch.bitstring_of_file_descr_max stdin 1024 in
+  let bs = Bitstring.bitstring_of_file_descr_max stdin 1024 in
 
   bitmatch bs with
   | { 0xD152 : 16;                     (* file magic *)
@@ -427,7 +427,7 @@ and write_stretch_header disknum free start_offset len_bytes =
     len_bytes : 64                     (* Length in bytes. *)
   } in
 
-  let str = Bitmatch.string_of_bitstring bs in
+  let str = Bitstring.string_of_bitstring bs in
   ignore (write stdout str 0 (String.length str))
 
 and write_stretch dev start_offset len_bytes =
@@ -449,7 +449,7 @@ and write_trailer () =
   let bs = BITSTRING {
     0xD152FFFF_l : 32
   } in
-  let str = Bitmatch.string_of_bitstring bs in
+  let str = Bitstring.string_of_bitstring bs in
   ignore (write stdout str 0 (String.length str))
 
 let () = main ()