/ Check-in [57e17c7c]
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:Add a --nostatic option to mksqlite3c.tcl. With this option turned on, the extra "static" storage class markers are not inserted into the amalgamation. (CVS 4013)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 57e17c7cda23a3b3e1d0a691af07c35c1c644dcc
User & Date: drh 2007-05-16 13:55:26
Context
2007-05-16
14:23
Omit some extra code when OMIT_INCRBLOB is defined. (CVS 4014) check-in: 1d89be28 user: danielk1977 tags: trunk
13:55
Add a --nostatic option to mksqlite3c.tcl. With this option turned on, the extra "static" storage class markers are not inserted into the amalgamation. (CVS 4013) check-in: 57e17c7c user: drh tags: trunk
11:55
Keep the full precision of integers if possible when casting to "numeric". Ticket #2364. (CVS 4012) check-in: 2ac985a3 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to tool/mksqlite3c.tcl.

22
23
24
25
26
27
28





29
30
31
32
33
34
35
...
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
...
136
137
138
139
140
141
142

143
144
145
146
147
148
149
150
...
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# The amalgamated SQLite code will be written into sqlite3.c
#

# Begin by reading the "sqlite3.h" header file.  Count the number of lines
# in this file and extract the version number.  That information will be
# needed in order to generate the header of the amalgamation.
#





set in [open tsrc/sqlite3.h]
set cnt 0
set VERSION ?????
while {![eof $in]} {
  set line [gets $in]
  if {$line=="" && [eof $in]} break
  incr cnt
................................................................................
}

# Read the source file named $filename and write it into the
# sqlite3.c output file.  If any #include statements are seen,
# process them approprately.
#
proc copy_file {filename} {
  global seen_hdr available_hdr out
  set tail [file tail $filename]
  section_comment "Begin file $tail"
  set in [open $filename r]
  if {[file extension $filename]==".h"} {
    set declpattern {^ *[a-zA-Z][a-zA-Z_0-9 ]+ \*?sqlite3[A-Z][a-zA-Z0-9]+\(}
  } else {
    set declpattern {^[a-zA-Z][a-zA-Z_0-9 ]+ \*?sqlite3[A-Z][a-zA-Z0-9]+\(}
................................................................................
        set seen_hdr($hdr) 1
        puts $out $line
      }
    } elseif {[regexp {^#ifdef __cplusplus} $line]} {
      puts $out "#if 0"
    } elseif {[regexp {^#line} $line]} {
      # Skip #line directives.

    } elseif {[regexp $declpattern $line] && ![regexp {^static} $line]} {
      # Add the "static" keyword before internal functions.
      puts $out "static $line"
    } else {
      puts $out $line
    }
  }
  close $in
................................................................................
   tokenize.c

   main.c
} {
  copy_file tsrc/$file
}

if 0 {
puts $out "#ifdef SQLITE_TEST"
foreach file {
   test1.c
   test2.c
   test3.c
   test4.c
   test5.c
   test6.c
   test7.c
   test8.c
   test_async.c
   test_autoext.c
   test_loadext.c
   test_md5.c
   test_schema.c
   test_server.c
   test_tclvar.c
} {
  copy_file ../sqlite/src/$file
}
puts $out "#endif /* SQLITE_TEST */"
puts $out "#ifdef SQLITE_TCL"
copy_file ../sqlite/src/tclsqlite.c
puts $out "#endif /* SQLITE_TCL */"
}

close $out







>
>
>
>
>







 







|







 







>
|







 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
...
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
...
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
...
219
220
221
222
223
224
225



























226
# The amalgamated SQLite code will be written into sqlite3.c
#

# Begin by reading the "sqlite3.h" header file.  Count the number of lines
# in this file and extract the version number.  That information will be
# needed in order to generate the header of the amalgamation.
#
if {[lsearch $argv --nostatic]>=0} {
  set addstatic 0
} else {
  set addstatic 1
}
set in [open tsrc/sqlite3.h]
set cnt 0
set VERSION ?????
while {![eof $in]} {
  set line [gets $in]
  if {$line=="" && [eof $in]} break
  incr cnt
................................................................................
}

# Read the source file named $filename and write it into the
# sqlite3.c output file.  If any #include statements are seen,
# process them approprately.
#
proc copy_file {filename} {
  global seen_hdr available_hdr out addstatic
  set tail [file tail $filename]
  section_comment "Begin file $tail"
  set in [open $filename r]
  if {[file extension $filename]==".h"} {
    set declpattern {^ *[a-zA-Z][a-zA-Z_0-9 ]+ \*?sqlite3[A-Z][a-zA-Z0-9]+\(}
  } else {
    set declpattern {^[a-zA-Z][a-zA-Z_0-9 ]+ \*?sqlite3[A-Z][a-zA-Z0-9]+\(}
................................................................................
        set seen_hdr($hdr) 1
        puts $out $line
      }
    } elseif {[regexp {^#ifdef __cplusplus} $line]} {
      puts $out "#if 0"
    } elseif {[regexp {^#line} $line]} {
      # Skip #line directives.
    } elseif {$addstatic && [regexp $declpattern $line] 
                  && ![regexp {^static} $line]} {
      # Add the "static" keyword before internal functions.
      puts $out "static $line"
    } else {
      puts $out $line
    }
  }
  close $in
................................................................................
   tokenize.c

   main.c
} {
  copy_file tsrc/$file
}




























close $out