]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Internal cleanups and docs in hwaci-common.tcl.
authorstephan <stephan@noemail.net>
Fri, 25 Oct 2024 04:16:36 +0000 (04:16 +0000)
committerstephan <stephan@noemail.net>
Fri, 25 Oct 2024 04:16:36 +0000 (04:16 +0000)
FossilOrigin-Name: 30699b57d21f70dd42ec61f5157859358c6be5e3e14bb2989f8874ceeda5dae6

autosetup/hwaci-common.tcl
manifest
manifest.uuid

index bab05264f36b42f6816f302e982d9e5eb89a88af..06f3b116456742c85729bfd0aa7bf81895c298b9 100644 (file)
@@ -776,7 +776,13 @@ proc hwaci-check-readline {} {
 }
 
 
-proc hwaci-defs-type- {name spec} {
+########################################################################
+# Internal helper for hwaci-dump-defs-json. Expects to be passed a
+# [define] name and the variadic $args which are passed to
+# hwaci-dump-defs-json. If it finds a pattern match for the given
+# $name in the various $args, it returns the type flag for that $name,
+# e.g. "-str" or "-bare", else returns an empty string.
+proc hwaci-defs-type_ {name spec} {
   foreach {type patterns} $spec {
     foreach pattern $patterns {
       if {[string match $pattern $name]} {
@@ -787,41 +793,48 @@ proc hwaci-defs-type- {name spec} {
   return ""
 }
 
+########################################################################
+# Internal helper for hwaci-defs-format_: returns a JSON-ish quoted
+# form of the given (JSON) string-type values.
+proc hwaci-quote-str_ {value} {
+  return \"[string map [list \\ \\\\ \" \\\"] $value]\"
+}
+
 ########################################################################
 # An internal impl detail of hwaci-dump-defs-json. Requires a data
 # type specifier, as used by make-config-header, and a value. Returns
-# the formatted value or the value $::hwaci(defs-skip) if the
-# caller should skip emitting that value.
-set hwaci(defs-skip) "-hwaci-defs-format-skip-"
-proc hwaci-defs-format- {type value} {
+# the formatted value or the value $::hwaci_(defs-skip) if the caller
+# should skip emitting that value.
+set hwaci_(defs-skip) "-hwaci-defs-format_ sentinel"
+proc hwaci-defs-format_ {type value} {
   switch -exact -- $type {
     -bare {
       # Just output the value unchanged
     }
     -none {
-      set value $::hwaci(defs-skip)
+      set value $::hwaci_(defs-skip)
     }
     -str {
-      #set value \"[string map [list \\ \\\\ \" \\\"] $value]\"
+      set value [hwaci-quote-str_ $value]
     }
     -auto {
       # Automatically determine the type
       if {![string is integer -strict $value]} {
-        set value \"[string map [list \\ \\\\ \" \\\"] $value]\"
+        set value [hwaci-quote-str_ $value]
       }
     }
     -array {
       set ar {}
       foreach v $value {
-        set v [hwaci-defs-format- -auto $v]
-        if {$::hwaci(defs-skip) ne $v} {
+        set v [hwaci-defs-format_ -auto $v]
+        if {$::hwaci_(defs-skip) ne $v} {
           lappend ar $v
         }
       }
       set value "\[ [join $ar {, }] \]"
     }
     "" {
-      set value $::hwaci(defs-skip)
+      set value $::hwaci_(defs-skip)
     }
     default {
       hwaci-fatal "Unknown type in hwaci-dump-defs-json: $type"
@@ -865,9 +878,9 @@ proc hwaci-dump-defs-json {file args} {
   set lines {}
   lappend args -bare {SIZEOF_* HAVE_DECL_*} -auto HAVE_*
   foreach n [lsort [dict keys [all-defines]]] {
-    set type [hwaci-defs-type- $n $args]
-    set value [hwaci-defs-format- $type [get-define $n]]
-    if {$::hwaci(defs-skip) ne $value} {
+    set type [hwaci-defs-type_ $n $args]
+    set value [hwaci-defs-format_ $type [get-define $n]]
+    if {$::hwaci_(defs-skip) ne $value} {
       lappend lines "\"$n\": ${value}"
     }
   }
index a40fd468aa1655ad4830c2cf9f1fdfb318b1fbba..5e84a206cf5333c4d5d6c989950845347b4f8cf1 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Docs\srelated\sto\sthe\s-array\sdefs-dump\soption.\sRename\ssome\sinternal-use\shwaci-common.tcl\sAPIs\safter\sdiscovering\sthat\sa\s-\sas\sa\ssymbol\ssuffix\sfails\sfor\svar\sderefs\s(but\sworks\sfor\sprocs\scalls).
-D 2024-10-25T03:56:09.158
+C Internal\scleanups\sand\sdocs\sin\shwaci-common.tcl.
+D 2024-10-25T04:16:36.966
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -47,7 +47,7 @@ F autosetup/cc-lib.tcl 493c5935b5dd3bf9bd4eca89b07c8b1b1a9356d61783035144e21795f
 F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1de1e5460d78
 F autosetup/cc.tcl 7e2fe943ae9d45cf39e9f5b05b6230df8e719415edea5af06c30eb68680bde14
 F autosetup/default.auto 5cdf016de2140e50f1db190a02039dc42fb390af1dda4cc4853e3042a9ef0e82
-F autosetup/hwaci-common.tcl 3f1653580ed9256c186c14264e50f8d7fb03e5a21b1790fccad173515d162b2a
+F autosetup/hwaci-common.tcl 97b55f68dd190e624340ced9c2de16286edad9db95fede4a184af4249561b4bb
 F autosetup/jimsh0.c eb49d62a5b28b4d3b2af10cdfa5dc972ed76e8474fd773cdc7266e768c746f6d
 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba
 F autosetup/system.tcl 3a39d6e0b3bfba526fd39afe07c1d0d325e5a31925013a1ba7c671e1128e31bb
@@ -2237,8 +2237,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P ce6bc4603c27952ca44ff55c81dd50a04b0f6ef8f198720ee0da3aff4c291449
-R 38a7ffa837a034a8e4135985ac058125
+P 0d5da3888e79166fec560554a921e2ef4290558e988144465f1ea7138ca263a3
+R 3df9a97de38801cc8ea2ce03eb6935ab
 U stephan
-Z 7fac80295cd944d4b161bf97831f53d2
+Z c1a5ed21a5f202d16f8c6f337f6da0c7
 # Remove this line to create a well-formed Fossil manifest.
index f8dd8bc4e753b88ea04be21d307974a56cc293ce..0016dc7576b0b3ae3a582131422bf95a34767192 100644 (file)
@@ -1 +1 @@
-0d5da3888e79166fec560554a921e2ef4290558e988144465f1ea7138ca263a3
+30699b57d21f70dd42ec61f5157859358c6be5e3e14bb2989f8874ceeda5dae6