Permalink
Browse files

More iterator work.

  • Loading branch information...
1 parent b1547c0 commit 45b7ed118383374c359e69fcd2acee1bd97ec718 Ilya Sterin committed Aug 7, 2010
Showing with 13 additions and 4 deletions.
  1. +8 −3 README
  2. +5 −1 kyoto-cabinet.lisp
View
11 README
@@ -1,6 +1,6 @@
(in-package :kyoto-cabinet)
(defparameter *db* (make-instance 'kc-dbm))
-(dbm-open *db* "/tmp/test_today.kch" :create :write)
+(dbm-open *db* "/tmp/hello.kch" :create :write)
(dbm-put *db* "Ilya" "Sterin" :mode :keep)
(dbm-get *db* "Ilya")
@@ -12,5 +12,10 @@
(defparameter *iter* (iter-open *db*))
(iter-first *iter*)
-(multiple-value-bind (key val) (iter-item *iter*))
-(multiple-value-bind (key val) (iter-item *iter*) (list key val))
+(multiple-value-bind (key val) (iter-item *iter*) (list key val))
+(iter-next *iter*)
+
+(dbm-put *db* 123 (make-array 2 :initial-contents '(75 76) :element-type '(unsigned-byte 8)) :mode :replace)
+(dbm-put *db* 123 (make-octet-vector 100 101) :mode :replace)
+
+(multiple-value-bind (key val) (iter-item *iter* :key-type :integer) (list key val))
View
@@ -596,4 +596,8 @@ integer."
(:method ((type (eql :string)) what-ptr)
(foreign-string-to-lisp what-ptr))
(:method ((type (eql :integer)) what-ptr)
- (convert-from-foreign what-ptr :int32)))
+ (mem-aref what-ptr :int32)))
+
+
+(defun make-octet-vector (&rest body)
+ (make-array (length body) :initial-contents body :element-type '(unsigned-byte 8)))

0 comments on commit 45b7ed1

Please sign in to comment.