[Pkg-ocaml-maint-commits] [ocaml-ipaddr] 03/10: Imported Upstream version 2.2.0
Stéphane Glondu
glondu at moszumanska.debian.org
Thu Jun 26 13:48:14 UTC 2014
This is an automated email from the git hooks/post-receive script.
glondu pushed a commit to branch master
in repository ocaml-ipaddr.
commit 508cb9fff4d2d3db4bf9b9b94df66396b59ba8fd
Author: Stephane Glondu <steph at glondu.net>
Date: Thu Jun 26 15:02:12 2014 +0200
Imported Upstream version 2.2.0
---
.travis-ci.sh | 2 +-
CHANGES | 4 ++
README.md | 2 +
_oasis | 30 ++++++++++++++-
_tags | 9 ++++-
lib/META | 26 ++++++++++++-
lib/ipaddr.ml | 17 +++++++++
lib/ipaddr.mli | 38 +++++++++++++++----
lib/ipaddr_unix.ml | 48 ++++++++++++++++++++++++
lib/ipaddr_unix.mli | 59 +++++++++++++++++++++++++++++
lib/ipaddr_unix.mllib | 4 ++
myocamlbuild.ml | 21 +++++++++--
setup.ml | 102 +++++++++++++++++++++++++++++++++++++++++++++++---
top/ipaddr_top.ml | 24 ++++++++++++
top/ipaddr_top.mllib | 4 ++
15 files changed, 369 insertions(+), 21 deletions(-)
diff --git a/.travis-ci.sh b/.travis-ci.sh
index ce388e5..4f3bc2b 100755
--- a/.travis-ci.sh
+++ b/.travis-ci.sh
@@ -12,7 +12,7 @@ esac
echo "yes" | sudo add-apt-repository ppa:$ppa
sudo apt-get update -qq
-sudo apt-get install -qq ocaml ocaml-native-compilers camlp4-extra opam
+sudo apt-get install -qq ocaml ocaml-native-compilers ocaml-compiler-libs camlp4-extra opam
export OPAMYES=1
export OPAMVERBOSE=1
echo OCaml version
diff --git a/CHANGES b/CHANGES
index 5a4e174..cf2ccf2 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+2.2.0 (2014-01-27):
+* Add an [Ipaddr_unix] module to convert to-and-from the standard library.
+* Add a toplevel pretty printer in the `ipaddr.top` package.
+
2.1.0 (2014-01-20):
* Add `of_string_raw` to `Ipaddr.V4.Prefix` and `Ipaddr.V6.Prefix`
* Add `of_addr` to `Ipaddr.V4.Prefix` and `Ipaddr.V6.Prefix`
diff --git a/README.md b/README.md
index 9698e07..3600e19 100644
--- a/README.md
+++ b/README.md
@@ -12,6 +12,8 @@ Features:
* `Ipaddr.V4` and `Ipaddr.V4.Prefix` modules are `Map.OrderedType`
* `Ipaddr.V6` and `Ipaddr.V6.Prefix` modules are `Map.OrderedType`
* `Ipaddr` and `Ipaddr.Prefix` modules are `Map.OrderedType`
+ * `Ipaddr_unix` in findlib subpackage `ipaddr.unix` provides compatibility with the standard library `Unix` module
+ * `Ipaddr_top` in findlib subpackage `ipaddr.top` provides top-level pretty printers (requires compiler-libs default since OCaml 4.0)
* IP address scope classification
* IPv4-mapped addresses in IPv6 (::ffff:0:0/96) are an embedding of IPv4
* MAC-48 (Ethernet) address support
diff --git a/_oasis b/_oasis
index 285cafd..0d4cef2 100644
--- a/_oasis
+++ b/_oasis
@@ -1,12 +1,20 @@
OASISFormat: 0.3
Name: ipaddr
-Version: 2.1.0
+Version: 2.2.0
Synopsis: A library for manipulation of IP (and MAC) address representations
Authors: David Sheets, Anil Madhavapeddy, Hugo Heuzard
License: ISC
Plugins: META (0.3), DevFiles (0.3)
BuildTools: ocamlbuild
+Flag unix
+ Description: build the unix library
+ Default: true
+
+Flag top
+ Description: build the toplevel printers
+ Default: true
+
Library ipaddr
Path: lib
Findlibname: ipaddr
@@ -14,6 +22,26 @@ Library ipaddr
NativeOpt: -w @f at p@u at s@40
ByteOpt: -w @f at p@u at s@40
+Library ipaddr_unix
+ Build$: flag(unix)
+ Path: lib
+ Findlibparent: ipaddr
+ Findlibname: unix
+ Modules: Ipaddr_unix
+ BuildDepends: unix, ipaddr
+
+Library ipaddr_top
+ Build$: flag(top)
+ Path: top
+ FindlibName: top
+ FindlibParent: ipaddr
+ Modules: Ipaddr_top
+ # Compiler libs do not exists for OCaml < 4.0.0 and otherwise always
+ # present. Use _tags to set them up.
+ # BuildDepends: compiler-libs.toplevel
+ XMETARequires: ipaddr
+ XMETADescription: Toplevel printers for IP addresses
+
Test ipaddr
Run: true
Command: make
diff --git a/_tags b/_tags
index a319626..d8efb66 100644
--- a/_tags
+++ b/_tags
@@ -1,5 +1,5 @@
# OASIS_START
-# DO NOT EDIT (digest: 4ae62e3665fc102fb022d9d1c2c8df73)
+# DO NOT EDIT (digest: 6e3d75e627e8d27796e5d44e56fed7b0)
# Ignore VCS directories, you can use the same kind of rule outside
# OASIS_START/STOP if you want to exclude directories that contains
# useless stuff for the build process
@@ -19,5 +19,12 @@
<lib/*.ml{,i}>: oasis_library_ipaddr_byte
<lib/ipaddr.{cma,cmxa}>: oasis_library_ipaddr_native
<lib/*.ml{,i}>: oasis_library_ipaddr_native
+# Library ipaddr_unix
+"lib/ipaddr_unix.cmxs": use_ipaddr_unix
+<lib/*.ml{,i}>: use_ipaddr
+<lib/*.ml{,i}>: pkg_unix
+# Library ipaddr_top
+"top/ipaddr_top.cmxs": use_ipaddr_top
# OASIS_STOP
true: debug, annot, bin_annot, principal
+<top/*.ml>: I(+compiler-libs)
diff --git a/lib/META b/lib/META
index 5ceecfe..1c39024 100644
--- a/lib/META
+++ b/lib/META
@@ -1,6 +1,6 @@
# OASIS_START
-# DO NOT EDIT (digest: 27735b5b8ddb548ad5bbe2baf0be89b6)
-version = "2.0.0"
+# DO NOT EDIT (digest: 958d37e3e4912bb1de77a8fb8718d800)
+version = "2.2.0"
description =
"A library for manipulation of IP (and MAC) address representations"
archive(byte) = "ipaddr.cma"
@@ -8,5 +8,27 @@ archive(byte, plugin) = "ipaddr.cma"
archive(native) = "ipaddr.cmxa"
archive(native, plugin) = "ipaddr.cmxs"
exists_if = "ipaddr.cma"
+package "unix" (
+ version = "2.2.0"
+ description =
+ "A library for manipulation of IP (and MAC) address representations"
+ requires = "unix ipaddr"
+ archive(byte) = "ipaddr_unix.cma"
+ archive(byte, plugin) = "ipaddr_unix.cma"
+ archive(native) = "ipaddr_unix.cmxa"
+ archive(native, plugin) = "ipaddr_unix.cmxs"
+ exists_if = "ipaddr_unix.cma"
+)
+
+package "top" (
+ version = "2.2.0"
+ description = "Toplevel printers for IP addresses"
+ requires = "ipaddr"
+ archive(byte) = "ipaddr_top.cma"
+ archive(byte, plugin) = "ipaddr_top.cma"
+ archive(native) = "ipaddr_top.cmxa"
+ archive(native, plugin) = "ipaddr_top.cmxs"
+ exists_if = "ipaddr_top.cma"
+)
# OASIS_STOP
diff --git a/lib/ipaddr.ml b/lib/ipaddr.ml
index 8ade0bf..a3101fd 100644
--- a/lib/ipaddr.ml
+++ b/lib/ipaddr.ml
@@ -134,6 +134,9 @@ module V4 = struct
to_buffer b i;
Buffer.contents b
+ let pp_hum ppf i =
+ Format.fprintf ppf "%s" (to_string i)
+
(* Byte conversion *)
let of_bytes_raw bs o =
@@ -235,6 +238,9 @@ module V4 = struct
to_buffer b subnet;
Buffer.contents b
+ let pp_hum ppf i =
+ Format.fprintf ppf "%s" (to_string i)
+
let to_address_buffer buf ((_,sz) as subnet) addr =
to_buffer buf (network_address subnet addr,sz)
@@ -522,6 +528,9 @@ module V6 = struct
to_buffer ?v4 buf l;
Buffer.contents buf
+ let pp_hum ppf i =
+ Format.fprintf ppf "%s" (to_string i)
+
(* byte conversion *)
let of_bytes_raw bs o = (* TODO : from cstruct *)
@@ -611,6 +620,9 @@ module V6 = struct
to_buffer buf subnet;
Buffer.contents buf
+ let pp_hum ppf i =
+ Format.fprintf ppf "%s" (to_string i)
+
let to_address_buffer buf ((_,sz) as subnet) addr =
to_buffer buf (network_address subnet addr,sz)
@@ -683,6 +695,9 @@ let to_buffer buf = function
| V4 x -> V4.to_buffer buf x
| V6 x -> V6.to_buffer buf x
+let pp_hum ppf i =
+ Format.fprintf ppf "%s" (to_string i)
+
let of_string_raw s offset =
let len = String.length s in
if len < !offset + 1 then raise (need_more s);
@@ -791,4 +806,6 @@ module Prefix = struct
| V4 p -> V4.Prefix.to_buffer buf p
| V6 p -> V6.Prefix.to_buffer buf p
+ let pp_hum ppf i =
+ Format.fprintf ppf "%s" (to_string i)
end
diff --git a/lib/ipaddr.mli b/lib/ipaddr.mli
index f44eefc..4188d93 100644
--- a/lib/ipaddr.mli
+++ b/lib/ipaddr.mli
@@ -64,6 +64,10 @@ module V4 : sig
buffer [buf]. *)
val to_buffer : Buffer.t -> t -> unit
+ (** [pp_hum f ipv4] outputs a human-readable representation of [ipv4] to
+ the formatter [f]. *)
+ val pp_hum : Format.formatter -> t -> unit
+
(** Bytestring conversion *)
(** [of_bytes_exn ipv4_octets] is the address represented
@@ -156,6 +160,10 @@ module V4 : sig
of [prefix], i.e. XXX.XX.X.XXX/XX. *)
val to_string : t -> string
+ (** [pp_hum f prefix] outputs a human-readable representation of [prefix]
+ to the formatter [f]. *)
+ val pp_hum : Format.formatter -> t -> unit
+
(** [of_address_string_exn cidr_addr] is the address and prefix
represented by [cidr_addr]. Raises [Parse_error] if [cidr_addr] is not
a valid representation of a CIDR-scoped address. *)
@@ -277,6 +285,10 @@ module V6 : sig
buffer [buf]. *)
val to_buffer : ?v4:bool -> Buffer.t -> t -> unit
+ (** [pp_hum f ipv6] outputs a human-readable representation of [ipv6] to
+ the formatter [f]. *)
+ val pp_hum : Format.formatter -> t -> unit
+
(** Bytestring conversion *)
(** [of_bytes_exn ipv6_octets] is the address represented
@@ -368,6 +380,10 @@ module V6 : sig
of [prefix], i.e. XXX:XX:X::XXX/XX. *)
val to_string : t -> string
+ (** [pp_hum f prefix] outputs a human-readable representation of [prefix]
+ to the formatter [f]. *)
+ val pp_hum : Format.formatter -> t -> unit
+
(** [of_address_string_exn cidr_addr] is the address and prefix
represented by [cidr_addr]. Raises [Parse_error] if [cidr_addr] is not
a valid representation of a CIDR-scoped address. *)
@@ -458,6 +474,10 @@ val to_string : t -> string
[buf]. *)
val to_buffer : Buffer.t -> t -> unit
+(** [pp_hum f ip] outputs a human-readable representation of [ip] to the
+ formatter [f]. *)
+val pp_hum : Format.formatter -> t -> unit
+
(** [of_string_exn s] parses [s] as an IPv4 or IPv6 address.
Raises [Parse_error] if [s] is not a valid string representation of an IP
address. *)
@@ -508,6 +528,17 @@ module Prefix : sig
val compare : t -> t -> int
+ (** [to_string subnet] is the text string representation of [subnet]. *)
+ val to_string : t -> string
+
+ (** [to_buffer buf subnet] writes the text string representation of [subnet]
+ into [buf]. *)
+ val to_buffer : Buffer.t -> t -> unit
+
+ (** [pp_hum f subnet] outputs a human-readable representation of [subnet]
+ to the formatter [f]. *)
+ val pp_hum : Format.formatter -> t -> unit
+
(** [of_string_exn cidr] is the subnet prefix represented by the CIDR
string, [cidr]. Raises [Parse_error] if [cidr] is not a valid
representation of a CIDR notation routing prefix. *)
@@ -540,13 +571,6 @@ module Prefix : sig
(** [of_addr ip] create a subnet composed of only one address, [ip].*)
val of_addr : addr -> t
- (** [to_string subnet] is the text string representation of [subnet]. *)
- val to_string : t -> string
-
- (** [to_buffer buf subnet] writes the text string representation of [subnet]
- into [buf]. *)
- val to_buffer : Buffer.t -> t -> unit
-
include Map.OrderedType with type t := t
end
diff --git a/lib/ipaddr_unix.ml b/lib/ipaddr_unix.ml
new file mode 100644
index 0000000..053815a
--- /dev/null
+++ b/lib/ipaddr_unix.ml
@@ -0,0 +1,48 @@
+(*
+ * Copyright (c) 2014 Anil Madhavapeddy <anil at recoil.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ *)
+
+let to_inet_addr t =
+ Unix.inet_addr_of_string (Ipaddr.to_string t)
+
+let of_inet_addr t =
+ Ipaddr.of_string_exn (Unix.string_of_inet_addr t)
+
+module V4 = struct
+
+ let to_inet_addr t =
+ Unix.inet_addr_of_string (Ipaddr.V4.to_string t)
+
+ let of_inet_addr_exn t =
+ Ipaddr.V4.of_string_exn (Unix.string_of_inet_addr t)
+
+ let of_inet_addr t =
+ try Some (of_inet_addr_exn t)
+ with _ -> None
+end
+
+module V6 = struct
+
+ let to_inet_addr t =
+ Unix.inet_addr_of_string (Ipaddr.V6.to_string t)
+
+ let of_inet_addr_exn t =
+ Ipaddr.V6.of_string_exn (Unix.string_of_inet_addr t)
+
+ let of_inet_addr t =
+ try Some (of_inet_addr_exn t)
+ with _ -> None
+end
diff --git a/lib/ipaddr_unix.mli b/lib/ipaddr_unix.mli
new file mode 100644
index 0000000..b5e5897
--- /dev/null
+++ b/lib/ipaddr_unix.mli
@@ -0,0 +1,59 @@
+(*
+ * Copyright (c) 2014 Anil Madhavapeddy <anil at recoil.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ *)
+
+(** Convert to and from [Unix] to [Ipaddr] representations *)
+
+(** [to_inet_addr ip] is the {! Unix.inet_addr} equivalent of the
+ IPv4 or IPv6 address [ip]. *)
+val to_inet_addr : Ipaddr.t -> Unix.inet_addr
+
+(** [of_inet_addr ip] is the {! Ipaddr.t} equivalent of the
+ {! Unix.inet_addr} [ip]. *)
+val of_inet_addr : Unix.inet_addr -> Ipaddr.t
+
+module V4 : sig
+
+ (** [to_inet_addr ip] is the {! Unix.inet_addr} equivalent of the
+ IPv4 address [ip]. *)
+ val to_inet_addr : Ipaddr.V4.t -> Unix.inet_addr
+
+ (** [of_inet_addr_exn ip] is the {! Ipaddr.t} equivalent of the
+ {!Unix.inet_addr} [ip] IPv4 address. Raises {! Ipaddr.Parse_error} if
+ [ip] is not a valid representation of an IPv4 address. *)
+ val of_inet_addr_exn : Unix.inet_addr -> Ipaddr.V4.t
+
+ (** Same as [of_inet_addr_exn] but returns an option type instead of raising
+ an exception. *)
+ val of_inet_addr : Unix.inet_addr -> Ipaddr.V4.t option
+end
+
+module V6 : sig
+
+ (** [to_inet_addr ip] is the {! Unix.inet_addr} equivalent of the
+ IPv6 address [ip]. *)
+ val to_inet_addr : Ipaddr.V6.t -> Unix.inet_addr
+
+
+ (** [of_inet_addr_exn ip] is the {! Ipaddr.t} equivalent of the
+ {!Unix.inet_addr} [ip] IPv6 address. Raises {! Ipaddr.Parse_error} if
+ [ip] is not a valid representation of an IPv6 address. *)
+ val of_inet_addr_exn : Unix.inet_addr -> Ipaddr.V6.t
+
+ (** Same as [of_inet_addr_exn] but returns an option type instead of raising
+ an exception. *)
+ val of_inet_addr : Unix.inet_addr -> Ipaddr.V6.t option
+end
diff --git a/lib/ipaddr_unix.mllib b/lib/ipaddr_unix.mllib
new file mode 100644
index 0000000..1e0f7b0
--- /dev/null
+++ b/lib/ipaddr_unix.mllib
@@ -0,0 +1,4 @@
+# OASIS_START
+# DO NOT EDIT (digest: ee982b4e45569cc57d5ac614e4a92b5b)
+Ipaddr_unix
+# OASIS_STOP
diff --git a/myocamlbuild.ml b/myocamlbuild.ml
index 5a5306d..6b6538d 100644
--- a/myocamlbuild.ml
+++ b/myocamlbuild.ml
@@ -1,5 +1,5 @@
(* OASIS_START *)
-(* DO NOT EDIT (digest: a1f1555690ba83caaade174974cb5694) *)
+(* DO NOT EDIT (digest: b9f1896c4b44f5c023c34582ffa087bd) *)
module OASISGettext = struct
(* # 22 "src/oasis/OASISGettext.ml" *)
@@ -555,7 +555,12 @@ end
open Ocamlbuild_plugin;;
let package_default =
{
- MyOCamlbuildBase.lib_ocaml = [("ipaddr", ["lib"], [])];
+ MyOCamlbuildBase.lib_ocaml =
+ [
+ ("ipaddr", ["lib"], []);
+ ("ipaddr_unix", ["lib"], []);
+ ("ipaddr_top", ["top"], [])
+ ];
lib_c = [];
flags =
[
@@ -578,6 +583,14 @@ let package_default =
let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;
-# 582 "myocamlbuild.ml"
+# 587 "myocamlbuild.ml"
(* OASIS_STOP *)
-Ocamlbuild_plugin.dispatch dispatch_default;;
+let () =
+ let additional_rules = function
+ | After_rules ->
+ pflag ["compile"; "ocaml"] "I" (fun x -> S [A "-I"; A x]);
+ | _ -> ()
+ in
+ Ocamlbuild_plugin.dispatch
+ (MyOCamlbuildBase.dispatch_combine
+ [MyOCamlbuildBase.dispatch_default package_default; additional_rules])
diff --git a/setup.ml b/setup.ml
index 10f0bd7..5fafb11 100644
--- a/setup.ml
+++ b/setup.ml
@@ -1,7 +1,7 @@
-(* setup.ml generated for the first time by OASIS v0.3.1 *)
+(* setup.ml generated for the first time by OASIS v0.4.1 *)
(* OASIS_START *)
-(* DO NOT EDIT (digest: e94c7d0b39c533c6cd2c54151586f95f) *)
+(* DO NOT EDIT (digest: 2064a96eb9de6b7991f512d5fa478005) *)
(*
Regenerated by OASIS v0.4.1
Visit http://oasis.forge.ocamlcore.org for more information and
@@ -6730,7 +6730,7 @@ let setup_t =
alpha_features = [];
beta_features = [];
name = "ipaddr";
- version = "2.0.0";
+ version = "2.2.0";
license =
OASISLicense.DEP5License
(OASISLicense.DEP5Unit
@@ -6784,6 +6784,26 @@ let setup_t =
files_ab = [];
sections =
[
+ Flag
+ ({
+ cs_name = "unix";
+ cs_data = PropList.Data.create ();
+ cs_plugin_data = []
+ },
+ {
+ flag_description = Some "build the unix library";
+ flag_default = [(OASISExpr.EBool true, true)]
+ });
+ Flag
+ ({
+ cs_name = "top";
+ cs_data = PropList.Data.create ();
+ cs_plugin_data = []
+ },
+ {
+ flag_description = Some "build the toplevel printers";
+ flag_default = [(OASISExpr.EBool true, true)]
+ });
Library
({
cs_name = "ipaddr";
@@ -6816,6 +6836,78 @@ let setup_t =
lib_findlib_name = Some "ipaddr";
lib_findlib_containers = []
});
+ Library
+ ({
+ cs_name = "ipaddr_unix";
+ cs_data = PropList.Data.create ();
+ cs_plugin_data = []
+ },
+ {
+ bs_build =
+ [
+ (OASISExpr.EBool true, false);
+ (OASISExpr.EFlag "unix", true)
+ ];
+ bs_install = [(OASISExpr.EBool true, true)];
+ bs_path = "lib";
+ bs_compiled_object = Best;
+ bs_build_depends =
+ [
+ FindlibPackage ("unix", None);
+ InternalLibrary "ipaddr"
+ ];
+ bs_build_tools = [ExternalTool "ocamlbuild"];
+ bs_c_sources = [];
+ bs_data_files = [];
+ bs_ccopt = [(OASISExpr.EBool true, [])];
+ bs_cclib = [(OASISExpr.EBool true, [])];
+ bs_dlllib = [(OASISExpr.EBool true, [])];
+ bs_dllpath = [(OASISExpr.EBool true, [])];
+ bs_byteopt = [(OASISExpr.EBool true, [])];
+ bs_nativeopt = [(OASISExpr.EBool true, [])]
+ },
+ {
+ lib_modules = ["Ipaddr_unix"];
+ lib_pack = false;
+ lib_internal_modules = [];
+ lib_findlib_parent = Some "ipaddr";
+ lib_findlib_name = Some "unix";
+ lib_findlib_containers = []
+ });
+ Library
+ ({
+ cs_name = "ipaddr_top";
+ cs_data = PropList.Data.create ();
+ cs_plugin_data = []
+ },
+ {
+ bs_build =
+ [
+ (OASISExpr.EBool true, false);
+ (OASISExpr.EFlag "top", true)
+ ];
+ bs_install = [(OASISExpr.EBool true, true)];
+ bs_path = "top";
+ bs_compiled_object = Best;
+ bs_build_depends = [];
+ bs_build_tools = [ExternalTool "ocamlbuild"];
+ bs_c_sources = [];
+ bs_data_files = [];
+ bs_ccopt = [(OASISExpr.EBool true, [])];
+ bs_cclib = [(OASISExpr.EBool true, [])];
+ bs_dlllib = [(OASISExpr.EBool true, [])];
+ bs_dllpath = [(OASISExpr.EBool true, [])];
+ bs_byteopt = [(OASISExpr.EBool true, [])];
+ bs_nativeopt = [(OASISExpr.EBool true, [])]
+ },
+ {
+ lib_modules = ["Ipaddr_top"];
+ lib_pack = false;
+ lib_internal_modules = [];
+ lib_findlib_parent = Some "ipaddr";
+ lib_findlib_name = Some "top";
+ lib_findlib_containers = []
+ });
Test
({
cs_name = "ipaddr";
@@ -6846,7 +6938,7 @@ let setup_t =
};
oasis_fn = Some "_oasis";
oasis_version = "0.4.1";
- oasis_digest = Some "R\021\187\"\243\226u\149=\232\191A\177O\215\223";
+ oasis_digest = Some "vz\180\151\174:\136\164H\128{((Q\000V";
oasis_exec = None;
oasis_setup_args = [];
setup_update = false
@@ -6854,6 +6946,6 @@ let setup_t =
let setup () = BaseSetup.setup setup_t;;
-# 6858 "setup.ml"
+# 6950 "setup.ml"
(* OASIS_STOP *)
let () = setup ();;
diff --git a/top/ipaddr_top.ml b/top/ipaddr_top.ml
new file mode 100644
index 0000000..9f80f74
--- /dev/null
+++ b/top/ipaddr_top.ml
@@ -0,0 +1,24 @@
+let printers = [
+ "Ipaddr.pp_hum";
+ "Ipaddr.Prefix.pp_hum";
+ "Ipaddr.V4.pp_hum";
+ "Ipaddr.V4.Prefix.pp_hum";
+ "Ipaddr.V6.pp_hum";
+ "Ipaddr.V6.Prefix.pp_hum";
+]
+
+let eval_string
+ ?(print_outcome = false) ?(err_formatter = Format.err_formatter) str =
+ let lexbuf = Lexing.from_string str in
+ let phrase = !Toploop.parse_toplevel_phrase lexbuf in
+ Toploop.execute_phrase print_outcome err_formatter phrase
+
+let rec install_printers = function
+ | [] -> true
+ | printer :: printers ->
+ let cmd = Printf.sprintf "#install_printer %s;;" printer in
+ eval_string cmd && install_printers printers
+
+let () =
+ if not (install_printers printers) then
+ Format.eprintf "Problem installing Ipaddr-printers at ."
diff --git a/top/ipaddr_top.mllib b/top/ipaddr_top.mllib
new file mode 100644
index 0000000..d012204
--- /dev/null
+++ b/top/ipaddr_top.mllib
@@ -0,0 +1,4 @@
+# OASIS_START
+# DO NOT EDIT (digest: 3d356511396d154b0f981aed8b64d9b1)
+Ipaddr_top
+# OASIS_STOP
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ocaml-maint/packages/ocaml-ipaddr.git
More information about the Pkg-ocaml-maint-commits
mailing list