summaryrefslogtreecommitdiffstats
path: root/tool/extract-sqlite3h.tcl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 17:28:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 17:28:19 +0000
commit18657a960e125336f704ea058e25c27bd3900dcb (patch)
tree17b438b680ed45a996d7b59951e6aa34023783f2 /tool/extract-sqlite3h.tcl
parentInitial commit. (diff)
downloadsqlite3-18657a960e125336f704ea058e25c27bd3900dcb.tar.xz
sqlite3-18657a960e125336f704ea058e25c27bd3900dcb.zip
Adding upstream version 3.40.1.upstream/3.40.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tool/extract-sqlite3h.tcl')
-rwxr-xr-xtool/extract-sqlite3h.tcl21
1 files changed, 21 insertions, 0 deletions
diff --git a/tool/extract-sqlite3h.tcl b/tool/extract-sqlite3h.tcl
new file mode 100755
index 0000000..a0f7c4e
--- /dev/null
+++ b/tool/extract-sqlite3h.tcl
@@ -0,0 +1,21 @@
+#!/usr/bin/tclsh
+#
+# Given an sqlite3.c source file identified by the command-line
+# argument, extract the "sqlite3.h" header file that is embedded inside
+# the sqlite3.c source file and write it to standard output.
+#
+if {[llength $argv]!=1} {
+ puts stderr "Usage: $argv0 sqlite3.c >sqlite3.h"
+ exit 1
+}
+set in [open [lindex $argv 0] rb]
+while {![eof $in]} {
+ set line [gets $in]
+ if {[string match {* Begin file sqlite3.h *} $line]} break
+}
+while {![eof $in]} {
+ set line [gets $in]
+ if {[string match {* End of sqlite3.h *} $line]} break
+ puts $line
+}
+close $in