-C Simplifications\sand\soptimizations.\s\sAlso:\sdisable\sthe\scorrupt.test\sfor\snow.\s(CVS\s1924)
-D 2004-08-31T13:45:11
+C Changes\sto\ssupport\scompiling\sunder\swindows.\s(CVS\s1925)
+D 2004-08-31T23:41:26
F Makefile.in 65a7c43fcaf9a710d62f120b11b6e435eeb4a450
F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
F spec.template b2f6c4e488cbc3b993a57deba22cbc36203c4da3
F sqlite.1 83f4a9d37bdf2b7ef079a82d54eaf2e3509ee6ea
F sqlite.pc.in 30552343140c53304c2a658c080fbe810cd09ca2
-F sqlite3.def cf325d366f167029a971de7333f32b74bfe2e375
+F sqlite3.def 84215604aa7b547d75e0f7b437966e7ad18fa8b2
F sqlite3.pc.in 985b9bf34192a549d7d370e0f0b6b34a4f61369a
F src/attach.c 0bd4f11da6999665da30625665a4096ba7898de6
F src/auth.c 60db23b98bb94c8b0178180faaf49dc116674217
F src/printf.c 17b28a1eedfe8129b05de981719306c18c3f1327
F src/random.c eff68e3f257e05e81eae6c4d50a51eb88beb4ff3
F src/select.c 400b2dcc8e05c0101a65a370f7ebb33c9c85f0b3
-F src/shell.c 64932b37d79baffd34544172c14c99b2e08a11bb
+F src/shell.c 4f1a2760ced81c829defb47b0a3b61ffec61b604
F src/sqlite.h.in b89ced1acc705bc9c79a2a4e725ac0eb64bd0614
F src/sqliteInt.h 89c1555ceba68d460ee13530eb8a51944e57fad2
F src/table.c 4521c278892f60e4d630788c0ea5cf4db1e75c49
F www/vdbe.tcl 59288db1ac5c0616296b26dce071c36cb611dfe9
F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0
F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4
-P 0a47c8f86d1649e9ae7edd4c49a6fe5f5272351e
-R 4e22239c77e5e5c0b57b87eb76489528
+P 8fd65e704888a8e2f4a712a94fd0e3f866c10ef3
+R 0d8f5ad503e5312e676ca00f78eae116
U drh
-Z 972ff5a80d13e0bb73eb2d8433c24b81
+Z 56bb610aa487540418fc40b7a4941024
** This file contains code to implement the "sqlite" command line
** utility for accessing SQLite databases.
**
-** $Id: shell.c,v 1.112 2004/08/30 01:54:05 drh Exp $
+** $Id: shell.c,v 1.113 2004/08/31 23:41:26 drh Exp $
*/
#include <stdlib.h>
#include <string.h>
/*
** Determines if a string is a number of not.
*/
-extern int sqlite3IsNumber(const char*, int*, unsigned char);
+static int isNumber(const unsigned char *z, int *realnum){
+ if( *z=='-' || *z=='+' ) z++;
+ if( !isdigit(*z) ){
+ return 0;
+ }
+ z++;
+ if( realnum ) *realnum = 0;
+ while( isdigit(*z) ){ z++; }
+ if( *z=='.' ){
+ z++;
+ if( !isdigit(*z) ) return 0;
+ while( isdigit(*z) ){ z++; }
+ if( realnum ) *realnum = 1;
+ }
+ if( *z=='e' || *z=='E' ){
+ z++;
+ if( *z=='+' || *z=='-' ) z++;
+ if( !isdigit(*z) ) return 0;
+ while( isdigit(*z) ){ z++; }
+ if( realnum ) *realnum = 1;
+ }
+ return *z==0;
+}
/*
** A global char* and an SQL function to access its current value
char *zSep = i>0 ? ",": "";
if( azArg[i]==0 ){
fprintf(p->out,"%sNULL",zSep);
- }else if( sqlite3IsNumber(azArg[i], 0, 1) ){
+ }else if( isNumber(azArg[i], 0) ){
fprintf(p->out,"%s%s",zSep, azArg[i]);
}else{
if( zSep[0] ) fprintf(p->out,"%s",zSep);
data.showHeader = 0;
data.mode = MODE_Semi;
if( nArg>1 ){
- extern int sqlite3StrICmp(const char*,const char*);
- if( sqlite3StrICmp(azArg[1],"sqlite_master")==0 ){
+ int i;
+ for(i=0; azArg[1][i]; i++) azArg[1][i] = tolower(azArg[1][i]);
+ if( strcmp(azArg[1],"sqlite_master")==0 ){
char *new_argv[2], *new_colv[2];
new_argv[0] = "CREATE TABLE sqlite_master (\n"
" type text,\n"
new_colv[0] = "sql";
new_colv[1] = 0;
callback(&data, 1, new_argv, new_colv);
- }else if( sqlite3StrICmp(azArg[1],"sqlite_temp_master")==0 ){
+ }else if( strcmp(azArg[1],"sqlite_temp_master")==0 ){
char *new_argv[2], *new_colv[2];
new_argv[0] = "CREATE TEMP TABLE sqlite_temp_master (\n"
" type text,\n"
** as is the Oracle "/".
*/
static int _is_command_terminator(const char *zLine){
- extern int sqlite3StrNICmp(const char*,const char*,int);
while( isspace(*(unsigned char*)zLine) ){ zLine++; };
if( zLine[0]=='/' && _all_whitespace(&zLine[1]) ) return 1; /* Oracle */
- if( sqlite3StrNICmp(zLine,"go",2)==0 && _all_whitespace(&zLine[2]) ){
+ if( tolower(zLine[0])=='g' && tolower(zLine[1])=='o'
+ && _all_whitespace(&zLine[2]) ){
return 1; /* SQL Server */
}
return 0;
const char *zInitFile = 0;
char *zFirstCmd = 0;
int i;
- extern int sqlite3OsFileExists(const char*);
#ifdef __MACOS__
argc = ccommand(&argv);
** files from being created if a user mistypes the database name argument
** to the sqlite command-line tool.
*/
- if( sqlite3OsFileExists(data.zDbFilename) ){
+ if( access(data.zDbFilename, 0)==0 ){
open_db(&data);
}
}else if( strcmp(z,"-echo")==0 ){
data.echoOn = 1;
}else if( strcmp(z,"-version")==0 ){
- printf("%s\n", sqlite3_version);
+ printf("%s\n", sqlite3_libversion());
return 1;
}else if( strcmp(z,"-help")==0 ){
usage(1);
printf(
"SQLite version %s\n"
"Enter \".help\" for instructions\n",
- sqlite3_version
+ sqlite3_libversion()
);
zHome = find_home_dir();
if( zHome && (zHistory = malloc(strlen(zHome)+20))!=0 ){