1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-01-06 08:01:16 +03:00

Add a script to tool/ that will extract the sqlite3.h header file from an

sqlite3.c amalgamation.

FossilOrigin-Name: 38d2e510cdedf38153466b161c0842b1604aef7b5589c51f628ae7cbb6a8722a
This commit is contained in:
drh
2019-03-05 16:53:16 +00:00
parent 7bf3133fef
commit 91ed9ce0dd
3 changed files with 28 additions and 6 deletions

21
tool/extract-sqlite3h.tcl Executable file
View File

@@ -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