From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Pirotte Newsgroups: gmane.lisp.guile.devel Subject: guile-sqlite3 - patch Date: Fri, 20 Jan 2012 14:57:49 -0200 Message-ID: <20120120145749.73121594@altosw.be> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/TmWdLgIR=2=fkgoW.0U_3ih" X-Trace: dough.gmane.org 1327078702 5589 80.91.229.12 (20 Jan 2012 16:58:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 20 Jan 2012 16:58:22 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Jan 20 17:58:18 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RoHn7-0005dL-M3 for guile-devel@m.gmane.org; Fri, 20 Jan 2012 17:58:18 +0100 Original-Received: from localhost ([::1]:54485 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RoHn2-0001rC-6c for guile-devel@m.gmane.org; Fri, 20 Jan 2012 11:58:12 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:45841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RoHmw-0001qi-C1 for guile-devel@gnu.org; Fri, 20 Jan 2012 11:58:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RoHms-0001FP-AD for guile-devel@gnu.org; Fri, 20 Jan 2012 11:58:06 -0500 Original-Received: from maximusconfessor.all2all.org ([62.58.108.13]:44979) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RoHms-0001FI-5g for guile-devel@gnu.org; Fri, 20 Jan 2012 11:58:02 -0500 Original-Received: from localhost (unknown [192.168.0.2]) by maximusconfessor.all2all.org (Postfix) with ESMTP id BAB33A04C1B0 for ; Fri, 20 Jan 2012 17:57:59 +0100 (CET) Original-Received: from maximusconfessor.all2all.org ([192.168.0.1]) by localhost (maximusconfessor.all2all.org [192.168.0.2]) (amavisd-new, port 10024) with ESMTP id Yc0F5YDtdJDq for ; Fri, 20 Jan 2012 17:35:26 +0100 (CET) Original-Received: from localhost (unknown [139.82.89.24]) by maximusconfessor.all2all.org (Postfix) with ESMTPSA id 4ACE2A04C186 for ; Fri, 20 Jan 2012 17:57:52 +0100 (CET) X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.4; i486-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 62.58.108.13 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:13598 Archived-At: --MP_/TmWdLgIR=2=fkgoW.0U_3ih Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello, Attached is a patch which defines and export sqlite3_enable_load_extension Cheers, David --MP_/TmWdLgIR=2=fkgoW.0U_3ih Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-sqlite3_enable_load_extension-added.patch >From 866e578beaf1eb89b1bb80b9c6347f62e8ee5c60 Mon Sep 17 00:00:00 2001 From: David Pirotte Date: Fri, 20 Jan 2012 14:38:13 -0200 Subject: [PATCH] sqlite3_enable_load_extension, added Extension loading while evaluating user-entered SQL is disabled per default. This API can be used to turn the sqlite3_load_extension() mechanism on and off. --- sqlite3.scm | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/sqlite3.scm b/sqlite3.scm index 2ac2f4b..f3c16ae 100644 --- a/sqlite3.scm +++ b/sqlite3.scm @@ -31,6 +31,7 @@ #:export (sqlite-open sqlite-close + sqlite-enable-load-extension sqlite-prepare sqlite-bind sqlite-column-names @@ -180,6 +181,14 @@ db) (sqlite-error #f 'sqlite-open ret (static-errcode->errmsg ret))))))) +(define sqlite-enable-load-extension + (let ((ele (pointer->procedure + int + (dynamic-func "sqlite3_enable_load_extension" libsqlite3) + (list '* int)))) + (lambda (db onoff) + (ele (db-pointer db) onoff)))) + ;;; ;;; SQL statements ;;; -- 1.7.8.3 --MP_/TmWdLgIR=2=fkgoW.0U_3ih--