-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathcmi_format.mli
62 lines (49 loc) · 2.14 KB
/
cmi_format.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
(**************************************************************************)
(* *)
(* 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. *)
(* *)
(**************************************************************************)
open Misc
type pers_flags =
| Rectypes
| Alerts of alerts
| Opaque
type kind =
| Normal of {
cmi_impl : Compilation_unit.t;
}
| Parameter
type 'sg cmi_infos_generic = {
cmi_name : Compilation_unit.Name.t;
cmi_kind : kind;
cmi_sign : 'sg;
cmi_crcs : Import_info.t array;
cmi_flags : pers_flags list;
}
type cmi_infos_lazy = Subst.Lazy.signature cmi_infos_generic
type cmi_infos = Types.signature cmi_infos_generic
(* write the magic + the cmi information *)
val output_cmi : string -> out_channel -> cmi_infos_lazy -> Digest.t
(* read the cmi information (the magic is supposed to have already been read) *)
val input_cmi : in_channel -> cmi_infos
val input_cmi_lazy : in_channel -> cmi_infos_lazy
(* read a cmi from a filename, checking the magic *)
val read_cmi : string -> cmi_infos
val read_cmi_lazy : string -> cmi_infos_lazy
(* Error report *)
type error =
| Not_an_interface of filepath
| Wrong_version_interface of filepath * string
| Corrupted_interface of filepath
exception Error of error
open Format
val report_error: formatter -> error -> unit