]> matita.cs.unibo.it Git - helm.git/commitdiff
configuration.ml moved to configuration.ml.in to use autoconf
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 28 Dec 2000 17:09:16 +0000 (17:09 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 28 Dec 2000 17:09:16 +0000 (17:09 +0000)
helm/interface/configuration.ml [deleted file]
helm/interface/configuration.ml.in [new file with mode: 0644]

diff --git a/helm/interface/configuration.ml b/helm/interface/configuration.ml
deleted file mode 100644 (file)
index 9a36cb3..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-(******************************************************************************)
-(*                                                                            *)
-(*                               PROJECT HELM                                 *)
-(*                                                                            *)
-(*                Claudio Sacerdoti Coen <sacerdot@cs.unibo.it>               *)
-(*                                 06/05/2000                                 *)
-(*                                                                            *)
-(* This is the parser that reads the configuration file of helm               *)
-(*                                                                            *)
-(******************************************************************************)
-
-(* this should be the only hard coded constant *)
-let filename =
- let prefix =
-  try
-   Sys.getenv "HELM_CONFIGURATION_PREFIX"
-  with
-   Not_found -> ""
- in
-  prefix ^ "/local/etc/helm/configuration.xml";;
-
-exception Warnings;;
-
-class warner =
-  object 
-    method warn w =
-      print_endline ("WARNING: " ^ w) ;
-      (raise Warnings : unit)
-  end
-;;
-
-let xml_document () =
- let module Y = Pxp_yacc in
-  try 
-   let config = {Y.default_config with Y.warner = new warner} in
-    Y.parse_document_entity config (Y.from_file filename) Y.default_spec
-  with
-   e ->
-     print_endline (Pxp_types.string_of_exn e) ;
-     raise e
-;;
-
-exception Impossible;;
-
-let vars = Hashtbl.create 14;;
-
-(* resolve <value-of> tags and returns the string values of the variable tags *)
-let rec resolve =
- let module D = Pxp_document in
-  function
-     [] -> ""
-   | he::tl when he#node_type = D.T_element "value-of" ->
-      (match he#attribute "var" with
-          Pxp_types.Value var -> Hashtbl.find vars var
-        | _ -> raise Impossible
-      ) ^ resolve tl
-   | he::tl when he#node_type = D.T_data ->
-      he#data ^ resolve tl
-   | _ -> raise Impossible
-;;
-
-(* we trust the xml file to be valid because of the validating xml parser *)
-let _ =
- List.iter
-  (function
-      n ->
-       match n#node_type with
-          Pxp_document.T_element var ->
-           Hashtbl.add vars var (resolve (n#sub_nodes))
-        | _ -> raise Impossible
-  )
-  ((xml_document ())#root#sub_nodes)
-;;
-
-let helm_dir      = Hashtbl.find vars "helm_dir";;
-let dtd_dir       = Hashtbl.find vars "dtd_dir";;
-let servers_file  = Hashtbl.find vars "servers_file";;
-let uris_dbm      = Hashtbl.find vars "uris_dbm";;
-let dest          = Hashtbl.find vars "dest";;
-let indexname     = Hashtbl.find vars "indexname";;
-let tmpdir        = Hashtbl.find vars "tmpdir";;
-let helm_dir      = Hashtbl.find vars "helm_dir";;
-let getter_url    = Hashtbl.find vars "getter_url";;
-
-let _ = Hashtbl.clear vars;;
diff --git a/helm/interface/configuration.ml.in b/helm/interface/configuration.ml.in
new file mode 100644 (file)
index 0000000..add4c3a
--- /dev/null
@@ -0,0 +1,85 @@
+(******************************************************************************)
+(*                                                                            *)
+(*                               PROJECT HELM                                 *)
+(*                                                                            *)
+(*                Claudio Sacerdoti Coen <sacerdot@cs.unibo.it>               *)
+(*                                 28/12/2000                                 *)
+(*                                                                            *)
+(* This is the parser that reads the configuration file of helm               *)
+(*                                                                            *)
+(******************************************************************************)
+
+(* this should be the only hard coded constant *)
+let filename =
+ let prefix =
+  try
+   Sys.getenv "HELM_CONFIGURATION_PREFIX"
+  with
+   Not_found -> ""
+ in
+  prefix ^ "/local/etc/helm/configuration.xml";;
+
+exception Warnings;;
+
+class warner =
+  object 
+    method warn w =
+      print_endline ("WARNING: " ^ w) ;
+      (raise Warnings : unit)
+  end
+;;
+
+let xml_document () =
+ let module Y = Pxp_yacc in
+  try 
+   let config = {Y.default_config with Y.warner = new warner} in
+    Y.parse_document_entity config (Y.from_file filename) Y.default_spec
+  with
+   e ->
+     print_endline (Pxp_types.string_of_exn e) ;
+     raise e
+;;
+
+exception Impossible;;
+
+let vars = Hashtbl.create 14;;
+
+(* resolve <value-of> tags and returns the string values of the variable tags *)
+let rec resolve =
+ let module D = Pxp_document in
+  function
+     [] -> ""
+   | he::tl when he#node_type = D.T_element "value-of" ->
+      (match he#attribute "var" with
+          Pxp_types.Value var -> Hashtbl.find vars var
+        | _ -> raise Impossible
+      ) ^ resolve tl
+   | he::tl when he#node_type = D.T_data ->
+      he#data ^ resolve tl
+   | _ -> raise Impossible
+;;
+
+(* we trust the xml file to be valid because of the validating xml parser *)
+let _ =
+ List.iter
+  (function
+      n ->
+       match n#node_type with
+          Pxp_document.T_element var ->
+           Hashtbl.add vars var (resolve (n#sub_nodes))
+        | _ -> raise Impossible
+  )
+  ((xml_document ())#root#sub_nodes)
+;;
+
+let helm_dir      = Hashtbl.find vars "helm_dir";;
+let dtd_dir       = Hashtbl.find vars "dtd_dir";;
+let servers_file  = Hashtbl.find vars "servers_file";;
+let uris_dbm      = Hashtbl.find vars "uris_dbm";;
+let dest          = Hashtbl.find vars "dest";;
+let indexname     = Hashtbl.find vars "indexname";;
+let tmpdir        = Hashtbl.find vars "tmpdir";;
+let helm_dir      = Hashtbl.find vars "helm_dir";;
+let getter_url    = Hashtbl.find vars "getter_url";;
+
+let _ = Hashtbl.clear vars;;