Method: (DB-PGET T T)

Source

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