]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/mathql_test/mqitop.ml
patched
[helm.git] / helm / mathql_test / mqitop.ml
index aca13b9cb5cf0522bd086fb45db8fcfd34f81d93..880d9605b3cb46288d6ec03dc77f1e631a2b794c 100644 (file)
 (*  AUTOR: Ferruccio Guidi <fguidi@cs.unibo.it>
  *)
 
-module U = MQueryUtil
+let _ = MQueryStandard.init
+let _ = MQueryHELM.init 
+
+module P = MQueryUtil
+module U = AvsUtil
 module I = MQueryInterpreter
 module C = MQIConn
 module F = MQueryIO
 
 let _ =
-   let t = U.start_time () in
+   Helm_registry.load_from "/home/fguidi/miohelm/gTopLevel.conf.xml";
+   let t = P.start_time () in
    let ich = Lexing.from_channel stdin in
    let flags = if Array.length Sys.argv >= 2 then Sys.argv.(1) else "" in
    let log s = print_string s; flush stdout in
-   let handle = C.init (C.flags_of_string flags) log in 
+   let handle = 
+      C.init_if_connected ~flags:(C.flags_of_string flags) ~log:log ()
+   in 
    if not (C.connected handle) then begin  
        print_endline "mqitop: no connection"; flush stdout
    end;
    let rec aux () =
-      let t = U.start_time () in
+      let t = P.start_time () in
       let r = I.execute handle (F.query_of_text ich) in
 (*    F.text_of_result log r "\n";
-*)    Printf.eprintf "mqitop: query: %s,%i\n" (U.stop_time t) (List.length r);
+*)    Printf.eprintf "mqitop: query: %s,%i\n" (P.stop_time t) (U.count r);
       flush stderr; aux()
       
    in
    begin try aux() with End_of_file -> () end;
    C.close handle;
-   Printf.eprintf "mqitop: done: %s\n" (U.stop_time t)
+   Printf.eprintf "mqitop: done: %s\n" (P.stop_time t)