/* ** 2006 June 10 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** Code for testing the virtual table interfaces. This code ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** ** $Id: test8.c,v 1.2 2006/06/12 06:09:19 danielk1977 Exp $ */ #include "sqliteInt.h" #include "tcl.h" #include "os.h" #include #include /* ** Global Tcl variable $echo_module is a list. This routine appends ** the string element zArg to that list in interpreter interp. */ static void appendToEchoModule(const sqlite3_module *pModule, const char *zArg){ int flags = (TCL_APPEND_VALUE | TCL_LIST_ELEMENT | TCL_GLOBAL_ONLY); Tcl_SetVar((Tcl_Interp *)(pModule->pAux), "echo_module", zArg, flags); } /* Methods for the echo module */ static int echoCreate( sqlite3 *db, const sqlite3_module *pModule, int argc, char **argv, sqlite3_vtab **ppVtab ){ int i; Tcl_Interp *interp = pModule->pAux; *ppVtab = pModule->pAux; appendToEchoModule(pModule, "xCreate"); for(i=0; ipAux; *ppVtab = pModule->pAux; Tcl_SetVar(interp, "echo_module", "xConnect", TCL_GLOBAL_ONLY); for(i=0; i