System.Data.SQLite
Check-in [738f909d78]
Not logged in

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

Overview
Comment:Update SQLite core library to the latest 3.14.2 release candidate.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 738f909d7855729f58105a2abe72f46ab81ff78c
User & Date: mistachkin 2016-09-08 23:21:36
Context
2016-09-09
20:40
Update links to the release log for 3.14.2. check-in: da9a6211c7 user: mistachkin tags: trunk
2016-09-08
23:21
Update SQLite core library to the latest 3.14.2 release candidate. check-in: 738f909d78 user: mistachkin tags: trunk
2016-09-06
20:56
Modify the design-time installer tests to take into account the recent test suite infrastructure build directory handling changes. check-in: 1d58465d4a user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Doc/Extra/Provider/version.html.

    41     41         </table>
    42     42       </div>
    43     43       <div id="mainSection">
    44     44       <div id="mainBody">
    45     45       <h1 class="heading">Version History</h1>
    46     46       <p><b>1.0.103.0 - September XX, 2016 <font color="red">(release scheduled)</font></b></p>
    47     47       <ul>
    48         -      <li>Updated to <a href="https://www.sqlite.org/releaselog/3_14_1.html">SQLite 3.14.1</a>.</li>
           48  +      <li>Updated to <a href="https://www.sqlite.org/releaselog/3_14_2.html">SQLite 3.14.2</a>.</li>
    49     49         <li>Add preliminary support for the .NET Framework 4.6.2.</li>
    50     50         <li>Change the SQLiteReadValueCallback delegate &quot;eventArgs&quot; parameter to be of type SQLiteReadEventArgs.&nbsp;<b>** Potentially Incompatible Change **</b></li>
    51     51         <li>Make SQLiteReadValueEventArgs and SQLiteReadArrayEventArgs derive from SQLiteReadEventArgs.&nbsp;<b>** Potentially Incompatible Change **</b></li>
    52     52         <li>Rename SQLiteReadValueEventArgs.ArrayEventArgs property to ExtraEventArgs.&nbsp;<b>** Potentially Incompatible Change **</b></li>
    53     53         <li>Add No_SQLiteGetSettingValue and No_SQLiteXmlConfigFile environment variables.</li>
    54     54         <li>Reduce the number of calls to GetSettingValue from SQLiteConnection. Pursuant to <a href="https://system.data.sqlite.org/index.html/info/25d53b48f6">[25d53b48f6]</a>.&nbsp;<b>** Potentially Incompatible Change **</b></li>
    55     55         <li>Add NoVerifyTypeAffinity connection flag to disable all type affinity checking.</li>

Changes to SQLite.Interop/props/sqlite3.props.

     5      5    *
     6      6    * Written by Joe Mistachkin.
     7      7    * Released to the public domain, use at your own risk!
     8      8    *
     9      9   -->
    10     10   <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
    11     11     <PropertyGroup Label="UserMacros">
    12         -    <SQLITE_MANIFEST_VERSION>3.14.1.0</SQLITE_MANIFEST_VERSION>
    13         -    <SQLITE_RC_VERSION>3,14,1,0</SQLITE_RC_VERSION>
           12  +    <SQLITE_MANIFEST_VERSION>3.14.2.0</SQLITE_MANIFEST_VERSION>
           13  +    <SQLITE_RC_VERSION>3,14,2,0</SQLITE_RC_VERSION>
    14     14       <SQLITE_COMMON_DEFINES>_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;SQLITE_THREADSAFE=1;SQLITE_USE_URI=1;SQLITE_ENABLE_COLUMN_METADATA=1;SQLITE_ENABLE_STAT4=1;SQLITE_ENABLE_FTS3=1;SQLITE_ENABLE_LOAD_EXTENSION=1;SQLITE_ENABLE_RTREE=1;SQLITE_SOUNDEX=1;SQLITE_ENABLE_MEMORY_MANAGEMENT=1;SQLITE_ENABLE_API_ARMOR=1;SQLITE_ENABLE_DBSTAT_VTAB=1</SQLITE_COMMON_DEFINES>
    15     15       <SQLITE_EXTRA_DEFINES>SQLITE_PLACEHOLDER=1;SQLITE_HAS_CODEC=1</SQLITE_EXTRA_DEFINES>
    16     16       <SQLITE_WINCE_200X_DEFINES>SQLITE_OMIT_WAL=1</SQLITE_WINCE_200X_DEFINES>
    17     17       <SQLITE_WINCE_2013_DEFINES>HAVE_ERRNO_H=1;SQLITE_MSVC_LOCALTIME_API=1</SQLITE_WINCE_2013_DEFINES>
    18     18       <SQLITE_DEBUG_DEFINES>SQLITE_DEBUG=1;SQLITE_MEMDEBUG=1;SQLITE_ENABLE_EXPENSIVE_ASSERT=1</SQLITE_DEBUG_DEFINES>
    19     19       <SQLITE_RELEASE_DEFINES>SQLITE_WIN32_MALLOC=1</SQLITE_RELEASE_DEFINES>
    20     20       <SQLITE_DISABLE_WARNINGS>4055;4100;4127;4146;4210;4232;4244;4245;4267;4306;4389;4701;4703;4706</SQLITE_DISABLE_WARNINGS>

Changes to SQLite.Interop/props/sqlite3.vsprops.

    10     10   <VisualStudioPropertySheet
    11     11   	ProjectType="Visual C++"
    12     12   	Version="8.00"
    13     13   	Name="sqlite3"
    14     14   	>
    15     15   	<UserMacro
    16     16   		Name="SQLITE_MANIFEST_VERSION"
    17         -		Value="3.14.1.0"
           17  +		Value="3.14.2.0"
    18     18   		PerformEnvironmentSet="true"
    19     19   	/>
    20     20   	<UserMacro
    21     21   		Name="SQLITE_RC_VERSION"
    22         -		Value="3,14,1,0"
           22  +		Value="3,14,2,0"
    23     23   		PerformEnvironmentSet="true"
    24     24   	/>
    25     25   	<UserMacro
    26     26   		Name="SQLITE_COMMON_DEFINES"
    27     27   		Value="_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;SQLITE_THREADSAFE=1;SQLITE_USE_URI=1;SQLITE_ENABLE_COLUMN_METADATA=1;SQLITE_ENABLE_STAT4=1;SQLITE_ENABLE_FTS3=1;SQLITE_ENABLE_LOAD_EXTENSION=1;SQLITE_ENABLE_RTREE=1;SQLITE_SOUNDEX=1;SQLITE_ENABLE_MEMORY_MANAGEMENT=1;SQLITE_ENABLE_API_ARMOR=1;SQLITE_ENABLE_DBSTAT_VTAB=1"
    28     28   		PerformEnvironmentSet="true"
    29     29   	/>

Changes to SQLite.Interop/src/core/sqlite3.c.

     1      1   /******************************************************************************
     2      2   ** This file is an amalgamation of many separate C source files from SQLite
     3         -** version 3.14.1.  By combining all the individual C code files into this 
            3  +** version 3.14.2.  By combining all the individual C code files into this
     4      4   ** single large file, the entire code can be compiled as a single translation
     5      5   ** unit.  This allows many compilers to do optimizations that would not be
     6      6   ** possible if the files were compiled separately.  Performance improvements
     7      7   ** of 5% or more are commonly seen when SQLite is compiled as a single
     8      8   ** translation unit.
     9      9   **
    10     10   ** This file is all you need to compile SQLite.  To use SQLite in other
    11     11   ** programs, you need this file and the "sqlite3.h" header file that defines
    12         -** the programming interface to the SQLite library.  (If you do not have 
           12  +** the programming interface to the SQLite library.  (If you do not have
    13     13   ** the "sqlite3.h" header file at hand, you will find a copy embedded within
    14     14   ** the text of this file.  Search for "Begin file sqlite3.h" to find the start
    15     15   ** of the embedded sqlite3.h header file.) Additional code files may be needed
    16     16   ** if you want a wrapper to interface SQLite with your choice of programming
    17     17   ** language. The code for the "sqlite3" command-line shell is also in a
    18     18   ** separate file. This file contains only code for the core SQLite library.
    19     19   */
................................................................................
   376    376   ** string contains the date and time of the check-in (UTC) and an SHA1
   377    377   ** hash of the entire source tree.
   378    378   **
   379    379   ** See also: [sqlite3_libversion()],
   380    380   ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
   381    381   ** [sqlite_version()] and [sqlite_source_id()].
   382    382   */
   383         -#define SQLITE_VERSION        "3.14.1"
   384         -#define SQLITE_VERSION_NUMBER 3014001
   385         -#define SQLITE_SOURCE_ID      "2016-08-11 18:53:32 a12d8059770df4bca59e321c266410344242bf7b"
          383  +#define SQLITE_VERSION        "3.14.2"
          384  +#define SQLITE_VERSION_NUMBER 3014002
          385  +#define SQLITE_SOURCE_ID      "2016-09-08 23:18:34 a04a21ad5aa1a56d50388d6cdb88bae754218a0a"
   386    386   
   387    387   /*
   388    388   ** CAPI3REF: Run-Time Library Version Numbers
   389    389   ** KEYWORDS: sqlite3_version, sqlite3_sourceid
   390    390   **
   391    391   ** These interfaces provide the same information as the [SQLITE_VERSION],
   392    392   ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
................................................................................
   411    411   ** [SQLITE_VERSION_NUMBER].  ^The sqlite3_sourceid() function returns 
   412    412   ** a pointer to a string constant whose value is the same as the 
   413    413   ** [SQLITE_SOURCE_ID] C preprocessor macro.
   414    414   **
   415    415   ** See also: [sqlite_version()] and [sqlite_source_id()].
   416    416   */
   417    417   SQLITE_API const char sqlite3_version[] = SQLITE_VERSION;
   418         -SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void);
   419         -SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void);
   420         -SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void);
          418  +SQLITE_API const char *sqlite3_libversion(void);
          419  +SQLITE_API const char *sqlite3_sourceid(void);
          420  +SQLITE_API int sqlite3_libversion_number(void);
   421    421   
   422    422   /*
   423    423   ** CAPI3REF: Run-Time Library Compilation Options Diagnostics
   424    424   **
   425    425   ** ^The sqlite3_compileoption_used() function returns 0 or 1 
   426    426   ** indicating whether the specified option was defined at 
   427    427   ** compile time.  ^The SQLITE_ prefix may be omitted from the 
................................................................................
   438    438   ** and sqlite3_compileoption_get() may be omitted by specifying the 
   439    439   ** [SQLITE_OMIT_COMPILEOPTION_DIAGS] option at compile time.
   440    440   **
   441    441   ** See also: SQL functions [sqlite_compileoption_used()] and
   442    442   ** [sqlite_compileoption_get()] and the [compile_options pragma].
   443    443   */
   444    444   #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
   445         -SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName);
   446         -SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N);
          445  +SQLITE_API int sqlite3_compileoption_used(const char *zOptName);
          446  +SQLITE_API const char *sqlite3_compileoption_get(int N);
   447    447   #endif
   448    448   
   449    449   /*
   450    450   ** CAPI3REF: Test To See If The Library Is Threadsafe
   451    451   **
   452    452   ** ^The sqlite3_threadsafe() function returns zero if and only if
   453    453   ** SQLite was compiled with mutexing code omitted due to the
................................................................................
   478    478   ** sqlite3_threadsafe() function shows only the compile-time setting of
   479    479   ** thread safety, not any run-time changes to that setting made by
   480    480   ** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
   481    481   ** is unchanged by calls to sqlite3_config().)^
   482    482   **
   483    483   ** See the [threading mode] documentation for additional information.
   484    484   */
   485         -SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void);
          485  +SQLITE_API int sqlite3_threadsafe(void);
   486    486   
   487    487   /*
   488    488   ** CAPI3REF: Database Connection Handle
   489    489   ** KEYWORDS: {database connection} {database connections}
   490    490   **
   491    491   ** Each open SQLite database is represented by a pointer to an instance of
   492    492   ** the opaque structure named "sqlite3".  It is useful to think of an sqlite3
................................................................................
   575    575   ** must be either a NULL
   576    576   ** pointer or an [sqlite3] object pointer obtained
   577    577   ** from [sqlite3_open()], [sqlite3_open16()], or
   578    578   ** [sqlite3_open_v2()], and not previously closed.
   579    579   ** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
   580    580   ** argument is a harmless no-op.
   581    581   */
   582         -SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3*);
   583         -SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3*);
          582  +SQLITE_API int sqlite3_close(sqlite3*);
          583  +SQLITE_API int sqlite3_close_v2(sqlite3*);
   584    584   
   585    585   /*
   586    586   ** The type for a callback function.
   587    587   ** This is legacy and deprecated.  It is included for historical
   588    588   ** compatibility and is not documented.
   589    589   */
   590    590   typedef int (*sqlite3_callback)(void*,int,char**, char**);
................................................................................
   647    647   **      is a valid and open [database connection].
   648    648   ** <li> The application must not close the [database connection] specified by
   649    649   **      the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
   650    650   ** <li> The application must not modify the SQL statement text passed into
   651    651   **      the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
   652    652   ** </ul>
   653    653   */
   654         -SQLITE_API int SQLITE_STDCALL sqlite3_exec(
          654  +SQLITE_API int sqlite3_exec(
   655    655     sqlite3*,                                  /* An open database */
   656    656     const char *sql,                           /* SQL to be evaluated */
   657    657     int (*callback)(void*,int,char**,char**),  /* Callback function */
   658    658     void *,                                    /* 1st argument to callback */
   659    659     char **errmsg                              /* Error msg written here */
   660    660   );
   661    661   
................................................................................
  1646   1646   ** (using the [SQLITE_OS_OTHER=1] compile-time
  1647   1647   ** option) the application must supply a suitable implementation for
  1648   1648   ** sqlite3_os_init() and sqlite3_os_end().  An application-supplied
  1649   1649   ** implementation of sqlite3_os_init() or sqlite3_os_end()
  1650   1650   ** must return [SQLITE_OK] on success and some other [error code] upon
  1651   1651   ** failure.
  1652   1652   */
  1653         -SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void);
  1654         -SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void);
  1655         -SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void);
  1656         -SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void);
         1653  +SQLITE_API int sqlite3_initialize(void);
         1654  +SQLITE_API int sqlite3_shutdown(void);
         1655  +SQLITE_API int sqlite3_os_init(void);
         1656  +SQLITE_API int sqlite3_os_end(void);
  1657   1657   
  1658   1658   /*
  1659   1659   ** CAPI3REF: Configuring The SQLite Library
  1660   1660   **
  1661   1661   ** The sqlite3_config() interface is used to make global configuration
  1662   1662   ** changes to SQLite in order to tune SQLite to the specific needs of
  1663   1663   ** the application.  The default configuration is recommended for most
................................................................................
  1682   1682   ** vary depending on the [configuration option]
  1683   1683   ** in the first argument.
  1684   1684   **
  1685   1685   ** ^When a configuration option is set, sqlite3_config() returns [SQLITE_OK].
  1686   1686   ** ^If the option is unknown or SQLite is unable to set the option
  1687   1687   ** then this routine returns a non-zero [error code].
  1688   1688   */
  1689         -SQLITE_API int SQLITE_CDECL sqlite3_config(int, ...);
         1689  +SQLITE_API int sqlite3_config(int, ...);
  1690   1690   
  1691   1691   /*
  1692   1692   ** CAPI3REF: Configure database connections
  1693   1693   ** METHOD: sqlite3
  1694   1694   **
  1695   1695   ** The sqlite3_db_config() interface is used to make configuration
  1696   1696   ** changes to a [database connection].  The interface is similar to
................................................................................
  1701   1701   ** [SQLITE_DBCONFIG_LOOKASIDE | configuration verb] - an integer code 
  1702   1702   ** that indicates what aspect of the [database connection] is being configured.
  1703   1703   ** Subsequent arguments vary depending on the configuration verb.
  1704   1704   **
  1705   1705   ** ^Calls to sqlite3_db_config() return SQLITE_OK if and only if
  1706   1706   ** the call is considered successful.
  1707   1707   */
  1708         -SQLITE_API int SQLITE_CDECL sqlite3_db_config(sqlite3*, int op, ...);
         1708  +SQLITE_API int sqlite3_db_config(sqlite3*, int op, ...);
  1709   1709   
  1710   1710   /*
  1711   1711   ** CAPI3REF: Memory Allocation Routines
  1712   1712   **
  1713   1713   ** An instance of this object defines the interface between SQLite
  1714   1714   ** and low-level memory allocation routines.
  1715   1715   **
................................................................................
  2242   2242   ** CAPI3REF: Enable Or Disable Extended Result Codes
  2243   2243   ** METHOD: sqlite3
  2244   2244   **
  2245   2245   ** ^The sqlite3_extended_result_codes() routine enables or disables the
  2246   2246   ** [extended result codes] feature of SQLite. ^The extended result
  2247   2247   ** codes are disabled by default for historical compatibility.
  2248   2248   */
  2249         -SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3*, int onoff);
         2249  +SQLITE_API int sqlite3_extended_result_codes(sqlite3*, int onoff);
  2250   2250   
  2251   2251   /*
  2252   2252   ** CAPI3REF: Last Insert Rowid
  2253   2253   ** METHOD: sqlite3
  2254   2254   **
  2255   2255   ** ^Each entry in most SQLite tables (except for [WITHOUT ROWID] tables)
  2256   2256   ** has a unique 64-bit signed
................................................................................
  2294   2294   ** If a separate thread performs a new [INSERT] on the same
  2295   2295   ** database connection while the [sqlite3_last_insert_rowid()]
  2296   2296   ** function is running and thus changes the last insert [rowid],
  2297   2297   ** then the value returned by [sqlite3_last_insert_rowid()] is
  2298   2298   ** unpredictable and might not equal either the old or the new
  2299   2299   ** last insert [rowid].
  2300   2300   */
  2301         -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3*);
         2301  +SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*);
  2302   2302   
  2303   2303   /*
  2304   2304   ** CAPI3REF: Count The Number Of Rows Modified
  2305   2305   ** METHOD: sqlite3
  2306   2306   **
  2307   2307   ** ^This function returns the number of rows modified, inserted or
  2308   2308   ** deleted by the most recently completed INSERT, UPDATE or DELETE
................................................................................
  2347   2347   ** See also the [sqlite3_total_changes()] interface, the
  2348   2348   ** [count_changes pragma], and the [changes() SQL function].
  2349   2349   **
  2350   2350   ** If a separate thread makes changes on the same database connection
  2351   2351   ** while [sqlite3_changes()] is running then the value returned
  2352   2352   ** is unpredictable and not meaningful.
  2353   2353   */
  2354         -SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3*);
         2354  +SQLITE_API int sqlite3_changes(sqlite3*);
  2355   2355   
  2356   2356   /*
  2357   2357   ** CAPI3REF: Total Number Of Rows Modified
  2358   2358   ** METHOD: sqlite3
  2359   2359   **
  2360   2360   ** ^This function returns the total number of rows inserted, modified or
  2361   2361   ** deleted by all [INSERT], [UPDATE] or [DELETE] statements completed
................................................................................
  2371   2371   ** See also the [sqlite3_changes()] interface, the
  2372   2372   ** [count_changes pragma], and the [total_changes() SQL function].
  2373   2373   **
  2374   2374   ** If a separate thread makes changes on the same database connection
  2375   2375   ** while [sqlite3_total_changes()] is running then the value
  2376   2376   ** returned is unpredictable and not meaningful.
  2377   2377   */
  2378         -SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3*);
         2378  +SQLITE_API int sqlite3_total_changes(sqlite3*);
  2379   2379   
  2380   2380   /*
  2381   2381   ** CAPI3REF: Interrupt A Long-Running Query
  2382   2382   ** METHOD: sqlite3
  2383   2383   **
  2384   2384   ** ^This function causes any pending database operation to abort and
  2385   2385   ** return at its earliest opportunity. This routine is typically
................................................................................
  2411   2411   ** ^A call to sqlite3_interrupt(D) that occurs when there are no running
  2412   2412   ** SQL statements is a no-op and has no effect on SQL statements
  2413   2413   ** that are started after the sqlite3_interrupt() call returns.
  2414   2414   **
  2415   2415   ** If the database connection closes while [sqlite3_interrupt()]
  2416   2416   ** is running then bad things will likely happen.
  2417   2417   */
  2418         -SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3*);
         2418  +SQLITE_API void sqlite3_interrupt(sqlite3*);
  2419   2419   
  2420   2420   /*
  2421   2421   ** CAPI3REF: Determine If An SQL Statement Is Complete
  2422   2422   **
  2423   2423   ** These routines are useful during command-line input to determine if the
  2424   2424   ** currently entered text seems to form a complete SQL statement or
  2425   2425   ** if additional input is needed before sending the text into
................................................................................
  2446   2446   **
  2447   2447   ** The input to [sqlite3_complete()] must be a zero-terminated
  2448   2448   ** UTF-8 string.
  2449   2449   **
  2450   2450   ** The input to [sqlite3_complete16()] must be a zero-terminated
  2451   2451   ** UTF-16 string in native byte order.
  2452   2452   */
  2453         -SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *sql);
  2454         -SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *sql);
         2453  +SQLITE_API int sqlite3_complete(const char *sql);
         2454  +SQLITE_API int sqlite3_complete16(const void *sql);
  2455   2455   
  2456   2456   /*
  2457   2457   ** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
  2458   2458   ** KEYWORDS: {busy-handler callback} {busy handler}
  2459   2459   ** METHOD: sqlite3
  2460   2460   **
  2461   2461   ** ^The sqlite3_busy_handler(D,X,P) routine sets a callback function X
................................................................................
  2508   2508   ** database connection that invoked the busy handler.  In other words,
  2509   2509   ** the busy handler is not reentrant.  Any such actions
  2510   2510   ** result in undefined behavior.
  2511   2511   ** 
  2512   2512   ** A busy handler must not close the database connection
  2513   2513   ** or [prepared statement] that invoked the busy handler.
  2514   2514   */
  2515         -SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(sqlite3*,int(*)(void*,int),void*);
         2515  +SQLITE_API int sqlite3_busy_handler(sqlite3*,int(*)(void*,int),void*);
  2516   2516   
  2517   2517   /*
  2518   2518   ** CAPI3REF: Set A Busy Timeout
  2519   2519   ** METHOD: sqlite3
  2520   2520   **
  2521   2521   ** ^This routine sets a [sqlite3_busy_handler | busy handler] that sleeps
  2522   2522   ** for a specified amount of time when a table is locked.  ^The handler
................................................................................
  2531   2531   ** ^(There can only be a single busy handler for a particular
  2532   2532   ** [database connection] at any given moment.  If another busy handler
  2533   2533   ** was defined  (using [sqlite3_busy_handler()]) prior to calling
  2534   2534   ** this routine, that other busy handler is cleared.)^
  2535   2535   **
  2536   2536   ** See also:  [PRAGMA busy_timeout]
  2537   2537   */
  2538         -SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3*, int ms);
         2538  +SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms);
  2539   2539   
  2540   2540   /*
  2541   2541   ** CAPI3REF: Convenience Routines For Running Queries
  2542   2542   ** METHOD: sqlite3
  2543   2543   **
  2544   2544   ** This is a legacy interface that is preserved for backwards compatibility.
  2545   2545   ** Use of this interface is not recommended.
................................................................................
  2606   2606   ** [sqlite3_exec()].  The sqlite3_get_table() routine does not have access
  2607   2607   ** to any internal data structures of SQLite.  It uses only the public
  2608   2608   ** interface defined here.  As a consequence, errors that occur in the
  2609   2609   ** wrapper layer outside of the internal [sqlite3_exec()] call are not
  2610   2610   ** reflected in subsequent calls to [sqlite3_errcode()] or
  2611   2611   ** [sqlite3_errmsg()].
  2612   2612   */
  2613         -SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
         2613  +SQLITE_API int sqlite3_get_table(
  2614   2614     sqlite3 *db,          /* An open database */
  2615   2615     const char *zSql,     /* SQL to be evaluated */
  2616   2616     char ***pazResult,    /* Results of the query */
  2617   2617     int *pnRow,           /* Number of result rows written here */
  2618   2618     int *pnColumn,        /* Number of result columns written here */
  2619   2619     char **pzErrmsg       /* Error msg written here */
  2620   2620   );
  2621         -SQLITE_API void SQLITE_STDCALL sqlite3_free_table(char **result);
         2621  +SQLITE_API void sqlite3_free_table(char **result);
  2622   2622   
  2623   2623   /*
  2624   2624   ** CAPI3REF: Formatted String Printing Functions
  2625   2625   **
  2626   2626   ** These routines are work-alikes of the "printf()" family of functions
  2627   2627   ** from the standard C library.
  2628   2628   ** These routines understand most of the common K&R formatting options,
................................................................................
  2720   2720   ** character.)^  The "%w" formatting option is intended for safely inserting
  2721   2721   ** table and column names into a constructed SQL statement.
  2722   2722   **
  2723   2723   ** ^(The "%z" formatting option works like "%s" but with the
  2724   2724   ** addition that after the string has been read and copied into
  2725   2725   ** the result, [sqlite3_free()] is called on the input string.)^
  2726   2726   */
  2727         -SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...);
  2728         -SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list);
  2729         -SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...);
  2730         -SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list);
         2727  +SQLITE_API char *sqlite3_mprintf(const char*,...);
         2728  +SQLITE_API char *sqlite3_vmprintf(const char*, va_list);
         2729  +SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...);
         2730  +SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);
  2731   2731   
  2732   2732   /*
  2733   2733   ** CAPI3REF: Memory Allocation Subsystem
  2734   2734   **
  2735   2735   ** The SQLite core uses these three routines for all of its own
  2736   2736   ** internal memory allocation needs. "Core" in the previous sentence
  2737   2737   ** does not include operating-system specific VFS implementation.  The
................................................................................
  2813   2813   ** invocation of [sqlite3_malloc()] or [sqlite3_realloc()] that have
  2814   2814   ** not yet been released.
  2815   2815   **
  2816   2816   ** The application must not read or write any part of
  2817   2817   ** a block of memory after it has been released using
  2818   2818   ** [sqlite3_free()] or [sqlite3_realloc()].
  2819   2819   */
  2820         -SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int);
  2821         -SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64);
  2822         -SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void*, int);
  2823         -SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void*, sqlite3_uint64);
  2824         -SQLITE_API void SQLITE_STDCALL sqlite3_free(void*);
  2825         -SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void*);
         2820  +SQLITE_API void *sqlite3_malloc(int);
         2821  +SQLITE_API void *sqlite3_malloc64(sqlite3_uint64);
         2822  +SQLITE_API void *sqlite3_realloc(void*, int);
         2823  +SQLITE_API void *sqlite3_realloc64(void*, sqlite3_uint64);
         2824  +SQLITE_API void sqlite3_free(void*);
         2825  +SQLITE_API sqlite3_uint64 sqlite3_msize(void*);
  2826   2826   
  2827   2827   /*
  2828   2828   ** CAPI3REF: Memory Allocator Statistics
  2829   2829   **
  2830   2830   ** SQLite provides these two interfaces for reporting on the status
  2831   2831   ** of the [sqlite3_malloc()], [sqlite3_free()], and [sqlite3_realloc()]
  2832   2832   ** routines, which form the built-in memory allocation subsystem.
................................................................................
  2843   2843   **
  2844   2844   ** ^The memory high-water mark is reset to the current value of
  2845   2845   ** [sqlite3_memory_used()] if and only if the parameter to
  2846   2846   ** [sqlite3_memory_highwater()] is true.  ^The value returned
  2847   2847   ** by [sqlite3_memory_highwater(1)] is the high-water mark
  2848   2848   ** prior to the reset.
  2849   2849   */
  2850         -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void);
  2851         -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag);
         2850  +SQLITE_API sqlite3_int64 sqlite3_memory_used(void);
         2851  +SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int resetFlag);
  2852   2852   
  2853   2853   /*
  2854   2854   ** CAPI3REF: Pseudo-Random Number Generator
  2855   2855   **
  2856   2856   ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
  2857   2857   ** select random [ROWID | ROWIDs] when inserting new records into a table that
  2858   2858   ** already uses the largest possible [ROWID].  The PRNG is also used for
................................................................................
  2867   2867   ** seeded using randomness obtained from the xRandomness method of
  2868   2868   ** the default [sqlite3_vfs] object.
  2869   2869   ** ^If the previous call to this routine had an N of 1 or more and a
  2870   2870   ** non-NULL P then the pseudo-randomness is generated
  2871   2871   ** internally and without recourse to the [sqlite3_vfs] xRandomness
  2872   2872   ** method.
  2873   2873   */
  2874         -SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *P);
         2874  +SQLITE_API void sqlite3_randomness(int N, void *P);
  2875   2875   
  2876   2876   /*
  2877   2877   ** CAPI3REF: Compile-Time Authorization Callbacks
  2878   2878   ** METHOD: sqlite3
  2879   2879   **
  2880   2880   ** ^This routine registers an authorizer callback with a particular
  2881   2881   ** [database connection], supplied in the first argument.
................................................................................
  2950   2950   **
  2951   2951   ** ^Note that the authorizer callback is invoked only during
  2952   2952   ** [sqlite3_prepare()] or its variants.  Authorization is not
  2953   2953   ** performed during statement evaluation in [sqlite3_step()], unless
  2954   2954   ** as stated in the previous paragraph, sqlite3_step() invokes
  2955   2955   ** sqlite3_prepare_v2() to reprepare a statement after a schema change.
  2956   2956   */
  2957         -SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
         2957  +SQLITE_API int sqlite3_set_authorizer(
  2958   2958     sqlite3*,
  2959   2959     int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
  2960   2960     void *pUserData
  2961   2961   );
  2962   2962   
  2963   2963   /*
  2964   2964   ** CAPI3REF: Authorizer Return Codes
................................................................................
  3058   3058   ** time is in units of nanoseconds, however the current implementation
  3059   3059   ** is only capable of millisecond resolution so the six least significant
  3060   3060   ** digits in the time are meaningless.  Future versions of SQLite
  3061   3061   ** might provide greater resolution on the profiler callback.  The
  3062   3062   ** sqlite3_profile() function is considered experimental and is
  3063   3063   ** subject to change in future versions of SQLite.
  3064   3064   */
  3065         -SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_trace(sqlite3*,
         3065  +SQLITE_API SQLITE_DEPRECATED void *sqlite3_trace(sqlite3*,
  3066   3066      void(*xTrace)(void*,const char*), void*);
  3067         -SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_profile(sqlite3*,
         3067  +SQLITE_API SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*,
  3068   3068      void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
  3069   3069   
  3070   3070   /*
  3071   3071   ** CAPI3REF: SQL Trace Event Codes
  3072   3072   ** KEYWORDS: SQLITE_TRACE
  3073   3073   **
  3074   3074   ** These constants identify classes of events that can be monitored
................................................................................
  3149   3149   ** ^The C argument is a copy of the context pointer.
  3150   3150   ** The P and X arguments are pointers whose meanings depend on T.
  3151   3151   **
  3152   3152   ** The sqlite3_trace_v2() interface is intended to replace the legacy
  3153   3153   ** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which
  3154   3154   ** are deprecated.
  3155   3155   */
  3156         -SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2(
         3156  +SQLITE_API int sqlite3_trace_v2(
  3157   3157     sqlite3*,
  3158   3158     unsigned uMask,
  3159   3159     int(*xCallback)(unsigned,void*,void*,void*),
  3160   3160     void *pCtx
  3161   3161   );
  3162   3162   
  3163   3163   /*
................................................................................
  3188   3188   **
  3189   3189   ** The progress handler callback must not do anything that will modify
  3190   3190   ** the database connection that invoked the progress handler.
  3191   3191   ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
  3192   3192   ** database connections for the meaning of "modify" in this paragraph.
  3193   3193   **
  3194   3194   */
  3195         -SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
         3195  +SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
  3196   3196   
  3197   3197   /*
  3198   3198   ** CAPI3REF: Opening A New Database Connection
  3199   3199   ** CONSTRUCTOR: sqlite3
  3200   3200   **
  3201   3201   ** ^These routines open an SQLite database file as specified by the 
  3202   3202   ** filename argument. ^The filename argument is interpreted as UTF-8 for
................................................................................
  3417   3417   **
  3418   3418   ** <b>Note to Windows Runtime users:</b>  The temporary directory must be set
  3419   3419   ** prior to calling sqlite3_open() or sqlite3_open_v2().  Otherwise, various
  3420   3420   ** features that require the use of temporary files may fail.
  3421   3421   **
  3422   3422   ** See also: [sqlite3_temp_directory]
  3423   3423   */
  3424         -SQLITE_API int SQLITE_STDCALL sqlite3_open(
         3424  +SQLITE_API int sqlite3_open(
  3425   3425     const char *filename,   /* Database filename (UTF-8) */
  3426   3426     sqlite3 **ppDb          /* OUT: SQLite db handle */
  3427   3427   );
  3428         -SQLITE_API int SQLITE_STDCALL sqlite3_open16(
         3428  +SQLITE_API int sqlite3_open16(
  3429   3429     const void *filename,   /* Database filename (UTF-16) */
  3430   3430     sqlite3 **ppDb          /* OUT: SQLite db handle */
  3431   3431   );
  3432         -SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
         3432  +SQLITE_API int sqlite3_open_v2(
  3433   3433     const char *filename,   /* Database filename (UTF-8) */
  3434   3434     sqlite3 **ppDb,         /* OUT: SQLite db handle */
  3435   3435     int flags,              /* Flags */
  3436   3436     const char *zVfs        /* Name of VFS module to use */
  3437   3437   );
  3438   3438   
  3439   3439   /*
................................................................................
  3471   3471   ** 
  3472   3472   ** If F is a NULL pointer, then sqlite3_uri_parameter(F,P) returns NULL and
  3473   3473   ** sqlite3_uri_boolean(F,P,B) returns B.  If F is not a NULL pointer and
  3474   3474   ** is not a database file pathname pointer that SQLite passed into the xOpen
  3475   3475   ** VFS method, then the behavior of this routine is undefined and probably
  3476   3476   ** undesirable.
  3477   3477   */
  3478         -SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam);
  3479         -SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
  3480         -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
         3478  +SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam);
         3479  +SQLITE_API int sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
         3480  +SQLITE_API sqlite3_int64 sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
  3481   3481   
  3482   3482   
  3483   3483   /*
  3484   3484   ** CAPI3REF: Error Codes And Messages
  3485   3485   ** METHOD: sqlite3
  3486   3486   **
  3487   3487   ** ^If the most recent sqlite3_* API call associated with 
................................................................................
  3517   3517   ** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after
  3518   3518   ** all calls to the interfaces listed here are completed.
  3519   3519   **
  3520   3520   ** If an interface fails with SQLITE_MISUSE, that means the interface
  3521   3521   ** was invoked incorrectly by the application.  In that case, the
  3522   3522   ** error code and message may or may not be set.
  3523   3523   */
  3524         -SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db);
  3525         -SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db);
  3526         -SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*);
  3527         -SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*);
  3528         -SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int);
         3524  +SQLITE_API int sqlite3_errcode(sqlite3 *db);
         3525  +SQLITE_API int sqlite3_extended_errcode(sqlite3 *db);
         3526  +SQLITE_API const char *sqlite3_errmsg(sqlite3*);
         3527  +SQLITE_API const void *sqlite3_errmsg16(sqlite3*);
         3528  +SQLITE_API const char *sqlite3_errstr(int);
  3529   3529   
  3530   3530   /*
  3531   3531   ** CAPI3REF: Prepared Statement Object
  3532   3532   ** KEYWORDS: {prepared statement} {prepared statements}
  3533   3533   **
  3534   3534   ** An instance of this object represents a single SQL statement that
  3535   3535   ** has been compiled into binary form and is ready to be evaluated.
................................................................................
  3589   3589   ** attack.  Developers might also want to use the [sqlite3_set_authorizer()]
  3590   3590   ** interface to further control untrusted SQL.  The size of the database
  3591   3591   ** created by an untrusted script can be contained using the
  3592   3592   ** [max_page_count] [PRAGMA].
  3593   3593   **
  3594   3594   ** New run-time limit categories may be added in future releases.
  3595   3595   */
  3596         -SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3*, int id, int newVal);
         3596  +SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal);
  3597   3597   
  3598   3598   /*
  3599   3599   ** CAPI3REF: Run-Time Limit Categories
  3600   3600   ** KEYWORDS: {limit category} {*limit categories}
  3601   3601   **
  3602   3602   ** These constants define various performance limits
  3603   3603   ** that can be lowered at run-time using [sqlite3_limit()].
................................................................................
  3741   3741   ** ^The specific value of WHERE-clause [parameter] might influence the 
  3742   3742   ** choice of query plan if the parameter is the left-hand side of a [LIKE]
  3743   3743   ** or [GLOB] operator or if the parameter is compared to an indexed column
  3744   3744   ** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
  3745   3745   ** </li>
  3746   3746   ** </ol>
  3747   3747   */
  3748         -SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
         3748  +SQLITE_API int sqlite3_prepare(
  3749   3749     sqlite3 *db,            /* Database handle */
  3750   3750     const char *zSql,       /* SQL statement, UTF-8 encoded */
  3751   3751     int nByte,              /* Maximum length of zSql in bytes. */
  3752   3752     sqlite3_stmt **ppStmt,  /* OUT: Statement handle */
  3753   3753     const char **pzTail     /* OUT: Pointer to unused portion of zSql */
  3754   3754   );
  3755         -SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
         3755  +SQLITE_API int sqlite3_prepare_v2(
  3756   3756     sqlite3 *db,            /* Database handle */
  3757   3757     const char *zSql,       /* SQL statement, UTF-8 encoded */
  3758   3758     int nByte,              /* Maximum length of zSql in bytes. */
  3759   3759     sqlite3_stmt **ppStmt,  /* OUT: Statement handle */
  3760   3760     const char **pzTail     /* OUT: Pointer to unused portion of zSql */
  3761   3761   );
  3762         -SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
         3762  +SQLITE_API int sqlite3_prepare16(
  3763   3763     sqlite3 *db,            /* Database handle */
  3764   3764     const void *zSql,       /* SQL statement, UTF-16 encoded */
  3765   3765     int nByte,              /* Maximum length of zSql in bytes. */
  3766   3766     sqlite3_stmt **ppStmt,  /* OUT: Statement handle */
  3767   3767     const void **pzTail     /* OUT: Pointer to unused portion of zSql */
  3768   3768   );
  3769         -SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
         3769  +SQLITE_API int sqlite3_prepare16_v2(
  3770   3770     sqlite3 *db,            /* Database handle */
  3771   3771     const void *zSql,       /* SQL statement, UTF-16 encoded */
  3772   3772     int nByte,              /* Maximum length of zSql in bytes. */
  3773   3773     sqlite3_stmt **ppStmt,  /* OUT: Statement handle */
  3774   3774     const void **pzTail     /* OUT: Pointer to unused portion of zSql */
  3775   3775   );
  3776   3776   
................................................................................
  3801   3801   **
  3802   3802   ** ^The string returned by sqlite3_sql(P) is managed by SQLite and is
  3803   3803   ** automatically freed when the prepared statement is finalized.
  3804   3804   ** ^The string returned by sqlite3_expanded_sql(P), on the other hand,
  3805   3805   ** is obtained from [sqlite3_malloc()] and must be free by the application
  3806   3806   ** by passing it to [sqlite3_free()].
  3807   3807   */
  3808         -SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt);
  3809         -SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt);
         3808  +SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt);
         3809  +SQLITE_API char *sqlite3_expanded_sql(sqlite3_stmt *pStmt);
  3810   3810   
  3811   3811   /*
  3812   3812   ** CAPI3REF: Determine If An SQL Statement Writes The Database
  3813   3813   ** METHOD: sqlite3_stmt
  3814   3814   **
  3815   3815   ** ^The sqlite3_stmt_readonly(X) interface returns true (non-zero) if
  3816   3816   ** and only if the [prepared statement] X makes no direct changes to
................................................................................
  3834   3834   ** since the statements themselves do not actually modify the database but
  3835   3835   ** rather they control the timing of when other statements modify the 
  3836   3836   ** database.  ^The [ATTACH] and [DETACH] statements also cause
  3837   3837   ** sqlite3_stmt_readonly() to return true since, while those statements
  3838   3838   ** change the configuration of a database connection, they do not make 
  3839   3839   ** changes to the content of the database files on disk.
  3840   3840   */
  3841         -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
         3841  +SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
  3842   3842   
  3843   3843   /*
  3844   3844   ** CAPI3REF: Determine If A Prepared Statement Has Been Reset
  3845   3845   ** METHOD: sqlite3_stmt
  3846   3846   **
  3847   3847   ** ^The sqlite3_stmt_busy(S) interface returns true (non-zero) if the
  3848   3848   ** [prepared statement] S has been stepped at least once using 
................................................................................
  3855   3855   **
  3856   3856   ** This interface can be used in combination [sqlite3_next_stmt()]
  3857   3857   ** to locate all prepared statements associated with a database 
  3858   3858   ** connection that are in need of being reset.  This can be used,
  3859   3859   ** for example, in diagnostic routines to search for prepared 
  3860   3860   ** statements that are holding a transaction open.
  3861   3861   */
  3862         -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt*);
         3862  +SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt*);
  3863   3863   
  3864   3864   /*
  3865   3865   ** CAPI3REF: Dynamically Typed Value Object
  3866   3866   ** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
  3867   3867   **
  3868   3868   ** SQLite uses the sqlite3_value object to represent all values
  3869   3869   ** that can be stored in a database table. SQLite uses dynamic typing
................................................................................
  4019   4019   ** [SQLITE_MAX_LENGTH].
  4020   4020   ** ^[SQLITE_RANGE] is returned if the parameter
  4021   4021   ** index is out of range.  ^[SQLITE_NOMEM] is returned if malloc() fails.
  4022   4022   **
  4023   4023   ** See also: [sqlite3_bind_parameter_count()],
  4024   4024   ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].
  4025   4025   */
  4026         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
  4027         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
         4026  +SQLITE_API int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
         4027  +SQLITE_API int sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
  4028   4028                           void(*)(void*));
  4029         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt*, int, double);
  4030         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt*, int, int);
  4031         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
  4032         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt*, int);
  4033         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
  4034         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
  4035         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
         4029  +SQLITE_API int sqlite3_bind_double(sqlite3_stmt*, int, double);
         4030  +SQLITE_API int sqlite3_bind_int(sqlite3_stmt*, int, int);
         4031  +SQLITE_API int sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
         4032  +SQLITE_API int sqlite3_bind_null(sqlite3_stmt*, int);
         4033  +SQLITE_API int sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
         4034  +SQLITE_API int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
         4035  +SQLITE_API int sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
  4036   4036                            void(*)(void*), unsigned char encoding);
  4037         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
  4038         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
  4039         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
         4037  +SQLITE_API int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
         4038  +SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
         4039  +SQLITE_API int sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
  4040   4040   
  4041   4041   /*
  4042   4042   ** CAPI3REF: Number Of SQL Parameters
  4043   4043   ** METHOD: sqlite3_stmt
  4044   4044   **
  4045   4045   ** ^This routine can be used to find the number of [SQL parameters]
  4046   4046   ** in a [prepared statement].  SQL parameters are tokens of the
................................................................................
  4053   4053   ** number of unique parameters.  If parameters of the ?NNN form are used,
  4054   4054   ** there may be gaps in the list.)^
  4055   4055   **
  4056   4056   ** See also: [sqlite3_bind_blob|sqlite3_bind()],
  4057   4057   ** [sqlite3_bind_parameter_name()], and
  4058   4058   ** [sqlite3_bind_parameter_index()].
  4059   4059   */
  4060         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt*);
         4060  +SQLITE_API int sqlite3_bind_parameter_count(sqlite3_stmt*);
  4061   4061   
  4062   4062   /*
  4063   4063   ** CAPI3REF: Name Of A Host Parameter
  4064   4064   ** METHOD: sqlite3_stmt
  4065   4065   **
  4066   4066   ** ^The sqlite3_bind_parameter_name(P,N) interface returns
  4067   4067   ** the name of the N-th [SQL parameter] in the [prepared statement] P.
................................................................................
  4081   4081   ** originally specified as UTF-16 in [sqlite3_prepare16()] or
  4082   4082   ** [sqlite3_prepare16_v2()].
  4083   4083   **
  4084   4084   ** See also: [sqlite3_bind_blob|sqlite3_bind()],
  4085   4085   ** [sqlite3_bind_parameter_count()], and
  4086   4086   ** [sqlite3_bind_parameter_index()].
  4087   4087   */
  4088         -SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
         4088  +SQLITE_API const char *sqlite3_bind_parameter_name(sqlite3_stmt*, int);
  4089   4089   
  4090   4090   /*
  4091   4091   ** CAPI3REF: Index Of A Parameter With A Given Name
  4092   4092   ** METHOD: sqlite3_stmt
  4093   4093   **
  4094   4094   ** ^Return the index of an SQL parameter given its name.  ^The
  4095   4095   ** index value returned is suitable for use as the second
................................................................................
  4098   4098   ** name must be given in UTF-8 even if the original statement
  4099   4099   ** was prepared from UTF-16 text using [sqlite3_prepare16_v2()].
  4100   4100   **
  4101   4101   ** See also: [sqlite3_bind_blob|sqlite3_bind()],
  4102   4102   ** [sqlite3_bind_parameter_count()], and
  4103   4103   ** [sqlite3_bind_parameter_name()].
  4104   4104   */
  4105         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
         4105  +SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
  4106   4106   
  4107   4107   /*
  4108   4108   ** CAPI3REF: Reset All Bindings On A Prepared Statement
  4109   4109   ** METHOD: sqlite3_stmt
  4110   4110   **
  4111   4111   ** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset
  4112   4112   ** the [sqlite3_bind_blob | bindings] on a [prepared statement].
  4113   4113   ** ^Use this routine to reset all host parameters to NULL.
  4114   4114   */
  4115         -SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt*);
         4115  +SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt*);
  4116   4116   
  4117   4117   /*
  4118   4118   ** CAPI3REF: Number Of Columns In A Result Set
  4119   4119   ** METHOD: sqlite3_stmt
  4120   4120   **
  4121   4121   ** ^Return the number of columns in the result set returned by the
  4122   4122   ** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
  4123   4123   ** statement that does not return data (for example an [UPDATE]).
  4124   4124   **
  4125   4125   ** See also: [sqlite3_data_count()]
  4126   4126   */
  4127         -SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt);
         4127  +SQLITE_API int sqlite3_column_count(sqlite3_stmt *pStmt);
  4128   4128   
  4129   4129   /*
  4130   4130   ** CAPI3REF: Column Names In A Result Set
  4131   4131   ** METHOD: sqlite3_stmt
  4132   4132   **
  4133   4133   ** ^These routines return the name assigned to a particular column
  4134   4134   ** in the result set of a [SELECT] statement.  ^The sqlite3_column_name()
................................................................................
  4149   4149   ** NULL pointer is returned.
  4150   4150   **
  4151   4151   ** ^The name of a result column is the value of the "AS" clause for
  4152   4152   ** that column, if there is an AS clause.  If there is no AS clause
  4153   4153   ** then the name of the column is unspecified and may change from
  4154   4154   ** one release of SQLite to the next.
  4155   4155   */
  4156         -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt*, int N);
  4157         -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt*, int N);
         4156  +SQLITE_API const char *sqlite3_column_name(sqlite3_stmt*, int N);
         4157  +SQLITE_API const void *sqlite3_column_name16(sqlite3_stmt*, int N);
  4158   4158   
  4159   4159   /*
  4160   4160   ** CAPI3REF: Source Of Data In A Query Result
  4161   4161   ** METHOD: sqlite3_stmt
  4162   4162   **
  4163   4163   ** ^These routines provide a means to determine the database, table, and
  4164   4164   ** table column that is the origin of a particular result column in
................................................................................
  4198   4198   ** undefined.
  4199   4199   **
  4200   4200   ** If two or more threads call one or more
  4201   4201   ** [sqlite3_column_database_name | column metadata interfaces]
  4202   4202   ** for the same [prepared statement] and result column
  4203   4203   ** at the same time then the results are undefined.
  4204   4204   */
  4205         -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int);
  4206         -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int);
  4207         -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int);
  4208         -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int);
  4209         -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int);
  4210         -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
         4205  +SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int);
         4206  +SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int);
         4207  +SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int);
         4208  +SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int);
         4209  +SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int);
         4210  +SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);
  4211   4211   
  4212   4212   /*
  4213   4213   ** CAPI3REF: Declared Datatype Of A Query Result
  4214   4214   ** METHOD: sqlite3_stmt
  4215   4215   **
  4216   4216   ** ^(The first parameter is a [prepared statement].
  4217   4217   ** If this statement is a [SELECT] statement and the Nth column of the
................................................................................
  4235   4235   ** ^SQLite uses dynamic run-time typing.  ^So just because a column
  4236   4236   ** is declared to contain a particular type does not mean that the
  4237   4237   ** data stored in that column is of the declared type.  SQLite is
  4238   4238   ** strongly typed, but the typing is dynamic not static.  ^Type
  4239   4239   ** is associated with individual values, not with the containers
  4240   4240   ** used to hold those values.
  4241   4241   */
  4242         -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt*,int);
  4243         -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt*,int);
         4242  +SQLITE_API const char *sqlite3_column_decltype(sqlite3_stmt*,int);
         4243  +SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int);
  4244   4244   
  4245   4245   /*
  4246   4246   ** CAPI3REF: Evaluate An SQL Statement
  4247   4247   ** METHOD: sqlite3_stmt
  4248   4248   **
  4249   4249   ** After a [prepared statement] has been prepared using either
  4250   4250   ** [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] or one of the legacy
................................................................................
  4316   4316   ** We admit that this is a goofy design.  The problem has been fixed
  4317   4317   ** with the "v2" interface.  If you prepare all of your SQL statements
  4318   4318   ** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
  4319   4319   ** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,
  4320   4320   ** then the more specific [error codes] are returned directly
  4321   4321   ** by sqlite3_step().  The use of the "v2" interface is recommended.
  4322   4322   */
  4323         -SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt*);
         4323  +SQLITE_API int sqlite3_step(sqlite3_stmt*);
  4324   4324   
  4325   4325   /*
  4326   4326   ** CAPI3REF: Number of columns in a result set
  4327   4327   ** METHOD: sqlite3_stmt
  4328   4328   **
  4329   4329   ** ^The sqlite3_data_count(P) interface returns the number of columns in the
  4330   4330   ** current row of the result set of [prepared statement] P.
................................................................................
  4337   4337   ** will return non-zero if previous call to [sqlite3_step](P) returned
  4338   4338   ** [SQLITE_ROW], except in the case of the [PRAGMA incremental_vacuum]
  4339   4339   ** where it always returns zero since each step of that multi-step
  4340   4340   ** pragma returns 0 columns of data.
  4341   4341   **
  4342   4342   ** See also: [sqlite3_column_count()]
  4343   4343   */
  4344         -SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt);
         4344  +SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt);
  4345   4345   
  4346   4346   /*
  4347   4347   ** CAPI3REF: Fundamental Datatypes
  4348   4348   ** KEYWORDS: SQLITE_TEXT
  4349   4349   **
  4350   4350   ** ^(Every value in SQLite has one of five fundamental datatypes:
  4351   4351   **
................................................................................
  4527   4527   **
  4528   4528   ** ^(If a memory allocation error occurs during the evaluation of any
  4529   4529   ** of these routines, a default value is returned.  The default value
  4530   4530   ** is either the integer 0, the floating point number 0.0, or a NULL
  4531   4531   ** pointer.  Subsequent calls to [sqlite3_errcode()] will return
  4532   4532   ** [SQLITE_NOMEM].)^
  4533   4533   */
  4534         -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt*, int iCol);
  4535         -SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt*, int iCol);
  4536         -SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
  4537         -SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt*, int iCol);
  4538         -SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt*, int iCol);
  4539         -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt*, int iCol);
  4540         -SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt*, int iCol);
  4541         -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt*, int iCol);
  4542         -SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt*, int iCol);
  4543         -SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt*, int iCol);
         4534  +SQLITE_API const void *sqlite3_column_blob(sqlite3_stmt*, int iCol);
         4535  +SQLITE_API int sqlite3_column_bytes(sqlite3_stmt*, int iCol);
         4536  +SQLITE_API int sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
         4537  +SQLITE_API double sqlite3_column_double(sqlite3_stmt*, int iCol);
         4538  +SQLITE_API int sqlite3_column_int(sqlite3_stmt*, int iCol);
         4539  +SQLITE_API sqlite3_int64 sqlite3_column_int64(sqlite3_stmt*, int iCol);
         4540  +SQLITE_API const unsigned char *sqlite3_column_text(sqlite3_stmt*, int iCol);
         4541  +SQLITE_API const void *sqlite3_column_text16(sqlite3_stmt*, int iCol);
         4542  +SQLITE_API int sqlite3_column_type(sqlite3_stmt*, int iCol);
         4543  +SQLITE_API sqlite3_value *sqlite3_column_value(sqlite3_stmt*, int iCol);
  4544   4544   
  4545   4545   /*
  4546   4546   ** CAPI3REF: Destroy A Prepared Statement Object
  4547   4547   ** DESTRUCTOR: sqlite3_stmt
  4548   4548   **
  4549   4549   ** ^The sqlite3_finalize() function is called to delete a [prepared statement].
  4550   4550   ** ^If the most recent evaluation of the statement encountered no errors
................................................................................
  4564   4564   **
  4565   4565   ** The application must finalize every [prepared statement] in order to avoid
  4566   4566   ** resource leaks.  It is a grievous error for the application to try to use
  4567   4567   ** a prepared statement after it has been finalized.  Any use of a prepared
  4568   4568   ** statement after it has been finalized can result in undefined and
  4569   4569   ** undesirable behavior such as segfaults and heap corruption.
  4570   4570   */
  4571         -SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt);
         4571  +SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt);
  4572   4572   
  4573   4573   /*
  4574   4574   ** CAPI3REF: Reset A Prepared Statement Object
  4575   4575   ** METHOD: sqlite3_stmt
  4576   4576   **
  4577   4577   ** The sqlite3_reset() function is called to reset a [prepared statement]
  4578   4578   ** object back to its initial state, ready to be re-executed.
................................................................................
  4591   4591   ** ^If the most recent call to [sqlite3_step(S)] for the
  4592   4592   ** [prepared statement] S indicated an error, then
  4593   4593   ** [sqlite3_reset(S)] returns an appropriate [error code].
  4594   4594   **
  4595   4595   ** ^The [sqlite3_reset(S)] interface does not change the values
  4596   4596   ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
  4597   4597   */
  4598         -SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt);
         4598  +SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt);
  4599   4599   
  4600   4600   /*
  4601   4601   ** CAPI3REF: Create Or Redefine SQL Functions
  4602   4602   ** KEYWORDS: {function creation routines}
  4603   4603   ** KEYWORDS: {application-defined SQL function}
  4604   4604   ** KEYWORDS: {application-defined SQL functions}
  4605   4605   ** METHOD: sqlite3
................................................................................
  4691   4691   ** ^Built-in functions may be overloaded by new application-defined functions.
  4692   4692   **
  4693   4693   ** ^An application-defined function is permitted to call other
  4694   4694   ** SQLite interfaces.  However, such calls must not
  4695   4695   ** close the database connection nor finalize or reset the prepared
  4696   4696   ** statement in which the function is running.
  4697   4697   */
  4698         -SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
         4698  +SQLITE_API int sqlite3_create_function(
  4699   4699     sqlite3 *db,
  4700   4700     const char *zFunctionName,
  4701   4701     int nArg,
  4702   4702     int eTextRep,
  4703   4703     void *pApp,
  4704   4704     void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
  4705   4705     void (*xStep)(sqlite3_context*,int,sqlite3_value**),
  4706   4706     void (*xFinal)(sqlite3_context*)
  4707   4707   );
  4708         -SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
         4708  +SQLITE_API int sqlite3_create_function16(
  4709   4709     sqlite3 *db,
  4710   4710     const void *zFunctionName,
  4711   4711     int nArg,
  4712   4712     int eTextRep,
  4713   4713     void *pApp,
  4714   4714     void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
  4715   4715     void (*xStep)(sqlite3_context*,int,sqlite3_value**),
  4716   4716     void (*xFinal)(sqlite3_context*)
  4717   4717   );
  4718         -SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
         4718  +SQLITE_API int sqlite3_create_function_v2(
  4719   4719     sqlite3 *db,
  4720   4720     const char *zFunctionName,
  4721   4721     int nArg,
  4722   4722     int eTextRep,
  4723   4723     void *pApp,
  4724   4724     void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
  4725   4725     void (*xStep)(sqlite3_context*,int,sqlite3_value**),
................................................................................
  4757   4757   ** These functions are [deprecated].  In order to maintain
  4758   4758   ** backwards compatibility with older code, these functions continue 
  4759   4759   ** to be supported.  However, new applications should avoid
  4760   4760   ** the use of these functions.  To encourage programmers to avoid
  4761   4761   ** these functions, we will not explain what they do.
  4762   4762   */
  4763   4763   #ifndef SQLITE_OMIT_DEPRECATED
  4764         -SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context*);
  4765         -SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt*);
  4766         -SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
  4767         -SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_global_recover(void);
  4768         -SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_thread_cleanup(void);
  4769         -SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
         4764  +SQLITE_API SQLITE_DEPRECATED int sqlite3_aggregate_count(sqlite3_context*);
         4765  +SQLITE_API SQLITE_DEPRECATED int sqlite3_expired(sqlite3_stmt*);
         4766  +SQLITE_API SQLITE_DEPRECATED int sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
         4767  +SQLITE_API SQLITE_DEPRECATED int sqlite3_global_recover(void);
         4768  +SQLITE_API SQLITE_DEPRECATED void sqlite3_thread_cleanup(void);
         4769  +SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
  4770   4770                         void*,sqlite3_int64);
  4771   4771   #endif
  4772   4772   
  4773   4773   /*
  4774   4774   ** CAPI3REF: Obtaining SQL Values
  4775   4775   ** METHOD: sqlite3_value
  4776   4776   **
................................................................................
  4812   4812   ** [sqlite3_value_text16()] can be invalidated by a subsequent call to
  4813   4813   ** [sqlite3_value_bytes()], [sqlite3_value_bytes16()], [sqlite3_value_text()],
  4814   4814   ** or [sqlite3_value_text16()].
  4815   4815   **
  4816   4816   ** These routines must be called from the same thread as
  4817   4817   ** the SQL function that supplied the [sqlite3_value*] parameters.
  4818   4818   */
  4819         -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value*);
  4820         -SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value*);
  4821         -SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value*);
  4822         -SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value*);
  4823         -SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value*);
  4824         -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value*);
  4825         -SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value*);
  4826         -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value*);
  4827         -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value*);
  4828         -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*);
  4829         -SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*);
  4830         -SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*);
         4819  +SQLITE_API const void *sqlite3_value_blob(sqlite3_value*);
         4820  +SQLITE_API int sqlite3_value_bytes(sqlite3_value*);
         4821  +SQLITE_API int sqlite3_value_bytes16(sqlite3_value*);
         4822  +SQLITE_API double sqlite3_value_double(sqlite3_value*);
         4823  +SQLITE_API int sqlite3_value_int(sqlite3_value*);
         4824  +SQLITE_API sqlite3_int64 sqlite3_value_int64(sqlite3_value*);
         4825  +SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value*);
         4826  +SQLITE_API const void *sqlite3_value_text16(sqlite3_value*);
         4827  +SQLITE_API const void *sqlite3_value_text16le(sqlite3_value*);
         4828  +SQLITE_API const void *sqlite3_value_text16be(sqlite3_value*);
         4829  +SQLITE_API int sqlite3_value_type(sqlite3_value*);
         4830  +SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*);
  4831   4831   
  4832   4832   /*
  4833   4833   ** CAPI3REF: Finding The Subtype Of SQL Values
  4834   4834   ** METHOD: sqlite3_value
  4835   4835   **
  4836   4836   ** The sqlite3_value_subtype(V) function returns the subtype for
  4837   4837   ** an [application-defined SQL function] argument V.  The subtype
................................................................................
  4839   4839   ** one SQL function to another.  Use the [sqlite3_result_subtype()]
  4840   4840   ** routine to set the subtype for the return value of an SQL function.
  4841   4841   **
  4842   4842   ** SQLite makes no use of subtype itself.  It merely passes the subtype
  4843   4843   ** from the result of one [application-defined SQL function] into the
  4844   4844   ** input of another.
  4845   4845   */
  4846         -SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value*);
         4846  +SQLITE_API unsigned int sqlite3_value_subtype(sqlite3_value*);
  4847   4847   
  4848   4848   /*
  4849   4849   ** CAPI3REF: Copy And Free SQL Values
  4850   4850   ** METHOD: sqlite3_value
  4851   4851   **
  4852   4852   ** ^The sqlite3_value_dup(V) interface makes a copy of the [sqlite3_value]
  4853   4853   ** object D and returns a pointer to that copy.  ^The [sqlite3_value] returned
................................................................................
  4855   4855   ** ^The sqlite3_value_dup(V) interface returns NULL if V is NULL or if a
  4856   4856   ** memory allocation fails.
  4857   4857   **
  4858   4858   ** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object
  4859   4859   ** previously obtained from [sqlite3_value_dup()].  ^If V is a NULL pointer
  4860   4860   ** then sqlite3_value_free(V) is a harmless no-op.
  4861   4861   */
  4862         -SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value*);
  4863         -SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value*);
         4862  +SQLITE_API sqlite3_value *sqlite3_value_dup(const sqlite3_value*);
         4863  +SQLITE_API void sqlite3_value_free(sqlite3_value*);
  4864   4864   
  4865   4865   /*
  4866   4866   ** CAPI3REF: Obtain Aggregate Function Context
  4867   4867   ** METHOD: sqlite3_context
  4868   4868   **
  4869   4869   ** Implementations of aggregate SQL functions use this
  4870   4870   ** routine to allocate memory for storing their state.
................................................................................
  4901   4901   ** [sqlite3_context | SQL function context] that is the first parameter
  4902   4902   ** to the xStep or xFinal callback routine that implements the aggregate
  4903   4903   ** function.
  4904   4904   **
  4905   4905   ** This routine must be called from the same thread in which
  4906   4906   ** the aggregate SQL function is running.
  4907   4907   */
  4908         -SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
         4908  +SQLITE_API void *sqlite3_aggregate_context(sqlite3_context*, int nBytes);
  4909   4909   
  4910   4910   /*
  4911   4911   ** CAPI3REF: User Data For Functions
  4912   4912   ** METHOD: sqlite3_context
  4913   4913   **
  4914   4914   ** ^The sqlite3_user_data() interface returns a copy of
  4915   4915   ** the pointer that was the pUserData parameter (the 5th parameter)
................................................................................
  4916   4916   ** of the [sqlite3_create_function()]
  4917   4917   ** and [sqlite3_create_function16()] routines that originally
  4918   4918   ** registered the application defined function.
  4919   4919   **
  4920   4920   ** This routine must be called from the same thread in which
  4921   4921   ** the application-defined function is running.
  4922   4922   */
  4923         -SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context*);
         4923  +SQLITE_API void *sqlite3_user_data(sqlite3_context*);
  4924   4924   
  4925   4925   /*
  4926   4926   ** CAPI3REF: Database Connection For Functions
  4927   4927   ** METHOD: sqlite3_context
  4928   4928   **
  4929   4929   ** ^The sqlite3_context_db_handle() interface returns a copy of
  4930   4930   ** the pointer to the [database connection] (the 1st parameter)
  4931   4931   ** of the [sqlite3_create_function()]
  4932   4932   ** and [sqlite3_create_function16()] routines that originally
  4933   4933   ** registered the application defined function.
  4934   4934   */
  4935         -SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context*);
         4935  +SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*);
  4936   4936   
  4937   4937   /*
  4938   4938   ** CAPI3REF: Function Auxiliary Data
  4939   4939   ** METHOD: sqlite3_context
  4940   4940   **
  4941   4941   ** These functions may be used by (non-aggregate) SQL functions to
  4942   4942   ** associate metadata with argument values. If the same value is passed to
................................................................................
  4982   4982   ** ^(In practice, metadata is preserved between function calls for
  4983   4983   ** function parameters that are compile-time constants, including literal
  4984   4984   ** values and [parameters] and expressions composed from the same.)^
  4985   4985   **
  4986   4986   ** These routines must be called from the same thread in which
  4987   4987   ** the SQL function is running.
  4988   4988   */
  4989         -SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context*, int N);
  4990         -SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
         4989  +SQLITE_API void *sqlite3_get_auxdata(sqlite3_context*, int N);
         4990  +SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
  4991   4991   
  4992   4992   
  4993   4993   /*
  4994   4994   ** CAPI3REF: Constants Defining Special Destructor Behavior
  4995   4995   **
  4996   4996   ** These are special values for the destructor that is passed in as the
  4997   4997   ** final argument to routines like [sqlite3_result_blob()].  ^If the destructor
................................................................................
  5119   5119   ** [unprotected sqlite3_value] object is required, so either
  5120   5120   ** kind of [sqlite3_value] object can be used with this interface.
  5121   5121   **
  5122   5122   ** If these routines are called from within the different thread
  5123   5123   ** than the one containing the application-defined function that received
  5124   5124   ** the [sqlite3_context] pointer, the results are undefined.
  5125   5125   */
  5126         -SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
  5127         -SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(sqlite3_context*,const void*,
         5126  +SQLITE_API void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
         5127  +SQLITE_API void sqlite3_result_blob64(sqlite3_context*,const void*,
  5128   5128                              sqlite3_uint64,void(*)(void*));
  5129         -SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context*, double);
  5130         -SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context*, const char*, int);
  5131         -SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context*, const void*, int);
  5132         -SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context*);
  5133         -SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context*);
  5134         -SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context*, int);
  5135         -SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context*, int);
  5136         -SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
  5137         -SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context*);
  5138         -SQLITE_API void SQLITE_STDCALL sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
  5139         -SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
         5129  +SQLITE_API void sqlite3_result_double(sqlite3_context*, double);
         5130  +SQLITE_API void sqlite3_result_error(sqlite3_context*, const char*, int);
         5131  +SQLITE_API void sqlite3_result_error16(sqlite3_context*, const void*, int);
         5132  +SQLITE_API void sqlite3_result_error_toobig(sqlite3_context*);
         5133  +SQLITE_API void sqlite3_result_error_nomem(sqlite3_context*);
         5134  +SQLITE_API void sqlite3_result_error_code(sqlite3_context*, int);
         5135  +SQLITE_API void sqlite3_result_int(sqlite3_context*, int);
         5136  +SQLITE_API void sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
         5137  +SQLITE_API void sqlite3_result_null(sqlite3_context*);
         5138  +SQLITE_API void sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
         5139  +SQLITE_API void sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
  5140   5140                              void(*)(void*), unsigned char encoding);
  5141         -SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
  5142         -SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
  5143         -SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
  5144         -SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
  5145         -SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n);
  5146         -SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
         5141  +SQLITE_API void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
         5142  +SQLITE_API void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
         5143  +SQLITE_API void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
         5144  +SQLITE_API void sqlite3_result_value(sqlite3_context*, sqlite3_value*);
         5145  +SQLITE_API void sqlite3_result_zeroblob(sqlite3_context*, int n);
         5146  +SQLITE_API int sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
  5147   5147   
  5148   5148   
  5149   5149   /*
  5150   5150   ** CAPI3REF: Setting The Subtype Of An SQL Function
  5151   5151   ** METHOD: sqlite3_context
  5152   5152   **
  5153   5153   ** The sqlite3_result_subtype(C,T) function causes the subtype of
................................................................................
  5154   5154   ** the result from the [application-defined SQL function] with 
  5155   5155   ** [sqlite3_context] C to be the value T.  Only the lower 8 bits 
  5156   5156   ** of the subtype T are preserved in current versions of SQLite;
  5157   5157   ** higher order bits are discarded.
  5158   5158   ** The number of subtype bytes preserved by SQLite might increase
  5159   5159   ** in future releases of SQLite.
  5160   5160   */
  5161         -SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context*,unsigned int);
         5161  +SQLITE_API void sqlite3_result_subtype(sqlite3_context*,unsigned int);
  5162   5162   
  5163   5163   /*
  5164   5164   ** CAPI3REF: Define New Collating Sequences
  5165   5165   ** METHOD: sqlite3
  5166   5166   **
  5167   5167   ** ^These functions add, remove, or modify a [collation] associated
  5168   5168   ** with the [database connection] specified as the first argument.
................................................................................
  5236   5236   ** themselves rather than expecting SQLite to deal with it for them.
  5237   5237   ** This is different from every other SQLite interface.  The inconsistency 
  5238   5238   ** is unfortunate but cannot be changed without breaking backwards 
  5239   5239   ** compatibility.
  5240   5240   **
  5241   5241   ** See also:  [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].
  5242   5242   */
  5243         -SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
         5243  +SQLITE_API int sqlite3_create_collation(
  5244   5244     sqlite3*, 
  5245   5245     const char *zName, 
  5246   5246     int eTextRep, 
  5247   5247     void *pArg,
  5248   5248     int(*xCompare)(void*,int,const void*,int,const void*)
  5249   5249   );
  5250         -SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
         5250  +SQLITE_API int sqlite3_create_collation_v2(
  5251   5251     sqlite3*, 
  5252   5252     const char *zName, 
  5253   5253     int eTextRep, 
  5254   5254     void *pArg,
  5255   5255     int(*xCompare)(void*,int,const void*,int,const void*),
  5256   5256     void(*xDestroy)(void*)
  5257   5257   );
  5258         -SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
         5258  +SQLITE_API int sqlite3_create_collation16(
  5259   5259     sqlite3*, 
  5260   5260     const void *zName,
  5261   5261     int eTextRep, 
  5262   5262     void *pArg,
  5263   5263     int(*xCompare)(void*,int,const void*,int,const void*)
  5264   5264   );
  5265   5265   
................................................................................
  5286   5286   ** sequence function required.  The fourth parameter is the name of the
  5287   5287   ** required collation sequence.)^
  5288   5288   **
  5289   5289   ** The callback function should register the desired collation using
  5290   5290   ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or
  5291   5291   ** [sqlite3_create_collation_v2()].
  5292   5292   */
  5293         -SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
         5293  +SQLITE_API int sqlite3_collation_needed(
  5294   5294     sqlite3*, 
  5295   5295     void*, 
  5296   5296     void(*)(void*,sqlite3*,int eTextRep,const char*)
  5297   5297   );
  5298         -SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
         5298  +SQLITE_API int sqlite3_collation_needed16(
  5299   5299     sqlite3*, 
  5300   5300     void*,
  5301   5301     void(*)(void*,sqlite3*,int eTextRep,const void*)
  5302   5302   );
  5303   5303   
  5304   5304   #ifdef SQLITE_HAS_CODEC
  5305   5305   /*
  5306   5306   ** Specify the key for an encrypted database.  This routine should be
  5307   5307   ** called right after sqlite3_open().
  5308   5308   **
  5309   5309   ** The code to implement this API is not available in the public release
  5310   5310   ** of SQLite.
  5311   5311   */
  5312         -SQLITE_API int SQLITE_STDCALL sqlite3_key(
         5312  +SQLITE_API int sqlite3_key(
  5313   5313     sqlite3 *db,                   /* Database to be rekeyed */
  5314   5314     const void *pKey, int nKey     /* The key */
  5315   5315   );
  5316         -SQLITE_API int SQLITE_STDCALL sqlite3_key_v2(
         5316  +SQLITE_API int sqlite3_key_v2(
  5317   5317     sqlite3 *db,                   /* Database to be rekeyed */
  5318   5318     const char *zDbName,           /* Name of the database */
  5319   5319     const void *pKey, int nKey     /* The key */
  5320   5320   );
  5321   5321   
  5322   5322   /*
  5323   5323   ** Change the key on an open database.  If the current database is not
  5324   5324   ** encrypted, this routine will encrypt it.  If pNew==0 or nNew==0, the
  5325   5325   ** database is decrypted.
  5326   5326   **
  5327   5327   ** The code to implement this API is not available in the public release
  5328   5328   ** of SQLite.
  5329   5329   */
  5330         -SQLITE_API int SQLITE_STDCALL sqlite3_rekey(
         5330  +SQLITE_API int sqlite3_rekey(
  5331   5331     sqlite3 *db,                   /* Database to be rekeyed */
  5332   5332     const void *pKey, int nKey     /* The new key */
  5333   5333   );
  5334         -SQLITE_API int SQLITE_STDCALL sqlite3_rekey_v2(
         5334  +SQLITE_API int sqlite3_rekey_v2(
  5335   5335     sqlite3 *db,                   /* Database to be rekeyed */
  5336   5336     const char *zDbName,           /* Name of the database */
  5337   5337     const void *pKey, int nKey     /* The new key */
  5338   5338   );
  5339   5339   
  5340   5340   /*
  5341   5341   ** Specify the activation key for a SEE database.  Unless 
  5342   5342   ** activated, none of the SEE routines will work.
  5343   5343   */
  5344         -SQLITE_API void SQLITE_STDCALL sqlite3_activate_see(
         5344  +SQLITE_API void sqlite3_activate_see(
  5345   5345     const char *zPassPhrase        /* Activation phrase */
  5346   5346   );
  5347   5347   #endif
  5348   5348   
  5349   5349   #ifdef SQLITE_ENABLE_CEROD
  5350   5350   /*
  5351   5351   ** Specify the activation key for a CEROD database.  Unless 
  5352   5352   ** activated, none of the CEROD routines will work.
  5353   5353   */
  5354         -SQLITE_API void SQLITE_STDCALL sqlite3_activate_cerod(
         5354  +SQLITE_API void sqlite3_activate_cerod(
  5355   5355     const char *zPassPhrase        /* Activation phrase */
  5356   5356   );
  5357   5357   #endif
  5358   5358   
  5359   5359   /*
  5360   5360   ** CAPI3REF: Suspend Execution For A Short Time
  5361   5361   **
................................................................................
  5369   5369   **
  5370   5370   ** ^SQLite implements this interface by calling the xSleep()
  5371   5371   ** method of the default [sqlite3_vfs] object.  If the xSleep() method
  5372   5372   ** of the default VFS is not implemented correctly, or not implemented at
  5373   5373   ** all, then the behavior of sqlite3_sleep() may deviate from the description
  5374   5374   ** in the previous paragraphs.
  5375   5375   */
  5376         -SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int);
         5376  +SQLITE_API int sqlite3_sleep(int);
  5377   5377   
  5378   5378   /*
  5379   5379   ** CAPI3REF: Name Of The Folder Holding Temporary Files
  5380   5380   **
  5381   5381   ** ^(If this global variable is made to point to a string which is
  5382   5382   ** the name of a folder (a.k.a. directory), then all temporary files
  5383   5383   ** created by SQLite when using a built-in [sqlite3_vfs | VFS]
................................................................................
  5488   5488   ** find out whether SQLite automatically rolled back the transaction after
  5489   5489   ** an error is to use this function.
  5490   5490   **
  5491   5491   ** If another thread changes the autocommit status of the database
  5492   5492   ** connection while this routine is running, then the return value
  5493   5493   ** is undefined.
  5494   5494   */
  5495         -SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3*);
         5495  +SQLITE_API int sqlite3_get_autocommit(sqlite3*);
  5496   5496   
  5497   5497   /*
  5498   5498   ** CAPI3REF: Find The Database Handle Of A Prepared Statement
  5499   5499   ** METHOD: sqlite3_stmt
  5500   5500   **
  5501   5501   ** ^The sqlite3_db_handle interface returns the [database connection] handle
  5502   5502   ** to which a [prepared statement] belongs.  ^The [database connection]
  5503   5503   ** returned by sqlite3_db_handle is the same [database connection]
  5504   5504   ** that was the first argument
  5505   5505   ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
  5506   5506   ** create the statement in the first place.
  5507   5507   */
  5508         -SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt*);
         5508  +SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*);
  5509   5509   
  5510   5510   /*
  5511   5511   ** CAPI3REF: Return The Filename For A Database Connection
  5512   5512   ** METHOD: sqlite3
  5513   5513   **
  5514   5514   ** ^The sqlite3_db_filename(D,N) interface returns a pointer to a filename
  5515   5515   ** associated with database N of connection D.  ^The main database file
................................................................................
  5518   5518   ** a NULL pointer is returned.
  5519   5519   **
  5520   5520   ** ^The filename returned by this function is the output of the
  5521   5521   ** xFullPathname method of the [VFS].  ^In other words, the filename
  5522   5522   ** will be an absolute pathname, even if the filename used
  5523   5523   ** to open the database originally was a URI or relative pathname.
  5524   5524   */
  5525         -SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
         5525  +SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName);
  5526   5526   
  5527   5527   /*
  5528   5528   ** CAPI3REF: Determine if a database is read-only
  5529   5529   ** METHOD: sqlite3
  5530   5530   **
  5531   5531   ** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N
  5532   5532   ** of connection D is read-only, 0 if it is read/write, or -1 if N is not
  5533   5533   ** the name of a database on connection D.
  5534   5534   */
  5535         -SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
         5535  +SQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
  5536   5536   
  5537   5537   /*
  5538   5538   ** CAPI3REF: Find the next prepared statement
  5539   5539   ** METHOD: sqlite3
  5540   5540   **
  5541   5541   ** ^This interface returns a pointer to the next [prepared statement] after
  5542   5542   ** pStmt associated with the [database connection] pDb.  ^If pStmt is NULL
................................................................................
  5544   5544   ** associated with the database connection pDb.  ^If no prepared statement
  5545   5545   ** satisfies the conditions of this routine, it returns NULL.
  5546   5546   **
  5547   5547   ** The [database connection] pointer D in a call to
  5548   5548   ** [sqlite3_next_stmt(D,S)] must refer to an open database
  5549   5549   ** connection and in particular must not be a NULL pointer.
  5550   5550   */
  5551         -SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
         5551  +SQLITE_API sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
  5552   5552   
  5553   5553   /*
  5554   5554   ** CAPI3REF: Commit And Rollback Notification Callbacks
  5555   5555   ** METHOD: sqlite3
  5556   5556   **
  5557   5557   ** ^The sqlite3_commit_hook() interface registers a callback
  5558   5558   ** function to be invoked whenever a transaction is [COMMIT | committed].
................................................................................
  5593   5593   ** rolled back if an explicit "ROLLBACK" statement is executed, or
  5594   5594   ** an error or constraint causes an implicit rollback to occur.
  5595   5595   ** ^The rollback callback is not invoked if a transaction is
  5596   5596   ** automatically rolled back because the database connection is closed.
  5597   5597   **
  5598   5598   ** See also the [sqlite3_update_hook()] interface.
  5599   5599   */
  5600         -SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
  5601         -SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
         5600  +SQLITE_API void *sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
         5601  +SQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
  5602   5602   
  5603   5603   /*
  5604   5604   ** CAPI3REF: Data Change Notification Callbacks
  5605   5605   ** METHOD: sqlite3
  5606   5606   **
  5607   5607   ** ^The sqlite3_update_hook() interface registers a callback function
  5608   5608   ** with the [database connection] identified by the first argument
................................................................................
  5645   5645   ** returns the P argument from the previous call
  5646   5646   ** on the same [database connection] D, or NULL for
  5647   5647   ** the first call on D.
  5648   5648   **
  5649   5649   ** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()],
  5650   5650   ** and [sqlite3_preupdate_hook()] interfaces.
  5651   5651   */
  5652         -SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
         5652  +SQLITE_API void *sqlite3_update_hook(
  5653   5653     sqlite3*, 
  5654   5654     void(*)(void *,int ,char const *,char const *,sqlite3_int64),
  5655   5655     void*
  5656   5656   );
  5657   5657   
  5658   5658   /*
  5659   5659   ** CAPI3REF: Enable Or Disable Shared Pager Cache
................................................................................
  5685   5685   ** [sqlite3_open_v2()] with [SQLITE_OPEN_SHAREDCACHE].
  5686   5686   **
  5687   5687   ** This interface is threadsafe on processors where writing a
  5688   5688   ** 32-bit integer is atomic.
  5689   5689   **
  5690   5690   ** See Also:  [SQLite Shared-Cache Mode]
  5691   5691   */
  5692         -SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int);
         5692  +SQLITE_API int sqlite3_enable_shared_cache(int);
  5693   5693   
  5694   5694   /*
  5695   5695   ** CAPI3REF: Attempt To Free Heap Memory
  5696   5696   **
  5697   5697   ** ^The sqlite3_release_memory() interface attempts to free N bytes
  5698   5698   ** of heap memory by deallocating non-essential memory allocations
  5699   5699   ** held by the database library.   Memory used to cache database
................................................................................
  5701   5701   ** ^sqlite3_release_memory() returns the number of bytes actually freed,
  5702   5702   ** which might be more or less than the amount requested.
  5703   5703   ** ^The sqlite3_release_memory() routine is a no-op returning zero
  5704   5704   ** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].
  5705   5705   **
  5706   5706   ** See also: [sqlite3_db_release_memory()]
  5707   5707   */
  5708         -SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int);
         5708  +SQLITE_API int sqlite3_release_memory(int);
  5709   5709   
  5710   5710   /*
  5711   5711   ** CAPI3REF: Free Memory Used By A Database Connection
  5712   5712   ** METHOD: sqlite3
  5713   5713   **
  5714   5714   ** ^The sqlite3_db_release_memory(D) interface attempts to free as much heap
  5715   5715   ** memory as possible from database connection D. Unlike the
  5716   5716   ** [sqlite3_release_memory()] interface, this interface is in effect even
  5717   5717   ** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
  5718   5718   ** omitted.
  5719   5719   **
  5720   5720   ** See also: [sqlite3_release_memory()]
  5721   5721   */
  5722         -SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3*);
         5722  +SQLITE_API int sqlite3_db_release_memory(sqlite3*);
  5723   5723   
  5724   5724   /*
  5725   5725   ** CAPI3REF: Impose A Limit On Heap Size
  5726   5726   **
  5727   5727   ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the
  5728   5728   ** soft limit on the amount of heap memory that may be allocated by SQLite.
  5729   5729   ** ^SQLite strives to keep heap memory utilization below the soft heap
................................................................................
  5767   5767   ** the page cache is the predominate memory user in SQLite, most
  5768   5768   ** applications will achieve adequate soft heap limit enforcement without
  5769   5769   ** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT].
  5770   5770   **
  5771   5771   ** The circumstances under which SQLite will enforce the soft heap limit may
  5772   5772   ** changes in future releases of SQLite.
  5773   5773   */
  5774         -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
         5774  +SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 N);
  5775   5775   
  5776   5776   /*
  5777   5777   ** CAPI3REF: Deprecated Soft Heap Limit Interface
  5778   5778   ** DEPRECATED
  5779   5779   **
  5780   5780   ** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
  5781   5781   ** interface.  This routine is provided for historical compatibility
  5782   5782   ** only.  All new applications should use the
  5783   5783   ** [sqlite3_soft_heap_limit64()] interface rather than this one.
  5784   5784   */
  5785         -SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_soft_heap_limit(int N);
         5785  +SQLITE_API SQLITE_DEPRECATED void sqlite3_soft_heap_limit(int N);
  5786   5786   
  5787   5787   
  5788   5788   /*
  5789   5789   ** CAPI3REF: Extract Metadata About A Column Of A Table
  5790   5790   ** METHOD: sqlite3
  5791   5791   **
  5792   5792   ** ^(The sqlite3_table_column_metadata(X,D,T,C,....) routine returns
................................................................................
  5848   5848   **     auto increment: 0
  5849   5849   ** </pre>)^
  5850   5850   **
  5851   5851   ** ^This function causes all database schemas to be read from disk and
  5852   5852   ** parsed, if that has not already been done, and returns an error if
  5853   5853   ** any errors are encountered while loading the schema.
  5854   5854   */
  5855         -SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
         5855  +SQLITE_API int sqlite3_table_column_metadata(
  5856   5856     sqlite3 *db,                /* Connection handle */
  5857   5857     const char *zDbName,        /* Database name or NULL */
  5858   5858     const char *zTableName,     /* Table name */
  5859   5859     const char *zColumnName,    /* Column name */
  5860   5860     char const **pzDataType,    /* OUTPUT: Declared data type */
  5861   5861     char const **pzCollSeq,     /* OUTPUT: Collation sequence name */
  5862   5862     int *pNotNull,              /* OUTPUT: True if NOT NULL constraint exists */
................................................................................
  5904   5904   ** interface.  The use of the [sqlite3_enable_load_extension()] interface
  5905   5905   ** should be avoided.  This will keep the SQL function [load_extension()]
  5906   5906   ** disabled and prevent SQL injections from giving attackers
  5907   5907   ** access to extension loading capabilities.
  5908   5908   **
  5909   5909   ** See also the [load_extension() SQL function].
  5910   5910   */
  5911         -SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
         5911  +SQLITE_API int sqlite3_load_extension(
  5912   5912     sqlite3 *db,          /* Load the extension into this database connection */
  5913   5913     const char *zFile,    /* Name of the shared library containing extension */
  5914   5914     const char *zProc,    /* Entry point.  Derived from zFile if 0 */
  5915   5915     char **pzErrMsg       /* Put error message here if not 0 */
  5916   5916   );
  5917   5917   
  5918   5918   /*
................................................................................
  5936   5936   **
  5937   5937   ** <b>Security warning:</b> It is recommended that extension loading
  5938   5938   ** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method
  5939   5939   ** rather than this interface, so the [load_extension()] SQL function
  5940   5940   ** remains disabled. This will prevent SQL injections from giving attackers
  5941   5941   ** access to extension loading capabilities.
  5942   5942   */
  5943         -SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
         5943  +SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
  5944   5944   
  5945   5945   /*
  5946   5946   ** CAPI3REF: Automatically Load Statically Linked Extensions
  5947   5947   **
  5948   5948   ** ^This interface causes the xEntryPoint() function to be invoked for
  5949   5949   ** each new [database connection] that is created.  The idea here is that
  5950   5950   ** xEntryPoint() is the entry point for a statically linked [SQLite extension]
................................................................................
  5974   5974   ** ^Calling sqlite3_auto_extension(X) with an entry point X that is already
  5975   5975   ** on the list of automatic extensions is a harmless no-op. ^No entry point
  5976   5976   ** will be called more than once for each database connection that is opened.
  5977   5977   **
  5978   5978   ** See also: [sqlite3_reset_auto_extension()]
  5979   5979   ** and [sqlite3_cancel_auto_extension()]
  5980   5980   */
  5981         -SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void(*xEntryPoint)(void));
         5981  +SQLITE_API int sqlite3_auto_extension(void(*xEntryPoint)(void));
  5982   5982   
  5983   5983   /*
  5984   5984   ** CAPI3REF: Cancel Automatic Extension Loading
  5985   5985   **
  5986   5986   ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
  5987   5987   ** initialization routine X that was registered using a prior call to
  5988   5988   ** [sqlite3_auto_extension(X)].  ^The [sqlite3_cancel_auto_extension(X)]
  5989   5989   ** routine returns 1 if initialization routine X was successfully 
  5990   5990   ** unregistered and it returns 0 if X was not on the list of initialization
  5991   5991   ** routines.
  5992   5992   */
  5993         -SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void(*xEntryPoint)(void));
         5993  +SQLITE_API int sqlite3_cancel_auto_extension(void(*xEntryPoint)(void));
  5994   5994   
  5995   5995   /*
  5996   5996   ** CAPI3REF: Reset Automatic Extension Loading
  5997   5997   **
  5998   5998   ** ^This interface disables all automatic extensions previously
  5999   5999   ** registered using [sqlite3_auto_extension()].
  6000   6000   */
  6001         -SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void);
         6001  +SQLITE_API void sqlite3_reset_auto_extension(void);
  6002   6002   
  6003   6003   /*
  6004   6004   ** The interface to the virtual-table mechanism is currently considered
  6005   6005   ** to be experimental.  The interface might change in incompatible ways.
  6006   6006   ** If this is a problem for you, do not use the interface at this time.
  6007   6007   **
  6008   6008   ** When the virtual-table mechanism stabilizes, we will declare the
................................................................................
  6239   6239   ** invoke the destructor function (if it is not NULL) when SQLite
  6240   6240   ** no longer needs the pClientData pointer.  ^The destructor will also
  6241   6241   ** be invoked if the call to sqlite3_create_module_v2() fails.
  6242   6242   ** ^The sqlite3_create_module()
  6243   6243   ** interface is equivalent to sqlite3_create_module_v2() with a NULL
  6244   6244   ** destructor.
  6245   6245   */
  6246         -SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
         6246  +SQLITE_API int sqlite3_create_module(
  6247   6247     sqlite3 *db,               /* SQLite connection to register module with */
  6248   6248     const char *zName,         /* Name of the module */
  6249   6249     const sqlite3_module *p,   /* Methods for the module */
  6250   6250     void *pClientData          /* Client data for xCreate/xConnect */
  6251   6251   );
  6252         -SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
         6252  +SQLITE_API int sqlite3_create_module_v2(
  6253   6253     sqlite3 *db,               /* SQLite connection to register module with */
  6254   6254     const char *zName,         /* Name of the module */
  6255   6255     const sqlite3_module *p,   /* Methods for the module */
  6256   6256     void *pClientData,         /* Client data for xCreate/xConnect */
  6257   6257     void(*xDestroy)(void*)     /* Module destructor function */
  6258   6258   );
  6259   6259   
................................................................................
  6308   6308   ** CAPI3REF: Declare The Schema Of A Virtual Table
  6309   6309   **
  6310   6310   ** ^The [xCreate] and [xConnect] methods of a
  6311   6311   ** [virtual table module] call this interface
  6312   6312   ** to declare the format (the names and datatypes of the columns) of
  6313   6313   ** the virtual tables they implement.
  6314   6314   */
  6315         -SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
         6315  +SQLITE_API int sqlite3_declare_vtab(sqlite3*, const char *zSQL);
  6316   6316   
  6317   6317   /*
  6318   6318   ** CAPI3REF: Overload A Function For A Virtual Table
  6319   6319   ** METHOD: sqlite3
  6320   6320   **
  6321   6321   ** ^(Virtual tables can provide alternative implementations of functions
  6322   6322   ** using the [xFindFunction] method of the [virtual table module].  
................................................................................
  6327   6327   ** name and number of parameters exists.  If no such function exists
  6328   6328   ** before this API is called, a new function is created.)^  ^The implementation
  6329   6329   ** of the new function always causes an exception to be thrown.  So
  6330   6330   ** the new function is not good for anything by itself.  Its only
  6331   6331   ** purpose is to be a placeholder function that can be overloaded
  6332   6332   ** by a [virtual table].
  6333   6333   */
  6334         -SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
         6334  +SQLITE_API int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
  6335   6335   
  6336   6336   /*
  6337   6337   ** The interface to the virtual-table mechanism defined above (back up
  6338   6338   ** to a comment remarkably similar to this one) is currently considered
  6339   6339   ** to be experimental.  The interface might change in incompatible ways.
  6340   6340   ** If this is a problem for you, do not use the interface at this time.
  6341   6341   **
................................................................................
  6426   6426   ** ^The [sqlite3_bind_zeroblob()] and [sqlite3_result_zeroblob()] interfaces
  6427   6427   ** and the built-in [zeroblob] SQL function may be used to create a 
  6428   6428   ** zero-filled blob to read or write using the incremental-blob interface.
  6429   6429   **
  6430   6430   ** To avoid a resource leak, every open [BLOB handle] should eventually
  6431   6431   ** be released by a call to [sqlite3_blob_close()].
  6432   6432   */
  6433         -SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
         6433  +SQLITE_API int sqlite3_blob_open(
  6434   6434     sqlite3*,
  6435   6435     const char *zDb,
  6436   6436     const char *zTable,
  6437   6437     const char *zColumn,
  6438   6438     sqlite3_int64 iRow,
  6439   6439     int flags,
  6440   6440     sqlite3_blob **ppBlob
................................................................................
  6459   6459   ** ^All subsequent calls to [sqlite3_blob_read()], [sqlite3_blob_write()] or
  6460   6460   ** [sqlite3_blob_reopen()] on an aborted blob handle immediately return
  6461   6461   ** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
  6462   6462   ** always returns zero.
  6463   6463   **
  6464   6464   ** ^This function sets the database handle error code and message.
  6465   6465   */
  6466         -SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
         6466  +SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
  6467   6467   
  6468   6468   /*
  6469   6469   ** CAPI3REF: Close A BLOB Handle
  6470   6470   ** DESTRUCTOR: sqlite3_blob
  6471   6471   **
  6472   6472   ** ^This function closes an open [BLOB handle]. ^(The BLOB handle is closed
  6473   6473   ** unconditionally.  Even if this routine returns an error code, the 
................................................................................
  6482   6482   ** Calling this function with an argument that is not a NULL pointer or an
  6483   6483   ** open blob handle results in undefined behaviour. ^Calling this routine 
  6484   6484   ** with a null pointer (such as would be returned by a failed call to 
  6485   6485   ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function
  6486   6486   ** is passed a valid open blob handle, the values returned by the 
  6487   6487   ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning.
  6488   6488   */
  6489         -SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *);
         6489  +SQLITE_API int sqlite3_blob_close(sqlite3_blob *);
  6490   6490   
  6491   6491   /*
  6492   6492   ** CAPI3REF: Return The Size Of An Open BLOB
  6493   6493   ** METHOD: sqlite3_blob
  6494   6494   **
  6495   6495   ** ^Returns the size in bytes of the BLOB accessible via the 
  6496   6496   ** successfully opened [BLOB handle] in its only argument.  ^The
................................................................................
  6498   6498   ** blob content; they cannot change the size of a blob.
  6499   6499   **
  6500   6500   ** This routine only works on a [BLOB handle] which has been created
  6501   6501   ** by a prior successful call to [sqlite3_blob_open()] and which has not
  6502   6502   ** been closed by [sqlite3_blob_close()].  Passing any other pointer in
  6503   6503   ** to this routine results in undefined and probably undesirable behavior.
  6504   6504   */
  6505         -SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *);
         6505  +SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *);
  6506   6506   
  6507   6507   /*
  6508   6508   ** CAPI3REF: Read Data From A BLOB Incrementally
  6509   6509   ** METHOD: sqlite3_blob
  6510   6510   **
  6511   6511   ** ^(This function is used to read data from an open [BLOB handle] into a
  6512   6512   ** caller-supplied buffer. N bytes of data are copied into buffer Z
................................................................................
  6527   6527   ** This routine only works on a [BLOB handle] which has been created
  6528   6528   ** by a prior successful call to [sqlite3_blob_open()] and which has not
  6529   6529   ** been closed by [sqlite3_blob_close()].  Passing any other pointer in
  6530   6530   ** to this routine results in undefined and probably undesirable behavior.
  6531   6531   **
  6532   6532   ** See also: [sqlite3_blob_write()].
  6533   6533   */
  6534         -SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
         6534  +SQLITE_API int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
  6535   6535   
  6536   6536   /*
  6537   6537   ** CAPI3REF: Write Data Into A BLOB Incrementally
  6538   6538   ** METHOD: sqlite3_blob
  6539   6539   **
  6540   6540   ** ^(This function is used to write data into an open [BLOB handle] from a
  6541   6541   ** caller-supplied buffer. N bytes of data are copied from the buffer Z
................................................................................
  6569   6569   ** This routine only works on a [BLOB handle] which has been created
  6570   6570   ** by a prior successful call to [sqlite3_blob_open()] and which has not
  6571   6571   ** been closed by [sqlite3_blob_close()].  Passing any other pointer in
  6572   6572   ** to this routine results in undefined and probably undesirable behavior.
  6573   6573   **
  6574   6574   ** See also: [sqlite3_blob_read()].
  6575   6575   */
  6576         -SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
         6576  +SQLITE_API int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
  6577   6577   
  6578   6578   /*
  6579   6579   ** CAPI3REF: Virtual File System Objects
  6580   6580   **
  6581   6581   ** A virtual filesystem (VFS) is an [sqlite3_vfs] object
  6582   6582   ** that SQLite uses to interact
  6583   6583   ** with the underlying operating system.  Most SQLite builds come with a
................................................................................
  6600   6600   ** VFS is registered with a name that is NULL or an empty string,
  6601   6601   ** then the behavior is undefined.
  6602   6602   **
  6603   6603   ** ^Unregister a VFS with the sqlite3_vfs_unregister() interface.
  6604   6604   ** ^(If the default VFS is unregistered, another VFS is chosen as
  6605   6605   ** the default.  The choice for the new VFS is arbitrary.)^
  6606   6606   */
  6607         -SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfsName);
  6608         -SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
  6609         -SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs*);
         6607  +SQLITE_API sqlite3_vfs *sqlite3_vfs_find(const char *zVfsName);
         6608  +SQLITE_API int sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
         6609  +SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*);
  6610   6610   
  6611   6611   /*
  6612   6612   ** CAPI3REF: Mutexes
  6613   6613   **
  6614   6614   ** The SQLite core uses these routines for thread
  6615   6615   ** synchronization. Though they are intended for internal
  6616   6616   ** use by SQLite, code that links against SQLite is
................................................................................
  6718   6718   **
  6719   6719   ** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or
  6720   6720   ** sqlite3_mutex_leave() is a NULL pointer, then all three routines
  6721   6721   ** behave as no-ops.
  6722   6722   **
  6723   6723   ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
  6724   6724   */
  6725         -SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int);
  6726         -SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*);
  6727         -SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*);
  6728         -SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*);
  6729         -SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*);
         6725  +SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int);
         6726  +SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*);
         6727  +SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*);
         6728  +SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*);
         6729  +SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*);
  6730   6730   
  6731   6731   /*
  6732   6732   ** CAPI3REF: Mutex Methods Object
  6733   6733   **
  6734   6734   ** An instance of this structure defines the low-level routines
  6735   6735   ** used to allocate and use mutexes.
  6736   6736   **
................................................................................
  6832   6832   ** the reason the mutex does not exist is because the build is not
  6833   6833   ** using mutexes.  And we do not want the assert() containing the
  6834   6834   ** call to sqlite3_mutex_held() to fail, so a non-zero return is
  6835   6835   ** the appropriate thing to do.  The sqlite3_mutex_notheld()
  6836   6836   ** interface should also return 1 when given a NULL pointer.
  6837   6837   */
  6838   6838   #ifndef NDEBUG
  6839         -SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex*);
  6840         -SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex*);
         6839  +SQLITE_API int sqlite3_mutex_held(sqlite3_mutex*);
         6840  +SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex*);
  6841   6841   #endif
  6842   6842   
  6843   6843   /*
  6844   6844   ** CAPI3REF: Mutex Types
  6845   6845   **
  6846   6846   ** The [sqlite3_mutex_alloc()] interface takes a single argument
  6847   6847   ** which is one of these integer constants.
................................................................................
  6873   6873   **
  6874   6874   ** ^This interface returns a pointer the [sqlite3_mutex] object that 
  6875   6875   ** serializes access to the [database connection] given in the argument
  6876   6876   ** when the [threading mode] is Serialized.
  6877   6877   ** ^If the [threading mode] is Single-thread or Multi-thread then this
  6878   6878   ** routine returns a NULL pointer.
  6879   6879   */
  6880         -SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3*);
         6880  +SQLITE_API sqlite3_mutex *sqlite3_db_mutex(sqlite3*);
  6881   6881   
  6882   6882   /*
  6883   6883   ** CAPI3REF: Low-Level Control Of Database Files
  6884   6884   ** METHOD: sqlite3
  6885   6885   **
  6886   6886   ** ^The [sqlite3_file_control()] interface makes a direct call to the
  6887   6887   ** xFileControl method for the [sqlite3_io_methods] object associated
................................................................................
  6908   6908   ** or [sqlite3_errmsg()].  The underlying xFileControl method might
  6909   6909   ** also return SQLITE_ERROR.  There is no way to distinguish between
  6910   6910   ** an incorrect zDbName and an SQLITE_ERROR return from the underlying
  6911   6911   ** xFileControl method.
  6912   6912   **
  6913   6913   ** See also: [SQLITE_FCNTL_LOCKSTATE]
  6914   6914   */
  6915         -SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
         6915  +SQLITE_API int sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
  6916   6916   
  6917   6917   /*
  6918   6918   ** CAPI3REF: Testing Interface
  6919   6919   **
  6920   6920   ** ^The sqlite3_test_control() interface is used to read out internal
  6921   6921   ** state of SQLite and to inject faults into SQLite for testing
  6922   6922   ** purposes.  ^The first parameter is an operation code that determines
................................................................................
  6927   6927   ** on how the SQLite library is compiled, this interface might not exist.
  6928   6928   **
  6929   6929   ** The details of the operation codes, their meanings, the parameters
  6930   6930   ** they take, and what they do are all subject to change without notice.
  6931   6931   ** Unlike most of the SQLite API, this function is not guaranteed to
  6932   6932   ** operate consistently from one release to the next.
  6933   6933   */
  6934         -SQLITE_API int SQLITE_CDECL sqlite3_test_control(int op, ...);
         6934  +SQLITE_API int sqlite3_test_control(int op, ...);
  6935   6935   
  6936   6936   /*
  6937   6937   ** CAPI3REF: Testing Interface Operation Codes
  6938   6938   **
  6939   6939   ** These constants are the valid operation code parameters used
  6940   6940   ** as the first argument to [sqlite3_test_control()].
  6941   6941   **
................................................................................
  6990   6990   **
  6991   6991   ** If either the current value or the highwater mark is too large to
  6992   6992   ** be represented by a 32-bit integer, then the values returned by
  6993   6993   ** sqlite3_status() are undefined.
  6994   6994   **
  6995   6995   ** See also: [sqlite3_db_status()]
  6996   6996   */
  6997         -SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
  6998         -SQLITE_API int SQLITE_STDCALL sqlite3_status64(
         6997  +SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
         6998  +SQLITE_API int sqlite3_status64(
  6999   6999     int op,
  7000   7000     sqlite3_int64 *pCurrent,
  7001   7001     sqlite3_int64 *pHighwater,
  7002   7002     int resetFlag
  7003   7003   );
  7004   7004   
  7005   7005   
................................................................................
  7116   7116   ** reset back down to the current value.
  7117   7117   **
  7118   7118   ** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a
  7119   7119   ** non-zero [error code] on failure.
  7120   7120   **
  7121   7121   ** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
  7122   7122   */
  7123         -SQLITE_API int SQLITE_STDCALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
         7123  +SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
  7124   7124   
  7125   7125   /*
  7126   7126   ** CAPI3REF: Status Parameters for database connections
  7127   7127   ** KEYWORDS: {SQLITE_DBSTATUS options}
  7128   7128   **
  7129   7129   ** These constants are the available integer "verbs" that can be passed as
  7130   7130   ** the second argument to the [sqlite3_db_status()] interface.
................................................................................
  7259   7259   ** to be interrogated.)^
  7260   7260   ** ^The current value of the requested counter is returned.
  7261   7261   ** ^If the resetFlg is true, then the counter is reset to zero after this
  7262   7262   ** interface call returns.
  7263   7263   **
  7264   7264   ** See also: [sqlite3_status()] and [sqlite3_db_status()].
  7265   7265   */
  7266         -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
         7266  +SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
  7267   7267   
  7268   7268   /*
  7269   7269   ** CAPI3REF: Status Parameters for prepared statements
  7270   7270   ** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters}
  7271   7271   **
  7272   7272   ** These preprocessor macros define integer codes that name counter
  7273   7273   ** values associated with the [sqlite3_stmt_status()] interface.
................................................................................
  7728   7728   ** The [sqlite3_backup] object itself is partially threadsafe. Multiple 
  7729   7729   ** threads may safely make multiple concurrent calls to sqlite3_backup_step().
  7730   7730   ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()
  7731   7731   ** APIs are not strictly speaking threadsafe. If they are invoked at the
  7732   7732   ** same time as another thread is invoking sqlite3_backup_step() it is
  7733   7733   ** possible that they return invalid values.
  7734   7734   */
  7735         -SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
         7735  +SQLITE_API sqlite3_backup *sqlite3_backup_init(
  7736   7736     sqlite3 *pDest,                        /* Destination database handle */
  7737   7737     const char *zDestName,                 /* Destination database name */
  7738   7738     sqlite3 *pSource,                      /* Source database handle */
  7739   7739     const char *zSourceName                /* Source database name */
  7740   7740   );
  7741         -SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage);
  7742         -SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p);
  7743         -SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p);
  7744         -SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p);
         7741  +SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage);
         7742  +SQLITE_API int sqlite3_backup_finish(sqlite3_backup *p);
         7743  +SQLITE_API int sqlite3_backup_remaining(sqlite3_backup *p);
         7744  +SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p);
  7745   7745   
  7746   7746   /*
  7747   7747   ** CAPI3REF: Unlock Notification
  7748   7748   ** METHOD: sqlite3
  7749   7749   **
  7750   7750   ** ^When running in shared-cache mode, a database operation may fail with
  7751   7751   ** an [SQLITE_LOCKED] error if the required locks on the shared-cache or
................................................................................
  7854   7854   **
  7855   7855   ** One way around this problem is to check the extended error code returned
  7856   7856   ** by an sqlite3_step() call. ^(If there is a blocking connection, then the
  7857   7857   ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in
  7858   7858   ** the special "DROP TABLE/INDEX" case, the extended error code is just 
  7859   7859   ** SQLITE_LOCKED.)^
  7860   7860   */
  7861         -SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
         7861  +SQLITE_API int sqlite3_unlock_notify(
  7862   7862     sqlite3 *pBlocked,                          /* Waiting connection */
  7863   7863     void (*xNotify)(void **apArg, int nArg),    /* Callback function to invoke */
  7864   7864     void *pNotifyArg                            /* Argument to pass to xNotify */
  7865   7865   );
  7866   7866   
  7867   7867   
  7868   7868   /*
................................................................................
  7869   7869   ** CAPI3REF: String Comparison
  7870   7870   **
  7871   7871   ** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications
  7872   7872   ** and extensions to compare the contents of two buffers containing UTF-8
  7873   7873   ** strings in a case-independent fashion, using the same definition of "case
  7874   7874   ** independence" that SQLite uses internally when comparing identifiers.
  7875   7875   */
  7876         -SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *, const char *);
  7877         -SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *, const char *, int);
         7876  +SQLITE_API int sqlite3_stricmp(const char *, const char *);
         7877  +SQLITE_API int sqlite3_strnicmp(const char *, const char *, int);
  7878   7878   
  7879   7879   /*
  7880   7880   ** CAPI3REF: String Globbing
  7881   7881   *
  7882   7882   ** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if
  7883   7883   ** string X matches the [GLOB] pattern P.
  7884   7884   ** ^The definition of [GLOB] pattern matching used in
................................................................................
  7887   7887   ** is case sensitive.
  7888   7888   **
  7889   7889   ** Note that this routine returns zero on a match and non-zero if the strings
  7890   7890   ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
  7891   7891   **
  7892   7892   ** See also: [sqlite3_strlike()].
  7893   7893   */
  7894         -SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlob, const char *zStr);
         7894  +SQLITE_API int sqlite3_strglob(const char *zGlob, const char *zStr);
  7895   7895   
  7896   7896   /*
  7897   7897   ** CAPI3REF: String LIKE Matching
  7898   7898   *
  7899   7899   ** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if
  7900   7900   ** string X matches the [LIKE] pattern P with escape character E.
  7901   7901   ** ^The definition of [LIKE] pattern matching used in
................................................................................
  7910   7910   ** only ASCII characters are case folded.
  7911   7911   **
  7912   7912   ** Note that this routine returns zero on a match and non-zero if the strings
  7913   7913   ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
  7914   7914   **
  7915   7915   ** See also: [sqlite3_strglob()].
  7916   7916   */
  7917         -SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
         7917  +SQLITE_API int sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
  7918   7918   
  7919   7919   /*
  7920   7920   ** CAPI3REF: Error Logging Interface
  7921   7921   **
  7922   7922   ** ^The [sqlite3_log()] interface writes a message into the [error log]
  7923   7923   ** established by the [SQLITE_CONFIG_LOG] option to [sqlite3_config()].
  7924   7924   ** ^If logging is enabled, the zFormat string and subsequent arguments are
................................................................................
  7933   7933   **
  7934   7934   ** To avoid deadlocks and other threading problems, the sqlite3_log() routine
  7935   7935   ** will not use dynamically allocated memory.  The log message is stored in
  7936   7936   ** a fixed-length buffer on the stack.  If the log message is longer than
  7937   7937   ** a few hundred characters, it will be truncated to the length of the
  7938   7938   ** buffer.
  7939   7939   */
  7940         -SQLITE_API void SQLITE_CDECL sqlite3_log(int iErrCode, const char *zFormat, ...);
         7940  +SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...);
  7941   7941   
  7942   7942   /*
  7943   7943   ** CAPI3REF: Write-Ahead Log Commit Hook
  7944   7944   ** METHOD: sqlite3
  7945   7945   **
  7946   7946   ** ^The [sqlite3_wal_hook()] function is used to register a callback that
  7947   7947   ** is invoked each time data is committed to a database in wal mode.
................................................................................
  7969   7969   ** A single database handle may have at most a single write-ahead log callback 
  7970   7970   ** registered at one time. ^Calling [sqlite3_wal_hook()] replaces any
  7971   7971   ** previously registered write-ahead log callback. ^Note that the
  7972   7972   ** [sqlite3_wal_autocheckpoint()] interface and the
  7973   7973   ** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will
  7974   7974   ** overwrite any prior [sqlite3_wal_hook()] settings.
  7975   7975   */
  7976         -SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
         7976  +SQLITE_API void *sqlite3_wal_hook(
  7977   7977     sqlite3*, 
  7978   7978     int(*)(void *,sqlite3*,const char*,int),
  7979   7979     void*
  7980   7980   );
  7981   7981   
  7982   7982   /*
  7983   7983   ** CAPI3REF: Configure an auto-checkpoint
................................................................................
  8004   8004   **
  8005   8005   ** ^Every new [database connection] defaults to having the auto-checkpoint
  8006   8006   ** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]
  8007   8007   ** pages.  The use of this interface
  8008   8008   ** is only necessary if the default setting is found to be suboptimal
  8009   8009   ** for a particular application.
  8010   8010   */
  8011         -SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
         8011  +SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
  8012   8012   
  8013   8013   /*
  8014   8014   ** CAPI3REF: Checkpoint a database
  8015   8015   ** METHOD: sqlite3
  8016   8016   **
  8017   8017   ** ^(The sqlite3_wal_checkpoint(D,X) is equivalent to
  8018   8018   ** [sqlite3_wal_checkpoint_v2](D,X,[SQLITE_CHECKPOINT_PASSIVE],0,0).)^
................................................................................
  8026   8026   ** This interface used to be the only way to cause a checkpoint to
  8027   8027   ** occur.  But then the newer and more powerful [sqlite3_wal_checkpoint_v2()]
  8028   8028   ** interface was added.  This interface is retained for backwards
  8029   8029   ** compatibility and as a convenience for applications that need to manually
  8030   8030   ** start a callback but which do not need the full power (and corresponding
  8031   8031   ** complication) of [sqlite3_wal_checkpoint_v2()].
  8032   8032   */
  8033         -SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
         8033  +SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
  8034   8034   
  8035   8035   /*
  8036   8036   ** CAPI3REF: Checkpoint a database
  8037   8037   ** METHOD: sqlite3
  8038   8038   **
  8039   8039   ** ^(The sqlite3_wal_checkpoint_v2(D,X,M,L,C) interface runs a checkpoint
  8040   8040   ** operation on database X of [database connection] D in mode M.  Status
................................................................................
  8120   8120   ** the sqlite3_wal_checkpoint_v2() interface
  8121   8121   ** sets the error information that is queried by
  8122   8122   ** [sqlite3_errcode()] and [sqlite3_errmsg()].
  8123   8123   **
  8124   8124   ** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface
  8125   8125   ** from SQL.
  8126   8126   */
  8127         -SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
         8127  +SQLITE_API int sqlite3_wal_checkpoint_v2(
  8128   8128     sqlite3 *db,                    /* Database handle */
  8129   8129     const char *zDb,                /* Name of attached database (or NULL) */
  8130   8130     int eMode,                      /* SQLITE_CHECKPOINT_* value */
  8131   8131     int *pnLog,                     /* OUT: Size of WAL log in frames */
  8132   8132     int *pnCkpt                     /* OUT: Total number of frames checkpointed */
  8133   8133   );
  8134   8134   
................................................................................
  8156   8156   ** If this interface is invoked outside the context of an xConnect or
  8157   8157   ** xCreate virtual table method then the behavior is undefined.
  8158   8158   **
  8159   8159   ** At present, there is only one option that may be configured using
  8160   8160   ** this function. (See [SQLITE_VTAB_CONSTRAINT_SUPPORT].)  Further options
  8161   8161   ** may be added in the future.
  8162   8162   */
  8163         -SQLITE_API int SQLITE_CDECL sqlite3_vtab_config(sqlite3*, int op, ...);
         8163  +SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...);
  8164   8164   
  8165   8165   /*
  8166   8166   ** CAPI3REF: Virtual Table Configuration Options
  8167   8167   **
  8168   8168   ** These macros define the various options to the
  8169   8169   ** [sqlite3_vtab_config()] interface that [virtual table] implementations
  8170   8170   ** can use to customize and optimize their behavior.
................................................................................
  8209   8209   ** This function may only be called from within a call to the [xUpdate] method
  8210   8210   ** of a [virtual table] implementation for an INSERT or UPDATE operation. ^The
  8211   8211   ** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL],
  8212   8212   ** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode
  8213   8213   ** of the SQL statement that triggered the call to the [xUpdate] method of the
  8214   8214   ** [virtual table].
  8215   8215   */
  8216         -SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *);
         8216  +SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *);
  8217   8217   
  8218   8218   /*
  8219   8219   ** CAPI3REF: Conflict resolution modes
  8220   8220   ** KEYWORDS: {conflict resolution mode}
  8221   8221   **
  8222   8222   ** These constants are returned by [sqlite3_vtab_on_conflict()] to
  8223   8223   ** inform a [virtual table] implementation what the [ON CONFLICT] mode
................................................................................
  8314   8314   ** ^Statistics might not be available for all loops in all statements. ^In cases
  8315   8315   ** where there exist loops with no available statistics, this function behaves
  8316   8316   ** as if the loop did not exist - it returns non-zero and leave the variable
  8317   8317   ** that pOut points to unchanged.
  8318   8318   **
  8319   8319   ** See also: [sqlite3_stmt_scanstatus_reset()]
  8320   8320   */
  8321         -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus(
         8321  +SQLITE_API int sqlite3_stmt_scanstatus(
  8322   8322     sqlite3_stmt *pStmt,      /* Prepared statement for which info desired */
  8323   8323     int idx,                  /* Index of loop to report on */
  8324   8324     int iScanStatusOp,        /* Information desired.  SQLITE_SCANSTAT_* */
  8325   8325     void *pOut                /* Result written here */
  8326   8326   );     
  8327   8327   
  8328   8328   /*
................................................................................
  8330   8330   ** METHOD: sqlite3_stmt
  8331   8331   **
  8332   8332   ** ^Zero all [sqlite3_stmt_scanstatus()] related event counters.
  8333   8333   **
  8334   8334   ** This API is only available if the library is built with pre-processor
  8335   8335   ** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined.
  8336   8336   */
  8337         -SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
         8337  +SQLITE_API void sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
  8338   8338   
  8339   8339   /*
  8340   8340   ** CAPI3REF: Flush caches to disk mid-transaction
  8341   8341   **
  8342   8342   ** ^If a write-transaction is open on [database connection] D when the
  8343   8343   ** [sqlite3_db_cacheflush(D)] interface invoked, any dirty
  8344   8344   ** pages in the pager-cache that are not currently in use are written out 
................................................................................
  8362   8362   ** abandoned and an SQLite [error code] is returned to the caller immediately.
  8363   8363   **
  8364   8364   ** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK.
  8365   8365   **
  8366   8366   ** ^This function does not set the database handle error code or message
  8367   8367   ** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions.
  8368   8368   */
  8369         -SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3*);
         8369  +SQLITE_API int sqlite3_db_cacheflush(sqlite3*);
  8370   8370   
  8371   8371   /*
  8372   8372   ** CAPI3REF: The pre-update hook.
  8373   8373   **
  8374   8374   ** ^These interfaces are only available if SQLite is compiled using the
  8375   8375   ** [SQLITE_ENABLE_PREUPDATE_HOOK] compile-time option.
  8376   8376   **
................................................................................
  8442   8442   ** callback was invoked as a result of a direct insert, update, or delete
  8443   8443   ** operation; or 1 for inserts, updates, or deletes invoked by top-level 
  8444   8444   ** triggers; or 2 for changes resulting from triggers called by top-level
  8445   8445   ** triggers; and so forth.
  8446   8446   **
  8447   8447   ** See also:  [sqlite3_update_hook()]
  8448   8448   */
  8449         -SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_STDCALL sqlite3_preupdate_hook(
         8449  +SQLITE_API SQLITE_EXPERIMENTAL void *sqlite3_preupdate_hook(
  8450   8450     sqlite3 *db,
  8451   8451     void(*xPreUpdate)(
  8452   8452       void *pCtx,                   /* Copy of third arg to preupdate_hook() */
  8453   8453       sqlite3 *db,                  /* Database handle */
  8454   8454       int op,                       /* SQLITE_UPDATE, DELETE or INSERT */
  8455   8455       char const *zDb,              /* Database name */
  8456   8456       char const *zName,            /* Table name */
  8457   8457       sqlite3_int64 iKey1,          /* Rowid of row about to be deleted/updated */
  8458   8458       sqlite3_int64 iKey2           /* New rowid value (for a rowid UPDATE) */
  8459   8459     ),
  8460   8460     void*
  8461   8461   );
  8462         -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **);
  8463         -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *);
  8464         -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *);
  8465         -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **);
         8462  +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **);
         8463  +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_preupdate_count(sqlite3 *);
         8464  +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_preupdate_depth(sqlite3 *);
         8465  +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **);
  8466   8466   
  8467   8467   /*
  8468   8468   ** CAPI3REF: Low-level system error code
  8469   8469   **
  8470   8470   ** ^Attempt to return the underlying operating system error code or error
  8471   8471   ** number that caused the most recent I/O error or failure to open a file.
  8472   8472   ** The return value is OS-dependent.  For example, on unix systems, after
  8473   8473   ** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be
  8474   8474   ** called to get back the underlying "errno" that caused the problem, such
  8475   8475   ** as ENOSPC, EAUTH, EISDIR, and so forth.  
  8476   8476   */
  8477         -SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3*);
         8477  +SQLITE_API int sqlite3_system_errno(sqlite3*);
  8478   8478   
  8479   8479   /*
  8480   8480   ** CAPI3REF: Database Snapshot
  8481   8481   ** KEYWORDS: {snapshot}
  8482   8482   ** EXPERIMENTAL
  8483   8483   **
  8484   8484   ** An instance of the snapshot object records the state of a [WAL mode]
................................................................................
  8520   8520   ** The [sqlite3_snapshot] object returned from a successful call to
  8521   8521   ** [sqlite3_snapshot_get()] must be freed using [sqlite3_snapshot_free()]
  8522   8522   ** to avoid a memory leak.
  8523   8523   **
  8524   8524   ** The [sqlite3_snapshot_get()] interface is only available when the
  8525   8525   ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
  8526   8526   */
  8527         -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_get(
         8527  +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_get(
  8528   8528     sqlite3 *db,
  8529   8529     const char *zSchema,
  8530   8530     sqlite3_snapshot **ppSnapshot
  8531   8531   );
  8532   8532   
  8533   8533   /*
  8534   8534   ** CAPI3REF: Start a read transaction on an historical snapshot
................................................................................
  8558   8558   ** after the most recent I/O on the database connection.)^
  8559   8559   ** (Hint: Run "[PRAGMA application_id]" against a newly opened
  8560   8560   ** database connection in order to make it ready to use snapshots.)
  8561   8561   **
  8562   8562   ** The [sqlite3_snapshot_open()] interface is only available when the
  8563   8563   ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
  8564   8564   */
  8565         -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_open(
         8565  +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_open(
  8566   8566     sqlite3 *db,
  8567   8567     const char *zSchema,
  8568   8568     sqlite3_snapshot *pSnapshot
  8569   8569   );
  8570   8570   
  8571   8571   /*
  8572   8572   ** CAPI3REF: Destroy a snapshot
................................................................................
  8575   8575   ** ^The [sqlite3_snapshot_free(P)] interface destroys [sqlite3_snapshot] P.
  8576   8576   ** The application must eventually free every [sqlite3_snapshot] object
  8577   8577   ** using this routine to avoid a memory leak.
  8578   8578   **
  8579   8579   ** The [sqlite3_snapshot_free()] interface is only available when the
  8580   8580   ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
  8581   8581   */
  8582         -SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot*);
         8582  +SQLITE_API SQLITE_EXPERIMENTAL void sqlite3_snapshot_free(sqlite3_snapshot*);
  8583   8583   
  8584   8584   /*
  8585   8585   ** CAPI3REF: Compare the ages of two snapshot handles.
  8586   8586   ** EXPERIMENTAL
  8587   8587   **
  8588   8588   ** The sqlite3_snapshot_cmp(P1, P2) interface is used to compare the ages
  8589   8589   ** of two valid snapshot handles. 
................................................................................
  8599   8599   ** wal file was last deleted, the value returned by this function 
  8600   8600   ** is undefined.
  8601   8601   **
  8602   8602   ** Otherwise, this API returns a negative value if P1 refers to an older
  8603   8603   ** snapshot than P2, zero if the two handles refer to the same database
  8604   8604   ** snapshot, and a positive value if P1 is a newer snapshot than P2.
  8605   8605   */
  8606         -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_cmp(
         8606  +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_cmp(
  8607   8607     sqlite3_snapshot *p1,
  8608   8608     sqlite3_snapshot *p2
  8609   8609   );
  8610   8610   
  8611   8611   /*
  8612   8612   ** Undo the hack that converts floating point types to integer for
  8613   8613   ** builds on processors without floating point support.
................................................................................
  8657   8657   
  8658   8658   /*
  8659   8659   ** Register a geometry callback named zGeom that can be used as part of an
  8660   8660   ** R-Tree geometry query as follows:
  8661   8661   **
  8662   8662   **   SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
  8663   8663   */
  8664         -SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
         8664  +SQLITE_API int sqlite3_rtree_geometry_callback(
  8665   8665     sqlite3 *db,
  8666   8666     const char *zGeom,
  8667   8667     int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
  8668   8668     void *pContext
  8669   8669   );
  8670   8670   
  8671   8671   
................................................................................
  8683   8683   
  8684   8684   /*
  8685   8685   ** Register a 2nd-generation geometry callback named zScore that can be 
  8686   8686   ** used as part of an R-Tree geometry query as follows:
  8687   8687   **
  8688   8688   **   SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...)
  8689   8689   */
  8690         -SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
         8690  +SQLITE_API int sqlite3_rtree_query_callback(
  8691   8691     sqlite3 *db,
  8692   8692     const char *zQueryFunc,
  8693   8693     int (*xQueryFunc)(sqlite3_rtree_query_info*),
  8694   8694     void *pContext,
  8695   8695     void (*xDestructor)(void*)
  8696   8696   );
  8697   8697   
................................................................................
 11898  11898   ** In the usual case where WSD is supported, the SQLITE_WSD and GLOBAL
 11899  11899   ** macros become no-ops and have zero performance impact.
 11900  11900   */
 11901  11901   #ifdef SQLITE_OMIT_WSD
 11902  11902     #define SQLITE_WSD const
 11903  11903     #define GLOBAL(t,v) (*(t*)sqlite3_wsd_find((void*)&(v), sizeof(v)))
 11904  11904     #define sqlite3GlobalConfig GLOBAL(struct Sqlite3Config, sqlite3Config)
 11905         -SQLITE_API int SQLITE_STDCALL sqlite3_wsd_init(int N, int J);
 11906         -SQLITE_API void *SQLITE_STDCALL sqlite3_wsd_find(void *K, int L);
        11905  +SQLITE_API int sqlite3_wsd_init(int N, int J);
        11906  +SQLITE_API void *sqlite3_wsd_find(void *K, int L);
 11907  11907   #else
 11908  11908     #define SQLITE_WSD
 11909  11909     #define GLOBAL(t,v) v
 11910  11910     #define sqlite3GlobalConfig sqlite3Config
 11911  11911   #endif
 11912  11912   
 11913  11913   /*
................................................................................
 12557  12557   #define OP_NoConflict     29 /* synopsis: key=r[P3@P4]                     */
 12558  12558   #define OP_NotFound       30 /* synopsis: key=r[P3@P4]                     */
 12559  12559   #define OP_Found          31 /* synopsis: key=r[P3@P4]                     */
 12560  12560   #define OP_SeekRowid      32 /* synopsis: intkey=r[P3]                     */
 12561  12561   #define OP_NotExists      33 /* synopsis: intkey=r[P3]                     */
 12562  12562   #define OP_IsNull         34 /* same as TK_ISNULL, synopsis: if r[P1]==NULL goto P2 */
 12563  12563   #define OP_NotNull        35 /* same as TK_NOTNULL, synopsis: if r[P1]!=NULL goto P2 */
 12564         -#define OP_Ne             36 /* same as TK_NE, synopsis: if r[P1]!=r[P3] goto P2 */
 12565         -#define OP_Eq             37 /* same as TK_EQ, synopsis: if r[P1]==r[P3] goto P2 */
 12566         -#define OP_Gt             38 /* same as TK_GT, synopsis: if r[P1]>r[P3] goto P2 */
 12567         -#define OP_Le             39 /* same as TK_LE, synopsis: if r[P1]<=r[P3] goto P2 */
 12568         -#define OP_Lt             40 /* same as TK_LT, synopsis: if r[P1]<r[P3] goto P2 */
 12569         -#define OP_Ge             41 /* same as TK_GE, synopsis: if r[P1]>=r[P3] goto P2 */
        12564  +#define OP_Ne             36 /* same as TK_NE, synopsis: IF r[P3]!=r[P1]   */
        12565  +#define OP_Eq             37 /* same as TK_EQ, synopsis: IF r[P3]==r[P1]   */
        12566  +#define OP_Gt             38 /* same as TK_GT, synopsis: IF r[P3]>r[P1]    */
        12567  +#define OP_Le             39 /* same as TK_LE, synopsis: IF r[P3]<=r[P1]   */
        12568  +#define OP_Lt             40 /* same as TK_LT, synopsis: IF r[P3]<r[P1]    */
        12569  +#define OP_Ge             41 /* same as TK_GE, synopsis: IF r[P3]>=r[P1]   */
 12570  12570   #define OP_Last           42
 12571  12571   #define OP_BitAnd         43 /* same as TK_BITAND, synopsis: r[P3]=r[P1]&r[P2] */
 12572  12572   #define OP_BitOr          44 /* same as TK_BITOR, synopsis: r[P3]=r[P1]|r[P2] */
 12573  12573   #define OP_ShiftLeft      45 /* same as TK_LSHIFT, synopsis: r[P3]=r[P2]<<r[P1] */
 12574  12574   #define OP_ShiftRight     46 /* same as TK_RSHIFT, synopsis: r[P3]=r[P2]>>r[P1] */
 12575  12575   #define OP_Add            47 /* same as TK_PLUS, synopsis: r[P3]=r[P1]+r[P2] */
 12576  12576   #define OP_Subtract       48 /* same as TK_MINUS, synopsis: r[P3]=r[P2]-r[P1] */
................................................................................
 17559  17559   /*
 17560  17560   ** Given the name of a compile-time option, return true if that option
 17561  17561   ** was used and false if not.
 17562  17562   **
 17563  17563   ** The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix
 17564  17564   ** is not required for a match.
 17565  17565   */
 17566         -SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName){
        17566  +SQLITE_API int sqlite3_compileoption_used(const char *zOptName){
 17567  17567     int i, n;
 17568  17568   
 17569  17569   #if SQLITE_ENABLE_API_ARMOR
 17570  17570     if( zOptName==0 ){
 17571  17571       (void)SQLITE_MISUSE_BKPT;
 17572  17572       return 0;
 17573  17573     }
................................................................................
 17587  17587     return 0;
 17588  17588   }
 17589  17589   
 17590  17590   /*
 17591  17591   ** Return the N-th compile-time option string.  If N is out of range,
 17592  17592   ** return a NULL pointer.
 17593  17593   */
 17594         -SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N){
        17594  +SQLITE_API const char *sqlite3_compileoption_get(int N){
 17595  17595     if( N>=0 && N<ArraySize(azCompileOpt) ){
 17596  17596       return azCompileOpt[N];
 17597  17597     }
 17598  17598     return 0;
 17599  17599   }
 17600  17600   
 17601  17601   #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */
................................................................................
 18297  18297       wsdStat.mxValue[op] = newValue;
 18298  18298     }
 18299  18299   }
 18300  18300   
 18301  18301   /*
 18302  18302   ** Query status information.
 18303  18303   */
 18304         -SQLITE_API int SQLITE_STDCALL sqlite3_status64(
        18304  +SQLITE_API int sqlite3_status64(
 18305  18305     int op,
 18306  18306     sqlite3_int64 *pCurrent,
 18307  18307     sqlite3_int64 *pHighwater,
 18308  18308     int resetFlag
 18309  18309   ){
 18310  18310     sqlite3_mutex *pMutex;
 18311  18311     wsdStatInit;
................................................................................
 18322  18322     if( resetFlag ){
 18323  18323       wsdStat.mxValue[op] = wsdStat.nowValue[op];
 18324  18324     }
 18325  18325     sqlite3_mutex_leave(pMutex);
 18326  18326     (void)pMutex;  /* Prevent warning when SQLITE_THREADSAFE=0 */
 18327  18327     return SQLITE_OK;
 18328  18328   }
 18329         -SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){
        18329  +SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){
 18330  18330     sqlite3_int64 iCur = 0, iHwtr = 0;
 18331  18331     int rc;
 18332  18332   #ifdef SQLITE_ENABLE_API_ARMOR
 18333  18333     if( pCurrent==0 || pHighwater==0 ) return SQLITE_MISUSE_BKPT;
 18334  18334   #endif
 18335  18335     rc = sqlite3_status64(op, &iCur, &iHwtr, resetFlag);
 18336  18336     if( rc==0 ){
................................................................................
 18339  18339     }
 18340  18340     return rc;
 18341  18341   }
 18342  18342   
 18343  18343   /*
 18344  18344   ** Query status information for a single database connection
 18345  18345   */
 18346         -SQLITE_API int SQLITE_STDCALL sqlite3_db_status(
        18346  +SQLITE_API int sqlite3_db_status(
 18347  18347     sqlite3 *db,          /* The database connection whose status is desired */
 18348  18348     int op,               /* Status verb */
 18349  18349     int *pCurrent,        /* Write current value here */
 18350  18350     int *pHighwater,      /* Write high-water mark here */
 18351  18351     int resetFlag         /* Reset high-water mark if true */
 18352  18352   ){
 18353  18353     int rc = SQLITE_OK;   /* Return code */
................................................................................
 20016  20016   static sqlite3_vfs * SQLITE_WSD vfsList = 0;
 20017  20017   #define vfsList GLOBAL(sqlite3_vfs *, vfsList)
 20018  20018   
 20019  20019   /*
 20020  20020   ** Locate a VFS by name.  If no name is given, simply return the
 20021  20021   ** first VFS on the list.
 20022  20022   */
 20023         -SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfs){
        20023  +SQLITE_API sqlite3_vfs *sqlite3_vfs_find(const char *zVfs){
 20024  20024     sqlite3_vfs *pVfs = 0;
 20025  20025   #if SQLITE_THREADSAFE
 20026  20026     sqlite3_mutex *mutex;
 20027  20027   #endif
 20028  20028   #ifndef SQLITE_OMIT_AUTOINIT
 20029  20029     int rc = sqlite3_initialize();
 20030  20030     if( rc ) return 0;
................................................................................
 20062  20062   }
 20063  20063   
 20064  20064   /*
 20065  20065   ** Register a VFS with the system.  It is harmless to register the same
 20066  20066   ** VFS multiple times.  The new VFS becomes the default if makeDflt is
 20067  20067   ** true.
 20068  20068   */
 20069         -SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){
        20069  +SQLITE_API int sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){
 20070  20070     MUTEX_LOGIC(sqlite3_mutex *mutex;)
 20071  20071   #ifndef SQLITE_OMIT_AUTOINIT
 20072  20072     int rc = sqlite3_initialize();
 20073  20073     if( rc ) return rc;
 20074  20074   #endif
 20075  20075   #ifdef SQLITE_ENABLE_API_ARMOR
 20076  20076     if( pVfs==0 ) return SQLITE_MISUSE_BKPT;
................................................................................
 20090  20090     sqlite3_mutex_leave(mutex);
 20091  20091     return SQLITE_OK;
 20092  20092   }
 20093  20093   
 20094  20094   /*
 20095  20095   ** Unregister a VFS so that it is no longer accessible.
 20096  20096   */
 20097         -SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs *pVfs){
        20097  +SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs *pVfs){
 20098  20098   #if SQLITE_THREADSAFE
 20099  20099     sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
 20100  20100   #endif
 20101  20101     sqlite3_mutex_enter(mutex);
 20102  20102     vfsUnlink(pVfs);
 20103  20103     sqlite3_mutex_leave(mutex);
 20104  20104     return SQLITE_OK;
................................................................................
 22441  22441   
 22442  22442     return rc;
 22443  22443   }
 22444  22444   
 22445  22445   /*
 22446  22446   ** Retrieve a pointer to a static mutex or allocate a new dynamic one.
 22447  22447   */
 22448         -SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int id){
        22448  +SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int id){
 22449  22449   #ifndef SQLITE_OMIT_AUTOINIT
 22450  22450     if( id<=SQLITE_MUTEX_RECURSIVE && sqlite3_initialize() ) return 0;
 22451  22451     if( id>SQLITE_MUTEX_RECURSIVE && sqlite3MutexInit() ) return 0;
 22452  22452   #endif
 22453  22453     assert( sqlite3GlobalConfig.mutex.xMutexAlloc );
 22454  22454     return sqlite3GlobalConfig.mutex.xMutexAlloc(id);
 22455  22455   }
................................................................................
 22462  22462     assert( sqlite3GlobalConfig.mutex.xMutexAlloc );
 22463  22463     return sqlite3GlobalConfig.mutex.xMutexAlloc(id);
 22464  22464   }
 22465  22465   
 22466  22466   /*
 22467  22467   ** Free a dynamic mutex.
 22468  22468   */
 22469         -SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex *p){
        22469  +SQLITE_API void sqlite3_mutex_free(sqlite3_mutex *p){
 22470  22470     if( p ){
 22471  22471       assert( sqlite3GlobalConfig.mutex.xMutexFree );
 22472  22472       sqlite3GlobalConfig.mutex.xMutexFree(p);
 22473  22473     }
 22474  22474   }
 22475  22475   
 22476  22476   /*
 22477  22477   ** Obtain the mutex p. If some other thread already has the mutex, block
 22478  22478   ** until it can be obtained.
 22479  22479   */
 22480         -SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex *p){
        22480  +SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex *p){
 22481  22481     if( p ){
 22482  22482       assert( sqlite3GlobalConfig.mutex.xMutexEnter );
 22483  22483       sqlite3GlobalConfig.mutex.xMutexEnter(p);
 22484  22484     }
 22485  22485   }
 22486  22486   
 22487  22487   /*
 22488  22488   ** Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another
 22489  22489   ** thread holds the mutex and it cannot be obtained, return SQLITE_BUSY.
 22490  22490   */
 22491         -SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex *p){
        22491  +SQLITE_API int sqlite3_mutex_try(sqlite3_mutex *p){
 22492  22492     int rc = SQLITE_OK;
 22493  22493     if( p ){
 22494  22494       assert( sqlite3GlobalConfig.mutex.xMutexTry );
 22495  22495       return sqlite3GlobalConfig.mutex.xMutexTry(p);
 22496  22496     }
 22497  22497     return rc;
 22498  22498   }
................................................................................
 22499  22499   
 22500  22500   /*
 22501  22501   ** The sqlite3_mutex_leave() routine exits a mutex that was previously
 22502  22502   ** entered by the same thread.  The behavior is undefined if the mutex 
 22503  22503   ** is not currently entered. If a NULL pointer is passed as an argument
 22504  22504   ** this function is a no-op.
 22505  22505   */
 22506         -SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex *p){
        22506  +SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex *p){
 22507  22507     if( p ){
 22508  22508       assert( sqlite3GlobalConfig.mutex.xMutexLeave );
 22509  22509       sqlite3GlobalConfig.mutex.xMutexLeave(p);
 22510  22510     }
 22511  22511   }
 22512  22512   
 22513  22513   #ifndef NDEBUG
 22514  22514   /*
 22515  22515   ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are
 22516  22516   ** intended for use inside assert() statements.
 22517  22517   */
 22518         -SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex *p){
        22518  +SQLITE_API int sqlite3_mutex_held(sqlite3_mutex *p){
 22519  22519     assert( p==0 || sqlite3GlobalConfig.mutex.xMutexHeld );
 22520  22520     return p==0 || sqlite3GlobalConfig.mutex.xMutexHeld(p);
 22521  22521   }
 22522         -SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex *p){
        22522  +SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex *p){
 22523  22523     assert( p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld );
 22524  22524     return p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld(p);
 22525  22525   }
 22526  22526   #endif
 22527  22527   
 22528  22528   #endif /* !defined(SQLITE_MUTEX_OMIT) */
 22529  22529   
................................................................................
 23547  23547   
 23548  23548   /* As the winMutexInit() and winMutexEnd() functions are called as part
 23549  23549   ** of the sqlite3_initialize() and sqlite3_shutdown() processing, the
 23550  23550   ** "interlocked" magic used here is probably not strictly necessary.
 23551  23551   */
 23552  23552   static LONG SQLITE_WIN32_VOLATILE winMutex_lock = 0;
 23553  23553   
 23554         -SQLITE_API int SQLITE_STDCALL sqlite3_win32_is_nt(void); /* os_win.c */
 23555         -SQLITE_API void SQLITE_STDCALL sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */
        23554  +SQLITE_API int sqlite3_win32_is_nt(void); /* os_win.c */
        23555  +SQLITE_API void sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */
 23556  23556   
 23557  23557   static int winMutexInit(void){
 23558  23558     /* The first to increment to 1 does actual initialization */
 23559  23559     if( InterlockedCompareExchange(&winMutex_lock, 1, 0)==0 ){
 23560  23560       int i;
 23561  23561       for(i=0; i<ArraySize(winMutex_staticMutexes); i++){
 23562  23562   #if SQLITE_OS_WINRT
................................................................................
 23848  23848   /* #include <stdarg.h> */
 23849  23849   
 23850  23850   /*
 23851  23851   ** Attempt to release up to n bytes of non-essential memory currently
 23852  23852   ** held by SQLite. An example of non-essential memory is memory used to
 23853  23853   ** cache database pages that are not currently in use.
 23854  23854   */
 23855         -SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int n){
        23855  +SQLITE_API int sqlite3_release_memory(int n){
 23856  23856   #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
 23857  23857     return sqlite3PcacheReleaseMemory(n);
 23858  23858   #else
 23859  23859     /* IMPLEMENTATION-OF: R-34391-24921 The sqlite3_release_memory() routine
 23860  23860     ** is a no-op returning zero if SQLite is not compiled with
 23861  23861     ** SQLITE_ENABLE_MEMORY_MANAGEMENT. */
 23862  23862     UNUSED_PARAMETER(n);
................................................................................
 23907  23907   
 23908  23908   #ifndef SQLITE_OMIT_DEPRECATED
 23909  23909   /*
 23910  23910   ** Deprecated external interface.  It used to set an alarm callback
 23911  23911   ** that was invoked when memory usage grew too large.  Now it is a
 23912  23912   ** no-op.
 23913  23913   */
 23914         -SQLITE_API int SQLITE_STDCALL sqlite3_memory_alarm(
        23914  +SQLITE_API int sqlite3_memory_alarm(
 23915  23915     void(*xCallback)(void *pArg, sqlite3_int64 used,int N),
 23916  23916     void *pArg,
 23917  23917     sqlite3_int64 iThreshold
 23918  23918   ){
 23919  23919     (void)xCallback;
 23920  23920     (void)pArg;
 23921  23921     (void)iThreshold;
................................................................................
 23923  23923   }
 23924  23924   #endif
 23925  23925   
 23926  23926   /*
 23927  23927   ** Set the soft heap-size limit for the library. Passing a zero or 
 23928  23928   ** negative value indicates no limit.
 23929  23929   */
 23930         -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 n){
        23930  +SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 n){
 23931  23931     sqlite3_int64 priorLimit;
 23932  23932     sqlite3_int64 excess;
 23933  23933     sqlite3_int64 nUsed;
 23934  23934   #ifndef SQLITE_OMIT_AUTOINIT
 23935  23935     int rc = sqlite3_initialize();
 23936  23936     if( rc ) return -1;
 23937  23937   #endif
................................................................................
 23945  23945     nUsed = sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED);
 23946  23946     mem0.nearlyFull = (n>0 && n<=nUsed);
 23947  23947     sqlite3_mutex_leave(mem0.mutex);
 23948  23948     excess = sqlite3_memory_used() - n;
 23949  23949     if( excess>0 ) sqlite3_release_memory((int)(excess & 0x7fffffff));
 23950  23950     return priorLimit;
 23951  23951   }
 23952         -SQLITE_API void SQLITE_STDCALL sqlite3_soft_heap_limit(int n){
        23952  +SQLITE_API void sqlite3_soft_heap_limit(int n){
 23953  23953     if( n<0 ) n = 0;
 23954  23954     sqlite3_soft_heap_limit64(n);
 23955  23955   }
 23956  23956   
 23957  23957   /*
 23958  23958   ** Initialize the memory allocation subsystem.
 23959  23959   */
................................................................................
 24014  24014     }
 24015  24015     memset(&mem0, 0, sizeof(mem0));
 24016  24016   }
 24017  24017   
 24018  24018   /*
 24019  24019   ** Return the amount of memory currently checked out.
 24020  24020   */
 24021         -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void){
        24021  +SQLITE_API sqlite3_int64 sqlite3_memory_used(void){
 24022  24022     sqlite3_int64 res, mx;
 24023  24023     sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, 0);
 24024  24024     return res;
 24025  24025   }
 24026  24026   
 24027  24027   /*
 24028  24028   ** Return the maximum amount of memory that has ever been
 24029  24029   ** checked out since either the beginning of this process
 24030  24030   ** or since the most recent reset.
 24031  24031   */
 24032         -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag){
        24032  +SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int resetFlag){
 24033  24033     sqlite3_int64 res, mx;
 24034  24034     sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, resetFlag);
 24035  24035     return mx;
 24036  24036   }
 24037  24037   
 24038  24038   /*
 24039  24039   ** Trigger the alarm 
................................................................................
 24105  24105   }
 24106  24106   
 24107  24107   /*
 24108  24108   ** This version of the memory allocation is for use by the application.
 24109  24109   ** First make sure the memory subsystem is initialized, then do the
 24110  24110   ** allocation.
 24111  24111   */
 24112         -SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int n){
        24112  +SQLITE_API void *sqlite3_malloc(int n){
 24113  24113   #ifndef SQLITE_OMIT_AUTOINIT
 24114  24114     if( sqlite3_initialize() ) return 0;
 24115  24115   #endif
 24116  24116     return n<=0 ? 0 : sqlite3Malloc(n);
 24117  24117   }
 24118         -SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64 n){
        24118  +SQLITE_API void *sqlite3_malloc64(sqlite3_uint64 n){
 24119  24119   #ifndef SQLITE_OMIT_AUTOINIT
 24120  24120     if( sqlite3_initialize() ) return 0;
 24121  24121   #endif
 24122  24122     return sqlite3Malloc(n);
 24123  24123   }
 24124  24124   
 24125  24125   /*
................................................................................
 24254  24254   #endif
 24255  24255       return sqlite3GlobalConfig.m.xSize(p);
 24256  24256     }else{
 24257  24257       assert( sqlite3_mutex_held(db->mutex) );
 24258  24258       return db->lookaside.sz;
 24259  24259     }
 24260  24260   }
 24261         -SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void *p){
        24261  +SQLITE_API sqlite3_uint64 sqlite3_msize(void *p){
 24262  24262     assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) );
 24263  24263     assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
 24264  24264     return p ? sqlite3GlobalConfig.m.xSize(p) : 0;
 24265  24265   }
 24266  24266   
 24267  24267   /*
 24268  24268   ** Free memory previously obtained from sqlite3Malloc().
 24269  24269   */
 24270         -SQLITE_API void SQLITE_STDCALL sqlite3_free(void *p){
        24270  +SQLITE_API void sqlite3_free(void *p){
 24271  24271     if( p==0 ) return;  /* IMP: R-49053-54554 */
 24272  24272     assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
 24273  24273     assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) );
 24274  24274     if( sqlite3GlobalConfig.bMemstat ){
 24275  24275       sqlite3_mutex_enter(mem0.mutex);
 24276  24276       sqlite3StatusDown(SQLITE_STATUS_MEMORY_USED, sqlite3MallocSize(p));
 24277  24277       sqlite3StatusDown(SQLITE_STATUS_MALLOC_COUNT, 1);
................................................................................
 24372  24372     return pNew;
 24373  24373   }
 24374  24374   
 24375  24375   /*
 24376  24376   ** The public interface to sqlite3Realloc.  Make sure that the memory
 24377  24377   ** subsystem is initialized prior to invoking sqliteRealloc.
 24378  24378   */
 24379         -SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void *pOld, int n){
        24379  +SQLITE_API void *sqlite3_realloc(void *pOld, int n){
 24380  24380   #ifndef SQLITE_OMIT_AUTOINIT
 24381  24381     if( sqlite3_initialize() ) return 0;
 24382  24382   #endif
 24383  24383     if( n<0 ) n = 0;  /* IMP: R-26507-47431 */
 24384  24384     return sqlite3Realloc(pOld, n);
 24385  24385   }
 24386         -SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void *pOld, sqlite3_uint64 n){
        24386  +SQLITE_API void *sqlite3_realloc64(void *pOld, sqlite3_uint64 n){
 24387  24387   #ifndef SQLITE_OMIT_AUTOINIT
 24388  24388     if( sqlite3_initialize() ) return 0;
 24389  24389   #endif
 24390  24390     return sqlite3Realloc(pOld, n);
 24391  24391   }
 24392  24392   
 24393  24393   
................................................................................
 25606  25606     return z;
 25607  25607   }
 25608  25608   
 25609  25609   /*
 25610  25610   ** Print into memory obtained from sqlite3_malloc().  Omit the internal
 25611  25611   ** %-conversion extensions.
 25612  25612   */
 25613         -SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char *zFormat, va_list ap){
        25613  +SQLITE_API char *sqlite3_vmprintf(const char *zFormat, va_list ap){
 25614  25614     char *z;
 25615  25615     char zBase[SQLITE_PRINT_BUF_SIZE];
 25616  25616     StrAccum acc;
 25617  25617   
 25618  25618   #ifdef SQLITE_ENABLE_API_ARMOR  
 25619  25619     if( zFormat==0 ){
 25620  25620       (void)SQLITE_MISUSE_BKPT;
................................................................................
 25630  25630     return z;
 25631  25631   }
 25632  25632   
 25633  25633   /*
 25634  25634   ** Print into memory obtained from sqlite3_malloc()().  Omit the internal
 25635  25635   ** %-conversion extensions.
 25636  25636   */
 25637         -SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char *zFormat, ...){
        25637  +SQLITE_API char *sqlite3_mprintf(const char *zFormat, ...){
 25638  25638     va_list ap;
 25639  25639     char *z;
 25640  25640   #ifndef SQLITE_OMIT_AUTOINIT
 25641  25641     if( sqlite3_initialize() ) return 0;
 25642  25642   #endif
 25643  25643     va_start(ap, zFormat);
 25644  25644     z = sqlite3_vmprintf(zFormat, ap);
................................................................................
 25655  25655   ** Oops:  The first two arguments of sqlite3_snprintf() are backwards
 25656  25656   ** from the snprintf() standard.  Unfortunately, it is too late to change
 25657  25657   ** this without breaking compatibility, so we just have to live with the
 25658  25658   ** mistake.
 25659  25659   **
 25660  25660   ** sqlite3_vsnprintf() is the varargs version.
 25661  25661   */
 25662         -SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int n, char *zBuf, const char *zFormat, va_list ap){
        25662  +SQLITE_API char *sqlite3_vsnprintf(int n, char *zBuf, const char *zFormat, va_list ap){
 25663  25663     StrAccum acc;
 25664  25664     if( n<=0 ) return zBuf;
 25665  25665   #ifdef SQLITE_ENABLE_API_ARMOR
 25666  25666     if( zBuf==0 || zFormat==0 ) {
 25667  25667       (void)SQLITE_MISUSE_BKPT;
 25668  25668       if( zBuf ) zBuf[0] = 0;
 25669  25669       return zBuf;
 25670  25670     }
 25671  25671   #endif
 25672  25672     sqlite3StrAccumInit(&acc, 0, zBuf, n, 0);
 25673  25673     sqlite3VXPrintf(&acc, zFormat, ap);
 25674  25674     return sqlite3StrAccumFinish(&acc);
 25675  25675   }
 25676         -SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){
        25676  +SQLITE_API char *sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){
 25677  25677     char *z;
 25678  25678     va_list ap;
 25679  25679     va_start(ap,zFormat);
 25680  25680     z = sqlite3_vsnprintf(n, zBuf, zFormat, ap);
 25681  25681     va_end(ap);
 25682  25682     return z;
 25683  25683   }
................................................................................
 25705  25705     sqlite3GlobalConfig.xLog(sqlite3GlobalConfig.pLogArg, iErrCode,
 25706  25706                              sqlite3StrAccumFinish(&acc));
 25707  25707   }
 25708  25708   
 25709  25709   /*
 25710  25710   ** Format and write a message to the log if logging is enabled.
 25711  25711   */
 25712         -SQLITE_API void SQLITE_CDECL sqlite3_log(int iErrCode, const char *zFormat, ...){
        25712  +SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...){
 25713  25713     va_list ap;                             /* Vararg list */
 25714  25714     if( sqlite3GlobalConfig.xLog ){
 25715  25715       va_start(ap, zFormat);
 25716  25716       renderLogMsg(iErrCode, zFormat, ap);
 25717  25717       va_end(ap);
 25718  25718     }
 25719  25719   }
................................................................................
 26282  26282     unsigned char i, j;            /* State variables */
 26283  26283     unsigned char s[256];          /* State variables */
 26284  26284   } sqlite3Prng;
 26285  26285   
 26286  26286   /*
 26287  26287   ** Return N random bytes.
 26288  26288   */
 26289         -SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *pBuf){
        26289  +SQLITE_API void sqlite3_randomness(int N, void *pBuf){
 26290  26290     unsigned char t;
 26291  26291     unsigned char *zBuf = pBuf;
 26292  26292   
 26293  26293     /* The "wsdPrng" macro will resolve to the pseudo-random number generator
 26294  26294     ** state vector.  If writable static data is unsupported on the target,
 26295  26295     ** we have to locate the state vector at run-time.  In the more common
 26296  26296     ** case where writable static data is supported, wsdPrng can refer directly
................................................................................
 27485  27485   **
 27486  27486   ** IMPLEMENTATION-OF: R-30243-02494 The sqlite3_stricmp() and
 27487  27487   ** sqlite3_strnicmp() APIs allow applications and extensions to compare
 27488  27488   ** the contents of two buffers containing UTF-8 strings in a
 27489  27489   ** case-independent fashion, using the same definition of "case
 27490  27490   ** independence" that SQLite uses internally when comparing identifiers.
 27491  27491   */
 27492         -SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *zLeft, const char *zRight){
        27492  +SQLITE_API int sqlite3_stricmp(const char *zLeft, const char *zRight){
 27493  27493     if( zLeft==0 ){
 27494  27494       return zRight ? -1 : 0;
 27495  27495     }else if( zRight==0 ){
 27496  27496       return 1;
 27497  27497     }
 27498  27498     return sqlite3StrICmp(zLeft, zRight);
 27499  27499   }
................................................................................
 27506  27506       c = (int)UpperToLower[*a] - (int)UpperToLower[*b];
 27507  27507       if( c || *a==0 ) break;
 27508  27508       a++;
 27509  27509       b++;
 27510  27510     }
 27511  27511     return c;
 27512  27512   }
 27513         -SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){
        27513  +SQLITE_API int sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){
 27514  27514     register unsigned char *a, *b;
 27515  27515     if( zLeft==0 ){
 27516  27516       return zRight ? -1 : 0;
 27517  27517     }else if( zRight==0 ){
 27518  27518       return 1;
 27519  27519     }
 27520  27520     a = (unsigned char *)zLeft;
................................................................................
 28988  28988       /*  29 */ "NoConflict"       OpHelp("key=r[P3@P4]"),
 28989  28989       /*  30 */ "NotFound"         OpHelp("key=r[P3@P4]"),
 28990  28990       /*  31 */ "Found"            OpHelp("key=r[P3@P4]"),
 28991  28991       /*  32 */ "SeekRowid"        OpHelp("intkey=r[P3]"),
 28992  28992       /*  33 */ "NotExists"        OpHelp("intkey=r[P3]"),
 28993  28993       /*  34 */ "IsNull"           OpHelp("if r[P1]==NULL goto P2"),
 28994  28994       /*  35 */ "NotNull"          OpHelp("if r[P1]!=NULL goto P2"),
 28995         -    /*  36 */ "Ne"               OpHelp("if r[P1]!=r[P3] goto P2"),
 28996         -    /*  37 */ "Eq"               OpHelp("if r[P1]==r[P3] goto P2"),
 28997         -    /*  38 */ "Gt"               OpHelp("if r[P1]>r[P3] goto P2"),
 28998         -    /*  39 */ "Le"               OpHelp("if r[P1]<=r[P3] goto P2"),
 28999         -    /*  40 */ "Lt"               OpHelp("if r[P1]<r[P3] goto P2"),
 29000         -    /*  41 */ "Ge"               OpHelp("if r[P1]>=r[P3] goto P2"),
        28995  +    /*  36 */ "Ne"               OpHelp("IF r[P3]!=r[P1]"),
        28996  +    /*  37 */ "Eq"               OpHelp("IF r[P3]==r[P1]"),
        28997  +    /*  38 */ "Gt"               OpHelp("IF r[P3]>r[P1]"),
        28998  +    /*  39 */ "Le"               OpHelp("IF r[P3]<=r[P1]"),
        28999  +    /*  40 */ "Lt"               OpHelp("IF r[P3]<r[P1]"),
        29000  +    /*  41 */ "Ge"               OpHelp("IF r[P3]>=r[P1]"),
 29001  29001       /*  42 */ "Last"             OpHelp(""),
 29002  29002       /*  43 */ "BitAnd"           OpHelp("r[P3]=r[P1]&r[P2]"),
 29003  29003       /*  44 */ "BitOr"            OpHelp("r[P3]=r[P1]|r[P2]"),
 29004  29004       /*  45 */ "ShiftLeft"        OpHelp("r[P3]=r[P2]<<r[P1]"),
 29005  29005       /*  46 */ "ShiftRight"       OpHelp("r[P3]=r[P2]>>r[P1]"),
 29006  29006       /*  47 */ "Add"              OpHelp("r[P3]=r[P1]+r[P2]"),
 29007  29007       /*  48 */ "Subtract"         OpHelp("r[P3]=r[P2]-r[P1]"),
................................................................................
 36805  36805   ** files.
 36806  36806   **
 36807  36807   ** This routine is called once during SQLite initialization and by a
 36808  36808   ** single thread.  The memory allocation and mutex subsystems have not
 36809  36809   ** necessarily been initialized when this routine is called, and so they
 36810  36810   ** should not be used.
 36811  36811   */
 36812         -SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void){ 
        36812  +SQLITE_API int sqlite3_os_init(void){ 
 36813  36813     /* 
 36814  36814     ** The following macro defines an initializer for an sqlite3_vfs object.
 36815  36815     ** The name of the VFS is NAME.  The pAppData is a pointer to a pointer
 36816  36816     ** to the "finder" function.  (pAppData is a pointer to a pointer because
 36817  36817     ** silly C90 rules prohibit a void* from being cast to a function pointer
 36818  36818     ** and so we have to go through the intermediate pointer to avoid problems
 36819  36819     ** when compiling with -pedantic-errors on GCC.)
................................................................................
 36904  36904   /*
 36905  36905   ** Shutdown the operating system interface.
 36906  36906   **
 36907  36907   ** Some operating systems might need to do some cleanup in this routine,
 36908  36908   ** to release dynamically allocated objects.  But not on unix.
 36909  36909   ** This routine is a no-op for unix.
 36910  36910   */
 36911         -SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void){ 
        36911  +SQLITE_API int sqlite3_os_end(void){ 
 36912  36912     return SQLITE_OK; 
 36913  36913   }
 36914  36914    
 36915  36915   #endif /* SQLITE_OS_UNIX */
 36916  36916   
 36917  36917   /************** End of os_unix.c *********************************************/
 36918  36918   /************** Begin file os_win.c ******************************************/
................................................................................
 38339  38339   /*
 38340  38340   ** If a Win32 native heap has been configured, this function will attempt to
 38341  38341   ** compact it.  Upon success, SQLITE_OK will be returned.  Upon failure, one
 38342  38342   ** of SQLITE_NOMEM, SQLITE_ERROR, or SQLITE_NOTFOUND will be returned.  The
 38343  38343   ** "pnLargest" argument, if non-zero, will be used to return the size of the
 38344  38344   ** largest committed free block in the heap, in bytes.
 38345  38345   */
 38346         -SQLITE_API int SQLITE_STDCALL sqlite3_win32_compact_heap(LPUINT pnLargest){
        38346  +SQLITE_API int sqlite3_win32_compact_heap(LPUINT pnLargest){
 38347  38347     int rc = SQLITE_OK;
 38348  38348     UINT nLargest = 0;
 38349  38349     HANDLE hHeap;
 38350  38350   
 38351  38351     winMemAssertMagic();
 38352  38352     hHeap = winMemGetHeap();
 38353  38353     assert( hHeap!=0 );
................................................................................
 38379  38379   
 38380  38380   /*
 38381  38381   ** If a Win32 native heap has been configured, this function will attempt to
 38382  38382   ** destroy and recreate it.  If the Win32 native heap is not isolated and/or
 38383  38383   ** the sqlite3_memory_used() function does not return zero, SQLITE_BUSY will
 38384  38384   ** be returned and no changes will be made to the Win32 native heap.
 38385  38385   */
 38386         -SQLITE_API int SQLITE_STDCALL sqlite3_win32_reset_heap(){
        38386  +SQLITE_API int sqlite3_win32_reset_heap(){
 38387  38387     int rc;
 38388  38388     MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */
 38389  38389     MUTEX_LOGIC( sqlite3_mutex *pMem; )    /* The memsys static mutex */
 38390  38390     MUTEX_LOGIC( pMaster = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); )
 38391  38391     MUTEX_LOGIC( pMem = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM); )
 38392  38392     sqlite3_mutex_enter(pMaster);
 38393  38393     sqlite3_mutex_enter(pMem);
................................................................................
 38424  38424   #endif /* SQLITE_WIN32_MALLOC */
 38425  38425   
 38426  38426   /*
 38427  38427   ** This function outputs the specified (ANSI) string to the Win32 debugger
 38428  38428   ** (if available).
 38429  38429   */
 38430  38430   
 38431         -SQLITE_API void SQLITE_STDCALL sqlite3_win32_write_debug(const char *zBuf, int nBuf){
        38431  +SQLITE_API void sqlite3_win32_write_debug(const char *zBuf, int nBuf){
 38432  38432     char zDbgBuf[SQLITE_WIN32_DBG_BUF_SIZE];
 38433  38433     int nMin = MIN(nBuf, (SQLITE_WIN32_DBG_BUF_SIZE - 1)); /* may be negative. */
 38434  38434     if( nMin<-1 ) nMin = -1; /* all negative values become -1. */
 38435  38435     assert( nMin==-1 || nMin==0 || nMin<SQLITE_WIN32_DBG_BUF_SIZE );
 38436  38436   #ifdef SQLITE_ENABLE_API_ARMOR
 38437  38437     if( !zBuf ){
 38438  38438       (void)SQLITE_MISUSE_BKPT;
................................................................................
 38470  38470   ** The following routine suspends the current thread for at least ms
 38471  38471   ** milliseconds.  This is equivalent to the Win32 Sleep() interface.
 38472  38472   */
 38473  38473   #if SQLITE_OS_WINRT
 38474  38474   static HANDLE sleepObj = NULL;
 38475  38475   #endif
 38476  38476   
 38477         -SQLITE_API void SQLITE_STDCALL sqlite3_win32_sleep(DWORD milliseconds){
        38477  +SQLITE_API void sqlite3_win32_sleep(DWORD milliseconds){
 38478  38478   #if SQLITE_OS_WINRT
 38479  38479     if ( sleepObj==NULL ){
 38480  38480       sleepObj = osCreateEventExW(NULL, NULL, CREATE_EVENT_MANUAL_RESET,
 38481  38481                                   SYNCHRONIZE);
 38482  38482     }
 38483  38483     assert( sleepObj!=NULL );
 38484  38484     osWaitForSingleObjectEx(sleepObj, milliseconds, FALSE);
................................................................................
 38519  38519   # define osIsNT()  ((sqlite3_os_type==2) || sqlite3_win32_is_nt())
 38520  38520   #endif
 38521  38521   
 38522  38522   /*
 38523  38523   ** This function determines if the machine is running a version of Windows
 38524  38524   ** based on the NT kernel.
 38525  38525   */
 38526         -SQLITE_API int SQLITE_STDCALL sqlite3_win32_is_nt(void){
        38526  +SQLITE_API int sqlite3_win32_is_nt(void){
 38527  38527   #if SQLITE_OS_WINRT
 38528  38528     /*
 38529  38529     ** NOTE: The WinRT sub-platform is always assumed to be based on the NT
 38530  38530     **       kernel.
 38531  38531     */
 38532  38532     return 1;
 38533  38533   #elif SQLITE_WIN32_GETVERSIONEX
................................................................................
 38907  38907     sqlite3_free(zTmpWide);
 38908  38908     return zTextMbcs;
 38909  38909   }
 38910  38910   
 38911  38911   /*
 38912  38912   ** This is a public wrapper for the winUtf8ToUnicode() function.
 38913  38913   */
 38914         -SQLITE_API LPWSTR SQLITE_STDCALL sqlite3_win32_utf8_to_unicode(const char *zText){
        38914  +SQLITE_API LPWSTR sqlite3_win32_utf8_to_unicode(const char *zText){
 38915  38915   #ifdef SQLITE_ENABLE_API_ARMOR
 38916  38916     if( !zText ){
 38917  38917       (void)SQLITE_MISUSE_BKPT;
 38918  38918       return 0;
 38919  38919     }
 38920  38920   #endif
 38921  38921   #ifndef SQLITE_OMIT_AUTOINIT
................................................................................
 38923  38923   #endif
 38924  38924     return winUtf8ToUnicode(zText);
 38925  38925   }
 38926  38926   
 38927  38927   /*
 38928  38928   ** This is a public wrapper for the winUnicodeToUtf8() function.
 38929  38929   */
 38930         -SQLITE_API char *SQLITE_STDCALL sqlite3_win32_unicode_to_utf8(LPCWSTR zWideText){
        38930  +SQLITE_API char *sqlite3_win32_unicode_to_utf8(LPCWSTR zWideText){
 38931  38931   #ifdef SQLITE_ENABLE_API_ARMOR
 38932  38932     if( !zWideText ){
 38933  38933       (void)SQLITE_MISUSE_BKPT;
 38934  38934       return 0;
 38935  38935     }
 38936  38936   #endif
 38937  38937   #ifndef SQLITE_OMIT_AUTOINIT
................................................................................
 38939  38939   #endif
 38940  38940     return winUnicodeToUtf8(zWideText);
 38941  38941   }
 38942  38942   
 38943  38943   /*
 38944  38944   ** This is a public wrapper for the winMbcsToUtf8() function.
 38945  38945   */
 38946         -SQLITE_API char *SQLITE_STDCALL sqlite3_win32_mbcs_to_utf8(const char *zText){
        38946  +SQLITE_API char *sqlite3_win32_mbcs_to_utf8(const char *zText){
 38947  38947   #ifdef SQLITE_ENABLE_API_ARMOR
 38948  38948     if( !zText ){
 38949  38949       (void)SQLITE_MISUSE_BKPT;
 38950  38950       return 0;
 38951  38951     }
 38952  38952   #endif
 38953  38953   #ifndef SQLITE_OMIT_AUTOINIT
................................................................................
 38955  38955   #endif
 38956  38956     return winMbcsToUtf8(zText, osAreFileApisANSI());
 38957  38957   }
 38958  38958   
 38959  38959   /*
 38960  38960   ** This is a public wrapper for the winMbcsToUtf8() function.
 38961  38961   */
 38962         -SQLITE_API char *SQLITE_STDCALL sqlite3_win32_mbcs_to_utf8_v2(const char *zText, int useAnsi){
        38962  +SQLITE_API char *sqlite3_win32_mbcs_to_utf8_v2(const char *zText, int useAnsi){
 38963  38963   #ifdef SQLITE_ENABLE_API_ARMOR
 38964  38964     if( !zText ){
 38965  38965       (void)SQLITE_MISUSE_BKPT;
 38966  38966       return 0;
 38967  38967     }
 38968  38968   #endif
 38969  38969   #ifndef SQLITE_OMIT_AUTOINIT
................................................................................
 38971  38971   #endif
 38972  38972     return winMbcsToUtf8(zText, useAnsi);
 38973  38973   }
 38974  38974   
 38975  38975   /*
 38976  38976   ** This is a public wrapper for the winUtf8ToMbcs() function.
 38977  38977   */
 38978         -SQLITE_API char *SQLITE_STDCALL sqlite3_win32_utf8_to_mbcs(const char *zText){
        38978  +SQLITE_API char *sqlite3_win32_utf8_to_mbcs(const char *zText){
 38979  38979   #ifdef SQLITE_ENABLE_API_ARMOR
 38980  38980     if( !zText ){
 38981  38981       (void)SQLITE_MISUSE_BKPT;
 38982  38982       return 0;
 38983  38983     }
 38984  38984   #endif
 38985  38985   #ifndef SQLITE_OMIT_AUTOINIT
................................................................................
 38987  38987   #endif
 38988  38988     return winUtf8ToMbcs(zText, osAreFileApisANSI());
 38989  38989   }
 38990  38990   
 38991  38991   /*
 38992  38992   ** This is a public wrapper for the winUtf8ToMbcs() function.
 38993  38993   */
 38994         -SQLITE_API char *SQLITE_STDCALL sqlite3_win32_utf8_to_mbcs_v2(const char *zText, int useAnsi){
        38994  +SQLITE_API char *sqlite3_win32_utf8_to_mbcs_v2(const char *zText, int useAnsi){
 38995  38995   #ifdef SQLITE_ENABLE_API_ARMOR
 38996  38996     if( !zText ){
 38997  38997       (void)SQLITE_MISUSE_BKPT;
 38998  38998       return 0;
 38999  38999     }
 39000  39000   #endif
 39001  39001   #ifndef SQLITE_OMIT_AUTOINIT
................................................................................
 39007  39007   /*
 39008  39008   ** This function sets the data directory or the temporary directory based on
 39009  39009   ** the provided arguments.  The type argument must be 1 in order to set the
 39010  39010   ** data directory or 2 in order to set the temporary directory.  The zValue
 39011  39011   ** argument is the name of the directory to use.  The return value will be
 39012  39012   ** SQLITE_OK if successful.
 39013  39013   */
 39014         -SQLITE_API int SQLITE_STDCALL sqlite3_win32_set_directory(DWORD type, LPCWSTR zValue){
        39014  +SQLITE_API int sqlite3_win32_set_directory(DWORD type, LPCWSTR zValue){
 39015  39015     char **ppDirectory = 0;
 39016  39016   #ifndef SQLITE_OMIT_AUTOINIT
 39017  39017     int rc = sqlite3_initialize();
 39018  39018     if( rc ) return rc;
 39019  39019   #endif
 39020  39020     if( type==SQLITE_WIN32_DATA_DIRECTORY_TYPE ){
 39021  39021       ppDirectory = &sqlite3_data_directory;
................................................................................
 42925  42925     if( nBuf>0 ) winGetLastErrorMsg(e, nBuf, zBuf);
 42926  42926     return e;
 42927  42927   }
 42928  42928   
 42929  42929   /*
 42930  42930   ** Initialize and deinitialize the operating system interface.
 42931  42931   */
 42932         -SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void){
        42932  +SQLITE_API int sqlite3_os_init(void){
 42933  42933     static sqlite3_vfs winVfs = {
 42934  42934       3,                     /* iVersion */
 42935  42935       sizeof(winFile),       /* szOsFile */
 42936  42936       SQLITE_WIN32_MAX_PATH_BYTES, /* mxPathname */
 42937  42937       0,                     /* pNext */
 42938  42938       "win32",               /* zName */
 42939  42939       &winAppData,           /* pAppData */
................................................................................
 43056  43056   #if defined(SQLITE_WIN32_HAS_WIDE)
 43057  43057     sqlite3_vfs_register(&winLongPathNolockVfs, 0);
 43058  43058   #endif
 43059  43059   
 43060  43060     return SQLITE_OK;
 43061  43061   }
 43062  43062   
 43063         -SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void){
        43063  +SQLITE_API int sqlite3_os_end(void){
 43064  43064   #if SQLITE_OS_WINRT
 43065  43065     if( sleepObj!=NULL ){
 43066  43066       osCloseHandle(sleepObj);
 43067  43067       sleepObj = NULL;
 43068  43068     }
 43069  43069   #endif
 43070  43070     return SQLITE_OK;
................................................................................
 57081  57081     pWal->pSnapshot = (WalIndexHdr*)pSnapshot;
 57082  57082   }
 57083  57083   
 57084  57084   /* 
 57085  57085   ** Return a +ve value if snapshot p1 is newer than p2. A -ve value if
 57086  57086   ** p1 is older than p2 and zero if p1 and p2 are the same snapshot.
 57087  57087   */
 57088         -SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_cmp(sqlite3_snapshot *p1, sqlite3_snapshot *p2){
        57088  +SQLITE_API int sqlite3_snapshot_cmp(sqlite3_snapshot *p1, sqlite3_snapshot *p2){
 57089  57089     WalIndexHdr *pHdr1 = (WalIndexHdr*)p1;
 57090  57090     WalIndexHdr *pHdr2 = (WalIndexHdr*)p2;
 57091  57091   
 57092  57092     /* aSalt[0] is a copy of the value stored in the wal file header. It
 57093  57093     ** is incremented each time the wal file is restarted.  */
 57094  57094     if( pHdr1->aSalt[0]<pHdr2->aSalt[0] ) return -1;
 57095  57095     if( pHdr1->aSalt[0]>pHdr2->aSalt[0] ) return +1;
................................................................................
 58218  58218   /*
 58219  58219   ** Enable or disable the shared pager and schema features.
 58220  58220   **
 58221  58221   ** This routine has no effect on existing database connections.
 58222  58222   ** The shared cache setting effects only future calls to
 58223  58223   ** sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2().
 58224  58224   */
 58225         -SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int enable){
        58225  +SQLITE_API int sqlite3_enable_shared_cache(int enable){
 58226  58226     sqlite3GlobalConfig.sharedCacheEnabled = enable;
 58227  58227     return SQLITE_OK;
 58228  58228   }
 58229  58229   #endif
 58230  58230   
 58231  58231   
 58232  58232   
................................................................................
 67991  67991   ** Create an sqlite3_backup process to copy the contents of zSrcDb from
 67992  67992   ** connection handle pSrcDb to zDestDb in pDestDb. If successful, return
 67993  67993   ** a pointer to the new sqlite3_backup object.
 67994  67994   **
 67995  67995   ** If an error occurs, NULL is returned and an error code and error message
 67996  67996   ** stored in database handle pDestDb.
 67997  67997   */
 67998         -SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
        67998  +SQLITE_API sqlite3_backup *sqlite3_backup_init(
 67999  67999     sqlite3* pDestDb,                     /* Database to write to */
 68000  68000     const char *zDestDb,                  /* Name of database within pDestDb */
 68001  68001     sqlite3* pSrcDb,                      /* Database connection to read from */
 68002  68002     const char *zSrcDb                    /* Name of database within pSrcDb */
 68003  68003   ){
 68004  68004     sqlite3_backup *p;                    /* Value to return */
 68005  68005   
................................................................................
 68199  68199     *pp = p;
 68200  68200     p->isAttached = 1;
 68201  68201   }
 68202  68202   
 68203  68203   /*
 68204  68204   ** Copy nPage pages from the source b-tree to the destination.
 68205  68205   */
 68206         -SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage){
        68206  +SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){
 68207  68207     int rc;
 68208  68208     int destMode;       /* Destination journal mode */
 68209  68209     int pgszSrc = 0;    /* Source page size */
 68210  68210     int pgszDest = 0;   /* Destination page size */
 68211  68211   
 68212  68212   #ifdef SQLITE_ENABLE_API_ARMOR
 68213  68213     if( p==0 ) return SQLITE_MISUSE_BKPT;
................................................................................
 68443  68443     sqlite3_mutex_leave(p->pSrcDb->mutex);
 68444  68444     return rc;
 68445  68445   }
 68446  68446   
 68447  68447   /*
 68448  68448   ** Release all resources associated with an sqlite3_backup* handle.
 68449  68449   */
 68450         -SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p){
        68450  +SQLITE_API int sqlite3_backup_finish(sqlite3_backup *p){
 68451  68451     sqlite3_backup **pp;                 /* Ptr to head of pagers backup list */
 68452  68452     sqlite3 *pSrcDb;                     /* Source database connection */
 68453  68453     int rc;                              /* Value to return */
 68454  68454   
 68455  68455     /* Enter the mutexes */
 68456  68456     if( p==0 ) return SQLITE_OK;
 68457  68457     pSrcDb = p->pSrcDb;
................................................................................
 68495  68495     return rc;
 68496  68496   }
 68497  68497   
 68498  68498   /*
 68499  68499   ** Return the number of pages still to be backed up as of the most recent
 68500  68500   ** call to sqlite3_backup_step().
 68501  68501   */
 68502         -SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p){
        68502  +SQLITE_API int sqlite3_backup_remaining(sqlite3_backup *p){
 68503  68503   #ifdef SQLITE_ENABLE_API_ARMOR
 68504  68504     if( p==0 ){
 68505  68505       (void)SQLITE_MISUSE_BKPT;
 68506  68506       return 0;
 68507  68507     }
 68508  68508   #endif
 68509  68509     return p->nRemaining;
 68510  68510   }
 68511  68511   
 68512  68512   /*
 68513  68513   ** Return the total number of pages in the source database as of the most 
 68514  68514   ** recent call to sqlite3_backup_step().
 68515  68515   */
 68516         -SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p){
        68516  +SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p){
 68517  68517   #ifdef SQLITE_ENABLE_API_ARMOR
 68518  68518     if( p==0 ){
 68519  68519       (void)SQLITE_MISUSE_BKPT;
 68520  68520       return 0;
 68521  68521     }
 68522  68522   #endif
 68523  68523     return p->nPagecount;
................................................................................
 71448  71448     char *zTemp,       /* Write result here */
 71449  71449     int nTemp          /* Space available in zTemp[] */
 71450  71450   ){
 71451  71451     const char *zOpName;
 71452  71452     const char *zSynopsis;
 71453  71453     int nOpName;
 71454  71454     int ii, jj;
        71455  +  char zAlt[50];
 71455  71456     zOpName = sqlite3OpcodeName(pOp->opcode);
 71456  71457     nOpName = sqlite3Strlen30(zOpName);
 71457  71458     if( zOpName[nOpName+1] ){
 71458  71459       int seenCom = 0;
 71459  71460       char c;
 71460  71461       zSynopsis = zOpName += nOpName + 1;
        71462  +    if( strncmp(zSynopsis,"IF ",3)==0 ){
        71463  +      if( pOp->p5 & SQLITE_STOREP2 ){
        71464  +        sqlite3_snprintf(sizeof(zAlt), zAlt, "r[P2] = (%s)", zSynopsis+3);
        71465  +      }else{
        71466  +        sqlite3_snprintf(sizeof(zAlt), zAlt, "if %s goto P2", zSynopsis+3);
        71467  +      }
        71468  +      zSynopsis = zAlt;
        71469  +    }
 71461  71470       for(ii=jj=0; jj<nTemp-1 && (c = zSynopsis[ii])!=0; ii++){
 71462  71471         if( c=='P' ){
 71463  71472           c = zSynopsis[++ii];
 71464  71473           if( c=='4' ){
 71465  71474             sqlite3_snprintf(nTemp-jj, zTemp+jj, "%s", zP4);
 71466  71475           }else if( c=='X' ){
 71467  71476             sqlite3_snprintf(nTemp-jj, zTemp+jj, "%s", pOp->zComment);
................................................................................
 74965  74974   ** Return TRUE (non-zero) of the statement supplied as an argument needs
 74966  74975   ** to be recompiled.  A statement needs to be recompiled whenever the
 74967  74976   ** execution environment changes in a way that would alter the program
 74968  74977   ** that sqlite3_prepare() generates.  For example, if new functions or
 74969  74978   ** collating sequences are registered or if an authorizer function is
 74970  74979   ** added or changed.
 74971  74980   */
 74972         -SQLITE_API int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt *pStmt){
        74981  +SQLITE_API int sqlite3_expired(sqlite3_stmt *pStmt){
 74973  74982     Vdbe *p = (Vdbe*)pStmt;
 74974  74983     return p==0 || p->expired;
 74975  74984   }
 74976  74985   #endif
 74977  74986   
 74978  74987   /*
 74979  74988   ** Check on a Vdbe to make sure it has not been finalized.  Log
................................................................................
 75034  75043   ** the sqlite3_compile() routine. The integer returned is an SQLITE_
 75035  75044   ** success/failure code that describes the result of executing the virtual
 75036  75045   ** machine.
 75037  75046   **
 75038  75047   ** This routine sets the error code and string returned by
 75039  75048   ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
 75040  75049   */
 75041         -SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt){
        75050  +SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt){
 75042  75051     int rc;
 75043  75052     if( pStmt==0 ){
 75044  75053       /* IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL
 75045  75054       ** pointer is a harmless no-op. */
 75046  75055       rc = SQLITE_OK;
 75047  75056     }else{
 75048  75057       Vdbe *v = (Vdbe*)pStmt;
................................................................................
 75061  75070   ** Terminate the current execution of an SQL statement and reset it
 75062  75071   ** back to its starting state so that it can be reused. A success code from
 75063  75072   ** the prior execution is returned.
 75064  75073   **
 75065  75074   ** This routine sets the error code and string returned by
 75066  75075   ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
 75067  75076   */
 75068         -SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt){
        75077  +SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt){
 75069  75078     int rc;
 75070  75079     if( pStmt==0 ){
 75071  75080       rc = SQLITE_OK;
 75072  75081     }else{
 75073  75082       Vdbe *v = (Vdbe*)pStmt;
 75074  75083       sqlite3 *db = v->db;
 75075  75084       sqlite3_mutex_enter(db->mutex);
................................................................................
 75082  75091     }
 75083  75092     return rc;
 75084  75093   }
 75085  75094   
 75086  75095   /*
 75087  75096   ** Set all the parameters in the compiled SQL statement to NULL.
 75088  75097   */
 75089         -SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt *pStmt){
        75098  +SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt *pStmt){
 75090  75099     int i;
 75091  75100     int rc = SQLITE_OK;
 75092  75101     Vdbe *p = (Vdbe*)pStmt;
 75093  75102   #if SQLITE_THREADSAFE
 75094  75103     sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex;
 75095  75104   #endif
 75096  75105     sqlite3_mutex_enter(mutex);
................................................................................
 75106  75115   }
 75107  75116   
 75108  75117   
 75109  75118   /**************************** sqlite3_value_  *******************************
 75110  75119   ** The following routines extract information from a Mem or sqlite3_value
 75111  75120   ** structure.
 75112  75121   */
 75113         -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value *pVal){
        75122  +SQLITE_API const void *sqlite3_value_blob(sqlite3_value *pVal){
 75114  75123     Mem *p = (Mem*)pVal;
 75115  75124     if( p->flags & (MEM_Blob|MEM_Str) ){
 75116  75125       if( sqlite3VdbeMemExpandBlob(p)!=SQLITE_OK ){
 75117  75126         assert( p->flags==MEM_Null && p->z==0 );
 75118  75127         return 0;
 75119  75128       }
 75120  75129       p->flags |= MEM_Blob;
 75121  75130       return p->n ? p->z : 0;
 75122  75131     }else{
 75123  75132       return sqlite3_value_text(pVal);
 75124  75133     }
 75125  75134   }
 75126         -SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value *pVal){
        75135  +SQLITE_API int sqlite3_value_bytes(sqlite3_value *pVal){
 75127  75136     return sqlite3ValueBytes(pVal, SQLITE_UTF8);
 75128  75137   }
 75129         -SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value *pVal){
        75138  +SQLITE_API int sqlite3_value_bytes16(sqlite3_value *pVal){
 75130  75139     return sqlite3ValueBytes(pVal, SQLITE_UTF16NATIVE);
 75131  75140   }
 75132         -SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value *pVal){
        75141  +SQLITE_API double sqlite3_value_double(sqlite3_value *pVal){
 75133  75142     return sqlite3VdbeRealValue((Mem*)pVal);
 75134  75143   }
 75135         -SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value *pVal){
        75144  +SQLITE_API int sqlite3_value_int(sqlite3_value *pVal){
 75136  75145     return (int)sqlite3VdbeIntValue((Mem*)pVal);
 75137  75146   }
 75138         -SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value *pVal){
        75147  +SQLITE_API sqlite_int64 sqlite3_value_int64(sqlite3_value *pVal){
 75139  75148     return sqlite3VdbeIntValue((Mem*)pVal);
 75140  75149   }
 75141         -SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value *pVal){
        75150  +SQLITE_API unsigned int sqlite3_value_subtype(sqlite3_value *pVal){
 75142  75151     Mem *pMem = (Mem*)pVal;
 75143  75152     return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0);
 75144  75153   }
 75145         -SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value *pVal){
        75154  +SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value *pVal){
 75146  75155     return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
 75147  75156   }
 75148  75157   #ifndef SQLITE_OMIT_UTF16
 75149         -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value* pVal){
        75158  +SQLITE_API const void *sqlite3_value_text16(sqlite3_value* pVal){
 75150  75159     return sqlite3ValueText(pVal, SQLITE_UTF16NATIVE);
 75151  75160   }
 75152         -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value *pVal){
        75161  +SQLITE_API const void *sqlite3_value_text16be(sqlite3_value *pVal){
 75153  75162     return sqlite3ValueText(pVal, SQLITE_UTF16BE);
 75154  75163   }
 75155         -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value *pVal){
        75164  +SQLITE_API const void *sqlite3_value_text16le(sqlite3_value *pVal){
 75156  75165     return sqlite3ValueText(pVal, SQLITE_UTF16LE);
 75157  75166   }
 75158  75167   #endif /* SQLITE_OMIT_UTF16 */
 75159  75168   /* EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five
 75160  75169   ** fundamental datatypes: 64-bit signed integer 64-bit IEEE floating
 75161  75170   ** point number string BLOB NULL
 75162  75171   */
 75163         -SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value* pVal){
        75172  +SQLITE_API int sqlite3_value_type(sqlite3_value* pVal){
 75164  75173     static const u8 aType[] = {
 75165  75174        SQLITE_BLOB,     /* 0x00 */
 75166  75175        SQLITE_NULL,     /* 0x01 */
 75167  75176        SQLITE_TEXT,     /* 0x02 */
 75168  75177        SQLITE_NULL,     /* 0x03 */
 75169  75178        SQLITE_INTEGER,  /* 0x04 */
 75170  75179        SQLITE_NULL,     /* 0x05 */
................................................................................
 75196  75205        SQLITE_NULL,     /* 0x1f */
 75197  75206     };
 75198  75207     return aType[pVal->flags&MEM_AffMask];
 75199  75208   }
 75200  75209   
 75201  75210   /* Make a copy of an sqlite3_value object
 75202  75211   */
 75203         -SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value *pOrig){
        75212  +SQLITE_API sqlite3_value *sqlite3_value_dup(const sqlite3_value *pOrig){
 75204  75213     sqlite3_value *pNew;
 75205  75214     if( pOrig==0 ) return 0;
 75206  75215     pNew = sqlite3_malloc( sizeof(*pNew) );
 75207  75216     if( pNew==0 ) return 0;
 75208  75217     memset(pNew, 0, sizeof(*pNew));
 75209  75218     memcpy(pNew, pOrig, MEMCELLSIZE);
 75210  75219     pNew->flags &= ~MEM_Dyn;
................................................................................
 75219  75228     }
 75220  75229     return pNew;
 75221  75230   }
 75222  75231   
 75223  75232   /* Destroy an sqlite3_value object previously obtained from
 75224  75233   ** sqlite3_value_dup().
 75225  75234   */
 75226         -SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value *pOld){
        75235  +SQLITE_API void sqlite3_value_free(sqlite3_value *pOld){
 75227  75236     sqlite3ValueFree(pOld);
 75228  75237   }
 75229  75238     
 75230  75239   
 75231  75240   /**************************** sqlite3_result_  *******************************
 75232  75241   ** The following routines are used by user-defined functions to specify
 75233  75242   ** the function result.
................................................................................
 75262  75271       /* noop */
 75263  75272     }else{
 75264  75273       xDel((void*)p);
 75265  75274     }
 75266  75275     if( pCtx ) sqlite3_result_error_toobig(pCtx);
 75267  75276     return SQLITE_TOOBIG;
 75268  75277   }
 75269         -SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(
        75278  +SQLITE_API void sqlite3_result_blob(
 75270  75279     sqlite3_context *pCtx, 
 75271  75280     const void *z, 
 75272  75281     int n, 
 75273  75282     void (*xDel)(void *)
 75274  75283   ){
 75275  75284     assert( n>=0 );
 75276  75285     assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
 75277  75286     setResultStrOrError(pCtx, z, n, 0, xDel);
 75278  75287   }
 75279         -SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(
        75288  +SQLITE_API void sqlite3_result_blob64(
 75280  75289     sqlite3_context *pCtx, 
 75281  75290     const void *z, 
 75282  75291     sqlite3_uint64 n,
 75283  75292     void (*xDel)(void *)
 75284  75293   ){
 75285  75294     assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
 75286  75295     assert( xDel!=SQLITE_DYNAMIC );
 75287  75296     if( n>0x7fffffff ){
 75288  75297       (void)invokeValueDestructor(z, xDel, pCtx);
 75289  75298     }else{
 75290  75299       setResultStrOrError(pCtx, z, (int)n, 0, xDel);
 75291  75300     }
 75292  75301   }
 75293         -SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context *pCtx, double rVal){
        75302  +SQLITE_API void sqlite3_result_double(sqlite3_context *pCtx, double rVal){
 75294  75303     assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
 75295  75304     sqlite3VdbeMemSetDouble(pCtx->pOut, rVal);
 75296  75305   }
 75297         -SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
        75306  +SQLITE_API void sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
 75298  75307     assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
 75299  75308     pCtx->isError = SQLITE_ERROR;
 75300  75309     pCtx->fErrorOrAux = 1;
 75301  75310     sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF8, SQLITE_TRANSIENT);
 75302  75311   }
 75303  75312   #ifndef SQLITE_OMIT_UTF16
 75304         -SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){
        75313  +SQLITE_API void sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){
 75305  75314     assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
 75306  75315     pCtx->isError = SQLITE_ERROR;
 75307  75316     pCtx->fErrorOrAux = 1;
 75308  75317     sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF16NATIVE, SQLITE_TRANSIENT);
 75309  75318   }
 75310  75319   #endif
 75311         -SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context *pCtx, int iVal){
        75320  +SQLITE_API void sqlite3_result_int(sqlite3_context *pCtx, int iVal){
 75312  75321     assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
 75313  75322     sqlite3VdbeMemSetInt64(pCtx->pOut, (i64)iVal);
 75314  75323   }
 75315         -SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
        75324  +SQLITE_API void sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
 75316  75325     assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
 75317  75326     sqlite3VdbeMemSetInt64(pCtx->pOut, iVal);
 75318  75327   }
 75319         -SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context *pCtx){
        75328  +SQLITE_API void sqlite3_result_null(sqlite3_context *pCtx){
 75320  75329     assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
 75321  75330     sqlite3VdbeMemSetNull(pCtx->pOut);
 75322  75331   }
 75323         -SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){
        75332  +SQLITE_API void sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){
 75324  75333     Mem *pOut = pCtx->pOut;
 75325  75334     assert( sqlite3_mutex_held(pOut->db->mutex) );
 75326  75335     pOut->eSubtype = eSubtype & 0xff;
 75327  75336     pOut->flags |= MEM_Subtype;
 75328  75337   }
 75329         -SQLITE_API void SQLITE_STDCALL sqlite3_result_text(
        75338  +SQLITE_API void sqlite3_result_text(
 75330  75339     sqlite3_context *pCtx, 
 75331  75340     const char *z, 
 75332  75341     int n,
 75333  75342     void (*xDel)(void *)
 75334  75343   ){
 75335  75344     assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
 75336  75345     setResultStrOrError(pCtx, z, n, SQLITE_UTF8, xDel);
 75337  75346   }
 75338         -SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(
        75347  +SQLITE_API void sqlite3_result_text64(
 75339  75348     sqlite3_context *pCtx, 
 75340  75349     const char *z, 
 75341  75350     sqlite3_uint64 n,
 75342  75351     void (*xDel)(void *),
 75343  75352     unsigned char enc
 75344  75353   ){
 75345  75354     assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
................................................................................
 75348  75357     if( n>0x7fffffff ){
 75349  75358       (void)invokeValueDestructor(z, xDel, pCtx);
 75350  75359     }else{
 75351  75360       setResultStrOrError(pCtx, z, (int)n, enc, xDel);
 75352  75361     }
 75353  75362   }
 75354  75363   #ifndef SQLITE_OMIT_UTF16
 75355         -SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(
        75364  +SQLITE_API void sqlite3_result_text16(
 75356  75365     sqlite3_context *pCtx, 
 75357  75366     const void *z, 
 75358  75367     int n, 
 75359  75368     void (*xDel)(void *)
 75360  75369   ){
 75361  75370     assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
 75362  75371     setResultStrOrError(pCtx, z, n, SQLITE_UTF16NATIVE, xDel);
 75363  75372   }
 75364         -SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(
        75373  +SQLITE_API void sqlite3_result_text16be(
 75365  75374     sqlite3_context *pCtx, 
 75366  75375     const void *z, 
 75367  75376     int n, 
 75368  75377     void (*xDel)(void *)
 75369  75378   ){
 75370  75379     assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
 75371  75380     setResultStrOrError(pCtx, z, n, SQLITE_UTF16BE, xDel);
 75372  75381   }
 75373         -SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(
        75382  +SQLITE_API void sqlite3_result_text16le(
 75374  75383     sqlite3_context *pCtx, 
 75375  75384     const void *z, 
 75376  75385     int n, 
 75377  75386     void (*xDel)(void *)
 75378  75387   ){
 75379  75388     assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
 75380  75389     setResultStrOrError(pCtx, z, n, SQLITE_UTF16LE, xDel);
 75381  75390   }
 75382  75391   #endif /* SQLITE_OMIT_UTF16 */
 75383         -SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){
        75392  +SQLITE_API void sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){
 75384  75393     assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
 75385  75394     sqlite3VdbeMemCopy(pCtx->pOut, pValue);
 75386  75395   }
 75387         -SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){
        75396  +SQLITE_API void sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){
 75388  75397     assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
 75389  75398     sqlite3VdbeMemSetZeroBlob(pCtx->pOut, n);
 75390  75399   }
 75391         -SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){
        75400  +SQLITE_API int sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){
 75392  75401     Mem *pOut = pCtx->pOut;
 75393  75402     assert( sqlite3_mutex_held(pOut->db->mutex) );
 75394  75403     if( n>(u64)pOut->db->aLimit[SQLITE_LIMIT_LENGTH] ){
 75395  75404       return SQLITE_TOOBIG;
 75396  75405     }
 75397  75406     sqlite3VdbeMemSetZeroBlob(pCtx->pOut, (int)n);
 75398  75407     return SQLITE_OK;
 75399  75408   }
 75400         -SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){
        75409  +SQLITE_API void sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){
 75401  75410     pCtx->isError = errCode;
 75402  75411     pCtx->fErrorOrAux = 1;
 75403  75412   #ifdef SQLITE_DEBUG
 75404  75413     if( pCtx->pVdbe ) pCtx->pVdbe->rcApp = errCode;
 75405  75414   #endif
 75406  75415     if( pCtx->pOut->flags & MEM_Null ){
 75407  75416       sqlite3VdbeMemSetStr(pCtx->pOut, sqlite3ErrStr(errCode), -1, 
 75408  75417                            SQLITE_UTF8, SQLITE_STATIC);
 75409  75418     }
 75410  75419   }
 75411  75420   
 75412  75421   /* Force an SQLITE_TOOBIG error. */
 75413         -SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context *pCtx){
        75422  +SQLITE_API void sqlite3_result_error_toobig(sqlite3_context *pCtx){
 75414  75423     assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
 75415  75424     pCtx->isError = SQLITE_TOOBIG;
 75416  75425     pCtx->fErrorOrAux = 1;
 75417  75426     sqlite3VdbeMemSetStr(pCtx->pOut, "string or blob too big", -1, 
 75418  75427                          SQLITE_UTF8, SQLITE_STATIC);
 75419  75428   }
 75420  75429   
 75421  75430   /* An SQLITE_NOMEM error. */
 75422         -SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context *pCtx){
        75431  +SQLITE_API void sqlite3_result_error_nomem(sqlite3_context *pCtx){
 75423  75432     assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
 75424  75433     sqlite3VdbeMemSetNull(pCtx->pOut);
 75425  75434     pCtx->isError = SQLITE_NOMEM_BKPT;
 75426  75435     pCtx->fErrorOrAux = 1;
 75427  75436     sqlite3OomFault(pCtx->pOut->db);
 75428  75437   }
 75429  75438   
................................................................................
 75587  75596   }
 75588  75597   
 75589  75598   /*
 75590  75599   ** This is the top-level implementation of sqlite3_step().  Call
 75591  75600   ** sqlite3Step() to do most of the work.  If a schema error occurs,
 75592  75601   ** call sqlite3Reprepare() and try again.
 75593  75602   */
 75594         -SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt *pStmt){
        75603  +SQLITE_API int sqlite3_step(sqlite3_stmt *pStmt){
 75595  75604     int rc = SQLITE_OK;      /* Result from sqlite3Step() */
 75596  75605     int rc2 = SQLITE_OK;     /* Result from sqlite3Reprepare() */
 75597  75606     Vdbe *v = (Vdbe*)pStmt;  /* the prepared statement */
 75598  75607     int cnt = 0;             /* Counter to prevent infinite loop of reprepares */
 75599  75608     sqlite3 *db;             /* The database connection */
 75600  75609   
 75601  75610     if( vdbeSafetyNotNull(v) ){
................................................................................
 75638  75647   }
 75639  75648   
 75640  75649   
 75641  75650   /*
 75642  75651   ** Extract the user data from a sqlite3_context structure and return a
 75643  75652   ** pointer to it.
 75644  75653   */
 75645         -SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context *p){
        75654  +SQLITE_API void *sqlite3_user_data(sqlite3_context *p){
 75646  75655     assert( p && p->pFunc );
 75647  75656     return p->pFunc->pUserData;
 75648  75657   }
 75649  75658   
 75650  75659   /*
 75651  75660   ** Extract the user data from a sqlite3_context structure and return a
 75652  75661   ** pointer to it.
................................................................................
 75653  75662   **
 75654  75663   ** IMPLEMENTATION-OF: R-46798-50301 The sqlite3_context_db_handle() interface
 75655  75664   ** returns a copy of the pointer to the database connection (the 1st
 75656  75665   ** parameter) of the sqlite3_create_function() and
 75657  75666   ** sqlite3_create_function16() routines that originally registered the
 75658  75667   ** application defined function.
 75659  75668   */
 75660         -SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context *p){
        75669  +SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context *p){
 75661  75670     assert( p && p->pOut );
 75662  75671     return p->pOut->db;
 75663  75672   }
 75664  75673   
 75665  75674   /*
 75666  75675   ** Return the current time for a statement.  If the current time
 75667  75676   ** is requested more than once within the same run of a single prepared
................................................................................
 75729  75738   }
 75730  75739   
 75731  75740   /*
 75732  75741   ** Allocate or return the aggregate context for a user function.  A new
 75733  75742   ** context is allocated on the first call.  Subsequent calls return the
 75734  75743   ** same context that was returned on prior calls.
 75735  75744   */
 75736         -SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context *p, int nByte){
        75745  +SQLITE_API void *sqlite3_aggregate_context(sqlite3_context *p, int nByte){
 75737  75746     assert( p && p->pFunc && p->pFunc->xFinalize );
 75738  75747     assert( sqlite3_mutex_held(p->pOut->db->mutex) );
 75739  75748     testcase( nByte<0 );
 75740  75749     if( (p->pMem->flags & MEM_Agg)==0 ){
 75741  75750       return createAggContext(p, nByte);
 75742  75751     }else{
 75743  75752       return (void*)p->pMem->z;
................................................................................
 75744  75753     }
 75745  75754   }
 75746  75755   
 75747  75756   /*
 75748  75757   ** Return the auxiliary data pointer, if any, for the iArg'th argument to
 75749  75758   ** the user-function defined by pCtx.
 75750  75759   */
 75751         -SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
        75760  +SQLITE_API void *sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
 75752  75761     AuxData *pAuxData;
 75753  75762   
 75754  75763     assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
 75755  75764   #if SQLITE_ENABLE_STAT3_OR_STAT4
 75756  75765     if( pCtx->pVdbe==0 ) return 0;
 75757  75766   #else
 75758  75767     assert( pCtx->pVdbe!=0 );
................................................................................
 75765  75774   }
 75766  75775   
 75767  75776   /*
 75768  75777   ** Set the auxiliary data pointer and delete function, for the iArg'th
 75769  75778   ** argument to the user-function defined by pCtx. Any previous value is
 75770  75779   ** deleted by calling the delete function specified when it was set.
 75771  75780   */
 75772         -SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(
        75781  +SQLITE_API void sqlite3_set_auxdata(
 75773  75782     sqlite3_context *pCtx, 
 75774  75783     int iArg, 
 75775  75784     void *pAux, 
 75776  75785     void (*xDelete)(void*)
 75777  75786   ){
 75778  75787     AuxData *pAuxData;
 75779  75788     Vdbe *pVdbe = pCtx->pVdbe;
................................................................................
 75820  75829   ** called.
 75821  75830   **
 75822  75831   ** This function is deprecated.  Do not use it for new code.  It is
 75823  75832   ** provide only to avoid breaking legacy code.  New aggregate function
 75824  75833   ** implementations should keep their own counts within their aggregate
 75825  75834   ** context.
 75826  75835   */
 75827         -SQLITE_API int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context *p){
        75836  +SQLITE_API int sqlite3_aggregate_count(sqlite3_context *p){
 75828  75837     assert( p && p->pMem && p->pFunc && p->pFunc->xFinalize );
 75829  75838     return p->pMem->n;
 75830  75839   }
 75831  75840   #endif
 75832  75841   
 75833  75842   /*
 75834  75843   ** Return the number of columns in the result set for the statement pStmt.
 75835  75844   */
 75836         -SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt){
        75845  +SQLITE_API int sqlite3_column_count(sqlite3_stmt *pStmt){
 75837  75846     Vdbe *pVm = (Vdbe *)pStmt;
 75838  75847     return pVm ? pVm->nResColumn : 0;
 75839  75848   }
 75840  75849   
 75841  75850   /*
 75842  75851   ** Return the number of values available from the current row of the
 75843  75852   ** currently executing statement pStmt.
 75844  75853   */
 75845         -SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt){
        75854  +SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt){
 75846  75855     Vdbe *pVm = (Vdbe *)pStmt;
 75847  75856     if( pVm==0 || pVm->pResultSet==0 ) return 0;
 75848  75857     return pVm->nResColumn;
 75849  75858   }
 75850  75859   
 75851  75860   /*
 75852  75861   ** Return a pointer to static memory containing an SQL NULL value.
................................................................................
 75941  75950     }
 75942  75951   }
 75943  75952   
 75944  75953   /**************************** sqlite3_column_  *******************************
 75945  75954   ** The following routines are used to access elements of the current row
 75946  75955   ** in the result set.
 75947  75956   */
 75948         -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt *pStmt, int i){
        75957  +SQLITE_API const void *sqlite3_column_blob(sqlite3_stmt *pStmt, int i){
 75949  75958     const void *val;
 75950  75959     val = sqlite3_value_blob( columnMem(pStmt,i) );
 75951  75960     /* Even though there is no encoding conversion, value_blob() might
 75952  75961     ** need to call malloc() to expand the result of a zeroblob() 
 75953  75962     ** expression. 
 75954  75963     */
 75955  75964     columnMallocFailure(pStmt);
 75956  75965     return val;
 75957  75966   }
 75958         -SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){
        75967  +SQLITE_API int sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){
 75959  75968     int val = sqlite3_value_bytes( columnMem(pStmt,i) );
 75960  75969     columnMallocFailure(pStmt);
 75961  75970     return val;
 75962  75971   }
 75963         -SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){
        75972  +SQLITE_API int sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){
 75964  75973     int val = sqlite3_value_bytes16( columnMem(pStmt,i) );
 75965  75974     columnMallocFailure(pStmt);
 75966  75975     return val;
 75967  75976   }
 75968         -SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt *pStmt, int i){
        75977  +SQLITE_API double sqlite3_column_double(sqlite3_stmt *pStmt, int i){
 75969  75978     double val = sqlite3_value_double( columnMem(pStmt,i) );
 75970  75979     columnMallocFailure(pStmt);
 75971  75980     return val;
 75972  75981   }
 75973         -SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt *pStmt, int i){
        75982  +SQLITE_API int sqlite3_column_int(sqlite3_stmt *pStmt, int i){
 75974  75983     int val = sqlite3_value_int( columnMem(pStmt,i) );
 75975  75984     columnMallocFailure(pStmt);
 75976  75985     return val;
 75977  75986   }
 75978         -SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt *pStmt, int i){
        75987  +SQLITE_API sqlite_int64 sqlite3_column_int64(sqlite3_stmt *pStmt, int i){
 75979  75988     sqlite_int64 val = sqlite3_value_int64( columnMem(pStmt,i) );
 75980  75989     columnMallocFailure(pStmt);
 75981  75990     return val;
 75982  75991   }
 75983         -SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt *pStmt, int i){
        75992  +SQLITE_API const unsigned char *sqlite3_column_text(sqlite3_stmt *pStmt, int i){
 75984  75993     const unsigned char *val = sqlite3_value_text( columnMem(pStmt,i) );
 75985  75994     columnMallocFailure(pStmt);
 75986  75995     return val;
 75987  75996   }
 75988         -SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt *pStmt, int i){
        75997  +SQLITE_API sqlite3_value *sqlite3_column_value(sqlite3_stmt *pStmt, int i){
 75989  75998     Mem *pOut = columnMem(pStmt, i);
 75990  75999     if( pOut->flags&MEM_Static ){
 75991  76000       pOut->flags &= ~MEM_Static;
 75992  76001       pOut->flags |= MEM_Ephem;
 75993  76002     }
 75994  76003     columnMallocFailure(pStmt);
 75995  76004     return (sqlite3_value *)pOut;
 75996  76005   }
 75997  76006   #ifndef SQLITE_OMIT_UTF16
 75998         -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt *pStmt, int i){
        76007  +SQLITE_API const void *sqlite3_column_text16(sqlite3_stmt *pStmt, int i){
 75999  76008     const void *val = sqlite3_value_text16( columnMem(pStmt,i) );
 76000  76009     columnMallocFailure(pStmt);
 76001  76010     return val;
 76002  76011   }
 76003  76012   #endif /* SQLITE_OMIT_UTF16 */
 76004         -SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt *pStmt, int i){
        76013  +SQLITE_API int sqlite3_column_type(sqlite3_stmt *pStmt, int i){
 76005  76014     int iType = sqlite3_value_type( columnMem(pStmt,i) );
 76006  76015     columnMallocFailure(pStmt);
 76007  76016     return iType;
 76008  76017   }
 76009  76018   
 76010  76019   /*
 76011  76020   ** Convert the N-th element of pStmt->pColName[] into a string using
................................................................................
 76061  76070     return ret;
 76062  76071   }
 76063  76072   
 76064  76073   /*
 76065  76074   ** Return the name of the Nth column of the result set returned by SQL
 76066  76075   ** statement pStmt.
 76067  76076   */
 76068         -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt *pStmt, int N){
        76077  +SQLITE_API const char *sqlite3_column_name(sqlite3_stmt *pStmt, int N){
 76069  76078     return columnName(
 76070  76079         pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_NAME);
 76071  76080   }
 76072  76081   #ifndef SQLITE_OMIT_UTF16
 76073         -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt *pStmt, int N){
        76082  +SQLITE_API const void *sqlite3_column_name16(sqlite3_stmt *pStmt, int N){
 76074  76083     return columnName(
 76075  76084         pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_NAME);
 76076  76085   }
 76077  76086   #endif
 76078  76087   
 76079  76088   /*
 76080  76089   ** Constraint:  If you have ENABLE_COLUMN_METADATA then you must
................................................................................
 76086  76095   #endif
 76087  76096   
 76088  76097   #ifndef SQLITE_OMIT_DECLTYPE
 76089  76098   /*
 76090  76099   ** Return the column declaration type (if applicable) of the 'i'th column
 76091  76100   ** of the result set of SQL statement pStmt.
 76092  76101   */
 76093         -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){
        76102  +SQLITE_API const char *sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){
 76094  76103     return columnName(
 76095  76104         pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DECLTYPE);
 76096  76105   }
 76097  76106   #ifndef SQLITE_OMIT_UTF16
 76098         -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){
        76107  +SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){
 76099  76108     return columnName(
 76100  76109         pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DECLTYPE);
 76101  76110   }
 76102  76111   #endif /* SQLITE_OMIT_UTF16 */
 76103  76112   #endif /* SQLITE_OMIT_DECLTYPE */
 76104  76113   
 76105  76114   #ifdef SQLITE_ENABLE_COLUMN_METADATA
 76106  76115   /*
 76107  76116   ** Return the name of the database from which a result column derives.
 76108  76117   ** NULL is returned if the result column is an expression or constant or
 76109  76118   ** anything else which is not an unambiguous reference to a database column.
 76110  76119   */
 76111         -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){
        76120  +SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){
 76112  76121     return columnName(
 76113  76122         pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DATABASE);
 76114  76123   }
 76115  76124   #ifndef SQLITE_OMIT_UTF16
 76116         -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){
        76125  +SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){
 76117  76126     return columnName(
 76118  76127         pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DATABASE);
 76119  76128   }
 76120  76129   #endif /* SQLITE_OMIT_UTF16 */
 76121  76130   
 76122  76131   /*
 76123  76132   ** Return the name of the table from which a result column derives.
 76124  76133   ** NULL is returned if the result column is an expression or constant or
 76125  76134   ** anything else which is not an unambiguous reference to a database column.
 76126  76135   */
 76127         -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){
        76136  +SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){
 76128  76137     return columnName(
 76129  76138         pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_TABLE);
 76130  76139   }
 76131  76140   #ifndef SQLITE_OMIT_UTF16
 76132         -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){
        76141  +SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){
 76133  76142     return columnName(
 76134  76143         pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_TABLE);
 76135  76144   }
 76136  76145   #endif /* SQLITE_OMIT_UTF16 */
 76137  76146   
 76138  76147   /*
 76139  76148   ** Return the name of the table column from which a result column derives.
 76140  76149   ** NULL is returned if the result column is an expression or constant or
 76141  76150   ** anything else which is not an unambiguous reference to a database column.
 76142  76151   */
 76143         -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){
        76152  +SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){
 76144  76153     return columnName(
 76145  76154         pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_COLUMN);
 76146  76155   }
 76147  76156   #ifndef SQLITE_OMIT_UTF16
 76148         -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){
        76157  +SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){
 76149  76158     return columnName(
 76150  76159         pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_COLUMN);
 76151  76160   }
 76152  76161   #endif /* SQLITE_OMIT_UTF16 */
 76153  76162   #endif /* SQLITE_ENABLE_COLUMN_METADATA */
 76154  76163   
 76155  76164   
................................................................................
 76242  76251     return rc;
 76243  76252   }
 76244  76253   
 76245  76254   
 76246  76255   /*
 76247  76256   ** Bind a blob value to an SQL statement variable.
 76248  76257   */
 76249         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(
        76258  +SQLITE_API int sqlite3_bind_blob(
 76250  76259     sqlite3_stmt *pStmt, 
 76251  76260     int i, 
 76252  76261     const void *zData, 
 76253  76262     int nData, 
 76254  76263     void (*xDel)(void*)
 76255  76264   ){
 76256  76265   #ifdef SQLITE_ENABLE_API_ARMOR
 76257  76266     if( nData<0 ) return SQLITE_MISUSE_BKPT;
 76258  76267   #endif
 76259  76268     return bindText(pStmt, i, zData, nData, xDel, 0);
 76260  76269   }
 76261         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(
        76270  +SQLITE_API int sqlite3_bind_blob64(
 76262  76271     sqlite3_stmt *pStmt, 
 76263  76272     int i, 
 76264  76273     const void *zData, 
 76265  76274     sqlite3_uint64 nData, 
 76266  76275     void (*xDel)(void*)
 76267  76276   ){
 76268  76277     assert( xDel!=SQLITE_DYNAMIC );
 76269  76278     if( nData>0x7fffffff ){
 76270  76279       return invokeValueDestructor(zData, xDel, 0);
 76271  76280     }else{
 76272  76281       return bindText(pStmt, i, zData, (int)nData, xDel, 0);
 76273  76282     }
 76274  76283   }
 76275         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
        76284  +SQLITE_API int sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
 76276  76285     int rc;
 76277  76286     Vdbe *p = (Vdbe *)pStmt;
 76278  76287     rc = vdbeUnbind(p, i);
 76279  76288     if( rc==SQLITE_OK ){
 76280  76289       sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue);
 76281  76290       sqlite3_mutex_leave(p->db->mutex);
 76282  76291     }
 76283  76292     return rc;
 76284  76293   }
 76285         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){
        76294  +SQLITE_API int sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){
 76286  76295     return sqlite3_bind_int64(p, i, (i64)iValue);
 76287  76296   }
 76288         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
        76297  +SQLITE_API int sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
 76289  76298     int rc;
 76290  76299     Vdbe *p = (Vdbe *)pStmt;
 76291  76300     rc = vdbeUnbind(p, i);
 76292  76301     if( rc==SQLITE_OK ){
 76293  76302       sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue);
 76294  76303       sqlite3_mutex_leave(p->db->mutex);
 76295  76304     }
 76296  76305     return rc;
 76297  76306   }
 76298         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
        76307  +SQLITE_API int sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
 76299  76308     int rc;
 76300  76309     Vdbe *p = (Vdbe*)pStmt;
 76301  76310     rc = vdbeUnbind(p, i);
 76302  76311     if( rc==SQLITE_OK ){
 76303  76312       sqlite3_mutex_leave(p->db->mutex);
 76304  76313     }
 76305  76314     return rc;
 76306  76315   }
 76307         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_text( 
        76316  +SQLITE_API int sqlite3_bind_text( 
 76308  76317     sqlite3_stmt *pStmt, 
 76309  76318     int i, 
 76310  76319     const char *zData, 
 76311  76320     int nData, 
 76312  76321     void (*xDel)(void*)
 76313  76322   ){
 76314  76323     return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8);
 76315  76324   }
 76316         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64( 
        76325  +SQLITE_API int sqlite3_bind_text64( 
 76317  76326     sqlite3_stmt *pStmt, 
 76318  76327     int i, 
 76319  76328     const char *zData, 
 76320  76329     sqlite3_uint64 nData, 
 76321  76330     void (*xDel)(void*),
 76322  76331     unsigned char enc
 76323  76332   ){
................................................................................
 76326  76335       return invokeValueDestructor(zData, xDel, 0);
 76327  76336     }else{
 76328  76337       if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE;
 76329  76338       return bindText(pStmt, i, zData, (int)nData, xDel, enc);
 76330  76339     }
 76331  76340   }
 76332  76341   #ifndef SQLITE_OMIT_UTF16
 76333         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(
        76342  +SQLITE_API int sqlite3_bind_text16(
 76334  76343     sqlite3_stmt *pStmt, 
 76335  76344     int i, 
 76336  76345     const void *zData, 
 76337  76346     int nData, 
 76338  76347     void (*xDel)(void*)
 76339  76348   ){
 76340  76349     return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE);
 76341  76350   }
 76342  76351   #endif /* SQLITE_OMIT_UTF16 */
 76343         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
        76352  +SQLITE_API int sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
 76344  76353     int rc;
 76345  76354     switch( sqlite3_value_type((sqlite3_value*)pValue) ){
 76346  76355       case SQLITE_INTEGER: {
 76347  76356         rc = sqlite3_bind_int64(pStmt, i, pValue->u.i);
 76348  76357         break;
 76349  76358       }
 76350  76359       case SQLITE_FLOAT: {
................................................................................
 76367  76376       default: {
 76368  76377         rc = sqlite3_bind_null(pStmt, i);
 76369  76378         break;
 76370  76379       }
 76371  76380     }
 76372  76381     return rc;
 76373  76382   }
 76374         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
        76383  +SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
 76375  76384     int rc;
 76376  76385     Vdbe *p = (Vdbe *)pStmt;
 76377  76386     rc = vdbeUnbind(p, i);
 76378  76387     if( rc==SQLITE_OK ){
 76379  76388       sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n);
 76380  76389       sqlite3_mutex_leave(p->db->mutex);
 76381  76390     }
 76382  76391     return rc;
 76383  76392   }
 76384         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){
        76393  +SQLITE_API int sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){
 76385  76394     int rc;
 76386  76395     Vdbe *p = (Vdbe *)pStmt;
 76387  76396     sqlite3_mutex_enter(p->db->mutex);
 76388  76397     if( n>(u64)p->db->aLimit[SQLITE_LIMIT_LENGTH] ){
 76389  76398       rc = SQLITE_TOOBIG;
 76390  76399     }else{
 76391  76400       assert( (n & 0x7FFFFFFF)==n );
................................................................................
 76396  76405     return rc;
 76397  76406   }
 76398  76407   
 76399  76408   /*
 76400  76409   ** Return the number of wildcards that can be potentially bound to.
 76401  76410   ** This routine is added to support DBD::SQLite.  
 76402  76411   */
 76403         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
        76412  +SQLITE_API int sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
 76404  76413     Vdbe *p = (Vdbe*)pStmt;
 76405  76414     return p ? p->nVar : 0;
 76406  76415   }
 76407  76416   
 76408  76417   /*
 76409  76418   ** Return the name of a wildcard parameter.  Return NULL if the index
 76410  76419   ** is out of range or if the wildcard is unnamed.
 76411  76420   **
 76412  76421   ** The result is always UTF-8.
 76413  76422   */
 76414         -SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){
        76423  +SQLITE_API const char *sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){
 76415  76424     Vdbe *p = (Vdbe*)pStmt;
 76416  76425     if( p==0 || i<1 || i>p->nzVar ){
 76417  76426       return 0;
 76418  76427     }
 76419  76428     return p->azVar[i-1];
 76420  76429   }
 76421  76430   
................................................................................
 76435  76444         if( z && strncmp(z,zName,nName)==0 && z[nName]==0 ){
 76436  76445           return i+1;
 76437  76446         }
 76438  76447       }
 76439  76448     }
 76440  76449     return 0;
 76441  76450   }
 76442         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
        76451  +SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
 76443  76452     return sqlite3VdbeParameterIndex((Vdbe*)pStmt, zName, sqlite3Strlen30(zName));
 76444  76453   }
 76445  76454   
 76446  76455   /*
 76447  76456   ** Transfer all bindings from the first statement over to the second.
 76448  76457   */
 76449  76458   SQLITE_PRIVATE int sqlite3TransferBindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
................................................................................
 76469  76478   ** database connections.  But as this is a deprecated interface, we
 76470  76479   ** will not bother to check for that condition.
 76471  76480   **
 76472  76481   ** If the two statements contain a different number of bindings, then
 76473  76482   ** an SQLITE_ERROR is returned.  Nothing else can go wrong, so otherwise
 76474  76483   ** SQLITE_OK is returned.
 76475  76484   */
 76476         -SQLITE_API int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
        76485  +SQLITE_API int sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
 76477  76486     Vdbe *pFrom = (Vdbe*)pFromStmt;
 76478  76487     Vdbe *pTo = (Vdbe*)pToStmt;
 76479  76488     if( pFrom->nVar!=pTo->nVar ){
 76480  76489       return SQLITE_ERROR;
 76481  76490     }
 76482  76491     if( pTo->isPrepareV2 && pTo->expmask ){
 76483  76492       pTo->expired = 1;
................................................................................
 76491  76500   
 76492  76501   /*
 76493  76502   ** Return the sqlite3* database handle to which the prepared statement given
 76494  76503   ** in the argument belongs.  This is the same database handle that was
 76495  76504   ** the first argument to the sqlite3_prepare() that was used to create
 76496  76505   ** the statement in the first place.
 76497  76506   */
 76498         -SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt *pStmt){
        76507  +SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt *pStmt){
 76499  76508     return pStmt ? ((Vdbe*)pStmt)->db : 0;
 76500  76509   }
 76501  76510   
 76502  76511   /*
 76503  76512   ** Return true if the prepared statement is guaranteed to not modify the
 76504  76513   ** database.
 76505  76514   */
 76506         -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt){
        76515  +SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt){
 76507  76516     return pStmt ? ((Vdbe*)pStmt)->readOnly : 1;
 76508  76517   }
 76509  76518   
 76510  76519   /*
 76511  76520   ** Return true if the prepared statement is in need of being reset.
 76512  76521   */
 76513         -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt *pStmt){
        76522  +SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt *pStmt){
 76514  76523     Vdbe *v = (Vdbe*)pStmt;
 76515  76524     return v!=0 && v->pc>=0 && v->magic==VDBE_MAGIC_RUN;
 76516  76525   }
 76517  76526   
 76518  76527   /*
 76519  76528   ** Return a pointer to the next prepared statement after pStmt associated
 76520  76529   ** with database connection pDb.  If pStmt is NULL, return the first
 76521  76530   ** prepared statement for the database connection.  Return NULL if there
 76522  76531   ** are no more.
 76523  76532   */
 76524         -SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){
        76533  +SQLITE_API sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){
 76525  76534     sqlite3_stmt *pNext;
 76526  76535   #ifdef SQLITE_ENABLE_API_ARMOR
 76527  76536     if( !sqlite3SafetyCheckOk(pDb) ){
 76528  76537       (void)SQLITE_MISUSE_BKPT;
 76529  76538       return 0;
 76530  76539     }
 76531  76540   #endif
................................................................................
 76538  76547     sqlite3_mutex_leave(pDb->mutex);
 76539  76548     return pNext;
 76540  76549   }
 76541  76550   
 76542  76551   /*
 76543  76552   ** Return the value of a status counter for a prepared statement
 76544  76553   */
 76545         -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){
        76554  +SQLITE_API int sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){
 76546  76555     Vdbe *pVdbe = (Vdbe*)pStmt;
 76547  76556     u32 v;
 76548  76557   #ifdef SQLITE_ENABLE_API_ARMOR
 76549  76558     if( !pStmt ){
 76550  76559       (void)SQLITE_MISUSE_BKPT;
 76551  76560       return 0;
 76552  76561     }
................................................................................
 76555  76564     if( resetFlag ) pVdbe->aCounter[op] = 0;
 76556  76565     return (int)v;
 76557  76566   }
 76558  76567   
 76559  76568   /*
 76560  76569   ** Return the SQL associated with a prepared statement
 76561  76570   */
 76562         -SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt){
        76571  +SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt){
 76563  76572     Vdbe *p = (Vdbe *)pStmt;
 76564  76573     return p ? p->zSql : 0;
 76565  76574   }
 76566  76575   
 76567  76576   /*
 76568  76577   ** Return the SQL associated with a prepared statement with
 76569  76578   ** bound parameters expanded.  Space to hold the returned string is
 76570  76579   ** obtained from sqlite3_malloc().  The caller is responsible for
 76571  76580   ** freeing the returned string by passing it to sqlite3_free().
 76572  76581   **
 76573  76582   ** The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of
 76574  76583   ** expanded bound parameters.
 76575  76584   */
 76576         -SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt){
        76585  +SQLITE_API char *sqlite3_expanded_sql(sqlite3_stmt *pStmt){
 76577  76586   #ifdef SQLITE_OMIT_TRACE
 76578  76587     return 0;
 76579  76588   #else
 76580  76589     char *z = 0;
 76581  76590     const char *zSql = sqlite3_sql(pStmt);
 76582  76591     if( zSql ){
 76583  76592       Vdbe *p = (Vdbe *)pStmt;
................................................................................
 76611  76620     return pRet;
 76612  76621   }
 76613  76622   
 76614  76623   /*
 76615  76624   ** This function is called from within a pre-update callback to retrieve
 76616  76625   ** a field of the row currently being updated or deleted.
 76617  76626   */
 76618         -SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
        76627  +SQLITE_API int sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
 76619  76628     PreUpdate *p = db->pPreUpdate;
 76620  76629     int rc = SQLITE_OK;
 76621  76630   
 76622  76631     /* Test that this call is being made from within an SQLITE_DELETE or
 76623  76632     ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */
 76624  76633     if( !p || p->op==SQLITE_INSERT ){
 76625  76634       rc = SQLITE_MISUSE_BKPT;
................................................................................
 76666  76675   #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
 76667  76676   
 76668  76677   #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
 76669  76678   /*
 76670  76679   ** This function is called from within a pre-update callback to retrieve
 76671  76680   ** the number of columns in the row being updated, deleted or inserted.
 76672  76681   */
 76673         -SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *db){
        76682  +SQLITE_API int sqlite3_preupdate_count(sqlite3 *db){
 76674  76683     PreUpdate *p = db->pPreUpdate;
 76675  76684     return (p ? p->keyinfo.nField : 0);
 76676  76685   }
 76677  76686   #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
 76678  76687   
 76679  76688   #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
 76680  76689   /*
................................................................................
 76684  76693   ** trigger program, it returns the number of trigger programs currently
 76685  76694   ** on the stack (1 for a top-level trigger, 2 for a trigger fired by a 
 76686  76695   ** top-level trigger etc.).
 76687  76696   **
 76688  76697   ** For the purposes of the previous paragraph, a foreign key CASCADE, SET NULL
 76689  76698   ** or SET DEFAULT action is considered a trigger.
 76690  76699   */
 76691         -SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *db){
        76700  +SQLITE_API int sqlite3_preupdate_depth(sqlite3 *db){
 76692  76701     PreUpdate *p = db->pPreUpdate;
 76693  76702     return (p ? p->v->nFrame : 0);
 76694  76703   }
 76695  76704   #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
 76696  76705   
 76697  76706   #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
 76698  76707   /*
 76699  76708   ** This function is called from within a pre-update callback to retrieve
 76700  76709   ** a field of the row currently being updated or inserted.
 76701  76710   */
 76702         -SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
        76711  +SQLITE_API int sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
 76703  76712     PreUpdate *p = db->pPreUpdate;
 76704  76713     int rc = SQLITE_OK;
 76705  76714     Mem *pMem;
 76706  76715   
 76707  76716     if( !p || p->op==SQLITE_DELETE ){
 76708  76717       rc = SQLITE_MISUSE_BKPT;
 76709  76718       goto preupdate_new_out;
................................................................................
 76769  76778   }
 76770  76779   #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
 76771  76780   
 76772  76781   #ifdef SQLITE_ENABLE_STMT_SCANSTATUS
 76773  76782   /*
 76774  76783   ** Return status data for a single loop within query pStmt.
 76775  76784   */
 76776         -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus(
        76785  +SQLITE_API int sqlite3_stmt_scanstatus(
 76777  76786     sqlite3_stmt *pStmt,            /* Prepared statement being queried */
 76778  76787     int idx,                        /* Index of loop to report on */
 76779  76788     int iScanStatusOp,              /* Which metric to return */
 76780  76789     void *pOut                      /* OUT: Write the answer here */
 76781  76790   ){
 76782  76791     Vdbe *p = (Vdbe*)pStmt;
 76783  76792     ScanStatus *pScan;
................................................................................
 76828  76837     }
 76829  76838     return 0;
 76830  76839   }
 76831  76840   
 76832  76841   /*
 76833  76842   ** Zero all counters associated with the sqlite3_stmt_scanstatus() data.
 76834  76843   */
 76835         -SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){
        76844  +SQLITE_API void sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){
 76836  76845     Vdbe *p = (Vdbe*)pStmt;
 76837  76846     memset(p->anExec, 0, p->nOp * sizeof(i64));
 76838  76847   }
 76839  76848   #endif /* SQLITE_ENABLE_STMT_SCANSTATUS */
 76840  76849   
 76841  76850   /************** End of vdbeapi.c *********************************************/
 76842  76851   /************** Begin file vdbetrace.c ***************************************/
................................................................................
 77355  77364   
 77356  77365   /*
 77357  77366   ** Try to convert the type of a function argument or a result column
 77358  77367   ** into a numeric representation.  Use either INTEGER or REAL whichever
 77359  77368   ** is appropriate.  But only do the conversion if it is possible without
 77360  77369   ** loss of information and return the revised type of the argument.
 77361  77370   */
 77362         -SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value *pVal){
        77371  +SQLITE_API int sqlite3_value_numeric_type(sqlite3_value *pVal){
 77363  77372     int eType = sqlite3_value_type(pVal);
 77364  77373     if( eType==SQLITE_TEXT ){
 77365  77374       Mem *pMem = (Mem*)pVal;
 77366  77375       applyNumericAffinity(pMem, 0);
 77367  77376       eType = sqlite3_value_type(pVal);
 77368  77377     }
 77369  77378     return eType;
................................................................................
 79005  79014     UPDATE_MAX_BLOBSIZE(pIn1);
 79006  79015     if( rc ) goto abort_due_to_error;
 79007  79016     break;
 79008  79017   }
 79009  79018   #endif /* SQLITE_OMIT_CAST */
 79010  79019   
 79011  79020   /* Opcode: Lt P1 P2 P3 P4 P5
 79012         -** Synopsis: if r[P1]<r[P3] goto P2
        79021  +** Synopsis: IF r[P3]<r[P1]
 79013  79022   **
 79014  79023   ** Compare the values in register P1 and P3.  If reg(P3)<reg(P1) then
 79015  79024   ** jump to address P2.  
 79016  79025   **
 79017  79026   ** If the SQLITE_JUMPIFNULL bit of P5 is set and either reg(P1) or
 79018  79027   ** reg(P3) is NULL then take the jump.  If the SQLITE_JUMPIFNULL 
 79019  79028   ** bit is clear then fall through if either operand is NULL.
................................................................................
 79040  79049   ** store a boolean result (either 0, or 1, or NULL) in register P2.
 79041  79050   **
 79042  79051   ** If the SQLITE_NULLEQ bit is set in P5, then NULL values are considered
 79043  79052   ** equal to one another, provided that they do not have their MEM_Cleared
 79044  79053   ** bit set.
 79045  79054   */
 79046  79055   /* Opcode: Ne P1 P2 P3 P4 P5
 79047         -** Synopsis: if r[P1]!=r[P3] goto P2
        79056  +** Synopsis: IF r[P3]!=r[P1]
 79048  79057   **
 79049  79058   ** This works just like the Lt opcode except that the jump is taken if
 79050  79059   ** the operands in registers P1 and P3 are not equal.  See the Lt opcode for
 79051  79060   ** additional information.
 79052  79061   **
 79053  79062   ** If SQLITE_NULLEQ is set in P5 then the result of comparison is always either
 79054  79063   ** true or false and is never NULL.  If both operands are NULL then the result
 79055  79064   ** of comparison is false.  If either operand is NULL then the result is true.
 79056  79065   ** If neither operand is NULL the result is the same as it would be if
 79057  79066   ** the SQLITE_NULLEQ flag were omitted from P5.
 79058  79067   */
 79059  79068   /* Opcode: Eq P1 P2 P3 P4 P5
 79060         -** Synopsis: if r[P1]==r[P3] goto P2
        79069  +** Synopsis: IF r[P3]==r[P1]
 79061  79070   **
 79062  79071   ** This works just like the Lt opcode except that the jump is taken if
 79063  79072   ** the operands in registers P1 and P3 are equal.
 79064  79073   ** See the Lt opcode for additional information.
 79065  79074   **
 79066  79075   ** If SQLITE_NULLEQ is set in P5 then the result of comparison is always either
 79067  79076   ** true or false and is never NULL.  If both operands are NULL then the result
 79068  79077   ** of comparison is true.  If either operand is NULL then the result is false.
 79069  79078   ** If neither operand is NULL the result is the same as it would be if
 79070  79079   ** the SQLITE_NULLEQ flag were omitted from P5.
 79071  79080   */
 79072  79081   /* Opcode: Le P1 P2 P3 P4 P5
 79073         -** Synopsis: if r[P1]<=r[P3] goto P2
        79082  +** Synopsis: IF r[P3]<=r[P1]
 79074  79083   **
 79075  79084   ** This works just like the Lt opcode except that the jump is taken if
 79076  79085   ** the content of register P3 is less than or equal to the content of
 79077  79086   ** register P1.  See the Lt opcode for additional information.
 79078  79087   */
 79079  79088   /* Opcode: Gt P1 P2 P3 P4 P5
 79080         -** Synopsis: if r[P1]>r[P3] goto P2
        79089  +** Synopsis: IF r[P3]>r[P1]
 79081  79090   **
 79082  79091   ** This works just like the Lt opcode except that the jump is taken if
 79083  79092   ** the content of register P3 is greater than the content of
 79084  79093   ** register P1.  See the Lt opcode for additional information.
 79085  79094   */
 79086  79095   /* Opcode: Ge P1 P2 P3 P4 P5
 79087         -** Synopsis: if r[P1]>=r[P3] goto P2
        79096  +** Synopsis: IF r[P3]>=r[P1]
 79088  79097   **
 79089  79098   ** This works just like the Lt opcode except that the jump is taken if
 79090  79099   ** the content of register P3 is greater than or equal to the content of
 79091  79100   ** register P1.  See the Lt opcode for additional information.
 79092  79101   */
 79093  79102   case OP_Eq:               /* same as TK_EQ, jump, in1, in3 */
 79094  79103   case OP_Ne:               /* same as TK_NE, jump, in1, in3 */
................................................................................
 84207  84216     *pzErr = zErr;
 84208  84217     return rc;
 84209  84218   }
 84210  84219   
 84211  84220   /*
 84212  84221   ** Open a blob handle.
 84213  84222   */
 84214         -SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
        84223  +SQLITE_API int sqlite3_blob_open(
 84215  84224     sqlite3* db,            /* The database connection */
 84216  84225     const char *zDb,        /* The attached database containing the blob */
 84217  84226     const char *zTable,     /* The table containing the blob */
 84218  84227     const char *zColumn,    /* The column containing the blob */
 84219  84228     sqlite_int64 iRow,      /* The row containing the glob */
 84220  84229     int flags,              /* True -> read/write access, false -> read-only */
 84221  84230     sqlite3_blob **ppBlob   /* Handle for accessing the blob returned here */
................................................................................
 84448  84457     return rc;
 84449  84458   }
 84450  84459   
 84451  84460   /*
 84452  84461   ** Close a blob handle that was previously created using
 84453  84462   ** sqlite3_blob_open().
 84454  84463   */
 84455         -SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *pBlob){
        84464  +SQLITE_API int sqlite3_blob_close(sqlite3_blob *pBlob){
 84456  84465     Incrblob *p = (Incrblob *)pBlob;
 84457  84466     int rc;
 84458  84467     sqlite3 *db;
 84459  84468   
 84460  84469     if( p ){
 84461  84470       db = p->db;
 84462  84471       sqlite3_mutex_enter(db->mutex);
................................................................................
 84541  84550     sqlite3_mutex_leave(db->mutex);
 84542  84551     return rc;
 84543  84552   }
 84544  84553   
 84545  84554   /*
 84546  84555   ** Read data from a blob handle.
 84547  84556   */
 84548         -SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){
        84557  +SQLITE_API int sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){
 84549  84558     return blobReadWrite(pBlob, z, n, iOffset, sqlite3BtreeData);
 84550  84559   }
 84551  84560   
 84552  84561   /*
 84553  84562   ** Write data to a blob handle.
 84554  84563   */
 84555         -SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){
        84564  +SQLITE_API int sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){
 84556  84565     return blobReadWrite(pBlob, (void *)z, n, iOffset, sqlite3BtreePutData);
 84557  84566   }
 84558  84567   
 84559  84568   /*
 84560  84569   ** Query a blob handle for the size of the data.
 84561  84570   **
 84562  84571   ** The Incrblob.nByte field is fixed for the lifetime of the Incrblob
 84563  84572   ** so no mutex is required for access.
 84564  84573   */
 84565         -SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *pBlob){
        84574  +SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *pBlob){
 84566  84575     Incrblob *p = (Incrblob *)pBlob;
 84567  84576     return (p && p->pStmt) ? p->nByte : 0;
 84568  84577   }
 84569  84578   
 84570  84579   /*
 84571  84580   ** Move an existing blob handle to point to a different row of the same
 84572  84581   ** database table.
................................................................................
 84573  84582   **
 84574  84583   ** If an error occurs, or if the specified row does not exist or does not
 84575  84584   ** contain a blob or text value, then an error code is returned and the
 84576  84585   ** database handle error code and message set. If this happens, then all 
 84577  84586   ** subsequent calls to sqlite3_blob_xxx() functions (except blob_close()) 
 84578  84587   ** immediately return SQLITE_ABORT.
 84579  84588   */
 84580         -SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){
        84589  +SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){
 84581  84590     int rc;
 84582  84591     Incrblob *p = (Incrblob *)pBlob;
 84583  84592     sqlite3 *db;
 84584  84593   
 84585  84594     if( p==0 ) return SQLITE_MISUSE_BKPT;
 84586  84595     db = p->db;
 84587  84596     sqlite3_mutex_enter(db->mutex);
................................................................................
 97186  97195   ** will return with an error.  SQLITE_IGNORE means that the SQL statement
 97187  97196   ** should run but attempts to read the specified column will return NULL
 97188  97197   ** and attempts to write the column will be ignored.
 97189  97198   **
 97190  97199   ** Setting the auth function to NULL disables this hook.  The default
 97191  97200   ** setting of the auth function is NULL.
 97192  97201   */
 97193         -SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
        97202  +SQLITE_API int sqlite3_set_authorizer(
 97194  97203     sqlite3 *db,
 97195  97204     int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
 97196  97205     void *pArg
 97197  97206   ){
 97198  97207   #ifdef SQLITE_ENABLE_API_ARMOR
 97199  97208     if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
 97200  97209   #endif
................................................................................
103956 103965     }
103957 103966     return *zString==0;
103958 103967   }
103959 103968   
103960 103969   /*
103961 103970   ** The sqlite3_strglob() interface.
103962 103971   */
103963         -SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlobPattern, const char *zString){
       103972  +SQLITE_API int sqlite3_strglob(const char *zGlobPattern, const char *zString){
103964 103973     return patternCompare((u8*)zGlobPattern, (u8*)zString, &globInfo, '[')==0;
103965 103974   }
103966 103975   
103967 103976   /*
103968 103977   ** The sqlite3_strlike() interface.
103969 103978   */
103970         -SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zPattern, const char *zStr, unsigned int esc){
       103979  +SQLITE_API int sqlite3_strlike(const char *zPattern, const char *zStr, unsigned int esc){
103971 103980     return patternCompare((u8*)zPattern, (u8*)zStr, &likeInfoNorm, esc)==0;
103972 103981   }
103973 103982   
103974 103983   /*
103975 103984   ** Count the number of times that the LIKE operator (or GLOB which is
103976 103985   ** just a variation of LIKE) gets called.  This is used for testing
103977 103986   ** only.
................................................................................
108242 108251     }else{
108243 108252       sqlite3TableLock(pParse, iDb, pTab->tnum, op==OP_OpenWrite, pTab->zName);
108244 108253     }
108245 108254     if( piIdxCur ) *piIdxCur = iBase;
108246 108255     for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){
108247 108256       int iIdxCur = iBase++;
108248 108257       assert( pIdx->pSchema==pTab->pSchema );
       108258  +    if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){
       108259  +      if( piDataCur ) *piDataCur = iIdxCur;
       108260  +      p5 = 0;
       108261  +    }
108249 108262       if( aToOpen==0 || aToOpen[i+1] ){
108250 108263         sqlite3VdbeAddOp3(v, op, iIdxCur, pIdx->tnum, iDb);
108251 108264         sqlite3VdbeSetP4KeyInfo(pParse, pIdx);
108252         -      VdbeComment((v, "%s", pIdx->zName));
108253         -    }
108254         -    if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){
108255         -      if( piDataCur ) *piDataCur = iIdxCur;
108256         -    }else{
108257 108265         sqlite3VdbeChangeP5(v, p5);
       108266  +      VdbeComment((v, "%s", pIdx->zName));
108258 108267       }
108259 108268     }
108260 108269     if( iBase>pParse->nTab ) pParse->nTab = iBase;
108261 108270     return i;
108262 108271   }
108263 108272   
108264 108273   
................................................................................
108682 108691   ** malloc() and make *pzErrMsg point to that message.
108683 108692   **
108684 108693   ** If the SQL is a query, then for each row in the query result
108685 108694   ** the xCallback() function is called.  pArg becomes the first
108686 108695   ** argument to xCallback().  If xCallback=NULL then no callback
108687 108696   ** is invoked, even for queries.
108688 108697   */
108689         -SQLITE_API int SQLITE_STDCALL sqlite3_exec(
       108698  +SQLITE_API int sqlite3_exec(
108690 108699     sqlite3 *db,                /* The database on which the SQL executes */
108691 108700     const char *zSql,           /* The SQL to be executed */
108692 108701     sqlite3_callback xCallback, /* Invoke this callback routine */
108693 108702     void *pArg,                 /* First argument to xCallback() */
108694 108703     char **pzErrMsg             /* Write error messages here */
108695 108704   ){
108696 108705     int rc = SQLITE_OK;         /* Return code */
................................................................................
109944 109953     }
109945 109954     sqlite3DbFree(db, db->aExtension);
109946 109955     db->aExtension = aHandle;
109947 109956   
109948 109957     db->aExtension[db->nExtension++] = handle;
109949 109958     return SQLITE_OK;
109950 109959   }
109951         -SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
       109960  +SQLITE_API int sqlite3_load_extension(
109952 109961     sqlite3 *db,          /* Load the extension into this database connection */
109953 109962     const char *zFile,    /* Name of the shared library containing extension */
109954 109963     const char *zProc,    /* Entry point.  Use "sqlite3_extension_init" if 0 */
109955 109964     char **pzErrMsg       /* Put error message here if not 0 */
109956 109965   ){
109957 109966     int rc;
109958 109967     sqlite3_mutex_enter(db->mutex);
................................................................................
109975 109984     sqlite3DbFree(db, db->aExtension);
109976 109985   }
109977 109986   
109978 109987   /*
109979 109988   ** Enable or disable extension loading.  Extension loading is disabled by
109980 109989   ** default so as not to open security holes in older applications.
109981 109990   */
109982         -SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff){
       109991  +SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff){
109983 109992     sqlite3_mutex_enter(db->mutex);
109984 109993     if( onoff ){
109985 109994       db->flags |= SQLITE_LoadExtension|SQLITE_LoadExtFunc;
109986 109995     }else{
109987 109996       db->flags &= ~(SQLITE_LoadExtension|SQLITE_LoadExtFunc);
109988 109997     }
109989 109998     sqlite3_mutex_leave(db->mutex);
................................................................................
110032 110041   #endif
110033 110042   
110034 110043   
110035 110044   /*
110036 110045   ** Register a statically linked extension that is automatically
110037 110046   ** loaded by every new database connection.
110038 110047   */
110039         -SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(
       110048  +SQLITE_API int sqlite3_auto_extension(
110040 110049     void (*xInit)(void)
110041 110050   ){
110042 110051     int rc = SQLITE_OK;
110043 110052   #ifndef SQLITE_OMIT_AUTOINIT
110044 110053     rc = sqlite3_initialize();
110045 110054     if( rc ){
110046 110055       return rc;
................................................................................
110079 110088   ** set of routines that is invoked for each new database connection, if it
110080 110089   ** is currently on the list.  If xInit is not on the list, then this
110081 110090   ** routine is a no-op.
110082 110091   **
110083 110092   ** Return 1 if xInit was found on the list and removed.  Return 0 if xInit
110084 110093   ** was not on the list.
110085 110094   */
110086         -SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(
       110095  +SQLITE_API int sqlite3_cancel_auto_extension(
110087 110096     void (*xInit)(void)
110088 110097   ){
110089 110098   #if SQLITE_THREADSAFE
110090 110099     sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
110091 110100   #endif
110092 110101     int i;
110093 110102     int n = 0;
................................................................................
110104 110113     sqlite3_mutex_leave(mutex);
110105 110114     return n;
110106 110115   }
110107 110116   
110108 110117   /*
110109 110118   ** Reset the automatic extension loading mechanism.
110110 110119   */
110111         -SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void){
       110120  +SQLITE_API void sqlite3_reset_auto_extension(void){
110112 110121   #ifndef SQLITE_OMIT_AUTOINIT
110113 110122     if( sqlite3_initialize()==SQLITE_OK )
110114 110123   #endif
110115 110124     {
110116 110125   #if SQLITE_THREADSAFE
110117 110126       sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
110118 110127   #endif
................................................................................
113365 113374   ** Two versions of the official API.  Legacy and new use.  In the legacy
113366 113375   ** version, the original SQL text is not saved in the prepared statement
113367 113376   ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
113368 113377   ** sqlite3_step().  In the new version, the original SQL text is retained
113369 113378   ** and the statement is automatically recompiled if an schema change
113370 113379   ** occurs.
113371 113380   */
113372         -SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
       113381  +SQLITE_API int sqlite3_prepare(
113373 113382     sqlite3 *db,              /* Database handle. */
113374 113383     const char *zSql,         /* UTF-8 encoded SQL statement. */
113375 113384     int nBytes,               /* Length of zSql in bytes. */
113376 113385     sqlite3_stmt **ppStmt,    /* OUT: A pointer to the prepared statement */
113377 113386     const char **pzTail       /* OUT: End of parsed string */
113378 113387   ){
113379 113388     int rc;
113380 113389     rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,0,ppStmt,pzTail);
113381 113390     assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 );  /* VERIFY: F13021 */
113382 113391     return rc;
113383 113392   }
113384         -SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
       113393  +SQLITE_API int sqlite3_prepare_v2(
113385 113394     sqlite3 *db,              /* Database handle. */
113386 113395     const char *zSql,         /* UTF-8 encoded SQL statement. */
113387 113396     int nBytes,               /* Length of zSql in bytes. */
113388 113397     sqlite3_stmt **ppStmt,    /* OUT: A pointer to the prepared statement */
113389 113398     const char **pzTail       /* OUT: End of parsed string */
113390 113399   ){
113391 113400     int rc;
................................................................................
113453 113462   ** Two versions of the official API.  Legacy and new use.  In the legacy
113454 113463   ** version, the original SQL text is not saved in the prepared statement
113455 113464   ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
113456 113465   ** sqlite3_step().  In the new version, the original SQL text is retained
113457 113466   ** and the statement is automatically recompiled if an schema change
113458 113467   ** occurs.
113459 113468   */
113460         -SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
       113469  +SQLITE_API int sqlite3_prepare16(
113461 113470     sqlite3 *db,              /* Database handle. */ 
113462 113471     const void *zSql,         /* UTF-16 encoded SQL statement. */
113463 113472     int nBytes,               /* Length of zSql in bytes. */
113464 113473     sqlite3_stmt **ppStmt,    /* OUT: A pointer to the prepared statement */
113465 113474     const void **pzTail       /* OUT: End of parsed string */
113466 113475   ){
113467 113476     int rc;
113468 113477     rc = sqlite3Prepare16(db,zSql,nBytes,0,ppStmt,pzTail);
113469 113478     assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 );  /* VERIFY: F13021 */
113470 113479     return rc;
113471 113480   }
113472         -SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
       113481  +SQLITE_API int sqlite3_prepare16_v2(
113473 113482     sqlite3 *db,              /* Database handle. */ 
113474 113483     const void *zSql,         /* UTF-16 encoded SQL statement. */
113475 113484     int nBytes,               /* Length of zSql in bytes. */
113476 113485     sqlite3_stmt **ppStmt,    /* OUT: A pointer to the prepared statement */
113477 113486     const void **pzTail       /* OUT: End of parsed string */
113478 113487   ){
113479 113488     int rc;
................................................................................
119308 119317   ** at the conclusion of the call.
119309 119318   **
119310 119319   ** The result that is written to ***pazResult is held in memory obtained
119311 119320   ** from malloc().  But the caller cannot free this memory directly.  
119312 119321   ** Instead, the entire table should be passed to sqlite3_free_table() when
119313 119322   ** the calling procedure is finished using it.
119314 119323   */
119315         -SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
       119324  +SQLITE_API int sqlite3_get_table(
119316 119325     sqlite3 *db,                /* The database on which the SQL executes */
119317 119326     const char *zSql,           /* The SQL to be executed */
119318 119327     char ***pazResult,          /* Write the result table here */
119319 119328     int *pnRow,                 /* Write the number of rows in the result here */
119320 119329     int *pnColumn,              /* Write the number of columns of result here */
119321 119330     char **pzErrMsg             /* Write error messages here */
119322 119331   ){
................................................................................
119377 119386     if( pnRow ) *pnRow = res.nRow;
119378 119387     return rc;
119379 119388   }
119380 119389   
119381 119390   /*
119382 119391   ** This routine frees the space the sqlite3_get_table() malloced.
119383 119392   */
119384         -SQLITE_API void SQLITE_STDCALL sqlite3_free_table(
       119393  +SQLITE_API void sqlite3_free_table(
119385 119394     char **azResult            /* Result returned from sqlite3_get_table() */
119386 119395   ){
119387 119396     if( azResult ){
119388 119397       int i, n;
119389 119398       azResult--;
119390 119399       assert( azResult!=0 );
119391 119400       n = SQLITE_PTR_TO_INT(azResult[0]);
................................................................................
121787 121796     return rc;
121788 121797   }
121789 121798   
121790 121799   
121791 121800   /*
121792 121801   ** External API function used to create a new virtual-table module.
121793 121802   */
121794         -SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
       121803  +SQLITE_API int sqlite3_create_module(
121795 121804     sqlite3 *db,                    /* Database in which module is registered */
121796 121805     const char *zName,              /* Name assigned to this module */
121797 121806     const sqlite3_module *pModule,  /* The definition of the module */
121798 121807     void *pAux                      /* Context pointer for xCreate/xConnect */
121799 121808   ){
121800 121809   #ifdef SQLITE_ENABLE_API_ARMOR
121801 121810     if( !sqlite3SafetyCheckOk(db) || zName==0 ) return SQLITE_MISUSE_BKPT;
................................................................................
121802 121811   #endif
121803 121812     return createModule(db, zName, pModule, pAux, 0);
121804 121813   }
121805 121814   
121806 121815   /*
121807 121816   ** External API function used to create a new virtual-table module.
121808 121817   */
121809         -SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
       121818  +SQLITE_API int sqlite3_create_module_v2(
121810 121819     sqlite3 *db,                    /* Database in which module is registered */
121811 121820     const char *zName,              /* Name assigned to this module */
121812 121821     const sqlite3_module *pModule,  /* The definition of the module */
121813 121822     void *pAux,                     /* Context pointer for xCreate/xConnect */
121814 121823     void (*xDestroy)(void *)        /* Module destructor function */
121815 121824   ){
121816 121825   #ifdef SQLITE_ENABLE_API_ARMOR
................................................................................
122426 122435   }
122427 122436   
122428 122437   /*
122429 122438   ** This function is used to set the schema of a virtual table.  It is only
122430 122439   ** valid to call this function from within the xCreate() or xConnect() of a
122431 122440   ** virtual table module.
122432 122441   */
122433         -SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
       122442  +SQLITE_API int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
122434 122443     VtabCtx *pCtx;
122435 122444     Parse *pParse;
122436 122445     int rc = SQLITE_OK;
122437 122446     Table *pTab;
122438 122447     char *zErr = 0;
122439 122448   
122440 122449   #ifdef SQLITE_ENABLE_API_ARMOR
................................................................................
122883 122892   /*
122884 122893   ** Return the ON CONFLICT resolution mode in effect for the virtual
122885 122894   ** table update operation currently in progress.
122886 122895   **
122887 122896   ** The results of this routine are undefined unless it is called from
122888 122897   ** within an xUpdate method.
122889 122898   */
122890         -SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *db){
       122899  +SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *db){
122891 122900     static const unsigned char aMap[] = { 
122892 122901       SQLITE_ROLLBACK, SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_REPLACE 
122893 122902     };
122894 122903   #ifdef SQLITE_ENABLE_API_ARMOR
122895 122904     if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
122896 122905   #endif
122897 122906     assert( OE_Rollback==1 && OE_Abort==2 && OE_Fail==3 );
................................................................................
122901 122910   }
122902 122911   
122903 122912   /*
122904 122913   ** Call from within the xCreate() or xConnect() methods to provide 
122905 122914   ** the SQLite core with additional information about the behavior
122906 122915   ** of the virtual table being implemented.
122907 122916   */
122908         -SQLITE_API int SQLITE_CDECL sqlite3_vtab_config(sqlite3 *db, int op, ...){
       122917  +SQLITE_API int sqlite3_vtab_config(sqlite3 *db, int op, ...){
122909 122918     va_list ap;
122910 122919     int rc = SQLITE_OK;
122911 122920   
122912 122921   #ifdef SQLITE_ENABLE_API_ARMOR
122913 122922     if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
122914 122923   #endif
122915 122924     sqlite3_mutex_enter(db->mutex);
................................................................................
124026 124035         if( nReg==1 ){
124027 124036           sqlite3ReleaseTempReg(pParse, regBase);
124028 124037           regBase = r1;
124029 124038         }else{
124030 124039           sqlite3VdbeAddOp2(v, OP_SCopy, r1, regBase+j);
124031 124040         }
124032 124041       }
124033         -    testcase( pTerm->eOperator & WO_ISNULL );
124034         -    testcase( pTerm->eOperator & WO_IN );
124035         -    if( (pTerm->eOperator & (WO_ISNULL|WO_IN))==0 ){
       124042  +    if( (pTerm->eOperator & WO_IN)!=0 ){
       124043  +      if( pTerm->pExpr->flags & EP_xIsSelect ){
       124044  +        /* No affinity ever needs to be (or should be) applied to a value
       124045  +        ** from the RHS of an "? IN (SELECT ...)" expression. The 
       124046  +        ** sqlite3FindInIndex() routine has already ensured that the 
       124047  +        ** affinity of the comparison has been applied to the value.  */
       124048  +        if( zAff ) zAff[j] = SQLITE_AFF_BLOB;
       124049  +      }
       124050  +    }else if( (pTerm->eOperator & WO_ISNULL)==0 ){
124036 124051         Expr *pRight = pTerm->pExpr->pRight;
124037 124052         if( (pTerm->wtFlags & TERM_IS)==0 && sqlite3ExprCanBeNull(pRight) ){
124038 124053           sqlite3VdbeAddOp2(v, OP_IsNull, regBase+j, pLevel->addrBrk);
124039 124054           VdbeCoverage(v);
124040 124055         }
124041 124056         if( zAff ){
124042 124057           if( sqlite3CompareAffinity(pRight, zAff[j])==SQLITE_AFF_BLOB ){
................................................................................
130103 130118         if( MASKBIT(i) & obSat ) continue;
130104 130119         pOBExpr = sqlite3ExprSkipCollate(pOrderBy->a[i].pExpr);
130105 130120         if( pOBExpr->op!=TK_COLUMN ) continue;
130106 130121         if( pOBExpr->iTable!=iCur ) continue;
130107 130122         pTerm = sqlite3WhereFindTerm(&pWInfo->sWC, iCur, pOBExpr->iColumn,
130108 130123                          ~ready, eqOpMask, 0);
130109 130124         if( pTerm==0 ) continue;
       130125  +      if( pTerm->eOperator==WO_IN ){
       130126  +        /* IN terms are only valid for sorting in the ORDER BY LIMIT 
       130127  +        ** optimization, and then only if they are actually used
       130128  +        ** by the query plan */
       130129  +        assert( wctrlFlags & WHERE_ORDERBY_LIMIT );
       130130  +        for(j=0; j<pLoop->nLTerm && pTerm!=pLoop->aLTerm[j]; j++){}
       130131  +        if( j>=pLoop->nLTerm ) continue;
       130132  +      }
130110 130133         if( (pTerm->eOperator&(WO_EQ|WO_IS))!=0 && pOBExpr->iColumn>=0 ){
130111 130134           const char *z1, *z2;
130112 130135           pColl = sqlite3ExprCollSeq(pWInfo->pParse, pOrderBy->a[i].pExpr);
130113 130136           if( !pColl ) pColl = db->pDfltColl;
130114 130137           z1 = pColl->zName;
130115 130138           pColl = sqlite3ExprCollSeq(pWInfo->pParse, pTerm->pExpr);
130116 130139           if( !pColl ) pColl = db->pDfltColl;
................................................................................
136208 136231   ** Whitespace never causes a state transition and is always ignored.
136209 136232   ** This means that a SQL string of all whitespace is invalid.
136210 136233   **
136211 136234   ** If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed
136212 136235   ** to recognize the end of a trigger can be omitted.  All we have to do
136213 136236   ** is look for a semicolon that is not part of an string or comment.
136214 136237   */
136215         -SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *zSql){
       136238  +SQLITE_API int sqlite3_complete(const char *zSql){
136216 136239     u8 state = 0;   /* Current state, using numbers defined in header comment */
136217 136240     u8 token;       /* Value of the next token */
136218 136241   
136219 136242   #ifndef SQLITE_OMIT_TRIGGER
136220 136243     /* A complex statement machine used to detect the end of a CREATE TRIGGER
136221 136244     ** statement.  This is the normal case.
136222 136245     */
................................................................................
136373 136396   
136374 136397   #ifndef SQLITE_OMIT_UTF16
136375 136398   /*
136376 136399   ** This routine is the same as the sqlite3_complete() routine described
136377 136400   ** above, except that the parameter is required to be UTF-16 encoded, not
136378 136401   ** UTF-8.
136379 136402   */
136380         -SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *zSql){
       136403  +SQLITE_API int sqlite3_complete16(const void *zSql){
136381 136404     sqlite3_value *pVal;
136382 136405     char const *zSql8;
136383 136406     int rc;
136384 136407   
136385 136408   #ifndef SQLITE_OMIT_AUTOINIT
136386 136409     rc = sqlite3_initialize();
136387 136410     if( rc ) return rc;
................................................................................
136533 136556   */
136534 136557   SQLITE_API const char sqlite3_version[] = SQLITE_VERSION;
136535 136558   #endif
136536 136559   
136537 136560   /* IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns
136538 136561   ** a pointer to the to the sqlite3_version[] string constant. 
136539 136562   */
136540         -SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void){ return sqlite3_version; }
       136563  +SQLITE_API const char *sqlite3_libversion(void){ return sqlite3_version; }
136541 136564   
136542 136565   /* IMPLEMENTATION-OF: R-63124-39300 The sqlite3_sourceid() function returns a
136543 136566   ** pointer to a string constant whose value is the same as the
136544 136567   ** SQLITE_SOURCE_ID C preprocessor macro. 
136545 136568   */
136546         -SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
       136569  +SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
136547 136570   
136548 136571   /* IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function
136549 136572   ** returns an integer equal to SQLITE_VERSION_NUMBER.
136550 136573   */
136551         -SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; }
       136574  +SQLITE_API int sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; }
136552 136575   
136553 136576   /* IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns
136554 136577   ** zero if and only if SQLite was compiled with mutexing code omitted due to
136555 136578   ** the SQLITE_THREADSAFE compile-time option being set to 0.
136556 136579   */
136557         -SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; }
       136580  +SQLITE_API int sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; }
136558 136581   
136559 136582   /*
136560 136583   ** When compiling the test fixture or with debugging enabled (on Win32),
136561 136584   ** this variable being set to non-zero will cause OSTRACE macros to emit
136562 136585   ** extra diagnostic information.
136563 136586   */
136564 136587   #ifdef SQLITE_HAVE_OS_TRACE
................................................................................
136623 136646   **
136624 136647   **    *  Calls to this routine from Y must block until the outer-most
136625 136648   **       call by X completes.
136626 136649   **
136627 136650   **    *  Recursive calls to this routine from thread X return immediately
136628 136651   **       without blocking.
136629 136652   */
136630         -SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void){
       136653  +SQLITE_API int sqlite3_initialize(void){
136631 136654     MUTEX_LOGIC( sqlite3_mutex *pMaster; )       /* The main static mutex */
136632 136655     int rc;                                      /* Result code */
136633 136656   #ifdef SQLITE_EXTRA_INIT
136634 136657     int bRunExtraInit = 0;                       /* Extra initialization needed */
136635 136658   #endif
136636 136659   
136637 136660   #ifdef SQLITE_OMIT_WSD
................................................................................
136789 136812   ** Undo the effects of sqlite3_initialize().  Must not be called while
136790 136813   ** there are outstanding database connections or memory allocations or
136791 136814   ** while any part of SQLite is otherwise in use in any thread.  This
136792 136815   ** routine is not threadsafe.  But it is safe to invoke this routine
136793 136816   ** on when SQLite is already shut down.  If SQLite is already shut down
136794 136817   ** when this routine is invoked, then this routine is a harmless no-op.
136795 136818   */
136796         -SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void){
       136819  +SQLITE_API int sqlite3_shutdown(void){
136797 136820   #ifdef SQLITE_OMIT_WSD
136798 136821     int rc = sqlite3_wsd_init(4096, 24);
136799 136822     if( rc!=SQLITE_OK ){
136800 136823       return rc;
136801 136824     }
136802 136825   #endif
136803 136826   
................................................................................
136843 136866   ** the SQLite library at run-time.
136844 136867   **
136845 136868   ** This routine should only be called when there are no outstanding
136846 136869   ** database connections or memory allocations.  This routine is not
136847 136870   ** threadsafe.  Failure to heed these warnings can lead to unpredictable
136848 136871   ** behavior.
136849 136872   */
136850         -SQLITE_API int SQLITE_CDECL sqlite3_config(int op, ...){
       136873  +SQLITE_API int sqlite3_config(int op, ...){
136851 136874     va_list ap;
136852 136875     int rc = SQLITE_OK;
136853 136876   
136854 136877     /* sqlite3_config() shall return SQLITE_MISUSE if it is invoked while
136855 136878     ** the SQLite library is in use. */
136856 136879     if( sqlite3GlobalConfig.isInit ) return SQLITE_MISUSE_BKPT;
136857 136880   
................................................................................
137208 137231   #endif /* SQLITE_OMIT_LOOKASIDE */
137209 137232     return SQLITE_OK;
137210 137233   }
137211 137234   
137212 137235   /*
137213 137236   ** Return the mutex associated with a database connection.
137214 137237   */
137215         -SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3 *db){
       137238  +SQLITE_API sqlite3_mutex *sqlite3_db_mutex(sqlite3 *db){
137216 137239   #ifdef SQLITE_ENABLE_API_ARMOR
137217 137240     if( !sqlite3SafetyCheckOk(db) ){
137218 137241       (void)SQLITE_MISUSE_BKPT;
137219 137242       return 0;
137220 137243     }
137221 137244   #endif
137222 137245     return db->mutex;
137223 137246   }
137224 137247   
137225 137248   /*
137226 137249   ** Free up as much memory as we can from the given database
137227 137250   ** connection.
137228 137251   */
137229         -SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3 *db){
       137252  +SQLITE_API int sqlite3_db_release_memory(sqlite3 *db){
137230 137253     int i;
137231 137254   
137232 137255   #ifdef SQLITE_ENABLE_API_ARMOR
137233 137256     if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
137234 137257   #endif
137235 137258     sqlite3_mutex_enter(db->mutex);
137236 137259     sqlite3BtreeEnterAll(db);
................................................................................
137246 137269     return SQLITE_OK;
137247 137270   }
137248 137271   
137249 137272   /*
137250 137273   ** Flush any dirty pages in the pager-cache for any attached database
137251 137274   ** to disk.
137252 137275   */
137253         -SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3 *db){
       137276  +SQLITE_API int sqlite3_db_cacheflush(sqlite3 *db){
137254 137277     int i;
137255 137278     int rc = SQLITE_OK;
137256 137279     int bSeenBusy = 0;
137257 137280   
137258 137281   #ifdef SQLITE_ENABLE_API_ARMOR
137259 137282     if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
137260 137283   #endif
................................................................................
137275 137298     sqlite3_mutex_leave(db->mutex);
137276 137299     return ((rc==SQLITE_OK && bSeenBusy) ? SQLITE_BUSY : rc);
137277 137300   }
137278 137301   
137279 137302   /*
137280 137303   ** Configuration settings for an individual database connection
137281 137304   */
137282         -SQLITE_API int SQLITE_CDECL sqlite3_db_config(sqlite3 *db, int op, ...){
       137305  +SQLITE_API int sqlite3_db_config(sqlite3 *db, int op, ...){
137283 137306     va_list ap;
137284 137307     int rc;
137285 137308     va_start(ap, op);
137286 137309     switch( op ){
137287 137310       case SQLITE_DBCONFIG_LOOKASIDE: {
137288 137311         void *pBuf = va_arg(ap, void*); /* IMP: R-26835-10964 */
137289 137312         int sz = va_arg(ap, int);       /* IMP: R-47871-25994 */
................................................................................
137396 137419     }
137397 137420     return r;
137398 137421   }
137399 137422   
137400 137423   /*
137401 137424   ** Return the ROWID of the most recent insert
137402 137425   */
137403         -SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3 *db){
       137426  +SQLITE_API sqlite_int64 sqlite3_last_insert_rowid(sqlite3 *db){
137404 137427   #ifdef SQLITE_ENABLE_API_ARMOR
137405 137428     if( !sqlite3SafetyCheckOk(db) ){
137406 137429       (void)SQLITE_MISUSE_BKPT;
137407 137430       return 0;
137408 137431     }
137409 137432   #endif
137410 137433     return db->lastRowid;
137411 137434   }
137412 137435   
137413 137436   /*
137414 137437   ** Return the number of changes in the most recent call to sqlite3_exec().
137415 137438   */
137416         -SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3 *db){
       137439  +SQLITE_API int sqlite3_changes(sqlite3 *db){
137417 137440   #ifdef SQLITE_ENABLE_API_ARMOR
137418 137441     if( !sqlite3SafetyCheckOk(db) ){
137419 137442       (void)SQLITE_MISUSE_BKPT;
137420 137443       return 0;
137421 137444     }
137422 137445   #endif
137423 137446     return db->nChange;
137424 137447   }
137425 137448   
137426 137449   /*
137427 137450   ** Return the number of changes since the database handle was opened.
137428 137451   */
137429         -SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3 *db){
       137452  +SQLITE_API int sqlite3_total_changes(sqlite3 *db){
137430 137453   #ifdef SQLITE_ENABLE_API_ARMOR
137431 137454     if( !sqlite3SafetyCheckOk(db) ){
137432 137455       (void)SQLITE_MISUSE_BKPT;
137433 137456       return 0;
137434 137457     }
137435 137458   #endif
137436 137459     return db->nTotalChange;
................................................................................
137573 137596   ** connection. The sqlite3_close() version returns SQLITE_BUSY and
137574 137597   ** leaves the connection option if there are unfinalized prepared
137575 137598   ** statements or unfinished sqlite3_backups.  The sqlite3_close_v2()
137576 137599   ** version forces the connection to become a zombie if there are
137577 137600   ** unclosed resources, and arranges for deallocation when the last
137578 137601   ** prepare statement or sqlite3_backup closes.
137579 137602   */
137580         -SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3 *db){ return sqlite3Close(db,0); }
137581         -SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3 *db){ return sqlite3Close(db,1); }
       137603  +SQLITE_API int sqlite3_close(sqlite3 *db){ return sqlite3Close(db,0); }
       137604  +SQLITE_API int sqlite3_close_v2(sqlite3 *db){ return sqlite3Close(db,1); }
137582 137605   
137583 137606   
137584 137607   /*
137585 137608   ** Close the mutex on database connection db.
137586 137609   **
137587 137610   ** Furthermore, if database connection db is a zombie (meaning that there
137588 137611   ** has been a prior call to sqlite3_close(db) or sqlite3_close_v2(db)) and
................................................................................
137981 138004     return rc; 
137982 138005   }
137983 138006   
137984 138007   /*
137985 138008   ** This routine sets the busy callback for an Sqlite database to the
137986 138009   ** given callback function with the given argument.
137987 138010   */
137988         -SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(
       138011  +SQLITE_API int sqlite3_busy_handler(
137989 138012     sqlite3 *db,
137990 138013     int (*xBusy)(void*,int),
137991 138014     void *pArg
137992 138015   ){
137993 138016   #ifdef SQLITE_ENABLE_API_ARMOR
137994 138017     if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
137995 138018   #endif
................................................................................
138004 138027   
138005 138028   #ifndef SQLITE_OMIT_PROGRESS_CALLBACK
138006 138029   /*
138007 138030   ** This routine sets the progress callback for an Sqlite database to the
138008 138031   ** given callback function with the given argument. The progress callback will
138009 138032   ** be invoked every nOps opcodes.
138010 138033   */
138011         -SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(
       138034  +SQLITE_API void sqlite3_progress_handler(
138012 138035     sqlite3 *db, 
138013 138036     int nOps,
138014 138037     int (*xProgress)(void*), 
138015 138038     void *pArg
138016 138039   ){
138017 138040   #ifdef SQLITE_ENABLE_API_ARMOR
138018 138041     if( !sqlite3SafetyCheckOk(db) ){
................................................................................
138035 138058   #endif
138036 138059   
138037 138060   
138038 138061   /*
138039 138062   ** This routine installs a default busy handler that waits for the
138040 138063   ** specified number of milliseconds before returning 0.
138041 138064   */
138042         -SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3 *db, int ms){
       138065  +SQLITE_API int sqlite3_busy_timeout(sqlite3 *db, int ms){
138043 138066   #ifdef SQLITE_ENABLE_API_ARMOR
138044 138067     if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
138045 138068   #endif
138046 138069     if( ms>0 ){
138047 138070       sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db);
138048 138071       db->busyTimeout = ms;
138049 138072     }else{
................................................................................
138051 138074     }
138052 138075     return SQLITE_OK;
138053 138076   }
138054 138077   
138055 138078   /*
138056 138079   ** Cause any pending operation to stop at its earliest opportunity.
138057 138080   */
138058         -SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3 *db){
       138081  +SQLITE_API void sqlite3_interrupt(sqlite3 *db){
138059 138082   #ifdef SQLITE_ENABLE_API_ARMOR
138060 138083     if( !sqlite3SafetyCheckOk(db) ){
138061 138084       (void)SQLITE_MISUSE_BKPT;
138062 138085       return;
138063 138086     }
138064 138087   #endif
138065 138088     db->u1.isInterrupted = 1;
................................................................................
138167 138190     p->nArg = (u16)nArg;
138168 138191     return SQLITE_OK;
138169 138192   }
138170 138193   
138171 138194   /*
138172 138195   ** Create new user functions.
138173 138196   */
138174         -SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
       138197  +SQLITE_API int sqlite3_create_function(
138175 138198     sqlite3 *db,
138176 138199     const char *zFunc,
138177 138200     int nArg,
138178 138201     int enc,
138179 138202     void *p,
138180 138203     void (*xSFunc)(sqlite3_context*,int,sqlite3_value **),
138181 138204     void (*xStep)(sqlite3_context*,int,sqlite3_value **),
138182 138205     void (*xFinal)(sqlite3_context*)
138183 138206   ){
138184 138207     return sqlite3_create_function_v2(db, zFunc, nArg, enc, p, xSFunc, xStep,
138185 138208                                       xFinal, 0);
138186 138209   }
138187 138210   
138188         -SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
       138211  +SQLITE_API int sqlite3_create_function_v2(
138189 138212     sqlite3 *db,
138190 138213     const char *zFunc,
138191 138214     int nArg,
138192 138215     int enc,
138193 138216     void *p,
138194 138217     void (*xSFunc)(sqlite3_context*,int,sqlite3_value **),
138195 138218     void (*xStep)(sqlite3_context*,int,sqlite3_value **),
................................................................................
138224 138247    out:
138225 138248     rc = sqlite3ApiExit(db, rc);
138226 138249     sqlite3_mutex_leave(db->mutex);
138227 138250     return rc;
138228 138251   }
138229 138252   
138230 138253   #ifndef SQLITE_OMIT_UTF16
138231         -SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
       138254  +SQLITE_API int sqlite3_create_function16(
138232 138255     sqlite3 *db,
138233 138256     const void *zFunctionName,
138234 138257     int nArg,
138235 138258     int eTextRep,
138236 138259     void *p,
138237 138260     void (*xSFunc)(sqlite3_context*,int,sqlite3_value**),
138238 138261     void (*xStep)(sqlite3_context*,int,sqlite3_value**),
................................................................................
138264 138287   ** a new one that always throws a run-time error.  
138265 138288   **
138266 138289   ** When virtual tables intend to provide an overloaded function, they
138267 138290   ** should call this routine to make sure the global function exists.
138268 138291   ** A global function must exist in order for name resolution to work
138269 138292   ** properly.
138270 138293   */
138271         -SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(
       138294  +SQLITE_API int sqlite3_overload_function(
138272 138295     sqlite3 *db,
138273 138296     const char *zName,
138274 138297     int nArg
138275 138298   ){
138276 138299     int rc = SQLITE_OK;
138277 138300   
138278 138301   #ifdef SQLITE_ENABLE_API_ARMOR
................................................................................
138296 138319   ** is returned.  
138297 138320   **
138298 138321   ** A NULL trace function means that no tracing is executes.  A non-NULL
138299 138322   ** trace is a pointer to a function that is invoked at the start of each
138300 138323   ** SQL statement.
138301 138324   */
138302 138325   #ifndef SQLITE_OMIT_DEPRECATED
138303         -SQLITE_API void *SQLITE_STDCALL sqlite3_trace(sqlite3 *db, void(*xTrace)(void*,const char*), void *pArg){
       138326  +SQLITE_API void *sqlite3_trace(sqlite3 *db, void(*xTrace)(void*,const char*), void *pArg){
138304 138327     void *pOld;
138305 138328   
138306 138329   #ifdef SQLITE_ENABLE_API_ARMOR
138307 138330     if( !sqlite3SafetyCheckOk(db) ){
138308 138331       (void)SQLITE_MISUSE_BKPT;
138309 138332       return 0;
138310 138333     }
................................................................................
138317 138340     sqlite3_mutex_leave(db->mutex);
138318 138341     return pOld;
138319 138342   }
138320 138343   #endif /* SQLITE_OMIT_DEPRECATED */
138321 138344   
138322 138345   /* Register a trace callback using the version-2 interface.
138323 138346   */
138324         -SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2(
       138347  +SQLITE_API int sqlite3_trace_v2(
138325 138348     sqlite3 *db,                               /* Trace this connection */
138326 138349     unsigned mTrace,                           /* Mask of events to be traced */
138327 138350     int(*xTrace)(unsigned,void*,void*,void*),  /* Callback to invoke */
138328 138351     void *pArg                                 /* Context */
138329 138352   ){
138330 138353   #ifdef SQLITE_ENABLE_API_ARMOR
138331 138354     if( !sqlite3SafetyCheckOk(db) ){
138332 138355       return SQLITE_MISUSE_BKPT;
138333 138356     }
138334 138357   #endif
138335 138358     sqlite3_mutex_enter(db->mutex);
       138359  +  if( mTrace==0 ) xTrace = 0;
       138360  +  if( xTrace==0 ) mTrace = 0;
138336 138361     db->mTrace = mTrace;
138337 138362     db->xTrace = xTrace;
138338 138363     db->pTraceArg = pArg;
138339 138364     sqlite3_mutex_leave(db->mutex);
138340 138365     return SQLITE_OK;
138341 138366   }
138342 138367   
................................................................................
138345 138370   ** Register a profile function.  The pArg from the previously registered 
138346 138371   ** profile function is returned.  
138347 138372   **
138348 138373   ** A NULL profile function means that no profiling is executes.  A non-NULL
138349 138374   ** profile is a pointer to a function that is invoked at the conclusion of
138350 138375   ** each SQL statement that is run.
138351 138376   */
138352         -SQLITE_API void *SQLITE_STDCALL sqlite3_profile(
       138377  +SQLITE_API void *sqlite3_profile(
138353 138378     sqlite3 *db,
138354 138379     void (*xProfile)(void*,const char*,sqlite_uint64),
138355 138380     void *pArg
138356 138381   ){
138357 138382     void *pOld;
138358 138383   
138359 138384   #ifdef SQLITE_ENABLE_API_ARMOR
................................................................................
138373 138398   #endif /* SQLITE_OMIT_TRACE */
138374 138399   
138375 138400   /*
138376 138401   ** Register a function to be invoked when a transaction commits.
138377 138402   ** If the invoked function returns non-zero, then the commit becomes a
138378 138403   ** rollback.
138379 138404   */
138380         -SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(
       138405  +SQLITE_API void *sqlite3_commit_hook(
138381 138406     sqlite3 *db,              /* Attach the hook to this database */
138382 138407     int (*xCallback)(void*),  /* Function to invoke on each commit */
138383 138408     void *pArg                /* Argument to the function */
138384 138409   ){
138385 138410     void *pOld;
138386 138411   
138387 138412   #ifdef SQLITE_ENABLE_API_ARMOR
................................................................................
138398 138423     return pOld;
138399 138424   }
138400 138425   
138401 138426   /*
138402 138427   ** Register a callback to be invoked each time a row is updated,
138403 138428   ** inserted or deleted using this database connection.
138404 138429   */
138405         -SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
       138430  +SQLITE_API void *sqlite3_update_hook(
138406 138431     sqlite3 *db,              /* Attach the hook to this database */
138407 138432     void (*xCallback)(void*,int,char const *,char const *,sqlite_int64),
138408 138433     void *pArg                /* Argument to the function */
138409 138434   ){
138410 138435     void *pRet;
138411 138436   
138412 138437   #ifdef SQLITE_ENABLE_API_ARMOR
................................................................................
138423 138448     return pRet;
138424 138449   }
138425 138450   
138426 138451   /*
138427 138452   ** Register a callback to be invoked each time a transaction is rolled
138428 138453   ** back by this database connection.
138429 138454   */
138430         -SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(
       138455  +SQLITE_API void *sqlite3_rollback_hook(
138431 138456     sqlite3 *db,              /* Attach the hook to this database */
138432 138457     void (*xCallback)(void*), /* Callback function */
138433 138458     void *pArg                /* Argument to the function */
138434 138459   ){
138435 138460     void *pRet;
138436 138461   
138437 138462   #ifdef SQLITE_ENABLE_API_ARMOR
................................................................................
138449 138474   }
138450 138475   
138451 138476   #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
138452 138477   /*
138453 138478   ** Register a callback to be invoked each time a row is updated,
138454 138479   ** inserted or deleted using this database connection.
138455 138480   */
138456         -SQLITE_API void *SQLITE_STDCALL sqlite3_preupdate_hook(
       138481  +SQLITE_API void *sqlite3_preupdate_hook(
138457 138482     sqlite3 *db,              /* Attach the hook to this database */
138458 138483     void(*xCallback)(         /* Callback function */
138459 138484       void*,sqlite3*,int,char const*,char const*,sqlite3_int64,sqlite3_int64),
138460 138485     void *pArg                /* First callback argument */
138461 138486   ){
138462 138487     void *pRet;
138463 138488     sqlite3_mutex_enter(db->mutex);
................................................................................
138498 138523   ** nFrame parameter disables automatic checkpoints entirely.
138499 138524   **
138500 138525   ** The callback registered by this function replaces any existing callback
138501 138526   ** registered using sqlite3_wal_hook(). Likewise, registering a callback
138502 138527   ** using sqlite3_wal_hook() disables the automatic checkpoint mechanism
138503 138528   ** configured by this function.
138504 138529   */
138505         -SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){
       138530  +SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){
138506 138531   #ifdef SQLITE_OMIT_WAL
138507 138532     UNUSED_PARAMETER(db);
138508 138533     UNUSED_PARAMETER(nFrame);
138509 138534   #else
138510 138535   #ifdef SQLITE_ENABLE_API_ARMOR
138511 138536     if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
138512 138537   #endif
................................................................................
138519 138544     return SQLITE_OK;
138520 138545   }
138521 138546   
138522 138547   /*
138523 138548   ** Register a callback to be invoked each time a transaction is written
138524 138549   ** into the write-ahead-log by this database connection.
138525 138550   */
138526         -SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
       138551  +SQLITE_API void *sqlite3_wal_hook(
138527 138552     sqlite3 *db,                    /* Attach the hook to this db handle */
138528 138553     int(*xCallback)(void *, sqlite3*, const char*, int),
138529 138554     void *pArg                      /* First argument passed to xCallback() */
138530 138555   ){
138531 138556   #ifndef SQLITE_OMIT_WAL
138532 138557     void *pRet;
138533 138558   #ifdef SQLITE_ENABLE_API_ARMOR
................................................................................
138546 138571     return 0;
138547 138572   #endif
138548 138573   }
138549 138574   
138550 138575   /*
138551 138576   ** Checkpoint database zDb.
138552 138577   */
138553         -SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
       138578  +SQLITE_API int sqlite3_wal_checkpoint_v2(
138554 138579     sqlite3 *db,                    /* Database handle */
138555 138580     const char *zDb,                /* Name of attached database (or NULL) */
138556 138581     int eMode,                      /* SQLITE_CHECKPOINT_* value */
138557 138582     int *pnLog,                     /* OUT: Size of WAL log in frames */
138558 138583     int *pnCkpt                     /* OUT: Total number of frames checkpointed */
138559 138584   ){
138560 138585   #ifdef SQLITE_OMIT_WAL
................................................................................
138601 138626   
138602 138627   
138603 138628   /*
138604 138629   ** Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points
138605 138630   ** to contains a zero-length string, all attached databases are 
138606 138631   ** checkpointed.
138607 138632   */
138608         -SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){
       138633  +SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){
138609 138634     /* EVIDENCE-OF: R-41613-20553 The sqlite3_wal_checkpoint(D,X) is equivalent to
138610 138635     ** sqlite3_wal_checkpoint_v2(D,X,SQLITE_CHECKPOINT_PASSIVE,0,0). */
138611 138636     return sqlite3_wal_checkpoint_v2(db,zDb,SQLITE_CHECKPOINT_PASSIVE,0,0);
138612 138637   }
138613 138638   
138614 138639   #ifndef SQLITE_OMIT_WAL
138615 138640   /*
................................................................................
138692 138717   #endif
138693 138718   }
138694 138719   
138695 138720   /*
138696 138721   ** Return UTF-8 encoded English language explanation of the most recent
138697 138722   ** error.
138698 138723   */
138699         -SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3 *db){
       138724  +SQLITE_API const char *sqlite3_errmsg(sqlite3 *db){
138700 138725     const char *z;
138701 138726     if( !db ){
138702 138727       return sqlite3ErrStr(SQLITE_NOMEM_BKPT);
138703 138728     }
138704 138729     if( !sqlite3SafetyCheckSickOrOk(db) ){
138705 138730       return sqlite3ErrStr(SQLITE_MISUSE_BKPT);
138706 138731     }
................................................................................
138720 138745   }
138721 138746   
138722 138747   #ifndef SQLITE_OMIT_UTF16
138723 138748   /*
138724 138749   ** Return UTF-16 encoded English language explanation of the most recent
138725 138750   ** error.
138726 138751   */
138727         -SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3 *db){
       138752  +SQLITE_API const void *sqlite3_errmsg16(sqlite3 *db){
138728 138753     static const u16 outOfMem[] = {
138729 138754       'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0
138730 138755     };
138731 138756     static const u16 misuse[] = {
138732 138757       'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ', 
138733 138758       'r', 'o', 'u', 't', 'i', 'n', 'e', ' ', 
138734 138759       'c', 'a', 'l', 'l', 'e', 'd', ' ', 
................................................................................
138765 138790   }
138766 138791   #endif /* SQLITE_OMIT_UTF16 */
138767 138792   
138768 138793   /*
138769 138794   ** Return the most recent error code generated by an SQLite routine. If NULL is
138770 138795   ** passed to this function, we assume a malloc() failed during sqlite3_open().
138771 138796   */
138772         -SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db){
       138797  +SQLITE_API int sqlite3_errcode(sqlite3 *db){
138773 138798     if( db && !sqlite3SafetyCheckSickOrOk(db) ){
138774 138799       return SQLITE_MISUSE_BKPT;
138775 138800     }
138776 138801     if( !db || db->mallocFailed ){
138777 138802       return SQLITE_NOMEM_BKPT;
138778 138803     }
138779 138804     return db->errCode & db->errMask;
138780 138805   }
138781         -SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db){
       138806  +SQLITE_API int sqlite3_extended_errcode(sqlite3 *db){
138782 138807     if( db && !sqlite3SafetyCheckSickOrOk(db) ){
138783 138808       return SQLITE_MISUSE_BKPT;
138784 138809     }
138785 138810     if( !db || db->mallocFailed ){
138786 138811       return SQLITE_NOMEM_BKPT;
138787 138812     }
138788 138813     return db->errCode;
138789 138814   }
138790         -SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3 *db){
       138815  +SQLITE_API int sqlite3_system_errno(sqlite3 *db){
138791 138816     return db ? db->iSysErrno : 0;
138792 138817   }  
138793 138818   
138794 138819   /*
138795 138820   ** Return a string that describes the kind of error specified in the
138796 138821   ** argument.  For now, this simply calls the internal sqlite3ErrStr()
138797 138822   ** function.
138798 138823   */
138799         -SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int rc){
       138824  +SQLITE_API const char *sqlite3_errstr(int rc){
138800 138825     return sqlite3ErrStr(rc);
138801 138826   }
138802 138827   
138803 138828   /*
138804 138829   ** Create a new collating function for database "db".  The name is zName
138805 138830   ** and the encoding is enc.
138806 138831   */
................................................................................
138940 138965   ** Make no changes but still report the old value if the
138941 138966   ** new limit is negative.
138942 138967   **
138943 138968   ** A new lower limit does not shrink existing constructs.
138944 138969   ** It merely prevents new constructs that exceed the limit
138945 138970   ** from forming.
138946 138971   */
138947         -SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3 *db, int limitId, int newLimit){
       138972  +SQLITE_API int sqlite3_limit(sqlite3 *db, int limitId, int newLimit){
138948 138973     int oldLimit;
138949 138974   
138950 138975   #ifdef SQLITE_ENABLE_API_ARMOR
138951 138976     if( !sqlite3SafetyCheckOk(db) ){
138952 138977       (void)SQLITE_MISUSE_BKPT;
138953 138978       return -1;
138954 138979     }
................................................................................
139564 139589     sqlite3_free(zOpen);
139565 139590     return rc & 0xff;
139566 139591   }
139567 139592   
139568 139593   /*
139569 139594   ** Open a new database handle.
139570 139595   */
139571         -SQLITE_API int SQLITE_STDCALL sqlite3_open(
       139596  +SQLITE_API int sqlite3_open(
139572 139597     const char *zFilename, 
139573 139598     sqlite3 **ppDb 
139574 139599   ){
139575 139600     return openDatabase(zFilename, ppDb,
139576 139601                         SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0);
139577 139602   }
139578         -SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
       139603  +SQLITE_API int sqlite3_open_v2(
139579 139604     const char *filename,   /* Database filename (UTF-8) */
139580 139605     sqlite3 **ppDb,         /* OUT: SQLite db handle */
139581 139606     int flags,              /* Flags */
139582 139607     const char *zVfs        /* Name of VFS module to use */
139583 139608   ){
139584 139609     return openDatabase(filename, ppDb, (unsigned int)flags, zVfs);
139585 139610   }
139586 139611   
139587 139612   #ifndef SQLITE_OMIT_UTF16
139588 139613   /*
139589 139614   ** Open a new database handle.
139590 139615   */
139591         -SQLITE_API int SQLITE_STDCALL sqlite3_open16(
       139616  +SQLITE_API int sqlite3_open16(
139592 139617     const void *zFilename, 
139593 139618     sqlite3 **ppDb
139594 139619   ){
139595 139620     char const *zFilename8;   /* zFilename encoded in UTF-8 instead of UTF-16 */
139596 139621     sqlite3_value *pVal;
139597 139622     int rc;
139598 139623   
................................................................................
139623 139648     return rc & 0xff;
139624 139649   }
139625 139650   #endif /* SQLITE_OMIT_UTF16 */
139626 139651   
139627 139652   /*
139628 139653   ** Register a new collation sequence with the database handle db.
139629 139654   */
139630         -SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
       139655  +SQLITE_API int sqlite3_create_collation(
139631 139656     sqlite3* db, 
139632 139657     const char *zName, 
139633 139658     int enc, 
139634 139659     void* pCtx,
139635 139660     int(*xCompare)(void*,int,const void*,int,const void*)
139636 139661   ){
139637 139662     return sqlite3_create_collation_v2(db, zName, enc, pCtx, xCompare, 0);
139638 139663   }
139639 139664   
139640 139665   /*
139641 139666   ** Register a new collation sequence with the database handle db.
139642 139667   */
139643         -SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
       139668  +SQLITE_API int sqlite3_create_collation_v2(
139644 139669     sqlite3* db, 
139645 139670     const char *zName, 
139646 139671     int enc, 
139647 139672     void* pCtx,
139648 139673     int(*xCompare)(void*,int,const void*,int,const void*),
139649 139674     void(*xDel)(void*)
139650 139675   ){
................................................................................
139661 139686     return rc;
139662 139687   }
139663 139688   
139664 139689   #ifndef SQLITE_OMIT_UTF16
139665 139690   /*
139666 139691   ** Register a new collation sequence with the database handle db.
139667 139692   */
139668         -SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
       139693  +SQLITE_API int sqlite3_create_collation16(
139669 139694     sqlite3* db, 
139670 139695     const void *zName,
139671 139696     int enc, 
139672 139697     void* pCtx,
139673 139698     int(*xCompare)(void*,int,const void*,int,const void*)
139674 139699   ){
139675 139700     int rc = SQLITE_OK;
................................................................................
139691 139716   }
139692 139717   #endif /* SQLITE_OMIT_UTF16 */
139693 139718   
139694 139719   /*
139695 139720   ** Register a collation sequence factory callback with the database handle
139696 139721   ** db. Replace any previously installed collation sequence factory.
139697 139722   */
139698         -SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
       139723  +SQLITE_API int sqlite3_collation_needed(
139699 139724     sqlite3 *db, 
139700 139725     void *pCollNeededArg, 
139701 139726     void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*)
139702 139727   ){
139703 139728   #ifdef SQLITE_ENABLE_API_ARMOR
139704 139729     if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
139705 139730   #endif
................................................................................
139712 139737   }
139713 139738   
139714 139739   #ifndef SQLITE_OMIT_UTF16
139715 139740   /*
139716 139741   ** Register a collation sequence factory callback with the database handle
139717 139742   ** db. Replace any previously installed collation sequence factory.
139718 139743   */
139719         -SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
       139744  +SQLITE_API int sqlite3_collation_needed16(
139720 139745     sqlite3 *db, 
139721 139746     void *pCollNeededArg, 
139722 139747     void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*)
139723 139748   ){
139724 139749   #ifdef SQLITE_ENABLE_API_ARMOR
139725 139750     if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
139726 139751   #endif
................................................................................
139734 139759   #endif /* SQLITE_OMIT_UTF16 */
139735 139760   
139736 139761   #ifndef SQLITE_OMIT_DEPRECATED
139737 139762   /*
139738 139763   ** This function is now an anachronism. It used to be used to recover from a
139739 139764   ** malloc() failure, but SQLite now does this automatically.
139740 139765   */
139741         -SQLITE_API int SQLITE_STDCALL sqlite3_global_recover(void){
       139766  +SQLITE_API int sqlite3_global_recover(void){
139742 139767     return SQLITE_OK;
139743 139768   }
139744 139769   #endif
139745 139770   
139746 139771   /*
139747 139772   ** Test to see whether or not the database connection is in autocommit
139748 139773   ** mode.  Return TRUE if it is and FALSE if not.  Autocommit mode is on
139749 139774   ** by default.  Autocommit is disabled by a BEGIN statement and reenabled
139750 139775   ** by the next COMMIT or ROLLBACK.
139751 139776   */
139752         -SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3 *db){
       139777  +SQLITE_API int sqlite3_get_autocommit(sqlite3 *db){
139753 139778   #ifdef SQLITE_ENABLE_API_ARMOR
139754 139779     if( !sqlite3SafetyCheckOk(db) ){
139755 139780       (void)SQLITE_MISUSE_BKPT;
139756 139781       return 0;
139757 139782     }
139758 139783   #endif
139759 139784     return db->autoCommit;
................................................................................
139802 139827   /*
139803 139828   ** This is a convenience routine that makes sure that all thread-specific
139804 139829   ** data for this thread has been deallocated.
139805 139830   **
139806 139831   ** SQLite no longer uses thread-specific data so this routine is now a
139807 139832   ** no-op.  It is retained for historical compatibility.
139808 139833   */
139809         -SQLITE_API void SQLITE_STDCALL sqlite3_thread_cleanup(void){
       139834  +SQLITE_API void sqlite3_thread_cleanup(void){
139810 139835   }
139811 139836   #endif
139812 139837   
139813 139838   /*
139814 139839   ** Return meta information about a specific column of a database table.
139815 139840   ** See comment in sqlite3.h (sqlite.h.in) for details.
139816 139841   */
139817         -SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
       139842  +SQLITE_API int sqlite3_table_column_metadata(
139818 139843     sqlite3 *db,                /* Connection handle */
139819 139844     const char *zDbName,        /* Database name or NULL */
139820 139845     const char *zTableName,     /* Table name */
139821 139846     const char *zColumnName,    /* Column name */
139822 139847     char const **pzDataType,    /* OUTPUT: Declared data type */
139823 139848     char const **pzCollSeq,     /* OUTPUT: Collation sequence name */
139824 139849     int *pNotNull,              /* OUTPUT: True if NOT NULL constraint exists */
................................................................................
139928 139953     sqlite3_mutex_leave(db->mutex);
139929 139954     return rc;
139930 139955   }
139931 139956   
139932 139957   /*
139933 139958   ** Sleep for a little while.  Return the amount of time slept.
139934 139959   */
139935         -SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int ms){
       139960  +SQLITE_API int sqlite3_sleep(int ms){
139936 139961     sqlite3_vfs *pVfs;
139937 139962     int rc;
139938 139963     pVfs = sqlite3_vfs_find(0);
139939 139964     if( pVfs==0 ) return 0;
139940 139965   
139941 139966     /* This function works in milliseconds, but the underlying OsSleep() 
139942 139967     ** API uses microseconds. Hence the 1000's.
................................................................................
139944 139969     rc = (sqlite3OsSleep(pVfs, 1000*ms)/1000);
139945 139970     return rc;
139946 139971   }
139947 139972   
139948 139973   /*
139949 139974   ** Enable or disable the extended result codes.
139950 139975   */
139951         -SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3 *db, int onoff){
       139976  +SQLITE_API int sqlite3_extended_result_codes(sqlite3 *db, int onoff){
139952 139977   #ifdef SQLITE_ENABLE_API_ARMOR
139953 139978     if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
139954 139979   #endif
139955 139980     sqlite3_mutex_enter(db->mutex);
139956 139981     db->errMask = onoff ? 0xffffffff : 0xff;
139957 139982     sqlite3_mutex_leave(db->mutex);
139958 139983     return SQLITE_OK;
139959 139984   }
139960 139985   
139961 139986   /*
139962 139987   ** Invoke the xFileControl method on a particular database.
139963 139988   */
139964         -SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
       139989  +SQLITE_API int sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
139965 139990     int rc = SQLITE_ERROR;
139966 139991     Btree *pBtree;
139967 139992   
139968 139993   #ifdef SQLITE_ENABLE_API_ARMOR
139969 139994     if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
139970 139995   #endif
139971 139996     sqlite3_mutex_enter(db->mutex);
................................................................................
139997 140022     sqlite3_mutex_leave(db->mutex);
139998 140023     return rc;
139999 140024   }
140000 140025   
140001 140026   /*
140002 140027   ** Interface to the testing logic.
140003 140028   */
140004         -SQLITE_API int SQLITE_CDECL sqlite3_test_control(int op, ...){
       140029  +SQLITE_API int sqlite3_test_control(int op, ...){
140005 140030     int rc = 0;
140006 140031   #ifdef SQLITE_OMIT_BUILTIN_TEST
140007 140032     UNUSED_PARAMETER(op);
140008 140033   #else
140009 140034     va_list ap;
140010 140035     va_start(ap, op);
140011 140036     switch( op ){
................................................................................
140342 140367   **
140343 140368   ** The zFilename argument is the filename pointer passed into the xOpen()
140344 140369   ** method of a VFS implementation.  The zParam argument is the name of the
140345 140370   ** query parameter we seek.  This routine returns the value of the zParam
140346 140371   ** parameter if it exists.  If the parameter does not exist, this routine
140347 140372   ** returns a NULL pointer.
140348 140373   */
140349         -SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam){
       140374  +SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam){
140350 140375     if( zFilename==0 || zParam==0 ) return 0;
140351 140376     zFilename += sqlite3Strlen30(zFilename) + 1;
140352 140377     while( zFilename[0] ){
140353 140378       int x = strcmp(zFilename, zParam);
140354 140379       zFilename += sqlite3Strlen30(zFilename) + 1;
140355 140380       if( x==0 ) return zFilename;
140356 140381       zFilename += sqlite3Strlen30(zFilename) + 1;
................................................................................
140357 140382     }
140358 140383     return 0;
140359 140384   }
140360 140385   
140361 140386   /*
140362 140387   ** Return a boolean value for a query parameter.
140363 140388   */
140364         -SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){
       140389  +SQLITE_API int sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){
140365 140390     const char *z = sqlite3_uri_parameter(zFilename, zParam);
140366 140391     bDflt = bDflt!=0;
140367 140392     return z ? sqlite3GetBoolean(z, bDflt) : bDflt;
140368 140393   }
140369 140394   
140370 140395   /*
140371 140396   ** Return a 64-bit integer value for a query parameter.
140372 140397   */
140373         -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(
       140398  +SQLITE_API sqlite3_int64 sqlite3_uri_int64(
140374 140399     const char *zFilename,    /* Filename as passed to xOpen */
140375 140400     const char *zParam,       /* URI parameter sought */
140376 140401     sqlite3_int64 bDflt       /* return if parameter is missing */
140377 140402   ){
140378 140403     const char *z = sqlite3_uri_parameter(zFilename, zParam);
140379 140404     sqlite3_int64 v;
140380 140405     if( z && sqlite3DecOrHexToI64(z, &v)==SQLITE_OK ){
................................................................................
140398 140423     return 0;
140399 140424   }
140400 140425   
140401 140426   /*
140402 140427   ** Return the filename of the database associated with a database
140403 140428   ** connection.
140404 140429   */
140405         -SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName){
       140430  +SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName){
140406 140431     Btree *pBt;
140407 140432   #ifdef SQLITE_ENABLE_API_ARMOR
140408 140433     if( !sqlite3SafetyCheckOk(db) ){
140409 140434       (void)SQLITE_MISUSE_BKPT;
140410 140435       return 0;
140411 140436     }
140412 140437   #endif
................................................................................
140414 140439     return pBt ? sqlite3BtreeGetFilename(pBt) : 0;
140415 140440   }
140416 140441   
140417 140442   /*
140418 140443   ** Return 1 if database is read-only or 0 if read/write.  Return -1 if
140419 140444   ** no such database exists.
140420 140445   */
140421         -SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName){
       140446  +SQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName){
140422 140447     Btree *pBt;
140423 140448   #ifdef SQLITE_ENABLE_API_ARMOR
140424 140449     if( !sqlite3SafetyCheckOk(db) ){
140425 140450       (void)SQLITE_MISUSE_BKPT;
140426 140451       return -1;
140427 140452     }
140428 140453   #endif
................................................................................
140431 140456   }
140432 140457   
140433 140458   #ifdef SQLITE_ENABLE_SNAPSHOT
140434 140459   /*
140435 140460   ** Obtain a snapshot handle for the snapshot of database zDb currently 
140436 140461   ** being read by handle db.
140437 140462   */
140438         -SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_get(
       140463  +SQLITE_API int sqlite3_snapshot_get(
140439 140464     sqlite3 *db, 
140440 140465     const char *zDb,
140441 140466     sqlite3_snapshot **ppSnapshot
140442 140467   ){
140443 140468     int rc = SQLITE_ERROR;
140444 140469   #ifndef SQLITE_OMIT_WAL
140445 140470     int iDb;
................................................................................
140466 140491   #endif   /* SQLITE_OMIT_WAL */
140467 140492     return rc;
140468 140493   }
140469 140494   
140470 140495   /*
140471 140496   ** Open a read-transaction on the snapshot idendified by pSnapshot.
140472 140497   */
140473         -SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_open(
       140498  +SQLITE_API int sqlite3_snapshot_open(
140474 140499     sqlite3 *db, 
140475 140500     const char *zDb, 
140476 140501     sqlite3_snapshot *pSnapshot
140477 140502   ){
140478 140503     int rc = SQLITE_ERROR;
140479 140504   #ifndef SQLITE_OMIT_WAL
140480 140505   
................................................................................
140503 140528   #endif   /* SQLITE_OMIT_WAL */
140504 140529     return rc;
140505 140530   }
140506 140531   
140507 140532   /*
140508 140533   ** Free a snapshot handle obtained from sqlite3_snapshot_get().
140509 140534   */
140510         -SQLITE_API void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot *pSnapshot){
       140535  +SQLITE_API void sqlite3_snapshot_free(sqlite3_snapshot *pSnapshot){
140511 140536     sqlite3_free(pSnapshot);
140512 140537   }
140513 140538   #endif /* SQLITE_ENABLE_SNAPSHOT */
140514 140539   
140515 140540   /************** End of main.c ************************************************/
140516 140541   /************** Begin file notify.c ******************************************/
140517 140542   /*
................................................................................
140657 140682   ** Otherwise, make arrangements to invoke xNotify when pOther drops
140658 140683   ** its locks.
140659 140684   **
140660 140685   ** Each call to this routine overrides any prior callbacks registered
140661 140686   ** on the same "db".  If xNotify==0 then any prior callbacks are immediately
140662 140687   ** cancelled.
140663 140688   */
140664         -SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
       140689  +SQLITE_API int sqlite3_unlock_notify(
140665 140690     sqlite3 *db,
140666 140691     void (*xNotify)(void **, int),
140667 140692     void *pArg
140668 140693   ){
140669 140694     int rc = SQLITE_OK;
140670 140695   
140671 140696     sqlite3_mutex_enter(db->mutex);
................................................................................
147660 147685   #if !SQLITE_CORE
147661 147686   /*
147662 147687   ** Initialize API pointer table, if required.
147663 147688   */
147664 147689   #ifdef _WIN32
147665 147690   __declspec(dllexport)
147666 147691   #endif
147667         -SQLITE_API int SQLITE_STDCALL sqlite3_fts3_init(
       147692  +SQLITE_API int sqlite3_fts3_init(
147668 147693     sqlite3 *db, 
147669 147694     char **pzErrMsg,
147670 147695     const sqlite3_api_routines *pApi
147671 147696   ){
147672 147697     SQLITE_EXTENSION_INIT2(pApi)
147673 147698     return sqlite3Fts3Init(db);
147674 147699   }
................................................................................
163461 163486       }
163462 163487     }
163463 163488   }
163464 163489   
163465 163490   /*
163466 163491   ** Register a new geometry function for use with the r-tree MATCH operator.
163467 163492   */
163468         -SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
       163493  +SQLITE_API int sqlite3_rtree_geometry_callback(
163469 163494     sqlite3 *db,                  /* Register SQL function on this connection */
163470 163495     const char *zGeom,            /* Name of the new SQL function */
163471 163496     int (*xGeom)(sqlite3_rtree_geometry*,int,RtreeDValue*,int*), /* Callback */
163472 163497     void *pContext                /* Extra data associated with the callback */
163473 163498   ){
163474 163499     RtreeGeomCallback *pGeomCtx;      /* Context object for new user-function */
163475 163500   
................................................................................
163485 163510     );
163486 163511   }
163487 163512   
163488 163513   /*
163489 163514   ** Register a new 2nd-generation geometry function for use with the
163490 163515   ** r-tree MATCH operator.
163491 163516   */
163492         -SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
       163517  +SQLITE_API int sqlite3_rtree_query_callback(
163493 163518     sqlite3 *db,                 /* Register SQL function on this connection */
163494 163519     const char *zQueryFunc,      /* Name of new SQL function */
163495 163520     int (*xQueryFunc)(sqlite3_rtree_query_info*), /* Callback */
163496 163521     void *pContext,              /* Extra data passed into the callback */
163497 163522     void (*xDestructor)(void*)   /* Destructor for the extra data */
163498 163523   ){
163499 163524     RtreeGeomCallback *pGeomCtx;      /* Context object for new user-function */
................................................................................
163510 163535     );
163511 163536   }
163512 163537   
163513 163538   #if !SQLITE_CORE
163514 163539   #ifdef _WIN32
163515 163540   __declspec(dllexport)
163516 163541   #endif
163517         -SQLITE_API int SQLITE_STDCALL sqlite3_rtree_init(
       163542  +SQLITE_API int sqlite3_rtree_init(
163518 163543     sqlite3 *db,
163519 163544     char **pzErrMsg,
163520 163545     const sqlite3_api_routines *pApi
163521 163546   ){
163522 163547     SQLITE_EXTENSION_INIT2(pApi)
163523 163548     return sqlite3RtreeInit(db);
163524 163549   }
................................................................................
164061 164086     return rc;
164062 164087   }
164063 164088   
164064 164089   #if !SQLITE_CORE
164065 164090   #ifdef _WIN32
164066 164091   __declspec(dllexport)
164067 164092   #endif
164068         -SQLITE_API int SQLITE_STDCALL sqlite3_icu_init(
       164093  +SQLITE_API int sqlite3_icu_init(
164069 164094     sqlite3 *db, 
164070 164095     char **pzErrMsg,
164071 164096     const sqlite3_api_routines *pApi
164072 164097   ){
164073 164098     SQLITE_EXTENSION_INIT2(pApi)
164074 164099     return sqlite3IcuInit(db);
164075 164100   }
................................................................................
164741 164766   ** "vfs=..." option may be passed as the zTarget option.
164742 164767   **
164743 164768   ** IMPORTANT NOTE FOR ZIPVFS USERS: The RBU extension works with all of
164744 164769   ** SQLite's built-in VFSs, including the multiplexor VFS. However it does
164745 164770   ** not work out of the box with zipvfs. Refer to the comment describing
164746 164771   ** the zipvfs_create_vfs() API below for details on using RBU with zipvfs.
164747 164772   */
164748         -SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_open(
       164773  +SQLITE_API sqlite3rbu *sqlite3rbu_open(
164749 164774     const char *zTarget, 
164750 164775     const char *zRbu,
164751 164776     const char *zState
164752 164777   );
164753 164778   
164754 164779   /*
164755 164780   ** Open an RBU handle to perform an RBU vacuum on database file zTarget.
................................................................................
164774 164799   ** new RBU vacuum operation.
164775 164800   **
164776 164801   ** As with sqlite3rbu_open(), Zipvfs users should rever to the comment
164777 164802   ** describing the sqlite3rbu_create_vfs() API function below for 
164778 164803   ** a description of the complications associated with using RBU with 
164779 164804   ** zipvfs databases.
164780 164805   */
164781         -SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_vacuum(
       164806  +SQLITE_API sqlite3rbu *sqlite3rbu_vacuum(
164782 164807     const char *zTarget, 
164783 164808     const char *zState
164784 164809   );
164785 164810   
164786 164811   /*
164787 164812   ** Internally, each RBU connection uses a separate SQLite database 
164788 164813   ** connection to access the target and rbu update databases. This
................................................................................
164810 164835   ** If an error has occurred, either while opening or stepping the RBU object,
164811 164836   ** this function may return NULL. The error code and message may be collected
164812 164837   ** when sqlite3rbu_close() is called.
164813 164838   **
164814 164839   ** Database handles returned by this function remain valid until the next
164815 164840   ** call to any sqlite3rbu_xxx() function other than sqlite3rbu_db().
164816 164841   */
164817         -SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3rbu_db(sqlite3rbu*, int bRbu);
       164842  +SQLITE_API sqlite3 *sqlite3rbu_db(sqlite3rbu*, int bRbu);
164818 164843   
164819 164844   /*
164820 164845   ** Do some work towards applying the RBU update to the target db. 
164821 164846   **
164822 164847   ** Return SQLITE_DONE if the update has been completely applied, or 
164823 164848   ** SQLITE_OK if no error occurs but there remains work to do to apply
164824 164849   ** the RBU update. If an error does occur, some other error code is 
164825 164850   ** returned. 
164826 164851   **
164827 164852   ** Once a call to sqlite3rbu_step() has returned a value other than
164828 164853   ** SQLITE_OK, all subsequent calls on the same RBU handle are no-ops
164829 164854   ** that immediately return the same value.
164830 164855   */
164831         -SQLITE_API int SQLITE_STDCALL sqlite3rbu_step(sqlite3rbu *pRbu);
       164856  +SQLITE_API int sqlite3rbu_step(sqlite3rbu *pRbu);
164832 164857   
164833 164858   /*
164834 164859   ** Force RBU to save its state to disk.
164835 164860   **
164836 164861   ** If a power failure or application crash occurs during an update, following
164837 164862   ** system recovery RBU may resume the update from the point at which the state
164838 164863   ** was last saved. In other words, from the most recent successful call to 
164839 164864   ** sqlite3rbu_close() or this function.
164840 164865   **
164841 164866   ** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
164842 164867   */
164843         -SQLITE_API int SQLITE_STDCALL sqlite3rbu_savestate(sqlite3rbu *pRbu);
       164868  +SQLITE_API int sqlite3rbu_savestate(sqlite3rbu *pRbu);
164844 164869   
164845 164870   /*
164846 164871   ** Close an RBU handle. 
164847 164872   **
164848 164873   ** If the RBU update has been completely applied, mark the RBU database
164849 164874   ** as fully applied. Otherwise, assuming no error has occurred, save the
164850 164875   ** current state of the RBU update appliation to the RBU database.
................................................................................
164856 164881   ** message. It is the responsibility of the caller to eventually free any 
164857 164882   ** such buffer using sqlite3_free().
164858 164883   **
164859 164884   ** Otherwise, if no error occurs, this function returns SQLITE_OK if the
164860 164885   ** update has been partially applied, or SQLITE_DONE if it has been 
164861 164886   ** completely applied.
164862 164887   */
164863         -SQLITE_API int SQLITE_STDCALL sqlite3rbu_close(sqlite3rbu *pRbu, char **pzErrmsg);
       164888  +SQLITE_API int sqlite3rbu_close(sqlite3rbu *pRbu, char **pzErrmsg);
164864 164889   
164865 164890   /*
164866 164891   ** Return the total number of key-value operations (inserts, deletes or 
164867 164892   ** updates) that have been performed on the target database since the
164868 164893   ** current RBU update was started.
164869 164894   */
164870         -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3rbu_progress(sqlite3rbu *pRbu);
       164895  +SQLITE_API sqlite3_int64 sqlite3rbu_progress(sqlite3rbu *pRbu);
164871 164896   
164872 164897   /*
164873 164898   ** Obtain permyriadage (permyriadage is to 10000 as percentage is to 100) 
164874 164899   ** progress indications for the two stages of an RBU update. This API may
164875 164900   ** be useful for driving GUI progress indicators and similar.
164876 164901   **
164877 164902   ** An RBU update is divided into two stages:
................................................................................
164905 164930   ** If the rbu_count table is present and populated correctly and this
164906 164931   ** API is called during stage 1, the *pnOne output variable is set to the
164907 164932   ** permyriadage progress of the same stage. If the rbu_count table does
164908 164933   ** not exist, then (*pnOne) is set to -1 during stage 1. If the rbu_count
164909 164934   ** table exists but is not correctly populated, the value of the *pnOne
164910 164935   ** output variable during stage 1 is undefined.
164911 164936   */
164912         -SQLITE_API void SQLITE_STDCALL sqlite3rbu_bp_progress(sqlite3rbu *pRbu, int *pnOne, int *pnTwo);
       164937  +SQLITE_API void sqlite3rbu_bp_progress(sqlite3rbu *pRbu, int *pnOne, int *pnTwo);
164913 164938   
164914 164939   /*
164915 164940   ** Obtain an indication as to the current stage of an RBU update or vacuum.
164916 164941   ** This function always returns one of the SQLITE_RBU_STATE_XXX constants
164917 164942   ** defined in this file. Return values should be interpreted as follows:
164918 164943   **
164919 164944   ** SQLITE_RBU_STATE_OAL:
................................................................................
164943 164968   */
164944 164969   #define SQLITE_RBU_STATE_OAL        1
164945 164970   #define SQLITE_RBU_STATE_MOVE       2
164946 164971   #define SQLITE_RBU_STATE_CHECKPOINT 3
164947 164972   #define SQLITE_RBU_STATE_DONE       4
164948 164973   #define SQLITE_RBU_STATE_ERROR      5
164949 164974   
164950         -SQLITE_API int SQLITE_STDCALL sqlite3rbu_state(sqlite3rbu *pRbu);
       164975  +SQLITE_API int sqlite3rbu_state(sqlite3rbu *pRbu);
164951 164976   
164952 164977   /*
164953 164978   ** Create an RBU VFS named zName that accesses the underlying file-system
164954 164979   ** via existing VFS zParent. Or, if the zParent parameter is passed NULL, 
164955 164980   ** then the new RBU VFS uses the default system VFS to access the file-system.
164956 164981   ** The new object is registered as a non-default VFS with SQLite before 
164957 164982   ** returning.
................................................................................
164987 165012   ** that does not include the RBU layer results in an error.
164988 165013   **
164989 165014   ** The overhead of adding the "rbu" VFS to the system is negligible for 
164990 165015   ** non-RBU users. There is no harm in an application accessing the 
164991 165016   ** file-system via "rbu" all the time, even if it only uses RBU functionality 
164992 165017   ** occasionally.
164993 165018   */
164994         -SQLITE_API int SQLITE_STDCALL sqlite3rbu_create_vfs(const char *zName, const char *zParent);
       165019  +SQLITE_API int sqlite3rbu_create_vfs(const char *zName, const char *zParent);
164995 165020   
164996 165021   /*
164997 165022   ** Deregister and destroy an RBU vfs created by an earlier call to
164998 165023   ** sqlite3rbu_create_vfs().
164999 165024   **
165000 165025   ** VFS objects are not reference counted. If a VFS object is destroyed
165001 165026   ** before all database handles that use it have been closed, the results
165002 165027   ** are undefined.
165003 165028   */
165004         -SQLITE_API void SQLITE_STDCALL sqlite3rbu_destroy_vfs(const char *zName);
       165029  +SQLITE_API void sqlite3rbu_destroy_vfs(const char *zName);
165005 165030   
165006 165031   #if 0
165007 165032   }  /* end of the 'extern "C"' block */
165008 165033   #endif
165009 165034   
165010 165035   #endif /* _SQLITE3RBU_H */
165011 165036   
................................................................................
168091 168116     rbuFinalize(p, pSql);
168092 168117     rbuFinalize(p, pInsert);
168093 168118   }
168094 168119   
168095 168120   /*
168096 168121   ** Step the RBU object.
168097 168122   */
168098         -SQLITE_API int SQLITE_STDCALL sqlite3rbu_step(sqlite3rbu *p){
       168123  +SQLITE_API int sqlite3rbu_step(sqlite3rbu *p){
168099 168124     if( p ){
168100 168125       switch( p->eStage ){
168101 168126         case RBU_STAGE_OAL: {
168102 168127           RbuObjIter *pIter = &p->objiter;
168103 168128   
168104 168129           /* If this is an RBU vacuum operation and the state table was empty
168105 168130           ** when this handle was opened, create the target database schema. */
................................................................................
168533 168558   
168534 168559     return p;
168535 168560   }
168536 168561   
168537 168562   /*
168538 168563   ** Open and return a new RBU handle. 
168539 168564   */
168540         -SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_open(
       168565  +SQLITE_API sqlite3rbu *sqlite3rbu_open(
168541 168566     const char *zTarget, 
168542 168567     const char *zRbu,
168543 168568     const char *zState
168544 168569   ){
168545 168570     /* TODO: Check that zTarget and zRbu are non-NULL */
168546 168571     return openRbuHandle(zTarget, zRbu, zState);
168547 168572   }
168548 168573   
168549 168574   /*
168550 168575   ** Open a handle to begin or resume an RBU VACUUM operation.
168551 168576   */
168552         -SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_vacuum(
       168577  +SQLITE_API sqlite3rbu *sqlite3rbu_vacuum(
168553 168578     const char *zTarget, 
168554 168579     const char *zState
168555 168580   ){
168556 168581     /* TODO: Check that both arguments are non-NULL */
168557 168582     return openRbuHandle(0, zTarget, zState);
168558 168583   }
168559 168584   
168560 168585   /*
168561 168586   ** Return the database handle used by pRbu.
168562 168587   */
168563         -SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3rbu_db(sqlite3rbu *pRbu, int bRbu){
       168588  +SQLITE_API sqlite3 *sqlite3rbu_db(sqlite3rbu *pRbu, int bRbu){
168564 168589     sqlite3 *db = 0;
168565 168590     if( pRbu ){
168566 168591       db = (bRbu ? pRbu->dbRbu : pRbu->dbMain);
168567 168592     }
168568 168593     return db;
168569 168594   }
168570 168595   
................................................................................
168588 168613       }
168589 168614     }
168590 168615   }
168591 168616   
168592 168617   /*
168593 168618   ** Close the RBU handle.
168594 168619   */
168595         -SQLITE_API int SQLITE_STDCALL sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){
       168620  +SQLITE_API int sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){
168596 168621     int rc;
168597 168622     if( p ){
168598 168623   
168599 168624       /* Commit the transaction to the *-oal file. */
168600 168625       if( p->rc==SQLITE_OK && p->eStage==RBU_STAGE_OAL ){
168601 168626         p->rc = sqlite3_exec(p->dbMain, "COMMIT", 0, 0, &p->zErrmsg);
168602 168627       }
................................................................................
168639 168664   }
168640 168665   
168641 168666   /*
168642 168667   ** Return the total number of key-value operations (inserts, deletes or 
168643 168668   ** updates) that have been performed on the target database since the
168644 168669   ** current RBU update was started.
168645 168670   */
168646         -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3rbu_progress(sqlite3rbu *pRbu){
       168671  +SQLITE_API sqlite3_int64 sqlite3rbu_progress(sqlite3rbu *pRbu){
168647 168672     return pRbu->nProgress;
168648 168673   }
168649 168674   
168650 168675   /*
168651 168676   ** Return permyriadage progress indications for the two main stages of
168652 168677   ** an RBU update.
168653 168678   */
168654         -SQLITE_API void SQLITE_STDCALL sqlite3rbu_bp_progress(sqlite3rbu *p, int *pnOne, int *pnTwo){
       168679  +SQLITE_API void sqlite3rbu_bp_progress(sqlite3rbu *p, int *pnOne, int *pnTwo){
168655 168680     const int MAX_PROGRESS = 10000;
168656 168681     switch( p->eStage ){
168657 168682       case RBU_STAGE_OAL:
168658 168683         if( p->nPhaseOneStep>0 ){
168659 168684           *pnOne = (int)(MAX_PROGRESS * (i64)p->nProgress/(i64)p->nPhaseOneStep);
168660 168685         }else{
168661 168686           *pnOne = -1;
................................................................................
168682 168707         assert( 0 );
168683 168708     }
168684 168709   }
168685 168710   
168686 168711   /*
168687 168712   ** Return the current state of the RBU vacuum or update operation.
168688 168713   */
168689         -SQLITE_API int SQLITE_STDCALL sqlite3rbu_state(sqlite3rbu *p){
       168714  +SQLITE_API int sqlite3rbu_state(sqlite3rbu *p){
168690 168715     int aRes[] = {
168691 168716       0, SQLITE_RBU_STATE_OAL, SQLITE_RBU_STATE_MOVE,
168692 168717       0, SQLITE_RBU_STATE_CHECKPOINT, SQLITE_RBU_STATE_DONE
168693 168718     };
168694 168719   
168695 168720     assert( RBU_STAGE_OAL==1 );
168696 168721     assert( RBU_STAGE_MOVE==2 );
................................................................................
168710 168735            || p->eStage==RBU_STAGE_CKPT
168711 168736            || p->eStage==RBU_STAGE_DONE
168712 168737       );
168713 168738       return aRes[p->eStage];
168714 168739     }
168715 168740   }
168716 168741   
168717         -SQLITE_API int SQLITE_STDCALL sqlite3rbu_savestate(sqlite3rbu *p){
       168742  +SQLITE_API int sqlite3rbu_savestate(sqlite3rbu *p){
168718 168743     int rc = p->rc;
168719 168744     if( rc==SQLITE_DONE ) return SQLITE_OK;
168720 168745   
168721 168746     assert( p->eStage>=RBU_STAGE_OAL && p->eStage<=RBU_STAGE_DONE );
168722 168747     if( p->eStage==RBU_STAGE_OAL ){
168723 168748       assert( rc!=SQLITE_DONE );
168724 168749       if( rc==SQLITE_OK ) rc = sqlite3_exec(p->dbMain, "COMMIT", 0, 0, 0);
................................................................................
169537 169562     return 0;
169538 169563   }
169539 169564   
169540 169565   /*
169541 169566   ** Deregister and destroy an RBU vfs created by an earlier call to
169542 169567   ** sqlite3rbu_create_vfs().
169543 169568   */
169544         -SQLITE_API void SQLITE_STDCALL sqlite3rbu_destroy_vfs(const char *zName){
       169569  +SQLITE_API void sqlite3rbu_destroy_vfs(const char *zName){
169545 169570     sqlite3_vfs *pVfs = sqlite3_vfs_find(zName);
169546 169571     if( pVfs && pVfs->xOpen==rbuVfsOpen ){
169547 169572       sqlite3_mutex_free(((rbu_vfs*)pVfs)->mutex);
169548 169573       sqlite3_vfs_unregister(pVfs);
169549 169574       sqlite3_free(pVfs);
169550 169575     }
169551 169576   }
169552 169577   
169553 169578   /*
169554 169579   ** Create an RBU VFS named zName that accesses the underlying file-system
169555 169580   ** via existing VFS zParent. The new object is registered as a non-default
169556 169581   ** VFS with SQLite before returning.
169557 169582   */
169558         -SQLITE_API int SQLITE_STDCALL sqlite3rbu_create_vfs(const char *zName, const char *zParent){
       169583  +SQLITE_API int sqlite3rbu_create_vfs(const char *zName, const char *zParent){
169559 169584   
169560 169585     /* Template for VFS */
169561 169586     static sqlite3_vfs vfs_template = {
169562 169587       1,                            /* iVersion */
169563 169588       0,                            /* szOsFile */
169564 169589       0,                            /* mxPathname */
169565 169590       0,                            /* pNext */
................................................................................
171796 171821         sqlite3_free(zStmt);
171797 171822       }
171798 171823     }
171799 171824   
171800 171825     return rc;
171801 171826   }
171802 171827   
171803         -SQLITE_API int SQLITE_STDCALL sqlite3session_diff(
       171828  +SQLITE_API int sqlite3session_diff(
171804 171829     sqlite3_session *pSession,
171805 171830     const char *zFrom,
171806 171831     const char *zTbl,
171807 171832     char **pzErrMsg
171808 171833   ){
171809 171834     const char *zDb = pSession->zDb;
171810 171835     int rc = pSession->rc;
................................................................................
171890 171915     return rc;
171891 171916   }
171892 171917   
171893 171918   /*
171894 171919   ** Create a session object. This session object will record changes to
171895 171920   ** database zDb attached to connection db.
171896 171921   */
171897         -SQLITE_API int SQLITE_STDCALL sqlite3session_create(
       171922  +SQLITE_API int sqlite3session_create(
171898 171923     sqlite3 *db,                    /* Database handle */
171899 171924     const char *zDb,                /* Name of db (e.g. "main") */
171900 171925     sqlite3_session **ppSession     /* OUT: New session object */
171901 171926   ){
171902 171927     sqlite3_session *pNew;          /* Newly allocated session object */
171903 171928     sqlite3_session *pOld;          /* Session object already attached to db */
171904 171929     int nDb = sqlite3Strlen30(zDb); /* Length of zDb in bytes */
................................................................................
171952 171977       sqlite3_free(pTab);
171953 171978     }
171954 171979   }
171955 171980   
171956 171981   /*
171957 171982   ** Delete a session object previously allocated using sqlite3session_create().
171958 171983   */
171959         -SQLITE_API void SQLITE_STDCALL sqlite3session_delete(sqlite3_session *pSession){
       171984  +SQLITE_API void sqlite3session_delete(sqlite3_session *pSession){
171960 171985     sqlite3 *db = pSession->db;
171961 171986     sqlite3_session *pHead;
171962 171987     sqlite3_session **pp;
171963 171988   
171964 171989     /* Unlink the session from the linked list of sessions attached to the
171965 171990     ** database handle. Hold the db mutex while doing so.  */
171966 171991     sqlite3_mutex_enter(sqlite3_db_mutex(db));
................................................................................
171981 172006     /* Free the session object itself. */
171982 172007     sqlite3_free(pSession);
171983 172008   }
171984 172009   
171985 172010   /*
171986 172011   ** Set a table filter on a Session Object.
171987 172012   */
171988         -SQLITE_API void SQLITE_STDCALL sqlite3session_table_filter(
       172013  +SQLITE_API void sqlite3session_table_filter(
171989 172014     sqlite3_session *pSession, 
171990 172015     int(*xFilter)(void*, const char*),
171991 172016     void *pCtx                      /* First argument passed to xFilter */
171992 172017   ){
171993 172018     pSession->bAutoAttach = 1;
171994 172019     pSession->pFilterCtx = pCtx;
171995 172020     pSession->xTableFilter = xFilter;
................................................................................
171999 172024   ** Attach a table to a session. All subsequent changes made to the table
172000 172025   ** while the session object is enabled will be recorded.
172001 172026   **
172002 172027   ** Only tables that have a PRIMARY KEY defined may be attached. It does
172003 172028   ** not matter if the PRIMARY KEY is an "INTEGER PRIMARY KEY" (rowid alias)
172004 172029   ** or not.
172005 172030   */
172006         -SQLITE_API int SQLITE_STDCALL sqlite3session_attach(
       172031  +SQLITE_API int sqlite3session_attach(
172007 172032     sqlite3_session *pSession,      /* Session object */
172008 172033     const char *zName               /* Table name */
172009 172034   ){
172010 172035     int rc = SQLITE_OK;
172011 172036     sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172012 172037   
172013 172038     if( !zName ){
................................................................................
172689 172714   /*
172690 172715   ** Obtain a changeset object containing all changes recorded by the 
172691 172716   ** session object passed as the first argument.
172692 172717   **
172693 172718   ** It is the responsibility of the caller to eventually free the buffer 
172694 172719   ** using sqlite3_free().
172695 172720   */
172696         -SQLITE_API int SQLITE_STDCALL sqlite3session_changeset(
       172721  +SQLITE_API int sqlite3session_changeset(
172697 172722     sqlite3_session *pSession,      /* Session object */
172698 172723     int *pnChangeset,               /* OUT: Size of buffer at *ppChangeset */
172699 172724     void **ppChangeset              /* OUT: Buffer containing changeset */
172700 172725   ){
172701 172726     return sessionGenerateChangeset(pSession, 0, 0, 0, pnChangeset, ppChangeset);
172702 172727   }
172703 172728   
172704 172729   /*
172705 172730   ** Streaming version of sqlite3session_changeset().
172706 172731   */
172707         -SQLITE_API int SQLITE_STDCALL sqlite3session_changeset_strm(
       172732  +SQLITE_API int sqlite3session_changeset_strm(
172708 172733     sqlite3_session *pSession,
172709 172734     int (*xOutput)(void *pOut, const void *pData, int nData),
172710 172735     void *pOut
172711 172736   ){
172712 172737     return sessionGenerateChangeset(pSession, 0, xOutput, pOut, 0, 0);
172713 172738   }
172714 172739   
172715 172740   /*
172716 172741   ** Streaming version of sqlite3session_patchset().
172717 172742   */
172718         -SQLITE_API int SQLITE_STDCALL sqlite3session_patchset_strm(
       172743  +SQLITE_API int sqlite3session_patchset_strm(
172719 172744     sqlite3_session *pSession,
172720 172745     int (*xOutput)(void *pOut, const void *pData, int nData),
172721 172746     void *pOut
172722 172747   ){
172723 172748     return sessionGenerateChangeset(pSession, 1, xOutput, pOut, 0, 0);
172724 172749   }
172725 172750   
................................................................................
172726 172751   /*
172727 172752   ** Obtain a patchset object containing all changes recorded by the 
172728 172753   ** session object passed as the first argument.
172729 172754   **
172730 172755   ** It is the responsibility of the caller to eventually free the buffer 
172731 172756   ** using sqlite3_free().
172732 172757   */
172733         -SQLITE_API int SQLITE_STDCALL sqlite3session_patchset(
       172758  +SQLITE_API int sqlite3session_patchset(
172734 172759     sqlite3_session *pSession,      /* Session object */
172735 172760     int *pnPatchset,                /* OUT: Size of buffer at *ppChangeset */
172736 172761     void **ppPatchset               /* OUT: Buffer containing changeset */
172737 172762   ){
172738 172763     return sessionGenerateChangeset(pSession, 1, 0, 0, pnPatchset, ppPatchset);
172739 172764   }
172740 172765   
172741 172766   /*
172742 172767   ** Enable or disable the session object passed as the first argument.
172743 172768   */
172744         -SQLITE_API int SQLITE_STDCALL sqlite3session_enable(sqlite3_session *pSession, int bEnable){
       172769  +SQLITE_API int sqlite3session_enable(sqlite3_session *pSession, int bEnable){
172745 172770     int ret;
172746 172771     sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172747 172772     if( bEnable>=0 ){
172748 172773       pSession->bEnable = bEnable;
172749 172774     }
172750 172775     ret = pSession->bEnable;
172751 172776     sqlite3_mutex_leave(sqlite3_db_mutex(pSession->db));
172752 172777     return ret;
172753 172778   }
172754 172779   
172755 172780   /*
172756 172781   ** Enable or disable the session object passed as the first argument.
172757 172782   */
172758         -SQLITE_API int SQLITE_STDCALL sqlite3session_indirect(sqlite3_session *pSession, int bIndirect){
       172783  +SQLITE_API int sqlite3session_indirect(sqlite3_session *pSession, int bIndirect){
172759 172784     int ret;
172760 172785     sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172761 172786     if( bIndirect>=0 ){
172762 172787       pSession->bIndirect = bIndirect;
172763 172788     }
172764 172789     ret = pSession->bIndirect;
172765 172790     sqlite3_mutex_leave(sqlite3_db_mutex(pSession->db));
................................................................................
172766 172791     return ret;
172767 172792   }
172768 172793   
172769 172794   /*
172770 172795   ** Return true if there have been no changes to monitored tables recorded
172771 172796   ** by the session object passed as the only argument.
172772 172797   */
172773         -SQLITE_API int SQLITE_STDCALL sqlite3session_isempty(sqlite3_session *pSession){
       172798  +SQLITE_API int sqlite3session_isempty(sqlite3_session *pSession){
172774 172799     int ret = 0;
172775 172800     SessionTable *pTab;
172776 172801   
172777 172802     sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172778 172803     for(pTab=pSession->pTable; pTab && ret==0; pTab=pTab->pNext){
172779 172804       ret = (pTab->nEntry>0);
172780 172805     }
................................................................................
172816 172841     *pp = pRet;
172817 172842     return SQLITE_OK;
172818 172843   }
172819 172844   
172820 172845   /*
172821 172846   ** Create an iterator used to iterate through the contents of a changeset.
172822 172847   */
172823         -SQLITE_API int SQLITE_STDCALL sqlite3changeset_start(
       172848  +SQLITE_API int sqlite3changeset_start(
172824 172849     sqlite3_changeset_iter **pp,    /* OUT: Changeset iterator handle */
172825 172850     int nChangeset,                 /* Size of buffer pChangeset in bytes */
172826 172851     void *pChangeset                /* Pointer to buffer containing changeset */
172827 172852   ){
172828 172853     return sessionChangesetStart(pp, 0, 0, nChangeset, pChangeset);
172829 172854   }
172830 172855   
172831 172856   /*
172832 172857   ** Streaming version of sqlite3changeset_start().
172833 172858   */
172834         -SQLITE_API int SQLITE_STDCALL sqlite3changeset_start_strm(
       172859  +SQLITE_API int sqlite3changeset_start_strm(
172835 172860     sqlite3_changeset_iter **pp,    /* OUT: Changeset iterator handle */
172836 172861     int (*xInput)(void *pIn, void *pData, int *pnData),
172837 172862     void *pIn
172838 172863   ){
172839 172864     return sessionChangesetStart(pp, xInput, pIn, 0, 0);
172840 172865   }
172841 172866   
................................................................................
173248 173273   ** Advance an iterator created by sqlite3changeset_start() to the next
173249 173274   ** change in the changeset. This function may return SQLITE_ROW, SQLITE_DONE
173250 173275   ** or SQLITE_CORRUPT.
173251 173276   **
173252 173277   ** This function may not be called on iterators passed to a conflict handler
173253 173278   ** callback by changeset_apply().
173254 173279   */
173255         -SQLITE_API int SQLITE_STDCALL sqlite3changeset_next(sqlite3_changeset_iter *p){
       173280  +SQLITE_API int sqlite3changeset_next(sqlite3_changeset_iter *p){
173256 173281     return sessionChangesetNext(p, 0, 0);
173257 173282   }
173258 173283   
173259 173284   /*
173260 173285   ** The following function extracts information on the current change
173261 173286   ** from a changeset iterator. It may only be called after changeset_next()
173262 173287   ** has returned SQLITE_ROW.
173263 173288   */
173264         -SQLITE_API int SQLITE_STDCALL sqlite3changeset_op(
       173289  +SQLITE_API int sqlite3changeset_op(
173265 173290     sqlite3_changeset_iter *pIter,  /* Iterator handle */
173266 173291     const char **pzTab,             /* OUT: Pointer to table name */
173267 173292     int *pnCol,                     /* OUT: Number of columns in table */
173268 173293     int *pOp,                       /* OUT: SQLITE_INSERT, DELETE or UPDATE */
173269 173294     int *pbIndirect                 /* OUT: True if change is indirect */
173270 173295   ){
173271 173296     *pOp = pIter->op;
................................................................................
173277 173302   
173278 173303   /*
173279 173304   ** Return information regarding the PRIMARY KEY and number of columns in
173280 173305   ** the database table affected by the change that pIter currently points
173281 173306   ** to. This function may only be called after changeset_next() returns
173282 173307   ** SQLITE_ROW.
173283 173308   */
173284         -SQLITE_API int SQLITE_STDCALL sqlite3changeset_pk(
       173309  +SQLITE_API int sqlite3changeset_pk(
173285 173310     sqlite3_changeset_iter *pIter,  /* Iterator object */
173286 173311     unsigned char **pabPK,          /* OUT: Array of boolean - true for PK cols */
173287 173312     int *pnCol                      /* OUT: Number of entries in output array */
173288 173313   ){
173289 173314     *pabPK = pIter->abPK;
173290 173315     if( pnCol ) *pnCol = pIter->nCol;
173291 173316     return SQLITE_OK;
................................................................................
173300 173325   ** iVal'th value in the old.* record. Or, if that particular value is not
173301 173326   ** included in the record (because the change is an UPDATE and the field
173302 173327   ** was not modified and is not a PK column), set *ppValue to NULL.
173303 173328   **
173304 173329   ** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is
173305 173330   ** not modified. Otherwise, SQLITE_OK.
173306 173331   */
173307         -SQLITE_API int SQLITE_STDCALL sqlite3changeset_old(
       173332  +SQLITE_API int sqlite3changeset_old(
173308 173333     sqlite3_changeset_iter *pIter,  /* Changeset iterator */
173309 173334     int iVal,                       /* Index of old.* value to retrieve */
173310 173335     sqlite3_value **ppValue         /* OUT: Old value (or NULL pointer) */
173311 173336   ){
173312 173337     if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_DELETE ){
173313 173338       return SQLITE_MISUSE;
173314 173339     }
................................................................................
173328 173353   ** iVal'th value in the new.* record. Or, if that particular value is not
173329 173354   ** included in the record (because the change is an UPDATE and the field
173330 173355   ** was not modified), set *ppValue to NULL.
173331 173356   **
173332 173357   ** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is
173333 173358   ** not modified. Otherwise, SQLITE_OK.
173334 173359   */
173335         -SQLITE_API int SQLITE_STDCALL sqlite3changeset_new(
       173360  +SQLITE_API int sqlite3changeset_new(
173336 173361     sqlite3_changeset_iter *pIter,  /* Changeset iterator */
173337 173362     int iVal,                       /* Index of new.* value to retrieve */
173338 173363     sqlite3_value **ppValue         /* OUT: New value (or NULL pointer) */
173339 173364   ){
173340 173365     if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_INSERT ){
173341 173366       return SQLITE_MISUSE;
173342 173367     }
................................................................................
173362 173387   **
173363 173388   ** If successful, *ppValue is set to point to an sqlite3_value structure
173364 173389   ** containing the iVal'th value of the conflicting record.
173365 173390   **
173366 173391   ** If value iVal is out-of-range or some other error occurs, an SQLite error
173367 173392   ** code is returned. Otherwise, SQLITE_OK.
173368 173393   */
173369         -SQLITE_API int SQLITE_STDCALL sqlite3changeset_conflict(
       173394  +SQLITE_API int sqlite3changeset_conflict(
173370 173395     sqlite3_changeset_iter *pIter,  /* Changeset iterator */
173371 173396     int iVal,                       /* Index of conflict record value to fetch */
173372 173397     sqlite3_value **ppValue         /* OUT: Value from conflicting row */
173373 173398   ){
173374 173399     if( !pIter->pConflict ){
173375 173400       return SQLITE_MISUSE;
173376 173401     }
................................................................................
173385 173410   ** This function may only be called with an iterator passed to an
173386 173411   ** SQLITE_CHANGESET_FOREIGN_KEY conflict handler callback. In this case
173387 173412   ** it sets the output variable to the total number of known foreign key
173388 173413   ** violations in the destination database and returns SQLITE_OK.
173389 173414   **
173390 173415   ** In all other cases this function returns SQLITE_MISUSE.
173391 173416   */
173392         -SQLITE_API int SQLITE_STDCALL sqlite3changeset_fk_conflicts(
       173417  +SQLITE_API int sqlite3changeset_fk_conflicts(
173393 173418     sqlite3_changeset_iter *pIter,  /* Changeset iterator */
173394 173419     int *pnOut                      /* OUT: Number of FK violations */
173395 173420   ){
173396 173421     if( pIter->pConflict || pIter->apValue ){
173397 173422       return SQLITE_MISUSE;
173398 173423     }
173399 173424     *pnOut = pIter->nCol;
................................................................................
173403 173428   
173404 173429   /*
173405 173430   ** Finalize an iterator allocated with sqlite3changeset_start().
173406 173431   **
173407 173432   ** This function may not be called on iterators passed to a conflict handler
173408 173433   ** callback by changeset_apply().
173409 173434   */
173410         -SQLITE_API int SQLITE_STDCALL sqlite3changeset_finalize(sqlite3_changeset_iter *p){
       173435  +SQLITE_API int sqlite3changeset_finalize(sqlite3_changeset_iter *p){
173411 173436     int rc = SQLITE_OK;
173412 173437     if( p ){
173413 173438       int i;                        /* Used to iterate through p->apValue[] */
173414 173439       rc = p->rc;
173415 173440       if( p->apValue ){
173416 173441         for(i=0; i<p->nCol*2; i++) sqlite3ValueFree(p->apValue[i]);
173417 173442       }
................................................................................
173577 173602     return rc;
173578 173603   }
173579 173604   
173580 173605   
173581 173606   /*
173582 173607   ** Invert a changeset object.
173583 173608   */
173584         -SQLITE_API int SQLITE_STDCALL sqlite3changeset_invert(
       173609  +SQLITE_API int sqlite3changeset_invert(
173585 173610     int nChangeset,                 /* Number of bytes in input */
173586 173611     const void *pChangeset,         /* Input changeset */
173587 173612     int *pnInverted,                /* OUT: Number of bytes in output changeset */
173588 173613     void **ppInverted               /* OUT: Inverse of pChangeset */
173589 173614   ){
173590 173615     SessionInput sInput;
173591 173616   
................................................................................
173596 173621   
173597 173622     return sessionChangesetInvert(&sInput, 0, 0, pnInverted, ppInverted);
173598 173623   }
173599 173624   
173600 173625   /*
173601 173626   ** Streaming version of sqlite3changeset_invert().
173602 173627   */
173603         -SQLITE_API int SQLITE_STDCALL sqlite3changeset_invert_strm(
       173628  +SQLITE_API int sqlite3changeset_invert_strm(
173604 173629     int (*xInput)(void *pIn, void *pData, int *pnData),
173605 173630     void *pIn,
173606 173631     int (*xOutput)(void *pOut, const void *pData, int nData),
173607 173632     void *pOut
173608 173633   ){
173609 173634     SessionInput sInput;
173610 173635     int rc;
................................................................................
174476 174501   }
174477 174502   
174478 174503   /*
174479 174504   ** Apply the changeset passed via pChangeset/nChangeset to the main database
174480 174505   ** attached to handle "db". Invoke the supplied conflict handler callback
174481 174506   ** to resolve any conflicts encountered while applying the change.
174482 174507   */
174483         -SQLITE_API int SQLITE_STDCALL sqlite3changeset_apply(
       174508  +SQLITE_API int sqlite3changeset_apply(
174484 174509     sqlite3 *db,                    /* Apply change to "main" db of this handle */
174485 174510     int nChangeset,                 /* Size of changeset in bytes */
174486 174511     void *pChangeset,               /* Changeset blob */
174487 174512     int(*xFilter)(
174488 174513       void *pCtx,                   /* Copy of sixth arg to _apply() */
174489 174514       const char *zTab              /* Table name */
174490 174515     ),
................................................................................
174504 174529   }
174505 174530   
174506 174531   /*
174507 174532   ** Apply the changeset passed via xInput/pIn to the main database
174508 174533   ** attached to handle "db". Invoke the supplied conflict handler callback
174509 174534   ** to resolve any conflicts encountered while applying the change.
174510 174535   */
174511         -SQLITE_API int SQLITE_STDCALL sqlite3changeset_apply_strm(
       174536  +SQLITE_API int sqlite3changeset_apply_strm(
174512 174537     sqlite3 *db,                    /* Apply change to "main" db of this handle */
174513 174538     int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
174514 174539     void *pIn,                                          /* First arg for xInput */
174515 174540     int(*xFilter)(
174516 174541       void *pCtx,                   /* Copy of sixth arg to _apply() */
174517 174542       const char *zTab              /* Table name */
174518 174543     ),
................................................................................
174839 174864   
174840 174865     return rc;
174841 174866   }
174842 174867   
174843 174868   /*
174844 174869   ** Allocate a new, empty, sqlite3_changegroup.
174845 174870   */
174846         -SQLITE_API int SQLITE_STDCALL sqlite3changegroup_new(sqlite3_changegroup **pp){
       174871  +SQLITE_API int sqlite3changegroup_new(sqlite3_changegroup **pp){
174847 174872     int rc = SQLITE_OK;             /* Return code */
174848 174873     sqlite3_changegroup *p;         /* New object */
174849 174874     p = (sqlite3_changegroup*)sqlite3_malloc(sizeof(sqlite3_changegroup));
174850 174875     if( p==0 ){
174851 174876       rc = SQLITE_NOMEM;
174852 174877     }else{
174853 174878       memset(p, 0, sizeof(sqlite3_changegroup));
................................................................................
174856 174881     return rc;
174857 174882   }
174858 174883   
174859 174884   /*
174860 174885   ** Add the changeset currently stored in buffer pData, size nData bytes,
174861 174886   ** to changeset-group p.
174862 174887   */
174863         -SQLITE_API int SQLITE_STDCALL sqlite3changegroup_add(sqlite3_changegroup *pGrp, int nData, void *pData){
       174888  +SQLITE_API int sqlite3changegroup_add(sqlite3_changegroup *pGrp, int nData, void *pData){
174864 174889     sqlite3_changeset_iter *pIter;  /* Iterator opened on pData/nData */
174865 174890     int rc;                         /* Return code */
174866 174891   
174867 174892     rc = sqlite3changeset_start(&pIter, nData, pData);
174868 174893     if( rc==SQLITE_OK ){
174869 174894       rc = sessionChangesetToHash(pIter, pGrp);
174870 174895     }
................................................................................
174872 174897     return rc;
174873 174898   }
174874 174899   
174875 174900   /*
174876 174901   ** Obtain a buffer containing a changeset representing the concatenation
174877 174902   ** of all changesets added to the group so far.
174878 174903   */
174879         -SQLITE_API int SQLITE_STDCALL sqlite3changegroup_output(
       174904  +SQLITE_API int sqlite3changegroup_output(
174880 174905       sqlite3_changegroup *pGrp,
174881 174906       int *pnData,
174882 174907       void **ppData
174883 174908   ){
174884 174909     return sessionChangegroupOutput(pGrp, 0, 0, pnData, ppData);
174885 174910   }
174886 174911   
174887 174912   /*
174888 174913   ** Streaming versions of changegroup_add().
174889 174914   */
174890         -SQLITE_API int SQLITE_STDCALL sqlite3changegroup_add_strm(
       174915  +SQLITE_API int sqlite3changegroup_add_strm(
174891 174916     sqlite3_changegroup *pGrp,
174892 174917     int (*xInput)(void *pIn, void *pData, int *pnData),
174893 174918     void *pIn
174894 174919   ){
174895 174920     sqlite3_changeset_iter *pIter;  /* Iterator opened on pData/nData */
174896 174921     int rc;                         /* Return code */
174897 174922   
................................................................................
174902 174927     sqlite3changeset_finalize(pIter);
174903 174928     return rc;
174904 174929   }
174905 174930   
174906 174931   /*
174907 174932   ** Streaming versions of changegroup_output().
174908 174933   */
174909         -SQLITE_API int SQLITE_STDCALL sqlite3changegroup_output_strm(
       174934  +SQLITE_API int sqlite3changegroup_output_strm(
174910 174935     sqlite3_changegroup *pGrp,
174911 174936     int (*xOutput)(void *pOut, const void *pData, int nData), 
174912 174937     void *pOut
174913 174938   ){
174914 174939     return sessionChangegroupOutput(pGrp, xOutput, pOut, 0, 0);
174915 174940   }
174916 174941   
174917 174942   /*
174918 174943   ** Delete a changegroup object.
174919 174944   */
174920         -SQLITE_API void SQLITE_STDCALL sqlite3changegroup_delete(sqlite3_changegroup *pGrp){
       174945  +SQLITE_API void sqlite3changegroup_delete(sqlite3_changegroup *pGrp){
174921 174946     if( pGrp ){
174922 174947       sessionDeleteTable(pGrp->pList);
174923 174948       sqlite3_free(pGrp);
174924 174949     }
174925 174950   }
174926 174951   
174927 174952   /* 
174928 174953   ** Combine two changesets together.
174929 174954   */
174930         -SQLITE_API int SQLITE_STDCALL sqlite3changeset_concat(
       174955  +SQLITE_API int sqlite3changeset_concat(
174931 174956     int nLeft,                      /* Number of bytes in lhs input */
174932 174957     void *pLeft,                    /* Lhs input changeset */
174933 174958     int nRight                      /* Number of bytes in rhs input */,
174934 174959     void *pRight,                   /* Rhs input changeset */
174935 174960     int *pnOut,                     /* OUT: Number of bytes in output changeset */
174936 174961     void **ppOut                    /* OUT: changeset (left <concat> right) */
174937 174962   ){
................................................................................
174952 174977   
174953 174978     return rc;
174954 174979   }
174955 174980   
174956 174981   /*
174957 174982   ** Streaming version of sqlite3changeset_concat().
174958 174983   */
174959         -SQLITE_API int SQLITE_STDCALL sqlite3changeset_concat_strm(
       174984  +SQLITE_API int sqlite3changeset_concat_strm(
174960 174985     int (*xInputA)(void *pIn, void *pData, int *pnData),
174961 174986     void *pInA,
174962 174987     int (*xInputB)(void *pIn, void *pData, int *pnData),
174963 174988     void *pInB,
174964 174989     int (*xOutput)(void *pOut, const void *pData, int nData),
174965 174990     void *pOut
174966 174991   ){
................................................................................
177184 177209   }
177185 177210   
177186 177211   
177187 177212   #ifndef SQLITE_CORE
177188 177213   #ifdef _WIN32
177189 177214   __declspec(dllexport)
177190 177215   #endif
177191         -SQLITE_API int SQLITE_STDCALL sqlite3_json_init(
       177216  +SQLITE_API int sqlite3_json_init(
177192 177217     sqlite3 *db, 
177193 177218     char **pzErrMsg, 
177194 177219     const sqlite3_api_routines *pApi
177195 177220   ){
177196 177221     SQLITE_EXTENSION_INIT2(pApi);
177197 177222     (void)pzErrMsg;  /* Unused parameter */
177198 177223     return sqlite3Json1Init(db);
................................................................................
194016 194041   static void fts5SourceIdFunc(
194017 194042     sqlite3_context *pCtx,          /* Function call context */
194018 194043     int nArg,                       /* Number of args */
194019 194044     sqlite3_value **apUnused        /* Function arguments */
194020 194045   ){
194021 194046     assert( nArg==0 );
194022 194047     UNUSED_PARAM2(nArg, apUnused);
194023         -  sqlite3_result_text(pCtx, "fts5: 2016-08-11 18:53:32 a12d8059770df4bca59e321c266410344242bf7b", -1, SQLITE_TRANSIENT);
       194048  +  sqlite3_result_text(pCtx, "fts5: 2016-09-08 23:18:34 a04a21ad5aa1a56d50388d6cdb88bae754218a0a", -1, SQLITE_TRANSIENT);
194024 194049   }
194025 194050   
194026 194051   static int fts5Init(sqlite3 *db){
194027 194052     static const sqlite3_module fts5Mod = {
194028 194053       /* iVersion      */ 2,
194029 194054       /* xCreate       */ fts5CreateMethod,
194030 194055       /* xConnect      */ fts5ConnectMethod,
................................................................................
194104 194129   ** sqlite3Fts5Init() is omitted and the two standard entry points
194105 194130   ** sqlite3_fts_init() and sqlite3_fts5_init() defined instead.
194106 194131   */
194107 194132   #ifndef SQLITE_CORE
194108 194133   #ifdef _WIN32
194109 194134   __declspec(dllexport)
194110 194135   #endif
194111         -SQLITE_API int SQLITE_STDCALL sqlite3_fts_init(
       194136  +SQLITE_API int sqlite3_fts_init(
194112 194137     sqlite3 *db,
194113 194138     char **pzErrMsg,
194114 194139     const sqlite3_api_routines *pApi
194115 194140   ){
194116 194141     SQLITE_EXTENSION_INIT2(pApi);
194117 194142     (void)pzErrMsg;  /* Unused parameter */
194118 194143     return fts5Init(db);
194119 194144   }
194120 194145   
194121 194146   #ifdef _WIN32
194122 194147   __declspec(dllexport)
194123 194148   #endif
194124         -SQLITE_API int SQLITE_STDCALL sqlite3_fts5_init(
       194149  +SQLITE_API int sqlite3_fts5_init(
194125 194150     sqlite3 *db,
194126 194151     char **pzErrMsg,
194127 194152     const sqlite3_api_routines *pApi
194128 194153   ){
194129 194154     SQLITE_EXTENSION_INIT2(pApi);
194130 194155     (void)pzErrMsg;  /* Unused parameter */
194131 194156     return fts5Init(db);

Changes to SQLite.Interop/src/core/sqlite3.h.

   116    116   ** string contains the date and time of the check-in (UTC) and an SHA1
   117    117   ** hash of the entire source tree.
   118    118   **
   119    119   ** See also: [sqlite3_libversion()],
   120    120   ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
   121    121   ** [sqlite_version()] and [sqlite_source_id()].
   122    122   */
   123         -#define SQLITE_VERSION        "3.14.1"
   124         -#define SQLITE_VERSION_NUMBER 3014001
   125         -#define SQLITE_SOURCE_ID      "2016-08-11 18:53:32 a12d8059770df4bca59e321c266410344242bf7b"
          123  +#define SQLITE_VERSION        "3.14.2"
          124  +#define SQLITE_VERSION_NUMBER 3014002
          125  +#define SQLITE_SOURCE_ID      "2016-09-08 23:18:34 a04a21ad5aa1a56d50388d6cdb88bae754218a0a"
   126    126   
   127    127   /*
   128    128   ** CAPI3REF: Run-Time Library Version Numbers
   129    129   ** KEYWORDS: sqlite3_version, sqlite3_sourceid
   130    130   **
   131    131   ** These interfaces provide the same information as the [SQLITE_VERSION],
   132    132   ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
................................................................................
   151    151   ** [SQLITE_VERSION_NUMBER].  ^The sqlite3_sourceid() function returns 
   152    152   ** a pointer to a string constant whose value is the same as the 
   153    153   ** [SQLITE_SOURCE_ID] C preprocessor macro.
   154    154   **
   155    155   ** See also: [sqlite_version()] and [sqlite_source_id()].
   156    156   */
   157    157   SQLITE_API SQLITE_EXTERN const char sqlite3_version[];
   158         -SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void);
   159         -SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void);
   160         -SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void);
          158  +SQLITE_API const char *sqlite3_libversion(void);
          159  +SQLITE_API const char *sqlite3_sourceid(void);
          160  +SQLITE_API int sqlite3_libversion_number(void);
   161    161   
   162    162   /*
   163    163   ** CAPI3REF: Run-Time Library Compilation Options Diagnostics
   164    164   **
   165    165   ** ^The sqlite3_compileoption_used() function returns 0 or 1 
   166    166   ** indicating whether the specified option was defined at 
   167    167   ** compile time.  ^The SQLITE_ prefix may be omitted from the 
................................................................................
   178    178   ** and sqlite3_compileoption_get() may be omitted by specifying the 
   179    179   ** [SQLITE_OMIT_COMPILEOPTION_DIAGS] option at compile time.
   180    180   **
   181    181   ** See also: SQL functions [sqlite_compileoption_used()] and
   182    182   ** [sqlite_compileoption_get()] and the [compile_options pragma].
   183    183   */
   184    184   #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
   185         -SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName);
   186         -SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N);
          185  +SQLITE_API int sqlite3_compileoption_used(const char *zOptName);
          186  +SQLITE_API const char *sqlite3_compileoption_get(int N);
   187    187   #endif
   188    188   
   189    189   /*
   190    190   ** CAPI3REF: Test To See If The Library Is Threadsafe
   191    191   **
   192    192   ** ^The sqlite3_threadsafe() function returns zero if and only if
   193    193   ** SQLite was compiled with mutexing code omitted due to the
................................................................................
   218    218   ** sqlite3_threadsafe() function shows only the compile-time setting of
   219    219   ** thread safety, not any run-time changes to that setting made by
   220    220   ** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
   221    221   ** is unchanged by calls to sqlite3_config().)^
   222    222   **
   223    223   ** See the [threading mode] documentation for additional information.
   224    224   */
   225         -SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void);
          225  +SQLITE_API int sqlite3_threadsafe(void);
   226    226   
   227    227   /*
   228    228   ** CAPI3REF: Database Connection Handle
   229    229   ** KEYWORDS: {database connection} {database connections}
   230    230   **
   231    231   ** Each open SQLite database is represented by a pointer to an instance of
   232    232   ** the opaque structure named "sqlite3".  It is useful to think of an sqlite3
................................................................................
   315    315   ** must be either a NULL
   316    316   ** pointer or an [sqlite3] object pointer obtained
   317    317   ** from [sqlite3_open()], [sqlite3_open16()], or
   318    318   ** [sqlite3_open_v2()], and not previously closed.
   319    319   ** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
   320    320   ** argument is a harmless no-op.
   321    321   */
   322         -SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3*);
   323         -SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3*);
          322  +SQLITE_API int sqlite3_close(sqlite3*);
          323  +SQLITE_API int sqlite3_close_v2(sqlite3*);
   324    324   
   325    325   /*
   326    326   ** The type for a callback function.
   327    327   ** This is legacy and deprecated.  It is included for historical
   328    328   ** compatibility and is not documented.
   329    329   */
   330    330   typedef int (*sqlite3_callback)(void*,int,char**, char**);
................................................................................
   387    387   **      is a valid and open [database connection].
   388    388   ** <li> The application must not close the [database connection] specified by
   389    389   **      the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
   390    390   ** <li> The application must not modify the SQL statement text passed into
   391    391   **      the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
   392    392   ** </ul>
   393    393   */
   394         -SQLITE_API int SQLITE_STDCALL sqlite3_exec(
          394  +SQLITE_API int sqlite3_exec(
   395    395     sqlite3*,                                  /* An open database */
   396    396     const char *sql,                           /* SQL to be evaluated */
   397    397     int (*callback)(void*,int,char**,char**),  /* Callback function */
   398    398     void *,                                    /* 1st argument to callback */
   399    399     char **errmsg                              /* Error msg written here */
   400    400   );
   401    401   
................................................................................
  1386   1386   ** (using the [SQLITE_OS_OTHER=1] compile-time
  1387   1387   ** option) the application must supply a suitable implementation for
  1388   1388   ** sqlite3_os_init() and sqlite3_os_end().  An application-supplied
  1389   1389   ** implementation of sqlite3_os_init() or sqlite3_os_end()
  1390   1390   ** must return [SQLITE_OK] on success and some other [error code] upon
  1391   1391   ** failure.
  1392   1392   */
  1393         -SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void);
  1394         -SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void);
  1395         -SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void);
  1396         -SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void);
         1393  +SQLITE_API int sqlite3_initialize(void);
         1394  +SQLITE_API int sqlite3_shutdown(void);
         1395  +SQLITE_API int sqlite3_os_init(void);
         1396  +SQLITE_API int sqlite3_os_end(void);
  1397   1397   
  1398   1398   /*
  1399   1399   ** CAPI3REF: Configuring The SQLite Library
  1400   1400   **
  1401   1401   ** The sqlite3_config() interface is used to make global configuration
  1402   1402   ** changes to SQLite in order to tune SQLite to the specific needs of
  1403   1403   ** the application.  The default configuration is recommended for most
................................................................................
  1422   1422   ** vary depending on the [configuration option]
  1423   1423   ** in the first argument.
  1424   1424   **
  1425   1425   ** ^When a configuration option is set, sqlite3_config() returns [SQLITE_OK].
  1426   1426   ** ^If the option is unknown or SQLite is unable to set the option
  1427   1427   ** then this routine returns a non-zero [error code].
  1428   1428   */
  1429         -SQLITE_API int SQLITE_CDECL sqlite3_config(int, ...);
         1429  +SQLITE_API int sqlite3_config(int, ...);
  1430   1430   
  1431   1431   /*
  1432   1432   ** CAPI3REF: Configure database connections
  1433   1433   ** METHOD: sqlite3
  1434   1434   **
  1435   1435   ** The sqlite3_db_config() interface is used to make configuration
  1436   1436   ** changes to a [database connection].  The interface is similar to
................................................................................
  1441   1441   ** [SQLITE_DBCONFIG_LOOKASIDE | configuration verb] - an integer code 
  1442   1442   ** that indicates what aspect of the [database connection] is being configured.
  1443   1443   ** Subsequent arguments vary depending on the configuration verb.
  1444   1444   **
  1445   1445   ** ^Calls to sqlite3_db_config() return SQLITE_OK if and only if
  1446   1446   ** the call is considered successful.
  1447   1447   */
  1448         -SQLITE_API int SQLITE_CDECL sqlite3_db_config(sqlite3*, int op, ...);
         1448  +SQLITE_API int sqlite3_db_config(sqlite3*, int op, ...);
  1449   1449   
  1450   1450   /*
  1451   1451   ** CAPI3REF: Memory Allocation Routines
  1452   1452   **
  1453   1453   ** An instance of this object defines the interface between SQLite
  1454   1454   ** and low-level memory allocation routines.
  1455   1455   **
................................................................................
  1982   1982   ** CAPI3REF: Enable Or Disable Extended Result Codes
  1983   1983   ** METHOD: sqlite3
  1984   1984   **
  1985   1985   ** ^The sqlite3_extended_result_codes() routine enables or disables the
  1986   1986   ** [extended result codes] feature of SQLite. ^The extended result
  1987   1987   ** codes are disabled by default for historical compatibility.
  1988   1988   */
  1989         -SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3*, int onoff);
         1989  +SQLITE_API int sqlite3_extended_result_codes(sqlite3*, int onoff);
  1990   1990   
  1991   1991   /*
  1992   1992   ** CAPI3REF: Last Insert Rowid
  1993   1993   ** METHOD: sqlite3
  1994   1994   **
  1995   1995   ** ^Each entry in most SQLite tables (except for [WITHOUT ROWID] tables)
  1996   1996   ** has a unique 64-bit signed
................................................................................
  2034   2034   ** If a separate thread performs a new [INSERT] on the same
  2035   2035   ** database connection while the [sqlite3_last_insert_rowid()]
  2036   2036   ** function is running and thus changes the last insert [rowid],
  2037   2037   ** then the value returned by [sqlite3_last_insert_rowid()] is
  2038   2038   ** unpredictable and might not equal either the old or the new
  2039   2039   ** last insert [rowid].
  2040   2040   */
  2041         -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3*);
         2041  +SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*);
  2042   2042   
  2043   2043   /*
  2044   2044   ** CAPI3REF: Count The Number Of Rows Modified
  2045   2045   ** METHOD: sqlite3
  2046   2046   **
  2047   2047   ** ^This function returns the number of rows modified, inserted or
  2048   2048   ** deleted by the most recently completed INSERT, UPDATE or DELETE
................................................................................
  2087   2087   ** See also the [sqlite3_total_changes()] interface, the
  2088   2088   ** [count_changes pragma], and the [changes() SQL function].
  2089   2089   **
  2090   2090   ** If a separate thread makes changes on the same database connection
  2091   2091   ** while [sqlite3_changes()] is running then the value returned
  2092   2092   ** is unpredictable and not meaningful.
  2093   2093   */
  2094         -SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3*);
         2094  +SQLITE_API int sqlite3_changes(sqlite3*);
  2095   2095   
  2096   2096   /*
  2097   2097   ** CAPI3REF: Total Number Of Rows Modified
  2098   2098   ** METHOD: sqlite3
  2099   2099   **
  2100   2100   ** ^This function returns the total number of rows inserted, modified or
  2101   2101   ** deleted by all [INSERT], [UPDATE] or [DELETE] statements completed
................................................................................
  2111   2111   ** See also the [sqlite3_changes()] interface, the
  2112   2112   ** [count_changes pragma], and the [total_changes() SQL function].
  2113   2113   **
  2114   2114   ** If a separate thread makes changes on the same database connection
  2115   2115   ** while [sqlite3_total_changes()] is running then the value
  2116   2116   ** returned is unpredictable and not meaningful.
  2117   2117   */
  2118         -SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3*);
         2118  +SQLITE_API int sqlite3_total_changes(sqlite3*);
  2119   2119   
  2120   2120   /*
  2121   2121   ** CAPI3REF: Interrupt A Long-Running Query
  2122   2122   ** METHOD: sqlite3
  2123   2123   **
  2124   2124   ** ^This function causes any pending database operation to abort and
  2125   2125   ** return at its earliest opportunity. This routine is typically
................................................................................
  2151   2151   ** ^A call to sqlite3_interrupt(D) that occurs when there are no running
  2152   2152   ** SQL statements is a no-op and has no effect on SQL statements
  2153   2153   ** that are started after the sqlite3_interrupt() call returns.
  2154   2154   **
  2155   2155   ** If the database connection closes while [sqlite3_interrupt()]
  2156   2156   ** is running then bad things will likely happen.
  2157   2157   */
  2158         -SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3*);
         2158  +SQLITE_API void sqlite3_interrupt(sqlite3*);
  2159   2159   
  2160   2160   /*
  2161   2161   ** CAPI3REF: Determine If An SQL Statement Is Complete
  2162   2162   **
  2163   2163   ** These routines are useful during command-line input to determine if the
  2164   2164   ** currently entered text seems to form a complete SQL statement or
  2165   2165   ** if additional input is needed before sending the text into
................................................................................
  2186   2186   **
  2187   2187   ** The input to [sqlite3_complete()] must be a zero-terminated
  2188   2188   ** UTF-8 string.
  2189   2189   **
  2190   2190   ** The input to [sqlite3_complete16()] must be a zero-terminated
  2191   2191   ** UTF-16 string in native byte order.
  2192   2192   */
  2193         -SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *sql);
  2194         -SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *sql);
         2193  +SQLITE_API int sqlite3_complete(const char *sql);
         2194  +SQLITE_API int sqlite3_complete16(const void *sql);
  2195   2195   
  2196   2196   /*
  2197   2197   ** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
  2198   2198   ** KEYWORDS: {busy-handler callback} {busy handler}
  2199   2199   ** METHOD: sqlite3
  2200   2200   **
  2201   2201   ** ^The sqlite3_busy_handler(D,X,P) routine sets a callback function X
................................................................................
  2248   2248   ** database connection that invoked the busy handler.  In other words,
  2249   2249   ** the busy handler is not reentrant.  Any such actions
  2250   2250   ** result in undefined behavior.
  2251   2251   ** 
  2252   2252   ** A busy handler must not close the database connection
  2253   2253   ** or [prepared statement] that invoked the busy handler.
  2254   2254   */
  2255         -SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(sqlite3*,int(*)(void*,int),void*);
         2255  +SQLITE_API int sqlite3_busy_handler(sqlite3*,int(*)(void*,int),void*);
  2256   2256   
  2257   2257   /*
  2258   2258   ** CAPI3REF: Set A Busy Timeout
  2259   2259   ** METHOD: sqlite3
  2260   2260   **
  2261   2261   ** ^This routine sets a [sqlite3_busy_handler | busy handler] that sleeps
  2262   2262   ** for a specified amount of time when a table is locked.  ^The handler
................................................................................
  2271   2271   ** ^(There can only be a single busy handler for a particular
  2272   2272   ** [database connection] at any given moment.  If another busy handler
  2273   2273   ** was defined  (using [sqlite3_busy_handler()]) prior to calling
  2274   2274   ** this routine, that other busy handler is cleared.)^
  2275   2275   **
  2276   2276   ** See also:  [PRAGMA busy_timeout]
  2277   2277   */
  2278         -SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3*, int ms);
         2278  +SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms);
  2279   2279   
  2280   2280   /*
  2281   2281   ** CAPI3REF: Convenience Routines For Running Queries
  2282   2282   ** METHOD: sqlite3
  2283   2283   **
  2284   2284   ** This is a legacy interface that is preserved for backwards compatibility.
  2285   2285   ** Use of this interface is not recommended.
................................................................................
  2346   2346   ** [sqlite3_exec()].  The sqlite3_get_table() routine does not have access
  2347   2347   ** to any internal data structures of SQLite.  It uses only the public
  2348   2348   ** interface defined here.  As a consequence, errors that occur in the
  2349   2349   ** wrapper layer outside of the internal [sqlite3_exec()] call are not
  2350   2350   ** reflected in subsequent calls to [sqlite3_errcode()] or
  2351   2351   ** [sqlite3_errmsg()].
  2352   2352   */
  2353         -SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
         2353  +SQLITE_API int sqlite3_get_table(
  2354   2354     sqlite3 *db,          /* An open database */
  2355   2355     const char *zSql,     /* SQL to be evaluated */
  2356   2356     char ***pazResult,    /* Results of the query */
  2357   2357     int *pnRow,           /* Number of result rows written here */
  2358   2358     int *pnColumn,        /* Number of result columns written here */
  2359   2359     char **pzErrmsg       /* Error msg written here */
  2360   2360   );
  2361         -SQLITE_API void SQLITE_STDCALL sqlite3_free_table(char **result);
         2361  +SQLITE_API void sqlite3_free_table(char **result);
  2362   2362   
  2363   2363   /*
  2364   2364   ** CAPI3REF: Formatted String Printing Functions
  2365   2365   **
  2366   2366   ** These routines are work-alikes of the "printf()" family of functions
  2367   2367   ** from the standard C library.
  2368   2368   ** These routines understand most of the common K&R formatting options,
................................................................................
  2460   2460   ** character.)^  The "%w" formatting option is intended for safely inserting
  2461   2461   ** table and column names into a constructed SQL statement.
  2462   2462   **
  2463   2463   ** ^(The "%z" formatting option works like "%s" but with the
  2464   2464   ** addition that after the string has been read and copied into
  2465   2465   ** the result, [sqlite3_free()] is called on the input string.)^
  2466   2466   */
  2467         -SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...);
  2468         -SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list);
  2469         -SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...);
  2470         -SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list);
         2467  +SQLITE_API char *sqlite3_mprintf(const char*,...);
         2468  +SQLITE_API char *sqlite3_vmprintf(const char*, va_list);
         2469  +SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...);
         2470  +SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);
  2471   2471   
  2472   2472   /*
  2473   2473   ** CAPI3REF: Memory Allocation Subsystem
  2474   2474   **
  2475   2475   ** The SQLite core uses these three routines for all of its own
  2476   2476   ** internal memory allocation needs. "Core" in the previous sentence
  2477   2477   ** does not include operating-system specific VFS implementation.  The
................................................................................
  2553   2553   ** invocation of [sqlite3_malloc()] or [sqlite3_realloc()] that have
  2554   2554   ** not yet been released.
  2555   2555   **
  2556   2556   ** The application must not read or write any part of
  2557   2557   ** a block of memory after it has been released using
  2558   2558   ** [sqlite3_free()] or [sqlite3_realloc()].
  2559   2559   */
  2560         -SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int);
  2561         -SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64);
  2562         -SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void*, int);
  2563         -SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void*, sqlite3_uint64);
  2564         -SQLITE_API void SQLITE_STDCALL sqlite3_free(void*);
  2565         -SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void*);
         2560  +SQLITE_API void *sqlite3_malloc(int);
         2561  +SQLITE_API void *sqlite3_malloc64(sqlite3_uint64);
         2562  +SQLITE_API void *sqlite3_realloc(void*, int);
         2563  +SQLITE_API void *sqlite3_realloc64(void*, sqlite3_uint64);
         2564  +SQLITE_API void sqlite3_free(void*);
         2565  +SQLITE_API sqlite3_uint64 sqlite3_msize(void*);
  2566   2566   
  2567   2567   /*
  2568   2568   ** CAPI3REF: Memory Allocator Statistics
  2569   2569   **
  2570   2570   ** SQLite provides these two interfaces for reporting on the status
  2571   2571   ** of the [sqlite3_malloc()], [sqlite3_free()], and [sqlite3_realloc()]
  2572   2572   ** routines, which form the built-in memory allocation subsystem.
................................................................................
  2583   2583   **
  2584   2584   ** ^The memory high-water mark is reset to the current value of
  2585   2585   ** [sqlite3_memory_used()] if and only if the parameter to
  2586   2586   ** [sqlite3_memory_highwater()] is true.  ^The value returned
  2587   2587   ** by [sqlite3_memory_highwater(1)] is the high-water mark
  2588   2588   ** prior to the reset.
  2589   2589   */
  2590         -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void);
  2591         -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag);
         2590  +SQLITE_API sqlite3_int64 sqlite3_memory_used(void);
         2591  +SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int resetFlag);
  2592   2592   
  2593   2593   /*
  2594   2594   ** CAPI3REF: Pseudo-Random Number Generator
  2595   2595   **
  2596   2596   ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
  2597   2597   ** select random [ROWID | ROWIDs] when inserting new records into a table that
  2598   2598   ** already uses the largest possible [ROWID].  The PRNG is also used for
................................................................................
  2607   2607   ** seeded using randomness obtained from the xRandomness method of
  2608   2608   ** the default [sqlite3_vfs] object.
  2609   2609   ** ^If the previous call to this routine had an N of 1 or more and a
  2610   2610   ** non-NULL P then the pseudo-randomness is generated
  2611   2611   ** internally and without recourse to the [sqlite3_vfs] xRandomness
  2612   2612   ** method.
  2613   2613   */
  2614         -SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *P);
         2614  +SQLITE_API void sqlite3_randomness(int N, void *P);
  2615   2615   
  2616   2616   /*
  2617   2617   ** CAPI3REF: Compile-Time Authorization Callbacks
  2618   2618   ** METHOD: sqlite3
  2619   2619   **
  2620   2620   ** ^This routine registers an authorizer callback with a particular
  2621   2621   ** [database connection], supplied in the first argument.
................................................................................
  2690   2690   **
  2691   2691   ** ^Note that the authorizer callback is invoked only during
  2692   2692   ** [sqlite3_prepare()] or its variants.  Authorization is not
  2693   2693   ** performed during statement evaluation in [sqlite3_step()], unless
  2694   2694   ** as stated in the previous paragraph, sqlite3_step() invokes
  2695   2695   ** sqlite3_prepare_v2() to reprepare a statement after a schema change.
  2696   2696   */
  2697         -SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
         2697  +SQLITE_API int sqlite3_set_authorizer(
  2698   2698     sqlite3*,
  2699   2699     int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
  2700   2700     void *pUserData
  2701   2701   );
  2702   2702   
  2703   2703   /*
  2704   2704   ** CAPI3REF: Authorizer Return Codes
................................................................................
  2798   2798   ** time is in units of nanoseconds, however the current implementation
  2799   2799   ** is only capable of millisecond resolution so the six least significant
  2800   2800   ** digits in the time are meaningless.  Future versions of SQLite
  2801   2801   ** might provide greater resolution on the profiler callback.  The
  2802   2802   ** sqlite3_profile() function is considered experimental and is
  2803   2803   ** subject to change in future versions of SQLite.
  2804   2804   */
  2805         -SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_trace(sqlite3*,
         2805  +SQLITE_API SQLITE_DEPRECATED void *sqlite3_trace(sqlite3*,
  2806   2806      void(*xTrace)(void*,const char*), void*);
  2807         -SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_profile(sqlite3*,
         2807  +SQLITE_API SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*,
  2808   2808      void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
  2809   2809   
  2810   2810   /*
  2811   2811   ** CAPI3REF: SQL Trace Event Codes
  2812   2812   ** KEYWORDS: SQLITE_TRACE
  2813   2813   **
  2814   2814   ** These constants identify classes of events that can be monitored
................................................................................
  2889   2889   ** ^The C argument is a copy of the context pointer.
  2890   2890   ** The P and X arguments are pointers whose meanings depend on T.
  2891   2891   **
  2892   2892   ** The sqlite3_trace_v2() interface is intended to replace the legacy
  2893   2893   ** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which
  2894   2894   ** are deprecated.
  2895   2895   */
  2896         -SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2(
         2896  +SQLITE_API int sqlite3_trace_v2(
  2897   2897     sqlite3*,
  2898   2898     unsigned uMask,
  2899   2899     int(*xCallback)(unsigned,void*,void*,void*),
  2900   2900     void *pCtx
  2901   2901   );
  2902   2902   
  2903   2903   /*
................................................................................
  2928   2928   **
  2929   2929   ** The progress handler callback must not do anything that will modify
  2930   2930   ** the database connection that invoked the progress handler.
  2931   2931   ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
  2932   2932   ** database connections for the meaning of "modify" in this paragraph.
  2933   2933   **
  2934   2934   */
  2935         -SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
         2935  +SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
  2936   2936   
  2937   2937   /*
  2938   2938   ** CAPI3REF: Opening A New Database Connection
  2939   2939   ** CONSTRUCTOR: sqlite3
  2940   2940   **
  2941   2941   ** ^These routines open an SQLite database file as specified by the 
  2942   2942   ** filename argument. ^The filename argument is interpreted as UTF-8 for
................................................................................
  3157   3157   **
  3158   3158   ** <b>Note to Windows Runtime users:</b>  The temporary directory must be set
  3159   3159   ** prior to calling sqlite3_open() or sqlite3_open_v2().  Otherwise, various
  3160   3160   ** features that require the use of temporary files may fail.
  3161   3161   **
  3162   3162   ** See also: [sqlite3_temp_directory]
  3163   3163   */
  3164         -SQLITE_API int SQLITE_STDCALL sqlite3_open(
         3164  +SQLITE_API int sqlite3_open(
  3165   3165     const char *filename,   /* Database filename (UTF-8) */
  3166   3166     sqlite3 **ppDb          /* OUT: SQLite db handle */
  3167   3167   );
  3168         -SQLITE_API int SQLITE_STDCALL sqlite3_open16(
         3168  +SQLITE_API int sqlite3_open16(
  3169   3169     const void *filename,   /* Database filename (UTF-16) */
  3170   3170     sqlite3 **ppDb          /* OUT: SQLite db handle */
  3171   3171   );
  3172         -SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
         3172  +SQLITE_API int sqlite3_open_v2(
  3173   3173     const char *filename,   /* Database filename (UTF-8) */
  3174   3174     sqlite3 **ppDb,         /* OUT: SQLite db handle */
  3175   3175     int flags,              /* Flags */
  3176   3176     const char *zVfs        /* Name of VFS module to use */
  3177   3177   );
  3178   3178   
  3179   3179   /*
................................................................................
  3211   3211   ** 
  3212   3212   ** If F is a NULL pointer, then sqlite3_uri_parameter(F,P) returns NULL and
  3213   3213   ** sqlite3_uri_boolean(F,P,B) returns B.  If F is not a NULL pointer and
  3214   3214   ** is not a database file pathname pointer that SQLite passed into the xOpen
  3215   3215   ** VFS method, then the behavior of this routine is undefined and probably
  3216   3216   ** undesirable.
  3217   3217   */
  3218         -SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam);
  3219         -SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
  3220         -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
         3218  +SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam);
         3219  +SQLITE_API int sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
         3220  +SQLITE_API sqlite3_int64 sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
  3221   3221   
  3222   3222   
  3223   3223   /*
  3224   3224   ** CAPI3REF: Error Codes And Messages
  3225   3225   ** METHOD: sqlite3
  3226   3226   **
  3227   3227   ** ^If the most recent sqlite3_* API call associated with 
................................................................................
  3257   3257   ** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after
  3258   3258   ** all calls to the interfaces listed here are completed.
  3259   3259   **
  3260   3260   ** If an interface fails with SQLITE_MISUSE, that means the interface
  3261   3261   ** was invoked incorrectly by the application.  In that case, the
  3262   3262   ** error code and message may or may not be set.
  3263   3263   */
  3264         -SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db);
  3265         -SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db);
  3266         -SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*);
  3267         -SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*);
  3268         -SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int);
         3264  +SQLITE_API int sqlite3_errcode(sqlite3 *db);
         3265  +SQLITE_API int sqlite3_extended_errcode(sqlite3 *db);
         3266  +SQLITE_API const char *sqlite3_errmsg(sqlite3*);
         3267  +SQLITE_API const void *sqlite3_errmsg16(sqlite3*);
         3268  +SQLITE_API const char *sqlite3_errstr(int);
  3269   3269   
  3270   3270   /*
  3271   3271   ** CAPI3REF: Prepared Statement Object
  3272   3272   ** KEYWORDS: {prepared statement} {prepared statements}
  3273   3273   **
  3274   3274   ** An instance of this object represents a single SQL statement that
  3275   3275   ** has been compiled into binary form and is ready to be evaluated.
................................................................................
  3329   3329   ** attack.  Developers might also want to use the [sqlite3_set_authorizer()]
  3330   3330   ** interface to further control untrusted SQL.  The size of the database
  3331   3331   ** created by an untrusted script can be contained using the
  3332   3332   ** [max_page_count] [PRAGMA].
  3333   3333   **
  3334   3334   ** New run-time limit categories may be added in future releases.
  3335   3335   */
  3336         -SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3*, int id, int newVal);
         3336  +SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal);
  3337   3337   
  3338   3338   /*
  3339   3339   ** CAPI3REF: Run-Time Limit Categories
  3340   3340   ** KEYWORDS: {limit category} {*limit categories}
  3341   3341   **
  3342   3342   ** These constants define various performance limits
  3343   3343   ** that can be lowered at run-time using [sqlite3_limit()].
................................................................................
  3481   3481   ** ^The specific value of WHERE-clause [parameter] might influence the 
  3482   3482   ** choice of query plan if the parameter is the left-hand side of a [LIKE]
  3483   3483   ** or [GLOB] operator or if the parameter is compared to an indexed column
  3484   3484   ** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
  3485   3485   ** </li>
  3486   3486   ** </ol>
  3487   3487   */
  3488         -SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
         3488  +SQLITE_API int sqlite3_prepare(
  3489   3489     sqlite3 *db,            /* Database handle */
  3490   3490     const char *zSql,       /* SQL statement, UTF-8 encoded */
  3491   3491     int nByte,              /* Maximum length of zSql in bytes. */
  3492   3492     sqlite3_stmt **ppStmt,  /* OUT: Statement handle */
  3493   3493     const char **pzTail     /* OUT: Pointer to unused portion of zSql */
  3494   3494   );
  3495         -SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
         3495  +SQLITE_API int sqlite3_prepare_v2(
  3496   3496     sqlite3 *db,            /* Database handle */
  3497   3497     const char *zSql,       /* SQL statement, UTF-8 encoded */
  3498   3498     int nByte,              /* Maximum length of zSql in bytes. */
  3499   3499     sqlite3_stmt **ppStmt,  /* OUT: Statement handle */
  3500   3500     const char **pzTail     /* OUT: Pointer to unused portion of zSql */
  3501   3501   );
  3502         -SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
         3502  +SQLITE_API int sqlite3_prepare16(
  3503   3503     sqlite3 *db,            /* Database handle */
  3504   3504     const void *zSql,       /* SQL statement, UTF-16 encoded */
  3505   3505     int nByte,              /* Maximum length of zSql in bytes. */
  3506   3506     sqlite3_stmt **ppStmt,  /* OUT: Statement handle */
  3507   3507     const void **pzTail     /* OUT: Pointer to unused portion of zSql */
  3508   3508   );
  3509         -SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
         3509  +SQLITE_API int sqlite3_prepare16_v2(
  3510   3510     sqlite3 *db,            /* Database handle */
  3511   3511     const void *zSql,       /* SQL statement, UTF-16 encoded */
  3512   3512     int nByte,              /* Maximum length of zSql in bytes. */
  3513   3513     sqlite3_stmt **ppStmt,  /* OUT: Statement handle */
  3514   3514     const void **pzTail     /* OUT: Pointer to unused portion of zSql */
  3515   3515   );
  3516   3516   
................................................................................
  3541   3541   **
  3542   3542   ** ^The string returned by sqlite3_sql(P) is managed by SQLite and is
  3543   3543   ** automatically freed when the prepared statement is finalized.
  3544   3544   ** ^The string returned by sqlite3_expanded_sql(P), on the other hand,
  3545   3545   ** is obtained from [sqlite3_malloc()] and must be free by the application
  3546   3546   ** by passing it to [sqlite3_free()].
  3547   3547   */
  3548         -SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt);
  3549         -SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt);
         3548  +SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt);
         3549  +SQLITE_API char *sqlite3_expanded_sql(sqlite3_stmt *pStmt);
  3550   3550   
  3551   3551   /*
  3552   3552   ** CAPI3REF: Determine If An SQL Statement Writes The Database
  3553   3553   ** METHOD: sqlite3_stmt
  3554   3554   **
  3555   3555   ** ^The sqlite3_stmt_readonly(X) interface returns true (non-zero) if
  3556   3556   ** and only if the [prepared statement] X makes no direct changes to
................................................................................
  3574   3574   ** since the statements themselves do not actually modify the database but
  3575   3575   ** rather they control the timing of when other statements modify the 
  3576   3576   ** database.  ^The [ATTACH] and [DETACH] statements also cause
  3577   3577   ** sqlite3_stmt_readonly() to return true since, while those statements
  3578   3578   ** change the configuration of a database connection, they do not make 
  3579   3579   ** changes to the content of the database files on disk.
  3580   3580   */
  3581         -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
         3581  +SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
  3582   3582   
  3583   3583   /*
  3584   3584   ** CAPI3REF: Determine If A Prepared Statement Has Been Reset
  3585   3585   ** METHOD: sqlite3_stmt
  3586   3586   **
  3587   3587   ** ^The sqlite3_stmt_busy(S) interface returns true (non-zero) if the
  3588   3588   ** [prepared statement] S has been stepped at least once using 
................................................................................
  3595   3595   **
  3596   3596   ** This interface can be used in combination [sqlite3_next_stmt()]
  3597   3597   ** to locate all prepared statements associated with a database 
  3598   3598   ** connection that are in need of being reset.  This can be used,
  3599   3599   ** for example, in diagnostic routines to search for prepared 
  3600   3600   ** statements that are holding a transaction open.
  3601   3601   */
  3602         -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt*);
         3602  +SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt*);
  3603   3603   
  3604   3604   /*
  3605   3605   ** CAPI3REF: Dynamically Typed Value Object
  3606   3606   ** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
  3607   3607   **
  3608   3608   ** SQLite uses the sqlite3_value object to represent all values
  3609   3609   ** that can be stored in a database table. SQLite uses dynamic typing
................................................................................
  3759   3759   ** [SQLITE_MAX_LENGTH].
  3760   3760   ** ^[SQLITE_RANGE] is returned if the parameter
  3761   3761   ** index is out of range.  ^[SQLITE_NOMEM] is returned if malloc() fails.
  3762   3762   **
  3763   3763   ** See also: [sqlite3_bind_parameter_count()],
  3764   3764   ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].
  3765   3765   */
  3766         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
  3767         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
         3766  +SQLITE_API int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
         3767  +SQLITE_API int sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
  3768   3768                           void(*)(void*));
  3769         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt*, int, double);
  3770         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt*, int, int);
  3771         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
  3772         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt*, int);
  3773         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
  3774         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
  3775         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
         3769  +SQLITE_API int sqlite3_bind_double(sqlite3_stmt*, int, double);
         3770  +SQLITE_API int sqlite3_bind_int(sqlite3_stmt*, int, int);
         3771  +SQLITE_API int sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
         3772  +SQLITE_API int sqlite3_bind_null(sqlite3_stmt*, int);
         3773  +SQLITE_API int sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
         3774  +SQLITE_API int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
         3775  +SQLITE_API int sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
  3776   3776                            void(*)(void*), unsigned char encoding);
  3777         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
  3778         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
  3779         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
         3777  +SQLITE_API int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
         3778  +SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
         3779  +SQLITE_API int sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
  3780   3780   
  3781   3781   /*
  3782   3782   ** CAPI3REF: Number Of SQL Parameters
  3783   3783   ** METHOD: sqlite3_stmt
  3784   3784   **
  3785   3785   ** ^This routine can be used to find the number of [SQL parameters]
  3786   3786   ** in a [prepared statement].  SQL parameters are tokens of the
................................................................................
  3793   3793   ** number of unique parameters.  If parameters of the ?NNN form are used,
  3794   3794   ** there may be gaps in the list.)^
  3795   3795   **
  3796   3796   ** See also: [sqlite3_bind_blob|sqlite3_bind()],
  3797   3797   ** [sqlite3_bind_parameter_name()], and
  3798   3798   ** [sqlite3_bind_parameter_index()].
  3799   3799   */
  3800         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt*);
         3800  +SQLITE_API int sqlite3_bind_parameter_count(sqlite3_stmt*);
  3801   3801   
  3802   3802   /*
  3803   3803   ** CAPI3REF: Name Of A Host Parameter
  3804   3804   ** METHOD: sqlite3_stmt
  3805   3805   **
  3806   3806   ** ^The sqlite3_bind_parameter_name(P,N) interface returns
  3807   3807   ** the name of the N-th [SQL parameter] in the [prepared statement] P.
................................................................................
  3821   3821   ** originally specified as UTF-16 in [sqlite3_prepare16()] or
  3822   3822   ** [sqlite3_prepare16_v2()].
  3823   3823   **
  3824   3824   ** See also: [sqlite3_bind_blob|sqlite3_bind()],
  3825   3825   ** [sqlite3_bind_parameter_count()], and
  3826   3826   ** [sqlite3_bind_parameter_index()].
  3827   3827   */
  3828         -SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
         3828  +SQLITE_API const char *sqlite3_bind_parameter_name(sqlite3_stmt*, int);
  3829   3829   
  3830   3830   /*
  3831   3831   ** CAPI3REF: Index Of A Parameter With A Given Name
  3832   3832   ** METHOD: sqlite3_stmt
  3833   3833   **
  3834   3834   ** ^Return the index of an SQL parameter given its name.  ^The
  3835   3835   ** index value returned is suitable for use as the second
................................................................................
  3838   3838   ** name must be given in UTF-8 even if the original statement
  3839   3839   ** was prepared from UTF-16 text using [sqlite3_prepare16_v2()].
  3840   3840   **
  3841   3841   ** See also: [sqlite3_bind_blob|sqlite3_bind()],
  3842   3842   ** [sqlite3_bind_parameter_count()], and
  3843   3843   ** [sqlite3_bind_parameter_name()].
  3844   3844   */
  3845         -SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
         3845  +SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
  3846   3846   
  3847   3847   /*
  3848   3848   ** CAPI3REF: Reset All Bindings On A Prepared Statement
  3849   3849   ** METHOD: sqlite3_stmt
  3850   3850   **
  3851   3851   ** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset
  3852   3852   ** the [sqlite3_bind_blob | bindings] on a [prepared statement].
  3853   3853   ** ^Use this routine to reset all host parameters to NULL.
  3854   3854   */
  3855         -SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt*);
         3855  +SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt*);
  3856   3856   
  3857   3857   /*
  3858   3858   ** CAPI3REF: Number Of Columns In A Result Set
  3859   3859   ** METHOD: sqlite3_stmt
  3860   3860   **
  3861   3861   ** ^Return the number of columns in the result set returned by the
  3862   3862   ** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
  3863   3863   ** statement that does not return data (for example an [UPDATE]).
  3864   3864   **
  3865   3865   ** See also: [sqlite3_data_count()]
  3866   3866   */
  3867         -SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt);
         3867  +SQLITE_API int sqlite3_column_count(sqlite3_stmt *pStmt);
  3868   3868   
  3869   3869   /*
  3870   3870   ** CAPI3REF: Column Names In A Result Set
  3871   3871   ** METHOD: sqlite3_stmt
  3872   3872   **
  3873   3873   ** ^These routines return the name assigned to a particular column
  3874   3874   ** in the result set of a [SELECT] statement.  ^The sqlite3_column_name()
................................................................................
  3889   3889   ** NULL pointer is returned.
  3890   3890   **
  3891   3891   ** ^The name of a result column is the value of the "AS" clause for
  3892   3892   ** that column, if there is an AS clause.  If there is no AS clause
  3893   3893   ** then the name of the column is unspecified and may change from
  3894   3894   ** one release of SQLite to the next.
  3895   3895   */
  3896         -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt*, int N);
  3897         -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt*, int N);
         3896  +SQLITE_API const char *sqlite3_column_name(sqlite3_stmt*, int N);
         3897  +SQLITE_API const void *sqlite3_column_name16(sqlite3_stmt*, int N);
  3898   3898   
  3899   3899   /*
  3900   3900   ** CAPI3REF: Source Of Data In A Query Result
  3901   3901   ** METHOD: sqlite3_stmt
  3902   3902   **
  3903   3903   ** ^These routines provide a means to determine the database, table, and
  3904   3904   ** table column that is the origin of a particular result column in
................................................................................
  3938   3938   ** undefined.
  3939   3939   **
  3940   3940   ** If two or more threads call one or more
  3941   3941   ** [sqlite3_column_database_name | column metadata interfaces]
  3942   3942   ** for the same [prepared statement] and result column
  3943   3943   ** at the same time then the results are undefined.
  3944   3944   */
  3945         -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int);
  3946         -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int);
  3947         -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int);
  3948         -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int);
  3949         -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int);
  3950         -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
         3945  +SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int);
         3946  +SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int);
         3947  +SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int);
         3948  +SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int);
         3949  +SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int);
         3950  +SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);
  3951   3951   
  3952   3952   /*
  3953   3953   ** CAPI3REF: Declared Datatype Of A Query Result
  3954   3954   ** METHOD: sqlite3_stmt
  3955   3955   **
  3956   3956   ** ^(The first parameter is a [prepared statement].
  3957   3957   ** If this statement is a [SELECT] statement and the Nth column of the
................................................................................
  3975   3975   ** ^SQLite uses dynamic run-time typing.  ^So just because a column
  3976   3976   ** is declared to contain a particular type does not mean that the
  3977   3977   ** data stored in that column is of the declared type.  SQLite is
  3978   3978   ** strongly typed, but the typing is dynamic not static.  ^Type
  3979   3979   ** is associated with individual values, not with the containers
  3980   3980   ** used to hold those values.
  3981   3981   */
  3982         -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt*,int);
  3983         -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt*,int);
         3982  +SQLITE_API const char *sqlite3_column_decltype(sqlite3_stmt*,int);
         3983  +SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int);
  3984   3984   
  3985   3985   /*
  3986   3986   ** CAPI3REF: Evaluate An SQL Statement
  3987   3987   ** METHOD: sqlite3_stmt
  3988   3988   **
  3989   3989   ** After a [prepared statement] has been prepared using either
  3990   3990   ** [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] or one of the legacy
................................................................................
  4056   4056   ** We admit that this is a goofy design.  The problem has been fixed
  4057   4057   ** with the "v2" interface.  If you prepare all of your SQL statements
  4058   4058   ** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
  4059   4059   ** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,
  4060   4060   ** then the more specific [error codes] are returned directly
  4061   4061   ** by sqlite3_step().  The use of the "v2" interface is recommended.
  4062   4062   */
  4063         -SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt*);
         4063  +SQLITE_API int sqlite3_step(sqlite3_stmt*);
  4064   4064   
  4065   4065   /*
  4066   4066   ** CAPI3REF: Number of columns in a result set
  4067   4067   ** METHOD: sqlite3_stmt
  4068   4068   **
  4069   4069   ** ^The sqlite3_data_count(P) interface returns the number of columns in the
  4070   4070   ** current row of the result set of [prepared statement] P.
................................................................................
  4077   4077   ** will return non-zero if previous call to [sqlite3_step](P) returned
  4078   4078   ** [SQLITE_ROW], except in the case of the [PRAGMA incremental_vacuum]
  4079   4079   ** where it always returns zero since each step of that multi-step
  4080   4080   ** pragma returns 0 columns of data.
  4081   4081   **
  4082   4082   ** See also: [sqlite3_column_count()]
  4083   4083   */
  4084         -SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt);
         4084  +SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt);
  4085   4085   
  4086   4086   /*
  4087   4087   ** CAPI3REF: Fundamental Datatypes
  4088   4088   ** KEYWORDS: SQLITE_TEXT
  4089   4089   **
  4090   4090   ** ^(Every value in SQLite has one of five fundamental datatypes:
  4091   4091   **
................................................................................
  4267   4267   **
  4268   4268   ** ^(If a memory allocation error occurs during the evaluation of any
  4269   4269   ** of these routines, a default value is returned.  The default value
  4270   4270   ** is either the integer 0, the floating point number 0.0, or a NULL
  4271   4271   ** pointer.  Subsequent calls to [sqlite3_errcode()] will return
  4272   4272   ** [SQLITE_NOMEM].)^
  4273   4273   */
  4274         -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt*, int iCol);
  4275         -SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt*, int iCol);
  4276         -SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
  4277         -SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt*, int iCol);
  4278         -SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt*, int iCol);
  4279         -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt*, int iCol);
  4280         -SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt*, int iCol);
  4281         -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt*, int iCol);
  4282         -SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt*, int iCol);
  4283         -SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt*, int iCol);
         4274  +SQLITE_API const void *sqlite3_column_blob(sqlite3_stmt*, int iCol);
         4275  +SQLITE_API int sqlite3_column_bytes(sqlite3_stmt*, int iCol);
         4276  +SQLITE_API int sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
         4277  +SQLITE_API double sqlite3_column_double(sqlite3_stmt*, int iCol);
         4278  +SQLITE_API int sqlite3_column_int(sqlite3_stmt*, int iCol);
         4279  +SQLITE_API sqlite3_int64 sqlite3_column_int64(sqlite3_stmt*, int iCol);
         4280  +SQLITE_API const unsigned char *sqlite3_column_text(sqlite3_stmt*, int iCol);
         4281  +SQLITE_API const void *sqlite3_column_text16(sqlite3_stmt*, int iCol);
         4282  +SQLITE_API int sqlite3_column_type(sqlite3_stmt*, int iCol);
         4283  +SQLITE_API sqlite3_value *sqlite3_column_value(sqlite3_stmt*, int iCol);
  4284   4284   
  4285   4285   /*
  4286   4286   ** CAPI3REF: Destroy A Prepared Statement Object
  4287   4287   ** DESTRUCTOR: sqlite3_stmt
  4288   4288   **
  4289   4289   ** ^The sqlite3_finalize() function is called to delete a [prepared statement].
  4290   4290   ** ^If the most recent evaluation of the statement encountered no errors
................................................................................
  4304   4304   **
  4305   4305   ** The application must finalize every [prepared statement] in order to avoid
  4306   4306   ** resource leaks.  It is a grievous error for the application to try to use
  4307   4307   ** a prepared statement after it has been finalized.  Any use of a prepared
  4308   4308   ** statement after it has been finalized can result in undefined and
  4309   4309   ** undesirable behavior such as segfaults and heap corruption.
  4310   4310   */
  4311         -SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt);
         4311  +SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt);
  4312   4312   
  4313   4313   /*
  4314   4314   ** CAPI3REF: Reset A Prepared Statement Object
  4315   4315   ** METHOD: sqlite3_stmt
  4316   4316   **
  4317   4317   ** The sqlite3_reset() function is called to reset a [prepared statement]
  4318   4318   ** object back to its initial state, ready to be re-executed.
................................................................................
  4331   4331   ** ^If the most recent call to [sqlite3_step(S)] for the
  4332   4332   ** [prepared statement] S indicated an error, then
  4333   4333   ** [sqlite3_reset(S)] returns an appropriate [error code].
  4334   4334   **
  4335   4335   ** ^The [sqlite3_reset(S)] interface does not change the values
  4336   4336   ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
  4337   4337   */
  4338         -SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt);
         4338  +SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt);
  4339   4339   
  4340   4340   /*
  4341   4341   ** CAPI3REF: Create Or Redefine SQL Functions
  4342   4342   ** KEYWORDS: {function creation routines}
  4343   4343   ** KEYWORDS: {application-defined SQL function}
  4344   4344   ** KEYWORDS: {application-defined SQL functions}
  4345   4345   ** METHOD: sqlite3
................................................................................
  4431   4431   ** ^Built-in functions may be overloaded by new application-defined functions.
  4432   4432   **
  4433   4433   ** ^An application-defined function is permitted to call other
  4434   4434   ** SQLite interfaces.  However, such calls must not
  4435   4435   ** close the database connection nor finalize or reset the prepared
  4436   4436   ** statement in which the function is running.
  4437   4437   */
  4438         -SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
         4438  +SQLITE_API int sqlite3_create_function(
  4439   4439     sqlite3 *db,
  4440   4440     const char *zFunctionName,
  4441   4441     int nArg,
  4442   4442     int eTextRep,
  4443   4443     void *pApp,
  4444   4444     void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
  4445   4445     void (*xStep)(sqlite3_context*,int,sqlite3_value**),
  4446   4446     void (*xFinal)(sqlite3_context*)
  4447   4447   );
  4448         -SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
         4448  +SQLITE_API int sqlite3_create_function16(
  4449   4449     sqlite3 *db,
  4450   4450     const void *zFunctionName,
  4451   4451     int nArg,
  4452   4452     int eTextRep,
  4453   4453     void *pApp,
  4454   4454     void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
  4455   4455     void (*xStep)(sqlite3_context*,int,sqlite3_value**),
  4456   4456     void (*xFinal)(sqlite3_context*)
  4457   4457   );
  4458         -SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
         4458  +SQLITE_API int sqlite3_create_function_v2(
  4459   4459     sqlite3 *db,
  4460   4460     const char *zFunctionName,
  4461   4461     int nArg,
  4462   4462     int eTextRep,
  4463   4463     void *pApp,
  4464   4464     void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
  4465   4465     void (*xStep)(sqlite3_context*,int,sqlite3_value**),
................................................................................
  4497   4497   ** These functions are [deprecated].  In order to maintain
  4498   4498   ** backwards compatibility with older code, these functions continue 
  4499   4499   ** to be supported.  However, new applications should avoid
  4500   4500   ** the use of these functions.  To encourage programmers to avoid
  4501   4501   ** these functions, we will not explain what they do.
  4502   4502   */
  4503   4503   #ifndef SQLITE_OMIT_DEPRECATED
  4504         -SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context*);
  4505         -SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt*);
  4506         -SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
  4507         -SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_global_recover(void);
  4508         -SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_thread_cleanup(void);
  4509         -SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
         4504  +SQLITE_API SQLITE_DEPRECATED int sqlite3_aggregate_count(sqlite3_context*);
         4505  +SQLITE_API SQLITE_DEPRECATED int sqlite3_expired(sqlite3_stmt*);
         4506  +SQLITE_API SQLITE_DEPRECATED int sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
         4507  +SQLITE_API SQLITE_DEPRECATED int sqlite3_global_recover(void);
         4508  +SQLITE_API SQLITE_DEPRECATED void sqlite3_thread_cleanup(void);
         4509  +SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
  4510   4510                         void*,sqlite3_int64);
  4511   4511   #endif
  4512   4512   
  4513   4513   /*
  4514   4514   ** CAPI3REF: Obtaining SQL Values
  4515   4515   ** METHOD: sqlite3_value
  4516   4516   **
................................................................................
  4552   4552   ** [sqlite3_value_text16()] can be invalidated by a subsequent call to
  4553   4553   ** [sqlite3_value_bytes()], [sqlite3_value_bytes16()], [sqlite3_value_text()],
  4554   4554   ** or [sqlite3_value_text16()].
  4555   4555   **
  4556   4556   ** These routines must be called from the same thread as
  4557   4557   ** the SQL function that supplied the [sqlite3_value*] parameters.
  4558   4558   */
  4559         -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value*);
  4560         -SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value*);
  4561         -SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value*);
  4562         -SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value*);
  4563         -SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value*);
  4564         -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value*);
  4565         -SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value*);
  4566         -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value*);
  4567         -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value*);
  4568         -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*);
  4569         -SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*);
  4570         -SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*);
         4559  +SQLITE_API const void *sqlite3_value_blob(sqlite3_value*);
         4560  +SQLITE_API int sqlite3_value_bytes(sqlite3_value*);
         4561  +SQLITE_API int sqlite3_value_bytes16(sqlite3_value*);
         4562  +SQLITE_API double sqlite3_value_double(sqlite3_value*);
         4563  +SQLITE_API int sqlite3_value_int(sqlite3_value*);
         4564  +SQLITE_API sqlite3_int64 sqlite3_value_int64(sqlite3_value*);
         4565  +SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value*);
         4566  +SQLITE_API const void *sqlite3_value_text16(sqlite3_value*);
         4567  +SQLITE_API const void *sqlite3_value_text16le(sqlite3_value*);
         4568  +SQLITE_API const void *sqlite3_value_text16be(sqlite3_value*);
         4569  +SQLITE_API int sqlite3_value_type(sqlite3_value*);
         4570  +SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*);
  4571   4571   
  4572   4572   /*
  4573   4573   ** CAPI3REF: Finding The Subtype Of SQL Values
  4574   4574   ** METHOD: sqlite3_value
  4575   4575   **
  4576   4576   ** The sqlite3_value_subtype(V) function returns the subtype for
  4577   4577   ** an [application-defined SQL function] argument V.  The subtype
................................................................................
  4579   4579   ** one SQL function to another.  Use the [sqlite3_result_subtype()]
  4580   4580   ** routine to set the subtype for the return value of an SQL function.
  4581   4581   **
  4582   4582   ** SQLite makes no use of subtype itself.  It merely passes the subtype
  4583   4583   ** from the result of one [application-defined SQL function] into the
  4584   4584   ** input of another.
  4585   4585   */
  4586         -SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value*);
         4586  +SQLITE_API unsigned int sqlite3_value_subtype(sqlite3_value*);
  4587   4587   
  4588   4588   /*
  4589   4589   ** CAPI3REF: Copy And Free SQL Values
  4590   4590   ** METHOD: sqlite3_value
  4591   4591   **
  4592   4592   ** ^The sqlite3_value_dup(V) interface makes a copy of the [sqlite3_value]
  4593   4593   ** object D and returns a pointer to that copy.  ^The [sqlite3_value] returned
................................................................................
  4595   4595   ** ^The sqlite3_value_dup(V) interface returns NULL if V is NULL or if a
  4596   4596   ** memory allocation fails.
  4597   4597   **
  4598   4598   ** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object
  4599   4599   ** previously obtained from [sqlite3_value_dup()].  ^If V is a NULL pointer
  4600   4600   ** then sqlite3_value_free(V) is a harmless no-op.
  4601   4601   */
  4602         -SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value*);
  4603         -SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value*);
         4602  +SQLITE_API sqlite3_value *sqlite3_value_dup(const sqlite3_value*);
         4603  +SQLITE_API void sqlite3_value_free(sqlite3_value*);
  4604   4604   
  4605   4605   /*
  4606   4606   ** CAPI3REF: Obtain Aggregate Function Context
  4607   4607   ** METHOD: sqlite3_context
  4608   4608   **
  4609   4609   ** Implementations of aggregate SQL functions use this
  4610   4610   ** routine to allocate memory for storing their state.
................................................................................
  4641   4641   ** [sqlite3_context | SQL function context] that is the first parameter
  4642   4642   ** to the xStep or xFinal callback routine that implements the aggregate
  4643   4643   ** function.
  4644   4644   **
  4645   4645   ** This routine must be called from the same thread in which
  4646   4646   ** the aggregate SQL function is running.
  4647   4647   */
  4648         -SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
         4648  +SQLITE_API void *sqlite3_aggregate_context(sqlite3_context*, int nBytes);
  4649   4649   
  4650   4650   /*
  4651   4651   ** CAPI3REF: User Data For Functions
  4652   4652   ** METHOD: sqlite3_context
  4653   4653   **
  4654   4654   ** ^The sqlite3_user_data() interface returns a copy of
  4655   4655   ** the pointer that was the pUserData parameter (the 5th parameter)
................................................................................
  4656   4656   ** of the [sqlite3_create_function()]
  4657   4657   ** and [sqlite3_create_function16()] routines that originally
  4658   4658   ** registered the application defined function.
  4659   4659   **
  4660   4660   ** This routine must be called from the same thread in which
  4661   4661   ** the application-defined function is running.
  4662   4662   */
  4663         -SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context*);
         4663  +SQLITE_API void *sqlite3_user_data(sqlite3_context*);
  4664   4664   
  4665   4665   /*
  4666   4666   ** CAPI3REF: Database Connection For Functions
  4667   4667   ** METHOD: sqlite3_context
  4668   4668   **
  4669   4669   ** ^The sqlite3_context_db_handle() interface returns a copy of
  4670   4670   ** the pointer to the [database connection] (the 1st parameter)
  4671   4671   ** of the [sqlite3_create_function()]
  4672   4672   ** and [sqlite3_create_function16()] routines that originally
  4673   4673   ** registered the application defined function.
  4674   4674   */
  4675         -SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context*);
         4675  +SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*);
  4676   4676   
  4677   4677   /*
  4678   4678   ** CAPI3REF: Function Auxiliary Data
  4679   4679   ** METHOD: sqlite3_context
  4680   4680   **
  4681   4681   ** These functions may be used by (non-aggregate) SQL functions to
  4682   4682   ** associate metadata with argument values. If the same value is passed to
................................................................................
  4722   4722   ** ^(In practice, metadata is preserved between function calls for
  4723   4723   ** function parameters that are compile-time constants, including literal
  4724   4724   ** values and [parameters] and expressions composed from the same.)^
  4725   4725   **
  4726   4726   ** These routines must be called from the same thread in which
  4727   4727   ** the SQL function is running.
  4728   4728   */
  4729         -SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context*, int N);
  4730         -SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
         4729  +SQLITE_API void *sqlite3_get_auxdata(sqlite3_context*, int N);
         4730  +SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
  4731   4731   
  4732   4732   
  4733   4733   /*
  4734   4734   ** CAPI3REF: Constants Defining Special Destructor Behavior
  4735   4735   **
  4736   4736   ** These are special values for the destructor that is passed in as the
  4737   4737   ** final argument to routines like [sqlite3_result_blob()].  ^If the destructor
................................................................................
  4859   4859   ** [unprotected sqlite3_value] object is required, so either
  4860   4860   ** kind of [sqlite3_value] object can be used with this interface.
  4861   4861   **
  4862   4862   ** If these routines are called from within the different thread
  4863   4863   ** than the one containing the application-defined function that received
  4864   4864   ** the [sqlite3_context] pointer, the results are undefined.
  4865   4865   */
  4866         -SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
  4867         -SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(sqlite3_context*,const void*,
         4866  +SQLITE_API void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
         4867  +SQLITE_API void sqlite3_result_blob64(sqlite3_context*,const void*,
  4868   4868                              sqlite3_uint64,void(*)(void*));
  4869         -SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context*, double);
  4870         -SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context*, const char*, int);
  4871         -SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context*, const void*, int);
  4872         -SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context*);
  4873         -SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context*);
  4874         -SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context*, int);
  4875         -SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context*, int);
  4876         -SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
  4877         -SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context*);
  4878         -SQLITE_API void SQLITE_STDCALL sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
  4879         -SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
         4869  +SQLITE_API void sqlite3_result_double(sqlite3_context*, double);
         4870  +SQLITE_API void sqlite3_result_error(sqlite3_context*, const char*, int);
         4871  +SQLITE_API void sqlite3_result_error16(sqlite3_context*, const void*, int);
         4872  +SQLITE_API void sqlite3_result_error_toobig(sqlite3_context*);
         4873  +SQLITE_API void sqlite3_result_error_nomem(sqlite3_context*);
         4874  +SQLITE_API void sqlite3_result_error_code(sqlite3_context*, int);
         4875  +SQLITE_API void sqlite3_result_int(sqlite3_context*, int);
         4876  +SQLITE_API void sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
         4877  +SQLITE_API void sqlite3_result_null(sqlite3_context*);
         4878  +SQLITE_API void sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
         4879  +SQLITE_API void sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
  4880   4880                              void(*)(void*), unsigned char encoding);
  4881         -SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
  4882         -SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
  4883         -SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
  4884         -SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
  4885         -SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n);
  4886         -SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
         4881  +SQLITE_API void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
         4882  +SQLITE_API void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
         4883  +SQLITE_API void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
         4884  +SQLITE_API void sqlite3_result_value(sqlite3_context*, sqlite3_value*);
         4885  +SQLITE_API void sqlite3_result_zeroblob(sqlite3_context*, int n);
         4886  +SQLITE_API int sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
  4887   4887   
  4888   4888   
  4889   4889   /*
  4890   4890   ** CAPI3REF: Setting The Subtype Of An SQL Function
  4891   4891   ** METHOD: sqlite3_context
  4892   4892   **
  4893   4893   ** The sqlite3_result_subtype(C,T) function causes the subtype of
................................................................................
  4894   4894   ** the result from the [application-defined SQL function] with 
  4895   4895   ** [sqlite3_context] C to be the value T.  Only the lower 8 bits 
  4896   4896   ** of the subtype T are preserved in current versions of SQLite;
  4897   4897   ** higher order bits are discarded.
  4898   4898   ** The number of subtype bytes preserved by SQLite might increase
  4899   4899   ** in future releases of SQLite.
  4900   4900   */
  4901         -SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context*,unsigned int);
         4901  +SQLITE_API void sqlite3_result_subtype(sqlite3_context*,unsigned int);
  4902   4902   
  4903   4903   /*
  4904   4904   ** CAPI3REF: Define New Collating Sequences
  4905   4905   ** METHOD: sqlite3
  4906   4906   **
  4907   4907   ** ^These functions add, remove, or modify a [collation] associated
  4908   4908   ** with the [database connection] specified as the first argument.
................................................................................
  4976   4976   ** themselves rather than expecting SQLite to deal with it for them.
  4977   4977   ** This is different from every other SQLite interface.  The inconsistency 
  4978   4978   ** is unfortunate but cannot be changed without breaking backwards 
  4979   4979   ** compatibility.
  4980   4980   **
  4981   4981   ** See also:  [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].
  4982   4982   */
  4983         -SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
         4983  +SQLITE_API int sqlite3_create_collation(
  4984   4984     sqlite3*, 
  4985   4985     const char *zName, 
  4986   4986     int eTextRep, 
  4987   4987     void *pArg,
  4988   4988     int(*xCompare)(void*,int,const void*,int,const void*)
  4989   4989   );
  4990         -SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
         4990  +SQLITE_API int sqlite3_create_collation_v2(
  4991   4991     sqlite3*, 
  4992   4992     const char *zName, 
  4993   4993     int eTextRep, 
  4994   4994     void *pArg,
  4995   4995     int(*xCompare)(void*,int,const void*,int,const void*),
  4996   4996     void(*xDestroy)(void*)
  4997   4997   );
  4998         -SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
         4998  +SQLITE_API int sqlite3_create_collation16(
  4999   4999     sqlite3*, 
  5000   5000     const void *zName,
  5001   5001     int eTextRep, 
  5002   5002     void *pArg,
  5003   5003     int(*xCompare)(void*,int,const void*,int,const void*)
  5004   5004   );
  5005   5005   
................................................................................
  5026   5026   ** sequence function required.  The fourth parameter is the name of the
  5027   5027   ** required collation sequence.)^
  5028   5028   **
  5029   5029   ** The callback function should register the desired collation using
  5030   5030   ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or
  5031   5031   ** [sqlite3_create_collation_v2()].
  5032   5032   */
  5033         -SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
         5033  +SQLITE_API int sqlite3_collation_needed(
  5034   5034     sqlite3*, 
  5035   5035     void*, 
  5036   5036     void(*)(void*,sqlite3*,int eTextRep,const char*)
  5037   5037   );
  5038         -SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
         5038  +SQLITE_API int sqlite3_collation_needed16(
  5039   5039     sqlite3*, 
  5040   5040     void*,
  5041   5041     void(*)(void*,sqlite3*,int eTextRep,const void*)
  5042   5042   );
  5043   5043   
  5044   5044   #ifdef SQLITE_HAS_CODEC
  5045   5045   /*
  5046   5046   ** Specify the key for an encrypted database.  This routine should be
  5047   5047   ** called right after sqlite3_open().
  5048   5048   **
  5049   5049   ** The code to implement this API is not available in the public release
  5050   5050   ** of SQLite.
  5051   5051   */
  5052         -SQLITE_API int SQLITE_STDCALL sqlite3_key(
         5052  +SQLITE_API int sqlite3_key(
  5053   5053     sqlite3 *db,                   /* Database to be rekeyed */
  5054   5054     const void *pKey, int nKey     /* The key */
  5055   5055   );
  5056         -SQLITE_API int SQLITE_STDCALL sqlite3_key_v2(
         5056  +SQLITE_API int sqlite3_key_v2(
  5057   5057     sqlite3 *db,                   /* Database to be rekeyed */
  5058   5058     const char *zDbName,           /* Name of the database */
  5059   5059     const void *pKey, int nKey     /* The key */
  5060   5060   );
  5061   5061   
  5062   5062   /*
  5063   5063   ** Change the key on an open database.  If the current database is not
  5064   5064   ** encrypted, this routine will encrypt it.  If pNew==0 or nNew==0, the
  5065   5065   ** database is decrypted.
  5066   5066   **
  5067   5067   ** The code to implement this API is not available in the public release
  5068   5068   ** of SQLite.
  5069   5069   */
  5070         -SQLITE_API int SQLITE_STDCALL sqlite3_rekey(
         5070  +SQLITE_API int sqlite3_rekey(
  5071   5071     sqlite3 *db,                   /* Database to be rekeyed */
  5072   5072     const void *pKey, int nKey     /* The new key */
  5073   5073   );
  5074         -SQLITE_API int SQLITE_STDCALL sqlite3_rekey_v2(
         5074  +SQLITE_API int sqlite3_rekey_v2(
  5075   5075     sqlite3 *db,                   /* Database to be rekeyed */
  5076   5076     const char *zDbName,           /* Name of the database */
  5077   5077     const void *pKey, int nKey     /* The new key */
  5078   5078   );
  5079   5079   
  5080   5080   /*
  5081   5081   ** Specify the activation key for a SEE database.  Unless 
  5082   5082   ** activated, none of the SEE routines will work.
  5083   5083   */
  5084         -SQLITE_API void SQLITE_STDCALL sqlite3_activate_see(
         5084  +SQLITE_API void sqlite3_activate_see(
  5085   5085     const char *zPassPhrase        /* Activation phrase */
  5086   5086   );
  5087   5087   #endif
  5088   5088   
  5089   5089   #ifdef SQLITE_ENABLE_CEROD
  5090   5090   /*
  5091   5091   ** Specify the activation key for a CEROD database.  Unless 
  5092   5092   ** activated, none of the CEROD routines will work.
  5093   5093   */
  5094         -SQLITE_API void SQLITE_STDCALL sqlite3_activate_cerod(
         5094  +SQLITE_API void sqlite3_activate_cerod(
  5095   5095     const char *zPassPhrase        /* Activation phrase */
  5096   5096   );
  5097   5097   #endif
  5098   5098   
  5099   5099   /*
  5100   5100   ** CAPI3REF: Suspend Execution For A Short Time
  5101   5101   **
................................................................................
  5109   5109   **
  5110   5110   ** ^SQLite implements this interface by calling the xSleep()
  5111   5111   ** method of the default [sqlite3_vfs] object.  If the xSleep() method
  5112   5112   ** of the default VFS is not implemented correctly, or not implemented at
  5113   5113   ** all, then the behavior of sqlite3_sleep() may deviate from the description
  5114   5114   ** in the previous paragraphs.
  5115   5115   */
  5116         -SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int);
         5116  +SQLITE_API int sqlite3_sleep(int);
  5117   5117   
  5118   5118   /*
  5119   5119   ** CAPI3REF: Name Of The Folder Holding Temporary Files
  5120   5120   **
  5121   5121   ** ^(If this global variable is made to point to a string which is
  5122   5122   ** the name of a folder (a.k.a. directory), then all temporary files
  5123   5123   ** created by SQLite when using a built-in [sqlite3_vfs | VFS]
................................................................................
  5228   5228   ** find out whether SQLite automatically rolled back the transaction after
  5229   5229   ** an error is to use this function.
  5230   5230   **
  5231   5231   ** If another thread changes the autocommit status of the database
  5232   5232   ** connection while this routine is running, then the return value
  5233   5233   ** is undefined.
  5234   5234   */
  5235         -SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3*);
         5235  +SQLITE_API int sqlite3_get_autocommit(sqlite3*);
  5236   5236   
  5237   5237   /*
  5238   5238   ** CAPI3REF: Find The Database Handle Of A Prepared Statement
  5239   5239   ** METHOD: sqlite3_stmt
  5240   5240   **
  5241   5241   ** ^The sqlite3_db_handle interface returns the [database connection] handle
  5242   5242   ** to which a [prepared statement] belongs.  ^The [database connection]
  5243   5243   ** returned by sqlite3_db_handle is the same [database connection]
  5244   5244   ** that was the first argument
  5245   5245   ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
  5246   5246   ** create the statement in the first place.
  5247   5247   */
  5248         -SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt*);
         5248  +SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*);
  5249   5249   
  5250   5250   /*
  5251   5251   ** CAPI3REF: Return The Filename For A Database Connection
  5252   5252   ** METHOD: sqlite3
  5253   5253   **
  5254   5254   ** ^The sqlite3_db_filename(D,N) interface returns a pointer to a filename
  5255   5255   ** associated with database N of connection D.  ^The main database file
................................................................................
  5258   5258   ** a NULL pointer is returned.
  5259   5259   **
  5260   5260   ** ^The filename returned by this function is the output of the
  5261   5261   ** xFullPathname method of the [VFS].  ^In other words, the filename
  5262   5262   ** will be an absolute pathname, even if the filename used
  5263   5263   ** to open the database originally was a URI or relative pathname.
  5264   5264   */
  5265         -SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
         5265  +SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName);
  5266   5266   
  5267   5267   /*
  5268   5268   ** CAPI3REF: Determine if a database is read-only
  5269   5269   ** METHOD: sqlite3
  5270   5270   **
  5271   5271   ** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N
  5272   5272   ** of connection D is read-only, 0 if it is read/write, or -1 if N is not
  5273   5273   ** the name of a database on connection D.
  5274   5274   */
  5275         -SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
         5275  +SQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
  5276   5276   
  5277   5277   /*
  5278   5278   ** CAPI3REF: Find the next prepared statement
  5279   5279   ** METHOD: sqlite3
  5280   5280   **
  5281   5281   ** ^This interface returns a pointer to the next [prepared statement] after
  5282   5282   ** pStmt associated with the [database connection] pDb.  ^If pStmt is NULL
................................................................................
  5284   5284   ** associated with the database connection pDb.  ^If no prepared statement
  5285   5285   ** satisfies the conditions of this routine, it returns NULL.
  5286   5286   **
  5287   5287   ** The [database connection] pointer D in a call to
  5288   5288   ** [sqlite3_next_stmt(D,S)] must refer to an open database
  5289   5289   ** connection and in particular must not be a NULL pointer.
  5290   5290   */
  5291         -SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
         5291  +SQLITE_API sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
  5292   5292   
  5293   5293   /*
  5294   5294   ** CAPI3REF: Commit And Rollback Notification Callbacks
  5295   5295   ** METHOD: sqlite3
  5296   5296   **
  5297   5297   ** ^The sqlite3_commit_hook() interface registers a callback
  5298   5298   ** function to be invoked whenever a transaction is [COMMIT | committed].
................................................................................
  5333   5333   ** rolled back if an explicit "ROLLBACK" statement is executed, or
  5334   5334   ** an error or constraint causes an implicit rollback to occur.
  5335   5335   ** ^The rollback callback is not invoked if a transaction is
  5336   5336   ** automatically rolled back because the database connection is closed.
  5337   5337   **
  5338   5338   ** See also the [sqlite3_update_hook()] interface.
  5339   5339   */
  5340         -SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
  5341         -SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
         5340  +SQLITE_API void *sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
         5341  +SQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
  5342   5342   
  5343   5343   /*
  5344   5344   ** CAPI3REF: Data Change Notification Callbacks
  5345   5345   ** METHOD: sqlite3
  5346   5346   **
  5347   5347   ** ^The sqlite3_update_hook() interface registers a callback function
  5348   5348   ** with the [database connection] identified by the first argument
................................................................................
  5385   5385   ** returns the P argument from the previous call
  5386   5386   ** on the same [database connection] D, or NULL for
  5387   5387   ** the first call on D.
  5388   5388   **
  5389   5389   ** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()],
  5390   5390   ** and [sqlite3_preupdate_hook()] interfaces.
  5391   5391   */
  5392         -SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
         5392  +SQLITE_API void *sqlite3_update_hook(
  5393   5393     sqlite3*, 
  5394   5394     void(*)(void *,int ,char const *,char const *,sqlite3_int64),
  5395   5395     void*
  5396   5396   );
  5397   5397   
  5398   5398   /*
  5399   5399   ** CAPI3REF: Enable Or Disable Shared Pager Cache
................................................................................
  5425   5425   ** [sqlite3_open_v2()] with [SQLITE_OPEN_SHAREDCACHE].
  5426   5426   **
  5427   5427   ** This interface is threadsafe on processors where writing a
  5428   5428   ** 32-bit integer is atomic.
  5429   5429   **
  5430   5430   ** See Also:  [SQLite Shared-Cache Mode]
  5431   5431   */
  5432         -SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int);
         5432  +SQLITE_API int sqlite3_enable_shared_cache(int);
  5433   5433   
  5434   5434   /*
  5435   5435   ** CAPI3REF: Attempt To Free Heap Memory
  5436   5436   **
  5437   5437   ** ^The sqlite3_release_memory() interface attempts to free N bytes
  5438   5438   ** of heap memory by deallocating non-essential memory allocations
  5439   5439   ** held by the database library.   Memory used to cache database
................................................................................
  5441   5441   ** ^sqlite3_release_memory() returns the number of bytes actually freed,
  5442   5442   ** which might be more or less than the amount requested.
  5443   5443   ** ^The sqlite3_release_memory() routine is a no-op returning zero
  5444   5444   ** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].
  5445   5445   **
  5446   5446   ** See also: [sqlite3_db_release_memory()]
  5447   5447   */
  5448         -SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int);
         5448  +SQLITE_API int sqlite3_release_memory(int);
  5449   5449   
  5450   5450   /*
  5451   5451   ** CAPI3REF: Free Memory Used By A Database Connection
  5452   5452   ** METHOD: sqlite3
  5453   5453   **
  5454   5454   ** ^The sqlite3_db_release_memory(D) interface attempts to free as much heap
  5455   5455   ** memory as possible from database connection D. Unlike the
  5456   5456   ** [sqlite3_release_memory()] interface, this interface is in effect even
  5457   5457   ** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
  5458   5458   ** omitted.
  5459   5459   **
  5460   5460   ** See also: [sqlite3_release_memory()]
  5461   5461   */
  5462         -SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3*);
         5462  +SQLITE_API int sqlite3_db_release_memory(sqlite3*);
  5463   5463   
  5464   5464   /*
  5465   5465   ** CAPI3REF: Impose A Limit On Heap Size
  5466   5466   **
  5467   5467   ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the
  5468   5468   ** soft limit on the amount of heap memory that may be allocated by SQLite.
  5469   5469   ** ^SQLite strives to keep heap memory utilization below the soft heap
................................................................................
  5507   5507   ** the page cache is the predominate memory user in SQLite, most
  5508   5508   ** applications will achieve adequate soft heap limit enforcement without
  5509   5509   ** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT].
  5510   5510   **
  5511   5511   ** The circumstances under which SQLite will enforce the soft heap limit may
  5512   5512   ** changes in future releases of SQLite.
  5513   5513   */
  5514         -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
         5514  +SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 N);
  5515   5515   
  5516   5516   /*
  5517   5517   ** CAPI3REF: Deprecated Soft Heap Limit Interface
  5518   5518   ** DEPRECATED
  5519   5519   **
  5520   5520   ** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
  5521   5521   ** interface.  This routine is provided for historical compatibility
  5522   5522   ** only.  All new applications should use the
  5523   5523   ** [sqlite3_soft_heap_limit64()] interface rather than this one.
  5524   5524   */
  5525         -SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_soft_heap_limit(int N);
         5525  +SQLITE_API SQLITE_DEPRECATED void sqlite3_soft_heap_limit(int N);
  5526   5526   
  5527   5527   
  5528   5528   /*
  5529   5529   ** CAPI3REF: Extract Metadata About A Column Of A Table
  5530   5530   ** METHOD: sqlite3
  5531   5531   **
  5532   5532   ** ^(The sqlite3_table_column_metadata(X,D,T,C,....) routine returns
................................................................................
  5588   5588   **     auto increment: 0
  5589   5589   ** </pre>)^
  5590   5590   **
  5591   5591   ** ^This function causes all database schemas to be read from disk and
  5592   5592   ** parsed, if that has not already been done, and returns an error if
  5593   5593   ** any errors are encountered while loading the schema.
  5594   5594   */
  5595         -SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
         5595  +SQLITE_API int sqlite3_table_column_metadata(
  5596   5596     sqlite3 *db,                /* Connection handle */
  5597   5597     const char *zDbName,        /* Database name or NULL */
  5598   5598     const char *zTableName,     /* Table name */
  5599   5599     const char *zColumnName,    /* Column name */
  5600   5600     char const **pzDataType,    /* OUTPUT: Declared data type */
  5601   5601     char const **pzCollSeq,     /* OUTPUT: Collation sequence name */
  5602   5602     int *pNotNull,              /* OUTPUT: True if NOT NULL constraint exists */
................................................................................
  5644   5644   ** interface.  The use of the [sqlite3_enable_load_extension()] interface
  5645   5645   ** should be avoided.  This will keep the SQL function [load_extension()]
  5646   5646   ** disabled and prevent SQL injections from giving attackers
  5647   5647   ** access to extension loading capabilities.
  5648   5648   **
  5649   5649   ** See also the [load_extension() SQL function].
  5650   5650   */
  5651         -SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
         5651  +SQLITE_API int sqlite3_load_extension(
  5652   5652     sqlite3 *db,          /* Load the extension into this database connection */
  5653   5653     const char *zFile,    /* Name of the shared library containing extension */
  5654   5654     const char *zProc,    /* Entry point.  Derived from zFile if 0 */
  5655   5655     char **pzErrMsg       /* Put error message here if not 0 */
  5656   5656   );
  5657   5657   
  5658   5658   /*
................................................................................
  5676   5676   **
  5677   5677   ** <b>Security warning:</b> It is recommended that extension loading
  5678   5678   ** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method
  5679   5679   ** rather than this interface, so the [load_extension()] SQL function
  5680   5680   ** remains disabled. This will prevent SQL injections from giving attackers
  5681   5681   ** access to extension loading capabilities.
  5682   5682   */
  5683         -SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
         5683  +SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
  5684   5684   
  5685   5685   /*
  5686   5686   ** CAPI3REF: Automatically Load Statically Linked Extensions
  5687   5687   **
  5688   5688   ** ^This interface causes the xEntryPoint() function to be invoked for
  5689   5689   ** each new [database connection] that is created.  The idea here is that
  5690   5690   ** xEntryPoint() is the entry point for a statically linked [SQLite extension]
................................................................................
  5714   5714   ** ^Calling sqlite3_auto_extension(X) with an entry point X that is already
  5715   5715   ** on the list of automatic extensions is a harmless no-op. ^No entry point
  5716   5716   ** will be called more than once for each database connection that is opened.
  5717   5717   **
  5718   5718   ** See also: [sqlite3_reset_auto_extension()]
  5719   5719   ** and [sqlite3_cancel_auto_extension()]
  5720   5720   */
  5721         -SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void(*xEntryPoint)(void));
         5721  +SQLITE_API int sqlite3_auto_extension(void(*xEntryPoint)(void));
  5722   5722   
  5723   5723   /*
  5724   5724   ** CAPI3REF: Cancel Automatic Extension Loading
  5725   5725   **
  5726   5726   ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
  5727   5727   ** initialization routine X that was registered using a prior call to
  5728   5728   ** [sqlite3_auto_extension(X)].  ^The [sqlite3_cancel_auto_extension(X)]
  5729   5729   ** routine returns 1 if initialization routine X was successfully 
  5730   5730   ** unregistered and it returns 0 if X was not on the list of initialization
  5731   5731   ** routines.
  5732   5732   */
  5733         -SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void(*xEntryPoint)(void));
         5733  +SQLITE_API int sqlite3_cancel_auto_extension(void(*xEntryPoint)(void));
  5734   5734   
  5735   5735   /*
  5736   5736   ** CAPI3REF: Reset Automatic Extension Loading
  5737   5737   **
  5738   5738   ** ^This interface disables all automatic extensions previously
  5739   5739   ** registered using [sqlite3_auto_extension()].
  5740   5740   */
  5741         -SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void);
         5741  +SQLITE_API void sqlite3_reset_auto_extension(void);
  5742   5742   
  5743   5743   /*
  5744   5744   ** The interface to the virtual-table mechanism is currently considered
  5745   5745   ** to be experimental.  The interface might change in incompatible ways.
  5746   5746   ** If this is a problem for you, do not use the interface at this time.
  5747   5747   **
  5748   5748   ** When the virtual-table mechanism stabilizes, we will declare the
................................................................................
  5979   5979   ** invoke the destructor function (if it is not NULL) when SQLite
  5980   5980   ** no longer needs the pClientData pointer.  ^The destructor will also
  5981   5981   ** be invoked if the call to sqlite3_create_module_v2() fails.
  5982   5982   ** ^The sqlite3_create_module()
  5983   5983   ** interface is equivalent to sqlite3_create_module_v2() with a NULL
  5984   5984   ** destructor.
  5985   5985   */
  5986         -SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
         5986  +SQLITE_API int sqlite3_create_module(
  5987   5987     sqlite3 *db,               /* SQLite connection to register module with */
  5988   5988     const char *zName,         /* Name of the module */
  5989   5989     const sqlite3_module *p,   /* Methods for the module */
  5990   5990     void *pClientData          /* Client data for xCreate/xConnect */
  5991   5991   );
  5992         -SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
         5992  +SQLITE_API int sqlite3_create_module_v2(
  5993   5993     sqlite3 *db,               /* SQLite connection to register module with */
  5994   5994     const char *zName,         /* Name of the module */
  5995   5995     const sqlite3_module *p,   /* Methods for the module */
  5996   5996     void *pClientData,         /* Client data for xCreate/xConnect */
  5997   5997     void(*xDestroy)(void*)     /* Module destructor function */
  5998   5998   );
  5999   5999   
................................................................................
  6048   6048   ** CAPI3REF: Declare The Schema Of A Virtual Table
  6049   6049   **
  6050   6050   ** ^The [xCreate] and [xConnect] methods of a
  6051   6051   ** [virtual table module] call this interface
  6052   6052   ** to declare the format (the names and datatypes of the columns) of
  6053   6053   ** the virtual tables they implement.
  6054   6054   */
  6055         -SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
         6055  +SQLITE_API int sqlite3_declare_vtab(sqlite3*, const char *zSQL);
  6056   6056   
  6057   6057   /*
  6058   6058   ** CAPI3REF: Overload A Function For A Virtual Table
  6059   6059   ** METHOD: sqlite3
  6060   6060   **
  6061   6061   ** ^(Virtual tables can provide alternative implementations of functions
  6062   6062   ** using the [xFindFunction] method of the [virtual table module].  
................................................................................
  6067   6067   ** name and number of parameters exists.  If no such function exists
  6068   6068   ** before this API is called, a new function is created.)^  ^The implementation
  6069   6069   ** of the new function always causes an exception to be thrown.  So
  6070   6070   ** the new function is not good for anything by itself.  Its only
  6071   6071   ** purpose is to be a placeholder function that can be overloaded
  6072   6072   ** by a [virtual table].
  6073   6073   */
  6074         -SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
         6074  +SQLITE_API int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
  6075   6075   
  6076   6076   /*
  6077   6077   ** The interface to the virtual-table mechanism defined above (back up
  6078   6078   ** to a comment remarkably similar to this one) is currently considered
  6079   6079   ** to be experimental.  The interface might change in incompatible ways.
  6080   6080   ** If this is a problem for you, do not use the interface at this time.
  6081   6081   **
................................................................................
  6166   6166   ** ^The [sqlite3_bind_zeroblob()] and [sqlite3_result_zeroblob()] interfaces
  6167   6167   ** and the built-in [zeroblob] SQL function may be used to create a 
  6168   6168   ** zero-filled blob to read or write using the incremental-blob interface.
  6169   6169   **
  6170   6170   ** To avoid a resource leak, every open [BLOB handle] should eventually
  6171   6171   ** be released by a call to [sqlite3_blob_close()].
  6172   6172   */
  6173         -SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
         6173  +SQLITE_API int sqlite3_blob_open(
  6174   6174     sqlite3*,
  6175   6175     const char *zDb,
  6176   6176     const char *zTable,
  6177   6177     const char *zColumn,
  6178   6178     sqlite3_int64 iRow,
  6179   6179     int flags,
  6180   6180     sqlite3_blob **ppBlob
................................................................................
  6199   6199   ** ^All subsequent calls to [sqlite3_blob_read()], [sqlite3_blob_write()] or
  6200   6200   ** [sqlite3_blob_reopen()] on an aborted blob handle immediately return
  6201   6201   ** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
  6202   6202   ** always returns zero.
  6203   6203   **
  6204   6204   ** ^This function sets the database handle error code and message.
  6205   6205   */
  6206         -SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
         6206  +SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
  6207   6207   
  6208   6208   /*
  6209   6209   ** CAPI3REF: Close A BLOB Handle
  6210   6210   ** DESTRUCTOR: sqlite3_blob
  6211   6211   **
  6212   6212   ** ^This function closes an open [BLOB handle]. ^(The BLOB handle is closed
  6213   6213   ** unconditionally.  Even if this routine returns an error code, the 
................................................................................
  6222   6222   ** Calling this function with an argument that is not a NULL pointer or an
  6223   6223   ** open blob handle results in undefined behaviour. ^Calling this routine 
  6224   6224   ** with a null pointer (such as would be returned by a failed call to 
  6225   6225   ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function
  6226   6226   ** is passed a valid open blob handle, the values returned by the 
  6227   6227   ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning.
  6228   6228   */
  6229         -SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *);
         6229  +SQLITE_API int sqlite3_blob_close(sqlite3_blob *);
  6230   6230   
  6231   6231   /*
  6232   6232   ** CAPI3REF: Return The Size Of An Open BLOB
  6233   6233   ** METHOD: sqlite3_blob
  6234   6234   **
  6235   6235   ** ^Returns the size in bytes of the BLOB accessible via the 
  6236   6236   ** successfully opened [BLOB handle] in its only argument.  ^The
................................................................................
  6238   6238   ** blob content; they cannot change the size of a blob.
  6239   6239   **
  6240   6240   ** This routine only works on a [BLOB handle] which has been created
  6241   6241   ** by a prior successful call to [sqlite3_blob_open()] and which has not
  6242   6242   ** been closed by [sqlite3_blob_close()].  Passing any other pointer in
  6243   6243   ** to this routine results in undefined and probably undesirable behavior.
  6244   6244   */
  6245         -SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *);
         6245  +SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *);
  6246   6246   
  6247   6247   /*
  6248   6248   ** CAPI3REF: Read Data From A BLOB Incrementally
  6249   6249   ** METHOD: sqlite3_blob
  6250   6250   **
  6251   6251   ** ^(This function is used to read data from an open [BLOB handle] into a
  6252   6252   ** caller-supplied buffer. N bytes of data are copied into buffer Z
................................................................................
  6267   6267   ** This routine only works on a [BLOB handle] which has been created
  6268   6268   ** by a prior successful call to [sqlite3_blob_open()] and which has not
  6269   6269   ** been closed by [sqlite3_blob_close()].  Passing any other pointer in
  6270   6270   ** to this routine results in undefined and probably undesirable behavior.
  6271   6271   **
  6272   6272   ** See also: [sqlite3_blob_write()].
  6273   6273   */
  6274         -SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
         6274  +SQLITE_API int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
  6275   6275   
  6276   6276   /*
  6277   6277   ** CAPI3REF: Write Data Into A BLOB Incrementally
  6278   6278   ** METHOD: sqlite3_blob
  6279   6279   **
  6280   6280   ** ^(This function is used to write data into an open [BLOB handle] from a
  6281   6281   ** caller-supplied buffer. N bytes of data are copied from the buffer Z
................................................................................
  6309   6309   ** This routine only works on a [BLOB handle] which has been created
  6310   6310   ** by a prior successful call to [sqlite3_blob_open()] and which has not
  6311   6311   ** been closed by [sqlite3_blob_close()].  Passing any other pointer in
  6312   6312   ** to this routine results in undefined and probably undesirable behavior.
  6313   6313   **
  6314   6314   ** See also: [sqlite3_blob_read()].
  6315   6315   */
  6316         -SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
         6316  +SQLITE_API int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
  6317   6317   
  6318   6318   /*
  6319   6319   ** CAPI3REF: Virtual File System Objects
  6320   6320   **
  6321   6321   ** A virtual filesystem (VFS) is an [sqlite3_vfs] object
  6322   6322   ** that SQLite uses to interact
  6323   6323   ** with the underlying operating system.  Most SQLite builds come with a
................................................................................
  6340   6340   ** VFS is registered with a name that is NULL or an empty string,
  6341   6341   ** then the behavior is undefined.
  6342   6342   **
  6343   6343   ** ^Unregister a VFS with the sqlite3_vfs_unregister() interface.
  6344   6344   ** ^(If the default VFS is unregistered, another VFS is chosen as
  6345   6345   ** the default.  The choice for the new VFS is arbitrary.)^
  6346   6346   */
  6347         -SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfsName);
  6348         -SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
  6349         -SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs*);
         6347  +SQLITE_API sqlite3_vfs *sqlite3_vfs_find(const char *zVfsName);
         6348  +SQLITE_API int sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
         6349  +SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*);
  6350   6350   
  6351   6351   /*
  6352   6352   ** CAPI3REF: Mutexes
  6353   6353   **
  6354   6354   ** The SQLite core uses these routines for thread
  6355   6355   ** synchronization. Though they are intended for internal
  6356   6356   ** use by SQLite, code that links against SQLite is
................................................................................
  6458   6458   **
  6459   6459   ** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or
  6460   6460   ** sqlite3_mutex_leave() is a NULL pointer, then all three routines
  6461   6461   ** behave as no-ops.
  6462   6462   **
  6463   6463   ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
  6464   6464   */
  6465         -SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int);
  6466         -SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*);
  6467         -SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*);
  6468         -SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*);
  6469         -SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*);
         6465  +SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int);
         6466  +SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*);
         6467  +SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*);
         6468  +SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*);
         6469  +SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*);
  6470   6470   
  6471   6471   /*
  6472   6472   ** CAPI3REF: Mutex Methods Object
  6473   6473   **
  6474   6474   ** An instance of this structure defines the low-level routines
  6475   6475   ** used to allocate and use mutexes.
  6476   6476   **
................................................................................
  6572   6572   ** the reason the mutex does not exist is because the build is not
  6573   6573   ** using mutexes.  And we do not want the assert() containing the
  6574   6574   ** call to sqlite3_mutex_held() to fail, so a non-zero return is
  6575   6575   ** the appropriate thing to do.  The sqlite3_mutex_notheld()
  6576   6576   ** interface should also return 1 when given a NULL pointer.
  6577   6577   */
  6578   6578   #ifndef NDEBUG
  6579         -SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex*);
  6580         -SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex*);
         6579  +SQLITE_API int sqlite3_mutex_held(sqlite3_mutex*);
         6580  +SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex*);
  6581   6581   #endif
  6582   6582   
  6583   6583   /*
  6584   6584   ** CAPI3REF: Mutex Types
  6585   6585   **
  6586   6586   ** The [sqlite3_mutex_alloc()] interface takes a single argument
  6587   6587   ** which is one of these integer constants.
................................................................................
  6613   6613   **
  6614   6614   ** ^This interface returns a pointer the [sqlite3_mutex] object that 
  6615   6615   ** serializes access to the [database connection] given in the argument
  6616   6616   ** when the [threading mode] is Serialized.
  6617   6617   ** ^If the [threading mode] is Single-thread or Multi-thread then this
  6618   6618   ** routine returns a NULL pointer.
  6619   6619   */
  6620         -SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3*);
         6620  +SQLITE_API sqlite3_mutex *sqlite3_db_mutex(sqlite3*);
  6621   6621   
  6622   6622   /*
  6623   6623   ** CAPI3REF: Low-Level Control Of Database Files
  6624   6624   ** METHOD: sqlite3
  6625   6625   **
  6626   6626   ** ^The [sqlite3_file_control()] interface makes a direct call to the
  6627   6627   ** xFileControl method for the [sqlite3_io_methods] object associated
................................................................................
  6648   6648   ** or [sqlite3_errmsg()].  The underlying xFileControl method might
  6649   6649   ** also return SQLITE_ERROR.  There is no way to distinguish between
  6650   6650   ** an incorrect zDbName and an SQLITE_ERROR return from the underlying
  6651   6651   ** xFileControl method.
  6652   6652   **
  6653   6653   ** See also: [SQLITE_FCNTL_LOCKSTATE]
  6654   6654   */
  6655         -SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
         6655  +SQLITE_API int sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
  6656   6656   
  6657   6657   /*
  6658   6658   ** CAPI3REF: Testing Interface
  6659   6659   **
  6660   6660   ** ^The sqlite3_test_control() interface is used to read out internal
  6661   6661   ** state of SQLite and to inject faults into SQLite for testing
  6662   6662   ** purposes.  ^The first parameter is an operation code that determines
................................................................................
  6667   6667   ** on how the SQLite library is compiled, this interface might not exist.
  6668   6668   **
  6669   6669   ** The details of the operation codes, their meanings, the parameters
  6670   6670   ** they take, and what they do are all subject to change without notice.
  6671   6671   ** Unlike most of the SQLite API, this function is not guaranteed to
  6672   6672   ** operate consistently from one release to the next.
  6673   6673   */
  6674         -SQLITE_API int SQLITE_CDECL sqlite3_test_control(int op, ...);
         6674  +SQLITE_API int sqlite3_test_control(int op, ...);
  6675   6675   
  6676   6676   /*
  6677   6677   ** CAPI3REF: Testing Interface Operation Codes
  6678   6678   **
  6679   6679   ** These constants are the valid operation code parameters used
  6680   6680   ** as the first argument to [sqlite3_test_control()].
  6681   6681   **
................................................................................
  6730   6730   **
  6731   6731   ** If either the current value or the highwater mark is too large to
  6732   6732   ** be represented by a 32-bit integer, then the values returned by
  6733   6733   ** sqlite3_status() are undefined.
  6734   6734   **
  6735   6735   ** See also: [sqlite3_db_status()]
  6736   6736   */
  6737         -SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
  6738         -SQLITE_API int SQLITE_STDCALL sqlite3_status64(
         6737  +SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
         6738  +SQLITE_API int sqlite3_status64(
  6739   6739     int op,
  6740   6740     sqlite3_int64 *pCurrent,
  6741   6741     sqlite3_int64 *pHighwater,
  6742   6742     int resetFlag
  6743   6743   );
  6744   6744   
  6745   6745   
................................................................................
  6856   6856   ** reset back down to the current value.
  6857   6857   **
  6858   6858   ** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a
  6859   6859   ** non-zero [error code] on failure.
  6860   6860   **
  6861   6861   ** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
  6862   6862   */
  6863         -SQLITE_API int SQLITE_STDCALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
         6863  +SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
  6864   6864   
  6865   6865   /*
  6866   6866   ** CAPI3REF: Status Parameters for database connections
  6867   6867   ** KEYWORDS: {SQLITE_DBSTATUS options}
  6868   6868   **
  6869   6869   ** These constants are the available integer "verbs" that can be passed as
  6870   6870   ** the second argument to the [sqlite3_db_status()] interface.
................................................................................
  6999   6999   ** to be interrogated.)^
  7000   7000   ** ^The current value of the requested counter is returned.
  7001   7001   ** ^If the resetFlg is true, then the counter is reset to zero after this
  7002   7002   ** interface call returns.
  7003   7003   **
  7004   7004   ** See also: [sqlite3_status()] and [sqlite3_db_status()].
  7005   7005   */
  7006         -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
         7006  +SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
  7007   7007   
  7008   7008   /*
  7009   7009   ** CAPI3REF: Status Parameters for prepared statements
  7010   7010   ** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters}
  7011   7011   **
  7012   7012   ** These preprocessor macros define integer codes that name counter
  7013   7013   ** values associated with the [sqlite3_stmt_status()] interface.
................................................................................
  7468   7468   ** The [sqlite3_backup] object itself is partially threadsafe. Multiple 
  7469   7469   ** threads may safely make multiple concurrent calls to sqlite3_backup_step().
  7470   7470   ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()
  7471   7471   ** APIs are not strictly speaking threadsafe. If they are invoked at the
  7472   7472   ** same time as another thread is invoking sqlite3_backup_step() it is
  7473   7473   ** possible that they return invalid values.
  7474   7474   */
  7475         -SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
         7475  +SQLITE_API sqlite3_backup *sqlite3_backup_init(
  7476   7476     sqlite3 *pDest,                        /* Destination database handle */
  7477   7477     const char *zDestName,                 /* Destination database name */
  7478   7478     sqlite3 *pSource,                      /* Source database handle */
  7479   7479     const char *zSourceName                /* Source database name */
  7480   7480   );
  7481         -SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage);
  7482         -SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p);
  7483         -SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p);
  7484         -SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p);
         7481  +SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage);
         7482  +SQLITE_API int sqlite3_backup_finish(sqlite3_backup *p);
         7483  +SQLITE_API int sqlite3_backup_remaining(sqlite3_backup *p);
         7484  +SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p);
  7485   7485   
  7486   7486   /*
  7487   7487   ** CAPI3REF: Unlock Notification
  7488   7488   ** METHOD: sqlite3
  7489   7489   **
  7490   7490   ** ^When running in shared-cache mode, a database operation may fail with
  7491   7491   ** an [SQLITE_LOCKED] error if the required locks on the shared-cache or
................................................................................
  7594   7594   **
  7595   7595   ** One way around this problem is to check the extended error code returned
  7596   7596   ** by an sqlite3_step() call. ^(If there is a blocking connection, then the
  7597   7597   ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in
  7598   7598   ** the special "DROP TABLE/INDEX" case, the extended error code is just 
  7599   7599   ** SQLITE_LOCKED.)^
  7600   7600   */
  7601         -SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
         7601  +SQLITE_API int sqlite3_unlock_notify(
  7602   7602     sqlite3 *pBlocked,                          /* Waiting connection */
  7603   7603     void (*xNotify)(void **apArg, int nArg),    /* Callback function to invoke */
  7604   7604     void *pNotifyArg                            /* Argument to pass to xNotify */
  7605   7605   );
  7606   7606   
  7607   7607   
  7608   7608   /*
................................................................................
  7609   7609   ** CAPI3REF: String Comparison
  7610   7610   **
  7611   7611   ** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications
  7612   7612   ** and extensions to compare the contents of two buffers containing UTF-8
  7613   7613   ** strings in a case-independent fashion, using the same definition of "case
  7614   7614   ** independence" that SQLite uses internally when comparing identifiers.
  7615   7615   */
  7616         -SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *, const char *);
  7617         -SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *, const char *, int);
         7616  +SQLITE_API int sqlite3_stricmp(const char *, const char *);
         7617  +SQLITE_API int sqlite3_strnicmp(const char *, const char *, int);
  7618   7618   
  7619   7619   /*
  7620   7620   ** CAPI3REF: String Globbing
  7621   7621   *
  7622   7622   ** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if
  7623   7623   ** string X matches the [GLOB] pattern P.
  7624   7624   ** ^The definition of [GLOB] pattern matching used in
................................................................................
  7627   7627   ** is case sensitive.
  7628   7628   **
  7629   7629   ** Note that this routine returns zero on a match and non-zero if the strings
  7630   7630   ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
  7631   7631   **
  7632   7632   ** See also: [sqlite3_strlike()].
  7633   7633   */
  7634         -SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlob, const char *zStr);
         7634  +SQLITE_API int sqlite3_strglob(const char *zGlob, const char *zStr);
  7635   7635   
  7636   7636   /*
  7637   7637   ** CAPI3REF: String LIKE Matching
  7638   7638   *
  7639   7639   ** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if
  7640   7640   ** string X matches the [LIKE] pattern P with escape character E.
  7641   7641   ** ^The definition of [LIKE] pattern matching used in
................................................................................
  7650   7650   ** only ASCII characters are case folded.
  7651   7651   **
  7652   7652   ** Note that this routine returns zero on a match and non-zero if the strings
  7653   7653   ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
  7654   7654   **
  7655   7655   ** See also: [sqlite3_strglob()].
  7656   7656   */
  7657         -SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
         7657  +SQLITE_API int sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
  7658   7658   
  7659   7659   /*
  7660   7660   ** CAPI3REF: Error Logging Interface
  7661   7661   **
  7662   7662   ** ^The [sqlite3_log()] interface writes a message into the [error log]
  7663   7663   ** established by the [SQLITE_CONFIG_LOG] option to [sqlite3_config()].
  7664   7664   ** ^If logging is enabled, the zFormat string and subsequent arguments are
................................................................................
  7673   7673   **
  7674   7674   ** To avoid deadlocks and other threading problems, the sqlite3_log() routine
  7675   7675   ** will not use dynamically allocated memory.  The log message is stored in
  7676   7676   ** a fixed-length buffer on the stack.  If the log message is longer than
  7677   7677   ** a few hundred characters, it will be truncated to the length of the
  7678   7678   ** buffer.
  7679   7679   */
  7680         -SQLITE_API void SQLITE_CDECL sqlite3_log(int iErrCode, const char *zFormat, ...);
         7680  +SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...);
  7681   7681   
  7682   7682   /*
  7683   7683   ** CAPI3REF: Write-Ahead Log Commit Hook
  7684   7684   ** METHOD: sqlite3
  7685   7685   **
  7686   7686   ** ^The [sqlite3_wal_hook()] function is used to register a callback that
  7687   7687   ** is invoked each time data is committed to a database in wal mode.
................................................................................
  7709   7709   ** A single database handle may have at most a single write-ahead log callback 
  7710   7710   ** registered at one time. ^Calling [sqlite3_wal_hook()] replaces any
  7711   7711   ** previously registered write-ahead log callback. ^Note that the
  7712   7712   ** [sqlite3_wal_autocheckpoint()] interface and the
  7713   7713   ** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will
  7714   7714   ** overwrite any prior [sqlite3_wal_hook()] settings.
  7715   7715   */
  7716         -SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
         7716  +SQLITE_API void *sqlite3_wal_hook(
  7717   7717     sqlite3*, 
  7718   7718     int(*)(void *,sqlite3*,const char*,int),
  7719   7719     void*
  7720   7720   );
  7721   7721   
  7722   7722   /*
  7723   7723   ** CAPI3REF: Configure an auto-checkpoint
................................................................................
  7744   7744   **
  7745   7745   ** ^Every new [database connection] defaults to having the auto-checkpoint
  7746   7746   ** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]
  7747   7747   ** pages.  The use of this interface
  7748   7748   ** is only necessary if the default setting is found to be suboptimal
  7749   7749   ** for a particular application.
  7750   7750   */
  7751         -SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
         7751  +SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
  7752   7752   
  7753   7753   /*
  7754   7754   ** CAPI3REF: Checkpoint a database
  7755   7755   ** METHOD: sqlite3
  7756   7756   **
  7757   7757   ** ^(The sqlite3_wal_checkpoint(D,X) is equivalent to
  7758   7758   ** [sqlite3_wal_checkpoint_v2](D,X,[SQLITE_CHECKPOINT_PASSIVE],0,0).)^
................................................................................
  7766   7766   ** This interface used to be the only way to cause a checkpoint to
  7767   7767   ** occur.  But then the newer and more powerful [sqlite3_wal_checkpoint_v2()]
  7768   7768   ** interface was added.  This interface is retained for backwards
  7769   7769   ** compatibility and as a convenience for applications that need to manually
  7770   7770   ** start a callback but which do not need the full power (and corresponding
  7771   7771   ** complication) of [sqlite3_wal_checkpoint_v2()].
  7772   7772   */
  7773         -SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
         7773  +SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
  7774   7774   
  7775   7775   /*
  7776   7776   ** CAPI3REF: Checkpoint a database
  7777   7777   ** METHOD: sqlite3
  7778   7778   **
  7779   7779   ** ^(The sqlite3_wal_checkpoint_v2(D,X,M,L,C) interface runs a checkpoint
  7780   7780   ** operation on database X of [database connection] D in mode M.  Status
................................................................................
  7860   7860   ** the sqlite3_wal_checkpoint_v2() interface
  7861   7861   ** sets the error information that is queried by
  7862   7862   ** [sqlite3_errcode()] and [sqlite3_errmsg()].
  7863   7863   **
  7864   7864   ** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface
  7865   7865   ** from SQL.
  7866   7866   */
  7867         -SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
         7867  +SQLITE_API int sqlite3_wal_checkpoint_v2(
  7868   7868     sqlite3 *db,                    /* Database handle */
  7869   7869     const char *zDb,                /* Name of attached database (or NULL) */
  7870   7870     int eMode,                      /* SQLITE_CHECKPOINT_* value */
  7871   7871     int *pnLog,                     /* OUT: Size of WAL log in frames */
  7872   7872     int *pnCkpt                     /* OUT: Total number of frames checkpointed */
  7873   7873   );
  7874   7874   
................................................................................
  7896   7896   ** If this interface is invoked outside the context of an xConnect or
  7897   7897   ** xCreate virtual table method then the behavior is undefined.
  7898   7898   **
  7899   7899   ** At present, there is only one option that may be configured using
  7900   7900   ** this function. (See [SQLITE_VTAB_CONSTRAINT_SUPPORT].)  Further options
  7901   7901   ** may be added in the future.
  7902   7902   */
  7903         -SQLITE_API int SQLITE_CDECL sqlite3_vtab_config(sqlite3*, int op, ...);
         7903  +SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...);
  7904   7904   
  7905   7905   /*
  7906   7906   ** CAPI3REF: Virtual Table Configuration Options
  7907   7907   **
  7908   7908   ** These macros define the various options to the
  7909   7909   ** [sqlite3_vtab_config()] interface that [virtual table] implementations
  7910   7910   ** can use to customize and optimize their behavior.
................................................................................
  7949   7949   ** This function may only be called from within a call to the [xUpdate] method
  7950   7950   ** of a [virtual table] implementation for an INSERT or UPDATE operation. ^The
  7951   7951   ** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL],
  7952   7952   ** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode
  7953   7953   ** of the SQL statement that triggered the call to the [xUpdate] method of the
  7954   7954   ** [virtual table].
  7955   7955   */
  7956         -SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *);
         7956  +SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *);
  7957   7957   
  7958   7958   /*
  7959   7959   ** CAPI3REF: Conflict resolution modes
  7960   7960   ** KEYWORDS: {conflict resolution mode}
  7961   7961   **
  7962   7962   ** These constants are returned by [sqlite3_vtab_on_conflict()] to
  7963   7963   ** inform a [virtual table] implementation what the [ON CONFLICT] mode
................................................................................
  8054   8054   ** ^Statistics might not be available for all loops in all statements. ^In cases
  8055   8055   ** where there exist loops with no available statistics, this function behaves
  8056   8056   ** as if the loop did not exist - it returns non-zero and leave the variable
  8057   8057   ** that pOut points to unchanged.
  8058   8058   **
  8059   8059   ** See also: [sqlite3_stmt_scanstatus_reset()]
  8060   8060   */
  8061         -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus(
         8061  +SQLITE_API int sqlite3_stmt_scanstatus(
  8062   8062     sqlite3_stmt *pStmt,      /* Prepared statement for which info desired */
  8063   8063     int idx,                  /* Index of loop to report on */
  8064   8064     int iScanStatusOp,        /* Information desired.  SQLITE_SCANSTAT_* */
  8065   8065     void *pOut                /* Result written here */
  8066   8066   );     
  8067   8067   
  8068   8068   /*
................................................................................
  8070   8070   ** METHOD: sqlite3_stmt
  8071   8071   **
  8072   8072   ** ^Zero all [sqlite3_stmt_scanstatus()] related event counters.
  8073   8073   **
  8074   8074   ** This API is only available if the library is built with pre-processor
  8075   8075   ** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined.
  8076   8076   */
  8077         -SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
         8077  +SQLITE_API void sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
  8078   8078   
  8079   8079   /*
  8080   8080   ** CAPI3REF: Flush caches to disk mid-transaction
  8081   8081   **
  8082   8082   ** ^If a write-transaction is open on [database connection] D when the
  8083   8083   ** [sqlite3_db_cacheflush(D)] interface invoked, any dirty
  8084   8084   ** pages in the pager-cache that are not currently in use are written out 
................................................................................
  8102   8102   ** abandoned and an SQLite [error code] is returned to the caller immediately.
  8103   8103   **
  8104   8104   ** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK.
  8105   8105   **
  8106   8106   ** ^This function does not set the database handle error code or message
  8107   8107   ** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions.
  8108   8108   */
  8109         -SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3*);
         8109  +SQLITE_API int sqlite3_db_cacheflush(sqlite3*);
  8110   8110   
  8111   8111   /*
  8112   8112   ** CAPI3REF: The pre-update hook.
  8113   8113   **
  8114   8114   ** ^These interfaces are only available if SQLite is compiled using the
  8115   8115   ** [SQLITE_ENABLE_PREUPDATE_HOOK] compile-time option.
  8116   8116   **
................................................................................
  8182   8182   ** callback was invoked as a result of a direct insert, update, or delete
  8183   8183   ** operation; or 1 for inserts, updates, or deletes invoked by top-level 
  8184   8184   ** triggers; or 2 for changes resulting from triggers called by top-level
  8185   8185   ** triggers; and so forth.
  8186   8186   **
  8187   8187   ** See also:  [sqlite3_update_hook()]
  8188   8188   */
  8189         -SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_STDCALL sqlite3_preupdate_hook(
         8189  +SQLITE_API SQLITE_EXPERIMENTAL void *sqlite3_preupdate_hook(
  8190   8190     sqlite3 *db,
  8191   8191     void(*xPreUpdate)(
  8192   8192       void *pCtx,                   /* Copy of third arg to preupdate_hook() */
  8193   8193       sqlite3 *db,                  /* Database handle */
  8194   8194       int op,                       /* SQLITE_UPDATE, DELETE or INSERT */
  8195   8195       char const *zDb,              /* Database name */
  8196   8196       char const *zName,            /* Table name */
  8197   8197       sqlite3_int64 iKey1,          /* Rowid of row about to be deleted/updated */
  8198   8198       sqlite3_int64 iKey2           /* New rowid value (for a rowid UPDATE) */
  8199   8199     ),
  8200   8200     void*
  8201   8201   );
  8202         -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **);
  8203         -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *);
  8204         -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *);
  8205         -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **);
         8202  +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **);
         8203  +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_preupdate_count(sqlite3 *);
         8204  +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_preupdate_depth(sqlite3 *);
         8205  +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **);
  8206   8206   
  8207   8207   /*
  8208   8208   ** CAPI3REF: Low-level system error code
  8209   8209   **
  8210   8210   ** ^Attempt to return the underlying operating system error code or error
  8211   8211   ** number that caused the most recent I/O error or failure to open a file.
  8212   8212   ** The return value is OS-dependent.  For example, on unix systems, after
  8213   8213   ** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be
  8214   8214   ** called to get back the underlying "errno" that caused the problem, such
  8215   8215   ** as ENOSPC, EAUTH, EISDIR, and so forth.  
  8216   8216   */
  8217         -SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3*);
         8217  +SQLITE_API int sqlite3_system_errno(sqlite3*);
  8218   8218   
  8219   8219   /*
  8220   8220   ** CAPI3REF: Database Snapshot
  8221   8221   ** KEYWORDS: {snapshot}
  8222   8222   ** EXPERIMENTAL
  8223   8223   **
  8224   8224   ** An instance of the snapshot object records the state of a [WAL mode]
................................................................................
  8260   8260   ** The [sqlite3_snapshot] object returned from a successful call to
  8261   8261   ** [sqlite3_snapshot_get()] must be freed using [sqlite3_snapshot_free()]
  8262   8262   ** to avoid a memory leak.
  8263   8263   **
  8264   8264   ** The [sqlite3_snapshot_get()] interface is only available when the
  8265   8265   ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
  8266   8266   */
  8267         -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_get(
         8267  +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_get(
  8268   8268     sqlite3 *db,
  8269   8269     const char *zSchema,
  8270   8270     sqlite3_snapshot **ppSnapshot
  8271   8271   );
  8272   8272   
  8273   8273   /*
  8274   8274   ** CAPI3REF: Start a read transaction on an historical snapshot
................................................................................
  8298   8298   ** after the most recent I/O on the database connection.)^
  8299   8299   ** (Hint: Run "[PRAGMA application_id]" against a newly opened
  8300   8300   ** database connection in order to make it ready to use snapshots.)
  8301   8301   **
  8302   8302   ** The [sqlite3_snapshot_open()] interface is only available when the
  8303   8303   ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
  8304   8304   */
  8305         -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_open(
         8305  +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_open(
  8306   8306     sqlite3 *db,
  8307   8307     const char *zSchema,
  8308   8308     sqlite3_snapshot *pSnapshot
  8309   8309   );
  8310   8310   
  8311   8311   /*
  8312   8312   ** CAPI3REF: Destroy a snapshot
................................................................................
  8315   8315   ** ^The [sqlite3_snapshot_free(P)] interface destroys [sqlite3_snapshot] P.
  8316   8316   ** The application must eventually free every [sqlite3_snapshot] object
  8317   8317   ** using this routine to avoid a memory leak.
  8318   8318   **
  8319   8319   ** The [sqlite3_snapshot_free()] interface is only available when the
  8320   8320   ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
  8321   8321   */
  8322         -SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot*);
         8322  +SQLITE_API SQLITE_EXPERIMENTAL void sqlite3_snapshot_free(sqlite3_snapshot*);
  8323   8323   
  8324   8324   /*
  8325   8325   ** CAPI3REF: Compare the ages of two snapshot handles.
  8326   8326   ** EXPERIMENTAL
  8327   8327   **
  8328   8328   ** The sqlite3_snapshot_cmp(P1, P2) interface is used to compare the ages
  8329   8329   ** of two valid snapshot handles. 
................................................................................
  8339   8339   ** wal file was last deleted, the value returned by this function 
  8340   8340   ** is undefined.
  8341   8341   **
  8342   8342   ** Otherwise, this API returns a negative value if P1 refers to an older
  8343   8343   ** snapshot than P2, zero if the two handles refer to the same database
  8344   8344   ** snapshot, and a positive value if P1 is a newer snapshot than P2.
  8345   8345   */
  8346         -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_cmp(
         8346  +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_cmp(
  8347   8347     sqlite3_snapshot *p1,
  8348   8348     sqlite3_snapshot *p2
  8349   8349   );
  8350   8350   
  8351   8351   /*
  8352   8352   ** Undo the hack that converts floating point types to integer for
  8353   8353   ** builds on processors without floating point support.
................................................................................
  8397   8397   
  8398   8398   /*
  8399   8399   ** Register a geometry callback named zGeom that can be used as part of an
  8400   8400   ** R-Tree geometry query as follows:
  8401   8401   **
  8402   8402   **   SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
  8403   8403   */
  8404         -SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
         8404  +SQLITE_API int sqlite3_rtree_geometry_callback(
  8405   8405     sqlite3 *db,
  8406   8406     const char *zGeom,
  8407   8407     int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
  8408   8408     void *pContext
  8409   8409   );
  8410   8410   
  8411   8411   
................................................................................
  8423   8423   
  8424   8424   /*
  8425   8425   ** Register a 2nd-generation geometry callback named zScore that can be 
  8426   8426   ** used as part of an R-Tree geometry query as follows:
  8427   8427   **
  8428   8428   **   SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...)
  8429   8429   */
  8430         -SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
         8430  +SQLITE_API int sqlite3_rtree_query_callback(
  8431   8431     sqlite3 *db,
  8432   8432     const char *zQueryFunc,
  8433   8433     int (*xQueryFunc)(sqlite3_rtree_query_info*),
  8434   8434     void *pContext,
  8435   8435     void (*xDestructor)(void*)
  8436   8436   );
  8437   8437   

Changes to SQLite.Interop/src/ext/fts5.c.

 16885  16885   static void fts5SourceIdFunc(
 16886  16886     sqlite3_context *pCtx,          /* Function call context */
 16887  16887     int nArg,                       /* Number of args */
 16888  16888     sqlite3_value **apUnused        /* Function arguments */
 16889  16889   ){
 16890  16890     assert( nArg==0 );
 16891  16891     UNUSED_PARAM2(nArg, apUnused);
 16892         -  sqlite3_result_text(pCtx, "fts5: 2016-08-11 18:53:32 a12d8059770df4bca59e321c266410344242bf7b", -1, SQLITE_TRANSIENT);
        16892  +  sqlite3_result_text(pCtx, "fts5: 2016-09-08 23:18:34 a04a21ad5aa1a56d50388d6cdb88bae754218a0a", -1, SQLITE_TRANSIENT);
 16893  16893   }
 16894  16894   
 16895  16895   static int fts5Init(sqlite3 *db){
 16896  16896     static const sqlite3_module fts5Mod = {
 16897  16897       /* iVersion      */ 2,
 16898  16898       /* xCreate       */ fts5CreateMethod,
 16899  16899       /* xConnect      */ fts5ConnectMethod,

Changes to readme.htm.

     2      2   <html>
     3      3   <head>
     4      4   <title></title>
     5      5   </head>
     6      6   <body>
     7      7   ADO.NET SQLite Data Provider<br />
     8      8   Version 1.0.103.0 - September XX, 2016 <font color="red">(release scheduled)</font><br />
     9         -Using <a href="https://www.sqlite.org/releaselog/3_14_1.html">SQLite 3.14.1</a><br />
            9  +Using <a href="https://www.sqlite.org/releaselog/3_14_2.html">SQLite 3.14.2</a><br />
    10     10   Originally written by Robert Simpson<br />
    11     11   Released to the public domain, use at your own risk!<br />
    12     12   Official provider website:&nbsp;<a href="https://system.data.sqlite.org/">https://system.data.sqlite.org/</a><br />
    13     13   Legacy versions:&nbsp;<a href="http://sqlite.phxsoftware.com/">http://sqlite.phxsoftware.com/</a><br />
    14     14   <br />
    15     15   The current development version can be downloaded from <a href="https://system.data.sqlite.org/index.html/timeline?y=ci">
    16     16   https://system.data.sqlite.org/index.html/timeline?y=ci</a>
................................................................................
   208    208   
   209    209   <h2><b>Version History</b></h2>
   210    210   
   211    211   <p>
   212    212       <b>1.0.103.0 - September XX, 2016 <font color="red">(release scheduled)</font></b>
   213    213   </p>
   214    214   <ul>
   215         -    <li>Updated to <a href="https://www.sqlite.org/releaselog/3_14_1.html">SQLite 3.14.1</a>.</li>
          215  +    <li>Updated to <a href="https://www.sqlite.org/releaselog/3_14_2.html">SQLite 3.14.2</a>.</li>
   216    216       <li>Add preliminary support for the .NET Framework 4.6.2.</li>
   217    217       <li>Change the SQLiteReadValueCallback delegate &quot;eventArgs&quot; parameter to be of type SQLiteReadEventArgs.&nbsp;<b>** Potentially Incompatible Change **</b></li>
   218    218       <li>Make SQLiteReadValueEventArgs and SQLiteReadArrayEventArgs derive from SQLiteReadEventArgs.&nbsp;<b>** Potentially Incompatible Change **</b></li>
   219    219       <li>Rename SQLiteReadValueEventArgs.ArrayEventArgs property to ExtraEventArgs.&nbsp;<b>** Potentially Incompatible Change **</b></li>
   220    220       <li>Add No_SQLiteGetSettingValue and No_SQLiteXmlConfigFile environment variables.</li>
   221    221       <li>Reduce the number of calls to GetSettingValue from SQLiteConnection. Pursuant to [25d53b48f6].&nbsp;<b>** Potentially Incompatible Change **</b></li>
   222    222       <li>Add NoVerifyTypeAffinity connection flag to disable all type affinity checking.</li>

Changes to www/news.wiki.

     2      2   
     3      3   <b>Version History</b>
     4      4   
     5      5   <p>
     6      6       <b>1.0.103.0 - September XX, 2016 <font color="red">(release scheduled)</font></b>
     7      7   </p>
     8      8   <ul>
     9         -    <li>Updated to [https://www.sqlite.org/releaselog/3_14_1.html|SQLite 3.14.1].</li>
            9  +    <li>Updated to [https://www.sqlite.org/releaselog/3_14_2.html|SQLite 3.14.2].</li>
    10     10       <li>Add preliminary support for the .NET Framework 4.6.2.</li>
    11     11       <li>Change the SQLiteReadValueCallback delegate &quot;eventArgs&quot; parameter to be of type SQLiteReadEventArgs.&nbsp;<b>** Potentially Incompatible Change **</b></li>
    12     12       <li>Make SQLiteReadValueEventArgs and SQLiteReadArrayEventArgs derive from SQLiteReadEventArgs.&nbsp;<b>** Potentially Incompatible Change **</b></li>
    13     13       <li>Rename SQLiteReadValueEventArgs.ArrayEventArgs property to ExtraEventArgs.&nbsp;<b>** Potentially Incompatible Change **</b></li>
    14     14       <li>Add No_SQLiteGetSettingValue and No_SQLiteXmlConfigFile environment variables.</li>
    15     15       <li>Reduce the number of calls to GetSettingValue from SQLiteConnection. Pursuant to [25d53b48f6].&nbsp;<b>** Potentially Incompatible Change **</b></li>
    16     16       <li>Add NoVerifyTypeAffinity connection flag to disable all type affinity checking.</li>