Skip to content

Commit

Permalink
Added octet conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya Sterin authored and kraison committed Aug 12, 2010
1 parent 3f8b002 commit f9cefa6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions kyoto-cabinet.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ treated. :STRING indicates that the value should be converted to a
Lisp string, while :OCTETS indicates that the byte vector should be
returned."))

(defgeneric dbm-rem (db key)
(defgeneric dbm-remove (db key)
(:documentation "Removes the value under KEY in DB. If REMOVE-DUPS
is T, duplicate values will be removed from a B+ tree database."))

Expand Down Expand Up @@ -467,7 +467,7 @@ key-ptr key-len size-ptr))
value-ptr (funcall fn (ptr-of db) key-ptr key-len size-ptr))
(if (null-pointer-p value-ptr)
(maybe-raise-error db "(key ~a)" key)
(copy-foreign-value value-ptr size-ptr)))
(copy-foreign-value value-ptr size-ptr)))
(when (and value-ptr (not (null-pointer-p value-ptr)))
(foreign-free value-ptr)))))

Expand Down Expand Up @@ -596,7 +596,9 @@ do (setf (mem-aref key-ptr :unsigned-char i) (aref key i)))
(:method ((type (eql :string)) what-ptr)
(foreign-string-to-lisp what-ptr))
(:method ((type (eql :integer)) what-ptr)
(mem-aref what-ptr :int32)))
(mem-aref what-ptr :int32))
(:method ((type (eql :octets)) what-ptr)
(copy-foreign-value what-ptr (foreign-type-size what-ptr))))

(defgeneric convert-from-lisp (type what)
(:method ((type (eql :string)) what)
Expand Down

0 comments on commit f9cefa6

Please sign in to comment.