diff options
author | drh <drh@noemail.net> | 2006-07-06 17:08:48 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2006-07-06 17:08:48 +0000 |
commit | 4144905b531ccf12ee33a62a2f6de1331908a11d (patch) | |
tree | 260c814114213b9d3d323fc4ebf51f8eaa1a5ce9 /src/tclsqlite.c | |
parent | 3086765b6fb34cd187888a3adf64803fdf6e8fb5 (diff) | |
download | sqlite-4144905b531ccf12ee33a62a2f6de1331908a11d.tar.gz sqlite-4144905b531ccf12ee33a62a2f6de1331908a11d.zip |
Make the sqlite3_enable_load_extension() interface accessible from the
TCL bindings. (CVS 3321)
FossilOrigin-Name: ce96b890bbf2f2b9686e19bbb1111a70f6404cb5
Diffstat (limited to 'src/tclsqlite.c')
-rw-r--r-- | src/tclsqlite.c | 48 |
1 files changed, 34 insertions, 14 deletions
diff --git a/src/tclsqlite.c b/src/tclsqlite.c index 30a3c88a3..1f4c5901f 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -11,7 +11,7 @@ ************************************************************************* ** A TCL Interface to SQLite ** -** $Id: tclsqlite.c,v 1.161 2006/06/21 19:30:34 drh Exp $ +** $Id: tclsqlite.c,v 1.162 2006/07/06 17:08:48 drh Exp $ */ #ifndef NO_TCL /* Omit this whole file if TCL is unavailable */ @@ -659,24 +659,25 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){ "authorizer", "busy", "cache", "changes", "close", "collate", "collation_needed", "commit_hook", "complete", - "copy", "errorcode", "eval", - "exists", "function", "last_insert_rowid", - "nullvalue", "onecolumn", "profile", - "progress", "rekey", "rollback_hook", - "timeout", "total_changes", "trace", - "transaction", "update_hook", "version", - 0 + "copy", "enable_load_extension","errorcode", + "eval", "exists", "function", + "last_insert_rowid", "nullvalue", "onecolumn", + "profile", "progress", "rekey", + "rollback_hook", "timeout", "total_changes", + "trace", "transaction", "update_hook", + "version", 0 }; enum DB_enum { DB_AUTHORIZER, DB_BUSY, DB_CACHE, DB_CHANGES, DB_CLOSE, DB_COLLATE, DB_COLLATION_NEEDED, DB_COMMIT_HOOK, DB_COMPLETE, - DB_COPY, DB_ERRORCODE, DB_EVAL, - DB_EXISTS, DB_FUNCTION, DB_LAST_INSERT_ROWID, - DB_NULLVALUE, DB_ONECOLUMN, DB_PROFILE, - DB_PROGRESS, DB_REKEY, DB_ROLLBACK_HOOK, - DB_TIMEOUT, DB_TOTAL_CHANGES, DB_TRACE, - DB_TRANSACTION, DB_UPDATE_HOOK, DB_VERSION + DB_COPY, DB_ENABLE_LOAD_EXTENSION,DB_ERRORCODE, + DB_EVAL, DB_EXISTS, DB_FUNCTION, + DB_LAST_INSERT_ROWID, DB_NULLVALUE, DB_ONECOLUMN, + DB_PROFILE, DB_PROGRESS, DB_REKEY, + DB_ROLLBACK_HOOK, DB_TIMEOUT, DB_TOTAL_CHANGES, + DB_TRACE, DB_TRANSACTION, DB_UPDATE_HOOK, + DB_VERSION, }; /* don't leave trailing commas on DB_enum, it confuses the AIX xlc compiler */ @@ -1157,6 +1158,25 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){ } /* + ** $db enable_load_extension BOOLEAN + ** + ** Turn the extension loading feature on or off. It if off by + ** default. + */ + case DB_ENABLE_LOAD_EXTENSION: { + int onoff; + if( objc!=3 ){ + Tcl_WrongNumArgs(interp, 2, objv, "BOOLEAN"); + return TCL_ERROR; + } + if( Tcl_GetBooleanFromObj(interp, objv[2], &onoff) ){ + return TCL_ERROR; + } + sqlite3_enable_load_extension(pDb->db, onoff); + break; + } + + /* ** $db errorcode ** ** Return the numeric error code that was returned by the most recent |