1 (**************************************************************************)
2 (* *)
3 (* OCaml *)
4 (* *)
5 (* Fabrice Le Fessant, INRIA Saclay *)
6 (* *)
7 (* Copyright 2012 Institut National de Recherche en Informatique et *)
8 (* en Automatique. *)
9 (* *)
10 (* All rights reserved. This file is distributed under the terms of *)
11 (* the GNU Lesser General Public License version 2.1, with the *)
12 (* special exception on linking described in the file LICENSE. *)
13 (* *)
14 (**************************************************************************)
15
16 open Misc
17
18 type pers_flags =
19 | Rectypes
20 | Alerts of alerts
21 | Opaque
22 | Unsafe_string
23
24 type cmi_infos = {
25 cmi_name : modname;
26 cmi_sign : Types.signature_item list;
27 cmi_crcs : crcs;
28 cmi_flags : pers_flags list;
29 }
30
31 (* write the magic + the cmi information *)
32 val output_cmi : string -> out_channel -> cmi_infos -> Digest.t
33
34 (* read the cmi information (the magic is supposed to have already been read) *)
35 val input_cmi : in_channel -> cmi_infos
36
37 (* read a cmi from a filename, checking the magic *)
38 val read_cmi : string -> cmi_infos
39
40 (* Error report *)
41
42 type error =
43 | Not_an_interface of filepath
44 | Wrong_version_interface of filepath * string
45 | Corrupted_interface of filepath
46
47 exception Error of error
48
49 open Format
50
51 val report_error: formatter -> error -> unit
52