INSTALL = @INSTALL@
OCAMLDOC = @OCAMLDOC@
-OCAMLDOCFLAGS += -html -sort -package bitmatch -I lib
+OCAMLDOCFLAGS += -html -sort -package bitstring -I lib
OCAMLDOCFILES := $(wildcard lib/diskimage*.mli) lib/int63.mli
SUBDIRS = lib virt-df diskzip
AC_MSG_ERROR([Cannot find required OCaml package 'xml-light'])
fi
-AC_CHECK_OCAML_PKG(bitmatch)
-if test "x$pkg_bitmatch" != "xyes"; then
- AC_MSG_ERROR([Cannot find required OCaml package 'bitmatch'])
+AC_CHECK_OCAML_PKG(bitstring)
+if test "x$pkg_bitstring" != "xyes"; then
+ AC_MSG_ERROR([Cannot find required OCaml package 'bitstring'])
fi
dnl Check for optional OCaml packages.
AC_SUBST(pkg_extlib)
AC_SUBST(pkg_libvirt)
AC_SUBST(pkg_xml_light)
-AC_SUBST(pkg_bitmatch)
+AC_SUBST(pkg_bitstring)
AC_SUBST(pkg_gettext)
AC_SUBST(pkg_csv)
pkg_gettext = @pkg_gettext@
-OCAMLCPACKAGES := -package unix,extlib,bitmatch.syntax,bitmatch -I ../lib
+OCAMLCPACKAGES := -package unix,extlib,bitstring.syntax,bitstring -I ../lib
ifneq ($(pkg_gettext),no)
OCAMLCPACKAGES += -package gettext-stub
OBJS := diskzip_gettext.cmo diskzip.cmo
XOBJS := $(OBJS:.cmo=.cmx)
-SYNTAX := -syntax bitmatch.syntax
+SYNTAX := -syntax bitstring.syntax
OCAMLCFLAGS := @OCAMLCFLAGS@ $(SYNTAX)
OCAMLCLIBS := -linkpkg diskimage.cma
-(* 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 ()
description="Library for processing disk images"
archive(byte)="diskimage.cma"
archive(native)="diskimage.cmxa"
-requires = "bitmatch"
+requires = "bitstring"
exec_prefix = @exec_prefix@
bindir = @bindir@
-OCAMLCPACKAGES := -package unix,extlib,bitmatch.syntax
+OCAMLCPACKAGES := -package unix,extlib,bitstring.syntax
#----------------------------------------------------------------------
# Build up the list of object files.
#----------------------------------------------------------------------
-SYNTAX := -syntax bitmatch.syntax
+SYNTAX := -syntax bitstring.syntax
OCAMLCFLAGS := @OCAMLCFLAGS@ $(SYNTAX)
OCAMLCLIBS := -linkpkg
This subdirectory contains a library of useful functions for parsing
disk images.
-It is all based on and uses the pa_bitmatch syntax extension &
-library. You need pa_bitmatch >= 1.9.5.
+It is all based on and uses the pa_bitstring syntax extension &
+library. You need pa_bitstring >= 1.9.7.
This program has suddenly become rather large and confusing.
Hopefully this documentation should go some way towards explaining
Note: A default implementation is provided for [read],
but it is fairly inefficient because it uses {!map_block} to
map each block in the request. *)
- method read_bitstring : Int63.t -> Int63.t -> Bitmatch.bitstring
+ method read_bitstring : Int63.t -> Int63.t -> Bitstring.bitstring
(** [read_bitstring] is the same as [read] but returns
- a pa_bitmatch-style bitstring. *)
+ a pa_bitstring-style bitstring. *)
method virtual blocksize : Int63.t
(** [blocksize] returns the natural block size of the device. *)
method name : string
method size : Int63.t
method read : Int63.t -> Int63.t -> string
- method read_bitstring : Int63.t -> Int63.t -> Bitmatch.bitstring
+ method read_bitstring : Int63.t -> Int63.t -> Bitstring.bitstring
method blocksize : Int63.t
method map_block : Int63.t -> (device * Int63.t) list
method contiguous : Int63.t -> Int63.t
method name : string
method size : Int63.t
method read : Int63.t -> Int63.t -> string
- method read_bitstring : Int63.t -> Int63.t -> Bitmatch.bitstring
+ method read_bitstring : Int63.t -> Int63.t -> Bitstring.bitstring
method blocksize : Int63.t
method map_block : Int63.t -> (device * Int63.t) list
method contiguous : Int63.t -> Int63.t
method name : string
method size : Int63.t
method read : Int63.t -> Int63.t -> string
- method read_bitstring : Int63.t -> Int63.t -> Bitmatch.bitstring
+ method read_bitstring : Int63.t -> Int63.t -> Bitstring.bitstring
method blocksize : Int63.t
method contiguous : Int63.t -> Int63.t
method map_block : Int63.t -> (device * Int63.t) list
method virtual name : string
method virtual size : Int63.t
method read : Int63.t -> Int63.t -> string
- method read_bitstring : Int63.t -> Int63.t -> Bitmatch.bitstring
+ method read_bitstring : Int63.t -> Int63.t -> Bitstring.bitstring
method virtual blocksize : Int63.t
method virtual map_block : Int63.t -> (device * Int63.t) list
method virtual contiguous : Int63.t -> Int63.t
method name : string
method size : Int63.t
method read : Int63.t -> Int63.t -> string
- method read_bitstring : Int63.t -> Int63.t -> Bitmatch.bitstring
+ method read_bitstring : Int63.t -> Int63.t -> Bitstring.bitstring
method blocksize : Int63.t
method map_block : Int63.t -> (device * Int63.t) list
method contiguous : Int63.t -> Int63.t
method name : string
method size : Int63.t
method read : Int63.t -> Int63.t -> string
- method read_bitstring : Int63.t -> Int63.t -> Bitmatch.bitstring
+ method read_bitstring : Int63.t -> Int63.t -> Bitstring.bitstring
method blocksize : Int63.t
method map_block : Int63.t -> (device * Int63.t) list
method contiguous : Int63.t -> Int63.t
method name : string
method size : Int63.t
method read : Int63.t -> Int63.t -> string
- method read_bitstring : Int63.t -> Int63.t -> Bitmatch.bitstring
+ method read_bitstring : Int63.t -> Int63.t -> Bitstring.bitstring
method blocksize : Int63.t
method map_block : Int63.t -> (device * Int63.t) list
method contiguous : Int63.t -> Int63.t
| { _ } ->
if !debug then (
eprintf "unknown field in the runlist\n%!";
- Bitmatch.hexdump_bitstring Pervasives.stderr bits
+ Bitstring.hexdump_bitstring Pervasives.stderr bits
);
[]
pkg_gettext = @pkg_gettext@
-OCAMLCPACKAGES := -package unix,extlib,xml-light,libvirt,bitmatch.syntax,bitmatch -I ../lib
+OCAMLCPACKAGES := -package unix,extlib,xml-light,libvirt,bitstring.syntax,bitstring -I ../lib
ifneq ($(pkg_gettext),no)
OCAMLCPACKAGES += -package gettext-stub