From 0d74fa83bb6f923a74151a8a160a8621170aa812 Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Wed, 11 Feb 2004 12:01:56 +0000 Subject: [PATCH] ported to new getter (backend) --- helm/ocaml/cic_annotations_cache/Makefile | 3 ++- helm/ocaml/cic_annotations_cache/cicCache.ml | 8 +++----- helm/ocaml/cic_cache/Makefile | 4 +++- helm/ocaml/cic_cache/cicCache.ml | 19 ++++++++----------- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/helm/ocaml/cic_annotations_cache/Makefile b/helm/ocaml/cic_annotations_cache/Makefile index 8b80b4f00..f5adf6380 100644 --- a/helm/ocaml/cic_annotations_cache/Makefile +++ b/helm/ocaml/cic_annotations_cache/Makefile @@ -1,5 +1,5 @@ PACKAGE = cic_annotations_cache -REQUIRES = helm-cic_annotations +REQUIRES = helm-cic_annotations helm-getter PREDICATES = INTERFACE_FILES = cicCache.mli @@ -8,3 +8,4 @@ EXTRA_OBJECTS_TO_INSTALL = EXTRA_OBJECTS_TO_CLEAN = include ../Makefile.common + diff --git a/helm/ocaml/cic_annotations_cache/cicCache.ml b/helm/ocaml/cic_annotations_cache/cicCache.ml index 088539758..5da492f11 100644 --- a/helm/ocaml/cic_annotations_cache/cicCache.ml +++ b/helm/ocaml/cic_annotations_cache/cicCache.ml @@ -36,14 +36,12 @@ (******************************************************************************) let get_annobj uri = - let module G = Getter in let module U = UriManager in - let cicfilename = G.getxml (U.cicuri_of_uri uri) in + let cicfilename = Http_getter.getxml' (U.cicuri_of_uri uri) in let cicbodyfilename = match U.bodyuri_of_uri uri with None -> None - | Some bodyuri -> - Some (G.getxml (U.cicuri_of_uri bodyuri)) + | Some bodyuri -> Some (Http_getter.getxml' (U.cicuri_of_uri bodyuri)) in let annobj = CicParser.annobj_of_xml cicfilename cicbodyfilename in Unix.unlink cicfilename ; @@ -51,7 +49,7 @@ let get_annobj uri = annobj, if U.uri_is_annuri uri then begin - let annfilename = G.getxml (U.annuri_of_uri uri) in + let annfilename = Http_getter.getxml' (U.annuri_of_uri uri) in let res = Some (CicAnnotationParser.get_annotations annfilename) in diff --git a/helm/ocaml/cic_cache/Makefile b/helm/ocaml/cic_cache/Makefile index 672f904d3..a7bff8fe8 100644 --- a/helm/ocaml/cic_cache/Makefile +++ b/helm/ocaml/cic_cache/Makefile @@ -1,5 +1,6 @@ + PACKAGE = cic_cache -REQUIRES = helm-cic +REQUIRES = helm-cic helm-getter PREDICATES = INTERFACE_FILES = cicCache.mli @@ -8,3 +9,4 @@ EXTRA_OBJECTS_TO_INSTALL = EXTRA_OBJECTS_TO_CLEAN = include ../Makefile.common + diff --git a/helm/ocaml/cic_cache/cicCache.ml b/helm/ocaml/cic_cache/cicCache.ml index 29d6a9a2f..b4ae4fbec 100644 --- a/helm/ocaml/cic_cache/cicCache.ml +++ b/helm/ocaml/cic_cache/cicCache.ml @@ -36,9 +36,8 @@ (******************************************************************************) let get_annobj uri = - let module G = Getter in let module U = UriManager in - let cicfilename = G.getxml (U.cicuri_of_uri uri) in + let cicfilename = Http_getter.getxml' (U.cicuri_of_uri uri) in match (U.bodyuri_of_uri uri) with None -> let annobj = CicParser.annobj_of_xml cicfilename None in @@ -47,11 +46,11 @@ let get_annobj uri = | Some bodyuri -> let cicbodyfilename = try - ignore (Getter.resolve bodyuri) ; + ignore (Http_getter.resolve' bodyuri) ; (* The body exists ==> it is not an axiom *) - Some (Getter.getxml bodyuri) + Some (Http_getter.getxml' bodyuri) with - Getter.Unresolved -> + Http_getter_types.Unresolvable_URI _ -> (* The body does not exist ==> we consider it an axiom *) None in @@ -64,9 +63,8 @@ let get_annobj uri = ;; let get_obj uri = - let module G = Getter in let module U = UriManager in - let cicfilename = G.getxml (U.cicuri_of_uri uri) in + let cicfilename = Http_getter.getxml' (U.cicuri_of_uri uri) in match (U.bodyuri_of_uri uri) with None -> let obj = CicParser.obj_of_xml cicfilename None in @@ -75,11 +73,10 @@ let get_obj uri = | Some bodyuri -> let cicbodyfilename = try - ignore (Getter.resolve bodyuri) ; + ignore (Http_getter.resolve' bodyuri) ; (* The body exists ==> it is not an axiom *) - Some (Getter.getxml bodyuri) - with - Getter.Unresolved -> + Some (Http_getter.getxml' bodyuri) + with Http_getter_types.Unresolvable_URI _ -> (* The body does not exist ==> we consider it an axiom *) None in -- 2.39.2