1 (* Copyright (C) 2004-2008, HELM Team.
3 * This file is part of HELM, an Hypertextual, Electronic
4 * Library of Mathematics, developed at the Computer Science
5 * Department, University of Bologna, Italy.
7 * HELM is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * HELM is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with HELM; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
22 * For details, see the HELM World-Wide-Web page,
23 * http://helm.cs.unibo.it/
26 exception NoRootFor of string
27 exception FileNotFound of string
29 (* make a relative path absolute *)
30 val absolutize: string -> string
32 (* a root file is a text, line oriented, file containing pairs separated by
33 * the '=' character. Example:
35 * baseuri = cic:/foo/bar
36 * include_paths = ../baz ../../pippo
38 * spaces at the end/begin of the line and around '=' are ignored,
39 * multiple spaces in the middle of an item are shrinked to one.
41 val load_root_file: string -> (string*string) list
43 (* baseuri_of_script ?(inc:REG[matita.includes]) fname
45 * root, buri, fullpath, rootrelativepath
46 * sample: baseuri_of_script a.ma -> /home/pippo/devel/, cic:/matita/a,
47 * /home/pippo/devel/a.ma, a.ma *)
48 val baseuri_of_script:
49 include_paths:string list -> string -> string * string * string * string
51 (* given a baseuri and a file name (relative to its root)
53 * mk_baseuri "cic:/matita" "nat/plus.ma" -> "cic:/matita/nat/plus"
55 val mk_baseuri: string -> string -> string
57 (* finds all the roots files in the specified dir, roots are
58 * text files, readable by the user named 'root'
60 val find_roots_in_dir: string -> string list
62 (* true if the argunent starts with a uri scheme prefix *)
63 val is_uri: string -> bool