2 ||M|| This file is part of HELM, an Hypertextual, Electronic
3 ||A|| Library of Mathematics, developed at the Computer Science
4 ||T|| Department, University of Bologna, Italy.
6 ||T|| HELM is free software; you can redistribute it and/or
7 ||A|| modify it under the terms of the GNU General Public License
8 \ / version 2 or (at your option) any later version.
9 \ / This software is distributed as is, NO WARRANTY.
10 V_______________________________________________________________ *)
14 module R = Helm_registry
16 let template = "matita.ma.templ"
18 let myself = F.basename Sys.argv.(0)
20 let get_preamble conf =
22 let rt_base_dir = R.get_string "matita.rt_base_dir" in
23 F.concat rt_base_dir template
25 let copy_preamble preamble och =
26 let ich = open_in preamble in
28 Printf.fprintf och "%s\n" (input_line ich); read ()
30 try read () with End_of_file -> close_in ich
32 let print_comment och =
33 let stars = String.make (30 - String.length myself) '*' in
34 Printf.fprintf och "(* This file was generated by %s: do not edit %s*)\n\n" myself stars
36 let open_out preamble name =
38 R.get_string "matita.rt_base_dir";
39 R.get_string "xoa.output_dir";
42 let name = List.fold_left F.concat "" path in
43 let och = open_out (name ^ ".ma") in
44 copy_preamble preamble och; print_comment och;
47 let out_include och s =
48 Printf.fprintf och "include \"%s\".\n\n" s