| 1 | (************************************************************************) |
| 2 | (* * The Rocq Prover / The Rocq Development Team *) |
| 3 | (* v * Copyright INRIA, CNRS and contributors *) |
| 4 | (* <O___,, * (see version control and CREDITS file for authors & dates) *) |
| 5 | (* \VV/ **************************************************************) |
| 6 | (* // * This file is distributed under the terms of the *) |
| 7 | (* * GNU Lesser General Public License Version 2.1 *) |
| 8 | (* * (see LICENSE file for the text of the license) *) |
| 9 | (************************************************************************) |
| 10 | |
| 11 | (** Main etry point to the sysinit component, all other modules are private. |
| 12 | |
| 13 | The following API shoud be called in order, and the first 3 steps only once |
| 14 | since they initialize global data. On the contrary step 4 can be called |
| 15 | many times to init the compilation of a unit. |
| 16 | *) |
| 17 | |
| 18 | (** 1 initialization of OCaml's runtime |
| 19 | |
| 20 | Profiling, GC parameters and signals. Nothing specific to Coq per se, but |
| 21 | the defaults here are good for Coq. |
| 22 | This API should be called up very early, or not at all. *) |
| 23 | val init_ocaml : unit -> unit |
| 24 | |
| 25 | val dirpath_of_top : Coqargs.top -> Names.DirPath.t |
| 26 | |
| 27 | (** 2 parsing of Sys.argv |
| 28 | |
| 29 | This API parses command line options which are known by Coq components. |
| 30 | Ideally it is functional, but some values in the `Flags` modules are set |
| 31 | on the spot instead of being represented as "injection commands" (a field |
| 32 | of Coqargs.t). |
| 33 | |
| 34 | The [string list] argument is typically [List.tl (Array.to_list Sys.argv)]. |
| 35 | |
| 36 | [parse_extra] and [usage] can be used to parse/document more options. *) |
| 37 | val parse_arguments : |
| 38 | parse_extra:(Coqargs.t -> string list -> 'a * string list) -> |
| 39 | ?initial_args:Coqargs.t -> |
| 40 | string list -> |
| 41 | Coqargs.t * 'a |
| 42 | |
| 43 | (** 3 initialization of global runtime data |
| 44 | |
| 45 | All global setup is done here, like ROCQLIB and the paths for native |
| 46 | compilation. If Coq is used to process multiple libraries, what is set up |
| 47 | here is really global and common to all of them. |
| 48 | |
| 49 | This API must be called, typically jsut after parsing arguments. *) |
| 50 | val init_runtime : usage:Boot.Usage.specific_usage -> Coqargs.t -> unit |
| 51 | |
| 52 | val init_document : Coqargs.t -> unit |
| 53 | |
| 54 | (** 4 Start a library (sets options and loads objects like the prelude) |
| 55 | |
| 56 | Given the logical name [top] of the current library and the set of initial |
| 57 | options and required libraries, it starts its processing (see also |
| 58 | Declaremods.start_library) *) |
| 59 | val start_library : |
| 60 | intern:Library.Intern.t -> top:Names.DirPath.t -> Coqargs.injection_command list -> unit |