MCPcopy Create free account
hub / github.com/audacity/audacity / wmain

Function wmain

lib-src/sqlite/shell.c:21001–21547  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20999int SQLITE_CDECL main(int argc, char **argv){
21000#else
21001int SQLITE_CDECL wmain(int argc, wchar_t **wargv){
21002 char **argv;
21003#endif
21004 char *zErrMsg = 0;
21005 ShellState data;
21006 const char *zInitFile = 0;
21007 int i;
21008 int rc = 0;
21009 int warnInmemoryDb = 0;
21010 int readStdin = 1;
21011 int nCmd = 0;
21012 char **azCmd = 0;
21013 const char *zVfs = 0; /* Value of -vfs command-line option */
21014#if !SQLITE_SHELL_IS_UTF8
21015 char **argvToFree = 0;
21016 int argcToFree = 0;
21017#endif
21018
21019 setBinaryMode(stdin, 0);
21020 setvbuf(stderr, 0, _IONBF, 0); /* Make sure stderr is unbuffered */
21021 stdin_is_interactive = isatty(0);
21022 stdout_is_console = isatty(1);
21023
21024#ifdef SQLITE_DEBUG
21025 registerOomSimulator();
21026#endif
21027
21028#if !defined(_WIN32_WCE)
21029 if( getenv("SQLITE_DEBUG_BREAK") ){
21030 if( isatty(0) && isatty(2) ){
21031 fprintf(stderr,
21032 "attach debugger to process %d and press any key to continue.\n",
21033 GETPID());
21034 fgetc(stdin);
21035 }else{
21036#if defined(_WIN32) || defined(WIN32)
21037#if SQLITE_OS_WINRT
21038 __debugbreak();
21039#else
21040 DebugBreak();
21041#endif
21042#elif defined(SIGTRAP)
21043 raise(SIGTRAP);
21044#endif
21045 }
21046 }
21047#endif
21048
21049#if USE_SYSTEM_SQLITE+0!=1
21050 if( strncmp(sqlite3_sourceid(),SQLITE_SOURCE_ID,60)!=0 ){
21051 utf8_printf(stderr, "SQLite header and source version mismatch\n%s\n%s\n",
21052 sqlite3_sourceid(), SQLITE_SOURCE_ID);
21053 exit(1);
21054 }
21055#endif
21056 main_init(&data);
21057
21058 /* On Windows, we must translate command-line arguments into UTF-8.

Callers

nothing calls this directly

Calls 15

setBinaryModeFunction · 0.85
registerOomSimulatorFunction · 0.85
utf8_printfFunction · 0.85
main_initFunction · 0.85
shell_out_of_memoryFunction · 0.85
verify_uninitializedFunction · 0.85
cmdline_option_valueFunction · 0.85
integerValueFunction · 0.85
sqlite3MemTraceActivateFunction · 0.85
sqlite3_appendvfs_initFunction · 0.85
open_dbFunction · 0.85
process_sqlitercFunction · 0.85

Tested by

no test coverage detected