]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Make tool/mctimec.tcl effect more regular and obvious
authorlarrybr <larrybr@noemail.net>
Wed, 12 Jan 2022 01:42:50 +0000 (01:42 +0000)
committerlarrybr <larrybr@noemail.net>
Wed, 12 Jan 2022 01:42:50 +0000 (01:42 +0000)
FossilOrigin-Name: 02aaa10f34ab17e76feb7b6f79048309536c0794fcb534b934e06f3daedfeaba

manifest
manifest.uuid
src/ctime.c
tool/mkctimec.tcl [changed mode: 0644->0755]

index 8113c2b57c63cc330a928adf62b94c95ae2401e4..a57d94552a8342519e61445c45cbe82096c0c57e 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\smkctimec.tcl\swith\sthe\supdated\scompile-time\soptions\sfor\sJSON.
-D 2022-01-12T00:52:34.194
+C Make\stool/mctimec.tcl\seffect\smore\sregular\sand\sobvious
+D 2022-01-12T01:42:50.451
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -497,7 +497,7 @@ F src/btreeInt.h ee9348c4cb9077243b049edc93a82c1f32ca48baeabf2140d41362b9f9139ff
 F src/build.c c72407a27a28982a384cd453a3a6b6992a1ceae8bd8d95e96d7fb9c0d645a32f
 F src/callback.c 4c19af69835787bfe790ac560f3071a824eb629f34e41f97b52ce5235c77de1c
 F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e
-F src/ctime.c ef91281f85e032f7a544ce2e4b4df29eaa45d236dabb28792af8c4398b960817
+F src/ctime.c 2cce39df1a13e05b7633e6d21b651f21492471f991dd7b323a4ee4e7b7f0b7f1
 F src/date.c ab8e01d928f201f5dee0bc6d54d6702fdcec96dff4d58c387447671f6a46d191
 F src/dbpage.c 8a01e865bf8bc6d7b1844b4314443a6436c07c3efe1d488ed89e81719047833a
 F src/dbstat.c 861e08690fcb0f2ee1165eff0060ea8d4f3e2ea10f80dab7d32ad70443a6ff2d
@@ -1865,7 +1865,7 @@ F tool/max-limits.c cbb635fbb37ae4d05f240bfb5b5270bb63c54439
 F tool/merge-test.tcl de76b62f2de2a92d4c1ca4f976bce0aea6899e0229e250479b229b2a1914b176
 F tool/mkautoconfamal.sh f62353eb6c06ab264da027fd4507d09914433dbdcab9cb011cdc18016f1ab3b8
 F tool/mkccode.tcl 86463e68ce9c15d3041610fedd285ce32a5cf7a58fc88b3202b8b76837650dbe x
-F tool/mkctimec.tcl 4d8e3f967f243456bc69e5d37fde6cf174beaaa7a4e2db3515a5a6b92086e7ee
+F tool/mkctimec.tcl 3147e9dfc4ad774e94f80084789ebaada9da9b6e66ddab16438cfc07999b6047 x
 F tool/mkkeywordhash.c 35bfc41adacc4aa6ef6fca7fd0c63e0ec0534b78daf4d0cfdebe398216bbffc3
 F tool/mkmsvcmin.tcl 6ecab9fe22c2c8de4d82d4c46797bda3d2deac8e763885f5a38d0c44a895ab33
 F tool/mkopcodec.tcl 33d20791e191df43209b77d37f0ff0904620b28465cca6990cf8d60da61a07ef
@@ -1938,8 +1938,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 adebb9d7478d092f16fb0ef7d5246ce152b166479d6f949110b5878b89ea2cec
-R 69b7f6a0b4d0fcc284cb15152e397fee
-U drh
-Z 474724af0a4417c46de4dcd375fa43ca
+P 8ded3f5b0025eb6cc11669c1208681e592862ce352dfff11173dff68daafad30
+R 99e0bf97f8dc74f258301b85c4857b96
+U larrybr
+Z da4e437349126128425252d5fe5b1489
 # Remove this line to create a well-formed Fossil manifest.
