]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/lambda-delta/toplevel/metaLibrary.ml
- performance data added for reference
[helm.git] / helm / software / lambda-delta / toplevel / metaLibrary.ml
diff --git a/helm/software/lambda-delta/toplevel/metaLibrary.ml b/helm/software/lambda-delta/toplevel/metaLibrary.ml
new file mode 100644 (file)
index 0000000..e9192f5
--- /dev/null
@@ -0,0 +1,36 @@
+(*
+    ||M||  This file is part of HELM, an Hypertextual, Electronic        
+    ||A||  Library of Mathematics, developed at the Computer Science     
+    ||T||  Department, University of Bologna, Italy.                     
+    ||I||                                                                
+    ||T||  HELM is free software; you can redistribute it and/or         
+    ||A||  modify it under the terms of the GNU General Public License   
+    \   /  version 2 or (at your option) any later version.              
+     \ /   This software is distributed as is, NO WARRANTY.              
+      V_______________________________________________________________ *)
+
+module F = Format
+module O = MetaOutput
+
+type out_channel = Pervasives.out_channel * F.formatter
+
+(* internal functions *******************************************************)
+
+let hal_dir = "hal"
+
+let hal_ext = ".hal"
+
+(* interface functions ******************************************************)
+
+let open_out f name =      
+   let _ = Sys.command (Printf.sprintf "mkdir -p %s" hal_dir) in
+   let och = open_out (Filename.concat hal_dir (name ^ hal_ext)) in
+   let frm = F.formatter_of_out_channel och in
+   F.pp_set_margin frm max_int;
+   f (och, frm)
+
+let write_item f (_, frm) item =
+   O.pp_item f frm item
+   
+let close_out f (och, _) =
+   close_out och; f ()