unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: David Pirotte <david@altosw.be>
To: guile-devel@gnu.org
Subject: guile-sqlite3 - patch
Date: Fri, 20 Jan 2012 16:11:24 -0200	[thread overview]
Message-ID: <20120120161124.0e74c580@altosw.be> (raw)

[-- Attachment #1: Type: text/plain, Size: 380 bytes --]

Hello,

Attached is a patch which changes the sqlite-open default optional flags argument
value.  If I am not misunderstanding the API doc and the intention behind the union
of both sqlite3_open and sqlite3_open_v2 into a single sqlite-open procedure with
optional arguments, then the default value should indeed be (logior
SQLITE_OPEN_READWRITE SQLITE_OPEN_CREATE)

Cheers,
David

[-- Attachment #2: 0002-sqlite-open-reviewed.patch --]
[-- Type: text/x-patch, Size: 1103 bytes --]

From a6cd637757a3923d228d07e8a986ac097d4e2bb3 Mon Sep 17 00:00:00 2001
From: David Pirotte <david@altosw.be>
Date: Fri, 20 Jan 2012 16:03:01 -0200
Subject: [PATCH 2/2] sqlite-open, reviewed

This patch modifies the default optional flags value from 0 to
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE.  The API documentation says:
"... This is the behavior that is always used for sqlite3_open() ... The
sqlite3_open_v2() interface works like sqlite3_open() ..."
---
 sqlite3.scm |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sqlite3.scm b/sqlite3.scm
index f3c16ae..726b3ca 100644
--- a/sqlite3.scm
+++ b/sqlite3.scm
@@ -169,7 +169,7 @@
             int
             (dynamic-func "sqlite3_open_v2" libsqlite3)
             (list '* '* int '*))))
-    (lambda* (filename #:optional (flags 0) (vfs #f))
+    (lambda* (filename #:optional (flags (logior SQLITE_OPEN_READWRITE SQLITE_OPEN_CREATE)) (vfs #f))
       (let* ((out-db (bytevector->pointer (make-bytevector (sizeof '*) 0)))
              (ret (f (string->utf8-pointer filename)
                      out-db
-- 
1.7.8.3


             reply	other threads:[~2012-01-20 18:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-20 18:11 David Pirotte [this message]
2012-01-23 15:22 ` guile-sqlite3 - patch Andy Wingo
  -- strict thread matches above, loose matches on Subject: below --
2012-01-20 16:57 David Pirotte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120120161124.0e74c580@altosw.be \
    --to=david@altosw.be \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).