1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Make it buildable. Pull test program from testee. Zap stray fprintf().

FossilOrigin-Name: 2b850aca1e76805a0358064318a765fa66ce394d015936fd47683d74ca4c187e
This commit is contained in:
larrybr
2023-11-05 23:55:41 +00:00
parent ff39634625
commit 8dd4697e48
4 changed files with 13 additions and 47 deletions

View File

@@ -133,7 +133,6 @@ consoleClassifySetup( FILE *pfIn, FILE *pfOut, FILE *pfErr ){
consoleInfo.outputIx |= ix;
}
SetConsoleMode(ppst->hx, cm);
fprintf(stderr, "consMode[%d]: %02x -> %02x\n", ix, ppst->consMode, cm);
#endif
rv |= (CSCS_InConsole<<ix);
}
@@ -270,7 +269,6 @@ INT_LINKAGE char* fgetsUtf8(char *cBuf, int ncMax, FILE *pfIn){
bRC &= ReadConsoleW(consoleInfo.pst[0].hx, wcBuf+nbr, 1, &nbrx, 0);
if( bRC ) nbr += nbrx;
}
hd(wcBuf,nbr);
if( !bRC || (noc==0 && nbr==0) ) return 0;
if( nbr > 0 ){
int nmb = WideCharToMultiByte(CP_UTF8, 0, wcBuf,nbr,0,0,0,0);
@@ -314,39 +312,3 @@ INT_LINKAGE char* fgetsUtf8(char *cBuf, int ncMax, FILE *pfIn){
}
#endif
}
#ifdef TEST_CIO
// cl -Zi -I. -DWIN32 -DTEST_CIO sqlite3.c src/console_io.c -Fecio.exe
// gcc -I. -DWIN32 -DTEST_CIO sqlite3.c src/console_io.c -o cio.exe
const char *prompts[] = { "main", "cont" };
Prompts goofy = { 2, prompts };
int main(int na, char *av[]){
ConsoleStdConsStreams cc = consoleClassifySetup(stdin, stdout, stderr);
const char *zt = "Math: ±×÷∂∆∙√∞∩∫≈≠≡≤≥\n"
"Hiragana: 亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱"
"宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏\n"
"Simplified Chinese: 餐参蚕残惭惨灿掺孱骖璨粲黪\n"
"Geometric Shapes: ■□▪▫▲△▼▽◆◇◊○◌◎●◢◣◤◥◦\n"
"Boxes single: ─━│┃┄┅┆┇┈┉┊┋ ┌┍┎┏┐┑┒┓└┕┖┗┘┙┚┛├┝┞┟┠┡┢┣┤┥┦┧┨┩┪┫┬┭┮┯┰┱┲┳"
"┴┵┶┷┸┹┺┻┼┽┾┿╀╁╂╃╄╅╆╇╈╉╊╋\n"
"Boxes double: ═║╒╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡╢╣╤╥╦╧╨╩╪╫╬\n"
"Rounded corners and diagonals: ╭╮╯╰╱╲╳\n"
;
char inBuf[150];
setTextMode(stdout, 1);
setTextMode(stderr, 1);
fprintfUtf8(stderr, "Console streams: %d, CP_UTF8 valid: %d\n", cc,
IsValidCodePage(CP_UTF8));
fprintfUtf8(stdout, "%s=%d\n", "∑(1st 7 primes)", 42);
fprintfUtf8(stderr, "%s\n", "∫ (1/x) dx ≡ ln(x)");
fprintfUtf8(stdout, "%s", zt);
fprintfUtf8(stderr, "Entering input/echo loop."
" Type or copy/paste, or EOF to exit.\n");
while( fprintfUtf8(stdout,"? ") && fgetsUtf8(inBuf, sizeof(inBuf), stdin) ){
fprintfUtf8(stdout, "! %s", inBuf);
}
consoleRestore();
return 0;
}
#endif /* defined(TEST_CIO) */