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 type uri = int * string (* shareno, URI *)
16 let string_of_uri (_, uri) = uri;;
18 module OrderedStrings =
21 let compare (s1 : t) (s2 : t) = compare s1 s2
25 module MapStringsToUri = Map.Make(OrderedStrings);;
27 let set_of_uri = ref MapStringsToUri.empty;;
30 let counter = ref 0 in
31 let c () = incr counter; !counter in
33 try MapStringsToUri.find s !set_of_uri
35 let new_uri = c(), s in
36 set_of_uri := MapStringsToUri.add s new_uri !set_of_uri;
41 let compare (n1,_) (n2,_) = n2 - n1;;
50 module UriHash = Hashtbl.Make(HT);;
52 let ouri_of_nuri u = UriManager.uri_of_string (string_of_uri u);;
53 let nuri_of_ouri o = uri_of_string (UriManager.string_of_uri o);;