File: extract-sqlite3h.tcl

package info (click to toggle)
sqlite3 3.34.1-3
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 137,536 kB
  • sloc: ansic: 255,567; tcl: 18,916; sh: 11,374; yacc: 1,528; makefile: 1,282; cpp: 440; cs: 307; javascript: 92
file content (21 lines) | stat: -rwxr-xr-x 571 bytes parent folder | download | duplicates (23)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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