Commit 8610f70b authored by -urso-'s avatar -urso-

update bdb qbook

darcs-hash:3fad6d08be75b48d9c5d03f4e1469be145219ce4
parent 6f0c9d7b
......@@ -352,6 +352,59 @@
<span class="paren">(</span>flags :flag <span class="paren">(</span>:create<span class="paren">)</span><span class="paren">)</span><span class="paren">)</span></span></pre
>
<pre class="code"
><span class="first-line"><span class="paren">(</span>defmethod+ <span class="paren">(</span>&quot;db_pget_raw&quot; %db-pget<span class="paren">)</span> :get-error-int</span><span class"body">
<span class="paren">(</span>db :pointer<span class="paren">)</span>
<span class="paren">(</span>txn :pointer :class txn-handle<span class="paren">)</span>
<span class="paren">(</span>key :pointer<span class="paren">)</span>
<span class="paren">(</span>key-size :uint32<span class="paren">)</span>
<span class="paren">(</span>pkey :pointer<span class="paren">)</span>
<span class="paren">(</span>pkey-size :uint32<span class="paren">)</span>
<span class="paren">(</span>pkey-ulen :uint32<span class="paren">)</span>
<span class="paren">(</span>data :pointer<span class="paren">)</span>
<span class="paren">(</span>data-size :uint32<span class="paren">)</span>
<span class="paren">(</span>data-ulen :uint32<span class="paren">)</span>
<span class="paren">(</span>flags :flag <span class="paren">(</span>:consume
:consume-wait
:get-both
:set-recno
:multiple
:rmw<span class="paren">)</span><span class="paren">)</span>
<span class="paren">(</span>ret-pkey :out :pointer<span class="paren">)</span>
<span class="paren">(</span>ret-pkey-size :out :uint32<span class="paren">)</span>
<span class="paren">(</span>ret-data :out :pointer<span class="paren">)</span>
<span class="paren">(</span>ret-data-size :out :uint32<span class="paren">)</span><span class="paren">)</span></span></pre
>
<pre class="code"
><span class="first-line"><span class="paren">(</span>defmethod+ <span class="paren">(</span>&quot;db_cursor_pget_raw&quot; %db-cursor-pget<span class="paren">)</span> :get-error-int</span><span class"body">
<span class="paren">(</span>cursor :pointer :class <span class="paren">(</span>cursor cursor-handle<span class="paren">)</span><span class="paren">)</span>
<span class="paren">(</span>key :pointer<span class="paren">)</span>
<span class="paren">(</span>key-size :uint32<span class="paren">)</span>
<span class="paren">(</span>key-ulen :uint32<span class="paren">)</span>
<span class="paren">(</span>pkey :pointer<span class="paren">)</span>
<span class="paren">(</span>pkey-size :uint32<span class="paren">)</span>
<span class="paren">(</span>pkey-ulen :uint32<span class="paren">)</span>
<span class="paren">(</span>data :pointer<span class="paren">)</span>
<span class="paren">(</span>data-size :uint32<span class="paren">)</span>
<span class="paren">(</span>data-ulen :uint32<span class="paren">)</span>
<span class="paren">(</span>flags :flag <span class="paren">(</span>: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<span class="paren">)</span><span class="paren">)</span>
<span class="paren">(</span>key-ret-ptr :out :pointer<span class="paren">)</span>
<span class="paren">(</span>key-ret-size :out :uint32<span class="paren">)</span>
<span class="paren">(</span>pkey-ret-ptr :out :pointer<span class="paren">)</span>
<span class="paren">(</span>pkey-ret-size :out :uint32<span class="paren">)</span>
<span class="paren">(</span>data-ret-ptr :out :pointer<span class="paren">)</span>
<span class="paren">(</span>data-ret-size :out :uint32<span class="paren">)</span><span class="paren">)</span></span></pre
>
<pre class="code"
><span class="first-line"><span class="paren">(</span>defmethod+ <span class="paren">(</span>&quot;bdb_sequence_create&quot; %bdb-sequ-create<span class="paren">)</span> :int</span><span class"body">
......@@ -381,12 +434,30 @@
<span class="paren">(</span>flags :out :uint32<span class="paren">)</span><span class="paren">)</span></span></pre
>
<pre class="code"
><span class="first-line">#-cffi-features:no-long-long</span><span class"body"></span></pre
>
<pre class="code"
><span class="first-line"><span class="paren">(</span>defmethod+ <span class="paren">(</span>&quot;db_sequence_init_value&quot; %db-sequ-init-value<span class="paren">)</span> :int</span><span class"body">
<span class="paren">(</span>sequ :pointer<span class="paren">)</span>
<span class="paren">(</span>value :int64<span class="paren">)</span><span class="paren">)</span></span></pre
>
<pre class="code"
><span class="first-line">#+cffi-features:no-long-long</span><span class"body">
<span class="paren">(</span>progn
<span class="paren">(</span>defmethod+ <span class="paren">(</span>&quot;db_sequence_init_value_i&quot; %%db-sequ-init-value<span class="paren">)</span> :int
<span class="paren">(</span>sequ :pointer<span class="paren">)</span>
<span class="paren">(</span>lower :uint32<span class="paren">)</span>
<span class="paren">(</span>upper :int32<span class="paren">)</span><span class="paren">)</span>
<span class="paren">(</span>defmethod %db-sequ-init-value <span class="paren">(</span>sequ value<span class="paren">)</span>
<span class="paren">(</span>%%db-sequ-init-value sequ
<span class="paren">(</span>ldb <span class="paren">(</span>byte 32 0<span class="paren">)</span> value<span class="paren">)</span>
<span class="paren">(</span>ldb <span class="paren">(</span>byte 32 32<span class="paren">)</span> value<span class="paren">)</span><span class="paren">)</span><span class="paren">)</span><span class="paren">)</span></span></pre
>
<pre class="code"
><span class="first-line"><span class="paren">(</span>defmethod+ <span class="paren">(</span>&quot;db_sequence_remove&quot; %db-sequ-remove<span class="paren">)</span> :int</span><span class"body">
......@@ -401,6 +472,9 @@
<span class="paren">(</span>flags :uint32 :const 0<span class="paren">)</span><span class="paren">)</span></span></pre
>
<pre class="code"
><span class="first-line">#-cffi-features:no-long-long</span><span class"body"></span></pre
>
<pre class="code"
><span class="first-line"><span class="paren">(</span>defmethod+ <span class="paren">(</span>&quot;db_sequence_get&quot; %db-sequ-get<span class="paren">)</span> :int</span><span class"body">
<span class="paren">(</span>sequ :pointer :class <span class="paren">(</span>db-sequence sequ-handle<span class="paren">)</span><span class="paren">)</span>
......@@ -411,6 +485,26 @@
>
<pre class="code"
><span class="first-line">#+cffi-features:no-long-long</span><span class"body">
<span class="paren">(</span>progn
<span class="paren">(</span>defmethod+ <span class="paren">(</span>&quot;db_sequence_get_i&quot; %%db-sequ-get<span class="paren">)</span> :int
<span class="paren">(</span>sequ :pointer :class <span class="paren">(</span>db-sequence sequ-handle<span class="paren">)</span><span class="paren">)</span>
<span class="paren">(</span>txn :pointer :class txn-handle<span class="paren">)</span>
<span class="paren">(</span>delta :int32<span class="paren">)</span>
<span class="paren">(</span>lower :out :uint32<span class="paren">)</span>
<span class="paren">(</span>upper :out :int32<span class="paren">)</span>
<span class="paren">(</span>flags :flag <span class="paren">(</span>:txn-no-sync<span class="paren">)</span><span class="paren">)</span><span class="paren">)</span>
<span class="paren">(</span>defmethod %db-sequ-get <span class="paren">(</span>sequ txn delta &amp;key txn-no-sync<span class="paren">)</span>
<span class="paren">(</span>multiple-value-bind <span class="paren">(</span>lower upper<span class="paren">)</span>
<span class="paren">(</span>%%db-sequ-get sequ txn delta
:txn-no-sync txn-no-sync<span class="paren">)</span>
<span class="paren">(</span>let <span class="paren">(</span><span class="paren">(</span>ret 0<span class="paren">)</span><span class="paren">)</span>
<span class="paren">(</span>setf <span class="paren">(</span>ldb <span class="paren">(</span>byte 32 0<span class="paren">)</span> ret<span class="paren">)</span> lower<span class="paren">)</span>
<span class="paren">(</span>setf <span class="paren">(</span>ldb <span class="paren">(</span>byte 32 32<span class="paren">)</span> ret<span class="paren">)</span> upper<span class="paren">)</span>
ret<span class="paren">)</span><span class="paren">)</span><span class="paren">)</span><span class="paren">)</span></span></pre
>
</div
></div
></body
......
......@@ -207,6 +207,22 @@
></div
>
<div class="computational-element-link computational-element-link-function"
><p
><a href="api/function_005FBDB_003A_003AHANDLE-GET-CODE.html" name="function_005FBDB_003A_003AHANDLE-GET-CODE"
>Function HANDLE-GET-CODE</a
> </p
></div
>
<div class="computational-element-link computational-element-link-function"
><p
><a href="api/function_005FBDB_003A_003AHANDLE-ERROR.html" name="function_005FBDB_003A_003AHANDLE-ERROR"
>Function HANDLE-ERROR</a
> </p
></div
>
<div class="computational-element-link computational-element-link-method"
><p
><a href="api/method_005FBDB_003A_003A_0028DB-GET_0020T_0020T_0029.html" name="method_005FBDB_003A_003A_0028DB-GET_0020T_0020T_0029"
......@@ -216,6 +232,7 @@
>
<div class="computational-element-link computational-element-link-method"
><p
><a href="api/method_005FBDB_003A_003A_0028DB-GET_0020DB_0020T_0029.html" name="method_005FBDB_003A_003A_0028DB-GET_0020DB_0020T_0029"
......
......@@ -118,6 +118,8 @@
#:db-join
#:build-assoc-callback-maker
#:build-cbuffered-assoc-lambda
#:db-pget
#:db-cursor-pget
;;txn
#:db-env-txn-begin
......@@ -141,7 +143,6 @@
#:db-sequ-get-cachesize
#:db-sequ-set-cachesize
;;util
#:make-cbuffer-writer
#:make-cbuffer-reader<span class="paren">)</span><span class="paren">)</span></span></pre
......
......@@ -162,6 +162,73 @@
></div
>
<div class="computational-element-link computational-element-link-method"
><p
><a href="api/method_005FBDB_003A_003A_0028DB-PGET_0020T_0020T_0029.html" name="method_005FBDB_003A_003A_0028DB-PGET_0020T_0020T_0029"
>Method (DB-PGET T T)</a
> </p
></div
>
<div class="computational-element-link computational-element-link-method"
><p
><a href="api/method_005FBDB_003A_003A_0028DB-PGET_0020DB_0020T_0029.html" name="method_005FBDB_003A_003A_0028DB-PGET_0020DB_0020T_0029"
>Method (DB-PGET DB T)</a
> </p
></div
>
<div class="computational-element-link computational-element-link-method"
><p
><a href="api/method_005FBDB_003A_003A_0028DB-PGET_0020DB-TXN_0020T_0029.html" name="method_005FBDB_003A_003A_0028DB-PGET_0020DB-TXN_0020T_0029"
>Method (DB-PGET DB-TXN T)</a
> </p
></div
>
<div class="computational-element-link computational-element-link-method"
><p
><a href="api/method_005FBDB_003A_003A_0028DB-PGET_0020DB-EXT_0020T_0029.html" name="method_005FBDB_003A_003A_0028DB-PGET_0020DB-EXT_0020T_0029"
>Method (DB-PGET DB-EXT T)</a
> </p
></div
>
<div class="computational-element-link computational-element-link-function"
><p
><a href="api/function_005FBDB_003A_003ABUILD-PGET-FUNCTION.html" name="function_005FBDB_003A_003ABUILD-PGET-FUNCTION"
>Function BUILD-PGET-FUNCTION</a
> </p
></div
>
<div class="computational-element-link computational-element-link-method"
><p
><a href="api/method_005FBDB_003A_003A_0028DB-CURSOR-PGET_0020CURSOR_0029.html" name="method_005FBDB_003A_003A_0028DB-CURSOR-PGET_0020CURSOR_0029"
>Method (DB-CURSOR-PGET CURSOR)</a
> </p
></div
>
<div class="computational-element-link computational-element-link-method"
><p
><a href="api/method_005FBDB_003A_003A_0028DB-CURSOR-PGET_0020EXT-CURSOR_0029.html" name="method_005FBDB_003A_003A_0028DB-CURSOR-PGET_0020EXT-CURSOR_0029"
>Method (DB-CURSOR-PGET EXT-CURSOR)</a
> </p
></div
>
<div class="computational-element-link computational-element-link-function"
><p
><a href="api/function_005FBDB_003A_003ABUILD-CURSOR-PGET-FUNCTION.html" name="function_005FBDB_003A_003ABUILD-CURSOR-PGET-FUNCTION"
>Function BUILD-CURSOR-PGET-FUNCTION</a
> </p
></div
>
</div
></div
></body
......
<html
><head
><title
>Function BUILD-CURSOR-PGET-FUNCTION</title
><link href="../style.css" rel="stylesheet"
/><link title="Print" href="../print.css" rel="alternate stylesheet"
/></head
><body
><div class="qbook"
><div class="computational-element"
><h1
>Function: BUILD-CURSOR-PGET-FUNCTION</h1
><div class="contents"
><h2
>Source</h2
><pre class="code"
>(defun build-cursor-pget-function (write-fn read-fn)
(lambda (cursor &amp;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)))))))</pre
><a href="../Secondary_0020Databases.html#function_005FBDB_003A_003ABUILD-CURSOR-PGET-FUNCTION"
>Source Context</a
></div
></div
></div
></body
></html
>
\ No newline at end of file
<html
><head
><title
>Function BUILD-PGET-FUNCTION</title
><link href="../style.css" rel="stylesheet"
/><link title="Print" href="../print.css" rel="alternate stylesheet"
/></head
><body
><div class="qbook"
><div class="computational-element"
><h1
>Function: BUILD-PGET-FUNCTION</h1
><div class="contents"
><h2
>Source</h2
><pre class="code"
>(defun build-pget-function (write-fn read-fn)
(lambda (db key &amp;key pkey txn
consume consume-wait
set-recno
multiple rmw
not-found)
(with-cbuffer key-buffer
(funcall write-fn key key-buffer)
(let ((pkey-buffer (when pkey (alloc-cbuffer))))
(unwind-protect
(multiple-value-bind (pkey-buf data-buf)
(db-get db key-buffer
:pkey (when pkey
(funcall write-fn pkey pkey-buffer)
pkey-buffer)
:txn txn
:consume consume :consume-wait consume-wait
:set-recno set-recno
:multiple multiple :rmw rmw
:not-found not-found)
(let* ((pkey-ret nil)
(data-ret nil))
(unwind-protect
(progn
(setf pkey-ret (funcall read-fn pkey-buf))
(setf data-ret (funcall read-fn data-buf)))
(free-cbuffer pkey-buf)
(free-cbuffer data-buf))
(values pkey-ret data-ret)))
(when pkey-buffer
(free-cbuffer pkey-buffer)))))))</pre
><a href="../Secondary_0020Databases.html#function_005FBDB_003A_003ABUILD-PGET-FUNCTION"
>Source Context</a
></div
></div
></div
></body
></html
>
\ No newline at end of file
<html
><head
><title
>Function HANDLE-ERROR</title
><link href="../style.css" rel="stylesheet"
/><link title="Print" href="../print.css" rel="alternate stylesheet"
/></head
><body
><div class="qbook"
><div class="computational-element"
><h1
>Function: HANDLE-ERROR</h1
><div class="contents"
><h2
>Source</h2
><pre class="code"
>(defun handle-error (type code &amp;optional (error-fun #'bdb-check-error))
(when type
(if (functionp type)
(funcall type)
(funcall error-fun code))))</pre
><a href="../Databases.html#function_005FBDB_003A_003AHANDLE-ERROR"
>Source Context</a
></div
></div
></div
></body
></html
>
\ No newline at end of file
<html
><head
><title
>Function HANDLE-GET-CODE</title
><link href="../style.css" rel="stylesheet"
/><link title="Print" href="../print.css" rel="alternate stylesheet"
/></head
><body
><div class="qbook"
><div class="computational-element"
><h1
>Function: HANDLE-GET-CODE</h1
><div class="contents"
><h2
>Source</h2
><pre class="code"
>(defun handle-get-code (code
on-return
on-not-found
on-buffer-small
otherwise)
(case code
(0 (funcall on-return))
(-30989 (funcall on-not-found))
(-30999 (funcall on-buffer-small))
(otherwise (funcall otherwise))))</pre
><a href="../Databases.html#function_005FBDB_003A_003AHANDLE-GET-CODE"
>Source Context</a
></div
></div
></div
></body
></html
>
\ No newline at end of file
......@@ -14,9 +14,9 @@
><h2
>Source</h2
><pre class="code"
>(defmacro in-txn ((txn &amp;key no-sync sync) &amp;body body)
>(defmacro in-txn ((txn &amp;key no-sync sync do-commit) &amp;body body)
(with-gensyms (success return)
(once-only (txn)
(once-only (txn do-commit)
`(let ((,return nil)
(,success nil))
(unwind-protect
......@@ -24,13 +24,15 @@
(setq ,return (multiple-value-list
(progn
,@body)))
(db-txn-commit ,txn
:no-sync ,no-sync
:sync ,sync)
(when ,do-commit
(db-txn-commit ,txn
:no-sync ,no-sync
:sync ,sync))
(setq ,success t)
(apply #'values ,return))
(unless ,success
(db-txn-abort ,txn)))))))</pre
(if (and ,do-commit
(not ,success))
(db-txn-abort ,txn)))))))</pre
><a href="../Transactions.html#macro_005FBDB_003A_003AIN-TXN"
>Source Context</a
></div
......
......@@ -26,8 +26,9 @@
:not-durable ,not-durable
:no-wait ,no-wait
:sync ,sync))))
(in-txn (txn :no-sync ,no-sync
:sync ,sync)
(in-txn (,txn-var :no-sync ,no-sync
:sync ,sync
:do-commit (null ,txn))
,@body))))</pre
><a href="../Transactions.html#macro_005FBDB_003A_003AWITH-TXN"
>Source Context</a
......
......@@ -42,21 +42,22 @@
:multiple multiple
:multiple-key multiple-key
:rmw rmw)
(case ret-code
(0 (values (make-cbuffer-from-pointer key-ptr key-size)
(make-cbuffer-from-pointer data-ptr data-size)))
(-30989 (free-cbuffer key) ;;DB_NOTFOUND
(free-cbuffer data)
(when not-found
(if (functionp not-found)
(funcall not-found)
(bdb-check-error ret-code))))
(-30999 ;;DB_BUFFER_SMALL
(handle-get-code
ret-code
(lambda () (values (make-cbuffer-from-pointer key-ptr key-size)
(make-cbuffer-from-pointer data-ptr
data-size)))
(lambda ()
(free-cbuffer key)
(free-cbuffer data)
(handle-error not-found ret-code))
(lambda ()
(get-by-buffer (cbuffer-ensure-size key key-size)
(cbuffer-ensure-size data data-size)))
(otherwise (free-cbuffer key)
(free-cbuffer data)
(bdb-check-error ret-code))))))
(lambda ()
(free-cbuffer key)
(free-cbuffer data)
(bdb-check-error ret-code))))))
(get-by-buffer tmp-key-buf tmp-data-buf))))</pre
><a href="../Cursors.html#method_005FBDB_003A_003A_0028DB-CURSOR-GET_0020CURSOR_0029"
>Source Context</a
......
<html
><head
><title
>Method (DB-CURSOR-PGET CURSOR)</title
><link href="../style.css" rel="stylesheet"
/><link title="Print" href="../print.css" rel="alternate stylesheet"
/></head
><body
><div class="qbook"
><div class="computational-element"
><h1
>Method: (DB-CURSOR-PGET CURSOR)</h1
><div class="contents"
><h2
>Source</h2
><pre class="code"
>(defmethod db-cursor-pget ((cursor cursor) &amp;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 ((tmp-key-buf (make-get-buffer key))
(tmp-pkey-buf (make-get-buffer pkey))
(tmp-data-buf (make-get-buffer nil)))
(labels ((get-by-buffer (key pkey data)
(multiple-value-bind (ret-code key-ptr key-size
pkey-ptr pkey-size
data-ptr data-size)
(%db-cursor-pget cursor
(cbuffer-data key) (cbuffer-size key)
(cbuffer-length key)
(cbuffer-data pkey) (cbuffer-size pkey)
(cbuffer-length pkey)
(cbuffer-data data) (cbuffer-size data)
(cbuffer-length data)
: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)
(handle-get-code
ret-code
(lambda () (values (make-cbuffer-from-pointer key-ptr
key-size)
(make-cbuffer-from-pointer pkey-ptr
pkey-size)
(make-cbuffer-from-pointer data-ptr
data-size)))
(lambda ()
(free-cbuffer key)
(free-cbuffer pkey)
(free-cbuffer data)
(handle-error not-found ret-code))
(lambda ()
(get-by-buffer (cbuffer-ensure-size key key-size)
(cbuffer-ensure-size pkey pkey-size)
(cbuffer-ensure-size data data-size)))
(lambda ()
(free-cbuffer key)
(free-cbuffer pkey)
(free-cbuffer data)
(bdb-check-error ret-code))))))
(get-by-buffer tmp-key-buf tmp-pkey-buf tmp-data-buf))))</pre
><a href="../Secondary_0020Databases.html#method_005FBDB_003A_003A_0028DB-CURSOR-PGET_0020CURSOR_0029"
>Source Context</a
></div
></div
></div
></body
></html
>
\ No newline at end of file
<html
><head
><title
>Method (DB-CURSOR-PGET EXT-CURSOR)</title
><link href="../style.css" rel="stylesheet"
/><link title="Print" href="../print.css" rel="alternate stylesheet"
/></head
><body
><div class="qbook"
><div class="computational-element"
><h1
>Method: (DB-CURSOR-PGET EXT-CURSOR)</h1
><div class="contents"
><h2
>Source</h2
><pre class="code"
>(defmethod db-cursor-pget ((cursor ext-cursor) &amp;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)
(call-next-method cursor
:key (when key
(funcall (buf-writer cursor)
key key-buffer)
key-buffer)
:pkey (when pkey
(funcall (buf-writer cursor)
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 (buf-reader cursor) ret-key)
(funcall (buf-reader cursor) ret-pkey)
(funcall (buf-reader cursor) 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))))))</pre
><a href="../Secondary_0020Databases.html#method_005FBDB_003A_003A_0028DB-CURSOR-PGET_0020EXT-CURSOR_0029"
>Source Context</a
></div
></div
></div
></body
></html
>
\ No newline at end of file
......@@ -24,24 +24,22 @@
(multiple-value-bind (code ptr size)
(%db-get db txn
(cbuffer-data key) (cbuffer-size key)
(cbuffer-data tmp-buf) (if data
(cbuffer-size data)
0)
(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)
(case code
(0 (make-cbuffer-from-pointer ptr size))
(-30989 (free-cbuffer tmp-buf) ;;DB_NOTFOUND
(when not-found
(if (functionp not-found)
(funcall not-found)
(bdb-check-error code))))
(-30999 ;;DB_BUFFER_SMALL
(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)))
(otherwise (free-cbuffer tmp-buf)
(bdb-check-error code))))))
(lambda () ;;otherwise
(free-cbuffer tmp-buf)
(bdb-check-error code))))))
(get-by-buffer tmp-buf))))</pre
><a href="../Databases.html#method_005FBDB_003A_003A_0028DB-GET_0020T_0020T_0029"
>Source Context</a
......