diff options
author | drh <> | 2024-09-24 17:40:54 +0000 |
---|---|---|
committer | drh <> | 2024-09-24 17:40:54 +0000 |
commit | a55901a27cf3de084c906466f0e126e76be0de64 (patch) | |
tree | 202bfd467ddf1ae35394b4d6f7f9216575cd245b /ext/misc/sqlite3_stdio.c | |
parent | 0be2dd9a1bb0615661f8d7ef98805b52955e32de (diff) | |
download | sqlite-a55901a27cf3de084c906466f0e126e76be0de64.tar.gz sqlite-a55901a27cf3de084c906466f0e126e76be0de64.zip |
Port sqldiff over to use sqlite3_stdio.
FossilOrigin-Name: 18f784c47d4252bc3696a7e084a1afb9f51f006cf2021292f2103531b8235226
Diffstat (limited to 'ext/misc/sqlite3_stdio.c')
-rw-r--r-- | ext/misc/sqlite3_stdio.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/ext/misc/sqlite3_stdio.c b/ext/misc/sqlite3_stdio.c index 0cfa26673..6b7beff4e 100644 --- a/ext/misc/sqlite3_stdio.c +++ b/ext/misc/sqlite3_stdio.c @@ -14,6 +14,19 @@ ** on Windows. */ #ifdef _WIN32 /* This file is a no-op on all platforms except Windows */ +#include "sqlite3_stdio.h" +#undef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#include <stdlib.h> +#include <string.h> +#include <stdio.h> +#include <assert.h> +#include "sqlite3.h" +#include <ctype.h> +#include <stdarg.h> +#include <io.h> +#include <fcntl.h> /* ** Work-alike for the fopen() routine from the standard C library. @@ -68,7 +81,7 @@ FILE *sqlite3_popen(const char *zCommand, const char *zMode){ ** Work-alike for fgets() from the standard C library. */ char *sqlite3_fgets(char *buf, int sz, FILE *in){ - if( isatty(_fileno(in)) ){ + if( _isatty(_fileno(in)) ){ /* When reading from the command-prompt in Windows, it is necessary ** to use _O_WTEXT input mode to read UTF-16 characters, then translate ** that into UTF-8. Otherwise, non-ASCII characters all get translated @@ -95,7 +108,7 @@ char *sqlite3_fgets(char *buf, int sz, FILE *in){ ** Work-alike for fputs() from the standard C library. */ int sqlite3_fputs(const char *z, FILE *out){ - if( isatty(_fileno(out)) ){ + if( _isatty(_fileno(out)) ){ /* When writing to the command-prompt in Windows, it is necessary ** to use _O_WTEXT input mode and write UTF-16 characters. */ @@ -121,7 +134,7 @@ int sqlite3_fputs(const char *z, FILE *out){ */ int sqlite3_fprintf(FILE *out, const char *zFormat, ...){ int rc; - if( isatty(fileno(out)) ){ + if( _isatty(fileno(out)) ){ /* When writing to the command-prompt in Windows, it is necessary ** to use _O_WTEXT input mode and write UTF-16 characters. */ |