/ Check-in [ec490336]
Login

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

Overview
Comment:Include the sqlite3session.h header file in with sqlite3.h. Make sure the session APIs are all public.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sessions
Files: files | file ages | folders
SHA1: ec490336bc6629d3910667ece1bbc4685a199546
User & Date: drh 2013-03-19 15:23:18
Context
2013-03-19
17:10
Also export the sqlite3changeset interfaces in the amalgamated version of the sessions extension. check-in: 5b399f2b user: drh tags: sessions
15:23
Include the sqlite3session.h header file in with sqlite3.h. Make sure the session APIs are all public. check-in: ec490336 user: drh tags: sessions
2013-03-18
16:24
Adjust the MSVC makefile so that it correctly handles the sessions extension being included in the amalgamation. Import the test case changes that appeared in 3.7.16 final. check-in: 9bac09a9 user: drh tags: sessions
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Makefile.in.

   524    524   	rm tsrc/sqlite.h.in tsrc/parse.y
   525    525   	$(TCLSH_CMD) $(TOP)/tool/vdbe-compress.tcl <tsrc/vdbe.c >vdbe.new
   526    526   	mv vdbe.new tsrc/vdbe.c
   527    527   	touch .target_source
   528    528   
   529    529   sqlite3.c:	.target_source $(TOP)/tool/mksqlite3c.tcl
   530    530   	$(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl
          531  +	cp tsrc/shell.c tsrc/sqlite3ext.h .
          532  +	cp $(TOP)/ext/session/sqlite3session.h .
   531    533   
   532    534   tclsqlite3.c:	sqlite3.c
   533    535   	echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
   534    536   	cat sqlite3.c >>tclsqlite3.c
   535    537   	echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
   536    538   	cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
   537    539   
................................................................................
   886    888   #
   887    889   TESTFIXTURE_FLAGS  = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
   888    890   TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE 
   889    891   TESTFIXTURE_FLAGS += -DBUILD_sqlite
   890    892   
   891    893   TESTFIXTURE_SRC0 = $(TESTSRC2) libsqlite3.la
   892    894   TESTFIXTURE_SRC1 = sqlite3.c
   893         -TESTFIXTURE_SRC = $(TESTSRC) $(TOP)/src/tclsqlite.c $(TESTFIXTURE_SRC$(USE_AMALGAMATION))
          895  +TESTFIXTURE_SRC = $(TESTSRC) $(TOP)/src/tclsqlite.c
          896  +TESTFIXTURE_SRC += $(TESTFIXTURE_SRC$(USE_AMALGAMATION))
   894    897   
   895    898   testfixture$(TEXE):	$(TESTFIXTURE_SRC)
   896    899   	$(LTLINK) -DSQLITE_NO_SYNC=1 $(TEMP_STORE) $(TESTFIXTURE_FLAGS) \
   897    900   		-o $@ $(TESTFIXTURE_SRC) $(LIBTCL) $(TLIBS)
   898    901   
   899    902   
   900    903   fulltest:	testfixture$(TEXE) sqlite3$(TEXE)

Changes to Makefile.msc.

   845    845   	del /Q tsrc\sqlite.h.in tsrc\parse.y
   846    846   	$(TCLSH_CMD) $(TOP)\tool\vdbe-compress.tcl < tsrc\vdbe.c > vdbe.new
   847    847   	move vdbe.new tsrc\vdbe.c
   848    848   	echo > .target_source
   849    849   
   850    850   sqlite3.c:	.target_source $(TOP)\tool\mksqlite3c.tcl
   851    851   	$(TCLSH_CMD) $(TOP)\tool\mksqlite3c.tcl
          852  +	copy tsrc\shell.c .
          853  +	copy tsrc\sqlite3ext.h .
          854  +	copy $(TOP)\ext\session\sqlite3session.h .
   852    855   
   853    856   sqlite3-all.c:	sqlite3.c $(TOP)\tool\split-sqlite3c.tcl
   854    857   	$(TCLSH_CMD) $(TOP)\tool\split-sqlite3c.tcl
   855    858   
   856    859   # Rule to build the amalgamation
   857    860   #
   858    861   sqlite3.lo:	sqlite3.c

Changes to main.mk.

   387    387   	rm tsrc/sqlite.h.in tsrc/parse.y
   388    388   	tclsh $(TOP)/tool/vdbe-compress.tcl <tsrc/vdbe.c >vdbe.new
   389    389   	mv vdbe.new tsrc/vdbe.c
   390    390   	touch target_source
   391    391   
   392    392   sqlite3.c:	target_source $(TOP)/tool/mksqlite3c.tcl
   393    393   	tclsh $(TOP)/tool/mksqlite3c.tcl
          394  +	cp tsrc/shell.c tsrc/sqlite3ext.h .
          395  +	cp $(TOP)/ext/session/sqlite3session.h .
   394    396   	echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
   395    397   	cat sqlite3.c >>tclsqlite3.c
   396    398   	echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c
   397    399   	cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
   398    400   
   399    401   sqlite3.c-debug:	target_source $(TOP)/tool/mksqlite3c.tcl
   400    402   	tclsh $(TOP)/tool/mksqlite3c.tcl --linemacros
................................................................................
   554    556   TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE 
   555    557   
   556    558   testfixture$(EXE): $(TESTSRC2) libsqlite3.a $(TESTSRC) $(TOP)/src/tclsqlite.c
   557    559   	$(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS)                  \
   558    560   		$(TESTSRC) $(TESTSRC2) $(TOP)/src/tclsqlite.c                \
   559    561   		-o testfixture$(EXE) $(LIBTCL) libsqlite3.a $(THREADLIB)
   560    562   
   561         -amalgamation-testfixture$(EXE): sqlite3.c $(TESTSRC) $(TOP)/src/tclsqlite.c
          563  +amalgamation-testfixture$(EXE): sqlite3.c $(TESTSRC) $(TOP)/src/tclsqlite.c  \
          564  +				$(TOP)/ext/session/test_session.c
   562    565   	$(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS)                  \
   563    566   		$(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c                  \
          567  +		$(TOP)/ext/session/test_session.c                            \
   564    568   		-o testfixture$(EXE) $(LIBTCL) $(THREADLIB)
   565    569   
   566    570   fts3-testfixture$(EXE): sqlite3.c fts3amal.c $(TESTSRC) $(TOP)/src/tclsqlite.c
   567    571   	$(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS)                  \
   568    572   	-DSQLITE_ENABLE_FTS3=1                                               \
   569    573   		$(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c fts3amal.c       \
   570    574   		-o testfixture$(EXE) $(LIBTCL) $(THREADLIB)

Changes to tool/mksqlite3c.tcl.

    19     19   #
    20     20   #      tclsh mksqlite3c.tcl
    21     21   #
    22     22   # The amalgamated SQLite code will be written into sqlite3.c
    23     23   #
    24     24   
    25     25   # Begin by reading the "sqlite3.h" header file.  Extract the version number
    26         -# from in this file.  The versioon number is needed to generate the header
           26  +# from in this file.  The version number is needed to generate the header
    27     27   # comment of the amalgamation.
    28     28   #
    29     29   if {[lsearch $argv --nostatic]>=0} {
    30     30     set addstatic 0
    31     31   } else {
    32     32     set addstatic 1
    33     33   }
................................................................................
   117    117      vdbe.h
   118    118      vdbeInt.h
   119    119      wal.h
   120    120   } {
   121    121     set available_hdr($hdr) 1
   122    122   }
   123    123   set available_hdr(sqliteInt.h) 0
          124  +set available_hdr(sqlite3session.h) 0
   124    125   
   125    126   # 78 stars used for comment formatting.
   126    127   set s78 \
   127    128   {*****************************************************************************}
   128    129   
   129    130   # Insert a comment into the code
   130    131   #
................................................................................
   178    179       } elseif {!$linemacros && [regexp {^#line} $line]} {
   179    180         # Skip #line directives.
   180    181       } elseif {$addstatic && ![regexp {^(static|typedef)} $line]} {
   181    182         regsub {^SQLITE_API } $line {} line
   182    183         if {[regexp $declpattern $line all funcname]} {
   183    184           # Add the SQLITE_PRIVATE or SQLITE_API keyword before functions.
   184    185           # so that linkage can be modified at compile-time.
   185         -        if {[regexp {^sqlite3_} $funcname]} {
          186  +        if {[regexp {^sqlite3(session)?_} $funcname]} {
   186    187             puts $out "SQLITE_API $line"
   187    188           } else {
   188    189             puts $out "SQLITE_PRIVATE $line"
   189    190           }
   190    191         } elseif {[regexp $varpattern $line all varname]} {
   191    192           # Add the SQLITE_PRIVATE before variable declarations or
   192    193           # definitions for internal use

Changes to tool/mksqlite3h.tcl.

    64     64   #
    65     65   set varpattern {^[a-zA-Z][a-zA-Z_0-9 *]+sqlite3_[_a-zA-Z0-9]+(\[|;| =)}
    66     66   set declpattern {^ *[a-zA-Z][a-zA-Z_0-9 ]+ \**sqlite3_[_a-zA-Z0-9]+\(}
    67     67   
    68     68   # Force the output to use unix line endings, even on Windows.
    69     69   fconfigure stdout -translation lf
    70     70   
    71         -# Process the src/sqlite.h.in ext/rtree/sqlite3rtree.h files.
           71  +set filelist [subst {
           72  +  $TOP/src/sqlite.h.in
           73  +  $TOP/ext/rtree/sqlite3rtree.h
           74  +  $TOP/ext/session/sqlite3session.h
           75  +}]
           76  +
           77  +# Process the source files.
    72     78   #
    73         -foreach file [list $TOP/src/sqlite.h.in $TOP/ext/rtree/sqlite3rtree.h] {
           79  +foreach file $filelist {
    74     80     set in [open $file]
    75     81     while {![eof $in]} {
    76     82     
    77     83       set line [gets $in]
    78     84   
    79     85       # File sqlite3rtree.h contains a line "#include <sqlite3.h>". Omit this
    80     86       # line when copying sqlite3rtree.h into sqlite3.h.