X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;ds=sidebyside;f=diskzip%2Fdiskzip.ml;fp=diskzip%2Fdiskzip.ml;h=0eed72190b39a8f58945523d72a4605edad9cc3b;hb=3af76b1a2e4d2e1cfa5fc41dfd4c1ddb397cedbb;hp=55094e7f55e562aa1ab0fbd5514405541d6f4fae;hpb=6c17fc407b61fae04a74df9779ff0094fc874e6d;p=virt-df.git diff --git a/diskzip/diskzip.ml b/diskzip/diskzip.ml index 55094e7..0eed721 100644 --- a/diskzip/diskzip.ml +++ b/diskzip/diskzip.ml @@ -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 ()