summaryrefslogtreecommitdiffstats
path: root/tool/extract-sqlite3h.tcl
diff options
context:
space:
mode:
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