| 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 | (* [fatal_error msg] prints msg and exits 1 *) |
| 12 | val fatal_error : Pp.t -> 'a |
| 13 | |
| 14 | (* [ensure ext src tgt] checks that, once stripped by ext, both [src] and |
| 15 | [tgt] have the same basename, and returns [tgt] with the extension. |
| 16 | [ext] is expected to begin with dot, eg [".v"]. *) |
| 17 | val ensure : ext:string -> src:string -> tgt:string -> string |
| 18 | |
| 19 | (* [ensure_exists f] fails if f does not exist *) |
| 20 | val ensure_exists : string -> unit |
| 21 | |
| 22 | (* [ensure_exists_with_prefix src tgt src_ext tgt_ext] checks that [src] exists |
| 23 | (if needed adding the extension) and that [tgt] exists (if needed adding the |
| 24 | extension) and returns [src] and [tgt] with their respective extensions. |
| 25 | If [tgt] is [None], then it defaults to [src] (with [tgt_ext] as extension). |
| 26 | [src_ext] and [tgt_ext] are expected to begin with dot, eg [".v"]. *) |
| 27 | val ensure_exists_with_prefix : src:string -> tgt:string option -> src_ext:string -> tgt_ext:string -> string * string |
| 28 | |
| 29 | (* [chop_extension f] is like Filename.chop_extension but fail safe *) |
| 30 | val safe_chop_extension : string -> string |
| 31 | |
| 32 | (* [ensure_no_pending_proofs ~filename] checks that no proof or obligation |
| 33 | is open *) |
| 34 | val ensure_no_pending_proofs : filename:string -> Vernacstate.t -> unit |