From: Luca Padovani Date: Fri, 17 Oct 2003 09:38:12 +0000 (+0000) Subject: * first files added to cvs X-Git-Tag: V_0_2_2~51 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=d07851ade676917a00ad479fb427dff0dfd06ff3;p=helm.git * first files added to cvs --- diff --git a/helm/DEVEL/rdfly/Makefile b/helm/DEVEL/rdfly/Makefile new file mode 100644 index 000000000..133763e62 --- /dev/null +++ b/helm/DEVEL/rdfly/Makefile @@ -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 index 000000000..2ea00d0c2 --- /dev/null +++ b/helm/DEVEL/rdfly/query.ml @@ -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