2016-02-18 07:11:59 -08:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
|
|
|
(* OCaml *)
|
|
|
|
(* *)
|
|
|
|
(* Fabrice Le Fessant, INRIA Saclay *)
|
|
|
|
(* *)
|
|
|
|
(* Copyright 2012 Institut National de Recherche en Informatique et *)
|
|
|
|
(* en Automatique. *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. This file is distributed under the terms of *)
|
|
|
|
(* the GNU Lesser General Public License version 2.1, with the *)
|
|
|
|
(* special exception on linking described in the file LICENSE. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
2012-05-30 08:25:49 -07:00
|
|
|
|
2015-11-27 10:13:56 -08:00
|
|
|
type pers_flags =
|
|
|
|
| Rectypes
|
|
|
|
| Deprecated of string
|
2015-11-29 08:23:38 -08:00
|
|
|
| Opaque
|
2012-05-30 08:25:49 -07:00
|
|
|
|
|
|
|
type cmi_infos = {
|
|
|
|
cmi_name : string;
|
|
|
|
cmi_sign : Types.signature_item list;
|
2014-05-06 17:34:20 -07:00
|
|
|
cmi_crcs : (string * Digest.t option) list;
|
2012-05-30 08:25:49 -07:00
|
|
|
cmi_flags : pers_flags list;
|
|
|
|
}
|
|
|
|
|
|
|
|
(* write the magic + the cmi information *)
|
|
|
|
val output_cmi : string -> out_channel -> cmi_infos -> Digest.t
|
|
|
|
|
|
|
|
(* read the cmi information (the magic is supposed to have already been read) *)
|
|
|
|
val input_cmi : in_channel -> cmi_infos
|
|
|
|
|
|
|
|
(* read a cmi from a filename, checking the magic *)
|
|
|
|
val read_cmi : string -> cmi_infos
|
|
|
|
|
|
|
|
(* Error report *)
|
|
|
|
|
|
|
|
type error =
|
|
|
|
Not_an_interface of string
|
|
|
|
| Wrong_version_interface of string * string
|
|
|
|
| Corrupted_interface of string
|
|
|
|
|
|
|
|
exception Error of error
|
|
|
|
|
|
|
|
open Format
|
|
|
|
|
|
|
|
val report_error: formatter -> error -> unit
|