/ Check-in [803ec79f]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Modify mksqlite3c.tcl so that it inserts SQLITE_API macros into sqlite3.h. Ticket #3983. (CVS 6924)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 803ec79f3b05fdd680f9ab762685bbd50a087b9b
User & Date: danielk1977 2009-07-22 18:24:54
Context
2009-07-23
01:44
Simplifications and comment enhancements on btree.c. (CVS 6925) check-in: 5ba880dd user: drh tags: trunk
2009-07-22
18:24
Modify mksqlite3c.tcl so that it inserts SQLITE_API macros into sqlite3.h. Ticket #3983. (CVS 6924) check-in: 803ec79f user: danielk1977 tags: trunk
18:07
Simplifications to btree.c in support of coverage testing. (CVS 6923) check-in: 375fd6f9 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tool/mksqlite3c.tcl.

300
301
302
303
304
305
306


































   icu.c
   fts3_icu.c
} {
  copy_file tsrc/$file
}

close $out









































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
   icu.c
   fts3_icu.c
} {
  copy_file tsrc/$file
}

close $out

# This block overwrites the copy of sqlite3.h in the current directory.
#
# It copies tsrc/sqlite3.h to ./sqlite3.h, adding SQLITE_API in front of the
# API functions and global variables as it goes. 
#
set fd_in [open tsrc/sqlite3.h r]
set fd_out [open sqlite3.h w]
while {![eof $fd_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]+\(}

  set line [gets $fd_in]
  if {[regexp {define SQLITE_EXTERN extern} $line]} {
    puts $fd_out $line
    puts $fd_out [gets $fd_in]
    puts $fd_out ""
    puts $fd_out "#ifndef SQLITE_API"
    puts $fd_out "# define SQLITE_API"
    puts $fd_out "#endif"
    set line ""
  }

  if {([regexp $varpattern $line] && ![regexp {^ *typedef} $line])
   || ([regexp $declpattern $line])
  } {
    set line "SQLITE_API $line"
  }
  puts $fd_out $line
}
close $fd_out
close $fd_in