| 26950 | int SQLITE_CDECL main(int argc, char **argv){ |
| 26951 | #else |
| 26952 | int SQLITE_CDECL wmain(int argc, wchar_t **wargv){ |
| 26953 | char **argv; |
| 26954 | #endif |
| 26955 | #ifdef SQLITE_DEBUG |
| 26956 | sqlite3_int64 mem_main_enter = sqlite3_memory_used(); |
| 26957 | #endif |
| 26958 | char *zErrMsg = 0; |
| 26959 | #ifdef SQLITE_SHELL_FIDDLE |
| 26960 | # define data shellState |
| 26961 | #else |
| 26962 | ShellState data; |
| 26963 | #endif |
| 26964 | const char *zInitFile = 0; |
| 26965 | int i; |
| 26966 | int rc = 0; |
| 26967 | int warnInmemoryDb = 0; |
| 26968 | int readStdin = 1; |
| 26969 | int nCmd = 0; |
| 26970 | char **azCmd = 0; |
| 26971 | const char *zVfs = 0; /* Value of -vfs command-line option */ |
| 26972 | #if !SQLITE_SHELL_IS_UTF8 |
| 26973 | char **argvToFree = 0; |
| 26974 | int argcToFree = 0; |
| 26975 | #endif |
| 26976 | |
| 26977 | setBinaryMode(stdin, 0); |
| 26978 | setvbuf(stderr, 0, _IONBF, 0); /* Make sure stderr is unbuffered */ |
| 26979 | #ifdef SQLITE_SHELL_FIDDLE |
| 26980 | stdin_is_interactive = 0; |
| 26981 | stdout_is_console = 1; |
| 26982 | data.wasm.zDefaultDbName = "/fiddle.sqlite3"; |
| 26983 | #else |
| 26984 | stdin_is_interactive = isatty(0); |
| 26985 | stdout_is_console = isatty(1); |
| 26986 | #endif |
| 26987 | |
| 26988 | #if !defined(_WIN32_WCE) |
| 26989 | if( getenv("SQLITE_DEBUG_BREAK") ){ |
| 26990 | if( isatty(0) && isatty(2) ){ |
| 26991 | fprintf(stderr, |
| 26992 | "attach debugger to process %d and press any key to continue.\n", |
| 26993 | GETPID()); |
| 26994 | fgetc(stdin); |
| 26995 | }else{ |
| 26996 | #if defined(_WIN32) || defined(WIN32) |
| 26997 | #if SQLITE_OS_WINRT |
| 26998 | __debugbreak(); |
| 26999 | #else |
| 27000 | DebugBreak(); |
| 27001 | #endif |
| 27002 | #elif defined(SIGTRAP) |
| 27003 | raise(SIGTRAP); |
| 27004 | #endif |
| 27005 | } |
| 27006 | } |
| 27007 | #endif |
| 27008 | |
| 27009 | #if USE_SYSTEM_SQLITE+0!=1 |
nothing calls this directly
no test coverage detected