Source
(defun build-cursor-pget-function (write-fn read-fn)
(lambda (cursor &key key pkey
;;flags
current first get-both get-both-range
get-recno join-item last
next next-dup next-no-dup
prev prev-no-dup set set-range set-recno
multiple multiple-key rmw not-found)
(let ((key-buffer (when key (make-get-buffer nil)))
(pkey-buffer (when pkey (make-get-buffer nil))))
(unwind-protect
(multiple-value-bind (ret-key ret-pkey ret-data)
(db-cursor-pget cursor
:key (when key
(funcall write-fn key key-buffer)
key-buffer)
:pkey (when pkey
(funcall write-fn pkey pkey-buffer)
pkey-buffer)
:current current :first first
:get-both get-both
:get-both-range get-both-range
:get-recno get-recno :join-item join-item
:last last :next next :next-dup next-dup
:next-no-dup next-no-dup :prev prev
:prev-no-dup prev-no-dup :set set
:set-range set-range :set-recno set-recno
:multiple multiple
:multiple-key multiple-key
:rmw rmw :not-found not-found)
(unwind-protect
(values (funcall read-fn ret-key)
(funcall read-fn ret-pkey)
(funcall read-fn ret-data))
(progn
(free-cbuffer ret-key)
(free-cbuffer ret-pkey)
(free-cbuffer ret-data))))
(progn
(when pkey-buffer (free-cbuffer pkey-buffer))
(when key-buffer (free-cbuffer key-buffer)))))))
Source Context