From 3af76b1a2e4d2e1cfa5fc41dfd4c1ddb397cedbb Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: [PATCH] Change bitmatch -> bitstring --- Makefile.in | 2 +- configure.ac | 8 ++++---- diskzip/Makefile.in | 4 ++-- diskzip/diskzip.ml | 16 ++++++++-------- lib/META.in | 2 +- lib/Makefile.in | 4 ++-- lib/README | 4 ++-- lib/diskimage.mli | 10 +++++----- lib/diskimage_impl.mli | 8 ++++---- lib/diskimage_ntfs.ml | 2 +- virt-df/Makefile.in | 2 +- 11 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Makefile.in b/Makefile.in index f9f2a51..d21bce8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -22,7 +22,7 @@ VERSION = @PACKAGE_VERSION@ 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 diff --git a/configure.ac b/configure.ac index 25c30bb..8a784a4 100644 --- a/configure.ac +++ b/configure.ac @@ -54,9 +54,9 @@ if test "x$pkg_xml_light" != "xyes"; then 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. @@ -67,7 +67,7 @@ AC_SUBST(pkg_unix) 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) diff --git a/diskzip/Makefile.in b/diskzip/Makefile.in index c3632e2..f44d347 100644 --- a/diskzip/Makefile.in +++ b/diskzip/Makefile.in @@ -28,7 +28,7 @@ bindir = @bindir@ 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 @@ -37,7 +37,7 @@ endif 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 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 () diff --git a/lib/META.in b/lib/META.in index d3ea966..e1c8f91 100644 --- a/lib/META.in +++ b/lib/META.in @@ -3,4 +3,4 @@ version="@PACKAGE_VERSION@" description="Library for processing disk images" archive(byte)="diskimage.cma" archive(native)="diskimage.cmxa" -requires = "bitmatch" +requires = "bitstring" diff --git a/lib/Makefile.in b/lib/Makefile.in index 5e54923..b508016 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -28,7 +28,7 @@ prefix = @prefix@ 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. @@ -54,7 +54,7 @@ XOBJS := $(OBJS:.cmo=.cmx) #---------------------------------------------------------------------- -SYNTAX := -syntax bitmatch.syntax +SYNTAX := -syntax bitstring.syntax OCAMLCFLAGS := @OCAMLCFLAGS@ $(SYNTAX) OCAMLCLIBS := -linkpkg diff --git a/lib/README b/lib/README index e5de637..2886d35 100644 --- a/lib/README +++ b/lib/README @@ -9,8 +9,8 @@ Developer documentation 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 diff --git a/lib/diskimage.mli b/lib/diskimage.mli index cf39e91..ee95453 100644 --- a/lib/diskimage.mli +++ b/lib/diskimage.mli @@ -48,9 +48,9 @@ class virtual device : 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. *) @@ -91,7 +91,7 @@ class block_device : string -> 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 @@ -109,7 +109,7 @@ class offset_device : string -> Int63.t -> Int63.t -> Int63.t -> 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 @@ -129,7 +129,7 @@ class blocksize_overlay : Int63.t -> 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 contiguous : Int63.t -> Int63.t method map_block : Int63.t -> (device * Int63.t) list diff --git a/lib/diskimage_impl.mli b/lib/diskimage_impl.mli index 3a34dcb..05fcd70 100644 --- a/lib/diskimage_impl.mli +++ b/lib/diskimage_impl.mli @@ -33,7 +33,7 @@ class virtual device : 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 @@ -44,7 +44,7 @@ class block_device : string -> 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 @@ -56,7 +56,7 @@ class offset_device : string -> Int63.t -> Int63.t -> Int63.t -> 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 @@ -67,7 +67,7 @@ class blocksize_overlay : Int63.t -> 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 diff --git a/lib/diskimage_ntfs.ml b/lib/diskimage_ntfs.ml index a26a686..e43033d 100644 --- a/lib/diskimage_ntfs.ml +++ b/lib/diskimage_ntfs.ml @@ -415,7 +415,7 @@ and parse_runlist vcn lcn bits = | { _ } -> if !debug then ( eprintf "unknown field in the runlist\n%!"; - Bitmatch.hexdump_bitstring Pervasives.stderr bits + Bitstring.hexdump_bitstring Pervasives.stderr bits ); [] diff --git a/virt-df/Makefile.in b/virt-df/Makefile.in index ade050d..312a257 100644 --- a/virt-df/Makefile.in +++ b/virt-df/Makefile.in @@ -28,7 +28,7 @@ bindir = @bindir@ 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 -- 1.8.3.1