git » nmdb » commit e5cf22b

Implement incr in the Bigloo bindings.

author Alberto Bertogli
2007-08-31 16:28:08 UTC
committer Alberto Bertogli
2007-08-31 16:28:08 UTC
parent a615324e5332311bc00cd34ec0b310c365b760c1

Implement incr in the Bigloo bindings.

Signed-off-by: Alberto Bertogli <albertito@gmail.com>

bindings/bigloo/nmdb.scm +18 -0

diff --git a/bindings/bigloo/nmdb.scm b/bindings/bigloo/nmdb.scm
index be8ba5c..2d874b1 100644
--- a/bindings/bigloo/nmdb.scm
+++ b/bindings/bigloo/nmdb.scm
@@ -53,6 +53,13 @@
 		 (::_nmdb_t ::string ::uint ::string ::uint ::string ::uint)
 		 "nmdb_cache_cas")
 
+	  (macro _nmdb_incr::ulong
+		 (::_nmdb_t ::string ::uint ::ulong)
+		 "nmdb_incr")
+	  (macro _nmdb_cache_incr::ulong
+		 (::_nmdb_t ::string ::uint ::ulong)
+		 "nmdb_cache_incr")
+
 	  )
 
 	(export
@@ -77,6 +84,9 @@
 
 	  (nmdb-cas db key oldval newval)
 	  (nmdb-cache-cas db key oldval newval)
+
+	  (nmdb-incr db key increment)
+	  (nmdb-cache-incr db key increment)
 	  )
 
 	)
@@ -135,3 +145,11 @@
 (define (nmdb-cache-cas db key oldval newval)
   (nmdb-generic-cas _nmdb_cache_cas db key oldval newval))
 
+;; incr functions
+(define (nmdb-generic-incr func db key increment)
+  (func db key (string-length key) increment ) )
+(define (nmdb-incr db key increment)
+  (nmdb-generic-incr _nmdb_incr db key increment))
+(define (nmdb-cache-incr db key increment)
+  (nmdb-generic-incr _nmdb_cache_incr db key increment))
+