-(* 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
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 =
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. *)
(*
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 *)
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 =
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 ()