Debian Codegraph @

tools/coqdep/lib/loadpath.mli

raw symbols SCIP
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 (** To move *)
12 val get_extension : string -> string list -> string * string
13
14 (* Loadpaths *)
15 type basename = string
16 type dirname = string
17 type dir = string option
18 type filename = string
19 type dirpath = string list
20 type root = filename * dirpath
21
22 module Filename :
23 sig
24 type t
25 val repr : t -> filename
26 end
27
28 module FileSet : Set.S with type elt = Filename.t
29
30 type fileset = private {
31 point : filename;
32 files : FileSet.t; (* guaranteed to contain [point] *)
33 }
34
35 type result =
36 | ExactMatches of fileset
37 | PartialMatchesInSameRoot of root * fileset
38
39 module State : sig
40 type t
41
42 val make : worker:string option -> boot:bool -> t
43 end
44
45 val get_worker_path : State.t -> string
46
47 val search_v_known : State.t -> ?from:dirpath -> dirpath -> result option
48 val search_other_known : State.t -> ?from:dirpath -> dirpath -> result option
49
50 val is_in_coqlib : State.t -> ?from:dirpath -> dirpath -> bool
51 val is_other_in_coqlib : State.t -> from:dirpath -> dirpath -> bool
52
53 val add_current_dir : State.t -> System.unix_path -> unit
54 val add_q_include : State.t -> System.unix_path -> string -> unit
55 val add_r_include : State.t -> System.unix_path -> string -> unit
56
57 (* These should disappear in favor of add_q / add_r *)
58
59 (** Simply add this directory and imports it, no subdirs. This is used
60 by the implicit adding of the current path. *)
61 val add_norec_dir_import :
62 (bool -> root -> dirname -> dirpath -> basename -> unit) -> dirname -> dirpath -> unit
63
64 (** -Q semantic: go in subdirs but only full logical paths are known. *)
65 val add_rec_dir_no_import :
66 (bool -> root -> dirname -> dirpath -> basename -> unit) -> dirname -> dirpath -> unit
67
68 (** -R semantic: go in subdirs and suffixes of logical paths are known. *)
69 val add_rec_dir_import :
70 (bool -> root -> dirname -> dirpath -> basename -> unit) -> dirname -> dirpath -> unit
71
72 val add_known : State.t -> bool -> root -> dirname -> dirpath -> basename -> unit
73 val add_coqlib_known : State.t -> bool -> root -> dirname -> dirpath -> basename -> unit
74
75 (** [find_dir_logpath phys_dir] Return the logical path of directory
76 [dir] if it has been given one. Raise [Not_found] otherwise. In
77 particular we can check if "." has been attributed a logical path
78 after processing all options and silently give the default one if
79 it hasn't. We may also use this to warn if ap hysical path is met
80 twice.*)
81 val find_dir_logpath : string -> string list
82
83 (* Used only in "canonize" *)
84 val absolute_dir : string -> string
85 val absolute_file_name : filename_concat:(string -> string -> string) -> string -> string option -> string