Snapshot of upstream SQLite 3.34.1
[sqlcipher.git] / tool / extract-sqlite3h.tcl
bloba0f7c4e3898e6bf9d1b5fb348c14abb56bfb19ec
1 #!/usr/bin/tclsh
3 # Given an sqlite3.c source file identified by the command-line
4 # argument, extract the "sqlite3.h" header file that is embedded inside
5 # the sqlite3.c source file and write it to standard output.
7 if {[llength $argv]!=1} {
8 puts stderr "Usage: $argv0 sqlite3.c >sqlite3.h"
9 exit 1
11 set in [open [lindex $argv 0] rb]
12 while {![eof $in]} {
13 set line [gets $in]
14 if {[string match {* Begin file sqlite3.h *} $line]} break
16 while {![eof $in]} {
17 set line [gets $in]
18 if {[string match {* End of sqlite3.h *} $line]} break
19 puts $line
21 close $in