summaryrefslogtreecommitdiffstats
path: root/third_party/sqlite/src/tool/mksqlite3h.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/sqlite/src/tool/mksqlite3h.tcl')
-rw-r--r--third_party/sqlite/src/tool/mksqlite3h.tcl55
1 files changed, 31 insertions, 24 deletions
diff --git a/third_party/sqlite/src/tool/mksqlite3h.tcl b/third_party/sqlite/src/tool/mksqlite3h.tcl
index 58fe8a8..88dc8df 100644
--- a/third_party/sqlite/src/tool/mksqlite3h.tcl
+++ b/third_party/sqlite/src/tool/mksqlite3h.tcl
@@ -65,32 +65,39 @@ close $in
set varpattern {^[a-zA-Z][a-zA-Z_0-9 *]+sqlite3_[_a-zA-Z0-9]+(\[|;| =)}
set declpattern {^ *[a-zA-Z][a-zA-Z_0-9 ]+ \**sqlite3_[_a-zA-Z0-9]+\(}
-# Process the src/sqlite.h.in file.
+# Process the src/sqlite.h.in ext/rtree/sqlite3rtree.h files.
#
-set in [open $TOP/src/sqlite.h.in]
-while {![eof $in]} {
-
- set line [gets $in]
-
- regsub -- --VERS-- $line $zVersion line
- regsub -- --VERSION-NUMBER-- $line $nVersion line
- regsub -- --SOURCE-ID-- $line "$zDate $zUuid" line
+foreach file [list $TOP/src/sqlite.h.in $TOP/ext/rtree/sqlite3rtree.h] {
+ set in [open $file]
+ while {![eof $in]} {
+
+ set line [gets $in]
- if {[regexp {define SQLITE_EXTERN extern} $line]} {
+ # File sqlite3rtree.h contains a line "#include <sqlite3.h>". Omit this
+ # line when copying sqlite3rtree.h into sqlite3.h.
+ #
+ if {[string match {*#include*<sqlite3.h>*} $line]} continue
+
+ regsub -- --VERS-- $line $zVersion line
+ regsub -- --VERSION-NUMBER-- $line $nVersion line
+ regsub -- --SOURCE-ID-- $line "$zDate $zUuid" line
+
+ if {[regexp {define SQLITE_EXTERN extern} $line]} {
+ puts $line
+ puts [gets $in]
+ puts ""
+ puts "#ifndef SQLITE_API"
+ puts "# define SQLITE_API"
+ puts "#endif"
+ set line ""
+ }
+
+ if {([regexp $varpattern $line] && ![regexp {^ *typedef} $line])
+ || ([regexp $declpattern $line])
+ } {
+ set line "SQLITE_API $line"
+ }
puts $line
- puts [gets $in]
- puts ""
- puts "#ifndef SQLITE_API"
- puts "# define SQLITE_API"
- puts "#endif"
- set line ""
}
-
- if {([regexp $varpattern $line] && ![regexp {^ *typedef} $line])
- || ([regexp $declpattern $line])
- } {
- set line "SQLITE_API $line"
- }
- puts $line
+ close $in
}
-close $in