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

@ -1,5 +1,5 @@
C Input\sworking.\sNo\sline-editor\sprovisions\syet.\s(WIP,\sbut\ssuitable\sfor\stesting.)
D 2023-11-05T19:42:00.134
C Make\sit\sbuildable.\sPull\stest\sprogram\sfrom\stestee.\sZap\sstray\sfprintf().
D 2023-11-05T23:55:41.214
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -669,8 +669,8 @@ F src/btreeInt.h ef12a72b708677e48d6bc8dcd66fed25434740568b89e2cfa368093cfc5b9d1
F src/build.c 189e4517d67f09f0a3e0d8e1faa6e2ef0c2e95f6ac82e33c912cb7efa2a359cc
F src/callback.c db3a45e376deff6a16c0058163fe0ae2b73a2945f3f408ca32cf74960b28d490
F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e
F src/console_io.c a04f62d1930d32f0bda26b546e9b3d6455e7caaee4ea7624be4b1ef7ea2329b7 x
F src/console_io.h 49680984d2a121697ccb2620f9e8465393d61c3edc3d5720c77dfa0a1f4a7389
F src/console_io.c 5ff9be9911d73bdf89d33b57db282e1777d2fc906c3e1c573d2e90adfb85393b x
F src/console_io.h 88b5376f02550b03a0d0f44e71fe6b8dccc025b33f7822780fed9cfe58961fe3
F src/ctime.c 23331529e654be40ca97d171cbbffe9b3d4c71cc53b78fe5501230675952da8b
F src/date.c eebc54a00e888d3c56147779e9f361b77d62fd69ff2008c5373946aa1ba1d574
F src/dbpage.c 80e46e1df623ec40486da7a5086cb723b0275a6e2a7b01d9f9b5da0f04ba2782
@ -2144,8 +2144,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P dfea85be1fb927ea446c9d98bae42ba1197bdab098aa6d95aa512a37d07a1e52
R 4898fd3a7f002f1e4e422622974a0785
P e8568b1d925c2118eb08394dd8aa50cfb521240f87668f535ec4a03e67dc9a09
R 35673b0955f1c798661d8793bf63d1c3
U larrybr
Z c9314460b6b28a6cd16041af96151d83
Z beec5bac02182bb7b20a99bcb3d7ba4e
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
e8568b1d925c2118eb08394dd8aa50cfb521240f87668f535ec4a03e67dc9a09
2b850aca1e76805a0358064318a765fa66ce394d015936fd47683d74ca4c187e

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) */

View File

@ -25,7 +25,7 @@
*/
#ifndef INT_LINKAGE
# define INT_LINKAGE /* Linkage will be external to translation unit. */
# define INT_LINKAGE extern /* Linkage external to translation unit. */
# include <stdio.h>
# include <stdlib.h>
# include <limits.h>
@ -38,6 +38,10 @@
# endif
#endif
#ifndef SQLITE3_H
# include "sqlite3.h"
#endif
/* Define enum for use with following function. */
typedef enum ConsoleStdConsStreams {
CSCS_NoConsole = 0,