Overview
| SHA1 Hash: | 86633e01fec2cbc00c749f6ef6ecda6acad2a82e |
|---|---|
| Date: | 2012-10-03 18:20:02 |
| User: | drh |
| Comment: | A branch off of the sessions branch corresponding to release 3.7.14. |
Tags And Properties
- bgcolor cancelled by [d768883948] on 2012-10-03 18:21:45
- branch=sessions-3.7.14 propagates to descendants
- sym-sessions cancelled
- sym-sessions-3.7.14 propagates to descendants
Changes
Changes to Makefile.msc
77 # Check for the command macro LD. This should point to the linker binary for 77 # Check for the command macro LD. This should point to the linker binary for 78 # the target platform. If it is not defined, simply define it to the legacy 78 # the target platform. If it is not defined, simply define it to the legacy 79 # default value 'link.exe'. 79 # default value 'link.exe'. 80 # 80 # 81 !IFNDEF LD 81 !IFNDEF LD 82 LD = link.exe 82 LD = link.exe 83 !ENDIF 83 !ENDIF > 84 > 85 # Check for the predefined command macro RC. This should point to the resource > 86 # compiler binary for the target platform. If it is not defined, simply define > 87 # it to the legacy default value 'rc.exe'. > 88 # > 89 !IFNDEF RC > 90 RC = rc.exe > 91 !ENDIF 84 92 85 # Check for the command macro NCC. This should point to the compiler binary 93 # Check for the command macro NCC. This should point to the compiler binary 86 # for the platform the compilation process is taking place on. If it is not 94 # for the platform the compilation process is taking place on. If it is not 87 # defined, simply define it to have the same value as the CC macro. When 95 # defined, simply define it to have the same value as the CC macro. When 88 # cross-compiling, it is suggested that this macro be modified via the command 96 # cross-compiling, it is suggested that this macro be modified via the command 89 # line (since nmake itself does not provide a built-in method to guess it). 97 # line (since nmake itself does not provide a built-in method to guess it). 90 # For example, to use the x86 compiler when cross-compiling for x64, a command 98 # For example, to use the x86 compiler when cross-compiling for x64, a command ................................................................................................................................................................................ 146 !ENDIF 154 !ENDIF 147 155 148 # C compiler and options for use in building executables that 156 # C compiler and options for use in building executables that 149 # will run on the target platform. (BCC and TCC are usually the 157 # will run on the target platform. (BCC and TCC are usually the 150 # same unless your are cross-compiling.) 158 # same unless your are cross-compiling.) 151 # 159 # 152 TCC = $(CC) -W3 -DSQLITE_OS_WIN=1 -I. -I$(TOP)\src -fp:precise 160 TCC = $(CC) -W3 -DSQLITE_OS_WIN=1 -I. -I$(TOP)\src -fp:precise > 161 RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP)\src 153 162 154 # When compiling the library for use in the WinRT environment, 163 # When compiling the library for use in the WinRT environment, 155 # the following compile-time options must be used as well to 164 # the following compile-time options must be used as well to 156 # disable use of Win32 APIs that are not available and to enable 165 # disable use of Win32 APIs that are not available and to enable 157 # use of Win32 APIs that are specific to Windows 8 and/or WinRT. 166 # use of Win32 APIs that are specific to Windows 8 and/or WinRT. 158 # 167 # 159 !IF $(FOR_WINRT)!=0 168 !IF $(FOR_WINRT)!=0 160 TCC = $(TCC) -DSQLITE_OS_WINRT=1 169 TCC = $(TCC) -DSQLITE_OS_WINRT=1 > 170 RCC = $(RCC) -DSQLITE_OS_WINRT=1 161 TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_PARTITION_APP 171 TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_PARTITION_APP > 172 RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_PARTITION_APP 162 !ENDIF 173 !ENDIF 163 174 164 # Also, we need to dynamically link to the correct MSVC runtime 175 # Also, we need to dynamically link to the correct MSVC runtime 165 # when compiling for WinRT (e.g. debug or release) OR if the 176 # when compiling for WinRT (e.g. debug or release) OR if the 166 # USE_CRT_DLL option is set to force dynamically linking to the 177 # USE_CRT_DLL option is set to force dynamically linking to the 167 # MSVC runtime library. 178 # MSVC runtime library. 168 # 179 # ................................................................................................................................................................................ 182 193 183 # The mksqlite3c.tcl and mksqlite3h.tcl scripts will pull in 194 # The mksqlite3c.tcl and mksqlite3h.tcl scripts will pull in 184 # any extension header files by default. For non-amalgamation 195 # any extension header files by default. For non-amalgamation 185 # builds, we need to make sure the compiler can find these. 196 # builds, we need to make sure the compiler can find these. 186 # 197 # 187 !IF $(USE_AMALGAMATION)==0 198 !IF $(USE_AMALGAMATION)==0 188 TCC = $(TCC) -I$(TOP)\ext\fts3 199 TCC = $(TCC) -I$(TOP)\ext\fts3 > 200 RCC = $(RCC) -I$(TOP)\ext\fts3 189 TCC = $(TCC) -I$(TOP)\ext\rtree 201 TCC = $(TCC) -I$(TOP)\ext\rtree > 202 RCC = $(RCC) -I$(TOP)\ext\rtree 190 !ENDIF 203 !ENDIF 191 204 192 # Define -DNDEBUG to compile without debugging (i.e., for production usage) 205 # Define -DNDEBUG to compile without debugging (i.e., for production usage) 193 # Omitting the define will cause extra debugging code to be inserted and 206 # Omitting the define will cause extra debugging code to be inserted and 194 # includes extra comments when "EXPLAIN stmt" is used. 207 # includes extra comments when "EXPLAIN stmt" is used. 195 # 208 # 196 !IF $(DEBUG)==0 209 !IF $(DEBUG)==0 197 TCC = $(TCC) -DNDEBUG 210 TCC = $(TCC) -DNDEBUG 198 BCC = $(BCC) -DNDEBUG 211 BCC = $(BCC) -DNDEBUG > 212 RCC = $(RCC) -DNDEBUG 199 !ENDIF 213 !ENDIF 200 214 201 !IF $(DEBUG)>1 215 !IF $(DEBUG)>1 202 TCC = $(TCC) -DSQLITE_DEBUG 216 TCC = $(TCC) -DSQLITE_DEBUG > 217 RCC = $(RCC) -DSQLITE_DEBUG 203 !ENDIF 218 !ENDIF 204 219 205 !IF $(DEBUG)>3 220 !IF $(DEBUG)>3 206 TCC = $(TCC) -DSQLITE_DEBUG_OS_TRACE=1 221 TCC = $(TCC) -DSQLITE_DEBUG_OS_TRACE=1 > 222 RCC = $(RCC) -DSQLITE_DEBUG_OS_TRACE=1 207 !ENDIF 223 !ENDIF 208 224 209 !IF $(DEBUG)>4 225 !IF $(DEBUG)>4 210 TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE 226 TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE > 227 RCC = $(RCC) -DSQLITE_ENABLE_IOTRACE 211 !ENDIF 228 !ENDIF 212 229 213 # 230 # 214 # Prevent warnings about "insecure" MSVC runtime library functions 231 # Prevent warnings about "insecure" MSVC runtime library functions 215 # being used. 232 # being used. 216 # 233 # 217 TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS 234 TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS 218 BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS 235 BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS > 236 RCC = $(RCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS 219 237 220 # 238 # 221 # Prevent warnings about "deprecated" POSIX functions being used. 239 # Prevent warnings about "deprecated" POSIX functions being used. 222 # 240 # 223 TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS 241 TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS 224 BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS 242 BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS > 243 RCC = $(RCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS 225 244 226 # 245 # 227 # Use the SQLite debugging heap subsystem? 246 # Use the SQLite debugging heap subsystem? 228 # 247 # 229 !IF $(MEMDEBUG)!=0 248 !IF $(MEMDEBUG)!=0 230 TCC = $(TCC) -DSQLITE_MEMDEBUG=1 249 TCC = $(TCC) -DSQLITE_MEMDEBUG=1 > 250 RCC = $(RCC) -DSQLITE_MEMDEBUG=1 231 251 232 # 252 # 233 # Use native Win32 heap subsystem instead of malloc/free? 253 # Use native Win32 heap subsystem instead of malloc/free? 234 # 254 # 235 !ELSEIF $(WIN32HEAP)!=0 255 !ELSEIF $(WIN32HEAP)!=0 236 TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1 256 TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1 > 257 RCC = $(RCC) -DSQLITE_WIN32_MALLOC=1 237 258 238 # 259 # 239 # Validate the heap on every call into the native Win32 heap subsystem? 260 # Validate the heap on every call into the native Win32 heap subsystem? 240 # 261 # 241 !IF $(DEBUG)>2 262 !IF $(DEBUG)>2 242 TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1 263 TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1 > 264 RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1 243 !ENDIF 265 !ENDIF 244 !ENDIF 266 !ENDIF 245 267 246 # The locations of the Tcl header and library files. Also, the library that 268 # The locations of the Tcl header and library files. Also, the library that 247 # non-stubs enabled programs using Tcl must link against. These variables 269 # non-stubs enabled programs using Tcl must link against. These variables 248 # (TCLINCDIR, TCLLIBDIR, and LIBTCL) may be overridden via the environment 270 # (TCLINCDIR, TCLLIBDIR, and LIBTCL) may be overridden via the environment 249 # prior to running nmake in order to match the actual installed location and 271 # prior to running nmake in order to match the actual installed location and ................................................................................................................................................................................ 294 # The library that programs using readline() must link against. 316 # The library that programs using readline() must link against. 295 # 317 # 296 LIBREADLINE = 318 LIBREADLINE = 297 319 298 # Should the database engine be compiled threadsafe 320 # Should the database engine be compiled threadsafe 299 # 321 # 300 TCC = $(TCC) -DSQLITE_THREADSAFE=1 322 TCC = $(TCC) -DSQLITE_THREADSAFE=1 > 323 RCC = $(RCC) -DSQLITE_THREADSAFE=1 301 324 302 # Do threads override each others locks by default (1), or do we test (-1) 325 # Do threads override each others locks by default (1), or do we test (-1) 303 # 326 # 304 TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1 327 TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1 > 328 RCC = $(RCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1 305 329 306 # Any target libraries which libsqlite must be linked against 330 # Any target libraries which libsqlite must be linked against 307 # 331 # 308 !IFNDEF TLIBS 332 !IFNDEF TLIBS 309 TLIBS = 333 TLIBS = 310 !ENDIF 334 !ENDIF 311 335 ................................................................................................................................................................................ 312 # Flags controlling use of the in memory btree implementation 336 # Flags controlling use of the in memory btree implementation 313 # 337 # 314 # SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to 338 # SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to 315 # default to file, 2 to default to memory, and 3 to force temporary 339 # default to file, 2 to default to memory, and 3 to force temporary 316 # tables to always be in memory. 340 # tables to always be in memory. 317 # 341 # 318 TCC = $(TCC) -DSQLITE_TEMP_STORE=1 342 TCC = $(TCC) -DSQLITE_TEMP_STORE=1 > 343 RCC = $(RCC) -DSQLITE_TEMP_STORE=1 319 344 320 # Enable/disable loadable extensions, and other optional features 345 # Enable/disable loadable extensions, and other optional features 321 # based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*). 346 # based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*). 322 # The same set of OMIT and ENABLE flags should be passed to the 347 # The same set of OMIT and ENABLE flags should be passed to the 323 # LEMON parser generator and the mkkeywordhash tool as well. 348 # LEMON parser generator and the mkkeywordhash tool as well. 324 349 325 # BEGIN standard options 350 # BEGIN standard options ................................................................................................................................................................................ 331 # END standard options 356 # END standard options 332 357 333 # BEGIN required Windows option 358 # BEGIN required Windows option 334 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100 359 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100 335 # END required Windows option 360 # END required Windows option 336 361 337 TCC = $(TCC) $(OPT_FEATURE_FLAGS) 362 TCC = $(TCC) $(OPT_FEATURE_FLAGS) > 363 RCC = $(RCC) $(OPT_FEATURE_FLAGS) 338 364 339 # Add in any optional parameters specified on the make commane line 365 # Add in any optional parameters specified on the make commane line 340 # ie. make "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1". 366 # ie. make "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1". 341 TCC = $(TCC) $(OPTS) 367 TCC = $(TCC) $(OPTS) > 368 RCC = $(RCC) $(OPTS) 342 369 343 # If symbols are enabled, enable PDBs. 370 # If symbols are enabled, enable PDBs. 344 # If debugging is enabled, disable all optimizations and enable PDBs. 371 # If debugging is enabled, disable all optimizations and enable PDBs. 345 !IF $(DEBUG)>0 372 !IF $(DEBUG)>0 346 TCC = $(TCC) -Od -D_DEBUG 373 TCC = $(TCC) -Od -D_DEBUG 347 BCC = $(BCC) -Od -D_DEBUG 374 BCC = $(BCC) -Od -D_DEBUG > 375 RCC = $(RCC) -D_DEBUG 348 !ELSE 376 !ELSE 349 TCC = $(TCC) -O2 377 TCC = $(TCC) -O2 350 BCC = $(BCC) -O2 378 BCC = $(BCC) -O2 351 !ENDIF 379 !ENDIF 352 380 353 !IF $(DEBUG)>0 || $(SYMBOLS)!=0 381 !IF $(DEBUG)>0 || $(SYMBOLS)!=0 354 TCC = $(TCC) -Zi 382 TCC = $(TCC) -Zi 355 BCC = $(BCC) -Zi 383 BCC = $(BCC) -Zi 356 !ENDIF 384 !ENDIF 357 385 358 # If ICU support is enabled, add the compiler options for it. 386 # If ICU support is enabled, add the compiler options for it. 359 !IF $(USE_ICU)!=0 387 !IF $(USE_ICU)!=0 360 TCC = $(TCC) -DSQLITE_ENABLE_ICU=1 388 TCC = $(TCC) -DSQLITE_ENABLE_ICU=1 > 389 RCC = $(RCC) -DSQLITE_ENABLE_ICU=1 361 TCC = $(TCC) -I$(TOP)\ext\icu 390 TCC = $(TCC) -I$(TOP)\ext\icu > 391 RCC = $(RCC) -I$(TOP)\ext\icu 362 TCC = $(TCC) -I$(ICUINCDIR) 392 TCC = $(TCC) -I$(ICUINCDIR) > 393 RCC = $(RCC) -I$(ICUINCDIR) 363 !ENDIF 394 !ENDIF 364 395 365 # libtool compile/link < > 396 # Command line prefixes for compiling code, compiling resources, > 397 # linking, etc. 366 LTCOMPILE = $(TCC) -Fo$@ 398 LTCOMPILE = $(TCC) -Fo$@ > 399 LTRCOMPILE = $(RCC) -r 367 LTLIB = lib.exe 400 LTLIB = lib.exe 368 LTLINK = $(TCC) -Fe$@ 401 LTLINK = $(TCC) -Fe$@ 369 402 370 # If a platform was set, force the linker to target that. 403 # If a platform was set, force the linker to target that. 371 # Note that the vcvars*.bat family of batch files typically 404 # Note that the vcvars*.bat family of batch files typically 372 # set this for you. Otherwise, the linker will attempt 405 # set this for you. Otherwise, the linker will attempt 373 # to deduce the binary type based on the object files. 406 # to deduce the binary type based on the object files. ................................................................................................................................................................................ 745 778 746 libsqlite3.lib: $(LIBOBJ) 779 libsqlite3.lib: $(LIBOBJ) 747 $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS) 780 $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS) 748 781 749 libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib 782 libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib 750 $(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib 783 $(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib 751 784 752 sqlite3.exe: $(TOP)\src\shell.c libsqlite3.lib sqlite3.h | 785 sqlite3.exe: $(TOP)\src\shell.c libsqlite3.lib sqlite3res.lo sqlite3.h 753 $(LTLINK) $(READLINE_FLAGS) \ 786 $(LTLINK) $(READLINE_FLAGS) \ 754 $(TOP)\src\shell.c \ 787 $(TOP)\src\shell.c \ 755 /link $(LTLINKOPTS) $(LTLIBPATHS) libsqlite3.lib $(LIBREADLINE) | 788 /link $(LTLINKOPTS) $(LTLIBPATHS) libsqlite3.lib sqlite3res.lo $ 756 789 757 # This target creates a directory named "tsrc" and fills it with 790 # This target creates a directory named "tsrc" and fills it with 758 # copies of all of the C source code and header files needed to 791 # copies of all of the C source code and header files needed to 759 # build on the target system. Some of the C source code and header 792 # build on the target system. Some of the C source code and header 760 # files are automatically generated. This target takes care of 793 # files are automatically generated. This target takes care of 761 # all that automatic generation. 794 # all that automatic generation. 762 # 795 # ................................................................................................................................................................................ 796 # 829 # 797 parse.lo: parse.c $(HDR) 830 parse.lo: parse.c $(HDR) 798 $(LTCOMPILE) -c parse.c 831 $(LTCOMPILE) -c parse.c 799 832 800 opcodes.lo: opcodes.c 833 opcodes.lo: opcodes.c 801 $(LTCOMPILE) -c opcodes.c 834 $(LTCOMPILE) -c opcodes.c 802 835 > 836 # Rule to build the Win32 resources object file. > 837 # > 838 sqlite3res.lo: $(TOP)\src\sqlite3.rc $(HDR) > 839 echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h > 840 for /F %%V in ('type VERSION') do ( \ > 841 echo #define SQLITE_RESOURCE_VERSION %%V \ > 842 | $(NAWK) "/.*/ { gsub(/[.]/,\",\");print }" >> sqlite3r > 843 ) > 844 echo #endif >> sqlite3rc.h > 845 $(LTRCOMPILE) -fo sqlite3res.lo $(TOP)\src\sqlite3.rc > 846 803 # Rules to build individual *.lo files from files in the src directory. 847 # Rules to build individual *.lo files from files in the src directory. 804 # 848 # 805 alter.lo: $(TOP)\src\alter.c $(HDR) 849 alter.lo: $(TOP)\src\alter.c $(HDR) 806 $(LTCOMPILE) -c $(TOP)\src\alter.c 850 $(LTCOMPILE) -c $(TOP)\src\alter.c 807 851 808 analyze.lo: $(TOP)\src\analyze.c $(HDR) 852 analyze.lo: $(TOP)\src\analyze.c $(HDR) 809 $(LTCOMPILE) -c $(TOP)\src\analyze.c 853 $(LTCOMPILE) -c $(TOP)\src\analyze.c ................................................................................................................................................................................ 1011 1055 1012 tclsqlite.lo: $(TOP)\src\tclsqlite.c $(HDR) 1056 tclsqlite.lo: $(TOP)\src\tclsqlite.c $(HDR) 1013 $(LTCOMPILE) -DUSE_TCL_STUBS=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\s 1057 $(LTCOMPILE) -DUSE_TCL_STUBS=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\s 1014 1058 1015 tclsqlite-shell.lo: $(TOP)\src\tclsqlite.c $(HDR) 1059 tclsqlite-shell.lo: $(TOP)\src\tclsqlite.c $(HDR) 1016 $(LTCOMPILE) -DTCLSH=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsq 1060 $(LTCOMPILE) -DTCLSH=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsq 1017 1061 1018 tclsqlite3.exe: tclsqlite-shell.lo libsqlite3.lib | 1062 tclsqlite3.exe: tclsqlite-shell.lo libsqlite3.lib sqlite3res.lo 1019 $(LTLINK) tclsqlite-shell.lo \ | 1063 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /OUT:$@ libsqlite3.lib tcls 1020 /link $(LTLINKOPTS) $(LTLIBPATHS) libsqlite3.lib $(LTLIBS) $(TLI < 1021 1064 1022 # Rules to build opcodes.c and opcodes.h 1065 # Rules to build opcodes.c and opcodes.h 1023 # 1066 # 1024 opcodes.c: opcodes.h $(TOP)\mkopcodec.awk 1067 opcodes.c: opcodes.h $(TOP)\mkopcodec.awk 1025 $(NAWK) -f $(TOP)\mkopcodec.awk opcodes.h > opcodes.c 1068 $(NAWK) -f $(TOP)\mkopcodec.awk opcodes.h > opcodes.c 1026 1069 1027 opcodes.h: parse.h $(TOP)\src\vdbe.c $(TOP)\mkopcodeh.awk 1070 opcodes.h: parse.h $(TOP)\src\vdbe.c $(TOP)\mkopcodeh.awk ................................................................................................................................................................................ 1126 TESTFIXTURE_SRC1 = $(TESTSRC3) sqlite3.c 1169 TESTFIXTURE_SRC1 = $(TESTSRC3) sqlite3.c 1127 !IF $(USE_AMALGAMATION)==0 1170 !IF $(USE_AMALGAMATION)==0 1128 TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0) 1171 TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0) 1129 !ELSE 1172 !ELSE 1130 TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1) 1173 TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1) 1131 !ENDIF 1174 !ENDIF 1132 1175 1133 testfixture.exe: $(TESTFIXTURE_SRC) $(HDR) | 1176 testfixture.exe: $(TESTFIXTURE_SRC) sqlite3res.lo $(HDR) 1134 $(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \ 1177 $(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \ 1135 -DBUILD_sqlite -I$(TCLINCDIR) \ 1178 -DBUILD_sqlite -I$(TCLINCDIR) \ 1136 $(TESTFIXTURE_SRC) \ 1179 $(TESTFIXTURE_SRC) \ 1137 /link $(LTLINKOPTS) $(LTLIBPATHS) $(LTLIBS) $(TLIBS) | 1180 /link $(LTLINKOPTS) $(LTLIBPATHS) sqlite3res.lo $(LTLIBS) $(TLIB 1138 1181 1139 fulltest: testfixture.exe sqlite3.exe 1182 fulltest: testfixture.exe sqlite3.exe 1140 .\testfixture.exe $(TOP)\test\all.test 1183 .\testfixture.exe $(TOP)\test\all.test 1141 1184 1142 soaktest: testfixture.exe sqlite3.exe 1185 soaktest: testfixture.exe sqlite3.exe 1143 .\testfixture.exe $(TOP)\test\all.test -soak=1 1186 .\testfixture.exe $(TOP)\test\all.test -soak=1 1144 1187 ................................................................................................................................................................................ 1148 sqlite3_analyzer.c: sqlite3.c $(TOP)\src\test_stat.c $(TOP)\src\tclsqlite.c $(TO 1191 sqlite3_analyzer.c: sqlite3.c $(TOP)\src\test_stat.c $(TOP)\src\tclsqlite.c $(TO 1149 copy sqlite3.c + $(TOP)\src\test_stat.c + $(TOP)\src\tclsqlite.c $@ 1192 copy sqlite3.c + $(TOP)\src\test_stat.c + $(TOP)\src\tclsqlite.c $@ 1150 echo static const char *tclsh_main_loop(void){ >> $@ 1193 echo static const char *tclsh_main_loop(void){ >> $@ 1151 echo static const char *zMainloop = >> $@ 1194 echo static const char *zMainloop = >> $@ 1152 $(NAWK) -f $(TOP)\tool\tostr.awk $(TOP)\tool\spaceanal.tcl >> $@ 1195 $(NAWK) -f $(TOP)\tool\tostr.awk $(TOP)\tool\spaceanal.tcl >> $@ 1153 echo ; return zMainloop; } >> $@ 1196 echo ; return zMainloop; } >> $@ 1154 1197 1155 sqlite3_analyzer.exe: sqlite3_analyzer.c | 1198 sqlite3_analyzer.exe: sqlite3_analyzer.c sqlite3res.lo 1156 $(LTLINK) -DBUILD_sqlite -DTCLSH=2 -I$(TCLINCDIR) sqlite3_analyzer.c \ 1199 $(LTLINK) -DBUILD_sqlite -DTCLSH=2 -I$(TCLINCDIR) sqlite3_analyzer.c \ 1157 /link $(LTLINKOPTS) $(LTLIBPATHS) $(LTLIBS) $(TLIBS) | 1200 /link $(LTLINKOPTS) $(LTLIBPATHS) sqlite3res.lo $(LTLIBS) $(TLIB 1158 1201 1159 clean: 1202 clean: 1160 del /Q *.lo *.ilk *.lib *.obj *.pdb sqlite3.exe libsqlite3.lib 1203 del /Q *.lo *.ilk *.lib *.obj *.pdb sqlite3.exe libsqlite3.lib 1161 del /Q *.da *.bb *.bbg gmon.out 1204 del /Q *.da *.bb *.bbg gmon.out 1162 del /Q sqlite3.h opcodes.c opcodes.h 1205 del /Q sqlite3.h opcodes.c opcodes.h 1163 del /Q lemon.exe lempar.c parse.* 1206 del /Q lemon.exe lempar.c parse.* 1164 del /Q mkkeywordhash.exe keywordhash.h 1207 del /Q mkkeywordhash.exe keywordhash.h ................................................................................................................................................................................ 1165 -rmdir /Q/S .deps 1208 -rmdir /Q/S .deps 1166 -rmdir /Q/S .libs 1209 -rmdir /Q/S .libs 1167 -rmdir /Q/S quota2a 1210 -rmdir /Q/S quota2a 1168 -rmdir /Q/S quota2b 1211 -rmdir /Q/S quota2b 1169 -rmdir /Q/S quota2c 1212 -rmdir /Q/S quota2c 1170 -rmdir /Q/S tsrc 1213 -rmdir /Q/S tsrc 1171 del /Q .target_source 1214 del /Q .target_source 1172 del /Q tclsqlite3.exe | 1215 del /Q tclsqlite3.exe tclsqlite3.exp 1173 del /Q testfixture.exe testfixture.exp test.db 1216 del /Q testfixture.exe testfixture.exp test.db 1174 del /Q sqlite3.dll sqlite3.lib sqlite3.exp sqlite3.def 1217 del /Q sqlite3.dll sqlite3.lib sqlite3.exp sqlite3.def 1175 del /Q sqlite3.c 1218 del /Q sqlite3.c > 1219 del /Q sqlite3rc.h 1176 del /Q sqlite3_analyzer.exe sqlite3_analyzer.exp sqlite3_analyzer.c 1220 del /Q sqlite3_analyzer.exe sqlite3_analyzer.exp sqlite3_analyzer.c 1177 del /Q sqlite-output.vsix 1221 del /Q sqlite-output.vsix 1178 1222 1179 # | 1223 # Dynamic link library section. 1180 # Windows section < 1181 # 1224 # 1182 dll: sqlite3.dll 1225 dll: sqlite3.dll 1183 1226 1184 sqlite3.def: libsqlite3.lib 1227 sqlite3.def: libsqlite3.lib 1185 echo EXPORTS > sqlite3.def 1228 echo EXPORTS > sqlite3.def 1186 dumpbin /all libsqlite3.lib \ 1229 dumpbin /all libsqlite3.lib \ 1187 | $(NAWK) "/ 1 _?sqlite3_/ { sub(/^.* _?/,\"\");print }" \ 1230 | $(NAWK) "/ 1 _?sqlite3_/ { sub(/^.* _?/,\"\");print }" \ 1188 | sort >> sqlite3.def 1231 | sort >> sqlite3.def 1189 1232 1190 sqlite3.dll: $(LIBOBJ) sqlite3.def | 1233 sqlite3.dll: $(LIBOBJ) sqlite3res.lo sqlite3.def 1191 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /DEF:sqlite3.def /OUT: | 1234 $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /DEF:sqlite3.def /OUT:
Added src/sqlite3.rc
> 1 /* > 2 ** 2012 September 2 > 3 ** > 4 ** The author disclaims copyright to this source code. In place of > 5 ** a legal notice, here is a blessing: > 6 ** > 7 ** May you do good and not evil. > 8 ** May you find forgiveness for yourself and forgive others. > 9 ** May you share freely, never taking more than you give. > 10 ** > 11 ****************************************************************************** > 12 ** > 13 ** This file contains code and resources that are specific to Windows. > 14 */ > 15 > 16 #if !defined(_WIN32_WCE) > 17 #include "winresrc.h" > 18 #else > 19 #include "windows.h" > 20 #endif > 21 > 22 #include "sqlite3.h" > 23 #include "sqlite3rc.h" > 24 > 25 /* > 26 * English (U.S.) resources > 27 */ > 28 > 29 #ifdef _WIN32 > 30 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US > 31 #pragma code_page(1252) > 32 #endif /* _WIN32 */ > 33 > 34 /* > 35 * Version > 36 */ > 37 > 38 VS_VERSION_INFO VERSIONINFO > 39 FILEVERSION SQLITE_RESOURCE_VERSION > 40 PRODUCTVERSION SQLITE_RESOURCE_VERSION > 41 FILEFLAGSMASK 0x3F > 42 #if defined(_DEBUG) > 43 FILEFLAGS 0x1L > 44 #else > 45 FILEFLAGS 0x0L > 46 #endif > 47 FILEOS VOS__WINDOWS32 > 48 FILETYPE VFT_APP > 49 FILESUBTYPE VFT2_UNKNOWN > 50 BEGIN > 51 BLOCK "StringFileInfo" > 52 BEGIN > 53 BLOCK "040904b0" > 54 BEGIN > 55 VALUE "CompanyName", "SQLite Development Team" > 56 VALUE "FileDescription", "SQLite is a software library that implements a s > 57 VALUE "FileVersion", SQLITE_VERSION > 58 VALUE "InternalName", "sqlite3" > 59 VALUE "LegalCopyright", "http://www.sqlite.org/copyright.html" > 60 VALUE "ProductName", "SQLite" > 61 VALUE "ProductVersion", SQLITE_VERSION > 62 VALUE "SourceId", SQLITE_SOURCE_ID > 63 END > 64 END > 65 BLOCK "VarFileInfo" > 66 BEGIN > 67 VALUE "Translation", 0x409, 1200 > 68 END > 69 END
Changes to src/test_spellfix.c
26 #include <ctype.h> 26 #include <ctype.h> 27 27 28 /* 28 /* 29 ** Character classes for ASCII characters: 29 ** Character classes for ASCII characters: 30 ** 30 ** 31 ** 0 '' Silent letters: H W 31 ** 0 '' Silent letters: H W 32 ** 1 'A' Any vowel: A E I O U (Y) 32 ** 1 'A' Any vowel: A E I O U (Y) 33 ** 2 'B' A bilabeal stop or fricative: B F P V | 33 ** 2 'B' A bilabeal stop or fricative: B F P V W 34 ** 3 'C' Other fricatives or back stops: C G J K Q S X Z 34 ** 3 'C' Other fricatives or back stops: C G J K Q S X Z 35 ** 4 'D' Alveolar stops: D T 35 ** 4 'D' Alveolar stops: D T 36 ** 5 'H' Letter H at the beginning of a word 36 ** 5 'H' Letter H at the beginning of a word 37 ** 6 'L' Glide: L 37 ** 6 'L' Glide: L 38 ** 7 'R' Semivowel: R 38 ** 7 'R' Semivowel: R 39 ** 8 'M' Nasals: M N 39 ** 8 'M' Nasals: M N 40 ** 9 'W' Letter W at the beginning of a word < 41 ** 10 'Y' Letter Y at the beginning of a word. | 40 ** 9 'Y' Letter Y at the beginning of a word. 42 ** 11 '9' Digits: 0 1 2 3 4 5 6 7 8 9 | 41 ** 10 '9' Digits: 0 1 2 3 4 5 6 7 8 9 43 ** 12 ' ' White space | 42 ** 11 ' ' White space 44 ** 13 '?' Other. | 43 ** 12 '?' Other. 45 */ 44 */ 46 #define CCLASS_SILENT 0 45 #define CCLASS_SILENT 0 47 #define CCLASS_VOWEL 1 46 #define CCLASS_VOWEL 1 48 #define CCLASS_B 2 47 #define CCLASS_B 2 49 #define CCLASS_C 3 48 #define CCLASS_C 3 50 #define CCLASS_D 4 49 #define CCLASS_D 4 51 #define CCLASS_H 5 50 #define CCLASS_H 5 52 #define CCLASS_L 6 51 #define CCLASS_L 6 53 #define CCLASS_R 7 52 #define CCLASS_R 7 54 #define CCLASS_M 8 53 #define CCLASS_M 8 55 #define CCLASS_W 9 < 56 #define CCLASS_Y 10 | 54 #define CCLASS_Y 9 57 #define CCLASS_DIGIT 11 | 55 #define CCLASS_DIGIT 10 58 #define CCLASS_SPACE 12 | 56 #define CCLASS_SPACE 11 59 #define CCLASS_OTHER 13 | 57 #define CCLASS_OTHER 12 60 58 61 /* 59 /* 62 ** The following table gives the character class for non-initial ASCII 60 ** The following table gives the character class for non-initial ASCII 63 ** characters. 61 ** characters. 64 */ 62 */ 65 static const unsigned char midClass[] = { 63 static const unsigned char midClass[] = { 66 /* */ CCLASS_OTHER, /* */ CCLASS_OTHER, /* */ CCLASS_OTHER, 64 /* */ CCLASS_OTHER, /* */ CCLASS_OTHER, /* */ CCLASS_OTHER, ................................................................................................................................................................................ 88 /* B */ CCLASS_B, /* C */ CCLASS_C, /* D */ CCLASS_D, 86 /* B */ CCLASS_B, /* C */ CCLASS_C, /* D */ CCLASS_D, 89 /* E */ CCLASS_VOWEL, /* F */ CCLASS_B, /* G */ CCLASS_C, 87 /* E */ CCLASS_VOWEL, /* F */ CCLASS_B, /* G */ CCLASS_C, 90 /* H */ CCLASS_SILENT, /* I */ CCLASS_VOWEL, /* J */ CCLASS_C, 88 /* H */ CCLASS_SILENT, /* I */ CCLASS_VOWEL, /* J */ CCLASS_C, 91 /* K */ CCLASS_C, /* L */ CCLASS_L, /* M */ CCLASS_M, 89 /* K */ CCLASS_C, /* L */ CCLASS_L, /* M */ CCLASS_M, 92 /* N */ CCLASS_M, /* O */ CCLASS_VOWEL, /* P */ CCLASS_B, 90 /* N */ CCLASS_M, /* O */ CCLASS_VOWEL, /* P */ CCLASS_B, 93 /* Q */ CCLASS_C, /* R */ CCLASS_R, /* S */ CCLASS_C, 91 /* Q */ CCLASS_C, /* R */ CCLASS_R, /* S */ CCLASS_C, 94 /* T */ CCLASS_D, /* U */ CCLASS_VOWEL, /* V */ CCLASS_B, 92 /* T */ CCLASS_D, /* U */ CCLASS_VOWEL, /* V */ CCLASS_B, 95 /* W */ CCLASS_SILENT, /* X */ CCLASS_C, /* Y */ CCLASS_VOWEL, | 93 /* W */ CCLASS_B, /* X */ CCLASS_C, /* Y */ CCLASS_VOWEL, 96 /* Z */ CCLASS_C, /* [ */ CCLASS_OTHER, /* \ */ CCLASS_OTHER, 94 /* Z */ CCLASS_C, /* [ */ CCLASS_OTHER, /* \ */ CCLASS_OTHER, 97 /* ] */ CCLASS_OTHER, /* ^ */ CCLASS_OTHER, /* _ */ CCLASS_OTHER, 95 /* ] */ CCLASS_OTHER, /* ^ */ CCLASS_OTHER, /* _ */ CCLASS_OTHER, 98 /* ` */ CCLASS_OTHER, /* a */ CCLASS_VOWEL, /* b */ CCLASS_B, 96 /* ` */ CCLASS_OTHER, /* a */ CCLASS_VOWEL, /* b */ CCLASS_B, 99 /* c */ CCLASS_C, /* d */ CCLASS_D, /* e */ CCLASS_VOWEL, 97 /* c */ CCLASS_C, /* d */ CCLASS_D, /* e */ CCLASS_VOWEL, 100 /* f */ CCLASS_B, /* g */ CCLASS_C, /* h */ CCLASS_SILENT, 98 /* f */ CCLASS_B, /* g */ CCLASS_C, /* h */ CCLASS_SILENT, 101 /* i */ CCLASS_VOWEL, /* j */ CCLASS_C, /* k */ CCLASS_C, 99 /* i */ CCLASS_VOWEL, /* j */ CCLASS_C, /* k */ CCLASS_C, 102 /* l */ CCLASS_L, /* m */ CCLASS_M, /* n */ CCLASS_M, 100 /* l */ CCLASS_L, /* m */ CCLASS_M, /* n */ CCLASS_M, 103 /* o */ CCLASS_VOWEL, /* p */ CCLASS_B, /* q */ CCLASS_C, 101 /* o */ CCLASS_VOWEL, /* p */ CCLASS_B, /* q */ CCLASS_C, 104 /* r */ CCLASS_R, /* s */ CCLASS_C, /* t */ CCLASS_D, 102 /* r */ CCLASS_R, /* s */ CCLASS_C, /* t */ CCLASS_D, 105 /* u */ CCLASS_VOWEL, /* v */ CCLASS_B, /* w */ CCLASS_SILENT, | 103 /* u */ CCLASS_VOWEL, /* v */ CCLASS_B, /* w */ CCLASS_B, 106 /* x */ CCLASS_C, /* y */ CCLASS_VOWEL, /* z */ CCLASS_C, 104 /* x */ CCLASS_C, /* y */ CCLASS_VOWEL, /* z */ CCLASS_C, 107 /* { */ CCLASS_OTHER, /* | */ CCLASS_OTHER, /* } */ CCLASS_OTHER, 105 /* { */ CCLASS_OTHER, /* | */ CCLASS_OTHER, /* } */ CCLASS_OTHER, 108 /* ~ */ CCLASS_OTHER, /* */ CCLASS_OTHER, 106 /* ~ */ CCLASS_OTHER, /* */ CCLASS_OTHER, 109 }; 107 }; 110 /* 108 /* 111 ** This tables gives the character class for ASCII characters that form the 109 ** This tables gives the character class for ASCII characters that form the 112 ** initial character of a word. The only difference from midClass is with 110 ** initial character of a word. The only difference from midClass is with ................................................................................................................................................................................ 138 /* B */ CCLASS_B, /* C */ CCLASS_C, /* D */ CCLASS_D, 136 /* B */ CCLASS_B, /* C */ CCLASS_C, /* D */ CCLASS_D, 139 /* E */ CCLASS_VOWEL, /* F */ CCLASS_B, /* G */ CCLASS_C, 137 /* E */ CCLASS_VOWEL, /* F */ CCLASS_B, /* G */ CCLASS_C, 140 /* H */ CCLASS_SILENT, /* I */ CCLASS_VOWEL, /* J */ CCLASS_C, 138 /* H */ CCLASS_SILENT, /* I */ CCLASS_VOWEL, /* J */ CCLASS_C, 141 /* K */ CCLASS_C, /* L */ CCLASS_L, /* M */ CCLASS_M, 139 /* K */ CCLASS_C, /* L */ CCLASS_L, /* M */ CCLASS_M, 142 /* N */ CCLASS_M, /* O */ CCLASS_VOWEL, /* P */ CCLASS_B, 140 /* N */ CCLASS_M, /* O */ CCLASS_VOWEL, /* P */ CCLASS_B, 143 /* Q */ CCLASS_C, /* R */ CCLASS_R, /* S */ CCLASS_C, 141 /* Q */ CCLASS_C, /* R */ CCLASS_R, /* S */ CCLASS_C, 144 /* T */ CCLASS_D, /* U */ CCLASS_VOWEL, /* V */ CCLASS_B, 142 /* T */ CCLASS_D, /* U */ CCLASS_VOWEL, /* V */ CCLASS_B, 145 /* W */ CCLASS_W, /* X */ CCLASS_C, /* Y */ CCLASS_Y, | 143 /* W */ CCLASS_B, /* X */ CCLASS_C, /* Y */ CCLASS_Y, 146 /* Z */ CCLASS_C, /* [ */ CCLASS_OTHER, /* \ */ CCLASS_OTHER, 144 /* Z */ CCLASS_C, /* [ */ CCLASS_OTHER, /* \ */ CCLASS_OTHER, 147 /* ] */ CCLASS_OTHER, /* ^ */ CCLASS_OTHER, /* _ */ CCLASS_OTHER, 145 /* ] */ CCLASS_OTHER, /* ^ */ CCLASS_OTHER, /* _ */ CCLASS_OTHER, 148 /* ` */ CCLASS_OTHER, /* a */ CCLASS_VOWEL, /* b */ CCLASS_B, 146 /* ` */ CCLASS_OTHER, /* a */ CCLASS_VOWEL, /* b */ CCLASS_B, 149 /* c */ CCLASS_C, /* d */ CCLASS_D, /* e */ CCLASS_VOWEL, 147 /* c */ CCLASS_C, /* d */ CCLASS_D, /* e */ CCLASS_VOWEL, 150 /* f */ CCLASS_B, /* g */ CCLASS_C, /* h */ CCLASS_SILENT, 148 /* f */ CCLASS_B, /* g */ CCLASS_C, /* h */ CCLASS_SILENT, 151 /* i */ CCLASS_VOWEL, /* j */ CCLASS_C, /* k */ CCLASS_C, 149 /* i */ CCLASS_VOWEL, /* j */ CCLASS_C, /* k */ CCLASS_C, 152 /* l */ CCLASS_L, /* m */ CCLASS_M, /* n */ CCLASS_M, 150 /* l */ CCLASS_L, /* m */ CCLASS_M, /* n */ CCLASS_M, 153 /* o */ CCLASS_VOWEL, /* p */ CCLASS_B, /* q */ CCLASS_C, 151 /* o */ CCLASS_VOWEL, /* p */ CCLASS_B, /* q */ CCLASS_C, 154 /* r */ CCLASS_R, /* s */ CCLASS_C, /* t */ CCLASS_D, 152 /* r */ CCLASS_R, /* s */ CCLASS_C, /* t */ CCLASS_D, 155 /* u */ CCLASS_VOWEL, /* v */ CCLASS_B, /* w */ CCLASS_W, | 153 /* u */ CCLASS_VOWEL, /* v */ CCLASS_B, /* w */ CCLASS_B, 156 /* x */ CCLASS_C, /* y */ CCLASS_Y, /* z */ CCLASS_C, 154 /* x */ CCLASS_C, /* y */ CCLASS_Y, /* z */ CCLASS_C, 157 /* { */ CCLASS_OTHER, /* | */ CCLASS_OTHER, /* } */ CCLASS_OTHER, 155 /* { */ CCLASS_OTHER, /* | */ CCLASS_OTHER, /* } */ CCLASS_OTHER, 158 /* ~ */ CCLASS_OTHER, /* */ CCLASS_OTHER, 156 /* ~ */ CCLASS_OTHER, /* */ CCLASS_OTHER, 159 }; 157 }; 160 158 161 /* 159 /* 162 ** Mapping from the character class number (0-13) to a symbol for each 160 ** Mapping from the character class number (0-13) to a symbol for each 163 ** character class. Note that initClass[] can be used to map the class 161 ** character class. Note that initClass[] can be used to map the class 164 ** symbol back into the class number. 162 ** symbol back into the class number. 165 */ 163 */ 166 static const unsigned char className[] = ".ABCDHLRMWY9 ?"; | 164 static const unsigned char className[] = ".ABCDHLRMY9 ?"; 167 165 168 /* 166 /* 169 ** Generate a "phonetic hash" from a string of ASCII characters 167 ** Generate a "phonetic hash" from a string of ASCII characters 170 ** in zIn[0..nIn-1]. 168 ** in zIn[0..nIn-1]. 171 ** 169 ** 172 ** * Map characters by character class as defined above. 170 ** * Map characters by character class as defined above. 173 ** * Omit double-letters 171 ** * Omit double-letters ................................................................................................................................................................................ 1892 const char *zModule = argv[0]; 1890 const char *zModule = argv[0]; 1893 const char *zDbName = argv[1]; 1891 const char *zDbName = argv[1]; 1894 const char *zTableName = argv[2]; 1892 const char *zTableName = argv[2]; 1895 int nDbName; 1893 int nDbName; 1896 int rc = SQLITE_OK; 1894 int rc = SQLITE_OK; 1897 int i; 1895 int i; 1898 1896 1899 nDbName = strlen(zDbName); | 1897 nDbName = (int)strlen(zDbName); 1900 pNew = sqlite3_malloc( sizeof(*pNew) + nDbName + 1); 1898 pNew = sqlite3_malloc( sizeof(*pNew) + nDbName + 1); 1901 if( pNew==0 ){ 1899 if( pNew==0 ){ 1902 rc = SQLITE_NOMEM; 1900 rc = SQLITE_NOMEM; 1903 }else{ 1901 }else{ 1904 memset(pNew, 0, sizeof(*pNew)); 1902 memset(pNew, 0, sizeof(*pNew)); 1905 pNew->zDbName = (char*)&pNew[1]; 1903 pNew->zDbName = (char*)&pNew[1]; 1906 memcpy(pNew->zDbName, zDbName, nDbName+1); 1904 memcpy(pNew->zDbName, zDbName, nDbName+1); ................................................................................................................................................................................ 2232 2230 2233 if( pCur->a==0 || p->rc ) return; /* Prior memory allocation failure */ 2231 if( pCur->a==0 || p->rc ) return; /* Prior memory allocation failure */ 2234 zClass = (char*)phoneticHash((unsigned char*)zQuery, nQuery); 2232 zClass = (char*)phoneticHash((unsigned char*)zQuery, nQuery); 2235 if( zClass==0 ){ 2233 if( zClass==0 ){ 2236 p->rc = SQLITE_NOMEM; 2234 p->rc = SQLITE_NOMEM; 2237 return; 2235 return; 2238 } 2236 } 2239 nClass = strlen(zClass); | 2237 nClass = (int)strlen(zClass); 2240 if( nClass>SPELLFIX_MX_HASH-2 ){ 2238 if( nClass>SPELLFIX_MX_HASH-2 ){ 2241 nClass = SPELLFIX_MX_HASH-2; 2239 nClass = SPELLFIX_MX_HASH-2; 2242 zClass[nClass] = 0; 2240 zClass[nClass] = 0; 2243 } 2241 } 2244 if( nClass<=iScope ){ 2242 if( nClass<=iScope ){ 2245 if( nClass>2 ){ 2243 if( nClass>2 ){ 2246 iScope = nClass-1; 2244 iScope = nClass-1; ................................................................................................................................................................................ 2406 zPattern = (char*)transliterate(zMatchThis, sqlite3_value_bytes(argv[0])); 2404 zPattern = (char*)transliterate(zMatchThis, sqlite3_value_bytes(argv[0])); 2407 sqlite3_free(pCur->zPattern); 2405 sqlite3_free(pCur->zPattern); 2408 pCur->zPattern = zPattern; 2406 pCur->zPattern = zPattern; 2409 if( zPattern==0 ){ 2407 if( zPattern==0 ){ 2410 x.rc = SQLITE_NOMEM; 2408 x.rc = SQLITE_NOMEM; 2411 goto filter_exit; 2409 goto filter_exit; 2412 } 2410 } 2413 nPattern = strlen(zPattern); | 2411 nPattern = (int)strlen(zPattern); 2414 if( zPattern[nPattern-1]=='*' ) nPattern--; 2412 if( zPattern[nPattern-1]=='*' ) nPattern--; 2415 zSql = sqlite3_mprintf( 2413 zSql = sqlite3_mprintf( 2416 "SELECT id, word, rank, k1" 2414 "SELECT id, word, rank, k1" 2417 " FROM \"%w\".\"%w_vocab\"" 2415 " FROM \"%w\".\"%w_vocab\"" 2418 " WHERE langid=%d AND k2>=?1 AND k2<?2", 2416 " WHERE langid=%d AND k2>=?1 AND k2<?2", 2419 p->zDbName, p->zTableName, iLang 2417 p->zDbName, p->zTableName, iLang 2420 ); 2418 ); ................................................................................................................................................................................ 2567 case SPELLFIX_COL_SCORE: { 2565 case SPELLFIX_COL_SCORE: { 2568 sqlite3_result_int(ctx, pCur->a[pCur->iRow].iScore); 2566 sqlite3_result_int(ctx, pCur->a[pCur->iRow].iScore); 2569 break; 2567 break; 2570 } 2568 } 2571 case SPELLFIX_COL_MATCHLEN: { 2569 case SPELLFIX_COL_MATCHLEN: { 2572 int iMatchlen = pCur->a[pCur->iRow].iMatchlen; 2570 int iMatchlen = pCur->a[pCur->iRow].iMatchlen; 2573 if( iMatchlen<0 ){ 2571 if( iMatchlen<0 ){ 2574 int nPattern = strlen(pCur->zPattern); | 2572 int nPattern = (int)strlen(pCur->zPattern); 2575 char *zWord = pCur->a[pCur->iRow].zWord; 2573 char *zWord = pCur->a[pCur->iRow].zWord; 2576 int nWord = strlen(zWord); | 2574 int nWord = (int)strlen(zWord); 2577 2575 2578 if( nPattern>0 && pCur->zPattern[nPattern-1]=='*' ){ 2576 if( nPattern>0 && pCur->zPattern[nPattern-1]=='*' ){ 2579 char *zTranslit; 2577 char *zTranslit; 2580 int res; 2578 int res; 2581 zTranslit = (char *)transliterate((unsigned char *)zWord, nWord); 2579 zTranslit = (char *)transliterate((unsigned char *)zWord, nWord); 2582 if( !zTranslit ) return SQLITE_NOMEM; 2580 if( !zTranslit ) return SQLITE_NOMEM; 2583 res = editdist1(pCur->zPattern, zTranslit, &iMatchlen); 2581 res = editdist1(pCur->zPattern, zTranslit, &iMatchlen);
Changes to test/spellfix.test
64 execsql { CREATE VIRTUAL TABLE t1 USING spellfix1 } 64 execsql { CREATE VIRTUAL TABLE t1 USING spellfix1 } 65 foreach word $vocab { 65 foreach word $vocab { 66 execsql { INSERT INTO t1(word) VALUES($word) } 66 execsql { INSERT INTO t1(word) VALUES($word) } 67 } 67 } 68 } {} 68 } {} 69 69 70 foreach {tn word res} { 70 foreach {tn word res} { 71 1 raxpi* {rasping 5 rasped 5 raspberry 6 rasp 4 rasps 4} | 71 1 raxpi* {rasping 5 rasped 5 ragweed 5 raspberry 6 rasp 4} 72 2 ril* {rail 4 railed 4 railer 4 railers 4 railing 4} 72 2 ril* {rail 4 railed 4 railer 4 railers 4 railing 4} 73 3 rilis* {realism 6 realist 6 realistic 6 realistically 6 realists 6} 73 3 rilis* {realism 6 realist 6 realistic 6 realistically 6 realists 6} 74 4 reail* {real 3 realest 3 realign 3 realigned 3 realigning 3} 74 4 reail* {real 3 realest 3 realign 3 realigned 3 realigning 3} 75 5 ras* {rascal 3 rascally 3 rascals 3 rash 3 rasher 3} 75 5 ras* {rascal 3 rascally 3 rascals 3 rash 3 rasher 3} 76 6 realistss* {realists 8 realigns 8 realistic 9 realistically 9 realest 7} 76 6 realistss* {realists 8 realigns 8 realistic 9 realistically 9 realest 7} 77 7 realistss {realists 8 realist 7 realigns 8 realistic 9 realest 7} 77 7 realistss {realists 8 realist 7 realigns 8 realistic 9 realest 7} 78 8 rllation* {realities 9 reality 7 rallied 7 railed 4} 78 8 rllation* {realities 9 reality 7 rallied 7 railed 4}