CFFI interface to Kyoto Cabinet
Common Lisp
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
LICENSE
README
cl-kyoto-cabinet-package.lisp
cl-kyoto-cabinet.asd
kyoto-cabinet-dbm.lisp
kyoto-cabinet-ffi.lisp
kyoto-cabinet.lisp
kyoto-cabinet.swig

README

(in-package :kyoto-cabinet)
(defparameter *db* (make-instance 'kc-dbm))
(dbm-open *db* "/tmp/hello.kch" :create :write)

(dbm-put *db* "Ilya" "Sterin" :mode :keep)
(dbm-get *db* "Ilya")
(dbm-remove *db* "Ilya")

(dbm-put *db* 123 "456" :mode :keep)
(dbm-get *db* 123)
(dbm-remove *db* 123)

(defparameter *iter* (iter-open *db*))
(iter-first *iter*)
(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))