index 10d9833208d03a095c3c966e2cfde1a39b175498..00e119201fb145bd82d3f33e7aed04db19aea062 100644 (file)
@@ -1 +1 @@
-8ded3f5b0025eb6cc11669c1208681e592862ce352dfff11173dff68daafad30
\ No newline at end of file
+02aaa10f34ab17e76feb7b6f79048309536c0794fcb534b934e06f3daedfeaba
\ No newline at end of file
index bb6896574ff4ae1a321f97f732564011dfd91e51..1463e4f552ab9b83f1835c9e1e48189353d3b9b0 100644 (file)
@@ -1,3 +1,11 @@
+/* DO NOT EDIT!
+** This file is automatically generated by the script in the canonical
+** SQLite source tree at tool/mkctimec.tcl.
+**
+** To modify this header, edit any of the various lists in that script
+** which specify categories of generated conditionals in this file.
+*/
+
 /*
 ** 2010 February 23
 **
@@ -46,9 +54,6 @@
 */
 static const char * const sqlite3azCompileOpt[] = {
 
-/* 
-** BEGIN CODE GENERATED BY tool/mkctime.tcl 
-*/
 #ifdef SQLITE_32BIT_ROWID
   "32BIT_ROWID",
 #endif
@@ -771,10 +776,8 @@ static const char * const sqlite3azCompileOpt[] = {
 #ifdef SQLITE_ZERO_MALLOC
   "ZERO_MALLOC",
 #endif
-/* 
-** END CODE GENERATED BY tool/mkctime.tcl 
-*/
-};
+
+} ;
 
 const char **sqlite3CompileOptions(int *pnOpt){
   *pnOpt = sizeof(sqlite3azCompileOpt) / sizeof(sqlite3azCompileOpt[0]);
old mode 100644 (file)
new mode 100755 (executable)
index a0d1511..745a59a
@@ -5,9 +5,82 @@
 #   const char **azCompileOpt[]
 #
 # definition used in src/ctime.c, run this script from
-# the checkout root. It alters src/ctime.c in-place.
+# the checkout root. It generates src/ctime.c .
 #
 
+
+set ::headWarning {/* DO NOT EDIT!
+** This file is automatically generated by the script in the canonical
+** SQLite source tree at tool/mkctimec.tcl.
+**
+** To modify this header, edit any of the various lists in that script
+** which specify categories of generated conditionals in this file.
+*/}
+
+# Make { and } easier to put into literals (even on EBCDIC machines.)
+regexp {(\{)(\})} "{}" ma ::lb ::rb
+
+set ::headCode "
+/*
+** 2010 February 23
+**
+** The author disclaims copyright to this source code.  In place of
+** a legal notice, here is a blessing:
+**
+**    May you do good and not evil.
+**    May you find forgiveness for yourself and forgive others.
+**    May you share freely, never taking more than you give.
+**
+*************************************************************************
+**
+** This file implements routines used to report what compile-time options
+** SQLite was built with.
+*/
+#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS /* IMP: R-16824-07538 */
+
+/*
+** Include the configuration header output by 'configure' if we're using the
+** autoconf-based build
+*/
+#if defined(_HAVE_SQLITE_CONFIG_H) && !defined(SQLITECONFIG_H)
+#include \"config.h\"
+#define SQLITECONFIG_H 1
+#endif
+
+/* These macros are provided to \"stringify\" the value of the define
+** for those options in which the value is meaningful. */
+#define CTIMEOPT_VAL_(opt) #opt
+#define CTIMEOPT_VAL(opt) CTIMEOPT_VAL_(opt)
+
+/* Like CTIMEOPT_VAL, but especially for SQLITE_DEFAULT_LOOKASIDE. This
+** option requires a separate macro because legal values contain a single
+** comma. e.g. (-DSQLITE_DEFAULT_LOOKASIDE=\"100,100\") */
+#define CTIMEOPT_VAL2_(opt1,opt2) #opt1 \",\" #opt2
+#define CTIMEOPT_VAL2(opt) CTIMEOPT_VAL2_(opt)
+#include \"sqliteInt.h\"
+
+/*
+** An array of names of all compile-time options.  This array should 
+** be sorted A-Z.
+**
+** This array looks large, but in a typical installation actually uses
+** only a handful of compile-time options, so most times this array is usually
+** rather short and uses little memory space.
+*/
+static const char * const sqlite3azCompileOpt\[\] = $::lb
+"
+
+set ::tailCode "
+$::rb ;
+
+const char **sqlite3CompileOptions(int *pnOpt){
+  *pnOpt = sizeof(sqlite3azCompileOpt) / sizeof(sqlite3azCompileOpt\[0\]);
+  return (const char**)sqlite3azCompileOpt;
+}
+
+#endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */
+"
+
 # All Boolean compile time options which default to something
 # other than 0 or empty. The default is paired with the PP
 # symbol so that a differing define can be detected.
@@ -354,60 +427,18 @@ foreach v $value2_options {
 }]
 }
 
-# Split a string on a regex, return all parts in order.
-# Any elements with an even index may be empty.
-# Elements with odd indices will match the regex.
-proc split_on_re {re str {nrepps 1}} {
-  set chunks {}
-  set cix 0
-  set resm [regexp -all -inline -indices $re $str]
-  if {[llength $resm]==0} {
-    return $str
-  }
-  set rix 0
-  while {$rix < [llength $resm]} {
-    set mre [lindex $resm $rix]
-    incr rix $nrepps
-    set mbx [lindex $mre 0]
-    set mex [lindex $mre 1]
-    lappend chunks [string range $str $cix [expr $mbx - 1]]
-    lappend chunks [string range $str $mbx $mex]
-    set cix [expr $mex + 1]
-  }
-  lappend chunks [string range $str $cix end]
-  return $chunks
-}
-
-
 set ctime_c "src/ctime.c"
-if {[catch {set cfd [open $ctime_c r]}]!=0} {
-  puts stderr "File '$ctime_c' unreadable. Run this script from checkout root."
-  exit 1;
-}
-
-set ctfc [read $cfd]
-close $cfd
-
-set re {/\*\s+\*+\s*((BEGIN)|(END)) CODE GENERATED BY (\S+)\s+\*/\s+}
-set renpp 5
-
-set ctfcChunks [split_on_re $re $ctfc $renpp]
-if {[llength $ctfcChunks] != 5} {
-  puts stderr "File '$ctime_c' has too few generated code markers."
-  exit 1;
-}
 
 if {[catch {set cfd [open $ctime_c w]}]!=0} {
   puts stderr "File '$ctime_c' unwritable."
   exit 1;
 }
 
-puts -nonewline $cfd [lindex $ctfcChunks 0]
-puts -nonewline $cfd [lindex $ctfcChunks 1]
+puts $cfd $::headWarning;
+puts $cfd $::headCode;
 foreach o [lsort [array names options]] {
   puts $cfd [string trim $options($o)]
 }
-puts -nonewline $cfd [lindex $ctfcChunks 3]
-puts -nonewline $cfd [lindex $ctfcChunks 4]
+puts -nonewline $cfd $::tailCode;
 
 close $cfd