aboutsummaryrefslogtreecommitdiff
path: root/src/tclsqlite.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2002-06-26 20:06:05 +0000
committerdrh <drh@noemail.net>2002-06-26 20:06:05 +0000
commit06b2718a5f8898baa74b15761f84440d4a13a71c (patch)
tree3996011bb73d05652d4b495f2c99e22b32fcb52d /src/tclsqlite.c
parentb13632063d5cfa89a076f3c4ed3dda62008e9f67 (diff)
downloadsqlite-06b2718a5f8898baa74b15761f84440d4a13a71c.tar.gz
sqlite-06b2718a5f8898baa74b15761f84440d4a13a71c.zip
In the TCL interface, the "sqlite" command now always returns the address
of the "sqlite*" pointer that sqlite_open() returns. It used to do this only when compiled with the SQLITE_TEST macro defined. (CVS 648) FossilOrigin-Name: 9ca6368525fe81fe9c78c6911f4d23009ce858d5
Diffstat (limited to 'src/tclsqlite.c')
-rw-r--r--src/tclsqlite.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/tclsqlite.c b/src/tclsqlite.c
index c613e8a60..8e6bc9717 100644
--- a/src/tclsqlite.c
+++ b/src/tclsqlite.c
@@ -11,11 +11,11 @@
*************************************************************************
** A TCL Interface to SQLite
**
-** $Id: tclsqlite.c,v 1.33 2002/06/25 19:31:18 drh Exp $
+** $Id: tclsqlite.c,v 1.34 2002/06/26 20:06:06 drh Exp $
*/
#ifndef NO_TCL /* Omit this whole file if TCL is unavailable */
-#include "sqlite.h"
+#include "sqliteInt.h"
#include "tcl.h"
#include <stdlib.h>
#include <string.h>
@@ -543,6 +543,7 @@ static int DbMain(void *cd, Tcl_Interp *interp, int argc, char **argv){
int mode;
SqliteDb *p;
char *zErrMsg;
+ char zBuf[80];
if( argc==2 ){
if( strcmp(argv[1],"-encoding")==0 ){
Tcl_AppendResult(interp,sqlite_encoding,0);
@@ -583,18 +584,19 @@ static int DbMain(void *cd, Tcl_Interp *interp, int argc, char **argv){
}
Tcl_CreateObjCommand(interp, argv[1], DbObjCmd, (char*)p, DbDeleteCmd);
+ /* The return value is the value of the sqlite* pointer
+ */
+ sprintf(zBuf, "%p", p->db);
+ Tcl_AppendResult(interp, zBuf, 0);
+
/* If compiled with SQLITE_TEST turned on, then register the "md5sum"
- ** SQL function and return an integer which is the memory address of
- ** the underlying sqlite* pointer.
+ ** SQL function.
*/
#ifdef SQLITE_TEST
{
- char zBuf[40];
extern void Md5_Register(sqlite*);
Md5_Register(p->db);
- sprintf(zBuf, "%d", (int)p->db);
- Tcl_AppendResult(interp, zBuf, 0);
- }
+ }
#endif
return TCL_OK;
}