Permalink
Browse files

moved posix.o into libbaardskeerder_c

  • Loading branch information...
1 parent fdd0bcc commit a13450760406dd32f87afbbdcc8d1629fe96f379 Romain Slootmaekers committed Dec 13, 2011
Showing with 69 additions and 13 deletions.
  1. +3 −0 examples/_tags
  2. +27 −0 examples/example.ml
  3. +1 −2 src/Makefile
  4. +5 −3 src/_tags
  5. +13 −1 src/baardskeerder.ml
  6. +12 −0 src/baardskeerder.mli
  7. +1 −0 src/{libcrc32c.clib → libbaardskeerder_c.clib}
  8. +7 −7 src/myocamlbuild.ml
View
@@ -0,0 +1,3 @@
+true: annot
+true: debug
+true:package(baardskeerder)
View
@@ -0,0 +1,27 @@
+let () =
+ let log = Baardskeerder.make "the_log.bs" in
+ let () = Baardskeerder.close log in
+ ();;
+(*
+open Flog0
+
+module MyLog = Flog0.Flog0
+module MyDBX = DBX(MyLog)
+
+let main() =
+ let fn = "the_log.bs" in
+ let () = MyLog.init fn Time.zero in
+ let log = MyLog.make fn in
+ let f tx =
+ let rec loop i =
+ if i = 100 then ()
+ else
+ let () = MyDBX.set tx (Printf.sprintf "_____key_%i_____" "xxxxx") in
+ loop (i+1)
+ in
+ loop 0
+ in
+ MyDBX.with_tx log f;
+ MyLog.close log;;
+
+*)
View
@@ -11,8 +11,7 @@ install:
_build/baardskeerder.cmxa \
_build/baardskeerder.mli \
_build/baardskeerder.cmi \
- _build/posix.o \
- _build/libcrc32c.a \
+ _build/libbaardskeerder_c.a \
_build/baardskeerder.a
View
@@ -2,8 +2,10 @@ true: annot
true: debug
<**/*.ml>: warn_A
<flog*.ml>: warn_error_A
-<test.*>: package(oUnit), use_posix, use_crc32
+<flog0.o>: use_libbaardskeerder
+<test.*>: package(oUnit), use_libbaardskeerder
+<test.native>: link_libbaardskeerder
<*_test.*>: package(oUnit)
-<benchmark.*>: package(unix), use_posix, use_crc32
-<baardskeerder.cma>: use_posix
+<benchmark.*>: package(unix), use_libbaardskeerder$
+<baardskeerder.cma>: use_libbaardskeerder, link_libbaardskeerder
<hudson_xml.{*}>: package(oUnit)
View
@@ -18,9 +18,21 @@
*)
module MyLog = Flog0
+module MyDBX = Dbx.DBX(MyLog)
+type t = MyLog.t
+type tx = MyDBX.tx
-type t = Flog0.t
+type k = string
+type v = string
+let init fn = MyLog.init ~d:6 fn Time.zero
let make fn = MyLog.make fn
let close log = MyLog.close log
+
+let with_tx log f = MyDBX.with_tx log f
+let get tx k = MyDBX.get tx k
+let set tx k v = MyDBX.set tx k v
+let delete tx k = MyDBX.delete tx k
+
+
View
@@ -18,5 +18,17 @@
*)
type t
+type tx
+type k
+type v
+
+val init : string -> unit
val make : string -> t
val close : t -> unit
+
+
+val with_tx : t -> (tx -> unit) -> unit
+
+val get : tx -> k -> v
+val set : tx -> k -> v -> unit
+val delete: tx -> k -> unit
@@ -1,3 +1,4 @@
+posix.o
bsd_crc32c.o
arakoon_crc32c.o
cpudetect.o
View
@@ -32,15 +32,15 @@ let _ = dispatch & function
A"-ccopt"; A"-Werror";
A"-ccopt"; A"-O3";
]);
+ flag ["ocaml"; "use_libbaardskeerder"; "link"; "library"; "byte"] &
+ S[A"-cclib"; A"-lbaardskeerder_c";];
- dep ["ocaml"; "link"; "use_posix"]
- ["posix.o"];
-
- dep ["ocaml"; "link"; "use_crc32"]
- ["libcrc32c.a"];
- flag ["ocaml"; "link"; "use_crc32"]
- (S[A"libcrc32c.a"]);
+ flag ["c"; "use_libbaardskeerder"; "ocamlmklib"] &
+ S[ A"-lbaardskeerder_c";];
+ dep ["link"; "ocaml"; "link_libbaardskeerder"]
+ ["libbaardskeerder_c.a"];
+
flag ["compile"; "c"]
(S[A"-ccopt"; A"-I.."; A"-ccopt"; A"-msse4.2"]);

0 comments on commit a134507

Please sign in to comment.