-C Changes\sto\scomments.\s\sIn\sparticular,\sa\slengthy\scomment\swas\sadded\sto\sencode.c\r\nthat\sexplains\show\sthe\sencoder\salgorithm\sworks.\s(CVS\s966)
-D 2003-05-10T03:36:54
+C Changed\s".databases"\scommand\sto\suse\sPRAGMA\sdatabase_list.\s(CVS\s967)
+D 2003-05-11T20:07:05
F Makefile.in 004acec253ecdde985c8ecd5b7c9accdb210378f
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
F src/printf.c fc5fdef6e92ad205005263661fe9716f55a49f3e
F src/random.c 19e8e00fe0df32a742f115773f57651be327cabe
F src/select.c c06b4605bca03d8237a3fc4098179bf3a7133702
-F src/shell.c 89a14538b40fbfa15b0ad10b3367aab272bd9f15
+F src/shell.c 88305ca3d0435cb5e5667c5b4cb991a2d63c1385
F src/shell.tcl 27ecbd63dd88396ad16d81ab44f73e6c0ea9d20e
F src/sqlite.h.in eec06462cba262c0ee03f38462a18a4bc66dda4e
F src/sqliteInt.h 9b64d8225a26f3d5a376370b31060dd70bcc362b
F www/sqlite.tcl 4bd1729e320f5fa9125f0022b281fbe839192125
F www/tclsqlite.tcl 1db15abeb446aad0caf0b95b8b9579720e4ea331
F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218
-P 26bd7bb1779e14f19c00e450aaa9529f2aabf131
-R b680c0a504530ce6590f8a3af4ddd816
-U drh
-Z d87b54e38f0dd3d4af38249efc6d41d2
+P 8b388b2f690dbfd50eefc0fdede1c7785f78afa1
+R a62aff9c2d1ccd3470c73630c954d229
+U jplyon
+Z 280acb47c3622340801e99c170c357f1
** This file contains code to implement the "sqlite" command line
** utility for accessing SQLite databases.
**
-** $Id: shell.c,v 1.77 2003/05/04 18:30:59 drh Exp $
+** $Id: shell.c,v 1.78 2003/05/11 20:07:05 jplyon Exp $
*/
#include <stdlib.h>
#include <string.h>
#define MODE_Semi 3 /* Same as MODE_List but append ";" to each line */
#define MODE_Html 4 /* Generate an XHTML table */
#define MODE_Insert 5 /* Generate SQL "insert" statements */
-#define MODE_NUM_OF 6
+#define MODE_NUM_OF 6 /* The number of modes (not a mode itself) */
char *modeDescr[MODE_NUM_OF] = {
"line",
n = strlen(azArg[0]);
c = azArg[0][0];
if( c=='d' && n>1 && strncmp(azArg[0], "databases", n)==0 ){
- int i;
+ struct callback_data data;
+ char *zErrMsg = 0;
open_db(p);
- fprintf(p->out, "[Name]\t[File]\n");
- for(i=0; i<db->nDb; i++){
- sqlite *db = p->db;
- Db *pDb = &db->aDb[i];
- BtOps* pOps = btOps(pDb->pBt);
- const char *zName = pDb->zName;
- const char *zFilename = pOps->GetFilename(pDb->pBt);
- fprintf(p->out, "%s\t%s\n", zName, zFilename);
+ memcpy(&data, p, sizeof(data));
+ data.showHeader = 0;
+ data.mode = MODE_Column;
+ sqlite_exec(p->db, "PRAGMA database_list; ", callback, &data, &zErrMsg);
+ if( zErrMsg ){
+ fprintf(stderr,"Error: %s\n", zErrMsg);
+ free(zErrMsg);
}
}else