]> matita.cs.unibo.it Git - helm.git/commitdiff
* first files added to cvs
authorLuca Padovani <luca.padovani@unito.it>
Fri, 17 Oct 2003 09:38:12 +0000 (09:38 +0000)
committerLuca Padovani <luca.padovani@unito.it>
Fri, 17 Oct 2003 09:38:12 +0000 (09:38 +0000)
helm/DEVEL/rdfly/Makefile [new file with mode: 0644]
helm/DEVEL/rdfly/query.ml [new file with mode: 0644]

diff --git a/helm/DEVEL/rdfly/Makefile b/helm/DEVEL/rdfly/Makefile
new file mode 100644 (file)
index 0000000..133763e
--- /dev/null
@@ -0,0 +1,36 @@
+BIN_DIR = /usr/local/bin
+REQUIRES = postgres
+PREDICATES = 
+OCAMLOPTIONS = -package "$(REQUIRES)" -predicates "$(PREDICATES)" -pp camlp4o
+OCAMLFIND = ocamlfind
+OCAMLC = $(OCAMLFIND) ocamlc -thread $(OCAMLOPTIONS)
+OCAMLOPT = $(OCAMLFIND) ocamlopt -thread $(OCAMLOPTIONS)
+OCAMLDEP = ocamldep -pp camlp4o
+
+LIBRARIES = $(shell $(OCAMLFIND) query -recursive -predicates "byte $(PREDICATES)" -format "%d/%a" $(REQUIRES))
+LIBRARIES_OPT = $(shell $(OCAMLFIND) query -recursive -predicates "native $(PREDICATES)" -format "%d/%a" $(REQUIRES))
+
+OBJS = query.cmo
+
+rdfly: $(OBJS) $(LIBRARIES)
+       $(OCAMLC) -linkpkg -o $@ $(OBJS)
+
+rdfly.opt: $(OBJS:.cmo=.cmx) $(LIBRARIES_OPT)
+       $(OCAMLOPT) -linkpkg -o rdfly.opt $(OBJS:.cmo=.cmx)
+
+.SUFFIXES: .ml .mli .cmo .cmi .cmx
+.ml.cmo:
+       $(OCAMLC) -c $<
+.mli.cmi:
+       $(OCAMLC) -c $<
+.ml.cmx:
+       $(OCAMLOPT) -c $<
+
+$(OBJS): $(LIBRARIES)
+$(OBJS:.cmo=.cmx)): $(LIBRARIES_OPT)
+
+clean:
+       rm -f *.cm[iox] *.o rdfly rdfly.opt
+
+.PHONY: install uninstall clean
+
diff --git a/helm/DEVEL/rdfly/query.ml b/helm/DEVEL/rdfly/query.ml
new file mode 100644 (file)
index 0000000..2ea00d0
--- /dev/null
@@ -0,0 +1,17 @@
+
+let db = Postgres.Connection.connect "dbname=mowgli user=helm host=mowgli.cs.unibo.it"
+
+let _ =
+  let status = 
+    match Postgres.Connection.status db with
+      Postgres.Connection.Ok -> "ok"
+    | _ -> "bad"
+  in
+  Printf.printf "connection status is %s\n" status ;
+  flush stdout
+
+let res = Postgres.Connection.exec db "SELECT * FROM refObj WHERE source = 'cic:/Coq/Arith/Le/le_O_n.con';"
+
+let _ =
+  Printf.printf "# results: %d\n" (Postgres.Result.ntuples res) ;
+  flush stdout