X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Flambda-delta%2Fcommon%2Flibrary.ml;h=1238c273986b760d9af759a564902d6e5b18b7f7;hb=a9f15ca61aac8089fb4b599af72533c4a432ba7b;hp=c60a227e76c65e425783f007dc7c4a003f641bfc;hpb=79684e8bd0f54b5c88fff981366bd8c78dd0fbe9;p=helm.git diff --git a/helm/software/lambda-delta/common/library.ml b/helm/software/lambda-delta/common/library.ml index c60a227e7..1238c2739 100644 --- a/helm/software/lambda-delta/common/library.ml +++ b/helm/software/lambda-delta/common/library.ml @@ -13,6 +13,8 @@ module F = Filename module U = NUri module H = Hierarchy +type 'a out = (unit -> 'a) -> string -> 'a + (* internal functions *******************************************************) let base = "xml" @@ -42,7 +44,7 @@ let close_entry frm = (* interface functions ******************************************************) -let export_unit export_entry si g = function +let old_export_entity export_entry si g = function | Some entry -> let _, uri, bind = entry in let path = path_of_uri uri in @@ -54,3 +56,20 @@ let export_unit export_entry si g = function pp_head pp_doctype (open_entry si g) export_entry entry close_entry; close_out och | None -> () + +(****************************************************************************) +(* +let export_entity export_entry si g = function + | Some entry -> + let _, uri, bind = entry in + let path = path_of_uri root uri in + let _ = Sys.command (Printf.sprintf "mkdir -p %s" (F.dirname path)) in + let och = open_out (path ^ obj_ext) in + let out f s = output_string och s; f () in + let f () = close_out och in + + Format.fprintf frm "@[%t%t%t%a%t@]@." + pp_head pp_doctype (open_entry si g) export_entry entry close_entry; + close_out och + | None -> () +*)