Source
(defmethod db-get (db key &key data txn
consume consume-wait
set-recno
multiple rmw
not-found)
(let ((tmp-buf (make-get-buffer data)))
(labels ((get-by-buffer (tmp-buf)
(multiple-value-bind (code ptr size)
(%db-get db txn
(cbuffer-data key) (cbuffer-size key)
(cbuffer-data tmp-buf) (cbuffer-size tmp-buf)
(cbuffer-length tmp-buf)
:consume consume :consume-wait consume-wait
:get-both data :set-recno set-recno
:multiple multiple :rmw rmw)
(handle-get-code
code
(lambda () (make-cbuffer-from-pointer ptr size)) ;;return
(lambda () ;;not-found
(free-cbuffer tmp-buf)
(handle-error not-found code))
(lambda () ;;buffer-small
(get-by-buffer (cbuffer-resize tmp-buf size)))
(lambda () ;;otherwise
(free-cbuffer tmp-buf)
(bdb-check-error code))))))
(get-by-buffer tmp-buf))))
Source Context