]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Upstream JimTCL patch and minor tcl script tweaks to support (fconfigure -translation...
authorstephan <stephan@noemail.net>
Wed, 5 Feb 2025 12:49:15 +0000 (12:49 +0000)
committerstephan <stephan@noemail.net>
Wed, 5 Feb 2025 12:49:15 +0000 (12:49 +0000)
FossilOrigin-Name: 0974a17c4565f202777fc6203df20dca19acc1e8740ede15334783f41e3e5054

autosetup/jimsh0.c
manifest
manifest.uuid
tool/mksqlite3c-noext.tcl
tool/mksqlite3c.tcl
tool/mksqlite3h.tcl
tool/split-sqlite3c.tcl

index 84db85a20734504a784b4afd111c7c4915d62080..4b9cf3eebfebc9dffef9b3a9e39130ad78348ac4 100644 (file)
@@ -75,6 +75,9 @@ extern "C" {
 
 #if defined(_WIN32) || defined(WIN32)
 
+#ifndef STDIN_FILENO
+#define STDIN_FILENO 0
+#endif
 #define HAVE_DLOPEN
 void *dlopen(const char *path, int mode);
 int dlclose(void *handle);
@@ -1864,7 +1867,7 @@ int Jim_tclcompatInit(Jim_Interp *interp)
 "                                      $f buffering $v\n"
 "                              }\n"
 "                              -tr* {\n"
-"\n"
+"                                      $f translation $v\n"
 "                              }\n"
 "                              default {\n"
 "                                      return -code error \"fconfigure: unknown option $n\"\n"
@@ -2936,6 +2939,28 @@ static int aio_cmd_buffering(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
     return JIM_OK;
 }
 
+static int aio_cmd_translation(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
+{
+       enum {OPT_BINARY, OPT_TEXT};
+    static const char * const options[] = {
+        "binary",
+        "text",
+        NULL
+    };
+       int opt;
+
+       if (Jim_GetEnum(interp, argv[0], options, &opt, NULL, JIM_ERRMSG) != JIM_OK) {
+               return JIM_ERR;
+       }
+#if defined(_setmode) && defined(O_BINARY)
+       else {
+               AioFile *af = Jim_CmdPrivData(interp);
+               _setmode(af->fh, opt == OPT_BINARY ? O_BINARY : O_TEXT);
+       }
+#endif
+    return JIM_OK;
+}
+
 static int aio_cmd_readsize(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 {
     AioFile *af = Jim_CmdPrivData(interp);
@@ -3145,6 +3170,13 @@ static const jim_subcmd_type aio_command_table[] = {
         0,
         2,
 
+    },
+    {   "translation",
+        "binary|text",
+        aio_cmd_translation,
+        1,
+        1,
+
     },
     {   "readsize",
         "?size?",
@@ -24342,6 +24374,10 @@ int Jim_InteractivePrompt(Jim_Interp *interp)
 #include <string.h>
 
 
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
 
 extern int Jim_initjimshInit(Jim_Interp *interp);
 
@@ -24425,6 +24461,10 @@ int main(int argc, char *const argv[])
         }
         if (retcode != JIM_EXIT) {
             JimSetArgv(interp, 0, NULL);
+            if (!isatty(STDIN_FILENO)) {
+
+                goto eval_stdin;
+            }
             retcode = Jim_InteractivePrompt(interp);
         }
     }
@@ -24447,6 +24487,7 @@ int main(int argc, char *const argv[])
             Jim_SetVariableStr(interp, "argv0", Jim_NewStringObj(interp, argv[1], -1));
             JimSetArgv(interp, argc - 2, argv + 2);
             if (strcmp(argv[1], "-") == 0) {
+eval_stdin:
                 retcode = Jim_Eval(interp, "eval [info source [stdin read] stdin 1]");
             } else {
                 retcode = Jim_EvalFile(interp, argv[1]);
index f5d136df4ac4d719da377cbca8f4eecef3499d69..0f78ec938a7930e7d1b1a777d7578db2f518b3fe 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Attempted\simprovements\sto\sthe\sSQLITE_DBCONFIG_...\sdocumentation.
-D 2025-02-05T12:02:43.871
+C Upstream\sJimTCL\spatch\sand\sminor\stcl\sscript\stweaks\sto\ssupport\s(fconfigure\s-translation\sbinary)\sfor\sbetter\scross-platform\sbuild\sportability.
+D 2025-02-05T12:49:15.023
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d
@@ -47,7 +47,7 @@ F autosetup/cc-db.tcl 6e0ed90146197a5a05b245e649975c07c548e30926b218ca3e1d4dc034
 F autosetup/cc-lib.tcl 493c5935b5dd3bf9bd4eca89b07c8b1b1a9356d61783035144e21795facf7360
 F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1de1e5460d78
 F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e45f
-F autosetup/jimsh0.c d40e381ea4526a067590e7b91bd4b2efa6d4980d286f908054c647b3df4aee14
+F autosetup/jimsh0.c 5a74bdbf43c52289e3f482f3b9578db4bd657e88e8fe04b16c564d9fb710540a
 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba
 F autosetup/proj.tcl 9adf1539673cef15bff862d9360b479e6920cc2c0d85de707b0ba31c04ce4531
 F autosetup/sqlite-config.tcl 00af5b9d94d580367bf01984b86397e8d35b74090427def9591a54ded0e1a287
@@ -2156,9 +2156,9 @@ F tool/mkpragmatab.tcl 32e359ccb21011958a821955254bd7a5fa7915d01a8c16fed91ffc8b4
 F tool/mkshellc.tcl 9ce74de0fa904a2c56a96f8d8b5261246bacb0eaa8d7e184f9e18ff94145ebbc
 F tool/mksourceid.c 36aa8020014aed0836fd13c51d6dc9219b0df1761d6b5f58ff5b616211b079b9
 F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97
-F tool/mksqlite3c-noext.tcl 4f7cfef5152b0c91920355cbfc1d608a4ad242cb819f1aea07f6d0274f584a7f
-F tool/mksqlite3c.tcl 1b24a4388f544a7f42fc2d03f34422182d3b2263453f65f642890259566369c1
-F tool/mksqlite3h.tcl 3cc8f3fbb3eca38c899549385622637667254067d865a70ad16e0996c2fd3214
+F tool/mksqlite3c-noext.tcl 351c55256213154cabb051a3c870ef9f4487de905015141ae50dc7578a901b84
+F tool/mksqlite3c.tcl ba13086555b3cb835eba5e47a9250300ab85304d23fd1081abd3f29d8ab71a2b
+F tool/mksqlite3h.tcl b05b85c32295bad3fe64807729693d1f19faed3c464c5faac6c53bb6b972ac2f
 F tool/mksqlite3internalh.tcl eb994013e833359137eb53a55acdad0b5ae1049b
 F tool/mksrczip.tcl 81efd9974dbb36005383f2cd655520057a2ae5aa85ac2441a80c7c28f803ac52
 F tool/mktoolzip.tcl 34b4e92be544f820e2cc26f143f7d5aec511e826ec394cc82969a5dcf7c7a27c
@@ -2187,7 +2187,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 7ce07da76b5e745783e703a834417d725b7d45fd
 F tool/spellsift.tcl 52b4b04dc4333c7ab024f09d9d66ed6b6f7c6eb00b38497a09f338fa55d40618 x
-F tool/split-sqlite3c.tcl 5aa60643afca558bc732b1444ae81a522326f91e1dc5665b369c54f09e20de60
+F tool/split-sqlite3c.tcl 07e18a1d8cc3f6b3a4a1f3528e63c9b29a5c8a7bca0b8d394b231da464ce1247
 F tool/sqldiff.c 2a0987d183027c795ced13d6749061c1d2f38e24eddb428f56fa64c3a8f51e4b
 F tool/sqlite3_analyzer.c.in fc7735c499d226a49d843d8209b2543e4e5229eeb71a674c331323a2217b65b4
 F tool/sqlite3_rsync.c 9a1cca2ab1271c59b37a6493c15dc1bcd0ab9149197a9125926bc08dd26b83fb
@@ -2209,8 +2209,9 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 317e9a470fba2a4b717b9cb66488b8fccb44810a80f3a7deaf1ea81906e2b8d2
-R 70f9a2f7e68a73caf1fe72ecdb3d41d3
-U drh
-Z 5ee06f9c240d54c68e35a361db8f0493
+P baac853871ad307b67b4d624b9ee47fc1313f1aa62c9f8072fb49e97aa33db94
+Q +fddcfbcafd1b343ee95960564bb57785b8af18aaae16969d83f1550d6868737e
+R a7b74c08eab9f96c10b2c2a2b89f2fbf
+U stephan
+Z c6d765f25f632bd465da0fecb9f4261f
 # Remove this line to create a well-formed Fossil manifest.
index af4c4d49c42ced7c7e4454421c981bb1844ee5e4..f1bcc15a2126668b17900c13109e385d36d11110 100644 (file)
@@ -1 +1 @@
-baac853871ad307b67b4d624b9ee47fc1313f1aa62c9f8072fb49e97aa33db94
+0974a17c4565f202777fc6203df20dca19acc1e8740ede15334783f41e3e5054
index 84520725646ec187e7cd77bf2ac3f1165ee7871c..1148b1c0d54b53fdbd55fb5eb2e2f85675128bbb 100644 (file)
@@ -57,7 +57,7 @@ close $in
 #
 set out [open sqlite3.c w]
 # Force the output to use unix line endings, even on Windows.
-fconfigure $out -translation lf
+fconfigure $out -translation binary
 set today [clock format [clock seconds] -format "%Y-%m-%d %H:%M:%S UTC" -gmt 1]
 puts $out [subst \
 {/******************************************************************************
index ddc1e58776f32de280bb865f2b87a1ab23b29afd..1d0f892363e8575347004358eeac0f1edb3523d8 100644 (file)
@@ -88,7 +88,7 @@ set fname sqlite3.c
 if {$enable_recover} { set fname sqlite3r.c }
 set out [open $fname wb]
 # Force the output to use unix line endings, even on Windows.
-fconfigure $out -translation lf
+fconfigure $out -translation binary
 set today [clock format [clock seconds] -format "%Y-%m-%d %H:%M:%S UTC" -gmt 1]
 puts $out [subst \
 {/******************************************************************************
index 8ef123bc72ae9eca9d9285074fe0a0e2561ab6f7..b1d5ecdcd3e2cc63caaf6cab0180b6cd33054207 100644 (file)
@@ -107,7 +107,7 @@ set declpattern5 \
     {^ *([a-zA-Z][a-zA-Z_0-9 ]+ \**)(sqlite3rebaser_[_a-zA-Z0-9]+)(\(.*)$}
 
 # Force the output to use unix line endings, even on Windows.
-fconfigure stdout -translation lf
+fconfigure stdout -translation binary
 
 set filelist [subst {
   $TOP/src/sqlite.h.in
index 0308431dab2eef83f7d80f9b2ddcc97bd1a53ad9..de4db55a1b40958968609d318b9b50557e5928cd 100644 (file)
@@ -15,7 +15,7 @@ set END   {^/\*+ End of %s \*+/}
 
 set in [open sqlite3.c]
 set out1 [open sqlite3-all.c w]
-fconfigure $out1 -translation lf
+fconfigure $out1 -translation binary
 
 # Copy the header from sqlite3.c into sqlite3-all.c
 #