package / ocaml-base-compiler.4.10.0 / otherlibs / dynlink / dynlink_platform_intf.ml
1 #2 "otherlibs/dynlink/dynlink_platform_intf.ml"
2 (**************************************************************************)
3 (* *)
4 (* OCaml *)
5 (* *)
6 (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
7 (* Mark Shinwell and Leo White, Jane Street Europe *)
8 (* *)
9 (* Copyright 1996 Institut National de Recherche en Informatique et *)
10 (* en Automatique. *)
11 (* Copyright 2017--2018 Jane Street Group LLC *)
12 (* *)
13 (* All rights reserved. This file is distributed under the terms of *)
14 (* the GNU Lesser General Public License version 2.1, with the *)
15 (* special exception on linking described in the file LICENSE. *)
16 (* *)
17 (**************************************************************************)
18
19 (** Interface for platform-specific dynlink providers.
20 Note that this file needs to be a valid .mli file. *)
21
22 [@@@ocaml.warning "+a-4-30-40-41-42"]
23
24 module type S = sig
25 type handle
26
27 module Unit_header : sig
28 type t
29
30 val name : t -> string
31 val crc : t -> Digest.t option
32
33 val interface_imports : t -> (string * Digest.t option) list
34 val implementation_imports : t -> (string * Digest.t option) list
35
36 val defined_symbols : t -> string list
37 val unsafe_module : t -> bool
38 end
39
40 val init : unit -> unit
41
42 val is_native : bool
43
44 val adapt_filename : Dynlink_types.filename -> Dynlink_types.filename
45
46 val num_globals_inited : unit -> int
47
48 val fold_initial_units
49 : init:'a
50 -> f:('a
51 -> comp_unit:string
52 -> interface:Digest.t option
53 -> implementation:(Digest.t option * Dynlink_types.implem_state) option
54 -> defined_symbols:string list
55 -> 'a)
56 -> 'a
57
58 val load
59 : filename:Dynlink_types.filename
60 -> priv:bool
61 -> handle * (Unit_header.t list)
62
63 val run_shared_startup : handle -> unit
64 val run : handle -> unit_header:Unit_header.t -> priv:bool -> unit
65
66 val unsafe_get_global_value : bytecode_or_asm_symbol:string -> Obj.t option
67
68 val finish : handle -> unit
69 end
70