1 (**************************************************************************)
2 (* *)
3 (* OCaml *)
4 (* *)
5 (* Fabrice Le Fessant, EPI Gallium, INRIA Paris-Rocquencourt *)
6 (* *)
7 (* Copyright 2013 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 val module_of_filename : string -> string -> string
17
18 val output_prefix : string -> string
19 val extract_output : string option -> string
20 val default_output : string option -> string
21
22 val print_version_and_library : string -> 'a
23 val print_version_string : unit -> 'a
24 val print_standard_library : unit -> 'a
25 val fatal : string -> 'a
26
27 val first_ccopts : string list ref
28 val first_ppx : string list ref
29 val first_include_dirs : string list ref
30 val last_include_dirs : string list ref
31
32 (* return the list of objfiles, after OCAMLPARAM and List.rev *)
33 val get_objfiles : with_ocamlparam:bool -> string list
34 val last_objfiles : string list ref
35 val first_objfiles : string list ref
36
37 type filename = string
38
39 type readenv_position =
40 Before_args | Before_compile of filename | Before_link
41
42 val readenv : Format.formatter -> readenv_position -> unit
43
44 (* [is_unit_name name] returns true only if [name] can be used as a
45 correct module name *)
46 val is_unit_name : string -> bool
47 (* [check_unit_name ppf filename name] prints a warning in [filename]
48 on [ppf] if [name] should not be used as a module name. *)
49 val check_unit_name : string -> string -> unit
50
51 (* Deferred actions of the compiler, while parsing arguments *)
52
53 type deferred_action =
54 | ProcessImplementation of string
55 | ProcessInterface of string
56 | ProcessCFile of string
57 | ProcessOtherFile of string
58 | ProcessObjects of string list
59 | ProcessDLLs of string list
60
61 val c_object_of_filename : string -> string
62
63 val defer : deferred_action -> unit
64 val anonymous : string -> unit
65 val impl : string -> unit
66 val intf : string -> unit
67
68 val process_deferred_actions :
69 Format.formatter *
70 (source_file:string -> output_prefix:string -> unit) *
71 (* compile implementation *)
72 (source_file:string -> output_prefix:string -> unit) *
73 (* compile interface *)
74 string * (* ocaml module extension *)
75 string -> (* ocaml library extension *)
76 unit
77