Commit 5eddf6c1 authored by -urso-'s avatar -urso-

"Updated bdb and bdb-playground qbooks"

darcs-hash:8c133da5480ae920832cf477294c1e2dbc6ab5a9
parent a7f628e3
......@@ -58,6 +58,11 @@
<pre class="code"
><span class="first-line"><span class="paren">(</span>setf <span class="paren">(</span>symbol-function 'db-cursor-put<span class="paren">)</span></span><span class"body">
<span class="paren">(</span>build-cursor-put-function #'buf-writer<span class="paren">)</span><span class="paren">)</span></span></pre
>
<pre class="code"
><span class="first-line"><span class="paren">(</span>setf <span class="paren">(</span>symbol-function 'create-assoc-callback<span class="paren">)</span></span><span class"body">
<span class="paren">(</span>build-assoc-callback-maker #'buf-writer #'buf-reader<span class="paren">)</span><span class="paren">)</span></span></pre
></div
></div
></body
......
......@@ -44,6 +44,9 @@
:components
<span class="paren">(</span><span class="paren">(</span>:module :src
:components <span class="paren">(</span><span class="paren">(</span>:file &quot;package&quot;<span class="paren">)</span>
<span class="paren">(</span>:file &quot;config&quot;
:depends-on <span class="paren">(</span>&quot;package&quot;
&quot;aux-bindings&quot;<span class="paren">)</span><span class="paren">)</span>
<span class="paren">(</span>:file &quot;consts&quot;
:depends-on <span class="paren">(</span>&quot;package&quot;<span class="paren">)</span><span class="paren">)</span>
<span class="paren">(</span>:file &quot;aux-bindings&quot;
......@@ -54,7 +57,8 @@
:depends-on <span class="paren">(</span>&quot;package&quot;<span class="paren">)</span><span class="paren">)</span>
<span class="paren">(</span>:file &quot;db&quot;
:depends-on <span class="paren">(</span>&quot;package&quot; &quot;consts&quot;
&quot;aux-bindings&quot; &quot;bdb&quot; &quot;util&quot;<span class="paren">)</span><span class="paren">)</span>
&quot;aux-bindings&quot; &quot;bdb&quot; &quot;util&quot;
&quot;config&quot;<span class="paren">)</span><span class="paren">)</span>
<span class="paren">(</span>:file &quot;cursor&quot;
:depends-on <span class="paren">(</span>&quot;package&quot; &quot;aux-bindings&quot;
&quot;consts&quot;
......
......@@ -102,6 +102,7 @@
:youngest<span class="paren">)</span><span class="paren">)</span>
<span class="paren">(</span>aborted :out :int<span class="paren">)</span><span class="paren">)</span></span></pre
>
</div
></div
></body
......
......@@ -89,6 +89,7 @@
<span class="paren">(</span>dup_cursor :out :pointer<span class="paren">)</span>
<span class="paren">(</span>flags :flag <span class="paren">(</span>:position<span class="paren">)</span><span class="paren">)</span><span class="paren">)</span></span></pre
>
</div
></div
></body
......
......@@ -105,6 +105,7 @@
;;secondary
#:db-associate
#:db-join
#:build-assoc-callback-maker
;;txn
#:db-env-txn-begin
......
......@@ -60,6 +60,14 @@
></div
>
<div class="computational-element-link computational-element-link-function"
><p
><a href="api/function_005FBDB_003A_003ABUILD-ASSOC-CALLBACK-MAKER.html" name="function_005FBDB_003A_003ABUILD-ASSOC-CALLBACK-MAKER"
>Function BUILD-ASSOC-CALLBACK-MAKER</a
> </p
></div
>
<div class="computational-element-link computational-element-link-function"
><p
><a href="api/function_005FBDB_003A_003ADB-ASSOCIATE.html" name="function_005FBDB_003A_003ADB-ASSOCIATE"
......@@ -76,6 +84,7 @@
> </p
></div
>
</div
></div
></body
......
<html
><head
><title
>Function BUILD-ASSOC-CALLBACK-MAKER</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-ASSOC-CALLBACK-MAKER</h1
><div class="contents"
><h2
>Source</h2
><pre class="code"
>(defun build-assoc-callback-maker (buf-writer buf-reader)
(lambda (fun &amp;optional name)
(create-cbuffered-db-assoc-callback
(lambda (secondary key-buf data-buf)
(multiple-value-bind (use-ret ret)
(funcall fun secondary
(funcall buf-reader key-buf)
(funcall buf-reader data-buf))
(if use-ret
(let ((ret-buf (alloc-cbuffer)))
(funcall buf-writer ret ret-buf)
(values t ret-buf))
(values nil nil))))
name)))</pre
><a href="../Secondary_0020Databases.html#function_005FBDB_003A_003ABUILD-ASSOC-CALLBACK-MAKER"
>Source Context</a
></div
></div
></div
></body
></html
>
\ No newline at end of file
......@@ -21,11 +21,10 @@
(funcall fun secondary
(make-cbuffer-from-pointer key-ptr key-size)
(make-cbuffer-from-pointer data-ptr data-size))
(if use-ret
(values t (cbuffer-data ret-buf) (cbuffer-size ret-buf))
(progn
(if ret-buf (free-cbuffer ret-buf))
nil))))
(cond (use-ret (values t (cbuffer-data ret-buf) (cbuffer-size ret-buf)))
(ret-buf (free-cbuffer ret-buf)
(values nil nil))
(t (values nil nil)))))
name))</pre
><a href="../Secondary_0020Databases.html#function_005FBDB_003A_003ACREATE-CBUFFERED-DB-ASSOC-CALLBACK"
>Source Context</a
......
......@@ -23,8 +23,7 @@
multiple multiple-key rmw not-found)
(let ((tmp-key-buf (make-get-buffer key))
(tmp-data-buf (make-get-buffer data)))
(labels ((get-by-buffer
(key data)
(labels ((get-by-buffer (key data)
(multiple-value-bind (ret-code key-ptr key-size
data-ptr data-size)
(%db-cursor-get cursor
......
......@@ -28,7 +28,13 @@
env txn db (mode 0) (type :db-btree)
;;flags
auto-commit create exclusive no-mmap
read-only threaded truncate)
read-only threaded truncate
;;db-set-flags flags:
checksum encrypt dup dup-sort
recnum revsplitoff inorder
renumber snapshot
)
&quot;creates and opens a new Database
params: env = Environment the database shall be opened in
txn = Transaction
......@@ -37,6 +43,13 @@
type = :db-btree :db-hash :db-recno or :db-queue
flags... see BDB documentation or db.h&quot;
(let ((dbp (bdb-create env 0)))
(db-set-flags dbp
:checksum checksum
:encrypt encrypt
:dup dup :dup-sort dup-sort
:recnum recnum :revsplitoff revsplitoff
:inorder inorder :renumber renumber
:snapshot snapshot)
(%db-open dbp txn file db (flag-value type)
mode
:auto-commit auto-commit
......
......@@ -23,7 +23,9 @@
(when data
(memcpy (cbuffer-data buf)
(cbuffer-data data)
(cbuffer-size data)))
(cbuffer-size data))
(setf (cbuffer-size buf)
(cbuffer-size data)))
buf))</pre
><a href="../Utilities.html#function_005FBDB_003A_003AMAKE-GET-BUFFER"
>Source Context</a
......
......@@ -16,6 +16,10 @@
><a href="../api/function_005FBDB_003A_003ABDB-CHECK-ERROR.html"
>BDB-CHECK-ERROR</a
></dt
><dt
><a href="../api/function_005FBDB_003A_003ABUILD-ASSOC-CALLBACK-MAKER.html"
>BUILD-ASSOC-CALLBACK-MAKER</a
></dt
><dt
><a href="../api/function_005FBDB_003A_003ABUILD-CURSOR-GET-FUNCTION.html"
>BUILD-CURSOR-GET-FUNCTION</a
......
......@@ -194,6 +194,20 @@
> [Function] </a
></td
></tr
><tr
><td align="right"
><a href="../api/function_005FBDB_003A_003ABUILD-ASSOC-CALLBACK-MAKER.html"
>BUILD-</a
></td
><td
><a href="../api/function_005FBDB_003A_003ABUILD-ASSOC-CALLBACK-MAKER.html"
>ASSOC-CALLBACK-MAKER</a
></td
><td
><a href="../api/function_005FBDB_003A_003ABUILD-ASSOC-CALLBACK-MAKER.html"
> [Function] </a
></td
></tr
><tr
><td align="right"
><a href="../api/function_005FBDB_003A_003ADB-ASSOCIATE.html"
......@@ -306,6 +320,20 @@
> [Function] </a
></td
></tr
><tr
><td align="right"
><a href="../api/function_005FBDB_003A_003ABUILD-ASSOC-CALLBACK-MAKER.html"
></a
></td
><td
><a href="../api/function_005FBDB_003A_003ABUILD-ASSOC-CALLBACK-MAKER.html"
>BUILD-ASSOC-CALLBACK-MAKER</a
></td
><td
><a href="../api/function_005FBDB_003A_003ABUILD-ASSOC-CALLBACK-MAKER.html"
> [Function] </a
></td
></tr
><tr
><td align="right"
><a href="../api/function_005FBDB_003A_003ABUILD-CURSOR-GET-FUNCTION.html"
......@@ -418,6 +446,20 @@
> [Function] </a
></td
></tr
><tr
><td align="right"
><a href="../api/function_005FBDB_003A_003ABUILD-ASSOC-CALLBACK-MAKER.html"
>BUILD-ASSOC-</a
></td
><td
><a href="../api/function_005FBDB_003A_003ABUILD-ASSOC-CALLBACK-MAKER.html"
>CALLBACK-MAKER</a
></td
><td
><a href="../api/function_005FBDB_003A_003ABUILD-ASSOC-CALLBACK-MAKER.html"
> [Function] </a
></td
></tr
><tr
><td align="right"
><a href="../api/constant_005FBDB_003A_003ADB_005FENV_005FOPEN_005FCALLED.html"
......@@ -4870,6 +4912,20 @@
> [Function] </a
></td
></tr
><tr
><td align="right"
><a href="../api/function_005FBDB_003A_003ABUILD-ASSOC-CALLBACK-MAKER.html"
>BUILD-ASSOC-CALLBACK-</a
></td
><td
><a href="../api/function_005FBDB_003A_003ABUILD-ASSOC-CALLBACK-MAKER.html"
>MAKER</a
></td
><td
><a href="../api/function_005FBDB_003A_003ABUILD-ASSOC-CALLBACK-MAKER.html"
> [Function] </a
></td
></tr
><tr
><td align="right"
><a href="../api/constant_005FBDB_003A_003ATXN_005FMALLOC.html"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment