Fossil SCM

Update the built-in SQLite to another 3.14 alpha version.

drh 2016-07-29 15:12 trunk
Commit 59bf47b2d5b0ed3136430dbcd8607824ce979b16
2 files changed +837 -781 +464 -450
+837 -781
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -65,10 +65,18 @@
6565
** In all cases, the special comment must be enclosed in the usual
6666
** slash-asterisk...asterisk-slash comment marks, with no spaces between the
6767
** asterisks and the comment text.
6868
*/
6969
70
+/*
71
+** Make sure the Tcl calling convention macro is defined. This macro is
72
+** only used by test code and Tcl integration code.
73
+*/
74
+#ifndef SQLITE_TCLAPI
75
+# define SQLITE_TCLAPI
76
+#endif
77
+
7078
/*
7179
** Make sure that rand_s() is available on Windows systems with MSVC 2005
7280
** or higher.
7381
*/
7482
#if defined(_MSC_VER) && _MSC_VER>=1400
@@ -304,12 +312,21 @@
304312
# define SQLITE_API
305313
#endif
306314
#ifndef SQLITE_CDECL
307315
# define SQLITE_CDECL
308316
#endif
317
+#ifndef SQLITE_APICALL
318
+# define SQLITE_APICALL
319
+#endif
309320
#ifndef SQLITE_STDCALL
310
-# define SQLITE_STDCALL
321
+# define SQLITE_STDCALL SQLITE_APICALL
322
+#endif
323
+#ifndef SQLITE_CALLBACK
324
+# define SQLITE_CALLBACK
325
+#endif
326
+#ifndef SQLITE_SYSAPI
327
+# define SQLITE_SYSAPI
311328
#endif
312329
313330
/*
314331
** These no-op macros are used in front of interfaces to mark those
315332
** interfaces as either deprecated or experimental. New applications
@@ -363,11 +380,11 @@
363380
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
364381
** [sqlite_version()] and [sqlite_source_id()].
365382
*/
366383
#define SQLITE_VERSION "3.14.0"
367384
#define SQLITE_VERSION_NUMBER 3014000
368
-#define SQLITE_SOURCE_ID "2016-07-28 12:52:30 6feff15cae8f0427be790355841d49c479c1c586"
385
+#define SQLITE_SOURCE_ID "2016-07-29 04:12:18 544c990afd3b64064cc4d970ec5d7eb23eeb9914"
369386
370387
/*
371388
** CAPI3REF: Run-Time Library Version Numbers
372389
** KEYWORDS: sqlite3_version, sqlite3_sourceid
373390
**
@@ -396,13 +413,13 @@
396413
** [SQLITE_SOURCE_ID] C preprocessor macro.
397414
**
398415
** See also: [sqlite_version()] and [sqlite_source_id()].
399416
*/
400417
SQLITE_API const char sqlite3_version[] = SQLITE_VERSION;
401
-SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void);
402
-SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void);
403
-SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void);
418
+SQLITE_API const char *SQLITE_APICALL sqlite3_libversion(void);
419
+SQLITE_API const char *SQLITE_APICALL sqlite3_sourceid(void);
420
+SQLITE_API int SQLITE_APICALL sqlite3_libversion_number(void);
404421
405422
/*
406423
** CAPI3REF: Run-Time Library Compilation Options Diagnostics
407424
**
408425
** ^The sqlite3_compileoption_used() function returns 0 or 1
@@ -423,12 +440,12 @@
423440
**
424441
** See also: SQL functions [sqlite_compileoption_used()] and
425442
** [sqlite_compileoption_get()] and the [compile_options pragma].
426443
*/
427444
#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
428
-SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName);
429
-SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N);
445
+SQLITE_API int SQLITE_APICALL sqlite3_compileoption_used(const char *zOptName);
446
+SQLITE_API const char *SQLITE_APICALL sqlite3_compileoption_get(int N);
430447
#endif
431448
432449
/*
433450
** CAPI3REF: Test To See If The Library Is Threadsafe
434451
**
@@ -463,11 +480,11 @@
463480
** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
464481
** is unchanged by calls to sqlite3_config().)^
465482
**
466483
** See the [threading mode] documentation for additional information.
467484
*/
468
-SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void);
485
+SQLITE_API int SQLITE_APICALL sqlite3_threadsafe(void);
469486
470487
/*
471488
** CAPI3REF: Database Connection Handle
472489
** KEYWORDS: {database connection} {database connections}
473490
**
@@ -560,19 +577,19 @@
560577
** from [sqlite3_open()], [sqlite3_open16()], or
561578
** [sqlite3_open_v2()], and not previously closed.
562579
** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
563580
** argument is a harmless no-op.
564581
*/
565
-SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3*);
566
-SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3*);
582
+SQLITE_API int SQLITE_APICALL sqlite3_close(sqlite3*);
583
+SQLITE_API int SQLITE_APICALL sqlite3_close_v2(sqlite3*);
567584
568585
/*
569586
** The type for a callback function.
570587
** This is legacy and deprecated. It is included for historical
571588
** compatibility and is not documented.
572589
*/
573
-typedef int (*sqlite3_callback)(void*,int,char**, char**);
590
+typedef int (SQLITE_CALLBACK *sqlite3_callback)(void*,int,char**, char**);
574591
575592
/*
576593
** CAPI3REF: One-Step Query Execution Interface
577594
** METHOD: sqlite3
578595
**
@@ -632,14 +649,14 @@
632649
** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
633650
** <li> The application must not modify the SQL statement text passed into
634651
** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
635652
** </ul>
636653
*/
637
-SQLITE_API int SQLITE_STDCALL sqlite3_exec(
654
+SQLITE_API int SQLITE_APICALL sqlite3_exec(
638655
sqlite3*, /* An open database */
639656
const char *sql, /* SQL to be evaluated */
640
- int (*callback)(void*,int,char**,char**), /* Callback function */
657
+ int (SQLITE_CALLBACK *callback)(void*,int,char**,char**), /* Callback function */
641658
void *, /* 1st argument to callback */
642659
char **errmsg /* Error msg written here */
643660
);
644661
645662
/*
@@ -983,30 +1000,30 @@
9831000
** database corruption.
9841001
*/
9851002
typedef struct sqlite3_io_methods sqlite3_io_methods;
9861003
struct sqlite3_io_methods {
9871004
int iVersion;
988
- int (*xClose)(sqlite3_file*);
989
- int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
990
- int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
991
- int (*xTruncate)(sqlite3_file*, sqlite3_int64 size);
992
- int (*xSync)(sqlite3_file*, int flags);
993
- int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
994
- int (*xLock)(sqlite3_file*, int);
995
- int (*xUnlock)(sqlite3_file*, int);
996
- int (*xCheckReservedLock)(sqlite3_file*, int *pResOut);
997
- int (*xFileControl)(sqlite3_file*, int op, void *pArg);
998
- int (*xSectorSize)(sqlite3_file*);
999
- int (*xDeviceCharacteristics)(sqlite3_file*);
1005
+ int (SQLITE_CALLBACK *xClose)(sqlite3_file*);
1006
+ int (SQLITE_CALLBACK *xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
1007
+ int (SQLITE_CALLBACK *xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
1008
+ int (SQLITE_CALLBACK *xTruncate)(sqlite3_file*, sqlite3_int64 size);
1009
+ int (SQLITE_CALLBACK *xSync)(sqlite3_file*, int flags);
1010
+ int (SQLITE_CALLBACK *xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
1011
+ int (SQLITE_CALLBACK *xLock)(sqlite3_file*, int);
1012
+ int (SQLITE_CALLBACK *xUnlock)(sqlite3_file*, int);
1013
+ int (SQLITE_CALLBACK *xCheckReservedLock)(sqlite3_file*, int *pResOut);
1014
+ int (SQLITE_CALLBACK *xFileControl)(sqlite3_file*, int op, void *pArg);
1015
+ int (SQLITE_CALLBACK *xSectorSize)(sqlite3_file*);
1016
+ int (SQLITE_CALLBACK *xDeviceCharacteristics)(sqlite3_file*);
10001017
/* Methods above are valid for version 1 */
1001
- int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
1002
- int (*xShmLock)(sqlite3_file*, int offset, int n, int flags);
1003
- void (*xShmBarrier)(sqlite3_file*);
1004
- int (*xShmUnmap)(sqlite3_file*, int deleteFlag);
1018
+ int (SQLITE_CALLBACK *xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
1019
+ int (SQLITE_CALLBACK *xShmLock)(sqlite3_file*, int offset, int n, int flags);
1020
+ void (SQLITE_CALLBACK *xShmBarrier)(sqlite3_file*);
1021
+ int (SQLITE_CALLBACK *xShmUnmap)(sqlite3_file*, int deleteFlag);
10051022
/* Methods above are valid for version 2 */
1006
- int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
1007
- int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p);
1023
+ int (SQLITE_CALLBACK *xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
1024
+ int (SQLITE_CALLBACK *xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p);
10081025
/* Methods above are valid for version 3 */
10091026
/* Additional methods may be added in future releases */
10101027
};
10111028
10121029
/*
@@ -1178,11 +1195,11 @@
11781195
** ^The [SQLITE_FCNTL_BUSYHANDLER]
11791196
** file-control may be invoked by SQLite on the database file handle
11801197
** shortly after it is opened in order to provide a custom VFS with access
11811198
** to the connections busy-handler callback. The argument is of type (void **)
11821199
** - an array of two (void *) values. The first (void *) actually points
1183
-** to a function of type (int (*)(void *)). In order to invoke the connections
1200
+** to a function of type (int (SQLITE_CALLBACK *)(void *)). In order to invoke the connections
11841201
** busy-handler, this function should be invoked with the second (void *) in
11851202
** the array as the only argument. If it returns non-zero, then the operation
11861203
** should be retried. If it returns zero, the custom VFS should abandon the
11871204
** current operation.
11881205
**
@@ -1444,43 +1461,43 @@
14441461
** or all of these interfaces to be NULL or for their behavior to change
14451462
** from one release to the next. Applications must not attempt to access
14461463
** any of these methods if the iVersion of the VFS is less than 3.
14471464
*/
14481465
typedef struct sqlite3_vfs sqlite3_vfs;
1449
-typedef void (*sqlite3_syscall_ptr)(void);
1466
+typedef void (SQLITE_SYSAPI *sqlite3_syscall_ptr)(void);
14501467
struct sqlite3_vfs {
14511468
int iVersion; /* Structure version number (currently 3) */
14521469
int szOsFile; /* Size of subclassed sqlite3_file */
14531470
int mxPathname; /* Maximum file pathname length */
14541471
sqlite3_vfs *pNext; /* Next registered VFS */
14551472
const char *zName; /* Name of this virtual file system */
14561473
void *pAppData; /* Pointer to application-specific data */
1457
- int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
1474
+ int (SQLITE_CALLBACK *xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
14581475
int flags, int *pOutFlags);
1459
- int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
1460
- int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
1461
- int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
1462
- void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename);
1463
- void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
1464
- void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
1465
- void (*xDlClose)(sqlite3_vfs*, void*);
1466
- int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
1467
- int (*xSleep)(sqlite3_vfs*, int microseconds);
1468
- int (*xCurrentTime)(sqlite3_vfs*, double*);
1469
- int (*xGetLastError)(sqlite3_vfs*, int, char *);
1476
+ int (SQLITE_CALLBACK *xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
1477
+ int (SQLITE_CALLBACK *xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
1478
+ int (SQLITE_CALLBACK *xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
1479
+ void *(SQLITE_CALLBACK *xDlOpen)(sqlite3_vfs*, const char *zFilename);
1480
+ void (SQLITE_CALLBACK *xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
1481
+ void (SQLITE_CALLBACK *(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
1482
+ void (SQLITE_CALLBACK *xDlClose)(sqlite3_vfs*, void*);
1483
+ int (SQLITE_CALLBACK *xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
1484
+ int (SQLITE_CALLBACK *xSleep)(sqlite3_vfs*, int microseconds);
1485
+ int (SQLITE_CALLBACK *xCurrentTime)(sqlite3_vfs*, double*);
1486
+ int (SQLITE_CALLBACK *xGetLastError)(sqlite3_vfs*, int, char *);
14701487
/*
14711488
** The methods above are in version 1 of the sqlite_vfs object
14721489
** definition. Those that follow are added in version 2 or later
14731490
*/
1474
- int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
1491
+ int (SQLITE_CALLBACK *xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
14751492
/*
14761493
** The methods above are in versions 1 and 2 of the sqlite_vfs object.
14771494
** Those below are for version 3 and greater.
14781495
*/
1479
- int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
1480
- sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName);
1481
- const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName);
1496
+ int (SQLITE_CALLBACK *xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
1497
+ sqlite3_syscall_ptr (SQLITE_CALLBACK *xGetSystemCall)(sqlite3_vfs*, const char *zName);
1498
+ const char *(SQLITE_CALLBACK *xNextSystemCall)(sqlite3_vfs*, const char *zName);
14821499
/*
14831500
** The methods above are in versions 1 through 3 of the sqlite_vfs object.
14841501
** New fields may be appended in future versions. The iVersion
14851502
** value will increment whenever this happens.
14861503
*/
@@ -1621,14 +1638,14 @@
16211638
** sqlite3_os_init() and sqlite3_os_end(). An application-supplied
16221639
** implementation of sqlite3_os_init() or sqlite3_os_end()
16231640
** must return [SQLITE_OK] on success and some other [error code] upon
16241641
** failure.
16251642
*/
1626
-SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void);
1627
-SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void);
1628
-SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void);
1629
-SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void);
1643
+SQLITE_API int SQLITE_APICALL sqlite3_initialize(void);
1644
+SQLITE_API int SQLITE_APICALL sqlite3_shutdown(void);
1645
+SQLITE_API int SQLITE_APICALL sqlite3_os_init(void);
1646
+SQLITE_API int SQLITE_APICALL sqlite3_os_end(void);
16301647
16311648
/*
16321649
** CAPI3REF: Configuring The SQLite Library
16331650
**
16341651
** The sqlite3_config() interface is used to make global configuration
@@ -1743,17 +1760,17 @@
17431760
** SQLite will never invoke xInit() more than once without an intervening
17441761
** call to xShutdown().
17451762
*/
17461763
typedef struct sqlite3_mem_methods sqlite3_mem_methods;
17471764
struct sqlite3_mem_methods {
1748
- void *(*xMalloc)(int); /* Memory allocation function */
1749
- void (*xFree)(void*); /* Free a prior allocation */
1750
- void *(*xRealloc)(void*,int); /* Resize an allocation */
1751
- int (*xSize)(void*); /* Return the size of an allocation */
1752
- int (*xRoundup)(int); /* Round up request size to allocation size */
1753
- int (*xInit)(void*); /* Initialize the memory allocator */
1754
- void (*xShutdown)(void*); /* Deinitialize the memory allocator */
1765
+ void *(SQLITE_CALLBACK *xMalloc)(int); /* Memory allocation function */
1766
+ void (SQLITE_CALLBACK *xFree)(void*); /* Free a prior allocation */
1767
+ void *(SQLITE_CALLBACK *xRealloc)(void*,int); /* Resize an allocation */
1768
+ int (SQLITE_CALLBACK *xSize)(void*); /* Return the size of an allocation */
1769
+ int (SQLITE_CALLBACK *xRoundup)(int); /* Round up request size to allocation size */
1770
+ int (SQLITE_CALLBACK *xInit)(void*); /* Initialize the memory allocator */
1771
+ void (SQLITE_CALLBACK *xShutdown)(void*); /* Deinitialize the memory allocator */
17551772
void *pAppData; /* Argument to xInit() and xShutdown() */
17561773
};
17571774
17581775
/*
17591776
** CAPI3REF: Configuration Options
@@ -1966,11 +1983,11 @@
19661983
**
19671984
** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
19681985
** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
19691986
** global [error log].
19701987
** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a
1971
-** function with a call signature of void(*)(void*,int,const char*),
1988
+** function with a call signature of void(SQLITE_CALLBACK *)(void*,int,const char*),
19721989
** and a pointer to void. ^If the function pointer is not NULL, it is
19731990
** invoked by [sqlite3_log()] to process each logging event. ^If the
19741991
** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op.
19751992
** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is
19761993
** passed through as the first parameter to the application-defined logger
@@ -2019,11 +2036,11 @@
20192036
**
20202037
** [[SQLITE_CONFIG_SQLLOG]]
20212038
** <dt>SQLITE_CONFIG_SQLLOG
20222039
** <dd>This option is only available if sqlite is compiled with the
20232040
** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should
2024
-** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int).
2041
+** be a pointer to a function of type void(SQLITE_CALLBACK *)(void*,sqlite3*,const char*, int).
20252042
** The second should be of type (void*). The callback is invoked by the library
20262043
** in three separate circumstances, identified by the value passed as the
20272044
** fourth parameter. If the fourth parameter is 0, then the database connection
20282045
** passed as the second argument has just been opened. The third argument
20292046
** points to a buffer containing the name of the main database file. If the
@@ -2217,11 +2234,11 @@
22172234
**
22182235
** ^The sqlite3_extended_result_codes() routine enables or disables the
22192236
** [extended result codes] feature of SQLite. ^The extended result
22202237
** codes are disabled by default for historical compatibility.
22212238
*/
2222
-SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3*, int onoff);
2239
+SQLITE_API int SQLITE_APICALL sqlite3_extended_result_codes(sqlite3*, int onoff);
22232240
22242241
/*
22252242
** CAPI3REF: Last Insert Rowid
22262243
** METHOD: sqlite3
22272244
**
@@ -2269,11 +2286,11 @@
22692286
** function is running and thus changes the last insert [rowid],
22702287
** then the value returned by [sqlite3_last_insert_rowid()] is
22712288
** unpredictable and might not equal either the old or the new
22722289
** last insert [rowid].
22732290
*/
2274
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3*);
2291
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_last_insert_rowid(sqlite3*);
22752292
22762293
/*
22772294
** CAPI3REF: Count The Number Of Rows Modified
22782295
** METHOD: sqlite3
22792296
**
@@ -2322,11 +2339,11 @@
23222339
**
23232340
** If a separate thread makes changes on the same database connection
23242341
** while [sqlite3_changes()] is running then the value returned
23252342
** is unpredictable and not meaningful.
23262343
*/
2327
-SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3*);
2344
+SQLITE_API int SQLITE_APICALL sqlite3_changes(sqlite3*);
23282345
23292346
/*
23302347
** CAPI3REF: Total Number Of Rows Modified
23312348
** METHOD: sqlite3
23322349
**
@@ -2346,11 +2363,11 @@
23462363
**
23472364
** If a separate thread makes changes on the same database connection
23482365
** while [sqlite3_total_changes()] is running then the value
23492366
** returned is unpredictable and not meaningful.
23502367
*/
2351
-SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3*);
2368
+SQLITE_API int SQLITE_APICALL sqlite3_total_changes(sqlite3*);
23522369
23532370
/*
23542371
** CAPI3REF: Interrupt A Long-Running Query
23552372
** METHOD: sqlite3
23562373
**
@@ -2386,11 +2403,11 @@
23862403
** that are started after the sqlite3_interrupt() call returns.
23872404
**
23882405
** If the database connection closes while [sqlite3_interrupt()]
23892406
** is running then bad things will likely happen.
23902407
*/
2391
-SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3*);
2408
+SQLITE_API void SQLITE_APICALL sqlite3_interrupt(sqlite3*);
23922409
23932410
/*
23942411
** CAPI3REF: Determine If An SQL Statement Is Complete
23952412
**
23962413
** These routines are useful during command-line input to determine if the
@@ -2421,12 +2438,12 @@
24212438
** UTF-8 string.
24222439
**
24232440
** The input to [sqlite3_complete16()] must be a zero-terminated
24242441
** UTF-16 string in native byte order.
24252442
*/
2426
-SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *sql);
2427
-SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *sql);
2443
+SQLITE_API int SQLITE_APICALL sqlite3_complete(const char *sql);
2444
+SQLITE_API int SQLITE_APICALL sqlite3_complete16(const void *sql);
24282445
24292446
/*
24302447
** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
24312448
** KEYWORDS: {busy-handler callback} {busy handler}
24322449
** METHOD: sqlite3
@@ -2483,11 +2500,11 @@
24832500
** result in undefined behavior.
24842501
**
24852502
** A busy handler must not close the database connection
24862503
** or [prepared statement] that invoked the busy handler.
24872504
*/
2488
-SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*);
2505
+SQLITE_API int SQLITE_APICALL sqlite3_busy_handler(sqlite3*, int(SQLITE_CALLBACK *)(void*,int), void*);
24892506
24902507
/*
24912508
** CAPI3REF: Set A Busy Timeout
24922509
** METHOD: sqlite3
24932510
**
@@ -2506,11 +2523,11 @@
25062523
** was defined (using [sqlite3_busy_handler()]) prior to calling
25072524
** this routine, that other busy handler is cleared.)^
25082525
**
25092526
** See also: [PRAGMA busy_timeout]
25102527
*/
2511
-SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3*, int ms);
2528
+SQLITE_API int SQLITE_APICALL sqlite3_busy_timeout(sqlite3*, int ms);
25122529
25132530
/*
25142531
** CAPI3REF: Convenience Routines For Running Queries
25152532
** METHOD: sqlite3
25162533
**
@@ -2581,19 +2598,19 @@
25812598
** interface defined here. As a consequence, errors that occur in the
25822599
** wrapper layer outside of the internal [sqlite3_exec()] call are not
25832600
** reflected in subsequent calls to [sqlite3_errcode()] or
25842601
** [sqlite3_errmsg()].
25852602
*/
2586
-SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
2603
+SQLITE_API int SQLITE_APICALL sqlite3_get_table(
25872604
sqlite3 *db, /* An open database */
25882605
const char *zSql, /* SQL to be evaluated */
25892606
char ***pazResult, /* Results of the query */
25902607
int *pnRow, /* Number of result rows written here */
25912608
int *pnColumn, /* Number of result columns written here */
25922609
char **pzErrmsg /* Error msg written here */
25932610
);
2594
-SQLITE_API void SQLITE_STDCALL sqlite3_free_table(char **result);
2611
+SQLITE_API void SQLITE_APICALL sqlite3_free_table(char **result);
25952612
25962613
/*
25972614
** CAPI3REF: Formatted String Printing Functions
25982615
**
25992616
** These routines are work-alikes of the "printf()" family of functions
@@ -2696,13 +2713,13 @@
26962713
** ^(The "%z" formatting option works like "%s" but with the
26972714
** addition that after the string has been read and copied into
26982715
** the result, [sqlite3_free()] is called on the input string.)^
26992716
*/
27002717
SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...);
2701
-SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list);
2718
+SQLITE_API char *SQLITE_APICALL sqlite3_vmprintf(const char*, va_list);
27022719
SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...);
2703
-SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list);
2720
+SQLITE_API char *SQLITE_APICALL sqlite3_vsnprintf(int,char*,const char*, va_list);
27042721
27052722
/*
27062723
** CAPI3REF: Memory Allocation Subsystem
27072724
**
27082725
** The SQLite core uses these three routines for all of its own
@@ -2788,16 +2805,16 @@
27882805
**
27892806
** The application must not read or write any part of
27902807
** a block of memory after it has been released using
27912808
** [sqlite3_free()] or [sqlite3_realloc()].
27922809
*/
2793
-SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int);
2794
-SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64);
2795
-SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void*, int);
2796
-SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void*, sqlite3_uint64);
2797
-SQLITE_API void SQLITE_STDCALL sqlite3_free(void*);
2798
-SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void*);
2810
+SQLITE_API void *SQLITE_APICALL sqlite3_malloc(int);
2811
+SQLITE_API void *SQLITE_APICALL sqlite3_malloc64(sqlite3_uint64);
2812
+SQLITE_API void *SQLITE_APICALL sqlite3_realloc(void*, int);
2813
+SQLITE_API void *SQLITE_APICALL sqlite3_realloc64(void*, sqlite3_uint64);
2814
+SQLITE_API void SQLITE_APICALL sqlite3_free(void*);
2815
+SQLITE_API sqlite3_uint64 SQLITE_APICALL sqlite3_msize(void*);
27992816
28002817
/*
28012818
** CAPI3REF: Memory Allocator Statistics
28022819
**
28032820
** SQLite provides these two interfaces for reporting on the status
@@ -2818,12 +2835,12 @@
28182835
** [sqlite3_memory_used()] if and only if the parameter to
28192836
** [sqlite3_memory_highwater()] is true. ^The value returned
28202837
** by [sqlite3_memory_highwater(1)] is the high-water mark
28212838
** prior to the reset.
28222839
*/
2823
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void);
2824
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag);
2840
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_used(void);
2841
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_highwater(int resetFlag);
28252842
28262843
/*
28272844
** CAPI3REF: Pseudo-Random Number Generator
28282845
**
28292846
** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
@@ -2842,11 +2859,11 @@
28422859
** ^If the previous call to this routine had an N of 1 or more and a
28432860
** non-NULL P then the pseudo-randomness is generated
28442861
** internally and without recourse to the [sqlite3_vfs] xRandomness
28452862
** method.
28462863
*/
2847
-SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *P);
2864
+SQLITE_API void SQLITE_APICALL sqlite3_randomness(int N, void *P);
28482865
28492866
/*
28502867
** CAPI3REF: Compile-Time Authorization Callbacks
28512868
** METHOD: sqlite3
28522869
**
@@ -2925,13 +2942,13 @@
29252942
** [sqlite3_prepare()] or its variants. Authorization is not
29262943
** performed during statement evaluation in [sqlite3_step()], unless
29272944
** as stated in the previous paragraph, sqlite3_step() invokes
29282945
** sqlite3_prepare_v2() to reprepare a statement after a schema change.
29292946
*/
2930
-SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
2947
+SQLITE_API int SQLITE_APICALL sqlite3_set_authorizer(
29312948
sqlite3*,
2932
- int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
2949
+ int (SQLITE_CALLBACK *xAuth)(void*,int,const char*,const char*,const char*,const char*),
29332950
void *pUserData
29342951
);
29352952
29362953
/*
29372954
** CAPI3REF: Authorizer Return Codes
@@ -3033,14 +3050,14 @@
30333050
** digits in the time are meaningless. Future versions of SQLite
30343051
** might provide greater resolution on the profiler callback. The
30353052
** sqlite3_profile() function is considered experimental and is
30363053
** subject to change in future versions of SQLite.
30373054
*/
3038
-SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_trace(sqlite3*,
3039
- void(*xTrace)(void*,const char*), void*);
3040
-SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_profile(sqlite3*,
3041
- void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
3055
+SQLITE_API SQLITE_DEPRECATED void *SQLITE_APICALL sqlite3_trace(sqlite3*,
3056
+ void(SQLITE_CALLBACK *xTrace)(void*,const char*), void*);
3057
+SQLITE_API SQLITE_DEPRECATED void *SQLITE_APICALL sqlite3_profile(sqlite3*,
3058
+ void(SQLITE_CALLBACK *xProfile)(void*,const char*,sqlite3_uint64), void*);
30423059
30433060
/*
30443061
** CAPI3REF: SQL Trace Event Codes
30453062
** KEYWORDS: SQLITE_TRACE
30463063
**
@@ -3124,14 +3141,14 @@
31243141
**
31253142
** The sqlite3_trace_v2() interface is intended to replace the legacy
31263143
** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which
31273144
** are deprecated.
31283145
*/
3129
-SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2(
3146
+SQLITE_API int SQLITE_APICALL sqlite3_trace_v2(
31303147
sqlite3*,
31313148
unsigned uMask,
3132
- int(*xCallback)(unsigned,void*,void*,void*),
3149
+ int(SQLITE_CALLBACK *xCallback)(unsigned,void*,void*,void*),
31333150
void *pCtx
31343151
);
31353152
31363153
/*
31373154
** CAPI3REF: Query Progress Callbacks
@@ -3163,11 +3180,11 @@
31633180
** the database connection that invoked the progress handler.
31643181
** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
31653182
** database connections for the meaning of "modify" in this paragraph.
31663183
**
31673184
*/
3168
-SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
3185
+SQLITE_API void SQLITE_APICALL sqlite3_progress_handler(sqlite3*, int, int(SQLITE_CALLBACK *)(void*), void*);
31693186
31703187
/*
31713188
** CAPI3REF: Opening A New Database Connection
31723189
** CONSTRUCTOR: sqlite3
31733190
**
@@ -3392,19 +3409,19 @@
33923409
** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various
33933410
** features that require the use of temporary files may fail.
33943411
**
33953412
** See also: [sqlite3_temp_directory]
33963413
*/
3397
-SQLITE_API int SQLITE_STDCALL sqlite3_open(
3414
+SQLITE_API int SQLITE_APICALL sqlite3_open(
33983415
const char *filename, /* Database filename (UTF-8) */
33993416
sqlite3 **ppDb /* OUT: SQLite db handle */
34003417
);
3401
-SQLITE_API int SQLITE_STDCALL sqlite3_open16(
3418
+SQLITE_API int SQLITE_APICALL sqlite3_open16(
34023419
const void *filename, /* Database filename (UTF-16) */
34033420
sqlite3 **ppDb /* OUT: SQLite db handle */
34043421
);
3405
-SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
3422
+SQLITE_API int SQLITE_APICALL sqlite3_open_v2(
34063423
const char *filename, /* Database filename (UTF-8) */
34073424
sqlite3 **ppDb, /* OUT: SQLite db handle */
34083425
int flags, /* Flags */
34093426
const char *zVfs /* Name of VFS module to use */
34103427
);
@@ -3446,13 +3463,13 @@
34463463
** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and
34473464
** is not a database file pathname pointer that SQLite passed into the xOpen
34483465
** VFS method, then the behavior of this routine is undefined and probably
34493466
** undesirable.
34503467
*/
3451
-SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3452
-SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3453
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
3468
+SQLITE_API const char *SQLITE_APICALL sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3469
+SQLITE_API int SQLITE_APICALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3470
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
34543471
34553472
34563473
/*
34573474
** CAPI3REF: Error Codes And Messages
34583475
** METHOD: sqlite3
@@ -3492,15 +3509,15 @@
34923509
**
34933510
** If an interface fails with SQLITE_MISUSE, that means the interface
34943511
** was invoked incorrectly by the application. In that case, the
34953512
** error code and message may or may not be set.
34963513
*/
3497
-SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db);
3498
-SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db);
3499
-SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*);
3500
-SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*);
3501
-SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int);
3514
+SQLITE_API int SQLITE_APICALL sqlite3_errcode(sqlite3 *db);
3515
+SQLITE_API int SQLITE_APICALL sqlite3_extended_errcode(sqlite3 *db);
3516
+SQLITE_API const char *SQLITE_APICALL sqlite3_errmsg(sqlite3*);
3517
+SQLITE_API const void *SQLITE_APICALL sqlite3_errmsg16(sqlite3*);
3518
+SQLITE_API const char *SQLITE_APICALL sqlite3_errstr(int);
35023519
35033520
/*
35043521
** CAPI3REF: Prepared Statement Object
35053522
** KEYWORDS: {prepared statement} {prepared statements}
35063523
**
@@ -3564,11 +3581,11 @@
35643581
** created by an untrusted script can be contained using the
35653582
** [max_page_count] [PRAGMA].
35663583
**
35673584
** New run-time limit categories may be added in future releases.
35683585
*/
3569
-SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3*, int id, int newVal);
3586
+SQLITE_API int SQLITE_APICALL sqlite3_limit(sqlite3*, int id, int newVal);
35703587
35713588
/*
35723589
** CAPI3REF: Run-Time Limit Categories
35733590
** KEYWORDS: {limit category} {*limit categories}
35743591
**
@@ -3716,32 +3733,32 @@
37163733
** or [GLOB] operator or if the parameter is compared to an indexed column
37173734
** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
37183735
** </li>
37193736
** </ol>
37203737
*/
3721
-SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
3738
+SQLITE_API int SQLITE_APICALL sqlite3_prepare(
37223739
sqlite3 *db, /* Database handle */
37233740
const char *zSql, /* SQL statement, UTF-8 encoded */
37243741
int nByte, /* Maximum length of zSql in bytes. */
37253742
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
37263743
const char **pzTail /* OUT: Pointer to unused portion of zSql */
37273744
);
3728
-SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
3745
+SQLITE_API int SQLITE_APICALL sqlite3_prepare_v2(
37293746
sqlite3 *db, /* Database handle */
37303747
const char *zSql, /* SQL statement, UTF-8 encoded */
37313748
int nByte, /* Maximum length of zSql in bytes. */
37323749
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
37333750
const char **pzTail /* OUT: Pointer to unused portion of zSql */
37343751
);
3735
-SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
3752
+SQLITE_API int SQLITE_APICALL sqlite3_prepare16(
37363753
sqlite3 *db, /* Database handle */
37373754
const void *zSql, /* SQL statement, UTF-16 encoded */
37383755
int nByte, /* Maximum length of zSql in bytes. */
37393756
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
37403757
const void **pzTail /* OUT: Pointer to unused portion of zSql */
37413758
);
3742
-SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
3759
+SQLITE_API int SQLITE_APICALL sqlite3_prepare16_v2(
37433760
sqlite3 *db, /* Database handle */
37443761
const void *zSql, /* SQL statement, UTF-16 encoded */
37453762
int nByte, /* Maximum length of zSql in bytes. */
37463763
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
37473764
const void **pzTail /* OUT: Pointer to unused portion of zSql */
@@ -3776,12 +3793,12 @@
37763793
** automatically freed when the prepared statement is finalized.
37773794
** ^The string returned by sqlite3_expanded_sql(P), on the other hand,
37783795
** is obtained from [sqlite3_malloc()] and must be free by the application
37793796
** by passing it to [sqlite3_free()].
37803797
*/
3781
-SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt);
3782
-SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt);
3798
+SQLITE_API const char *SQLITE_APICALL sqlite3_sql(sqlite3_stmt *pStmt);
3799
+SQLITE_API char *SQLITE_APICALL sqlite3_expanded_sql(sqlite3_stmt *pStmt);
37833800
37843801
/*
37853802
** CAPI3REF: Determine If An SQL Statement Writes The Database
37863803
** METHOD: sqlite3_stmt
37873804
**
@@ -3809,11 +3826,11 @@
38093826
** database. ^The [ATTACH] and [DETACH] statements also cause
38103827
** sqlite3_stmt_readonly() to return true since, while those statements
38113828
** change the configuration of a database connection, they do not make
38123829
** changes to the content of the database files on disk.
38133830
*/
3814
-SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
3831
+SQLITE_API int SQLITE_APICALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
38153832
38163833
/*
38173834
** CAPI3REF: Determine If A Prepared Statement Has Been Reset
38183835
** METHOD: sqlite3_stmt
38193836
**
@@ -3830,11 +3847,11 @@
38303847
** to locate all prepared statements associated with a database
38313848
** connection that are in need of being reset. This can be used,
38323849
** for example, in diagnostic routines to search for prepared
38333850
** statements that are holding a transaction open.
38343851
*/
3835
-SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt*);
3852
+SQLITE_API int SQLITE_APICALL sqlite3_stmt_busy(sqlite3_stmt*);
38363853
38373854
/*
38383855
** CAPI3REF: Dynamically Typed Value Object
38393856
** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
38403857
**
@@ -3994,24 +4011,24 @@
39944011
** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails.
39954012
**
39964013
** See also: [sqlite3_bind_parameter_count()],
39974014
** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].
39984015
*/
3999
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
4000
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
4001
- void(*)(void*));
4002
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt*, int, double);
4003
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt*, int, int);
4004
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
4005
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt*, int);
4006
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
4007
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
4008
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
4009
- void(*)(void*), unsigned char encoding);
4010
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
4011
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
4012
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
4016
+SQLITE_API int SQLITE_APICALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(SQLITE_CALLBACK *)(void*));
4017
+SQLITE_API int SQLITE_APICALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
4018
+ void(SQLITE_CALLBACK *)(void*));
4019
+SQLITE_API int SQLITE_APICALL sqlite3_bind_double(sqlite3_stmt*, int, double);
4020
+SQLITE_API int SQLITE_APICALL sqlite3_bind_int(sqlite3_stmt*, int, int);
4021
+SQLITE_API int SQLITE_APICALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
4022
+SQLITE_API int SQLITE_APICALL sqlite3_bind_null(sqlite3_stmt*, int);
4023
+SQLITE_API int SQLITE_APICALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(SQLITE_CALLBACK *)(void*));
4024
+SQLITE_API int SQLITE_APICALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(SQLITE_CALLBACK *)(void*));
4025
+SQLITE_API int SQLITE_APICALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
4026
+ void(SQLITE_CALLBACK *)(void*), unsigned char encoding);
4027
+SQLITE_API int SQLITE_APICALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
4028
+SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
4029
+SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
40134030
40144031
/*
40154032
** CAPI3REF: Number Of SQL Parameters
40164033
** METHOD: sqlite3_stmt
40174034
**
@@ -4028,11 +4045,11 @@
40284045
**
40294046
** See also: [sqlite3_bind_blob|sqlite3_bind()],
40304047
** [sqlite3_bind_parameter_name()], and
40314048
** [sqlite3_bind_parameter_index()].
40324049
*/
4033
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt*);
4050
+SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_count(sqlite3_stmt*);
40344051
40354052
/*
40364053
** CAPI3REF: Name Of A Host Parameter
40374054
** METHOD: sqlite3_stmt
40384055
**
@@ -4056,11 +4073,11 @@
40564073
**
40574074
** See also: [sqlite3_bind_blob|sqlite3_bind()],
40584075
** [sqlite3_bind_parameter_count()], and
40594076
** [sqlite3_bind_parameter_index()].
40604077
*/
4061
-SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
4078
+SQLITE_API const char *SQLITE_APICALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
40624079
40634080
/*
40644081
** CAPI3REF: Index Of A Parameter With A Given Name
40654082
** METHOD: sqlite3_stmt
40664083
**
@@ -4073,21 +4090,21 @@
40734090
**
40744091
** See also: [sqlite3_bind_blob|sqlite3_bind()],
40754092
** [sqlite3_bind_parameter_count()], and
40764093
** [sqlite3_bind_parameter_name()].
40774094
*/
4078
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
4095
+SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
40794096
40804097
/*
40814098
** CAPI3REF: Reset All Bindings On A Prepared Statement
40824099
** METHOD: sqlite3_stmt
40834100
**
40844101
** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset
40854102
** the [sqlite3_bind_blob | bindings] on a [prepared statement].
40864103
** ^Use this routine to reset all host parameters to NULL.
40874104
*/
4088
-SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt*);
4105
+SQLITE_API int SQLITE_APICALL sqlite3_clear_bindings(sqlite3_stmt*);
40894106
40904107
/*
40914108
** CAPI3REF: Number Of Columns In A Result Set
40924109
** METHOD: sqlite3_stmt
40934110
**
@@ -4095,11 +4112,11 @@
40954112
** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
40964113
** statement that does not return data (for example an [UPDATE]).
40974114
**
40984115
** See also: [sqlite3_data_count()]
40994116
*/
4100
-SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt);
4117
+SQLITE_API int SQLITE_APICALL sqlite3_column_count(sqlite3_stmt *pStmt);
41014118
41024119
/*
41034120
** CAPI3REF: Column Names In A Result Set
41044121
** METHOD: sqlite3_stmt
41054122
**
@@ -4124,12 +4141,12 @@
41244141
** ^The name of a result column is the value of the "AS" clause for
41254142
** that column, if there is an AS clause. If there is no AS clause
41264143
** then the name of the column is unspecified and may change from
41274144
** one release of SQLite to the next.
41284145
*/
4129
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt*, int N);
4130
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt*, int N);
4146
+SQLITE_API const char *SQLITE_APICALL sqlite3_column_name(sqlite3_stmt*, int N);
4147
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_name16(sqlite3_stmt*, int N);
41314148
41324149
/*
41334150
** CAPI3REF: Source Of Data In A Query Result
41344151
** METHOD: sqlite3_stmt
41354152
**
@@ -4173,16 +4190,16 @@
41734190
** If two or more threads call one or more
41744191
** [sqlite3_column_database_name | column metadata interfaces]
41754192
** for the same [prepared statement] and result column
41764193
** at the same time then the results are undefined.
41774194
*/
4178
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int);
4179
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int);
4180
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int);
4181
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int);
4182
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int);
4183
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
4195
+SQLITE_API const char *SQLITE_APICALL sqlite3_column_database_name(sqlite3_stmt*,int);
4196
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_database_name16(sqlite3_stmt*,int);
4197
+SQLITE_API const char *SQLITE_APICALL sqlite3_column_table_name(sqlite3_stmt*,int);
4198
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_table_name16(sqlite3_stmt*,int);
4199
+SQLITE_API const char *SQLITE_APICALL sqlite3_column_origin_name(sqlite3_stmt*,int);
4200
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
41844201
41854202
/*
41864203
** CAPI3REF: Declared Datatype Of A Query Result
41874204
** METHOD: sqlite3_stmt
41884205
**
@@ -4210,12 +4227,12 @@
42104227
** data stored in that column is of the declared type. SQLite is
42114228
** strongly typed, but the typing is dynamic not static. ^Type
42124229
** is associated with individual values, not with the containers
42134230
** used to hold those values.
42144231
*/
4215
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt*,int);
4216
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt*,int);
4232
+SQLITE_API const char *SQLITE_APICALL sqlite3_column_decltype(sqlite3_stmt*,int);
4233
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_decltype16(sqlite3_stmt*,int);
42174234
42184235
/*
42194236
** CAPI3REF: Evaluate An SQL Statement
42204237
** METHOD: sqlite3_stmt
42214238
**
@@ -4291,11 +4308,11 @@
42914308
** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
42924309
** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,
42934310
** then the more specific [error codes] are returned directly
42944311
** by sqlite3_step(). The use of the "v2" interface is recommended.
42954312
*/
4296
-SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt*);
4313
+SQLITE_API int SQLITE_APICALL sqlite3_step(sqlite3_stmt*);
42974314
42984315
/*
42994316
** CAPI3REF: Number of columns in a result set
43004317
** METHOD: sqlite3_stmt
43014318
**
@@ -4312,11 +4329,11 @@
43124329
** where it always returns zero since each step of that multi-step
43134330
** pragma returns 0 columns of data.
43144331
**
43154332
** See also: [sqlite3_column_count()]
43164333
*/
4317
-SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt);
4334
+SQLITE_API int SQLITE_APICALL sqlite3_data_count(sqlite3_stmt *pStmt);
43184335
43194336
/*
43204337
** CAPI3REF: Fundamental Datatypes
43214338
** KEYWORDS: SQLITE_TEXT
43224339
**
@@ -4502,20 +4519,20 @@
45024519
** of these routines, a default value is returned. The default value
45034520
** is either the integer 0, the floating point number 0.0, or a NULL
45044521
** pointer. Subsequent calls to [sqlite3_errcode()] will return
45054522
** [SQLITE_NOMEM].)^
45064523
*/
4507
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt*, int iCol);
4508
-SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4509
-SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4510
-SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt*, int iCol);
4511
-SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt*, int iCol);
4512
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt*, int iCol);
4513
-SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt*, int iCol);
4514
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt*, int iCol);
4515
-SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt*, int iCol);
4516
-SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt*, int iCol);
4524
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_blob(sqlite3_stmt*, int iCol);
4525
+SQLITE_API int SQLITE_APICALL sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4526
+SQLITE_API int SQLITE_APICALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4527
+SQLITE_API double SQLITE_APICALL sqlite3_column_double(sqlite3_stmt*, int iCol);
4528
+SQLITE_API int SQLITE_APICALL sqlite3_column_int(sqlite3_stmt*, int iCol);
4529
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_column_int64(sqlite3_stmt*, int iCol);
4530
+SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_column_text(sqlite3_stmt*, int iCol);
4531
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_text16(sqlite3_stmt*, int iCol);
4532
+SQLITE_API int SQLITE_APICALL sqlite3_column_type(sqlite3_stmt*, int iCol);
4533
+SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_column_value(sqlite3_stmt*, int iCol);
45174534
45184535
/*
45194536
** CAPI3REF: Destroy A Prepared Statement Object
45204537
** DESTRUCTOR: sqlite3_stmt
45214538
**
@@ -4539,11 +4556,11 @@
45394556
** resource leaks. It is a grievous error for the application to try to use
45404557
** a prepared statement after it has been finalized. Any use of a prepared
45414558
** statement after it has been finalized can result in undefined and
45424559
** undesirable behavior such as segfaults and heap corruption.
45434560
*/
4544
-SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt);
4561
+SQLITE_API int SQLITE_APICALL sqlite3_finalize(sqlite3_stmt *pStmt);
45454562
45464563
/*
45474564
** CAPI3REF: Reset A Prepared Statement Object
45484565
** METHOD: sqlite3_stmt
45494566
**
@@ -4566,11 +4583,11 @@
45664583
** [sqlite3_reset(S)] returns an appropriate [error code].
45674584
**
45684585
** ^The [sqlite3_reset(S)] interface does not change the values
45694586
** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
45704587
*/
4571
-SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt);
4588
+SQLITE_API int SQLITE_APICALL sqlite3_reset(sqlite3_stmt *pStmt);
45724589
45734590
/*
45744591
** CAPI3REF: Create Or Redefine SQL Functions
45754592
** KEYWORDS: {function creation routines}
45764593
** KEYWORDS: {application-defined SQL function}
@@ -4666,40 +4683,40 @@
46664683
** ^An application-defined function is permitted to call other
46674684
** SQLite interfaces. However, such calls must not
46684685
** close the database connection nor finalize or reset the prepared
46694686
** statement in which the function is running.
46704687
*/
4671
-SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
4688
+SQLITE_API int SQLITE_APICALL sqlite3_create_function(
46724689
sqlite3 *db,
46734690
const char *zFunctionName,
46744691
int nArg,
46754692
int eTextRep,
46764693
void *pApp,
4677
- void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4678
- void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4679
- void (*xFinal)(sqlite3_context*)
4694
+ void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**),
4695
+ void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**),
4696
+ void (SQLITE_CALLBACK *xFinal)(sqlite3_context*)
46804697
);
4681
-SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
4698
+SQLITE_API int SQLITE_APICALL sqlite3_create_function16(
46824699
sqlite3 *db,
46834700
const void *zFunctionName,
46844701
int nArg,
46854702
int eTextRep,
46864703
void *pApp,
4687
- void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4688
- void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4689
- void (*xFinal)(sqlite3_context*)
4704
+ void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**),
4705
+ void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**),
4706
+ void (SQLITE_CALLBACK *xFinal)(sqlite3_context*)
46904707
);
4691
-SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
4708
+SQLITE_API int SQLITE_APICALL sqlite3_create_function_v2(
46924709
sqlite3 *db,
46934710
const char *zFunctionName,
46944711
int nArg,
46954712
int eTextRep,
46964713
void *pApp,
4697
- void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4698
- void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4699
- void (*xFinal)(sqlite3_context*),
4700
- void(*xDestroy)(void*)
4714
+ void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**),
4715
+ void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**),
4716
+ void (SQLITE_CALLBACK *xFinal)(sqlite3_context*),
4717
+ void(SQLITE_CALLBACK *xDestroy)(void*)
47014718
);
47024719
47034720
/*
47044721
** CAPI3REF: Text Encodings
47054722
**
@@ -4732,16 +4749,16 @@
47324749
** to be supported. However, new applications should avoid
47334750
** the use of these functions. To encourage programmers to avoid
47344751
** these functions, we will not explain what they do.
47354752
*/
47364753
#ifndef SQLITE_OMIT_DEPRECATED
4737
-SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context*);
4738
-SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt*);
4739
-SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4740
-SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_global_recover(void);
4741
-SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_thread_cleanup(void);
4742
-SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
4754
+SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_aggregate_count(sqlite3_context*);
4755
+SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_expired(sqlite3_stmt*);
4756
+SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4757
+SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_global_recover(void);
4758
+SQLITE_API SQLITE_DEPRECATED void SQLITE_APICALL sqlite3_thread_cleanup(void);
4759
+SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_memory_alarm(void(SQLITE_CALLBACK *)(void*,sqlite3_int64,int),
47434760
void*,sqlite3_int64);
47444761
#endif
47454762
47464763
/*
47474764
** CAPI3REF: Obtaining SQL Values
@@ -4787,22 +4804,22 @@
47874804
** or [sqlite3_value_text16()].
47884805
**
47894806
** These routines must be called from the same thread as
47904807
** the SQL function that supplied the [sqlite3_value*] parameters.
47914808
*/
4792
-SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value*);
4793
-SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value*);
4794
-SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value*);
4795
-SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value*);
4796
-SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value*);
4797
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value*);
4798
-SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value*);
4799
-SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value*);
4800
-SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value*);
4801
-SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*);
4802
-SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*);
4803
-SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*);
4809
+SQLITE_API const void *SQLITE_APICALL sqlite3_value_blob(sqlite3_value*);
4810
+SQLITE_API int SQLITE_APICALL sqlite3_value_bytes(sqlite3_value*);
4811
+SQLITE_API int SQLITE_APICALL sqlite3_value_bytes16(sqlite3_value*);
4812
+SQLITE_API double SQLITE_APICALL sqlite3_value_double(sqlite3_value*);
4813
+SQLITE_API int SQLITE_APICALL sqlite3_value_int(sqlite3_value*);
4814
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_value_int64(sqlite3_value*);
4815
+SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_value_text(sqlite3_value*);
4816
+SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16(sqlite3_value*);
4817
+SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16le(sqlite3_value*);
4818
+SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16be(sqlite3_value*);
4819
+SQLITE_API int SQLITE_APICALL sqlite3_value_type(sqlite3_value*);
4820
+SQLITE_API int SQLITE_APICALL sqlite3_value_numeric_type(sqlite3_value*);
48044821
48054822
/*
48064823
** CAPI3REF: Finding The Subtype Of SQL Values
48074824
** METHOD: sqlite3_value
48084825
**
@@ -4814,11 +4831,11 @@
48144831
**
48154832
** SQLite makes no use of subtype itself. It merely passes the subtype
48164833
** from the result of one [application-defined SQL function] into the
48174834
** input of another.
48184835
*/
4819
-SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value*);
4836
+SQLITE_API unsigned int SQLITE_APICALL sqlite3_value_subtype(sqlite3_value*);
48204837
48214838
/*
48224839
** CAPI3REF: Copy And Free SQL Values
48234840
** METHOD: sqlite3_value
48244841
**
@@ -4830,12 +4847,12 @@
48304847
**
48314848
** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object
48324849
** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer
48334850
** then sqlite3_value_free(V) is a harmless no-op.
48344851
*/
4835
-SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value*);
4836
-SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value*);
4852
+SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_value_dup(const sqlite3_value*);
4853
+SQLITE_API void SQLITE_APICALL sqlite3_value_free(sqlite3_value*);
48374854
48384855
/*
48394856
** CAPI3REF: Obtain Aggregate Function Context
48404857
** METHOD: sqlite3_context
48414858
**
@@ -4876,11 +4893,11 @@
48764893
** function.
48774894
**
48784895
** This routine must be called from the same thread in which
48794896
** the aggregate SQL function is running.
48804897
*/
4881
-SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
4898
+SQLITE_API void *SQLITE_APICALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
48824899
48834900
/*
48844901
** CAPI3REF: User Data For Functions
48854902
** METHOD: sqlite3_context
48864903
**
@@ -4891,11 +4908,11 @@
48914908
** registered the application defined function.
48924909
**
48934910
** This routine must be called from the same thread in which
48944911
** the application-defined function is running.
48954912
*/
4896
-SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context*);
4913
+SQLITE_API void *SQLITE_APICALL sqlite3_user_data(sqlite3_context*);
48974914
48984915
/*
48994916
** CAPI3REF: Database Connection For Functions
49004917
** METHOD: sqlite3_context
49014918
**
@@ -4903,11 +4920,11 @@
49034920
** the pointer to the [database connection] (the 1st parameter)
49044921
** of the [sqlite3_create_function()]
49054922
** and [sqlite3_create_function16()] routines that originally
49064923
** registered the application defined function.
49074924
*/
4908
-SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context*);
4925
+SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_context_db_handle(sqlite3_context*);
49094926
49104927
/*
49114928
** CAPI3REF: Function Auxiliary Data
49124929
** METHOD: sqlite3_context
49134930
**
@@ -4956,12 +4973,12 @@
49564973
** values and [parameters] and expressions composed from the same.)^
49574974
**
49584975
** These routines must be called from the same thread in which
49594976
** the SQL function is running.
49604977
*/
4961
-SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context*, int N);
4962
-SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
4978
+SQLITE_API void *SQLITE_APICALL sqlite3_get_auxdata(sqlite3_context*, int N);
4979
+SQLITE_API void SQLITE_APICALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (SQLITE_CALLBACK *)(void*));
49634980
49644981
49654982
/*
49664983
** CAPI3REF: Constants Defining Special Destructor Behavior
49674984
**
@@ -4974,11 +4991,11 @@
49744991
** the content before returning.
49754992
**
49764993
** The typedef is necessary to work around problems in certain
49774994
** C++ compilers.
49784995
*/
4979
-typedef void (*sqlite3_destructor_type)(void*);
4996
+typedef void (SQLITE_CALLBACK *sqlite3_destructor_type)(void*);
49804997
#define SQLITE_STATIC ((sqlite3_destructor_type)0)
49814998
#define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1)
49824999
49835000
/*
49845001
** CAPI3REF: Setting The Result Of An SQL Function
@@ -5093,31 +5110,31 @@
50935110
**
50945111
** If these routines are called from within the different thread
50955112
** than the one containing the application-defined function that received
50965113
** the [sqlite3_context] pointer, the results are undefined.
50975114
*/
5098
-SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
5099
-SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(sqlite3_context*,const void*,
5100
- sqlite3_uint64,void(*)(void*));
5101
-SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context*, double);
5102
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context*, const char*, int);
5103
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context*, const void*, int);
5104
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context*);
5105
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context*);
5106
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context*, int);
5107
-SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context*, int);
5108
-SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
5109
-SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context*);
5110
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
5111
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
5112
- void(*)(void*), unsigned char encoding);
5113
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
5114
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
5115
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
5116
-SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
5117
-SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n);
5118
-SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
5115
+SQLITE_API void SQLITE_APICALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(SQLITE_CALLBACK *)(void*));
5116
+SQLITE_API void SQLITE_APICALL sqlite3_result_blob64(sqlite3_context*,const void*,
5117
+ sqlite3_uint64,void(SQLITE_CALLBACK *)(void*));
5118
+SQLITE_API void SQLITE_APICALL sqlite3_result_double(sqlite3_context*, double);
5119
+SQLITE_API void SQLITE_APICALL sqlite3_result_error(sqlite3_context*, const char*, int);
5120
+SQLITE_API void SQLITE_APICALL sqlite3_result_error16(sqlite3_context*, const void*, int);
5121
+SQLITE_API void SQLITE_APICALL sqlite3_result_error_toobig(sqlite3_context*);
5122
+SQLITE_API void SQLITE_APICALL sqlite3_result_error_nomem(sqlite3_context*);
5123
+SQLITE_API void SQLITE_APICALL sqlite3_result_error_code(sqlite3_context*, int);
5124
+SQLITE_API void SQLITE_APICALL sqlite3_result_int(sqlite3_context*, int);
5125
+SQLITE_API void SQLITE_APICALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
5126
+SQLITE_API void SQLITE_APICALL sqlite3_result_null(sqlite3_context*);
5127
+SQLITE_API void SQLITE_APICALL sqlite3_result_text(sqlite3_context*, const char*, int, void(SQLITE_CALLBACK *)(void*));
5128
+SQLITE_API void SQLITE_APICALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
5129
+ void(SQLITE_CALLBACK *)(void*), unsigned char encoding);
5130
+SQLITE_API void SQLITE_APICALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(SQLITE_CALLBACK *)(void*));
5131
+SQLITE_API void SQLITE_APICALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(SQLITE_CALLBACK *)(void*));
5132
+SQLITE_API void SQLITE_APICALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(SQLITE_CALLBACK *)(void*));
5133
+SQLITE_API void SQLITE_APICALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
5134
+SQLITE_API void SQLITE_APICALL sqlite3_result_zeroblob(sqlite3_context*, int n);
5135
+SQLITE_API int SQLITE_APICALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
51195136
51205137
51215138
/*
51225139
** CAPI3REF: Setting The Subtype Of An SQL Function
51235140
** METHOD: sqlite3_context
@@ -5128,11 +5145,11 @@
51285145
** of the subtype T are preserved in current versions of SQLite;
51295146
** higher order bits are discarded.
51305147
** The number of subtype bytes preserved by SQLite might increase
51315148
** in future releases of SQLite.
51325149
*/
5133
-SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context*,unsigned int);
5150
+SQLITE_API void SQLITE_APICALL sqlite3_result_subtype(sqlite3_context*,unsigned int);
51345151
51355152
/*
51365153
** CAPI3REF: Define New Collating Sequences
51375154
** METHOD: sqlite3
51385155
**
@@ -5210,31 +5227,31 @@
52105227
** is unfortunate but cannot be changed without breaking backwards
52115228
** compatibility.
52125229
**
52135230
** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].
52145231
*/
5215
-SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
5232
+SQLITE_API int SQLITE_APICALL sqlite3_create_collation(
52165233
sqlite3*,
52175234
const char *zName,
52185235
int eTextRep,
52195236
void *pArg,
5220
- int(*xCompare)(void*,int,const void*,int,const void*)
5237
+ int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*)
52215238
);
5222
-SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
5239
+SQLITE_API int SQLITE_APICALL sqlite3_create_collation_v2(
52235240
sqlite3*,
52245241
const char *zName,
52255242
int eTextRep,
52265243
void *pArg,
5227
- int(*xCompare)(void*,int,const void*,int,const void*),
5228
- void(*xDestroy)(void*)
5244
+ int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*),
5245
+ void(SQLITE_CALLBACK *xDestroy)(void*)
52295246
);
5230
-SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
5247
+SQLITE_API int SQLITE_APICALL sqlite3_create_collation16(
52315248
sqlite3*,
52325249
const void *zName,
52335250
int eTextRep,
52345251
void *pArg,
5235
- int(*xCompare)(void*,int,const void*,int,const void*)
5252
+ int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*)
52365253
);
52375254
52385255
/*
52395256
** CAPI3REF: Collation Needed Callbacks
52405257
** METHOD: sqlite3
@@ -5260,19 +5277,19 @@
52605277
**
52615278
** The callback function should register the desired collation using
52625279
** [sqlite3_create_collation()], [sqlite3_create_collation16()], or
52635280
** [sqlite3_create_collation_v2()].
52645281
*/
5265
-SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
5282
+SQLITE_API int SQLITE_APICALL sqlite3_collation_needed(
52665283
sqlite3*,
52675284
void*,
5268
- void(*)(void*,sqlite3*,int eTextRep,const char*)
5285
+ void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const char*)
52695286
);
5270
-SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
5287
+SQLITE_API int SQLITE_APICALL sqlite3_collation_needed16(
52715288
sqlite3*,
52725289
void*,
5273
- void(*)(void*,sqlite3*,int eTextRep,const void*)
5290
+ void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const void*)
52745291
);
52755292
52765293
#ifdef SQLITE_HAS_CODEC
52775294
/*
52785295
** Specify the key for an encrypted database. This routine should be
@@ -5279,15 +5296,15 @@
52795296
** called right after sqlite3_open().
52805297
**
52815298
** The code to implement this API is not available in the public release
52825299
** of SQLite.
52835300
*/
5284
-SQLITE_API int SQLITE_STDCALL sqlite3_key(
5301
+SQLITE_API int SQLITE_APICALL sqlite3_key(
52855302
sqlite3 *db, /* Database to be rekeyed */
52865303
const void *pKey, int nKey /* The key */
52875304
);
5288
-SQLITE_API int SQLITE_STDCALL sqlite3_key_v2(
5305
+SQLITE_API int SQLITE_APICALL sqlite3_key_v2(
52895306
sqlite3 *db, /* Database to be rekeyed */
52905307
const char *zDbName, /* Name of the database */
52915308
const void *pKey, int nKey /* The key */
52925309
);
52935310
@@ -5297,35 +5314,35 @@
52975314
** database is decrypted.
52985315
**
52995316
** The code to implement this API is not available in the public release
53005317
** of SQLite.
53015318
*/
5302
-SQLITE_API int SQLITE_STDCALL sqlite3_rekey(
5319
+SQLITE_API int SQLITE_APICALL sqlite3_rekey(
53035320
sqlite3 *db, /* Database to be rekeyed */
53045321
const void *pKey, int nKey /* The new key */
53055322
);
5306
-SQLITE_API int SQLITE_STDCALL sqlite3_rekey_v2(
5323
+SQLITE_API int SQLITE_APICALL sqlite3_rekey_v2(
53075324
sqlite3 *db, /* Database to be rekeyed */
53085325
const char *zDbName, /* Name of the database */
53095326
const void *pKey, int nKey /* The new key */
53105327
);
53115328
53125329
/*
53135330
** Specify the activation key for a SEE database. Unless
53145331
** activated, none of the SEE routines will work.
53155332
*/
5316
-SQLITE_API void SQLITE_STDCALL sqlite3_activate_see(
5333
+SQLITE_API void SQLITE_APICALL sqlite3_activate_see(
53175334
const char *zPassPhrase /* Activation phrase */
53185335
);
53195336
#endif
53205337
53215338
#ifdef SQLITE_ENABLE_CEROD
53225339
/*
53235340
** Specify the activation key for a CEROD database. Unless
53245341
** activated, none of the CEROD routines will work.
53255342
*/
5326
-SQLITE_API void SQLITE_STDCALL sqlite3_activate_cerod(
5343
+SQLITE_API void SQLITE_APICALL sqlite3_activate_cerod(
53275344
const char *zPassPhrase /* Activation phrase */
53285345
);
53295346
#endif
53305347
53315348
/*
@@ -5343,11 +5360,11 @@
53435360
** method of the default [sqlite3_vfs] object. If the xSleep() method
53445361
** of the default VFS is not implemented correctly, or not implemented at
53455362
** all, then the behavior of sqlite3_sleep() may deviate from the description
53465363
** in the previous paragraphs.
53475364
*/
5348
-SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int);
5365
+SQLITE_API int SQLITE_APICALL sqlite3_sleep(int);
53495366
53505367
/*
53515368
** CAPI3REF: Name Of The Folder Holding Temporary Files
53525369
**
53535370
** ^(If this global variable is made to point to a string which is
@@ -5462,11 +5479,11 @@
54625479
**
54635480
** If another thread changes the autocommit status of the database
54645481
** connection while this routine is running, then the return value
54655482
** is undefined.
54665483
*/
5467
-SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3*);
5484
+SQLITE_API int SQLITE_APICALL sqlite3_get_autocommit(sqlite3*);
54685485
54695486
/*
54705487
** CAPI3REF: Find The Database Handle Of A Prepared Statement
54715488
** METHOD: sqlite3_stmt
54725489
**
@@ -5475,11 +5492,11 @@
54755492
** returned by sqlite3_db_handle is the same [database connection]
54765493
** that was the first argument
54775494
** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
54785495
** create the statement in the first place.
54795496
*/
5480
-SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt*);
5497
+SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_db_handle(sqlite3_stmt*);
54815498
54825499
/*
54835500
** CAPI3REF: Return The Filename For A Database Connection
54845501
** METHOD: sqlite3
54855502
**
@@ -5492,21 +5509,21 @@
54925509
** ^The filename returned by this function is the output of the
54935510
** xFullPathname method of the [VFS]. ^In other words, the filename
54945511
** will be an absolute pathname, even if the filename used
54955512
** to open the database originally was a URI or relative pathname.
54965513
*/
5497
-SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
5514
+SQLITE_API const char *SQLITE_APICALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
54985515
54995516
/*
55005517
** CAPI3REF: Determine if a database is read-only
55015518
** METHOD: sqlite3
55025519
**
55035520
** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N
55045521
** of connection D is read-only, 0 if it is read/write, or -1 if N is not
55055522
** the name of a database on connection D.
55065523
*/
5507
-SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
5524
+SQLITE_API int SQLITE_APICALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
55085525
55095526
/*
55105527
** CAPI3REF: Find the next prepared statement
55115528
** METHOD: sqlite3
55125529
**
@@ -5518,11 +5535,11 @@
55185535
**
55195536
** The [database connection] pointer D in a call to
55205537
** [sqlite3_next_stmt(D,S)] must refer to an open database
55215538
** connection and in particular must not be a NULL pointer.
55225539
*/
5523
-SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
5540
+SQLITE_API sqlite3_stmt *SQLITE_APICALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
55245541
55255542
/*
55265543
** CAPI3REF: Commit And Rollback Notification Callbacks
55275544
** METHOD: sqlite3
55285545
**
@@ -5567,12 +5584,12 @@
55675584
** ^The rollback callback is not invoked if a transaction is
55685585
** automatically rolled back because the database connection is closed.
55695586
**
55705587
** See also the [sqlite3_update_hook()] interface.
55715588
*/
5572
-SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
5573
-SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
5589
+SQLITE_API void *SQLITE_APICALL sqlite3_commit_hook(sqlite3*, int(SQLITE_CALLBACK *)(void*), void*);
5590
+SQLITE_API void *SQLITE_APICALL sqlite3_rollback_hook(sqlite3*, void(SQLITE_CALLBACK *)(void *), void*);
55745591
55755592
/*
55765593
** CAPI3REF: Data Change Notification Callbacks
55775594
** METHOD: sqlite3
55785595
**
@@ -5619,13 +5636,13 @@
56195636
** the first call on D.
56205637
**
56215638
** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()],
56225639
** and [sqlite3_preupdate_hook()] interfaces.
56235640
*/
5624
-SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
5641
+SQLITE_API void *SQLITE_APICALL sqlite3_update_hook(
56255642
sqlite3*,
5626
- void(*)(void *,int ,char const *,char const *,sqlite3_int64),
5643
+ void(SQLITE_CALLBACK *)(void *,int ,char const *,char const *,sqlite3_int64),
56275644
void*
56285645
);
56295646
56305647
/*
56315648
** CAPI3REF: Enable Or Disable Shared Pager Cache
@@ -5659,11 +5676,11 @@
56595676
** This interface is threadsafe on processors where writing a
56605677
** 32-bit integer is atomic.
56615678
**
56625679
** See Also: [SQLite Shared-Cache Mode]
56635680
*/
5664
-SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int);
5681
+SQLITE_API int SQLITE_APICALL sqlite3_enable_shared_cache(int);
56655682
56665683
/*
56675684
** CAPI3REF: Attempt To Free Heap Memory
56685685
**
56695686
** ^The sqlite3_release_memory() interface attempts to free N bytes
@@ -5675,11 +5692,11 @@
56755692
** ^The sqlite3_release_memory() routine is a no-op returning zero
56765693
** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].
56775694
**
56785695
** See also: [sqlite3_db_release_memory()]
56795696
*/
5680
-SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int);
5697
+SQLITE_API int SQLITE_APICALL sqlite3_release_memory(int);
56815698
56825699
/*
56835700
** CAPI3REF: Free Memory Used By A Database Connection
56845701
** METHOD: sqlite3
56855702
**
@@ -5689,11 +5706,11 @@
56895706
** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
56905707
** omitted.
56915708
**
56925709
** See also: [sqlite3_release_memory()]
56935710
*/
5694
-SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3*);
5711
+SQLITE_API int SQLITE_APICALL sqlite3_db_release_memory(sqlite3*);
56955712
56965713
/*
56975714
** CAPI3REF: Impose A Limit On Heap Size
56985715
**
56995716
** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the
@@ -5741,11 +5758,11 @@
57415758
** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT].
57425759
**
57435760
** The circumstances under which SQLite will enforce the soft heap limit may
57445761
** changes in future releases of SQLite.
57455762
*/
5746
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
5763
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
57475764
57485765
/*
57495766
** CAPI3REF: Deprecated Soft Heap Limit Interface
57505767
** DEPRECATED
57515768
**
@@ -5752,11 +5769,11 @@
57525769
** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
57535770
** interface. This routine is provided for historical compatibility
57545771
** only. All new applications should use the
57555772
** [sqlite3_soft_heap_limit64()] interface rather than this one.
57565773
*/
5757
-SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_soft_heap_limit(int N);
5774
+SQLITE_API SQLITE_DEPRECATED void SQLITE_APICALL sqlite3_soft_heap_limit(int N);
57585775
57595776
57605777
/*
57615778
** CAPI3REF: Extract Metadata About A Column Of A Table
57625779
** METHOD: sqlite3
@@ -5822,11 +5839,11 @@
58225839
**
58235840
** ^This function causes all database schemas to be read from disk and
58245841
** parsed, if that has not already been done, and returns an error if
58255842
** any errors are encountered while loading the schema.
58265843
*/
5827
-SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
5844
+SQLITE_API int SQLITE_APICALL sqlite3_table_column_metadata(
58285845
sqlite3 *db, /* Connection handle */
58295846
const char *zDbName, /* Database name or NULL */
58305847
const char *zTableName, /* Table name */
58315848
const char *zColumnName, /* Column name */
58325849
char const **pzDataType, /* OUTPUT: Declared data type */
@@ -5878,11 +5895,11 @@
58785895
** disabled and prevent SQL injections from giving attackers
58795896
** access to extension loading capabilities.
58805897
**
58815898
** See also the [load_extension() SQL function].
58825899
*/
5883
-SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
5900
+SQLITE_API int SQLITE_APICALL sqlite3_load_extension(
58845901
sqlite3 *db, /* Load the extension into this database connection */
58855902
const char *zFile, /* Name of the shared library containing extension */
58865903
const char *zProc, /* Entry point. Derived from zFile if 0 */
58875904
char **pzErrMsg /* Put error message here if not 0 */
58885905
);
@@ -5910,11 +5927,11 @@
59105927
** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method
59115928
** rather than this interface, so the [load_extension()] SQL function
59125929
** remains disabled. This will prevent SQL injections from giving attackers
59135930
** access to extension loading capabilities.
59145931
*/
5915
-SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
5932
+SQLITE_API int SQLITE_APICALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
59165933
59175934
/*
59185935
** CAPI3REF: Automatically Load Statically Linked Extensions
59195936
**
59205937
** ^This interface causes the xEntryPoint() function to be invoked for
@@ -5948,11 +5965,14 @@
59485965
** will be called more than once for each database connection that is opened.
59495966
**
59505967
** See also: [sqlite3_reset_auto_extension()]
59515968
** and [sqlite3_cancel_auto_extension()]
59525969
*/
5953
-SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void (*xEntryPoint)(void));
5970
+typedef struct sqlite3_api_routines sqlite3_api_routines;
5971
+SQLITE_API int SQLITE_APICALL sqlite3_auto_extension(
5972
+ int (SQLITE_CALLBACK *xEntryPoint)(sqlite3 *, char **, const sqlite3_api_routines *)
5973
+);
59545974
59555975
/*
59565976
** CAPI3REF: Cancel Automatic Extension Loading
59575977
**
59585978
** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
@@ -5960,19 +5980,21 @@
59605980
** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)]
59615981
** routine returns 1 if initialization routine X was successfully
59625982
** unregistered and it returns 0 if X was not on the list of initialization
59635983
** routines.
59645984
*/
5965
-SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void (*xEntryPoint)(void));
5985
+SQLITE_API int SQLITE_APICALL sqlite3_cancel_auto_extension(
5986
+ int (SQLITE_CALLBACK *xEntryPoint)(sqlite3 *, char **, const sqlite3_api_routines *)
5987
+);
59665988
59675989
/*
59685990
** CAPI3REF: Reset Automatic Extension Loading
59695991
**
59705992
** ^This interface disables all automatic extensions previously
59715993
** registered using [sqlite3_auto_extension()].
59725994
*/
5973
-SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void);
5995
+SQLITE_API void SQLITE_APICALL sqlite3_reset_auto_extension(void);
59745996
59755997
/*
59765998
** The interface to the virtual-table mechanism is currently considered
59775999
** to be experimental. The interface might change in incompatible ways.
59786000
** If this is a problem for you, do not use the interface at this time.
@@ -6005,41 +6027,41 @@
60056027
** of this structure must not change while it is registered with
60066028
** any database connection.
60076029
*/
60086030
struct sqlite3_module {
60096031
int iVersion;
6010
- int (*xCreate)(sqlite3*, void *pAux,
6011
- int argc, const char *const*argv,
6012
- sqlite3_vtab **ppVTab, char**);
6013
- int (*xConnect)(sqlite3*, void *pAux,
6014
- int argc, const char *const*argv,
6015
- sqlite3_vtab **ppVTab, char**);
6016
- int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
6017
- int (*xDisconnect)(sqlite3_vtab *pVTab);
6018
- int (*xDestroy)(sqlite3_vtab *pVTab);
6019
- int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);
6020
- int (*xClose)(sqlite3_vtab_cursor*);
6021
- int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
6022
- int argc, sqlite3_value **argv);
6023
- int (*xNext)(sqlite3_vtab_cursor*);
6024
- int (*xEof)(sqlite3_vtab_cursor*);
6025
- int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int);
6026
- int (*xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid);
6027
- int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *);
6028
- int (*xBegin)(sqlite3_vtab *pVTab);
6029
- int (*xSync)(sqlite3_vtab *pVTab);
6030
- int (*xCommit)(sqlite3_vtab *pVTab);
6031
- int (*xRollback)(sqlite3_vtab *pVTab);
6032
- int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,
6033
- void (**pxFunc)(sqlite3_context*,int,sqlite3_value**),
6034
- void **ppArg);
6035
- int (*xRename)(sqlite3_vtab *pVtab, const char *zNew);
6036
- /* The methods above are in version 1 of the sqlite_module object. Those
6037
- ** below are for version 2 and greater. */
6038
- int (*xSavepoint)(sqlite3_vtab *pVTab, int);
6039
- int (*xRelease)(sqlite3_vtab *pVTab, int);
6040
- int (*xRollbackTo)(sqlite3_vtab *pVTab, int);
6032
+ int (SQLITE_CALLBACK *xCreate)(sqlite3*, void *pAux,
6033
+ int argc, const char *const*argv,
6034
+ sqlite3_vtab **ppVTab, char**);
6035
+ int (SQLITE_CALLBACK *xConnect)(sqlite3*, void *pAux,
6036
+ int argc, const char *const*argv,
6037
+ sqlite3_vtab **ppVTab, char**);
6038
+ int (SQLITE_CALLBACK *xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
6039
+ int (SQLITE_CALLBACK *xDisconnect)(sqlite3_vtab *pVTab);
6040
+ int (SQLITE_CALLBACK *xDestroy)(sqlite3_vtab *pVTab);
6041
+ int (SQLITE_CALLBACK *xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);
6042
+ int (SQLITE_CALLBACK *xClose)(sqlite3_vtab_cursor*);
6043
+ int (SQLITE_CALLBACK *xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
6044
+ int argc, sqlite3_value **argv);
6045
+ int (SQLITE_CALLBACK *xNext)(sqlite3_vtab_cursor*);
6046
+ int (SQLITE_CALLBACK *xEof)(sqlite3_vtab_cursor*);
6047
+ int (SQLITE_CALLBACK *xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int);
6048
+ int (SQLITE_CALLBACK *xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid);
6049
+ int (SQLITE_CALLBACK *xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *);
6050
+ int (SQLITE_CALLBACK *xBegin)(sqlite3_vtab *pVTab);
6051
+ int (SQLITE_CALLBACK *xSync)(sqlite3_vtab *pVTab);
6052
+ int (SQLITE_CALLBACK *xCommit)(sqlite3_vtab *pVTab);
6053
+ int (SQLITE_CALLBACK *xRollback)(sqlite3_vtab *pVTab);
6054
+ int (SQLITE_CALLBACK *xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,
6055
+ void (SQLITE_CALLBACK **pxFunc)(sqlite3_context*,int,sqlite3_value**),
6056
+ void **ppArg);
6057
+ int (SQLITE_CALLBACK *xRename)(sqlite3_vtab *pVtab, const char *zNew);
6058
+ /* The methods above are in version 1 of the sqlite_module object. Those
6059
+ ** below are for version 2 and greater. */
6060
+ int (SQLITE_CALLBACK *xSavepoint)(sqlite3_vtab *pVTab, int);
6061
+ int (SQLITE_CALLBACK *xRelease)(sqlite3_vtab *pVTab, int);
6062
+ int (SQLITE_CALLBACK *xRollbackTo)(sqlite3_vtab *pVTab, int);
60416063
};
60426064
60436065
/*
60446066
** CAPI3REF: Virtual Table Indexing Information
60456067
** KEYWORDS: sqlite3_index_info
@@ -6213,22 +6235,22 @@
62136235
** be invoked if the call to sqlite3_create_module_v2() fails.
62146236
** ^The sqlite3_create_module()
62156237
** interface is equivalent to sqlite3_create_module_v2() with a NULL
62166238
** destructor.
62176239
*/
6218
-SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
6240
+SQLITE_API int SQLITE_APICALL sqlite3_create_module(
62196241
sqlite3 *db, /* SQLite connection to register module with */
62206242
const char *zName, /* Name of the module */
62216243
const sqlite3_module *p, /* Methods for the module */
62226244
void *pClientData /* Client data for xCreate/xConnect */
62236245
);
6224
-SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
6246
+SQLITE_API int SQLITE_APICALL sqlite3_create_module_v2(
62256247
sqlite3 *db, /* SQLite connection to register module with */
62266248
const char *zName, /* Name of the module */
62276249
const sqlite3_module *p, /* Methods for the module */
62286250
void *pClientData, /* Client data for xCreate/xConnect */
6229
- void(*xDestroy)(void*) /* Module destructor function */
6251
+ void(SQLITE_CALLBACK *xDestroy)(void*) /* Module destructor function */
62306252
);
62316253
62326254
/*
62336255
** CAPI3REF: Virtual Table Instance Object
62346256
** KEYWORDS: sqlite3_vtab
@@ -6282,11 +6304,11 @@
62826304
** ^The [xCreate] and [xConnect] methods of a
62836305
** [virtual table module] call this interface
62846306
** to declare the format (the names and datatypes of the columns) of
62856307
** the virtual tables they implement.
62866308
*/
6287
-SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
6309
+SQLITE_API int SQLITE_APICALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
62886310
62896311
/*
62906312
** CAPI3REF: Overload A Function For A Virtual Table
62916313
** METHOD: sqlite3
62926314
**
@@ -6301,11 +6323,11 @@
63016323
** of the new function always causes an exception to be thrown. So
63026324
** the new function is not good for anything by itself. Its only
63036325
** purpose is to be a placeholder function that can be overloaded
63046326
** by a [virtual table].
63056327
*/
6306
-SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
6328
+SQLITE_API int SQLITE_APICALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
63076329
63086330
/*
63096331
** The interface to the virtual-table mechanism defined above (back up
63106332
** to a comment remarkably similar to this one) is currently considered
63116333
** to be experimental. The interface might change in incompatible ways.
@@ -6400,11 +6422,11 @@
64006422
** zero-filled blob to read or write using the incremental-blob interface.
64016423
**
64026424
** To avoid a resource leak, every open [BLOB handle] should eventually
64036425
** be released by a call to [sqlite3_blob_close()].
64046426
*/
6405
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
6427
+SQLITE_API int SQLITE_APICALL sqlite3_blob_open(
64066428
sqlite3*,
64076429
const char *zDb,
64086430
const char *zTable,
64096431
const char *zColumn,
64106432
sqlite3_int64 iRow,
@@ -6433,11 +6455,11 @@
64336455
** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
64346456
** always returns zero.
64356457
**
64366458
** ^This function sets the database handle error code and message.
64376459
*/
6438
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
6460
+SQLITE_API int SQLITE_APICALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
64396461
64406462
/*
64416463
** CAPI3REF: Close A BLOB Handle
64426464
** DESTRUCTOR: sqlite3_blob
64436465
**
@@ -6456,11 +6478,11 @@
64566478
** with a null pointer (such as would be returned by a failed call to
64576479
** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function
64586480
** is passed a valid open blob handle, the values returned by the
64596481
** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning.
64606482
*/
6461
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *);
6483
+SQLITE_API int SQLITE_APICALL sqlite3_blob_close(sqlite3_blob *);
64626484
64636485
/*
64646486
** CAPI3REF: Return The Size Of An Open BLOB
64656487
** METHOD: sqlite3_blob
64666488
**
@@ -6472,11 +6494,11 @@
64726494
** This routine only works on a [BLOB handle] which has been created
64736495
** by a prior successful call to [sqlite3_blob_open()] and which has not
64746496
** been closed by [sqlite3_blob_close()]. Passing any other pointer in
64756497
** to this routine results in undefined and probably undesirable behavior.
64766498
*/
6477
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *);
6499
+SQLITE_API int SQLITE_APICALL sqlite3_blob_bytes(sqlite3_blob *);
64786500
64796501
/*
64806502
** CAPI3REF: Read Data From A BLOB Incrementally
64816503
** METHOD: sqlite3_blob
64826504
**
@@ -6501,11 +6523,11 @@
65016523
** been closed by [sqlite3_blob_close()]. Passing any other pointer in
65026524
** to this routine results in undefined and probably undesirable behavior.
65036525
**
65046526
** See also: [sqlite3_blob_write()].
65056527
*/
6506
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
6528
+SQLITE_API int SQLITE_APICALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
65076529
65086530
/*
65096531
** CAPI3REF: Write Data Into A BLOB Incrementally
65106532
** METHOD: sqlite3_blob
65116533
**
@@ -6543,11 +6565,11 @@
65436565
** been closed by [sqlite3_blob_close()]. Passing any other pointer in
65446566
** to this routine results in undefined and probably undesirable behavior.
65456567
**
65466568
** See also: [sqlite3_blob_read()].
65476569
*/
6548
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
6570
+SQLITE_API int SQLITE_APICALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
65496571
65506572
/*
65516573
** CAPI3REF: Virtual File System Objects
65526574
**
65536575
** A virtual filesystem (VFS) is an [sqlite3_vfs] object
@@ -6574,13 +6596,13 @@
65746596
**
65756597
** ^Unregister a VFS with the sqlite3_vfs_unregister() interface.
65766598
** ^(If the default VFS is unregistered, another VFS is chosen as
65776599
** the default. The choice for the new VFS is arbitrary.)^
65786600
*/
6579
-SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfsName);
6580
-SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
6581
-SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs*);
6601
+SQLITE_API sqlite3_vfs *SQLITE_APICALL sqlite3_vfs_find(const char *zVfsName);
6602
+SQLITE_API int SQLITE_APICALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
6603
+SQLITE_API int SQLITE_APICALL sqlite3_vfs_unregister(sqlite3_vfs*);
65826604
65836605
/*
65846606
** CAPI3REF: Mutexes
65856607
**
65866608
** The SQLite core uses these routines for thread
@@ -6692,15 +6714,15 @@
66926714
** sqlite3_mutex_leave() is a NULL pointer, then all three routines
66936715
** behave as no-ops.
66946716
**
66956717
** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
66966718
*/
6697
-SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int);
6698
-SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*);
6699
-SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*);
6700
-SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*);
6701
-SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*);
6719
+SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_mutex_alloc(int);
6720
+SQLITE_API void SQLITE_APICALL sqlite3_mutex_free(sqlite3_mutex*);
6721
+SQLITE_API void SQLITE_APICALL sqlite3_mutex_enter(sqlite3_mutex*);
6722
+SQLITE_API int SQLITE_APICALL sqlite3_mutex_try(sqlite3_mutex*);
6723
+SQLITE_API void SQLITE_APICALL sqlite3_mutex_leave(sqlite3_mutex*);
67026724
67036725
/*
67046726
** CAPI3REF: Mutex Methods Object
67056727
**
67066728
** An instance of this structure defines the low-level routines
@@ -6765,19 +6787,19 @@
67656787
** If xMutexInit fails in any way, it is expected to clean up after itself
67666788
** prior to returning.
67676789
*/
67686790
typedef struct sqlite3_mutex_methods sqlite3_mutex_methods;
67696791
struct sqlite3_mutex_methods {
6770
- int (*xMutexInit)(void);
6771
- int (*xMutexEnd)(void);
6772
- sqlite3_mutex *(*xMutexAlloc)(int);
6773
- void (*xMutexFree)(sqlite3_mutex *);
6774
- void (*xMutexEnter)(sqlite3_mutex *);
6775
- int (*xMutexTry)(sqlite3_mutex *);
6776
- void (*xMutexLeave)(sqlite3_mutex *);
6777
- int (*xMutexHeld)(sqlite3_mutex *);
6778
- int (*xMutexNotheld)(sqlite3_mutex *);
6792
+ int (SQLITE_CALLBACK *xMutexInit)(void);
6793
+ int (SQLITE_CALLBACK *xMutexEnd)(void);
6794
+ sqlite3_mutex *(SQLITE_CALLBACK *xMutexAlloc)(int);
6795
+ void (SQLITE_CALLBACK *xMutexFree)(sqlite3_mutex *);
6796
+ void (SQLITE_CALLBACK *xMutexEnter)(sqlite3_mutex *);
6797
+ int (SQLITE_CALLBACK *xMutexTry)(sqlite3_mutex *);
6798
+ void (SQLITE_CALLBACK *xMutexLeave)(sqlite3_mutex *);
6799
+ int (SQLITE_CALLBACK *xMutexHeld)(sqlite3_mutex *);
6800
+ int (SQLITE_CALLBACK *xMutexNotheld)(sqlite3_mutex *);
67796801
};
67806802
67816803
/*
67826804
** CAPI3REF: Mutex Verification Routines
67836805
**
@@ -6806,12 +6828,12 @@
68066828
** call to sqlite3_mutex_held() to fail, so a non-zero return is
68076829
** the appropriate thing to do. The sqlite3_mutex_notheld()
68086830
** interface should also return 1 when given a NULL pointer.
68096831
*/
68106832
#ifndef NDEBUG
6811
-SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex*);
6812
-SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex*);
6833
+SQLITE_API int SQLITE_APICALL sqlite3_mutex_held(sqlite3_mutex*);
6834
+SQLITE_API int SQLITE_APICALL sqlite3_mutex_notheld(sqlite3_mutex*);
68136835
#endif
68146836
68156837
/*
68166838
** CAPI3REF: Mutex Types
68176839
**
@@ -6847,11 +6869,11 @@
68476869
** serializes access to the [database connection] given in the argument
68486870
** when the [threading mode] is Serialized.
68496871
** ^If the [threading mode] is Single-thread or Multi-thread then this
68506872
** routine returns a NULL pointer.
68516873
*/
6852
-SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3*);
6874
+SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_db_mutex(sqlite3*);
68536875
68546876
/*
68556877
** CAPI3REF: Low-Level Control Of Database Files
68566878
** METHOD: sqlite3
68576879
**
@@ -6882,11 +6904,11 @@
68826904
** an incorrect zDbName and an SQLITE_ERROR return from the underlying
68836905
** xFileControl method.
68846906
**
68856907
** See also: [SQLITE_FCNTL_LOCKSTATE]
68866908
*/
6887
-SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
6909
+SQLITE_API int SQLITE_APICALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
68886910
68896911
/*
68906912
** CAPI3REF: Testing Interface
68916913
**
68926914
** ^The sqlite3_test_control() interface is used to read out internal
@@ -6964,12 +6986,12 @@
69646986
** be represented by a 32-bit integer, then the values returned by
69656987
** sqlite3_status() are undefined.
69666988
**
69676989
** See also: [sqlite3_db_status()]
69686990
*/
6969
-SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6970
-SQLITE_API int SQLITE_STDCALL sqlite3_status64(
6991
+SQLITE_API int SQLITE_APICALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6992
+SQLITE_API int SQLITE_APICALL sqlite3_status64(
69716993
int op,
69726994
sqlite3_int64 *pCurrent,
69736995
sqlite3_int64 *pHighwater,
69746996
int resetFlag
69756997
);
@@ -7090,11 +7112,11 @@
70907112
** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a
70917113
** non-zero [error code] on failure.
70927114
**
70937115
** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
70947116
*/
7095
-SQLITE_API int SQLITE_STDCALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
7117
+SQLITE_API int SQLITE_APICALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
70967118
70977119
/*
70987120
** CAPI3REF: Status Parameters for database connections
70997121
** KEYWORDS: {SQLITE_DBSTATUS options}
71007122
**
@@ -7233,11 +7255,11 @@
72337255
** ^If the resetFlg is true, then the counter is reset to zero after this
72347256
** interface call returns.
72357257
**
72367258
** See also: [sqlite3_status()] and [sqlite3_db_status()].
72377259
*/
7238
-SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
7260
+SQLITE_API int SQLITE_APICALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
72397261
72407262
/*
72417263
** CAPI3REF: Status Parameters for prepared statements
72427264
** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters}
72437265
**
@@ -7469,22 +7491,22 @@
74697491
*/
74707492
typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2;
74717493
struct sqlite3_pcache_methods2 {
74727494
int iVersion;
74737495
void *pArg;
7474
- int (*xInit)(void*);
7475
- void (*xShutdown)(void*);
7476
- sqlite3_pcache *(*xCreate)(int szPage, int szExtra, int bPurgeable);
7477
- void (*xCachesize)(sqlite3_pcache*, int nCachesize);
7478
- int (*xPagecount)(sqlite3_pcache*);
7479
- sqlite3_pcache_page *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7480
- void (*xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard);
7481
- void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*,
7496
+ int (SQLITE_CALLBACK *xInit)(void*);
7497
+ void (SQLITE_CALLBACK *xShutdown)(void*);
7498
+ sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int szExtra, int bPurgeable);
7499
+ void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize);
7500
+ int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*);
7501
+ sqlite3_pcache_page *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7502
+ void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard);
7503
+ void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, sqlite3_pcache_page*,
74827504
unsigned oldKey, unsigned newKey);
7483
- void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
7484
- void (*xDestroy)(sqlite3_pcache*);
7485
- void (*xShrink)(sqlite3_pcache*);
7505
+ void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit);
7506
+ void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*);
7507
+ void (SQLITE_CALLBACK *xShrink)(sqlite3_pcache*);
74867508
};
74877509
74887510
/*
74897511
** This is the obsolete pcache_methods object that has now been replaced
74907512
** by sqlite3_pcache_methods2. This object is not used by SQLite. It is
@@ -7491,20 +7513,20 @@
74917513
** retained in the header file for backwards compatibility only.
74927514
*/
74937515
typedef struct sqlite3_pcache_methods sqlite3_pcache_methods;
74947516
struct sqlite3_pcache_methods {
74957517
void *pArg;
7496
- int (*xInit)(void*);
7497
- void (*xShutdown)(void*);
7498
- sqlite3_pcache *(*xCreate)(int szPage, int bPurgeable);
7499
- void (*xCachesize)(sqlite3_pcache*, int nCachesize);
7500
- int (*xPagecount)(sqlite3_pcache*);
7501
- void *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7502
- void (*xUnpin)(sqlite3_pcache*, void*, int discard);
7503
- void (*xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey);
7504
- void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
7505
- void (*xDestroy)(sqlite3_pcache*);
7518
+ int (SQLITE_CALLBACK *xInit)(void*);
7519
+ void (SQLITE_CALLBACK *xShutdown)(void*);
7520
+ sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int bPurgeable);
7521
+ void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize);
7522
+ int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*);
7523
+ void *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7524
+ void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, void*, int discard);
7525
+ void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey);
7526
+ void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit);
7527
+ void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*);
75067528
};
75077529
75087530
75097531
/*
75107532
** CAPI3REF: Online Backup Object
@@ -7702,20 +7724,20 @@
77027724
** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()
77037725
** APIs are not strictly speaking threadsafe. If they are invoked at the
77047726
** same time as another thread is invoking sqlite3_backup_step() it is
77057727
** possible that they return invalid values.
77067728
*/
7707
-SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
7729
+SQLITE_API sqlite3_backup *SQLITE_APICALL sqlite3_backup_init(
77087730
sqlite3 *pDest, /* Destination database handle */
77097731
const char *zDestName, /* Destination database name */
77107732
sqlite3 *pSource, /* Source database handle */
77117733
const char *zSourceName /* Source database name */
77127734
);
7713
-SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage);
7714
-SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p);
7715
-SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p);
7716
-SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p);
7735
+SQLITE_API int SQLITE_APICALL sqlite3_backup_step(sqlite3_backup *p, int nPage);
7736
+SQLITE_API int SQLITE_APICALL sqlite3_backup_finish(sqlite3_backup *p);
7737
+SQLITE_API int SQLITE_APICALL sqlite3_backup_remaining(sqlite3_backup *p);
7738
+SQLITE_API int SQLITE_APICALL sqlite3_backup_pagecount(sqlite3_backup *p);
77177739
77187740
/*
77197741
** CAPI3REF: Unlock Notification
77207742
** METHOD: sqlite3
77217743
**
@@ -7828,13 +7850,13 @@
78287850
** by an sqlite3_step() call. ^(If there is a blocking connection, then the
78297851
** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in
78307852
** the special "DROP TABLE/INDEX" case, the extended error code is just
78317853
** SQLITE_LOCKED.)^
78327854
*/
7833
-SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
7855
+SQLITE_API int SQLITE_APICALL sqlite3_unlock_notify(
78347856
sqlite3 *pBlocked, /* Waiting connection */
7835
- void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */
7857
+ void (SQLITE_CALLBACK *xNotify)(void **apArg, int nArg), /* Callback function to invoke */
78367858
void *pNotifyArg /* Argument to pass to xNotify */
78377859
);
78387860
78397861
78407862
/*
@@ -7843,12 +7865,12 @@
78437865
** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications
78447866
** and extensions to compare the contents of two buffers containing UTF-8
78457867
** strings in a case-independent fashion, using the same definition of "case
78467868
** independence" that SQLite uses internally when comparing identifiers.
78477869
*/
7848
-SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *, const char *);
7849
-SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *, const char *, int);
7870
+SQLITE_API int SQLITE_APICALL sqlite3_stricmp(const char *, const char *);
7871
+SQLITE_API int SQLITE_APICALL sqlite3_strnicmp(const char *, const char *, int);
78507872
78517873
/*
78527874
** CAPI3REF: String Globbing
78537875
*
78547876
** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if
@@ -7861,11 +7883,11 @@
78617883
** Note that this routine returns zero on a match and non-zero if the strings
78627884
** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
78637885
**
78647886
** See also: [sqlite3_strlike()].
78657887
*/
7866
-SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlob, const char *zStr);
7888
+SQLITE_API int SQLITE_APICALL sqlite3_strglob(const char *zGlob, const char *zStr);
78677889
78687890
/*
78697891
** CAPI3REF: String LIKE Matching
78707892
*
78717893
** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if
@@ -7884,11 +7906,11 @@
78847906
** Note that this routine returns zero on a match and non-zero if the strings
78857907
** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
78867908
**
78877909
** See also: [sqlite3_strglob()].
78887910
*/
7889
-SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
7911
+SQLITE_API int SQLITE_APICALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
78907912
78917913
/*
78927914
** CAPI3REF: Error Logging Interface
78937915
**
78947916
** ^The [sqlite3_log()] interface writes a message into the [error log]
@@ -7943,13 +7965,13 @@
79437965
** previously registered write-ahead log callback. ^Note that the
79447966
** [sqlite3_wal_autocheckpoint()] interface and the
79457967
** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will
79467968
** overwrite any prior [sqlite3_wal_hook()] settings.
79477969
*/
7948
-SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
7970
+SQLITE_API void *SQLITE_APICALL sqlite3_wal_hook(
79497971
sqlite3*,
7950
- int(*)(void *,sqlite3*,const char*,int),
7972
+ int(SQLITE_CALLBACK *)(void *,sqlite3*,const char*,int),
79517973
void*
79527974
);
79537975
79547976
/*
79557977
** CAPI3REF: Configure an auto-checkpoint
@@ -7978,11 +8000,11 @@
79788000
** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]
79798001
** pages. The use of this interface
79808002
** is only necessary if the default setting is found to be suboptimal
79818003
** for a particular application.
79828004
*/
7983
-SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
8005
+SQLITE_API int SQLITE_APICALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
79848006
79858007
/*
79868008
** CAPI3REF: Checkpoint a database
79878009
** METHOD: sqlite3
79888010
**
@@ -8000,11 +8022,11 @@
80008022
** interface was added. This interface is retained for backwards
80018023
** compatibility and as a convenience for applications that need to manually
80028024
** start a callback but which do not need the full power (and corresponding
80038025
** complication) of [sqlite3_wal_checkpoint_v2()].
80048026
*/
8005
-SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
8027
+SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
80068028
80078029
/*
80088030
** CAPI3REF: Checkpoint a database
80098031
** METHOD: sqlite3
80108032
**
@@ -8094,11 +8116,11 @@
80948116
** [sqlite3_errcode()] and [sqlite3_errmsg()].
80958117
**
80968118
** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface
80978119
** from SQL.
80988120
*/
8099
-SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
8121
+SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint_v2(
81008122
sqlite3 *db, /* Database handle */
81018123
const char *zDb, /* Name of attached database (or NULL) */
81028124
int eMode, /* SQLITE_CHECKPOINT_* value */
81038125
int *pnLog, /* OUT: Size of WAL log in frames */
81048126
int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -8183,11 +8205,11 @@
81838205
** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL],
81848206
** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode
81858207
** of the SQL statement that triggered the call to the [xUpdate] method of the
81868208
** [virtual table].
81878209
*/
8188
-SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *);
8210
+SQLITE_API int SQLITE_APICALL sqlite3_vtab_on_conflict(sqlite3 *);
81898211
81908212
/*
81918213
** CAPI3REF: Conflict resolution modes
81928214
** KEYWORDS: {conflict resolution mode}
81938215
**
@@ -8288,11 +8310,11 @@
82888310
** as if the loop did not exist - it returns non-zero and leave the variable
82898311
** that pOut points to unchanged.
82908312
**
82918313
** See also: [sqlite3_stmt_scanstatus_reset()]
82928314
*/
8293
-SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus(
8315
+SQLITE_API int SQLITE_APICALL sqlite3_stmt_scanstatus(
82948316
sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
82958317
int idx, /* Index of loop to report on */
82968318
int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
82978319
void *pOut /* Result written here */
82988320
);
@@ -8304,11 +8326,11 @@
83048326
** ^Zero all [sqlite3_stmt_scanstatus()] related event counters.
83058327
**
83068328
** This API is only available if the library is built with pre-processor
83078329
** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined.
83088330
*/
8309
-SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
8331
+SQLITE_API void SQLITE_APICALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
83108332
83118333
/*
83128334
** CAPI3REF: Flush caches to disk mid-transaction
83138335
**
83148336
** ^If a write-transaction is open on [database connection] D when the
@@ -8336,11 +8358,11 @@
83368358
** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK.
83378359
**
83388360
** ^This function does not set the database handle error code or message
83398361
** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions.
83408362
*/
8341
-SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3*);
8363
+SQLITE_API int SQLITE_APICALL sqlite3_db_cacheflush(sqlite3*);
83428364
83438365
/*
83448366
** CAPI3REF: The pre-update hook.
83458367
**
83468368
** ^These interfaces are only available if SQLite is compiled using the
@@ -8416,13 +8438,13 @@
84168438
** triggers; or 2 for changes resulting from triggers called by top-level
84178439
** triggers; and so forth.
84188440
**
84198441
** See also: [sqlite3_update_hook()]
84208442
*/
8421
-SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_STDCALL sqlite3_preupdate_hook(
8443
+SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_APICALL sqlite3_preupdate_hook(
84228444
sqlite3 *db,
8423
- void(*xPreUpdate)(
8445
+ void(SQLITE_CALLBACK *xPreUpdate)(
84248446
void *pCtx, /* Copy of third arg to preupdate_hook() */
84258447
sqlite3 *db, /* Database handle */
84268448
int op, /* SQLITE_UPDATE, DELETE or INSERT */
84278449
char const *zDb, /* Database name */
84288450
char const *zName, /* Table name */
@@ -8429,14 +8451,14 @@
84298451
sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */
84308452
sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */
84318453
),
84328454
void*
84338455
);
8434
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **);
8435
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *);
8436
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *);
8437
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **);
8456
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **);
8457
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_count(sqlite3 *);
8458
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_depth(sqlite3 *);
8459
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **);
84388460
84398461
/*
84408462
** CAPI3REF: Low-level system error code
84418463
**
84428464
** ^Attempt to return the underlying operating system error code or error
@@ -8444,11 +8466,11 @@
84448466
** The return value is OS-dependent. For example, on unix systems, after
84458467
** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be
84468468
** called to get back the underlying "errno" that caused the problem, such
84478469
** as ENOSPC, EAUTH, EISDIR, and so forth.
84488470
*/
8449
-SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3*);
8471
+SQLITE_API int SQLITE_APICALL sqlite3_system_errno(sqlite3*);
84508472
84518473
/*
84528474
** CAPI3REF: Database Snapshot
84538475
** KEYWORDS: {snapshot}
84548476
** EXPERIMENTAL
@@ -8494,11 +8516,11 @@
84948516
** to avoid a memory leak.
84958517
**
84968518
** The [sqlite3_snapshot_get()] interface is only available when the
84978519
** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
84988520
*/
8499
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_get(
8521
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_get(
85008522
sqlite3 *db,
85018523
const char *zSchema,
85028524
sqlite3_snapshot **ppSnapshot
85038525
);
85048526
@@ -8532,11 +8554,11 @@
85328554
** database connection in order to make it ready to use snapshots.)
85338555
**
85348556
** The [sqlite3_snapshot_open()] interface is only available when the
85358557
** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
85368558
*/
8537
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_open(
8559
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_open(
85388560
sqlite3 *db,
85398561
const char *zSchema,
85408562
sqlite3_snapshot *pSnapshot
85418563
);
85428564
@@ -8549,11 +8571,11 @@
85498571
** using this routine to avoid a memory leak.
85508572
**
85518573
** The [sqlite3_snapshot_free()] interface is only available when the
85528574
** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
85538575
*/
8554
-SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot*);
8576
+SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_APICALL sqlite3_snapshot_free(sqlite3_snapshot*);
85558577
85568578
/*
85578579
** CAPI3REF: Compare the ages of two snapshot handles.
85588580
** EXPERIMENTAL
85598581
**
@@ -8573,11 +8595,11 @@
85738595
**
85748596
** Otherwise, this API returns a negative value if P1 refers to an older
85758597
** snapshot than P2, zero if the two handles refer to the same database
85768598
** snapshot, and a positive value if P1 is a newer snapshot than P2.
85778599
*/
8578
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_cmp(
8600
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_cmp(
85798601
sqlite3_snapshot *p1,
85808602
sqlite3_snapshot *p2
85818603
);
85828604
85838605
/*
@@ -8631,14 +8653,14 @@
86318653
** Register a geometry callback named zGeom that can be used as part of an
86328654
** R-Tree geometry query as follows:
86338655
**
86348656
** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
86358657
*/
8636
-SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
8658
+SQLITE_API int SQLITE_APICALL sqlite3_rtree_geometry_callback(
86378659
sqlite3 *db,
86388660
const char *zGeom,
8639
- int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
8661
+ int (SQLITE_CALLBACK *xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
86408662
void *pContext
86418663
);
86428664
86438665
86448666
/*
@@ -8648,25 +8670,25 @@
86488670
struct sqlite3_rtree_geometry {
86498671
void *pContext; /* Copy of pContext passed to s_r_g_c() */
86508672
int nParam; /* Size of array aParam[] */
86518673
sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */
86528674
void *pUser; /* Callback implementation user data */
8653
- void (*xDelUser)(void *); /* Called by SQLite to clean up pUser */
8675
+ void (SQLITE_CALLBACK *xDelUser)(void *); /* Called by SQLite to clean up pUser */
86548676
};
86558677
86568678
/*
86578679
** Register a 2nd-generation geometry callback named zScore that can be
86588680
** used as part of an R-Tree geometry query as follows:
86598681
**
86608682
** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...)
86618683
*/
8662
-SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
8684
+SQLITE_API int SQLITE_APICALL sqlite3_rtree_query_callback(
86638685
sqlite3 *db,
86648686
const char *zQueryFunc,
8665
- int (*xQueryFunc)(sqlite3_rtree_query_info*),
8687
+ int (SQLITE_CALLBACK *xQueryFunc)(sqlite3_rtree_query_info*),
86668688
void *pContext,
8667
- void (*xDestructor)(void*)
8689
+ void (SQLITE_CALLBACK *xDestructor)(void*)
86688690
);
86698691
86708692
86718693
/*
86728694
** A pointer to a structure of the following type is passed as the
@@ -8680,11 +8702,11 @@
86808702
struct sqlite3_rtree_query_info {
86818703
void *pContext; /* pContext from when function registered */
86828704
int nParam; /* Number of function parameters */
86838705
sqlite3_rtree_dbl *aParam; /* value of function parameters */
86848706
void *pUser; /* callback can use this, if desired */
8685
- void (*xDelUser)(void*); /* function to free pUser */
8707
+ void (SQLITE_CALLBACK *xDelUser)(void*); /* function to free pUser */
86868708
sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */
86878709
unsigned int *anQueue; /* Number of pending entries in the queue */
86888710
int nCoord; /* Number of coordinates */
86898711
int iLevel; /* Level of current node or entry */
86908712
int mxLevel; /* The largest iLevel value in the tree */
@@ -8876,11 +8898,11 @@
88768898
** If xFilter returns 0, changes is not tracked. Note that once a table is
88778899
** attached, xFilter will not be called again.
88788900
*/
88798901
void sqlite3session_table_filter(
88808902
sqlite3_session *pSession, /* Session object */
8881
- int(*xFilter)(
8903
+ int(SQLITE_CALLBACK *xFilter)(
88828904
void *pCtx, /* Copy of third arg to _filter_table() */
88838905
const char *zTab /* Table name */
88848906
),
88858907
void *pCtx /* First argument passed to xFilter */
88868908
);
@@ -9451,11 +9473,11 @@
94519473
** An sqlite3_changegroup object is used to combine two or more changesets
94529474
** (or patchsets) into a single changeset (or patchset). A single changegroup
94539475
** object may combine changesets or patchsets, but not both. The output is
94549476
** always in the same format as the input.
94559477
**
9456
-** If successful, this function returns SQLITE_OK and populates (*pp) with
9478
+** If successful, this function returns SQLITE_OK and populates (SQLITE_CALLBACK *pp) with
94579479
** a pointer to a new sqlite3_changegroup object before returning. The caller
94589480
** should eventually free the returned object using a call to
94599481
** sqlite3changegroup_delete(). If an error occurs, an SQLite error code
94609482
** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL.
94619483
**
@@ -9571,11 +9593,11 @@
95719593
** changes for tables that do not appear in the first changeset, they are
95729594
** appended onto the end of the output changeset, again in the order in
95739595
** which they are first encountered.
95749596
**
95759597
** If an error occurs, an SQLite error code is returned and the output
9576
-** variables (*pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK
9598
+** variables (SQLITE_CALLBACK *pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK
95779599
** is returned and the output variables are set to the size of and a
95789600
** pointer to the output buffer, respectively. In this case it is the
95799601
** responsibility of the caller to eventually free the buffer using a
95809602
** call to sqlite3_free().
95819603
*/
@@ -9728,15 +9750,15 @@
97289750
*/
97299751
int sqlite3changeset_apply(
97309752
sqlite3 *db, /* Apply change to "main" db of this handle */
97319753
int nChangeset, /* Size of changeset in bytes */
97329754
void *pChangeset, /* Changeset blob */
9733
- int(*xFilter)(
9755
+ int(SQLITE_CALLBACK *xFilter)(
97349756
void *pCtx, /* Copy of sixth arg to _apply() */
97359757
const char *zTab /* Table name */
97369758
),
9737
- int(*xConflict)(
9759
+ int(SQLITE_CALLBACK *xConflict)(
97389760
void *pCtx, /* Copy of sixth arg to _apply() */
97399761
int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
97409762
sqlite3_changeset_iter *p /* Handle describing change and conflict */
97419763
),
97429764
void *pCtx /* First argument passed to xConflict */
@@ -9873,20 +9895,20 @@
98739895
** </pre>
98749896
**
98759897
** Is replaced by:
98769898
**
98779899
** <pre>
9878
-** &nbsp; int (*xInput)(void *pIn, void *pData, int *pnData),
9900
+** &nbsp; int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
98799901
** &nbsp; void *pIn,
98809902
** </pre>
98819903
**
98829904
** Each time the xInput callback is invoked by the sessions module, the first
98839905
** argument passed is a copy of the supplied pIn context pointer. The second
9884
-** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no
9885
-** error occurs the xInput method should copy up to (*pnData) bytes of data
9886
-** into the buffer and set (*pnData) to the actual number of bytes copied
9887
-** before returning SQLITE_OK. If the input is completely exhausted, (*pnData)
9906
+** argument, pData, points to a buffer (SQLITE_CALLBACK *pnData) bytes in size. Assuming no
9907
+** error occurs the xInput method should copy up to (SQLITE_CALLBACK *pnData) bytes of data
9908
+** into the buffer and set (SQLITE_CALLBACK *pnData) to the actual number of bytes copied
9909
+** before returning SQLITE_OK. If the input is completely exhausted, (SQLITE_CALLBACK *pnData)
98889910
** should be set to zero to indicate this. Or, if an error occurs, an SQLite
98899911
** error code should be returned. In all cases, if an xInput callback returns
98909912
** an error, all processing is abandoned and the streaming API function
98919913
** returns a copy of the error code to the caller.
98929914
**
@@ -9907,11 +9929,11 @@
99079929
** </pre>
99089930
**
99099931
** Is replaced by:
99109932
**
99119933
** <pre>
9912
-** &nbsp; int (*xOutput)(void *pOut, const void *pData, int nData),
9934
+** &nbsp; int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
99139935
** &nbsp; void *pOut
99149936
** </pre>
99159937
**
99169938
** The xOutput callback is invoked zero or more times to return data to
99179939
** the application. The first parameter passed to each call is a copy of the
@@ -9927,58 +9949,58 @@
99279949
** parameter set to a value less than or equal to zero. Other than this,
99289950
** no guarantees are made as to the size of the chunks of data returned.
99299951
*/
99309952
int sqlite3changeset_apply_strm(
99319953
sqlite3 *db, /* Apply change to "main" db of this handle */
9932
- int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
9954
+ int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), /* Input function */
99339955
void *pIn, /* First arg for xInput */
9934
- int(*xFilter)(
9956
+ int(SQLITE_CALLBACK *xFilter)(
99359957
void *pCtx, /* Copy of sixth arg to _apply() */
99369958
const char *zTab /* Table name */
99379959
),
9938
- int(*xConflict)(
9960
+ int(SQLITE_CALLBACK *xConflict)(
99399961
void *pCtx, /* Copy of sixth arg to _apply() */
99409962
int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
99419963
sqlite3_changeset_iter *p /* Handle describing change and conflict */
99429964
),
99439965
void *pCtx /* First argument passed to xConflict */
99449966
);
99459967
int sqlite3changeset_concat_strm(
9946
- int (*xInputA)(void *pIn, void *pData, int *pnData),
9968
+ int (SQLITE_CALLBACK *xInputA)(void *pIn, void *pData, int *pnData),
99479969
void *pInA,
9948
- int (*xInputB)(void *pIn, void *pData, int *pnData),
9970
+ int (SQLITE_CALLBACK *xInputB)(void *pIn, void *pData, int *pnData),
99499971
void *pInB,
9950
- int (*xOutput)(void *pOut, const void *pData, int nData),
9972
+ int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
99519973
void *pOut
99529974
);
99539975
int sqlite3changeset_invert_strm(
9954
- int (*xInput)(void *pIn, void *pData, int *pnData),
9976
+ int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
99559977
void *pIn,
9956
- int (*xOutput)(void *pOut, const void *pData, int nData),
9978
+ int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
99579979
void *pOut
99589980
);
99599981
int sqlite3changeset_start_strm(
99609982
sqlite3_changeset_iter **pp,
9961
- int (*xInput)(void *pIn, void *pData, int *pnData),
9983
+ int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
99629984
void *pIn
99639985
);
99649986
int sqlite3session_changeset_strm(
99659987
sqlite3_session *pSession,
9966
- int (*xOutput)(void *pOut, const void *pData, int nData),
9988
+ int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
99679989
void *pOut
99689990
);
99699991
int sqlite3session_patchset_strm(
99709992
sqlite3_session *pSession,
9971
- int (*xOutput)(void *pOut, const void *pData, int nData),
9993
+ int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
99729994
void *pOut
99739995
);
99749996
int sqlite3changegroup_add_strm(sqlite3_changegroup*,
9975
- int (*xInput)(void *pIn, void *pData, int *pnData),
9997
+ int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
99769998
void *pIn
99779999
);
997810000
int sqlite3changegroup_output_strm(sqlite3_changegroup*,
9979
- int (*xOutput)(void *pOut, const void *pData, int nData),
10001
+ int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
998010002
void *pOut
998110003
);
998210004
998310005
998410006
/*
@@ -10029,11 +10051,11 @@
1002910051
1003010052
typedef struct Fts5ExtensionApi Fts5ExtensionApi;
1003110053
typedef struct Fts5Context Fts5Context;
1003210054
typedef struct Fts5PhraseIter Fts5PhraseIter;
1003310055
10034
-typedef void (*fts5_extension_function)(
10056
+typedef void (SQLITE_CALLBACK *fts5_extension_function)(
1003510057
const Fts5ExtensionApi *pApi, /* API offered by current FTS version */
1003610058
Fts5Context *pFts, /* First arg to pass to pApi functions */
1003710059
sqlite3_context *pCtx, /* Context for returning result/error */
1003810060
int nVal, /* Number of values in apVal[] array */
1003910061
sqlite3_value **apVal /* Array of trailing arguments */
@@ -10080,15 +10102,15 @@
1008010102
** This function may be quite inefficient if used with an FTS5 table
1008110103
** created with the "columnsize=0" option.
1008210104
**
1008310105
** xColumnText:
1008410106
** This function attempts to retrieve the text of column iCol of the
10085
-** current document. If successful, (*pz) is set to point to a buffer
10086
-** containing the text in utf-8 encoding, (*pn) is set to the size in bytes
10107
+** current document. If successful, (SQLITE_CALLBACK *pz) is set to point to a buffer
10108
+** containing the text in utf-8 encoding, (SQLITE_CALLBACK *pn) is set to the size in bytes
1008710109
** (not characters) of the buffer and SQLITE_OK is returned. Otherwise,
1008810110
** if an error occurs, an SQLite error code is returned and the final values
10089
-** of (*pz) and (*pn) are undefined.
10111
+** of (SQLITE_CALLBACK *pz) and (*pn) are undefined.
1009010112
**
1009110113
** xPhraseCount:
1009210114
** Returns the number of phrases in the current query expression.
1009310115
**
1009410116
** xPhraseSize:
@@ -10193,11 +10215,11 @@
1019310215
** xRowCount(pFts5, pnRow)
1019410216
**
1019510217
** This function is used to retrieve the total number of rows in the table.
1019610218
** In other words, the same value that would be returned by:
1019710219
**
10198
-** SELECT count(*) FROM ftstable;
10220
+** SELECT count(SQLITE_CALLBACK *) FROM ftstable;
1019910221
**
1020010222
** xPhraseFirst()
1020110223
** This function is used, along with type Fts5PhraseIter and the xPhraseNext
1020210224
** method, to iterate through all instances of a single query phrase within
1020310225
** the current row. This is the same information as is accessible via the
@@ -10260,43 +10282,43 @@
1026010282
** See xPhraseFirstColumn above.
1026110283
*/
1026210284
struct Fts5ExtensionApi {
1026310285
int iVersion; /* Currently always set to 3 */
1026410286
10265
- void *(*xUserData)(Fts5Context*);
10287
+ void *(SQLITE_CALLBACK *xUserData)(Fts5Context*);
1026610288
10267
- int (*xColumnCount)(Fts5Context*);
10268
- int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow);
10269
- int (*xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken);
10289
+ int (SQLITE_CALLBACK *xColumnCount)(Fts5Context*);
10290
+ int (SQLITE_CALLBACK *xRowCount)(Fts5Context*, sqlite3_int64 *pnRow);
10291
+ int (SQLITE_CALLBACK *xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken);
1027010292
10271
- int (*xTokenize)(Fts5Context*,
10293
+ int (SQLITE_CALLBACK *xTokenize)(Fts5Context*,
1027210294
const char *pText, int nText, /* Text to tokenize */
1027310295
void *pCtx, /* Context passed to xToken() */
10274
- int (*xToken)(void*, int, const char*, int, int, int) /* Callback */
10275
- );
10276
-
10277
- int (*xPhraseCount)(Fts5Context*);
10278
- int (*xPhraseSize)(Fts5Context*, int iPhrase);
10279
-
10280
- int (*xInstCount)(Fts5Context*, int *pnInst);
10281
- int (*xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff);
10282
-
10283
- sqlite3_int64 (*xRowid)(Fts5Context*);
10284
- int (*xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn);
10285
- int (*xColumnSize)(Fts5Context*, int iCol, int *pnToken);
10286
-
10287
- int (*xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData,
10288
- int(*)(const Fts5ExtensionApi*,Fts5Context*,void*)
10289
- );
10290
- int (*xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*));
10291
- void *(*xGetAuxdata)(Fts5Context*, int bClear);
10292
-
10293
- int (*xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*);
10294
- void (*xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff);
10295
-
10296
- int (*xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*);
10297
- void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol);
10296
+ int (SQLITE_CALLBACK *xToken)(void*, int, const char*, int, int, int) /* Callback */
10297
+ );
10298
+
10299
+ int (SQLITE_CALLBACK *xPhraseCount)(Fts5Context*);
10300
+ int (SQLITE_CALLBACK *xPhraseSize)(Fts5Context*, int iPhrase);
10301
+
10302
+ int (SQLITE_CALLBACK *xInstCount)(Fts5Context*, int *pnInst);
10303
+ int (SQLITE_CALLBACK *xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff);
10304
+
10305
+ sqlite3_int64 (SQLITE_CALLBACK *xRowid)(Fts5Context*);
10306
+ int (SQLITE_CALLBACK *xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn);
10307
+ int (SQLITE_CALLBACK *xColumnSize)(Fts5Context*, int iCol, int *pnToken);
10308
+
10309
+ int (SQLITE_CALLBACK *xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData,
10310
+ int(SQLITE_CALLBACK *)(const Fts5ExtensionApi*,Fts5Context*,void*)
10311
+ );
10312
+ int (SQLITE_CALLBACK *xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*));
10313
+ void *(SQLITE_CALLBACK *xGetAuxdata)(Fts5Context*, int bClear);
10314
+
10315
+ int (SQLITE_CALLBACK *xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*);
10316
+ void (SQLITE_CALLBACK *xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff);
10317
+
10318
+ int (SQLITE_CALLBACK *xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*);
10319
+ void (SQLITE_CALLBACK *xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol);
1029810320
};
1029910321
1030010322
/*
1030110323
** CUSTOM AUXILIARY FUNCTIONS
1030210324
*************************************************************************/
@@ -10320,11 +10342,11 @@
1032010342
** The second and third arguments are an array of nul-terminated strings
1032110343
** containing the tokenizer arguments, if any, specified following the
1032210344
** tokenizer name as part of the CREATE VIRTUAL TABLE statement used
1032310345
** to create the FTS5 table.
1032410346
**
10325
-** The final argument is an output variable. If successful, (*ppOut)
10347
+** The final argument is an output variable. If successful, (SQLITE_CALLBACK *ppOut)
1032610348
** should be set to point to the new tokenizer handle and SQLITE_OK
1032710349
** returned. If an error occurs, some value other than SQLITE_OK should
1032810350
** be returned. In this case, fts5 assumes that the final value of *ppOut
1032910351
** is undefined.
1033010352
**
@@ -10494,17 +10516,17 @@
1049410516
** inefficient.
1049510517
*/
1049610518
typedef struct Fts5Tokenizer Fts5Tokenizer;
1049710519
typedef struct fts5_tokenizer fts5_tokenizer;
1049810520
struct fts5_tokenizer {
10499
- int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
10500
- void (*xDelete)(Fts5Tokenizer*);
10501
- int (*xTokenize)(Fts5Tokenizer*,
10521
+ int (SQLITE_CALLBACK *xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
10522
+ void (SQLITE_CALLBACK *xDelete)(Fts5Tokenizer*);
10523
+ int (SQLITE_CALLBACK *xTokenize)(Fts5Tokenizer*,
1050210524
void *pCtx,
1050310525
int flags, /* Mask of FTS5_TOKENIZE_* flags */
1050410526
const char *pText, int nText,
10505
- int (*xToken)(
10527
+ int (SQLITE_CALLBACK *xToken)(
1050610528
void *pCtx, /* Copy of 2nd argument to xTokenize() */
1050710529
int tflags, /* Mask of FTS5_TOKEN_* flags */
1050810530
const char *pToken, /* Pointer to buffer containing token */
1050910531
int nToken, /* Size of token in bytes */
1051010532
int iStart, /* Byte offset of token within input text */
@@ -10533,33 +10555,33 @@
1053310555
typedef struct fts5_api fts5_api;
1053410556
struct fts5_api {
1053510557
int iVersion; /* Currently always set to 2 */
1053610558
1053710559
/* Create a new tokenizer */
10538
- int (*xCreateTokenizer)(
10560
+ int (SQLITE_CALLBACK *xCreateTokenizer)(
1053910561
fts5_api *pApi,
1054010562
const char *zName,
1054110563
void *pContext,
1054210564
fts5_tokenizer *pTokenizer,
10543
- void (*xDestroy)(void*)
10565
+ void (SQLITE_CALLBACK *xDestroy)(void*)
1054410566
);
1054510567
1054610568
/* Find an existing tokenizer */
10547
- int (*xFindTokenizer)(
10569
+ int (SQLITE_CALLBACK *xFindTokenizer)(
1054810570
fts5_api *pApi,
1054910571
const char *zName,
1055010572
void **ppContext,
1055110573
fts5_tokenizer *pTokenizer
1055210574
);
1055310575
1055410576
/* Create a new auxiliary function */
10555
- int (*xCreateFunction)(
10577
+ int (SQLITE_CALLBACK *xCreateFunction)(
1055610578
fts5_api *pApi,
1055710579
const char *zName,
1055810580
void *pContext,
1055910581
fts5_extension_function xFunction,
10560
- void (*xDestroy)(void*)
10582
+ void (SQLITE_CALLBACK *xDestroy)(void*)
1056110583
);
1056210584
};
1056310585
1056410586
/*
1056510587
** END OF REGISTRATION API
@@ -11873,12 +11895,12 @@
1187311895
*/
1187411896
#ifdef SQLITE_OMIT_WSD
1187511897
#define SQLITE_WSD const
1187611898
#define GLOBAL(t,v) (*(t*)sqlite3_wsd_find((void*)&(v), sizeof(v)))
1187711899
#define sqlite3GlobalConfig GLOBAL(struct Sqlite3Config, sqlite3Config)
11878
-SQLITE_API int SQLITE_STDCALL sqlite3_wsd_init(int N, int J);
11879
-SQLITE_API void *SQLITE_STDCALL sqlite3_wsd_find(void *K, int L);
11900
+SQLITE_API int SQLITE_APICALL sqlite3_wsd_init(int N, int J);
11901
+SQLITE_API void *SQLITE_APICALL sqlite3_wsd_find(void *K, int L);
1188011902
#else
1188111903
#define SQLITE_WSD
1188211904
#define GLOBAL(t,v) v
1188311905
#define sqlite3GlobalConfig sqlite3Config
1188411906
#endif
@@ -17165,12 +17187,14 @@
1716517187
"CASE_SENSITIVE_LIKE",
1716617188
#endif
1716717189
#if SQLITE_CHECK_PAGES
1716817190
"CHECK_PAGES",
1716917191
#endif
17170
-#if defined(__clang__) && defined(__clang_version__)
17171
- "COMPILER=clang-" __clang_version__,
17192
+#if defined(__clang__) && defined(__clang_major__)
17193
+ "COMPILER=clang-" CTIMEOPT_VAL(__clang_major__) "."
17194
+ CTIMEOPT_VAL(__clang_minor__) "."
17195
+ CTIMEOPT_VAL(__clang_patchlevel__),
1717217196
#elif defined(_MSC_VER)
1717317197
"COMPILER=msvc-" CTIMEOPT_VAL(_MSC_VER),
1717417198
#elif defined(__GNUC__) && defined(__VERSION__)
1717517199
"COMPILER=gcc-" __VERSION__,
1717617200
#endif
@@ -17531,11 +17555,11 @@
1753117555
** was used and false if not.
1753217556
**
1753317557
** The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix
1753417558
** is not required for a match.
1753517559
*/
17536
-SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName){
17560
+SQLITE_API int SQLITE_APICALL sqlite3_compileoption_used(const char *zOptName){
1753717561
int i, n;
1753817562
1753917563
#if SQLITE_ENABLE_API_ARMOR
1754017564
if( zOptName==0 ){
1754117565
(void)SQLITE_MISUSE_BKPT;
@@ -17559,11 +17583,11 @@
1755917583
1756017584
/*
1756117585
** Return the N-th compile-time option string. If N is out of range,
1756217586
** return a NULL pointer.
1756317587
*/
17564
-SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N){
17588
+SQLITE_API const char *SQLITE_APICALL sqlite3_compileoption_get(int N){
1756517589
if( N>=0 && N<ArraySize(azCompileOpt) ){
1756617590
return azCompileOpt[N];
1756717591
}
1756817592
return 0;
1756917593
}
@@ -18269,11 +18293,11 @@
1826918293
}
1827018294
1827118295
/*
1827218296
** Query status information.
1827318297
*/
18274
-SQLITE_API int SQLITE_STDCALL sqlite3_status64(
18298
+SQLITE_API int SQLITE_APICALL sqlite3_status64(
1827518299
int op,
1827618300
sqlite3_int64 *pCurrent,
1827718301
sqlite3_int64 *pHighwater,
1827818302
int resetFlag
1827918303
){
@@ -18294,11 +18318,11 @@
1829418318
}
1829518319
sqlite3_mutex_leave(pMutex);
1829618320
(void)pMutex; /* Prevent warning when SQLITE_THREADSAFE=0 */
1829718321
return SQLITE_OK;
1829818322
}
18299
-SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){
18323
+SQLITE_API int SQLITE_APICALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){
1830018324
sqlite3_int64 iCur, iHwtr;
1830118325
int rc;
1830218326
#ifdef SQLITE_ENABLE_API_ARMOR
1830318327
if( pCurrent==0 || pHighwater==0 ) return SQLITE_MISUSE_BKPT;
1830418328
#endif
@@ -18311,11 +18335,11 @@
1831118335
}
1831218336
1831318337
/*
1831418338
** Query status information for a single database connection
1831518339
*/
18316
-SQLITE_API int SQLITE_STDCALL sqlite3_db_status(
18340
+SQLITE_API int SQLITE_APICALL sqlite3_db_status(
1831718341
sqlite3 *db, /* The database connection whose status is desired */
1831818342
int op, /* Status verb */
1831918343
int *pCurrent, /* Write current value here */
1832018344
int *pHighwater, /* Write high-water mark here */
1832118345
int resetFlag /* Reset high-water mark if true */
@@ -19989,11 +20013,11 @@
1998920013
1999020014
/*
1999120015
** Locate a VFS by name. If no name is given, simply return the
1999220016
** first VFS on the list.
1999320017
*/
19994
-SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfs){
20018
+SQLITE_API sqlite3_vfs *SQLITE_APICALL sqlite3_vfs_find(const char *zVfs){
1999520019
sqlite3_vfs *pVfs = 0;
1999620020
#if SQLITE_THREADSAFE
1999720021
sqlite3_mutex *mutex;
1999820022
#endif
1999920023
#ifndef SQLITE_OMIT_AUTOINIT
@@ -20035,11 +20059,11 @@
2003520059
/*
2003620060
** Register a VFS with the system. It is harmless to register the same
2003720061
** VFS multiple times. The new VFS becomes the default if makeDflt is
2003820062
** true.
2003920063
*/
20040
-SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){
20064
+SQLITE_API int SQLITE_APICALL sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){
2004120065
MUTEX_LOGIC(sqlite3_mutex *mutex;)
2004220066
#ifndef SQLITE_OMIT_AUTOINIT
2004320067
int rc = sqlite3_initialize();
2004420068
if( rc ) return rc;
2004520069
#endif
@@ -20063,11 +20087,11 @@
2006320087
}
2006420088
2006520089
/*
2006620090
** Unregister a VFS so that it is no longer accessible.
2006720091
*/
20068
-SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs *pVfs){
20092
+SQLITE_API int SQLITE_APICALL sqlite3_vfs_unregister(sqlite3_vfs *pVfs){
2006920093
#if SQLITE_THREADSAFE
2007020094
sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
2007120095
#endif
2007220096
sqlite3_mutex_enter(mutex);
2007320097
vfsUnlink(pVfs);
@@ -22414,11 +22438,11 @@
2241422438
}
2241522439
2241622440
/*
2241722441
** Retrieve a pointer to a static mutex or allocate a new dynamic one.
2241822442
*/
22419
-SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int id){
22443
+SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_mutex_alloc(int id){
2242022444
#ifndef SQLITE_OMIT_AUTOINIT
2242122445
if( id<=SQLITE_MUTEX_RECURSIVE && sqlite3_initialize() ) return 0;
2242222446
if( id>SQLITE_MUTEX_RECURSIVE && sqlite3MutexInit() ) return 0;
2242322447
#endif
2242422448
assert( sqlite3GlobalConfig.mutex.xMutexAlloc );
@@ -22435,11 +22459,11 @@
2243522459
}
2243622460
2243722461
/*
2243822462
** Free a dynamic mutex.
2243922463
*/
22440
-SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex *p){
22464
+SQLITE_API void SQLITE_APICALL sqlite3_mutex_free(sqlite3_mutex *p){
2244122465
if( p ){
2244222466
assert( sqlite3GlobalConfig.mutex.xMutexFree );
2244322467
sqlite3GlobalConfig.mutex.xMutexFree(p);
2244422468
}
2244522469
}
@@ -22446,11 +22470,11 @@
2244622470
2244722471
/*
2244822472
** Obtain the mutex p. If some other thread already has the mutex, block
2244922473
** until it can be obtained.
2245022474
*/
22451
-SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex *p){
22475
+SQLITE_API void SQLITE_APICALL sqlite3_mutex_enter(sqlite3_mutex *p){
2245222476
if( p ){
2245322477
assert( sqlite3GlobalConfig.mutex.xMutexEnter );
2245422478
sqlite3GlobalConfig.mutex.xMutexEnter(p);
2245522479
}
2245622480
}
@@ -22457,11 +22481,11 @@
2245722481
2245822482
/*
2245922483
** Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another
2246022484
** thread holds the mutex and it cannot be obtained, return SQLITE_BUSY.
2246122485
*/
22462
-SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex *p){
22486
+SQLITE_API int SQLITE_APICALL sqlite3_mutex_try(sqlite3_mutex *p){
2246322487
int rc = SQLITE_OK;
2246422488
if( p ){
2246522489
assert( sqlite3GlobalConfig.mutex.xMutexTry );
2246622490
return sqlite3GlobalConfig.mutex.xMutexTry(p);
2246722491
}
@@ -22472,11 +22496,11 @@
2247222496
** The sqlite3_mutex_leave() routine exits a mutex that was previously
2247322497
** entered by the same thread. The behavior is undefined if the mutex
2247422498
** is not currently entered. If a NULL pointer is passed as an argument
2247522499
** this function is a no-op.
2247622500
*/
22477
-SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex *p){
22501
+SQLITE_API void SQLITE_APICALL sqlite3_mutex_leave(sqlite3_mutex *p){
2247822502
if( p ){
2247922503
assert( sqlite3GlobalConfig.mutex.xMutexLeave );
2248022504
sqlite3GlobalConfig.mutex.xMutexLeave(p);
2248122505
}
2248222506
}
@@ -22484,15 +22508,15 @@
2248422508
#ifndef NDEBUG
2248522509
/*
2248622510
** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are
2248722511
** intended for use inside assert() statements.
2248822512
*/
22489
-SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex *p){
22513
+SQLITE_API int SQLITE_APICALL sqlite3_mutex_held(sqlite3_mutex *p){
2249022514
assert( p==0 || sqlite3GlobalConfig.mutex.xMutexHeld );
2249122515
return p==0 || sqlite3GlobalConfig.mutex.xMutexHeld(p);
2249222516
}
22493
-SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex *p){
22517
+SQLITE_API int SQLITE_APICALL sqlite3_mutex_notheld(sqlite3_mutex *p){
2249422518
assert( p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld );
2249522519
return p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld(p);
2249622520
}
2249722521
#endif
2249822522
@@ -23520,12 +23544,12 @@
2352023544
** of the sqlite3_initialize() and sqlite3_shutdown() processing, the
2352123545
** "interlocked" magic used here is probably not strictly necessary.
2352223546
*/
2352323547
static LONG SQLITE_WIN32_VOLATILE winMutex_lock = 0;
2352423548
23525
-SQLITE_API int SQLITE_STDCALL sqlite3_win32_is_nt(void); /* os_win.c */
23526
-SQLITE_API void SQLITE_STDCALL sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */
23549
+SQLITE_API int SQLITE_APICALL sqlite3_win32_is_nt(void); /* os_win.c */
23550
+SQLITE_API void SQLITE_APICALL sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */
2352723551
2352823552
static int winMutexInit(void){
2352923553
/* The first to increment to 1 does actual initialization */
2353023554
if( InterlockedCompareExchange(&winMutex_lock, 1, 0)==0 ){
2353123555
int i;
@@ -23821,11 +23845,11 @@
2382123845
/*
2382223846
** Attempt to release up to n bytes of non-essential memory currently
2382323847
** held by SQLite. An example of non-essential memory is memory used to
2382423848
** cache database pages that are not currently in use.
2382523849
*/
23826
-SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int n){
23850
+SQLITE_API int SQLITE_APICALL sqlite3_release_memory(int n){
2382723851
#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
2382823852
return sqlite3PcacheReleaseMemory(n);
2382923853
#else
2383023854
/* IMPLEMENTATION-OF: R-34391-24921 The sqlite3_release_memory() routine
2383123855
** is a no-op returning zero if SQLite is not compiled with
@@ -23880,11 +23904,11 @@
2388023904
/*
2388123905
** Deprecated external interface. It used to set an alarm callback
2388223906
** that was invoked when memory usage grew too large. Now it is a
2388323907
** no-op.
2388423908
*/
23885
-SQLITE_API int SQLITE_STDCALL sqlite3_memory_alarm(
23909
+SQLITE_API int SQLITE_APICALL sqlite3_memory_alarm(
2388623910
void(*xCallback)(void *pArg, sqlite3_int64 used,int N),
2388723911
void *pArg,
2388823912
sqlite3_int64 iThreshold
2388923913
){
2389023914
(void)xCallback;
@@ -23896,11 +23920,11 @@
2389623920
2389723921
/*
2389823922
** Set the soft heap-size limit for the library. Passing a zero or
2389923923
** negative value indicates no limit.
2390023924
*/
23901
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 n){
23925
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_soft_heap_limit64(sqlite3_int64 n){
2390223926
sqlite3_int64 priorLimit;
2390323927
sqlite3_int64 excess;
2390423928
sqlite3_int64 nUsed;
2390523929
#ifndef SQLITE_OMIT_AUTOINIT
2390623930
int rc = sqlite3_initialize();
@@ -23918,11 +23942,11 @@
2391823942
sqlite3_mutex_leave(mem0.mutex);
2391923943
excess = sqlite3_memory_used() - n;
2392023944
if( excess>0 ) sqlite3_release_memory((int)(excess & 0x7fffffff));
2392123945
return priorLimit;
2392223946
}
23923
-SQLITE_API void SQLITE_STDCALL sqlite3_soft_heap_limit(int n){
23947
+SQLITE_API void SQLITE_APICALL sqlite3_soft_heap_limit(int n){
2392423948
if( n<0 ) n = 0;
2392523949
sqlite3_soft_heap_limit64(n);
2392623950
}
2392723951
2392823952
/*
@@ -23987,11 +24011,11 @@
2398724011
}
2398824012
2398924013
/*
2399024014
** Return the amount of memory currently checked out.
2399124015
*/
23992
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void){
24016
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_used(void){
2399324017
sqlite3_int64 res, mx;
2399424018
sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, 0);
2399524019
return res;
2399624020
}
2399724021
@@ -23998,11 +24022,11 @@
2399824022
/*
2399924023
** Return the maximum amount of memory that has ever been
2400024024
** checked out since either the beginning of this process
2400124025
** or since the most recent reset.
2400224026
*/
24003
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag){
24027
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_highwater(int resetFlag){
2400424028
sqlite3_int64 res, mx;
2400524029
sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, resetFlag);
2400624030
return mx;
2400724031
}
2400824032
@@ -24078,17 +24102,17 @@
2407824102
/*
2407924103
** This version of the memory allocation is for use by the application.
2408024104
** First make sure the memory subsystem is initialized, then do the
2408124105
** allocation.
2408224106
*/
24083
-SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int n){
24107
+SQLITE_API void *SQLITE_APICALL sqlite3_malloc(int n){
2408424108
#ifndef SQLITE_OMIT_AUTOINIT
2408524109
if( sqlite3_initialize() ) return 0;
2408624110
#endif
2408724111
return n<=0 ? 0 : sqlite3Malloc(n);
2408824112
}
24089
-SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64 n){
24113
+SQLITE_API void *SQLITE_APICALL sqlite3_malloc64(sqlite3_uint64 n){
2409024114
#ifndef SQLITE_OMIT_AUTOINIT
2409124115
if( sqlite3_initialize() ) return 0;
2409224116
#endif
2409324117
return sqlite3Malloc(n);
2409424118
}
@@ -24227,20 +24251,20 @@
2422724251
}else{
2422824252
assert( sqlite3_mutex_held(db->mutex) );
2422924253
return db->lookaside.sz;
2423024254
}
2423124255
}
24232
-SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void *p){
24256
+SQLITE_API sqlite3_uint64 SQLITE_APICALL sqlite3_msize(void *p){
2423324257
assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) );
2423424258
assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
2423524259
return p ? sqlite3GlobalConfig.m.xSize(p) : 0;
2423624260
}
2423724261
2423824262
/*
2423924263
** Free memory previously obtained from sqlite3Malloc().
2424024264
*/
24241
-SQLITE_API void SQLITE_STDCALL sqlite3_free(void *p){
24265
+SQLITE_API void SQLITE_APICALL sqlite3_free(void *p){
2424224266
if( p==0 ) return; /* IMP: R-49053-54554 */
2424324267
assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
2424424268
assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) );
2424524269
if( sqlite3GlobalConfig.bMemstat ){
2424624270
sqlite3_mutex_enter(mem0.mutex);
@@ -24345,18 +24369,18 @@
2434524369
2434624370
/*
2434724371
** The public interface to sqlite3Realloc. Make sure that the memory
2434824372
** subsystem is initialized prior to invoking sqliteRealloc.
2434924373
*/
24350
-SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void *pOld, int n){
24374
+SQLITE_API void *SQLITE_APICALL sqlite3_realloc(void *pOld, int n){
2435124375
#ifndef SQLITE_OMIT_AUTOINIT
2435224376
if( sqlite3_initialize() ) return 0;
2435324377
#endif
2435424378
if( n<0 ) n = 0; /* IMP: R-26507-47431 */
2435524379
return sqlite3Realloc(pOld, n);
2435624380
}
24357
-SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void *pOld, sqlite3_uint64 n){
24381
+SQLITE_API void *SQLITE_APICALL sqlite3_realloc64(void *pOld, sqlite3_uint64 n){
2435824382
#ifndef SQLITE_OMIT_AUTOINIT
2435924383
if( sqlite3_initialize() ) return 0;
2436024384
#endif
2436124385
return sqlite3Realloc(pOld, n);
2436224386
}
@@ -25579,11 +25603,11 @@
2557925603
2558025604
/*
2558125605
** Print into memory obtained from sqlite3_malloc(). Omit the internal
2558225606
** %-conversion extensions.
2558325607
*/
25584
-SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char *zFormat, va_list ap){
25608
+SQLITE_API char *SQLITE_APICALL sqlite3_vmprintf(const char *zFormat, va_list ap){
2558525609
char *z;
2558625610
char zBase[SQLITE_PRINT_BUF_SIZE];
2558725611
StrAccum acc;
2558825612
2558925613
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -25628,11 +25652,11 @@
2562825652
** this without breaking compatibility, so we just have to live with the
2562925653
** mistake.
2563025654
**
2563125655
** sqlite3_vsnprintf() is the varargs version.
2563225656
*/
25633
-SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int n, char *zBuf, const char *zFormat, va_list ap){
25657
+SQLITE_API char *SQLITE_APICALL sqlite3_vsnprintf(int n, char *zBuf, const char *zFormat, va_list ap){
2563425658
StrAccum acc;
2563525659
if( n<=0 ) return zBuf;
2563625660
#ifdef SQLITE_ENABLE_API_ARMOR
2563725661
if( zBuf==0 || zFormat==0 ) {
2563825662
(void)SQLITE_MISUSE_BKPT;
@@ -26255,11 +26279,11 @@
2625526279
} sqlite3Prng;
2625626280
2625726281
/*
2625826282
** Return N random bytes.
2625926283
*/
26260
-SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *pBuf){
26284
+SQLITE_API void SQLITE_APICALL sqlite3_randomness(int N, void *pBuf){
2626126285
unsigned char t;
2626226286
unsigned char *zBuf = pBuf;
2626326287
2626426288
/* The "wsdPrng" macro will resolve to the pseudo-random number generator
2626526289
** state vector. If writable static data is unsupported on the target,
@@ -27458,11 +27482,11 @@
2745827482
** sqlite3_strnicmp() APIs allow applications and extensions to compare
2745927483
** the contents of two buffers containing UTF-8 strings in a
2746027484
** case-independent fashion, using the same definition of "case
2746127485
** independence" that SQLite uses internally when comparing identifiers.
2746227486
*/
27463
-SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *zLeft, const char *zRight){
27487
+SQLITE_API int SQLITE_APICALL sqlite3_stricmp(const char *zLeft, const char *zRight){
2746427488
if( zLeft==0 ){
2746527489
return zRight ? -1 : 0;
2746627490
}else if( zRight==0 ){
2746727491
return 1;
2746827492
}
@@ -27479,11 +27503,11 @@
2747927503
a++;
2748027504
b++;
2748127505
}
2748227506
return c;
2748327507
}
27484
-SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){
27508
+SQLITE_API int SQLITE_APICALL sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){
2748527509
register unsigned char *a, *b;
2748627510
if( zLeft==0 ){
2748727511
return zRight ? -1 : 0;
2748827512
}else if( zRight==0 ){
2748927513
return 1;
@@ -36778,11 +36802,11 @@
3677836802
** This routine is called once during SQLite initialization and by a
3677936803
** single thread. The memory allocation and mutex subsystems have not
3678036804
** necessarily been initialized when this routine is called, and so they
3678136805
** should not be used.
3678236806
*/
36783
-SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void){
36807
+SQLITE_API int SQLITE_APICALL sqlite3_os_init(void){
3678436808
/*
3678536809
** The following macro defines an initializer for an sqlite3_vfs object.
3678636810
** The name of the VFS is NAME. The pAppData is a pointer to a pointer
3678736811
** to the "finder" function. (pAppData is a pointer to a pointer because
3678836812
** silly C90 rules prohibit a void* from being cast to a function pointer
@@ -36877,11 +36901,11 @@
3687736901
**
3687836902
** Some operating systems might need to do some cleanup in this routine,
3687936903
** to release dynamically allocated objects. But not on unix.
3688036904
** This routine is a no-op for unix.
3688136905
*/
36882
-SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void){
36906
+SQLITE_API int SQLITE_APICALL sqlite3_os_end(void){
3688336907
return SQLITE_OK;
3688436908
}
3688536909
3688636910
#endif /* SQLITE_OS_UNIX */
3688736911
@@ -38312,11 +38336,11 @@
3831238336
** compact it. Upon success, SQLITE_OK will be returned. Upon failure, one
3831338337
** of SQLITE_NOMEM, SQLITE_ERROR, or SQLITE_NOTFOUND will be returned. The
3831438338
** "pnLargest" argument, if non-zero, will be used to return the size of the
3831538339
** largest committed free block in the heap, in bytes.
3831638340
*/
38317
-SQLITE_API int SQLITE_STDCALL sqlite3_win32_compact_heap(LPUINT pnLargest){
38341
+SQLITE_API int SQLITE_APICALL sqlite3_win32_compact_heap(LPUINT pnLargest){
3831838342
int rc = SQLITE_OK;
3831938343
UINT nLargest = 0;
3832038344
HANDLE hHeap;
3832138345
3832238346
winMemAssertMagic();
@@ -38352,11 +38376,11 @@
3835238376
** If a Win32 native heap has been configured, this function will attempt to
3835338377
** destroy and recreate it. If the Win32 native heap is not isolated and/or
3835438378
** the sqlite3_memory_used() function does not return zero, SQLITE_BUSY will
3835538379
** be returned and no changes will be made to the Win32 native heap.
3835638380
*/
38357
-SQLITE_API int SQLITE_STDCALL sqlite3_win32_reset_heap(){
38381
+SQLITE_API int SQLITE_APICALL sqlite3_win32_reset_heap(){
3835838382
int rc;
3835938383
MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */
3836038384
MUTEX_LOGIC( sqlite3_mutex *pMem; ) /* The memsys static mutex */
3836138385
MUTEX_LOGIC( pMaster = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); )
3836238386
MUTEX_LOGIC( pMem = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM); )
@@ -38397,11 +38421,11 @@
3839738421
/*
3839838422
** This function outputs the specified (ANSI) string to the Win32 debugger
3839938423
** (if available).
3840038424
*/
3840138425
38402
-SQLITE_API void SQLITE_STDCALL sqlite3_win32_write_debug(const char *zBuf, int nBuf){
38426
+SQLITE_API void SQLITE_APICALL sqlite3_win32_write_debug(const char *zBuf, int nBuf){
3840338427
char zDbgBuf[SQLITE_WIN32_DBG_BUF_SIZE];
3840438428
int nMin = MIN(nBuf, (SQLITE_WIN32_DBG_BUF_SIZE - 1)); /* may be negative. */
3840538429
if( nMin<-1 ) nMin = -1; /* all negative values become -1. */
3840638430
assert( nMin==-1 || nMin==0 || nMin<SQLITE_WIN32_DBG_BUF_SIZE );
3840738431
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -38443,11 +38467,11 @@
3844338467
*/
3844438468
#if SQLITE_OS_WINRT
3844538469
static HANDLE sleepObj = NULL;
3844638470
#endif
3844738471
38448
-SQLITE_API void SQLITE_STDCALL sqlite3_win32_sleep(DWORD milliseconds){
38472
+SQLITE_API void SQLITE_APICALL sqlite3_win32_sleep(DWORD milliseconds){
3844938473
#if SQLITE_OS_WINRT
3845038474
if ( sleepObj==NULL ){
3845138475
sleepObj = osCreateEventExW(NULL, NULL, CREATE_EVENT_MANUAL_RESET,
3845238476
SYNCHRONIZE);
3845338477
}
@@ -38492,11 +38516,11 @@
3849238516
3849338517
/*
3849438518
** This function determines if the machine is running a version of Windows
3849538519
** based on the NT kernel.
3849638520
*/
38497
-SQLITE_API int SQLITE_STDCALL sqlite3_win32_is_nt(void){
38521
+SQLITE_API int SQLITE_APICALL sqlite3_win32_is_nt(void){
3849838522
#if SQLITE_OS_WINRT
3849938523
/*
3850038524
** NOTE: The WinRT sub-platform is always assumed to be based on the NT
3850138525
** kernel.
3850238526
*/
@@ -38880,11 +38904,11 @@
3888038904
}
3888138905
3888238906
/*
3888338907
** This is a public wrapper for the winUtf8ToUnicode() function.
3888438908
*/
38885
-SQLITE_API LPWSTR SQLITE_STDCALL sqlite3_win32_utf8_to_unicode(const char *zText){
38909
+SQLITE_API LPWSTR SQLITE_APICALL sqlite3_win32_utf8_to_unicode(const char *zText){
3888638910
#ifdef SQLITE_ENABLE_API_ARMOR
3888738911
if( !zText ){
3888838912
(void)SQLITE_MISUSE_BKPT;
3888938913
return 0;
3889038914
}
@@ -38896,11 +38920,11 @@
3889638920
}
3889738921
3889838922
/*
3889938923
** This is a public wrapper for the winUnicodeToUtf8() function.
3890038924
*/
38901
-SQLITE_API char *SQLITE_STDCALL sqlite3_win32_unicode_to_utf8(LPCWSTR zWideText){
38925
+SQLITE_API char *SQLITE_APICALL sqlite3_win32_unicode_to_utf8(LPCWSTR zWideText){
3890238926
#ifdef SQLITE_ENABLE_API_ARMOR
3890338927
if( !zWideText ){
3890438928
(void)SQLITE_MISUSE_BKPT;
3890538929
return 0;
3890638930
}
@@ -38912,11 +38936,11 @@
3891238936
}
3891338937
3891438938
/*
3891538939
** This is a public wrapper for the winMbcsToUtf8() function.
3891638940
*/
38917
-SQLITE_API char *SQLITE_STDCALL sqlite3_win32_mbcs_to_utf8(const char *zText){
38941
+SQLITE_API char *SQLITE_APICALL sqlite3_win32_mbcs_to_utf8(const char *zText){
3891838942
#ifdef SQLITE_ENABLE_API_ARMOR
3891938943
if( !zText ){
3892038944
(void)SQLITE_MISUSE_BKPT;
3892138945
return 0;
3892238946
}
@@ -38928,11 +38952,11 @@
3892838952
}
3892938953
3893038954
/*
3893138955
** This is a public wrapper for the winMbcsToUtf8() function.
3893238956
*/
38933
-SQLITE_API char *SQLITE_STDCALL sqlite3_win32_mbcs_to_utf8_v2(const char *zText, int useAnsi){
38957
+SQLITE_API char *SQLITE_APICALL sqlite3_win32_mbcs_to_utf8_v2(const char *zText, int useAnsi){
3893438958
#ifdef SQLITE_ENABLE_API_ARMOR
3893538959
if( !zText ){
3893638960
(void)SQLITE_MISUSE_BKPT;
3893738961
return 0;
3893838962
}
@@ -38944,11 +38968,11 @@
3894438968
}
3894538969
3894638970
/*
3894738971
** This is a public wrapper for the winUtf8ToMbcs() function.
3894838972
*/
38949
-SQLITE_API char *SQLITE_STDCALL sqlite3_win32_utf8_to_mbcs(const char *zText){
38973
+SQLITE_API char *SQLITE_APICALL sqlite3_win32_utf8_to_mbcs(const char *zText){
3895038974
#ifdef SQLITE_ENABLE_API_ARMOR
3895138975
if( !zText ){
3895238976
(void)SQLITE_MISUSE_BKPT;
3895338977
return 0;
3895438978
}
@@ -38960,11 +38984,11 @@
3896038984
}
3896138985
3896238986
/*
3896338987
** This is a public wrapper for the winUtf8ToMbcs() function.
3896438988
*/
38965
-SQLITE_API char *SQLITE_STDCALL sqlite3_win32_utf8_to_mbcs_v2(const char *zText, int useAnsi){
38989
+SQLITE_API char *SQLITE_APICALL sqlite3_win32_utf8_to_mbcs_v2(const char *zText, int useAnsi){
3896638990
#ifdef SQLITE_ENABLE_API_ARMOR
3896738991
if( !zText ){
3896838992
(void)SQLITE_MISUSE_BKPT;
3896938993
return 0;
3897038994
}
@@ -38980,11 +39004,11 @@
3898039004
** the provided arguments. The type argument must be 1 in order to set the
3898139005
** data directory or 2 in order to set the temporary directory. The zValue
3898239006
** argument is the name of the directory to use. The return value will be
3898339007
** SQLITE_OK if successful.
3898439008
*/
38985
-SQLITE_API int SQLITE_STDCALL sqlite3_win32_set_directory(DWORD type, LPCWSTR zValue){
39009
+SQLITE_API int SQLITE_APICALL sqlite3_win32_set_directory(DWORD type, LPCWSTR zValue){
3898639010
char **ppDirectory = 0;
3898739011
#ifndef SQLITE_OMIT_AUTOINIT
3898839012
int rc = sqlite3_initialize();
3898939013
if( rc ) return rc;
3899039014
#endif
@@ -42898,11 +42922,11 @@
4289842922
}
4289942923
4290042924
/*
4290142925
** Initialize and deinitialize the operating system interface.
4290242926
*/
42903
-SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void){
42927
+SQLITE_API int SQLITE_APICALL sqlite3_os_init(void){
4290442928
static sqlite3_vfs winVfs = {
4290542929
3, /* iVersion */
4290642930
sizeof(winFile), /* szOsFile */
4290742931
SQLITE_WIN32_MAX_PATH_BYTES, /* mxPathname */
4290842932
0, /* pNext */
@@ -43029,11 +43053,11 @@
4302943053
#endif
4303043054
4303143055
return SQLITE_OK;
4303243056
}
4303343057
43034
-SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void){
43058
+SQLITE_API int SQLITE_APICALL sqlite3_os_end(void){
4303543059
#if SQLITE_OS_WINRT
4303643060
if( sleepObj!=NULL ){
4303743061
osCloseHandle(sleepObj);
4303843062
sleepObj = NULL;
4303943063
}
@@ -57024,11 +57048,11 @@
5702457048
5702557049
/*
5702657050
** Return a +ve value if snapshot p1 is newer than p2. A -ve value if
5702757051
** p1 is older than p2 and zero if p1 and p2 are the same snapshot.
5702857052
*/
57029
-SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_cmp(sqlite3_snapshot *p1, sqlite3_snapshot *p2){
57053
+SQLITE_API int SQLITE_APICALL sqlite3_snapshot_cmp(sqlite3_snapshot *p1, sqlite3_snapshot *p2){
5703057054
WalIndexHdr *pHdr1 = (WalIndexHdr*)p1;
5703157055
WalIndexHdr *pHdr2 = (WalIndexHdr*)p2;
5703257056
5703357057
/* aSalt[0] is a copy of the value stored in the wal file header. It
5703457058
** is incremented each time the wal file is restarted. */
@@ -58161,11 +58185,11 @@
5816158185
**
5816258186
** This routine has no effect on existing database connections.
5816358187
** The shared cache setting effects only future calls to
5816458188
** sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2().
5816558189
*/
58166
-SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int enable){
58190
+SQLITE_API int SQLITE_APICALL sqlite3_enable_shared_cache(int enable){
5816758191
sqlite3GlobalConfig.sharedCacheEnabled = enable;
5816858192
return SQLITE_OK;
5816958193
}
5817058194
#endif
5817158195
@@ -67934,11 +67958,11 @@
6793467958
** a pointer to the new sqlite3_backup object.
6793567959
**
6793667960
** If an error occurs, NULL is returned and an error code and error message
6793767961
** stored in database handle pDestDb.
6793867962
*/
67939
-SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
67963
+SQLITE_API sqlite3_backup *SQLITE_APICALL sqlite3_backup_init(
6794067964
sqlite3* pDestDb, /* Database to write to */
6794167965
const char *zDestDb, /* Name of database within pDestDb */
6794267966
sqlite3* pSrcDb, /* Database connection to read from */
6794367967
const char *zSrcDb /* Name of database within pSrcDb */
6794467968
){
@@ -68142,11 +68166,11 @@
6814268166
}
6814368167
6814468168
/*
6814568169
** Copy nPage pages from the source b-tree to the destination.
6814668170
*/
68147
-SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage){
68171
+SQLITE_API int SQLITE_APICALL sqlite3_backup_step(sqlite3_backup *p, int nPage){
6814868172
int rc;
6814968173
int destMode; /* Destination journal mode */
6815068174
int pgszSrc = 0; /* Source page size */
6815168175
int pgszDest = 0; /* Destination page size */
6815268176
@@ -68386,11 +68410,11 @@
6838668410
}
6838768411
6838868412
/*
6838968413
** Release all resources associated with an sqlite3_backup* handle.
6839068414
*/
68391
-SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p){
68415
+SQLITE_API int SQLITE_APICALL sqlite3_backup_finish(sqlite3_backup *p){
6839268416
sqlite3_backup **pp; /* Ptr to head of pagers backup list */
6839368417
sqlite3 *pSrcDb; /* Source database connection */
6839468418
int rc; /* Value to return */
6839568419
6839668420
/* Enter the mutexes */
@@ -68438,11 +68462,11 @@
6843868462
6843968463
/*
6844068464
** Return the number of pages still to be backed up as of the most recent
6844168465
** call to sqlite3_backup_step().
6844268466
*/
68443
-SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p){
68467
+SQLITE_API int SQLITE_APICALL sqlite3_backup_remaining(sqlite3_backup *p){
6844468468
#ifdef SQLITE_ENABLE_API_ARMOR
6844568469
if( p==0 ){
6844668470
(void)SQLITE_MISUSE_BKPT;
6844768471
return 0;
6844868472
}
@@ -68452,11 +68476,11 @@
6845268476
6845368477
/*
6845468478
** Return the total number of pages in the source database as of the most
6845568479
** recent call to sqlite3_backup_step().
6845668480
*/
68457
-SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p){
68481
+SQLITE_API int SQLITE_APICALL sqlite3_backup_pagecount(sqlite3_backup *p){
6845868482
#ifdef SQLITE_ENABLE_API_ARMOR
6845968483
if( p==0 ){
6846068484
(void)SQLITE_MISUSE_BKPT;
6846168485
return 0;
6846268486
}
@@ -74906,11 +74930,11 @@
7490674930
** execution environment changes in a way that would alter the program
7490774931
** that sqlite3_prepare() generates. For example, if new functions or
7490874932
** collating sequences are registered or if an authorizer function is
7490974933
** added or changed.
7491074934
*/
74911
-SQLITE_API int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt *pStmt){
74935
+SQLITE_API int SQLITE_APICALL sqlite3_expired(sqlite3_stmt *pStmt){
7491274936
Vdbe *p = (Vdbe*)pStmt;
7491374937
return p==0 || p->expired;
7491474938
}
7491574939
#endif
7491674940
@@ -74975,11 +74999,11 @@
7497574999
** machine.
7497675000
**
7497775001
** This routine sets the error code and string returned by
7497875002
** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
7497975003
*/
74980
-SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt){
75004
+SQLITE_API int SQLITE_APICALL sqlite3_finalize(sqlite3_stmt *pStmt){
7498175005
int rc;
7498275006
if( pStmt==0 ){
7498375007
/* IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL
7498475008
** pointer is a harmless no-op. */
7498575009
rc = SQLITE_OK;
@@ -75002,11 +75026,11 @@
7500275026
** the prior execution is returned.
7500375027
**
7500475028
** This routine sets the error code and string returned by
7500575029
** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
7500675030
*/
75007
-SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt){
75031
+SQLITE_API int SQLITE_APICALL sqlite3_reset(sqlite3_stmt *pStmt){
7500875032
int rc;
7500975033
if( pStmt==0 ){
7501075034
rc = SQLITE_OK;
7501175035
}else{
7501275036
Vdbe *v = (Vdbe*)pStmt;
@@ -75023,11 +75047,11 @@
7502375047
}
7502475048
7502575049
/*
7502675050
** Set all the parameters in the compiled SQL statement to NULL.
7502775051
*/
75028
-SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt *pStmt){
75052
+SQLITE_API int SQLITE_APICALL sqlite3_clear_bindings(sqlite3_stmt *pStmt){
7502975053
int i;
7503075054
int rc = SQLITE_OK;
7503175055
Vdbe *p = (Vdbe*)pStmt;
7503275056
#if SQLITE_THREADSAFE
7503375057
sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex;
@@ -75047,11 +75071,11 @@
7504775071
7504875072
/**************************** sqlite3_value_ *******************************
7504975073
** The following routines extract information from a Mem or sqlite3_value
7505075074
** structure.
7505175075
*/
75052
-SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value *pVal){
75076
+SQLITE_API const void *SQLITE_APICALL sqlite3_value_blob(sqlite3_value *pVal){
7505375077
Mem *p = (Mem*)pVal;
7505475078
if( p->flags & (MEM_Blob|MEM_Str) ){
7505575079
if( sqlite3VdbeMemExpandBlob(p)!=SQLITE_OK ){
7505675080
assert( p->flags==MEM_Null && p->z==0 );
7505775081
return 0;
@@ -75060,48 +75084,48 @@
7506075084
return p->n ? p->z : 0;
7506175085
}else{
7506275086
return sqlite3_value_text(pVal);
7506375087
}
7506475088
}
75065
-SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value *pVal){
75089
+SQLITE_API int SQLITE_APICALL sqlite3_value_bytes(sqlite3_value *pVal){
7506675090
return sqlite3ValueBytes(pVal, SQLITE_UTF8);
7506775091
}
75068
-SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value *pVal){
75092
+SQLITE_API int SQLITE_APICALL sqlite3_value_bytes16(sqlite3_value *pVal){
7506975093
return sqlite3ValueBytes(pVal, SQLITE_UTF16NATIVE);
7507075094
}
75071
-SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value *pVal){
75095
+SQLITE_API double SQLITE_APICALL sqlite3_value_double(sqlite3_value *pVal){
7507275096
return sqlite3VdbeRealValue((Mem*)pVal);
7507375097
}
75074
-SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value *pVal){
75098
+SQLITE_API int SQLITE_APICALL sqlite3_value_int(sqlite3_value *pVal){
7507575099
return (int)sqlite3VdbeIntValue((Mem*)pVal);
7507675100
}
75077
-SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value *pVal){
75101
+SQLITE_API sqlite_int64 SQLITE_APICALL sqlite3_value_int64(sqlite3_value *pVal){
7507875102
return sqlite3VdbeIntValue((Mem*)pVal);
7507975103
}
75080
-SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value *pVal){
75104
+SQLITE_API unsigned int SQLITE_APICALL sqlite3_value_subtype(sqlite3_value *pVal){
7508175105
Mem *pMem = (Mem*)pVal;
7508275106
return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0);
7508375107
}
75084
-SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value *pVal){
75108
+SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_value_text(sqlite3_value *pVal){
7508575109
return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
7508675110
}
7508775111
#ifndef SQLITE_OMIT_UTF16
75088
-SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value* pVal){
75112
+SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16(sqlite3_value* pVal){
7508975113
return sqlite3ValueText(pVal, SQLITE_UTF16NATIVE);
7509075114
}
75091
-SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value *pVal){
75115
+SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16be(sqlite3_value *pVal){
7509275116
return sqlite3ValueText(pVal, SQLITE_UTF16BE);
7509375117
}
75094
-SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value *pVal){
75118
+SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16le(sqlite3_value *pVal){
7509575119
return sqlite3ValueText(pVal, SQLITE_UTF16LE);
7509675120
}
7509775121
#endif /* SQLITE_OMIT_UTF16 */
7509875122
/* EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five
7509975123
** fundamental datatypes: 64-bit signed integer 64-bit IEEE floating
7510075124
** point number string BLOB NULL
7510175125
*/
75102
-SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value* pVal){
75126
+SQLITE_API int SQLITE_APICALL sqlite3_value_type(sqlite3_value* pVal){
7510375127
static const u8 aType[] = {
7510475128
SQLITE_BLOB, /* 0x00 */
7510575129
SQLITE_NULL, /* 0x01 */
7510675130
SQLITE_TEXT, /* 0x02 */
7510775131
SQLITE_NULL, /* 0x03 */
@@ -75137,11 +75161,11 @@
7513775161
return aType[pVal->flags&MEM_AffMask];
7513875162
}
7513975163
7514075164
/* Make a copy of an sqlite3_value object
7514175165
*/
75142
-SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value *pOrig){
75166
+SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_value_dup(const sqlite3_value *pOrig){
7514375167
sqlite3_value *pNew;
7514475168
if( pOrig==0 ) return 0;
7514575169
pNew = sqlite3_malloc( sizeof(*pNew) );
7514675170
if( pNew==0 ) return 0;
7514775171
memset(pNew, 0, sizeof(*pNew));
@@ -75160,11 +75184,11 @@
7516075184
}
7516175185
7516275186
/* Destroy an sqlite3_value object previously obtained from
7516375187
** sqlite3_value_dup().
7516475188
*/
75165
-SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value *pOld){
75189
+SQLITE_API void SQLITE_APICALL sqlite3_value_free(sqlite3_value *pOld){
7516675190
sqlite3ValueFree(pOld);
7516775191
}
7516875192
7516975193
7517075194
/**************************** sqlite3_result_ *******************************
@@ -75203,21 +75227,21 @@
7520375227
xDel((void*)p);
7520475228
}
7520575229
if( pCtx ) sqlite3_result_error_toobig(pCtx);
7520675230
return SQLITE_TOOBIG;
7520775231
}
75208
-SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(
75232
+SQLITE_API void SQLITE_APICALL sqlite3_result_blob(
7520975233
sqlite3_context *pCtx,
7521075234
const void *z,
7521175235
int n,
7521275236
void (*xDel)(void *)
7521375237
){
7521475238
assert( n>=0 );
7521575239
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7521675240
setResultStrOrError(pCtx, z, n, 0, xDel);
7521775241
}
75218
-SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(
75242
+SQLITE_API void SQLITE_APICALL sqlite3_result_blob64(
7521975243
sqlite3_context *pCtx,
7522075244
const void *z,
7522175245
sqlite3_uint64 n,
7522275246
void (*xDel)(void *)
7522375247
){
@@ -75227,56 +75251,56 @@
7522775251
(void)invokeValueDestructor(z, xDel, pCtx);
7522875252
}else{
7522975253
setResultStrOrError(pCtx, z, (int)n, 0, xDel);
7523075254
}
7523175255
}
75232
-SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context *pCtx, double rVal){
75256
+SQLITE_API void SQLITE_APICALL sqlite3_result_double(sqlite3_context *pCtx, double rVal){
7523375257
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7523475258
sqlite3VdbeMemSetDouble(pCtx->pOut, rVal);
7523575259
}
75236
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
75260
+SQLITE_API void SQLITE_APICALL sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
7523775261
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7523875262
pCtx->isError = SQLITE_ERROR;
7523975263
pCtx->fErrorOrAux = 1;
7524075264
sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF8, SQLITE_TRANSIENT);
7524175265
}
7524275266
#ifndef SQLITE_OMIT_UTF16
75243
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){
75267
+SQLITE_API void SQLITE_APICALL sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){
7524475268
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7524575269
pCtx->isError = SQLITE_ERROR;
7524675270
pCtx->fErrorOrAux = 1;
7524775271
sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF16NATIVE, SQLITE_TRANSIENT);
7524875272
}
7524975273
#endif
75250
-SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context *pCtx, int iVal){
75274
+SQLITE_API void SQLITE_APICALL sqlite3_result_int(sqlite3_context *pCtx, int iVal){
7525175275
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7525275276
sqlite3VdbeMemSetInt64(pCtx->pOut, (i64)iVal);
7525375277
}
75254
-SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
75278
+SQLITE_API void SQLITE_APICALL sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
7525575279
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7525675280
sqlite3VdbeMemSetInt64(pCtx->pOut, iVal);
7525775281
}
75258
-SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context *pCtx){
75282
+SQLITE_API void SQLITE_APICALL sqlite3_result_null(sqlite3_context *pCtx){
7525975283
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7526075284
sqlite3VdbeMemSetNull(pCtx->pOut);
7526175285
}
75262
-SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){
75286
+SQLITE_API void SQLITE_APICALL sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){
7526375287
Mem *pOut = pCtx->pOut;
7526475288
assert( sqlite3_mutex_held(pOut->db->mutex) );
7526575289
pOut->eSubtype = eSubtype & 0xff;
7526675290
pOut->flags |= MEM_Subtype;
7526775291
}
75268
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text(
75292
+SQLITE_API void SQLITE_APICALL sqlite3_result_text(
7526975293
sqlite3_context *pCtx,
7527075294
const char *z,
7527175295
int n,
7527275296
void (*xDel)(void *)
7527375297
){
7527475298
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7527575299
setResultStrOrError(pCtx, z, n, SQLITE_UTF8, xDel);
7527675300
}
75277
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(
75301
+SQLITE_API void SQLITE_APICALL sqlite3_result_text64(
7527875302
sqlite3_context *pCtx,
7527975303
const char *z,
7528075304
sqlite3_uint64 n,
7528175305
void (*xDel)(void *),
7528275306
unsigned char enc
@@ -75289,56 +75313,56 @@
7528975313
}else{
7529075314
setResultStrOrError(pCtx, z, (int)n, enc, xDel);
7529175315
}
7529275316
}
7529375317
#ifndef SQLITE_OMIT_UTF16
75294
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(
75318
+SQLITE_API void SQLITE_APICALL sqlite3_result_text16(
7529575319
sqlite3_context *pCtx,
7529675320
const void *z,
7529775321
int n,
7529875322
void (*xDel)(void *)
7529975323
){
7530075324
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7530175325
setResultStrOrError(pCtx, z, n, SQLITE_UTF16NATIVE, xDel);
7530275326
}
75303
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(
75327
+SQLITE_API void SQLITE_APICALL sqlite3_result_text16be(
7530475328
sqlite3_context *pCtx,
7530575329
const void *z,
7530675330
int n,
7530775331
void (*xDel)(void *)
7530875332
){
7530975333
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7531075334
setResultStrOrError(pCtx, z, n, SQLITE_UTF16BE, xDel);
7531175335
}
75312
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(
75336
+SQLITE_API void SQLITE_APICALL sqlite3_result_text16le(
7531375337
sqlite3_context *pCtx,
7531475338
const void *z,
7531575339
int n,
7531675340
void (*xDel)(void *)
7531775341
){
7531875342
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7531975343
setResultStrOrError(pCtx, z, n, SQLITE_UTF16LE, xDel);
7532075344
}
7532175345
#endif /* SQLITE_OMIT_UTF16 */
75322
-SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){
75346
+SQLITE_API void SQLITE_APICALL sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){
7532375347
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7532475348
sqlite3VdbeMemCopy(pCtx->pOut, pValue);
7532575349
}
75326
-SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){
75350
+SQLITE_API void SQLITE_APICALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){
7532775351
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7532875352
sqlite3VdbeMemSetZeroBlob(pCtx->pOut, n);
7532975353
}
75330
-SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){
75354
+SQLITE_API int SQLITE_APICALL sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){
7533175355
Mem *pOut = pCtx->pOut;
7533275356
assert( sqlite3_mutex_held(pOut->db->mutex) );
7533375357
if( n>(u64)pOut->db->aLimit[SQLITE_LIMIT_LENGTH] ){
7533475358
return SQLITE_TOOBIG;
7533575359
}
7533675360
sqlite3VdbeMemSetZeroBlob(pCtx->pOut, (int)n);
7533775361
return SQLITE_OK;
7533875362
}
75339
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){
75363
+SQLITE_API void SQLITE_APICALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){
7534075364
pCtx->isError = errCode;
7534175365
pCtx->fErrorOrAux = 1;
7534275366
#ifdef SQLITE_DEBUG
7534375367
if( pCtx->pVdbe ) pCtx->pVdbe->rcApp = errCode;
7534475368
#endif
@@ -75347,20 +75371,20 @@
7534775371
SQLITE_UTF8, SQLITE_STATIC);
7534875372
}
7534975373
}
7535075374
7535175375
/* Force an SQLITE_TOOBIG error. */
75352
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context *pCtx){
75376
+SQLITE_API void SQLITE_APICALL sqlite3_result_error_toobig(sqlite3_context *pCtx){
7535375377
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7535475378
pCtx->isError = SQLITE_TOOBIG;
7535575379
pCtx->fErrorOrAux = 1;
7535675380
sqlite3VdbeMemSetStr(pCtx->pOut, "string or blob too big", -1,
7535775381
SQLITE_UTF8, SQLITE_STATIC);
7535875382
}
7535975383
7536075384
/* An SQLITE_NOMEM error. */
75361
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context *pCtx){
75385
+SQLITE_API void SQLITE_APICALL sqlite3_result_error_nomem(sqlite3_context *pCtx){
7536275386
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7536375387
sqlite3VdbeMemSetNull(pCtx->pOut);
7536475388
pCtx->isError = SQLITE_NOMEM_BKPT;
7536575389
pCtx->fErrorOrAux = 1;
7536675390
sqlite3OomFault(pCtx->pOut->db);
@@ -75528,11 +75552,11 @@
7552875552
/*
7552975553
** This is the top-level implementation of sqlite3_step(). Call
7553075554
** sqlite3Step() to do most of the work. If a schema error occurs,
7553175555
** call sqlite3Reprepare() and try again.
7553275556
*/
75533
-SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt *pStmt){
75557
+SQLITE_API int SQLITE_APICALL sqlite3_step(sqlite3_stmt *pStmt){
7553475558
int rc = SQLITE_OK; /* Result from sqlite3Step() */
7553575559
int rc2 = SQLITE_OK; /* Result from sqlite3Reprepare() */
7553675560
Vdbe *v = (Vdbe*)pStmt; /* the prepared statement */
7553775561
int cnt = 0; /* Counter to prevent infinite loop of reprepares */
7553875562
sqlite3 *db; /* The database connection */
@@ -75579,11 +75603,11 @@
7557975603
7558075604
/*
7558175605
** Extract the user data from a sqlite3_context structure and return a
7558275606
** pointer to it.
7558375607
*/
75584
-SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context *p){
75608
+SQLITE_API void *SQLITE_APICALL sqlite3_user_data(sqlite3_context *p){
7558575609
assert( p && p->pFunc );
7558675610
return p->pFunc->pUserData;
7558775611
}
7558875612
7558975613
/*
@@ -75594,11 +75618,11 @@
7559475618
** returns a copy of the pointer to the database connection (the 1st
7559575619
** parameter) of the sqlite3_create_function() and
7559675620
** sqlite3_create_function16() routines that originally registered the
7559775621
** application defined function.
7559875622
*/
75599
-SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context *p){
75623
+SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_context_db_handle(sqlite3_context *p){
7560075624
assert( p && p->pOut );
7560175625
return p->pOut->db;
7560275626
}
7560375627
7560475628
/*
@@ -75670,11 +75694,11 @@
7567075694
/*
7567175695
** Allocate or return the aggregate context for a user function. A new
7567275696
** context is allocated on the first call. Subsequent calls return the
7567375697
** same context that was returned on prior calls.
7567475698
*/
75675
-SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context *p, int nByte){
75699
+SQLITE_API void *SQLITE_APICALL sqlite3_aggregate_context(sqlite3_context *p, int nByte){
7567675700
assert( p && p->pFunc && p->pFunc->xFinalize );
7567775701
assert( sqlite3_mutex_held(p->pOut->db->mutex) );
7567875702
testcase( nByte<0 );
7567975703
if( (p->pMem->flags & MEM_Agg)==0 ){
7568075704
return createAggContext(p, nByte);
@@ -75685,11 +75709,11 @@
7568575709
7568675710
/*
7568775711
** Return the auxiliary data pointer, if any, for the iArg'th argument to
7568875712
** the user-function defined by pCtx.
7568975713
*/
75690
-SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
75714
+SQLITE_API void *SQLITE_APICALL sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
7569175715
AuxData *pAuxData;
7569275716
7569375717
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7569475718
#if SQLITE_ENABLE_STAT3_OR_STAT4
7569575719
if( pCtx->pVdbe==0 ) return 0;
@@ -75706,11 +75730,11 @@
7570675730
/*
7570775731
** Set the auxiliary data pointer and delete function, for the iArg'th
7570875732
** argument to the user-function defined by pCtx. Any previous value is
7570975733
** deleted by calling the delete function specified when it was set.
7571075734
*/
75711
-SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(
75735
+SQLITE_API void SQLITE_APICALL sqlite3_set_auxdata(
7571275736
sqlite3_context *pCtx,
7571375737
int iArg,
7571475738
void *pAux,
7571575739
void (*xDelete)(void*)
7571675740
){
@@ -75761,29 +75785,29 @@
7576175785
** This function is deprecated. Do not use it for new code. It is
7576275786
** provide only to avoid breaking legacy code. New aggregate function
7576375787
** implementations should keep their own counts within their aggregate
7576475788
** context.
7576575789
*/
75766
-SQLITE_API int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context *p){
75790
+SQLITE_API int SQLITE_APICALL sqlite3_aggregate_count(sqlite3_context *p){
7576775791
assert( p && p->pMem && p->pFunc && p->pFunc->xFinalize );
7576875792
return p->pMem->n;
7576975793
}
7577075794
#endif
7577175795
7577275796
/*
7577375797
** Return the number of columns in the result set for the statement pStmt.
7577475798
*/
75775
-SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt){
75799
+SQLITE_API int SQLITE_APICALL sqlite3_column_count(sqlite3_stmt *pStmt){
7577675800
Vdbe *pVm = (Vdbe *)pStmt;
7577775801
return pVm ? pVm->nResColumn : 0;
7577875802
}
7577975803
7578075804
/*
7578175805
** Return the number of values available from the current row of the
7578275806
** currently executing statement pStmt.
7578375807
*/
75784
-SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt){
75808
+SQLITE_API int SQLITE_APICALL sqlite3_data_count(sqlite3_stmt *pStmt){
7578575809
Vdbe *pVm = (Vdbe *)pStmt;
7578675810
if( pVm==0 || pVm->pResultSet==0 ) return 0;
7578775811
return pVm->nResColumn;
7578875812
}
7578975813
@@ -75882,67 +75906,67 @@
7588275906
7588375907
/**************************** sqlite3_column_ *******************************
7588475908
** The following routines are used to access elements of the current row
7588575909
** in the result set.
7588675910
*/
75887
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt *pStmt, int i){
75911
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_blob(sqlite3_stmt *pStmt, int i){
7588875912
const void *val;
7588975913
val = sqlite3_value_blob( columnMem(pStmt,i) );
7589075914
/* Even though there is no encoding conversion, value_blob() might
7589175915
** need to call malloc() to expand the result of a zeroblob()
7589275916
** expression.
7589375917
*/
7589475918
columnMallocFailure(pStmt);
7589575919
return val;
7589675920
}
75897
-SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){
75921
+SQLITE_API int SQLITE_APICALL sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){
7589875922
int val = sqlite3_value_bytes( columnMem(pStmt,i) );
7589975923
columnMallocFailure(pStmt);
7590075924
return val;
7590175925
}
75902
-SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){
75926
+SQLITE_API int SQLITE_APICALL sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){
7590375927
int val = sqlite3_value_bytes16( columnMem(pStmt,i) );
7590475928
columnMallocFailure(pStmt);
7590575929
return val;
7590675930
}
75907
-SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt *pStmt, int i){
75931
+SQLITE_API double SQLITE_APICALL sqlite3_column_double(sqlite3_stmt *pStmt, int i){
7590875932
double val = sqlite3_value_double( columnMem(pStmt,i) );
7590975933
columnMallocFailure(pStmt);
7591075934
return val;
7591175935
}
75912
-SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt *pStmt, int i){
75936
+SQLITE_API int SQLITE_APICALL sqlite3_column_int(sqlite3_stmt *pStmt, int i){
7591375937
int val = sqlite3_value_int( columnMem(pStmt,i) );
7591475938
columnMallocFailure(pStmt);
7591575939
return val;
7591675940
}
75917
-SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt *pStmt, int i){
75941
+SQLITE_API sqlite_int64 SQLITE_APICALL sqlite3_column_int64(sqlite3_stmt *pStmt, int i){
7591875942
sqlite_int64 val = sqlite3_value_int64( columnMem(pStmt,i) );
7591975943
columnMallocFailure(pStmt);
7592075944
return val;
7592175945
}
75922
-SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt *pStmt, int i){
75946
+SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_column_text(sqlite3_stmt *pStmt, int i){
7592375947
const unsigned char *val = sqlite3_value_text( columnMem(pStmt,i) );
7592475948
columnMallocFailure(pStmt);
7592575949
return val;
7592675950
}
75927
-SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt *pStmt, int i){
75951
+SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_column_value(sqlite3_stmt *pStmt, int i){
7592875952
Mem *pOut = columnMem(pStmt, i);
7592975953
if( pOut->flags&MEM_Static ){
7593075954
pOut->flags &= ~MEM_Static;
7593175955
pOut->flags |= MEM_Ephem;
7593275956
}
7593375957
columnMallocFailure(pStmt);
7593475958
return (sqlite3_value *)pOut;
7593575959
}
7593675960
#ifndef SQLITE_OMIT_UTF16
75937
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt *pStmt, int i){
75961
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_text16(sqlite3_stmt *pStmt, int i){
7593875962
const void *val = sqlite3_value_text16( columnMem(pStmt,i) );
7593975963
columnMallocFailure(pStmt);
7594075964
return val;
7594175965
}
7594275966
#endif /* SQLITE_OMIT_UTF16 */
75943
-SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt *pStmt, int i){
75967
+SQLITE_API int SQLITE_APICALL sqlite3_column_type(sqlite3_stmt *pStmt, int i){
7594475968
int iType = sqlite3_value_type( columnMem(pStmt,i) );
7594575969
columnMallocFailure(pStmt);
7594675970
return iType;
7594775971
}
7594875972
@@ -76002,16 +76026,16 @@
7600276026
7600376027
/*
7600476028
** Return the name of the Nth column of the result set returned by SQL
7600576029
** statement pStmt.
7600676030
*/
76007
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt *pStmt, int N){
76031
+SQLITE_API const char *SQLITE_APICALL sqlite3_column_name(sqlite3_stmt *pStmt, int N){
7600876032
return columnName(
7600976033
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_NAME);
7601076034
}
7601176035
#ifndef SQLITE_OMIT_UTF16
76012
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt *pStmt, int N){
76036
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_name16(sqlite3_stmt *pStmt, int N){
7601376037
return columnName(
7601476038
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_NAME);
7601576039
}
7601676040
#endif
7601776041
@@ -76027,16 +76051,16 @@
7602776051
#ifndef SQLITE_OMIT_DECLTYPE
7602876052
/*
7602976053
** Return the column declaration type (if applicable) of the 'i'th column
7603076054
** of the result set of SQL statement pStmt.
7603176055
*/
76032
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){
76056
+SQLITE_API const char *SQLITE_APICALL sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){
7603376057
return columnName(
7603476058
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DECLTYPE);
7603576059
}
7603676060
#ifndef SQLITE_OMIT_UTF16
76037
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){
76061
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){
7603876062
return columnName(
7603976063
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DECLTYPE);
7604076064
}
7604176065
#endif /* SQLITE_OMIT_UTF16 */
7604276066
#endif /* SQLITE_OMIT_DECLTYPE */
@@ -76045,16 +76069,16 @@
7604576069
/*
7604676070
** Return the name of the database from which a result column derives.
7604776071
** NULL is returned if the result column is an expression or constant or
7604876072
** anything else which is not an unambiguous reference to a database column.
7604976073
*/
76050
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){
76074
+SQLITE_API const char *SQLITE_APICALL sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){
7605176075
return columnName(
7605276076
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DATABASE);
7605376077
}
7605476078
#ifndef SQLITE_OMIT_UTF16
76055
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){
76079
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){
7605676080
return columnName(
7605776081
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DATABASE);
7605876082
}
7605976083
#endif /* SQLITE_OMIT_UTF16 */
7606076084
@@ -76061,16 +76085,16 @@
7606176085
/*
7606276086
** Return the name of the table from which a result column derives.
7606376087
** NULL is returned if the result column is an expression or constant or
7606476088
** anything else which is not an unambiguous reference to a database column.
7606576089
*/
76066
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){
76090
+SQLITE_API const char *SQLITE_APICALL sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){
7606776091
return columnName(
7606876092
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_TABLE);
7606976093
}
7607076094
#ifndef SQLITE_OMIT_UTF16
76071
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){
76095
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){
7607276096
return columnName(
7607376097
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_TABLE);
7607476098
}
7607576099
#endif /* SQLITE_OMIT_UTF16 */
7607676100
@@ -76077,16 +76101,16 @@
7607776101
/*
7607876102
** Return the name of the table column from which a result column derives.
7607976103
** NULL is returned if the result column is an expression or constant or
7608076104
** anything else which is not an unambiguous reference to a database column.
7608176105
*/
76082
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){
76106
+SQLITE_API const char *SQLITE_APICALL sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){
7608376107
return columnName(
7608476108
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_COLUMN);
7608576109
}
7608676110
#ifndef SQLITE_OMIT_UTF16
76087
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){
76111
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){
7608876112
return columnName(
7608976113
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_COLUMN);
7609076114
}
7609176115
#endif /* SQLITE_OMIT_UTF16 */
7609276116
#endif /* SQLITE_ENABLE_COLUMN_METADATA */
@@ -76183,11 +76207,11 @@
7618376207
7618476208
7618576209
/*
7618676210
** Bind a blob value to an SQL statement variable.
7618776211
*/
76188
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(
76212
+SQLITE_API int SQLITE_APICALL sqlite3_bind_blob(
7618976213
sqlite3_stmt *pStmt,
7619076214
int i,
7619176215
const void *zData,
7619276216
int nData,
7619376217
void (*xDel)(void*)
@@ -76195,11 +76219,11 @@
7619576219
#ifdef SQLITE_ENABLE_API_ARMOR
7619676220
if( nData<0 ) return SQLITE_MISUSE_BKPT;
7619776221
#endif
7619876222
return bindText(pStmt, i, zData, nData, xDel, 0);
7619976223
}
76200
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(
76224
+SQLITE_API int SQLITE_APICALL sqlite3_bind_blob64(
7620176225
sqlite3_stmt *pStmt,
7620276226
int i,
7620376227
const void *zData,
7620476228
sqlite3_uint64 nData,
7620576229
void (*xDel)(void*)
@@ -76209,52 +76233,52 @@
7620976233
return invokeValueDestructor(zData, xDel, 0);
7621076234
}else{
7621176235
return bindText(pStmt, i, zData, (int)nData, xDel, 0);
7621276236
}
7621376237
}
76214
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
76238
+SQLITE_API int SQLITE_APICALL sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
7621576239
int rc;
7621676240
Vdbe *p = (Vdbe *)pStmt;
7621776241
rc = vdbeUnbind(p, i);
7621876242
if( rc==SQLITE_OK ){
7621976243
sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue);
7622076244
sqlite3_mutex_leave(p->db->mutex);
7622176245
}
7622276246
return rc;
7622376247
}
76224
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){
76248
+SQLITE_API int SQLITE_APICALL sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){
7622576249
return sqlite3_bind_int64(p, i, (i64)iValue);
7622676250
}
76227
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
76251
+SQLITE_API int SQLITE_APICALL sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
7622876252
int rc;
7622976253
Vdbe *p = (Vdbe *)pStmt;
7623076254
rc = vdbeUnbind(p, i);
7623176255
if( rc==SQLITE_OK ){
7623276256
sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue);
7623376257
sqlite3_mutex_leave(p->db->mutex);
7623476258
}
7623576259
return rc;
7623676260
}
76237
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
76261
+SQLITE_API int SQLITE_APICALL sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
7623876262
int rc;
7623976263
Vdbe *p = (Vdbe*)pStmt;
7624076264
rc = vdbeUnbind(p, i);
7624176265
if( rc==SQLITE_OK ){
7624276266
sqlite3_mutex_leave(p->db->mutex);
7624376267
}
7624476268
return rc;
7624576269
}
76246
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(
76270
+SQLITE_API int SQLITE_APICALL sqlite3_bind_text(
7624776271
sqlite3_stmt *pStmt,
7624876272
int i,
7624976273
const char *zData,
7625076274
int nData,
7625176275
void (*xDel)(void*)
7625276276
){
7625376277
return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8);
7625476278
}
76255
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(
76279
+SQLITE_API int SQLITE_APICALL sqlite3_bind_text64(
7625676280
sqlite3_stmt *pStmt,
7625776281
int i,
7625876282
const char *zData,
7625976283
sqlite3_uint64 nData,
7626076284
void (*xDel)(void*),
@@ -76267,21 +76291,21 @@
7626776291
if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE;
7626876292
return bindText(pStmt, i, zData, (int)nData, xDel, enc);
7626976293
}
7627076294
}
7627176295
#ifndef SQLITE_OMIT_UTF16
76272
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(
76296
+SQLITE_API int SQLITE_APICALL sqlite3_bind_text16(
7627376297
sqlite3_stmt *pStmt,
7627476298
int i,
7627576299
const void *zData,
7627676300
int nData,
7627776301
void (*xDel)(void*)
7627876302
){
7627976303
return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE);
7628076304
}
7628176305
#endif /* SQLITE_OMIT_UTF16 */
76282
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
76306
+SQLITE_API int SQLITE_APICALL sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
7628376307
int rc;
7628476308
switch( sqlite3_value_type((sqlite3_value*)pValue) ){
7628576309
case SQLITE_INTEGER: {
7628676310
rc = sqlite3_bind_int64(pStmt, i, pValue->u.i);
7628776311
break;
@@ -76308,21 +76332,21 @@
7630876332
break;
7630976333
}
7631076334
}
7631176335
return rc;
7631276336
}
76313
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
76337
+SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
7631476338
int rc;
7631576339
Vdbe *p = (Vdbe *)pStmt;
7631676340
rc = vdbeUnbind(p, i);
7631776341
if( rc==SQLITE_OK ){
7631876342
sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n);
7631976343
sqlite3_mutex_leave(p->db->mutex);
7632076344
}
7632176345
return rc;
7632276346
}
76323
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){
76347
+SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){
7632476348
int rc;
7632576349
Vdbe *p = (Vdbe *)pStmt;
7632676350
sqlite3_mutex_enter(p->db->mutex);
7632776351
if( n>(u64)p->db->aLimit[SQLITE_LIMIT_LENGTH] ){
7632876352
rc = SQLITE_TOOBIG;
@@ -76337,11 +76361,11 @@
7633776361
7633876362
/*
7633976363
** Return the number of wildcards that can be potentially bound to.
7634076364
** This routine is added to support DBD::SQLite.
7634176365
*/
76342
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
76366
+SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
7634376367
Vdbe *p = (Vdbe*)pStmt;
7634476368
return p ? p->nVar : 0;
7634576369
}
7634676370
7634776371
/*
@@ -76348,11 +76372,11 @@
7634876372
** Return the name of a wildcard parameter. Return NULL if the index
7634976373
** is out of range or if the wildcard is unnamed.
7635076374
**
7635176375
** The result is always UTF-8.
7635276376
*/
76353
-SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){
76377
+SQLITE_API const char *SQLITE_APICALL sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){
7635476378
Vdbe *p = (Vdbe*)pStmt;
7635576379
if( p==0 || i<1 || i>p->nzVar ){
7635676380
return 0;
7635776381
}
7635876382
return p->azVar[i-1];
@@ -76376,11 +76400,11 @@
7637676400
}
7637776401
}
7637876402
}
7637976403
return 0;
7638076404
}
76381
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
76405
+SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
7638276406
return sqlite3VdbeParameterIndex((Vdbe*)pStmt, zName, sqlite3Strlen30(zName));
7638376407
}
7638476408
7638576409
/*
7638676410
** Transfer all bindings from the first statement over to the second.
@@ -76410,11 +76434,11 @@
7641076434
**
7641176435
** If the two statements contain a different number of bindings, then
7641276436
** an SQLITE_ERROR is returned. Nothing else can go wrong, so otherwise
7641376437
** SQLITE_OK is returned.
7641476438
*/
76415
-SQLITE_API int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
76439
+SQLITE_API int SQLITE_APICALL sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
7641676440
Vdbe *pFrom = (Vdbe*)pFromStmt;
7641776441
Vdbe *pTo = (Vdbe*)pToStmt;
7641876442
if( pFrom->nVar!=pTo->nVar ){
7641976443
return SQLITE_ERROR;
7642076444
}
@@ -76432,26 +76456,26 @@
7643276456
** Return the sqlite3* database handle to which the prepared statement given
7643376457
** in the argument belongs. This is the same database handle that was
7643476458
** the first argument to the sqlite3_prepare() that was used to create
7643576459
** the statement in the first place.
7643676460
*/
76437
-SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt *pStmt){
76461
+SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_db_handle(sqlite3_stmt *pStmt){
7643876462
return pStmt ? ((Vdbe*)pStmt)->db : 0;
7643976463
}
7644076464
7644176465
/*
7644276466
** Return true if the prepared statement is guaranteed to not modify the
7644376467
** database.
7644476468
*/
76445
-SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt){
76469
+SQLITE_API int SQLITE_APICALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt){
7644676470
return pStmt ? ((Vdbe*)pStmt)->readOnly : 1;
7644776471
}
7644876472
7644976473
/*
7645076474
** Return true if the prepared statement is in need of being reset.
7645176475
*/
76452
-SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt *pStmt){
76476
+SQLITE_API int SQLITE_APICALL sqlite3_stmt_busy(sqlite3_stmt *pStmt){
7645376477
Vdbe *v = (Vdbe*)pStmt;
7645476478
return v!=0 && v->pc>=0 && v->magic==VDBE_MAGIC_RUN;
7645576479
}
7645676480
7645776481
/*
@@ -76458,11 +76482,11 @@
7645876482
** Return a pointer to the next prepared statement after pStmt associated
7645976483
** with database connection pDb. If pStmt is NULL, return the first
7646076484
** prepared statement for the database connection. Return NULL if there
7646176485
** are no more.
7646276486
*/
76463
-SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){
76487
+SQLITE_API sqlite3_stmt *SQLITE_APICALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){
7646476488
sqlite3_stmt *pNext;
7646576489
#ifdef SQLITE_ENABLE_API_ARMOR
7646676490
if( !sqlite3SafetyCheckOk(pDb) ){
7646776491
(void)SQLITE_MISUSE_BKPT;
7646876492
return 0;
@@ -76479,11 +76503,11 @@
7647976503
}
7648076504
7648176505
/*
7648276506
** Return the value of a status counter for a prepared statement
7648376507
*/
76484
-SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){
76508
+SQLITE_API int SQLITE_APICALL sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){
7648576509
Vdbe *pVdbe = (Vdbe*)pStmt;
7648676510
u32 v;
7648776511
#ifdef SQLITE_ENABLE_API_ARMOR
7648876512
if( !pStmt ){
7648976513
(void)SQLITE_MISUSE_BKPT;
@@ -76496,11 +76520,11 @@
7649676520
}
7649776521
7649876522
/*
7649976523
** Return the SQL associated with a prepared statement
7650076524
*/
76501
-SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt){
76525
+SQLITE_API const char *SQLITE_APICALL sqlite3_sql(sqlite3_stmt *pStmt){
7650276526
Vdbe *p = (Vdbe *)pStmt;
7650376527
return p ? p->zSql : 0;
7650476528
}
7650576529
7650676530
/*
@@ -76510,11 +76534,11 @@
7651076534
** freeing the returned string by passing it to sqlite3_free().
7651176535
**
7651276536
** The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of
7651376537
** expanded bound parameters.
7651476538
*/
76515
-SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt){
76539
+SQLITE_API char *SQLITE_APICALL sqlite3_expanded_sql(sqlite3_stmt *pStmt){
7651676540
#ifdef SQLITE_OMIT_TRACE
7651776541
return 0;
7651876542
#else
7651976543
char *z = 0;
7652076544
const char *zSql = sqlite3_sql(pStmt);
@@ -76552,11 +76576,11 @@
7655276576
7655376577
/*
7655476578
** This function is called from within a pre-update callback to retrieve
7655576579
** a field of the row currently being updated or deleted.
7655676580
*/
76557
-SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
76581
+SQLITE_API int SQLITE_APICALL sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
7655876582
PreUpdate *p = db->pPreUpdate;
7655976583
int rc = SQLITE_OK;
7656076584
7656176585
/* Test that this call is being made from within an SQLITE_DELETE or
7656276586
** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */
@@ -76607,11 +76631,11 @@
7660776631
#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
7660876632
/*
7660976633
** This function is called from within a pre-update callback to retrieve
7661076634
** the number of columns in the row being updated, deleted or inserted.
7661176635
*/
76612
-SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *db){
76636
+SQLITE_API int SQLITE_APICALL sqlite3_preupdate_count(sqlite3 *db){
7661376637
PreUpdate *p = db->pPreUpdate;
7661476638
return (p ? p->keyinfo.nField : 0);
7661576639
}
7661676640
#endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
7661776641
@@ -76625,11 +76649,11 @@
7662576649
** top-level trigger etc.).
7662676650
**
7662776651
** For the purposes of the previous paragraph, a foreign key CASCADE, SET NULL
7662876652
** or SET DEFAULT action is considered a trigger.
7662976653
*/
76630
-SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *db){
76654
+SQLITE_API int SQLITE_APICALL sqlite3_preupdate_depth(sqlite3 *db){
7663176655
PreUpdate *p = db->pPreUpdate;
7663276656
return (p ? p->v->nFrame : 0);
7663376657
}
7663476658
#endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
7663576659
@@ -76636,11 +76660,11 @@
7663676660
#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
7663776661
/*
7663876662
** This function is called from within a pre-update callback to retrieve
7663976663
** a field of the row currently being updated or inserted.
7664076664
*/
76641
-SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
76665
+SQLITE_API int SQLITE_APICALL sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
7664276666
PreUpdate *p = db->pPreUpdate;
7664376667
int rc = SQLITE_OK;
7664476668
Mem *pMem;
7664576669
7664676670
if( !p || p->op==SQLITE_DELETE ){
@@ -76710,11 +76734,11 @@
7671076734
7671176735
#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
7671276736
/*
7671376737
** Return status data for a single loop within query pStmt.
7671476738
*/
76715
-SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus(
76739
+SQLITE_API int SQLITE_APICALL sqlite3_stmt_scanstatus(
7671676740
sqlite3_stmt *pStmt, /* Prepared statement being queried */
7671776741
int idx, /* Index of loop to report on */
7671876742
int iScanStatusOp, /* Which metric to return */
7671976743
void *pOut /* OUT: Write the answer here */
7672076744
){
@@ -76769,11 +76793,11 @@
7676976793
}
7677076794
7677176795
/*
7677276796
** Zero all counters associated with the sqlite3_stmt_scanstatus() data.
7677376797
*/
76774
-SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){
76798
+SQLITE_API void SQLITE_APICALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){
7677576799
Vdbe *p = (Vdbe*)pStmt;
7677676800
memset(p->anExec, 0, p->nOp * sizeof(i64));
7677776801
}
7677876802
#endif /* SQLITE_ENABLE_STMT_SCANSTATUS */
7677976803
@@ -77296,11 +77320,11 @@
7729677320
** Try to convert the type of a function argument or a result column
7729777321
** into a numeric representation. Use either INTEGER or REAL whichever
7729877322
** is appropriate. But only do the conversion if it is possible without
7729977323
** loss of information and return the revised type of the argument.
7730077324
*/
77301
-SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value *pVal){
77325
+SQLITE_API int SQLITE_APICALL sqlite3_value_numeric_type(sqlite3_value *pVal){
7730277326
int eType = sqlite3_value_type(pVal);
7730377327
if( eType==SQLITE_TEXT ){
7730477328
Mem *pMem = (Mem*)pVal;
7730577329
applyNumericAffinity(pMem, 0);
7730677330
eType = sqlite3_value_type(pVal);
@@ -84148,11 +84172,11 @@
8414884172
}
8414984173
8415084174
/*
8415184175
** Open a blob handle.
8415284176
*/
84153
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
84177
+SQLITE_API int SQLITE_APICALL sqlite3_blob_open(
8415484178
sqlite3* db, /* The database connection */
8415584179
const char *zDb, /* The attached database containing the blob */
8415684180
const char *zTable, /* The table containing the blob */
8415784181
const char *zColumn, /* The column containing the blob */
8415884182
sqlite_int64 iRow, /* The row containing the glob */
@@ -84389,11 +84413,11 @@
8438984413
8439084414
/*
8439184415
** Close a blob handle that was previously created using
8439284416
** sqlite3_blob_open().
8439384417
*/
84394
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *pBlob){
84418
+SQLITE_API int SQLITE_APICALL sqlite3_blob_close(sqlite3_blob *pBlob){
8439584419
Incrblob *p = (Incrblob *)pBlob;
8439684420
int rc;
8439784421
sqlite3 *db;
8439884422
8439984423
if( p ){
@@ -84482,28 +84506,28 @@
8448284506
}
8448384507
8448484508
/*
8448584509
** Read data from a blob handle.
8448684510
*/
84487
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){
84511
+SQLITE_API int SQLITE_APICALL sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){
8448884512
return blobReadWrite(pBlob, z, n, iOffset, sqlite3BtreeData);
8448984513
}
8449084514
8449184515
/*
8449284516
** Write data to a blob handle.
8449384517
*/
84494
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){
84518
+SQLITE_API int SQLITE_APICALL sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){
8449584519
return blobReadWrite(pBlob, (void *)z, n, iOffset, sqlite3BtreePutData);
8449684520
}
8449784521
8449884522
/*
8449984523
** Query a blob handle for the size of the data.
8450084524
**
8450184525
** The Incrblob.nByte field is fixed for the lifetime of the Incrblob
8450284526
** so no mutex is required for access.
8450384527
*/
84504
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *pBlob){
84528
+SQLITE_API int SQLITE_APICALL sqlite3_blob_bytes(sqlite3_blob *pBlob){
8450584529
Incrblob *p = (Incrblob *)pBlob;
8450684530
return (p && p->pStmt) ? p->nByte : 0;
8450784531
}
8450884532
8450984533
/*
@@ -84514,11 +84538,11 @@
8451484538
** contain a blob or text value, then an error code is returned and the
8451584539
** database handle error code and message set. If this happens, then all
8451684540
** subsequent calls to sqlite3_blob_xxx() functions (except blob_close())
8451784541
** immediately return SQLITE_ABORT.
8451884542
*/
84519
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){
84543
+SQLITE_API int SQLITE_APICALL sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){
8452084544
int rc;
8452184545
Incrblob *p = (Incrblob *)pBlob;
8452284546
sqlite3 *db;
8452384547
8452484548
if( p==0 ) return SQLITE_MISUSE_BKPT;
@@ -97118,11 +97142,11 @@
9711897142
** and attempts to write the column will be ignored.
9711997143
**
9712097144
** Setting the auth function to NULL disables this hook. The default
9712197145
** setting of the auth function is NULL.
9712297146
*/
97123
-SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
97147
+SQLITE_API int SQLITE_APICALL sqlite3_set_authorizer(
9712497148
sqlite3 *db,
9712597149
int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
9712697150
void *pArg
9712797151
){
9712897152
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -97162,10 +97186,11 @@
9716297186
){
9716397187
sqlite3 *db = pParse->db; /* Database handle */
9716497188
char *zDb = db->aDb[iDb].zName; /* Name of attached database */
9716597189
int rc; /* Auth callback return code */
9716697190
97191
+ if( db->init.busy ) return SQLITE_OK;
9716797192
rc = db->xAuth(db->pAuthArg, SQLITE_READ, zTab,zCol,zDb,pParse->zAuthContext
9716897193
#ifdef SQLITE_USER_AUTHENTICATION
9716997194
,db->auth.zAuthUser
9717097195
#endif
9717197196
);
@@ -103880,18 +103905,18 @@
103880103905
}
103881103906
103882103907
/*
103883103908
** The sqlite3_strglob() interface.
103884103909
*/
103885
-SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlobPattern, const char *zString){
103910
+SQLITE_API int SQLITE_APICALL sqlite3_strglob(const char *zGlobPattern, const char *zString){
103886103911
return patternCompare((u8*)zGlobPattern, (u8*)zString, &globInfo, '[')==0;
103887103912
}
103888103913
103889103914
/*
103890103915
** The sqlite3_strlike() interface.
103891103916
*/
103892
-SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zPattern, const char *zStr, unsigned int esc){
103917
+SQLITE_API int SQLITE_APICALL sqlite3_strlike(const char *zPattern, const char *zStr, unsigned int esc){
103893103918
return patternCompare((u8*)zPattern, (u8*)zStr, &likeInfoNorm, esc)==0;
103894103919
}
103895103920
103896103921
/*
103897103922
** Count the number of times that the LIKE operator (or GLOB which is
@@ -108583,11 +108608,11 @@
108583108608
** If the SQL is a query, then for each row in the query result
108584108609
** the xCallback() function is called. pArg becomes the first
108585108610
** argument to xCallback(). If xCallback=NULL then no callback
108586108611
** is invoked, even for queries.
108587108612
*/
108588
-SQLITE_API int SQLITE_STDCALL sqlite3_exec(
108613
+SQLITE_API int SQLITE_APICALL sqlite3_exec(
108589108614
sqlite3 *db, /* The database on which the SQL executes */
108590108615
const char *zSql, /* The SQL to be executed */
108591108616
sqlite3_callback xCallback, /* Invoke this callback routine */
108592108617
void *pArg, /* First argument to xCallback() */
108593108618
char **pzErrMsg /* Write error messages here */
@@ -108974,16 +108999,17 @@
108974108999
sqlite3_int64 (*uri_int64)(const char*,const char*,sqlite3_int64);
108975109000
const char *(*uri_parameter)(const char*,const char*);
108976109001
char *(*vsnprintf)(int,char*,const char*,va_list);
108977109002
int (*wal_checkpoint_v2)(sqlite3*,const char*,int,int*,int*);
108978109003
/* Version 3.8.7 and later */
108979
- int (*auto_extension)(void(*)(void));
109004
+ int (*auto_extension)(int(*)(sqlite3*,char**,const sqlite3_api_routines*));
108980109005
int (*bind_blob64)(sqlite3_stmt*,int,const void*,sqlite3_uint64,
108981109006
void(*)(void*));
108982109007
int (*bind_text64)(sqlite3_stmt*,int,const char*,sqlite3_uint64,
108983109008
void(*)(void*),unsigned char);
108984
- int (*cancel_auto_extension)(void(*)(void));
109009
+ int (*cancel_auto_extension)(int(*)(sqlite3*,char**,
109010
+ const sqlite3_api_routines*));
108985109011
int (*load_extension)(sqlite3*,const char*,const char*,char**);
108986109012
void *(*malloc64)(sqlite3_uint64);
108987109013
sqlite3_uint64 (*msize)(void*);
108988109014
void *(*realloc64)(void*,sqlite3_uint64);
108989109015
void (*reset_auto_extension)(void);
@@ -109008,10 +109034,20 @@
109008109034
int (*system_errno)(sqlite3*);
109009109035
/* Version 3.14.0 and later */
109010109036
int (*trace_v2)(sqlite3*,unsigned,int(*)(unsigned,void*,void*,void*),void*);
109011109037
char *(*expanded_sql)(sqlite3_stmt*);
109012109038
};
109039
+
109040
+/*
109041
+** This is the function signature used for all extension entry points. It
109042
+** is also defined in the file "loadext.c".
109043
+*/
109044
+typedef int (*sqlite3_loadext_entry)(
109045
+ sqlite3 *db, /* Handle to the database. */
109046
+ char **pzErrMsg, /* Used to set error string on failure. */
109047
+ const sqlite3_api_routines *pThunk /* Extension API function pointers. */
109048
+);
109013109049
109014109050
/*
109015109051
** The following macros redefine the API routines so that they are
109016109052
** redirected through the global sqlite3_api structure.
109017109053
**
@@ -109280,10 +109316,18 @@
109280109316
/************** Continuing where we left off in loadext.c ********************/
109281109317
/* #include "sqliteInt.h" */
109282109318
/* #include <string.h> */
109283109319
109284109320
#ifndef SQLITE_OMIT_LOAD_EXTENSION
109321
+/*
109322
+** This is the function signature used for all extension entry points.
109323
+*/
109324
+typedef int (*sqlite3_loadext_entry)(
109325
+ sqlite3 *db, /* Handle to the database. */
109326
+ char **pzErrMsg, /* Used to set error string on failure. */
109327
+ const sqlite3_api_routines *pThunk /* Extension API function pointers. */
109328
+);
109285109329
109286109330
/*
109287109331
** Some API routines are omitted when various features are
109288109332
** excluded from a build of SQLite. Substitute a NULL pointer
109289109333
** for any missing APIs.
@@ -109369,10 +109413,14 @@
109369109413
#define sqlite3_blob_open 0
109370109414
#define sqlite3_blob_read 0
109371109415
#define sqlite3_blob_write 0
109372109416
#define sqlite3_blob_reopen 0
109373109417
#endif
109418
+
109419
+#if defined(SQLITE_OMIT_TRACE)
109420
+# define sqlite3_trace_v2 0
109421
+#endif
109374109422
109375109423
/*
109376109424
** The following structure contains pointers to all SQLite API routines.
109377109425
** A pointer to this structure is passed into extensions when they are
109378109426
** loaded so that the extension can make calls back into the SQLite
@@ -109675,11 +109723,14 @@
109675109723
/* Version 3.10.0 and later */
109676109724
sqlite3_status64,
109677109725
sqlite3_strlike,
109678109726
sqlite3_db_cacheflush,
109679109727
/* Version 3.12.0 and later */
109680
- sqlite3_system_errno
109728
+ sqlite3_system_errno,
109729
+ /* Version 3.14.0 and later */
109730
+ sqlite3_trace_v2,
109731
+ sqlite3_expanded_sql
109681109732
};
109682109733
109683109734
/*
109684109735
** Attempt to load an SQLite extension library contained in the file
109685109736
** zFile. The entry point is zProc. zProc may be 0 in which case a
@@ -109698,11 +109749,11 @@
109698109749
const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */
109699109750
char **pzErrMsg /* Put error message here if not 0 */
109700109751
){
109701109752
sqlite3_vfs *pVfs = db->pVfs;
109702109753
void *handle;
109703
- int (*xInit)(sqlite3*,char**,const sqlite3_api_routines*);
109754
+ sqlite3_loadext_entry xInit;
109704109755
char *zErrmsg = 0;
109705109756
const char *zEntry;
109706109757
char *zAltEntry = 0;
109707109758
void **aHandle;
109708109759
u64 nMsg = 300 + sqlite3Strlen30(zFile);
@@ -109757,12 +109808,11 @@
109757109808
sqlite3OsDlError(pVfs, nMsg-1, zErrmsg);
109758109809
}
109759109810
}
109760109811
return SQLITE_ERROR;
109761109812
}
109762
- xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*))
109763
- sqlite3OsDlSym(pVfs, handle, zEntry);
109813
+ xInit = (sqlite3_loadext_entry)sqlite3OsDlSym(pVfs, handle, zEntry);
109764109814
109765109815
/* If no entry point was specified and the default legacy
109766109816
** entry point name "sqlite3_extension_init" was not found, then
109767109817
** construct an entry point name "sqlite3_X_init" where the X is
109768109818
** replaced by the lowercase value of every ASCII alphabetic
@@ -109790,12 +109840,11 @@
109790109840
zAltEntry[iEntry++] = (char)sqlite3UpperToLower[(unsigned)c];
109791109841
}
109792109842
}
109793109843
memcpy(zAltEntry+iEntry, "_init", 6);
109794109844
zEntry = zAltEntry;
109795
- xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*))
109796
- sqlite3OsDlSym(pVfs, handle, zEntry);
109845
+ xInit = (sqlite3_loadext_entry)sqlite3OsDlSym(pVfs, handle, zEntry);
109797109846
}
109798109847
if( xInit==0 ){
109799109848
if( pzErrMsg ){
109800109849
nMsg += sqlite3Strlen30(zEntry);
109801109850
*pzErrMsg = zErrmsg = sqlite3_malloc64(nMsg);
@@ -109833,11 +109882,11 @@
109833109882
db->aExtension = aHandle;
109834109883
109835109884
db->aExtension[db->nExtension++] = handle;
109836109885
return SQLITE_OK;
109837109886
}
109838
-SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
109887
+SQLITE_API int SQLITE_APICALL sqlite3_load_extension(
109839109888
sqlite3 *db, /* Load the extension into this database connection */
109840109889
const char *zFile, /* Name of the shared library containing extension */
109841109890
const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */
109842109891
char **pzErrMsg /* Put error message here if not 0 */
109843109892
){
@@ -109864,11 +109913,11 @@
109864109913
109865109914
/*
109866109915
** Enable or disable extension loading. Extension loading is disabled by
109867109916
** default so as not to open security holes in older applications.
109868109917
*/
109869
-SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff){
109918
+SQLITE_API int SQLITE_APICALL sqlite3_enable_load_extension(sqlite3 *db, int onoff){
109870109919
sqlite3_mutex_enter(db->mutex);
109871109920
if( onoff ){
109872109921
db->flags |= SQLITE_LoadExtension|SQLITE_LoadExtFunc;
109873109922
}else{
109874109923
db->flags &= ~(SQLITE_LoadExtension|SQLITE_LoadExtFunc);
@@ -109921,11 +109970,13 @@
109921109970
109922109971
/*
109923109972
** Register a statically linked extension that is automatically
109924109973
** loaded by every new database connection.
109925109974
*/
109926
-SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void (*xInit)(void)){
109975
+SQLITE_API int SQLITE_APICALL sqlite3_auto_extension(
109976
+ int (*xInit)(sqlite3 *, char **, const sqlite3_api_routines *)
109977
+){
109927109978
int rc = SQLITE_OK;
109928109979
#ifndef SQLITE_OMIT_AUTOINIT
109929109980
rc = sqlite3_initialize();
109930109981
if( rc ){
109931109982
return rc;
@@ -109937,21 +109988,21 @@
109937109988
sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
109938109989
#endif
109939109990
wsdAutoextInit;
109940109991
sqlite3_mutex_enter(mutex);
109941109992
for(i=0; i<wsdAutoext.nExt; i++){
109942
- if( wsdAutoext.aExt[i]==xInit ) break;
109993
+ if( wsdAutoext.aExt[i]==(void*)xInit ) break;
109943109994
}
109944109995
if( i==wsdAutoext.nExt ){
109945109996
u64 nByte = (wsdAutoext.nExt+1)*sizeof(wsdAutoext.aExt[0]);
109946109997
void (**aNew)(void);
109947109998
aNew = sqlite3_realloc64(wsdAutoext.aExt, nByte);
109948109999
if( aNew==0 ){
109949110000
rc = SQLITE_NOMEM_BKPT;
109950110001
}else{
109951110002
wsdAutoext.aExt = aNew;
109952
- wsdAutoext.aExt[wsdAutoext.nExt] = xInit;
110003
+ wsdAutoext.aExt[wsdAutoext.nExt] = (void*)xInit;
109953110004
wsdAutoext.nExt++;
109954110005
}
109955110006
}
109956110007
sqlite3_mutex_leave(mutex);
109957110008
assert( (rc&0xff)==rc );
@@ -109966,20 +110017,22 @@
109966110017
** routine is a no-op.
109967110018
**
109968110019
** Return 1 if xInit was found on the list and removed. Return 0 if xInit
109969110020
** was not on the list.
109970110021
*/
109971
-SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void (*xInit)(void)){
110022
+SQLITE_API int SQLITE_APICALL sqlite3_cancel_auto_extension(
110023
+ int (*xInit)(sqlite3 *, char **, const sqlite3_api_routines *)
110024
+){
109972110025
#if SQLITE_THREADSAFE
109973110026
sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
109974110027
#endif
109975110028
int i;
109976110029
int n = 0;
109977110030
wsdAutoextInit;
109978110031
sqlite3_mutex_enter(mutex);
109979110032
for(i=(int)wsdAutoext.nExt-1; i>=0; i--){
109980
- if( wsdAutoext.aExt[i]==xInit ){
110033
+ if( wsdAutoext.aExt[i]==(void*)xInit ){
109981110034
wsdAutoext.nExt--;
109982110035
wsdAutoext.aExt[i] = wsdAutoext.aExt[wsdAutoext.nExt];
109983110036
n++;
109984110037
break;
109985110038
}
@@ -109989,11 +110042,11 @@
109989110042
}
109990110043
109991110044
/*
109992110045
** Reset the automatic extension loading mechanism.
109993110046
*/
109994
-SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void){
110047
+SQLITE_API void SQLITE_APICALL sqlite3_reset_auto_extension(void){
109995110048
#ifndef SQLITE_OMIT_AUTOINIT
109996110049
if( sqlite3_initialize()==SQLITE_OK )
109997110050
#endif
109998110051
{
109999110052
#if SQLITE_THREADSAFE
@@ -110015,11 +110068,11 @@
110015110068
*/
110016110069
SQLITE_PRIVATE void sqlite3AutoLoadExtensions(sqlite3 *db){
110017110070
u32 i;
110018110071
int go = 1;
110019110072
int rc;
110020
- int (*xInit)(sqlite3*,char**,const sqlite3_api_routines*);
110073
+ sqlite3_loadext_entry xInit;
110021110074
110022110075
wsdAutoextInit;
110023110076
if( wsdAutoext.nExt==0 ){
110024110077
/* Common case: early out without every having to acquire a mutex */
110025110078
return;
@@ -110032,12 +110085,11 @@
110032110085
sqlite3_mutex_enter(mutex);
110033110086
if( i>=wsdAutoext.nExt ){
110034110087
xInit = 0;
110035110088
go = 0;
110036110089
}else{
110037
- xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*))
110038
- wsdAutoext.aExt[i];
110090
+ xInit = (sqlite3_loadext_entry)wsdAutoext.aExt[i];
110039110091
}
110040110092
sqlite3_mutex_leave(mutex);
110041110093
zErrmsg = 0;
110042110094
if( xInit && (rc = xInit(db, &zErrmsg, &sqlite3Apis))!=0 ){
110043110095
sqlite3ErrorWithMsg(db, rc,
@@ -113251,11 +113303,11 @@
113251113303
** and so if a schema change occurs, SQLITE_SCHEMA is returned by
113252113304
** sqlite3_step(). In the new version, the original SQL text is retained
113253113305
** and the statement is automatically recompiled if an schema change
113254113306
** occurs.
113255113307
*/
113256
-SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
113308
+SQLITE_API int SQLITE_APICALL sqlite3_prepare(
113257113309
sqlite3 *db, /* Database handle. */
113258113310
const char *zSql, /* UTF-8 encoded SQL statement. */
113259113311
int nBytes, /* Length of zSql in bytes. */
113260113312
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113261113313
const char **pzTail /* OUT: End of parsed string */
@@ -113263,11 +113315,11 @@
113263113315
int rc;
113264113316
rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,0,ppStmt,pzTail);
113265113317
assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
113266113318
return rc;
113267113319
}
113268
-SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
113320
+SQLITE_API int SQLITE_APICALL sqlite3_prepare_v2(
113269113321
sqlite3 *db, /* Database handle. */
113270113322
const char *zSql, /* UTF-8 encoded SQL statement. */
113271113323
int nBytes, /* Length of zSql in bytes. */
113272113324
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113273113325
const char **pzTail /* OUT: End of parsed string */
@@ -113339,11 +113391,11 @@
113339113391
** and so if a schema change occurs, SQLITE_SCHEMA is returned by
113340113392
** sqlite3_step(). In the new version, the original SQL text is retained
113341113393
** and the statement is automatically recompiled if an schema change
113342113394
** occurs.
113343113395
*/
113344
-SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
113396
+SQLITE_API int SQLITE_APICALL sqlite3_prepare16(
113345113397
sqlite3 *db, /* Database handle. */
113346113398
const void *zSql, /* UTF-16 encoded SQL statement. */
113347113399
int nBytes, /* Length of zSql in bytes. */
113348113400
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113349113401
const void **pzTail /* OUT: End of parsed string */
@@ -113351,11 +113403,11 @@
113351113403
int rc;
113352113404
rc = sqlite3Prepare16(db,zSql,nBytes,0,ppStmt,pzTail);
113353113405
assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
113354113406
return rc;
113355113407
}
113356
-SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
113408
+SQLITE_API int SQLITE_APICALL sqlite3_prepare16_v2(
113357113409
sqlite3 *db, /* Database handle. */
113358113410
const void *zSql, /* UTF-16 encoded SQL statement. */
113359113411
int nBytes, /* Length of zSql in bytes. */
113360113412
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113361113413
const void **pzTail /* OUT: End of parsed string */
@@ -119194,11 +119246,11 @@
119194119246
** The result that is written to ***pazResult is held in memory obtained
119195119247
** from malloc(). But the caller cannot free this memory directly.
119196119248
** Instead, the entire table should be passed to sqlite3_free_table() when
119197119249
** the calling procedure is finished using it.
119198119250
*/
119199
-SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
119251
+SQLITE_API int SQLITE_APICALL sqlite3_get_table(
119200119252
sqlite3 *db, /* The database on which the SQL executes */
119201119253
const char *zSql, /* The SQL to be executed */
119202119254
char ***pazResult, /* Write the result table here */
119203119255
int *pnRow, /* Write the number of rows in the result here */
119204119256
int *pnColumn, /* Write the number of columns of result here */
@@ -119263,11 +119315,11 @@
119263119315
}
119264119316
119265119317
/*
119266119318
** This routine frees the space the sqlite3_get_table() malloced.
119267119319
*/
119268
-SQLITE_API void SQLITE_STDCALL sqlite3_free_table(
119320
+SQLITE_API void SQLITE_APICALL sqlite3_free_table(
119269119321
char **azResult /* Result returned from sqlite3_get_table() */
119270119322
){
119271119323
if( azResult ){
119272119324
int i, n;
119273119325
azResult--;
@@ -121673,11 +121725,11 @@
121673121725
121674121726
121675121727
/*
121676121728
** External API function used to create a new virtual-table module.
121677121729
*/
121678
-SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
121730
+SQLITE_API int SQLITE_APICALL sqlite3_create_module(
121679121731
sqlite3 *db, /* Database in which module is registered */
121680121732
const char *zName, /* Name assigned to this module */
121681121733
const sqlite3_module *pModule, /* The definition of the module */
121682121734
void *pAux /* Context pointer for xCreate/xConnect */
121683121735
){
@@ -121688,11 +121740,11 @@
121688121740
}
121689121741
121690121742
/*
121691121743
** External API function used to create a new virtual-table module.
121692121744
*/
121693
-SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
121745
+SQLITE_API int SQLITE_APICALL sqlite3_create_module_v2(
121694121746
sqlite3 *db, /* Database in which module is registered */
121695121747
const char *zName, /* Name assigned to this module */
121696121748
const sqlite3_module *pModule, /* The definition of the module */
121697121749
void *pAux, /* Context pointer for xCreate/xConnect */
121698121750
void (*xDestroy)(void *) /* Module destructor function */
@@ -122312,11 +122364,11 @@
122312122364
/*
122313122365
** This function is used to set the schema of a virtual table. It is only
122314122366
** valid to call this function from within the xCreate() or xConnect() of a
122315122367
** virtual table module.
122316122368
*/
122317
-SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
122369
+SQLITE_API int SQLITE_APICALL sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
122318122370
VtabCtx *pCtx;
122319122371
Parse *pParse;
122320122372
int rc = SQLITE_OK;
122321122373
Table *pTab;
122322122374
char *zErr = 0;
@@ -122766,11 +122818,11 @@
122766122818
** table update operation currently in progress.
122767122819
**
122768122820
** The results of this routine are undefined unless it is called from
122769122821
** within an xUpdate method.
122770122822
*/
122771
-SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *db){
122823
+SQLITE_API int SQLITE_APICALL sqlite3_vtab_on_conflict(sqlite3 *db){
122772122824
static const unsigned char aMap[] = {
122773122825
SQLITE_ROLLBACK, SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_REPLACE
122774122826
};
122775122827
#ifdef SQLITE_ENABLE_API_ARMOR
122776122828
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -129063,15 +129115,15 @@
129063129115
LogEst nIter;
129064129116
pNew->u.btree.nEq++;
129065129117
pNew->nSkip++;
129066129118
pNew->aLTerm[pNew->nLTerm++] = 0;
129067129119
pNew->wsFlags |= WHERE_SKIPSCAN;
129068
- nIter = pProbe->aiRowLogEst[saved_nEq]+1 - pProbe->aiRowLogEst[saved_nEq+1];
129120
+ nIter = pProbe->aiRowLogEst[saved_nEq] - pProbe->aiRowLogEst[saved_nEq+1];
129069129121
pNew->nOut -= nIter;
129070129122
/* TUNING: Because uncertainties in the estimates for skip-scan queries,
129071129123
** add a 1.375 fudge factor to make skip-scan slightly less likely. */
129072
- nIter += 4;
129124
+ nIter += 5;
129073129125
whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, nIter + nInMul);
129074129126
pNew->nOut = saved_nOut;
129075129127
pNew->u.btree.nEq = saved_nEq;
129076129128
pNew->nSkip = saved_nSkip;
129077129129
pNew->wsFlags = saved_wsFlags;
@@ -136091,11 +136143,11 @@
136091136143
**
136092136144
** If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed
136093136145
** to recognize the end of a trigger can be omitted. All we have to do
136094136146
** is look for a semicolon that is not part of an string or comment.
136095136147
*/
136096
-SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *zSql){
136148
+SQLITE_API int SQLITE_APICALL sqlite3_complete(const char *zSql){
136097136149
u8 state = 0; /* Current state, using numbers defined in header comment */
136098136150
u8 token; /* Value of the next token */
136099136151
136100136152
#ifndef SQLITE_OMIT_TRIGGER
136101136153
/* A complex statement machine used to detect the end of a CREATE TRIGGER
@@ -136256,11 +136308,11 @@
136256136308
/*
136257136309
** This routine is the same as the sqlite3_complete() routine described
136258136310
** above, except that the parameter is required to be UTF-16 encoded, not
136259136311
** UTF-8.
136260136312
*/
136261
-SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *zSql){
136313
+SQLITE_API int SQLITE_APICALL sqlite3_complete16(const void *zSql){
136262136314
sqlite3_value *pVal;
136263136315
char const *zSql8;
136264136316
int rc;
136265136317
136266136318
#ifndef SQLITE_OMIT_AUTOINIT
@@ -136416,28 +136468,28 @@
136416136468
#endif
136417136469
136418136470
/* IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns
136419136471
** a pointer to the to the sqlite3_version[] string constant.
136420136472
*/
136421
-SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void){ return sqlite3_version; }
136473
+SQLITE_API const char *SQLITE_APICALL sqlite3_libversion(void){ return sqlite3_version; }
136422136474
136423136475
/* IMPLEMENTATION-OF: R-63124-39300 The sqlite3_sourceid() function returns a
136424136476
** pointer to a string constant whose value is the same as the
136425136477
** SQLITE_SOURCE_ID C preprocessor macro.
136426136478
*/
136427
-SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
136479
+SQLITE_API const char *SQLITE_APICALL sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
136428136480
136429136481
/* IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function
136430136482
** returns an integer equal to SQLITE_VERSION_NUMBER.
136431136483
*/
136432
-SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; }
136484
+SQLITE_API int SQLITE_APICALL sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; }
136433136485
136434136486
/* IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns
136435136487
** zero if and only if SQLite was compiled with mutexing code omitted due to
136436136488
** the SQLITE_THREADSAFE compile-time option being set to 0.
136437136489
*/
136438
-SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; }
136490
+SQLITE_API int SQLITE_APICALL sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; }
136439136491
136440136492
/*
136441136493
** When compiling the test fixture or with debugging enabled (on Win32),
136442136494
** this variable being set to non-zero will cause OSTRACE macros to emit
136443136495
** extra diagnostic information.
@@ -136506,11 +136558,11 @@
136506136558
** call by X completes.
136507136559
**
136508136560
** * Recursive calls to this routine from thread X return immediately
136509136561
** without blocking.
136510136562
*/
136511
-SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void){
136563
+SQLITE_API int SQLITE_APICALL sqlite3_initialize(void){
136512136564
MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */
136513136565
int rc; /* Result code */
136514136566
#ifdef SQLITE_EXTRA_INIT
136515136567
int bRunExtraInit = 0; /* Extra initialization needed */
136516136568
#endif
@@ -136672,11 +136724,11 @@
136672136724
** while any part of SQLite is otherwise in use in any thread. This
136673136725
** routine is not threadsafe. But it is safe to invoke this routine
136674136726
** on when SQLite is already shut down. If SQLite is already shut down
136675136727
** when this routine is invoked, then this routine is a harmless no-op.
136676136728
*/
136677
-SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void){
136729
+SQLITE_API int SQLITE_APICALL sqlite3_shutdown(void){
136678136730
#ifdef SQLITE_OMIT_WSD
136679136731
int rc = sqlite3_wsd_init(4096, 24);
136680136732
if( rc!=SQLITE_OK ){
136681136733
return rc;
136682136734
}
@@ -137091,11 +137143,11 @@
137091137143
}
137092137144
137093137145
/*
137094137146
** Return the mutex associated with a database connection.
137095137147
*/
137096
-SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3 *db){
137148
+SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_db_mutex(sqlite3 *db){
137097137149
#ifdef SQLITE_ENABLE_API_ARMOR
137098137150
if( !sqlite3SafetyCheckOk(db) ){
137099137151
(void)SQLITE_MISUSE_BKPT;
137100137152
return 0;
137101137153
}
@@ -137105,11 +137157,11 @@
137105137157
137106137158
/*
137107137159
** Free up as much memory as we can from the given database
137108137160
** connection.
137109137161
*/
137110
-SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3 *db){
137162
+SQLITE_API int SQLITE_APICALL sqlite3_db_release_memory(sqlite3 *db){
137111137163
int i;
137112137164
137113137165
#ifdef SQLITE_ENABLE_API_ARMOR
137114137166
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
137115137167
#endif
@@ -137129,11 +137181,11 @@
137129137181
137130137182
/*
137131137183
** Flush any dirty pages in the pager-cache for any attached database
137132137184
** to disk.
137133137185
*/
137134
-SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3 *db){
137186
+SQLITE_API int SQLITE_APICALL sqlite3_db_cacheflush(sqlite3 *db){
137135137187
int i;
137136137188
int rc = SQLITE_OK;
137137137189
int bSeenBusy = 0;
137138137190
137139137191
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -137279,11 +137331,11 @@
137279137331
}
137280137332
137281137333
/*
137282137334
** Return the ROWID of the most recent insert
137283137335
*/
137284
-SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3 *db){
137336
+SQLITE_API sqlite_int64 SQLITE_APICALL sqlite3_last_insert_rowid(sqlite3 *db){
137285137337
#ifdef SQLITE_ENABLE_API_ARMOR
137286137338
if( !sqlite3SafetyCheckOk(db) ){
137287137339
(void)SQLITE_MISUSE_BKPT;
137288137340
return 0;
137289137341
}
@@ -137292,11 +137344,11 @@
137292137344
}
137293137345
137294137346
/*
137295137347
** Return the number of changes in the most recent call to sqlite3_exec().
137296137348
*/
137297
-SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3 *db){
137349
+SQLITE_API int SQLITE_APICALL sqlite3_changes(sqlite3 *db){
137298137350
#ifdef SQLITE_ENABLE_API_ARMOR
137299137351
if( !sqlite3SafetyCheckOk(db) ){
137300137352
(void)SQLITE_MISUSE_BKPT;
137301137353
return 0;
137302137354
}
@@ -137305,11 +137357,11 @@
137305137357
}
137306137358
137307137359
/*
137308137360
** Return the number of changes since the database handle was opened.
137309137361
*/
137310
-SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3 *db){
137362
+SQLITE_API int SQLITE_APICALL sqlite3_total_changes(sqlite3 *db){
137311137363
#ifdef SQLITE_ENABLE_API_ARMOR
137312137364
if( !sqlite3SafetyCheckOk(db) ){
137313137365
(void)SQLITE_MISUSE_BKPT;
137314137366
return 0;
137315137367
}
@@ -137456,12 +137508,12 @@
137456137508
** statements or unfinished sqlite3_backups. The sqlite3_close_v2()
137457137509
** version forces the connection to become a zombie if there are
137458137510
** unclosed resources, and arranges for deallocation when the last
137459137511
** prepare statement or sqlite3_backup closes.
137460137512
*/
137461
-SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3 *db){ return sqlite3Close(db,0); }
137462
-SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3 *db){ return sqlite3Close(db,1); }
137513
+SQLITE_API int SQLITE_APICALL sqlite3_close(sqlite3 *db){ return sqlite3Close(db,0); }
137514
+SQLITE_API int SQLITE_APICALL sqlite3_close_v2(sqlite3 *db){ return sqlite3Close(db,1); }
137463137515
137464137516
137465137517
/*
137466137518
** Close the mutex on database connection db.
137467137519
**
@@ -137864,11 +137916,11 @@
137864137916
137865137917
/*
137866137918
** This routine sets the busy callback for an Sqlite database to the
137867137919
** given callback function with the given argument.
137868137920
*/
137869
-SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(
137921
+SQLITE_API int SQLITE_APICALL sqlite3_busy_handler(
137870137922
sqlite3 *db,
137871137923
int (*xBusy)(void*,int),
137872137924
void *pArg
137873137925
){
137874137926
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -137887,11 +137939,11 @@
137887137939
/*
137888137940
** This routine sets the progress callback for an Sqlite database to the
137889137941
** given callback function with the given argument. The progress callback will
137890137942
** be invoked every nOps opcodes.
137891137943
*/
137892
-SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(
137944
+SQLITE_API void SQLITE_APICALL sqlite3_progress_handler(
137893137945
sqlite3 *db,
137894137946
int nOps,
137895137947
int (*xProgress)(void*),
137896137948
void *pArg
137897137949
){
@@ -137918,11 +137970,11 @@
137918137970
137919137971
/*
137920137972
** This routine installs a default busy handler that waits for the
137921137973
** specified number of milliseconds before returning 0.
137922137974
*/
137923
-SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3 *db, int ms){
137975
+SQLITE_API int SQLITE_APICALL sqlite3_busy_timeout(sqlite3 *db, int ms){
137924137976
#ifdef SQLITE_ENABLE_API_ARMOR
137925137977
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
137926137978
#endif
137927137979
if( ms>0 ){
137928137980
sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db);
@@ -137934,11 +137986,11 @@
137934137986
}
137935137987
137936137988
/*
137937137989
** Cause any pending operation to stop at its earliest opportunity.
137938137990
*/
137939
-SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3 *db){
137991
+SQLITE_API void SQLITE_APICALL sqlite3_interrupt(sqlite3 *db){
137940137992
#ifdef SQLITE_ENABLE_API_ARMOR
137941137993
if( !sqlite3SafetyCheckOk(db) ){
137942137994
(void)SQLITE_MISUSE_BKPT;
137943137995
return;
137944137996
}
@@ -138050,11 +138102,11 @@
138050138102
}
138051138103
138052138104
/*
138053138105
** Create new user functions.
138054138106
*/
138055
-SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
138107
+SQLITE_API int SQLITE_APICALL sqlite3_create_function(
138056138108
sqlite3 *db,
138057138109
const char *zFunc,
138058138110
int nArg,
138059138111
int enc,
138060138112
void *p,
@@ -138064,11 +138116,11 @@
138064138116
){
138065138117
return sqlite3_create_function_v2(db, zFunc, nArg, enc, p, xSFunc, xStep,
138066138118
xFinal, 0);
138067138119
}
138068138120
138069
-SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
138121
+SQLITE_API int SQLITE_APICALL sqlite3_create_function_v2(
138070138122
sqlite3 *db,
138071138123
const char *zFunc,
138072138124
int nArg,
138073138125
int enc,
138074138126
void *p,
@@ -138107,11 +138159,11 @@
138107138159
sqlite3_mutex_leave(db->mutex);
138108138160
return rc;
138109138161
}
138110138162
138111138163
#ifndef SQLITE_OMIT_UTF16
138112
-SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
138164
+SQLITE_API int SQLITE_APICALL sqlite3_create_function16(
138113138165
sqlite3 *db,
138114138166
const void *zFunctionName,
138115138167
int nArg,
138116138168
int eTextRep,
138117138169
void *p,
@@ -138147,11 +138199,11 @@
138147138199
** When virtual tables intend to provide an overloaded function, they
138148138200
** should call this routine to make sure the global function exists.
138149138201
** A global function must exist in order for name resolution to work
138150138202
** properly.
138151138203
*/
138152
-SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(
138204
+SQLITE_API int SQLITE_APICALL sqlite3_overload_function(
138153138205
sqlite3 *db,
138154138206
const char *zName,
138155138207
int nArg
138156138208
){
138157138209
int rc = SQLITE_OK;
@@ -138179,11 +138231,11 @@
138179138231
** A NULL trace function means that no tracing is executes. A non-NULL
138180138232
** trace is a pointer to a function that is invoked at the start of each
138181138233
** SQL statement.
138182138234
*/
138183138235
#ifndef SQLITE_OMIT_DEPRECATED
138184
-SQLITE_API void *SQLITE_STDCALL sqlite3_trace(sqlite3 *db, void(*xTrace)(void*,const char*), void *pArg){
138236
+SQLITE_API void *SQLITE_APICALL sqlite3_trace(sqlite3 *db, void(*xTrace)(void*,const char*), void *pArg){
138185138237
void *pOld;
138186138238
138187138239
#ifdef SQLITE_ENABLE_API_ARMOR
138188138240
if( !sqlite3SafetyCheckOk(db) ){
138189138241
(void)SQLITE_MISUSE_BKPT;
@@ -138200,11 +138252,11 @@
138200138252
}
138201138253
#endif /* SQLITE_OMIT_DEPRECATED */
138202138254
138203138255
/* Register a trace callback using the version-2 interface.
138204138256
*/
138205
-SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2(
138257
+SQLITE_API int SQLITE_APICALL sqlite3_trace_v2(
138206138258
sqlite3 *db, /* Trace this connection */
138207138259
unsigned mTrace, /* Mask of events to be traced */
138208138260
int(*xTrace)(unsigned,void*,void*,void*), /* Callback to invoke */
138209138261
void *pArg /* Context */
138210138262
){
@@ -138228,11 +138280,11 @@
138228138280
**
138229138281
** A NULL profile function means that no profiling is executes. A non-NULL
138230138282
** profile is a pointer to a function that is invoked at the conclusion of
138231138283
** each SQL statement that is run.
138232138284
*/
138233
-SQLITE_API void *SQLITE_STDCALL sqlite3_profile(
138285
+SQLITE_API void *SQLITE_APICALL sqlite3_profile(
138234138286
sqlite3 *db,
138235138287
void (*xProfile)(void*,const char*,sqlite_uint64),
138236138288
void *pArg
138237138289
){
138238138290
void *pOld;
@@ -138256,11 +138308,11 @@
138256138308
/*
138257138309
** Register a function to be invoked when a transaction commits.
138258138310
** If the invoked function returns non-zero, then the commit becomes a
138259138311
** rollback.
138260138312
*/
138261
-SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(
138313
+SQLITE_API void *SQLITE_APICALL sqlite3_commit_hook(
138262138314
sqlite3 *db, /* Attach the hook to this database */
138263138315
int (*xCallback)(void*), /* Function to invoke on each commit */
138264138316
void *pArg /* Argument to the function */
138265138317
){
138266138318
void *pOld;
@@ -138281,11 +138333,11 @@
138281138333
138282138334
/*
138283138335
** Register a callback to be invoked each time a row is updated,
138284138336
** inserted or deleted using this database connection.
138285138337
*/
138286
-SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
138338
+SQLITE_API void *SQLITE_APICALL sqlite3_update_hook(
138287138339
sqlite3 *db, /* Attach the hook to this database */
138288138340
void (*xCallback)(void*,int,char const *,char const *,sqlite_int64),
138289138341
void *pArg /* Argument to the function */
138290138342
){
138291138343
void *pRet;
@@ -138306,11 +138358,11 @@
138306138358
138307138359
/*
138308138360
** Register a callback to be invoked each time a transaction is rolled
138309138361
** back by this database connection.
138310138362
*/
138311
-SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(
138363
+SQLITE_API void *SQLITE_APICALL sqlite3_rollback_hook(
138312138364
sqlite3 *db, /* Attach the hook to this database */
138313138365
void (*xCallback)(void*), /* Callback function */
138314138366
void *pArg /* Argument to the function */
138315138367
){
138316138368
void *pRet;
@@ -138332,11 +138384,11 @@
138332138384
#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
138333138385
/*
138334138386
** Register a callback to be invoked each time a row is updated,
138335138387
** inserted or deleted using this database connection.
138336138388
*/
138337
-SQLITE_API void *SQLITE_STDCALL sqlite3_preupdate_hook(
138389
+SQLITE_API void *SQLITE_APICALL sqlite3_preupdate_hook(
138338138390
sqlite3 *db, /* Attach the hook to this database */
138339138391
void(*xCallback)( /* Callback function */
138340138392
void*,sqlite3*,int,char const*,char const*,sqlite3_int64,sqlite3_int64),
138341138393
void *pArg /* First callback argument */
138342138394
){
@@ -138381,11 +138433,11 @@
138381138433
** The callback registered by this function replaces any existing callback
138382138434
** registered using sqlite3_wal_hook(). Likewise, registering a callback
138383138435
** using sqlite3_wal_hook() disables the automatic checkpoint mechanism
138384138436
** configured by this function.
138385138437
*/
138386
-SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){
138438
+SQLITE_API int SQLITE_APICALL sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){
138387138439
#ifdef SQLITE_OMIT_WAL
138388138440
UNUSED_PARAMETER(db);
138389138441
UNUSED_PARAMETER(nFrame);
138390138442
#else
138391138443
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -138402,11 +138454,11 @@
138402138454
138403138455
/*
138404138456
** Register a callback to be invoked each time a transaction is written
138405138457
** into the write-ahead-log by this database connection.
138406138458
*/
138407
-SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
138459
+SQLITE_API void *SQLITE_APICALL sqlite3_wal_hook(
138408138460
sqlite3 *db, /* Attach the hook to this db handle */
138409138461
int(*xCallback)(void *, sqlite3*, const char*, int),
138410138462
void *pArg /* First argument passed to xCallback() */
138411138463
){
138412138464
#ifndef SQLITE_OMIT_WAL
@@ -138429,11 +138481,11 @@
138429138481
}
138430138482
138431138483
/*
138432138484
** Checkpoint database zDb.
138433138485
*/
138434
-SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
138486
+SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint_v2(
138435138487
sqlite3 *db, /* Database handle */
138436138488
const char *zDb, /* Name of attached database (or NULL) */
138437138489
int eMode, /* SQLITE_CHECKPOINT_* value */
138438138490
int *pnLog, /* OUT: Size of WAL log in frames */
138439138491
int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -138484,11 +138536,11 @@
138484138536
/*
138485138537
** Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points
138486138538
** to contains a zero-length string, all attached databases are
138487138539
** checkpointed.
138488138540
*/
138489
-SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){
138541
+SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){
138490138542
/* EVIDENCE-OF: R-41613-20553 The sqlite3_wal_checkpoint(D,X) is equivalent to
138491138543
** sqlite3_wal_checkpoint_v2(D,X,SQLITE_CHECKPOINT_PASSIVE,0,0). */
138492138544
return sqlite3_wal_checkpoint_v2(db,zDb,SQLITE_CHECKPOINT_PASSIVE,0,0);
138493138545
}
138494138546
@@ -138575,11 +138627,11 @@
138575138627
138576138628
/*
138577138629
** Return UTF-8 encoded English language explanation of the most recent
138578138630
** error.
138579138631
*/
138580
-SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3 *db){
138632
+SQLITE_API const char *SQLITE_APICALL sqlite3_errmsg(sqlite3 *db){
138581138633
const char *z;
138582138634
if( !db ){
138583138635
return sqlite3ErrStr(SQLITE_NOMEM_BKPT);
138584138636
}
138585138637
if( !sqlite3SafetyCheckSickOrOk(db) ){
@@ -138603,11 +138655,11 @@
138603138655
#ifndef SQLITE_OMIT_UTF16
138604138656
/*
138605138657
** Return UTF-16 encoded English language explanation of the most recent
138606138658
** error.
138607138659
*/
138608
-SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3 *db){
138660
+SQLITE_API const void *SQLITE_APICALL sqlite3_errmsg16(sqlite3 *db){
138609138661
static const u16 outOfMem[] = {
138610138662
'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0
138611138663
};
138612138664
static const u16 misuse[] = {
138613138665
'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ',
@@ -138648,38 +138700,38 @@
138648138700
138649138701
/*
138650138702
** Return the most recent error code generated by an SQLite routine. If NULL is
138651138703
** passed to this function, we assume a malloc() failed during sqlite3_open().
138652138704
*/
138653
-SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db){
138705
+SQLITE_API int SQLITE_APICALL sqlite3_errcode(sqlite3 *db){
138654138706
if( db && !sqlite3SafetyCheckSickOrOk(db) ){
138655138707
return SQLITE_MISUSE_BKPT;
138656138708
}
138657138709
if( !db || db->mallocFailed ){
138658138710
return SQLITE_NOMEM_BKPT;
138659138711
}
138660138712
return db->errCode & db->errMask;
138661138713
}
138662
-SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db){
138714
+SQLITE_API int SQLITE_APICALL sqlite3_extended_errcode(sqlite3 *db){
138663138715
if( db && !sqlite3SafetyCheckSickOrOk(db) ){
138664138716
return SQLITE_MISUSE_BKPT;
138665138717
}
138666138718
if( !db || db->mallocFailed ){
138667138719
return SQLITE_NOMEM_BKPT;
138668138720
}
138669138721
return db->errCode;
138670138722
}
138671
-SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3 *db){
138723
+SQLITE_API int SQLITE_APICALL sqlite3_system_errno(sqlite3 *db){
138672138724
return db ? db->iSysErrno : 0;
138673138725
}
138674138726
138675138727
/*
138676138728
** Return a string that describes the kind of error specified in the
138677138729
** argument. For now, this simply calls the internal sqlite3ErrStr()
138678138730
** function.
138679138731
*/
138680
-SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int rc){
138732
+SQLITE_API const char *SQLITE_APICALL sqlite3_errstr(int rc){
138681138733
return sqlite3ErrStr(rc);
138682138734
}
138683138735
138684138736
/*
138685138737
** Create a new collating function for database "db". The name is zName
@@ -138823,11 +138875,11 @@
138823138875
**
138824138876
** A new lower limit does not shrink existing constructs.
138825138877
** It merely prevents new constructs that exceed the limit
138826138878
** from forming.
138827138879
*/
138828
-SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3 *db, int limitId, int newLimit){
138880
+SQLITE_API int SQLITE_APICALL sqlite3_limit(sqlite3 *db, int limitId, int newLimit){
138829138881
int oldLimit;
138830138882
138831138883
#ifdef SQLITE_ENABLE_API_ARMOR
138832138884
if( !sqlite3SafetyCheckOk(db) ){
138833138885
(void)SQLITE_MISUSE_BKPT;
@@ -139447,18 +139499,18 @@
139447139499
}
139448139500
139449139501
/*
139450139502
** Open a new database handle.
139451139503
*/
139452
-SQLITE_API int SQLITE_STDCALL sqlite3_open(
139504
+SQLITE_API int SQLITE_APICALL sqlite3_open(
139453139505
const char *zFilename,
139454139506
sqlite3 **ppDb
139455139507
){
139456139508
return openDatabase(zFilename, ppDb,
139457139509
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0);
139458139510
}
139459
-SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
139511
+SQLITE_API int SQLITE_APICALL sqlite3_open_v2(
139460139512
const char *filename, /* Database filename (UTF-8) */
139461139513
sqlite3 **ppDb, /* OUT: SQLite db handle */
139462139514
int flags, /* Flags */
139463139515
const char *zVfs /* Name of VFS module to use */
139464139516
){
@@ -139467,11 +139519,11 @@
139467139519
139468139520
#ifndef SQLITE_OMIT_UTF16
139469139521
/*
139470139522
** Open a new database handle.
139471139523
*/
139472
-SQLITE_API int SQLITE_STDCALL sqlite3_open16(
139524
+SQLITE_API int SQLITE_APICALL sqlite3_open16(
139473139525
const void *zFilename,
139474139526
sqlite3 **ppDb
139475139527
){
139476139528
char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */
139477139529
sqlite3_value *pVal;
@@ -139506,11 +139558,11 @@
139506139558
#endif /* SQLITE_OMIT_UTF16 */
139507139559
139508139560
/*
139509139561
** Register a new collation sequence with the database handle db.
139510139562
*/
139511
-SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
139563
+SQLITE_API int SQLITE_APICALL sqlite3_create_collation(
139512139564
sqlite3* db,
139513139565
const char *zName,
139514139566
int enc,
139515139567
void* pCtx,
139516139568
int(*xCompare)(void*,int,const void*,int,const void*)
@@ -139519,11 +139571,11 @@
139519139571
}
139520139572
139521139573
/*
139522139574
** Register a new collation sequence with the database handle db.
139523139575
*/
139524
-SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
139576
+SQLITE_API int SQLITE_APICALL sqlite3_create_collation_v2(
139525139577
sqlite3* db,
139526139578
const char *zName,
139527139579
int enc,
139528139580
void* pCtx,
139529139581
int(*xCompare)(void*,int,const void*,int,const void*),
@@ -139544,11 +139596,11 @@
139544139596
139545139597
#ifndef SQLITE_OMIT_UTF16
139546139598
/*
139547139599
** Register a new collation sequence with the database handle db.
139548139600
*/
139549
-SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
139601
+SQLITE_API int SQLITE_APICALL sqlite3_create_collation16(
139550139602
sqlite3* db,
139551139603
const void *zName,
139552139604
int enc,
139553139605
void* pCtx,
139554139606
int(*xCompare)(void*,int,const void*,int,const void*)
@@ -139574,11 +139626,11 @@
139574139626
139575139627
/*
139576139628
** Register a collation sequence factory callback with the database handle
139577139629
** db. Replace any previously installed collation sequence factory.
139578139630
*/
139579
-SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
139631
+SQLITE_API int SQLITE_APICALL sqlite3_collation_needed(
139580139632
sqlite3 *db,
139581139633
void *pCollNeededArg,
139582139634
void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*)
139583139635
){
139584139636
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -139595,11 +139647,11 @@
139595139647
#ifndef SQLITE_OMIT_UTF16
139596139648
/*
139597139649
** Register a collation sequence factory callback with the database handle
139598139650
** db. Replace any previously installed collation sequence factory.
139599139651
*/
139600
-SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
139652
+SQLITE_API int SQLITE_APICALL sqlite3_collation_needed16(
139601139653
sqlite3 *db,
139602139654
void *pCollNeededArg,
139603139655
void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*)
139604139656
){
139605139657
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -139617,11 +139669,11 @@
139617139669
#ifndef SQLITE_OMIT_DEPRECATED
139618139670
/*
139619139671
** This function is now an anachronism. It used to be used to recover from a
139620139672
** malloc() failure, but SQLite now does this automatically.
139621139673
*/
139622
-SQLITE_API int SQLITE_STDCALL sqlite3_global_recover(void){
139674
+SQLITE_API int SQLITE_APICALL sqlite3_global_recover(void){
139623139675
return SQLITE_OK;
139624139676
}
139625139677
#endif
139626139678
139627139679
/*
@@ -139628,11 +139680,11 @@
139628139680
** Test to see whether or not the database connection is in autocommit
139629139681
** mode. Return TRUE if it is and FALSE if not. Autocommit mode is on
139630139682
** by default. Autocommit is disabled by a BEGIN statement and reenabled
139631139683
** by the next COMMIT or ROLLBACK.
139632139684
*/
139633
-SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3 *db){
139685
+SQLITE_API int SQLITE_APICALL sqlite3_get_autocommit(sqlite3 *db){
139634139686
#ifdef SQLITE_ENABLE_API_ARMOR
139635139687
if( !sqlite3SafetyCheckOk(db) ){
139636139688
(void)SQLITE_MISUSE_BKPT;
139637139689
return 0;
139638139690
}
@@ -139685,19 +139737,19 @@
139685139737
** data for this thread has been deallocated.
139686139738
**
139687139739
** SQLite no longer uses thread-specific data so this routine is now a
139688139740
** no-op. It is retained for historical compatibility.
139689139741
*/
139690
-SQLITE_API void SQLITE_STDCALL sqlite3_thread_cleanup(void){
139742
+SQLITE_API void SQLITE_APICALL sqlite3_thread_cleanup(void){
139691139743
}
139692139744
#endif
139693139745
139694139746
/*
139695139747
** Return meta information about a specific column of a database table.
139696139748
** See comment in sqlite3.h (sqlite.h.in) for details.
139697139749
*/
139698
-SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
139750
+SQLITE_API int SQLITE_APICALL sqlite3_table_column_metadata(
139699139751
sqlite3 *db, /* Connection handle */
139700139752
const char *zDbName, /* Database name or NULL */
139701139753
const char *zTableName, /* Table name */
139702139754
const char *zColumnName, /* Column name */
139703139755
char const **pzDataType, /* OUTPUT: Declared data type */
@@ -139811,11 +139863,11 @@
139811139863
}
139812139864
139813139865
/*
139814139866
** Sleep for a little while. Return the amount of time slept.
139815139867
*/
139816
-SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int ms){
139868
+SQLITE_API int SQLITE_APICALL sqlite3_sleep(int ms){
139817139869
sqlite3_vfs *pVfs;
139818139870
int rc;
139819139871
pVfs = sqlite3_vfs_find(0);
139820139872
if( pVfs==0 ) return 0;
139821139873
@@ -139827,11 +139879,11 @@
139827139879
}
139828139880
139829139881
/*
139830139882
** Enable or disable the extended result codes.
139831139883
*/
139832
-SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3 *db, int onoff){
139884
+SQLITE_API int SQLITE_APICALL sqlite3_extended_result_codes(sqlite3 *db, int onoff){
139833139885
#ifdef SQLITE_ENABLE_API_ARMOR
139834139886
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
139835139887
#endif
139836139888
sqlite3_mutex_enter(db->mutex);
139837139889
db->errMask = onoff ? 0xffffffff : 0xff;
@@ -139840,11 +139892,11 @@
139840139892
}
139841139893
139842139894
/*
139843139895
** Invoke the xFileControl method on a particular database.
139844139896
*/
139845
-SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
139897
+SQLITE_API int SQLITE_APICALL sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
139846139898
int rc = SQLITE_ERROR;
139847139899
Btree *pBtree;
139848139900
139849139901
#ifdef SQLITE_ENABLE_API_ARMOR
139850139902
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -140225,11 +140277,11 @@
140225140277
** method of a VFS implementation. The zParam argument is the name of the
140226140278
** query parameter we seek. This routine returns the value of the zParam
140227140279
** parameter if it exists. If the parameter does not exist, this routine
140228140280
** returns a NULL pointer.
140229140281
*/
140230
-SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam){
140282
+SQLITE_API const char *SQLITE_APICALL sqlite3_uri_parameter(const char *zFilename, const char *zParam){
140231140283
if( zFilename==0 || zParam==0 ) return 0;
140232140284
zFilename += sqlite3Strlen30(zFilename) + 1;
140233140285
while( zFilename[0] ){
140234140286
int x = strcmp(zFilename, zParam);
140235140287
zFilename += sqlite3Strlen30(zFilename) + 1;
@@ -140240,20 +140292,20 @@
140240140292
}
140241140293
140242140294
/*
140243140295
** Return a boolean value for a query parameter.
140244140296
*/
140245
-SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){
140297
+SQLITE_API int SQLITE_APICALL sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){
140246140298
const char *z = sqlite3_uri_parameter(zFilename, zParam);
140247140299
bDflt = bDflt!=0;
140248140300
return z ? sqlite3GetBoolean(z, bDflt) : bDflt;
140249140301
}
140250140302
140251140303
/*
140252140304
** Return a 64-bit integer value for a query parameter.
140253140305
*/
140254
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(
140306
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_uri_int64(
140255140307
const char *zFilename, /* Filename as passed to xOpen */
140256140308
const char *zParam, /* URI parameter sought */
140257140309
sqlite3_int64 bDflt /* return if parameter is missing */
140258140310
){
140259140311
const char *z = sqlite3_uri_parameter(zFilename, zParam);
@@ -140281,11 +140333,11 @@
140281140333
140282140334
/*
140283140335
** Return the filename of the database associated with a database
140284140336
** connection.
140285140337
*/
140286
-SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName){
140338
+SQLITE_API const char *SQLITE_APICALL sqlite3_db_filename(sqlite3 *db, const char *zDbName){
140287140339
Btree *pBt;
140288140340
#ifdef SQLITE_ENABLE_API_ARMOR
140289140341
if( !sqlite3SafetyCheckOk(db) ){
140290140342
(void)SQLITE_MISUSE_BKPT;
140291140343
return 0;
@@ -140297,11 +140349,11 @@
140297140349
140298140350
/*
140299140351
** Return 1 if database is read-only or 0 if read/write. Return -1 if
140300140352
** no such database exists.
140301140353
*/
140302
-SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName){
140354
+SQLITE_API int SQLITE_APICALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName){
140303140355
Btree *pBt;
140304140356
#ifdef SQLITE_ENABLE_API_ARMOR
140305140357
if( !sqlite3SafetyCheckOk(db) ){
140306140358
(void)SQLITE_MISUSE_BKPT;
140307140359
return -1;
@@ -140314,11 +140366,11 @@
140314140366
#ifdef SQLITE_ENABLE_SNAPSHOT
140315140367
/*
140316140368
** Obtain a snapshot handle for the snapshot of database zDb currently
140317140369
** being read by handle db.
140318140370
*/
140319
-SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_get(
140371
+SQLITE_API int SQLITE_APICALL sqlite3_snapshot_get(
140320140372
sqlite3 *db,
140321140373
const char *zDb,
140322140374
sqlite3_snapshot **ppSnapshot
140323140375
){
140324140376
int rc = SQLITE_ERROR;
@@ -140349,11 +140401,11 @@
140349140401
}
140350140402
140351140403
/*
140352140404
** Open a read-transaction on the snapshot idendified by pSnapshot.
140353140405
*/
140354
-SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_open(
140406
+SQLITE_API int SQLITE_APICALL sqlite3_snapshot_open(
140355140407
sqlite3 *db,
140356140408
const char *zDb,
140357140409
sqlite3_snapshot *pSnapshot
140358140410
){
140359140411
int rc = SQLITE_ERROR;
@@ -140386,11 +140438,11 @@
140386140438
}
140387140439
140388140440
/*
140389140441
** Free a snapshot handle obtained from sqlite3_snapshot_get().
140390140442
*/
140391
-SQLITE_API void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot *pSnapshot){
140443
+SQLITE_API void SQLITE_APICALL sqlite3_snapshot_free(sqlite3_snapshot *pSnapshot){
140392140444
sqlite3_free(pSnapshot);
140393140445
}
140394140446
#endif /* SQLITE_ENABLE_SNAPSHOT */
140395140447
140396140448
/************** End of main.c ************************************************/
@@ -140540,11 +140592,11 @@
140540140592
**
140541140593
** Each call to this routine overrides any prior callbacks registered
140542140594
** on the same "db". If xNotify==0 then any prior callbacks are immediately
140543140595
** cancelled.
140544140596
*/
140545
-SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
140597
+SQLITE_API int SQLITE_APICALL sqlite3_unlock_notify(
140546140598
sqlite3 *db,
140547140599
void (*xNotify)(void **, int),
140548140600
void *pArg
140549140601
){
140550140602
int rc = SQLITE_OK;
@@ -147543,11 +147595,11 @@
147543147595
** Initialize API pointer table, if required.
147544147596
*/
147545147597
#ifdef _WIN32
147546147598
__declspec(dllexport)
147547147599
#endif
147548
-SQLITE_API int SQLITE_STDCALL sqlite3_fts3_init(
147600
+SQLITE_API int SQLITE_APICALL sqlite3_fts3_init(
147549147601
sqlite3 *db,
147550147602
char **pzErrMsg,
147551147603
const sqlite3_api_routines *pApi
147552147604
){
147553147605
SQLITE_EXTENSION_INIT2(pApi)
@@ -150699,11 +150751,15 @@
150699150751
}
150700150752
150701150753
150702150754
#ifdef SQLITE_TEST
150703150755
150704
-#include <tcl.h>
150756
+#if defined(INCLUDE_SQLITE_TCL_H)
150757
+# include "sqlite_tcl.h"
150758
+#else
150759
+# include "tcl.h"
150760
+#endif
150705150761
/* #include <string.h> */
150706150762
150707150763
/*
150708150764
** Implementation of a special SQL scalar function for testing tokenizers
150709150765
** designed to be used in concert with the Tcl testing framework. This
@@ -163340,11 +163396,11 @@
163340163396
}
163341163397
163342163398
/*
163343163399
** Register a new geometry function for use with the r-tree MATCH operator.
163344163400
*/
163345
-SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
163401
+SQLITE_API int SQLITE_APICALL sqlite3_rtree_geometry_callback(
163346163402
sqlite3 *db, /* Register SQL function on this connection */
163347163403
const char *zGeom, /* Name of the new SQL function */
163348163404
int (*xGeom)(sqlite3_rtree_geometry*,int,RtreeDValue*,int*), /* Callback */
163349163405
void *pContext /* Extra data associated with the callback */
163350163406
){
@@ -163364,11 +163420,11 @@
163364163420
163365163421
/*
163366163422
** Register a new 2nd-generation geometry function for use with the
163367163423
** r-tree MATCH operator.
163368163424
*/
163369
-SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
163425
+SQLITE_API int SQLITE_APICALL sqlite3_rtree_query_callback(
163370163426
sqlite3 *db, /* Register SQL function on this connection */
163371163427
const char *zQueryFunc, /* Name of new SQL function */
163372163428
int (*xQueryFunc)(sqlite3_rtree_query_info*), /* Callback */
163373163429
void *pContext, /* Extra data passed into the callback */
163374163430
void (*xDestructor)(void*) /* Destructor for the extra data */
@@ -163389,11 +163445,11 @@
163389163445
163390163446
#if !SQLITE_CORE
163391163447
#ifdef _WIN32
163392163448
__declspec(dllexport)
163393163449
#endif
163394
-SQLITE_API int SQLITE_STDCALL sqlite3_rtree_init(
163450
+SQLITE_API int SQLITE_APICALL sqlite3_rtree_init(
163395163451
sqlite3 *db,
163396163452
char **pzErrMsg,
163397163453
const sqlite3_api_routines *pApi
163398163454
){
163399163455
SQLITE_EXTENSION_INIT2(pApi)
@@ -163940,11 +163996,11 @@
163940163996
163941163997
#if !SQLITE_CORE
163942163998
#ifdef _WIN32
163943163999
__declspec(dllexport)
163944164000
#endif
163945
-SQLITE_API int SQLITE_STDCALL sqlite3_icu_init(
164001
+SQLITE_API int SQLITE_APICALL sqlite3_icu_init(
163946164002
sqlite3 *db,
163947164003
char **pzErrMsg,
163948164004
const sqlite3_api_routines *pApi
163949164005
){
163950164006
SQLITE_EXTENSION_INIT2(pApi)
@@ -164620,11 +164676,11 @@
164620164676
** IMPORTANT NOTE FOR ZIPVFS USERS: The RBU extension works with all of
164621164677
** SQLite's built-in VFSs, including the multiplexor VFS. However it does
164622164678
** not work out of the box with zipvfs. Refer to the comment describing
164623164679
** the zipvfs_create_vfs() API below for details on using RBU with zipvfs.
164624164680
*/
164625
-SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_open(
164681
+SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_open(
164626164682
const char *zTarget,
164627164683
const char *zRbu,
164628164684
const char *zState
164629164685
);
164630164686
@@ -164653,11 +164709,11 @@
164653164709
** As with sqlite3rbu_open(), Zipvfs users should rever to the comment
164654164710
** describing the sqlite3rbu_create_vfs() API function below for
164655164711
** a description of the complications associated with using RBU with
164656164712
** zipvfs databases.
164657164713
*/
164658
-SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_vacuum(
164714
+SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_vacuum(
164659164715
const char *zTarget,
164660164716
const char *zState
164661164717
);
164662164718
164663164719
/*
@@ -164689,11 +164745,11 @@
164689164745
** when sqlite3rbu_close() is called.
164690164746
**
164691164747
** Database handles returned by this function remain valid until the next
164692164748
** call to any sqlite3rbu_xxx() function other than sqlite3rbu_db().
164693164749
*/
164694
-SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3rbu_db(sqlite3rbu*, int bRbu);
164750
+SQLITE_API sqlite3 *SQLITE_APICALL sqlite3rbu_db(sqlite3rbu*, int bRbu);
164695164751
164696164752
/*
164697164753
** Do some work towards applying the RBU update to the target db.
164698164754
**
164699164755
** Return SQLITE_DONE if the update has been completely applied, or
@@ -164703,11 +164759,11 @@
164703164759
**
164704164760
** Once a call to sqlite3rbu_step() has returned a value other than
164705164761
** SQLITE_OK, all subsequent calls on the same RBU handle are no-ops
164706164762
** that immediately return the same value.
164707164763
*/
164708
-SQLITE_API int SQLITE_STDCALL sqlite3rbu_step(sqlite3rbu *pRbu);
164764
+SQLITE_API int SQLITE_APICALL sqlite3rbu_step(sqlite3rbu *pRbu);
164709164765
164710164766
/*
164711164767
** Force RBU to save its state to disk.
164712164768
**
164713164769
** If a power failure or application crash occurs during an update, following
@@ -164715,11 +164771,11 @@
164715164771
** was last saved. In other words, from the most recent successful call to
164716164772
** sqlite3rbu_close() or this function.
164717164773
**
164718164774
** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
164719164775
*/
164720
-SQLITE_API int SQLITE_STDCALL sqlite3rbu_savestate(sqlite3rbu *pRbu);
164776
+SQLITE_API int SQLITE_APICALL sqlite3rbu_savestate(sqlite3rbu *pRbu);
164721164777
164722164778
/*
164723164779
** Close an RBU handle.
164724164780
**
164725164781
** If the RBU update has been completely applied, mark the RBU database
@@ -164735,18 +164791,18 @@
164735164791
**
164736164792
** Otherwise, if no error occurs, this function returns SQLITE_OK if the
164737164793
** update has been partially applied, or SQLITE_DONE if it has been
164738164794
** completely applied.
164739164795
*/
164740
-SQLITE_API int SQLITE_STDCALL sqlite3rbu_close(sqlite3rbu *pRbu, char **pzErrmsg);
164796
+SQLITE_API int SQLITE_APICALL sqlite3rbu_close(sqlite3rbu *pRbu, char **pzErrmsg);
164741164797
164742164798
/*
164743164799
** Return the total number of key-value operations (inserts, deletes or
164744164800
** updates) that have been performed on the target database since the
164745164801
** current RBU update was started.
164746164802
*/
164747
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3rbu_progress(sqlite3rbu *pRbu);
164803
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3rbu_progress(sqlite3rbu *pRbu);
164748164804
164749164805
/*
164750164806
** Obtain permyriadage (permyriadage is to 10000 as percentage is to 100)
164751164807
** progress indications for the two stages of an RBU update. This API may
164752164808
** be useful for driving GUI progress indicators and similar.
@@ -164784,11 +164840,11 @@
164784164840
** permyriadage progress of the same stage. If the rbu_count table does
164785164841
** not exist, then (*pnOne) is set to -1 during stage 1. If the rbu_count
164786164842
** table exists but is not correctly populated, the value of the *pnOne
164787164843
** output variable during stage 1 is undefined.
164788164844
*/
164789
-SQLITE_API void SQLITE_STDCALL sqlite3rbu_bp_progress(sqlite3rbu *pRbu, int *pnOne, int *pnTwo);
164845
+SQLITE_API void SQLITE_APICALL sqlite3rbu_bp_progress(sqlite3rbu *pRbu, int *pnOne, int *pnTwo);
164790164846
164791164847
/*
164792164848
** Obtain an indication as to the current stage of an RBU update or vacuum.
164793164849
** This function always returns one of the SQLITE_RBU_STATE_XXX constants
164794164850
** defined in this file. Return values should be interpreted as follows:
@@ -164822,11 +164878,11 @@
164822164878
#define SQLITE_RBU_STATE_MOVE 2
164823164879
#define SQLITE_RBU_STATE_CHECKPOINT 3
164824164880
#define SQLITE_RBU_STATE_DONE 4
164825164881
#define SQLITE_RBU_STATE_ERROR 5
164826164882
164827
-SQLITE_API int SQLITE_STDCALL sqlite3rbu_state(sqlite3rbu *pRbu);
164883
+SQLITE_API int SQLITE_APICALL sqlite3rbu_state(sqlite3rbu *pRbu);
164828164884
164829164885
/*
164830164886
** Create an RBU VFS named zName that accesses the underlying file-system
164831164887
** via existing VFS zParent. Or, if the zParent parameter is passed NULL,
164832164888
** then the new RBU VFS uses the default system VFS to access the file-system.
@@ -164866,21 +164922,21 @@
164866164922
** The overhead of adding the "rbu" VFS to the system is negligible for
164867164923
** non-RBU users. There is no harm in an application accessing the
164868164924
** file-system via "rbu" all the time, even if it only uses RBU functionality
164869164925
** occasionally.
164870164926
*/
164871
-SQLITE_API int SQLITE_STDCALL sqlite3rbu_create_vfs(const char *zName, const char *zParent);
164927
+SQLITE_API int SQLITE_APICALL sqlite3rbu_create_vfs(const char *zName, const char *zParent);
164872164928
164873164929
/*
164874164930
** Deregister and destroy an RBU vfs created by an earlier call to
164875164931
** sqlite3rbu_create_vfs().
164876164932
**
164877164933
** VFS objects are not reference counted. If a VFS object is destroyed
164878164934
** before all database handles that use it have been closed, the results
164879164935
** are undefined.
164880164936
*/
164881
-SQLITE_API void SQLITE_STDCALL sqlite3rbu_destroy_vfs(const char *zName);
164937
+SQLITE_API void SQLITE_APICALL sqlite3rbu_destroy_vfs(const char *zName);
164882164938
164883164939
#if 0
164884164940
} /* end of the 'extern "C"' block */
164885164941
#endif
164886164942
@@ -167970,11 +168026,11 @@
167970168026
}
167971168027
167972168028
/*
167973168029
** Step the RBU object.
167974168030
*/
167975
-SQLITE_API int SQLITE_STDCALL sqlite3rbu_step(sqlite3rbu *p){
168031
+SQLITE_API int SQLITE_APICALL sqlite3rbu_step(sqlite3rbu *p){
167976168032
if( p ){
167977168033
switch( p->eStage ){
167978168034
case RBU_STAGE_OAL: {
167979168035
RbuObjIter *pIter = &p->objiter;
167980168036
@@ -168412,11 +168468,11 @@
168412168468
}
168413168469
168414168470
/*
168415168471
** Open and return a new RBU handle.
168416168472
*/
168417
-SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_open(
168473
+SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_open(
168418168474
const char *zTarget,
168419168475
const char *zRbu,
168420168476
const char *zState
168421168477
){
168422168478
/* TODO: Check that zTarget and zRbu are non-NULL */
@@ -168424,11 +168480,11 @@
168424168480
}
168425168481
168426168482
/*
168427168483
** Open a handle to begin or resume an RBU VACUUM operation.
168428168484
*/
168429
-SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_vacuum(
168485
+SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_vacuum(
168430168486
const char *zTarget,
168431168487
const char *zState
168432168488
){
168433168489
/* TODO: Check that both arguments are non-NULL */
168434168490
return openRbuHandle(0, zTarget, zState);
@@ -168435,11 +168491,11 @@
168435168491
}
168436168492
168437168493
/*
168438168494
** Return the database handle used by pRbu.
168439168495
*/
168440
-SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3rbu_db(sqlite3rbu *pRbu, int bRbu){
168496
+SQLITE_API sqlite3 *SQLITE_APICALL sqlite3rbu_db(sqlite3rbu *pRbu, int bRbu){
168441168497
sqlite3 *db = 0;
168442168498
if( pRbu ){
168443168499
db = (bRbu ? pRbu->dbRbu : pRbu->dbMain);
168444168500
}
168445168501
return db;
@@ -168467,11 +168523,11 @@
168467168523
}
168468168524
168469168525
/*
168470168526
** Close the RBU handle.
168471168527
*/
168472
-SQLITE_API int SQLITE_STDCALL sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){
168528
+SQLITE_API int SQLITE_APICALL sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){
168473168529
int rc;
168474168530
if( p ){
168475168531
168476168532
/* Commit the transaction to the *-oal file. */
168477168533
if( p->rc==SQLITE_OK && p->eStage==RBU_STAGE_OAL ){
@@ -168518,19 +168574,19 @@
168518168574
/*
168519168575
** Return the total number of key-value operations (inserts, deletes or
168520168576
** updates) that have been performed on the target database since the
168521168577
** current RBU update was started.
168522168578
*/
168523
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3rbu_progress(sqlite3rbu *pRbu){
168579
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3rbu_progress(sqlite3rbu *pRbu){
168524168580
return pRbu->nProgress;
168525168581
}
168526168582
168527168583
/*
168528168584
** Return permyriadage progress indications for the two main stages of
168529168585
** an RBU update.
168530168586
*/
168531
-SQLITE_API void SQLITE_STDCALL sqlite3rbu_bp_progress(sqlite3rbu *p, int *pnOne, int *pnTwo){
168587
+SQLITE_API void SQLITE_APICALL sqlite3rbu_bp_progress(sqlite3rbu *p, int *pnOne, int *pnTwo){
168532168588
const int MAX_PROGRESS = 10000;
168533168589
switch( p->eStage ){
168534168590
case RBU_STAGE_OAL:
168535168591
if( p->nPhaseOneStep>0 ){
168536168592
*pnOne = (int)(MAX_PROGRESS * (i64)p->nProgress/(i64)p->nPhaseOneStep);
@@ -168561,11 +168617,11 @@
168561168617
}
168562168618
168563168619
/*
168564168620
** Return the current state of the RBU vacuum or update operation.
168565168621
*/
168566
-SQLITE_API int SQLITE_STDCALL sqlite3rbu_state(sqlite3rbu *p){
168622
+SQLITE_API int SQLITE_APICALL sqlite3rbu_state(sqlite3rbu *p){
168567168623
int aRes[] = {
168568168624
0, SQLITE_RBU_STATE_OAL, SQLITE_RBU_STATE_MOVE,
168569168625
0, SQLITE_RBU_STATE_CHECKPOINT, SQLITE_RBU_STATE_DONE
168570168626
};
168571168627
@@ -168589,11 +168645,11 @@
168589168645
);
168590168646
return aRes[p->eStage];
168591168647
}
168592168648
}
168593168649
168594
-SQLITE_API int SQLITE_STDCALL sqlite3rbu_savestate(sqlite3rbu *p){
168650
+SQLITE_API int SQLITE_APICALL sqlite3rbu_savestate(sqlite3rbu *p){
168595168651
int rc = p->rc;
168596168652
if( rc==SQLITE_DONE ) return SQLITE_OK;
168597168653
168598168654
assert( p->eStage>=RBU_STAGE_OAL && p->eStage<=RBU_STAGE_DONE );
168599168655
if( p->eStage==RBU_STAGE_OAL ){
@@ -169416,11 +169472,11 @@
169416169472
169417169473
/*
169418169474
** Deregister and destroy an RBU vfs created by an earlier call to
169419169475
** sqlite3rbu_create_vfs().
169420169476
*/
169421
-SQLITE_API void SQLITE_STDCALL sqlite3rbu_destroy_vfs(const char *zName){
169477
+SQLITE_API void SQLITE_APICALL sqlite3rbu_destroy_vfs(const char *zName){
169422169478
sqlite3_vfs *pVfs = sqlite3_vfs_find(zName);
169423169479
if( pVfs && pVfs->xOpen==rbuVfsOpen ){
169424169480
sqlite3_mutex_free(((rbu_vfs*)pVfs)->mutex);
169425169481
sqlite3_vfs_unregister(pVfs);
169426169482
sqlite3_free(pVfs);
@@ -169430,11 +169486,11 @@
169430169486
/*
169431169487
** Create an RBU VFS named zName that accesses the underlying file-system
169432169488
** via existing VFS zParent. The new object is registered as a non-default
169433169489
** VFS with SQLite before returning.
169434169490
*/
169435
-SQLITE_API int SQLITE_STDCALL sqlite3rbu_create_vfs(const char *zName, const char *zParent){
169491
+SQLITE_API int SQLITE_APICALL sqlite3rbu_create_vfs(const char *zName, const char *zParent){
169436169492
169437169493
/* Template for VFS */
169438169494
static sqlite3_vfs vfs_template = {
169439169495
1, /* iVersion */
169440169496
0, /* szOsFile */
@@ -171675,11 +171731,11 @@
171675171731
}
171676171732
171677171733
return rc;
171678171734
}
171679171735
171680
-SQLITE_API int SQLITE_STDCALL sqlite3session_diff(
171736
+SQLITE_API int SQLITE_APICALL sqlite3session_diff(
171681171737
sqlite3_session *pSession,
171682171738
const char *zFrom,
171683171739
const char *zTbl,
171684171740
char **pzErrMsg
171685171741
){
@@ -171769,11 +171825,11 @@
171769171825
171770171826
/*
171771171827
** Create a session object. This session object will record changes to
171772171828
** database zDb attached to connection db.
171773171829
*/
171774
-SQLITE_API int SQLITE_STDCALL sqlite3session_create(
171830
+SQLITE_API int SQLITE_APICALL sqlite3session_create(
171775171831
sqlite3 *db, /* Database handle */
171776171832
const char *zDb, /* Name of db (e.g. "main") */
171777171833
sqlite3_session **ppSession /* OUT: New session object */
171778171834
){
171779171835
sqlite3_session *pNew; /* Newly allocated session object */
@@ -171831,11 +171887,11 @@
171831171887
}
171832171888
171833171889
/*
171834171890
** Delete a session object previously allocated using sqlite3session_create().
171835171891
*/
171836
-SQLITE_API void SQLITE_STDCALL sqlite3session_delete(sqlite3_session *pSession){
171892
+SQLITE_API void SQLITE_APICALL sqlite3session_delete(sqlite3_session *pSession){
171837171893
sqlite3 *db = pSession->db;
171838171894
sqlite3_session *pHead;
171839171895
sqlite3_session **pp;
171840171896
171841171897
/* Unlink the session from the linked list of sessions attached to the
@@ -171860,11 +171916,11 @@
171860171916
}
171861171917
171862171918
/*
171863171919
** Set a table filter on a Session Object.
171864171920
*/
171865
-SQLITE_API void SQLITE_STDCALL sqlite3session_table_filter(
171921
+SQLITE_API void SQLITE_APICALL sqlite3session_table_filter(
171866171922
sqlite3_session *pSession,
171867171923
int(*xFilter)(void*, const char*),
171868171924
void *pCtx /* First argument passed to xFilter */
171869171925
){
171870171926
pSession->bAutoAttach = 1;
@@ -171878,11 +171934,11 @@
171878171934
**
171879171935
** Only tables that have a PRIMARY KEY defined may be attached. It does
171880171936
** not matter if the PRIMARY KEY is an "INTEGER PRIMARY KEY" (rowid alias)
171881171937
** or not.
171882171938
*/
171883
-SQLITE_API int SQLITE_STDCALL sqlite3session_attach(
171939
+SQLITE_API int SQLITE_APICALL sqlite3session_attach(
171884171940
sqlite3_session *pSession, /* Session object */
171885171941
const char *zName /* Table name */
171886171942
){
171887171943
int rc = SQLITE_OK;
171888171944
sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
@@ -172568,11 +172624,11 @@
172568172624
** session object passed as the first argument.
172569172625
**
172570172626
** It is the responsibility of the caller to eventually free the buffer
172571172627
** using sqlite3_free().
172572172628
*/
172573
-SQLITE_API int SQLITE_STDCALL sqlite3session_changeset(
172629
+SQLITE_API int SQLITE_APICALL sqlite3session_changeset(
172574172630
sqlite3_session *pSession, /* Session object */
172575172631
int *pnChangeset, /* OUT: Size of buffer at *ppChangeset */
172576172632
void **ppChangeset /* OUT: Buffer containing changeset */
172577172633
){
172578172634
return sessionGenerateChangeset(pSession, 0, 0, 0, pnChangeset, ppChangeset);
@@ -172579,11 +172635,11 @@
172579172635
}
172580172636
172581172637
/*
172582172638
** Streaming version of sqlite3session_changeset().
172583172639
*/
172584
-SQLITE_API int SQLITE_STDCALL sqlite3session_changeset_strm(
172640
+SQLITE_API int SQLITE_APICALL sqlite3session_changeset_strm(
172585172641
sqlite3_session *pSession,
172586172642
int (*xOutput)(void *pOut, const void *pData, int nData),
172587172643
void *pOut
172588172644
){
172589172645
return sessionGenerateChangeset(pSession, 0, xOutput, pOut, 0, 0);
@@ -172590,11 +172646,11 @@
172590172646
}
172591172647
172592172648
/*
172593172649
** Streaming version of sqlite3session_patchset().
172594172650
*/
172595
-SQLITE_API int SQLITE_STDCALL sqlite3session_patchset_strm(
172651
+SQLITE_API int SQLITE_APICALL sqlite3session_patchset_strm(
172596172652
sqlite3_session *pSession,
172597172653
int (*xOutput)(void *pOut, const void *pData, int nData),
172598172654
void *pOut
172599172655
){
172600172656
return sessionGenerateChangeset(pSession, 1, xOutput, pOut, 0, 0);
@@ -172605,11 +172661,11 @@
172605172661
** session object passed as the first argument.
172606172662
**
172607172663
** It is the responsibility of the caller to eventually free the buffer
172608172664
** using sqlite3_free().
172609172665
*/
172610
-SQLITE_API int SQLITE_STDCALL sqlite3session_patchset(
172666
+SQLITE_API int SQLITE_APICALL sqlite3session_patchset(
172611172667
sqlite3_session *pSession, /* Session object */
172612172668
int *pnPatchset, /* OUT: Size of buffer at *ppChangeset */
172613172669
void **ppPatchset /* OUT: Buffer containing changeset */
172614172670
){
172615172671
return sessionGenerateChangeset(pSession, 1, 0, 0, pnPatchset, ppPatchset);
@@ -172616,11 +172672,11 @@
172616172672
}
172617172673
172618172674
/*
172619172675
** Enable or disable the session object passed as the first argument.
172620172676
*/
172621
-SQLITE_API int SQLITE_STDCALL sqlite3session_enable(sqlite3_session *pSession, int bEnable){
172677
+SQLITE_API int SQLITE_APICALL sqlite3session_enable(sqlite3_session *pSession, int bEnable){
172622172678
int ret;
172623172679
sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172624172680
if( bEnable>=0 ){
172625172681
pSession->bEnable = bEnable;
172626172682
}
@@ -172630,11 +172686,11 @@
172630172686
}
172631172687
172632172688
/*
172633172689
** Enable or disable the session object passed as the first argument.
172634172690
*/
172635
-SQLITE_API int SQLITE_STDCALL sqlite3session_indirect(sqlite3_session *pSession, int bIndirect){
172691
+SQLITE_API int SQLITE_APICALL sqlite3session_indirect(sqlite3_session *pSession, int bIndirect){
172636172692
int ret;
172637172693
sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172638172694
if( bIndirect>=0 ){
172639172695
pSession->bIndirect = bIndirect;
172640172696
}
@@ -172645,11 +172701,11 @@
172645172701
172646172702
/*
172647172703
** Return true if there have been no changes to monitored tables recorded
172648172704
** by the session object passed as the only argument.
172649172705
*/
172650
-SQLITE_API int SQLITE_STDCALL sqlite3session_isempty(sqlite3_session *pSession){
172706
+SQLITE_API int SQLITE_APICALL sqlite3session_isempty(sqlite3_session *pSession){
172651172707
int ret = 0;
172652172708
SessionTable *pTab;
172653172709
172654172710
sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172655172711
for(pTab=pSession->pTable; pTab && ret==0; pTab=pTab->pNext){
@@ -172695,11 +172751,11 @@
172695172751
}
172696172752
172697172753
/*
172698172754
** Create an iterator used to iterate through the contents of a changeset.
172699172755
*/
172700
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_start(
172756
+SQLITE_API int SQLITE_APICALL sqlite3changeset_start(
172701172757
sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
172702172758
int nChangeset, /* Size of buffer pChangeset in bytes */
172703172759
void *pChangeset /* Pointer to buffer containing changeset */
172704172760
){
172705172761
return sessionChangesetStart(pp, 0, 0, nChangeset, pChangeset);
@@ -172706,11 +172762,11 @@
172706172762
}
172707172763
172708172764
/*
172709172765
** Streaming version of sqlite3changeset_start().
172710172766
*/
172711
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_start_strm(
172767
+SQLITE_API int SQLITE_APICALL sqlite3changeset_start_strm(
172712172768
sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
172713172769
int (*xInput)(void *pIn, void *pData, int *pnData),
172714172770
void *pIn
172715172771
){
172716172772
return sessionChangesetStart(pp, xInput, pIn, 0, 0);
@@ -173127,20 +173183,20 @@
173127173183
** or SQLITE_CORRUPT.
173128173184
**
173129173185
** This function may not be called on iterators passed to a conflict handler
173130173186
** callback by changeset_apply().
173131173187
*/
173132
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_next(sqlite3_changeset_iter *p){
173188
+SQLITE_API int SQLITE_APICALL sqlite3changeset_next(sqlite3_changeset_iter *p){
173133173189
return sessionChangesetNext(p, 0, 0);
173134173190
}
173135173191
173136173192
/*
173137173193
** The following function extracts information on the current change
173138173194
** from a changeset iterator. It may only be called after changeset_next()
173139173195
** has returned SQLITE_ROW.
173140173196
*/
173141
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_op(
173197
+SQLITE_API int SQLITE_APICALL sqlite3changeset_op(
173142173198
sqlite3_changeset_iter *pIter, /* Iterator handle */
173143173199
const char **pzTab, /* OUT: Pointer to table name */
173144173200
int *pnCol, /* OUT: Number of columns in table */
173145173201
int *pOp, /* OUT: SQLITE_INSERT, DELETE or UPDATE */
173146173202
int *pbIndirect /* OUT: True if change is indirect */
@@ -173156,11 +173212,11 @@
173156173212
** Return information regarding the PRIMARY KEY and number of columns in
173157173213
** the database table affected by the change that pIter currently points
173158173214
** to. This function may only be called after changeset_next() returns
173159173215
** SQLITE_ROW.
173160173216
*/
173161
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_pk(
173217
+SQLITE_API int SQLITE_APICALL sqlite3changeset_pk(
173162173218
sqlite3_changeset_iter *pIter, /* Iterator object */
173163173219
unsigned char **pabPK, /* OUT: Array of boolean - true for PK cols */
173164173220
int *pnCol /* OUT: Number of entries in output array */
173165173221
){
173166173222
*pabPK = pIter->abPK;
@@ -173179,11 +173235,11 @@
173179173235
** was not modified and is not a PK column), set *ppValue to NULL.
173180173236
**
173181173237
** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is
173182173238
** not modified. Otherwise, SQLITE_OK.
173183173239
*/
173184
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_old(
173240
+SQLITE_API int SQLITE_APICALL sqlite3changeset_old(
173185173241
sqlite3_changeset_iter *pIter, /* Changeset iterator */
173186173242
int iVal, /* Index of old.* value to retrieve */
173187173243
sqlite3_value **ppValue /* OUT: Old value (or NULL pointer) */
173188173244
){
173189173245
if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_DELETE ){
@@ -173207,11 +173263,11 @@
173207173263
** was not modified), set *ppValue to NULL.
173208173264
**
173209173265
** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is
173210173266
** not modified. Otherwise, SQLITE_OK.
173211173267
*/
173212
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_new(
173268
+SQLITE_API int SQLITE_APICALL sqlite3changeset_new(
173213173269
sqlite3_changeset_iter *pIter, /* Changeset iterator */
173214173270
int iVal, /* Index of new.* value to retrieve */
173215173271
sqlite3_value **ppValue /* OUT: New value (or NULL pointer) */
173216173272
){
173217173273
if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_INSERT ){
@@ -173241,11 +173297,11 @@
173241173297
** containing the iVal'th value of the conflicting record.
173242173298
**
173243173299
** If value iVal is out-of-range or some other error occurs, an SQLite error
173244173300
** code is returned. Otherwise, SQLITE_OK.
173245173301
*/
173246
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_conflict(
173302
+SQLITE_API int SQLITE_APICALL sqlite3changeset_conflict(
173247173303
sqlite3_changeset_iter *pIter, /* Changeset iterator */
173248173304
int iVal, /* Index of conflict record value to fetch */
173249173305
sqlite3_value **ppValue /* OUT: Value from conflicting row */
173250173306
){
173251173307
if( !pIter->pConflict ){
@@ -173264,11 +173320,11 @@
173264173320
** it sets the output variable to the total number of known foreign key
173265173321
** violations in the destination database and returns SQLITE_OK.
173266173322
**
173267173323
** In all other cases this function returns SQLITE_MISUSE.
173268173324
*/
173269
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_fk_conflicts(
173325
+SQLITE_API int SQLITE_APICALL sqlite3changeset_fk_conflicts(
173270173326
sqlite3_changeset_iter *pIter, /* Changeset iterator */
173271173327
int *pnOut /* OUT: Number of FK violations */
173272173328
){
173273173329
if( pIter->pConflict || pIter->apValue ){
173274173330
return SQLITE_MISUSE;
@@ -173282,11 +173338,11 @@
173282173338
** Finalize an iterator allocated with sqlite3changeset_start().
173283173339
**
173284173340
** This function may not be called on iterators passed to a conflict handler
173285173341
** callback by changeset_apply().
173286173342
*/
173287
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_finalize(sqlite3_changeset_iter *p){
173343
+SQLITE_API int SQLITE_APICALL sqlite3changeset_finalize(sqlite3_changeset_iter *p){
173288173344
int rc = SQLITE_OK;
173289173345
if( p ){
173290173346
int i; /* Used to iterate through p->apValue[] */
173291173347
rc = p->rc;
173292173348
if( p->apValue ){
@@ -173456,11 +173512,11 @@
173456173512
173457173513
173458173514
/*
173459173515
** Invert a changeset object.
173460173516
*/
173461
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_invert(
173517
+SQLITE_API int SQLITE_APICALL sqlite3changeset_invert(
173462173518
int nChangeset, /* Number of bytes in input */
173463173519
const void *pChangeset, /* Input changeset */
173464173520
int *pnInverted, /* OUT: Number of bytes in output changeset */
173465173521
void **ppInverted /* OUT: Inverse of pChangeset */
173466173522
){
@@ -173475,11 +173531,11 @@
173475173531
}
173476173532
173477173533
/*
173478173534
** Streaming version of sqlite3changeset_invert().
173479173535
*/
173480
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_invert_strm(
173536
+SQLITE_API int SQLITE_APICALL sqlite3changeset_invert_strm(
173481173537
int (*xInput)(void *pIn, void *pData, int *pnData),
173482173538
void *pIn,
173483173539
int (*xOutput)(void *pOut, const void *pData, int nData),
173484173540
void *pOut
173485173541
){
@@ -174355,11 +174411,11 @@
174355174411
/*
174356174412
** Apply the changeset passed via pChangeset/nChangeset to the main database
174357174413
** attached to handle "db". Invoke the supplied conflict handler callback
174358174414
** to resolve any conflicts encountered while applying the change.
174359174415
*/
174360
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_apply(
174416
+SQLITE_API int SQLITE_APICALL sqlite3changeset_apply(
174361174417
sqlite3 *db, /* Apply change to "main" db of this handle */
174362174418
int nChangeset, /* Size of changeset in bytes */
174363174419
void *pChangeset, /* Changeset blob */
174364174420
int(*xFilter)(
174365174421
void *pCtx, /* Copy of sixth arg to _apply() */
@@ -174383,11 +174439,11 @@
174383174439
/*
174384174440
** Apply the changeset passed via xInput/pIn to the main database
174385174441
** attached to handle "db". Invoke the supplied conflict handler callback
174386174442
** to resolve any conflicts encountered while applying the change.
174387174443
*/
174388
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_apply_strm(
174444
+SQLITE_API int SQLITE_APICALL sqlite3changeset_apply_strm(
174389174445
sqlite3 *db, /* Apply change to "main" db of this handle */
174390174446
int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
174391174447
void *pIn, /* First arg for xInput */
174392174448
int(*xFilter)(
174393174449
void *pCtx, /* Copy of sixth arg to _apply() */
@@ -174718,11 +174774,11 @@
174718174774
}
174719174775
174720174776
/*
174721174777
** Allocate a new, empty, sqlite3_changegroup.
174722174778
*/
174723
-SQLITE_API int SQLITE_STDCALL sqlite3changegroup_new(sqlite3_changegroup **pp){
174779
+SQLITE_API int SQLITE_APICALL sqlite3changegroup_new(sqlite3_changegroup **pp){
174724174780
int rc = SQLITE_OK; /* Return code */
174725174781
sqlite3_changegroup *p; /* New object */
174726174782
p = (sqlite3_changegroup*)sqlite3_malloc(sizeof(sqlite3_changegroup));
174727174783
if( p==0 ){
174728174784
rc = SQLITE_NOMEM;
@@ -174735,11 +174791,11 @@
174735174791
174736174792
/*
174737174793
** Add the changeset currently stored in buffer pData, size nData bytes,
174738174794
** to changeset-group p.
174739174795
*/
174740
-SQLITE_API int SQLITE_STDCALL sqlite3changegroup_add(sqlite3_changegroup *pGrp, int nData, void *pData){
174796
+SQLITE_API int SQLITE_APICALL sqlite3changegroup_add(sqlite3_changegroup *pGrp, int nData, void *pData){
174741174797
sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */
174742174798
int rc; /* Return code */
174743174799
174744174800
rc = sqlite3changeset_start(&pIter, nData, pData);
174745174801
if( rc==SQLITE_OK ){
@@ -174751,11 +174807,11 @@
174751174807
174752174808
/*
174753174809
** Obtain a buffer containing a changeset representing the concatenation
174754174810
** of all changesets added to the group so far.
174755174811
*/
174756
-SQLITE_API int SQLITE_STDCALL sqlite3changegroup_output(
174812
+SQLITE_API int SQLITE_APICALL sqlite3changegroup_output(
174757174813
sqlite3_changegroup *pGrp,
174758174814
int *pnData,
174759174815
void **ppData
174760174816
){
174761174817
return sessionChangegroupOutput(pGrp, 0, 0, pnData, ppData);
@@ -174762,11 +174818,11 @@
174762174818
}
174763174819
174764174820
/*
174765174821
** Streaming versions of changegroup_add().
174766174822
*/
174767
-SQLITE_API int SQLITE_STDCALL sqlite3changegroup_add_strm(
174823
+SQLITE_API int SQLITE_APICALL sqlite3changegroup_add_strm(
174768174824
sqlite3_changegroup *pGrp,
174769174825
int (*xInput)(void *pIn, void *pData, int *pnData),
174770174826
void *pIn
174771174827
){
174772174828
sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */
@@ -174781,11 +174837,11 @@
174781174837
}
174782174838
174783174839
/*
174784174840
** Streaming versions of changegroup_output().
174785174841
*/
174786
-SQLITE_API int SQLITE_STDCALL sqlite3changegroup_output_strm(
174842
+SQLITE_API int SQLITE_APICALL sqlite3changegroup_output_strm(
174787174843
sqlite3_changegroup *pGrp,
174788174844
int (*xOutput)(void *pOut, const void *pData, int nData),
174789174845
void *pOut
174790174846
){
174791174847
return sessionChangegroupOutput(pGrp, xOutput, pOut, 0, 0);
@@ -174792,21 +174848,21 @@
174792174848
}
174793174849
174794174850
/*
174795174851
** Delete a changegroup object.
174796174852
*/
174797
-SQLITE_API void SQLITE_STDCALL sqlite3changegroup_delete(sqlite3_changegroup *pGrp){
174853
+SQLITE_API void SQLITE_APICALL sqlite3changegroup_delete(sqlite3_changegroup *pGrp){
174798174854
if( pGrp ){
174799174855
sessionDeleteTable(pGrp->pList);
174800174856
sqlite3_free(pGrp);
174801174857
}
174802174858
}
174803174859
174804174860
/*
174805174861
** Combine two changesets together.
174806174862
*/
174807
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_concat(
174863
+SQLITE_API int SQLITE_APICALL sqlite3changeset_concat(
174808174864
int nLeft, /* Number of bytes in lhs input */
174809174865
void *pLeft, /* Lhs input changeset */
174810174866
int nRight /* Number of bytes in rhs input */,
174811174867
void *pRight, /* Rhs input changeset */
174812174868
int *pnOut, /* OUT: Number of bytes in output changeset */
@@ -174831,11 +174887,11 @@
174831174887
}
174832174888
174833174889
/*
174834174890
** Streaming version of sqlite3changeset_concat().
174835174891
*/
174836
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_concat_strm(
174892
+SQLITE_API int SQLITE_APICALL sqlite3changeset_concat_strm(
174837174893
int (*xInputA)(void *pIn, void *pData, int *pnData),
174838174894
void *pInA,
174839174895
int (*xInputB)(void *pIn, void *pData, int *pnData),
174840174896
void *pInB,
174841174897
int (*xOutput)(void *pOut, const void *pData, int nData),
@@ -177062,11 +177118,11 @@
177062177118
177063177119
#ifndef SQLITE_CORE
177064177120
#ifdef _WIN32
177065177121
__declspec(dllexport)
177066177122
#endif
177067
-SQLITE_API int SQLITE_STDCALL sqlite3_json_init(
177123
+SQLITE_API int SQLITE_APICALL sqlite3_json_init(
177068177124
sqlite3 *db,
177069177125
char **pzErrMsg,
177070177126
const sqlite3_api_routines *pApi
177071177127
){
177072177128
SQLITE_EXTENSION_INIT2(pApi);
@@ -193895,11 +193951,11 @@
193895193951
int nArg, /* Number of args */
193896193952
sqlite3_value **apUnused /* Function arguments */
193897193953
){
193898193954
assert( nArg==0 );
193899193955
UNUSED_PARAM2(nArg, apUnused);
193900
- sqlite3_result_text(pCtx, "fts5: 2016-07-26 10:46:21 483994a54dee3c7a3801e0e9d3c96fa9dbd8d2fd", -1, SQLITE_TRANSIENT);
193956
+ sqlite3_result_text(pCtx, "fts5: 2016-07-29 04:12:18 544c990afd3b64064cc4d970ec5d7eb23eeb9914", -1, SQLITE_TRANSIENT);
193901193957
}
193902193958
193903193959
static int fts5Init(sqlite3 *db){
193904193960
static const sqlite3_module fts5Mod = {
193905193961
/* iVersion */ 2,
@@ -193983,11 +194039,11 @@
193983194039
*/
193984194040
#ifndef SQLITE_CORE
193985194041
#ifdef _WIN32
193986194042
__declspec(dllexport)
193987194043
#endif
193988
-SQLITE_API int SQLITE_STDCALL sqlite3_fts_init(
194044
+SQLITE_API int SQLITE_APICALL sqlite3_fts_init(
193989194045
sqlite3 *db,
193990194046
char **pzErrMsg,
193991194047
const sqlite3_api_routines *pApi
193992194048
){
193993194049
SQLITE_EXTENSION_INIT2(pApi);
@@ -193996,11 +194052,11 @@
193996194052
}
193997194053
193998194054
#ifdef _WIN32
193999194055
__declspec(dllexport)
194000194056
#endif
194001
-SQLITE_API int SQLITE_STDCALL sqlite3_fts5_init(
194057
+SQLITE_API int SQLITE_APICALL sqlite3_fts5_init(
194002194058
sqlite3 *db,
194003194059
char **pzErrMsg,
194004194060
const sqlite3_api_routines *pApi
194005194061
){
194006194062
SQLITE_EXTENSION_INIT2(pApi);
194007194063
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -65,10 +65,18 @@
65 ** In all cases, the special comment must be enclosed in the usual
66 ** slash-asterisk...asterisk-slash comment marks, with no spaces between the
67 ** asterisks and the comment text.
68 */
69
 
 
 
 
 
 
 
 
70 /*
71 ** Make sure that rand_s() is available on Windows systems with MSVC 2005
72 ** or higher.
73 */
74 #if defined(_MSC_VER) && _MSC_VER>=1400
@@ -304,12 +312,21 @@
304 # define SQLITE_API
305 #endif
306 #ifndef SQLITE_CDECL
307 # define SQLITE_CDECL
308 #endif
 
 
 
309 #ifndef SQLITE_STDCALL
310 # define SQLITE_STDCALL
 
 
 
 
 
 
311 #endif
312
313 /*
314 ** These no-op macros are used in front of interfaces to mark those
315 ** interfaces as either deprecated or experimental. New applications
@@ -363,11 +380,11 @@
363 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
364 ** [sqlite_version()] and [sqlite_source_id()].
365 */
366 #define SQLITE_VERSION "3.14.0"
367 #define SQLITE_VERSION_NUMBER 3014000
368 #define SQLITE_SOURCE_ID "2016-07-28 12:52:30 6feff15cae8f0427be790355841d49c479c1c586"
369
370 /*
371 ** CAPI3REF: Run-Time Library Version Numbers
372 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
373 **
@@ -396,13 +413,13 @@
396 ** [SQLITE_SOURCE_ID] C preprocessor macro.
397 **
398 ** See also: [sqlite_version()] and [sqlite_source_id()].
399 */
400 SQLITE_API const char sqlite3_version[] = SQLITE_VERSION;
401 SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void);
402 SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void);
403 SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void);
404
405 /*
406 ** CAPI3REF: Run-Time Library Compilation Options Diagnostics
407 **
408 ** ^The sqlite3_compileoption_used() function returns 0 or 1
@@ -423,12 +440,12 @@
423 **
424 ** See also: SQL functions [sqlite_compileoption_used()] and
425 ** [sqlite_compileoption_get()] and the [compile_options pragma].
426 */
427 #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
428 SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName);
429 SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N);
430 #endif
431
432 /*
433 ** CAPI3REF: Test To See If The Library Is Threadsafe
434 **
@@ -463,11 +480,11 @@
463 ** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
464 ** is unchanged by calls to sqlite3_config().)^
465 **
466 ** See the [threading mode] documentation for additional information.
467 */
468 SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void);
469
470 /*
471 ** CAPI3REF: Database Connection Handle
472 ** KEYWORDS: {database connection} {database connections}
473 **
@@ -560,19 +577,19 @@
560 ** from [sqlite3_open()], [sqlite3_open16()], or
561 ** [sqlite3_open_v2()], and not previously closed.
562 ** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
563 ** argument is a harmless no-op.
564 */
565 SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3*);
566 SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3*);
567
568 /*
569 ** The type for a callback function.
570 ** This is legacy and deprecated. It is included for historical
571 ** compatibility and is not documented.
572 */
573 typedef int (*sqlite3_callback)(void*,int,char**, char**);
574
575 /*
576 ** CAPI3REF: One-Step Query Execution Interface
577 ** METHOD: sqlite3
578 **
@@ -632,14 +649,14 @@
632 ** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
633 ** <li> The application must not modify the SQL statement text passed into
634 ** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
635 ** </ul>
636 */
637 SQLITE_API int SQLITE_STDCALL sqlite3_exec(
638 sqlite3*, /* An open database */
639 const char *sql, /* SQL to be evaluated */
640 int (*callback)(void*,int,char**,char**), /* Callback function */
641 void *, /* 1st argument to callback */
642 char **errmsg /* Error msg written here */
643 );
644
645 /*
@@ -983,30 +1000,30 @@
983 ** database corruption.
984 */
985 typedef struct sqlite3_io_methods sqlite3_io_methods;
986 struct sqlite3_io_methods {
987 int iVersion;
988 int (*xClose)(sqlite3_file*);
989 int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
990 int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
991 int (*xTruncate)(sqlite3_file*, sqlite3_int64 size);
992 int (*xSync)(sqlite3_file*, int flags);
993 int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
994 int (*xLock)(sqlite3_file*, int);
995 int (*xUnlock)(sqlite3_file*, int);
996 int (*xCheckReservedLock)(sqlite3_file*, int *pResOut);
997 int (*xFileControl)(sqlite3_file*, int op, void *pArg);
998 int (*xSectorSize)(sqlite3_file*);
999 int (*xDeviceCharacteristics)(sqlite3_file*);
1000 /* Methods above are valid for version 1 */
1001 int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
1002 int (*xShmLock)(sqlite3_file*, int offset, int n, int flags);
1003 void (*xShmBarrier)(sqlite3_file*);
1004 int (*xShmUnmap)(sqlite3_file*, int deleteFlag);
1005 /* Methods above are valid for version 2 */
1006 int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
1007 int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p);
1008 /* Methods above are valid for version 3 */
1009 /* Additional methods may be added in future releases */
1010 };
1011
1012 /*
@@ -1178,11 +1195,11 @@
1178 ** ^The [SQLITE_FCNTL_BUSYHANDLER]
1179 ** file-control may be invoked by SQLite on the database file handle
1180 ** shortly after it is opened in order to provide a custom VFS with access
1181 ** to the connections busy-handler callback. The argument is of type (void **)
1182 ** - an array of two (void *) values. The first (void *) actually points
1183 ** to a function of type (int (*)(void *)). In order to invoke the connections
1184 ** busy-handler, this function should be invoked with the second (void *) in
1185 ** the array as the only argument. If it returns non-zero, then the operation
1186 ** should be retried. If it returns zero, the custom VFS should abandon the
1187 ** current operation.
1188 **
@@ -1444,43 +1461,43 @@
1444 ** or all of these interfaces to be NULL or for their behavior to change
1445 ** from one release to the next. Applications must not attempt to access
1446 ** any of these methods if the iVersion of the VFS is less than 3.
1447 */
1448 typedef struct sqlite3_vfs sqlite3_vfs;
1449 typedef void (*sqlite3_syscall_ptr)(void);
1450 struct sqlite3_vfs {
1451 int iVersion; /* Structure version number (currently 3) */
1452 int szOsFile; /* Size of subclassed sqlite3_file */
1453 int mxPathname; /* Maximum file pathname length */
1454 sqlite3_vfs *pNext; /* Next registered VFS */
1455 const char *zName; /* Name of this virtual file system */
1456 void *pAppData; /* Pointer to application-specific data */
1457 int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
1458 int flags, int *pOutFlags);
1459 int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
1460 int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
1461 int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
1462 void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename);
1463 void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
1464 void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
1465 void (*xDlClose)(sqlite3_vfs*, void*);
1466 int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
1467 int (*xSleep)(sqlite3_vfs*, int microseconds);
1468 int (*xCurrentTime)(sqlite3_vfs*, double*);
1469 int (*xGetLastError)(sqlite3_vfs*, int, char *);
1470 /*
1471 ** The methods above are in version 1 of the sqlite_vfs object
1472 ** definition. Those that follow are added in version 2 or later
1473 */
1474 int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
1475 /*
1476 ** The methods above are in versions 1 and 2 of the sqlite_vfs object.
1477 ** Those below are for version 3 and greater.
1478 */
1479 int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
1480 sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName);
1481 const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName);
1482 /*
1483 ** The methods above are in versions 1 through 3 of the sqlite_vfs object.
1484 ** New fields may be appended in future versions. The iVersion
1485 ** value will increment whenever this happens.
1486 */
@@ -1621,14 +1638,14 @@
1621 ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied
1622 ** implementation of sqlite3_os_init() or sqlite3_os_end()
1623 ** must return [SQLITE_OK] on success and some other [error code] upon
1624 ** failure.
1625 */
1626 SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void);
1627 SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void);
1628 SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void);
1629 SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void);
1630
1631 /*
1632 ** CAPI3REF: Configuring The SQLite Library
1633 **
1634 ** The sqlite3_config() interface is used to make global configuration
@@ -1743,17 +1760,17 @@
1743 ** SQLite will never invoke xInit() more than once without an intervening
1744 ** call to xShutdown().
1745 */
1746 typedef struct sqlite3_mem_methods sqlite3_mem_methods;
1747 struct sqlite3_mem_methods {
1748 void *(*xMalloc)(int); /* Memory allocation function */
1749 void (*xFree)(void*); /* Free a prior allocation */
1750 void *(*xRealloc)(void*,int); /* Resize an allocation */
1751 int (*xSize)(void*); /* Return the size of an allocation */
1752 int (*xRoundup)(int); /* Round up request size to allocation size */
1753 int (*xInit)(void*); /* Initialize the memory allocator */
1754 void (*xShutdown)(void*); /* Deinitialize the memory allocator */
1755 void *pAppData; /* Argument to xInit() and xShutdown() */
1756 };
1757
1758 /*
1759 ** CAPI3REF: Configuration Options
@@ -1966,11 +1983,11 @@
1966 **
1967 ** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
1968 ** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
1969 ** global [error log].
1970 ** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a
1971 ** function with a call signature of void(*)(void*,int,const char*),
1972 ** and a pointer to void. ^If the function pointer is not NULL, it is
1973 ** invoked by [sqlite3_log()] to process each logging event. ^If the
1974 ** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op.
1975 ** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is
1976 ** passed through as the first parameter to the application-defined logger
@@ -2019,11 +2036,11 @@
2019 **
2020 ** [[SQLITE_CONFIG_SQLLOG]]
2021 ** <dt>SQLITE_CONFIG_SQLLOG
2022 ** <dd>This option is only available if sqlite is compiled with the
2023 ** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should
2024 ** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int).
2025 ** The second should be of type (void*). The callback is invoked by the library
2026 ** in three separate circumstances, identified by the value passed as the
2027 ** fourth parameter. If the fourth parameter is 0, then the database connection
2028 ** passed as the second argument has just been opened. The third argument
2029 ** points to a buffer containing the name of the main database file. If the
@@ -2217,11 +2234,11 @@
2217 **
2218 ** ^The sqlite3_extended_result_codes() routine enables or disables the
2219 ** [extended result codes] feature of SQLite. ^The extended result
2220 ** codes are disabled by default for historical compatibility.
2221 */
2222 SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3*, int onoff);
2223
2224 /*
2225 ** CAPI3REF: Last Insert Rowid
2226 ** METHOD: sqlite3
2227 **
@@ -2269,11 +2286,11 @@
2269 ** function is running and thus changes the last insert [rowid],
2270 ** then the value returned by [sqlite3_last_insert_rowid()] is
2271 ** unpredictable and might not equal either the old or the new
2272 ** last insert [rowid].
2273 */
2274 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3*);
2275
2276 /*
2277 ** CAPI3REF: Count The Number Of Rows Modified
2278 ** METHOD: sqlite3
2279 **
@@ -2322,11 +2339,11 @@
2322 **
2323 ** If a separate thread makes changes on the same database connection
2324 ** while [sqlite3_changes()] is running then the value returned
2325 ** is unpredictable and not meaningful.
2326 */
2327 SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3*);
2328
2329 /*
2330 ** CAPI3REF: Total Number Of Rows Modified
2331 ** METHOD: sqlite3
2332 **
@@ -2346,11 +2363,11 @@
2346 **
2347 ** If a separate thread makes changes on the same database connection
2348 ** while [sqlite3_total_changes()] is running then the value
2349 ** returned is unpredictable and not meaningful.
2350 */
2351 SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3*);
2352
2353 /*
2354 ** CAPI3REF: Interrupt A Long-Running Query
2355 ** METHOD: sqlite3
2356 **
@@ -2386,11 +2403,11 @@
2386 ** that are started after the sqlite3_interrupt() call returns.
2387 **
2388 ** If the database connection closes while [sqlite3_interrupt()]
2389 ** is running then bad things will likely happen.
2390 */
2391 SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3*);
2392
2393 /*
2394 ** CAPI3REF: Determine If An SQL Statement Is Complete
2395 **
2396 ** These routines are useful during command-line input to determine if the
@@ -2421,12 +2438,12 @@
2421 ** UTF-8 string.
2422 **
2423 ** The input to [sqlite3_complete16()] must be a zero-terminated
2424 ** UTF-16 string in native byte order.
2425 */
2426 SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *sql);
2427 SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *sql);
2428
2429 /*
2430 ** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
2431 ** KEYWORDS: {busy-handler callback} {busy handler}
2432 ** METHOD: sqlite3
@@ -2483,11 +2500,11 @@
2483 ** result in undefined behavior.
2484 **
2485 ** A busy handler must not close the database connection
2486 ** or [prepared statement] that invoked the busy handler.
2487 */
2488 SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*);
2489
2490 /*
2491 ** CAPI3REF: Set A Busy Timeout
2492 ** METHOD: sqlite3
2493 **
@@ -2506,11 +2523,11 @@
2506 ** was defined (using [sqlite3_busy_handler()]) prior to calling
2507 ** this routine, that other busy handler is cleared.)^
2508 **
2509 ** See also: [PRAGMA busy_timeout]
2510 */
2511 SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3*, int ms);
2512
2513 /*
2514 ** CAPI3REF: Convenience Routines For Running Queries
2515 ** METHOD: sqlite3
2516 **
@@ -2581,19 +2598,19 @@
2581 ** interface defined here. As a consequence, errors that occur in the
2582 ** wrapper layer outside of the internal [sqlite3_exec()] call are not
2583 ** reflected in subsequent calls to [sqlite3_errcode()] or
2584 ** [sqlite3_errmsg()].
2585 */
2586 SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
2587 sqlite3 *db, /* An open database */
2588 const char *zSql, /* SQL to be evaluated */
2589 char ***pazResult, /* Results of the query */
2590 int *pnRow, /* Number of result rows written here */
2591 int *pnColumn, /* Number of result columns written here */
2592 char **pzErrmsg /* Error msg written here */
2593 );
2594 SQLITE_API void SQLITE_STDCALL sqlite3_free_table(char **result);
2595
2596 /*
2597 ** CAPI3REF: Formatted String Printing Functions
2598 **
2599 ** These routines are work-alikes of the "printf()" family of functions
@@ -2696,13 +2713,13 @@
2696 ** ^(The "%z" formatting option works like "%s" but with the
2697 ** addition that after the string has been read and copied into
2698 ** the result, [sqlite3_free()] is called on the input string.)^
2699 */
2700 SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...);
2701 SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list);
2702 SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...);
2703 SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list);
2704
2705 /*
2706 ** CAPI3REF: Memory Allocation Subsystem
2707 **
2708 ** The SQLite core uses these three routines for all of its own
@@ -2788,16 +2805,16 @@
2788 **
2789 ** The application must not read or write any part of
2790 ** a block of memory after it has been released using
2791 ** [sqlite3_free()] or [sqlite3_realloc()].
2792 */
2793 SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int);
2794 SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64);
2795 SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void*, int);
2796 SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void*, sqlite3_uint64);
2797 SQLITE_API void SQLITE_STDCALL sqlite3_free(void*);
2798 SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void*);
2799
2800 /*
2801 ** CAPI3REF: Memory Allocator Statistics
2802 **
2803 ** SQLite provides these two interfaces for reporting on the status
@@ -2818,12 +2835,12 @@
2818 ** [sqlite3_memory_used()] if and only if the parameter to
2819 ** [sqlite3_memory_highwater()] is true. ^The value returned
2820 ** by [sqlite3_memory_highwater(1)] is the high-water mark
2821 ** prior to the reset.
2822 */
2823 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void);
2824 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag);
2825
2826 /*
2827 ** CAPI3REF: Pseudo-Random Number Generator
2828 **
2829 ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
@@ -2842,11 +2859,11 @@
2842 ** ^If the previous call to this routine had an N of 1 or more and a
2843 ** non-NULL P then the pseudo-randomness is generated
2844 ** internally and without recourse to the [sqlite3_vfs] xRandomness
2845 ** method.
2846 */
2847 SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *P);
2848
2849 /*
2850 ** CAPI3REF: Compile-Time Authorization Callbacks
2851 ** METHOD: sqlite3
2852 **
@@ -2925,13 +2942,13 @@
2925 ** [sqlite3_prepare()] or its variants. Authorization is not
2926 ** performed during statement evaluation in [sqlite3_step()], unless
2927 ** as stated in the previous paragraph, sqlite3_step() invokes
2928 ** sqlite3_prepare_v2() to reprepare a statement after a schema change.
2929 */
2930 SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
2931 sqlite3*,
2932 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
2933 void *pUserData
2934 );
2935
2936 /*
2937 ** CAPI3REF: Authorizer Return Codes
@@ -3033,14 +3050,14 @@
3033 ** digits in the time are meaningless. Future versions of SQLite
3034 ** might provide greater resolution on the profiler callback. The
3035 ** sqlite3_profile() function is considered experimental and is
3036 ** subject to change in future versions of SQLite.
3037 */
3038 SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_trace(sqlite3*,
3039 void(*xTrace)(void*,const char*), void*);
3040 SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_profile(sqlite3*,
3041 void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
3042
3043 /*
3044 ** CAPI3REF: SQL Trace Event Codes
3045 ** KEYWORDS: SQLITE_TRACE
3046 **
@@ -3124,14 +3141,14 @@
3124 **
3125 ** The sqlite3_trace_v2() interface is intended to replace the legacy
3126 ** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which
3127 ** are deprecated.
3128 */
3129 SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2(
3130 sqlite3*,
3131 unsigned uMask,
3132 int(*xCallback)(unsigned,void*,void*,void*),
3133 void *pCtx
3134 );
3135
3136 /*
3137 ** CAPI3REF: Query Progress Callbacks
@@ -3163,11 +3180,11 @@
3163 ** the database connection that invoked the progress handler.
3164 ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
3165 ** database connections for the meaning of "modify" in this paragraph.
3166 **
3167 */
3168 SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
3169
3170 /*
3171 ** CAPI3REF: Opening A New Database Connection
3172 ** CONSTRUCTOR: sqlite3
3173 **
@@ -3392,19 +3409,19 @@
3392 ** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various
3393 ** features that require the use of temporary files may fail.
3394 **
3395 ** See also: [sqlite3_temp_directory]
3396 */
3397 SQLITE_API int SQLITE_STDCALL sqlite3_open(
3398 const char *filename, /* Database filename (UTF-8) */
3399 sqlite3 **ppDb /* OUT: SQLite db handle */
3400 );
3401 SQLITE_API int SQLITE_STDCALL sqlite3_open16(
3402 const void *filename, /* Database filename (UTF-16) */
3403 sqlite3 **ppDb /* OUT: SQLite db handle */
3404 );
3405 SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
3406 const char *filename, /* Database filename (UTF-8) */
3407 sqlite3 **ppDb, /* OUT: SQLite db handle */
3408 int flags, /* Flags */
3409 const char *zVfs /* Name of VFS module to use */
3410 );
@@ -3446,13 +3463,13 @@
3446 ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and
3447 ** is not a database file pathname pointer that SQLite passed into the xOpen
3448 ** VFS method, then the behavior of this routine is undefined and probably
3449 ** undesirable.
3450 */
3451 SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3452 SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3453 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
3454
3455
3456 /*
3457 ** CAPI3REF: Error Codes And Messages
3458 ** METHOD: sqlite3
@@ -3492,15 +3509,15 @@
3492 **
3493 ** If an interface fails with SQLITE_MISUSE, that means the interface
3494 ** was invoked incorrectly by the application. In that case, the
3495 ** error code and message may or may not be set.
3496 */
3497 SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db);
3498 SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db);
3499 SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*);
3500 SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*);
3501 SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int);
3502
3503 /*
3504 ** CAPI3REF: Prepared Statement Object
3505 ** KEYWORDS: {prepared statement} {prepared statements}
3506 **
@@ -3564,11 +3581,11 @@
3564 ** created by an untrusted script can be contained using the
3565 ** [max_page_count] [PRAGMA].
3566 **
3567 ** New run-time limit categories may be added in future releases.
3568 */
3569 SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3*, int id, int newVal);
3570
3571 /*
3572 ** CAPI3REF: Run-Time Limit Categories
3573 ** KEYWORDS: {limit category} {*limit categories}
3574 **
@@ -3716,32 +3733,32 @@
3716 ** or [GLOB] operator or if the parameter is compared to an indexed column
3717 ** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
3718 ** </li>
3719 ** </ol>
3720 */
3721 SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
3722 sqlite3 *db, /* Database handle */
3723 const char *zSql, /* SQL statement, UTF-8 encoded */
3724 int nByte, /* Maximum length of zSql in bytes. */
3725 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3726 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3727 );
3728 SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
3729 sqlite3 *db, /* Database handle */
3730 const char *zSql, /* SQL statement, UTF-8 encoded */
3731 int nByte, /* Maximum length of zSql in bytes. */
3732 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3733 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3734 );
3735 SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
3736 sqlite3 *db, /* Database handle */
3737 const void *zSql, /* SQL statement, UTF-16 encoded */
3738 int nByte, /* Maximum length of zSql in bytes. */
3739 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3740 const void **pzTail /* OUT: Pointer to unused portion of zSql */
3741 );
3742 SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
3743 sqlite3 *db, /* Database handle */
3744 const void *zSql, /* SQL statement, UTF-16 encoded */
3745 int nByte, /* Maximum length of zSql in bytes. */
3746 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3747 const void **pzTail /* OUT: Pointer to unused portion of zSql */
@@ -3776,12 +3793,12 @@
3776 ** automatically freed when the prepared statement is finalized.
3777 ** ^The string returned by sqlite3_expanded_sql(P), on the other hand,
3778 ** is obtained from [sqlite3_malloc()] and must be free by the application
3779 ** by passing it to [sqlite3_free()].
3780 */
3781 SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt);
3782 SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt);
3783
3784 /*
3785 ** CAPI3REF: Determine If An SQL Statement Writes The Database
3786 ** METHOD: sqlite3_stmt
3787 **
@@ -3809,11 +3826,11 @@
3809 ** database. ^The [ATTACH] and [DETACH] statements also cause
3810 ** sqlite3_stmt_readonly() to return true since, while those statements
3811 ** change the configuration of a database connection, they do not make
3812 ** changes to the content of the database files on disk.
3813 */
3814 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
3815
3816 /*
3817 ** CAPI3REF: Determine If A Prepared Statement Has Been Reset
3818 ** METHOD: sqlite3_stmt
3819 **
@@ -3830,11 +3847,11 @@
3830 ** to locate all prepared statements associated with a database
3831 ** connection that are in need of being reset. This can be used,
3832 ** for example, in diagnostic routines to search for prepared
3833 ** statements that are holding a transaction open.
3834 */
3835 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt*);
3836
3837 /*
3838 ** CAPI3REF: Dynamically Typed Value Object
3839 ** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
3840 **
@@ -3994,24 +4011,24 @@
3994 ** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails.
3995 **
3996 ** See also: [sqlite3_bind_parameter_count()],
3997 ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].
3998 */
3999 SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
4000 SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
4001 void(*)(void*));
4002 SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt*, int, double);
4003 SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt*, int, int);
4004 SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
4005 SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt*, int);
4006 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
4007 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
4008 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
4009 void(*)(void*), unsigned char encoding);
4010 SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
4011 SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
4012 SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
4013
4014 /*
4015 ** CAPI3REF: Number Of SQL Parameters
4016 ** METHOD: sqlite3_stmt
4017 **
@@ -4028,11 +4045,11 @@
4028 **
4029 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
4030 ** [sqlite3_bind_parameter_name()], and
4031 ** [sqlite3_bind_parameter_index()].
4032 */
4033 SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt*);
4034
4035 /*
4036 ** CAPI3REF: Name Of A Host Parameter
4037 ** METHOD: sqlite3_stmt
4038 **
@@ -4056,11 +4073,11 @@
4056 **
4057 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
4058 ** [sqlite3_bind_parameter_count()], and
4059 ** [sqlite3_bind_parameter_index()].
4060 */
4061 SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
4062
4063 /*
4064 ** CAPI3REF: Index Of A Parameter With A Given Name
4065 ** METHOD: sqlite3_stmt
4066 **
@@ -4073,21 +4090,21 @@
4073 **
4074 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
4075 ** [sqlite3_bind_parameter_count()], and
4076 ** [sqlite3_bind_parameter_name()].
4077 */
4078 SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
4079
4080 /*
4081 ** CAPI3REF: Reset All Bindings On A Prepared Statement
4082 ** METHOD: sqlite3_stmt
4083 **
4084 ** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset
4085 ** the [sqlite3_bind_blob | bindings] on a [prepared statement].
4086 ** ^Use this routine to reset all host parameters to NULL.
4087 */
4088 SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt*);
4089
4090 /*
4091 ** CAPI3REF: Number Of Columns In A Result Set
4092 ** METHOD: sqlite3_stmt
4093 **
@@ -4095,11 +4112,11 @@
4095 ** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
4096 ** statement that does not return data (for example an [UPDATE]).
4097 **
4098 ** See also: [sqlite3_data_count()]
4099 */
4100 SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt);
4101
4102 /*
4103 ** CAPI3REF: Column Names In A Result Set
4104 ** METHOD: sqlite3_stmt
4105 **
@@ -4124,12 +4141,12 @@
4124 ** ^The name of a result column is the value of the "AS" clause for
4125 ** that column, if there is an AS clause. If there is no AS clause
4126 ** then the name of the column is unspecified and may change from
4127 ** one release of SQLite to the next.
4128 */
4129 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt*, int N);
4130 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt*, int N);
4131
4132 /*
4133 ** CAPI3REF: Source Of Data In A Query Result
4134 ** METHOD: sqlite3_stmt
4135 **
@@ -4173,16 +4190,16 @@
4173 ** If two or more threads call one or more
4174 ** [sqlite3_column_database_name | column metadata interfaces]
4175 ** for the same [prepared statement] and result column
4176 ** at the same time then the results are undefined.
4177 */
4178 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int);
4179 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int);
4180 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int);
4181 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int);
4182 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int);
4183 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
4184
4185 /*
4186 ** CAPI3REF: Declared Datatype Of A Query Result
4187 ** METHOD: sqlite3_stmt
4188 **
@@ -4210,12 +4227,12 @@
4210 ** data stored in that column is of the declared type. SQLite is
4211 ** strongly typed, but the typing is dynamic not static. ^Type
4212 ** is associated with individual values, not with the containers
4213 ** used to hold those values.
4214 */
4215 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt*,int);
4216 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt*,int);
4217
4218 /*
4219 ** CAPI3REF: Evaluate An SQL Statement
4220 ** METHOD: sqlite3_stmt
4221 **
@@ -4291,11 +4308,11 @@
4291 ** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
4292 ** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,
4293 ** then the more specific [error codes] are returned directly
4294 ** by sqlite3_step(). The use of the "v2" interface is recommended.
4295 */
4296 SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt*);
4297
4298 /*
4299 ** CAPI3REF: Number of columns in a result set
4300 ** METHOD: sqlite3_stmt
4301 **
@@ -4312,11 +4329,11 @@
4312 ** where it always returns zero since each step of that multi-step
4313 ** pragma returns 0 columns of data.
4314 **
4315 ** See also: [sqlite3_column_count()]
4316 */
4317 SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt);
4318
4319 /*
4320 ** CAPI3REF: Fundamental Datatypes
4321 ** KEYWORDS: SQLITE_TEXT
4322 **
@@ -4502,20 +4519,20 @@
4502 ** of these routines, a default value is returned. The default value
4503 ** is either the integer 0, the floating point number 0.0, or a NULL
4504 ** pointer. Subsequent calls to [sqlite3_errcode()] will return
4505 ** [SQLITE_NOMEM].)^
4506 */
4507 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt*, int iCol);
4508 SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4509 SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4510 SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt*, int iCol);
4511 SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt*, int iCol);
4512 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt*, int iCol);
4513 SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt*, int iCol);
4514 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt*, int iCol);
4515 SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt*, int iCol);
4516 SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt*, int iCol);
4517
4518 /*
4519 ** CAPI3REF: Destroy A Prepared Statement Object
4520 ** DESTRUCTOR: sqlite3_stmt
4521 **
@@ -4539,11 +4556,11 @@
4539 ** resource leaks. It is a grievous error for the application to try to use
4540 ** a prepared statement after it has been finalized. Any use of a prepared
4541 ** statement after it has been finalized can result in undefined and
4542 ** undesirable behavior such as segfaults and heap corruption.
4543 */
4544 SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt);
4545
4546 /*
4547 ** CAPI3REF: Reset A Prepared Statement Object
4548 ** METHOD: sqlite3_stmt
4549 **
@@ -4566,11 +4583,11 @@
4566 ** [sqlite3_reset(S)] returns an appropriate [error code].
4567 **
4568 ** ^The [sqlite3_reset(S)] interface does not change the values
4569 ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
4570 */
4571 SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt);
4572
4573 /*
4574 ** CAPI3REF: Create Or Redefine SQL Functions
4575 ** KEYWORDS: {function creation routines}
4576 ** KEYWORDS: {application-defined SQL function}
@@ -4666,40 +4683,40 @@
4666 ** ^An application-defined function is permitted to call other
4667 ** SQLite interfaces. However, such calls must not
4668 ** close the database connection nor finalize or reset the prepared
4669 ** statement in which the function is running.
4670 */
4671 SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
4672 sqlite3 *db,
4673 const char *zFunctionName,
4674 int nArg,
4675 int eTextRep,
4676 void *pApp,
4677 void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4678 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4679 void (*xFinal)(sqlite3_context*)
4680 );
4681 SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
4682 sqlite3 *db,
4683 const void *zFunctionName,
4684 int nArg,
4685 int eTextRep,
4686 void *pApp,
4687 void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4688 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4689 void (*xFinal)(sqlite3_context*)
4690 );
4691 SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
4692 sqlite3 *db,
4693 const char *zFunctionName,
4694 int nArg,
4695 int eTextRep,
4696 void *pApp,
4697 void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4698 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4699 void (*xFinal)(sqlite3_context*),
4700 void(*xDestroy)(void*)
4701 );
4702
4703 /*
4704 ** CAPI3REF: Text Encodings
4705 **
@@ -4732,16 +4749,16 @@
4732 ** to be supported. However, new applications should avoid
4733 ** the use of these functions. To encourage programmers to avoid
4734 ** these functions, we will not explain what they do.
4735 */
4736 #ifndef SQLITE_OMIT_DEPRECATED
4737 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context*);
4738 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt*);
4739 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4740 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_global_recover(void);
4741 SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_thread_cleanup(void);
4742 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
4743 void*,sqlite3_int64);
4744 #endif
4745
4746 /*
4747 ** CAPI3REF: Obtaining SQL Values
@@ -4787,22 +4804,22 @@
4787 ** or [sqlite3_value_text16()].
4788 **
4789 ** These routines must be called from the same thread as
4790 ** the SQL function that supplied the [sqlite3_value*] parameters.
4791 */
4792 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value*);
4793 SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value*);
4794 SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value*);
4795 SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value*);
4796 SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value*);
4797 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value*);
4798 SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value*);
4799 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value*);
4800 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value*);
4801 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*);
4802 SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*);
4803 SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*);
4804
4805 /*
4806 ** CAPI3REF: Finding The Subtype Of SQL Values
4807 ** METHOD: sqlite3_value
4808 **
@@ -4814,11 +4831,11 @@
4814 **
4815 ** SQLite makes no use of subtype itself. It merely passes the subtype
4816 ** from the result of one [application-defined SQL function] into the
4817 ** input of another.
4818 */
4819 SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value*);
4820
4821 /*
4822 ** CAPI3REF: Copy And Free SQL Values
4823 ** METHOD: sqlite3_value
4824 **
@@ -4830,12 +4847,12 @@
4830 **
4831 ** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object
4832 ** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer
4833 ** then sqlite3_value_free(V) is a harmless no-op.
4834 */
4835 SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value*);
4836 SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value*);
4837
4838 /*
4839 ** CAPI3REF: Obtain Aggregate Function Context
4840 ** METHOD: sqlite3_context
4841 **
@@ -4876,11 +4893,11 @@
4876 ** function.
4877 **
4878 ** This routine must be called from the same thread in which
4879 ** the aggregate SQL function is running.
4880 */
4881 SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
4882
4883 /*
4884 ** CAPI3REF: User Data For Functions
4885 ** METHOD: sqlite3_context
4886 **
@@ -4891,11 +4908,11 @@
4891 ** registered the application defined function.
4892 **
4893 ** This routine must be called from the same thread in which
4894 ** the application-defined function is running.
4895 */
4896 SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context*);
4897
4898 /*
4899 ** CAPI3REF: Database Connection For Functions
4900 ** METHOD: sqlite3_context
4901 **
@@ -4903,11 +4920,11 @@
4903 ** the pointer to the [database connection] (the 1st parameter)
4904 ** of the [sqlite3_create_function()]
4905 ** and [sqlite3_create_function16()] routines that originally
4906 ** registered the application defined function.
4907 */
4908 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context*);
4909
4910 /*
4911 ** CAPI3REF: Function Auxiliary Data
4912 ** METHOD: sqlite3_context
4913 **
@@ -4956,12 +4973,12 @@
4956 ** values and [parameters] and expressions composed from the same.)^
4957 **
4958 ** These routines must be called from the same thread in which
4959 ** the SQL function is running.
4960 */
4961 SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context*, int N);
4962 SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
4963
4964
4965 /*
4966 ** CAPI3REF: Constants Defining Special Destructor Behavior
4967 **
@@ -4974,11 +4991,11 @@
4974 ** the content before returning.
4975 **
4976 ** The typedef is necessary to work around problems in certain
4977 ** C++ compilers.
4978 */
4979 typedef void (*sqlite3_destructor_type)(void*);
4980 #define SQLITE_STATIC ((sqlite3_destructor_type)0)
4981 #define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1)
4982
4983 /*
4984 ** CAPI3REF: Setting The Result Of An SQL Function
@@ -5093,31 +5110,31 @@
5093 **
5094 ** If these routines are called from within the different thread
5095 ** than the one containing the application-defined function that received
5096 ** the [sqlite3_context] pointer, the results are undefined.
5097 */
5098 SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
5099 SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(sqlite3_context*,const void*,
5100 sqlite3_uint64,void(*)(void*));
5101 SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context*, double);
5102 SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context*, const char*, int);
5103 SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context*, const void*, int);
5104 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context*);
5105 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context*);
5106 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context*, int);
5107 SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context*, int);
5108 SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
5109 SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context*);
5110 SQLITE_API void SQLITE_STDCALL sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
5111 SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
5112 void(*)(void*), unsigned char encoding);
5113 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
5114 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
5115 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
5116 SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
5117 SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n);
5118 SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
5119
5120
5121 /*
5122 ** CAPI3REF: Setting The Subtype Of An SQL Function
5123 ** METHOD: sqlite3_context
@@ -5128,11 +5145,11 @@
5128 ** of the subtype T are preserved in current versions of SQLite;
5129 ** higher order bits are discarded.
5130 ** The number of subtype bytes preserved by SQLite might increase
5131 ** in future releases of SQLite.
5132 */
5133 SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context*,unsigned int);
5134
5135 /*
5136 ** CAPI3REF: Define New Collating Sequences
5137 ** METHOD: sqlite3
5138 **
@@ -5210,31 +5227,31 @@
5210 ** is unfortunate but cannot be changed without breaking backwards
5211 ** compatibility.
5212 **
5213 ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].
5214 */
5215 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
5216 sqlite3*,
5217 const char *zName,
5218 int eTextRep,
5219 void *pArg,
5220 int(*xCompare)(void*,int,const void*,int,const void*)
5221 );
5222 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
5223 sqlite3*,
5224 const char *zName,
5225 int eTextRep,
5226 void *pArg,
5227 int(*xCompare)(void*,int,const void*,int,const void*),
5228 void(*xDestroy)(void*)
5229 );
5230 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
5231 sqlite3*,
5232 const void *zName,
5233 int eTextRep,
5234 void *pArg,
5235 int(*xCompare)(void*,int,const void*,int,const void*)
5236 );
5237
5238 /*
5239 ** CAPI3REF: Collation Needed Callbacks
5240 ** METHOD: sqlite3
@@ -5260,19 +5277,19 @@
5260 **
5261 ** The callback function should register the desired collation using
5262 ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or
5263 ** [sqlite3_create_collation_v2()].
5264 */
5265 SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
5266 sqlite3*,
5267 void*,
5268 void(*)(void*,sqlite3*,int eTextRep,const char*)
5269 );
5270 SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
5271 sqlite3*,
5272 void*,
5273 void(*)(void*,sqlite3*,int eTextRep,const void*)
5274 );
5275
5276 #ifdef SQLITE_HAS_CODEC
5277 /*
5278 ** Specify the key for an encrypted database. This routine should be
@@ -5279,15 +5296,15 @@
5279 ** called right after sqlite3_open().
5280 **
5281 ** The code to implement this API is not available in the public release
5282 ** of SQLite.
5283 */
5284 SQLITE_API int SQLITE_STDCALL sqlite3_key(
5285 sqlite3 *db, /* Database to be rekeyed */
5286 const void *pKey, int nKey /* The key */
5287 );
5288 SQLITE_API int SQLITE_STDCALL sqlite3_key_v2(
5289 sqlite3 *db, /* Database to be rekeyed */
5290 const char *zDbName, /* Name of the database */
5291 const void *pKey, int nKey /* The key */
5292 );
5293
@@ -5297,35 +5314,35 @@
5297 ** database is decrypted.
5298 **
5299 ** The code to implement this API is not available in the public release
5300 ** of SQLite.
5301 */
5302 SQLITE_API int SQLITE_STDCALL sqlite3_rekey(
5303 sqlite3 *db, /* Database to be rekeyed */
5304 const void *pKey, int nKey /* The new key */
5305 );
5306 SQLITE_API int SQLITE_STDCALL sqlite3_rekey_v2(
5307 sqlite3 *db, /* Database to be rekeyed */
5308 const char *zDbName, /* Name of the database */
5309 const void *pKey, int nKey /* The new key */
5310 );
5311
5312 /*
5313 ** Specify the activation key for a SEE database. Unless
5314 ** activated, none of the SEE routines will work.
5315 */
5316 SQLITE_API void SQLITE_STDCALL sqlite3_activate_see(
5317 const char *zPassPhrase /* Activation phrase */
5318 );
5319 #endif
5320
5321 #ifdef SQLITE_ENABLE_CEROD
5322 /*
5323 ** Specify the activation key for a CEROD database. Unless
5324 ** activated, none of the CEROD routines will work.
5325 */
5326 SQLITE_API void SQLITE_STDCALL sqlite3_activate_cerod(
5327 const char *zPassPhrase /* Activation phrase */
5328 );
5329 #endif
5330
5331 /*
@@ -5343,11 +5360,11 @@
5343 ** method of the default [sqlite3_vfs] object. If the xSleep() method
5344 ** of the default VFS is not implemented correctly, or not implemented at
5345 ** all, then the behavior of sqlite3_sleep() may deviate from the description
5346 ** in the previous paragraphs.
5347 */
5348 SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int);
5349
5350 /*
5351 ** CAPI3REF: Name Of The Folder Holding Temporary Files
5352 **
5353 ** ^(If this global variable is made to point to a string which is
@@ -5462,11 +5479,11 @@
5462 **
5463 ** If another thread changes the autocommit status of the database
5464 ** connection while this routine is running, then the return value
5465 ** is undefined.
5466 */
5467 SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3*);
5468
5469 /*
5470 ** CAPI3REF: Find The Database Handle Of A Prepared Statement
5471 ** METHOD: sqlite3_stmt
5472 **
@@ -5475,11 +5492,11 @@
5475 ** returned by sqlite3_db_handle is the same [database connection]
5476 ** that was the first argument
5477 ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
5478 ** create the statement in the first place.
5479 */
5480 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt*);
5481
5482 /*
5483 ** CAPI3REF: Return The Filename For A Database Connection
5484 ** METHOD: sqlite3
5485 **
@@ -5492,21 +5509,21 @@
5492 ** ^The filename returned by this function is the output of the
5493 ** xFullPathname method of the [VFS]. ^In other words, the filename
5494 ** will be an absolute pathname, even if the filename used
5495 ** to open the database originally was a URI or relative pathname.
5496 */
5497 SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
5498
5499 /*
5500 ** CAPI3REF: Determine if a database is read-only
5501 ** METHOD: sqlite3
5502 **
5503 ** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N
5504 ** of connection D is read-only, 0 if it is read/write, or -1 if N is not
5505 ** the name of a database on connection D.
5506 */
5507 SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
5508
5509 /*
5510 ** CAPI3REF: Find the next prepared statement
5511 ** METHOD: sqlite3
5512 **
@@ -5518,11 +5535,11 @@
5518 **
5519 ** The [database connection] pointer D in a call to
5520 ** [sqlite3_next_stmt(D,S)] must refer to an open database
5521 ** connection and in particular must not be a NULL pointer.
5522 */
5523 SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
5524
5525 /*
5526 ** CAPI3REF: Commit And Rollback Notification Callbacks
5527 ** METHOD: sqlite3
5528 **
@@ -5567,12 +5584,12 @@
5567 ** ^The rollback callback is not invoked if a transaction is
5568 ** automatically rolled back because the database connection is closed.
5569 **
5570 ** See also the [sqlite3_update_hook()] interface.
5571 */
5572 SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
5573 SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
5574
5575 /*
5576 ** CAPI3REF: Data Change Notification Callbacks
5577 ** METHOD: sqlite3
5578 **
@@ -5619,13 +5636,13 @@
5619 ** the first call on D.
5620 **
5621 ** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()],
5622 ** and [sqlite3_preupdate_hook()] interfaces.
5623 */
5624 SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
5625 sqlite3*,
5626 void(*)(void *,int ,char const *,char const *,sqlite3_int64),
5627 void*
5628 );
5629
5630 /*
5631 ** CAPI3REF: Enable Or Disable Shared Pager Cache
@@ -5659,11 +5676,11 @@
5659 ** This interface is threadsafe on processors where writing a
5660 ** 32-bit integer is atomic.
5661 **
5662 ** See Also: [SQLite Shared-Cache Mode]
5663 */
5664 SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int);
5665
5666 /*
5667 ** CAPI3REF: Attempt To Free Heap Memory
5668 **
5669 ** ^The sqlite3_release_memory() interface attempts to free N bytes
@@ -5675,11 +5692,11 @@
5675 ** ^The sqlite3_release_memory() routine is a no-op returning zero
5676 ** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5677 **
5678 ** See also: [sqlite3_db_release_memory()]
5679 */
5680 SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int);
5681
5682 /*
5683 ** CAPI3REF: Free Memory Used By A Database Connection
5684 ** METHOD: sqlite3
5685 **
@@ -5689,11 +5706,11 @@
5689 ** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
5690 ** omitted.
5691 **
5692 ** See also: [sqlite3_release_memory()]
5693 */
5694 SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3*);
5695
5696 /*
5697 ** CAPI3REF: Impose A Limit On Heap Size
5698 **
5699 ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the
@@ -5741,11 +5758,11 @@
5741 ** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5742 **
5743 ** The circumstances under which SQLite will enforce the soft heap limit may
5744 ** changes in future releases of SQLite.
5745 */
5746 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
5747
5748 /*
5749 ** CAPI3REF: Deprecated Soft Heap Limit Interface
5750 ** DEPRECATED
5751 **
@@ -5752,11 +5769,11 @@
5752 ** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
5753 ** interface. This routine is provided for historical compatibility
5754 ** only. All new applications should use the
5755 ** [sqlite3_soft_heap_limit64()] interface rather than this one.
5756 */
5757 SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_soft_heap_limit(int N);
5758
5759
5760 /*
5761 ** CAPI3REF: Extract Metadata About A Column Of A Table
5762 ** METHOD: sqlite3
@@ -5822,11 +5839,11 @@
5822 **
5823 ** ^This function causes all database schemas to be read from disk and
5824 ** parsed, if that has not already been done, and returns an error if
5825 ** any errors are encountered while loading the schema.
5826 */
5827 SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
5828 sqlite3 *db, /* Connection handle */
5829 const char *zDbName, /* Database name or NULL */
5830 const char *zTableName, /* Table name */
5831 const char *zColumnName, /* Column name */
5832 char const **pzDataType, /* OUTPUT: Declared data type */
@@ -5878,11 +5895,11 @@
5878 ** disabled and prevent SQL injections from giving attackers
5879 ** access to extension loading capabilities.
5880 **
5881 ** See also the [load_extension() SQL function].
5882 */
5883 SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
5884 sqlite3 *db, /* Load the extension into this database connection */
5885 const char *zFile, /* Name of the shared library containing extension */
5886 const char *zProc, /* Entry point. Derived from zFile if 0 */
5887 char **pzErrMsg /* Put error message here if not 0 */
5888 );
@@ -5910,11 +5927,11 @@
5910 ** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method
5911 ** rather than this interface, so the [load_extension()] SQL function
5912 ** remains disabled. This will prevent SQL injections from giving attackers
5913 ** access to extension loading capabilities.
5914 */
5915 SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
5916
5917 /*
5918 ** CAPI3REF: Automatically Load Statically Linked Extensions
5919 **
5920 ** ^This interface causes the xEntryPoint() function to be invoked for
@@ -5948,11 +5965,14 @@
5948 ** will be called more than once for each database connection that is opened.
5949 **
5950 ** See also: [sqlite3_reset_auto_extension()]
5951 ** and [sqlite3_cancel_auto_extension()]
5952 */
5953 SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void (*xEntryPoint)(void));
 
 
 
5954
5955 /*
5956 ** CAPI3REF: Cancel Automatic Extension Loading
5957 **
5958 ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
@@ -5960,19 +5980,21 @@
5960 ** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)]
5961 ** routine returns 1 if initialization routine X was successfully
5962 ** unregistered and it returns 0 if X was not on the list of initialization
5963 ** routines.
5964 */
5965 SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void (*xEntryPoint)(void));
 
 
5966
5967 /*
5968 ** CAPI3REF: Reset Automatic Extension Loading
5969 **
5970 ** ^This interface disables all automatic extensions previously
5971 ** registered using [sqlite3_auto_extension()].
5972 */
5973 SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void);
5974
5975 /*
5976 ** The interface to the virtual-table mechanism is currently considered
5977 ** to be experimental. The interface might change in incompatible ways.
5978 ** If this is a problem for you, do not use the interface at this time.
@@ -6005,41 +6027,41 @@
6005 ** of this structure must not change while it is registered with
6006 ** any database connection.
6007 */
6008 struct sqlite3_module {
6009 int iVersion;
6010 int (*xCreate)(sqlite3*, void *pAux,
6011 int argc, const char *const*argv,
6012 sqlite3_vtab **ppVTab, char**);
6013 int (*xConnect)(sqlite3*, void *pAux,
6014 int argc, const char *const*argv,
6015 sqlite3_vtab **ppVTab, char**);
6016 int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
6017 int (*xDisconnect)(sqlite3_vtab *pVTab);
6018 int (*xDestroy)(sqlite3_vtab *pVTab);
6019 int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);
6020 int (*xClose)(sqlite3_vtab_cursor*);
6021 int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
6022 int argc, sqlite3_value **argv);
6023 int (*xNext)(sqlite3_vtab_cursor*);
6024 int (*xEof)(sqlite3_vtab_cursor*);
6025 int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int);
6026 int (*xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid);
6027 int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *);
6028 int (*xBegin)(sqlite3_vtab *pVTab);
6029 int (*xSync)(sqlite3_vtab *pVTab);
6030 int (*xCommit)(sqlite3_vtab *pVTab);
6031 int (*xRollback)(sqlite3_vtab *pVTab);
6032 int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,
6033 void (**pxFunc)(sqlite3_context*,int,sqlite3_value**),
6034 void **ppArg);
6035 int (*xRename)(sqlite3_vtab *pVtab, const char *zNew);
6036 /* The methods above are in version 1 of the sqlite_module object. Those
6037 ** below are for version 2 and greater. */
6038 int (*xSavepoint)(sqlite3_vtab *pVTab, int);
6039 int (*xRelease)(sqlite3_vtab *pVTab, int);
6040 int (*xRollbackTo)(sqlite3_vtab *pVTab, int);
6041 };
6042
6043 /*
6044 ** CAPI3REF: Virtual Table Indexing Information
6045 ** KEYWORDS: sqlite3_index_info
@@ -6213,22 +6235,22 @@
6213 ** be invoked if the call to sqlite3_create_module_v2() fails.
6214 ** ^The sqlite3_create_module()
6215 ** interface is equivalent to sqlite3_create_module_v2() with a NULL
6216 ** destructor.
6217 */
6218 SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
6219 sqlite3 *db, /* SQLite connection to register module with */
6220 const char *zName, /* Name of the module */
6221 const sqlite3_module *p, /* Methods for the module */
6222 void *pClientData /* Client data for xCreate/xConnect */
6223 );
6224 SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
6225 sqlite3 *db, /* SQLite connection to register module with */
6226 const char *zName, /* Name of the module */
6227 const sqlite3_module *p, /* Methods for the module */
6228 void *pClientData, /* Client data for xCreate/xConnect */
6229 void(*xDestroy)(void*) /* Module destructor function */
6230 );
6231
6232 /*
6233 ** CAPI3REF: Virtual Table Instance Object
6234 ** KEYWORDS: sqlite3_vtab
@@ -6282,11 +6304,11 @@
6282 ** ^The [xCreate] and [xConnect] methods of a
6283 ** [virtual table module] call this interface
6284 ** to declare the format (the names and datatypes of the columns) of
6285 ** the virtual tables they implement.
6286 */
6287 SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
6288
6289 /*
6290 ** CAPI3REF: Overload A Function For A Virtual Table
6291 ** METHOD: sqlite3
6292 **
@@ -6301,11 +6323,11 @@
6301 ** of the new function always causes an exception to be thrown. So
6302 ** the new function is not good for anything by itself. Its only
6303 ** purpose is to be a placeholder function that can be overloaded
6304 ** by a [virtual table].
6305 */
6306 SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
6307
6308 /*
6309 ** The interface to the virtual-table mechanism defined above (back up
6310 ** to a comment remarkably similar to this one) is currently considered
6311 ** to be experimental. The interface might change in incompatible ways.
@@ -6400,11 +6422,11 @@
6400 ** zero-filled blob to read or write using the incremental-blob interface.
6401 **
6402 ** To avoid a resource leak, every open [BLOB handle] should eventually
6403 ** be released by a call to [sqlite3_blob_close()].
6404 */
6405 SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
6406 sqlite3*,
6407 const char *zDb,
6408 const char *zTable,
6409 const char *zColumn,
6410 sqlite3_int64 iRow,
@@ -6433,11 +6455,11 @@
6433 ** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
6434 ** always returns zero.
6435 **
6436 ** ^This function sets the database handle error code and message.
6437 */
6438 SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
6439
6440 /*
6441 ** CAPI3REF: Close A BLOB Handle
6442 ** DESTRUCTOR: sqlite3_blob
6443 **
@@ -6456,11 +6478,11 @@
6456 ** with a null pointer (such as would be returned by a failed call to
6457 ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function
6458 ** is passed a valid open blob handle, the values returned by the
6459 ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning.
6460 */
6461 SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *);
6462
6463 /*
6464 ** CAPI3REF: Return The Size Of An Open BLOB
6465 ** METHOD: sqlite3_blob
6466 **
@@ -6472,11 +6494,11 @@
6472 ** This routine only works on a [BLOB handle] which has been created
6473 ** by a prior successful call to [sqlite3_blob_open()] and which has not
6474 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6475 ** to this routine results in undefined and probably undesirable behavior.
6476 */
6477 SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *);
6478
6479 /*
6480 ** CAPI3REF: Read Data From A BLOB Incrementally
6481 ** METHOD: sqlite3_blob
6482 **
@@ -6501,11 +6523,11 @@
6501 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6502 ** to this routine results in undefined and probably undesirable behavior.
6503 **
6504 ** See also: [sqlite3_blob_write()].
6505 */
6506 SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
6507
6508 /*
6509 ** CAPI3REF: Write Data Into A BLOB Incrementally
6510 ** METHOD: sqlite3_blob
6511 **
@@ -6543,11 +6565,11 @@
6543 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6544 ** to this routine results in undefined and probably undesirable behavior.
6545 **
6546 ** See also: [sqlite3_blob_read()].
6547 */
6548 SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
6549
6550 /*
6551 ** CAPI3REF: Virtual File System Objects
6552 **
6553 ** A virtual filesystem (VFS) is an [sqlite3_vfs] object
@@ -6574,13 +6596,13 @@
6574 **
6575 ** ^Unregister a VFS with the sqlite3_vfs_unregister() interface.
6576 ** ^(If the default VFS is unregistered, another VFS is chosen as
6577 ** the default. The choice for the new VFS is arbitrary.)^
6578 */
6579 SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfsName);
6580 SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
6581 SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs*);
6582
6583 /*
6584 ** CAPI3REF: Mutexes
6585 **
6586 ** The SQLite core uses these routines for thread
@@ -6692,15 +6714,15 @@
6692 ** sqlite3_mutex_leave() is a NULL pointer, then all three routines
6693 ** behave as no-ops.
6694 **
6695 ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
6696 */
6697 SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int);
6698 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*);
6699 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*);
6700 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*);
6701 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*);
6702
6703 /*
6704 ** CAPI3REF: Mutex Methods Object
6705 **
6706 ** An instance of this structure defines the low-level routines
@@ -6765,19 +6787,19 @@
6765 ** If xMutexInit fails in any way, it is expected to clean up after itself
6766 ** prior to returning.
6767 */
6768 typedef struct sqlite3_mutex_methods sqlite3_mutex_methods;
6769 struct sqlite3_mutex_methods {
6770 int (*xMutexInit)(void);
6771 int (*xMutexEnd)(void);
6772 sqlite3_mutex *(*xMutexAlloc)(int);
6773 void (*xMutexFree)(sqlite3_mutex *);
6774 void (*xMutexEnter)(sqlite3_mutex *);
6775 int (*xMutexTry)(sqlite3_mutex *);
6776 void (*xMutexLeave)(sqlite3_mutex *);
6777 int (*xMutexHeld)(sqlite3_mutex *);
6778 int (*xMutexNotheld)(sqlite3_mutex *);
6779 };
6780
6781 /*
6782 ** CAPI3REF: Mutex Verification Routines
6783 **
@@ -6806,12 +6828,12 @@
6806 ** call to sqlite3_mutex_held() to fail, so a non-zero return is
6807 ** the appropriate thing to do. The sqlite3_mutex_notheld()
6808 ** interface should also return 1 when given a NULL pointer.
6809 */
6810 #ifndef NDEBUG
6811 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex*);
6812 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex*);
6813 #endif
6814
6815 /*
6816 ** CAPI3REF: Mutex Types
6817 **
@@ -6847,11 +6869,11 @@
6847 ** serializes access to the [database connection] given in the argument
6848 ** when the [threading mode] is Serialized.
6849 ** ^If the [threading mode] is Single-thread or Multi-thread then this
6850 ** routine returns a NULL pointer.
6851 */
6852 SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3*);
6853
6854 /*
6855 ** CAPI3REF: Low-Level Control Of Database Files
6856 ** METHOD: sqlite3
6857 **
@@ -6882,11 +6904,11 @@
6882 ** an incorrect zDbName and an SQLITE_ERROR return from the underlying
6883 ** xFileControl method.
6884 **
6885 ** See also: [SQLITE_FCNTL_LOCKSTATE]
6886 */
6887 SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
6888
6889 /*
6890 ** CAPI3REF: Testing Interface
6891 **
6892 ** ^The sqlite3_test_control() interface is used to read out internal
@@ -6964,12 +6986,12 @@
6964 ** be represented by a 32-bit integer, then the values returned by
6965 ** sqlite3_status() are undefined.
6966 **
6967 ** See also: [sqlite3_db_status()]
6968 */
6969 SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6970 SQLITE_API int SQLITE_STDCALL sqlite3_status64(
6971 int op,
6972 sqlite3_int64 *pCurrent,
6973 sqlite3_int64 *pHighwater,
6974 int resetFlag
6975 );
@@ -7090,11 +7112,11 @@
7090 ** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a
7091 ** non-zero [error code] on failure.
7092 **
7093 ** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
7094 */
7095 SQLITE_API int SQLITE_STDCALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
7096
7097 /*
7098 ** CAPI3REF: Status Parameters for database connections
7099 ** KEYWORDS: {SQLITE_DBSTATUS options}
7100 **
@@ -7233,11 +7255,11 @@
7233 ** ^If the resetFlg is true, then the counter is reset to zero after this
7234 ** interface call returns.
7235 **
7236 ** See also: [sqlite3_status()] and [sqlite3_db_status()].
7237 */
7238 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
7239
7240 /*
7241 ** CAPI3REF: Status Parameters for prepared statements
7242 ** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters}
7243 **
@@ -7469,22 +7491,22 @@
7469 */
7470 typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2;
7471 struct sqlite3_pcache_methods2 {
7472 int iVersion;
7473 void *pArg;
7474 int (*xInit)(void*);
7475 void (*xShutdown)(void*);
7476 sqlite3_pcache *(*xCreate)(int szPage, int szExtra, int bPurgeable);
7477 void (*xCachesize)(sqlite3_pcache*, int nCachesize);
7478 int (*xPagecount)(sqlite3_pcache*);
7479 sqlite3_pcache_page *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7480 void (*xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard);
7481 void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*,
7482 unsigned oldKey, unsigned newKey);
7483 void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
7484 void (*xDestroy)(sqlite3_pcache*);
7485 void (*xShrink)(sqlite3_pcache*);
7486 };
7487
7488 /*
7489 ** This is the obsolete pcache_methods object that has now been replaced
7490 ** by sqlite3_pcache_methods2. This object is not used by SQLite. It is
@@ -7491,20 +7513,20 @@
7491 ** retained in the header file for backwards compatibility only.
7492 */
7493 typedef struct sqlite3_pcache_methods sqlite3_pcache_methods;
7494 struct sqlite3_pcache_methods {
7495 void *pArg;
7496 int (*xInit)(void*);
7497 void (*xShutdown)(void*);
7498 sqlite3_pcache *(*xCreate)(int szPage, int bPurgeable);
7499 void (*xCachesize)(sqlite3_pcache*, int nCachesize);
7500 int (*xPagecount)(sqlite3_pcache*);
7501 void *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7502 void (*xUnpin)(sqlite3_pcache*, void*, int discard);
7503 void (*xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey);
7504 void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
7505 void (*xDestroy)(sqlite3_pcache*);
7506 };
7507
7508
7509 /*
7510 ** CAPI3REF: Online Backup Object
@@ -7702,20 +7724,20 @@
7702 ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()
7703 ** APIs are not strictly speaking threadsafe. If they are invoked at the
7704 ** same time as another thread is invoking sqlite3_backup_step() it is
7705 ** possible that they return invalid values.
7706 */
7707 SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
7708 sqlite3 *pDest, /* Destination database handle */
7709 const char *zDestName, /* Destination database name */
7710 sqlite3 *pSource, /* Source database handle */
7711 const char *zSourceName /* Source database name */
7712 );
7713 SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage);
7714 SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p);
7715 SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p);
7716 SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p);
7717
7718 /*
7719 ** CAPI3REF: Unlock Notification
7720 ** METHOD: sqlite3
7721 **
@@ -7828,13 +7850,13 @@
7828 ** by an sqlite3_step() call. ^(If there is a blocking connection, then the
7829 ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in
7830 ** the special "DROP TABLE/INDEX" case, the extended error code is just
7831 ** SQLITE_LOCKED.)^
7832 */
7833 SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
7834 sqlite3 *pBlocked, /* Waiting connection */
7835 void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */
7836 void *pNotifyArg /* Argument to pass to xNotify */
7837 );
7838
7839
7840 /*
@@ -7843,12 +7865,12 @@
7843 ** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications
7844 ** and extensions to compare the contents of two buffers containing UTF-8
7845 ** strings in a case-independent fashion, using the same definition of "case
7846 ** independence" that SQLite uses internally when comparing identifiers.
7847 */
7848 SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *, const char *);
7849 SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *, const char *, int);
7850
7851 /*
7852 ** CAPI3REF: String Globbing
7853 *
7854 ** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if
@@ -7861,11 +7883,11 @@
7861 ** Note that this routine returns zero on a match and non-zero if the strings
7862 ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
7863 **
7864 ** See also: [sqlite3_strlike()].
7865 */
7866 SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlob, const char *zStr);
7867
7868 /*
7869 ** CAPI3REF: String LIKE Matching
7870 *
7871 ** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if
@@ -7884,11 +7906,11 @@
7884 ** Note that this routine returns zero on a match and non-zero if the strings
7885 ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
7886 **
7887 ** See also: [sqlite3_strglob()].
7888 */
7889 SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
7890
7891 /*
7892 ** CAPI3REF: Error Logging Interface
7893 **
7894 ** ^The [sqlite3_log()] interface writes a message into the [error log]
@@ -7943,13 +7965,13 @@
7943 ** previously registered write-ahead log callback. ^Note that the
7944 ** [sqlite3_wal_autocheckpoint()] interface and the
7945 ** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will
7946 ** overwrite any prior [sqlite3_wal_hook()] settings.
7947 */
7948 SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
7949 sqlite3*,
7950 int(*)(void *,sqlite3*,const char*,int),
7951 void*
7952 );
7953
7954 /*
7955 ** CAPI3REF: Configure an auto-checkpoint
@@ -7978,11 +8000,11 @@
7978 ** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]
7979 ** pages. The use of this interface
7980 ** is only necessary if the default setting is found to be suboptimal
7981 ** for a particular application.
7982 */
7983 SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
7984
7985 /*
7986 ** CAPI3REF: Checkpoint a database
7987 ** METHOD: sqlite3
7988 **
@@ -8000,11 +8022,11 @@
8000 ** interface was added. This interface is retained for backwards
8001 ** compatibility and as a convenience for applications that need to manually
8002 ** start a callback but which do not need the full power (and corresponding
8003 ** complication) of [sqlite3_wal_checkpoint_v2()].
8004 */
8005 SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
8006
8007 /*
8008 ** CAPI3REF: Checkpoint a database
8009 ** METHOD: sqlite3
8010 **
@@ -8094,11 +8116,11 @@
8094 ** [sqlite3_errcode()] and [sqlite3_errmsg()].
8095 **
8096 ** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface
8097 ** from SQL.
8098 */
8099 SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
8100 sqlite3 *db, /* Database handle */
8101 const char *zDb, /* Name of attached database (or NULL) */
8102 int eMode, /* SQLITE_CHECKPOINT_* value */
8103 int *pnLog, /* OUT: Size of WAL log in frames */
8104 int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -8183,11 +8205,11 @@
8183 ** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL],
8184 ** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode
8185 ** of the SQL statement that triggered the call to the [xUpdate] method of the
8186 ** [virtual table].
8187 */
8188 SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *);
8189
8190 /*
8191 ** CAPI3REF: Conflict resolution modes
8192 ** KEYWORDS: {conflict resolution mode}
8193 **
@@ -8288,11 +8310,11 @@
8288 ** as if the loop did not exist - it returns non-zero and leave the variable
8289 ** that pOut points to unchanged.
8290 **
8291 ** See also: [sqlite3_stmt_scanstatus_reset()]
8292 */
8293 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus(
8294 sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
8295 int idx, /* Index of loop to report on */
8296 int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
8297 void *pOut /* Result written here */
8298 );
@@ -8304,11 +8326,11 @@
8304 ** ^Zero all [sqlite3_stmt_scanstatus()] related event counters.
8305 **
8306 ** This API is only available if the library is built with pre-processor
8307 ** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined.
8308 */
8309 SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
8310
8311 /*
8312 ** CAPI3REF: Flush caches to disk mid-transaction
8313 **
8314 ** ^If a write-transaction is open on [database connection] D when the
@@ -8336,11 +8358,11 @@
8336 ** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK.
8337 **
8338 ** ^This function does not set the database handle error code or message
8339 ** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions.
8340 */
8341 SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3*);
8342
8343 /*
8344 ** CAPI3REF: The pre-update hook.
8345 **
8346 ** ^These interfaces are only available if SQLite is compiled using the
@@ -8416,13 +8438,13 @@
8416 ** triggers; or 2 for changes resulting from triggers called by top-level
8417 ** triggers; and so forth.
8418 **
8419 ** See also: [sqlite3_update_hook()]
8420 */
8421 SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_STDCALL sqlite3_preupdate_hook(
8422 sqlite3 *db,
8423 void(*xPreUpdate)(
8424 void *pCtx, /* Copy of third arg to preupdate_hook() */
8425 sqlite3 *db, /* Database handle */
8426 int op, /* SQLITE_UPDATE, DELETE or INSERT */
8427 char const *zDb, /* Database name */
8428 char const *zName, /* Table name */
@@ -8429,14 +8451,14 @@
8429 sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */
8430 sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */
8431 ),
8432 void*
8433 );
8434 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **);
8435 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *);
8436 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *);
8437 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **);
8438
8439 /*
8440 ** CAPI3REF: Low-level system error code
8441 **
8442 ** ^Attempt to return the underlying operating system error code or error
@@ -8444,11 +8466,11 @@
8444 ** The return value is OS-dependent. For example, on unix systems, after
8445 ** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be
8446 ** called to get back the underlying "errno" that caused the problem, such
8447 ** as ENOSPC, EAUTH, EISDIR, and so forth.
8448 */
8449 SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3*);
8450
8451 /*
8452 ** CAPI3REF: Database Snapshot
8453 ** KEYWORDS: {snapshot}
8454 ** EXPERIMENTAL
@@ -8494,11 +8516,11 @@
8494 ** to avoid a memory leak.
8495 **
8496 ** The [sqlite3_snapshot_get()] interface is only available when the
8497 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8498 */
8499 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_get(
8500 sqlite3 *db,
8501 const char *zSchema,
8502 sqlite3_snapshot **ppSnapshot
8503 );
8504
@@ -8532,11 +8554,11 @@
8532 ** database connection in order to make it ready to use snapshots.)
8533 **
8534 ** The [sqlite3_snapshot_open()] interface is only available when the
8535 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8536 */
8537 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_open(
8538 sqlite3 *db,
8539 const char *zSchema,
8540 sqlite3_snapshot *pSnapshot
8541 );
8542
@@ -8549,11 +8571,11 @@
8549 ** using this routine to avoid a memory leak.
8550 **
8551 ** The [sqlite3_snapshot_free()] interface is only available when the
8552 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8553 */
8554 SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot*);
8555
8556 /*
8557 ** CAPI3REF: Compare the ages of two snapshot handles.
8558 ** EXPERIMENTAL
8559 **
@@ -8573,11 +8595,11 @@
8573 **
8574 ** Otherwise, this API returns a negative value if P1 refers to an older
8575 ** snapshot than P2, zero if the two handles refer to the same database
8576 ** snapshot, and a positive value if P1 is a newer snapshot than P2.
8577 */
8578 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_cmp(
8579 sqlite3_snapshot *p1,
8580 sqlite3_snapshot *p2
8581 );
8582
8583 /*
@@ -8631,14 +8653,14 @@
8631 ** Register a geometry callback named zGeom that can be used as part of an
8632 ** R-Tree geometry query as follows:
8633 **
8634 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
8635 */
8636 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
8637 sqlite3 *db,
8638 const char *zGeom,
8639 int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
8640 void *pContext
8641 );
8642
8643
8644 /*
@@ -8648,25 +8670,25 @@
8648 struct sqlite3_rtree_geometry {
8649 void *pContext; /* Copy of pContext passed to s_r_g_c() */
8650 int nParam; /* Size of array aParam[] */
8651 sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */
8652 void *pUser; /* Callback implementation user data */
8653 void (*xDelUser)(void *); /* Called by SQLite to clean up pUser */
8654 };
8655
8656 /*
8657 ** Register a 2nd-generation geometry callback named zScore that can be
8658 ** used as part of an R-Tree geometry query as follows:
8659 **
8660 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...)
8661 */
8662 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
8663 sqlite3 *db,
8664 const char *zQueryFunc,
8665 int (*xQueryFunc)(sqlite3_rtree_query_info*),
8666 void *pContext,
8667 void (*xDestructor)(void*)
8668 );
8669
8670
8671 /*
8672 ** A pointer to a structure of the following type is passed as the
@@ -8680,11 +8702,11 @@
8680 struct sqlite3_rtree_query_info {
8681 void *pContext; /* pContext from when function registered */
8682 int nParam; /* Number of function parameters */
8683 sqlite3_rtree_dbl *aParam; /* value of function parameters */
8684 void *pUser; /* callback can use this, if desired */
8685 void (*xDelUser)(void*); /* function to free pUser */
8686 sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */
8687 unsigned int *anQueue; /* Number of pending entries in the queue */
8688 int nCoord; /* Number of coordinates */
8689 int iLevel; /* Level of current node or entry */
8690 int mxLevel; /* The largest iLevel value in the tree */
@@ -8876,11 +8898,11 @@
8876 ** If xFilter returns 0, changes is not tracked. Note that once a table is
8877 ** attached, xFilter will not be called again.
8878 */
8879 void sqlite3session_table_filter(
8880 sqlite3_session *pSession, /* Session object */
8881 int(*xFilter)(
8882 void *pCtx, /* Copy of third arg to _filter_table() */
8883 const char *zTab /* Table name */
8884 ),
8885 void *pCtx /* First argument passed to xFilter */
8886 );
@@ -9451,11 +9473,11 @@
9451 ** An sqlite3_changegroup object is used to combine two or more changesets
9452 ** (or patchsets) into a single changeset (or patchset). A single changegroup
9453 ** object may combine changesets or patchsets, but not both. The output is
9454 ** always in the same format as the input.
9455 **
9456 ** If successful, this function returns SQLITE_OK and populates (*pp) with
9457 ** a pointer to a new sqlite3_changegroup object before returning. The caller
9458 ** should eventually free the returned object using a call to
9459 ** sqlite3changegroup_delete(). If an error occurs, an SQLite error code
9460 ** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL.
9461 **
@@ -9571,11 +9593,11 @@
9571 ** changes for tables that do not appear in the first changeset, they are
9572 ** appended onto the end of the output changeset, again in the order in
9573 ** which they are first encountered.
9574 **
9575 ** If an error occurs, an SQLite error code is returned and the output
9576 ** variables (*pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK
9577 ** is returned and the output variables are set to the size of and a
9578 ** pointer to the output buffer, respectively. In this case it is the
9579 ** responsibility of the caller to eventually free the buffer using a
9580 ** call to sqlite3_free().
9581 */
@@ -9728,15 +9750,15 @@
9728 */
9729 int sqlite3changeset_apply(
9730 sqlite3 *db, /* Apply change to "main" db of this handle */
9731 int nChangeset, /* Size of changeset in bytes */
9732 void *pChangeset, /* Changeset blob */
9733 int(*xFilter)(
9734 void *pCtx, /* Copy of sixth arg to _apply() */
9735 const char *zTab /* Table name */
9736 ),
9737 int(*xConflict)(
9738 void *pCtx, /* Copy of sixth arg to _apply() */
9739 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
9740 sqlite3_changeset_iter *p /* Handle describing change and conflict */
9741 ),
9742 void *pCtx /* First argument passed to xConflict */
@@ -9873,20 +9895,20 @@
9873 ** </pre>
9874 **
9875 ** Is replaced by:
9876 **
9877 ** <pre>
9878 ** &nbsp; int (*xInput)(void *pIn, void *pData, int *pnData),
9879 ** &nbsp; void *pIn,
9880 ** </pre>
9881 **
9882 ** Each time the xInput callback is invoked by the sessions module, the first
9883 ** argument passed is a copy of the supplied pIn context pointer. The second
9884 ** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no
9885 ** error occurs the xInput method should copy up to (*pnData) bytes of data
9886 ** into the buffer and set (*pnData) to the actual number of bytes copied
9887 ** before returning SQLITE_OK. If the input is completely exhausted, (*pnData)
9888 ** should be set to zero to indicate this. Or, if an error occurs, an SQLite
9889 ** error code should be returned. In all cases, if an xInput callback returns
9890 ** an error, all processing is abandoned and the streaming API function
9891 ** returns a copy of the error code to the caller.
9892 **
@@ -9907,11 +9929,11 @@
9907 ** </pre>
9908 **
9909 ** Is replaced by:
9910 **
9911 ** <pre>
9912 ** &nbsp; int (*xOutput)(void *pOut, const void *pData, int nData),
9913 ** &nbsp; void *pOut
9914 ** </pre>
9915 **
9916 ** The xOutput callback is invoked zero or more times to return data to
9917 ** the application. The first parameter passed to each call is a copy of the
@@ -9927,58 +9949,58 @@
9927 ** parameter set to a value less than or equal to zero. Other than this,
9928 ** no guarantees are made as to the size of the chunks of data returned.
9929 */
9930 int sqlite3changeset_apply_strm(
9931 sqlite3 *db, /* Apply change to "main" db of this handle */
9932 int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
9933 void *pIn, /* First arg for xInput */
9934 int(*xFilter)(
9935 void *pCtx, /* Copy of sixth arg to _apply() */
9936 const char *zTab /* Table name */
9937 ),
9938 int(*xConflict)(
9939 void *pCtx, /* Copy of sixth arg to _apply() */
9940 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
9941 sqlite3_changeset_iter *p /* Handle describing change and conflict */
9942 ),
9943 void *pCtx /* First argument passed to xConflict */
9944 );
9945 int sqlite3changeset_concat_strm(
9946 int (*xInputA)(void *pIn, void *pData, int *pnData),
9947 void *pInA,
9948 int (*xInputB)(void *pIn, void *pData, int *pnData),
9949 void *pInB,
9950 int (*xOutput)(void *pOut, const void *pData, int nData),
9951 void *pOut
9952 );
9953 int sqlite3changeset_invert_strm(
9954 int (*xInput)(void *pIn, void *pData, int *pnData),
9955 void *pIn,
9956 int (*xOutput)(void *pOut, const void *pData, int nData),
9957 void *pOut
9958 );
9959 int sqlite3changeset_start_strm(
9960 sqlite3_changeset_iter **pp,
9961 int (*xInput)(void *pIn, void *pData, int *pnData),
9962 void *pIn
9963 );
9964 int sqlite3session_changeset_strm(
9965 sqlite3_session *pSession,
9966 int (*xOutput)(void *pOut, const void *pData, int nData),
9967 void *pOut
9968 );
9969 int sqlite3session_patchset_strm(
9970 sqlite3_session *pSession,
9971 int (*xOutput)(void *pOut, const void *pData, int nData),
9972 void *pOut
9973 );
9974 int sqlite3changegroup_add_strm(sqlite3_changegroup*,
9975 int (*xInput)(void *pIn, void *pData, int *pnData),
9976 void *pIn
9977 );
9978 int sqlite3changegroup_output_strm(sqlite3_changegroup*,
9979 int (*xOutput)(void *pOut, const void *pData, int nData),
9980 void *pOut
9981 );
9982
9983
9984 /*
@@ -10029,11 +10051,11 @@
10029
10030 typedef struct Fts5ExtensionApi Fts5ExtensionApi;
10031 typedef struct Fts5Context Fts5Context;
10032 typedef struct Fts5PhraseIter Fts5PhraseIter;
10033
10034 typedef void (*fts5_extension_function)(
10035 const Fts5ExtensionApi *pApi, /* API offered by current FTS version */
10036 Fts5Context *pFts, /* First arg to pass to pApi functions */
10037 sqlite3_context *pCtx, /* Context for returning result/error */
10038 int nVal, /* Number of values in apVal[] array */
10039 sqlite3_value **apVal /* Array of trailing arguments */
@@ -10080,15 +10102,15 @@
10080 ** This function may be quite inefficient if used with an FTS5 table
10081 ** created with the "columnsize=0" option.
10082 **
10083 ** xColumnText:
10084 ** This function attempts to retrieve the text of column iCol of the
10085 ** current document. If successful, (*pz) is set to point to a buffer
10086 ** containing the text in utf-8 encoding, (*pn) is set to the size in bytes
10087 ** (not characters) of the buffer and SQLITE_OK is returned. Otherwise,
10088 ** if an error occurs, an SQLite error code is returned and the final values
10089 ** of (*pz) and (*pn) are undefined.
10090 **
10091 ** xPhraseCount:
10092 ** Returns the number of phrases in the current query expression.
10093 **
10094 ** xPhraseSize:
@@ -10193,11 +10215,11 @@
10193 ** xRowCount(pFts5, pnRow)
10194 **
10195 ** This function is used to retrieve the total number of rows in the table.
10196 ** In other words, the same value that would be returned by:
10197 **
10198 ** SELECT count(*) FROM ftstable;
10199 **
10200 ** xPhraseFirst()
10201 ** This function is used, along with type Fts5PhraseIter and the xPhraseNext
10202 ** method, to iterate through all instances of a single query phrase within
10203 ** the current row. This is the same information as is accessible via the
@@ -10260,43 +10282,43 @@
10260 ** See xPhraseFirstColumn above.
10261 */
10262 struct Fts5ExtensionApi {
10263 int iVersion; /* Currently always set to 3 */
10264
10265 void *(*xUserData)(Fts5Context*);
10266
10267 int (*xColumnCount)(Fts5Context*);
10268 int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow);
10269 int (*xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken);
10270
10271 int (*xTokenize)(Fts5Context*,
10272 const char *pText, int nText, /* Text to tokenize */
10273 void *pCtx, /* Context passed to xToken() */
10274 int (*xToken)(void*, int, const char*, int, int, int) /* Callback */
10275 );
10276
10277 int (*xPhraseCount)(Fts5Context*);
10278 int (*xPhraseSize)(Fts5Context*, int iPhrase);
10279
10280 int (*xInstCount)(Fts5Context*, int *pnInst);
10281 int (*xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff);
10282
10283 sqlite3_int64 (*xRowid)(Fts5Context*);
10284 int (*xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn);
10285 int (*xColumnSize)(Fts5Context*, int iCol, int *pnToken);
10286
10287 int (*xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData,
10288 int(*)(const Fts5ExtensionApi*,Fts5Context*,void*)
10289 );
10290 int (*xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*));
10291 void *(*xGetAuxdata)(Fts5Context*, int bClear);
10292
10293 int (*xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*);
10294 void (*xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff);
10295
10296 int (*xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*);
10297 void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol);
10298 };
10299
10300 /*
10301 ** CUSTOM AUXILIARY FUNCTIONS
10302 *************************************************************************/
@@ -10320,11 +10342,11 @@
10320 ** The second and third arguments are an array of nul-terminated strings
10321 ** containing the tokenizer arguments, if any, specified following the
10322 ** tokenizer name as part of the CREATE VIRTUAL TABLE statement used
10323 ** to create the FTS5 table.
10324 **
10325 ** The final argument is an output variable. If successful, (*ppOut)
10326 ** should be set to point to the new tokenizer handle and SQLITE_OK
10327 ** returned. If an error occurs, some value other than SQLITE_OK should
10328 ** be returned. In this case, fts5 assumes that the final value of *ppOut
10329 ** is undefined.
10330 **
@@ -10494,17 +10516,17 @@
10494 ** inefficient.
10495 */
10496 typedef struct Fts5Tokenizer Fts5Tokenizer;
10497 typedef struct fts5_tokenizer fts5_tokenizer;
10498 struct fts5_tokenizer {
10499 int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
10500 void (*xDelete)(Fts5Tokenizer*);
10501 int (*xTokenize)(Fts5Tokenizer*,
10502 void *pCtx,
10503 int flags, /* Mask of FTS5_TOKENIZE_* flags */
10504 const char *pText, int nText,
10505 int (*xToken)(
10506 void *pCtx, /* Copy of 2nd argument to xTokenize() */
10507 int tflags, /* Mask of FTS5_TOKEN_* flags */
10508 const char *pToken, /* Pointer to buffer containing token */
10509 int nToken, /* Size of token in bytes */
10510 int iStart, /* Byte offset of token within input text */
@@ -10533,33 +10555,33 @@
10533 typedef struct fts5_api fts5_api;
10534 struct fts5_api {
10535 int iVersion; /* Currently always set to 2 */
10536
10537 /* Create a new tokenizer */
10538 int (*xCreateTokenizer)(
10539 fts5_api *pApi,
10540 const char *zName,
10541 void *pContext,
10542 fts5_tokenizer *pTokenizer,
10543 void (*xDestroy)(void*)
10544 );
10545
10546 /* Find an existing tokenizer */
10547 int (*xFindTokenizer)(
10548 fts5_api *pApi,
10549 const char *zName,
10550 void **ppContext,
10551 fts5_tokenizer *pTokenizer
10552 );
10553
10554 /* Create a new auxiliary function */
10555 int (*xCreateFunction)(
10556 fts5_api *pApi,
10557 const char *zName,
10558 void *pContext,
10559 fts5_extension_function xFunction,
10560 void (*xDestroy)(void*)
10561 );
10562 };
10563
10564 /*
10565 ** END OF REGISTRATION API
@@ -11873,12 +11895,12 @@
11873 */
11874 #ifdef SQLITE_OMIT_WSD
11875 #define SQLITE_WSD const
11876 #define GLOBAL(t,v) (*(t*)sqlite3_wsd_find((void*)&(v), sizeof(v)))
11877 #define sqlite3GlobalConfig GLOBAL(struct Sqlite3Config, sqlite3Config)
11878 SQLITE_API int SQLITE_STDCALL sqlite3_wsd_init(int N, int J);
11879 SQLITE_API void *SQLITE_STDCALL sqlite3_wsd_find(void *K, int L);
11880 #else
11881 #define SQLITE_WSD
11882 #define GLOBAL(t,v) v
11883 #define sqlite3GlobalConfig sqlite3Config
11884 #endif
@@ -17165,12 +17187,14 @@
17165 "CASE_SENSITIVE_LIKE",
17166 #endif
17167 #if SQLITE_CHECK_PAGES
17168 "CHECK_PAGES",
17169 #endif
17170 #if defined(__clang__) && defined(__clang_version__)
17171 "COMPILER=clang-" __clang_version__,
 
 
17172 #elif defined(_MSC_VER)
17173 "COMPILER=msvc-" CTIMEOPT_VAL(_MSC_VER),
17174 #elif defined(__GNUC__) && defined(__VERSION__)
17175 "COMPILER=gcc-" __VERSION__,
17176 #endif
@@ -17531,11 +17555,11 @@
17531 ** was used and false if not.
17532 **
17533 ** The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix
17534 ** is not required for a match.
17535 */
17536 SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName){
17537 int i, n;
17538
17539 #if SQLITE_ENABLE_API_ARMOR
17540 if( zOptName==0 ){
17541 (void)SQLITE_MISUSE_BKPT;
@@ -17559,11 +17583,11 @@
17559
17560 /*
17561 ** Return the N-th compile-time option string. If N is out of range,
17562 ** return a NULL pointer.
17563 */
17564 SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N){
17565 if( N>=0 && N<ArraySize(azCompileOpt) ){
17566 return azCompileOpt[N];
17567 }
17568 return 0;
17569 }
@@ -18269,11 +18293,11 @@
18269 }
18270
18271 /*
18272 ** Query status information.
18273 */
18274 SQLITE_API int SQLITE_STDCALL sqlite3_status64(
18275 int op,
18276 sqlite3_int64 *pCurrent,
18277 sqlite3_int64 *pHighwater,
18278 int resetFlag
18279 ){
@@ -18294,11 +18318,11 @@
18294 }
18295 sqlite3_mutex_leave(pMutex);
18296 (void)pMutex; /* Prevent warning when SQLITE_THREADSAFE=0 */
18297 return SQLITE_OK;
18298 }
18299 SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){
18300 sqlite3_int64 iCur, iHwtr;
18301 int rc;
18302 #ifdef SQLITE_ENABLE_API_ARMOR
18303 if( pCurrent==0 || pHighwater==0 ) return SQLITE_MISUSE_BKPT;
18304 #endif
@@ -18311,11 +18335,11 @@
18311 }
18312
18313 /*
18314 ** Query status information for a single database connection
18315 */
18316 SQLITE_API int SQLITE_STDCALL sqlite3_db_status(
18317 sqlite3 *db, /* The database connection whose status is desired */
18318 int op, /* Status verb */
18319 int *pCurrent, /* Write current value here */
18320 int *pHighwater, /* Write high-water mark here */
18321 int resetFlag /* Reset high-water mark if true */
@@ -19989,11 +20013,11 @@
19989
19990 /*
19991 ** Locate a VFS by name. If no name is given, simply return the
19992 ** first VFS on the list.
19993 */
19994 SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfs){
19995 sqlite3_vfs *pVfs = 0;
19996 #if SQLITE_THREADSAFE
19997 sqlite3_mutex *mutex;
19998 #endif
19999 #ifndef SQLITE_OMIT_AUTOINIT
@@ -20035,11 +20059,11 @@
20035 /*
20036 ** Register a VFS with the system. It is harmless to register the same
20037 ** VFS multiple times. The new VFS becomes the default if makeDflt is
20038 ** true.
20039 */
20040 SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){
20041 MUTEX_LOGIC(sqlite3_mutex *mutex;)
20042 #ifndef SQLITE_OMIT_AUTOINIT
20043 int rc = sqlite3_initialize();
20044 if( rc ) return rc;
20045 #endif
@@ -20063,11 +20087,11 @@
20063 }
20064
20065 /*
20066 ** Unregister a VFS so that it is no longer accessible.
20067 */
20068 SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs *pVfs){
20069 #if SQLITE_THREADSAFE
20070 sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
20071 #endif
20072 sqlite3_mutex_enter(mutex);
20073 vfsUnlink(pVfs);
@@ -22414,11 +22438,11 @@
22414 }
22415
22416 /*
22417 ** Retrieve a pointer to a static mutex or allocate a new dynamic one.
22418 */
22419 SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int id){
22420 #ifndef SQLITE_OMIT_AUTOINIT
22421 if( id<=SQLITE_MUTEX_RECURSIVE && sqlite3_initialize() ) return 0;
22422 if( id>SQLITE_MUTEX_RECURSIVE && sqlite3MutexInit() ) return 0;
22423 #endif
22424 assert( sqlite3GlobalConfig.mutex.xMutexAlloc );
@@ -22435,11 +22459,11 @@
22435 }
22436
22437 /*
22438 ** Free a dynamic mutex.
22439 */
22440 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex *p){
22441 if( p ){
22442 assert( sqlite3GlobalConfig.mutex.xMutexFree );
22443 sqlite3GlobalConfig.mutex.xMutexFree(p);
22444 }
22445 }
@@ -22446,11 +22470,11 @@
22446
22447 /*
22448 ** Obtain the mutex p. If some other thread already has the mutex, block
22449 ** until it can be obtained.
22450 */
22451 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex *p){
22452 if( p ){
22453 assert( sqlite3GlobalConfig.mutex.xMutexEnter );
22454 sqlite3GlobalConfig.mutex.xMutexEnter(p);
22455 }
22456 }
@@ -22457,11 +22481,11 @@
22457
22458 /*
22459 ** Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another
22460 ** thread holds the mutex and it cannot be obtained, return SQLITE_BUSY.
22461 */
22462 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex *p){
22463 int rc = SQLITE_OK;
22464 if( p ){
22465 assert( sqlite3GlobalConfig.mutex.xMutexTry );
22466 return sqlite3GlobalConfig.mutex.xMutexTry(p);
22467 }
@@ -22472,11 +22496,11 @@
22472 ** The sqlite3_mutex_leave() routine exits a mutex that was previously
22473 ** entered by the same thread. The behavior is undefined if the mutex
22474 ** is not currently entered. If a NULL pointer is passed as an argument
22475 ** this function is a no-op.
22476 */
22477 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex *p){
22478 if( p ){
22479 assert( sqlite3GlobalConfig.mutex.xMutexLeave );
22480 sqlite3GlobalConfig.mutex.xMutexLeave(p);
22481 }
22482 }
@@ -22484,15 +22508,15 @@
22484 #ifndef NDEBUG
22485 /*
22486 ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are
22487 ** intended for use inside assert() statements.
22488 */
22489 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex *p){
22490 assert( p==0 || sqlite3GlobalConfig.mutex.xMutexHeld );
22491 return p==0 || sqlite3GlobalConfig.mutex.xMutexHeld(p);
22492 }
22493 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex *p){
22494 assert( p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld );
22495 return p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld(p);
22496 }
22497 #endif
22498
@@ -23520,12 +23544,12 @@
23520 ** of the sqlite3_initialize() and sqlite3_shutdown() processing, the
23521 ** "interlocked" magic used here is probably not strictly necessary.
23522 */
23523 static LONG SQLITE_WIN32_VOLATILE winMutex_lock = 0;
23524
23525 SQLITE_API int SQLITE_STDCALL sqlite3_win32_is_nt(void); /* os_win.c */
23526 SQLITE_API void SQLITE_STDCALL sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */
23527
23528 static int winMutexInit(void){
23529 /* The first to increment to 1 does actual initialization */
23530 if( InterlockedCompareExchange(&winMutex_lock, 1, 0)==0 ){
23531 int i;
@@ -23821,11 +23845,11 @@
23821 /*
23822 ** Attempt to release up to n bytes of non-essential memory currently
23823 ** held by SQLite. An example of non-essential memory is memory used to
23824 ** cache database pages that are not currently in use.
23825 */
23826 SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int n){
23827 #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
23828 return sqlite3PcacheReleaseMemory(n);
23829 #else
23830 /* IMPLEMENTATION-OF: R-34391-24921 The sqlite3_release_memory() routine
23831 ** is a no-op returning zero if SQLite is not compiled with
@@ -23880,11 +23904,11 @@
23880 /*
23881 ** Deprecated external interface. It used to set an alarm callback
23882 ** that was invoked when memory usage grew too large. Now it is a
23883 ** no-op.
23884 */
23885 SQLITE_API int SQLITE_STDCALL sqlite3_memory_alarm(
23886 void(*xCallback)(void *pArg, sqlite3_int64 used,int N),
23887 void *pArg,
23888 sqlite3_int64 iThreshold
23889 ){
23890 (void)xCallback;
@@ -23896,11 +23920,11 @@
23896
23897 /*
23898 ** Set the soft heap-size limit for the library. Passing a zero or
23899 ** negative value indicates no limit.
23900 */
23901 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 n){
23902 sqlite3_int64 priorLimit;
23903 sqlite3_int64 excess;
23904 sqlite3_int64 nUsed;
23905 #ifndef SQLITE_OMIT_AUTOINIT
23906 int rc = sqlite3_initialize();
@@ -23918,11 +23942,11 @@
23918 sqlite3_mutex_leave(mem0.mutex);
23919 excess = sqlite3_memory_used() - n;
23920 if( excess>0 ) sqlite3_release_memory((int)(excess & 0x7fffffff));
23921 return priorLimit;
23922 }
23923 SQLITE_API void SQLITE_STDCALL sqlite3_soft_heap_limit(int n){
23924 if( n<0 ) n = 0;
23925 sqlite3_soft_heap_limit64(n);
23926 }
23927
23928 /*
@@ -23987,11 +24011,11 @@
23987 }
23988
23989 /*
23990 ** Return the amount of memory currently checked out.
23991 */
23992 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void){
23993 sqlite3_int64 res, mx;
23994 sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, 0);
23995 return res;
23996 }
23997
@@ -23998,11 +24022,11 @@
23998 /*
23999 ** Return the maximum amount of memory that has ever been
24000 ** checked out since either the beginning of this process
24001 ** or since the most recent reset.
24002 */
24003 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag){
24004 sqlite3_int64 res, mx;
24005 sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, resetFlag);
24006 return mx;
24007 }
24008
@@ -24078,17 +24102,17 @@
24078 /*
24079 ** This version of the memory allocation is for use by the application.
24080 ** First make sure the memory subsystem is initialized, then do the
24081 ** allocation.
24082 */
24083 SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int n){
24084 #ifndef SQLITE_OMIT_AUTOINIT
24085 if( sqlite3_initialize() ) return 0;
24086 #endif
24087 return n<=0 ? 0 : sqlite3Malloc(n);
24088 }
24089 SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64 n){
24090 #ifndef SQLITE_OMIT_AUTOINIT
24091 if( sqlite3_initialize() ) return 0;
24092 #endif
24093 return sqlite3Malloc(n);
24094 }
@@ -24227,20 +24251,20 @@
24227 }else{
24228 assert( sqlite3_mutex_held(db->mutex) );
24229 return db->lookaside.sz;
24230 }
24231 }
24232 SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void *p){
24233 assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) );
24234 assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
24235 return p ? sqlite3GlobalConfig.m.xSize(p) : 0;
24236 }
24237
24238 /*
24239 ** Free memory previously obtained from sqlite3Malloc().
24240 */
24241 SQLITE_API void SQLITE_STDCALL sqlite3_free(void *p){
24242 if( p==0 ) return; /* IMP: R-49053-54554 */
24243 assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
24244 assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) );
24245 if( sqlite3GlobalConfig.bMemstat ){
24246 sqlite3_mutex_enter(mem0.mutex);
@@ -24345,18 +24369,18 @@
24345
24346 /*
24347 ** The public interface to sqlite3Realloc. Make sure that the memory
24348 ** subsystem is initialized prior to invoking sqliteRealloc.
24349 */
24350 SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void *pOld, int n){
24351 #ifndef SQLITE_OMIT_AUTOINIT
24352 if( sqlite3_initialize() ) return 0;
24353 #endif
24354 if( n<0 ) n = 0; /* IMP: R-26507-47431 */
24355 return sqlite3Realloc(pOld, n);
24356 }
24357 SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void *pOld, sqlite3_uint64 n){
24358 #ifndef SQLITE_OMIT_AUTOINIT
24359 if( sqlite3_initialize() ) return 0;
24360 #endif
24361 return sqlite3Realloc(pOld, n);
24362 }
@@ -25579,11 +25603,11 @@
25579
25580 /*
25581 ** Print into memory obtained from sqlite3_malloc(). Omit the internal
25582 ** %-conversion extensions.
25583 */
25584 SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char *zFormat, va_list ap){
25585 char *z;
25586 char zBase[SQLITE_PRINT_BUF_SIZE];
25587 StrAccum acc;
25588
25589 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -25628,11 +25652,11 @@
25628 ** this without breaking compatibility, so we just have to live with the
25629 ** mistake.
25630 **
25631 ** sqlite3_vsnprintf() is the varargs version.
25632 */
25633 SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int n, char *zBuf, const char *zFormat, va_list ap){
25634 StrAccum acc;
25635 if( n<=0 ) return zBuf;
25636 #ifdef SQLITE_ENABLE_API_ARMOR
25637 if( zBuf==0 || zFormat==0 ) {
25638 (void)SQLITE_MISUSE_BKPT;
@@ -26255,11 +26279,11 @@
26255 } sqlite3Prng;
26256
26257 /*
26258 ** Return N random bytes.
26259 */
26260 SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *pBuf){
26261 unsigned char t;
26262 unsigned char *zBuf = pBuf;
26263
26264 /* The "wsdPrng" macro will resolve to the pseudo-random number generator
26265 ** state vector. If writable static data is unsupported on the target,
@@ -27458,11 +27482,11 @@
27458 ** sqlite3_strnicmp() APIs allow applications and extensions to compare
27459 ** the contents of two buffers containing UTF-8 strings in a
27460 ** case-independent fashion, using the same definition of "case
27461 ** independence" that SQLite uses internally when comparing identifiers.
27462 */
27463 SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *zLeft, const char *zRight){
27464 if( zLeft==0 ){
27465 return zRight ? -1 : 0;
27466 }else if( zRight==0 ){
27467 return 1;
27468 }
@@ -27479,11 +27503,11 @@
27479 a++;
27480 b++;
27481 }
27482 return c;
27483 }
27484 SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){
27485 register unsigned char *a, *b;
27486 if( zLeft==0 ){
27487 return zRight ? -1 : 0;
27488 }else if( zRight==0 ){
27489 return 1;
@@ -36778,11 +36802,11 @@
36778 ** This routine is called once during SQLite initialization and by a
36779 ** single thread. The memory allocation and mutex subsystems have not
36780 ** necessarily been initialized when this routine is called, and so they
36781 ** should not be used.
36782 */
36783 SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void){
36784 /*
36785 ** The following macro defines an initializer for an sqlite3_vfs object.
36786 ** The name of the VFS is NAME. The pAppData is a pointer to a pointer
36787 ** to the "finder" function. (pAppData is a pointer to a pointer because
36788 ** silly C90 rules prohibit a void* from being cast to a function pointer
@@ -36877,11 +36901,11 @@
36877 **
36878 ** Some operating systems might need to do some cleanup in this routine,
36879 ** to release dynamically allocated objects. But not on unix.
36880 ** This routine is a no-op for unix.
36881 */
36882 SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void){
36883 return SQLITE_OK;
36884 }
36885
36886 #endif /* SQLITE_OS_UNIX */
36887
@@ -38312,11 +38336,11 @@
38312 ** compact it. Upon success, SQLITE_OK will be returned. Upon failure, one
38313 ** of SQLITE_NOMEM, SQLITE_ERROR, or SQLITE_NOTFOUND will be returned. The
38314 ** "pnLargest" argument, if non-zero, will be used to return the size of the
38315 ** largest committed free block in the heap, in bytes.
38316 */
38317 SQLITE_API int SQLITE_STDCALL sqlite3_win32_compact_heap(LPUINT pnLargest){
38318 int rc = SQLITE_OK;
38319 UINT nLargest = 0;
38320 HANDLE hHeap;
38321
38322 winMemAssertMagic();
@@ -38352,11 +38376,11 @@
38352 ** If a Win32 native heap has been configured, this function will attempt to
38353 ** destroy and recreate it. If the Win32 native heap is not isolated and/or
38354 ** the sqlite3_memory_used() function does not return zero, SQLITE_BUSY will
38355 ** be returned and no changes will be made to the Win32 native heap.
38356 */
38357 SQLITE_API int SQLITE_STDCALL sqlite3_win32_reset_heap(){
38358 int rc;
38359 MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */
38360 MUTEX_LOGIC( sqlite3_mutex *pMem; ) /* The memsys static mutex */
38361 MUTEX_LOGIC( pMaster = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); )
38362 MUTEX_LOGIC( pMem = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM); )
@@ -38397,11 +38421,11 @@
38397 /*
38398 ** This function outputs the specified (ANSI) string to the Win32 debugger
38399 ** (if available).
38400 */
38401
38402 SQLITE_API void SQLITE_STDCALL sqlite3_win32_write_debug(const char *zBuf, int nBuf){
38403 char zDbgBuf[SQLITE_WIN32_DBG_BUF_SIZE];
38404 int nMin = MIN(nBuf, (SQLITE_WIN32_DBG_BUF_SIZE - 1)); /* may be negative. */
38405 if( nMin<-1 ) nMin = -1; /* all negative values become -1. */
38406 assert( nMin==-1 || nMin==0 || nMin<SQLITE_WIN32_DBG_BUF_SIZE );
38407 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -38443,11 +38467,11 @@
38443 */
38444 #if SQLITE_OS_WINRT
38445 static HANDLE sleepObj = NULL;
38446 #endif
38447
38448 SQLITE_API void SQLITE_STDCALL sqlite3_win32_sleep(DWORD milliseconds){
38449 #if SQLITE_OS_WINRT
38450 if ( sleepObj==NULL ){
38451 sleepObj = osCreateEventExW(NULL, NULL, CREATE_EVENT_MANUAL_RESET,
38452 SYNCHRONIZE);
38453 }
@@ -38492,11 +38516,11 @@
38492
38493 /*
38494 ** This function determines if the machine is running a version of Windows
38495 ** based on the NT kernel.
38496 */
38497 SQLITE_API int SQLITE_STDCALL sqlite3_win32_is_nt(void){
38498 #if SQLITE_OS_WINRT
38499 /*
38500 ** NOTE: The WinRT sub-platform is always assumed to be based on the NT
38501 ** kernel.
38502 */
@@ -38880,11 +38904,11 @@
38880 }
38881
38882 /*
38883 ** This is a public wrapper for the winUtf8ToUnicode() function.
38884 */
38885 SQLITE_API LPWSTR SQLITE_STDCALL sqlite3_win32_utf8_to_unicode(const char *zText){
38886 #ifdef SQLITE_ENABLE_API_ARMOR
38887 if( !zText ){
38888 (void)SQLITE_MISUSE_BKPT;
38889 return 0;
38890 }
@@ -38896,11 +38920,11 @@
38896 }
38897
38898 /*
38899 ** This is a public wrapper for the winUnicodeToUtf8() function.
38900 */
38901 SQLITE_API char *SQLITE_STDCALL sqlite3_win32_unicode_to_utf8(LPCWSTR zWideText){
38902 #ifdef SQLITE_ENABLE_API_ARMOR
38903 if( !zWideText ){
38904 (void)SQLITE_MISUSE_BKPT;
38905 return 0;
38906 }
@@ -38912,11 +38936,11 @@
38912 }
38913
38914 /*
38915 ** This is a public wrapper for the winMbcsToUtf8() function.
38916 */
38917 SQLITE_API char *SQLITE_STDCALL sqlite3_win32_mbcs_to_utf8(const char *zText){
38918 #ifdef SQLITE_ENABLE_API_ARMOR
38919 if( !zText ){
38920 (void)SQLITE_MISUSE_BKPT;
38921 return 0;
38922 }
@@ -38928,11 +38952,11 @@
38928 }
38929
38930 /*
38931 ** This is a public wrapper for the winMbcsToUtf8() function.
38932 */
38933 SQLITE_API char *SQLITE_STDCALL sqlite3_win32_mbcs_to_utf8_v2(const char *zText, int useAnsi){
38934 #ifdef SQLITE_ENABLE_API_ARMOR
38935 if( !zText ){
38936 (void)SQLITE_MISUSE_BKPT;
38937 return 0;
38938 }
@@ -38944,11 +38968,11 @@
38944 }
38945
38946 /*
38947 ** This is a public wrapper for the winUtf8ToMbcs() function.
38948 */
38949 SQLITE_API char *SQLITE_STDCALL sqlite3_win32_utf8_to_mbcs(const char *zText){
38950 #ifdef SQLITE_ENABLE_API_ARMOR
38951 if( !zText ){
38952 (void)SQLITE_MISUSE_BKPT;
38953 return 0;
38954 }
@@ -38960,11 +38984,11 @@
38960 }
38961
38962 /*
38963 ** This is a public wrapper for the winUtf8ToMbcs() function.
38964 */
38965 SQLITE_API char *SQLITE_STDCALL sqlite3_win32_utf8_to_mbcs_v2(const char *zText, int useAnsi){
38966 #ifdef SQLITE_ENABLE_API_ARMOR
38967 if( !zText ){
38968 (void)SQLITE_MISUSE_BKPT;
38969 return 0;
38970 }
@@ -38980,11 +39004,11 @@
38980 ** the provided arguments. The type argument must be 1 in order to set the
38981 ** data directory or 2 in order to set the temporary directory. The zValue
38982 ** argument is the name of the directory to use. The return value will be
38983 ** SQLITE_OK if successful.
38984 */
38985 SQLITE_API int SQLITE_STDCALL sqlite3_win32_set_directory(DWORD type, LPCWSTR zValue){
38986 char **ppDirectory = 0;
38987 #ifndef SQLITE_OMIT_AUTOINIT
38988 int rc = sqlite3_initialize();
38989 if( rc ) return rc;
38990 #endif
@@ -42898,11 +42922,11 @@
42898 }
42899
42900 /*
42901 ** Initialize and deinitialize the operating system interface.
42902 */
42903 SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void){
42904 static sqlite3_vfs winVfs = {
42905 3, /* iVersion */
42906 sizeof(winFile), /* szOsFile */
42907 SQLITE_WIN32_MAX_PATH_BYTES, /* mxPathname */
42908 0, /* pNext */
@@ -43029,11 +43053,11 @@
43029 #endif
43030
43031 return SQLITE_OK;
43032 }
43033
43034 SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void){
43035 #if SQLITE_OS_WINRT
43036 if( sleepObj!=NULL ){
43037 osCloseHandle(sleepObj);
43038 sleepObj = NULL;
43039 }
@@ -57024,11 +57048,11 @@
57024
57025 /*
57026 ** Return a +ve value if snapshot p1 is newer than p2. A -ve value if
57027 ** p1 is older than p2 and zero if p1 and p2 are the same snapshot.
57028 */
57029 SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_cmp(sqlite3_snapshot *p1, sqlite3_snapshot *p2){
57030 WalIndexHdr *pHdr1 = (WalIndexHdr*)p1;
57031 WalIndexHdr *pHdr2 = (WalIndexHdr*)p2;
57032
57033 /* aSalt[0] is a copy of the value stored in the wal file header. It
57034 ** is incremented each time the wal file is restarted. */
@@ -58161,11 +58185,11 @@
58161 **
58162 ** This routine has no effect on existing database connections.
58163 ** The shared cache setting effects only future calls to
58164 ** sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2().
58165 */
58166 SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int enable){
58167 sqlite3GlobalConfig.sharedCacheEnabled = enable;
58168 return SQLITE_OK;
58169 }
58170 #endif
58171
@@ -67934,11 +67958,11 @@
67934 ** a pointer to the new sqlite3_backup object.
67935 **
67936 ** If an error occurs, NULL is returned and an error code and error message
67937 ** stored in database handle pDestDb.
67938 */
67939 SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
67940 sqlite3* pDestDb, /* Database to write to */
67941 const char *zDestDb, /* Name of database within pDestDb */
67942 sqlite3* pSrcDb, /* Database connection to read from */
67943 const char *zSrcDb /* Name of database within pSrcDb */
67944 ){
@@ -68142,11 +68166,11 @@
68142 }
68143
68144 /*
68145 ** Copy nPage pages from the source b-tree to the destination.
68146 */
68147 SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage){
68148 int rc;
68149 int destMode; /* Destination journal mode */
68150 int pgszSrc = 0; /* Source page size */
68151 int pgszDest = 0; /* Destination page size */
68152
@@ -68386,11 +68410,11 @@
68386 }
68387
68388 /*
68389 ** Release all resources associated with an sqlite3_backup* handle.
68390 */
68391 SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p){
68392 sqlite3_backup **pp; /* Ptr to head of pagers backup list */
68393 sqlite3 *pSrcDb; /* Source database connection */
68394 int rc; /* Value to return */
68395
68396 /* Enter the mutexes */
@@ -68438,11 +68462,11 @@
68438
68439 /*
68440 ** Return the number of pages still to be backed up as of the most recent
68441 ** call to sqlite3_backup_step().
68442 */
68443 SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p){
68444 #ifdef SQLITE_ENABLE_API_ARMOR
68445 if( p==0 ){
68446 (void)SQLITE_MISUSE_BKPT;
68447 return 0;
68448 }
@@ -68452,11 +68476,11 @@
68452
68453 /*
68454 ** Return the total number of pages in the source database as of the most
68455 ** recent call to sqlite3_backup_step().
68456 */
68457 SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p){
68458 #ifdef SQLITE_ENABLE_API_ARMOR
68459 if( p==0 ){
68460 (void)SQLITE_MISUSE_BKPT;
68461 return 0;
68462 }
@@ -74906,11 +74930,11 @@
74906 ** execution environment changes in a way that would alter the program
74907 ** that sqlite3_prepare() generates. For example, if new functions or
74908 ** collating sequences are registered or if an authorizer function is
74909 ** added or changed.
74910 */
74911 SQLITE_API int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt *pStmt){
74912 Vdbe *p = (Vdbe*)pStmt;
74913 return p==0 || p->expired;
74914 }
74915 #endif
74916
@@ -74975,11 +74999,11 @@
74975 ** machine.
74976 **
74977 ** This routine sets the error code and string returned by
74978 ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
74979 */
74980 SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt){
74981 int rc;
74982 if( pStmt==0 ){
74983 /* IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL
74984 ** pointer is a harmless no-op. */
74985 rc = SQLITE_OK;
@@ -75002,11 +75026,11 @@
75002 ** the prior execution is returned.
75003 **
75004 ** This routine sets the error code and string returned by
75005 ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
75006 */
75007 SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt){
75008 int rc;
75009 if( pStmt==0 ){
75010 rc = SQLITE_OK;
75011 }else{
75012 Vdbe *v = (Vdbe*)pStmt;
@@ -75023,11 +75047,11 @@
75023 }
75024
75025 /*
75026 ** Set all the parameters in the compiled SQL statement to NULL.
75027 */
75028 SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt *pStmt){
75029 int i;
75030 int rc = SQLITE_OK;
75031 Vdbe *p = (Vdbe*)pStmt;
75032 #if SQLITE_THREADSAFE
75033 sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex;
@@ -75047,11 +75071,11 @@
75047
75048 /**************************** sqlite3_value_ *******************************
75049 ** The following routines extract information from a Mem or sqlite3_value
75050 ** structure.
75051 */
75052 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value *pVal){
75053 Mem *p = (Mem*)pVal;
75054 if( p->flags & (MEM_Blob|MEM_Str) ){
75055 if( sqlite3VdbeMemExpandBlob(p)!=SQLITE_OK ){
75056 assert( p->flags==MEM_Null && p->z==0 );
75057 return 0;
@@ -75060,48 +75084,48 @@
75060 return p->n ? p->z : 0;
75061 }else{
75062 return sqlite3_value_text(pVal);
75063 }
75064 }
75065 SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value *pVal){
75066 return sqlite3ValueBytes(pVal, SQLITE_UTF8);
75067 }
75068 SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value *pVal){
75069 return sqlite3ValueBytes(pVal, SQLITE_UTF16NATIVE);
75070 }
75071 SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value *pVal){
75072 return sqlite3VdbeRealValue((Mem*)pVal);
75073 }
75074 SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value *pVal){
75075 return (int)sqlite3VdbeIntValue((Mem*)pVal);
75076 }
75077 SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value *pVal){
75078 return sqlite3VdbeIntValue((Mem*)pVal);
75079 }
75080 SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value *pVal){
75081 Mem *pMem = (Mem*)pVal;
75082 return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0);
75083 }
75084 SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value *pVal){
75085 return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
75086 }
75087 #ifndef SQLITE_OMIT_UTF16
75088 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value* pVal){
75089 return sqlite3ValueText(pVal, SQLITE_UTF16NATIVE);
75090 }
75091 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value *pVal){
75092 return sqlite3ValueText(pVal, SQLITE_UTF16BE);
75093 }
75094 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value *pVal){
75095 return sqlite3ValueText(pVal, SQLITE_UTF16LE);
75096 }
75097 #endif /* SQLITE_OMIT_UTF16 */
75098 /* EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five
75099 ** fundamental datatypes: 64-bit signed integer 64-bit IEEE floating
75100 ** point number string BLOB NULL
75101 */
75102 SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value* pVal){
75103 static const u8 aType[] = {
75104 SQLITE_BLOB, /* 0x00 */
75105 SQLITE_NULL, /* 0x01 */
75106 SQLITE_TEXT, /* 0x02 */
75107 SQLITE_NULL, /* 0x03 */
@@ -75137,11 +75161,11 @@
75137 return aType[pVal->flags&MEM_AffMask];
75138 }
75139
75140 /* Make a copy of an sqlite3_value object
75141 */
75142 SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value *pOrig){
75143 sqlite3_value *pNew;
75144 if( pOrig==0 ) return 0;
75145 pNew = sqlite3_malloc( sizeof(*pNew) );
75146 if( pNew==0 ) return 0;
75147 memset(pNew, 0, sizeof(*pNew));
@@ -75160,11 +75184,11 @@
75160 }
75161
75162 /* Destroy an sqlite3_value object previously obtained from
75163 ** sqlite3_value_dup().
75164 */
75165 SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value *pOld){
75166 sqlite3ValueFree(pOld);
75167 }
75168
75169
75170 /**************************** sqlite3_result_ *******************************
@@ -75203,21 +75227,21 @@
75203 xDel((void*)p);
75204 }
75205 if( pCtx ) sqlite3_result_error_toobig(pCtx);
75206 return SQLITE_TOOBIG;
75207 }
75208 SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(
75209 sqlite3_context *pCtx,
75210 const void *z,
75211 int n,
75212 void (*xDel)(void *)
75213 ){
75214 assert( n>=0 );
75215 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75216 setResultStrOrError(pCtx, z, n, 0, xDel);
75217 }
75218 SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(
75219 sqlite3_context *pCtx,
75220 const void *z,
75221 sqlite3_uint64 n,
75222 void (*xDel)(void *)
75223 ){
@@ -75227,56 +75251,56 @@
75227 (void)invokeValueDestructor(z, xDel, pCtx);
75228 }else{
75229 setResultStrOrError(pCtx, z, (int)n, 0, xDel);
75230 }
75231 }
75232 SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context *pCtx, double rVal){
75233 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75234 sqlite3VdbeMemSetDouble(pCtx->pOut, rVal);
75235 }
75236 SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
75237 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75238 pCtx->isError = SQLITE_ERROR;
75239 pCtx->fErrorOrAux = 1;
75240 sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF8, SQLITE_TRANSIENT);
75241 }
75242 #ifndef SQLITE_OMIT_UTF16
75243 SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){
75244 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75245 pCtx->isError = SQLITE_ERROR;
75246 pCtx->fErrorOrAux = 1;
75247 sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF16NATIVE, SQLITE_TRANSIENT);
75248 }
75249 #endif
75250 SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context *pCtx, int iVal){
75251 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75252 sqlite3VdbeMemSetInt64(pCtx->pOut, (i64)iVal);
75253 }
75254 SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
75255 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75256 sqlite3VdbeMemSetInt64(pCtx->pOut, iVal);
75257 }
75258 SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context *pCtx){
75259 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75260 sqlite3VdbeMemSetNull(pCtx->pOut);
75261 }
75262 SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){
75263 Mem *pOut = pCtx->pOut;
75264 assert( sqlite3_mutex_held(pOut->db->mutex) );
75265 pOut->eSubtype = eSubtype & 0xff;
75266 pOut->flags |= MEM_Subtype;
75267 }
75268 SQLITE_API void SQLITE_STDCALL sqlite3_result_text(
75269 sqlite3_context *pCtx,
75270 const char *z,
75271 int n,
75272 void (*xDel)(void *)
75273 ){
75274 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75275 setResultStrOrError(pCtx, z, n, SQLITE_UTF8, xDel);
75276 }
75277 SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(
75278 sqlite3_context *pCtx,
75279 const char *z,
75280 sqlite3_uint64 n,
75281 void (*xDel)(void *),
75282 unsigned char enc
@@ -75289,56 +75313,56 @@
75289 }else{
75290 setResultStrOrError(pCtx, z, (int)n, enc, xDel);
75291 }
75292 }
75293 #ifndef SQLITE_OMIT_UTF16
75294 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(
75295 sqlite3_context *pCtx,
75296 const void *z,
75297 int n,
75298 void (*xDel)(void *)
75299 ){
75300 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75301 setResultStrOrError(pCtx, z, n, SQLITE_UTF16NATIVE, xDel);
75302 }
75303 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(
75304 sqlite3_context *pCtx,
75305 const void *z,
75306 int n,
75307 void (*xDel)(void *)
75308 ){
75309 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75310 setResultStrOrError(pCtx, z, n, SQLITE_UTF16BE, xDel);
75311 }
75312 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(
75313 sqlite3_context *pCtx,
75314 const void *z,
75315 int n,
75316 void (*xDel)(void *)
75317 ){
75318 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75319 setResultStrOrError(pCtx, z, n, SQLITE_UTF16LE, xDel);
75320 }
75321 #endif /* SQLITE_OMIT_UTF16 */
75322 SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){
75323 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75324 sqlite3VdbeMemCopy(pCtx->pOut, pValue);
75325 }
75326 SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){
75327 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75328 sqlite3VdbeMemSetZeroBlob(pCtx->pOut, n);
75329 }
75330 SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){
75331 Mem *pOut = pCtx->pOut;
75332 assert( sqlite3_mutex_held(pOut->db->mutex) );
75333 if( n>(u64)pOut->db->aLimit[SQLITE_LIMIT_LENGTH] ){
75334 return SQLITE_TOOBIG;
75335 }
75336 sqlite3VdbeMemSetZeroBlob(pCtx->pOut, (int)n);
75337 return SQLITE_OK;
75338 }
75339 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){
75340 pCtx->isError = errCode;
75341 pCtx->fErrorOrAux = 1;
75342 #ifdef SQLITE_DEBUG
75343 if( pCtx->pVdbe ) pCtx->pVdbe->rcApp = errCode;
75344 #endif
@@ -75347,20 +75371,20 @@
75347 SQLITE_UTF8, SQLITE_STATIC);
75348 }
75349 }
75350
75351 /* Force an SQLITE_TOOBIG error. */
75352 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context *pCtx){
75353 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75354 pCtx->isError = SQLITE_TOOBIG;
75355 pCtx->fErrorOrAux = 1;
75356 sqlite3VdbeMemSetStr(pCtx->pOut, "string or blob too big", -1,
75357 SQLITE_UTF8, SQLITE_STATIC);
75358 }
75359
75360 /* An SQLITE_NOMEM error. */
75361 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context *pCtx){
75362 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75363 sqlite3VdbeMemSetNull(pCtx->pOut);
75364 pCtx->isError = SQLITE_NOMEM_BKPT;
75365 pCtx->fErrorOrAux = 1;
75366 sqlite3OomFault(pCtx->pOut->db);
@@ -75528,11 +75552,11 @@
75528 /*
75529 ** This is the top-level implementation of sqlite3_step(). Call
75530 ** sqlite3Step() to do most of the work. If a schema error occurs,
75531 ** call sqlite3Reprepare() and try again.
75532 */
75533 SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt *pStmt){
75534 int rc = SQLITE_OK; /* Result from sqlite3Step() */
75535 int rc2 = SQLITE_OK; /* Result from sqlite3Reprepare() */
75536 Vdbe *v = (Vdbe*)pStmt; /* the prepared statement */
75537 int cnt = 0; /* Counter to prevent infinite loop of reprepares */
75538 sqlite3 *db; /* The database connection */
@@ -75579,11 +75603,11 @@
75579
75580 /*
75581 ** Extract the user data from a sqlite3_context structure and return a
75582 ** pointer to it.
75583 */
75584 SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context *p){
75585 assert( p && p->pFunc );
75586 return p->pFunc->pUserData;
75587 }
75588
75589 /*
@@ -75594,11 +75618,11 @@
75594 ** returns a copy of the pointer to the database connection (the 1st
75595 ** parameter) of the sqlite3_create_function() and
75596 ** sqlite3_create_function16() routines that originally registered the
75597 ** application defined function.
75598 */
75599 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context *p){
75600 assert( p && p->pOut );
75601 return p->pOut->db;
75602 }
75603
75604 /*
@@ -75670,11 +75694,11 @@
75670 /*
75671 ** Allocate or return the aggregate context for a user function. A new
75672 ** context is allocated on the first call. Subsequent calls return the
75673 ** same context that was returned on prior calls.
75674 */
75675 SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context *p, int nByte){
75676 assert( p && p->pFunc && p->pFunc->xFinalize );
75677 assert( sqlite3_mutex_held(p->pOut->db->mutex) );
75678 testcase( nByte<0 );
75679 if( (p->pMem->flags & MEM_Agg)==0 ){
75680 return createAggContext(p, nByte);
@@ -75685,11 +75709,11 @@
75685
75686 /*
75687 ** Return the auxiliary data pointer, if any, for the iArg'th argument to
75688 ** the user-function defined by pCtx.
75689 */
75690 SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
75691 AuxData *pAuxData;
75692
75693 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75694 #if SQLITE_ENABLE_STAT3_OR_STAT4
75695 if( pCtx->pVdbe==0 ) return 0;
@@ -75706,11 +75730,11 @@
75706 /*
75707 ** Set the auxiliary data pointer and delete function, for the iArg'th
75708 ** argument to the user-function defined by pCtx. Any previous value is
75709 ** deleted by calling the delete function specified when it was set.
75710 */
75711 SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(
75712 sqlite3_context *pCtx,
75713 int iArg,
75714 void *pAux,
75715 void (*xDelete)(void*)
75716 ){
@@ -75761,29 +75785,29 @@
75761 ** This function is deprecated. Do not use it for new code. It is
75762 ** provide only to avoid breaking legacy code. New aggregate function
75763 ** implementations should keep their own counts within their aggregate
75764 ** context.
75765 */
75766 SQLITE_API int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context *p){
75767 assert( p && p->pMem && p->pFunc && p->pFunc->xFinalize );
75768 return p->pMem->n;
75769 }
75770 #endif
75771
75772 /*
75773 ** Return the number of columns in the result set for the statement pStmt.
75774 */
75775 SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt){
75776 Vdbe *pVm = (Vdbe *)pStmt;
75777 return pVm ? pVm->nResColumn : 0;
75778 }
75779
75780 /*
75781 ** Return the number of values available from the current row of the
75782 ** currently executing statement pStmt.
75783 */
75784 SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt){
75785 Vdbe *pVm = (Vdbe *)pStmt;
75786 if( pVm==0 || pVm->pResultSet==0 ) return 0;
75787 return pVm->nResColumn;
75788 }
75789
@@ -75882,67 +75906,67 @@
75882
75883 /**************************** sqlite3_column_ *******************************
75884 ** The following routines are used to access elements of the current row
75885 ** in the result set.
75886 */
75887 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt *pStmt, int i){
75888 const void *val;
75889 val = sqlite3_value_blob( columnMem(pStmt,i) );
75890 /* Even though there is no encoding conversion, value_blob() might
75891 ** need to call malloc() to expand the result of a zeroblob()
75892 ** expression.
75893 */
75894 columnMallocFailure(pStmt);
75895 return val;
75896 }
75897 SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){
75898 int val = sqlite3_value_bytes( columnMem(pStmt,i) );
75899 columnMallocFailure(pStmt);
75900 return val;
75901 }
75902 SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){
75903 int val = sqlite3_value_bytes16( columnMem(pStmt,i) );
75904 columnMallocFailure(pStmt);
75905 return val;
75906 }
75907 SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt *pStmt, int i){
75908 double val = sqlite3_value_double( columnMem(pStmt,i) );
75909 columnMallocFailure(pStmt);
75910 return val;
75911 }
75912 SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt *pStmt, int i){
75913 int val = sqlite3_value_int( columnMem(pStmt,i) );
75914 columnMallocFailure(pStmt);
75915 return val;
75916 }
75917 SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt *pStmt, int i){
75918 sqlite_int64 val = sqlite3_value_int64( columnMem(pStmt,i) );
75919 columnMallocFailure(pStmt);
75920 return val;
75921 }
75922 SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt *pStmt, int i){
75923 const unsigned char *val = sqlite3_value_text( columnMem(pStmt,i) );
75924 columnMallocFailure(pStmt);
75925 return val;
75926 }
75927 SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt *pStmt, int i){
75928 Mem *pOut = columnMem(pStmt, i);
75929 if( pOut->flags&MEM_Static ){
75930 pOut->flags &= ~MEM_Static;
75931 pOut->flags |= MEM_Ephem;
75932 }
75933 columnMallocFailure(pStmt);
75934 return (sqlite3_value *)pOut;
75935 }
75936 #ifndef SQLITE_OMIT_UTF16
75937 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt *pStmt, int i){
75938 const void *val = sqlite3_value_text16( columnMem(pStmt,i) );
75939 columnMallocFailure(pStmt);
75940 return val;
75941 }
75942 #endif /* SQLITE_OMIT_UTF16 */
75943 SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt *pStmt, int i){
75944 int iType = sqlite3_value_type( columnMem(pStmt,i) );
75945 columnMallocFailure(pStmt);
75946 return iType;
75947 }
75948
@@ -76002,16 +76026,16 @@
76002
76003 /*
76004 ** Return the name of the Nth column of the result set returned by SQL
76005 ** statement pStmt.
76006 */
76007 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt *pStmt, int N){
76008 return columnName(
76009 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_NAME);
76010 }
76011 #ifndef SQLITE_OMIT_UTF16
76012 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt *pStmt, int N){
76013 return columnName(
76014 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_NAME);
76015 }
76016 #endif
76017
@@ -76027,16 +76051,16 @@
76027 #ifndef SQLITE_OMIT_DECLTYPE
76028 /*
76029 ** Return the column declaration type (if applicable) of the 'i'th column
76030 ** of the result set of SQL statement pStmt.
76031 */
76032 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){
76033 return columnName(
76034 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DECLTYPE);
76035 }
76036 #ifndef SQLITE_OMIT_UTF16
76037 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){
76038 return columnName(
76039 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DECLTYPE);
76040 }
76041 #endif /* SQLITE_OMIT_UTF16 */
76042 #endif /* SQLITE_OMIT_DECLTYPE */
@@ -76045,16 +76069,16 @@
76045 /*
76046 ** Return the name of the database from which a result column derives.
76047 ** NULL is returned if the result column is an expression or constant or
76048 ** anything else which is not an unambiguous reference to a database column.
76049 */
76050 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){
76051 return columnName(
76052 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DATABASE);
76053 }
76054 #ifndef SQLITE_OMIT_UTF16
76055 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){
76056 return columnName(
76057 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DATABASE);
76058 }
76059 #endif /* SQLITE_OMIT_UTF16 */
76060
@@ -76061,16 +76085,16 @@
76061 /*
76062 ** Return the name of the table from which a result column derives.
76063 ** NULL is returned if the result column is an expression or constant or
76064 ** anything else which is not an unambiguous reference to a database column.
76065 */
76066 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){
76067 return columnName(
76068 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_TABLE);
76069 }
76070 #ifndef SQLITE_OMIT_UTF16
76071 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){
76072 return columnName(
76073 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_TABLE);
76074 }
76075 #endif /* SQLITE_OMIT_UTF16 */
76076
@@ -76077,16 +76101,16 @@
76077 /*
76078 ** Return the name of the table column from which a result column derives.
76079 ** NULL is returned if the result column is an expression or constant or
76080 ** anything else which is not an unambiguous reference to a database column.
76081 */
76082 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){
76083 return columnName(
76084 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_COLUMN);
76085 }
76086 #ifndef SQLITE_OMIT_UTF16
76087 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){
76088 return columnName(
76089 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_COLUMN);
76090 }
76091 #endif /* SQLITE_OMIT_UTF16 */
76092 #endif /* SQLITE_ENABLE_COLUMN_METADATA */
@@ -76183,11 +76207,11 @@
76183
76184
76185 /*
76186 ** Bind a blob value to an SQL statement variable.
76187 */
76188 SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(
76189 sqlite3_stmt *pStmt,
76190 int i,
76191 const void *zData,
76192 int nData,
76193 void (*xDel)(void*)
@@ -76195,11 +76219,11 @@
76195 #ifdef SQLITE_ENABLE_API_ARMOR
76196 if( nData<0 ) return SQLITE_MISUSE_BKPT;
76197 #endif
76198 return bindText(pStmt, i, zData, nData, xDel, 0);
76199 }
76200 SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(
76201 sqlite3_stmt *pStmt,
76202 int i,
76203 const void *zData,
76204 sqlite3_uint64 nData,
76205 void (*xDel)(void*)
@@ -76209,52 +76233,52 @@
76209 return invokeValueDestructor(zData, xDel, 0);
76210 }else{
76211 return bindText(pStmt, i, zData, (int)nData, xDel, 0);
76212 }
76213 }
76214 SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
76215 int rc;
76216 Vdbe *p = (Vdbe *)pStmt;
76217 rc = vdbeUnbind(p, i);
76218 if( rc==SQLITE_OK ){
76219 sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue);
76220 sqlite3_mutex_leave(p->db->mutex);
76221 }
76222 return rc;
76223 }
76224 SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){
76225 return sqlite3_bind_int64(p, i, (i64)iValue);
76226 }
76227 SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
76228 int rc;
76229 Vdbe *p = (Vdbe *)pStmt;
76230 rc = vdbeUnbind(p, i);
76231 if( rc==SQLITE_OK ){
76232 sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue);
76233 sqlite3_mutex_leave(p->db->mutex);
76234 }
76235 return rc;
76236 }
76237 SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
76238 int rc;
76239 Vdbe *p = (Vdbe*)pStmt;
76240 rc = vdbeUnbind(p, i);
76241 if( rc==SQLITE_OK ){
76242 sqlite3_mutex_leave(p->db->mutex);
76243 }
76244 return rc;
76245 }
76246 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(
76247 sqlite3_stmt *pStmt,
76248 int i,
76249 const char *zData,
76250 int nData,
76251 void (*xDel)(void*)
76252 ){
76253 return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8);
76254 }
76255 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(
76256 sqlite3_stmt *pStmt,
76257 int i,
76258 const char *zData,
76259 sqlite3_uint64 nData,
76260 void (*xDel)(void*),
@@ -76267,21 +76291,21 @@
76267 if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE;
76268 return bindText(pStmt, i, zData, (int)nData, xDel, enc);
76269 }
76270 }
76271 #ifndef SQLITE_OMIT_UTF16
76272 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(
76273 sqlite3_stmt *pStmt,
76274 int i,
76275 const void *zData,
76276 int nData,
76277 void (*xDel)(void*)
76278 ){
76279 return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE);
76280 }
76281 #endif /* SQLITE_OMIT_UTF16 */
76282 SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
76283 int rc;
76284 switch( sqlite3_value_type((sqlite3_value*)pValue) ){
76285 case SQLITE_INTEGER: {
76286 rc = sqlite3_bind_int64(pStmt, i, pValue->u.i);
76287 break;
@@ -76308,21 +76332,21 @@
76308 break;
76309 }
76310 }
76311 return rc;
76312 }
76313 SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
76314 int rc;
76315 Vdbe *p = (Vdbe *)pStmt;
76316 rc = vdbeUnbind(p, i);
76317 if( rc==SQLITE_OK ){
76318 sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n);
76319 sqlite3_mutex_leave(p->db->mutex);
76320 }
76321 return rc;
76322 }
76323 SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){
76324 int rc;
76325 Vdbe *p = (Vdbe *)pStmt;
76326 sqlite3_mutex_enter(p->db->mutex);
76327 if( n>(u64)p->db->aLimit[SQLITE_LIMIT_LENGTH] ){
76328 rc = SQLITE_TOOBIG;
@@ -76337,11 +76361,11 @@
76337
76338 /*
76339 ** Return the number of wildcards that can be potentially bound to.
76340 ** This routine is added to support DBD::SQLite.
76341 */
76342 SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
76343 Vdbe *p = (Vdbe*)pStmt;
76344 return p ? p->nVar : 0;
76345 }
76346
76347 /*
@@ -76348,11 +76372,11 @@
76348 ** Return the name of a wildcard parameter. Return NULL if the index
76349 ** is out of range or if the wildcard is unnamed.
76350 **
76351 ** The result is always UTF-8.
76352 */
76353 SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){
76354 Vdbe *p = (Vdbe*)pStmt;
76355 if( p==0 || i<1 || i>p->nzVar ){
76356 return 0;
76357 }
76358 return p->azVar[i-1];
@@ -76376,11 +76400,11 @@
76376 }
76377 }
76378 }
76379 return 0;
76380 }
76381 SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
76382 return sqlite3VdbeParameterIndex((Vdbe*)pStmt, zName, sqlite3Strlen30(zName));
76383 }
76384
76385 /*
76386 ** Transfer all bindings from the first statement over to the second.
@@ -76410,11 +76434,11 @@
76410 **
76411 ** If the two statements contain a different number of bindings, then
76412 ** an SQLITE_ERROR is returned. Nothing else can go wrong, so otherwise
76413 ** SQLITE_OK is returned.
76414 */
76415 SQLITE_API int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
76416 Vdbe *pFrom = (Vdbe*)pFromStmt;
76417 Vdbe *pTo = (Vdbe*)pToStmt;
76418 if( pFrom->nVar!=pTo->nVar ){
76419 return SQLITE_ERROR;
76420 }
@@ -76432,26 +76456,26 @@
76432 ** Return the sqlite3* database handle to which the prepared statement given
76433 ** in the argument belongs. This is the same database handle that was
76434 ** the first argument to the sqlite3_prepare() that was used to create
76435 ** the statement in the first place.
76436 */
76437 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt *pStmt){
76438 return pStmt ? ((Vdbe*)pStmt)->db : 0;
76439 }
76440
76441 /*
76442 ** Return true if the prepared statement is guaranteed to not modify the
76443 ** database.
76444 */
76445 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt){
76446 return pStmt ? ((Vdbe*)pStmt)->readOnly : 1;
76447 }
76448
76449 /*
76450 ** Return true if the prepared statement is in need of being reset.
76451 */
76452 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt *pStmt){
76453 Vdbe *v = (Vdbe*)pStmt;
76454 return v!=0 && v->pc>=0 && v->magic==VDBE_MAGIC_RUN;
76455 }
76456
76457 /*
@@ -76458,11 +76482,11 @@
76458 ** Return a pointer to the next prepared statement after pStmt associated
76459 ** with database connection pDb. If pStmt is NULL, return the first
76460 ** prepared statement for the database connection. Return NULL if there
76461 ** are no more.
76462 */
76463 SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){
76464 sqlite3_stmt *pNext;
76465 #ifdef SQLITE_ENABLE_API_ARMOR
76466 if( !sqlite3SafetyCheckOk(pDb) ){
76467 (void)SQLITE_MISUSE_BKPT;
76468 return 0;
@@ -76479,11 +76503,11 @@
76479 }
76480
76481 /*
76482 ** Return the value of a status counter for a prepared statement
76483 */
76484 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){
76485 Vdbe *pVdbe = (Vdbe*)pStmt;
76486 u32 v;
76487 #ifdef SQLITE_ENABLE_API_ARMOR
76488 if( !pStmt ){
76489 (void)SQLITE_MISUSE_BKPT;
@@ -76496,11 +76520,11 @@
76496 }
76497
76498 /*
76499 ** Return the SQL associated with a prepared statement
76500 */
76501 SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt){
76502 Vdbe *p = (Vdbe *)pStmt;
76503 return p ? p->zSql : 0;
76504 }
76505
76506 /*
@@ -76510,11 +76534,11 @@
76510 ** freeing the returned string by passing it to sqlite3_free().
76511 **
76512 ** The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of
76513 ** expanded bound parameters.
76514 */
76515 SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt){
76516 #ifdef SQLITE_OMIT_TRACE
76517 return 0;
76518 #else
76519 char *z = 0;
76520 const char *zSql = sqlite3_sql(pStmt);
@@ -76552,11 +76576,11 @@
76552
76553 /*
76554 ** This function is called from within a pre-update callback to retrieve
76555 ** a field of the row currently being updated or deleted.
76556 */
76557 SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
76558 PreUpdate *p = db->pPreUpdate;
76559 int rc = SQLITE_OK;
76560
76561 /* Test that this call is being made from within an SQLITE_DELETE or
76562 ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */
@@ -76607,11 +76631,11 @@
76607 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
76608 /*
76609 ** This function is called from within a pre-update callback to retrieve
76610 ** the number of columns in the row being updated, deleted or inserted.
76611 */
76612 SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *db){
76613 PreUpdate *p = db->pPreUpdate;
76614 return (p ? p->keyinfo.nField : 0);
76615 }
76616 #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
76617
@@ -76625,11 +76649,11 @@
76625 ** top-level trigger etc.).
76626 **
76627 ** For the purposes of the previous paragraph, a foreign key CASCADE, SET NULL
76628 ** or SET DEFAULT action is considered a trigger.
76629 */
76630 SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *db){
76631 PreUpdate *p = db->pPreUpdate;
76632 return (p ? p->v->nFrame : 0);
76633 }
76634 #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
76635
@@ -76636,11 +76660,11 @@
76636 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
76637 /*
76638 ** This function is called from within a pre-update callback to retrieve
76639 ** a field of the row currently being updated or inserted.
76640 */
76641 SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
76642 PreUpdate *p = db->pPreUpdate;
76643 int rc = SQLITE_OK;
76644 Mem *pMem;
76645
76646 if( !p || p->op==SQLITE_DELETE ){
@@ -76710,11 +76734,11 @@
76710
76711 #ifdef SQLITE_ENABLE_STMT_SCANSTATUS
76712 /*
76713 ** Return status data for a single loop within query pStmt.
76714 */
76715 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus(
76716 sqlite3_stmt *pStmt, /* Prepared statement being queried */
76717 int idx, /* Index of loop to report on */
76718 int iScanStatusOp, /* Which metric to return */
76719 void *pOut /* OUT: Write the answer here */
76720 ){
@@ -76769,11 +76793,11 @@
76769 }
76770
76771 /*
76772 ** Zero all counters associated with the sqlite3_stmt_scanstatus() data.
76773 */
76774 SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){
76775 Vdbe *p = (Vdbe*)pStmt;
76776 memset(p->anExec, 0, p->nOp * sizeof(i64));
76777 }
76778 #endif /* SQLITE_ENABLE_STMT_SCANSTATUS */
76779
@@ -77296,11 +77320,11 @@
77296 ** Try to convert the type of a function argument or a result column
77297 ** into a numeric representation. Use either INTEGER or REAL whichever
77298 ** is appropriate. But only do the conversion if it is possible without
77299 ** loss of information and return the revised type of the argument.
77300 */
77301 SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value *pVal){
77302 int eType = sqlite3_value_type(pVal);
77303 if( eType==SQLITE_TEXT ){
77304 Mem *pMem = (Mem*)pVal;
77305 applyNumericAffinity(pMem, 0);
77306 eType = sqlite3_value_type(pVal);
@@ -84148,11 +84172,11 @@
84148 }
84149
84150 /*
84151 ** Open a blob handle.
84152 */
84153 SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
84154 sqlite3* db, /* The database connection */
84155 const char *zDb, /* The attached database containing the blob */
84156 const char *zTable, /* The table containing the blob */
84157 const char *zColumn, /* The column containing the blob */
84158 sqlite_int64 iRow, /* The row containing the glob */
@@ -84389,11 +84413,11 @@
84389
84390 /*
84391 ** Close a blob handle that was previously created using
84392 ** sqlite3_blob_open().
84393 */
84394 SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *pBlob){
84395 Incrblob *p = (Incrblob *)pBlob;
84396 int rc;
84397 sqlite3 *db;
84398
84399 if( p ){
@@ -84482,28 +84506,28 @@
84482 }
84483
84484 /*
84485 ** Read data from a blob handle.
84486 */
84487 SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){
84488 return blobReadWrite(pBlob, z, n, iOffset, sqlite3BtreeData);
84489 }
84490
84491 /*
84492 ** Write data to a blob handle.
84493 */
84494 SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){
84495 return blobReadWrite(pBlob, (void *)z, n, iOffset, sqlite3BtreePutData);
84496 }
84497
84498 /*
84499 ** Query a blob handle for the size of the data.
84500 **
84501 ** The Incrblob.nByte field is fixed for the lifetime of the Incrblob
84502 ** so no mutex is required for access.
84503 */
84504 SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *pBlob){
84505 Incrblob *p = (Incrblob *)pBlob;
84506 return (p && p->pStmt) ? p->nByte : 0;
84507 }
84508
84509 /*
@@ -84514,11 +84538,11 @@
84514 ** contain a blob or text value, then an error code is returned and the
84515 ** database handle error code and message set. If this happens, then all
84516 ** subsequent calls to sqlite3_blob_xxx() functions (except blob_close())
84517 ** immediately return SQLITE_ABORT.
84518 */
84519 SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){
84520 int rc;
84521 Incrblob *p = (Incrblob *)pBlob;
84522 sqlite3 *db;
84523
84524 if( p==0 ) return SQLITE_MISUSE_BKPT;
@@ -97118,11 +97142,11 @@
97118 ** and attempts to write the column will be ignored.
97119 **
97120 ** Setting the auth function to NULL disables this hook. The default
97121 ** setting of the auth function is NULL.
97122 */
97123 SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
97124 sqlite3 *db,
97125 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
97126 void *pArg
97127 ){
97128 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -97162,10 +97186,11 @@
97162 ){
97163 sqlite3 *db = pParse->db; /* Database handle */
97164 char *zDb = db->aDb[iDb].zName; /* Name of attached database */
97165 int rc; /* Auth callback return code */
97166
 
97167 rc = db->xAuth(db->pAuthArg, SQLITE_READ, zTab,zCol,zDb,pParse->zAuthContext
97168 #ifdef SQLITE_USER_AUTHENTICATION
97169 ,db->auth.zAuthUser
97170 #endif
97171 );
@@ -103880,18 +103905,18 @@
103880 }
103881
103882 /*
103883 ** The sqlite3_strglob() interface.
103884 */
103885 SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlobPattern, const char *zString){
103886 return patternCompare((u8*)zGlobPattern, (u8*)zString, &globInfo, '[')==0;
103887 }
103888
103889 /*
103890 ** The sqlite3_strlike() interface.
103891 */
103892 SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zPattern, const char *zStr, unsigned int esc){
103893 return patternCompare((u8*)zPattern, (u8*)zStr, &likeInfoNorm, esc)==0;
103894 }
103895
103896 /*
103897 ** Count the number of times that the LIKE operator (or GLOB which is
@@ -108583,11 +108608,11 @@
108583 ** If the SQL is a query, then for each row in the query result
108584 ** the xCallback() function is called. pArg becomes the first
108585 ** argument to xCallback(). If xCallback=NULL then no callback
108586 ** is invoked, even for queries.
108587 */
108588 SQLITE_API int SQLITE_STDCALL sqlite3_exec(
108589 sqlite3 *db, /* The database on which the SQL executes */
108590 const char *zSql, /* The SQL to be executed */
108591 sqlite3_callback xCallback, /* Invoke this callback routine */
108592 void *pArg, /* First argument to xCallback() */
108593 char **pzErrMsg /* Write error messages here */
@@ -108974,16 +108999,17 @@
108974 sqlite3_int64 (*uri_int64)(const char*,const char*,sqlite3_int64);
108975 const char *(*uri_parameter)(const char*,const char*);
108976 char *(*vsnprintf)(int,char*,const char*,va_list);
108977 int (*wal_checkpoint_v2)(sqlite3*,const char*,int,int*,int*);
108978 /* Version 3.8.7 and later */
108979 int (*auto_extension)(void(*)(void));
108980 int (*bind_blob64)(sqlite3_stmt*,int,const void*,sqlite3_uint64,
108981 void(*)(void*));
108982 int (*bind_text64)(sqlite3_stmt*,int,const char*,sqlite3_uint64,
108983 void(*)(void*),unsigned char);
108984 int (*cancel_auto_extension)(void(*)(void));
 
108985 int (*load_extension)(sqlite3*,const char*,const char*,char**);
108986 void *(*malloc64)(sqlite3_uint64);
108987 sqlite3_uint64 (*msize)(void*);
108988 void *(*realloc64)(void*,sqlite3_uint64);
108989 void (*reset_auto_extension)(void);
@@ -109008,10 +109034,20 @@
109008 int (*system_errno)(sqlite3*);
109009 /* Version 3.14.0 and later */
109010 int (*trace_v2)(sqlite3*,unsigned,int(*)(unsigned,void*,void*,void*),void*);
109011 char *(*expanded_sql)(sqlite3_stmt*);
109012 };
 
 
 
 
 
 
 
 
 
 
109013
109014 /*
109015 ** The following macros redefine the API routines so that they are
109016 ** redirected through the global sqlite3_api structure.
109017 **
@@ -109280,10 +109316,18 @@
109280 /************** Continuing where we left off in loadext.c ********************/
109281 /* #include "sqliteInt.h" */
109282 /* #include <string.h> */
109283
109284 #ifndef SQLITE_OMIT_LOAD_EXTENSION
 
 
 
 
 
 
 
 
109285
109286 /*
109287 ** Some API routines are omitted when various features are
109288 ** excluded from a build of SQLite. Substitute a NULL pointer
109289 ** for any missing APIs.
@@ -109369,10 +109413,14 @@
109369 #define sqlite3_blob_open 0
109370 #define sqlite3_blob_read 0
109371 #define sqlite3_blob_write 0
109372 #define sqlite3_blob_reopen 0
109373 #endif
 
 
 
 
109374
109375 /*
109376 ** The following structure contains pointers to all SQLite API routines.
109377 ** A pointer to this structure is passed into extensions when they are
109378 ** loaded so that the extension can make calls back into the SQLite
@@ -109675,11 +109723,14 @@
109675 /* Version 3.10.0 and later */
109676 sqlite3_status64,
109677 sqlite3_strlike,
109678 sqlite3_db_cacheflush,
109679 /* Version 3.12.0 and later */
109680 sqlite3_system_errno
 
 
 
109681 };
109682
109683 /*
109684 ** Attempt to load an SQLite extension library contained in the file
109685 ** zFile. The entry point is zProc. zProc may be 0 in which case a
@@ -109698,11 +109749,11 @@
109698 const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */
109699 char **pzErrMsg /* Put error message here if not 0 */
109700 ){
109701 sqlite3_vfs *pVfs = db->pVfs;
109702 void *handle;
109703 int (*xInit)(sqlite3*,char**,const sqlite3_api_routines*);
109704 char *zErrmsg = 0;
109705 const char *zEntry;
109706 char *zAltEntry = 0;
109707 void **aHandle;
109708 u64 nMsg = 300 + sqlite3Strlen30(zFile);
@@ -109757,12 +109808,11 @@
109757 sqlite3OsDlError(pVfs, nMsg-1, zErrmsg);
109758 }
109759 }
109760 return SQLITE_ERROR;
109761 }
109762 xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*))
109763 sqlite3OsDlSym(pVfs, handle, zEntry);
109764
109765 /* If no entry point was specified and the default legacy
109766 ** entry point name "sqlite3_extension_init" was not found, then
109767 ** construct an entry point name "sqlite3_X_init" where the X is
109768 ** replaced by the lowercase value of every ASCII alphabetic
@@ -109790,12 +109840,11 @@
109790 zAltEntry[iEntry++] = (char)sqlite3UpperToLower[(unsigned)c];
109791 }
109792 }
109793 memcpy(zAltEntry+iEntry, "_init", 6);
109794 zEntry = zAltEntry;
109795 xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*))
109796 sqlite3OsDlSym(pVfs, handle, zEntry);
109797 }
109798 if( xInit==0 ){
109799 if( pzErrMsg ){
109800 nMsg += sqlite3Strlen30(zEntry);
109801 *pzErrMsg = zErrmsg = sqlite3_malloc64(nMsg);
@@ -109833,11 +109882,11 @@
109833 db->aExtension = aHandle;
109834
109835 db->aExtension[db->nExtension++] = handle;
109836 return SQLITE_OK;
109837 }
109838 SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
109839 sqlite3 *db, /* Load the extension into this database connection */
109840 const char *zFile, /* Name of the shared library containing extension */
109841 const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */
109842 char **pzErrMsg /* Put error message here if not 0 */
109843 ){
@@ -109864,11 +109913,11 @@
109864
109865 /*
109866 ** Enable or disable extension loading. Extension loading is disabled by
109867 ** default so as not to open security holes in older applications.
109868 */
109869 SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff){
109870 sqlite3_mutex_enter(db->mutex);
109871 if( onoff ){
109872 db->flags |= SQLITE_LoadExtension|SQLITE_LoadExtFunc;
109873 }else{
109874 db->flags &= ~(SQLITE_LoadExtension|SQLITE_LoadExtFunc);
@@ -109921,11 +109970,13 @@
109921
109922 /*
109923 ** Register a statically linked extension that is automatically
109924 ** loaded by every new database connection.
109925 */
109926 SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void (*xInit)(void)){
 
 
109927 int rc = SQLITE_OK;
109928 #ifndef SQLITE_OMIT_AUTOINIT
109929 rc = sqlite3_initialize();
109930 if( rc ){
109931 return rc;
@@ -109937,21 +109988,21 @@
109937 sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
109938 #endif
109939 wsdAutoextInit;
109940 sqlite3_mutex_enter(mutex);
109941 for(i=0; i<wsdAutoext.nExt; i++){
109942 if( wsdAutoext.aExt[i]==xInit ) break;
109943 }
109944 if( i==wsdAutoext.nExt ){
109945 u64 nByte = (wsdAutoext.nExt+1)*sizeof(wsdAutoext.aExt[0]);
109946 void (**aNew)(void);
109947 aNew = sqlite3_realloc64(wsdAutoext.aExt, nByte);
109948 if( aNew==0 ){
109949 rc = SQLITE_NOMEM_BKPT;
109950 }else{
109951 wsdAutoext.aExt = aNew;
109952 wsdAutoext.aExt[wsdAutoext.nExt] = xInit;
109953 wsdAutoext.nExt++;
109954 }
109955 }
109956 sqlite3_mutex_leave(mutex);
109957 assert( (rc&0xff)==rc );
@@ -109966,20 +110017,22 @@
109966 ** routine is a no-op.
109967 **
109968 ** Return 1 if xInit was found on the list and removed. Return 0 if xInit
109969 ** was not on the list.
109970 */
109971 SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void (*xInit)(void)){
 
 
109972 #if SQLITE_THREADSAFE
109973 sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
109974 #endif
109975 int i;
109976 int n = 0;
109977 wsdAutoextInit;
109978 sqlite3_mutex_enter(mutex);
109979 for(i=(int)wsdAutoext.nExt-1; i>=0; i--){
109980 if( wsdAutoext.aExt[i]==xInit ){
109981 wsdAutoext.nExt--;
109982 wsdAutoext.aExt[i] = wsdAutoext.aExt[wsdAutoext.nExt];
109983 n++;
109984 break;
109985 }
@@ -109989,11 +110042,11 @@
109989 }
109990
109991 /*
109992 ** Reset the automatic extension loading mechanism.
109993 */
109994 SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void){
109995 #ifndef SQLITE_OMIT_AUTOINIT
109996 if( sqlite3_initialize()==SQLITE_OK )
109997 #endif
109998 {
109999 #if SQLITE_THREADSAFE
@@ -110015,11 +110068,11 @@
110015 */
110016 SQLITE_PRIVATE void sqlite3AutoLoadExtensions(sqlite3 *db){
110017 u32 i;
110018 int go = 1;
110019 int rc;
110020 int (*xInit)(sqlite3*,char**,const sqlite3_api_routines*);
110021
110022 wsdAutoextInit;
110023 if( wsdAutoext.nExt==0 ){
110024 /* Common case: early out without every having to acquire a mutex */
110025 return;
@@ -110032,12 +110085,11 @@
110032 sqlite3_mutex_enter(mutex);
110033 if( i>=wsdAutoext.nExt ){
110034 xInit = 0;
110035 go = 0;
110036 }else{
110037 xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*))
110038 wsdAutoext.aExt[i];
110039 }
110040 sqlite3_mutex_leave(mutex);
110041 zErrmsg = 0;
110042 if( xInit && (rc = xInit(db, &zErrmsg, &sqlite3Apis))!=0 ){
110043 sqlite3ErrorWithMsg(db, rc,
@@ -113251,11 +113303,11 @@
113251 ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
113252 ** sqlite3_step(). In the new version, the original SQL text is retained
113253 ** and the statement is automatically recompiled if an schema change
113254 ** occurs.
113255 */
113256 SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
113257 sqlite3 *db, /* Database handle. */
113258 const char *zSql, /* UTF-8 encoded SQL statement. */
113259 int nBytes, /* Length of zSql in bytes. */
113260 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113261 const char **pzTail /* OUT: End of parsed string */
@@ -113263,11 +113315,11 @@
113263 int rc;
113264 rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,0,ppStmt,pzTail);
113265 assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
113266 return rc;
113267 }
113268 SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
113269 sqlite3 *db, /* Database handle. */
113270 const char *zSql, /* UTF-8 encoded SQL statement. */
113271 int nBytes, /* Length of zSql in bytes. */
113272 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113273 const char **pzTail /* OUT: End of parsed string */
@@ -113339,11 +113391,11 @@
113339 ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
113340 ** sqlite3_step(). In the new version, the original SQL text is retained
113341 ** and the statement is automatically recompiled if an schema change
113342 ** occurs.
113343 */
113344 SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
113345 sqlite3 *db, /* Database handle. */
113346 const void *zSql, /* UTF-16 encoded SQL statement. */
113347 int nBytes, /* Length of zSql in bytes. */
113348 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113349 const void **pzTail /* OUT: End of parsed string */
@@ -113351,11 +113403,11 @@
113351 int rc;
113352 rc = sqlite3Prepare16(db,zSql,nBytes,0,ppStmt,pzTail);
113353 assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
113354 return rc;
113355 }
113356 SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
113357 sqlite3 *db, /* Database handle. */
113358 const void *zSql, /* UTF-16 encoded SQL statement. */
113359 int nBytes, /* Length of zSql in bytes. */
113360 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113361 const void **pzTail /* OUT: End of parsed string */
@@ -119194,11 +119246,11 @@
119194 ** The result that is written to ***pazResult is held in memory obtained
119195 ** from malloc(). But the caller cannot free this memory directly.
119196 ** Instead, the entire table should be passed to sqlite3_free_table() when
119197 ** the calling procedure is finished using it.
119198 */
119199 SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
119200 sqlite3 *db, /* The database on which the SQL executes */
119201 const char *zSql, /* The SQL to be executed */
119202 char ***pazResult, /* Write the result table here */
119203 int *pnRow, /* Write the number of rows in the result here */
119204 int *pnColumn, /* Write the number of columns of result here */
@@ -119263,11 +119315,11 @@
119263 }
119264
119265 /*
119266 ** This routine frees the space the sqlite3_get_table() malloced.
119267 */
119268 SQLITE_API void SQLITE_STDCALL sqlite3_free_table(
119269 char **azResult /* Result returned from sqlite3_get_table() */
119270 ){
119271 if( azResult ){
119272 int i, n;
119273 azResult--;
@@ -121673,11 +121725,11 @@
121673
121674
121675 /*
121676 ** External API function used to create a new virtual-table module.
121677 */
121678 SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
121679 sqlite3 *db, /* Database in which module is registered */
121680 const char *zName, /* Name assigned to this module */
121681 const sqlite3_module *pModule, /* The definition of the module */
121682 void *pAux /* Context pointer for xCreate/xConnect */
121683 ){
@@ -121688,11 +121740,11 @@
121688 }
121689
121690 /*
121691 ** External API function used to create a new virtual-table module.
121692 */
121693 SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
121694 sqlite3 *db, /* Database in which module is registered */
121695 const char *zName, /* Name assigned to this module */
121696 const sqlite3_module *pModule, /* The definition of the module */
121697 void *pAux, /* Context pointer for xCreate/xConnect */
121698 void (*xDestroy)(void *) /* Module destructor function */
@@ -122312,11 +122364,11 @@
122312 /*
122313 ** This function is used to set the schema of a virtual table. It is only
122314 ** valid to call this function from within the xCreate() or xConnect() of a
122315 ** virtual table module.
122316 */
122317 SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
122318 VtabCtx *pCtx;
122319 Parse *pParse;
122320 int rc = SQLITE_OK;
122321 Table *pTab;
122322 char *zErr = 0;
@@ -122766,11 +122818,11 @@
122766 ** table update operation currently in progress.
122767 **
122768 ** The results of this routine are undefined unless it is called from
122769 ** within an xUpdate method.
122770 */
122771 SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *db){
122772 static const unsigned char aMap[] = {
122773 SQLITE_ROLLBACK, SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_REPLACE
122774 };
122775 #ifdef SQLITE_ENABLE_API_ARMOR
122776 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -129063,15 +129115,15 @@
129063 LogEst nIter;
129064 pNew->u.btree.nEq++;
129065 pNew->nSkip++;
129066 pNew->aLTerm[pNew->nLTerm++] = 0;
129067 pNew->wsFlags |= WHERE_SKIPSCAN;
129068 nIter = pProbe->aiRowLogEst[saved_nEq]+1 - pProbe->aiRowLogEst[saved_nEq+1];
129069 pNew->nOut -= nIter;
129070 /* TUNING: Because uncertainties in the estimates for skip-scan queries,
129071 ** add a 1.375 fudge factor to make skip-scan slightly less likely. */
129072 nIter += 4;
129073 whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, nIter + nInMul);
129074 pNew->nOut = saved_nOut;
129075 pNew->u.btree.nEq = saved_nEq;
129076 pNew->nSkip = saved_nSkip;
129077 pNew->wsFlags = saved_wsFlags;
@@ -136091,11 +136143,11 @@
136091 **
136092 ** If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed
136093 ** to recognize the end of a trigger can be omitted. All we have to do
136094 ** is look for a semicolon that is not part of an string or comment.
136095 */
136096 SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *zSql){
136097 u8 state = 0; /* Current state, using numbers defined in header comment */
136098 u8 token; /* Value of the next token */
136099
136100 #ifndef SQLITE_OMIT_TRIGGER
136101 /* A complex statement machine used to detect the end of a CREATE TRIGGER
@@ -136256,11 +136308,11 @@
136256 /*
136257 ** This routine is the same as the sqlite3_complete() routine described
136258 ** above, except that the parameter is required to be UTF-16 encoded, not
136259 ** UTF-8.
136260 */
136261 SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *zSql){
136262 sqlite3_value *pVal;
136263 char const *zSql8;
136264 int rc;
136265
136266 #ifndef SQLITE_OMIT_AUTOINIT
@@ -136416,28 +136468,28 @@
136416 #endif
136417
136418 /* IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns
136419 ** a pointer to the to the sqlite3_version[] string constant.
136420 */
136421 SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void){ return sqlite3_version; }
136422
136423 /* IMPLEMENTATION-OF: R-63124-39300 The sqlite3_sourceid() function returns a
136424 ** pointer to a string constant whose value is the same as the
136425 ** SQLITE_SOURCE_ID C preprocessor macro.
136426 */
136427 SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
136428
136429 /* IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function
136430 ** returns an integer equal to SQLITE_VERSION_NUMBER.
136431 */
136432 SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; }
136433
136434 /* IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns
136435 ** zero if and only if SQLite was compiled with mutexing code omitted due to
136436 ** the SQLITE_THREADSAFE compile-time option being set to 0.
136437 */
136438 SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; }
136439
136440 /*
136441 ** When compiling the test fixture or with debugging enabled (on Win32),
136442 ** this variable being set to non-zero will cause OSTRACE macros to emit
136443 ** extra diagnostic information.
@@ -136506,11 +136558,11 @@
136506 ** call by X completes.
136507 **
136508 ** * Recursive calls to this routine from thread X return immediately
136509 ** without blocking.
136510 */
136511 SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void){
136512 MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */
136513 int rc; /* Result code */
136514 #ifdef SQLITE_EXTRA_INIT
136515 int bRunExtraInit = 0; /* Extra initialization needed */
136516 #endif
@@ -136672,11 +136724,11 @@
136672 ** while any part of SQLite is otherwise in use in any thread. This
136673 ** routine is not threadsafe. But it is safe to invoke this routine
136674 ** on when SQLite is already shut down. If SQLite is already shut down
136675 ** when this routine is invoked, then this routine is a harmless no-op.
136676 */
136677 SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void){
136678 #ifdef SQLITE_OMIT_WSD
136679 int rc = sqlite3_wsd_init(4096, 24);
136680 if( rc!=SQLITE_OK ){
136681 return rc;
136682 }
@@ -137091,11 +137143,11 @@
137091 }
137092
137093 /*
137094 ** Return the mutex associated with a database connection.
137095 */
137096 SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3 *db){
137097 #ifdef SQLITE_ENABLE_API_ARMOR
137098 if( !sqlite3SafetyCheckOk(db) ){
137099 (void)SQLITE_MISUSE_BKPT;
137100 return 0;
137101 }
@@ -137105,11 +137157,11 @@
137105
137106 /*
137107 ** Free up as much memory as we can from the given database
137108 ** connection.
137109 */
137110 SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3 *db){
137111 int i;
137112
137113 #ifdef SQLITE_ENABLE_API_ARMOR
137114 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
137115 #endif
@@ -137129,11 +137181,11 @@
137129
137130 /*
137131 ** Flush any dirty pages in the pager-cache for any attached database
137132 ** to disk.
137133 */
137134 SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3 *db){
137135 int i;
137136 int rc = SQLITE_OK;
137137 int bSeenBusy = 0;
137138
137139 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -137279,11 +137331,11 @@
137279 }
137280
137281 /*
137282 ** Return the ROWID of the most recent insert
137283 */
137284 SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3 *db){
137285 #ifdef SQLITE_ENABLE_API_ARMOR
137286 if( !sqlite3SafetyCheckOk(db) ){
137287 (void)SQLITE_MISUSE_BKPT;
137288 return 0;
137289 }
@@ -137292,11 +137344,11 @@
137292 }
137293
137294 /*
137295 ** Return the number of changes in the most recent call to sqlite3_exec().
137296 */
137297 SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3 *db){
137298 #ifdef SQLITE_ENABLE_API_ARMOR
137299 if( !sqlite3SafetyCheckOk(db) ){
137300 (void)SQLITE_MISUSE_BKPT;
137301 return 0;
137302 }
@@ -137305,11 +137357,11 @@
137305 }
137306
137307 /*
137308 ** Return the number of changes since the database handle was opened.
137309 */
137310 SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3 *db){
137311 #ifdef SQLITE_ENABLE_API_ARMOR
137312 if( !sqlite3SafetyCheckOk(db) ){
137313 (void)SQLITE_MISUSE_BKPT;
137314 return 0;
137315 }
@@ -137456,12 +137508,12 @@
137456 ** statements or unfinished sqlite3_backups. The sqlite3_close_v2()
137457 ** version forces the connection to become a zombie if there are
137458 ** unclosed resources, and arranges for deallocation when the last
137459 ** prepare statement or sqlite3_backup closes.
137460 */
137461 SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3 *db){ return sqlite3Close(db,0); }
137462 SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3 *db){ return sqlite3Close(db,1); }
137463
137464
137465 /*
137466 ** Close the mutex on database connection db.
137467 **
@@ -137864,11 +137916,11 @@
137864
137865 /*
137866 ** This routine sets the busy callback for an Sqlite database to the
137867 ** given callback function with the given argument.
137868 */
137869 SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(
137870 sqlite3 *db,
137871 int (*xBusy)(void*,int),
137872 void *pArg
137873 ){
137874 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -137887,11 +137939,11 @@
137887 /*
137888 ** This routine sets the progress callback for an Sqlite database to the
137889 ** given callback function with the given argument. The progress callback will
137890 ** be invoked every nOps opcodes.
137891 */
137892 SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(
137893 sqlite3 *db,
137894 int nOps,
137895 int (*xProgress)(void*),
137896 void *pArg
137897 ){
@@ -137918,11 +137970,11 @@
137918
137919 /*
137920 ** This routine installs a default busy handler that waits for the
137921 ** specified number of milliseconds before returning 0.
137922 */
137923 SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3 *db, int ms){
137924 #ifdef SQLITE_ENABLE_API_ARMOR
137925 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
137926 #endif
137927 if( ms>0 ){
137928 sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db);
@@ -137934,11 +137986,11 @@
137934 }
137935
137936 /*
137937 ** Cause any pending operation to stop at its earliest opportunity.
137938 */
137939 SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3 *db){
137940 #ifdef SQLITE_ENABLE_API_ARMOR
137941 if( !sqlite3SafetyCheckOk(db) ){
137942 (void)SQLITE_MISUSE_BKPT;
137943 return;
137944 }
@@ -138050,11 +138102,11 @@
138050 }
138051
138052 /*
138053 ** Create new user functions.
138054 */
138055 SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
138056 sqlite3 *db,
138057 const char *zFunc,
138058 int nArg,
138059 int enc,
138060 void *p,
@@ -138064,11 +138116,11 @@
138064 ){
138065 return sqlite3_create_function_v2(db, zFunc, nArg, enc, p, xSFunc, xStep,
138066 xFinal, 0);
138067 }
138068
138069 SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
138070 sqlite3 *db,
138071 const char *zFunc,
138072 int nArg,
138073 int enc,
138074 void *p,
@@ -138107,11 +138159,11 @@
138107 sqlite3_mutex_leave(db->mutex);
138108 return rc;
138109 }
138110
138111 #ifndef SQLITE_OMIT_UTF16
138112 SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
138113 sqlite3 *db,
138114 const void *zFunctionName,
138115 int nArg,
138116 int eTextRep,
138117 void *p,
@@ -138147,11 +138199,11 @@
138147 ** When virtual tables intend to provide an overloaded function, they
138148 ** should call this routine to make sure the global function exists.
138149 ** A global function must exist in order for name resolution to work
138150 ** properly.
138151 */
138152 SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(
138153 sqlite3 *db,
138154 const char *zName,
138155 int nArg
138156 ){
138157 int rc = SQLITE_OK;
@@ -138179,11 +138231,11 @@
138179 ** A NULL trace function means that no tracing is executes. A non-NULL
138180 ** trace is a pointer to a function that is invoked at the start of each
138181 ** SQL statement.
138182 */
138183 #ifndef SQLITE_OMIT_DEPRECATED
138184 SQLITE_API void *SQLITE_STDCALL sqlite3_trace(sqlite3 *db, void(*xTrace)(void*,const char*), void *pArg){
138185 void *pOld;
138186
138187 #ifdef SQLITE_ENABLE_API_ARMOR
138188 if( !sqlite3SafetyCheckOk(db) ){
138189 (void)SQLITE_MISUSE_BKPT;
@@ -138200,11 +138252,11 @@
138200 }
138201 #endif /* SQLITE_OMIT_DEPRECATED */
138202
138203 /* Register a trace callback using the version-2 interface.
138204 */
138205 SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2(
138206 sqlite3 *db, /* Trace this connection */
138207 unsigned mTrace, /* Mask of events to be traced */
138208 int(*xTrace)(unsigned,void*,void*,void*), /* Callback to invoke */
138209 void *pArg /* Context */
138210 ){
@@ -138228,11 +138280,11 @@
138228 **
138229 ** A NULL profile function means that no profiling is executes. A non-NULL
138230 ** profile is a pointer to a function that is invoked at the conclusion of
138231 ** each SQL statement that is run.
138232 */
138233 SQLITE_API void *SQLITE_STDCALL sqlite3_profile(
138234 sqlite3 *db,
138235 void (*xProfile)(void*,const char*,sqlite_uint64),
138236 void *pArg
138237 ){
138238 void *pOld;
@@ -138256,11 +138308,11 @@
138256 /*
138257 ** Register a function to be invoked when a transaction commits.
138258 ** If the invoked function returns non-zero, then the commit becomes a
138259 ** rollback.
138260 */
138261 SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(
138262 sqlite3 *db, /* Attach the hook to this database */
138263 int (*xCallback)(void*), /* Function to invoke on each commit */
138264 void *pArg /* Argument to the function */
138265 ){
138266 void *pOld;
@@ -138281,11 +138333,11 @@
138281
138282 /*
138283 ** Register a callback to be invoked each time a row is updated,
138284 ** inserted or deleted using this database connection.
138285 */
138286 SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
138287 sqlite3 *db, /* Attach the hook to this database */
138288 void (*xCallback)(void*,int,char const *,char const *,sqlite_int64),
138289 void *pArg /* Argument to the function */
138290 ){
138291 void *pRet;
@@ -138306,11 +138358,11 @@
138306
138307 /*
138308 ** Register a callback to be invoked each time a transaction is rolled
138309 ** back by this database connection.
138310 */
138311 SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(
138312 sqlite3 *db, /* Attach the hook to this database */
138313 void (*xCallback)(void*), /* Callback function */
138314 void *pArg /* Argument to the function */
138315 ){
138316 void *pRet;
@@ -138332,11 +138384,11 @@
138332 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
138333 /*
138334 ** Register a callback to be invoked each time a row is updated,
138335 ** inserted or deleted using this database connection.
138336 */
138337 SQLITE_API void *SQLITE_STDCALL sqlite3_preupdate_hook(
138338 sqlite3 *db, /* Attach the hook to this database */
138339 void(*xCallback)( /* Callback function */
138340 void*,sqlite3*,int,char const*,char const*,sqlite3_int64,sqlite3_int64),
138341 void *pArg /* First callback argument */
138342 ){
@@ -138381,11 +138433,11 @@
138381 ** The callback registered by this function replaces any existing callback
138382 ** registered using sqlite3_wal_hook(). Likewise, registering a callback
138383 ** using sqlite3_wal_hook() disables the automatic checkpoint mechanism
138384 ** configured by this function.
138385 */
138386 SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){
138387 #ifdef SQLITE_OMIT_WAL
138388 UNUSED_PARAMETER(db);
138389 UNUSED_PARAMETER(nFrame);
138390 #else
138391 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -138402,11 +138454,11 @@
138402
138403 /*
138404 ** Register a callback to be invoked each time a transaction is written
138405 ** into the write-ahead-log by this database connection.
138406 */
138407 SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
138408 sqlite3 *db, /* Attach the hook to this db handle */
138409 int(*xCallback)(void *, sqlite3*, const char*, int),
138410 void *pArg /* First argument passed to xCallback() */
138411 ){
138412 #ifndef SQLITE_OMIT_WAL
@@ -138429,11 +138481,11 @@
138429 }
138430
138431 /*
138432 ** Checkpoint database zDb.
138433 */
138434 SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
138435 sqlite3 *db, /* Database handle */
138436 const char *zDb, /* Name of attached database (or NULL) */
138437 int eMode, /* SQLITE_CHECKPOINT_* value */
138438 int *pnLog, /* OUT: Size of WAL log in frames */
138439 int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -138484,11 +138536,11 @@
138484 /*
138485 ** Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points
138486 ** to contains a zero-length string, all attached databases are
138487 ** checkpointed.
138488 */
138489 SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){
138490 /* EVIDENCE-OF: R-41613-20553 The sqlite3_wal_checkpoint(D,X) is equivalent to
138491 ** sqlite3_wal_checkpoint_v2(D,X,SQLITE_CHECKPOINT_PASSIVE,0,0). */
138492 return sqlite3_wal_checkpoint_v2(db,zDb,SQLITE_CHECKPOINT_PASSIVE,0,0);
138493 }
138494
@@ -138575,11 +138627,11 @@
138575
138576 /*
138577 ** Return UTF-8 encoded English language explanation of the most recent
138578 ** error.
138579 */
138580 SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3 *db){
138581 const char *z;
138582 if( !db ){
138583 return sqlite3ErrStr(SQLITE_NOMEM_BKPT);
138584 }
138585 if( !sqlite3SafetyCheckSickOrOk(db) ){
@@ -138603,11 +138655,11 @@
138603 #ifndef SQLITE_OMIT_UTF16
138604 /*
138605 ** Return UTF-16 encoded English language explanation of the most recent
138606 ** error.
138607 */
138608 SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3 *db){
138609 static const u16 outOfMem[] = {
138610 'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0
138611 };
138612 static const u16 misuse[] = {
138613 'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ',
@@ -138648,38 +138700,38 @@
138648
138649 /*
138650 ** Return the most recent error code generated by an SQLite routine. If NULL is
138651 ** passed to this function, we assume a malloc() failed during sqlite3_open().
138652 */
138653 SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db){
138654 if( db && !sqlite3SafetyCheckSickOrOk(db) ){
138655 return SQLITE_MISUSE_BKPT;
138656 }
138657 if( !db || db->mallocFailed ){
138658 return SQLITE_NOMEM_BKPT;
138659 }
138660 return db->errCode & db->errMask;
138661 }
138662 SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db){
138663 if( db && !sqlite3SafetyCheckSickOrOk(db) ){
138664 return SQLITE_MISUSE_BKPT;
138665 }
138666 if( !db || db->mallocFailed ){
138667 return SQLITE_NOMEM_BKPT;
138668 }
138669 return db->errCode;
138670 }
138671 SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3 *db){
138672 return db ? db->iSysErrno : 0;
138673 }
138674
138675 /*
138676 ** Return a string that describes the kind of error specified in the
138677 ** argument. For now, this simply calls the internal sqlite3ErrStr()
138678 ** function.
138679 */
138680 SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int rc){
138681 return sqlite3ErrStr(rc);
138682 }
138683
138684 /*
138685 ** Create a new collating function for database "db". The name is zName
@@ -138823,11 +138875,11 @@
138823 **
138824 ** A new lower limit does not shrink existing constructs.
138825 ** It merely prevents new constructs that exceed the limit
138826 ** from forming.
138827 */
138828 SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3 *db, int limitId, int newLimit){
138829 int oldLimit;
138830
138831 #ifdef SQLITE_ENABLE_API_ARMOR
138832 if( !sqlite3SafetyCheckOk(db) ){
138833 (void)SQLITE_MISUSE_BKPT;
@@ -139447,18 +139499,18 @@
139447 }
139448
139449 /*
139450 ** Open a new database handle.
139451 */
139452 SQLITE_API int SQLITE_STDCALL sqlite3_open(
139453 const char *zFilename,
139454 sqlite3 **ppDb
139455 ){
139456 return openDatabase(zFilename, ppDb,
139457 SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0);
139458 }
139459 SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
139460 const char *filename, /* Database filename (UTF-8) */
139461 sqlite3 **ppDb, /* OUT: SQLite db handle */
139462 int flags, /* Flags */
139463 const char *zVfs /* Name of VFS module to use */
139464 ){
@@ -139467,11 +139519,11 @@
139467
139468 #ifndef SQLITE_OMIT_UTF16
139469 /*
139470 ** Open a new database handle.
139471 */
139472 SQLITE_API int SQLITE_STDCALL sqlite3_open16(
139473 const void *zFilename,
139474 sqlite3 **ppDb
139475 ){
139476 char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */
139477 sqlite3_value *pVal;
@@ -139506,11 +139558,11 @@
139506 #endif /* SQLITE_OMIT_UTF16 */
139507
139508 /*
139509 ** Register a new collation sequence with the database handle db.
139510 */
139511 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
139512 sqlite3* db,
139513 const char *zName,
139514 int enc,
139515 void* pCtx,
139516 int(*xCompare)(void*,int,const void*,int,const void*)
@@ -139519,11 +139571,11 @@
139519 }
139520
139521 /*
139522 ** Register a new collation sequence with the database handle db.
139523 */
139524 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
139525 sqlite3* db,
139526 const char *zName,
139527 int enc,
139528 void* pCtx,
139529 int(*xCompare)(void*,int,const void*,int,const void*),
@@ -139544,11 +139596,11 @@
139544
139545 #ifndef SQLITE_OMIT_UTF16
139546 /*
139547 ** Register a new collation sequence with the database handle db.
139548 */
139549 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
139550 sqlite3* db,
139551 const void *zName,
139552 int enc,
139553 void* pCtx,
139554 int(*xCompare)(void*,int,const void*,int,const void*)
@@ -139574,11 +139626,11 @@
139574
139575 /*
139576 ** Register a collation sequence factory callback with the database handle
139577 ** db. Replace any previously installed collation sequence factory.
139578 */
139579 SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
139580 sqlite3 *db,
139581 void *pCollNeededArg,
139582 void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*)
139583 ){
139584 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -139595,11 +139647,11 @@
139595 #ifndef SQLITE_OMIT_UTF16
139596 /*
139597 ** Register a collation sequence factory callback with the database handle
139598 ** db. Replace any previously installed collation sequence factory.
139599 */
139600 SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
139601 sqlite3 *db,
139602 void *pCollNeededArg,
139603 void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*)
139604 ){
139605 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -139617,11 +139669,11 @@
139617 #ifndef SQLITE_OMIT_DEPRECATED
139618 /*
139619 ** This function is now an anachronism. It used to be used to recover from a
139620 ** malloc() failure, but SQLite now does this automatically.
139621 */
139622 SQLITE_API int SQLITE_STDCALL sqlite3_global_recover(void){
139623 return SQLITE_OK;
139624 }
139625 #endif
139626
139627 /*
@@ -139628,11 +139680,11 @@
139628 ** Test to see whether or not the database connection is in autocommit
139629 ** mode. Return TRUE if it is and FALSE if not. Autocommit mode is on
139630 ** by default. Autocommit is disabled by a BEGIN statement and reenabled
139631 ** by the next COMMIT or ROLLBACK.
139632 */
139633 SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3 *db){
139634 #ifdef SQLITE_ENABLE_API_ARMOR
139635 if( !sqlite3SafetyCheckOk(db) ){
139636 (void)SQLITE_MISUSE_BKPT;
139637 return 0;
139638 }
@@ -139685,19 +139737,19 @@
139685 ** data for this thread has been deallocated.
139686 **
139687 ** SQLite no longer uses thread-specific data so this routine is now a
139688 ** no-op. It is retained for historical compatibility.
139689 */
139690 SQLITE_API void SQLITE_STDCALL sqlite3_thread_cleanup(void){
139691 }
139692 #endif
139693
139694 /*
139695 ** Return meta information about a specific column of a database table.
139696 ** See comment in sqlite3.h (sqlite.h.in) for details.
139697 */
139698 SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
139699 sqlite3 *db, /* Connection handle */
139700 const char *zDbName, /* Database name or NULL */
139701 const char *zTableName, /* Table name */
139702 const char *zColumnName, /* Column name */
139703 char const **pzDataType, /* OUTPUT: Declared data type */
@@ -139811,11 +139863,11 @@
139811 }
139812
139813 /*
139814 ** Sleep for a little while. Return the amount of time slept.
139815 */
139816 SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int ms){
139817 sqlite3_vfs *pVfs;
139818 int rc;
139819 pVfs = sqlite3_vfs_find(0);
139820 if( pVfs==0 ) return 0;
139821
@@ -139827,11 +139879,11 @@
139827 }
139828
139829 /*
139830 ** Enable or disable the extended result codes.
139831 */
139832 SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3 *db, int onoff){
139833 #ifdef SQLITE_ENABLE_API_ARMOR
139834 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
139835 #endif
139836 sqlite3_mutex_enter(db->mutex);
139837 db->errMask = onoff ? 0xffffffff : 0xff;
@@ -139840,11 +139892,11 @@
139840 }
139841
139842 /*
139843 ** Invoke the xFileControl method on a particular database.
139844 */
139845 SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
139846 int rc = SQLITE_ERROR;
139847 Btree *pBtree;
139848
139849 #ifdef SQLITE_ENABLE_API_ARMOR
139850 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -140225,11 +140277,11 @@
140225 ** method of a VFS implementation. The zParam argument is the name of the
140226 ** query parameter we seek. This routine returns the value of the zParam
140227 ** parameter if it exists. If the parameter does not exist, this routine
140228 ** returns a NULL pointer.
140229 */
140230 SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam){
140231 if( zFilename==0 || zParam==0 ) return 0;
140232 zFilename += sqlite3Strlen30(zFilename) + 1;
140233 while( zFilename[0] ){
140234 int x = strcmp(zFilename, zParam);
140235 zFilename += sqlite3Strlen30(zFilename) + 1;
@@ -140240,20 +140292,20 @@
140240 }
140241
140242 /*
140243 ** Return a boolean value for a query parameter.
140244 */
140245 SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){
140246 const char *z = sqlite3_uri_parameter(zFilename, zParam);
140247 bDflt = bDflt!=0;
140248 return z ? sqlite3GetBoolean(z, bDflt) : bDflt;
140249 }
140250
140251 /*
140252 ** Return a 64-bit integer value for a query parameter.
140253 */
140254 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(
140255 const char *zFilename, /* Filename as passed to xOpen */
140256 const char *zParam, /* URI parameter sought */
140257 sqlite3_int64 bDflt /* return if parameter is missing */
140258 ){
140259 const char *z = sqlite3_uri_parameter(zFilename, zParam);
@@ -140281,11 +140333,11 @@
140281
140282 /*
140283 ** Return the filename of the database associated with a database
140284 ** connection.
140285 */
140286 SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName){
140287 Btree *pBt;
140288 #ifdef SQLITE_ENABLE_API_ARMOR
140289 if( !sqlite3SafetyCheckOk(db) ){
140290 (void)SQLITE_MISUSE_BKPT;
140291 return 0;
@@ -140297,11 +140349,11 @@
140297
140298 /*
140299 ** Return 1 if database is read-only or 0 if read/write. Return -1 if
140300 ** no such database exists.
140301 */
140302 SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName){
140303 Btree *pBt;
140304 #ifdef SQLITE_ENABLE_API_ARMOR
140305 if( !sqlite3SafetyCheckOk(db) ){
140306 (void)SQLITE_MISUSE_BKPT;
140307 return -1;
@@ -140314,11 +140366,11 @@
140314 #ifdef SQLITE_ENABLE_SNAPSHOT
140315 /*
140316 ** Obtain a snapshot handle for the snapshot of database zDb currently
140317 ** being read by handle db.
140318 */
140319 SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_get(
140320 sqlite3 *db,
140321 const char *zDb,
140322 sqlite3_snapshot **ppSnapshot
140323 ){
140324 int rc = SQLITE_ERROR;
@@ -140349,11 +140401,11 @@
140349 }
140350
140351 /*
140352 ** Open a read-transaction on the snapshot idendified by pSnapshot.
140353 */
140354 SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_open(
140355 sqlite3 *db,
140356 const char *zDb,
140357 sqlite3_snapshot *pSnapshot
140358 ){
140359 int rc = SQLITE_ERROR;
@@ -140386,11 +140438,11 @@
140386 }
140387
140388 /*
140389 ** Free a snapshot handle obtained from sqlite3_snapshot_get().
140390 */
140391 SQLITE_API void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot *pSnapshot){
140392 sqlite3_free(pSnapshot);
140393 }
140394 #endif /* SQLITE_ENABLE_SNAPSHOT */
140395
140396 /************** End of main.c ************************************************/
@@ -140540,11 +140592,11 @@
140540 **
140541 ** Each call to this routine overrides any prior callbacks registered
140542 ** on the same "db". If xNotify==0 then any prior callbacks are immediately
140543 ** cancelled.
140544 */
140545 SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
140546 sqlite3 *db,
140547 void (*xNotify)(void **, int),
140548 void *pArg
140549 ){
140550 int rc = SQLITE_OK;
@@ -147543,11 +147595,11 @@
147543 ** Initialize API pointer table, if required.
147544 */
147545 #ifdef _WIN32
147546 __declspec(dllexport)
147547 #endif
147548 SQLITE_API int SQLITE_STDCALL sqlite3_fts3_init(
147549 sqlite3 *db,
147550 char **pzErrMsg,
147551 const sqlite3_api_routines *pApi
147552 ){
147553 SQLITE_EXTENSION_INIT2(pApi)
@@ -150699,11 +150751,15 @@
150699 }
150700
150701
150702 #ifdef SQLITE_TEST
150703
150704 #include <tcl.h>
 
 
 
 
150705 /* #include <string.h> */
150706
150707 /*
150708 ** Implementation of a special SQL scalar function for testing tokenizers
150709 ** designed to be used in concert with the Tcl testing framework. This
@@ -163340,11 +163396,11 @@
163340 }
163341
163342 /*
163343 ** Register a new geometry function for use with the r-tree MATCH operator.
163344 */
163345 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
163346 sqlite3 *db, /* Register SQL function on this connection */
163347 const char *zGeom, /* Name of the new SQL function */
163348 int (*xGeom)(sqlite3_rtree_geometry*,int,RtreeDValue*,int*), /* Callback */
163349 void *pContext /* Extra data associated with the callback */
163350 ){
@@ -163364,11 +163420,11 @@
163364
163365 /*
163366 ** Register a new 2nd-generation geometry function for use with the
163367 ** r-tree MATCH operator.
163368 */
163369 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
163370 sqlite3 *db, /* Register SQL function on this connection */
163371 const char *zQueryFunc, /* Name of new SQL function */
163372 int (*xQueryFunc)(sqlite3_rtree_query_info*), /* Callback */
163373 void *pContext, /* Extra data passed into the callback */
163374 void (*xDestructor)(void*) /* Destructor for the extra data */
@@ -163389,11 +163445,11 @@
163389
163390 #if !SQLITE_CORE
163391 #ifdef _WIN32
163392 __declspec(dllexport)
163393 #endif
163394 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_init(
163395 sqlite3 *db,
163396 char **pzErrMsg,
163397 const sqlite3_api_routines *pApi
163398 ){
163399 SQLITE_EXTENSION_INIT2(pApi)
@@ -163940,11 +163996,11 @@
163940
163941 #if !SQLITE_CORE
163942 #ifdef _WIN32
163943 __declspec(dllexport)
163944 #endif
163945 SQLITE_API int SQLITE_STDCALL sqlite3_icu_init(
163946 sqlite3 *db,
163947 char **pzErrMsg,
163948 const sqlite3_api_routines *pApi
163949 ){
163950 SQLITE_EXTENSION_INIT2(pApi)
@@ -164620,11 +164676,11 @@
164620 ** IMPORTANT NOTE FOR ZIPVFS USERS: The RBU extension works with all of
164621 ** SQLite's built-in VFSs, including the multiplexor VFS. However it does
164622 ** not work out of the box with zipvfs. Refer to the comment describing
164623 ** the zipvfs_create_vfs() API below for details on using RBU with zipvfs.
164624 */
164625 SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_open(
164626 const char *zTarget,
164627 const char *zRbu,
164628 const char *zState
164629 );
164630
@@ -164653,11 +164709,11 @@
164653 ** As with sqlite3rbu_open(), Zipvfs users should rever to the comment
164654 ** describing the sqlite3rbu_create_vfs() API function below for
164655 ** a description of the complications associated with using RBU with
164656 ** zipvfs databases.
164657 */
164658 SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_vacuum(
164659 const char *zTarget,
164660 const char *zState
164661 );
164662
164663 /*
@@ -164689,11 +164745,11 @@
164689 ** when sqlite3rbu_close() is called.
164690 **
164691 ** Database handles returned by this function remain valid until the next
164692 ** call to any sqlite3rbu_xxx() function other than sqlite3rbu_db().
164693 */
164694 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3rbu_db(sqlite3rbu*, int bRbu);
164695
164696 /*
164697 ** Do some work towards applying the RBU update to the target db.
164698 **
164699 ** Return SQLITE_DONE if the update has been completely applied, or
@@ -164703,11 +164759,11 @@
164703 **
164704 ** Once a call to sqlite3rbu_step() has returned a value other than
164705 ** SQLITE_OK, all subsequent calls on the same RBU handle are no-ops
164706 ** that immediately return the same value.
164707 */
164708 SQLITE_API int SQLITE_STDCALL sqlite3rbu_step(sqlite3rbu *pRbu);
164709
164710 /*
164711 ** Force RBU to save its state to disk.
164712 **
164713 ** If a power failure or application crash occurs during an update, following
@@ -164715,11 +164771,11 @@
164715 ** was last saved. In other words, from the most recent successful call to
164716 ** sqlite3rbu_close() or this function.
164717 **
164718 ** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
164719 */
164720 SQLITE_API int SQLITE_STDCALL sqlite3rbu_savestate(sqlite3rbu *pRbu);
164721
164722 /*
164723 ** Close an RBU handle.
164724 **
164725 ** If the RBU update has been completely applied, mark the RBU database
@@ -164735,18 +164791,18 @@
164735 **
164736 ** Otherwise, if no error occurs, this function returns SQLITE_OK if the
164737 ** update has been partially applied, or SQLITE_DONE if it has been
164738 ** completely applied.
164739 */
164740 SQLITE_API int SQLITE_STDCALL sqlite3rbu_close(sqlite3rbu *pRbu, char **pzErrmsg);
164741
164742 /*
164743 ** Return the total number of key-value operations (inserts, deletes or
164744 ** updates) that have been performed on the target database since the
164745 ** current RBU update was started.
164746 */
164747 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3rbu_progress(sqlite3rbu *pRbu);
164748
164749 /*
164750 ** Obtain permyriadage (permyriadage is to 10000 as percentage is to 100)
164751 ** progress indications for the two stages of an RBU update. This API may
164752 ** be useful for driving GUI progress indicators and similar.
@@ -164784,11 +164840,11 @@
164784 ** permyriadage progress of the same stage. If the rbu_count table does
164785 ** not exist, then (*pnOne) is set to -1 during stage 1. If the rbu_count
164786 ** table exists but is not correctly populated, the value of the *pnOne
164787 ** output variable during stage 1 is undefined.
164788 */
164789 SQLITE_API void SQLITE_STDCALL sqlite3rbu_bp_progress(sqlite3rbu *pRbu, int *pnOne, int *pnTwo);
164790
164791 /*
164792 ** Obtain an indication as to the current stage of an RBU update or vacuum.
164793 ** This function always returns one of the SQLITE_RBU_STATE_XXX constants
164794 ** defined in this file. Return values should be interpreted as follows:
@@ -164822,11 +164878,11 @@
164822 #define SQLITE_RBU_STATE_MOVE 2
164823 #define SQLITE_RBU_STATE_CHECKPOINT 3
164824 #define SQLITE_RBU_STATE_DONE 4
164825 #define SQLITE_RBU_STATE_ERROR 5
164826
164827 SQLITE_API int SQLITE_STDCALL sqlite3rbu_state(sqlite3rbu *pRbu);
164828
164829 /*
164830 ** Create an RBU VFS named zName that accesses the underlying file-system
164831 ** via existing VFS zParent. Or, if the zParent parameter is passed NULL,
164832 ** then the new RBU VFS uses the default system VFS to access the file-system.
@@ -164866,21 +164922,21 @@
164866 ** The overhead of adding the "rbu" VFS to the system is negligible for
164867 ** non-RBU users. There is no harm in an application accessing the
164868 ** file-system via "rbu" all the time, even if it only uses RBU functionality
164869 ** occasionally.
164870 */
164871 SQLITE_API int SQLITE_STDCALL sqlite3rbu_create_vfs(const char *zName, const char *zParent);
164872
164873 /*
164874 ** Deregister and destroy an RBU vfs created by an earlier call to
164875 ** sqlite3rbu_create_vfs().
164876 **
164877 ** VFS objects are not reference counted. If a VFS object is destroyed
164878 ** before all database handles that use it have been closed, the results
164879 ** are undefined.
164880 */
164881 SQLITE_API void SQLITE_STDCALL sqlite3rbu_destroy_vfs(const char *zName);
164882
164883 #if 0
164884 } /* end of the 'extern "C"' block */
164885 #endif
164886
@@ -167970,11 +168026,11 @@
167970 }
167971
167972 /*
167973 ** Step the RBU object.
167974 */
167975 SQLITE_API int SQLITE_STDCALL sqlite3rbu_step(sqlite3rbu *p){
167976 if( p ){
167977 switch( p->eStage ){
167978 case RBU_STAGE_OAL: {
167979 RbuObjIter *pIter = &p->objiter;
167980
@@ -168412,11 +168468,11 @@
168412 }
168413
168414 /*
168415 ** Open and return a new RBU handle.
168416 */
168417 SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_open(
168418 const char *zTarget,
168419 const char *zRbu,
168420 const char *zState
168421 ){
168422 /* TODO: Check that zTarget and zRbu are non-NULL */
@@ -168424,11 +168480,11 @@
168424 }
168425
168426 /*
168427 ** Open a handle to begin or resume an RBU VACUUM operation.
168428 */
168429 SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_vacuum(
168430 const char *zTarget,
168431 const char *zState
168432 ){
168433 /* TODO: Check that both arguments are non-NULL */
168434 return openRbuHandle(0, zTarget, zState);
@@ -168435,11 +168491,11 @@
168435 }
168436
168437 /*
168438 ** Return the database handle used by pRbu.
168439 */
168440 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3rbu_db(sqlite3rbu *pRbu, int bRbu){
168441 sqlite3 *db = 0;
168442 if( pRbu ){
168443 db = (bRbu ? pRbu->dbRbu : pRbu->dbMain);
168444 }
168445 return db;
@@ -168467,11 +168523,11 @@
168467 }
168468
168469 /*
168470 ** Close the RBU handle.
168471 */
168472 SQLITE_API int SQLITE_STDCALL sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){
168473 int rc;
168474 if( p ){
168475
168476 /* Commit the transaction to the *-oal file. */
168477 if( p->rc==SQLITE_OK && p->eStage==RBU_STAGE_OAL ){
@@ -168518,19 +168574,19 @@
168518 /*
168519 ** Return the total number of key-value operations (inserts, deletes or
168520 ** updates) that have been performed on the target database since the
168521 ** current RBU update was started.
168522 */
168523 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3rbu_progress(sqlite3rbu *pRbu){
168524 return pRbu->nProgress;
168525 }
168526
168527 /*
168528 ** Return permyriadage progress indications for the two main stages of
168529 ** an RBU update.
168530 */
168531 SQLITE_API void SQLITE_STDCALL sqlite3rbu_bp_progress(sqlite3rbu *p, int *pnOne, int *pnTwo){
168532 const int MAX_PROGRESS = 10000;
168533 switch( p->eStage ){
168534 case RBU_STAGE_OAL:
168535 if( p->nPhaseOneStep>0 ){
168536 *pnOne = (int)(MAX_PROGRESS * (i64)p->nProgress/(i64)p->nPhaseOneStep);
@@ -168561,11 +168617,11 @@
168561 }
168562
168563 /*
168564 ** Return the current state of the RBU vacuum or update operation.
168565 */
168566 SQLITE_API int SQLITE_STDCALL sqlite3rbu_state(sqlite3rbu *p){
168567 int aRes[] = {
168568 0, SQLITE_RBU_STATE_OAL, SQLITE_RBU_STATE_MOVE,
168569 0, SQLITE_RBU_STATE_CHECKPOINT, SQLITE_RBU_STATE_DONE
168570 };
168571
@@ -168589,11 +168645,11 @@
168589 );
168590 return aRes[p->eStage];
168591 }
168592 }
168593
168594 SQLITE_API int SQLITE_STDCALL sqlite3rbu_savestate(sqlite3rbu *p){
168595 int rc = p->rc;
168596 if( rc==SQLITE_DONE ) return SQLITE_OK;
168597
168598 assert( p->eStage>=RBU_STAGE_OAL && p->eStage<=RBU_STAGE_DONE );
168599 if( p->eStage==RBU_STAGE_OAL ){
@@ -169416,11 +169472,11 @@
169416
169417 /*
169418 ** Deregister and destroy an RBU vfs created by an earlier call to
169419 ** sqlite3rbu_create_vfs().
169420 */
169421 SQLITE_API void SQLITE_STDCALL sqlite3rbu_destroy_vfs(const char *zName){
169422 sqlite3_vfs *pVfs = sqlite3_vfs_find(zName);
169423 if( pVfs && pVfs->xOpen==rbuVfsOpen ){
169424 sqlite3_mutex_free(((rbu_vfs*)pVfs)->mutex);
169425 sqlite3_vfs_unregister(pVfs);
169426 sqlite3_free(pVfs);
@@ -169430,11 +169486,11 @@
169430 /*
169431 ** Create an RBU VFS named zName that accesses the underlying file-system
169432 ** via existing VFS zParent. The new object is registered as a non-default
169433 ** VFS with SQLite before returning.
169434 */
169435 SQLITE_API int SQLITE_STDCALL sqlite3rbu_create_vfs(const char *zName, const char *zParent){
169436
169437 /* Template for VFS */
169438 static sqlite3_vfs vfs_template = {
169439 1, /* iVersion */
169440 0, /* szOsFile */
@@ -171675,11 +171731,11 @@
171675 }
171676
171677 return rc;
171678 }
171679
171680 SQLITE_API int SQLITE_STDCALL sqlite3session_diff(
171681 sqlite3_session *pSession,
171682 const char *zFrom,
171683 const char *zTbl,
171684 char **pzErrMsg
171685 ){
@@ -171769,11 +171825,11 @@
171769
171770 /*
171771 ** Create a session object. This session object will record changes to
171772 ** database zDb attached to connection db.
171773 */
171774 SQLITE_API int SQLITE_STDCALL sqlite3session_create(
171775 sqlite3 *db, /* Database handle */
171776 const char *zDb, /* Name of db (e.g. "main") */
171777 sqlite3_session **ppSession /* OUT: New session object */
171778 ){
171779 sqlite3_session *pNew; /* Newly allocated session object */
@@ -171831,11 +171887,11 @@
171831 }
171832
171833 /*
171834 ** Delete a session object previously allocated using sqlite3session_create().
171835 */
171836 SQLITE_API void SQLITE_STDCALL sqlite3session_delete(sqlite3_session *pSession){
171837 sqlite3 *db = pSession->db;
171838 sqlite3_session *pHead;
171839 sqlite3_session **pp;
171840
171841 /* Unlink the session from the linked list of sessions attached to the
@@ -171860,11 +171916,11 @@
171860 }
171861
171862 /*
171863 ** Set a table filter on a Session Object.
171864 */
171865 SQLITE_API void SQLITE_STDCALL sqlite3session_table_filter(
171866 sqlite3_session *pSession,
171867 int(*xFilter)(void*, const char*),
171868 void *pCtx /* First argument passed to xFilter */
171869 ){
171870 pSession->bAutoAttach = 1;
@@ -171878,11 +171934,11 @@
171878 **
171879 ** Only tables that have a PRIMARY KEY defined may be attached. It does
171880 ** not matter if the PRIMARY KEY is an "INTEGER PRIMARY KEY" (rowid alias)
171881 ** or not.
171882 */
171883 SQLITE_API int SQLITE_STDCALL sqlite3session_attach(
171884 sqlite3_session *pSession, /* Session object */
171885 const char *zName /* Table name */
171886 ){
171887 int rc = SQLITE_OK;
171888 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
@@ -172568,11 +172624,11 @@
172568 ** session object passed as the first argument.
172569 **
172570 ** It is the responsibility of the caller to eventually free the buffer
172571 ** using sqlite3_free().
172572 */
172573 SQLITE_API int SQLITE_STDCALL sqlite3session_changeset(
172574 sqlite3_session *pSession, /* Session object */
172575 int *pnChangeset, /* OUT: Size of buffer at *ppChangeset */
172576 void **ppChangeset /* OUT: Buffer containing changeset */
172577 ){
172578 return sessionGenerateChangeset(pSession, 0, 0, 0, pnChangeset, ppChangeset);
@@ -172579,11 +172635,11 @@
172579 }
172580
172581 /*
172582 ** Streaming version of sqlite3session_changeset().
172583 */
172584 SQLITE_API int SQLITE_STDCALL sqlite3session_changeset_strm(
172585 sqlite3_session *pSession,
172586 int (*xOutput)(void *pOut, const void *pData, int nData),
172587 void *pOut
172588 ){
172589 return sessionGenerateChangeset(pSession, 0, xOutput, pOut, 0, 0);
@@ -172590,11 +172646,11 @@
172590 }
172591
172592 /*
172593 ** Streaming version of sqlite3session_patchset().
172594 */
172595 SQLITE_API int SQLITE_STDCALL sqlite3session_patchset_strm(
172596 sqlite3_session *pSession,
172597 int (*xOutput)(void *pOut, const void *pData, int nData),
172598 void *pOut
172599 ){
172600 return sessionGenerateChangeset(pSession, 1, xOutput, pOut, 0, 0);
@@ -172605,11 +172661,11 @@
172605 ** session object passed as the first argument.
172606 **
172607 ** It is the responsibility of the caller to eventually free the buffer
172608 ** using sqlite3_free().
172609 */
172610 SQLITE_API int SQLITE_STDCALL sqlite3session_patchset(
172611 sqlite3_session *pSession, /* Session object */
172612 int *pnPatchset, /* OUT: Size of buffer at *ppChangeset */
172613 void **ppPatchset /* OUT: Buffer containing changeset */
172614 ){
172615 return sessionGenerateChangeset(pSession, 1, 0, 0, pnPatchset, ppPatchset);
@@ -172616,11 +172672,11 @@
172616 }
172617
172618 /*
172619 ** Enable or disable the session object passed as the first argument.
172620 */
172621 SQLITE_API int SQLITE_STDCALL sqlite3session_enable(sqlite3_session *pSession, int bEnable){
172622 int ret;
172623 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172624 if( bEnable>=0 ){
172625 pSession->bEnable = bEnable;
172626 }
@@ -172630,11 +172686,11 @@
172630 }
172631
172632 /*
172633 ** Enable or disable the session object passed as the first argument.
172634 */
172635 SQLITE_API int SQLITE_STDCALL sqlite3session_indirect(sqlite3_session *pSession, int bIndirect){
172636 int ret;
172637 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172638 if( bIndirect>=0 ){
172639 pSession->bIndirect = bIndirect;
172640 }
@@ -172645,11 +172701,11 @@
172645
172646 /*
172647 ** Return true if there have been no changes to monitored tables recorded
172648 ** by the session object passed as the only argument.
172649 */
172650 SQLITE_API int SQLITE_STDCALL sqlite3session_isempty(sqlite3_session *pSession){
172651 int ret = 0;
172652 SessionTable *pTab;
172653
172654 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172655 for(pTab=pSession->pTable; pTab && ret==0; pTab=pTab->pNext){
@@ -172695,11 +172751,11 @@
172695 }
172696
172697 /*
172698 ** Create an iterator used to iterate through the contents of a changeset.
172699 */
172700 SQLITE_API int SQLITE_STDCALL sqlite3changeset_start(
172701 sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
172702 int nChangeset, /* Size of buffer pChangeset in bytes */
172703 void *pChangeset /* Pointer to buffer containing changeset */
172704 ){
172705 return sessionChangesetStart(pp, 0, 0, nChangeset, pChangeset);
@@ -172706,11 +172762,11 @@
172706 }
172707
172708 /*
172709 ** Streaming version of sqlite3changeset_start().
172710 */
172711 SQLITE_API int SQLITE_STDCALL sqlite3changeset_start_strm(
172712 sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
172713 int (*xInput)(void *pIn, void *pData, int *pnData),
172714 void *pIn
172715 ){
172716 return sessionChangesetStart(pp, xInput, pIn, 0, 0);
@@ -173127,20 +173183,20 @@
173127 ** or SQLITE_CORRUPT.
173128 **
173129 ** This function may not be called on iterators passed to a conflict handler
173130 ** callback by changeset_apply().
173131 */
173132 SQLITE_API int SQLITE_STDCALL sqlite3changeset_next(sqlite3_changeset_iter *p){
173133 return sessionChangesetNext(p, 0, 0);
173134 }
173135
173136 /*
173137 ** The following function extracts information on the current change
173138 ** from a changeset iterator. It may only be called after changeset_next()
173139 ** has returned SQLITE_ROW.
173140 */
173141 SQLITE_API int SQLITE_STDCALL sqlite3changeset_op(
173142 sqlite3_changeset_iter *pIter, /* Iterator handle */
173143 const char **pzTab, /* OUT: Pointer to table name */
173144 int *pnCol, /* OUT: Number of columns in table */
173145 int *pOp, /* OUT: SQLITE_INSERT, DELETE or UPDATE */
173146 int *pbIndirect /* OUT: True if change is indirect */
@@ -173156,11 +173212,11 @@
173156 ** Return information regarding the PRIMARY KEY and number of columns in
173157 ** the database table affected by the change that pIter currently points
173158 ** to. This function may only be called after changeset_next() returns
173159 ** SQLITE_ROW.
173160 */
173161 SQLITE_API int SQLITE_STDCALL sqlite3changeset_pk(
173162 sqlite3_changeset_iter *pIter, /* Iterator object */
173163 unsigned char **pabPK, /* OUT: Array of boolean - true for PK cols */
173164 int *pnCol /* OUT: Number of entries in output array */
173165 ){
173166 *pabPK = pIter->abPK;
@@ -173179,11 +173235,11 @@
173179 ** was not modified and is not a PK column), set *ppValue to NULL.
173180 **
173181 ** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is
173182 ** not modified. Otherwise, SQLITE_OK.
173183 */
173184 SQLITE_API int SQLITE_STDCALL sqlite3changeset_old(
173185 sqlite3_changeset_iter *pIter, /* Changeset iterator */
173186 int iVal, /* Index of old.* value to retrieve */
173187 sqlite3_value **ppValue /* OUT: Old value (or NULL pointer) */
173188 ){
173189 if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_DELETE ){
@@ -173207,11 +173263,11 @@
173207 ** was not modified), set *ppValue to NULL.
173208 **
173209 ** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is
173210 ** not modified. Otherwise, SQLITE_OK.
173211 */
173212 SQLITE_API int SQLITE_STDCALL sqlite3changeset_new(
173213 sqlite3_changeset_iter *pIter, /* Changeset iterator */
173214 int iVal, /* Index of new.* value to retrieve */
173215 sqlite3_value **ppValue /* OUT: New value (or NULL pointer) */
173216 ){
173217 if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_INSERT ){
@@ -173241,11 +173297,11 @@
173241 ** containing the iVal'th value of the conflicting record.
173242 **
173243 ** If value iVal is out-of-range or some other error occurs, an SQLite error
173244 ** code is returned. Otherwise, SQLITE_OK.
173245 */
173246 SQLITE_API int SQLITE_STDCALL sqlite3changeset_conflict(
173247 sqlite3_changeset_iter *pIter, /* Changeset iterator */
173248 int iVal, /* Index of conflict record value to fetch */
173249 sqlite3_value **ppValue /* OUT: Value from conflicting row */
173250 ){
173251 if( !pIter->pConflict ){
@@ -173264,11 +173320,11 @@
173264 ** it sets the output variable to the total number of known foreign key
173265 ** violations in the destination database and returns SQLITE_OK.
173266 **
173267 ** In all other cases this function returns SQLITE_MISUSE.
173268 */
173269 SQLITE_API int SQLITE_STDCALL sqlite3changeset_fk_conflicts(
173270 sqlite3_changeset_iter *pIter, /* Changeset iterator */
173271 int *pnOut /* OUT: Number of FK violations */
173272 ){
173273 if( pIter->pConflict || pIter->apValue ){
173274 return SQLITE_MISUSE;
@@ -173282,11 +173338,11 @@
173282 ** Finalize an iterator allocated with sqlite3changeset_start().
173283 **
173284 ** This function may not be called on iterators passed to a conflict handler
173285 ** callback by changeset_apply().
173286 */
173287 SQLITE_API int SQLITE_STDCALL sqlite3changeset_finalize(sqlite3_changeset_iter *p){
173288 int rc = SQLITE_OK;
173289 if( p ){
173290 int i; /* Used to iterate through p->apValue[] */
173291 rc = p->rc;
173292 if( p->apValue ){
@@ -173456,11 +173512,11 @@
173456
173457
173458 /*
173459 ** Invert a changeset object.
173460 */
173461 SQLITE_API int SQLITE_STDCALL sqlite3changeset_invert(
173462 int nChangeset, /* Number of bytes in input */
173463 const void *pChangeset, /* Input changeset */
173464 int *pnInverted, /* OUT: Number of bytes in output changeset */
173465 void **ppInverted /* OUT: Inverse of pChangeset */
173466 ){
@@ -173475,11 +173531,11 @@
173475 }
173476
173477 /*
173478 ** Streaming version of sqlite3changeset_invert().
173479 */
173480 SQLITE_API int SQLITE_STDCALL sqlite3changeset_invert_strm(
173481 int (*xInput)(void *pIn, void *pData, int *pnData),
173482 void *pIn,
173483 int (*xOutput)(void *pOut, const void *pData, int nData),
173484 void *pOut
173485 ){
@@ -174355,11 +174411,11 @@
174355 /*
174356 ** Apply the changeset passed via pChangeset/nChangeset to the main database
174357 ** attached to handle "db". Invoke the supplied conflict handler callback
174358 ** to resolve any conflicts encountered while applying the change.
174359 */
174360 SQLITE_API int SQLITE_STDCALL sqlite3changeset_apply(
174361 sqlite3 *db, /* Apply change to "main" db of this handle */
174362 int nChangeset, /* Size of changeset in bytes */
174363 void *pChangeset, /* Changeset blob */
174364 int(*xFilter)(
174365 void *pCtx, /* Copy of sixth arg to _apply() */
@@ -174383,11 +174439,11 @@
174383 /*
174384 ** Apply the changeset passed via xInput/pIn to the main database
174385 ** attached to handle "db". Invoke the supplied conflict handler callback
174386 ** to resolve any conflicts encountered while applying the change.
174387 */
174388 SQLITE_API int SQLITE_STDCALL sqlite3changeset_apply_strm(
174389 sqlite3 *db, /* Apply change to "main" db of this handle */
174390 int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
174391 void *pIn, /* First arg for xInput */
174392 int(*xFilter)(
174393 void *pCtx, /* Copy of sixth arg to _apply() */
@@ -174718,11 +174774,11 @@
174718 }
174719
174720 /*
174721 ** Allocate a new, empty, sqlite3_changegroup.
174722 */
174723 SQLITE_API int SQLITE_STDCALL sqlite3changegroup_new(sqlite3_changegroup **pp){
174724 int rc = SQLITE_OK; /* Return code */
174725 sqlite3_changegroup *p; /* New object */
174726 p = (sqlite3_changegroup*)sqlite3_malloc(sizeof(sqlite3_changegroup));
174727 if( p==0 ){
174728 rc = SQLITE_NOMEM;
@@ -174735,11 +174791,11 @@
174735
174736 /*
174737 ** Add the changeset currently stored in buffer pData, size nData bytes,
174738 ** to changeset-group p.
174739 */
174740 SQLITE_API int SQLITE_STDCALL sqlite3changegroup_add(sqlite3_changegroup *pGrp, int nData, void *pData){
174741 sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */
174742 int rc; /* Return code */
174743
174744 rc = sqlite3changeset_start(&pIter, nData, pData);
174745 if( rc==SQLITE_OK ){
@@ -174751,11 +174807,11 @@
174751
174752 /*
174753 ** Obtain a buffer containing a changeset representing the concatenation
174754 ** of all changesets added to the group so far.
174755 */
174756 SQLITE_API int SQLITE_STDCALL sqlite3changegroup_output(
174757 sqlite3_changegroup *pGrp,
174758 int *pnData,
174759 void **ppData
174760 ){
174761 return sessionChangegroupOutput(pGrp, 0, 0, pnData, ppData);
@@ -174762,11 +174818,11 @@
174762 }
174763
174764 /*
174765 ** Streaming versions of changegroup_add().
174766 */
174767 SQLITE_API int SQLITE_STDCALL sqlite3changegroup_add_strm(
174768 sqlite3_changegroup *pGrp,
174769 int (*xInput)(void *pIn, void *pData, int *pnData),
174770 void *pIn
174771 ){
174772 sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */
@@ -174781,11 +174837,11 @@
174781 }
174782
174783 /*
174784 ** Streaming versions of changegroup_output().
174785 */
174786 SQLITE_API int SQLITE_STDCALL sqlite3changegroup_output_strm(
174787 sqlite3_changegroup *pGrp,
174788 int (*xOutput)(void *pOut, const void *pData, int nData),
174789 void *pOut
174790 ){
174791 return sessionChangegroupOutput(pGrp, xOutput, pOut, 0, 0);
@@ -174792,21 +174848,21 @@
174792 }
174793
174794 /*
174795 ** Delete a changegroup object.
174796 */
174797 SQLITE_API void SQLITE_STDCALL sqlite3changegroup_delete(sqlite3_changegroup *pGrp){
174798 if( pGrp ){
174799 sessionDeleteTable(pGrp->pList);
174800 sqlite3_free(pGrp);
174801 }
174802 }
174803
174804 /*
174805 ** Combine two changesets together.
174806 */
174807 SQLITE_API int SQLITE_STDCALL sqlite3changeset_concat(
174808 int nLeft, /* Number of bytes in lhs input */
174809 void *pLeft, /* Lhs input changeset */
174810 int nRight /* Number of bytes in rhs input */,
174811 void *pRight, /* Rhs input changeset */
174812 int *pnOut, /* OUT: Number of bytes in output changeset */
@@ -174831,11 +174887,11 @@
174831 }
174832
174833 /*
174834 ** Streaming version of sqlite3changeset_concat().
174835 */
174836 SQLITE_API int SQLITE_STDCALL sqlite3changeset_concat_strm(
174837 int (*xInputA)(void *pIn, void *pData, int *pnData),
174838 void *pInA,
174839 int (*xInputB)(void *pIn, void *pData, int *pnData),
174840 void *pInB,
174841 int (*xOutput)(void *pOut, const void *pData, int nData),
@@ -177062,11 +177118,11 @@
177062
177063 #ifndef SQLITE_CORE
177064 #ifdef _WIN32
177065 __declspec(dllexport)
177066 #endif
177067 SQLITE_API int SQLITE_STDCALL sqlite3_json_init(
177068 sqlite3 *db,
177069 char **pzErrMsg,
177070 const sqlite3_api_routines *pApi
177071 ){
177072 SQLITE_EXTENSION_INIT2(pApi);
@@ -193895,11 +193951,11 @@
193895 int nArg, /* Number of args */
193896 sqlite3_value **apUnused /* Function arguments */
193897 ){
193898 assert( nArg==0 );
193899 UNUSED_PARAM2(nArg, apUnused);
193900 sqlite3_result_text(pCtx, "fts5: 2016-07-26 10:46:21 483994a54dee3c7a3801e0e9d3c96fa9dbd8d2fd", -1, SQLITE_TRANSIENT);
193901 }
193902
193903 static int fts5Init(sqlite3 *db){
193904 static const sqlite3_module fts5Mod = {
193905 /* iVersion */ 2,
@@ -193983,11 +194039,11 @@
193983 */
193984 #ifndef SQLITE_CORE
193985 #ifdef _WIN32
193986 __declspec(dllexport)
193987 #endif
193988 SQLITE_API int SQLITE_STDCALL sqlite3_fts_init(
193989 sqlite3 *db,
193990 char **pzErrMsg,
193991 const sqlite3_api_routines *pApi
193992 ){
193993 SQLITE_EXTENSION_INIT2(pApi);
@@ -193996,11 +194052,11 @@
193996 }
193997
193998 #ifdef _WIN32
193999 __declspec(dllexport)
194000 #endif
194001 SQLITE_API int SQLITE_STDCALL sqlite3_fts5_init(
194002 sqlite3 *db,
194003 char **pzErrMsg,
194004 const sqlite3_api_routines *pApi
194005 ){
194006 SQLITE_EXTENSION_INIT2(pApi);
194007
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -65,10 +65,18 @@
65 ** In all cases, the special comment must be enclosed in the usual
66 ** slash-asterisk...asterisk-slash comment marks, with no spaces between the
67 ** asterisks and the comment text.
68 */
69
70 /*
71 ** Make sure the Tcl calling convention macro is defined. This macro is
72 ** only used by test code and Tcl integration code.
73 */
74 #ifndef SQLITE_TCLAPI
75 # define SQLITE_TCLAPI
76 #endif
77
78 /*
79 ** Make sure that rand_s() is available on Windows systems with MSVC 2005
80 ** or higher.
81 */
82 #if defined(_MSC_VER) && _MSC_VER>=1400
@@ -304,12 +312,21 @@
312 # define SQLITE_API
313 #endif
314 #ifndef SQLITE_CDECL
315 # define SQLITE_CDECL
316 #endif
317 #ifndef SQLITE_APICALL
318 # define SQLITE_APICALL
319 #endif
320 #ifndef SQLITE_STDCALL
321 # define SQLITE_STDCALL SQLITE_APICALL
322 #endif
323 #ifndef SQLITE_CALLBACK
324 # define SQLITE_CALLBACK
325 #endif
326 #ifndef SQLITE_SYSAPI
327 # define SQLITE_SYSAPI
328 #endif
329
330 /*
331 ** These no-op macros are used in front of interfaces to mark those
332 ** interfaces as either deprecated or experimental. New applications
@@ -363,11 +380,11 @@
380 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
381 ** [sqlite_version()] and [sqlite_source_id()].
382 */
383 #define SQLITE_VERSION "3.14.0"
384 #define SQLITE_VERSION_NUMBER 3014000
385 #define SQLITE_SOURCE_ID "2016-07-29 04:12:18 544c990afd3b64064cc4d970ec5d7eb23eeb9914"
386
387 /*
388 ** CAPI3REF: Run-Time Library Version Numbers
389 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
390 **
@@ -396,13 +413,13 @@
413 ** [SQLITE_SOURCE_ID] C preprocessor macro.
414 **
415 ** See also: [sqlite_version()] and [sqlite_source_id()].
416 */
417 SQLITE_API const char sqlite3_version[] = SQLITE_VERSION;
418 SQLITE_API const char *SQLITE_APICALL sqlite3_libversion(void);
419 SQLITE_API const char *SQLITE_APICALL sqlite3_sourceid(void);
420 SQLITE_API int SQLITE_APICALL sqlite3_libversion_number(void);
421
422 /*
423 ** CAPI3REF: Run-Time Library Compilation Options Diagnostics
424 **
425 ** ^The sqlite3_compileoption_used() function returns 0 or 1
@@ -423,12 +440,12 @@
440 **
441 ** See also: SQL functions [sqlite_compileoption_used()] and
442 ** [sqlite_compileoption_get()] and the [compile_options pragma].
443 */
444 #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
445 SQLITE_API int SQLITE_APICALL sqlite3_compileoption_used(const char *zOptName);
446 SQLITE_API const char *SQLITE_APICALL sqlite3_compileoption_get(int N);
447 #endif
448
449 /*
450 ** CAPI3REF: Test To See If The Library Is Threadsafe
451 **
@@ -463,11 +480,11 @@
480 ** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
481 ** is unchanged by calls to sqlite3_config().)^
482 **
483 ** See the [threading mode] documentation for additional information.
484 */
485 SQLITE_API int SQLITE_APICALL sqlite3_threadsafe(void);
486
487 /*
488 ** CAPI3REF: Database Connection Handle
489 ** KEYWORDS: {database connection} {database connections}
490 **
@@ -560,19 +577,19 @@
577 ** from [sqlite3_open()], [sqlite3_open16()], or
578 ** [sqlite3_open_v2()], and not previously closed.
579 ** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
580 ** argument is a harmless no-op.
581 */
582 SQLITE_API int SQLITE_APICALL sqlite3_close(sqlite3*);
583 SQLITE_API int SQLITE_APICALL sqlite3_close_v2(sqlite3*);
584
585 /*
586 ** The type for a callback function.
587 ** This is legacy and deprecated. It is included for historical
588 ** compatibility and is not documented.
589 */
590 typedef int (SQLITE_CALLBACK *sqlite3_callback)(void*,int,char**, char**);
591
592 /*
593 ** CAPI3REF: One-Step Query Execution Interface
594 ** METHOD: sqlite3
595 **
@@ -632,14 +649,14 @@
649 ** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
650 ** <li> The application must not modify the SQL statement text passed into
651 ** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
652 ** </ul>
653 */
654 SQLITE_API int SQLITE_APICALL sqlite3_exec(
655 sqlite3*, /* An open database */
656 const char *sql, /* SQL to be evaluated */
657 int (SQLITE_CALLBACK *callback)(void*,int,char**,char**), /* Callback function */
658 void *, /* 1st argument to callback */
659 char **errmsg /* Error msg written here */
660 );
661
662 /*
@@ -983,30 +1000,30 @@
1000 ** database corruption.
1001 */
1002 typedef struct sqlite3_io_methods sqlite3_io_methods;
1003 struct sqlite3_io_methods {
1004 int iVersion;
1005 int (SQLITE_CALLBACK *xClose)(sqlite3_file*);
1006 int (SQLITE_CALLBACK *xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
1007 int (SQLITE_CALLBACK *xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
1008 int (SQLITE_CALLBACK *xTruncate)(sqlite3_file*, sqlite3_int64 size);
1009 int (SQLITE_CALLBACK *xSync)(sqlite3_file*, int flags);
1010 int (SQLITE_CALLBACK *xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
1011 int (SQLITE_CALLBACK *xLock)(sqlite3_file*, int);
1012 int (SQLITE_CALLBACK *xUnlock)(sqlite3_file*, int);
1013 int (SQLITE_CALLBACK *xCheckReservedLock)(sqlite3_file*, int *pResOut);
1014 int (SQLITE_CALLBACK *xFileControl)(sqlite3_file*, int op, void *pArg);
1015 int (SQLITE_CALLBACK *xSectorSize)(sqlite3_file*);
1016 int (SQLITE_CALLBACK *xDeviceCharacteristics)(sqlite3_file*);
1017 /* Methods above are valid for version 1 */
1018 int (SQLITE_CALLBACK *xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
1019 int (SQLITE_CALLBACK *xShmLock)(sqlite3_file*, int offset, int n, int flags);
1020 void (SQLITE_CALLBACK *xShmBarrier)(sqlite3_file*);
1021 int (SQLITE_CALLBACK *xShmUnmap)(sqlite3_file*, int deleteFlag);
1022 /* Methods above are valid for version 2 */
1023 int (SQLITE_CALLBACK *xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
1024 int (SQLITE_CALLBACK *xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p);
1025 /* Methods above are valid for version 3 */
1026 /* Additional methods may be added in future releases */
1027 };
1028
1029 /*
@@ -1178,11 +1195,11 @@
1195 ** ^The [SQLITE_FCNTL_BUSYHANDLER]
1196 ** file-control may be invoked by SQLite on the database file handle
1197 ** shortly after it is opened in order to provide a custom VFS with access
1198 ** to the connections busy-handler callback. The argument is of type (void **)
1199 ** - an array of two (void *) values. The first (void *) actually points
1200 ** to a function of type (int (SQLITE_CALLBACK *)(void *)). In order to invoke the connections
1201 ** busy-handler, this function should be invoked with the second (void *) in
1202 ** the array as the only argument. If it returns non-zero, then the operation
1203 ** should be retried. If it returns zero, the custom VFS should abandon the
1204 ** current operation.
1205 **
@@ -1444,43 +1461,43 @@
1461 ** or all of these interfaces to be NULL or for their behavior to change
1462 ** from one release to the next. Applications must not attempt to access
1463 ** any of these methods if the iVersion of the VFS is less than 3.
1464 */
1465 typedef struct sqlite3_vfs sqlite3_vfs;
1466 typedef void (SQLITE_SYSAPI *sqlite3_syscall_ptr)(void);
1467 struct sqlite3_vfs {
1468 int iVersion; /* Structure version number (currently 3) */
1469 int szOsFile; /* Size of subclassed sqlite3_file */
1470 int mxPathname; /* Maximum file pathname length */
1471 sqlite3_vfs *pNext; /* Next registered VFS */
1472 const char *zName; /* Name of this virtual file system */
1473 void *pAppData; /* Pointer to application-specific data */
1474 int (SQLITE_CALLBACK *xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
1475 int flags, int *pOutFlags);
1476 int (SQLITE_CALLBACK *xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
1477 int (SQLITE_CALLBACK *xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
1478 int (SQLITE_CALLBACK *xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
1479 void *(SQLITE_CALLBACK *xDlOpen)(sqlite3_vfs*, const char *zFilename);
1480 void (SQLITE_CALLBACK *xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
1481 void (SQLITE_CALLBACK *(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
1482 void (SQLITE_CALLBACK *xDlClose)(sqlite3_vfs*, void*);
1483 int (SQLITE_CALLBACK *xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
1484 int (SQLITE_CALLBACK *xSleep)(sqlite3_vfs*, int microseconds);
1485 int (SQLITE_CALLBACK *xCurrentTime)(sqlite3_vfs*, double*);
1486 int (SQLITE_CALLBACK *xGetLastError)(sqlite3_vfs*, int, char *);
1487 /*
1488 ** The methods above are in version 1 of the sqlite_vfs object
1489 ** definition. Those that follow are added in version 2 or later
1490 */
1491 int (SQLITE_CALLBACK *xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
1492 /*
1493 ** The methods above are in versions 1 and 2 of the sqlite_vfs object.
1494 ** Those below are for version 3 and greater.
1495 */
1496 int (SQLITE_CALLBACK *xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
1497 sqlite3_syscall_ptr (SQLITE_CALLBACK *xGetSystemCall)(sqlite3_vfs*, const char *zName);
1498 const char *(SQLITE_CALLBACK *xNextSystemCall)(sqlite3_vfs*, const char *zName);
1499 /*
1500 ** The methods above are in versions 1 through 3 of the sqlite_vfs object.
1501 ** New fields may be appended in future versions. The iVersion
1502 ** value will increment whenever this happens.
1503 */
@@ -1621,14 +1638,14 @@
1638 ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied
1639 ** implementation of sqlite3_os_init() or sqlite3_os_end()
1640 ** must return [SQLITE_OK] on success and some other [error code] upon
1641 ** failure.
1642 */
1643 SQLITE_API int SQLITE_APICALL sqlite3_initialize(void);
1644 SQLITE_API int SQLITE_APICALL sqlite3_shutdown(void);
1645 SQLITE_API int SQLITE_APICALL sqlite3_os_init(void);
1646 SQLITE_API int SQLITE_APICALL sqlite3_os_end(void);
1647
1648 /*
1649 ** CAPI3REF: Configuring The SQLite Library
1650 **
1651 ** The sqlite3_config() interface is used to make global configuration
@@ -1743,17 +1760,17 @@
1760 ** SQLite will never invoke xInit() more than once without an intervening
1761 ** call to xShutdown().
1762 */
1763 typedef struct sqlite3_mem_methods sqlite3_mem_methods;
1764 struct sqlite3_mem_methods {
1765 void *(SQLITE_CALLBACK *xMalloc)(int); /* Memory allocation function */
1766 void (SQLITE_CALLBACK *xFree)(void*); /* Free a prior allocation */
1767 void *(SQLITE_CALLBACK *xRealloc)(void*,int); /* Resize an allocation */
1768 int (SQLITE_CALLBACK *xSize)(void*); /* Return the size of an allocation */
1769 int (SQLITE_CALLBACK *xRoundup)(int); /* Round up request size to allocation size */
1770 int (SQLITE_CALLBACK *xInit)(void*); /* Initialize the memory allocator */
1771 void (SQLITE_CALLBACK *xShutdown)(void*); /* Deinitialize the memory allocator */
1772 void *pAppData; /* Argument to xInit() and xShutdown() */
1773 };
1774
1775 /*
1776 ** CAPI3REF: Configuration Options
@@ -1966,11 +1983,11 @@
1983 **
1984 ** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
1985 ** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
1986 ** global [error log].
1987 ** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a
1988 ** function with a call signature of void(SQLITE_CALLBACK *)(void*,int,const char*),
1989 ** and a pointer to void. ^If the function pointer is not NULL, it is
1990 ** invoked by [sqlite3_log()] to process each logging event. ^If the
1991 ** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op.
1992 ** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is
1993 ** passed through as the first parameter to the application-defined logger
@@ -2019,11 +2036,11 @@
2036 **
2037 ** [[SQLITE_CONFIG_SQLLOG]]
2038 ** <dt>SQLITE_CONFIG_SQLLOG
2039 ** <dd>This option is only available if sqlite is compiled with the
2040 ** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should
2041 ** be a pointer to a function of type void(SQLITE_CALLBACK *)(void*,sqlite3*,const char*, int).
2042 ** The second should be of type (void*). The callback is invoked by the library
2043 ** in three separate circumstances, identified by the value passed as the
2044 ** fourth parameter. If the fourth parameter is 0, then the database connection
2045 ** passed as the second argument has just been opened. The third argument
2046 ** points to a buffer containing the name of the main database file. If the
@@ -2217,11 +2234,11 @@
2234 **
2235 ** ^The sqlite3_extended_result_codes() routine enables or disables the
2236 ** [extended result codes] feature of SQLite. ^The extended result
2237 ** codes are disabled by default for historical compatibility.
2238 */
2239 SQLITE_API int SQLITE_APICALL sqlite3_extended_result_codes(sqlite3*, int onoff);
2240
2241 /*
2242 ** CAPI3REF: Last Insert Rowid
2243 ** METHOD: sqlite3
2244 **
@@ -2269,11 +2286,11 @@
2286 ** function is running and thus changes the last insert [rowid],
2287 ** then the value returned by [sqlite3_last_insert_rowid()] is
2288 ** unpredictable and might not equal either the old or the new
2289 ** last insert [rowid].
2290 */
2291 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_last_insert_rowid(sqlite3*);
2292
2293 /*
2294 ** CAPI3REF: Count The Number Of Rows Modified
2295 ** METHOD: sqlite3
2296 **
@@ -2322,11 +2339,11 @@
2339 **
2340 ** If a separate thread makes changes on the same database connection
2341 ** while [sqlite3_changes()] is running then the value returned
2342 ** is unpredictable and not meaningful.
2343 */
2344 SQLITE_API int SQLITE_APICALL sqlite3_changes(sqlite3*);
2345
2346 /*
2347 ** CAPI3REF: Total Number Of Rows Modified
2348 ** METHOD: sqlite3
2349 **
@@ -2346,11 +2363,11 @@
2363 **
2364 ** If a separate thread makes changes on the same database connection
2365 ** while [sqlite3_total_changes()] is running then the value
2366 ** returned is unpredictable and not meaningful.
2367 */
2368 SQLITE_API int SQLITE_APICALL sqlite3_total_changes(sqlite3*);
2369
2370 /*
2371 ** CAPI3REF: Interrupt A Long-Running Query
2372 ** METHOD: sqlite3
2373 **
@@ -2386,11 +2403,11 @@
2403 ** that are started after the sqlite3_interrupt() call returns.
2404 **
2405 ** If the database connection closes while [sqlite3_interrupt()]
2406 ** is running then bad things will likely happen.
2407 */
2408 SQLITE_API void SQLITE_APICALL sqlite3_interrupt(sqlite3*);
2409
2410 /*
2411 ** CAPI3REF: Determine If An SQL Statement Is Complete
2412 **
2413 ** These routines are useful during command-line input to determine if the
@@ -2421,12 +2438,12 @@
2438 ** UTF-8 string.
2439 **
2440 ** The input to [sqlite3_complete16()] must be a zero-terminated
2441 ** UTF-16 string in native byte order.
2442 */
2443 SQLITE_API int SQLITE_APICALL sqlite3_complete(const char *sql);
2444 SQLITE_API int SQLITE_APICALL sqlite3_complete16(const void *sql);
2445
2446 /*
2447 ** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
2448 ** KEYWORDS: {busy-handler callback} {busy handler}
2449 ** METHOD: sqlite3
@@ -2483,11 +2500,11 @@
2500 ** result in undefined behavior.
2501 **
2502 ** A busy handler must not close the database connection
2503 ** or [prepared statement] that invoked the busy handler.
2504 */
2505 SQLITE_API int SQLITE_APICALL sqlite3_busy_handler(sqlite3*, int(SQLITE_CALLBACK *)(void*,int), void*);
2506
2507 /*
2508 ** CAPI3REF: Set A Busy Timeout
2509 ** METHOD: sqlite3
2510 **
@@ -2506,11 +2523,11 @@
2523 ** was defined (using [sqlite3_busy_handler()]) prior to calling
2524 ** this routine, that other busy handler is cleared.)^
2525 **
2526 ** See also: [PRAGMA busy_timeout]
2527 */
2528 SQLITE_API int SQLITE_APICALL sqlite3_busy_timeout(sqlite3*, int ms);
2529
2530 /*
2531 ** CAPI3REF: Convenience Routines For Running Queries
2532 ** METHOD: sqlite3
2533 **
@@ -2581,19 +2598,19 @@
2598 ** interface defined here. As a consequence, errors that occur in the
2599 ** wrapper layer outside of the internal [sqlite3_exec()] call are not
2600 ** reflected in subsequent calls to [sqlite3_errcode()] or
2601 ** [sqlite3_errmsg()].
2602 */
2603 SQLITE_API int SQLITE_APICALL sqlite3_get_table(
2604 sqlite3 *db, /* An open database */
2605 const char *zSql, /* SQL to be evaluated */
2606 char ***pazResult, /* Results of the query */
2607 int *pnRow, /* Number of result rows written here */
2608 int *pnColumn, /* Number of result columns written here */
2609 char **pzErrmsg /* Error msg written here */
2610 );
2611 SQLITE_API void SQLITE_APICALL sqlite3_free_table(char **result);
2612
2613 /*
2614 ** CAPI3REF: Formatted String Printing Functions
2615 **
2616 ** These routines are work-alikes of the "printf()" family of functions
@@ -2696,13 +2713,13 @@
2713 ** ^(The "%z" formatting option works like "%s" but with the
2714 ** addition that after the string has been read and copied into
2715 ** the result, [sqlite3_free()] is called on the input string.)^
2716 */
2717 SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...);
2718 SQLITE_API char *SQLITE_APICALL sqlite3_vmprintf(const char*, va_list);
2719 SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...);
2720 SQLITE_API char *SQLITE_APICALL sqlite3_vsnprintf(int,char*,const char*, va_list);
2721
2722 /*
2723 ** CAPI3REF: Memory Allocation Subsystem
2724 **
2725 ** The SQLite core uses these three routines for all of its own
@@ -2788,16 +2805,16 @@
2805 **
2806 ** The application must not read or write any part of
2807 ** a block of memory after it has been released using
2808 ** [sqlite3_free()] or [sqlite3_realloc()].
2809 */
2810 SQLITE_API void *SQLITE_APICALL sqlite3_malloc(int);
2811 SQLITE_API void *SQLITE_APICALL sqlite3_malloc64(sqlite3_uint64);
2812 SQLITE_API void *SQLITE_APICALL sqlite3_realloc(void*, int);
2813 SQLITE_API void *SQLITE_APICALL sqlite3_realloc64(void*, sqlite3_uint64);
2814 SQLITE_API void SQLITE_APICALL sqlite3_free(void*);
2815 SQLITE_API sqlite3_uint64 SQLITE_APICALL sqlite3_msize(void*);
2816
2817 /*
2818 ** CAPI3REF: Memory Allocator Statistics
2819 **
2820 ** SQLite provides these two interfaces for reporting on the status
@@ -2818,12 +2835,12 @@
2835 ** [sqlite3_memory_used()] if and only if the parameter to
2836 ** [sqlite3_memory_highwater()] is true. ^The value returned
2837 ** by [sqlite3_memory_highwater(1)] is the high-water mark
2838 ** prior to the reset.
2839 */
2840 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_used(void);
2841 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_highwater(int resetFlag);
2842
2843 /*
2844 ** CAPI3REF: Pseudo-Random Number Generator
2845 **
2846 ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
@@ -2842,11 +2859,11 @@
2859 ** ^If the previous call to this routine had an N of 1 or more and a
2860 ** non-NULL P then the pseudo-randomness is generated
2861 ** internally and without recourse to the [sqlite3_vfs] xRandomness
2862 ** method.
2863 */
2864 SQLITE_API void SQLITE_APICALL sqlite3_randomness(int N, void *P);
2865
2866 /*
2867 ** CAPI3REF: Compile-Time Authorization Callbacks
2868 ** METHOD: sqlite3
2869 **
@@ -2925,13 +2942,13 @@
2942 ** [sqlite3_prepare()] or its variants. Authorization is not
2943 ** performed during statement evaluation in [sqlite3_step()], unless
2944 ** as stated in the previous paragraph, sqlite3_step() invokes
2945 ** sqlite3_prepare_v2() to reprepare a statement after a schema change.
2946 */
2947 SQLITE_API int SQLITE_APICALL sqlite3_set_authorizer(
2948 sqlite3*,
2949 int (SQLITE_CALLBACK *xAuth)(void*,int,const char*,const char*,const char*,const char*),
2950 void *pUserData
2951 );
2952
2953 /*
2954 ** CAPI3REF: Authorizer Return Codes
@@ -3033,14 +3050,14 @@
3050 ** digits in the time are meaningless. Future versions of SQLite
3051 ** might provide greater resolution on the profiler callback. The
3052 ** sqlite3_profile() function is considered experimental and is
3053 ** subject to change in future versions of SQLite.
3054 */
3055 SQLITE_API SQLITE_DEPRECATED void *SQLITE_APICALL sqlite3_trace(sqlite3*,
3056 void(SQLITE_CALLBACK *xTrace)(void*,const char*), void*);
3057 SQLITE_API SQLITE_DEPRECATED void *SQLITE_APICALL sqlite3_profile(sqlite3*,
3058 void(SQLITE_CALLBACK *xProfile)(void*,const char*,sqlite3_uint64), void*);
3059
3060 /*
3061 ** CAPI3REF: SQL Trace Event Codes
3062 ** KEYWORDS: SQLITE_TRACE
3063 **
@@ -3124,14 +3141,14 @@
3141 **
3142 ** The sqlite3_trace_v2() interface is intended to replace the legacy
3143 ** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which
3144 ** are deprecated.
3145 */
3146 SQLITE_API int SQLITE_APICALL sqlite3_trace_v2(
3147 sqlite3*,
3148 unsigned uMask,
3149 int(SQLITE_CALLBACK *xCallback)(unsigned,void*,void*,void*),
3150 void *pCtx
3151 );
3152
3153 /*
3154 ** CAPI3REF: Query Progress Callbacks
@@ -3163,11 +3180,11 @@
3180 ** the database connection that invoked the progress handler.
3181 ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
3182 ** database connections for the meaning of "modify" in this paragraph.
3183 **
3184 */
3185 SQLITE_API void SQLITE_APICALL sqlite3_progress_handler(sqlite3*, int, int(SQLITE_CALLBACK *)(void*), void*);
3186
3187 /*
3188 ** CAPI3REF: Opening A New Database Connection
3189 ** CONSTRUCTOR: sqlite3
3190 **
@@ -3392,19 +3409,19 @@
3409 ** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various
3410 ** features that require the use of temporary files may fail.
3411 **
3412 ** See also: [sqlite3_temp_directory]
3413 */
3414 SQLITE_API int SQLITE_APICALL sqlite3_open(
3415 const char *filename, /* Database filename (UTF-8) */
3416 sqlite3 **ppDb /* OUT: SQLite db handle */
3417 );
3418 SQLITE_API int SQLITE_APICALL sqlite3_open16(
3419 const void *filename, /* Database filename (UTF-16) */
3420 sqlite3 **ppDb /* OUT: SQLite db handle */
3421 );
3422 SQLITE_API int SQLITE_APICALL sqlite3_open_v2(
3423 const char *filename, /* Database filename (UTF-8) */
3424 sqlite3 **ppDb, /* OUT: SQLite db handle */
3425 int flags, /* Flags */
3426 const char *zVfs /* Name of VFS module to use */
3427 );
@@ -3446,13 +3463,13 @@
3463 ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and
3464 ** is not a database file pathname pointer that SQLite passed into the xOpen
3465 ** VFS method, then the behavior of this routine is undefined and probably
3466 ** undesirable.
3467 */
3468 SQLITE_API const char *SQLITE_APICALL sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3469 SQLITE_API int SQLITE_APICALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3470 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
3471
3472
3473 /*
3474 ** CAPI3REF: Error Codes And Messages
3475 ** METHOD: sqlite3
@@ -3492,15 +3509,15 @@
3509 **
3510 ** If an interface fails with SQLITE_MISUSE, that means the interface
3511 ** was invoked incorrectly by the application. In that case, the
3512 ** error code and message may or may not be set.
3513 */
3514 SQLITE_API int SQLITE_APICALL sqlite3_errcode(sqlite3 *db);
3515 SQLITE_API int SQLITE_APICALL sqlite3_extended_errcode(sqlite3 *db);
3516 SQLITE_API const char *SQLITE_APICALL sqlite3_errmsg(sqlite3*);
3517 SQLITE_API const void *SQLITE_APICALL sqlite3_errmsg16(sqlite3*);
3518 SQLITE_API const char *SQLITE_APICALL sqlite3_errstr(int);
3519
3520 /*
3521 ** CAPI3REF: Prepared Statement Object
3522 ** KEYWORDS: {prepared statement} {prepared statements}
3523 **
@@ -3564,11 +3581,11 @@
3581 ** created by an untrusted script can be contained using the
3582 ** [max_page_count] [PRAGMA].
3583 **
3584 ** New run-time limit categories may be added in future releases.
3585 */
3586 SQLITE_API int SQLITE_APICALL sqlite3_limit(sqlite3*, int id, int newVal);
3587
3588 /*
3589 ** CAPI3REF: Run-Time Limit Categories
3590 ** KEYWORDS: {limit category} {*limit categories}
3591 **
@@ -3716,32 +3733,32 @@
3733 ** or [GLOB] operator or if the parameter is compared to an indexed column
3734 ** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
3735 ** </li>
3736 ** </ol>
3737 */
3738 SQLITE_API int SQLITE_APICALL sqlite3_prepare(
3739 sqlite3 *db, /* Database handle */
3740 const char *zSql, /* SQL statement, UTF-8 encoded */
3741 int nByte, /* Maximum length of zSql in bytes. */
3742 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3743 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3744 );
3745 SQLITE_API int SQLITE_APICALL sqlite3_prepare_v2(
3746 sqlite3 *db, /* Database handle */
3747 const char *zSql, /* SQL statement, UTF-8 encoded */
3748 int nByte, /* Maximum length of zSql in bytes. */
3749 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3750 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3751 );
3752 SQLITE_API int SQLITE_APICALL sqlite3_prepare16(
3753 sqlite3 *db, /* Database handle */
3754 const void *zSql, /* SQL statement, UTF-16 encoded */
3755 int nByte, /* Maximum length of zSql in bytes. */
3756 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3757 const void **pzTail /* OUT: Pointer to unused portion of zSql */
3758 );
3759 SQLITE_API int SQLITE_APICALL sqlite3_prepare16_v2(
3760 sqlite3 *db, /* Database handle */
3761 const void *zSql, /* SQL statement, UTF-16 encoded */
3762 int nByte, /* Maximum length of zSql in bytes. */
3763 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3764 const void **pzTail /* OUT: Pointer to unused portion of zSql */
@@ -3776,12 +3793,12 @@
3793 ** automatically freed when the prepared statement is finalized.
3794 ** ^The string returned by sqlite3_expanded_sql(P), on the other hand,
3795 ** is obtained from [sqlite3_malloc()] and must be free by the application
3796 ** by passing it to [sqlite3_free()].
3797 */
3798 SQLITE_API const char *SQLITE_APICALL sqlite3_sql(sqlite3_stmt *pStmt);
3799 SQLITE_API char *SQLITE_APICALL sqlite3_expanded_sql(sqlite3_stmt *pStmt);
3800
3801 /*
3802 ** CAPI3REF: Determine If An SQL Statement Writes The Database
3803 ** METHOD: sqlite3_stmt
3804 **
@@ -3809,11 +3826,11 @@
3826 ** database. ^The [ATTACH] and [DETACH] statements also cause
3827 ** sqlite3_stmt_readonly() to return true since, while those statements
3828 ** change the configuration of a database connection, they do not make
3829 ** changes to the content of the database files on disk.
3830 */
3831 SQLITE_API int SQLITE_APICALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
3832
3833 /*
3834 ** CAPI3REF: Determine If A Prepared Statement Has Been Reset
3835 ** METHOD: sqlite3_stmt
3836 **
@@ -3830,11 +3847,11 @@
3847 ** to locate all prepared statements associated with a database
3848 ** connection that are in need of being reset. This can be used,
3849 ** for example, in diagnostic routines to search for prepared
3850 ** statements that are holding a transaction open.
3851 */
3852 SQLITE_API int SQLITE_APICALL sqlite3_stmt_busy(sqlite3_stmt*);
3853
3854 /*
3855 ** CAPI3REF: Dynamically Typed Value Object
3856 ** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
3857 **
@@ -3994,24 +4011,24 @@
4011 ** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails.
4012 **
4013 ** See also: [sqlite3_bind_parameter_count()],
4014 ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].
4015 */
4016 SQLITE_API int SQLITE_APICALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(SQLITE_CALLBACK *)(void*));
4017 SQLITE_API int SQLITE_APICALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
4018 void(SQLITE_CALLBACK *)(void*));
4019 SQLITE_API int SQLITE_APICALL sqlite3_bind_double(sqlite3_stmt*, int, double);
4020 SQLITE_API int SQLITE_APICALL sqlite3_bind_int(sqlite3_stmt*, int, int);
4021 SQLITE_API int SQLITE_APICALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
4022 SQLITE_API int SQLITE_APICALL sqlite3_bind_null(sqlite3_stmt*, int);
4023 SQLITE_API int SQLITE_APICALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(SQLITE_CALLBACK *)(void*));
4024 SQLITE_API int SQLITE_APICALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(SQLITE_CALLBACK *)(void*));
4025 SQLITE_API int SQLITE_APICALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
4026 void(SQLITE_CALLBACK *)(void*), unsigned char encoding);
4027 SQLITE_API int SQLITE_APICALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
4028 SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
4029 SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
4030
4031 /*
4032 ** CAPI3REF: Number Of SQL Parameters
4033 ** METHOD: sqlite3_stmt
4034 **
@@ -4028,11 +4045,11 @@
4045 **
4046 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
4047 ** [sqlite3_bind_parameter_name()], and
4048 ** [sqlite3_bind_parameter_index()].
4049 */
4050 SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_count(sqlite3_stmt*);
4051
4052 /*
4053 ** CAPI3REF: Name Of A Host Parameter
4054 ** METHOD: sqlite3_stmt
4055 **
@@ -4056,11 +4073,11 @@
4073 **
4074 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
4075 ** [sqlite3_bind_parameter_count()], and
4076 ** [sqlite3_bind_parameter_index()].
4077 */
4078 SQLITE_API const char *SQLITE_APICALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
4079
4080 /*
4081 ** CAPI3REF: Index Of A Parameter With A Given Name
4082 ** METHOD: sqlite3_stmt
4083 **
@@ -4073,21 +4090,21 @@
4090 **
4091 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
4092 ** [sqlite3_bind_parameter_count()], and
4093 ** [sqlite3_bind_parameter_name()].
4094 */
4095 SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
4096
4097 /*
4098 ** CAPI3REF: Reset All Bindings On A Prepared Statement
4099 ** METHOD: sqlite3_stmt
4100 **
4101 ** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset
4102 ** the [sqlite3_bind_blob | bindings] on a [prepared statement].
4103 ** ^Use this routine to reset all host parameters to NULL.
4104 */
4105 SQLITE_API int SQLITE_APICALL sqlite3_clear_bindings(sqlite3_stmt*);
4106
4107 /*
4108 ** CAPI3REF: Number Of Columns In A Result Set
4109 ** METHOD: sqlite3_stmt
4110 **
@@ -4095,11 +4112,11 @@
4112 ** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
4113 ** statement that does not return data (for example an [UPDATE]).
4114 **
4115 ** See also: [sqlite3_data_count()]
4116 */
4117 SQLITE_API int SQLITE_APICALL sqlite3_column_count(sqlite3_stmt *pStmt);
4118
4119 /*
4120 ** CAPI3REF: Column Names In A Result Set
4121 ** METHOD: sqlite3_stmt
4122 **
@@ -4124,12 +4141,12 @@
4141 ** ^The name of a result column is the value of the "AS" clause for
4142 ** that column, if there is an AS clause. If there is no AS clause
4143 ** then the name of the column is unspecified and may change from
4144 ** one release of SQLite to the next.
4145 */
4146 SQLITE_API const char *SQLITE_APICALL sqlite3_column_name(sqlite3_stmt*, int N);
4147 SQLITE_API const void *SQLITE_APICALL sqlite3_column_name16(sqlite3_stmt*, int N);
4148
4149 /*
4150 ** CAPI3REF: Source Of Data In A Query Result
4151 ** METHOD: sqlite3_stmt
4152 **
@@ -4173,16 +4190,16 @@
4190 ** If two or more threads call one or more
4191 ** [sqlite3_column_database_name | column metadata interfaces]
4192 ** for the same [prepared statement] and result column
4193 ** at the same time then the results are undefined.
4194 */
4195 SQLITE_API const char *SQLITE_APICALL sqlite3_column_database_name(sqlite3_stmt*,int);
4196 SQLITE_API const void *SQLITE_APICALL sqlite3_column_database_name16(sqlite3_stmt*,int);
4197 SQLITE_API const char *SQLITE_APICALL sqlite3_column_table_name(sqlite3_stmt*,int);
4198 SQLITE_API const void *SQLITE_APICALL sqlite3_column_table_name16(sqlite3_stmt*,int);
4199 SQLITE_API const char *SQLITE_APICALL sqlite3_column_origin_name(sqlite3_stmt*,int);
4200 SQLITE_API const void *SQLITE_APICALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
4201
4202 /*
4203 ** CAPI3REF: Declared Datatype Of A Query Result
4204 ** METHOD: sqlite3_stmt
4205 **
@@ -4210,12 +4227,12 @@
4227 ** data stored in that column is of the declared type. SQLite is
4228 ** strongly typed, but the typing is dynamic not static. ^Type
4229 ** is associated with individual values, not with the containers
4230 ** used to hold those values.
4231 */
4232 SQLITE_API const char *SQLITE_APICALL sqlite3_column_decltype(sqlite3_stmt*,int);
4233 SQLITE_API const void *SQLITE_APICALL sqlite3_column_decltype16(sqlite3_stmt*,int);
4234
4235 /*
4236 ** CAPI3REF: Evaluate An SQL Statement
4237 ** METHOD: sqlite3_stmt
4238 **
@@ -4291,11 +4308,11 @@
4308 ** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
4309 ** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,
4310 ** then the more specific [error codes] are returned directly
4311 ** by sqlite3_step(). The use of the "v2" interface is recommended.
4312 */
4313 SQLITE_API int SQLITE_APICALL sqlite3_step(sqlite3_stmt*);
4314
4315 /*
4316 ** CAPI3REF: Number of columns in a result set
4317 ** METHOD: sqlite3_stmt
4318 **
@@ -4312,11 +4329,11 @@
4329 ** where it always returns zero since each step of that multi-step
4330 ** pragma returns 0 columns of data.
4331 **
4332 ** See also: [sqlite3_column_count()]
4333 */
4334 SQLITE_API int SQLITE_APICALL sqlite3_data_count(sqlite3_stmt *pStmt);
4335
4336 /*
4337 ** CAPI3REF: Fundamental Datatypes
4338 ** KEYWORDS: SQLITE_TEXT
4339 **
@@ -4502,20 +4519,20 @@
4519 ** of these routines, a default value is returned. The default value
4520 ** is either the integer 0, the floating point number 0.0, or a NULL
4521 ** pointer. Subsequent calls to [sqlite3_errcode()] will return
4522 ** [SQLITE_NOMEM].)^
4523 */
4524 SQLITE_API const void *SQLITE_APICALL sqlite3_column_blob(sqlite3_stmt*, int iCol);
4525 SQLITE_API int SQLITE_APICALL sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4526 SQLITE_API int SQLITE_APICALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4527 SQLITE_API double SQLITE_APICALL sqlite3_column_double(sqlite3_stmt*, int iCol);
4528 SQLITE_API int SQLITE_APICALL sqlite3_column_int(sqlite3_stmt*, int iCol);
4529 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_column_int64(sqlite3_stmt*, int iCol);
4530 SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_column_text(sqlite3_stmt*, int iCol);
4531 SQLITE_API const void *SQLITE_APICALL sqlite3_column_text16(sqlite3_stmt*, int iCol);
4532 SQLITE_API int SQLITE_APICALL sqlite3_column_type(sqlite3_stmt*, int iCol);
4533 SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_column_value(sqlite3_stmt*, int iCol);
4534
4535 /*
4536 ** CAPI3REF: Destroy A Prepared Statement Object
4537 ** DESTRUCTOR: sqlite3_stmt
4538 **
@@ -4539,11 +4556,11 @@
4556 ** resource leaks. It is a grievous error for the application to try to use
4557 ** a prepared statement after it has been finalized. Any use of a prepared
4558 ** statement after it has been finalized can result in undefined and
4559 ** undesirable behavior such as segfaults and heap corruption.
4560 */
4561 SQLITE_API int SQLITE_APICALL sqlite3_finalize(sqlite3_stmt *pStmt);
4562
4563 /*
4564 ** CAPI3REF: Reset A Prepared Statement Object
4565 ** METHOD: sqlite3_stmt
4566 **
@@ -4566,11 +4583,11 @@
4583 ** [sqlite3_reset(S)] returns an appropriate [error code].
4584 **
4585 ** ^The [sqlite3_reset(S)] interface does not change the values
4586 ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
4587 */
4588 SQLITE_API int SQLITE_APICALL sqlite3_reset(sqlite3_stmt *pStmt);
4589
4590 /*
4591 ** CAPI3REF: Create Or Redefine SQL Functions
4592 ** KEYWORDS: {function creation routines}
4593 ** KEYWORDS: {application-defined SQL function}
@@ -4666,40 +4683,40 @@
4683 ** ^An application-defined function is permitted to call other
4684 ** SQLite interfaces. However, such calls must not
4685 ** close the database connection nor finalize or reset the prepared
4686 ** statement in which the function is running.
4687 */
4688 SQLITE_API int SQLITE_APICALL sqlite3_create_function(
4689 sqlite3 *db,
4690 const char *zFunctionName,
4691 int nArg,
4692 int eTextRep,
4693 void *pApp,
4694 void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**),
4695 void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**),
4696 void (SQLITE_CALLBACK *xFinal)(sqlite3_context*)
4697 );
4698 SQLITE_API int SQLITE_APICALL sqlite3_create_function16(
4699 sqlite3 *db,
4700 const void *zFunctionName,
4701 int nArg,
4702 int eTextRep,
4703 void *pApp,
4704 void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**),
4705 void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**),
4706 void (SQLITE_CALLBACK *xFinal)(sqlite3_context*)
4707 );
4708 SQLITE_API int SQLITE_APICALL sqlite3_create_function_v2(
4709 sqlite3 *db,
4710 const char *zFunctionName,
4711 int nArg,
4712 int eTextRep,
4713 void *pApp,
4714 void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**),
4715 void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**),
4716 void (SQLITE_CALLBACK *xFinal)(sqlite3_context*),
4717 void(SQLITE_CALLBACK *xDestroy)(void*)
4718 );
4719
4720 /*
4721 ** CAPI3REF: Text Encodings
4722 **
@@ -4732,16 +4749,16 @@
4749 ** to be supported. However, new applications should avoid
4750 ** the use of these functions. To encourage programmers to avoid
4751 ** these functions, we will not explain what they do.
4752 */
4753 #ifndef SQLITE_OMIT_DEPRECATED
4754 SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_aggregate_count(sqlite3_context*);
4755 SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_expired(sqlite3_stmt*);
4756 SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4757 SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_global_recover(void);
4758 SQLITE_API SQLITE_DEPRECATED void SQLITE_APICALL sqlite3_thread_cleanup(void);
4759 SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_memory_alarm(void(SQLITE_CALLBACK *)(void*,sqlite3_int64,int),
4760 void*,sqlite3_int64);
4761 #endif
4762
4763 /*
4764 ** CAPI3REF: Obtaining SQL Values
@@ -4787,22 +4804,22 @@
4804 ** or [sqlite3_value_text16()].
4805 **
4806 ** These routines must be called from the same thread as
4807 ** the SQL function that supplied the [sqlite3_value*] parameters.
4808 */
4809 SQLITE_API const void *SQLITE_APICALL sqlite3_value_blob(sqlite3_value*);
4810 SQLITE_API int SQLITE_APICALL sqlite3_value_bytes(sqlite3_value*);
4811 SQLITE_API int SQLITE_APICALL sqlite3_value_bytes16(sqlite3_value*);
4812 SQLITE_API double SQLITE_APICALL sqlite3_value_double(sqlite3_value*);
4813 SQLITE_API int SQLITE_APICALL sqlite3_value_int(sqlite3_value*);
4814 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_value_int64(sqlite3_value*);
4815 SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_value_text(sqlite3_value*);
4816 SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16(sqlite3_value*);
4817 SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16le(sqlite3_value*);
4818 SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16be(sqlite3_value*);
4819 SQLITE_API int SQLITE_APICALL sqlite3_value_type(sqlite3_value*);
4820 SQLITE_API int SQLITE_APICALL sqlite3_value_numeric_type(sqlite3_value*);
4821
4822 /*
4823 ** CAPI3REF: Finding The Subtype Of SQL Values
4824 ** METHOD: sqlite3_value
4825 **
@@ -4814,11 +4831,11 @@
4831 **
4832 ** SQLite makes no use of subtype itself. It merely passes the subtype
4833 ** from the result of one [application-defined SQL function] into the
4834 ** input of another.
4835 */
4836 SQLITE_API unsigned int SQLITE_APICALL sqlite3_value_subtype(sqlite3_value*);
4837
4838 /*
4839 ** CAPI3REF: Copy And Free SQL Values
4840 ** METHOD: sqlite3_value
4841 **
@@ -4830,12 +4847,12 @@
4847 **
4848 ** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object
4849 ** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer
4850 ** then sqlite3_value_free(V) is a harmless no-op.
4851 */
4852 SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_value_dup(const sqlite3_value*);
4853 SQLITE_API void SQLITE_APICALL sqlite3_value_free(sqlite3_value*);
4854
4855 /*
4856 ** CAPI3REF: Obtain Aggregate Function Context
4857 ** METHOD: sqlite3_context
4858 **
@@ -4876,11 +4893,11 @@
4893 ** function.
4894 **
4895 ** This routine must be called from the same thread in which
4896 ** the aggregate SQL function is running.
4897 */
4898 SQLITE_API void *SQLITE_APICALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
4899
4900 /*
4901 ** CAPI3REF: User Data For Functions
4902 ** METHOD: sqlite3_context
4903 **
@@ -4891,11 +4908,11 @@
4908 ** registered the application defined function.
4909 **
4910 ** This routine must be called from the same thread in which
4911 ** the application-defined function is running.
4912 */
4913 SQLITE_API void *SQLITE_APICALL sqlite3_user_data(sqlite3_context*);
4914
4915 /*
4916 ** CAPI3REF: Database Connection For Functions
4917 ** METHOD: sqlite3_context
4918 **
@@ -4903,11 +4920,11 @@
4920 ** the pointer to the [database connection] (the 1st parameter)
4921 ** of the [sqlite3_create_function()]
4922 ** and [sqlite3_create_function16()] routines that originally
4923 ** registered the application defined function.
4924 */
4925 SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_context_db_handle(sqlite3_context*);
4926
4927 /*
4928 ** CAPI3REF: Function Auxiliary Data
4929 ** METHOD: sqlite3_context
4930 **
@@ -4956,12 +4973,12 @@
4973 ** values and [parameters] and expressions composed from the same.)^
4974 **
4975 ** These routines must be called from the same thread in which
4976 ** the SQL function is running.
4977 */
4978 SQLITE_API void *SQLITE_APICALL sqlite3_get_auxdata(sqlite3_context*, int N);
4979 SQLITE_API void SQLITE_APICALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (SQLITE_CALLBACK *)(void*));
4980
4981
4982 /*
4983 ** CAPI3REF: Constants Defining Special Destructor Behavior
4984 **
@@ -4974,11 +4991,11 @@
4991 ** the content before returning.
4992 **
4993 ** The typedef is necessary to work around problems in certain
4994 ** C++ compilers.
4995 */
4996 typedef void (SQLITE_CALLBACK *sqlite3_destructor_type)(void*);
4997 #define SQLITE_STATIC ((sqlite3_destructor_type)0)
4998 #define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1)
4999
5000 /*
5001 ** CAPI3REF: Setting The Result Of An SQL Function
@@ -5093,31 +5110,31 @@
5110 **
5111 ** If these routines are called from within the different thread
5112 ** than the one containing the application-defined function that received
5113 ** the [sqlite3_context] pointer, the results are undefined.
5114 */
5115 SQLITE_API void SQLITE_APICALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(SQLITE_CALLBACK *)(void*));
5116 SQLITE_API void SQLITE_APICALL sqlite3_result_blob64(sqlite3_context*,const void*,
5117 sqlite3_uint64,void(SQLITE_CALLBACK *)(void*));
5118 SQLITE_API void SQLITE_APICALL sqlite3_result_double(sqlite3_context*, double);
5119 SQLITE_API void SQLITE_APICALL sqlite3_result_error(sqlite3_context*, const char*, int);
5120 SQLITE_API void SQLITE_APICALL sqlite3_result_error16(sqlite3_context*, const void*, int);
5121 SQLITE_API void SQLITE_APICALL sqlite3_result_error_toobig(sqlite3_context*);
5122 SQLITE_API void SQLITE_APICALL sqlite3_result_error_nomem(sqlite3_context*);
5123 SQLITE_API void SQLITE_APICALL sqlite3_result_error_code(sqlite3_context*, int);
5124 SQLITE_API void SQLITE_APICALL sqlite3_result_int(sqlite3_context*, int);
5125 SQLITE_API void SQLITE_APICALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
5126 SQLITE_API void SQLITE_APICALL sqlite3_result_null(sqlite3_context*);
5127 SQLITE_API void SQLITE_APICALL sqlite3_result_text(sqlite3_context*, const char*, int, void(SQLITE_CALLBACK *)(void*));
5128 SQLITE_API void SQLITE_APICALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
5129 void(SQLITE_CALLBACK *)(void*), unsigned char encoding);
5130 SQLITE_API void SQLITE_APICALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(SQLITE_CALLBACK *)(void*));
5131 SQLITE_API void SQLITE_APICALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(SQLITE_CALLBACK *)(void*));
5132 SQLITE_API void SQLITE_APICALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(SQLITE_CALLBACK *)(void*));
5133 SQLITE_API void SQLITE_APICALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
5134 SQLITE_API void SQLITE_APICALL sqlite3_result_zeroblob(sqlite3_context*, int n);
5135 SQLITE_API int SQLITE_APICALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
5136
5137
5138 /*
5139 ** CAPI3REF: Setting The Subtype Of An SQL Function
5140 ** METHOD: sqlite3_context
@@ -5128,11 +5145,11 @@
5145 ** of the subtype T are preserved in current versions of SQLite;
5146 ** higher order bits are discarded.
5147 ** The number of subtype bytes preserved by SQLite might increase
5148 ** in future releases of SQLite.
5149 */
5150 SQLITE_API void SQLITE_APICALL sqlite3_result_subtype(sqlite3_context*,unsigned int);
5151
5152 /*
5153 ** CAPI3REF: Define New Collating Sequences
5154 ** METHOD: sqlite3
5155 **
@@ -5210,31 +5227,31 @@
5227 ** is unfortunate but cannot be changed without breaking backwards
5228 ** compatibility.
5229 **
5230 ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].
5231 */
5232 SQLITE_API int SQLITE_APICALL sqlite3_create_collation(
5233 sqlite3*,
5234 const char *zName,
5235 int eTextRep,
5236 void *pArg,
5237 int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*)
5238 );
5239 SQLITE_API int SQLITE_APICALL sqlite3_create_collation_v2(
5240 sqlite3*,
5241 const char *zName,
5242 int eTextRep,
5243 void *pArg,
5244 int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*),
5245 void(SQLITE_CALLBACK *xDestroy)(void*)
5246 );
5247 SQLITE_API int SQLITE_APICALL sqlite3_create_collation16(
5248 sqlite3*,
5249 const void *zName,
5250 int eTextRep,
5251 void *pArg,
5252 int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*)
5253 );
5254
5255 /*
5256 ** CAPI3REF: Collation Needed Callbacks
5257 ** METHOD: sqlite3
@@ -5260,19 +5277,19 @@
5277 **
5278 ** The callback function should register the desired collation using
5279 ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or
5280 ** [sqlite3_create_collation_v2()].
5281 */
5282 SQLITE_API int SQLITE_APICALL sqlite3_collation_needed(
5283 sqlite3*,
5284 void*,
5285 void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const char*)
5286 );
5287 SQLITE_API int SQLITE_APICALL sqlite3_collation_needed16(
5288 sqlite3*,
5289 void*,
5290 void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const void*)
5291 );
5292
5293 #ifdef SQLITE_HAS_CODEC
5294 /*
5295 ** Specify the key for an encrypted database. This routine should be
@@ -5279,15 +5296,15 @@
5296 ** called right after sqlite3_open().
5297 **
5298 ** The code to implement this API is not available in the public release
5299 ** of SQLite.
5300 */
5301 SQLITE_API int SQLITE_APICALL sqlite3_key(
5302 sqlite3 *db, /* Database to be rekeyed */
5303 const void *pKey, int nKey /* The key */
5304 );
5305 SQLITE_API int SQLITE_APICALL sqlite3_key_v2(
5306 sqlite3 *db, /* Database to be rekeyed */
5307 const char *zDbName, /* Name of the database */
5308 const void *pKey, int nKey /* The key */
5309 );
5310
@@ -5297,35 +5314,35 @@
5314 ** database is decrypted.
5315 **
5316 ** The code to implement this API is not available in the public release
5317 ** of SQLite.
5318 */
5319 SQLITE_API int SQLITE_APICALL sqlite3_rekey(
5320 sqlite3 *db, /* Database to be rekeyed */
5321 const void *pKey, int nKey /* The new key */
5322 );
5323 SQLITE_API int SQLITE_APICALL sqlite3_rekey_v2(
5324 sqlite3 *db, /* Database to be rekeyed */
5325 const char *zDbName, /* Name of the database */
5326 const void *pKey, int nKey /* The new key */
5327 );
5328
5329 /*
5330 ** Specify the activation key for a SEE database. Unless
5331 ** activated, none of the SEE routines will work.
5332 */
5333 SQLITE_API void SQLITE_APICALL sqlite3_activate_see(
5334 const char *zPassPhrase /* Activation phrase */
5335 );
5336 #endif
5337
5338 #ifdef SQLITE_ENABLE_CEROD
5339 /*
5340 ** Specify the activation key for a CEROD database. Unless
5341 ** activated, none of the CEROD routines will work.
5342 */
5343 SQLITE_API void SQLITE_APICALL sqlite3_activate_cerod(
5344 const char *zPassPhrase /* Activation phrase */
5345 );
5346 #endif
5347
5348 /*
@@ -5343,11 +5360,11 @@
5360 ** method of the default [sqlite3_vfs] object. If the xSleep() method
5361 ** of the default VFS is not implemented correctly, or not implemented at
5362 ** all, then the behavior of sqlite3_sleep() may deviate from the description
5363 ** in the previous paragraphs.
5364 */
5365 SQLITE_API int SQLITE_APICALL sqlite3_sleep(int);
5366
5367 /*
5368 ** CAPI3REF: Name Of The Folder Holding Temporary Files
5369 **
5370 ** ^(If this global variable is made to point to a string which is
@@ -5462,11 +5479,11 @@
5479 **
5480 ** If another thread changes the autocommit status of the database
5481 ** connection while this routine is running, then the return value
5482 ** is undefined.
5483 */
5484 SQLITE_API int SQLITE_APICALL sqlite3_get_autocommit(sqlite3*);
5485
5486 /*
5487 ** CAPI3REF: Find The Database Handle Of A Prepared Statement
5488 ** METHOD: sqlite3_stmt
5489 **
@@ -5475,11 +5492,11 @@
5492 ** returned by sqlite3_db_handle is the same [database connection]
5493 ** that was the first argument
5494 ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
5495 ** create the statement in the first place.
5496 */
5497 SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_db_handle(sqlite3_stmt*);
5498
5499 /*
5500 ** CAPI3REF: Return The Filename For A Database Connection
5501 ** METHOD: sqlite3
5502 **
@@ -5492,21 +5509,21 @@
5509 ** ^The filename returned by this function is the output of the
5510 ** xFullPathname method of the [VFS]. ^In other words, the filename
5511 ** will be an absolute pathname, even if the filename used
5512 ** to open the database originally was a URI or relative pathname.
5513 */
5514 SQLITE_API const char *SQLITE_APICALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
5515
5516 /*
5517 ** CAPI3REF: Determine if a database is read-only
5518 ** METHOD: sqlite3
5519 **
5520 ** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N
5521 ** of connection D is read-only, 0 if it is read/write, or -1 if N is not
5522 ** the name of a database on connection D.
5523 */
5524 SQLITE_API int SQLITE_APICALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
5525
5526 /*
5527 ** CAPI3REF: Find the next prepared statement
5528 ** METHOD: sqlite3
5529 **
@@ -5518,11 +5535,11 @@
5535 **
5536 ** The [database connection] pointer D in a call to
5537 ** [sqlite3_next_stmt(D,S)] must refer to an open database
5538 ** connection and in particular must not be a NULL pointer.
5539 */
5540 SQLITE_API sqlite3_stmt *SQLITE_APICALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
5541
5542 /*
5543 ** CAPI3REF: Commit And Rollback Notification Callbacks
5544 ** METHOD: sqlite3
5545 **
@@ -5567,12 +5584,12 @@
5584 ** ^The rollback callback is not invoked if a transaction is
5585 ** automatically rolled back because the database connection is closed.
5586 **
5587 ** See also the [sqlite3_update_hook()] interface.
5588 */
5589 SQLITE_API void *SQLITE_APICALL sqlite3_commit_hook(sqlite3*, int(SQLITE_CALLBACK *)(void*), void*);
5590 SQLITE_API void *SQLITE_APICALL sqlite3_rollback_hook(sqlite3*, void(SQLITE_CALLBACK *)(void *), void*);
5591
5592 /*
5593 ** CAPI3REF: Data Change Notification Callbacks
5594 ** METHOD: sqlite3
5595 **
@@ -5619,13 +5636,13 @@
5636 ** the first call on D.
5637 **
5638 ** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()],
5639 ** and [sqlite3_preupdate_hook()] interfaces.
5640 */
5641 SQLITE_API void *SQLITE_APICALL sqlite3_update_hook(
5642 sqlite3*,
5643 void(SQLITE_CALLBACK *)(void *,int ,char const *,char const *,sqlite3_int64),
5644 void*
5645 );
5646
5647 /*
5648 ** CAPI3REF: Enable Or Disable Shared Pager Cache
@@ -5659,11 +5676,11 @@
5676 ** This interface is threadsafe on processors where writing a
5677 ** 32-bit integer is atomic.
5678 **
5679 ** See Also: [SQLite Shared-Cache Mode]
5680 */
5681 SQLITE_API int SQLITE_APICALL sqlite3_enable_shared_cache(int);
5682
5683 /*
5684 ** CAPI3REF: Attempt To Free Heap Memory
5685 **
5686 ** ^The sqlite3_release_memory() interface attempts to free N bytes
@@ -5675,11 +5692,11 @@
5692 ** ^The sqlite3_release_memory() routine is a no-op returning zero
5693 ** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5694 **
5695 ** See also: [sqlite3_db_release_memory()]
5696 */
5697 SQLITE_API int SQLITE_APICALL sqlite3_release_memory(int);
5698
5699 /*
5700 ** CAPI3REF: Free Memory Used By A Database Connection
5701 ** METHOD: sqlite3
5702 **
@@ -5689,11 +5706,11 @@
5706 ** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
5707 ** omitted.
5708 **
5709 ** See also: [sqlite3_release_memory()]
5710 */
5711 SQLITE_API int SQLITE_APICALL sqlite3_db_release_memory(sqlite3*);
5712
5713 /*
5714 ** CAPI3REF: Impose A Limit On Heap Size
5715 **
5716 ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the
@@ -5741,11 +5758,11 @@
5758 ** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5759 **
5760 ** The circumstances under which SQLite will enforce the soft heap limit may
5761 ** changes in future releases of SQLite.
5762 */
5763 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
5764
5765 /*
5766 ** CAPI3REF: Deprecated Soft Heap Limit Interface
5767 ** DEPRECATED
5768 **
@@ -5752,11 +5769,11 @@
5769 ** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
5770 ** interface. This routine is provided for historical compatibility
5771 ** only. All new applications should use the
5772 ** [sqlite3_soft_heap_limit64()] interface rather than this one.
5773 */
5774 SQLITE_API SQLITE_DEPRECATED void SQLITE_APICALL sqlite3_soft_heap_limit(int N);
5775
5776
5777 /*
5778 ** CAPI3REF: Extract Metadata About A Column Of A Table
5779 ** METHOD: sqlite3
@@ -5822,11 +5839,11 @@
5839 **
5840 ** ^This function causes all database schemas to be read from disk and
5841 ** parsed, if that has not already been done, and returns an error if
5842 ** any errors are encountered while loading the schema.
5843 */
5844 SQLITE_API int SQLITE_APICALL sqlite3_table_column_metadata(
5845 sqlite3 *db, /* Connection handle */
5846 const char *zDbName, /* Database name or NULL */
5847 const char *zTableName, /* Table name */
5848 const char *zColumnName, /* Column name */
5849 char const **pzDataType, /* OUTPUT: Declared data type */
@@ -5878,11 +5895,11 @@
5895 ** disabled and prevent SQL injections from giving attackers
5896 ** access to extension loading capabilities.
5897 **
5898 ** See also the [load_extension() SQL function].
5899 */
5900 SQLITE_API int SQLITE_APICALL sqlite3_load_extension(
5901 sqlite3 *db, /* Load the extension into this database connection */
5902 const char *zFile, /* Name of the shared library containing extension */
5903 const char *zProc, /* Entry point. Derived from zFile if 0 */
5904 char **pzErrMsg /* Put error message here if not 0 */
5905 );
@@ -5910,11 +5927,11 @@
5927 ** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method
5928 ** rather than this interface, so the [load_extension()] SQL function
5929 ** remains disabled. This will prevent SQL injections from giving attackers
5930 ** access to extension loading capabilities.
5931 */
5932 SQLITE_API int SQLITE_APICALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
5933
5934 /*
5935 ** CAPI3REF: Automatically Load Statically Linked Extensions
5936 **
5937 ** ^This interface causes the xEntryPoint() function to be invoked for
@@ -5948,11 +5965,14 @@
5965 ** will be called more than once for each database connection that is opened.
5966 **
5967 ** See also: [sqlite3_reset_auto_extension()]
5968 ** and [sqlite3_cancel_auto_extension()]
5969 */
5970 typedef struct sqlite3_api_routines sqlite3_api_routines;
5971 SQLITE_API int SQLITE_APICALL sqlite3_auto_extension(
5972 int (SQLITE_CALLBACK *xEntryPoint)(sqlite3 *, char **, const sqlite3_api_routines *)
5973 );
5974
5975 /*
5976 ** CAPI3REF: Cancel Automatic Extension Loading
5977 **
5978 ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
@@ -5960,19 +5980,21 @@
5980 ** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)]
5981 ** routine returns 1 if initialization routine X was successfully
5982 ** unregistered and it returns 0 if X was not on the list of initialization
5983 ** routines.
5984 */
5985 SQLITE_API int SQLITE_APICALL sqlite3_cancel_auto_extension(
5986 int (SQLITE_CALLBACK *xEntryPoint)(sqlite3 *, char **, const sqlite3_api_routines *)
5987 );
5988
5989 /*
5990 ** CAPI3REF: Reset Automatic Extension Loading
5991 **
5992 ** ^This interface disables all automatic extensions previously
5993 ** registered using [sqlite3_auto_extension()].
5994 */
5995 SQLITE_API void SQLITE_APICALL sqlite3_reset_auto_extension(void);
5996
5997 /*
5998 ** The interface to the virtual-table mechanism is currently considered
5999 ** to be experimental. The interface might change in incompatible ways.
6000 ** If this is a problem for you, do not use the interface at this time.
@@ -6005,41 +6027,41 @@
6027 ** of this structure must not change while it is registered with
6028 ** any database connection.
6029 */
6030 struct sqlite3_module {
6031 int iVersion;
6032 int (SQLITE_CALLBACK *xCreate)(sqlite3*, void *pAux,
6033 int argc, const char *const*argv,
6034 sqlite3_vtab **ppVTab, char**);
6035 int (SQLITE_CALLBACK *xConnect)(sqlite3*, void *pAux,
6036 int argc, const char *const*argv,
6037 sqlite3_vtab **ppVTab, char**);
6038 int (SQLITE_CALLBACK *xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
6039 int (SQLITE_CALLBACK *xDisconnect)(sqlite3_vtab *pVTab);
6040 int (SQLITE_CALLBACK *xDestroy)(sqlite3_vtab *pVTab);
6041 int (SQLITE_CALLBACK *xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);
6042 int (SQLITE_CALLBACK *xClose)(sqlite3_vtab_cursor*);
6043 int (SQLITE_CALLBACK *xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
6044 int argc, sqlite3_value **argv);
6045 int (SQLITE_CALLBACK *xNext)(sqlite3_vtab_cursor*);
6046 int (SQLITE_CALLBACK *xEof)(sqlite3_vtab_cursor*);
6047 int (SQLITE_CALLBACK *xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int);
6048 int (SQLITE_CALLBACK *xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid);
6049 int (SQLITE_CALLBACK *xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *);
6050 int (SQLITE_CALLBACK *xBegin)(sqlite3_vtab *pVTab);
6051 int (SQLITE_CALLBACK *xSync)(sqlite3_vtab *pVTab);
6052 int (SQLITE_CALLBACK *xCommit)(sqlite3_vtab *pVTab);
6053 int (SQLITE_CALLBACK *xRollback)(sqlite3_vtab *pVTab);
6054 int (SQLITE_CALLBACK *xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,
6055 void (SQLITE_CALLBACK **pxFunc)(sqlite3_context*,int,sqlite3_value**),
6056 void **ppArg);
6057 int (SQLITE_CALLBACK *xRename)(sqlite3_vtab *pVtab, const char *zNew);
6058 /* The methods above are in version 1 of the sqlite_module object. Those
6059 ** below are for version 2 and greater. */
6060 int (SQLITE_CALLBACK *xSavepoint)(sqlite3_vtab *pVTab, int);
6061 int (SQLITE_CALLBACK *xRelease)(sqlite3_vtab *pVTab, int);
6062 int (SQLITE_CALLBACK *xRollbackTo)(sqlite3_vtab *pVTab, int);
6063 };
6064
6065 /*
6066 ** CAPI3REF: Virtual Table Indexing Information
6067 ** KEYWORDS: sqlite3_index_info
@@ -6213,22 +6235,22 @@
6235 ** be invoked if the call to sqlite3_create_module_v2() fails.
6236 ** ^The sqlite3_create_module()
6237 ** interface is equivalent to sqlite3_create_module_v2() with a NULL
6238 ** destructor.
6239 */
6240 SQLITE_API int SQLITE_APICALL sqlite3_create_module(
6241 sqlite3 *db, /* SQLite connection to register module with */
6242 const char *zName, /* Name of the module */
6243 const sqlite3_module *p, /* Methods for the module */
6244 void *pClientData /* Client data for xCreate/xConnect */
6245 );
6246 SQLITE_API int SQLITE_APICALL sqlite3_create_module_v2(
6247 sqlite3 *db, /* SQLite connection to register module with */
6248 const char *zName, /* Name of the module */
6249 const sqlite3_module *p, /* Methods for the module */
6250 void *pClientData, /* Client data for xCreate/xConnect */
6251 void(SQLITE_CALLBACK *xDestroy)(void*) /* Module destructor function */
6252 );
6253
6254 /*
6255 ** CAPI3REF: Virtual Table Instance Object
6256 ** KEYWORDS: sqlite3_vtab
@@ -6282,11 +6304,11 @@
6304 ** ^The [xCreate] and [xConnect] methods of a
6305 ** [virtual table module] call this interface
6306 ** to declare the format (the names and datatypes of the columns) of
6307 ** the virtual tables they implement.
6308 */
6309 SQLITE_API int SQLITE_APICALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
6310
6311 /*
6312 ** CAPI3REF: Overload A Function For A Virtual Table
6313 ** METHOD: sqlite3
6314 **
@@ -6301,11 +6323,11 @@
6323 ** of the new function always causes an exception to be thrown. So
6324 ** the new function is not good for anything by itself. Its only
6325 ** purpose is to be a placeholder function that can be overloaded
6326 ** by a [virtual table].
6327 */
6328 SQLITE_API int SQLITE_APICALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
6329
6330 /*
6331 ** The interface to the virtual-table mechanism defined above (back up
6332 ** to a comment remarkably similar to this one) is currently considered
6333 ** to be experimental. The interface might change in incompatible ways.
@@ -6400,11 +6422,11 @@
6422 ** zero-filled blob to read or write using the incremental-blob interface.
6423 **
6424 ** To avoid a resource leak, every open [BLOB handle] should eventually
6425 ** be released by a call to [sqlite3_blob_close()].
6426 */
6427 SQLITE_API int SQLITE_APICALL sqlite3_blob_open(
6428 sqlite3*,
6429 const char *zDb,
6430 const char *zTable,
6431 const char *zColumn,
6432 sqlite3_int64 iRow,
@@ -6433,11 +6455,11 @@
6455 ** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
6456 ** always returns zero.
6457 **
6458 ** ^This function sets the database handle error code and message.
6459 */
6460 SQLITE_API int SQLITE_APICALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
6461
6462 /*
6463 ** CAPI3REF: Close A BLOB Handle
6464 ** DESTRUCTOR: sqlite3_blob
6465 **
@@ -6456,11 +6478,11 @@
6478 ** with a null pointer (such as would be returned by a failed call to
6479 ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function
6480 ** is passed a valid open blob handle, the values returned by the
6481 ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning.
6482 */
6483 SQLITE_API int SQLITE_APICALL sqlite3_blob_close(sqlite3_blob *);
6484
6485 /*
6486 ** CAPI3REF: Return The Size Of An Open BLOB
6487 ** METHOD: sqlite3_blob
6488 **
@@ -6472,11 +6494,11 @@
6494 ** This routine only works on a [BLOB handle] which has been created
6495 ** by a prior successful call to [sqlite3_blob_open()] and which has not
6496 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6497 ** to this routine results in undefined and probably undesirable behavior.
6498 */
6499 SQLITE_API int SQLITE_APICALL sqlite3_blob_bytes(sqlite3_blob *);
6500
6501 /*
6502 ** CAPI3REF: Read Data From A BLOB Incrementally
6503 ** METHOD: sqlite3_blob
6504 **
@@ -6501,11 +6523,11 @@
6523 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6524 ** to this routine results in undefined and probably undesirable behavior.
6525 **
6526 ** See also: [sqlite3_blob_write()].
6527 */
6528 SQLITE_API int SQLITE_APICALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
6529
6530 /*
6531 ** CAPI3REF: Write Data Into A BLOB Incrementally
6532 ** METHOD: sqlite3_blob
6533 **
@@ -6543,11 +6565,11 @@
6565 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6566 ** to this routine results in undefined and probably undesirable behavior.
6567 **
6568 ** See also: [sqlite3_blob_read()].
6569 */
6570 SQLITE_API int SQLITE_APICALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
6571
6572 /*
6573 ** CAPI3REF: Virtual File System Objects
6574 **
6575 ** A virtual filesystem (VFS) is an [sqlite3_vfs] object
@@ -6574,13 +6596,13 @@
6596 **
6597 ** ^Unregister a VFS with the sqlite3_vfs_unregister() interface.
6598 ** ^(If the default VFS is unregistered, another VFS is chosen as
6599 ** the default. The choice for the new VFS is arbitrary.)^
6600 */
6601 SQLITE_API sqlite3_vfs *SQLITE_APICALL sqlite3_vfs_find(const char *zVfsName);
6602 SQLITE_API int SQLITE_APICALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
6603 SQLITE_API int SQLITE_APICALL sqlite3_vfs_unregister(sqlite3_vfs*);
6604
6605 /*
6606 ** CAPI3REF: Mutexes
6607 **
6608 ** The SQLite core uses these routines for thread
@@ -6692,15 +6714,15 @@
6714 ** sqlite3_mutex_leave() is a NULL pointer, then all three routines
6715 ** behave as no-ops.
6716 **
6717 ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
6718 */
6719 SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_mutex_alloc(int);
6720 SQLITE_API void SQLITE_APICALL sqlite3_mutex_free(sqlite3_mutex*);
6721 SQLITE_API void SQLITE_APICALL sqlite3_mutex_enter(sqlite3_mutex*);
6722 SQLITE_API int SQLITE_APICALL sqlite3_mutex_try(sqlite3_mutex*);
6723 SQLITE_API void SQLITE_APICALL sqlite3_mutex_leave(sqlite3_mutex*);
6724
6725 /*
6726 ** CAPI3REF: Mutex Methods Object
6727 **
6728 ** An instance of this structure defines the low-level routines
@@ -6765,19 +6787,19 @@
6787 ** If xMutexInit fails in any way, it is expected to clean up after itself
6788 ** prior to returning.
6789 */
6790 typedef struct sqlite3_mutex_methods sqlite3_mutex_methods;
6791 struct sqlite3_mutex_methods {
6792 int (SQLITE_CALLBACK *xMutexInit)(void);
6793 int (SQLITE_CALLBACK *xMutexEnd)(void);
6794 sqlite3_mutex *(SQLITE_CALLBACK *xMutexAlloc)(int);
6795 void (SQLITE_CALLBACK *xMutexFree)(sqlite3_mutex *);
6796 void (SQLITE_CALLBACK *xMutexEnter)(sqlite3_mutex *);
6797 int (SQLITE_CALLBACK *xMutexTry)(sqlite3_mutex *);
6798 void (SQLITE_CALLBACK *xMutexLeave)(sqlite3_mutex *);
6799 int (SQLITE_CALLBACK *xMutexHeld)(sqlite3_mutex *);
6800 int (SQLITE_CALLBACK *xMutexNotheld)(sqlite3_mutex *);
6801 };
6802
6803 /*
6804 ** CAPI3REF: Mutex Verification Routines
6805 **
@@ -6806,12 +6828,12 @@
6828 ** call to sqlite3_mutex_held() to fail, so a non-zero return is
6829 ** the appropriate thing to do. The sqlite3_mutex_notheld()
6830 ** interface should also return 1 when given a NULL pointer.
6831 */
6832 #ifndef NDEBUG
6833 SQLITE_API int SQLITE_APICALL sqlite3_mutex_held(sqlite3_mutex*);
6834 SQLITE_API int SQLITE_APICALL sqlite3_mutex_notheld(sqlite3_mutex*);
6835 #endif
6836
6837 /*
6838 ** CAPI3REF: Mutex Types
6839 **
@@ -6847,11 +6869,11 @@
6869 ** serializes access to the [database connection] given in the argument
6870 ** when the [threading mode] is Serialized.
6871 ** ^If the [threading mode] is Single-thread or Multi-thread then this
6872 ** routine returns a NULL pointer.
6873 */
6874 SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_db_mutex(sqlite3*);
6875
6876 /*
6877 ** CAPI3REF: Low-Level Control Of Database Files
6878 ** METHOD: sqlite3
6879 **
@@ -6882,11 +6904,11 @@
6904 ** an incorrect zDbName and an SQLITE_ERROR return from the underlying
6905 ** xFileControl method.
6906 **
6907 ** See also: [SQLITE_FCNTL_LOCKSTATE]
6908 */
6909 SQLITE_API int SQLITE_APICALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
6910
6911 /*
6912 ** CAPI3REF: Testing Interface
6913 **
6914 ** ^The sqlite3_test_control() interface is used to read out internal
@@ -6964,12 +6986,12 @@
6986 ** be represented by a 32-bit integer, then the values returned by
6987 ** sqlite3_status() are undefined.
6988 **
6989 ** See also: [sqlite3_db_status()]
6990 */
6991 SQLITE_API int SQLITE_APICALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6992 SQLITE_API int SQLITE_APICALL sqlite3_status64(
6993 int op,
6994 sqlite3_int64 *pCurrent,
6995 sqlite3_int64 *pHighwater,
6996 int resetFlag
6997 );
@@ -7090,11 +7112,11 @@
7112 ** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a
7113 ** non-zero [error code] on failure.
7114 **
7115 ** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
7116 */
7117 SQLITE_API int SQLITE_APICALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
7118
7119 /*
7120 ** CAPI3REF: Status Parameters for database connections
7121 ** KEYWORDS: {SQLITE_DBSTATUS options}
7122 **
@@ -7233,11 +7255,11 @@
7255 ** ^If the resetFlg is true, then the counter is reset to zero after this
7256 ** interface call returns.
7257 **
7258 ** See also: [sqlite3_status()] and [sqlite3_db_status()].
7259 */
7260 SQLITE_API int SQLITE_APICALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
7261
7262 /*
7263 ** CAPI3REF: Status Parameters for prepared statements
7264 ** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters}
7265 **
@@ -7469,22 +7491,22 @@
7491 */
7492 typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2;
7493 struct sqlite3_pcache_methods2 {
7494 int iVersion;
7495 void *pArg;
7496 int (SQLITE_CALLBACK *xInit)(void*);
7497 void (SQLITE_CALLBACK *xShutdown)(void*);
7498 sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int szExtra, int bPurgeable);
7499 void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize);
7500 int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*);
7501 sqlite3_pcache_page *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7502 void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard);
7503 void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, sqlite3_pcache_page*,
7504 unsigned oldKey, unsigned newKey);
7505 void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit);
7506 void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*);
7507 void (SQLITE_CALLBACK *xShrink)(sqlite3_pcache*);
7508 };
7509
7510 /*
7511 ** This is the obsolete pcache_methods object that has now been replaced
7512 ** by sqlite3_pcache_methods2. This object is not used by SQLite. It is
@@ -7491,20 +7513,20 @@
7513 ** retained in the header file for backwards compatibility only.
7514 */
7515 typedef struct sqlite3_pcache_methods sqlite3_pcache_methods;
7516 struct sqlite3_pcache_methods {
7517 void *pArg;
7518 int (SQLITE_CALLBACK *xInit)(void*);
7519 void (SQLITE_CALLBACK *xShutdown)(void*);
7520 sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int bPurgeable);
7521 void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize);
7522 int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*);
7523 void *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7524 void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, void*, int discard);
7525 void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey);
7526 void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit);
7527 void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*);
7528 };
7529
7530
7531 /*
7532 ** CAPI3REF: Online Backup Object
@@ -7702,20 +7724,20 @@
7724 ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()
7725 ** APIs are not strictly speaking threadsafe. If they are invoked at the
7726 ** same time as another thread is invoking sqlite3_backup_step() it is
7727 ** possible that they return invalid values.
7728 */
7729 SQLITE_API sqlite3_backup *SQLITE_APICALL sqlite3_backup_init(
7730 sqlite3 *pDest, /* Destination database handle */
7731 const char *zDestName, /* Destination database name */
7732 sqlite3 *pSource, /* Source database handle */
7733 const char *zSourceName /* Source database name */
7734 );
7735 SQLITE_API int SQLITE_APICALL sqlite3_backup_step(sqlite3_backup *p, int nPage);
7736 SQLITE_API int SQLITE_APICALL sqlite3_backup_finish(sqlite3_backup *p);
7737 SQLITE_API int SQLITE_APICALL sqlite3_backup_remaining(sqlite3_backup *p);
7738 SQLITE_API int SQLITE_APICALL sqlite3_backup_pagecount(sqlite3_backup *p);
7739
7740 /*
7741 ** CAPI3REF: Unlock Notification
7742 ** METHOD: sqlite3
7743 **
@@ -7828,13 +7850,13 @@
7850 ** by an sqlite3_step() call. ^(If there is a blocking connection, then the
7851 ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in
7852 ** the special "DROP TABLE/INDEX" case, the extended error code is just
7853 ** SQLITE_LOCKED.)^
7854 */
7855 SQLITE_API int SQLITE_APICALL sqlite3_unlock_notify(
7856 sqlite3 *pBlocked, /* Waiting connection */
7857 void (SQLITE_CALLBACK *xNotify)(void **apArg, int nArg), /* Callback function to invoke */
7858 void *pNotifyArg /* Argument to pass to xNotify */
7859 );
7860
7861
7862 /*
@@ -7843,12 +7865,12 @@
7865 ** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications
7866 ** and extensions to compare the contents of two buffers containing UTF-8
7867 ** strings in a case-independent fashion, using the same definition of "case
7868 ** independence" that SQLite uses internally when comparing identifiers.
7869 */
7870 SQLITE_API int SQLITE_APICALL sqlite3_stricmp(const char *, const char *);
7871 SQLITE_API int SQLITE_APICALL sqlite3_strnicmp(const char *, const char *, int);
7872
7873 /*
7874 ** CAPI3REF: String Globbing
7875 *
7876 ** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if
@@ -7861,11 +7883,11 @@
7883 ** Note that this routine returns zero on a match and non-zero if the strings
7884 ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
7885 **
7886 ** See also: [sqlite3_strlike()].
7887 */
7888 SQLITE_API int SQLITE_APICALL sqlite3_strglob(const char *zGlob, const char *zStr);
7889
7890 /*
7891 ** CAPI3REF: String LIKE Matching
7892 *
7893 ** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if
@@ -7884,11 +7906,11 @@
7906 ** Note that this routine returns zero on a match and non-zero if the strings
7907 ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
7908 **
7909 ** See also: [sqlite3_strglob()].
7910 */
7911 SQLITE_API int SQLITE_APICALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
7912
7913 /*
7914 ** CAPI3REF: Error Logging Interface
7915 **
7916 ** ^The [sqlite3_log()] interface writes a message into the [error log]
@@ -7943,13 +7965,13 @@
7965 ** previously registered write-ahead log callback. ^Note that the
7966 ** [sqlite3_wal_autocheckpoint()] interface and the
7967 ** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will
7968 ** overwrite any prior [sqlite3_wal_hook()] settings.
7969 */
7970 SQLITE_API void *SQLITE_APICALL sqlite3_wal_hook(
7971 sqlite3*,
7972 int(SQLITE_CALLBACK *)(void *,sqlite3*,const char*,int),
7973 void*
7974 );
7975
7976 /*
7977 ** CAPI3REF: Configure an auto-checkpoint
@@ -7978,11 +8000,11 @@
8000 ** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]
8001 ** pages. The use of this interface
8002 ** is only necessary if the default setting is found to be suboptimal
8003 ** for a particular application.
8004 */
8005 SQLITE_API int SQLITE_APICALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
8006
8007 /*
8008 ** CAPI3REF: Checkpoint a database
8009 ** METHOD: sqlite3
8010 **
@@ -8000,11 +8022,11 @@
8022 ** interface was added. This interface is retained for backwards
8023 ** compatibility and as a convenience for applications that need to manually
8024 ** start a callback but which do not need the full power (and corresponding
8025 ** complication) of [sqlite3_wal_checkpoint_v2()].
8026 */
8027 SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
8028
8029 /*
8030 ** CAPI3REF: Checkpoint a database
8031 ** METHOD: sqlite3
8032 **
@@ -8094,11 +8116,11 @@
8116 ** [sqlite3_errcode()] and [sqlite3_errmsg()].
8117 **
8118 ** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface
8119 ** from SQL.
8120 */
8121 SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint_v2(
8122 sqlite3 *db, /* Database handle */
8123 const char *zDb, /* Name of attached database (or NULL) */
8124 int eMode, /* SQLITE_CHECKPOINT_* value */
8125 int *pnLog, /* OUT: Size of WAL log in frames */
8126 int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -8183,11 +8205,11 @@
8205 ** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL],
8206 ** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode
8207 ** of the SQL statement that triggered the call to the [xUpdate] method of the
8208 ** [virtual table].
8209 */
8210 SQLITE_API int SQLITE_APICALL sqlite3_vtab_on_conflict(sqlite3 *);
8211
8212 /*
8213 ** CAPI3REF: Conflict resolution modes
8214 ** KEYWORDS: {conflict resolution mode}
8215 **
@@ -8288,11 +8310,11 @@
8310 ** as if the loop did not exist - it returns non-zero and leave the variable
8311 ** that pOut points to unchanged.
8312 **
8313 ** See also: [sqlite3_stmt_scanstatus_reset()]
8314 */
8315 SQLITE_API int SQLITE_APICALL sqlite3_stmt_scanstatus(
8316 sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
8317 int idx, /* Index of loop to report on */
8318 int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
8319 void *pOut /* Result written here */
8320 );
@@ -8304,11 +8326,11 @@
8326 ** ^Zero all [sqlite3_stmt_scanstatus()] related event counters.
8327 **
8328 ** This API is only available if the library is built with pre-processor
8329 ** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined.
8330 */
8331 SQLITE_API void SQLITE_APICALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
8332
8333 /*
8334 ** CAPI3REF: Flush caches to disk mid-transaction
8335 **
8336 ** ^If a write-transaction is open on [database connection] D when the
@@ -8336,11 +8358,11 @@
8358 ** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK.
8359 **
8360 ** ^This function does not set the database handle error code or message
8361 ** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions.
8362 */
8363 SQLITE_API int SQLITE_APICALL sqlite3_db_cacheflush(sqlite3*);
8364
8365 /*
8366 ** CAPI3REF: The pre-update hook.
8367 **
8368 ** ^These interfaces are only available if SQLite is compiled using the
@@ -8416,13 +8438,13 @@
8438 ** triggers; or 2 for changes resulting from triggers called by top-level
8439 ** triggers; and so forth.
8440 **
8441 ** See also: [sqlite3_update_hook()]
8442 */
8443 SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_APICALL sqlite3_preupdate_hook(
8444 sqlite3 *db,
8445 void(SQLITE_CALLBACK *xPreUpdate)(
8446 void *pCtx, /* Copy of third arg to preupdate_hook() */
8447 sqlite3 *db, /* Database handle */
8448 int op, /* SQLITE_UPDATE, DELETE or INSERT */
8449 char const *zDb, /* Database name */
8450 char const *zName, /* Table name */
@@ -8429,14 +8451,14 @@
8451 sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */
8452 sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */
8453 ),
8454 void*
8455 );
8456 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **);
8457 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_count(sqlite3 *);
8458 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_depth(sqlite3 *);
8459 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **);
8460
8461 /*
8462 ** CAPI3REF: Low-level system error code
8463 **
8464 ** ^Attempt to return the underlying operating system error code or error
@@ -8444,11 +8466,11 @@
8466 ** The return value is OS-dependent. For example, on unix systems, after
8467 ** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be
8468 ** called to get back the underlying "errno" that caused the problem, such
8469 ** as ENOSPC, EAUTH, EISDIR, and so forth.
8470 */
8471 SQLITE_API int SQLITE_APICALL sqlite3_system_errno(sqlite3*);
8472
8473 /*
8474 ** CAPI3REF: Database Snapshot
8475 ** KEYWORDS: {snapshot}
8476 ** EXPERIMENTAL
@@ -8494,11 +8516,11 @@
8516 ** to avoid a memory leak.
8517 **
8518 ** The [sqlite3_snapshot_get()] interface is only available when the
8519 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8520 */
8521 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_get(
8522 sqlite3 *db,
8523 const char *zSchema,
8524 sqlite3_snapshot **ppSnapshot
8525 );
8526
@@ -8532,11 +8554,11 @@
8554 ** database connection in order to make it ready to use snapshots.)
8555 **
8556 ** The [sqlite3_snapshot_open()] interface is only available when the
8557 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8558 */
8559 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_open(
8560 sqlite3 *db,
8561 const char *zSchema,
8562 sqlite3_snapshot *pSnapshot
8563 );
8564
@@ -8549,11 +8571,11 @@
8571 ** using this routine to avoid a memory leak.
8572 **
8573 ** The [sqlite3_snapshot_free()] interface is only available when the
8574 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8575 */
8576 SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_APICALL sqlite3_snapshot_free(sqlite3_snapshot*);
8577
8578 /*
8579 ** CAPI3REF: Compare the ages of two snapshot handles.
8580 ** EXPERIMENTAL
8581 **
@@ -8573,11 +8595,11 @@
8595 **
8596 ** Otherwise, this API returns a negative value if P1 refers to an older
8597 ** snapshot than P2, zero if the two handles refer to the same database
8598 ** snapshot, and a positive value if P1 is a newer snapshot than P2.
8599 */
8600 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_cmp(
8601 sqlite3_snapshot *p1,
8602 sqlite3_snapshot *p2
8603 );
8604
8605 /*
@@ -8631,14 +8653,14 @@
8653 ** Register a geometry callback named zGeom that can be used as part of an
8654 ** R-Tree geometry query as follows:
8655 **
8656 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
8657 */
8658 SQLITE_API int SQLITE_APICALL sqlite3_rtree_geometry_callback(
8659 sqlite3 *db,
8660 const char *zGeom,
8661 int (SQLITE_CALLBACK *xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
8662 void *pContext
8663 );
8664
8665
8666 /*
@@ -8648,25 +8670,25 @@
8670 struct sqlite3_rtree_geometry {
8671 void *pContext; /* Copy of pContext passed to s_r_g_c() */
8672 int nParam; /* Size of array aParam[] */
8673 sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */
8674 void *pUser; /* Callback implementation user data */
8675 void (SQLITE_CALLBACK *xDelUser)(void *); /* Called by SQLite to clean up pUser */
8676 };
8677
8678 /*
8679 ** Register a 2nd-generation geometry callback named zScore that can be
8680 ** used as part of an R-Tree geometry query as follows:
8681 **
8682 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...)
8683 */
8684 SQLITE_API int SQLITE_APICALL sqlite3_rtree_query_callback(
8685 sqlite3 *db,
8686 const char *zQueryFunc,
8687 int (SQLITE_CALLBACK *xQueryFunc)(sqlite3_rtree_query_info*),
8688 void *pContext,
8689 void (SQLITE_CALLBACK *xDestructor)(void*)
8690 );
8691
8692
8693 /*
8694 ** A pointer to a structure of the following type is passed as the
@@ -8680,11 +8702,11 @@
8702 struct sqlite3_rtree_query_info {
8703 void *pContext; /* pContext from when function registered */
8704 int nParam; /* Number of function parameters */
8705 sqlite3_rtree_dbl *aParam; /* value of function parameters */
8706 void *pUser; /* callback can use this, if desired */
8707 void (SQLITE_CALLBACK *xDelUser)(void*); /* function to free pUser */
8708 sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */
8709 unsigned int *anQueue; /* Number of pending entries in the queue */
8710 int nCoord; /* Number of coordinates */
8711 int iLevel; /* Level of current node or entry */
8712 int mxLevel; /* The largest iLevel value in the tree */
@@ -8876,11 +8898,11 @@
8898 ** If xFilter returns 0, changes is not tracked. Note that once a table is
8899 ** attached, xFilter will not be called again.
8900 */
8901 void sqlite3session_table_filter(
8902 sqlite3_session *pSession, /* Session object */
8903 int(SQLITE_CALLBACK *xFilter)(
8904 void *pCtx, /* Copy of third arg to _filter_table() */
8905 const char *zTab /* Table name */
8906 ),
8907 void *pCtx /* First argument passed to xFilter */
8908 );
@@ -9451,11 +9473,11 @@
9473 ** An sqlite3_changegroup object is used to combine two or more changesets
9474 ** (or patchsets) into a single changeset (or patchset). A single changegroup
9475 ** object may combine changesets or patchsets, but not both. The output is
9476 ** always in the same format as the input.
9477 **
9478 ** If successful, this function returns SQLITE_OK and populates (SQLITE_CALLBACK *pp) with
9479 ** a pointer to a new sqlite3_changegroup object before returning. The caller
9480 ** should eventually free the returned object using a call to
9481 ** sqlite3changegroup_delete(). If an error occurs, an SQLite error code
9482 ** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL.
9483 **
@@ -9571,11 +9593,11 @@
9593 ** changes for tables that do not appear in the first changeset, they are
9594 ** appended onto the end of the output changeset, again in the order in
9595 ** which they are first encountered.
9596 **
9597 ** If an error occurs, an SQLite error code is returned and the output
9598 ** variables (SQLITE_CALLBACK *pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK
9599 ** is returned and the output variables are set to the size of and a
9600 ** pointer to the output buffer, respectively. In this case it is the
9601 ** responsibility of the caller to eventually free the buffer using a
9602 ** call to sqlite3_free().
9603 */
@@ -9728,15 +9750,15 @@
9750 */
9751 int sqlite3changeset_apply(
9752 sqlite3 *db, /* Apply change to "main" db of this handle */
9753 int nChangeset, /* Size of changeset in bytes */
9754 void *pChangeset, /* Changeset blob */
9755 int(SQLITE_CALLBACK *xFilter)(
9756 void *pCtx, /* Copy of sixth arg to _apply() */
9757 const char *zTab /* Table name */
9758 ),
9759 int(SQLITE_CALLBACK *xConflict)(
9760 void *pCtx, /* Copy of sixth arg to _apply() */
9761 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
9762 sqlite3_changeset_iter *p /* Handle describing change and conflict */
9763 ),
9764 void *pCtx /* First argument passed to xConflict */
@@ -9873,20 +9895,20 @@
9895 ** </pre>
9896 **
9897 ** Is replaced by:
9898 **
9899 ** <pre>
9900 ** &nbsp; int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
9901 ** &nbsp; void *pIn,
9902 ** </pre>
9903 **
9904 ** Each time the xInput callback is invoked by the sessions module, the first
9905 ** argument passed is a copy of the supplied pIn context pointer. The second
9906 ** argument, pData, points to a buffer (SQLITE_CALLBACK *pnData) bytes in size. Assuming no
9907 ** error occurs the xInput method should copy up to (SQLITE_CALLBACK *pnData) bytes of data
9908 ** into the buffer and set (SQLITE_CALLBACK *pnData) to the actual number of bytes copied
9909 ** before returning SQLITE_OK. If the input is completely exhausted, (SQLITE_CALLBACK *pnData)
9910 ** should be set to zero to indicate this. Or, if an error occurs, an SQLite
9911 ** error code should be returned. In all cases, if an xInput callback returns
9912 ** an error, all processing is abandoned and the streaming API function
9913 ** returns a copy of the error code to the caller.
9914 **
@@ -9907,11 +9929,11 @@
9929 ** </pre>
9930 **
9931 ** Is replaced by:
9932 **
9933 ** <pre>
9934 ** &nbsp; int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9935 ** &nbsp; void *pOut
9936 ** </pre>
9937 **
9938 ** The xOutput callback is invoked zero or more times to return data to
9939 ** the application. The first parameter passed to each call is a copy of the
@@ -9927,58 +9949,58 @@
9949 ** parameter set to a value less than or equal to zero. Other than this,
9950 ** no guarantees are made as to the size of the chunks of data returned.
9951 */
9952 int sqlite3changeset_apply_strm(
9953 sqlite3 *db, /* Apply change to "main" db of this handle */
9954 int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), /* Input function */
9955 void *pIn, /* First arg for xInput */
9956 int(SQLITE_CALLBACK *xFilter)(
9957 void *pCtx, /* Copy of sixth arg to _apply() */
9958 const char *zTab /* Table name */
9959 ),
9960 int(SQLITE_CALLBACK *xConflict)(
9961 void *pCtx, /* Copy of sixth arg to _apply() */
9962 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
9963 sqlite3_changeset_iter *p /* Handle describing change and conflict */
9964 ),
9965 void *pCtx /* First argument passed to xConflict */
9966 );
9967 int sqlite3changeset_concat_strm(
9968 int (SQLITE_CALLBACK *xInputA)(void *pIn, void *pData, int *pnData),
9969 void *pInA,
9970 int (SQLITE_CALLBACK *xInputB)(void *pIn, void *pData, int *pnData),
9971 void *pInB,
9972 int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9973 void *pOut
9974 );
9975 int sqlite3changeset_invert_strm(
9976 int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
9977 void *pIn,
9978 int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9979 void *pOut
9980 );
9981 int sqlite3changeset_start_strm(
9982 sqlite3_changeset_iter **pp,
9983 int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
9984 void *pIn
9985 );
9986 int sqlite3session_changeset_strm(
9987 sqlite3_session *pSession,
9988 int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9989 void *pOut
9990 );
9991 int sqlite3session_patchset_strm(
9992 sqlite3_session *pSession,
9993 int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9994 void *pOut
9995 );
9996 int sqlite3changegroup_add_strm(sqlite3_changegroup*,
9997 int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
9998 void *pIn
9999 );
10000 int sqlite3changegroup_output_strm(sqlite3_changegroup*,
10001 int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
10002 void *pOut
10003 );
10004
10005
10006 /*
@@ -10029,11 +10051,11 @@
10051
10052 typedef struct Fts5ExtensionApi Fts5ExtensionApi;
10053 typedef struct Fts5Context Fts5Context;
10054 typedef struct Fts5PhraseIter Fts5PhraseIter;
10055
10056 typedef void (SQLITE_CALLBACK *fts5_extension_function)(
10057 const Fts5ExtensionApi *pApi, /* API offered by current FTS version */
10058 Fts5Context *pFts, /* First arg to pass to pApi functions */
10059 sqlite3_context *pCtx, /* Context for returning result/error */
10060 int nVal, /* Number of values in apVal[] array */
10061 sqlite3_value **apVal /* Array of trailing arguments */
@@ -10080,15 +10102,15 @@
10102 ** This function may be quite inefficient if used with an FTS5 table
10103 ** created with the "columnsize=0" option.
10104 **
10105 ** xColumnText:
10106 ** This function attempts to retrieve the text of column iCol of the
10107 ** current document. If successful, (SQLITE_CALLBACK *pz) is set to point to a buffer
10108 ** containing the text in utf-8 encoding, (SQLITE_CALLBACK *pn) is set to the size in bytes
10109 ** (not characters) of the buffer and SQLITE_OK is returned. Otherwise,
10110 ** if an error occurs, an SQLite error code is returned and the final values
10111 ** of (SQLITE_CALLBACK *pz) and (*pn) are undefined.
10112 **
10113 ** xPhraseCount:
10114 ** Returns the number of phrases in the current query expression.
10115 **
10116 ** xPhraseSize:
@@ -10193,11 +10215,11 @@
10215 ** xRowCount(pFts5, pnRow)
10216 **
10217 ** This function is used to retrieve the total number of rows in the table.
10218 ** In other words, the same value that would be returned by:
10219 **
10220 ** SELECT count(SQLITE_CALLBACK *) FROM ftstable;
10221 **
10222 ** xPhraseFirst()
10223 ** This function is used, along with type Fts5PhraseIter and the xPhraseNext
10224 ** method, to iterate through all instances of a single query phrase within
10225 ** the current row. This is the same information as is accessible via the
@@ -10260,43 +10282,43 @@
10282 ** See xPhraseFirstColumn above.
10283 */
10284 struct Fts5ExtensionApi {
10285 int iVersion; /* Currently always set to 3 */
10286
10287 void *(SQLITE_CALLBACK *xUserData)(Fts5Context*);
10288
10289 int (SQLITE_CALLBACK *xColumnCount)(Fts5Context*);
10290 int (SQLITE_CALLBACK *xRowCount)(Fts5Context*, sqlite3_int64 *pnRow);
10291 int (SQLITE_CALLBACK *xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken);
10292
10293 int (SQLITE_CALLBACK *xTokenize)(Fts5Context*,
10294 const char *pText, int nText, /* Text to tokenize */
10295 void *pCtx, /* Context passed to xToken() */
10296 int (SQLITE_CALLBACK *xToken)(void*, int, const char*, int, int, int) /* Callback */
10297 );
10298
10299 int (SQLITE_CALLBACK *xPhraseCount)(Fts5Context*);
10300 int (SQLITE_CALLBACK *xPhraseSize)(Fts5Context*, int iPhrase);
10301
10302 int (SQLITE_CALLBACK *xInstCount)(Fts5Context*, int *pnInst);
10303 int (SQLITE_CALLBACK *xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff);
10304
10305 sqlite3_int64 (SQLITE_CALLBACK *xRowid)(Fts5Context*);
10306 int (SQLITE_CALLBACK *xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn);
10307 int (SQLITE_CALLBACK *xColumnSize)(Fts5Context*, int iCol, int *pnToken);
10308
10309 int (SQLITE_CALLBACK *xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData,
10310 int(SQLITE_CALLBACK *)(const Fts5ExtensionApi*,Fts5Context*,void*)
10311 );
10312 int (SQLITE_CALLBACK *xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*));
10313 void *(SQLITE_CALLBACK *xGetAuxdata)(Fts5Context*, int bClear);
10314
10315 int (SQLITE_CALLBACK *xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*);
10316 void (SQLITE_CALLBACK *xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff);
10317
10318 int (SQLITE_CALLBACK *xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*);
10319 void (SQLITE_CALLBACK *xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol);
10320 };
10321
10322 /*
10323 ** CUSTOM AUXILIARY FUNCTIONS
10324 *************************************************************************/
@@ -10320,11 +10342,11 @@
10342 ** The second and third arguments are an array of nul-terminated strings
10343 ** containing the tokenizer arguments, if any, specified following the
10344 ** tokenizer name as part of the CREATE VIRTUAL TABLE statement used
10345 ** to create the FTS5 table.
10346 **
10347 ** The final argument is an output variable. If successful, (SQLITE_CALLBACK *ppOut)
10348 ** should be set to point to the new tokenizer handle and SQLITE_OK
10349 ** returned. If an error occurs, some value other than SQLITE_OK should
10350 ** be returned. In this case, fts5 assumes that the final value of *ppOut
10351 ** is undefined.
10352 **
@@ -10494,17 +10516,17 @@
10516 ** inefficient.
10517 */
10518 typedef struct Fts5Tokenizer Fts5Tokenizer;
10519 typedef struct fts5_tokenizer fts5_tokenizer;
10520 struct fts5_tokenizer {
10521 int (SQLITE_CALLBACK *xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
10522 void (SQLITE_CALLBACK *xDelete)(Fts5Tokenizer*);
10523 int (SQLITE_CALLBACK *xTokenize)(Fts5Tokenizer*,
10524 void *pCtx,
10525 int flags, /* Mask of FTS5_TOKENIZE_* flags */
10526 const char *pText, int nText,
10527 int (SQLITE_CALLBACK *xToken)(
10528 void *pCtx, /* Copy of 2nd argument to xTokenize() */
10529 int tflags, /* Mask of FTS5_TOKEN_* flags */
10530 const char *pToken, /* Pointer to buffer containing token */
10531 int nToken, /* Size of token in bytes */
10532 int iStart, /* Byte offset of token within input text */
@@ -10533,33 +10555,33 @@
10555 typedef struct fts5_api fts5_api;
10556 struct fts5_api {
10557 int iVersion; /* Currently always set to 2 */
10558
10559 /* Create a new tokenizer */
10560 int (SQLITE_CALLBACK *xCreateTokenizer)(
10561 fts5_api *pApi,
10562 const char *zName,
10563 void *pContext,
10564 fts5_tokenizer *pTokenizer,
10565 void (SQLITE_CALLBACK *xDestroy)(void*)
10566 );
10567
10568 /* Find an existing tokenizer */
10569 int (SQLITE_CALLBACK *xFindTokenizer)(
10570 fts5_api *pApi,
10571 const char *zName,
10572 void **ppContext,
10573 fts5_tokenizer *pTokenizer
10574 );
10575
10576 /* Create a new auxiliary function */
10577 int (SQLITE_CALLBACK *xCreateFunction)(
10578 fts5_api *pApi,
10579 const char *zName,
10580 void *pContext,
10581 fts5_extension_function xFunction,
10582 void (SQLITE_CALLBACK *xDestroy)(void*)
10583 );
10584 };
10585
10586 /*
10587 ** END OF REGISTRATION API
@@ -11873,12 +11895,12 @@
11895 */
11896 #ifdef SQLITE_OMIT_WSD
11897 #define SQLITE_WSD const
11898 #define GLOBAL(t,v) (*(t*)sqlite3_wsd_find((void*)&(v), sizeof(v)))
11899 #define sqlite3GlobalConfig GLOBAL(struct Sqlite3Config, sqlite3Config)
11900 SQLITE_API int SQLITE_APICALL sqlite3_wsd_init(int N, int J);
11901 SQLITE_API void *SQLITE_APICALL sqlite3_wsd_find(void *K, int L);
11902 #else
11903 #define SQLITE_WSD
11904 #define GLOBAL(t,v) v
11905 #define sqlite3GlobalConfig sqlite3Config
11906 #endif
@@ -17165,12 +17187,14 @@
17187 "CASE_SENSITIVE_LIKE",
17188 #endif
17189 #if SQLITE_CHECK_PAGES
17190 "CHECK_PAGES",
17191 #endif
17192 #if defined(__clang__) && defined(__clang_major__)
17193 "COMPILER=clang-" CTIMEOPT_VAL(__clang_major__) "."
17194 CTIMEOPT_VAL(__clang_minor__) "."
17195 CTIMEOPT_VAL(__clang_patchlevel__),
17196 #elif defined(_MSC_VER)
17197 "COMPILER=msvc-" CTIMEOPT_VAL(_MSC_VER),
17198 #elif defined(__GNUC__) && defined(__VERSION__)
17199 "COMPILER=gcc-" __VERSION__,
17200 #endif
@@ -17531,11 +17555,11 @@
17555 ** was used and false if not.
17556 **
17557 ** The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix
17558 ** is not required for a match.
17559 */
17560 SQLITE_API int SQLITE_APICALL sqlite3_compileoption_used(const char *zOptName){
17561 int i, n;
17562
17563 #if SQLITE_ENABLE_API_ARMOR
17564 if( zOptName==0 ){
17565 (void)SQLITE_MISUSE_BKPT;
@@ -17559,11 +17583,11 @@
17583
17584 /*
17585 ** Return the N-th compile-time option string. If N is out of range,
17586 ** return a NULL pointer.
17587 */
17588 SQLITE_API const char *SQLITE_APICALL sqlite3_compileoption_get(int N){
17589 if( N>=0 && N<ArraySize(azCompileOpt) ){
17590 return azCompileOpt[N];
17591 }
17592 return 0;
17593 }
@@ -18269,11 +18293,11 @@
18293 }
18294
18295 /*
18296 ** Query status information.
18297 */
18298 SQLITE_API int SQLITE_APICALL sqlite3_status64(
18299 int op,
18300 sqlite3_int64 *pCurrent,
18301 sqlite3_int64 *pHighwater,
18302 int resetFlag
18303 ){
@@ -18294,11 +18318,11 @@
18318 }
18319 sqlite3_mutex_leave(pMutex);
18320 (void)pMutex; /* Prevent warning when SQLITE_THREADSAFE=0 */
18321 return SQLITE_OK;
18322 }
18323 SQLITE_API int SQLITE_APICALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){
18324 sqlite3_int64 iCur, iHwtr;
18325 int rc;
18326 #ifdef SQLITE_ENABLE_API_ARMOR
18327 if( pCurrent==0 || pHighwater==0 ) return SQLITE_MISUSE_BKPT;
18328 #endif
@@ -18311,11 +18335,11 @@
18335 }
18336
18337 /*
18338 ** Query status information for a single database connection
18339 */
18340 SQLITE_API int SQLITE_APICALL sqlite3_db_status(
18341 sqlite3 *db, /* The database connection whose status is desired */
18342 int op, /* Status verb */
18343 int *pCurrent, /* Write current value here */
18344 int *pHighwater, /* Write high-water mark here */
18345 int resetFlag /* Reset high-water mark if true */
@@ -19989,11 +20013,11 @@
20013
20014 /*
20015 ** Locate a VFS by name. If no name is given, simply return the
20016 ** first VFS on the list.
20017 */
20018 SQLITE_API sqlite3_vfs *SQLITE_APICALL sqlite3_vfs_find(const char *zVfs){
20019 sqlite3_vfs *pVfs = 0;
20020 #if SQLITE_THREADSAFE
20021 sqlite3_mutex *mutex;
20022 #endif
20023 #ifndef SQLITE_OMIT_AUTOINIT
@@ -20035,11 +20059,11 @@
20059 /*
20060 ** Register a VFS with the system. It is harmless to register the same
20061 ** VFS multiple times. The new VFS becomes the default if makeDflt is
20062 ** true.
20063 */
20064 SQLITE_API int SQLITE_APICALL sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){
20065 MUTEX_LOGIC(sqlite3_mutex *mutex;)
20066 #ifndef SQLITE_OMIT_AUTOINIT
20067 int rc = sqlite3_initialize();
20068 if( rc ) return rc;
20069 #endif
@@ -20063,11 +20087,11 @@
20087 }
20088
20089 /*
20090 ** Unregister a VFS so that it is no longer accessible.
20091 */
20092 SQLITE_API int SQLITE_APICALL sqlite3_vfs_unregister(sqlite3_vfs *pVfs){
20093 #if SQLITE_THREADSAFE
20094 sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
20095 #endif
20096 sqlite3_mutex_enter(mutex);
20097 vfsUnlink(pVfs);
@@ -22414,11 +22438,11 @@
22438 }
22439
22440 /*
22441 ** Retrieve a pointer to a static mutex or allocate a new dynamic one.
22442 */
22443 SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_mutex_alloc(int id){
22444 #ifndef SQLITE_OMIT_AUTOINIT
22445 if( id<=SQLITE_MUTEX_RECURSIVE && sqlite3_initialize() ) return 0;
22446 if( id>SQLITE_MUTEX_RECURSIVE && sqlite3MutexInit() ) return 0;
22447 #endif
22448 assert( sqlite3GlobalConfig.mutex.xMutexAlloc );
@@ -22435,11 +22459,11 @@
22459 }
22460
22461 /*
22462 ** Free a dynamic mutex.
22463 */
22464 SQLITE_API void SQLITE_APICALL sqlite3_mutex_free(sqlite3_mutex *p){
22465 if( p ){
22466 assert( sqlite3GlobalConfig.mutex.xMutexFree );
22467 sqlite3GlobalConfig.mutex.xMutexFree(p);
22468 }
22469 }
@@ -22446,11 +22470,11 @@
22470
22471 /*
22472 ** Obtain the mutex p. If some other thread already has the mutex, block
22473 ** until it can be obtained.
22474 */
22475 SQLITE_API void SQLITE_APICALL sqlite3_mutex_enter(sqlite3_mutex *p){
22476 if( p ){
22477 assert( sqlite3GlobalConfig.mutex.xMutexEnter );
22478 sqlite3GlobalConfig.mutex.xMutexEnter(p);
22479 }
22480 }
@@ -22457,11 +22481,11 @@
22481
22482 /*
22483 ** Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another
22484 ** thread holds the mutex and it cannot be obtained, return SQLITE_BUSY.
22485 */
22486 SQLITE_API int SQLITE_APICALL sqlite3_mutex_try(sqlite3_mutex *p){
22487 int rc = SQLITE_OK;
22488 if( p ){
22489 assert( sqlite3GlobalConfig.mutex.xMutexTry );
22490 return sqlite3GlobalConfig.mutex.xMutexTry(p);
22491 }
@@ -22472,11 +22496,11 @@
22496 ** The sqlite3_mutex_leave() routine exits a mutex that was previously
22497 ** entered by the same thread. The behavior is undefined if the mutex
22498 ** is not currently entered. If a NULL pointer is passed as an argument
22499 ** this function is a no-op.
22500 */
22501 SQLITE_API void SQLITE_APICALL sqlite3_mutex_leave(sqlite3_mutex *p){
22502 if( p ){
22503 assert( sqlite3GlobalConfig.mutex.xMutexLeave );
22504 sqlite3GlobalConfig.mutex.xMutexLeave(p);
22505 }
22506 }
@@ -22484,15 +22508,15 @@
22508 #ifndef NDEBUG
22509 /*
22510 ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are
22511 ** intended for use inside assert() statements.
22512 */
22513 SQLITE_API int SQLITE_APICALL sqlite3_mutex_held(sqlite3_mutex *p){
22514 assert( p==0 || sqlite3GlobalConfig.mutex.xMutexHeld );
22515 return p==0 || sqlite3GlobalConfig.mutex.xMutexHeld(p);
22516 }
22517 SQLITE_API int SQLITE_APICALL sqlite3_mutex_notheld(sqlite3_mutex *p){
22518 assert( p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld );
22519 return p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld(p);
22520 }
22521 #endif
22522
@@ -23520,12 +23544,12 @@
23544 ** of the sqlite3_initialize() and sqlite3_shutdown() processing, the
23545 ** "interlocked" magic used here is probably not strictly necessary.
23546 */
23547 static LONG SQLITE_WIN32_VOLATILE winMutex_lock = 0;
23548
23549 SQLITE_API int SQLITE_APICALL sqlite3_win32_is_nt(void); /* os_win.c */
23550 SQLITE_API void SQLITE_APICALL sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */
23551
23552 static int winMutexInit(void){
23553 /* The first to increment to 1 does actual initialization */
23554 if( InterlockedCompareExchange(&winMutex_lock, 1, 0)==0 ){
23555 int i;
@@ -23821,11 +23845,11 @@
23845 /*
23846 ** Attempt to release up to n bytes of non-essential memory currently
23847 ** held by SQLite. An example of non-essential memory is memory used to
23848 ** cache database pages that are not currently in use.
23849 */
23850 SQLITE_API int SQLITE_APICALL sqlite3_release_memory(int n){
23851 #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
23852 return sqlite3PcacheReleaseMemory(n);
23853 #else
23854 /* IMPLEMENTATION-OF: R-34391-24921 The sqlite3_release_memory() routine
23855 ** is a no-op returning zero if SQLite is not compiled with
@@ -23880,11 +23904,11 @@
23904 /*
23905 ** Deprecated external interface. It used to set an alarm callback
23906 ** that was invoked when memory usage grew too large. Now it is a
23907 ** no-op.
23908 */
23909 SQLITE_API int SQLITE_APICALL sqlite3_memory_alarm(
23910 void(*xCallback)(void *pArg, sqlite3_int64 used,int N),
23911 void *pArg,
23912 sqlite3_int64 iThreshold
23913 ){
23914 (void)xCallback;
@@ -23896,11 +23920,11 @@
23920
23921 /*
23922 ** Set the soft heap-size limit for the library. Passing a zero or
23923 ** negative value indicates no limit.
23924 */
23925 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_soft_heap_limit64(sqlite3_int64 n){
23926 sqlite3_int64 priorLimit;
23927 sqlite3_int64 excess;
23928 sqlite3_int64 nUsed;
23929 #ifndef SQLITE_OMIT_AUTOINIT
23930 int rc = sqlite3_initialize();
@@ -23918,11 +23942,11 @@
23942 sqlite3_mutex_leave(mem0.mutex);
23943 excess = sqlite3_memory_used() - n;
23944 if( excess>0 ) sqlite3_release_memory((int)(excess & 0x7fffffff));
23945 return priorLimit;
23946 }
23947 SQLITE_API void SQLITE_APICALL sqlite3_soft_heap_limit(int n){
23948 if( n<0 ) n = 0;
23949 sqlite3_soft_heap_limit64(n);
23950 }
23951
23952 /*
@@ -23987,11 +24011,11 @@
24011 }
24012
24013 /*
24014 ** Return the amount of memory currently checked out.
24015 */
24016 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_used(void){
24017 sqlite3_int64 res, mx;
24018 sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, 0);
24019 return res;
24020 }
24021
@@ -23998,11 +24022,11 @@
24022 /*
24023 ** Return the maximum amount of memory that has ever been
24024 ** checked out since either the beginning of this process
24025 ** or since the most recent reset.
24026 */
24027 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_highwater(int resetFlag){
24028 sqlite3_int64 res, mx;
24029 sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, resetFlag);
24030 return mx;
24031 }
24032
@@ -24078,17 +24102,17 @@
24102 /*
24103 ** This version of the memory allocation is for use by the application.
24104 ** First make sure the memory subsystem is initialized, then do the
24105 ** allocation.
24106 */
24107 SQLITE_API void *SQLITE_APICALL sqlite3_malloc(int n){
24108 #ifndef SQLITE_OMIT_AUTOINIT
24109 if( sqlite3_initialize() ) return 0;
24110 #endif
24111 return n<=0 ? 0 : sqlite3Malloc(n);
24112 }
24113 SQLITE_API void *SQLITE_APICALL sqlite3_malloc64(sqlite3_uint64 n){
24114 #ifndef SQLITE_OMIT_AUTOINIT
24115 if( sqlite3_initialize() ) return 0;
24116 #endif
24117 return sqlite3Malloc(n);
24118 }
@@ -24227,20 +24251,20 @@
24251 }else{
24252 assert( sqlite3_mutex_held(db->mutex) );
24253 return db->lookaside.sz;
24254 }
24255 }
24256 SQLITE_API sqlite3_uint64 SQLITE_APICALL sqlite3_msize(void *p){
24257 assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) );
24258 assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
24259 return p ? sqlite3GlobalConfig.m.xSize(p) : 0;
24260 }
24261
24262 /*
24263 ** Free memory previously obtained from sqlite3Malloc().
24264 */
24265 SQLITE_API void SQLITE_APICALL sqlite3_free(void *p){
24266 if( p==0 ) return; /* IMP: R-49053-54554 */
24267 assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
24268 assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) );
24269 if( sqlite3GlobalConfig.bMemstat ){
24270 sqlite3_mutex_enter(mem0.mutex);
@@ -24345,18 +24369,18 @@
24369
24370 /*
24371 ** The public interface to sqlite3Realloc. Make sure that the memory
24372 ** subsystem is initialized prior to invoking sqliteRealloc.
24373 */
24374 SQLITE_API void *SQLITE_APICALL sqlite3_realloc(void *pOld, int n){
24375 #ifndef SQLITE_OMIT_AUTOINIT
24376 if( sqlite3_initialize() ) return 0;
24377 #endif
24378 if( n<0 ) n = 0; /* IMP: R-26507-47431 */
24379 return sqlite3Realloc(pOld, n);
24380 }
24381 SQLITE_API void *SQLITE_APICALL sqlite3_realloc64(void *pOld, sqlite3_uint64 n){
24382 #ifndef SQLITE_OMIT_AUTOINIT
24383 if( sqlite3_initialize() ) return 0;
24384 #endif
24385 return sqlite3Realloc(pOld, n);
24386 }
@@ -25579,11 +25603,11 @@
25603
25604 /*
25605 ** Print into memory obtained from sqlite3_malloc(). Omit the internal
25606 ** %-conversion extensions.
25607 */
25608 SQLITE_API char *SQLITE_APICALL sqlite3_vmprintf(const char *zFormat, va_list ap){
25609 char *z;
25610 char zBase[SQLITE_PRINT_BUF_SIZE];
25611 StrAccum acc;
25612
25613 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -25628,11 +25652,11 @@
25652 ** this without breaking compatibility, so we just have to live with the
25653 ** mistake.
25654 **
25655 ** sqlite3_vsnprintf() is the varargs version.
25656 */
25657 SQLITE_API char *SQLITE_APICALL sqlite3_vsnprintf(int n, char *zBuf, const char *zFormat, va_list ap){
25658 StrAccum acc;
25659 if( n<=0 ) return zBuf;
25660 #ifdef SQLITE_ENABLE_API_ARMOR
25661 if( zBuf==0 || zFormat==0 ) {
25662 (void)SQLITE_MISUSE_BKPT;
@@ -26255,11 +26279,11 @@
26279 } sqlite3Prng;
26280
26281 /*
26282 ** Return N random bytes.
26283 */
26284 SQLITE_API void SQLITE_APICALL sqlite3_randomness(int N, void *pBuf){
26285 unsigned char t;
26286 unsigned char *zBuf = pBuf;
26287
26288 /* The "wsdPrng" macro will resolve to the pseudo-random number generator
26289 ** state vector. If writable static data is unsupported on the target,
@@ -27458,11 +27482,11 @@
27482 ** sqlite3_strnicmp() APIs allow applications and extensions to compare
27483 ** the contents of two buffers containing UTF-8 strings in a
27484 ** case-independent fashion, using the same definition of "case
27485 ** independence" that SQLite uses internally when comparing identifiers.
27486 */
27487 SQLITE_API int SQLITE_APICALL sqlite3_stricmp(const char *zLeft, const char *zRight){
27488 if( zLeft==0 ){
27489 return zRight ? -1 : 0;
27490 }else if( zRight==0 ){
27491 return 1;
27492 }
@@ -27479,11 +27503,11 @@
27503 a++;
27504 b++;
27505 }
27506 return c;
27507 }
27508 SQLITE_API int SQLITE_APICALL sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){
27509 register unsigned char *a, *b;
27510 if( zLeft==0 ){
27511 return zRight ? -1 : 0;
27512 }else if( zRight==0 ){
27513 return 1;
@@ -36778,11 +36802,11 @@
36802 ** This routine is called once during SQLite initialization and by a
36803 ** single thread. The memory allocation and mutex subsystems have not
36804 ** necessarily been initialized when this routine is called, and so they
36805 ** should not be used.
36806 */
36807 SQLITE_API int SQLITE_APICALL sqlite3_os_init(void){
36808 /*
36809 ** The following macro defines an initializer for an sqlite3_vfs object.
36810 ** The name of the VFS is NAME. The pAppData is a pointer to a pointer
36811 ** to the "finder" function. (pAppData is a pointer to a pointer because
36812 ** silly C90 rules prohibit a void* from being cast to a function pointer
@@ -36877,11 +36901,11 @@
36901 **
36902 ** Some operating systems might need to do some cleanup in this routine,
36903 ** to release dynamically allocated objects. But not on unix.
36904 ** This routine is a no-op for unix.
36905 */
36906 SQLITE_API int SQLITE_APICALL sqlite3_os_end(void){
36907 return SQLITE_OK;
36908 }
36909
36910 #endif /* SQLITE_OS_UNIX */
36911
@@ -38312,11 +38336,11 @@
38336 ** compact it. Upon success, SQLITE_OK will be returned. Upon failure, one
38337 ** of SQLITE_NOMEM, SQLITE_ERROR, or SQLITE_NOTFOUND will be returned. The
38338 ** "pnLargest" argument, if non-zero, will be used to return the size of the
38339 ** largest committed free block in the heap, in bytes.
38340 */
38341 SQLITE_API int SQLITE_APICALL sqlite3_win32_compact_heap(LPUINT pnLargest){
38342 int rc = SQLITE_OK;
38343 UINT nLargest = 0;
38344 HANDLE hHeap;
38345
38346 winMemAssertMagic();
@@ -38352,11 +38376,11 @@
38376 ** If a Win32 native heap has been configured, this function will attempt to
38377 ** destroy and recreate it. If the Win32 native heap is not isolated and/or
38378 ** the sqlite3_memory_used() function does not return zero, SQLITE_BUSY will
38379 ** be returned and no changes will be made to the Win32 native heap.
38380 */
38381 SQLITE_API int SQLITE_APICALL sqlite3_win32_reset_heap(){
38382 int rc;
38383 MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */
38384 MUTEX_LOGIC( sqlite3_mutex *pMem; ) /* The memsys static mutex */
38385 MUTEX_LOGIC( pMaster = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); )
38386 MUTEX_LOGIC( pMem = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM); )
@@ -38397,11 +38421,11 @@
38421 /*
38422 ** This function outputs the specified (ANSI) string to the Win32 debugger
38423 ** (if available).
38424 */
38425
38426 SQLITE_API void SQLITE_APICALL sqlite3_win32_write_debug(const char *zBuf, int nBuf){
38427 char zDbgBuf[SQLITE_WIN32_DBG_BUF_SIZE];
38428 int nMin = MIN(nBuf, (SQLITE_WIN32_DBG_BUF_SIZE - 1)); /* may be negative. */
38429 if( nMin<-1 ) nMin = -1; /* all negative values become -1. */
38430 assert( nMin==-1 || nMin==0 || nMin<SQLITE_WIN32_DBG_BUF_SIZE );
38431 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -38443,11 +38467,11 @@
38467 */
38468 #if SQLITE_OS_WINRT
38469 static HANDLE sleepObj = NULL;
38470 #endif
38471
38472 SQLITE_API void SQLITE_APICALL sqlite3_win32_sleep(DWORD milliseconds){
38473 #if SQLITE_OS_WINRT
38474 if ( sleepObj==NULL ){
38475 sleepObj = osCreateEventExW(NULL, NULL, CREATE_EVENT_MANUAL_RESET,
38476 SYNCHRONIZE);
38477 }
@@ -38492,11 +38516,11 @@
38516
38517 /*
38518 ** This function determines if the machine is running a version of Windows
38519 ** based on the NT kernel.
38520 */
38521 SQLITE_API int SQLITE_APICALL sqlite3_win32_is_nt(void){
38522 #if SQLITE_OS_WINRT
38523 /*
38524 ** NOTE: The WinRT sub-platform is always assumed to be based on the NT
38525 ** kernel.
38526 */
@@ -38880,11 +38904,11 @@
38904 }
38905
38906 /*
38907 ** This is a public wrapper for the winUtf8ToUnicode() function.
38908 */
38909 SQLITE_API LPWSTR SQLITE_APICALL sqlite3_win32_utf8_to_unicode(const char *zText){
38910 #ifdef SQLITE_ENABLE_API_ARMOR
38911 if( !zText ){
38912 (void)SQLITE_MISUSE_BKPT;
38913 return 0;
38914 }
@@ -38896,11 +38920,11 @@
38920 }
38921
38922 /*
38923 ** This is a public wrapper for the winUnicodeToUtf8() function.
38924 */
38925 SQLITE_API char *SQLITE_APICALL sqlite3_win32_unicode_to_utf8(LPCWSTR zWideText){
38926 #ifdef SQLITE_ENABLE_API_ARMOR
38927 if( !zWideText ){
38928 (void)SQLITE_MISUSE_BKPT;
38929 return 0;
38930 }
@@ -38912,11 +38936,11 @@
38936 }
38937
38938 /*
38939 ** This is a public wrapper for the winMbcsToUtf8() function.
38940 */
38941 SQLITE_API char *SQLITE_APICALL sqlite3_win32_mbcs_to_utf8(const char *zText){
38942 #ifdef SQLITE_ENABLE_API_ARMOR
38943 if( !zText ){
38944 (void)SQLITE_MISUSE_BKPT;
38945 return 0;
38946 }
@@ -38928,11 +38952,11 @@
38952 }
38953
38954 /*
38955 ** This is a public wrapper for the winMbcsToUtf8() function.
38956 */
38957 SQLITE_API char *SQLITE_APICALL sqlite3_win32_mbcs_to_utf8_v2(const char *zText, int useAnsi){
38958 #ifdef SQLITE_ENABLE_API_ARMOR
38959 if( !zText ){
38960 (void)SQLITE_MISUSE_BKPT;
38961 return 0;
38962 }
@@ -38944,11 +38968,11 @@
38968 }
38969
38970 /*
38971 ** This is a public wrapper for the winUtf8ToMbcs() function.
38972 */
38973 SQLITE_API char *SQLITE_APICALL sqlite3_win32_utf8_to_mbcs(const char *zText){
38974 #ifdef SQLITE_ENABLE_API_ARMOR
38975 if( !zText ){
38976 (void)SQLITE_MISUSE_BKPT;
38977 return 0;
38978 }
@@ -38960,11 +38984,11 @@
38984 }
38985
38986 /*
38987 ** This is a public wrapper for the winUtf8ToMbcs() function.
38988 */
38989 SQLITE_API char *SQLITE_APICALL sqlite3_win32_utf8_to_mbcs_v2(const char *zText, int useAnsi){
38990 #ifdef SQLITE_ENABLE_API_ARMOR
38991 if( !zText ){
38992 (void)SQLITE_MISUSE_BKPT;
38993 return 0;
38994 }
@@ -38980,11 +39004,11 @@
39004 ** the provided arguments. The type argument must be 1 in order to set the
39005 ** data directory or 2 in order to set the temporary directory. The zValue
39006 ** argument is the name of the directory to use. The return value will be
39007 ** SQLITE_OK if successful.
39008 */
39009 SQLITE_API int SQLITE_APICALL sqlite3_win32_set_directory(DWORD type, LPCWSTR zValue){
39010 char **ppDirectory = 0;
39011 #ifndef SQLITE_OMIT_AUTOINIT
39012 int rc = sqlite3_initialize();
39013 if( rc ) return rc;
39014 #endif
@@ -42898,11 +42922,11 @@
42922 }
42923
42924 /*
42925 ** Initialize and deinitialize the operating system interface.
42926 */
42927 SQLITE_API int SQLITE_APICALL sqlite3_os_init(void){
42928 static sqlite3_vfs winVfs = {
42929 3, /* iVersion */
42930 sizeof(winFile), /* szOsFile */
42931 SQLITE_WIN32_MAX_PATH_BYTES, /* mxPathname */
42932 0, /* pNext */
@@ -43029,11 +43053,11 @@
43053 #endif
43054
43055 return SQLITE_OK;
43056 }
43057
43058 SQLITE_API int SQLITE_APICALL sqlite3_os_end(void){
43059 #if SQLITE_OS_WINRT
43060 if( sleepObj!=NULL ){
43061 osCloseHandle(sleepObj);
43062 sleepObj = NULL;
43063 }
@@ -57024,11 +57048,11 @@
57048
57049 /*
57050 ** Return a +ve value if snapshot p1 is newer than p2. A -ve value if
57051 ** p1 is older than p2 and zero if p1 and p2 are the same snapshot.
57052 */
57053 SQLITE_API int SQLITE_APICALL sqlite3_snapshot_cmp(sqlite3_snapshot *p1, sqlite3_snapshot *p2){
57054 WalIndexHdr *pHdr1 = (WalIndexHdr*)p1;
57055 WalIndexHdr *pHdr2 = (WalIndexHdr*)p2;
57056
57057 /* aSalt[0] is a copy of the value stored in the wal file header. It
57058 ** is incremented each time the wal file is restarted. */
@@ -58161,11 +58185,11 @@
58185 **
58186 ** This routine has no effect on existing database connections.
58187 ** The shared cache setting effects only future calls to
58188 ** sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2().
58189 */
58190 SQLITE_API int SQLITE_APICALL sqlite3_enable_shared_cache(int enable){
58191 sqlite3GlobalConfig.sharedCacheEnabled = enable;
58192 return SQLITE_OK;
58193 }
58194 #endif
58195
@@ -67934,11 +67958,11 @@
67958 ** a pointer to the new sqlite3_backup object.
67959 **
67960 ** If an error occurs, NULL is returned and an error code and error message
67961 ** stored in database handle pDestDb.
67962 */
67963 SQLITE_API sqlite3_backup *SQLITE_APICALL sqlite3_backup_init(
67964 sqlite3* pDestDb, /* Database to write to */
67965 const char *zDestDb, /* Name of database within pDestDb */
67966 sqlite3* pSrcDb, /* Database connection to read from */
67967 const char *zSrcDb /* Name of database within pSrcDb */
67968 ){
@@ -68142,11 +68166,11 @@
68166 }
68167
68168 /*
68169 ** Copy nPage pages from the source b-tree to the destination.
68170 */
68171 SQLITE_API int SQLITE_APICALL sqlite3_backup_step(sqlite3_backup *p, int nPage){
68172 int rc;
68173 int destMode; /* Destination journal mode */
68174 int pgszSrc = 0; /* Source page size */
68175 int pgszDest = 0; /* Destination page size */
68176
@@ -68386,11 +68410,11 @@
68410 }
68411
68412 /*
68413 ** Release all resources associated with an sqlite3_backup* handle.
68414 */
68415 SQLITE_API int SQLITE_APICALL sqlite3_backup_finish(sqlite3_backup *p){
68416 sqlite3_backup **pp; /* Ptr to head of pagers backup list */
68417 sqlite3 *pSrcDb; /* Source database connection */
68418 int rc; /* Value to return */
68419
68420 /* Enter the mutexes */
@@ -68438,11 +68462,11 @@
68462
68463 /*
68464 ** Return the number of pages still to be backed up as of the most recent
68465 ** call to sqlite3_backup_step().
68466 */
68467 SQLITE_API int SQLITE_APICALL sqlite3_backup_remaining(sqlite3_backup *p){
68468 #ifdef SQLITE_ENABLE_API_ARMOR
68469 if( p==0 ){
68470 (void)SQLITE_MISUSE_BKPT;
68471 return 0;
68472 }
@@ -68452,11 +68476,11 @@
68476
68477 /*
68478 ** Return the total number of pages in the source database as of the most
68479 ** recent call to sqlite3_backup_step().
68480 */
68481 SQLITE_API int SQLITE_APICALL sqlite3_backup_pagecount(sqlite3_backup *p){
68482 #ifdef SQLITE_ENABLE_API_ARMOR
68483 if( p==0 ){
68484 (void)SQLITE_MISUSE_BKPT;
68485 return 0;
68486 }
@@ -74906,11 +74930,11 @@
74930 ** execution environment changes in a way that would alter the program
74931 ** that sqlite3_prepare() generates. For example, if new functions or
74932 ** collating sequences are registered or if an authorizer function is
74933 ** added or changed.
74934 */
74935 SQLITE_API int SQLITE_APICALL sqlite3_expired(sqlite3_stmt *pStmt){
74936 Vdbe *p = (Vdbe*)pStmt;
74937 return p==0 || p->expired;
74938 }
74939 #endif
74940
@@ -74975,11 +74999,11 @@
74999 ** machine.
75000 **
75001 ** This routine sets the error code and string returned by
75002 ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
75003 */
75004 SQLITE_API int SQLITE_APICALL sqlite3_finalize(sqlite3_stmt *pStmt){
75005 int rc;
75006 if( pStmt==0 ){
75007 /* IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL
75008 ** pointer is a harmless no-op. */
75009 rc = SQLITE_OK;
@@ -75002,11 +75026,11 @@
75026 ** the prior execution is returned.
75027 **
75028 ** This routine sets the error code and string returned by
75029 ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
75030 */
75031 SQLITE_API int SQLITE_APICALL sqlite3_reset(sqlite3_stmt *pStmt){
75032 int rc;
75033 if( pStmt==0 ){
75034 rc = SQLITE_OK;
75035 }else{
75036 Vdbe *v = (Vdbe*)pStmt;
@@ -75023,11 +75047,11 @@
75047 }
75048
75049 /*
75050 ** Set all the parameters in the compiled SQL statement to NULL.
75051 */
75052 SQLITE_API int SQLITE_APICALL sqlite3_clear_bindings(sqlite3_stmt *pStmt){
75053 int i;
75054 int rc = SQLITE_OK;
75055 Vdbe *p = (Vdbe*)pStmt;
75056 #if SQLITE_THREADSAFE
75057 sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex;
@@ -75047,11 +75071,11 @@
75071
75072 /**************************** sqlite3_value_ *******************************
75073 ** The following routines extract information from a Mem or sqlite3_value
75074 ** structure.
75075 */
75076 SQLITE_API const void *SQLITE_APICALL sqlite3_value_blob(sqlite3_value *pVal){
75077 Mem *p = (Mem*)pVal;
75078 if( p->flags & (MEM_Blob|MEM_Str) ){
75079 if( sqlite3VdbeMemExpandBlob(p)!=SQLITE_OK ){
75080 assert( p->flags==MEM_Null && p->z==0 );
75081 return 0;
@@ -75060,48 +75084,48 @@
75084 return p->n ? p->z : 0;
75085 }else{
75086 return sqlite3_value_text(pVal);
75087 }
75088 }
75089 SQLITE_API int SQLITE_APICALL sqlite3_value_bytes(sqlite3_value *pVal){
75090 return sqlite3ValueBytes(pVal, SQLITE_UTF8);
75091 }
75092 SQLITE_API int SQLITE_APICALL sqlite3_value_bytes16(sqlite3_value *pVal){
75093 return sqlite3ValueBytes(pVal, SQLITE_UTF16NATIVE);
75094 }
75095 SQLITE_API double SQLITE_APICALL sqlite3_value_double(sqlite3_value *pVal){
75096 return sqlite3VdbeRealValue((Mem*)pVal);
75097 }
75098 SQLITE_API int SQLITE_APICALL sqlite3_value_int(sqlite3_value *pVal){
75099 return (int)sqlite3VdbeIntValue((Mem*)pVal);
75100 }
75101 SQLITE_API sqlite_int64 SQLITE_APICALL sqlite3_value_int64(sqlite3_value *pVal){
75102 return sqlite3VdbeIntValue((Mem*)pVal);
75103 }
75104 SQLITE_API unsigned int SQLITE_APICALL sqlite3_value_subtype(sqlite3_value *pVal){
75105 Mem *pMem = (Mem*)pVal;
75106 return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0);
75107 }
75108 SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_value_text(sqlite3_value *pVal){
75109 return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
75110 }
75111 #ifndef SQLITE_OMIT_UTF16
75112 SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16(sqlite3_value* pVal){
75113 return sqlite3ValueText(pVal, SQLITE_UTF16NATIVE);
75114 }
75115 SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16be(sqlite3_value *pVal){
75116 return sqlite3ValueText(pVal, SQLITE_UTF16BE);
75117 }
75118 SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16le(sqlite3_value *pVal){
75119 return sqlite3ValueText(pVal, SQLITE_UTF16LE);
75120 }
75121 #endif /* SQLITE_OMIT_UTF16 */
75122 /* EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five
75123 ** fundamental datatypes: 64-bit signed integer 64-bit IEEE floating
75124 ** point number string BLOB NULL
75125 */
75126 SQLITE_API int SQLITE_APICALL sqlite3_value_type(sqlite3_value* pVal){
75127 static const u8 aType[] = {
75128 SQLITE_BLOB, /* 0x00 */
75129 SQLITE_NULL, /* 0x01 */
75130 SQLITE_TEXT, /* 0x02 */
75131 SQLITE_NULL, /* 0x03 */
@@ -75137,11 +75161,11 @@
75161 return aType[pVal->flags&MEM_AffMask];
75162 }
75163
75164 /* Make a copy of an sqlite3_value object
75165 */
75166 SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_value_dup(const sqlite3_value *pOrig){
75167 sqlite3_value *pNew;
75168 if( pOrig==0 ) return 0;
75169 pNew = sqlite3_malloc( sizeof(*pNew) );
75170 if( pNew==0 ) return 0;
75171 memset(pNew, 0, sizeof(*pNew));
@@ -75160,11 +75184,11 @@
75184 }
75185
75186 /* Destroy an sqlite3_value object previously obtained from
75187 ** sqlite3_value_dup().
75188 */
75189 SQLITE_API void SQLITE_APICALL sqlite3_value_free(sqlite3_value *pOld){
75190 sqlite3ValueFree(pOld);
75191 }
75192
75193
75194 /**************************** sqlite3_result_ *******************************
@@ -75203,21 +75227,21 @@
75227 xDel((void*)p);
75228 }
75229 if( pCtx ) sqlite3_result_error_toobig(pCtx);
75230 return SQLITE_TOOBIG;
75231 }
75232 SQLITE_API void SQLITE_APICALL sqlite3_result_blob(
75233 sqlite3_context *pCtx,
75234 const void *z,
75235 int n,
75236 void (*xDel)(void *)
75237 ){
75238 assert( n>=0 );
75239 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75240 setResultStrOrError(pCtx, z, n, 0, xDel);
75241 }
75242 SQLITE_API void SQLITE_APICALL sqlite3_result_blob64(
75243 sqlite3_context *pCtx,
75244 const void *z,
75245 sqlite3_uint64 n,
75246 void (*xDel)(void *)
75247 ){
@@ -75227,56 +75251,56 @@
75251 (void)invokeValueDestructor(z, xDel, pCtx);
75252 }else{
75253 setResultStrOrError(pCtx, z, (int)n, 0, xDel);
75254 }
75255 }
75256 SQLITE_API void SQLITE_APICALL sqlite3_result_double(sqlite3_context *pCtx, double rVal){
75257 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75258 sqlite3VdbeMemSetDouble(pCtx->pOut, rVal);
75259 }
75260 SQLITE_API void SQLITE_APICALL sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
75261 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75262 pCtx->isError = SQLITE_ERROR;
75263 pCtx->fErrorOrAux = 1;
75264 sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF8, SQLITE_TRANSIENT);
75265 }
75266 #ifndef SQLITE_OMIT_UTF16
75267 SQLITE_API void SQLITE_APICALL sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){
75268 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75269 pCtx->isError = SQLITE_ERROR;
75270 pCtx->fErrorOrAux = 1;
75271 sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF16NATIVE, SQLITE_TRANSIENT);
75272 }
75273 #endif
75274 SQLITE_API void SQLITE_APICALL sqlite3_result_int(sqlite3_context *pCtx, int iVal){
75275 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75276 sqlite3VdbeMemSetInt64(pCtx->pOut, (i64)iVal);
75277 }
75278 SQLITE_API void SQLITE_APICALL sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
75279 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75280 sqlite3VdbeMemSetInt64(pCtx->pOut, iVal);
75281 }
75282 SQLITE_API void SQLITE_APICALL sqlite3_result_null(sqlite3_context *pCtx){
75283 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75284 sqlite3VdbeMemSetNull(pCtx->pOut);
75285 }
75286 SQLITE_API void SQLITE_APICALL sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){
75287 Mem *pOut = pCtx->pOut;
75288 assert( sqlite3_mutex_held(pOut->db->mutex) );
75289 pOut->eSubtype = eSubtype & 0xff;
75290 pOut->flags |= MEM_Subtype;
75291 }
75292 SQLITE_API void SQLITE_APICALL sqlite3_result_text(
75293 sqlite3_context *pCtx,
75294 const char *z,
75295 int n,
75296 void (*xDel)(void *)
75297 ){
75298 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75299 setResultStrOrError(pCtx, z, n, SQLITE_UTF8, xDel);
75300 }
75301 SQLITE_API void SQLITE_APICALL sqlite3_result_text64(
75302 sqlite3_context *pCtx,
75303 const char *z,
75304 sqlite3_uint64 n,
75305 void (*xDel)(void *),
75306 unsigned char enc
@@ -75289,56 +75313,56 @@
75313 }else{
75314 setResultStrOrError(pCtx, z, (int)n, enc, xDel);
75315 }
75316 }
75317 #ifndef SQLITE_OMIT_UTF16
75318 SQLITE_API void SQLITE_APICALL sqlite3_result_text16(
75319 sqlite3_context *pCtx,
75320 const void *z,
75321 int n,
75322 void (*xDel)(void *)
75323 ){
75324 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75325 setResultStrOrError(pCtx, z, n, SQLITE_UTF16NATIVE, xDel);
75326 }
75327 SQLITE_API void SQLITE_APICALL sqlite3_result_text16be(
75328 sqlite3_context *pCtx,
75329 const void *z,
75330 int n,
75331 void (*xDel)(void *)
75332 ){
75333 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75334 setResultStrOrError(pCtx, z, n, SQLITE_UTF16BE, xDel);
75335 }
75336 SQLITE_API void SQLITE_APICALL sqlite3_result_text16le(
75337 sqlite3_context *pCtx,
75338 const void *z,
75339 int n,
75340 void (*xDel)(void *)
75341 ){
75342 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75343 setResultStrOrError(pCtx, z, n, SQLITE_UTF16LE, xDel);
75344 }
75345 #endif /* SQLITE_OMIT_UTF16 */
75346 SQLITE_API void SQLITE_APICALL sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){
75347 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75348 sqlite3VdbeMemCopy(pCtx->pOut, pValue);
75349 }
75350 SQLITE_API void SQLITE_APICALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){
75351 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75352 sqlite3VdbeMemSetZeroBlob(pCtx->pOut, n);
75353 }
75354 SQLITE_API int SQLITE_APICALL sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){
75355 Mem *pOut = pCtx->pOut;
75356 assert( sqlite3_mutex_held(pOut->db->mutex) );
75357 if( n>(u64)pOut->db->aLimit[SQLITE_LIMIT_LENGTH] ){
75358 return SQLITE_TOOBIG;
75359 }
75360 sqlite3VdbeMemSetZeroBlob(pCtx->pOut, (int)n);
75361 return SQLITE_OK;
75362 }
75363 SQLITE_API void SQLITE_APICALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){
75364 pCtx->isError = errCode;
75365 pCtx->fErrorOrAux = 1;
75366 #ifdef SQLITE_DEBUG
75367 if( pCtx->pVdbe ) pCtx->pVdbe->rcApp = errCode;
75368 #endif
@@ -75347,20 +75371,20 @@
75371 SQLITE_UTF8, SQLITE_STATIC);
75372 }
75373 }
75374
75375 /* Force an SQLITE_TOOBIG error. */
75376 SQLITE_API void SQLITE_APICALL sqlite3_result_error_toobig(sqlite3_context *pCtx){
75377 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75378 pCtx->isError = SQLITE_TOOBIG;
75379 pCtx->fErrorOrAux = 1;
75380 sqlite3VdbeMemSetStr(pCtx->pOut, "string or blob too big", -1,
75381 SQLITE_UTF8, SQLITE_STATIC);
75382 }
75383
75384 /* An SQLITE_NOMEM error. */
75385 SQLITE_API void SQLITE_APICALL sqlite3_result_error_nomem(sqlite3_context *pCtx){
75386 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75387 sqlite3VdbeMemSetNull(pCtx->pOut);
75388 pCtx->isError = SQLITE_NOMEM_BKPT;
75389 pCtx->fErrorOrAux = 1;
75390 sqlite3OomFault(pCtx->pOut->db);
@@ -75528,11 +75552,11 @@
75552 /*
75553 ** This is the top-level implementation of sqlite3_step(). Call
75554 ** sqlite3Step() to do most of the work. If a schema error occurs,
75555 ** call sqlite3Reprepare() and try again.
75556 */
75557 SQLITE_API int SQLITE_APICALL sqlite3_step(sqlite3_stmt *pStmt){
75558 int rc = SQLITE_OK; /* Result from sqlite3Step() */
75559 int rc2 = SQLITE_OK; /* Result from sqlite3Reprepare() */
75560 Vdbe *v = (Vdbe*)pStmt; /* the prepared statement */
75561 int cnt = 0; /* Counter to prevent infinite loop of reprepares */
75562 sqlite3 *db; /* The database connection */
@@ -75579,11 +75603,11 @@
75603
75604 /*
75605 ** Extract the user data from a sqlite3_context structure and return a
75606 ** pointer to it.
75607 */
75608 SQLITE_API void *SQLITE_APICALL sqlite3_user_data(sqlite3_context *p){
75609 assert( p && p->pFunc );
75610 return p->pFunc->pUserData;
75611 }
75612
75613 /*
@@ -75594,11 +75618,11 @@
75618 ** returns a copy of the pointer to the database connection (the 1st
75619 ** parameter) of the sqlite3_create_function() and
75620 ** sqlite3_create_function16() routines that originally registered the
75621 ** application defined function.
75622 */
75623 SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_context_db_handle(sqlite3_context *p){
75624 assert( p && p->pOut );
75625 return p->pOut->db;
75626 }
75627
75628 /*
@@ -75670,11 +75694,11 @@
75694 /*
75695 ** Allocate or return the aggregate context for a user function. A new
75696 ** context is allocated on the first call. Subsequent calls return the
75697 ** same context that was returned on prior calls.
75698 */
75699 SQLITE_API void *SQLITE_APICALL sqlite3_aggregate_context(sqlite3_context *p, int nByte){
75700 assert( p && p->pFunc && p->pFunc->xFinalize );
75701 assert( sqlite3_mutex_held(p->pOut->db->mutex) );
75702 testcase( nByte<0 );
75703 if( (p->pMem->flags & MEM_Agg)==0 ){
75704 return createAggContext(p, nByte);
@@ -75685,11 +75709,11 @@
75709
75710 /*
75711 ** Return the auxiliary data pointer, if any, for the iArg'th argument to
75712 ** the user-function defined by pCtx.
75713 */
75714 SQLITE_API void *SQLITE_APICALL sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
75715 AuxData *pAuxData;
75716
75717 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75718 #if SQLITE_ENABLE_STAT3_OR_STAT4
75719 if( pCtx->pVdbe==0 ) return 0;
@@ -75706,11 +75730,11 @@
75730 /*
75731 ** Set the auxiliary data pointer and delete function, for the iArg'th
75732 ** argument to the user-function defined by pCtx. Any previous value is
75733 ** deleted by calling the delete function specified when it was set.
75734 */
75735 SQLITE_API void SQLITE_APICALL sqlite3_set_auxdata(
75736 sqlite3_context *pCtx,
75737 int iArg,
75738 void *pAux,
75739 void (*xDelete)(void*)
75740 ){
@@ -75761,29 +75785,29 @@
75785 ** This function is deprecated. Do not use it for new code. It is
75786 ** provide only to avoid breaking legacy code. New aggregate function
75787 ** implementations should keep their own counts within their aggregate
75788 ** context.
75789 */
75790 SQLITE_API int SQLITE_APICALL sqlite3_aggregate_count(sqlite3_context *p){
75791 assert( p && p->pMem && p->pFunc && p->pFunc->xFinalize );
75792 return p->pMem->n;
75793 }
75794 #endif
75795
75796 /*
75797 ** Return the number of columns in the result set for the statement pStmt.
75798 */
75799 SQLITE_API int SQLITE_APICALL sqlite3_column_count(sqlite3_stmt *pStmt){
75800 Vdbe *pVm = (Vdbe *)pStmt;
75801 return pVm ? pVm->nResColumn : 0;
75802 }
75803
75804 /*
75805 ** Return the number of values available from the current row of the
75806 ** currently executing statement pStmt.
75807 */
75808 SQLITE_API int SQLITE_APICALL sqlite3_data_count(sqlite3_stmt *pStmt){
75809 Vdbe *pVm = (Vdbe *)pStmt;
75810 if( pVm==0 || pVm->pResultSet==0 ) return 0;
75811 return pVm->nResColumn;
75812 }
75813
@@ -75882,67 +75906,67 @@
75906
75907 /**************************** sqlite3_column_ *******************************
75908 ** The following routines are used to access elements of the current row
75909 ** in the result set.
75910 */
75911 SQLITE_API const void *SQLITE_APICALL sqlite3_column_blob(sqlite3_stmt *pStmt, int i){
75912 const void *val;
75913 val = sqlite3_value_blob( columnMem(pStmt,i) );
75914 /* Even though there is no encoding conversion, value_blob() might
75915 ** need to call malloc() to expand the result of a zeroblob()
75916 ** expression.
75917 */
75918 columnMallocFailure(pStmt);
75919 return val;
75920 }
75921 SQLITE_API int SQLITE_APICALL sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){
75922 int val = sqlite3_value_bytes( columnMem(pStmt,i) );
75923 columnMallocFailure(pStmt);
75924 return val;
75925 }
75926 SQLITE_API int SQLITE_APICALL sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){
75927 int val = sqlite3_value_bytes16( columnMem(pStmt,i) );
75928 columnMallocFailure(pStmt);
75929 return val;
75930 }
75931 SQLITE_API double SQLITE_APICALL sqlite3_column_double(sqlite3_stmt *pStmt, int i){
75932 double val = sqlite3_value_double( columnMem(pStmt,i) );
75933 columnMallocFailure(pStmt);
75934 return val;
75935 }
75936 SQLITE_API int SQLITE_APICALL sqlite3_column_int(sqlite3_stmt *pStmt, int i){
75937 int val = sqlite3_value_int( columnMem(pStmt,i) );
75938 columnMallocFailure(pStmt);
75939 return val;
75940 }
75941 SQLITE_API sqlite_int64 SQLITE_APICALL sqlite3_column_int64(sqlite3_stmt *pStmt, int i){
75942 sqlite_int64 val = sqlite3_value_int64( columnMem(pStmt,i) );
75943 columnMallocFailure(pStmt);
75944 return val;
75945 }
75946 SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_column_text(sqlite3_stmt *pStmt, int i){
75947 const unsigned char *val = sqlite3_value_text( columnMem(pStmt,i) );
75948 columnMallocFailure(pStmt);
75949 return val;
75950 }
75951 SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_column_value(sqlite3_stmt *pStmt, int i){
75952 Mem *pOut = columnMem(pStmt, i);
75953 if( pOut->flags&MEM_Static ){
75954 pOut->flags &= ~MEM_Static;
75955 pOut->flags |= MEM_Ephem;
75956 }
75957 columnMallocFailure(pStmt);
75958 return (sqlite3_value *)pOut;
75959 }
75960 #ifndef SQLITE_OMIT_UTF16
75961 SQLITE_API const void *SQLITE_APICALL sqlite3_column_text16(sqlite3_stmt *pStmt, int i){
75962 const void *val = sqlite3_value_text16( columnMem(pStmt,i) );
75963 columnMallocFailure(pStmt);
75964 return val;
75965 }
75966 #endif /* SQLITE_OMIT_UTF16 */
75967 SQLITE_API int SQLITE_APICALL sqlite3_column_type(sqlite3_stmt *pStmt, int i){
75968 int iType = sqlite3_value_type( columnMem(pStmt,i) );
75969 columnMallocFailure(pStmt);
75970 return iType;
75971 }
75972
@@ -76002,16 +76026,16 @@
76026
76027 /*
76028 ** Return the name of the Nth column of the result set returned by SQL
76029 ** statement pStmt.
76030 */
76031 SQLITE_API const char *SQLITE_APICALL sqlite3_column_name(sqlite3_stmt *pStmt, int N){
76032 return columnName(
76033 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_NAME);
76034 }
76035 #ifndef SQLITE_OMIT_UTF16
76036 SQLITE_API const void *SQLITE_APICALL sqlite3_column_name16(sqlite3_stmt *pStmt, int N){
76037 return columnName(
76038 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_NAME);
76039 }
76040 #endif
76041
@@ -76027,16 +76051,16 @@
76051 #ifndef SQLITE_OMIT_DECLTYPE
76052 /*
76053 ** Return the column declaration type (if applicable) of the 'i'th column
76054 ** of the result set of SQL statement pStmt.
76055 */
76056 SQLITE_API const char *SQLITE_APICALL sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){
76057 return columnName(
76058 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DECLTYPE);
76059 }
76060 #ifndef SQLITE_OMIT_UTF16
76061 SQLITE_API const void *SQLITE_APICALL sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){
76062 return columnName(
76063 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DECLTYPE);
76064 }
76065 #endif /* SQLITE_OMIT_UTF16 */
76066 #endif /* SQLITE_OMIT_DECLTYPE */
@@ -76045,16 +76069,16 @@
76069 /*
76070 ** Return the name of the database from which a result column derives.
76071 ** NULL is returned if the result column is an expression or constant or
76072 ** anything else which is not an unambiguous reference to a database column.
76073 */
76074 SQLITE_API const char *SQLITE_APICALL sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){
76075 return columnName(
76076 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DATABASE);
76077 }
76078 #ifndef SQLITE_OMIT_UTF16
76079 SQLITE_API const void *SQLITE_APICALL sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){
76080 return columnName(
76081 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DATABASE);
76082 }
76083 #endif /* SQLITE_OMIT_UTF16 */
76084
@@ -76061,16 +76085,16 @@
76085 /*
76086 ** Return the name of the table from which a result column derives.
76087 ** NULL is returned if the result column is an expression or constant or
76088 ** anything else which is not an unambiguous reference to a database column.
76089 */
76090 SQLITE_API const char *SQLITE_APICALL sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){
76091 return columnName(
76092 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_TABLE);
76093 }
76094 #ifndef SQLITE_OMIT_UTF16
76095 SQLITE_API const void *SQLITE_APICALL sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){
76096 return columnName(
76097 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_TABLE);
76098 }
76099 #endif /* SQLITE_OMIT_UTF16 */
76100
@@ -76077,16 +76101,16 @@
76101 /*
76102 ** Return the name of the table column from which a result column derives.
76103 ** NULL is returned if the result column is an expression or constant or
76104 ** anything else which is not an unambiguous reference to a database column.
76105 */
76106 SQLITE_API const char *SQLITE_APICALL sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){
76107 return columnName(
76108 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_COLUMN);
76109 }
76110 #ifndef SQLITE_OMIT_UTF16
76111 SQLITE_API const void *SQLITE_APICALL sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){
76112 return columnName(
76113 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_COLUMN);
76114 }
76115 #endif /* SQLITE_OMIT_UTF16 */
76116 #endif /* SQLITE_ENABLE_COLUMN_METADATA */
@@ -76183,11 +76207,11 @@
76207
76208
76209 /*
76210 ** Bind a blob value to an SQL statement variable.
76211 */
76212 SQLITE_API int SQLITE_APICALL sqlite3_bind_blob(
76213 sqlite3_stmt *pStmt,
76214 int i,
76215 const void *zData,
76216 int nData,
76217 void (*xDel)(void*)
@@ -76195,11 +76219,11 @@
76219 #ifdef SQLITE_ENABLE_API_ARMOR
76220 if( nData<0 ) return SQLITE_MISUSE_BKPT;
76221 #endif
76222 return bindText(pStmt, i, zData, nData, xDel, 0);
76223 }
76224 SQLITE_API int SQLITE_APICALL sqlite3_bind_blob64(
76225 sqlite3_stmt *pStmt,
76226 int i,
76227 const void *zData,
76228 sqlite3_uint64 nData,
76229 void (*xDel)(void*)
@@ -76209,52 +76233,52 @@
76233 return invokeValueDestructor(zData, xDel, 0);
76234 }else{
76235 return bindText(pStmt, i, zData, (int)nData, xDel, 0);
76236 }
76237 }
76238 SQLITE_API int SQLITE_APICALL sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
76239 int rc;
76240 Vdbe *p = (Vdbe *)pStmt;
76241 rc = vdbeUnbind(p, i);
76242 if( rc==SQLITE_OK ){
76243 sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue);
76244 sqlite3_mutex_leave(p->db->mutex);
76245 }
76246 return rc;
76247 }
76248 SQLITE_API int SQLITE_APICALL sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){
76249 return sqlite3_bind_int64(p, i, (i64)iValue);
76250 }
76251 SQLITE_API int SQLITE_APICALL sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
76252 int rc;
76253 Vdbe *p = (Vdbe *)pStmt;
76254 rc = vdbeUnbind(p, i);
76255 if( rc==SQLITE_OK ){
76256 sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue);
76257 sqlite3_mutex_leave(p->db->mutex);
76258 }
76259 return rc;
76260 }
76261 SQLITE_API int SQLITE_APICALL sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
76262 int rc;
76263 Vdbe *p = (Vdbe*)pStmt;
76264 rc = vdbeUnbind(p, i);
76265 if( rc==SQLITE_OK ){
76266 sqlite3_mutex_leave(p->db->mutex);
76267 }
76268 return rc;
76269 }
76270 SQLITE_API int SQLITE_APICALL sqlite3_bind_text(
76271 sqlite3_stmt *pStmt,
76272 int i,
76273 const char *zData,
76274 int nData,
76275 void (*xDel)(void*)
76276 ){
76277 return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8);
76278 }
76279 SQLITE_API int SQLITE_APICALL sqlite3_bind_text64(
76280 sqlite3_stmt *pStmt,
76281 int i,
76282 const char *zData,
76283 sqlite3_uint64 nData,
76284 void (*xDel)(void*),
@@ -76267,21 +76291,21 @@
76291 if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE;
76292 return bindText(pStmt, i, zData, (int)nData, xDel, enc);
76293 }
76294 }
76295 #ifndef SQLITE_OMIT_UTF16
76296 SQLITE_API int SQLITE_APICALL sqlite3_bind_text16(
76297 sqlite3_stmt *pStmt,
76298 int i,
76299 const void *zData,
76300 int nData,
76301 void (*xDel)(void*)
76302 ){
76303 return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE);
76304 }
76305 #endif /* SQLITE_OMIT_UTF16 */
76306 SQLITE_API int SQLITE_APICALL sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
76307 int rc;
76308 switch( sqlite3_value_type((sqlite3_value*)pValue) ){
76309 case SQLITE_INTEGER: {
76310 rc = sqlite3_bind_int64(pStmt, i, pValue->u.i);
76311 break;
@@ -76308,21 +76332,21 @@
76332 break;
76333 }
76334 }
76335 return rc;
76336 }
76337 SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
76338 int rc;
76339 Vdbe *p = (Vdbe *)pStmt;
76340 rc = vdbeUnbind(p, i);
76341 if( rc==SQLITE_OK ){
76342 sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n);
76343 sqlite3_mutex_leave(p->db->mutex);
76344 }
76345 return rc;
76346 }
76347 SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){
76348 int rc;
76349 Vdbe *p = (Vdbe *)pStmt;
76350 sqlite3_mutex_enter(p->db->mutex);
76351 if( n>(u64)p->db->aLimit[SQLITE_LIMIT_LENGTH] ){
76352 rc = SQLITE_TOOBIG;
@@ -76337,11 +76361,11 @@
76361
76362 /*
76363 ** Return the number of wildcards that can be potentially bound to.
76364 ** This routine is added to support DBD::SQLite.
76365 */
76366 SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
76367 Vdbe *p = (Vdbe*)pStmt;
76368 return p ? p->nVar : 0;
76369 }
76370
76371 /*
@@ -76348,11 +76372,11 @@
76372 ** Return the name of a wildcard parameter. Return NULL if the index
76373 ** is out of range or if the wildcard is unnamed.
76374 **
76375 ** The result is always UTF-8.
76376 */
76377 SQLITE_API const char *SQLITE_APICALL sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){
76378 Vdbe *p = (Vdbe*)pStmt;
76379 if( p==0 || i<1 || i>p->nzVar ){
76380 return 0;
76381 }
76382 return p->azVar[i-1];
@@ -76376,11 +76400,11 @@
76400 }
76401 }
76402 }
76403 return 0;
76404 }
76405 SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
76406 return sqlite3VdbeParameterIndex((Vdbe*)pStmt, zName, sqlite3Strlen30(zName));
76407 }
76408
76409 /*
76410 ** Transfer all bindings from the first statement over to the second.
@@ -76410,11 +76434,11 @@
76434 **
76435 ** If the two statements contain a different number of bindings, then
76436 ** an SQLITE_ERROR is returned. Nothing else can go wrong, so otherwise
76437 ** SQLITE_OK is returned.
76438 */
76439 SQLITE_API int SQLITE_APICALL sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
76440 Vdbe *pFrom = (Vdbe*)pFromStmt;
76441 Vdbe *pTo = (Vdbe*)pToStmt;
76442 if( pFrom->nVar!=pTo->nVar ){
76443 return SQLITE_ERROR;
76444 }
@@ -76432,26 +76456,26 @@
76456 ** Return the sqlite3* database handle to which the prepared statement given
76457 ** in the argument belongs. This is the same database handle that was
76458 ** the first argument to the sqlite3_prepare() that was used to create
76459 ** the statement in the first place.
76460 */
76461 SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_db_handle(sqlite3_stmt *pStmt){
76462 return pStmt ? ((Vdbe*)pStmt)->db : 0;
76463 }
76464
76465 /*
76466 ** Return true if the prepared statement is guaranteed to not modify the
76467 ** database.
76468 */
76469 SQLITE_API int SQLITE_APICALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt){
76470 return pStmt ? ((Vdbe*)pStmt)->readOnly : 1;
76471 }
76472
76473 /*
76474 ** Return true if the prepared statement is in need of being reset.
76475 */
76476 SQLITE_API int SQLITE_APICALL sqlite3_stmt_busy(sqlite3_stmt *pStmt){
76477 Vdbe *v = (Vdbe*)pStmt;
76478 return v!=0 && v->pc>=0 && v->magic==VDBE_MAGIC_RUN;
76479 }
76480
76481 /*
@@ -76458,11 +76482,11 @@
76482 ** Return a pointer to the next prepared statement after pStmt associated
76483 ** with database connection pDb. If pStmt is NULL, return the first
76484 ** prepared statement for the database connection. Return NULL if there
76485 ** are no more.
76486 */
76487 SQLITE_API sqlite3_stmt *SQLITE_APICALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){
76488 sqlite3_stmt *pNext;
76489 #ifdef SQLITE_ENABLE_API_ARMOR
76490 if( !sqlite3SafetyCheckOk(pDb) ){
76491 (void)SQLITE_MISUSE_BKPT;
76492 return 0;
@@ -76479,11 +76503,11 @@
76503 }
76504
76505 /*
76506 ** Return the value of a status counter for a prepared statement
76507 */
76508 SQLITE_API int SQLITE_APICALL sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){
76509 Vdbe *pVdbe = (Vdbe*)pStmt;
76510 u32 v;
76511 #ifdef SQLITE_ENABLE_API_ARMOR
76512 if( !pStmt ){
76513 (void)SQLITE_MISUSE_BKPT;
@@ -76496,11 +76520,11 @@
76520 }
76521
76522 /*
76523 ** Return the SQL associated with a prepared statement
76524 */
76525 SQLITE_API const char *SQLITE_APICALL sqlite3_sql(sqlite3_stmt *pStmt){
76526 Vdbe *p = (Vdbe *)pStmt;
76527 return p ? p->zSql : 0;
76528 }
76529
76530 /*
@@ -76510,11 +76534,11 @@
76534 ** freeing the returned string by passing it to sqlite3_free().
76535 **
76536 ** The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of
76537 ** expanded bound parameters.
76538 */
76539 SQLITE_API char *SQLITE_APICALL sqlite3_expanded_sql(sqlite3_stmt *pStmt){
76540 #ifdef SQLITE_OMIT_TRACE
76541 return 0;
76542 #else
76543 char *z = 0;
76544 const char *zSql = sqlite3_sql(pStmt);
@@ -76552,11 +76576,11 @@
76576
76577 /*
76578 ** This function is called from within a pre-update callback to retrieve
76579 ** a field of the row currently being updated or deleted.
76580 */
76581 SQLITE_API int SQLITE_APICALL sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
76582 PreUpdate *p = db->pPreUpdate;
76583 int rc = SQLITE_OK;
76584
76585 /* Test that this call is being made from within an SQLITE_DELETE or
76586 ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */
@@ -76607,11 +76631,11 @@
76631 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
76632 /*
76633 ** This function is called from within a pre-update callback to retrieve
76634 ** the number of columns in the row being updated, deleted or inserted.
76635 */
76636 SQLITE_API int SQLITE_APICALL sqlite3_preupdate_count(sqlite3 *db){
76637 PreUpdate *p = db->pPreUpdate;
76638 return (p ? p->keyinfo.nField : 0);
76639 }
76640 #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
76641
@@ -76625,11 +76649,11 @@
76649 ** top-level trigger etc.).
76650 **
76651 ** For the purposes of the previous paragraph, a foreign key CASCADE, SET NULL
76652 ** or SET DEFAULT action is considered a trigger.
76653 */
76654 SQLITE_API int SQLITE_APICALL sqlite3_preupdate_depth(sqlite3 *db){
76655 PreUpdate *p = db->pPreUpdate;
76656 return (p ? p->v->nFrame : 0);
76657 }
76658 #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
76659
@@ -76636,11 +76660,11 @@
76660 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
76661 /*
76662 ** This function is called from within a pre-update callback to retrieve
76663 ** a field of the row currently being updated or inserted.
76664 */
76665 SQLITE_API int SQLITE_APICALL sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
76666 PreUpdate *p = db->pPreUpdate;
76667 int rc = SQLITE_OK;
76668 Mem *pMem;
76669
76670 if( !p || p->op==SQLITE_DELETE ){
@@ -76710,11 +76734,11 @@
76734
76735 #ifdef SQLITE_ENABLE_STMT_SCANSTATUS
76736 /*
76737 ** Return status data for a single loop within query pStmt.
76738 */
76739 SQLITE_API int SQLITE_APICALL sqlite3_stmt_scanstatus(
76740 sqlite3_stmt *pStmt, /* Prepared statement being queried */
76741 int idx, /* Index of loop to report on */
76742 int iScanStatusOp, /* Which metric to return */
76743 void *pOut /* OUT: Write the answer here */
76744 ){
@@ -76769,11 +76793,11 @@
76793 }
76794
76795 /*
76796 ** Zero all counters associated with the sqlite3_stmt_scanstatus() data.
76797 */
76798 SQLITE_API void SQLITE_APICALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){
76799 Vdbe *p = (Vdbe*)pStmt;
76800 memset(p->anExec, 0, p->nOp * sizeof(i64));
76801 }
76802 #endif /* SQLITE_ENABLE_STMT_SCANSTATUS */
76803
@@ -77296,11 +77320,11 @@
77320 ** Try to convert the type of a function argument or a result column
77321 ** into a numeric representation. Use either INTEGER or REAL whichever
77322 ** is appropriate. But only do the conversion if it is possible without
77323 ** loss of information and return the revised type of the argument.
77324 */
77325 SQLITE_API int SQLITE_APICALL sqlite3_value_numeric_type(sqlite3_value *pVal){
77326 int eType = sqlite3_value_type(pVal);
77327 if( eType==SQLITE_TEXT ){
77328 Mem *pMem = (Mem*)pVal;
77329 applyNumericAffinity(pMem, 0);
77330 eType = sqlite3_value_type(pVal);
@@ -84148,11 +84172,11 @@
84172 }
84173
84174 /*
84175 ** Open a blob handle.
84176 */
84177 SQLITE_API int SQLITE_APICALL sqlite3_blob_open(
84178 sqlite3* db, /* The database connection */
84179 const char *zDb, /* The attached database containing the blob */
84180 const char *zTable, /* The table containing the blob */
84181 const char *zColumn, /* The column containing the blob */
84182 sqlite_int64 iRow, /* The row containing the glob */
@@ -84389,11 +84413,11 @@
84413
84414 /*
84415 ** Close a blob handle that was previously created using
84416 ** sqlite3_blob_open().
84417 */
84418 SQLITE_API int SQLITE_APICALL sqlite3_blob_close(sqlite3_blob *pBlob){
84419 Incrblob *p = (Incrblob *)pBlob;
84420 int rc;
84421 sqlite3 *db;
84422
84423 if( p ){
@@ -84482,28 +84506,28 @@
84506 }
84507
84508 /*
84509 ** Read data from a blob handle.
84510 */
84511 SQLITE_API int SQLITE_APICALL sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){
84512 return blobReadWrite(pBlob, z, n, iOffset, sqlite3BtreeData);
84513 }
84514
84515 /*
84516 ** Write data to a blob handle.
84517 */
84518 SQLITE_API int SQLITE_APICALL sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){
84519 return blobReadWrite(pBlob, (void *)z, n, iOffset, sqlite3BtreePutData);
84520 }
84521
84522 /*
84523 ** Query a blob handle for the size of the data.
84524 **
84525 ** The Incrblob.nByte field is fixed for the lifetime of the Incrblob
84526 ** so no mutex is required for access.
84527 */
84528 SQLITE_API int SQLITE_APICALL sqlite3_blob_bytes(sqlite3_blob *pBlob){
84529 Incrblob *p = (Incrblob *)pBlob;
84530 return (p && p->pStmt) ? p->nByte : 0;
84531 }
84532
84533 /*
@@ -84514,11 +84538,11 @@
84538 ** contain a blob or text value, then an error code is returned and the
84539 ** database handle error code and message set. If this happens, then all
84540 ** subsequent calls to sqlite3_blob_xxx() functions (except blob_close())
84541 ** immediately return SQLITE_ABORT.
84542 */
84543 SQLITE_API int SQLITE_APICALL sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){
84544 int rc;
84545 Incrblob *p = (Incrblob *)pBlob;
84546 sqlite3 *db;
84547
84548 if( p==0 ) return SQLITE_MISUSE_BKPT;
@@ -97118,11 +97142,11 @@
97142 ** and attempts to write the column will be ignored.
97143 **
97144 ** Setting the auth function to NULL disables this hook. The default
97145 ** setting of the auth function is NULL.
97146 */
97147 SQLITE_API int SQLITE_APICALL sqlite3_set_authorizer(
97148 sqlite3 *db,
97149 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
97150 void *pArg
97151 ){
97152 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -97162,10 +97186,11 @@
97186 ){
97187 sqlite3 *db = pParse->db; /* Database handle */
97188 char *zDb = db->aDb[iDb].zName; /* Name of attached database */
97189 int rc; /* Auth callback return code */
97190
97191 if( db->init.busy ) return SQLITE_OK;
97192 rc = db->xAuth(db->pAuthArg, SQLITE_READ, zTab,zCol,zDb,pParse->zAuthContext
97193 #ifdef SQLITE_USER_AUTHENTICATION
97194 ,db->auth.zAuthUser
97195 #endif
97196 );
@@ -103880,18 +103905,18 @@
103905 }
103906
103907 /*
103908 ** The sqlite3_strglob() interface.
103909 */
103910 SQLITE_API int SQLITE_APICALL sqlite3_strglob(const char *zGlobPattern, const char *zString){
103911 return patternCompare((u8*)zGlobPattern, (u8*)zString, &globInfo, '[')==0;
103912 }
103913
103914 /*
103915 ** The sqlite3_strlike() interface.
103916 */
103917 SQLITE_API int SQLITE_APICALL sqlite3_strlike(const char *zPattern, const char *zStr, unsigned int esc){
103918 return patternCompare((u8*)zPattern, (u8*)zStr, &likeInfoNorm, esc)==0;
103919 }
103920
103921 /*
103922 ** Count the number of times that the LIKE operator (or GLOB which is
@@ -108583,11 +108608,11 @@
108608 ** If the SQL is a query, then for each row in the query result
108609 ** the xCallback() function is called. pArg becomes the first
108610 ** argument to xCallback(). If xCallback=NULL then no callback
108611 ** is invoked, even for queries.
108612 */
108613 SQLITE_API int SQLITE_APICALL sqlite3_exec(
108614 sqlite3 *db, /* The database on which the SQL executes */
108615 const char *zSql, /* The SQL to be executed */
108616 sqlite3_callback xCallback, /* Invoke this callback routine */
108617 void *pArg, /* First argument to xCallback() */
108618 char **pzErrMsg /* Write error messages here */
@@ -108974,16 +108999,17 @@
108999 sqlite3_int64 (*uri_int64)(const char*,const char*,sqlite3_int64);
109000 const char *(*uri_parameter)(const char*,const char*);
109001 char *(*vsnprintf)(int,char*,const char*,va_list);
109002 int (*wal_checkpoint_v2)(sqlite3*,const char*,int,int*,int*);
109003 /* Version 3.8.7 and later */
109004 int (*auto_extension)(int(*)(sqlite3*,char**,const sqlite3_api_routines*));
109005 int (*bind_blob64)(sqlite3_stmt*,int,const void*,sqlite3_uint64,
109006 void(*)(void*));
109007 int (*bind_text64)(sqlite3_stmt*,int,const char*,sqlite3_uint64,
109008 void(*)(void*),unsigned char);
109009 int (*cancel_auto_extension)(int(*)(sqlite3*,char**,
109010 const sqlite3_api_routines*));
109011 int (*load_extension)(sqlite3*,const char*,const char*,char**);
109012 void *(*malloc64)(sqlite3_uint64);
109013 sqlite3_uint64 (*msize)(void*);
109014 void *(*realloc64)(void*,sqlite3_uint64);
109015 void (*reset_auto_extension)(void);
@@ -109008,10 +109034,20 @@
109034 int (*system_errno)(sqlite3*);
109035 /* Version 3.14.0 and later */
109036 int (*trace_v2)(sqlite3*,unsigned,int(*)(unsigned,void*,void*,void*),void*);
109037 char *(*expanded_sql)(sqlite3_stmt*);
109038 };
109039
109040 /*
109041 ** This is the function signature used for all extension entry points. It
109042 ** is also defined in the file "loadext.c".
109043 */
109044 typedef int (*sqlite3_loadext_entry)(
109045 sqlite3 *db, /* Handle to the database. */
109046 char **pzErrMsg, /* Used to set error string on failure. */
109047 const sqlite3_api_routines *pThunk /* Extension API function pointers. */
109048 );
109049
109050 /*
109051 ** The following macros redefine the API routines so that they are
109052 ** redirected through the global sqlite3_api structure.
109053 **
@@ -109280,10 +109316,18 @@
109316 /************** Continuing where we left off in loadext.c ********************/
109317 /* #include "sqliteInt.h" */
109318 /* #include <string.h> */
109319
109320 #ifndef SQLITE_OMIT_LOAD_EXTENSION
109321 /*
109322 ** This is the function signature used for all extension entry points.
109323 */
109324 typedef int (*sqlite3_loadext_entry)(
109325 sqlite3 *db, /* Handle to the database. */
109326 char **pzErrMsg, /* Used to set error string on failure. */
109327 const sqlite3_api_routines *pThunk /* Extension API function pointers. */
109328 );
109329
109330 /*
109331 ** Some API routines are omitted when various features are
109332 ** excluded from a build of SQLite. Substitute a NULL pointer
109333 ** for any missing APIs.
@@ -109369,10 +109413,14 @@
109413 #define sqlite3_blob_open 0
109414 #define sqlite3_blob_read 0
109415 #define sqlite3_blob_write 0
109416 #define sqlite3_blob_reopen 0
109417 #endif
109418
109419 #if defined(SQLITE_OMIT_TRACE)
109420 # define sqlite3_trace_v2 0
109421 #endif
109422
109423 /*
109424 ** The following structure contains pointers to all SQLite API routines.
109425 ** A pointer to this structure is passed into extensions when they are
109426 ** loaded so that the extension can make calls back into the SQLite
@@ -109675,11 +109723,14 @@
109723 /* Version 3.10.0 and later */
109724 sqlite3_status64,
109725 sqlite3_strlike,
109726 sqlite3_db_cacheflush,
109727 /* Version 3.12.0 and later */
109728 sqlite3_system_errno,
109729 /* Version 3.14.0 and later */
109730 sqlite3_trace_v2,
109731 sqlite3_expanded_sql
109732 };
109733
109734 /*
109735 ** Attempt to load an SQLite extension library contained in the file
109736 ** zFile. The entry point is zProc. zProc may be 0 in which case a
@@ -109698,11 +109749,11 @@
109749 const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */
109750 char **pzErrMsg /* Put error message here if not 0 */
109751 ){
109752 sqlite3_vfs *pVfs = db->pVfs;
109753 void *handle;
109754 sqlite3_loadext_entry xInit;
109755 char *zErrmsg = 0;
109756 const char *zEntry;
109757 char *zAltEntry = 0;
109758 void **aHandle;
109759 u64 nMsg = 300 + sqlite3Strlen30(zFile);
@@ -109757,12 +109808,11 @@
109808 sqlite3OsDlError(pVfs, nMsg-1, zErrmsg);
109809 }
109810 }
109811 return SQLITE_ERROR;
109812 }
109813 xInit = (sqlite3_loadext_entry)sqlite3OsDlSym(pVfs, handle, zEntry);
 
109814
109815 /* If no entry point was specified and the default legacy
109816 ** entry point name "sqlite3_extension_init" was not found, then
109817 ** construct an entry point name "sqlite3_X_init" where the X is
109818 ** replaced by the lowercase value of every ASCII alphabetic
@@ -109790,12 +109840,11 @@
109840 zAltEntry[iEntry++] = (char)sqlite3UpperToLower[(unsigned)c];
109841 }
109842 }
109843 memcpy(zAltEntry+iEntry, "_init", 6);
109844 zEntry = zAltEntry;
109845 xInit = (sqlite3_loadext_entry)sqlite3OsDlSym(pVfs, handle, zEntry);
 
109846 }
109847 if( xInit==0 ){
109848 if( pzErrMsg ){
109849 nMsg += sqlite3Strlen30(zEntry);
109850 *pzErrMsg = zErrmsg = sqlite3_malloc64(nMsg);
@@ -109833,11 +109882,11 @@
109882 db->aExtension = aHandle;
109883
109884 db->aExtension[db->nExtension++] = handle;
109885 return SQLITE_OK;
109886 }
109887 SQLITE_API int SQLITE_APICALL sqlite3_load_extension(
109888 sqlite3 *db, /* Load the extension into this database connection */
109889 const char *zFile, /* Name of the shared library containing extension */
109890 const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */
109891 char **pzErrMsg /* Put error message here if not 0 */
109892 ){
@@ -109864,11 +109913,11 @@
109913
109914 /*
109915 ** Enable or disable extension loading. Extension loading is disabled by
109916 ** default so as not to open security holes in older applications.
109917 */
109918 SQLITE_API int SQLITE_APICALL sqlite3_enable_load_extension(sqlite3 *db, int onoff){
109919 sqlite3_mutex_enter(db->mutex);
109920 if( onoff ){
109921 db->flags |= SQLITE_LoadExtension|SQLITE_LoadExtFunc;
109922 }else{
109923 db->flags &= ~(SQLITE_LoadExtension|SQLITE_LoadExtFunc);
@@ -109921,11 +109970,13 @@
109970
109971 /*
109972 ** Register a statically linked extension that is automatically
109973 ** loaded by every new database connection.
109974 */
109975 SQLITE_API int SQLITE_APICALL sqlite3_auto_extension(
109976 int (*xInit)(sqlite3 *, char **, const sqlite3_api_routines *)
109977 ){
109978 int rc = SQLITE_OK;
109979 #ifndef SQLITE_OMIT_AUTOINIT
109980 rc = sqlite3_initialize();
109981 if( rc ){
109982 return rc;
@@ -109937,21 +109988,21 @@
109988 sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
109989 #endif
109990 wsdAutoextInit;
109991 sqlite3_mutex_enter(mutex);
109992 for(i=0; i<wsdAutoext.nExt; i++){
109993 if( wsdAutoext.aExt[i]==(void*)xInit ) break;
109994 }
109995 if( i==wsdAutoext.nExt ){
109996 u64 nByte = (wsdAutoext.nExt+1)*sizeof(wsdAutoext.aExt[0]);
109997 void (**aNew)(void);
109998 aNew = sqlite3_realloc64(wsdAutoext.aExt, nByte);
109999 if( aNew==0 ){
110000 rc = SQLITE_NOMEM_BKPT;
110001 }else{
110002 wsdAutoext.aExt = aNew;
110003 wsdAutoext.aExt[wsdAutoext.nExt] = (void*)xInit;
110004 wsdAutoext.nExt++;
110005 }
110006 }
110007 sqlite3_mutex_leave(mutex);
110008 assert( (rc&0xff)==rc );
@@ -109966,20 +110017,22 @@
110017 ** routine is a no-op.
110018 **
110019 ** Return 1 if xInit was found on the list and removed. Return 0 if xInit
110020 ** was not on the list.
110021 */
110022 SQLITE_API int SQLITE_APICALL sqlite3_cancel_auto_extension(
110023 int (*xInit)(sqlite3 *, char **, const sqlite3_api_routines *)
110024 ){
110025 #if SQLITE_THREADSAFE
110026 sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
110027 #endif
110028 int i;
110029 int n = 0;
110030 wsdAutoextInit;
110031 sqlite3_mutex_enter(mutex);
110032 for(i=(int)wsdAutoext.nExt-1; i>=0; i--){
110033 if( wsdAutoext.aExt[i]==(void*)xInit ){
110034 wsdAutoext.nExt--;
110035 wsdAutoext.aExt[i] = wsdAutoext.aExt[wsdAutoext.nExt];
110036 n++;
110037 break;
110038 }
@@ -109989,11 +110042,11 @@
110042 }
110043
110044 /*
110045 ** Reset the automatic extension loading mechanism.
110046 */
110047 SQLITE_API void SQLITE_APICALL sqlite3_reset_auto_extension(void){
110048 #ifndef SQLITE_OMIT_AUTOINIT
110049 if( sqlite3_initialize()==SQLITE_OK )
110050 #endif
110051 {
110052 #if SQLITE_THREADSAFE
@@ -110015,11 +110068,11 @@
110068 */
110069 SQLITE_PRIVATE void sqlite3AutoLoadExtensions(sqlite3 *db){
110070 u32 i;
110071 int go = 1;
110072 int rc;
110073 sqlite3_loadext_entry xInit;
110074
110075 wsdAutoextInit;
110076 if( wsdAutoext.nExt==0 ){
110077 /* Common case: early out without every having to acquire a mutex */
110078 return;
@@ -110032,12 +110085,11 @@
110085 sqlite3_mutex_enter(mutex);
110086 if( i>=wsdAutoext.nExt ){
110087 xInit = 0;
110088 go = 0;
110089 }else{
110090 xInit = (sqlite3_loadext_entry)wsdAutoext.aExt[i];
 
110091 }
110092 sqlite3_mutex_leave(mutex);
110093 zErrmsg = 0;
110094 if( xInit && (rc = xInit(db, &zErrmsg, &sqlite3Apis))!=0 ){
110095 sqlite3ErrorWithMsg(db, rc,
@@ -113251,11 +113303,11 @@
113303 ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
113304 ** sqlite3_step(). In the new version, the original SQL text is retained
113305 ** and the statement is automatically recompiled if an schema change
113306 ** occurs.
113307 */
113308 SQLITE_API int SQLITE_APICALL sqlite3_prepare(
113309 sqlite3 *db, /* Database handle. */
113310 const char *zSql, /* UTF-8 encoded SQL statement. */
113311 int nBytes, /* Length of zSql in bytes. */
113312 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113313 const char **pzTail /* OUT: End of parsed string */
@@ -113263,11 +113315,11 @@
113315 int rc;
113316 rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,0,ppStmt,pzTail);
113317 assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
113318 return rc;
113319 }
113320 SQLITE_API int SQLITE_APICALL sqlite3_prepare_v2(
113321 sqlite3 *db, /* Database handle. */
113322 const char *zSql, /* UTF-8 encoded SQL statement. */
113323 int nBytes, /* Length of zSql in bytes. */
113324 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113325 const char **pzTail /* OUT: End of parsed string */
@@ -113339,11 +113391,11 @@
113391 ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
113392 ** sqlite3_step(). In the new version, the original SQL text is retained
113393 ** and the statement is automatically recompiled if an schema change
113394 ** occurs.
113395 */
113396 SQLITE_API int SQLITE_APICALL sqlite3_prepare16(
113397 sqlite3 *db, /* Database handle. */
113398 const void *zSql, /* UTF-16 encoded SQL statement. */
113399 int nBytes, /* Length of zSql in bytes. */
113400 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113401 const void **pzTail /* OUT: End of parsed string */
@@ -113351,11 +113403,11 @@
113403 int rc;
113404 rc = sqlite3Prepare16(db,zSql,nBytes,0,ppStmt,pzTail);
113405 assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
113406 return rc;
113407 }
113408 SQLITE_API int SQLITE_APICALL sqlite3_prepare16_v2(
113409 sqlite3 *db, /* Database handle. */
113410 const void *zSql, /* UTF-16 encoded SQL statement. */
113411 int nBytes, /* Length of zSql in bytes. */
113412 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113413 const void **pzTail /* OUT: End of parsed string */
@@ -119194,11 +119246,11 @@
119246 ** The result that is written to ***pazResult is held in memory obtained
119247 ** from malloc(). But the caller cannot free this memory directly.
119248 ** Instead, the entire table should be passed to sqlite3_free_table() when
119249 ** the calling procedure is finished using it.
119250 */
119251 SQLITE_API int SQLITE_APICALL sqlite3_get_table(
119252 sqlite3 *db, /* The database on which the SQL executes */
119253 const char *zSql, /* The SQL to be executed */
119254 char ***pazResult, /* Write the result table here */
119255 int *pnRow, /* Write the number of rows in the result here */
119256 int *pnColumn, /* Write the number of columns of result here */
@@ -119263,11 +119315,11 @@
119315 }
119316
119317 /*
119318 ** This routine frees the space the sqlite3_get_table() malloced.
119319 */
119320 SQLITE_API void SQLITE_APICALL sqlite3_free_table(
119321 char **azResult /* Result returned from sqlite3_get_table() */
119322 ){
119323 if( azResult ){
119324 int i, n;
119325 azResult--;
@@ -121673,11 +121725,11 @@
121725
121726
121727 /*
121728 ** External API function used to create a new virtual-table module.
121729 */
121730 SQLITE_API int SQLITE_APICALL sqlite3_create_module(
121731 sqlite3 *db, /* Database in which module is registered */
121732 const char *zName, /* Name assigned to this module */
121733 const sqlite3_module *pModule, /* The definition of the module */
121734 void *pAux /* Context pointer for xCreate/xConnect */
121735 ){
@@ -121688,11 +121740,11 @@
121740 }
121741
121742 /*
121743 ** External API function used to create a new virtual-table module.
121744 */
121745 SQLITE_API int SQLITE_APICALL sqlite3_create_module_v2(
121746 sqlite3 *db, /* Database in which module is registered */
121747 const char *zName, /* Name assigned to this module */
121748 const sqlite3_module *pModule, /* The definition of the module */
121749 void *pAux, /* Context pointer for xCreate/xConnect */
121750 void (*xDestroy)(void *) /* Module destructor function */
@@ -122312,11 +122364,11 @@
122364 /*
122365 ** This function is used to set the schema of a virtual table. It is only
122366 ** valid to call this function from within the xCreate() or xConnect() of a
122367 ** virtual table module.
122368 */
122369 SQLITE_API int SQLITE_APICALL sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
122370 VtabCtx *pCtx;
122371 Parse *pParse;
122372 int rc = SQLITE_OK;
122373 Table *pTab;
122374 char *zErr = 0;
@@ -122766,11 +122818,11 @@
122818 ** table update operation currently in progress.
122819 **
122820 ** The results of this routine are undefined unless it is called from
122821 ** within an xUpdate method.
122822 */
122823 SQLITE_API int SQLITE_APICALL sqlite3_vtab_on_conflict(sqlite3 *db){
122824 static const unsigned char aMap[] = {
122825 SQLITE_ROLLBACK, SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_REPLACE
122826 };
122827 #ifdef SQLITE_ENABLE_API_ARMOR
122828 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -129063,15 +129115,15 @@
129115 LogEst nIter;
129116 pNew->u.btree.nEq++;
129117 pNew->nSkip++;
129118 pNew->aLTerm[pNew->nLTerm++] = 0;
129119 pNew->wsFlags |= WHERE_SKIPSCAN;
129120 nIter = pProbe->aiRowLogEst[saved_nEq] - pProbe->aiRowLogEst[saved_nEq+1];
129121 pNew->nOut -= nIter;
129122 /* TUNING: Because uncertainties in the estimates for skip-scan queries,
129123 ** add a 1.375 fudge factor to make skip-scan slightly less likely. */
129124 nIter += 5;
129125 whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, nIter + nInMul);
129126 pNew->nOut = saved_nOut;
129127 pNew->u.btree.nEq = saved_nEq;
129128 pNew->nSkip = saved_nSkip;
129129 pNew->wsFlags = saved_wsFlags;
@@ -136091,11 +136143,11 @@
136143 **
136144 ** If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed
136145 ** to recognize the end of a trigger can be omitted. All we have to do
136146 ** is look for a semicolon that is not part of an string or comment.
136147 */
136148 SQLITE_API int SQLITE_APICALL sqlite3_complete(const char *zSql){
136149 u8 state = 0; /* Current state, using numbers defined in header comment */
136150 u8 token; /* Value of the next token */
136151
136152 #ifndef SQLITE_OMIT_TRIGGER
136153 /* A complex statement machine used to detect the end of a CREATE TRIGGER
@@ -136256,11 +136308,11 @@
136308 /*
136309 ** This routine is the same as the sqlite3_complete() routine described
136310 ** above, except that the parameter is required to be UTF-16 encoded, not
136311 ** UTF-8.
136312 */
136313 SQLITE_API int SQLITE_APICALL sqlite3_complete16(const void *zSql){
136314 sqlite3_value *pVal;
136315 char const *zSql8;
136316 int rc;
136317
136318 #ifndef SQLITE_OMIT_AUTOINIT
@@ -136416,28 +136468,28 @@
136468 #endif
136469
136470 /* IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns
136471 ** a pointer to the to the sqlite3_version[] string constant.
136472 */
136473 SQLITE_API const char *SQLITE_APICALL sqlite3_libversion(void){ return sqlite3_version; }
136474
136475 /* IMPLEMENTATION-OF: R-63124-39300 The sqlite3_sourceid() function returns a
136476 ** pointer to a string constant whose value is the same as the
136477 ** SQLITE_SOURCE_ID C preprocessor macro.
136478 */
136479 SQLITE_API const char *SQLITE_APICALL sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
136480
136481 /* IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function
136482 ** returns an integer equal to SQLITE_VERSION_NUMBER.
136483 */
136484 SQLITE_API int SQLITE_APICALL sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; }
136485
136486 /* IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns
136487 ** zero if and only if SQLite was compiled with mutexing code omitted due to
136488 ** the SQLITE_THREADSAFE compile-time option being set to 0.
136489 */
136490 SQLITE_API int SQLITE_APICALL sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; }
136491
136492 /*
136493 ** When compiling the test fixture or with debugging enabled (on Win32),
136494 ** this variable being set to non-zero will cause OSTRACE macros to emit
136495 ** extra diagnostic information.
@@ -136506,11 +136558,11 @@
136558 ** call by X completes.
136559 **
136560 ** * Recursive calls to this routine from thread X return immediately
136561 ** without blocking.
136562 */
136563 SQLITE_API int SQLITE_APICALL sqlite3_initialize(void){
136564 MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */
136565 int rc; /* Result code */
136566 #ifdef SQLITE_EXTRA_INIT
136567 int bRunExtraInit = 0; /* Extra initialization needed */
136568 #endif
@@ -136672,11 +136724,11 @@
136724 ** while any part of SQLite is otherwise in use in any thread. This
136725 ** routine is not threadsafe. But it is safe to invoke this routine
136726 ** on when SQLite is already shut down. If SQLite is already shut down
136727 ** when this routine is invoked, then this routine is a harmless no-op.
136728 */
136729 SQLITE_API int SQLITE_APICALL sqlite3_shutdown(void){
136730 #ifdef SQLITE_OMIT_WSD
136731 int rc = sqlite3_wsd_init(4096, 24);
136732 if( rc!=SQLITE_OK ){
136733 return rc;
136734 }
@@ -137091,11 +137143,11 @@
137143 }
137144
137145 /*
137146 ** Return the mutex associated with a database connection.
137147 */
137148 SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_db_mutex(sqlite3 *db){
137149 #ifdef SQLITE_ENABLE_API_ARMOR
137150 if( !sqlite3SafetyCheckOk(db) ){
137151 (void)SQLITE_MISUSE_BKPT;
137152 return 0;
137153 }
@@ -137105,11 +137157,11 @@
137157
137158 /*
137159 ** Free up as much memory as we can from the given database
137160 ** connection.
137161 */
137162 SQLITE_API int SQLITE_APICALL sqlite3_db_release_memory(sqlite3 *db){
137163 int i;
137164
137165 #ifdef SQLITE_ENABLE_API_ARMOR
137166 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
137167 #endif
@@ -137129,11 +137181,11 @@
137181
137182 /*
137183 ** Flush any dirty pages in the pager-cache for any attached database
137184 ** to disk.
137185 */
137186 SQLITE_API int SQLITE_APICALL sqlite3_db_cacheflush(sqlite3 *db){
137187 int i;
137188 int rc = SQLITE_OK;
137189 int bSeenBusy = 0;
137190
137191 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -137279,11 +137331,11 @@
137331 }
137332
137333 /*
137334 ** Return the ROWID of the most recent insert
137335 */
137336 SQLITE_API sqlite_int64 SQLITE_APICALL sqlite3_last_insert_rowid(sqlite3 *db){
137337 #ifdef SQLITE_ENABLE_API_ARMOR
137338 if( !sqlite3SafetyCheckOk(db) ){
137339 (void)SQLITE_MISUSE_BKPT;
137340 return 0;
137341 }
@@ -137292,11 +137344,11 @@
137344 }
137345
137346 /*
137347 ** Return the number of changes in the most recent call to sqlite3_exec().
137348 */
137349 SQLITE_API int SQLITE_APICALL sqlite3_changes(sqlite3 *db){
137350 #ifdef SQLITE_ENABLE_API_ARMOR
137351 if( !sqlite3SafetyCheckOk(db) ){
137352 (void)SQLITE_MISUSE_BKPT;
137353 return 0;
137354 }
@@ -137305,11 +137357,11 @@
137357 }
137358
137359 /*
137360 ** Return the number of changes since the database handle was opened.
137361 */
137362 SQLITE_API int SQLITE_APICALL sqlite3_total_changes(sqlite3 *db){
137363 #ifdef SQLITE_ENABLE_API_ARMOR
137364 if( !sqlite3SafetyCheckOk(db) ){
137365 (void)SQLITE_MISUSE_BKPT;
137366 return 0;
137367 }
@@ -137456,12 +137508,12 @@
137508 ** statements or unfinished sqlite3_backups. The sqlite3_close_v2()
137509 ** version forces the connection to become a zombie if there are
137510 ** unclosed resources, and arranges for deallocation when the last
137511 ** prepare statement or sqlite3_backup closes.
137512 */
137513 SQLITE_API int SQLITE_APICALL sqlite3_close(sqlite3 *db){ return sqlite3Close(db,0); }
137514 SQLITE_API int SQLITE_APICALL sqlite3_close_v2(sqlite3 *db){ return sqlite3Close(db,1); }
137515
137516
137517 /*
137518 ** Close the mutex on database connection db.
137519 **
@@ -137864,11 +137916,11 @@
137916
137917 /*
137918 ** This routine sets the busy callback for an Sqlite database to the
137919 ** given callback function with the given argument.
137920 */
137921 SQLITE_API int SQLITE_APICALL sqlite3_busy_handler(
137922 sqlite3 *db,
137923 int (*xBusy)(void*,int),
137924 void *pArg
137925 ){
137926 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -137887,11 +137939,11 @@
137939 /*
137940 ** This routine sets the progress callback for an Sqlite database to the
137941 ** given callback function with the given argument. The progress callback will
137942 ** be invoked every nOps opcodes.
137943 */
137944 SQLITE_API void SQLITE_APICALL sqlite3_progress_handler(
137945 sqlite3 *db,
137946 int nOps,
137947 int (*xProgress)(void*),
137948 void *pArg
137949 ){
@@ -137918,11 +137970,11 @@
137970
137971 /*
137972 ** This routine installs a default busy handler that waits for the
137973 ** specified number of milliseconds before returning 0.
137974 */
137975 SQLITE_API int SQLITE_APICALL sqlite3_busy_timeout(sqlite3 *db, int ms){
137976 #ifdef SQLITE_ENABLE_API_ARMOR
137977 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
137978 #endif
137979 if( ms>0 ){
137980 sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db);
@@ -137934,11 +137986,11 @@
137986 }
137987
137988 /*
137989 ** Cause any pending operation to stop at its earliest opportunity.
137990 */
137991 SQLITE_API void SQLITE_APICALL sqlite3_interrupt(sqlite3 *db){
137992 #ifdef SQLITE_ENABLE_API_ARMOR
137993 if( !sqlite3SafetyCheckOk(db) ){
137994 (void)SQLITE_MISUSE_BKPT;
137995 return;
137996 }
@@ -138050,11 +138102,11 @@
138102 }
138103
138104 /*
138105 ** Create new user functions.
138106 */
138107 SQLITE_API int SQLITE_APICALL sqlite3_create_function(
138108 sqlite3 *db,
138109 const char *zFunc,
138110 int nArg,
138111 int enc,
138112 void *p,
@@ -138064,11 +138116,11 @@
138116 ){
138117 return sqlite3_create_function_v2(db, zFunc, nArg, enc, p, xSFunc, xStep,
138118 xFinal, 0);
138119 }
138120
138121 SQLITE_API int SQLITE_APICALL sqlite3_create_function_v2(
138122 sqlite3 *db,
138123 const char *zFunc,
138124 int nArg,
138125 int enc,
138126 void *p,
@@ -138107,11 +138159,11 @@
138159 sqlite3_mutex_leave(db->mutex);
138160 return rc;
138161 }
138162
138163 #ifndef SQLITE_OMIT_UTF16
138164 SQLITE_API int SQLITE_APICALL sqlite3_create_function16(
138165 sqlite3 *db,
138166 const void *zFunctionName,
138167 int nArg,
138168 int eTextRep,
138169 void *p,
@@ -138147,11 +138199,11 @@
138199 ** When virtual tables intend to provide an overloaded function, they
138200 ** should call this routine to make sure the global function exists.
138201 ** A global function must exist in order for name resolution to work
138202 ** properly.
138203 */
138204 SQLITE_API int SQLITE_APICALL sqlite3_overload_function(
138205 sqlite3 *db,
138206 const char *zName,
138207 int nArg
138208 ){
138209 int rc = SQLITE_OK;
@@ -138179,11 +138231,11 @@
138231 ** A NULL trace function means that no tracing is executes. A non-NULL
138232 ** trace is a pointer to a function that is invoked at the start of each
138233 ** SQL statement.
138234 */
138235 #ifndef SQLITE_OMIT_DEPRECATED
138236 SQLITE_API void *SQLITE_APICALL sqlite3_trace(sqlite3 *db, void(*xTrace)(void*,const char*), void *pArg){
138237 void *pOld;
138238
138239 #ifdef SQLITE_ENABLE_API_ARMOR
138240 if( !sqlite3SafetyCheckOk(db) ){
138241 (void)SQLITE_MISUSE_BKPT;
@@ -138200,11 +138252,11 @@
138252 }
138253 #endif /* SQLITE_OMIT_DEPRECATED */
138254
138255 /* Register a trace callback using the version-2 interface.
138256 */
138257 SQLITE_API int SQLITE_APICALL sqlite3_trace_v2(
138258 sqlite3 *db, /* Trace this connection */
138259 unsigned mTrace, /* Mask of events to be traced */
138260 int(*xTrace)(unsigned,void*,void*,void*), /* Callback to invoke */
138261 void *pArg /* Context */
138262 ){
@@ -138228,11 +138280,11 @@
138280 **
138281 ** A NULL profile function means that no profiling is executes. A non-NULL
138282 ** profile is a pointer to a function that is invoked at the conclusion of
138283 ** each SQL statement that is run.
138284 */
138285 SQLITE_API void *SQLITE_APICALL sqlite3_profile(
138286 sqlite3 *db,
138287 void (*xProfile)(void*,const char*,sqlite_uint64),
138288 void *pArg
138289 ){
138290 void *pOld;
@@ -138256,11 +138308,11 @@
138308 /*
138309 ** Register a function to be invoked when a transaction commits.
138310 ** If the invoked function returns non-zero, then the commit becomes a
138311 ** rollback.
138312 */
138313 SQLITE_API void *SQLITE_APICALL sqlite3_commit_hook(
138314 sqlite3 *db, /* Attach the hook to this database */
138315 int (*xCallback)(void*), /* Function to invoke on each commit */
138316 void *pArg /* Argument to the function */
138317 ){
138318 void *pOld;
@@ -138281,11 +138333,11 @@
138333
138334 /*
138335 ** Register a callback to be invoked each time a row is updated,
138336 ** inserted or deleted using this database connection.
138337 */
138338 SQLITE_API void *SQLITE_APICALL sqlite3_update_hook(
138339 sqlite3 *db, /* Attach the hook to this database */
138340 void (*xCallback)(void*,int,char const *,char const *,sqlite_int64),
138341 void *pArg /* Argument to the function */
138342 ){
138343 void *pRet;
@@ -138306,11 +138358,11 @@
138358
138359 /*
138360 ** Register a callback to be invoked each time a transaction is rolled
138361 ** back by this database connection.
138362 */
138363 SQLITE_API void *SQLITE_APICALL sqlite3_rollback_hook(
138364 sqlite3 *db, /* Attach the hook to this database */
138365 void (*xCallback)(void*), /* Callback function */
138366 void *pArg /* Argument to the function */
138367 ){
138368 void *pRet;
@@ -138332,11 +138384,11 @@
138384 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
138385 /*
138386 ** Register a callback to be invoked each time a row is updated,
138387 ** inserted or deleted using this database connection.
138388 */
138389 SQLITE_API void *SQLITE_APICALL sqlite3_preupdate_hook(
138390 sqlite3 *db, /* Attach the hook to this database */
138391 void(*xCallback)( /* Callback function */
138392 void*,sqlite3*,int,char const*,char const*,sqlite3_int64,sqlite3_int64),
138393 void *pArg /* First callback argument */
138394 ){
@@ -138381,11 +138433,11 @@
138433 ** The callback registered by this function replaces any existing callback
138434 ** registered using sqlite3_wal_hook(). Likewise, registering a callback
138435 ** using sqlite3_wal_hook() disables the automatic checkpoint mechanism
138436 ** configured by this function.
138437 */
138438 SQLITE_API int SQLITE_APICALL sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){
138439 #ifdef SQLITE_OMIT_WAL
138440 UNUSED_PARAMETER(db);
138441 UNUSED_PARAMETER(nFrame);
138442 #else
138443 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -138402,11 +138454,11 @@
138454
138455 /*
138456 ** Register a callback to be invoked each time a transaction is written
138457 ** into the write-ahead-log by this database connection.
138458 */
138459 SQLITE_API void *SQLITE_APICALL sqlite3_wal_hook(
138460 sqlite3 *db, /* Attach the hook to this db handle */
138461 int(*xCallback)(void *, sqlite3*, const char*, int),
138462 void *pArg /* First argument passed to xCallback() */
138463 ){
138464 #ifndef SQLITE_OMIT_WAL
@@ -138429,11 +138481,11 @@
138481 }
138482
138483 /*
138484 ** Checkpoint database zDb.
138485 */
138486 SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint_v2(
138487 sqlite3 *db, /* Database handle */
138488 const char *zDb, /* Name of attached database (or NULL) */
138489 int eMode, /* SQLITE_CHECKPOINT_* value */
138490 int *pnLog, /* OUT: Size of WAL log in frames */
138491 int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -138484,11 +138536,11 @@
138536 /*
138537 ** Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points
138538 ** to contains a zero-length string, all attached databases are
138539 ** checkpointed.
138540 */
138541 SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){
138542 /* EVIDENCE-OF: R-41613-20553 The sqlite3_wal_checkpoint(D,X) is equivalent to
138543 ** sqlite3_wal_checkpoint_v2(D,X,SQLITE_CHECKPOINT_PASSIVE,0,0). */
138544 return sqlite3_wal_checkpoint_v2(db,zDb,SQLITE_CHECKPOINT_PASSIVE,0,0);
138545 }
138546
@@ -138575,11 +138627,11 @@
138627
138628 /*
138629 ** Return UTF-8 encoded English language explanation of the most recent
138630 ** error.
138631 */
138632 SQLITE_API const char *SQLITE_APICALL sqlite3_errmsg(sqlite3 *db){
138633 const char *z;
138634 if( !db ){
138635 return sqlite3ErrStr(SQLITE_NOMEM_BKPT);
138636 }
138637 if( !sqlite3SafetyCheckSickOrOk(db) ){
@@ -138603,11 +138655,11 @@
138655 #ifndef SQLITE_OMIT_UTF16
138656 /*
138657 ** Return UTF-16 encoded English language explanation of the most recent
138658 ** error.
138659 */
138660 SQLITE_API const void *SQLITE_APICALL sqlite3_errmsg16(sqlite3 *db){
138661 static const u16 outOfMem[] = {
138662 'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0
138663 };
138664 static const u16 misuse[] = {
138665 'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ',
@@ -138648,38 +138700,38 @@
138700
138701 /*
138702 ** Return the most recent error code generated by an SQLite routine. If NULL is
138703 ** passed to this function, we assume a malloc() failed during sqlite3_open().
138704 */
138705 SQLITE_API int SQLITE_APICALL sqlite3_errcode(sqlite3 *db){
138706 if( db && !sqlite3SafetyCheckSickOrOk(db) ){
138707 return SQLITE_MISUSE_BKPT;
138708 }
138709 if( !db || db->mallocFailed ){
138710 return SQLITE_NOMEM_BKPT;
138711 }
138712 return db->errCode & db->errMask;
138713 }
138714 SQLITE_API int SQLITE_APICALL sqlite3_extended_errcode(sqlite3 *db){
138715 if( db && !sqlite3SafetyCheckSickOrOk(db) ){
138716 return SQLITE_MISUSE_BKPT;
138717 }
138718 if( !db || db->mallocFailed ){
138719 return SQLITE_NOMEM_BKPT;
138720 }
138721 return db->errCode;
138722 }
138723 SQLITE_API int SQLITE_APICALL sqlite3_system_errno(sqlite3 *db){
138724 return db ? db->iSysErrno : 0;
138725 }
138726
138727 /*
138728 ** Return a string that describes the kind of error specified in the
138729 ** argument. For now, this simply calls the internal sqlite3ErrStr()
138730 ** function.
138731 */
138732 SQLITE_API const char *SQLITE_APICALL sqlite3_errstr(int rc){
138733 return sqlite3ErrStr(rc);
138734 }
138735
138736 /*
138737 ** Create a new collating function for database "db". The name is zName
@@ -138823,11 +138875,11 @@
138875 **
138876 ** A new lower limit does not shrink existing constructs.
138877 ** It merely prevents new constructs that exceed the limit
138878 ** from forming.
138879 */
138880 SQLITE_API int SQLITE_APICALL sqlite3_limit(sqlite3 *db, int limitId, int newLimit){
138881 int oldLimit;
138882
138883 #ifdef SQLITE_ENABLE_API_ARMOR
138884 if( !sqlite3SafetyCheckOk(db) ){
138885 (void)SQLITE_MISUSE_BKPT;
@@ -139447,18 +139499,18 @@
139499 }
139500
139501 /*
139502 ** Open a new database handle.
139503 */
139504 SQLITE_API int SQLITE_APICALL sqlite3_open(
139505 const char *zFilename,
139506 sqlite3 **ppDb
139507 ){
139508 return openDatabase(zFilename, ppDb,
139509 SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0);
139510 }
139511 SQLITE_API int SQLITE_APICALL sqlite3_open_v2(
139512 const char *filename, /* Database filename (UTF-8) */
139513 sqlite3 **ppDb, /* OUT: SQLite db handle */
139514 int flags, /* Flags */
139515 const char *zVfs /* Name of VFS module to use */
139516 ){
@@ -139467,11 +139519,11 @@
139519
139520 #ifndef SQLITE_OMIT_UTF16
139521 /*
139522 ** Open a new database handle.
139523 */
139524 SQLITE_API int SQLITE_APICALL sqlite3_open16(
139525 const void *zFilename,
139526 sqlite3 **ppDb
139527 ){
139528 char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */
139529 sqlite3_value *pVal;
@@ -139506,11 +139558,11 @@
139558 #endif /* SQLITE_OMIT_UTF16 */
139559
139560 /*
139561 ** Register a new collation sequence with the database handle db.
139562 */
139563 SQLITE_API int SQLITE_APICALL sqlite3_create_collation(
139564 sqlite3* db,
139565 const char *zName,
139566 int enc,
139567 void* pCtx,
139568 int(*xCompare)(void*,int,const void*,int,const void*)
@@ -139519,11 +139571,11 @@
139571 }
139572
139573 /*
139574 ** Register a new collation sequence with the database handle db.
139575 */
139576 SQLITE_API int SQLITE_APICALL sqlite3_create_collation_v2(
139577 sqlite3* db,
139578 const char *zName,
139579 int enc,
139580 void* pCtx,
139581 int(*xCompare)(void*,int,const void*,int,const void*),
@@ -139544,11 +139596,11 @@
139596
139597 #ifndef SQLITE_OMIT_UTF16
139598 /*
139599 ** Register a new collation sequence with the database handle db.
139600 */
139601 SQLITE_API int SQLITE_APICALL sqlite3_create_collation16(
139602 sqlite3* db,
139603 const void *zName,
139604 int enc,
139605 void* pCtx,
139606 int(*xCompare)(void*,int,const void*,int,const void*)
@@ -139574,11 +139626,11 @@
139626
139627 /*
139628 ** Register a collation sequence factory callback with the database handle
139629 ** db. Replace any previously installed collation sequence factory.
139630 */
139631 SQLITE_API int SQLITE_APICALL sqlite3_collation_needed(
139632 sqlite3 *db,
139633 void *pCollNeededArg,
139634 void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*)
139635 ){
139636 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -139595,11 +139647,11 @@
139647 #ifndef SQLITE_OMIT_UTF16
139648 /*
139649 ** Register a collation sequence factory callback with the database handle
139650 ** db. Replace any previously installed collation sequence factory.
139651 */
139652 SQLITE_API int SQLITE_APICALL sqlite3_collation_needed16(
139653 sqlite3 *db,
139654 void *pCollNeededArg,
139655 void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*)
139656 ){
139657 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -139617,11 +139669,11 @@
139669 #ifndef SQLITE_OMIT_DEPRECATED
139670 /*
139671 ** This function is now an anachronism. It used to be used to recover from a
139672 ** malloc() failure, but SQLite now does this automatically.
139673 */
139674 SQLITE_API int SQLITE_APICALL sqlite3_global_recover(void){
139675 return SQLITE_OK;
139676 }
139677 #endif
139678
139679 /*
@@ -139628,11 +139680,11 @@
139680 ** Test to see whether or not the database connection is in autocommit
139681 ** mode. Return TRUE if it is and FALSE if not. Autocommit mode is on
139682 ** by default. Autocommit is disabled by a BEGIN statement and reenabled
139683 ** by the next COMMIT or ROLLBACK.
139684 */
139685 SQLITE_API int SQLITE_APICALL sqlite3_get_autocommit(sqlite3 *db){
139686 #ifdef SQLITE_ENABLE_API_ARMOR
139687 if( !sqlite3SafetyCheckOk(db) ){
139688 (void)SQLITE_MISUSE_BKPT;
139689 return 0;
139690 }
@@ -139685,19 +139737,19 @@
139737 ** data for this thread has been deallocated.
139738 **
139739 ** SQLite no longer uses thread-specific data so this routine is now a
139740 ** no-op. It is retained for historical compatibility.
139741 */
139742 SQLITE_API void SQLITE_APICALL sqlite3_thread_cleanup(void){
139743 }
139744 #endif
139745
139746 /*
139747 ** Return meta information about a specific column of a database table.
139748 ** See comment in sqlite3.h (sqlite.h.in) for details.
139749 */
139750 SQLITE_API int SQLITE_APICALL sqlite3_table_column_metadata(
139751 sqlite3 *db, /* Connection handle */
139752 const char *zDbName, /* Database name or NULL */
139753 const char *zTableName, /* Table name */
139754 const char *zColumnName, /* Column name */
139755 char const **pzDataType, /* OUTPUT: Declared data type */
@@ -139811,11 +139863,11 @@
139863 }
139864
139865 /*
139866 ** Sleep for a little while. Return the amount of time slept.
139867 */
139868 SQLITE_API int SQLITE_APICALL sqlite3_sleep(int ms){
139869 sqlite3_vfs *pVfs;
139870 int rc;
139871 pVfs = sqlite3_vfs_find(0);
139872 if( pVfs==0 ) return 0;
139873
@@ -139827,11 +139879,11 @@
139879 }
139880
139881 /*
139882 ** Enable or disable the extended result codes.
139883 */
139884 SQLITE_API int SQLITE_APICALL sqlite3_extended_result_codes(sqlite3 *db, int onoff){
139885 #ifdef SQLITE_ENABLE_API_ARMOR
139886 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
139887 #endif
139888 sqlite3_mutex_enter(db->mutex);
139889 db->errMask = onoff ? 0xffffffff : 0xff;
@@ -139840,11 +139892,11 @@
139892 }
139893
139894 /*
139895 ** Invoke the xFileControl method on a particular database.
139896 */
139897 SQLITE_API int SQLITE_APICALL sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
139898 int rc = SQLITE_ERROR;
139899 Btree *pBtree;
139900
139901 #ifdef SQLITE_ENABLE_API_ARMOR
139902 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -140225,11 +140277,11 @@
140277 ** method of a VFS implementation. The zParam argument is the name of the
140278 ** query parameter we seek. This routine returns the value of the zParam
140279 ** parameter if it exists. If the parameter does not exist, this routine
140280 ** returns a NULL pointer.
140281 */
140282 SQLITE_API const char *SQLITE_APICALL sqlite3_uri_parameter(const char *zFilename, const char *zParam){
140283 if( zFilename==0 || zParam==0 ) return 0;
140284 zFilename += sqlite3Strlen30(zFilename) + 1;
140285 while( zFilename[0] ){
140286 int x = strcmp(zFilename, zParam);
140287 zFilename += sqlite3Strlen30(zFilename) + 1;
@@ -140240,20 +140292,20 @@
140292 }
140293
140294 /*
140295 ** Return a boolean value for a query parameter.
140296 */
140297 SQLITE_API int SQLITE_APICALL sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){
140298 const char *z = sqlite3_uri_parameter(zFilename, zParam);
140299 bDflt = bDflt!=0;
140300 return z ? sqlite3GetBoolean(z, bDflt) : bDflt;
140301 }
140302
140303 /*
140304 ** Return a 64-bit integer value for a query parameter.
140305 */
140306 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_uri_int64(
140307 const char *zFilename, /* Filename as passed to xOpen */
140308 const char *zParam, /* URI parameter sought */
140309 sqlite3_int64 bDflt /* return if parameter is missing */
140310 ){
140311 const char *z = sqlite3_uri_parameter(zFilename, zParam);
@@ -140281,11 +140333,11 @@
140333
140334 /*
140335 ** Return the filename of the database associated with a database
140336 ** connection.
140337 */
140338 SQLITE_API const char *SQLITE_APICALL sqlite3_db_filename(sqlite3 *db, const char *zDbName){
140339 Btree *pBt;
140340 #ifdef SQLITE_ENABLE_API_ARMOR
140341 if( !sqlite3SafetyCheckOk(db) ){
140342 (void)SQLITE_MISUSE_BKPT;
140343 return 0;
@@ -140297,11 +140349,11 @@
140349
140350 /*
140351 ** Return 1 if database is read-only or 0 if read/write. Return -1 if
140352 ** no such database exists.
140353 */
140354 SQLITE_API int SQLITE_APICALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName){
140355 Btree *pBt;
140356 #ifdef SQLITE_ENABLE_API_ARMOR
140357 if( !sqlite3SafetyCheckOk(db) ){
140358 (void)SQLITE_MISUSE_BKPT;
140359 return -1;
@@ -140314,11 +140366,11 @@
140366 #ifdef SQLITE_ENABLE_SNAPSHOT
140367 /*
140368 ** Obtain a snapshot handle for the snapshot of database zDb currently
140369 ** being read by handle db.
140370 */
140371 SQLITE_API int SQLITE_APICALL sqlite3_snapshot_get(
140372 sqlite3 *db,
140373 const char *zDb,
140374 sqlite3_snapshot **ppSnapshot
140375 ){
140376 int rc = SQLITE_ERROR;
@@ -140349,11 +140401,11 @@
140401 }
140402
140403 /*
140404 ** Open a read-transaction on the snapshot idendified by pSnapshot.
140405 */
140406 SQLITE_API int SQLITE_APICALL sqlite3_snapshot_open(
140407 sqlite3 *db,
140408 const char *zDb,
140409 sqlite3_snapshot *pSnapshot
140410 ){
140411 int rc = SQLITE_ERROR;
@@ -140386,11 +140438,11 @@
140438 }
140439
140440 /*
140441 ** Free a snapshot handle obtained from sqlite3_snapshot_get().
140442 */
140443 SQLITE_API void SQLITE_APICALL sqlite3_snapshot_free(sqlite3_snapshot *pSnapshot){
140444 sqlite3_free(pSnapshot);
140445 }
140446 #endif /* SQLITE_ENABLE_SNAPSHOT */
140447
140448 /************** End of main.c ************************************************/
@@ -140540,11 +140592,11 @@
140592 **
140593 ** Each call to this routine overrides any prior callbacks registered
140594 ** on the same "db". If xNotify==0 then any prior callbacks are immediately
140595 ** cancelled.
140596 */
140597 SQLITE_API int SQLITE_APICALL sqlite3_unlock_notify(
140598 sqlite3 *db,
140599 void (*xNotify)(void **, int),
140600 void *pArg
140601 ){
140602 int rc = SQLITE_OK;
@@ -147543,11 +147595,11 @@
147595 ** Initialize API pointer table, if required.
147596 */
147597 #ifdef _WIN32
147598 __declspec(dllexport)
147599 #endif
147600 SQLITE_API int SQLITE_APICALL sqlite3_fts3_init(
147601 sqlite3 *db,
147602 char **pzErrMsg,
147603 const sqlite3_api_routines *pApi
147604 ){
147605 SQLITE_EXTENSION_INIT2(pApi)
@@ -150699,11 +150751,15 @@
150751 }
150752
150753
150754 #ifdef SQLITE_TEST
150755
150756 #if defined(INCLUDE_SQLITE_TCL_H)
150757 # include "sqlite_tcl.h"
150758 #else
150759 # include "tcl.h"
150760 #endif
150761 /* #include <string.h> */
150762
150763 /*
150764 ** Implementation of a special SQL scalar function for testing tokenizers
150765 ** designed to be used in concert with the Tcl testing framework. This
@@ -163340,11 +163396,11 @@
163396 }
163397
163398 /*
163399 ** Register a new geometry function for use with the r-tree MATCH operator.
163400 */
163401 SQLITE_API int SQLITE_APICALL sqlite3_rtree_geometry_callback(
163402 sqlite3 *db, /* Register SQL function on this connection */
163403 const char *zGeom, /* Name of the new SQL function */
163404 int (*xGeom)(sqlite3_rtree_geometry*,int,RtreeDValue*,int*), /* Callback */
163405 void *pContext /* Extra data associated with the callback */
163406 ){
@@ -163364,11 +163420,11 @@
163420
163421 /*
163422 ** Register a new 2nd-generation geometry function for use with the
163423 ** r-tree MATCH operator.
163424 */
163425 SQLITE_API int SQLITE_APICALL sqlite3_rtree_query_callback(
163426 sqlite3 *db, /* Register SQL function on this connection */
163427 const char *zQueryFunc, /* Name of new SQL function */
163428 int (*xQueryFunc)(sqlite3_rtree_query_info*), /* Callback */
163429 void *pContext, /* Extra data passed into the callback */
163430 void (*xDestructor)(void*) /* Destructor for the extra data */
@@ -163389,11 +163445,11 @@
163445
163446 #if !SQLITE_CORE
163447 #ifdef _WIN32
163448 __declspec(dllexport)
163449 #endif
163450 SQLITE_API int SQLITE_APICALL sqlite3_rtree_init(
163451 sqlite3 *db,
163452 char **pzErrMsg,
163453 const sqlite3_api_routines *pApi
163454 ){
163455 SQLITE_EXTENSION_INIT2(pApi)
@@ -163940,11 +163996,11 @@
163996
163997 #if !SQLITE_CORE
163998 #ifdef _WIN32
163999 __declspec(dllexport)
164000 #endif
164001 SQLITE_API int SQLITE_APICALL sqlite3_icu_init(
164002 sqlite3 *db,
164003 char **pzErrMsg,
164004 const sqlite3_api_routines *pApi
164005 ){
164006 SQLITE_EXTENSION_INIT2(pApi)
@@ -164620,11 +164676,11 @@
164676 ** IMPORTANT NOTE FOR ZIPVFS USERS: The RBU extension works with all of
164677 ** SQLite's built-in VFSs, including the multiplexor VFS. However it does
164678 ** not work out of the box with zipvfs. Refer to the comment describing
164679 ** the zipvfs_create_vfs() API below for details on using RBU with zipvfs.
164680 */
164681 SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_open(
164682 const char *zTarget,
164683 const char *zRbu,
164684 const char *zState
164685 );
164686
@@ -164653,11 +164709,11 @@
164709 ** As with sqlite3rbu_open(), Zipvfs users should rever to the comment
164710 ** describing the sqlite3rbu_create_vfs() API function below for
164711 ** a description of the complications associated with using RBU with
164712 ** zipvfs databases.
164713 */
164714 SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_vacuum(
164715 const char *zTarget,
164716 const char *zState
164717 );
164718
164719 /*
@@ -164689,11 +164745,11 @@
164745 ** when sqlite3rbu_close() is called.
164746 **
164747 ** Database handles returned by this function remain valid until the next
164748 ** call to any sqlite3rbu_xxx() function other than sqlite3rbu_db().
164749 */
164750 SQLITE_API sqlite3 *SQLITE_APICALL sqlite3rbu_db(sqlite3rbu*, int bRbu);
164751
164752 /*
164753 ** Do some work towards applying the RBU update to the target db.
164754 **
164755 ** Return SQLITE_DONE if the update has been completely applied, or
@@ -164703,11 +164759,11 @@
164759 **
164760 ** Once a call to sqlite3rbu_step() has returned a value other than
164761 ** SQLITE_OK, all subsequent calls on the same RBU handle are no-ops
164762 ** that immediately return the same value.
164763 */
164764 SQLITE_API int SQLITE_APICALL sqlite3rbu_step(sqlite3rbu *pRbu);
164765
164766 /*
164767 ** Force RBU to save its state to disk.
164768 **
164769 ** If a power failure or application crash occurs during an update, following
@@ -164715,11 +164771,11 @@
164771 ** was last saved. In other words, from the most recent successful call to
164772 ** sqlite3rbu_close() or this function.
164773 **
164774 ** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
164775 */
164776 SQLITE_API int SQLITE_APICALL sqlite3rbu_savestate(sqlite3rbu *pRbu);
164777
164778 /*
164779 ** Close an RBU handle.
164780 **
164781 ** If the RBU update has been completely applied, mark the RBU database
@@ -164735,18 +164791,18 @@
164791 **
164792 ** Otherwise, if no error occurs, this function returns SQLITE_OK if the
164793 ** update has been partially applied, or SQLITE_DONE if it has been
164794 ** completely applied.
164795 */
164796 SQLITE_API int SQLITE_APICALL sqlite3rbu_close(sqlite3rbu *pRbu, char **pzErrmsg);
164797
164798 /*
164799 ** Return the total number of key-value operations (inserts, deletes or
164800 ** updates) that have been performed on the target database since the
164801 ** current RBU update was started.
164802 */
164803 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3rbu_progress(sqlite3rbu *pRbu);
164804
164805 /*
164806 ** Obtain permyriadage (permyriadage is to 10000 as percentage is to 100)
164807 ** progress indications for the two stages of an RBU update. This API may
164808 ** be useful for driving GUI progress indicators and similar.
@@ -164784,11 +164840,11 @@
164840 ** permyriadage progress of the same stage. If the rbu_count table does
164841 ** not exist, then (*pnOne) is set to -1 during stage 1. If the rbu_count
164842 ** table exists but is not correctly populated, the value of the *pnOne
164843 ** output variable during stage 1 is undefined.
164844 */
164845 SQLITE_API void SQLITE_APICALL sqlite3rbu_bp_progress(sqlite3rbu *pRbu, int *pnOne, int *pnTwo);
164846
164847 /*
164848 ** Obtain an indication as to the current stage of an RBU update or vacuum.
164849 ** This function always returns one of the SQLITE_RBU_STATE_XXX constants
164850 ** defined in this file. Return values should be interpreted as follows:
@@ -164822,11 +164878,11 @@
164878 #define SQLITE_RBU_STATE_MOVE 2
164879 #define SQLITE_RBU_STATE_CHECKPOINT 3
164880 #define SQLITE_RBU_STATE_DONE 4
164881 #define SQLITE_RBU_STATE_ERROR 5
164882
164883 SQLITE_API int SQLITE_APICALL sqlite3rbu_state(sqlite3rbu *pRbu);
164884
164885 /*
164886 ** Create an RBU VFS named zName that accesses the underlying file-system
164887 ** via existing VFS zParent. Or, if the zParent parameter is passed NULL,
164888 ** then the new RBU VFS uses the default system VFS to access the file-system.
@@ -164866,21 +164922,21 @@
164922 ** The overhead of adding the "rbu" VFS to the system is negligible for
164923 ** non-RBU users. There is no harm in an application accessing the
164924 ** file-system via "rbu" all the time, even if it only uses RBU functionality
164925 ** occasionally.
164926 */
164927 SQLITE_API int SQLITE_APICALL sqlite3rbu_create_vfs(const char *zName, const char *zParent);
164928
164929 /*
164930 ** Deregister and destroy an RBU vfs created by an earlier call to
164931 ** sqlite3rbu_create_vfs().
164932 **
164933 ** VFS objects are not reference counted. If a VFS object is destroyed
164934 ** before all database handles that use it have been closed, the results
164935 ** are undefined.
164936 */
164937 SQLITE_API void SQLITE_APICALL sqlite3rbu_destroy_vfs(const char *zName);
164938
164939 #if 0
164940 } /* end of the 'extern "C"' block */
164941 #endif
164942
@@ -167970,11 +168026,11 @@
168026 }
168027
168028 /*
168029 ** Step the RBU object.
168030 */
168031 SQLITE_API int SQLITE_APICALL sqlite3rbu_step(sqlite3rbu *p){
168032 if( p ){
168033 switch( p->eStage ){
168034 case RBU_STAGE_OAL: {
168035 RbuObjIter *pIter = &p->objiter;
168036
@@ -168412,11 +168468,11 @@
168468 }
168469
168470 /*
168471 ** Open and return a new RBU handle.
168472 */
168473 SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_open(
168474 const char *zTarget,
168475 const char *zRbu,
168476 const char *zState
168477 ){
168478 /* TODO: Check that zTarget and zRbu are non-NULL */
@@ -168424,11 +168480,11 @@
168480 }
168481
168482 /*
168483 ** Open a handle to begin or resume an RBU VACUUM operation.
168484 */
168485 SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_vacuum(
168486 const char *zTarget,
168487 const char *zState
168488 ){
168489 /* TODO: Check that both arguments are non-NULL */
168490 return openRbuHandle(0, zTarget, zState);
@@ -168435,11 +168491,11 @@
168491 }
168492
168493 /*
168494 ** Return the database handle used by pRbu.
168495 */
168496 SQLITE_API sqlite3 *SQLITE_APICALL sqlite3rbu_db(sqlite3rbu *pRbu, int bRbu){
168497 sqlite3 *db = 0;
168498 if( pRbu ){
168499 db = (bRbu ? pRbu->dbRbu : pRbu->dbMain);
168500 }
168501 return db;
@@ -168467,11 +168523,11 @@
168523 }
168524
168525 /*
168526 ** Close the RBU handle.
168527 */
168528 SQLITE_API int SQLITE_APICALL sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){
168529 int rc;
168530 if( p ){
168531
168532 /* Commit the transaction to the *-oal file. */
168533 if( p->rc==SQLITE_OK && p->eStage==RBU_STAGE_OAL ){
@@ -168518,19 +168574,19 @@
168574 /*
168575 ** Return the total number of key-value operations (inserts, deletes or
168576 ** updates) that have been performed on the target database since the
168577 ** current RBU update was started.
168578 */
168579 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3rbu_progress(sqlite3rbu *pRbu){
168580 return pRbu->nProgress;
168581 }
168582
168583 /*
168584 ** Return permyriadage progress indications for the two main stages of
168585 ** an RBU update.
168586 */
168587 SQLITE_API void SQLITE_APICALL sqlite3rbu_bp_progress(sqlite3rbu *p, int *pnOne, int *pnTwo){
168588 const int MAX_PROGRESS = 10000;
168589 switch( p->eStage ){
168590 case RBU_STAGE_OAL:
168591 if( p->nPhaseOneStep>0 ){
168592 *pnOne = (int)(MAX_PROGRESS * (i64)p->nProgress/(i64)p->nPhaseOneStep);
@@ -168561,11 +168617,11 @@
168617 }
168618
168619 /*
168620 ** Return the current state of the RBU vacuum or update operation.
168621 */
168622 SQLITE_API int SQLITE_APICALL sqlite3rbu_state(sqlite3rbu *p){
168623 int aRes[] = {
168624 0, SQLITE_RBU_STATE_OAL, SQLITE_RBU_STATE_MOVE,
168625 0, SQLITE_RBU_STATE_CHECKPOINT, SQLITE_RBU_STATE_DONE
168626 };
168627
@@ -168589,11 +168645,11 @@
168645 );
168646 return aRes[p->eStage];
168647 }
168648 }
168649
168650 SQLITE_API int SQLITE_APICALL sqlite3rbu_savestate(sqlite3rbu *p){
168651 int rc = p->rc;
168652 if( rc==SQLITE_DONE ) return SQLITE_OK;
168653
168654 assert( p->eStage>=RBU_STAGE_OAL && p->eStage<=RBU_STAGE_DONE );
168655 if( p->eStage==RBU_STAGE_OAL ){
@@ -169416,11 +169472,11 @@
169472
169473 /*
169474 ** Deregister and destroy an RBU vfs created by an earlier call to
169475 ** sqlite3rbu_create_vfs().
169476 */
169477 SQLITE_API void SQLITE_APICALL sqlite3rbu_destroy_vfs(const char *zName){
169478 sqlite3_vfs *pVfs = sqlite3_vfs_find(zName);
169479 if( pVfs && pVfs->xOpen==rbuVfsOpen ){
169480 sqlite3_mutex_free(((rbu_vfs*)pVfs)->mutex);
169481 sqlite3_vfs_unregister(pVfs);
169482 sqlite3_free(pVfs);
@@ -169430,11 +169486,11 @@
169486 /*
169487 ** Create an RBU VFS named zName that accesses the underlying file-system
169488 ** via existing VFS zParent. The new object is registered as a non-default
169489 ** VFS with SQLite before returning.
169490 */
169491 SQLITE_API int SQLITE_APICALL sqlite3rbu_create_vfs(const char *zName, const char *zParent){
169492
169493 /* Template for VFS */
169494 static sqlite3_vfs vfs_template = {
169495 1, /* iVersion */
169496 0, /* szOsFile */
@@ -171675,11 +171731,11 @@
171731 }
171732
171733 return rc;
171734 }
171735
171736 SQLITE_API int SQLITE_APICALL sqlite3session_diff(
171737 sqlite3_session *pSession,
171738 const char *zFrom,
171739 const char *zTbl,
171740 char **pzErrMsg
171741 ){
@@ -171769,11 +171825,11 @@
171825
171826 /*
171827 ** Create a session object. This session object will record changes to
171828 ** database zDb attached to connection db.
171829 */
171830 SQLITE_API int SQLITE_APICALL sqlite3session_create(
171831 sqlite3 *db, /* Database handle */
171832 const char *zDb, /* Name of db (e.g. "main") */
171833 sqlite3_session **ppSession /* OUT: New session object */
171834 ){
171835 sqlite3_session *pNew; /* Newly allocated session object */
@@ -171831,11 +171887,11 @@
171887 }
171888
171889 /*
171890 ** Delete a session object previously allocated using sqlite3session_create().
171891 */
171892 SQLITE_API void SQLITE_APICALL sqlite3session_delete(sqlite3_session *pSession){
171893 sqlite3 *db = pSession->db;
171894 sqlite3_session *pHead;
171895 sqlite3_session **pp;
171896
171897 /* Unlink the session from the linked list of sessions attached to the
@@ -171860,11 +171916,11 @@
171916 }
171917
171918 /*
171919 ** Set a table filter on a Session Object.
171920 */
171921 SQLITE_API void SQLITE_APICALL sqlite3session_table_filter(
171922 sqlite3_session *pSession,
171923 int(*xFilter)(void*, const char*),
171924 void *pCtx /* First argument passed to xFilter */
171925 ){
171926 pSession->bAutoAttach = 1;
@@ -171878,11 +171934,11 @@
171934 **
171935 ** Only tables that have a PRIMARY KEY defined may be attached. It does
171936 ** not matter if the PRIMARY KEY is an "INTEGER PRIMARY KEY" (rowid alias)
171937 ** or not.
171938 */
171939 SQLITE_API int SQLITE_APICALL sqlite3session_attach(
171940 sqlite3_session *pSession, /* Session object */
171941 const char *zName /* Table name */
171942 ){
171943 int rc = SQLITE_OK;
171944 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
@@ -172568,11 +172624,11 @@
172624 ** session object passed as the first argument.
172625 **
172626 ** It is the responsibility of the caller to eventually free the buffer
172627 ** using sqlite3_free().
172628 */
172629 SQLITE_API int SQLITE_APICALL sqlite3session_changeset(
172630 sqlite3_session *pSession, /* Session object */
172631 int *pnChangeset, /* OUT: Size of buffer at *ppChangeset */
172632 void **ppChangeset /* OUT: Buffer containing changeset */
172633 ){
172634 return sessionGenerateChangeset(pSession, 0, 0, 0, pnChangeset, ppChangeset);
@@ -172579,11 +172635,11 @@
172635 }
172636
172637 /*
172638 ** Streaming version of sqlite3session_changeset().
172639 */
172640 SQLITE_API int SQLITE_APICALL sqlite3session_changeset_strm(
172641 sqlite3_session *pSession,
172642 int (*xOutput)(void *pOut, const void *pData, int nData),
172643 void *pOut
172644 ){
172645 return sessionGenerateChangeset(pSession, 0, xOutput, pOut, 0, 0);
@@ -172590,11 +172646,11 @@
172646 }
172647
172648 /*
172649 ** Streaming version of sqlite3session_patchset().
172650 */
172651 SQLITE_API int SQLITE_APICALL sqlite3session_patchset_strm(
172652 sqlite3_session *pSession,
172653 int (*xOutput)(void *pOut, const void *pData, int nData),
172654 void *pOut
172655 ){
172656 return sessionGenerateChangeset(pSession, 1, xOutput, pOut, 0, 0);
@@ -172605,11 +172661,11 @@
172661 ** session object passed as the first argument.
172662 **
172663 ** It is the responsibility of the caller to eventually free the buffer
172664 ** using sqlite3_free().
172665 */
172666 SQLITE_API int SQLITE_APICALL sqlite3session_patchset(
172667 sqlite3_session *pSession, /* Session object */
172668 int *pnPatchset, /* OUT: Size of buffer at *ppChangeset */
172669 void **ppPatchset /* OUT: Buffer containing changeset */
172670 ){
172671 return sessionGenerateChangeset(pSession, 1, 0, 0, pnPatchset, ppPatchset);
@@ -172616,11 +172672,11 @@
172672 }
172673
172674 /*
172675 ** Enable or disable the session object passed as the first argument.
172676 */
172677 SQLITE_API int SQLITE_APICALL sqlite3session_enable(sqlite3_session *pSession, int bEnable){
172678 int ret;
172679 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172680 if( bEnable>=0 ){
172681 pSession->bEnable = bEnable;
172682 }
@@ -172630,11 +172686,11 @@
172686 }
172687
172688 /*
172689 ** Enable or disable the session object passed as the first argument.
172690 */
172691 SQLITE_API int SQLITE_APICALL sqlite3session_indirect(sqlite3_session *pSession, int bIndirect){
172692 int ret;
172693 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172694 if( bIndirect>=0 ){
172695 pSession->bIndirect = bIndirect;
172696 }
@@ -172645,11 +172701,11 @@
172701
172702 /*
172703 ** Return true if there have been no changes to monitored tables recorded
172704 ** by the session object passed as the only argument.
172705 */
172706 SQLITE_API int SQLITE_APICALL sqlite3session_isempty(sqlite3_session *pSession){
172707 int ret = 0;
172708 SessionTable *pTab;
172709
172710 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172711 for(pTab=pSession->pTable; pTab && ret==0; pTab=pTab->pNext){
@@ -172695,11 +172751,11 @@
172751 }
172752
172753 /*
172754 ** Create an iterator used to iterate through the contents of a changeset.
172755 */
172756 SQLITE_API int SQLITE_APICALL sqlite3changeset_start(
172757 sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
172758 int nChangeset, /* Size of buffer pChangeset in bytes */
172759 void *pChangeset /* Pointer to buffer containing changeset */
172760 ){
172761 return sessionChangesetStart(pp, 0, 0, nChangeset, pChangeset);
@@ -172706,11 +172762,11 @@
172762 }
172763
172764 /*
172765 ** Streaming version of sqlite3changeset_start().
172766 */
172767 SQLITE_API int SQLITE_APICALL sqlite3changeset_start_strm(
172768 sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
172769 int (*xInput)(void *pIn, void *pData, int *pnData),
172770 void *pIn
172771 ){
172772 return sessionChangesetStart(pp, xInput, pIn, 0, 0);
@@ -173127,20 +173183,20 @@
173183 ** or SQLITE_CORRUPT.
173184 **
173185 ** This function may not be called on iterators passed to a conflict handler
173186 ** callback by changeset_apply().
173187 */
173188 SQLITE_API int SQLITE_APICALL sqlite3changeset_next(sqlite3_changeset_iter *p){
173189 return sessionChangesetNext(p, 0, 0);
173190 }
173191
173192 /*
173193 ** The following function extracts information on the current change
173194 ** from a changeset iterator. It may only be called after changeset_next()
173195 ** has returned SQLITE_ROW.
173196 */
173197 SQLITE_API int SQLITE_APICALL sqlite3changeset_op(
173198 sqlite3_changeset_iter *pIter, /* Iterator handle */
173199 const char **pzTab, /* OUT: Pointer to table name */
173200 int *pnCol, /* OUT: Number of columns in table */
173201 int *pOp, /* OUT: SQLITE_INSERT, DELETE or UPDATE */
173202 int *pbIndirect /* OUT: True if change is indirect */
@@ -173156,11 +173212,11 @@
173212 ** Return information regarding the PRIMARY KEY and number of columns in
173213 ** the database table affected by the change that pIter currently points
173214 ** to. This function may only be called after changeset_next() returns
173215 ** SQLITE_ROW.
173216 */
173217 SQLITE_API int SQLITE_APICALL sqlite3changeset_pk(
173218 sqlite3_changeset_iter *pIter, /* Iterator object */
173219 unsigned char **pabPK, /* OUT: Array of boolean - true for PK cols */
173220 int *pnCol /* OUT: Number of entries in output array */
173221 ){
173222 *pabPK = pIter->abPK;
@@ -173179,11 +173235,11 @@
173235 ** was not modified and is not a PK column), set *ppValue to NULL.
173236 **
173237 ** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is
173238 ** not modified. Otherwise, SQLITE_OK.
173239 */
173240 SQLITE_API int SQLITE_APICALL sqlite3changeset_old(
173241 sqlite3_changeset_iter *pIter, /* Changeset iterator */
173242 int iVal, /* Index of old.* value to retrieve */
173243 sqlite3_value **ppValue /* OUT: Old value (or NULL pointer) */
173244 ){
173245 if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_DELETE ){
@@ -173207,11 +173263,11 @@
173263 ** was not modified), set *ppValue to NULL.
173264 **
173265 ** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is
173266 ** not modified. Otherwise, SQLITE_OK.
173267 */
173268 SQLITE_API int SQLITE_APICALL sqlite3changeset_new(
173269 sqlite3_changeset_iter *pIter, /* Changeset iterator */
173270 int iVal, /* Index of new.* value to retrieve */
173271 sqlite3_value **ppValue /* OUT: New value (or NULL pointer) */
173272 ){
173273 if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_INSERT ){
@@ -173241,11 +173297,11 @@
173297 ** containing the iVal'th value of the conflicting record.
173298 **
173299 ** If value iVal is out-of-range or some other error occurs, an SQLite error
173300 ** code is returned. Otherwise, SQLITE_OK.
173301 */
173302 SQLITE_API int SQLITE_APICALL sqlite3changeset_conflict(
173303 sqlite3_changeset_iter *pIter, /* Changeset iterator */
173304 int iVal, /* Index of conflict record value to fetch */
173305 sqlite3_value **ppValue /* OUT: Value from conflicting row */
173306 ){
173307 if( !pIter->pConflict ){
@@ -173264,11 +173320,11 @@
173320 ** it sets the output variable to the total number of known foreign key
173321 ** violations in the destination database and returns SQLITE_OK.
173322 **
173323 ** In all other cases this function returns SQLITE_MISUSE.
173324 */
173325 SQLITE_API int SQLITE_APICALL sqlite3changeset_fk_conflicts(
173326 sqlite3_changeset_iter *pIter, /* Changeset iterator */
173327 int *pnOut /* OUT: Number of FK violations */
173328 ){
173329 if( pIter->pConflict || pIter->apValue ){
173330 return SQLITE_MISUSE;
@@ -173282,11 +173338,11 @@
173338 ** Finalize an iterator allocated with sqlite3changeset_start().
173339 **
173340 ** This function may not be called on iterators passed to a conflict handler
173341 ** callback by changeset_apply().
173342 */
173343 SQLITE_API int SQLITE_APICALL sqlite3changeset_finalize(sqlite3_changeset_iter *p){
173344 int rc = SQLITE_OK;
173345 if( p ){
173346 int i; /* Used to iterate through p->apValue[] */
173347 rc = p->rc;
173348 if( p->apValue ){
@@ -173456,11 +173512,11 @@
173512
173513
173514 /*
173515 ** Invert a changeset object.
173516 */
173517 SQLITE_API int SQLITE_APICALL sqlite3changeset_invert(
173518 int nChangeset, /* Number of bytes in input */
173519 const void *pChangeset, /* Input changeset */
173520 int *pnInverted, /* OUT: Number of bytes in output changeset */
173521 void **ppInverted /* OUT: Inverse of pChangeset */
173522 ){
@@ -173475,11 +173531,11 @@
173531 }
173532
173533 /*
173534 ** Streaming version of sqlite3changeset_invert().
173535 */
173536 SQLITE_API int SQLITE_APICALL sqlite3changeset_invert_strm(
173537 int (*xInput)(void *pIn, void *pData, int *pnData),
173538 void *pIn,
173539 int (*xOutput)(void *pOut, const void *pData, int nData),
173540 void *pOut
173541 ){
@@ -174355,11 +174411,11 @@
174411 /*
174412 ** Apply the changeset passed via pChangeset/nChangeset to the main database
174413 ** attached to handle "db". Invoke the supplied conflict handler callback
174414 ** to resolve any conflicts encountered while applying the change.
174415 */
174416 SQLITE_API int SQLITE_APICALL sqlite3changeset_apply(
174417 sqlite3 *db, /* Apply change to "main" db of this handle */
174418 int nChangeset, /* Size of changeset in bytes */
174419 void *pChangeset, /* Changeset blob */
174420 int(*xFilter)(
174421 void *pCtx, /* Copy of sixth arg to _apply() */
@@ -174383,11 +174439,11 @@
174439 /*
174440 ** Apply the changeset passed via xInput/pIn to the main database
174441 ** attached to handle "db". Invoke the supplied conflict handler callback
174442 ** to resolve any conflicts encountered while applying the change.
174443 */
174444 SQLITE_API int SQLITE_APICALL sqlite3changeset_apply_strm(
174445 sqlite3 *db, /* Apply change to "main" db of this handle */
174446 int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
174447 void *pIn, /* First arg for xInput */
174448 int(*xFilter)(
174449 void *pCtx, /* Copy of sixth arg to _apply() */
@@ -174718,11 +174774,11 @@
174774 }
174775
174776 /*
174777 ** Allocate a new, empty, sqlite3_changegroup.
174778 */
174779 SQLITE_API int SQLITE_APICALL sqlite3changegroup_new(sqlite3_changegroup **pp){
174780 int rc = SQLITE_OK; /* Return code */
174781 sqlite3_changegroup *p; /* New object */
174782 p = (sqlite3_changegroup*)sqlite3_malloc(sizeof(sqlite3_changegroup));
174783 if( p==0 ){
174784 rc = SQLITE_NOMEM;
@@ -174735,11 +174791,11 @@
174791
174792 /*
174793 ** Add the changeset currently stored in buffer pData, size nData bytes,
174794 ** to changeset-group p.
174795 */
174796 SQLITE_API int SQLITE_APICALL sqlite3changegroup_add(sqlite3_changegroup *pGrp, int nData, void *pData){
174797 sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */
174798 int rc; /* Return code */
174799
174800 rc = sqlite3changeset_start(&pIter, nData, pData);
174801 if( rc==SQLITE_OK ){
@@ -174751,11 +174807,11 @@
174807
174808 /*
174809 ** Obtain a buffer containing a changeset representing the concatenation
174810 ** of all changesets added to the group so far.
174811 */
174812 SQLITE_API int SQLITE_APICALL sqlite3changegroup_output(
174813 sqlite3_changegroup *pGrp,
174814 int *pnData,
174815 void **ppData
174816 ){
174817 return sessionChangegroupOutput(pGrp, 0, 0, pnData, ppData);
@@ -174762,11 +174818,11 @@
174818 }
174819
174820 /*
174821 ** Streaming versions of changegroup_add().
174822 */
174823 SQLITE_API int SQLITE_APICALL sqlite3changegroup_add_strm(
174824 sqlite3_changegroup *pGrp,
174825 int (*xInput)(void *pIn, void *pData, int *pnData),
174826 void *pIn
174827 ){
174828 sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */
@@ -174781,11 +174837,11 @@
174837 }
174838
174839 /*
174840 ** Streaming versions of changegroup_output().
174841 */
174842 SQLITE_API int SQLITE_APICALL sqlite3changegroup_output_strm(
174843 sqlite3_changegroup *pGrp,
174844 int (*xOutput)(void *pOut, const void *pData, int nData),
174845 void *pOut
174846 ){
174847 return sessionChangegroupOutput(pGrp, xOutput, pOut, 0, 0);
@@ -174792,21 +174848,21 @@
174848 }
174849
174850 /*
174851 ** Delete a changegroup object.
174852 */
174853 SQLITE_API void SQLITE_APICALL sqlite3changegroup_delete(sqlite3_changegroup *pGrp){
174854 if( pGrp ){
174855 sessionDeleteTable(pGrp->pList);
174856 sqlite3_free(pGrp);
174857 }
174858 }
174859
174860 /*
174861 ** Combine two changesets together.
174862 */
174863 SQLITE_API int SQLITE_APICALL sqlite3changeset_concat(
174864 int nLeft, /* Number of bytes in lhs input */
174865 void *pLeft, /* Lhs input changeset */
174866 int nRight /* Number of bytes in rhs input */,
174867 void *pRight, /* Rhs input changeset */
174868 int *pnOut, /* OUT: Number of bytes in output changeset */
@@ -174831,11 +174887,11 @@
174887 }
174888
174889 /*
174890 ** Streaming version of sqlite3changeset_concat().
174891 */
174892 SQLITE_API int SQLITE_APICALL sqlite3changeset_concat_strm(
174893 int (*xInputA)(void *pIn, void *pData, int *pnData),
174894 void *pInA,
174895 int (*xInputB)(void *pIn, void *pData, int *pnData),
174896 void *pInB,
174897 int (*xOutput)(void *pOut, const void *pData, int nData),
@@ -177062,11 +177118,11 @@
177118
177119 #ifndef SQLITE_CORE
177120 #ifdef _WIN32
177121 __declspec(dllexport)
177122 #endif
177123 SQLITE_API int SQLITE_APICALL sqlite3_json_init(
177124 sqlite3 *db,
177125 char **pzErrMsg,
177126 const sqlite3_api_routines *pApi
177127 ){
177128 SQLITE_EXTENSION_INIT2(pApi);
@@ -193895,11 +193951,11 @@
193951 int nArg, /* Number of args */
193952 sqlite3_value **apUnused /* Function arguments */
193953 ){
193954 assert( nArg==0 );
193955 UNUSED_PARAM2(nArg, apUnused);
193956 sqlite3_result_text(pCtx, "fts5: 2016-07-29 04:12:18 544c990afd3b64064cc4d970ec5d7eb23eeb9914", -1, SQLITE_TRANSIENT);
193957 }
193958
193959 static int fts5Init(sqlite3 *db){
193960 static const sqlite3_module fts5Mod = {
193961 /* iVersion */ 2,
@@ -193983,11 +194039,11 @@
194039 */
194040 #ifndef SQLITE_CORE
194041 #ifdef _WIN32
194042 __declspec(dllexport)
194043 #endif
194044 SQLITE_API int SQLITE_APICALL sqlite3_fts_init(
194045 sqlite3 *db,
194046 char **pzErrMsg,
194047 const sqlite3_api_routines *pApi
194048 ){
194049 SQLITE_EXTENSION_INIT2(pApi);
@@ -193996,11 +194052,11 @@
194052 }
194053
194054 #ifdef _WIN32
194055 __declspec(dllexport)
194056 #endif
194057 SQLITE_API int SQLITE_APICALL sqlite3_fts5_init(
194058 sqlite3 *db,
194059 char **pzErrMsg,
194060 const sqlite3_api_routines *pApi
194061 ){
194062 SQLITE_EXTENSION_INIT2(pApi);
194063
+464 -450
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -52,12 +52,21 @@
5252
# define SQLITE_API
5353
#endif
5454
#ifndef SQLITE_CDECL
5555
# define SQLITE_CDECL
5656
#endif
57
+#ifndef SQLITE_APICALL
58
+# define SQLITE_APICALL
59
+#endif
5760
#ifndef SQLITE_STDCALL
58
-# define SQLITE_STDCALL
61
+# define SQLITE_STDCALL SQLITE_APICALL
62
+#endif
63
+#ifndef SQLITE_CALLBACK
64
+# define SQLITE_CALLBACK
65
+#endif
66
+#ifndef SQLITE_SYSAPI
67
+# define SQLITE_SYSAPI
5968
#endif
6069
6170
/*
6271
** These no-op macros are used in front of interfaces to mark those
6372
** interfaces as either deprecated or experimental. New applications
@@ -111,11 +120,11 @@
111120
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
112121
** [sqlite_version()] and [sqlite_source_id()].
113122
*/
114123
#define SQLITE_VERSION "3.14.0"
115124
#define SQLITE_VERSION_NUMBER 3014000
116
-#define SQLITE_SOURCE_ID "2016-07-28 12:52:30 6feff15cae8f0427be790355841d49c479c1c586"
125
+#define SQLITE_SOURCE_ID "2016-07-29 04:12:18 544c990afd3b64064cc4d970ec5d7eb23eeb9914"
117126
118127
/*
119128
** CAPI3REF: Run-Time Library Version Numbers
120129
** KEYWORDS: sqlite3_version, sqlite3_sourceid
121130
**
@@ -144,13 +153,13 @@
144153
** [SQLITE_SOURCE_ID] C preprocessor macro.
145154
**
146155
** See also: [sqlite_version()] and [sqlite_source_id()].
147156
*/
148157
SQLITE_API SQLITE_EXTERN const char sqlite3_version[];
149
-SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void);
150
-SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void);
151
-SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void);
158
+SQLITE_API const char *SQLITE_APICALL sqlite3_libversion(void);
159
+SQLITE_API const char *SQLITE_APICALL sqlite3_sourceid(void);
160
+SQLITE_API int SQLITE_APICALL sqlite3_libversion_number(void);
152161
153162
/*
154163
** CAPI3REF: Run-Time Library Compilation Options Diagnostics
155164
**
156165
** ^The sqlite3_compileoption_used() function returns 0 or 1
@@ -171,12 +180,12 @@
171180
**
172181
** See also: SQL functions [sqlite_compileoption_used()] and
173182
** [sqlite_compileoption_get()] and the [compile_options pragma].
174183
*/
175184
#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
176
-SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName);
177
-SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N);
185
+SQLITE_API int SQLITE_APICALL sqlite3_compileoption_used(const char *zOptName);
186
+SQLITE_API const char *SQLITE_APICALL sqlite3_compileoption_get(int N);
178187
#endif
179188
180189
/*
181190
** CAPI3REF: Test To See If The Library Is Threadsafe
182191
**
@@ -211,11 +220,11 @@
211220
** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
212221
** is unchanged by calls to sqlite3_config().)^
213222
**
214223
** See the [threading mode] documentation for additional information.
215224
*/
216
-SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void);
225
+SQLITE_API int SQLITE_APICALL sqlite3_threadsafe(void);
217226
218227
/*
219228
** CAPI3REF: Database Connection Handle
220229
** KEYWORDS: {database connection} {database connections}
221230
**
@@ -308,19 +317,19 @@
308317
** from [sqlite3_open()], [sqlite3_open16()], or
309318
** [sqlite3_open_v2()], and not previously closed.
310319
** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
311320
** argument is a harmless no-op.
312321
*/
313
-SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3*);
314
-SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3*);
322
+SQLITE_API int SQLITE_APICALL sqlite3_close(sqlite3*);
323
+SQLITE_API int SQLITE_APICALL sqlite3_close_v2(sqlite3*);
315324
316325
/*
317326
** The type for a callback function.
318327
** This is legacy and deprecated. It is included for historical
319328
** compatibility and is not documented.
320329
*/
321
-typedef int (*sqlite3_callback)(void*,int,char**, char**);
330
+typedef int (SQLITE_CALLBACK *sqlite3_callback)(void*,int,char**, char**);
322331
323332
/*
324333
** CAPI3REF: One-Step Query Execution Interface
325334
** METHOD: sqlite3
326335
**
@@ -380,14 +389,14 @@
380389
** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
381390
** <li> The application must not modify the SQL statement text passed into
382391
** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
383392
** </ul>
384393
*/
385
-SQLITE_API int SQLITE_STDCALL sqlite3_exec(
394
+SQLITE_API int SQLITE_APICALL sqlite3_exec(
386395
sqlite3*, /* An open database */
387396
const char *sql, /* SQL to be evaluated */
388
- int (*callback)(void*,int,char**,char**), /* Callback function */
397
+ int (SQLITE_CALLBACK *callback)(void*,int,char**,char**), /* Callback function */
389398
void *, /* 1st argument to callback */
390399
char **errmsg /* Error msg written here */
391400
);
392401
393402
/*
@@ -731,30 +740,30 @@
731740
** database corruption.
732741
*/
733742
typedef struct sqlite3_io_methods sqlite3_io_methods;
734743
struct sqlite3_io_methods {
735744
int iVersion;
736
- int (*xClose)(sqlite3_file*);
737
- int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
738
- int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
739
- int (*xTruncate)(sqlite3_file*, sqlite3_int64 size);
740
- int (*xSync)(sqlite3_file*, int flags);
741
- int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
742
- int (*xLock)(sqlite3_file*, int);
743
- int (*xUnlock)(sqlite3_file*, int);
744
- int (*xCheckReservedLock)(sqlite3_file*, int *pResOut);
745
- int (*xFileControl)(sqlite3_file*, int op, void *pArg);
746
- int (*xSectorSize)(sqlite3_file*);
747
- int (*xDeviceCharacteristics)(sqlite3_file*);
745
+ int (SQLITE_CALLBACK *xClose)(sqlite3_file*);
746
+ int (SQLITE_CALLBACK *xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
747
+ int (SQLITE_CALLBACK *xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
748
+ int (SQLITE_CALLBACK *xTruncate)(sqlite3_file*, sqlite3_int64 size);
749
+ int (SQLITE_CALLBACK *xSync)(sqlite3_file*, int flags);
750
+ int (SQLITE_CALLBACK *xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
751
+ int (SQLITE_CALLBACK *xLock)(sqlite3_file*, int);
752
+ int (SQLITE_CALLBACK *xUnlock)(sqlite3_file*, int);
753
+ int (SQLITE_CALLBACK *xCheckReservedLock)(sqlite3_file*, int *pResOut);
754
+ int (SQLITE_CALLBACK *xFileControl)(sqlite3_file*, int op, void *pArg);
755
+ int (SQLITE_CALLBACK *xSectorSize)(sqlite3_file*);
756
+ int (SQLITE_CALLBACK *xDeviceCharacteristics)(sqlite3_file*);
748757
/* Methods above are valid for version 1 */
749
- int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
750
- int (*xShmLock)(sqlite3_file*, int offset, int n, int flags);
751
- void (*xShmBarrier)(sqlite3_file*);
752
- int (*xShmUnmap)(sqlite3_file*, int deleteFlag);
758
+ int (SQLITE_CALLBACK *xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
759
+ int (SQLITE_CALLBACK *xShmLock)(sqlite3_file*, int offset, int n, int flags);
760
+ void (SQLITE_CALLBACK *xShmBarrier)(sqlite3_file*);
761
+ int (SQLITE_CALLBACK *xShmUnmap)(sqlite3_file*, int deleteFlag);
753762
/* Methods above are valid for version 2 */
754
- int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
755
- int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p);
763
+ int (SQLITE_CALLBACK *xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
764
+ int (SQLITE_CALLBACK *xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p);
756765
/* Methods above are valid for version 3 */
757766
/* Additional methods may be added in future releases */
758767
};
759768
760769
/*
@@ -926,11 +935,11 @@
926935
** ^The [SQLITE_FCNTL_BUSYHANDLER]
927936
** file-control may be invoked by SQLite on the database file handle
928937
** shortly after it is opened in order to provide a custom VFS with access
929938
** to the connections busy-handler callback. The argument is of type (void **)
930939
** - an array of two (void *) values. The first (void *) actually points
931
-** to a function of type (int (*)(void *)). In order to invoke the connections
940
+** to a function of type (int (SQLITE_CALLBACK *)(void *)). In order to invoke the connections
932941
** busy-handler, this function should be invoked with the second (void *) in
933942
** the array as the only argument. If it returns non-zero, then the operation
934943
** should be retried. If it returns zero, the custom VFS should abandon the
935944
** current operation.
936945
**
@@ -1192,43 +1201,43 @@
11921201
** or all of these interfaces to be NULL or for their behavior to change
11931202
** from one release to the next. Applications must not attempt to access
11941203
** any of these methods if the iVersion of the VFS is less than 3.
11951204
*/
11961205
typedef struct sqlite3_vfs sqlite3_vfs;
1197
-typedef void (*sqlite3_syscall_ptr)(void);
1206
+typedef void (SQLITE_SYSAPI *sqlite3_syscall_ptr)(void);
11981207
struct sqlite3_vfs {
11991208
int iVersion; /* Structure version number (currently 3) */
12001209
int szOsFile; /* Size of subclassed sqlite3_file */
12011210
int mxPathname; /* Maximum file pathname length */
12021211
sqlite3_vfs *pNext; /* Next registered VFS */
12031212
const char *zName; /* Name of this virtual file system */
12041213
void *pAppData; /* Pointer to application-specific data */
1205
- int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
1214
+ int (SQLITE_CALLBACK *xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
12061215
int flags, int *pOutFlags);
1207
- int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
1208
- int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
1209
- int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
1210
- void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename);
1211
- void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
1212
- void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
1213
- void (*xDlClose)(sqlite3_vfs*, void*);
1214
- int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
1215
- int (*xSleep)(sqlite3_vfs*, int microseconds);
1216
- int (*xCurrentTime)(sqlite3_vfs*, double*);
1217
- int (*xGetLastError)(sqlite3_vfs*, int, char *);
1216
+ int (SQLITE_CALLBACK *xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
1217
+ int (SQLITE_CALLBACK *xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
1218
+ int (SQLITE_CALLBACK *xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
1219
+ void *(SQLITE_CALLBACK *xDlOpen)(sqlite3_vfs*, const char *zFilename);
1220
+ void (SQLITE_CALLBACK *xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
1221
+ void (SQLITE_CALLBACK *(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
1222
+ void (SQLITE_CALLBACK *xDlClose)(sqlite3_vfs*, void*);
1223
+ int (SQLITE_CALLBACK *xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
1224
+ int (SQLITE_CALLBACK *xSleep)(sqlite3_vfs*, int microseconds);
1225
+ int (SQLITE_CALLBACK *xCurrentTime)(sqlite3_vfs*, double*);
1226
+ int (SQLITE_CALLBACK *xGetLastError)(sqlite3_vfs*, int, char *);
12181227
/*
12191228
** The methods above are in version 1 of the sqlite_vfs object
12201229
** definition. Those that follow are added in version 2 or later
12211230
*/
1222
- int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
1231
+ int (SQLITE_CALLBACK *xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
12231232
/*
12241233
** The methods above are in versions 1 and 2 of the sqlite_vfs object.
12251234
** Those below are for version 3 and greater.
12261235
*/
1227
- int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
1228
- sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName);
1229
- const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName);
1236
+ int (SQLITE_CALLBACK *xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
1237
+ sqlite3_syscall_ptr (SQLITE_CALLBACK *xGetSystemCall)(sqlite3_vfs*, const char *zName);
1238
+ const char *(SQLITE_CALLBACK *xNextSystemCall)(sqlite3_vfs*, const char *zName);
12301239
/*
12311240
** The methods above are in versions 1 through 3 of the sqlite_vfs object.
12321241
** New fields may be appended in future versions. The iVersion
12331242
** value will increment whenever this happens.
12341243
*/
@@ -1369,14 +1378,14 @@
13691378
** sqlite3_os_init() and sqlite3_os_end(). An application-supplied
13701379
** implementation of sqlite3_os_init() or sqlite3_os_end()
13711380
** must return [SQLITE_OK] on success and some other [error code] upon
13721381
** failure.
13731382
*/
1374
-SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void);
1375
-SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void);
1376
-SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void);
1377
-SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void);
1383
+SQLITE_API int SQLITE_APICALL sqlite3_initialize(void);
1384
+SQLITE_API int SQLITE_APICALL sqlite3_shutdown(void);
1385
+SQLITE_API int SQLITE_APICALL sqlite3_os_init(void);
1386
+SQLITE_API int SQLITE_APICALL sqlite3_os_end(void);
13781387
13791388
/*
13801389
** CAPI3REF: Configuring The SQLite Library
13811390
**
13821391
** The sqlite3_config() interface is used to make global configuration
@@ -1491,17 +1500,17 @@
14911500
** SQLite will never invoke xInit() more than once without an intervening
14921501
** call to xShutdown().
14931502
*/
14941503
typedef struct sqlite3_mem_methods sqlite3_mem_methods;
14951504
struct sqlite3_mem_methods {
1496
- void *(*xMalloc)(int); /* Memory allocation function */
1497
- void (*xFree)(void*); /* Free a prior allocation */
1498
- void *(*xRealloc)(void*,int); /* Resize an allocation */
1499
- int (*xSize)(void*); /* Return the size of an allocation */
1500
- int (*xRoundup)(int); /* Round up request size to allocation size */
1501
- int (*xInit)(void*); /* Initialize the memory allocator */
1502
- void (*xShutdown)(void*); /* Deinitialize the memory allocator */
1505
+ void *(SQLITE_CALLBACK *xMalloc)(int); /* Memory allocation function */
1506
+ void (SQLITE_CALLBACK *xFree)(void*); /* Free a prior allocation */
1507
+ void *(SQLITE_CALLBACK *xRealloc)(void*,int); /* Resize an allocation */
1508
+ int (SQLITE_CALLBACK *xSize)(void*); /* Return the size of an allocation */
1509
+ int (SQLITE_CALLBACK *xRoundup)(int); /* Round up request size to allocation size */
1510
+ int (SQLITE_CALLBACK *xInit)(void*); /* Initialize the memory allocator */
1511
+ void (SQLITE_CALLBACK *xShutdown)(void*); /* Deinitialize the memory allocator */
15031512
void *pAppData; /* Argument to xInit() and xShutdown() */
15041513
};
15051514
15061515
/*
15071516
** CAPI3REF: Configuration Options
@@ -1714,11 +1723,11 @@
17141723
**
17151724
** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
17161725
** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
17171726
** global [error log].
17181727
** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a
1719
-** function with a call signature of void(*)(void*,int,const char*),
1728
+** function with a call signature of void(SQLITE_CALLBACK *)(void*,int,const char*),
17201729
** and a pointer to void. ^If the function pointer is not NULL, it is
17211730
** invoked by [sqlite3_log()] to process each logging event. ^If the
17221731
** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op.
17231732
** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is
17241733
** passed through as the first parameter to the application-defined logger
@@ -1767,11 +1776,11 @@
17671776
**
17681777
** [[SQLITE_CONFIG_SQLLOG]]
17691778
** <dt>SQLITE_CONFIG_SQLLOG
17701779
** <dd>This option is only available if sqlite is compiled with the
17711780
** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should
1772
-** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int).
1781
+** be a pointer to a function of type void(SQLITE_CALLBACK *)(void*,sqlite3*,const char*, int).
17731782
** The second should be of type (void*). The callback is invoked by the library
17741783
** in three separate circumstances, identified by the value passed as the
17751784
** fourth parameter. If the fourth parameter is 0, then the database connection
17761785
** passed as the second argument has just been opened. The third argument
17771786
** points to a buffer containing the name of the main database file. If the
@@ -1965,11 +1974,11 @@
19651974
**
19661975
** ^The sqlite3_extended_result_codes() routine enables or disables the
19671976
** [extended result codes] feature of SQLite. ^The extended result
19681977
** codes are disabled by default for historical compatibility.
19691978
*/
1970
-SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3*, int onoff);
1979
+SQLITE_API int SQLITE_APICALL sqlite3_extended_result_codes(sqlite3*, int onoff);
19711980
19721981
/*
19731982
** CAPI3REF: Last Insert Rowid
19741983
** METHOD: sqlite3
19751984
**
@@ -2017,11 +2026,11 @@
20172026
** function is running and thus changes the last insert [rowid],
20182027
** then the value returned by [sqlite3_last_insert_rowid()] is
20192028
** unpredictable and might not equal either the old or the new
20202029
** last insert [rowid].
20212030
*/
2022
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3*);
2031
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_last_insert_rowid(sqlite3*);
20232032
20242033
/*
20252034
** CAPI3REF: Count The Number Of Rows Modified
20262035
** METHOD: sqlite3
20272036
**
@@ -2070,11 +2079,11 @@
20702079
**
20712080
** If a separate thread makes changes on the same database connection
20722081
** while [sqlite3_changes()] is running then the value returned
20732082
** is unpredictable and not meaningful.
20742083
*/
2075
-SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3*);
2084
+SQLITE_API int SQLITE_APICALL sqlite3_changes(sqlite3*);
20762085
20772086
/*
20782087
** CAPI3REF: Total Number Of Rows Modified
20792088
** METHOD: sqlite3
20802089
**
@@ -2094,11 +2103,11 @@
20942103
**
20952104
** If a separate thread makes changes on the same database connection
20962105
** while [sqlite3_total_changes()] is running then the value
20972106
** returned is unpredictable and not meaningful.
20982107
*/
2099
-SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3*);
2108
+SQLITE_API int SQLITE_APICALL sqlite3_total_changes(sqlite3*);
21002109
21012110
/*
21022111
** CAPI3REF: Interrupt A Long-Running Query
21032112
** METHOD: sqlite3
21042113
**
@@ -2134,11 +2143,11 @@
21342143
** that are started after the sqlite3_interrupt() call returns.
21352144
**
21362145
** If the database connection closes while [sqlite3_interrupt()]
21372146
** is running then bad things will likely happen.
21382147
*/
2139
-SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3*);
2148
+SQLITE_API void SQLITE_APICALL sqlite3_interrupt(sqlite3*);
21402149
21412150
/*
21422151
** CAPI3REF: Determine If An SQL Statement Is Complete
21432152
**
21442153
** These routines are useful during command-line input to determine if the
@@ -2169,12 +2178,12 @@
21692178
** UTF-8 string.
21702179
**
21712180
** The input to [sqlite3_complete16()] must be a zero-terminated
21722181
** UTF-16 string in native byte order.
21732182
*/
2174
-SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *sql);
2175
-SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *sql);
2183
+SQLITE_API int SQLITE_APICALL sqlite3_complete(const char *sql);
2184
+SQLITE_API int SQLITE_APICALL sqlite3_complete16(const void *sql);
21762185
21772186
/*
21782187
** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
21792188
** KEYWORDS: {busy-handler callback} {busy handler}
21802189
** METHOD: sqlite3
@@ -2231,11 +2240,11 @@
22312240
** result in undefined behavior.
22322241
**
22332242
** A busy handler must not close the database connection
22342243
** or [prepared statement] that invoked the busy handler.
22352244
*/
2236
-SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*);
2245
+SQLITE_API int SQLITE_APICALL sqlite3_busy_handler(sqlite3*, int(SQLITE_CALLBACK *)(void*,int), void*);
22372246
22382247
/*
22392248
** CAPI3REF: Set A Busy Timeout
22402249
** METHOD: sqlite3
22412250
**
@@ -2254,11 +2263,11 @@
22542263
** was defined (using [sqlite3_busy_handler()]) prior to calling
22552264
** this routine, that other busy handler is cleared.)^
22562265
**
22572266
** See also: [PRAGMA busy_timeout]
22582267
*/
2259
-SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3*, int ms);
2268
+SQLITE_API int SQLITE_APICALL sqlite3_busy_timeout(sqlite3*, int ms);
22602269
22612270
/*
22622271
** CAPI3REF: Convenience Routines For Running Queries
22632272
** METHOD: sqlite3
22642273
**
@@ -2329,19 +2338,19 @@
23292338
** interface defined here. As a consequence, errors that occur in the
23302339
** wrapper layer outside of the internal [sqlite3_exec()] call are not
23312340
** reflected in subsequent calls to [sqlite3_errcode()] or
23322341
** [sqlite3_errmsg()].
23332342
*/
2334
-SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
2343
+SQLITE_API int SQLITE_APICALL sqlite3_get_table(
23352344
sqlite3 *db, /* An open database */
23362345
const char *zSql, /* SQL to be evaluated */
23372346
char ***pazResult, /* Results of the query */
23382347
int *pnRow, /* Number of result rows written here */
23392348
int *pnColumn, /* Number of result columns written here */
23402349
char **pzErrmsg /* Error msg written here */
23412350
);
2342
-SQLITE_API void SQLITE_STDCALL sqlite3_free_table(char **result);
2351
+SQLITE_API void SQLITE_APICALL sqlite3_free_table(char **result);
23432352
23442353
/*
23452354
** CAPI3REF: Formatted String Printing Functions
23462355
**
23472356
** These routines are work-alikes of the "printf()" family of functions
@@ -2444,13 +2453,13 @@
24442453
** ^(The "%z" formatting option works like "%s" but with the
24452454
** addition that after the string has been read and copied into
24462455
** the result, [sqlite3_free()] is called on the input string.)^
24472456
*/
24482457
SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...);
2449
-SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list);
2458
+SQLITE_API char *SQLITE_APICALL sqlite3_vmprintf(const char*, va_list);
24502459
SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...);
2451
-SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list);
2460
+SQLITE_API char *SQLITE_APICALL sqlite3_vsnprintf(int,char*,const char*, va_list);
24522461
24532462
/*
24542463
** CAPI3REF: Memory Allocation Subsystem
24552464
**
24562465
** The SQLite core uses these three routines for all of its own
@@ -2536,16 +2545,16 @@
25362545
**
25372546
** The application must not read or write any part of
25382547
** a block of memory after it has been released using
25392548
** [sqlite3_free()] or [sqlite3_realloc()].
25402549
*/
2541
-SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int);
2542
-SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64);
2543
-SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void*, int);
2544
-SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void*, sqlite3_uint64);
2545
-SQLITE_API void SQLITE_STDCALL sqlite3_free(void*);
2546
-SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void*);
2550
+SQLITE_API void *SQLITE_APICALL sqlite3_malloc(int);
2551
+SQLITE_API void *SQLITE_APICALL sqlite3_malloc64(sqlite3_uint64);
2552
+SQLITE_API void *SQLITE_APICALL sqlite3_realloc(void*, int);
2553
+SQLITE_API void *SQLITE_APICALL sqlite3_realloc64(void*, sqlite3_uint64);
2554
+SQLITE_API void SQLITE_APICALL sqlite3_free(void*);
2555
+SQLITE_API sqlite3_uint64 SQLITE_APICALL sqlite3_msize(void*);
25472556
25482557
/*
25492558
** CAPI3REF: Memory Allocator Statistics
25502559
**
25512560
** SQLite provides these two interfaces for reporting on the status
@@ -2566,12 +2575,12 @@
25662575
** [sqlite3_memory_used()] if and only if the parameter to
25672576
** [sqlite3_memory_highwater()] is true. ^The value returned
25682577
** by [sqlite3_memory_highwater(1)] is the high-water mark
25692578
** prior to the reset.
25702579
*/
2571
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void);
2572
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag);
2580
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_used(void);
2581
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_highwater(int resetFlag);
25732582
25742583
/*
25752584
** CAPI3REF: Pseudo-Random Number Generator
25762585
**
25772586
** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
@@ -2590,11 +2599,11 @@
25902599
** ^If the previous call to this routine had an N of 1 or more and a
25912600
** non-NULL P then the pseudo-randomness is generated
25922601
** internally and without recourse to the [sqlite3_vfs] xRandomness
25932602
** method.
25942603
*/
2595
-SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *P);
2604
+SQLITE_API void SQLITE_APICALL sqlite3_randomness(int N, void *P);
25962605
25972606
/*
25982607
** CAPI3REF: Compile-Time Authorization Callbacks
25992608
** METHOD: sqlite3
26002609
**
@@ -2673,13 +2682,13 @@
26732682
** [sqlite3_prepare()] or its variants. Authorization is not
26742683
** performed during statement evaluation in [sqlite3_step()], unless
26752684
** as stated in the previous paragraph, sqlite3_step() invokes
26762685
** sqlite3_prepare_v2() to reprepare a statement after a schema change.
26772686
*/
2678
-SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
2687
+SQLITE_API int SQLITE_APICALL sqlite3_set_authorizer(
26792688
sqlite3*,
2680
- int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
2689
+ int (SQLITE_CALLBACK *xAuth)(void*,int,const char*,const char*,const char*,const char*),
26812690
void *pUserData
26822691
);
26832692
26842693
/*
26852694
** CAPI3REF: Authorizer Return Codes
@@ -2781,14 +2790,14 @@
27812790
** digits in the time are meaningless. Future versions of SQLite
27822791
** might provide greater resolution on the profiler callback. The
27832792
** sqlite3_profile() function is considered experimental and is
27842793
** subject to change in future versions of SQLite.
27852794
*/
2786
-SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_trace(sqlite3*,
2787
- void(*xTrace)(void*,const char*), void*);
2788
-SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_profile(sqlite3*,
2789
- void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
2795
+SQLITE_API SQLITE_DEPRECATED void *SQLITE_APICALL sqlite3_trace(sqlite3*,
2796
+ void(SQLITE_CALLBACK *xTrace)(void*,const char*), void*);
2797
+SQLITE_API SQLITE_DEPRECATED void *SQLITE_APICALL sqlite3_profile(sqlite3*,
2798
+ void(SQLITE_CALLBACK *xProfile)(void*,const char*,sqlite3_uint64), void*);
27902799
27912800
/*
27922801
** CAPI3REF: SQL Trace Event Codes
27932802
** KEYWORDS: SQLITE_TRACE
27942803
**
@@ -2872,14 +2881,14 @@
28722881
**
28732882
** The sqlite3_trace_v2() interface is intended to replace the legacy
28742883
** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which
28752884
** are deprecated.
28762885
*/
2877
-SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2(
2886
+SQLITE_API int SQLITE_APICALL sqlite3_trace_v2(
28782887
sqlite3*,
28792888
unsigned uMask,
2880
- int(*xCallback)(unsigned,void*,void*,void*),
2889
+ int(SQLITE_CALLBACK *xCallback)(unsigned,void*,void*,void*),
28812890
void *pCtx
28822891
);
28832892
28842893
/*
28852894
** CAPI3REF: Query Progress Callbacks
@@ -2911,11 +2920,11 @@
29112920
** the database connection that invoked the progress handler.
29122921
** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
29132922
** database connections for the meaning of "modify" in this paragraph.
29142923
**
29152924
*/
2916
-SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
2925
+SQLITE_API void SQLITE_APICALL sqlite3_progress_handler(sqlite3*, int, int(SQLITE_CALLBACK *)(void*), void*);
29172926
29182927
/*
29192928
** CAPI3REF: Opening A New Database Connection
29202929
** CONSTRUCTOR: sqlite3
29212930
**
@@ -3140,19 +3149,19 @@
31403149
** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various
31413150
** features that require the use of temporary files may fail.
31423151
**
31433152
** See also: [sqlite3_temp_directory]
31443153
*/
3145
-SQLITE_API int SQLITE_STDCALL sqlite3_open(
3154
+SQLITE_API int SQLITE_APICALL sqlite3_open(
31463155
const char *filename, /* Database filename (UTF-8) */
31473156
sqlite3 **ppDb /* OUT: SQLite db handle */
31483157
);
3149
-SQLITE_API int SQLITE_STDCALL sqlite3_open16(
3158
+SQLITE_API int SQLITE_APICALL sqlite3_open16(
31503159
const void *filename, /* Database filename (UTF-16) */
31513160
sqlite3 **ppDb /* OUT: SQLite db handle */
31523161
);
3153
-SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
3162
+SQLITE_API int SQLITE_APICALL sqlite3_open_v2(
31543163
const char *filename, /* Database filename (UTF-8) */
31553164
sqlite3 **ppDb, /* OUT: SQLite db handle */
31563165
int flags, /* Flags */
31573166
const char *zVfs /* Name of VFS module to use */
31583167
);
@@ -3194,13 +3203,13 @@
31943203
** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and
31953204
** is not a database file pathname pointer that SQLite passed into the xOpen
31963205
** VFS method, then the behavior of this routine is undefined and probably
31973206
** undesirable.
31983207
*/
3199
-SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3200
-SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3201
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
3208
+SQLITE_API const char *SQLITE_APICALL sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3209
+SQLITE_API int SQLITE_APICALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3210
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
32023211
32033212
32043213
/*
32053214
** CAPI3REF: Error Codes And Messages
32063215
** METHOD: sqlite3
@@ -3240,15 +3249,15 @@
32403249
**
32413250
** If an interface fails with SQLITE_MISUSE, that means the interface
32423251
** was invoked incorrectly by the application. In that case, the
32433252
** error code and message may or may not be set.
32443253
*/
3245
-SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db);
3246
-SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db);
3247
-SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*);
3248
-SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*);
3249
-SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int);
3254
+SQLITE_API int SQLITE_APICALL sqlite3_errcode(sqlite3 *db);
3255
+SQLITE_API int SQLITE_APICALL sqlite3_extended_errcode(sqlite3 *db);
3256
+SQLITE_API const char *SQLITE_APICALL sqlite3_errmsg(sqlite3*);
3257
+SQLITE_API const void *SQLITE_APICALL sqlite3_errmsg16(sqlite3*);
3258
+SQLITE_API const char *SQLITE_APICALL sqlite3_errstr(int);
32503259
32513260
/*
32523261
** CAPI3REF: Prepared Statement Object
32533262
** KEYWORDS: {prepared statement} {prepared statements}
32543263
**
@@ -3312,11 +3321,11 @@
33123321
** created by an untrusted script can be contained using the
33133322
** [max_page_count] [PRAGMA].
33143323
**
33153324
** New run-time limit categories may be added in future releases.
33163325
*/
3317
-SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3*, int id, int newVal);
3326
+SQLITE_API int SQLITE_APICALL sqlite3_limit(sqlite3*, int id, int newVal);
33183327
33193328
/*
33203329
** CAPI3REF: Run-Time Limit Categories
33213330
** KEYWORDS: {limit category} {*limit categories}
33223331
**
@@ -3464,32 +3473,32 @@
34643473
** or [GLOB] operator or if the parameter is compared to an indexed column
34653474
** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
34663475
** </li>
34673476
** </ol>
34683477
*/
3469
-SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
3478
+SQLITE_API int SQLITE_APICALL sqlite3_prepare(
34703479
sqlite3 *db, /* Database handle */
34713480
const char *zSql, /* SQL statement, UTF-8 encoded */
34723481
int nByte, /* Maximum length of zSql in bytes. */
34733482
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
34743483
const char **pzTail /* OUT: Pointer to unused portion of zSql */
34753484
);
3476
-SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
3485
+SQLITE_API int SQLITE_APICALL sqlite3_prepare_v2(
34773486
sqlite3 *db, /* Database handle */
34783487
const char *zSql, /* SQL statement, UTF-8 encoded */
34793488
int nByte, /* Maximum length of zSql in bytes. */
34803489
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
34813490
const char **pzTail /* OUT: Pointer to unused portion of zSql */
34823491
);
3483
-SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
3492
+SQLITE_API int SQLITE_APICALL sqlite3_prepare16(
34843493
sqlite3 *db, /* Database handle */
34853494
const void *zSql, /* SQL statement, UTF-16 encoded */
34863495
int nByte, /* Maximum length of zSql in bytes. */
34873496
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
34883497
const void **pzTail /* OUT: Pointer to unused portion of zSql */
34893498
);
3490
-SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
3499
+SQLITE_API int SQLITE_APICALL sqlite3_prepare16_v2(
34913500
sqlite3 *db, /* Database handle */
34923501
const void *zSql, /* SQL statement, UTF-16 encoded */
34933502
int nByte, /* Maximum length of zSql in bytes. */
34943503
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
34953504
const void **pzTail /* OUT: Pointer to unused portion of zSql */
@@ -3524,12 +3533,12 @@
35243533
** automatically freed when the prepared statement is finalized.
35253534
** ^The string returned by sqlite3_expanded_sql(P), on the other hand,
35263535
** is obtained from [sqlite3_malloc()] and must be free by the application
35273536
** by passing it to [sqlite3_free()].
35283537
*/
3529
-SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt);
3530
-SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt);
3538
+SQLITE_API const char *SQLITE_APICALL sqlite3_sql(sqlite3_stmt *pStmt);
3539
+SQLITE_API char *SQLITE_APICALL sqlite3_expanded_sql(sqlite3_stmt *pStmt);
35313540
35323541
/*
35333542
** CAPI3REF: Determine If An SQL Statement Writes The Database
35343543
** METHOD: sqlite3_stmt
35353544
**
@@ -3557,11 +3566,11 @@
35573566
** database. ^The [ATTACH] and [DETACH] statements also cause
35583567
** sqlite3_stmt_readonly() to return true since, while those statements
35593568
** change the configuration of a database connection, they do not make
35603569
** changes to the content of the database files on disk.
35613570
*/
3562
-SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
3571
+SQLITE_API int SQLITE_APICALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
35633572
35643573
/*
35653574
** CAPI3REF: Determine If A Prepared Statement Has Been Reset
35663575
** METHOD: sqlite3_stmt
35673576
**
@@ -3578,11 +3587,11 @@
35783587
** to locate all prepared statements associated with a database
35793588
** connection that are in need of being reset. This can be used,
35803589
** for example, in diagnostic routines to search for prepared
35813590
** statements that are holding a transaction open.
35823591
*/
3583
-SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt*);
3592
+SQLITE_API int SQLITE_APICALL sqlite3_stmt_busy(sqlite3_stmt*);
35843593
35853594
/*
35863595
** CAPI3REF: Dynamically Typed Value Object
35873596
** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
35883597
**
@@ -3742,24 +3751,24 @@
37423751
** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails.
37433752
**
37443753
** See also: [sqlite3_bind_parameter_count()],
37453754
** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].
37463755
*/
3747
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
3748
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
3749
- void(*)(void*));
3750
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt*, int, double);
3751
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt*, int, int);
3752
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
3753
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt*, int);
3754
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
3755
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
3756
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
3757
- void(*)(void*), unsigned char encoding);
3758
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
3759
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
3760
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
3756
+SQLITE_API int SQLITE_APICALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(SQLITE_CALLBACK *)(void*));
3757
+SQLITE_API int SQLITE_APICALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
3758
+ void(SQLITE_CALLBACK *)(void*));
3759
+SQLITE_API int SQLITE_APICALL sqlite3_bind_double(sqlite3_stmt*, int, double);
3760
+SQLITE_API int SQLITE_APICALL sqlite3_bind_int(sqlite3_stmt*, int, int);
3761
+SQLITE_API int SQLITE_APICALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
3762
+SQLITE_API int SQLITE_APICALL sqlite3_bind_null(sqlite3_stmt*, int);
3763
+SQLITE_API int SQLITE_APICALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(SQLITE_CALLBACK *)(void*));
3764
+SQLITE_API int SQLITE_APICALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(SQLITE_CALLBACK *)(void*));
3765
+SQLITE_API int SQLITE_APICALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
3766
+ void(SQLITE_CALLBACK *)(void*), unsigned char encoding);
3767
+SQLITE_API int SQLITE_APICALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
3768
+SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
3769
+SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
37613770
37623771
/*
37633772
** CAPI3REF: Number Of SQL Parameters
37643773
** METHOD: sqlite3_stmt
37653774
**
@@ -3776,11 +3785,11 @@
37763785
**
37773786
** See also: [sqlite3_bind_blob|sqlite3_bind()],
37783787
** [sqlite3_bind_parameter_name()], and
37793788
** [sqlite3_bind_parameter_index()].
37803789
*/
3781
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt*);
3790
+SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_count(sqlite3_stmt*);
37823791
37833792
/*
37843793
** CAPI3REF: Name Of A Host Parameter
37853794
** METHOD: sqlite3_stmt
37863795
**
@@ -3804,11 +3813,11 @@
38043813
**
38053814
** See also: [sqlite3_bind_blob|sqlite3_bind()],
38063815
** [sqlite3_bind_parameter_count()], and
38073816
** [sqlite3_bind_parameter_index()].
38083817
*/
3809
-SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
3818
+SQLITE_API const char *SQLITE_APICALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
38103819
38113820
/*
38123821
** CAPI3REF: Index Of A Parameter With A Given Name
38133822
** METHOD: sqlite3_stmt
38143823
**
@@ -3821,21 +3830,21 @@
38213830
**
38223831
** See also: [sqlite3_bind_blob|sqlite3_bind()],
38233832
** [sqlite3_bind_parameter_count()], and
38243833
** [sqlite3_bind_parameter_name()].
38253834
*/
3826
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
3835
+SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
38273836
38283837
/*
38293838
** CAPI3REF: Reset All Bindings On A Prepared Statement
38303839
** METHOD: sqlite3_stmt
38313840
**
38323841
** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset
38333842
** the [sqlite3_bind_blob | bindings] on a [prepared statement].
38343843
** ^Use this routine to reset all host parameters to NULL.
38353844
*/
3836
-SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt*);
3845
+SQLITE_API int SQLITE_APICALL sqlite3_clear_bindings(sqlite3_stmt*);
38373846
38383847
/*
38393848
** CAPI3REF: Number Of Columns In A Result Set
38403849
** METHOD: sqlite3_stmt
38413850
**
@@ -3843,11 +3852,11 @@
38433852
** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
38443853
** statement that does not return data (for example an [UPDATE]).
38453854
**
38463855
** See also: [sqlite3_data_count()]
38473856
*/
3848
-SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt);
3857
+SQLITE_API int SQLITE_APICALL sqlite3_column_count(sqlite3_stmt *pStmt);
38493858
38503859
/*
38513860
** CAPI3REF: Column Names In A Result Set
38523861
** METHOD: sqlite3_stmt
38533862
**
@@ -3872,12 +3881,12 @@
38723881
** ^The name of a result column is the value of the "AS" clause for
38733882
** that column, if there is an AS clause. If there is no AS clause
38743883
** then the name of the column is unspecified and may change from
38753884
** one release of SQLite to the next.
38763885
*/
3877
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt*, int N);
3878
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt*, int N);
3886
+SQLITE_API const char *SQLITE_APICALL sqlite3_column_name(sqlite3_stmt*, int N);
3887
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_name16(sqlite3_stmt*, int N);
38793888
38803889
/*
38813890
** CAPI3REF: Source Of Data In A Query Result
38823891
** METHOD: sqlite3_stmt
38833892
**
@@ -3921,16 +3930,16 @@
39213930
** If two or more threads call one or more
39223931
** [sqlite3_column_database_name | column metadata interfaces]
39233932
** for the same [prepared statement] and result column
39243933
** at the same time then the results are undefined.
39253934
*/
3926
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int);
3927
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int);
3928
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int);
3929
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int);
3930
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int);
3931
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
3935
+SQLITE_API const char *SQLITE_APICALL sqlite3_column_database_name(sqlite3_stmt*,int);
3936
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_database_name16(sqlite3_stmt*,int);
3937
+SQLITE_API const char *SQLITE_APICALL sqlite3_column_table_name(sqlite3_stmt*,int);
3938
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_table_name16(sqlite3_stmt*,int);
3939
+SQLITE_API const char *SQLITE_APICALL sqlite3_column_origin_name(sqlite3_stmt*,int);
3940
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
39323941
39333942
/*
39343943
** CAPI3REF: Declared Datatype Of A Query Result
39353944
** METHOD: sqlite3_stmt
39363945
**
@@ -3958,12 +3967,12 @@
39583967
** data stored in that column is of the declared type. SQLite is
39593968
** strongly typed, but the typing is dynamic not static. ^Type
39603969
** is associated with individual values, not with the containers
39613970
** used to hold those values.
39623971
*/
3963
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt*,int);
3964
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt*,int);
3972
+SQLITE_API const char *SQLITE_APICALL sqlite3_column_decltype(sqlite3_stmt*,int);
3973
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_decltype16(sqlite3_stmt*,int);
39653974
39663975
/*
39673976
** CAPI3REF: Evaluate An SQL Statement
39683977
** METHOD: sqlite3_stmt
39693978
**
@@ -4039,11 +4048,11 @@
40394048
** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
40404049
** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,
40414050
** then the more specific [error codes] are returned directly
40424051
** by sqlite3_step(). The use of the "v2" interface is recommended.
40434052
*/
4044
-SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt*);
4053
+SQLITE_API int SQLITE_APICALL sqlite3_step(sqlite3_stmt*);
40454054
40464055
/*
40474056
** CAPI3REF: Number of columns in a result set
40484057
** METHOD: sqlite3_stmt
40494058
**
@@ -4060,11 +4069,11 @@
40604069
** where it always returns zero since each step of that multi-step
40614070
** pragma returns 0 columns of data.
40624071
**
40634072
** See also: [sqlite3_column_count()]
40644073
*/
4065
-SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt);
4074
+SQLITE_API int SQLITE_APICALL sqlite3_data_count(sqlite3_stmt *pStmt);
40664075
40674076
/*
40684077
** CAPI3REF: Fundamental Datatypes
40694078
** KEYWORDS: SQLITE_TEXT
40704079
**
@@ -4250,20 +4259,20 @@
42504259
** of these routines, a default value is returned. The default value
42514260
** is either the integer 0, the floating point number 0.0, or a NULL
42524261
** pointer. Subsequent calls to [sqlite3_errcode()] will return
42534262
** [SQLITE_NOMEM].)^
42544263
*/
4255
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt*, int iCol);
4256
-SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4257
-SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4258
-SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt*, int iCol);
4259
-SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt*, int iCol);
4260
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt*, int iCol);
4261
-SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt*, int iCol);
4262
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt*, int iCol);
4263
-SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt*, int iCol);
4264
-SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt*, int iCol);
4264
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_blob(sqlite3_stmt*, int iCol);
4265
+SQLITE_API int SQLITE_APICALL sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4266
+SQLITE_API int SQLITE_APICALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4267
+SQLITE_API double SQLITE_APICALL sqlite3_column_double(sqlite3_stmt*, int iCol);
4268
+SQLITE_API int SQLITE_APICALL sqlite3_column_int(sqlite3_stmt*, int iCol);
4269
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_column_int64(sqlite3_stmt*, int iCol);
4270
+SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_column_text(sqlite3_stmt*, int iCol);
4271
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_text16(sqlite3_stmt*, int iCol);
4272
+SQLITE_API int SQLITE_APICALL sqlite3_column_type(sqlite3_stmt*, int iCol);
4273
+SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_column_value(sqlite3_stmt*, int iCol);
42654274
42664275
/*
42674276
** CAPI3REF: Destroy A Prepared Statement Object
42684277
** DESTRUCTOR: sqlite3_stmt
42694278
**
@@ -4287,11 +4296,11 @@
42874296
** resource leaks. It is a grievous error for the application to try to use
42884297
** a prepared statement after it has been finalized. Any use of a prepared
42894298
** statement after it has been finalized can result in undefined and
42904299
** undesirable behavior such as segfaults and heap corruption.
42914300
*/
4292
-SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt);
4301
+SQLITE_API int SQLITE_APICALL sqlite3_finalize(sqlite3_stmt *pStmt);
42934302
42944303
/*
42954304
** CAPI3REF: Reset A Prepared Statement Object
42964305
** METHOD: sqlite3_stmt
42974306
**
@@ -4314,11 +4323,11 @@
43144323
** [sqlite3_reset(S)] returns an appropriate [error code].
43154324
**
43164325
** ^The [sqlite3_reset(S)] interface does not change the values
43174326
** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
43184327
*/
4319
-SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt);
4328
+SQLITE_API int SQLITE_APICALL sqlite3_reset(sqlite3_stmt *pStmt);
43204329
43214330
/*
43224331
** CAPI3REF: Create Or Redefine SQL Functions
43234332
** KEYWORDS: {function creation routines}
43244333
** KEYWORDS: {application-defined SQL function}
@@ -4414,40 +4423,40 @@
44144423
** ^An application-defined function is permitted to call other
44154424
** SQLite interfaces. However, such calls must not
44164425
** close the database connection nor finalize or reset the prepared
44174426
** statement in which the function is running.
44184427
*/
4419
-SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
4428
+SQLITE_API int SQLITE_APICALL sqlite3_create_function(
44204429
sqlite3 *db,
44214430
const char *zFunctionName,
44224431
int nArg,
44234432
int eTextRep,
44244433
void *pApp,
4425
- void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4426
- void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4427
- void (*xFinal)(sqlite3_context*)
4434
+ void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**),
4435
+ void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**),
4436
+ void (SQLITE_CALLBACK *xFinal)(sqlite3_context*)
44284437
);
4429
-SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
4438
+SQLITE_API int SQLITE_APICALL sqlite3_create_function16(
44304439
sqlite3 *db,
44314440
const void *zFunctionName,
44324441
int nArg,
44334442
int eTextRep,
44344443
void *pApp,
4435
- void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4436
- void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4437
- void (*xFinal)(sqlite3_context*)
4444
+ void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**),
4445
+ void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**),
4446
+ void (SQLITE_CALLBACK *xFinal)(sqlite3_context*)
44384447
);
4439
-SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
4448
+SQLITE_API int SQLITE_APICALL sqlite3_create_function_v2(
44404449
sqlite3 *db,
44414450
const char *zFunctionName,
44424451
int nArg,
44434452
int eTextRep,
44444453
void *pApp,
4445
- void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4446
- void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4447
- void (*xFinal)(sqlite3_context*),
4448
- void(*xDestroy)(void*)
4454
+ void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**),
4455
+ void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**),
4456
+ void (SQLITE_CALLBACK *xFinal)(sqlite3_context*),
4457
+ void(SQLITE_CALLBACK *xDestroy)(void*)
44494458
);
44504459
44514460
/*
44524461
** CAPI3REF: Text Encodings
44534462
**
@@ -4480,16 +4489,16 @@
44804489
** to be supported. However, new applications should avoid
44814490
** the use of these functions. To encourage programmers to avoid
44824491
** these functions, we will not explain what they do.
44834492
*/
44844493
#ifndef SQLITE_OMIT_DEPRECATED
4485
-SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context*);
4486
-SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt*);
4487
-SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4488
-SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_global_recover(void);
4489
-SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_thread_cleanup(void);
4490
-SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
4494
+SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_aggregate_count(sqlite3_context*);
4495
+SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_expired(sqlite3_stmt*);
4496
+SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4497
+SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_global_recover(void);
4498
+SQLITE_API SQLITE_DEPRECATED void SQLITE_APICALL sqlite3_thread_cleanup(void);
4499
+SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_memory_alarm(void(SQLITE_CALLBACK *)(void*,sqlite3_int64,int),
44914500
void*,sqlite3_int64);
44924501
#endif
44934502
44944503
/*
44954504
** CAPI3REF: Obtaining SQL Values
@@ -4535,22 +4544,22 @@
45354544
** or [sqlite3_value_text16()].
45364545
**
45374546
** These routines must be called from the same thread as
45384547
** the SQL function that supplied the [sqlite3_value*] parameters.
45394548
*/
4540
-SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value*);
4541
-SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value*);
4542
-SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value*);
4543
-SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value*);
4544
-SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value*);
4545
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value*);
4546
-SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value*);
4547
-SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value*);
4548
-SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value*);
4549
-SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*);
4550
-SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*);
4551
-SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*);
4549
+SQLITE_API const void *SQLITE_APICALL sqlite3_value_blob(sqlite3_value*);
4550
+SQLITE_API int SQLITE_APICALL sqlite3_value_bytes(sqlite3_value*);
4551
+SQLITE_API int SQLITE_APICALL sqlite3_value_bytes16(sqlite3_value*);
4552
+SQLITE_API double SQLITE_APICALL sqlite3_value_double(sqlite3_value*);
4553
+SQLITE_API int SQLITE_APICALL sqlite3_value_int(sqlite3_value*);
4554
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_value_int64(sqlite3_value*);
4555
+SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_value_text(sqlite3_value*);
4556
+SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16(sqlite3_value*);
4557
+SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16le(sqlite3_value*);
4558
+SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16be(sqlite3_value*);
4559
+SQLITE_API int SQLITE_APICALL sqlite3_value_type(sqlite3_value*);
4560
+SQLITE_API int SQLITE_APICALL sqlite3_value_numeric_type(sqlite3_value*);
45524561
45534562
/*
45544563
** CAPI3REF: Finding The Subtype Of SQL Values
45554564
** METHOD: sqlite3_value
45564565
**
@@ -4562,11 +4571,11 @@
45624571
**
45634572
** SQLite makes no use of subtype itself. It merely passes the subtype
45644573
** from the result of one [application-defined SQL function] into the
45654574
** input of another.
45664575
*/
4567
-SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value*);
4576
+SQLITE_API unsigned int SQLITE_APICALL sqlite3_value_subtype(sqlite3_value*);
45684577
45694578
/*
45704579
** CAPI3REF: Copy And Free SQL Values
45714580
** METHOD: sqlite3_value
45724581
**
@@ -4578,12 +4587,12 @@
45784587
**
45794588
** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object
45804589
** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer
45814590
** then sqlite3_value_free(V) is a harmless no-op.
45824591
*/
4583
-SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value*);
4584
-SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value*);
4592
+SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_value_dup(const sqlite3_value*);
4593
+SQLITE_API void SQLITE_APICALL sqlite3_value_free(sqlite3_value*);
45854594
45864595
/*
45874596
** CAPI3REF: Obtain Aggregate Function Context
45884597
** METHOD: sqlite3_context
45894598
**
@@ -4624,11 +4633,11 @@
46244633
** function.
46254634
**
46264635
** This routine must be called from the same thread in which
46274636
** the aggregate SQL function is running.
46284637
*/
4629
-SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
4638
+SQLITE_API void *SQLITE_APICALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
46304639
46314640
/*
46324641
** CAPI3REF: User Data For Functions
46334642
** METHOD: sqlite3_context
46344643
**
@@ -4639,11 +4648,11 @@
46394648
** registered the application defined function.
46404649
**
46414650
** This routine must be called from the same thread in which
46424651
** the application-defined function is running.
46434652
*/
4644
-SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context*);
4653
+SQLITE_API void *SQLITE_APICALL sqlite3_user_data(sqlite3_context*);
46454654
46464655
/*
46474656
** CAPI3REF: Database Connection For Functions
46484657
** METHOD: sqlite3_context
46494658
**
@@ -4651,11 +4660,11 @@
46514660
** the pointer to the [database connection] (the 1st parameter)
46524661
** of the [sqlite3_create_function()]
46534662
** and [sqlite3_create_function16()] routines that originally
46544663
** registered the application defined function.
46554664
*/
4656
-SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context*);
4665
+SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_context_db_handle(sqlite3_context*);
46574666
46584667
/*
46594668
** CAPI3REF: Function Auxiliary Data
46604669
** METHOD: sqlite3_context
46614670
**
@@ -4704,12 +4713,12 @@
47044713
** values and [parameters] and expressions composed from the same.)^
47054714
**
47064715
** These routines must be called from the same thread in which
47074716
** the SQL function is running.
47084717
*/
4709
-SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context*, int N);
4710
-SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
4718
+SQLITE_API void *SQLITE_APICALL sqlite3_get_auxdata(sqlite3_context*, int N);
4719
+SQLITE_API void SQLITE_APICALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (SQLITE_CALLBACK *)(void*));
47114720
47124721
47134722
/*
47144723
** CAPI3REF: Constants Defining Special Destructor Behavior
47154724
**
@@ -4722,11 +4731,11 @@
47224731
** the content before returning.
47234732
**
47244733
** The typedef is necessary to work around problems in certain
47254734
** C++ compilers.
47264735
*/
4727
-typedef void (*sqlite3_destructor_type)(void*);
4736
+typedef void (SQLITE_CALLBACK *sqlite3_destructor_type)(void*);
47284737
#define SQLITE_STATIC ((sqlite3_destructor_type)0)
47294738
#define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1)
47304739
47314740
/*
47324741
** CAPI3REF: Setting The Result Of An SQL Function
@@ -4841,31 +4850,31 @@
48414850
**
48424851
** If these routines are called from within the different thread
48434852
** than the one containing the application-defined function that received
48444853
** the [sqlite3_context] pointer, the results are undefined.
48454854
*/
4846
-SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
4847
-SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(sqlite3_context*,const void*,
4848
- sqlite3_uint64,void(*)(void*));
4849
-SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context*, double);
4850
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context*, const char*, int);
4851
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context*, const void*, int);
4852
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context*);
4853
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context*);
4854
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context*, int);
4855
-SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context*, int);
4856
-SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
4857
-SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context*);
4858
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
4859
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
4860
- void(*)(void*), unsigned char encoding);
4861
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
4862
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
4863
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
4864
-SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
4865
-SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n);
4866
-SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
4855
+SQLITE_API void SQLITE_APICALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(SQLITE_CALLBACK *)(void*));
4856
+SQLITE_API void SQLITE_APICALL sqlite3_result_blob64(sqlite3_context*,const void*,
4857
+ sqlite3_uint64,void(SQLITE_CALLBACK *)(void*));
4858
+SQLITE_API void SQLITE_APICALL sqlite3_result_double(sqlite3_context*, double);
4859
+SQLITE_API void SQLITE_APICALL sqlite3_result_error(sqlite3_context*, const char*, int);
4860
+SQLITE_API void SQLITE_APICALL sqlite3_result_error16(sqlite3_context*, const void*, int);
4861
+SQLITE_API void SQLITE_APICALL sqlite3_result_error_toobig(sqlite3_context*);
4862
+SQLITE_API void SQLITE_APICALL sqlite3_result_error_nomem(sqlite3_context*);
4863
+SQLITE_API void SQLITE_APICALL sqlite3_result_error_code(sqlite3_context*, int);
4864
+SQLITE_API void SQLITE_APICALL sqlite3_result_int(sqlite3_context*, int);
4865
+SQLITE_API void SQLITE_APICALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
4866
+SQLITE_API void SQLITE_APICALL sqlite3_result_null(sqlite3_context*);
4867
+SQLITE_API void SQLITE_APICALL sqlite3_result_text(sqlite3_context*, const char*, int, void(SQLITE_CALLBACK *)(void*));
4868
+SQLITE_API void SQLITE_APICALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
4869
+ void(SQLITE_CALLBACK *)(void*), unsigned char encoding);
4870
+SQLITE_API void SQLITE_APICALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(SQLITE_CALLBACK *)(void*));
4871
+SQLITE_API void SQLITE_APICALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(SQLITE_CALLBACK *)(void*));
4872
+SQLITE_API void SQLITE_APICALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(SQLITE_CALLBACK *)(void*));
4873
+SQLITE_API void SQLITE_APICALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
4874
+SQLITE_API void SQLITE_APICALL sqlite3_result_zeroblob(sqlite3_context*, int n);
4875
+SQLITE_API int SQLITE_APICALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
48674876
48684877
48694878
/*
48704879
** CAPI3REF: Setting The Subtype Of An SQL Function
48714880
** METHOD: sqlite3_context
@@ -4876,11 +4885,11 @@
48764885
** of the subtype T are preserved in current versions of SQLite;
48774886
** higher order bits are discarded.
48784887
** The number of subtype bytes preserved by SQLite might increase
48794888
** in future releases of SQLite.
48804889
*/
4881
-SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context*,unsigned int);
4890
+SQLITE_API void SQLITE_APICALL sqlite3_result_subtype(sqlite3_context*,unsigned int);
48824891
48834892
/*
48844893
** CAPI3REF: Define New Collating Sequences
48854894
** METHOD: sqlite3
48864895
**
@@ -4958,31 +4967,31 @@
49584967
** is unfortunate but cannot be changed without breaking backwards
49594968
** compatibility.
49604969
**
49614970
** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].
49624971
*/
4963
-SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
4972
+SQLITE_API int SQLITE_APICALL sqlite3_create_collation(
49644973
sqlite3*,
49654974
const char *zName,
49664975
int eTextRep,
49674976
void *pArg,
4968
- int(*xCompare)(void*,int,const void*,int,const void*)
4977
+ int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*)
49694978
);
4970
-SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
4979
+SQLITE_API int SQLITE_APICALL sqlite3_create_collation_v2(
49714980
sqlite3*,
49724981
const char *zName,
49734982
int eTextRep,
49744983
void *pArg,
4975
- int(*xCompare)(void*,int,const void*,int,const void*),
4976
- void(*xDestroy)(void*)
4984
+ int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*),
4985
+ void(SQLITE_CALLBACK *xDestroy)(void*)
49774986
);
4978
-SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
4987
+SQLITE_API int SQLITE_APICALL sqlite3_create_collation16(
49794988
sqlite3*,
49804989
const void *zName,
49814990
int eTextRep,
49824991
void *pArg,
4983
- int(*xCompare)(void*,int,const void*,int,const void*)
4992
+ int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*)
49844993
);
49854994
49864995
/*
49874996
** CAPI3REF: Collation Needed Callbacks
49884997
** METHOD: sqlite3
@@ -5008,19 +5017,19 @@
50085017
**
50095018
** The callback function should register the desired collation using
50105019
** [sqlite3_create_collation()], [sqlite3_create_collation16()], or
50115020
** [sqlite3_create_collation_v2()].
50125021
*/
5013
-SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
5022
+SQLITE_API int SQLITE_APICALL sqlite3_collation_needed(
50145023
sqlite3*,
50155024
void*,
5016
- void(*)(void*,sqlite3*,int eTextRep,const char*)
5025
+ void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const char*)
50175026
);
5018
-SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
5027
+SQLITE_API int SQLITE_APICALL sqlite3_collation_needed16(
50195028
sqlite3*,
50205029
void*,
5021
- void(*)(void*,sqlite3*,int eTextRep,const void*)
5030
+ void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const void*)
50225031
);
50235032
50245033
#ifdef SQLITE_HAS_CODEC
50255034
/*
50265035
** Specify the key for an encrypted database. This routine should be
@@ -5027,15 +5036,15 @@
50275036
** called right after sqlite3_open().
50285037
**
50295038
** The code to implement this API is not available in the public release
50305039
** of SQLite.
50315040
*/
5032
-SQLITE_API int SQLITE_STDCALL sqlite3_key(
5041
+SQLITE_API int SQLITE_APICALL sqlite3_key(
50335042
sqlite3 *db, /* Database to be rekeyed */
50345043
const void *pKey, int nKey /* The key */
50355044
);
5036
-SQLITE_API int SQLITE_STDCALL sqlite3_key_v2(
5045
+SQLITE_API int SQLITE_APICALL sqlite3_key_v2(
50375046
sqlite3 *db, /* Database to be rekeyed */
50385047
const char *zDbName, /* Name of the database */
50395048
const void *pKey, int nKey /* The key */
50405049
);
50415050
@@ -5045,35 +5054,35 @@
50455054
** database is decrypted.
50465055
**
50475056
** The code to implement this API is not available in the public release
50485057
** of SQLite.
50495058
*/
5050
-SQLITE_API int SQLITE_STDCALL sqlite3_rekey(
5059
+SQLITE_API int SQLITE_APICALL sqlite3_rekey(
50515060
sqlite3 *db, /* Database to be rekeyed */
50525061
const void *pKey, int nKey /* The new key */
50535062
);
5054
-SQLITE_API int SQLITE_STDCALL sqlite3_rekey_v2(
5063
+SQLITE_API int SQLITE_APICALL sqlite3_rekey_v2(
50555064
sqlite3 *db, /* Database to be rekeyed */
50565065
const char *zDbName, /* Name of the database */
50575066
const void *pKey, int nKey /* The new key */
50585067
);
50595068
50605069
/*
50615070
** Specify the activation key for a SEE database. Unless
50625071
** activated, none of the SEE routines will work.
50635072
*/
5064
-SQLITE_API void SQLITE_STDCALL sqlite3_activate_see(
5073
+SQLITE_API void SQLITE_APICALL sqlite3_activate_see(
50655074
const char *zPassPhrase /* Activation phrase */
50665075
);
50675076
#endif
50685077
50695078
#ifdef SQLITE_ENABLE_CEROD
50705079
/*
50715080
** Specify the activation key for a CEROD database. Unless
50725081
** activated, none of the CEROD routines will work.
50735082
*/
5074
-SQLITE_API void SQLITE_STDCALL sqlite3_activate_cerod(
5083
+SQLITE_API void SQLITE_APICALL sqlite3_activate_cerod(
50755084
const char *zPassPhrase /* Activation phrase */
50765085
);
50775086
#endif
50785087
50795088
/*
@@ -5091,11 +5100,11 @@
50915100
** method of the default [sqlite3_vfs] object. If the xSleep() method
50925101
** of the default VFS is not implemented correctly, or not implemented at
50935102
** all, then the behavior of sqlite3_sleep() may deviate from the description
50945103
** in the previous paragraphs.
50955104
*/
5096
-SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int);
5105
+SQLITE_API int SQLITE_APICALL sqlite3_sleep(int);
50975106
50985107
/*
50995108
** CAPI3REF: Name Of The Folder Holding Temporary Files
51005109
**
51015110
** ^(If this global variable is made to point to a string which is
@@ -5210,11 +5219,11 @@
52105219
**
52115220
** If another thread changes the autocommit status of the database
52125221
** connection while this routine is running, then the return value
52135222
** is undefined.
52145223
*/
5215
-SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3*);
5224
+SQLITE_API int SQLITE_APICALL sqlite3_get_autocommit(sqlite3*);
52165225
52175226
/*
52185227
** CAPI3REF: Find The Database Handle Of A Prepared Statement
52195228
** METHOD: sqlite3_stmt
52205229
**
@@ -5223,11 +5232,11 @@
52235232
** returned by sqlite3_db_handle is the same [database connection]
52245233
** that was the first argument
52255234
** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
52265235
** create the statement in the first place.
52275236
*/
5228
-SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt*);
5237
+SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_db_handle(sqlite3_stmt*);
52295238
52305239
/*
52315240
** CAPI3REF: Return The Filename For A Database Connection
52325241
** METHOD: sqlite3
52335242
**
@@ -5240,21 +5249,21 @@
52405249
** ^The filename returned by this function is the output of the
52415250
** xFullPathname method of the [VFS]. ^In other words, the filename
52425251
** will be an absolute pathname, even if the filename used
52435252
** to open the database originally was a URI or relative pathname.
52445253
*/
5245
-SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
5254
+SQLITE_API const char *SQLITE_APICALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
52465255
52475256
/*
52485257
** CAPI3REF: Determine if a database is read-only
52495258
** METHOD: sqlite3
52505259
**
52515260
** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N
52525261
** of connection D is read-only, 0 if it is read/write, or -1 if N is not
52535262
** the name of a database on connection D.
52545263
*/
5255
-SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
5264
+SQLITE_API int SQLITE_APICALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
52565265
52575266
/*
52585267
** CAPI3REF: Find the next prepared statement
52595268
** METHOD: sqlite3
52605269
**
@@ -5266,11 +5275,11 @@
52665275
**
52675276
** The [database connection] pointer D in a call to
52685277
** [sqlite3_next_stmt(D,S)] must refer to an open database
52695278
** connection and in particular must not be a NULL pointer.
52705279
*/
5271
-SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
5280
+SQLITE_API sqlite3_stmt *SQLITE_APICALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
52725281
52735282
/*
52745283
** CAPI3REF: Commit And Rollback Notification Callbacks
52755284
** METHOD: sqlite3
52765285
**
@@ -5315,12 +5324,12 @@
53155324
** ^The rollback callback is not invoked if a transaction is
53165325
** automatically rolled back because the database connection is closed.
53175326
**
53185327
** See also the [sqlite3_update_hook()] interface.
53195328
*/
5320
-SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
5321
-SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
5329
+SQLITE_API void *SQLITE_APICALL sqlite3_commit_hook(sqlite3*, int(SQLITE_CALLBACK *)(void*), void*);
5330
+SQLITE_API void *SQLITE_APICALL sqlite3_rollback_hook(sqlite3*, void(SQLITE_CALLBACK *)(void *), void*);
53225331
53235332
/*
53245333
** CAPI3REF: Data Change Notification Callbacks
53255334
** METHOD: sqlite3
53265335
**
@@ -5367,13 +5376,13 @@
53675376
** the first call on D.
53685377
**
53695378
** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()],
53705379
** and [sqlite3_preupdate_hook()] interfaces.
53715380
*/
5372
-SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
5381
+SQLITE_API void *SQLITE_APICALL sqlite3_update_hook(
53735382
sqlite3*,
5374
- void(*)(void *,int ,char const *,char const *,sqlite3_int64),
5383
+ void(SQLITE_CALLBACK *)(void *,int ,char const *,char const *,sqlite3_int64),
53755384
void*
53765385
);
53775386
53785387
/*
53795388
** CAPI3REF: Enable Or Disable Shared Pager Cache
@@ -5407,11 +5416,11 @@
54075416
** This interface is threadsafe on processors where writing a
54085417
** 32-bit integer is atomic.
54095418
**
54105419
** See Also: [SQLite Shared-Cache Mode]
54115420
*/
5412
-SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int);
5421
+SQLITE_API int SQLITE_APICALL sqlite3_enable_shared_cache(int);
54135422
54145423
/*
54155424
** CAPI3REF: Attempt To Free Heap Memory
54165425
**
54175426
** ^The sqlite3_release_memory() interface attempts to free N bytes
@@ -5423,11 +5432,11 @@
54235432
** ^The sqlite3_release_memory() routine is a no-op returning zero
54245433
** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].
54255434
**
54265435
** See also: [sqlite3_db_release_memory()]
54275436
*/
5428
-SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int);
5437
+SQLITE_API int SQLITE_APICALL sqlite3_release_memory(int);
54295438
54305439
/*
54315440
** CAPI3REF: Free Memory Used By A Database Connection
54325441
** METHOD: sqlite3
54335442
**
@@ -5437,11 +5446,11 @@
54375446
** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
54385447
** omitted.
54395448
**
54405449
** See also: [sqlite3_release_memory()]
54415450
*/
5442
-SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3*);
5451
+SQLITE_API int SQLITE_APICALL sqlite3_db_release_memory(sqlite3*);
54435452
54445453
/*
54455454
** CAPI3REF: Impose A Limit On Heap Size
54465455
**
54475456
** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the
@@ -5489,11 +5498,11 @@
54895498
** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT].
54905499
**
54915500
** The circumstances under which SQLite will enforce the soft heap limit may
54925501
** changes in future releases of SQLite.
54935502
*/
5494
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
5503
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
54955504
54965505
/*
54975506
** CAPI3REF: Deprecated Soft Heap Limit Interface
54985507
** DEPRECATED
54995508
**
@@ -5500,11 +5509,11 @@
55005509
** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
55015510
** interface. This routine is provided for historical compatibility
55025511
** only. All new applications should use the
55035512
** [sqlite3_soft_heap_limit64()] interface rather than this one.
55045513
*/
5505
-SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_soft_heap_limit(int N);
5514
+SQLITE_API SQLITE_DEPRECATED void SQLITE_APICALL sqlite3_soft_heap_limit(int N);
55065515
55075516
55085517
/*
55095518
** CAPI3REF: Extract Metadata About A Column Of A Table
55105519
** METHOD: sqlite3
@@ -5570,11 +5579,11 @@
55705579
**
55715580
** ^This function causes all database schemas to be read from disk and
55725581
** parsed, if that has not already been done, and returns an error if
55735582
** any errors are encountered while loading the schema.
55745583
*/
5575
-SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
5584
+SQLITE_API int SQLITE_APICALL sqlite3_table_column_metadata(
55765585
sqlite3 *db, /* Connection handle */
55775586
const char *zDbName, /* Database name or NULL */
55785587
const char *zTableName, /* Table name */
55795588
const char *zColumnName, /* Column name */
55805589
char const **pzDataType, /* OUTPUT: Declared data type */
@@ -5626,11 +5635,11 @@
56265635
** disabled and prevent SQL injections from giving attackers
56275636
** access to extension loading capabilities.
56285637
**
56295638
** See also the [load_extension() SQL function].
56305639
*/
5631
-SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
5640
+SQLITE_API int SQLITE_APICALL sqlite3_load_extension(
56325641
sqlite3 *db, /* Load the extension into this database connection */
56335642
const char *zFile, /* Name of the shared library containing extension */
56345643
const char *zProc, /* Entry point. Derived from zFile if 0 */
56355644
char **pzErrMsg /* Put error message here if not 0 */
56365645
);
@@ -5658,11 +5667,11 @@
56585667
** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method
56595668
** rather than this interface, so the [load_extension()] SQL function
56605669
** remains disabled. This will prevent SQL injections from giving attackers
56615670
** access to extension loading capabilities.
56625671
*/
5663
-SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
5672
+SQLITE_API int SQLITE_APICALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
56645673
56655674
/*
56665675
** CAPI3REF: Automatically Load Statically Linked Extensions
56675676
**
56685677
** ^This interface causes the xEntryPoint() function to be invoked for
@@ -5696,11 +5705,14 @@
56965705
** will be called more than once for each database connection that is opened.
56975706
**
56985707
** See also: [sqlite3_reset_auto_extension()]
56995708
** and [sqlite3_cancel_auto_extension()]
57005709
*/
5701
-SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void (*xEntryPoint)(void));
5710
+typedef struct sqlite3_api_routines sqlite3_api_routines;
5711
+SQLITE_API int SQLITE_APICALL sqlite3_auto_extension(
5712
+ int (SQLITE_CALLBACK *xEntryPoint)(sqlite3 *, char **, const sqlite3_api_routines *)
5713
+);
57025714
57035715
/*
57045716
** CAPI3REF: Cancel Automatic Extension Loading
57055717
**
57065718
** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
@@ -5708,19 +5720,21 @@
57085720
** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)]
57095721
** routine returns 1 if initialization routine X was successfully
57105722
** unregistered and it returns 0 if X was not on the list of initialization
57115723
** routines.
57125724
*/
5713
-SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void (*xEntryPoint)(void));
5725
+SQLITE_API int SQLITE_APICALL sqlite3_cancel_auto_extension(
5726
+ int (SQLITE_CALLBACK *xEntryPoint)(sqlite3 *, char **, const sqlite3_api_routines *)
5727
+);
57145728
57155729
/*
57165730
** CAPI3REF: Reset Automatic Extension Loading
57175731
**
57185732
** ^This interface disables all automatic extensions previously
57195733
** registered using [sqlite3_auto_extension()].
57205734
*/
5721
-SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void);
5735
+SQLITE_API void SQLITE_APICALL sqlite3_reset_auto_extension(void);
57225736
57235737
/*
57245738
** The interface to the virtual-table mechanism is currently considered
57255739
** to be experimental. The interface might change in incompatible ways.
57265740
** If this is a problem for you, do not use the interface at this time.
@@ -5753,41 +5767,41 @@
57535767
** of this structure must not change while it is registered with
57545768
** any database connection.
57555769
*/
57565770
struct sqlite3_module {
57575771
int iVersion;
5758
- int (*xCreate)(sqlite3*, void *pAux,
5759
- int argc, const char *const*argv,
5760
- sqlite3_vtab **ppVTab, char**);
5761
- int (*xConnect)(sqlite3*, void *pAux,
5762
- int argc, const char *const*argv,
5763
- sqlite3_vtab **ppVTab, char**);
5764
- int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
5765
- int (*xDisconnect)(sqlite3_vtab *pVTab);
5766
- int (*xDestroy)(sqlite3_vtab *pVTab);
5767
- int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);
5768
- int (*xClose)(sqlite3_vtab_cursor*);
5769
- int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
5770
- int argc, sqlite3_value **argv);
5771
- int (*xNext)(sqlite3_vtab_cursor*);
5772
- int (*xEof)(sqlite3_vtab_cursor*);
5773
- int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int);
5774
- int (*xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid);
5775
- int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *);
5776
- int (*xBegin)(sqlite3_vtab *pVTab);
5777
- int (*xSync)(sqlite3_vtab *pVTab);
5778
- int (*xCommit)(sqlite3_vtab *pVTab);
5779
- int (*xRollback)(sqlite3_vtab *pVTab);
5780
- int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,
5781
- void (**pxFunc)(sqlite3_context*,int,sqlite3_value**),
5782
- void **ppArg);
5783
- int (*xRename)(sqlite3_vtab *pVtab, const char *zNew);
5784
- /* The methods above are in version 1 of the sqlite_module object. Those
5785
- ** below are for version 2 and greater. */
5786
- int (*xSavepoint)(sqlite3_vtab *pVTab, int);
5787
- int (*xRelease)(sqlite3_vtab *pVTab, int);
5788
- int (*xRollbackTo)(sqlite3_vtab *pVTab, int);
5772
+ int (SQLITE_CALLBACK *xCreate)(sqlite3*, void *pAux,
5773
+ int argc, const char *const*argv,
5774
+ sqlite3_vtab **ppVTab, char**);
5775
+ int (SQLITE_CALLBACK *xConnect)(sqlite3*, void *pAux,
5776
+ int argc, const char *const*argv,
5777
+ sqlite3_vtab **ppVTab, char**);
5778
+ int (SQLITE_CALLBACK *xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
5779
+ int (SQLITE_CALLBACK *xDisconnect)(sqlite3_vtab *pVTab);
5780
+ int (SQLITE_CALLBACK *xDestroy)(sqlite3_vtab *pVTab);
5781
+ int (SQLITE_CALLBACK *xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);
5782
+ int (SQLITE_CALLBACK *xClose)(sqlite3_vtab_cursor*);
5783
+ int (SQLITE_CALLBACK *xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
5784
+ int argc, sqlite3_value **argv);
5785
+ int (SQLITE_CALLBACK *xNext)(sqlite3_vtab_cursor*);
5786
+ int (SQLITE_CALLBACK *xEof)(sqlite3_vtab_cursor*);
5787
+ int (SQLITE_CALLBACK *xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int);
5788
+ int (SQLITE_CALLBACK *xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid);
5789
+ int (SQLITE_CALLBACK *xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *);
5790
+ int (SQLITE_CALLBACK *xBegin)(sqlite3_vtab *pVTab);
5791
+ int (SQLITE_CALLBACK *xSync)(sqlite3_vtab *pVTab);
5792
+ int (SQLITE_CALLBACK *xCommit)(sqlite3_vtab *pVTab);
5793
+ int (SQLITE_CALLBACK *xRollback)(sqlite3_vtab *pVTab);
5794
+ int (SQLITE_CALLBACK *xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,
5795
+ void (SQLITE_CALLBACK **pxFunc)(sqlite3_context*,int,sqlite3_value**),
5796
+ void **ppArg);
5797
+ int (SQLITE_CALLBACK *xRename)(sqlite3_vtab *pVtab, const char *zNew);
5798
+ /* The methods above are in version 1 of the sqlite_module object. Those
5799
+ ** below are for version 2 and greater. */
5800
+ int (SQLITE_CALLBACK *xSavepoint)(sqlite3_vtab *pVTab, int);
5801
+ int (SQLITE_CALLBACK *xRelease)(sqlite3_vtab *pVTab, int);
5802
+ int (SQLITE_CALLBACK *xRollbackTo)(sqlite3_vtab *pVTab, int);
57895803
};
57905804
57915805
/*
57925806
** CAPI3REF: Virtual Table Indexing Information
57935807
** KEYWORDS: sqlite3_index_info
@@ -5961,22 +5975,22 @@
59615975
** be invoked if the call to sqlite3_create_module_v2() fails.
59625976
** ^The sqlite3_create_module()
59635977
** interface is equivalent to sqlite3_create_module_v2() with a NULL
59645978
** destructor.
59655979
*/
5966
-SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
5980
+SQLITE_API int SQLITE_APICALL sqlite3_create_module(
59675981
sqlite3 *db, /* SQLite connection to register module with */
59685982
const char *zName, /* Name of the module */
59695983
const sqlite3_module *p, /* Methods for the module */
59705984
void *pClientData /* Client data for xCreate/xConnect */
59715985
);
5972
-SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
5986
+SQLITE_API int SQLITE_APICALL sqlite3_create_module_v2(
59735987
sqlite3 *db, /* SQLite connection to register module with */
59745988
const char *zName, /* Name of the module */
59755989
const sqlite3_module *p, /* Methods for the module */
59765990
void *pClientData, /* Client data for xCreate/xConnect */
5977
- void(*xDestroy)(void*) /* Module destructor function */
5991
+ void(SQLITE_CALLBACK *xDestroy)(void*) /* Module destructor function */
59785992
);
59795993
59805994
/*
59815995
** CAPI3REF: Virtual Table Instance Object
59825996
** KEYWORDS: sqlite3_vtab
@@ -6030,11 +6044,11 @@
60306044
** ^The [xCreate] and [xConnect] methods of a
60316045
** [virtual table module] call this interface
60326046
** to declare the format (the names and datatypes of the columns) of
60336047
** the virtual tables they implement.
60346048
*/
6035
-SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
6049
+SQLITE_API int SQLITE_APICALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
60366050
60376051
/*
60386052
** CAPI3REF: Overload A Function For A Virtual Table
60396053
** METHOD: sqlite3
60406054
**
@@ -6049,11 +6063,11 @@
60496063
** of the new function always causes an exception to be thrown. So
60506064
** the new function is not good for anything by itself. Its only
60516065
** purpose is to be a placeholder function that can be overloaded
60526066
** by a [virtual table].
60536067
*/
6054
-SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
6068
+SQLITE_API int SQLITE_APICALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
60556069
60566070
/*
60576071
** The interface to the virtual-table mechanism defined above (back up
60586072
** to a comment remarkably similar to this one) is currently considered
60596073
** to be experimental. The interface might change in incompatible ways.
@@ -6148,11 +6162,11 @@
61486162
** zero-filled blob to read or write using the incremental-blob interface.
61496163
**
61506164
** To avoid a resource leak, every open [BLOB handle] should eventually
61516165
** be released by a call to [sqlite3_blob_close()].
61526166
*/
6153
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
6167
+SQLITE_API int SQLITE_APICALL sqlite3_blob_open(
61546168
sqlite3*,
61556169
const char *zDb,
61566170
const char *zTable,
61576171
const char *zColumn,
61586172
sqlite3_int64 iRow,
@@ -6181,11 +6195,11 @@
61816195
** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
61826196
** always returns zero.
61836197
**
61846198
** ^This function sets the database handle error code and message.
61856199
*/
6186
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
6200
+SQLITE_API int SQLITE_APICALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
61876201
61886202
/*
61896203
** CAPI3REF: Close A BLOB Handle
61906204
** DESTRUCTOR: sqlite3_blob
61916205
**
@@ -6204,11 +6218,11 @@
62046218
** with a null pointer (such as would be returned by a failed call to
62056219
** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function
62066220
** is passed a valid open blob handle, the values returned by the
62076221
** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning.
62086222
*/
6209
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *);
6223
+SQLITE_API int SQLITE_APICALL sqlite3_blob_close(sqlite3_blob *);
62106224
62116225
/*
62126226
** CAPI3REF: Return The Size Of An Open BLOB
62136227
** METHOD: sqlite3_blob
62146228
**
@@ -6220,11 +6234,11 @@
62206234
** This routine only works on a [BLOB handle] which has been created
62216235
** by a prior successful call to [sqlite3_blob_open()] and which has not
62226236
** been closed by [sqlite3_blob_close()]. Passing any other pointer in
62236237
** to this routine results in undefined and probably undesirable behavior.
62246238
*/
6225
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *);
6239
+SQLITE_API int SQLITE_APICALL sqlite3_blob_bytes(sqlite3_blob *);
62266240
62276241
/*
62286242
** CAPI3REF: Read Data From A BLOB Incrementally
62296243
** METHOD: sqlite3_blob
62306244
**
@@ -6249,11 +6263,11 @@
62496263
** been closed by [sqlite3_blob_close()]. Passing any other pointer in
62506264
** to this routine results in undefined and probably undesirable behavior.
62516265
**
62526266
** See also: [sqlite3_blob_write()].
62536267
*/
6254
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
6268
+SQLITE_API int SQLITE_APICALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
62556269
62566270
/*
62576271
** CAPI3REF: Write Data Into A BLOB Incrementally
62586272
** METHOD: sqlite3_blob
62596273
**
@@ -6291,11 +6305,11 @@
62916305
** been closed by [sqlite3_blob_close()]. Passing any other pointer in
62926306
** to this routine results in undefined and probably undesirable behavior.
62936307
**
62946308
** See also: [sqlite3_blob_read()].
62956309
*/
6296
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
6310
+SQLITE_API int SQLITE_APICALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
62976311
62986312
/*
62996313
** CAPI3REF: Virtual File System Objects
63006314
**
63016315
** A virtual filesystem (VFS) is an [sqlite3_vfs] object
@@ -6322,13 +6336,13 @@
63226336
**
63236337
** ^Unregister a VFS with the sqlite3_vfs_unregister() interface.
63246338
** ^(If the default VFS is unregistered, another VFS is chosen as
63256339
** the default. The choice for the new VFS is arbitrary.)^
63266340
*/
6327
-SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfsName);
6328
-SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
6329
-SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs*);
6341
+SQLITE_API sqlite3_vfs *SQLITE_APICALL sqlite3_vfs_find(const char *zVfsName);
6342
+SQLITE_API int SQLITE_APICALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
6343
+SQLITE_API int SQLITE_APICALL sqlite3_vfs_unregister(sqlite3_vfs*);
63306344
63316345
/*
63326346
** CAPI3REF: Mutexes
63336347
**
63346348
** The SQLite core uses these routines for thread
@@ -6440,15 +6454,15 @@
64406454
** sqlite3_mutex_leave() is a NULL pointer, then all three routines
64416455
** behave as no-ops.
64426456
**
64436457
** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
64446458
*/
6445
-SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int);
6446
-SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*);
6447
-SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*);
6448
-SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*);
6449
-SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*);
6459
+SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_mutex_alloc(int);
6460
+SQLITE_API void SQLITE_APICALL sqlite3_mutex_free(sqlite3_mutex*);
6461
+SQLITE_API void SQLITE_APICALL sqlite3_mutex_enter(sqlite3_mutex*);
6462
+SQLITE_API int SQLITE_APICALL sqlite3_mutex_try(sqlite3_mutex*);
6463
+SQLITE_API void SQLITE_APICALL sqlite3_mutex_leave(sqlite3_mutex*);
64506464
64516465
/*
64526466
** CAPI3REF: Mutex Methods Object
64536467
**
64546468
** An instance of this structure defines the low-level routines
@@ -6513,19 +6527,19 @@
65136527
** If xMutexInit fails in any way, it is expected to clean up after itself
65146528
** prior to returning.
65156529
*/
65166530
typedef struct sqlite3_mutex_methods sqlite3_mutex_methods;
65176531
struct sqlite3_mutex_methods {
6518
- int (*xMutexInit)(void);
6519
- int (*xMutexEnd)(void);
6520
- sqlite3_mutex *(*xMutexAlloc)(int);
6521
- void (*xMutexFree)(sqlite3_mutex *);
6522
- void (*xMutexEnter)(sqlite3_mutex *);
6523
- int (*xMutexTry)(sqlite3_mutex *);
6524
- void (*xMutexLeave)(sqlite3_mutex *);
6525
- int (*xMutexHeld)(sqlite3_mutex *);
6526
- int (*xMutexNotheld)(sqlite3_mutex *);
6532
+ int (SQLITE_CALLBACK *xMutexInit)(void);
6533
+ int (SQLITE_CALLBACK *xMutexEnd)(void);
6534
+ sqlite3_mutex *(SQLITE_CALLBACK *xMutexAlloc)(int);
6535
+ void (SQLITE_CALLBACK *xMutexFree)(sqlite3_mutex *);
6536
+ void (SQLITE_CALLBACK *xMutexEnter)(sqlite3_mutex *);
6537
+ int (SQLITE_CALLBACK *xMutexTry)(sqlite3_mutex *);
6538
+ void (SQLITE_CALLBACK *xMutexLeave)(sqlite3_mutex *);
6539
+ int (SQLITE_CALLBACK *xMutexHeld)(sqlite3_mutex *);
6540
+ int (SQLITE_CALLBACK *xMutexNotheld)(sqlite3_mutex *);
65276541
};
65286542
65296543
/*
65306544
** CAPI3REF: Mutex Verification Routines
65316545
**
@@ -6554,12 +6568,12 @@
65546568
** call to sqlite3_mutex_held() to fail, so a non-zero return is
65556569
** the appropriate thing to do. The sqlite3_mutex_notheld()
65566570
** interface should also return 1 when given a NULL pointer.
65576571
*/
65586572
#ifndef NDEBUG
6559
-SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex*);
6560
-SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex*);
6573
+SQLITE_API int SQLITE_APICALL sqlite3_mutex_held(sqlite3_mutex*);
6574
+SQLITE_API int SQLITE_APICALL sqlite3_mutex_notheld(sqlite3_mutex*);
65616575
#endif
65626576
65636577
/*
65646578
** CAPI3REF: Mutex Types
65656579
**
@@ -6595,11 +6609,11 @@
65956609
** serializes access to the [database connection] given in the argument
65966610
** when the [threading mode] is Serialized.
65976611
** ^If the [threading mode] is Single-thread or Multi-thread then this
65986612
** routine returns a NULL pointer.
65996613
*/
6600
-SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3*);
6614
+SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_db_mutex(sqlite3*);
66016615
66026616
/*
66036617
** CAPI3REF: Low-Level Control Of Database Files
66046618
** METHOD: sqlite3
66056619
**
@@ -6630,11 +6644,11 @@
66306644
** an incorrect zDbName and an SQLITE_ERROR return from the underlying
66316645
** xFileControl method.
66326646
**
66336647
** See also: [SQLITE_FCNTL_LOCKSTATE]
66346648
*/
6635
-SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
6649
+SQLITE_API int SQLITE_APICALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
66366650
66376651
/*
66386652
** CAPI3REF: Testing Interface
66396653
**
66406654
** ^The sqlite3_test_control() interface is used to read out internal
@@ -6712,12 +6726,12 @@
67126726
** be represented by a 32-bit integer, then the values returned by
67136727
** sqlite3_status() are undefined.
67146728
**
67156729
** See also: [sqlite3_db_status()]
67166730
*/
6717
-SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6718
-SQLITE_API int SQLITE_STDCALL sqlite3_status64(
6731
+SQLITE_API int SQLITE_APICALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6732
+SQLITE_API int SQLITE_APICALL sqlite3_status64(
67196733
int op,
67206734
sqlite3_int64 *pCurrent,
67216735
sqlite3_int64 *pHighwater,
67226736
int resetFlag
67236737
);
@@ -6838,11 +6852,11 @@
68386852
** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a
68396853
** non-zero [error code] on failure.
68406854
**
68416855
** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
68426856
*/
6843
-SQLITE_API int SQLITE_STDCALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
6857
+SQLITE_API int SQLITE_APICALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
68446858
68456859
/*
68466860
** CAPI3REF: Status Parameters for database connections
68476861
** KEYWORDS: {SQLITE_DBSTATUS options}
68486862
**
@@ -6981,11 +6995,11 @@
69816995
** ^If the resetFlg is true, then the counter is reset to zero after this
69826996
** interface call returns.
69836997
**
69846998
** See also: [sqlite3_status()] and [sqlite3_db_status()].
69856999
*/
6986
-SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
7000
+SQLITE_API int SQLITE_APICALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
69877001
69887002
/*
69897003
** CAPI3REF: Status Parameters for prepared statements
69907004
** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters}
69917005
**
@@ -7217,22 +7231,22 @@
72177231
*/
72187232
typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2;
72197233
struct sqlite3_pcache_methods2 {
72207234
int iVersion;
72217235
void *pArg;
7222
- int (*xInit)(void*);
7223
- void (*xShutdown)(void*);
7224
- sqlite3_pcache *(*xCreate)(int szPage, int szExtra, int bPurgeable);
7225
- void (*xCachesize)(sqlite3_pcache*, int nCachesize);
7226
- int (*xPagecount)(sqlite3_pcache*);
7227
- sqlite3_pcache_page *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7228
- void (*xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard);
7229
- void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*,
7236
+ int (SQLITE_CALLBACK *xInit)(void*);
7237
+ void (SQLITE_CALLBACK *xShutdown)(void*);
7238
+ sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int szExtra, int bPurgeable);
7239
+ void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize);
7240
+ int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*);
7241
+ sqlite3_pcache_page *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7242
+ void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard);
7243
+ void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, sqlite3_pcache_page*,
72307244
unsigned oldKey, unsigned newKey);
7231
- void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
7232
- void (*xDestroy)(sqlite3_pcache*);
7233
- void (*xShrink)(sqlite3_pcache*);
7245
+ void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit);
7246
+ void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*);
7247
+ void (SQLITE_CALLBACK *xShrink)(sqlite3_pcache*);
72347248
};
72357249
72367250
/*
72377251
** This is the obsolete pcache_methods object that has now been replaced
72387252
** by sqlite3_pcache_methods2. This object is not used by SQLite. It is
@@ -7239,20 +7253,20 @@
72397253
** retained in the header file for backwards compatibility only.
72407254
*/
72417255
typedef struct sqlite3_pcache_methods sqlite3_pcache_methods;
72427256
struct sqlite3_pcache_methods {
72437257
void *pArg;
7244
- int (*xInit)(void*);
7245
- void (*xShutdown)(void*);
7246
- sqlite3_pcache *(*xCreate)(int szPage, int bPurgeable);
7247
- void (*xCachesize)(sqlite3_pcache*, int nCachesize);
7248
- int (*xPagecount)(sqlite3_pcache*);
7249
- void *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7250
- void (*xUnpin)(sqlite3_pcache*, void*, int discard);
7251
- void (*xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey);
7252
- void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
7253
- void (*xDestroy)(sqlite3_pcache*);
7258
+ int (SQLITE_CALLBACK *xInit)(void*);
7259
+ void (SQLITE_CALLBACK *xShutdown)(void*);
7260
+ sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int bPurgeable);
7261
+ void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize);
7262
+ int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*);
7263
+ void *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7264
+ void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, void*, int discard);
7265
+ void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey);
7266
+ void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit);
7267
+ void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*);
72547268
};
72557269
72567270
72577271
/*
72587272
** CAPI3REF: Online Backup Object
@@ -7450,20 +7464,20 @@
74507464
** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()
74517465
** APIs are not strictly speaking threadsafe. If they are invoked at the
74527466
** same time as another thread is invoking sqlite3_backup_step() it is
74537467
** possible that they return invalid values.
74547468
*/
7455
-SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
7469
+SQLITE_API sqlite3_backup *SQLITE_APICALL sqlite3_backup_init(
74567470
sqlite3 *pDest, /* Destination database handle */
74577471
const char *zDestName, /* Destination database name */
74587472
sqlite3 *pSource, /* Source database handle */
74597473
const char *zSourceName /* Source database name */
74607474
);
7461
-SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage);
7462
-SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p);
7463
-SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p);
7464
-SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p);
7475
+SQLITE_API int SQLITE_APICALL sqlite3_backup_step(sqlite3_backup *p, int nPage);
7476
+SQLITE_API int SQLITE_APICALL sqlite3_backup_finish(sqlite3_backup *p);
7477
+SQLITE_API int SQLITE_APICALL sqlite3_backup_remaining(sqlite3_backup *p);
7478
+SQLITE_API int SQLITE_APICALL sqlite3_backup_pagecount(sqlite3_backup *p);
74657479
74667480
/*
74677481
** CAPI3REF: Unlock Notification
74687482
** METHOD: sqlite3
74697483
**
@@ -7576,13 +7590,13 @@
75767590
** by an sqlite3_step() call. ^(If there is a blocking connection, then the
75777591
** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in
75787592
** the special "DROP TABLE/INDEX" case, the extended error code is just
75797593
** SQLITE_LOCKED.)^
75807594
*/
7581
-SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
7595
+SQLITE_API int SQLITE_APICALL sqlite3_unlock_notify(
75827596
sqlite3 *pBlocked, /* Waiting connection */
7583
- void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */
7597
+ void (SQLITE_CALLBACK *xNotify)(void **apArg, int nArg), /* Callback function to invoke */
75847598
void *pNotifyArg /* Argument to pass to xNotify */
75857599
);
75867600
75877601
75887602
/*
@@ -7591,12 +7605,12 @@
75917605
** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications
75927606
** and extensions to compare the contents of two buffers containing UTF-8
75937607
** strings in a case-independent fashion, using the same definition of "case
75947608
** independence" that SQLite uses internally when comparing identifiers.
75957609
*/
7596
-SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *, const char *);
7597
-SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *, const char *, int);
7610
+SQLITE_API int SQLITE_APICALL sqlite3_stricmp(const char *, const char *);
7611
+SQLITE_API int SQLITE_APICALL sqlite3_strnicmp(const char *, const char *, int);
75987612
75997613
/*
76007614
** CAPI3REF: String Globbing
76017615
*
76027616
** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if
@@ -7609,11 +7623,11 @@
76097623
** Note that this routine returns zero on a match and non-zero if the strings
76107624
** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
76117625
**
76127626
** See also: [sqlite3_strlike()].
76137627
*/
7614
-SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlob, const char *zStr);
7628
+SQLITE_API int SQLITE_APICALL sqlite3_strglob(const char *zGlob, const char *zStr);
76157629
76167630
/*
76177631
** CAPI3REF: String LIKE Matching
76187632
*
76197633
** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if
@@ -7632,11 +7646,11 @@
76327646
** Note that this routine returns zero on a match and non-zero if the strings
76337647
** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
76347648
**
76357649
** See also: [sqlite3_strglob()].
76367650
*/
7637
-SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
7651
+SQLITE_API int SQLITE_APICALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
76387652
76397653
/*
76407654
** CAPI3REF: Error Logging Interface
76417655
**
76427656
** ^The [sqlite3_log()] interface writes a message into the [error log]
@@ -7691,13 +7705,13 @@
76917705
** previously registered write-ahead log callback. ^Note that the
76927706
** [sqlite3_wal_autocheckpoint()] interface and the
76937707
** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will
76947708
** overwrite any prior [sqlite3_wal_hook()] settings.
76957709
*/
7696
-SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
7710
+SQLITE_API void *SQLITE_APICALL sqlite3_wal_hook(
76977711
sqlite3*,
7698
- int(*)(void *,sqlite3*,const char*,int),
7712
+ int(SQLITE_CALLBACK *)(void *,sqlite3*,const char*,int),
76997713
void*
77007714
);
77017715
77027716
/*
77037717
** CAPI3REF: Configure an auto-checkpoint
@@ -7726,11 +7740,11 @@
77267740
** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]
77277741
** pages. The use of this interface
77287742
** is only necessary if the default setting is found to be suboptimal
77297743
** for a particular application.
77307744
*/
7731
-SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
7745
+SQLITE_API int SQLITE_APICALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
77327746
77337747
/*
77347748
** CAPI3REF: Checkpoint a database
77357749
** METHOD: sqlite3
77367750
**
@@ -7748,11 +7762,11 @@
77487762
** interface was added. This interface is retained for backwards
77497763
** compatibility and as a convenience for applications that need to manually
77507764
** start a callback but which do not need the full power (and corresponding
77517765
** complication) of [sqlite3_wal_checkpoint_v2()].
77527766
*/
7753
-SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
7767
+SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
77547768
77557769
/*
77567770
** CAPI3REF: Checkpoint a database
77577771
** METHOD: sqlite3
77587772
**
@@ -7842,11 +7856,11 @@
78427856
** [sqlite3_errcode()] and [sqlite3_errmsg()].
78437857
**
78447858
** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface
78457859
** from SQL.
78467860
*/
7847
-SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
7861
+SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint_v2(
78487862
sqlite3 *db, /* Database handle */
78497863
const char *zDb, /* Name of attached database (or NULL) */
78507864
int eMode, /* SQLITE_CHECKPOINT_* value */
78517865
int *pnLog, /* OUT: Size of WAL log in frames */
78527866
int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -7931,11 +7945,11 @@
79317945
** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL],
79327946
** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode
79337947
** of the SQL statement that triggered the call to the [xUpdate] method of the
79347948
** [virtual table].
79357949
*/
7936
-SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *);
7950
+SQLITE_API int SQLITE_APICALL sqlite3_vtab_on_conflict(sqlite3 *);
79377951
79387952
/*
79397953
** CAPI3REF: Conflict resolution modes
79407954
** KEYWORDS: {conflict resolution mode}
79417955
**
@@ -8036,11 +8050,11 @@
80368050
** as if the loop did not exist - it returns non-zero and leave the variable
80378051
** that pOut points to unchanged.
80388052
**
80398053
** See also: [sqlite3_stmt_scanstatus_reset()]
80408054
*/
8041
-SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus(
8055
+SQLITE_API int SQLITE_APICALL sqlite3_stmt_scanstatus(
80428056
sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
80438057
int idx, /* Index of loop to report on */
80448058
int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
80458059
void *pOut /* Result written here */
80468060
);
@@ -8052,11 +8066,11 @@
80528066
** ^Zero all [sqlite3_stmt_scanstatus()] related event counters.
80538067
**
80548068
** This API is only available if the library is built with pre-processor
80558069
** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined.
80568070
*/
8057
-SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
8071
+SQLITE_API void SQLITE_APICALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
80588072
80598073
/*
80608074
** CAPI3REF: Flush caches to disk mid-transaction
80618075
**
80628076
** ^If a write-transaction is open on [database connection] D when the
@@ -8084,11 +8098,11 @@
80848098
** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK.
80858099
**
80868100
** ^This function does not set the database handle error code or message
80878101
** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions.
80888102
*/
8089
-SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3*);
8103
+SQLITE_API int SQLITE_APICALL sqlite3_db_cacheflush(sqlite3*);
80908104
80918105
/*
80928106
** CAPI3REF: The pre-update hook.
80938107
**
80948108
** ^These interfaces are only available if SQLite is compiled using the
@@ -8164,13 +8178,13 @@
81648178
** triggers; or 2 for changes resulting from triggers called by top-level
81658179
** triggers; and so forth.
81668180
**
81678181
** See also: [sqlite3_update_hook()]
81688182
*/
8169
-SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_STDCALL sqlite3_preupdate_hook(
8183
+SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_APICALL sqlite3_preupdate_hook(
81708184
sqlite3 *db,
8171
- void(*xPreUpdate)(
8185
+ void(SQLITE_CALLBACK *xPreUpdate)(
81728186
void *pCtx, /* Copy of third arg to preupdate_hook() */
81738187
sqlite3 *db, /* Database handle */
81748188
int op, /* SQLITE_UPDATE, DELETE or INSERT */
81758189
char const *zDb, /* Database name */
81768190
char const *zName, /* Table name */
@@ -8177,14 +8191,14 @@
81778191
sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */
81788192
sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */
81798193
),
81808194
void*
81818195
);
8182
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **);
8183
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *);
8184
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *);
8185
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **);
8196
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **);
8197
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_count(sqlite3 *);
8198
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_depth(sqlite3 *);
8199
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **);
81868200
81878201
/*
81888202
** CAPI3REF: Low-level system error code
81898203
**
81908204
** ^Attempt to return the underlying operating system error code or error
@@ -8192,11 +8206,11 @@
81928206
** The return value is OS-dependent. For example, on unix systems, after
81938207
** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be
81948208
** called to get back the underlying "errno" that caused the problem, such
81958209
** as ENOSPC, EAUTH, EISDIR, and so forth.
81968210
*/
8197
-SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3*);
8211
+SQLITE_API int SQLITE_APICALL sqlite3_system_errno(sqlite3*);
81988212
81998213
/*
82008214
** CAPI3REF: Database Snapshot
82018215
** KEYWORDS: {snapshot}
82028216
** EXPERIMENTAL
@@ -8242,11 +8256,11 @@
82428256
** to avoid a memory leak.
82438257
**
82448258
** The [sqlite3_snapshot_get()] interface is only available when the
82458259
** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
82468260
*/
8247
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_get(
8261
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_get(
82488262
sqlite3 *db,
82498263
const char *zSchema,
82508264
sqlite3_snapshot **ppSnapshot
82518265
);
82528266
@@ -8280,11 +8294,11 @@
82808294
** database connection in order to make it ready to use snapshots.)
82818295
**
82828296
** The [sqlite3_snapshot_open()] interface is only available when the
82838297
** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
82848298
*/
8285
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_open(
8299
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_open(
82868300
sqlite3 *db,
82878301
const char *zSchema,
82888302
sqlite3_snapshot *pSnapshot
82898303
);
82908304
@@ -8297,11 +8311,11 @@
82978311
** using this routine to avoid a memory leak.
82988312
**
82998313
** The [sqlite3_snapshot_free()] interface is only available when the
83008314
** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
83018315
*/
8302
-SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot*);
8316
+SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_APICALL sqlite3_snapshot_free(sqlite3_snapshot*);
83038317
83048318
/*
83058319
** CAPI3REF: Compare the ages of two snapshot handles.
83068320
** EXPERIMENTAL
83078321
**
@@ -8321,11 +8335,11 @@
83218335
**
83228336
** Otherwise, this API returns a negative value if P1 refers to an older
83238337
** snapshot than P2, zero if the two handles refer to the same database
83248338
** snapshot, and a positive value if P1 is a newer snapshot than P2.
83258339
*/
8326
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_cmp(
8340
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_cmp(
83278341
sqlite3_snapshot *p1,
83288342
sqlite3_snapshot *p2
83298343
);
83308344
83318345
/*
@@ -8379,14 +8393,14 @@
83798393
** Register a geometry callback named zGeom that can be used as part of an
83808394
** R-Tree geometry query as follows:
83818395
**
83828396
** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
83838397
*/
8384
-SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
8398
+SQLITE_API int SQLITE_APICALL sqlite3_rtree_geometry_callback(
83858399
sqlite3 *db,
83868400
const char *zGeom,
8387
- int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
8401
+ int (SQLITE_CALLBACK *xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
83888402
void *pContext
83898403
);
83908404
83918405
83928406
/*
@@ -8396,25 +8410,25 @@
83968410
struct sqlite3_rtree_geometry {
83978411
void *pContext; /* Copy of pContext passed to s_r_g_c() */
83988412
int nParam; /* Size of array aParam[] */
83998413
sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */
84008414
void *pUser; /* Callback implementation user data */
8401
- void (*xDelUser)(void *); /* Called by SQLite to clean up pUser */
8415
+ void (SQLITE_CALLBACK *xDelUser)(void *); /* Called by SQLite to clean up pUser */
84028416
};
84038417
84048418
/*
84058419
** Register a 2nd-generation geometry callback named zScore that can be
84068420
** used as part of an R-Tree geometry query as follows:
84078421
**
84088422
** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...)
84098423
*/
8410
-SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
8424
+SQLITE_API int SQLITE_APICALL sqlite3_rtree_query_callback(
84118425
sqlite3 *db,
84128426
const char *zQueryFunc,
8413
- int (*xQueryFunc)(sqlite3_rtree_query_info*),
8427
+ int (SQLITE_CALLBACK *xQueryFunc)(sqlite3_rtree_query_info*),
84148428
void *pContext,
8415
- void (*xDestructor)(void*)
8429
+ void (SQLITE_CALLBACK *xDestructor)(void*)
84168430
);
84178431
84188432
84198433
/*
84208434
** A pointer to a structure of the following type is passed as the
@@ -8428,11 +8442,11 @@
84288442
struct sqlite3_rtree_query_info {
84298443
void *pContext; /* pContext from when function registered */
84308444
int nParam; /* Number of function parameters */
84318445
sqlite3_rtree_dbl *aParam; /* value of function parameters */
84328446
void *pUser; /* callback can use this, if desired */
8433
- void (*xDelUser)(void*); /* function to free pUser */
8447
+ void (SQLITE_CALLBACK *xDelUser)(void*); /* function to free pUser */
84348448
sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */
84358449
unsigned int *anQueue; /* Number of pending entries in the queue */
84368450
int nCoord; /* Number of coordinates */
84378451
int iLevel; /* Level of current node or entry */
84388452
int mxLevel; /* The largest iLevel value in the tree */
@@ -8624,11 +8638,11 @@
86248638
** If xFilter returns 0, changes is not tracked. Note that once a table is
86258639
** attached, xFilter will not be called again.
86268640
*/
86278641
void sqlite3session_table_filter(
86288642
sqlite3_session *pSession, /* Session object */
8629
- int(*xFilter)(
8643
+ int(SQLITE_CALLBACK *xFilter)(
86308644
void *pCtx, /* Copy of third arg to _filter_table() */
86318645
const char *zTab /* Table name */
86328646
),
86338647
void *pCtx /* First argument passed to xFilter */
86348648
);
@@ -9199,11 +9213,11 @@
91999213
** An sqlite3_changegroup object is used to combine two or more changesets
92009214
** (or patchsets) into a single changeset (or patchset). A single changegroup
92019215
** object may combine changesets or patchsets, but not both. The output is
92029216
** always in the same format as the input.
92039217
**
9204
-** If successful, this function returns SQLITE_OK and populates (*pp) with
9218
+** If successful, this function returns SQLITE_OK and populates (SQLITE_CALLBACK *pp) with
92059219
** a pointer to a new sqlite3_changegroup object before returning. The caller
92069220
** should eventually free the returned object using a call to
92079221
** sqlite3changegroup_delete(). If an error occurs, an SQLite error code
92089222
** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL.
92099223
**
@@ -9319,11 +9333,11 @@
93199333
** changes for tables that do not appear in the first changeset, they are
93209334
** appended onto the end of the output changeset, again in the order in
93219335
** which they are first encountered.
93229336
**
93239337
** If an error occurs, an SQLite error code is returned and the output
9324
-** variables (*pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK
9338
+** variables (SQLITE_CALLBACK *pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK
93259339
** is returned and the output variables are set to the size of and a
93269340
** pointer to the output buffer, respectively. In this case it is the
93279341
** responsibility of the caller to eventually free the buffer using a
93289342
** call to sqlite3_free().
93299343
*/
@@ -9476,15 +9490,15 @@
94769490
*/
94779491
int sqlite3changeset_apply(
94789492
sqlite3 *db, /* Apply change to "main" db of this handle */
94799493
int nChangeset, /* Size of changeset in bytes */
94809494
void *pChangeset, /* Changeset blob */
9481
- int(*xFilter)(
9495
+ int(SQLITE_CALLBACK *xFilter)(
94829496
void *pCtx, /* Copy of sixth arg to _apply() */
94839497
const char *zTab /* Table name */
94849498
),
9485
- int(*xConflict)(
9499
+ int(SQLITE_CALLBACK *xConflict)(
94869500
void *pCtx, /* Copy of sixth arg to _apply() */
94879501
int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
94889502
sqlite3_changeset_iter *p /* Handle describing change and conflict */
94899503
),
94909504
void *pCtx /* First argument passed to xConflict */
@@ -9621,20 +9635,20 @@
96219635
** </pre>
96229636
**
96239637
** Is replaced by:
96249638
**
96259639
** <pre>
9626
-** &nbsp; int (*xInput)(void *pIn, void *pData, int *pnData),
9640
+** &nbsp; int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
96279641
** &nbsp; void *pIn,
96289642
** </pre>
96299643
**
96309644
** Each time the xInput callback is invoked by the sessions module, the first
96319645
** argument passed is a copy of the supplied pIn context pointer. The second
9632
-** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no
9633
-** error occurs the xInput method should copy up to (*pnData) bytes of data
9634
-** into the buffer and set (*pnData) to the actual number of bytes copied
9635
-** before returning SQLITE_OK. If the input is completely exhausted, (*pnData)
9646
+** argument, pData, points to a buffer (SQLITE_CALLBACK *pnData) bytes in size. Assuming no
9647
+** error occurs the xInput method should copy up to (SQLITE_CALLBACK *pnData) bytes of data
9648
+** into the buffer and set (SQLITE_CALLBACK *pnData) to the actual number of bytes copied
9649
+** before returning SQLITE_OK. If the input is completely exhausted, (SQLITE_CALLBACK *pnData)
96369650
** should be set to zero to indicate this. Or, if an error occurs, an SQLite
96379651
** error code should be returned. In all cases, if an xInput callback returns
96389652
** an error, all processing is abandoned and the streaming API function
96399653
** returns a copy of the error code to the caller.
96409654
**
@@ -9655,11 +9669,11 @@
96559669
** </pre>
96569670
**
96579671
** Is replaced by:
96589672
**
96599673
** <pre>
9660
-** &nbsp; int (*xOutput)(void *pOut, const void *pData, int nData),
9674
+** &nbsp; int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
96619675
** &nbsp; void *pOut
96629676
** </pre>
96639677
**
96649678
** The xOutput callback is invoked zero or more times to return data to
96659679
** the application. The first parameter passed to each call is a copy of the
@@ -9675,58 +9689,58 @@
96759689
** parameter set to a value less than or equal to zero. Other than this,
96769690
** no guarantees are made as to the size of the chunks of data returned.
96779691
*/
96789692
int sqlite3changeset_apply_strm(
96799693
sqlite3 *db, /* Apply change to "main" db of this handle */
9680
- int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
9694
+ int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), /* Input function */
96819695
void *pIn, /* First arg for xInput */
9682
- int(*xFilter)(
9696
+ int(SQLITE_CALLBACK *xFilter)(
96839697
void *pCtx, /* Copy of sixth arg to _apply() */
96849698
const char *zTab /* Table name */
96859699
),
9686
- int(*xConflict)(
9700
+ int(SQLITE_CALLBACK *xConflict)(
96879701
void *pCtx, /* Copy of sixth arg to _apply() */
96889702
int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
96899703
sqlite3_changeset_iter *p /* Handle describing change and conflict */
96909704
),
96919705
void *pCtx /* First argument passed to xConflict */
96929706
);
96939707
int sqlite3changeset_concat_strm(
9694
- int (*xInputA)(void *pIn, void *pData, int *pnData),
9708
+ int (SQLITE_CALLBACK *xInputA)(void *pIn, void *pData, int *pnData),
96959709
void *pInA,
9696
- int (*xInputB)(void *pIn, void *pData, int *pnData),
9710
+ int (SQLITE_CALLBACK *xInputB)(void *pIn, void *pData, int *pnData),
96979711
void *pInB,
9698
- int (*xOutput)(void *pOut, const void *pData, int nData),
9712
+ int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
96999713
void *pOut
97009714
);
97019715
int sqlite3changeset_invert_strm(
9702
- int (*xInput)(void *pIn, void *pData, int *pnData),
9716
+ int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
97039717
void *pIn,
9704
- int (*xOutput)(void *pOut, const void *pData, int nData),
9718
+ int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
97059719
void *pOut
97069720
);
97079721
int sqlite3changeset_start_strm(
97089722
sqlite3_changeset_iter **pp,
9709
- int (*xInput)(void *pIn, void *pData, int *pnData),
9723
+ int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
97109724
void *pIn
97119725
);
97129726
int sqlite3session_changeset_strm(
97139727
sqlite3_session *pSession,
9714
- int (*xOutput)(void *pOut, const void *pData, int nData),
9728
+ int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
97159729
void *pOut
97169730
);
97179731
int sqlite3session_patchset_strm(
97189732
sqlite3_session *pSession,
9719
- int (*xOutput)(void *pOut, const void *pData, int nData),
9733
+ int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
97209734
void *pOut
97219735
);
97229736
int sqlite3changegroup_add_strm(sqlite3_changegroup*,
9723
- int (*xInput)(void *pIn, void *pData, int *pnData),
9737
+ int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
97249738
void *pIn
97259739
);
97269740
int sqlite3changegroup_output_strm(sqlite3_changegroup*,
9727
- int (*xOutput)(void *pOut, const void *pData, int nData),
9741
+ int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
97289742
void *pOut
97299743
);
97309744
97319745
97329746
/*
@@ -9777,11 +9791,11 @@
97779791
97789792
typedef struct Fts5ExtensionApi Fts5ExtensionApi;
97799793
typedef struct Fts5Context Fts5Context;
97809794
typedef struct Fts5PhraseIter Fts5PhraseIter;
97819795
9782
-typedef void (*fts5_extension_function)(
9796
+typedef void (SQLITE_CALLBACK *fts5_extension_function)(
97839797
const Fts5ExtensionApi *pApi, /* API offered by current FTS version */
97849798
Fts5Context *pFts, /* First arg to pass to pApi functions */
97859799
sqlite3_context *pCtx, /* Context for returning result/error */
97869800
int nVal, /* Number of values in apVal[] array */
97879801
sqlite3_value **apVal /* Array of trailing arguments */
@@ -9828,15 +9842,15 @@
98289842
** This function may be quite inefficient if used with an FTS5 table
98299843
** created with the "columnsize=0" option.
98309844
**
98319845
** xColumnText:
98329846
** This function attempts to retrieve the text of column iCol of the
9833
-** current document. If successful, (*pz) is set to point to a buffer
9834
-** containing the text in utf-8 encoding, (*pn) is set to the size in bytes
9847
+** current document. If successful, (SQLITE_CALLBACK *pz) is set to point to a buffer
9848
+** containing the text in utf-8 encoding, (SQLITE_CALLBACK *pn) is set to the size in bytes
98359849
** (not characters) of the buffer and SQLITE_OK is returned. Otherwise,
98369850
** if an error occurs, an SQLite error code is returned and the final values
9837
-** of (*pz) and (*pn) are undefined.
9851
+** of (SQLITE_CALLBACK *pz) and (*pn) are undefined.
98389852
**
98399853
** xPhraseCount:
98409854
** Returns the number of phrases in the current query expression.
98419855
**
98429856
** xPhraseSize:
@@ -9941,11 +9955,11 @@
99419955
** xRowCount(pFts5, pnRow)
99429956
**
99439957
** This function is used to retrieve the total number of rows in the table.
99449958
** In other words, the same value that would be returned by:
99459959
**
9946
-** SELECT count(*) FROM ftstable;
9960
+** SELECT count(SQLITE_CALLBACK *) FROM ftstable;
99479961
**
99489962
** xPhraseFirst()
99499963
** This function is used, along with type Fts5PhraseIter and the xPhraseNext
99509964
** method, to iterate through all instances of a single query phrase within
99519965
** the current row. This is the same information as is accessible via the
@@ -10008,43 +10022,43 @@
1000810022
** See xPhraseFirstColumn above.
1000910023
*/
1001010024
struct Fts5ExtensionApi {
1001110025
int iVersion; /* Currently always set to 3 */
1001210026
10013
- void *(*xUserData)(Fts5Context*);
10027
+ void *(SQLITE_CALLBACK *xUserData)(Fts5Context*);
1001410028
10015
- int (*xColumnCount)(Fts5Context*);
10016
- int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow);
10017
- int (*xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken);
10029
+ int (SQLITE_CALLBACK *xColumnCount)(Fts5Context*);
10030
+ int (SQLITE_CALLBACK *xRowCount)(Fts5Context*, sqlite3_int64 *pnRow);
10031
+ int (SQLITE_CALLBACK *xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken);
1001810032
10019
- int (*xTokenize)(Fts5Context*,
10033
+ int (SQLITE_CALLBACK *xTokenize)(Fts5Context*,
1002010034
const char *pText, int nText, /* Text to tokenize */
1002110035
void *pCtx, /* Context passed to xToken() */
10022
- int (*xToken)(void*, int, const char*, int, int, int) /* Callback */
10023
- );
10024
-
10025
- int (*xPhraseCount)(Fts5Context*);
10026
- int (*xPhraseSize)(Fts5Context*, int iPhrase);
10027
-
10028
- int (*xInstCount)(Fts5Context*, int *pnInst);
10029
- int (*xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff);
10030
-
10031
- sqlite3_int64 (*xRowid)(Fts5Context*);
10032
- int (*xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn);
10033
- int (*xColumnSize)(Fts5Context*, int iCol, int *pnToken);
10034
-
10035
- int (*xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData,
10036
- int(*)(const Fts5ExtensionApi*,Fts5Context*,void*)
10037
- );
10038
- int (*xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*));
10039
- void *(*xGetAuxdata)(Fts5Context*, int bClear);
10040
-
10041
- int (*xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*);
10042
- void (*xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff);
10043
-
10044
- int (*xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*);
10045
- void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol);
10036
+ int (SQLITE_CALLBACK *xToken)(void*, int, const char*, int, int, int) /* Callback */
10037
+ );
10038
+
10039
+ int (SQLITE_CALLBACK *xPhraseCount)(Fts5Context*);
10040
+ int (SQLITE_CALLBACK *xPhraseSize)(Fts5Context*, int iPhrase);
10041
+
10042
+ int (SQLITE_CALLBACK *xInstCount)(Fts5Context*, int *pnInst);
10043
+ int (SQLITE_CALLBACK *xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff);
10044
+
10045
+ sqlite3_int64 (SQLITE_CALLBACK *xRowid)(Fts5Context*);
10046
+ int (SQLITE_CALLBACK *xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn);
10047
+ int (SQLITE_CALLBACK *xColumnSize)(Fts5Context*, int iCol, int *pnToken);
10048
+
10049
+ int (SQLITE_CALLBACK *xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData,
10050
+ int(SQLITE_CALLBACK *)(const Fts5ExtensionApi*,Fts5Context*,void*)
10051
+ );
10052
+ int (SQLITE_CALLBACK *xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*));
10053
+ void *(SQLITE_CALLBACK *xGetAuxdata)(Fts5Context*, int bClear);
10054
+
10055
+ int (SQLITE_CALLBACK *xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*);
10056
+ void (SQLITE_CALLBACK *xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff);
10057
+
10058
+ int (SQLITE_CALLBACK *xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*);
10059
+ void (SQLITE_CALLBACK *xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol);
1004610060
};
1004710061
1004810062
/*
1004910063
** CUSTOM AUXILIARY FUNCTIONS
1005010064
*************************************************************************/
@@ -10068,11 +10082,11 @@
1006810082
** The second and third arguments are an array of nul-terminated strings
1006910083
** containing the tokenizer arguments, if any, specified following the
1007010084
** tokenizer name as part of the CREATE VIRTUAL TABLE statement used
1007110085
** to create the FTS5 table.
1007210086
**
10073
-** The final argument is an output variable. If successful, (*ppOut)
10087
+** The final argument is an output variable. If successful, (SQLITE_CALLBACK *ppOut)
1007410088
** should be set to point to the new tokenizer handle and SQLITE_OK
1007510089
** returned. If an error occurs, some value other than SQLITE_OK should
1007610090
** be returned. In this case, fts5 assumes that the final value of *ppOut
1007710091
** is undefined.
1007810092
**
@@ -10242,17 +10256,17 @@
1024210256
** inefficient.
1024310257
*/
1024410258
typedef struct Fts5Tokenizer Fts5Tokenizer;
1024510259
typedef struct fts5_tokenizer fts5_tokenizer;
1024610260
struct fts5_tokenizer {
10247
- int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
10248
- void (*xDelete)(Fts5Tokenizer*);
10249
- int (*xTokenize)(Fts5Tokenizer*,
10261
+ int (SQLITE_CALLBACK *xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
10262
+ void (SQLITE_CALLBACK *xDelete)(Fts5Tokenizer*);
10263
+ int (SQLITE_CALLBACK *xTokenize)(Fts5Tokenizer*,
1025010264
void *pCtx,
1025110265
int flags, /* Mask of FTS5_TOKENIZE_* flags */
1025210266
const char *pText, int nText,
10253
- int (*xToken)(
10267
+ int (SQLITE_CALLBACK *xToken)(
1025410268
void *pCtx, /* Copy of 2nd argument to xTokenize() */
1025510269
int tflags, /* Mask of FTS5_TOKEN_* flags */
1025610270
const char *pToken, /* Pointer to buffer containing token */
1025710271
int nToken, /* Size of token in bytes */
1025810272
int iStart, /* Byte offset of token within input text */
@@ -10281,33 +10295,33 @@
1028110295
typedef struct fts5_api fts5_api;
1028210296
struct fts5_api {
1028310297
int iVersion; /* Currently always set to 2 */
1028410298
1028510299
/* Create a new tokenizer */
10286
- int (*xCreateTokenizer)(
10300
+ int (SQLITE_CALLBACK *xCreateTokenizer)(
1028710301
fts5_api *pApi,
1028810302
const char *zName,
1028910303
void *pContext,
1029010304
fts5_tokenizer *pTokenizer,
10291
- void (*xDestroy)(void*)
10305
+ void (SQLITE_CALLBACK *xDestroy)(void*)
1029210306
);
1029310307
1029410308
/* Find an existing tokenizer */
10295
- int (*xFindTokenizer)(
10309
+ int (SQLITE_CALLBACK *xFindTokenizer)(
1029610310
fts5_api *pApi,
1029710311
const char *zName,
1029810312
void **ppContext,
1029910313
fts5_tokenizer *pTokenizer
1030010314
);
1030110315
1030210316
/* Create a new auxiliary function */
10303
- int (*xCreateFunction)(
10317
+ int (SQLITE_CALLBACK *xCreateFunction)(
1030410318
fts5_api *pApi,
1030510319
const char *zName,
1030610320
void *pContext,
1030710321
fts5_extension_function xFunction,
10308
- void (*xDestroy)(void*)
10322
+ void (SQLITE_CALLBACK *xDestroy)(void*)
1030910323
);
1031010324
};
1031110325
1031210326
/*
1031310327
** END OF REGISTRATION API
1031410328
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -52,12 +52,21 @@
52 # define SQLITE_API
53 #endif
54 #ifndef SQLITE_CDECL
55 # define SQLITE_CDECL
56 #endif
 
 
 
57 #ifndef SQLITE_STDCALL
58 # define SQLITE_STDCALL
 
 
 
 
 
 
59 #endif
60
61 /*
62 ** These no-op macros are used in front of interfaces to mark those
63 ** interfaces as either deprecated or experimental. New applications
@@ -111,11 +120,11 @@
111 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
112 ** [sqlite_version()] and [sqlite_source_id()].
113 */
114 #define SQLITE_VERSION "3.14.0"
115 #define SQLITE_VERSION_NUMBER 3014000
116 #define SQLITE_SOURCE_ID "2016-07-28 12:52:30 6feff15cae8f0427be790355841d49c479c1c586"
117
118 /*
119 ** CAPI3REF: Run-Time Library Version Numbers
120 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
121 **
@@ -144,13 +153,13 @@
144 ** [SQLITE_SOURCE_ID] C preprocessor macro.
145 **
146 ** See also: [sqlite_version()] and [sqlite_source_id()].
147 */
148 SQLITE_API SQLITE_EXTERN const char sqlite3_version[];
149 SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void);
150 SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void);
151 SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void);
152
153 /*
154 ** CAPI3REF: Run-Time Library Compilation Options Diagnostics
155 **
156 ** ^The sqlite3_compileoption_used() function returns 0 or 1
@@ -171,12 +180,12 @@
171 **
172 ** See also: SQL functions [sqlite_compileoption_used()] and
173 ** [sqlite_compileoption_get()] and the [compile_options pragma].
174 */
175 #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
176 SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName);
177 SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N);
178 #endif
179
180 /*
181 ** CAPI3REF: Test To See If The Library Is Threadsafe
182 **
@@ -211,11 +220,11 @@
211 ** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
212 ** is unchanged by calls to sqlite3_config().)^
213 **
214 ** See the [threading mode] documentation for additional information.
215 */
216 SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void);
217
218 /*
219 ** CAPI3REF: Database Connection Handle
220 ** KEYWORDS: {database connection} {database connections}
221 **
@@ -308,19 +317,19 @@
308 ** from [sqlite3_open()], [sqlite3_open16()], or
309 ** [sqlite3_open_v2()], and not previously closed.
310 ** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
311 ** argument is a harmless no-op.
312 */
313 SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3*);
314 SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3*);
315
316 /*
317 ** The type for a callback function.
318 ** This is legacy and deprecated. It is included for historical
319 ** compatibility and is not documented.
320 */
321 typedef int (*sqlite3_callback)(void*,int,char**, char**);
322
323 /*
324 ** CAPI3REF: One-Step Query Execution Interface
325 ** METHOD: sqlite3
326 **
@@ -380,14 +389,14 @@
380 ** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
381 ** <li> The application must not modify the SQL statement text passed into
382 ** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
383 ** </ul>
384 */
385 SQLITE_API int SQLITE_STDCALL sqlite3_exec(
386 sqlite3*, /* An open database */
387 const char *sql, /* SQL to be evaluated */
388 int (*callback)(void*,int,char**,char**), /* Callback function */
389 void *, /* 1st argument to callback */
390 char **errmsg /* Error msg written here */
391 );
392
393 /*
@@ -731,30 +740,30 @@
731 ** database corruption.
732 */
733 typedef struct sqlite3_io_methods sqlite3_io_methods;
734 struct sqlite3_io_methods {
735 int iVersion;
736 int (*xClose)(sqlite3_file*);
737 int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
738 int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
739 int (*xTruncate)(sqlite3_file*, sqlite3_int64 size);
740 int (*xSync)(sqlite3_file*, int flags);
741 int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
742 int (*xLock)(sqlite3_file*, int);
743 int (*xUnlock)(sqlite3_file*, int);
744 int (*xCheckReservedLock)(sqlite3_file*, int *pResOut);
745 int (*xFileControl)(sqlite3_file*, int op, void *pArg);
746 int (*xSectorSize)(sqlite3_file*);
747 int (*xDeviceCharacteristics)(sqlite3_file*);
748 /* Methods above are valid for version 1 */
749 int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
750 int (*xShmLock)(sqlite3_file*, int offset, int n, int flags);
751 void (*xShmBarrier)(sqlite3_file*);
752 int (*xShmUnmap)(sqlite3_file*, int deleteFlag);
753 /* Methods above are valid for version 2 */
754 int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
755 int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p);
756 /* Methods above are valid for version 3 */
757 /* Additional methods may be added in future releases */
758 };
759
760 /*
@@ -926,11 +935,11 @@
926 ** ^The [SQLITE_FCNTL_BUSYHANDLER]
927 ** file-control may be invoked by SQLite on the database file handle
928 ** shortly after it is opened in order to provide a custom VFS with access
929 ** to the connections busy-handler callback. The argument is of type (void **)
930 ** - an array of two (void *) values. The first (void *) actually points
931 ** to a function of type (int (*)(void *)). In order to invoke the connections
932 ** busy-handler, this function should be invoked with the second (void *) in
933 ** the array as the only argument. If it returns non-zero, then the operation
934 ** should be retried. If it returns zero, the custom VFS should abandon the
935 ** current operation.
936 **
@@ -1192,43 +1201,43 @@
1192 ** or all of these interfaces to be NULL or for their behavior to change
1193 ** from one release to the next. Applications must not attempt to access
1194 ** any of these methods if the iVersion of the VFS is less than 3.
1195 */
1196 typedef struct sqlite3_vfs sqlite3_vfs;
1197 typedef void (*sqlite3_syscall_ptr)(void);
1198 struct sqlite3_vfs {
1199 int iVersion; /* Structure version number (currently 3) */
1200 int szOsFile; /* Size of subclassed sqlite3_file */
1201 int mxPathname; /* Maximum file pathname length */
1202 sqlite3_vfs *pNext; /* Next registered VFS */
1203 const char *zName; /* Name of this virtual file system */
1204 void *pAppData; /* Pointer to application-specific data */
1205 int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
1206 int flags, int *pOutFlags);
1207 int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
1208 int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
1209 int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
1210 void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename);
1211 void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
1212 void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
1213 void (*xDlClose)(sqlite3_vfs*, void*);
1214 int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
1215 int (*xSleep)(sqlite3_vfs*, int microseconds);
1216 int (*xCurrentTime)(sqlite3_vfs*, double*);
1217 int (*xGetLastError)(sqlite3_vfs*, int, char *);
1218 /*
1219 ** The methods above are in version 1 of the sqlite_vfs object
1220 ** definition. Those that follow are added in version 2 or later
1221 */
1222 int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
1223 /*
1224 ** The methods above are in versions 1 and 2 of the sqlite_vfs object.
1225 ** Those below are for version 3 and greater.
1226 */
1227 int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
1228 sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName);
1229 const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName);
1230 /*
1231 ** The methods above are in versions 1 through 3 of the sqlite_vfs object.
1232 ** New fields may be appended in future versions. The iVersion
1233 ** value will increment whenever this happens.
1234 */
@@ -1369,14 +1378,14 @@
1369 ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied
1370 ** implementation of sqlite3_os_init() or sqlite3_os_end()
1371 ** must return [SQLITE_OK] on success and some other [error code] upon
1372 ** failure.
1373 */
1374 SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void);
1375 SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void);
1376 SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void);
1377 SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void);
1378
1379 /*
1380 ** CAPI3REF: Configuring The SQLite Library
1381 **
1382 ** The sqlite3_config() interface is used to make global configuration
@@ -1491,17 +1500,17 @@
1491 ** SQLite will never invoke xInit() more than once without an intervening
1492 ** call to xShutdown().
1493 */
1494 typedef struct sqlite3_mem_methods sqlite3_mem_methods;
1495 struct sqlite3_mem_methods {
1496 void *(*xMalloc)(int); /* Memory allocation function */
1497 void (*xFree)(void*); /* Free a prior allocation */
1498 void *(*xRealloc)(void*,int); /* Resize an allocation */
1499 int (*xSize)(void*); /* Return the size of an allocation */
1500 int (*xRoundup)(int); /* Round up request size to allocation size */
1501 int (*xInit)(void*); /* Initialize the memory allocator */
1502 void (*xShutdown)(void*); /* Deinitialize the memory allocator */
1503 void *pAppData; /* Argument to xInit() and xShutdown() */
1504 };
1505
1506 /*
1507 ** CAPI3REF: Configuration Options
@@ -1714,11 +1723,11 @@
1714 **
1715 ** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
1716 ** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
1717 ** global [error log].
1718 ** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a
1719 ** function with a call signature of void(*)(void*,int,const char*),
1720 ** and a pointer to void. ^If the function pointer is not NULL, it is
1721 ** invoked by [sqlite3_log()] to process each logging event. ^If the
1722 ** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op.
1723 ** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is
1724 ** passed through as the first parameter to the application-defined logger
@@ -1767,11 +1776,11 @@
1767 **
1768 ** [[SQLITE_CONFIG_SQLLOG]]
1769 ** <dt>SQLITE_CONFIG_SQLLOG
1770 ** <dd>This option is only available if sqlite is compiled with the
1771 ** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should
1772 ** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int).
1773 ** The second should be of type (void*). The callback is invoked by the library
1774 ** in three separate circumstances, identified by the value passed as the
1775 ** fourth parameter. If the fourth parameter is 0, then the database connection
1776 ** passed as the second argument has just been opened. The third argument
1777 ** points to a buffer containing the name of the main database file. If the
@@ -1965,11 +1974,11 @@
1965 **
1966 ** ^The sqlite3_extended_result_codes() routine enables or disables the
1967 ** [extended result codes] feature of SQLite. ^The extended result
1968 ** codes are disabled by default for historical compatibility.
1969 */
1970 SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3*, int onoff);
1971
1972 /*
1973 ** CAPI3REF: Last Insert Rowid
1974 ** METHOD: sqlite3
1975 **
@@ -2017,11 +2026,11 @@
2017 ** function is running and thus changes the last insert [rowid],
2018 ** then the value returned by [sqlite3_last_insert_rowid()] is
2019 ** unpredictable and might not equal either the old or the new
2020 ** last insert [rowid].
2021 */
2022 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3*);
2023
2024 /*
2025 ** CAPI3REF: Count The Number Of Rows Modified
2026 ** METHOD: sqlite3
2027 **
@@ -2070,11 +2079,11 @@
2070 **
2071 ** If a separate thread makes changes on the same database connection
2072 ** while [sqlite3_changes()] is running then the value returned
2073 ** is unpredictable and not meaningful.
2074 */
2075 SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3*);
2076
2077 /*
2078 ** CAPI3REF: Total Number Of Rows Modified
2079 ** METHOD: sqlite3
2080 **
@@ -2094,11 +2103,11 @@
2094 **
2095 ** If a separate thread makes changes on the same database connection
2096 ** while [sqlite3_total_changes()] is running then the value
2097 ** returned is unpredictable and not meaningful.
2098 */
2099 SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3*);
2100
2101 /*
2102 ** CAPI3REF: Interrupt A Long-Running Query
2103 ** METHOD: sqlite3
2104 **
@@ -2134,11 +2143,11 @@
2134 ** that are started after the sqlite3_interrupt() call returns.
2135 **
2136 ** If the database connection closes while [sqlite3_interrupt()]
2137 ** is running then bad things will likely happen.
2138 */
2139 SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3*);
2140
2141 /*
2142 ** CAPI3REF: Determine If An SQL Statement Is Complete
2143 **
2144 ** These routines are useful during command-line input to determine if the
@@ -2169,12 +2178,12 @@
2169 ** UTF-8 string.
2170 **
2171 ** The input to [sqlite3_complete16()] must be a zero-terminated
2172 ** UTF-16 string in native byte order.
2173 */
2174 SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *sql);
2175 SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *sql);
2176
2177 /*
2178 ** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
2179 ** KEYWORDS: {busy-handler callback} {busy handler}
2180 ** METHOD: sqlite3
@@ -2231,11 +2240,11 @@
2231 ** result in undefined behavior.
2232 **
2233 ** A busy handler must not close the database connection
2234 ** or [prepared statement] that invoked the busy handler.
2235 */
2236 SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*);
2237
2238 /*
2239 ** CAPI3REF: Set A Busy Timeout
2240 ** METHOD: sqlite3
2241 **
@@ -2254,11 +2263,11 @@
2254 ** was defined (using [sqlite3_busy_handler()]) prior to calling
2255 ** this routine, that other busy handler is cleared.)^
2256 **
2257 ** See also: [PRAGMA busy_timeout]
2258 */
2259 SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3*, int ms);
2260
2261 /*
2262 ** CAPI3REF: Convenience Routines For Running Queries
2263 ** METHOD: sqlite3
2264 **
@@ -2329,19 +2338,19 @@
2329 ** interface defined here. As a consequence, errors that occur in the
2330 ** wrapper layer outside of the internal [sqlite3_exec()] call are not
2331 ** reflected in subsequent calls to [sqlite3_errcode()] or
2332 ** [sqlite3_errmsg()].
2333 */
2334 SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
2335 sqlite3 *db, /* An open database */
2336 const char *zSql, /* SQL to be evaluated */
2337 char ***pazResult, /* Results of the query */
2338 int *pnRow, /* Number of result rows written here */
2339 int *pnColumn, /* Number of result columns written here */
2340 char **pzErrmsg /* Error msg written here */
2341 );
2342 SQLITE_API void SQLITE_STDCALL sqlite3_free_table(char **result);
2343
2344 /*
2345 ** CAPI3REF: Formatted String Printing Functions
2346 **
2347 ** These routines are work-alikes of the "printf()" family of functions
@@ -2444,13 +2453,13 @@
2444 ** ^(The "%z" formatting option works like "%s" but with the
2445 ** addition that after the string has been read and copied into
2446 ** the result, [sqlite3_free()] is called on the input string.)^
2447 */
2448 SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...);
2449 SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list);
2450 SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...);
2451 SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list);
2452
2453 /*
2454 ** CAPI3REF: Memory Allocation Subsystem
2455 **
2456 ** The SQLite core uses these three routines for all of its own
@@ -2536,16 +2545,16 @@
2536 **
2537 ** The application must not read or write any part of
2538 ** a block of memory after it has been released using
2539 ** [sqlite3_free()] or [sqlite3_realloc()].
2540 */
2541 SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int);
2542 SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64);
2543 SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void*, int);
2544 SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void*, sqlite3_uint64);
2545 SQLITE_API void SQLITE_STDCALL sqlite3_free(void*);
2546 SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void*);
2547
2548 /*
2549 ** CAPI3REF: Memory Allocator Statistics
2550 **
2551 ** SQLite provides these two interfaces for reporting on the status
@@ -2566,12 +2575,12 @@
2566 ** [sqlite3_memory_used()] if and only if the parameter to
2567 ** [sqlite3_memory_highwater()] is true. ^The value returned
2568 ** by [sqlite3_memory_highwater(1)] is the high-water mark
2569 ** prior to the reset.
2570 */
2571 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void);
2572 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag);
2573
2574 /*
2575 ** CAPI3REF: Pseudo-Random Number Generator
2576 **
2577 ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
@@ -2590,11 +2599,11 @@
2590 ** ^If the previous call to this routine had an N of 1 or more and a
2591 ** non-NULL P then the pseudo-randomness is generated
2592 ** internally and without recourse to the [sqlite3_vfs] xRandomness
2593 ** method.
2594 */
2595 SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *P);
2596
2597 /*
2598 ** CAPI3REF: Compile-Time Authorization Callbacks
2599 ** METHOD: sqlite3
2600 **
@@ -2673,13 +2682,13 @@
2673 ** [sqlite3_prepare()] or its variants. Authorization is not
2674 ** performed during statement evaluation in [sqlite3_step()], unless
2675 ** as stated in the previous paragraph, sqlite3_step() invokes
2676 ** sqlite3_prepare_v2() to reprepare a statement after a schema change.
2677 */
2678 SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
2679 sqlite3*,
2680 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
2681 void *pUserData
2682 );
2683
2684 /*
2685 ** CAPI3REF: Authorizer Return Codes
@@ -2781,14 +2790,14 @@
2781 ** digits in the time are meaningless. Future versions of SQLite
2782 ** might provide greater resolution on the profiler callback. The
2783 ** sqlite3_profile() function is considered experimental and is
2784 ** subject to change in future versions of SQLite.
2785 */
2786 SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_trace(sqlite3*,
2787 void(*xTrace)(void*,const char*), void*);
2788 SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_profile(sqlite3*,
2789 void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
2790
2791 /*
2792 ** CAPI3REF: SQL Trace Event Codes
2793 ** KEYWORDS: SQLITE_TRACE
2794 **
@@ -2872,14 +2881,14 @@
2872 **
2873 ** The sqlite3_trace_v2() interface is intended to replace the legacy
2874 ** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which
2875 ** are deprecated.
2876 */
2877 SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2(
2878 sqlite3*,
2879 unsigned uMask,
2880 int(*xCallback)(unsigned,void*,void*,void*),
2881 void *pCtx
2882 );
2883
2884 /*
2885 ** CAPI3REF: Query Progress Callbacks
@@ -2911,11 +2920,11 @@
2911 ** the database connection that invoked the progress handler.
2912 ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
2913 ** database connections for the meaning of "modify" in this paragraph.
2914 **
2915 */
2916 SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
2917
2918 /*
2919 ** CAPI3REF: Opening A New Database Connection
2920 ** CONSTRUCTOR: sqlite3
2921 **
@@ -3140,19 +3149,19 @@
3140 ** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various
3141 ** features that require the use of temporary files may fail.
3142 **
3143 ** See also: [sqlite3_temp_directory]
3144 */
3145 SQLITE_API int SQLITE_STDCALL sqlite3_open(
3146 const char *filename, /* Database filename (UTF-8) */
3147 sqlite3 **ppDb /* OUT: SQLite db handle */
3148 );
3149 SQLITE_API int SQLITE_STDCALL sqlite3_open16(
3150 const void *filename, /* Database filename (UTF-16) */
3151 sqlite3 **ppDb /* OUT: SQLite db handle */
3152 );
3153 SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
3154 const char *filename, /* Database filename (UTF-8) */
3155 sqlite3 **ppDb, /* OUT: SQLite db handle */
3156 int flags, /* Flags */
3157 const char *zVfs /* Name of VFS module to use */
3158 );
@@ -3194,13 +3203,13 @@
3194 ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and
3195 ** is not a database file pathname pointer that SQLite passed into the xOpen
3196 ** VFS method, then the behavior of this routine is undefined and probably
3197 ** undesirable.
3198 */
3199 SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3200 SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3201 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
3202
3203
3204 /*
3205 ** CAPI3REF: Error Codes And Messages
3206 ** METHOD: sqlite3
@@ -3240,15 +3249,15 @@
3240 **
3241 ** If an interface fails with SQLITE_MISUSE, that means the interface
3242 ** was invoked incorrectly by the application. In that case, the
3243 ** error code and message may or may not be set.
3244 */
3245 SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db);
3246 SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db);
3247 SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*);
3248 SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*);
3249 SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int);
3250
3251 /*
3252 ** CAPI3REF: Prepared Statement Object
3253 ** KEYWORDS: {prepared statement} {prepared statements}
3254 **
@@ -3312,11 +3321,11 @@
3312 ** created by an untrusted script can be contained using the
3313 ** [max_page_count] [PRAGMA].
3314 **
3315 ** New run-time limit categories may be added in future releases.
3316 */
3317 SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3*, int id, int newVal);
3318
3319 /*
3320 ** CAPI3REF: Run-Time Limit Categories
3321 ** KEYWORDS: {limit category} {*limit categories}
3322 **
@@ -3464,32 +3473,32 @@
3464 ** or [GLOB] operator or if the parameter is compared to an indexed column
3465 ** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
3466 ** </li>
3467 ** </ol>
3468 */
3469 SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
3470 sqlite3 *db, /* Database handle */
3471 const char *zSql, /* SQL statement, UTF-8 encoded */
3472 int nByte, /* Maximum length of zSql in bytes. */
3473 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3474 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3475 );
3476 SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
3477 sqlite3 *db, /* Database handle */
3478 const char *zSql, /* SQL statement, UTF-8 encoded */
3479 int nByte, /* Maximum length of zSql in bytes. */
3480 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3481 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3482 );
3483 SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
3484 sqlite3 *db, /* Database handle */
3485 const void *zSql, /* SQL statement, UTF-16 encoded */
3486 int nByte, /* Maximum length of zSql in bytes. */
3487 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3488 const void **pzTail /* OUT: Pointer to unused portion of zSql */
3489 );
3490 SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
3491 sqlite3 *db, /* Database handle */
3492 const void *zSql, /* SQL statement, UTF-16 encoded */
3493 int nByte, /* Maximum length of zSql in bytes. */
3494 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3495 const void **pzTail /* OUT: Pointer to unused portion of zSql */
@@ -3524,12 +3533,12 @@
3524 ** automatically freed when the prepared statement is finalized.
3525 ** ^The string returned by sqlite3_expanded_sql(P), on the other hand,
3526 ** is obtained from [sqlite3_malloc()] and must be free by the application
3527 ** by passing it to [sqlite3_free()].
3528 */
3529 SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt);
3530 SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt);
3531
3532 /*
3533 ** CAPI3REF: Determine If An SQL Statement Writes The Database
3534 ** METHOD: sqlite3_stmt
3535 **
@@ -3557,11 +3566,11 @@
3557 ** database. ^The [ATTACH] and [DETACH] statements also cause
3558 ** sqlite3_stmt_readonly() to return true since, while those statements
3559 ** change the configuration of a database connection, they do not make
3560 ** changes to the content of the database files on disk.
3561 */
3562 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
3563
3564 /*
3565 ** CAPI3REF: Determine If A Prepared Statement Has Been Reset
3566 ** METHOD: sqlite3_stmt
3567 **
@@ -3578,11 +3587,11 @@
3578 ** to locate all prepared statements associated with a database
3579 ** connection that are in need of being reset. This can be used,
3580 ** for example, in diagnostic routines to search for prepared
3581 ** statements that are holding a transaction open.
3582 */
3583 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt*);
3584
3585 /*
3586 ** CAPI3REF: Dynamically Typed Value Object
3587 ** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
3588 **
@@ -3742,24 +3751,24 @@
3742 ** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails.
3743 **
3744 ** See also: [sqlite3_bind_parameter_count()],
3745 ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].
3746 */
3747 SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
3748 SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
3749 void(*)(void*));
3750 SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt*, int, double);
3751 SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt*, int, int);
3752 SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
3753 SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt*, int);
3754 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
3755 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
3756 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
3757 void(*)(void*), unsigned char encoding);
3758 SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
3759 SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
3760 SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
3761
3762 /*
3763 ** CAPI3REF: Number Of SQL Parameters
3764 ** METHOD: sqlite3_stmt
3765 **
@@ -3776,11 +3785,11 @@
3776 **
3777 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3778 ** [sqlite3_bind_parameter_name()], and
3779 ** [sqlite3_bind_parameter_index()].
3780 */
3781 SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt*);
3782
3783 /*
3784 ** CAPI3REF: Name Of A Host Parameter
3785 ** METHOD: sqlite3_stmt
3786 **
@@ -3804,11 +3813,11 @@
3804 **
3805 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3806 ** [sqlite3_bind_parameter_count()], and
3807 ** [sqlite3_bind_parameter_index()].
3808 */
3809 SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
3810
3811 /*
3812 ** CAPI3REF: Index Of A Parameter With A Given Name
3813 ** METHOD: sqlite3_stmt
3814 **
@@ -3821,21 +3830,21 @@
3821 **
3822 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3823 ** [sqlite3_bind_parameter_count()], and
3824 ** [sqlite3_bind_parameter_name()].
3825 */
3826 SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
3827
3828 /*
3829 ** CAPI3REF: Reset All Bindings On A Prepared Statement
3830 ** METHOD: sqlite3_stmt
3831 **
3832 ** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset
3833 ** the [sqlite3_bind_blob | bindings] on a [prepared statement].
3834 ** ^Use this routine to reset all host parameters to NULL.
3835 */
3836 SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt*);
3837
3838 /*
3839 ** CAPI3REF: Number Of Columns In A Result Set
3840 ** METHOD: sqlite3_stmt
3841 **
@@ -3843,11 +3852,11 @@
3843 ** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
3844 ** statement that does not return data (for example an [UPDATE]).
3845 **
3846 ** See also: [sqlite3_data_count()]
3847 */
3848 SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt);
3849
3850 /*
3851 ** CAPI3REF: Column Names In A Result Set
3852 ** METHOD: sqlite3_stmt
3853 **
@@ -3872,12 +3881,12 @@
3872 ** ^The name of a result column is the value of the "AS" clause for
3873 ** that column, if there is an AS clause. If there is no AS clause
3874 ** then the name of the column is unspecified and may change from
3875 ** one release of SQLite to the next.
3876 */
3877 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt*, int N);
3878 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt*, int N);
3879
3880 /*
3881 ** CAPI3REF: Source Of Data In A Query Result
3882 ** METHOD: sqlite3_stmt
3883 **
@@ -3921,16 +3930,16 @@
3921 ** If two or more threads call one or more
3922 ** [sqlite3_column_database_name | column metadata interfaces]
3923 ** for the same [prepared statement] and result column
3924 ** at the same time then the results are undefined.
3925 */
3926 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int);
3927 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int);
3928 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int);
3929 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int);
3930 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int);
3931 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
3932
3933 /*
3934 ** CAPI3REF: Declared Datatype Of A Query Result
3935 ** METHOD: sqlite3_stmt
3936 **
@@ -3958,12 +3967,12 @@
3958 ** data stored in that column is of the declared type. SQLite is
3959 ** strongly typed, but the typing is dynamic not static. ^Type
3960 ** is associated with individual values, not with the containers
3961 ** used to hold those values.
3962 */
3963 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt*,int);
3964 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt*,int);
3965
3966 /*
3967 ** CAPI3REF: Evaluate An SQL Statement
3968 ** METHOD: sqlite3_stmt
3969 **
@@ -4039,11 +4048,11 @@
4039 ** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
4040 ** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,
4041 ** then the more specific [error codes] are returned directly
4042 ** by sqlite3_step(). The use of the "v2" interface is recommended.
4043 */
4044 SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt*);
4045
4046 /*
4047 ** CAPI3REF: Number of columns in a result set
4048 ** METHOD: sqlite3_stmt
4049 **
@@ -4060,11 +4069,11 @@
4060 ** where it always returns zero since each step of that multi-step
4061 ** pragma returns 0 columns of data.
4062 **
4063 ** See also: [sqlite3_column_count()]
4064 */
4065 SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt);
4066
4067 /*
4068 ** CAPI3REF: Fundamental Datatypes
4069 ** KEYWORDS: SQLITE_TEXT
4070 **
@@ -4250,20 +4259,20 @@
4250 ** of these routines, a default value is returned. The default value
4251 ** is either the integer 0, the floating point number 0.0, or a NULL
4252 ** pointer. Subsequent calls to [sqlite3_errcode()] will return
4253 ** [SQLITE_NOMEM].)^
4254 */
4255 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt*, int iCol);
4256 SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4257 SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4258 SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt*, int iCol);
4259 SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt*, int iCol);
4260 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt*, int iCol);
4261 SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt*, int iCol);
4262 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt*, int iCol);
4263 SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt*, int iCol);
4264 SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt*, int iCol);
4265
4266 /*
4267 ** CAPI3REF: Destroy A Prepared Statement Object
4268 ** DESTRUCTOR: sqlite3_stmt
4269 **
@@ -4287,11 +4296,11 @@
4287 ** resource leaks. It is a grievous error for the application to try to use
4288 ** a prepared statement after it has been finalized. Any use of a prepared
4289 ** statement after it has been finalized can result in undefined and
4290 ** undesirable behavior such as segfaults and heap corruption.
4291 */
4292 SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt);
4293
4294 /*
4295 ** CAPI3REF: Reset A Prepared Statement Object
4296 ** METHOD: sqlite3_stmt
4297 **
@@ -4314,11 +4323,11 @@
4314 ** [sqlite3_reset(S)] returns an appropriate [error code].
4315 **
4316 ** ^The [sqlite3_reset(S)] interface does not change the values
4317 ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
4318 */
4319 SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt);
4320
4321 /*
4322 ** CAPI3REF: Create Or Redefine SQL Functions
4323 ** KEYWORDS: {function creation routines}
4324 ** KEYWORDS: {application-defined SQL function}
@@ -4414,40 +4423,40 @@
4414 ** ^An application-defined function is permitted to call other
4415 ** SQLite interfaces. However, such calls must not
4416 ** close the database connection nor finalize or reset the prepared
4417 ** statement in which the function is running.
4418 */
4419 SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
4420 sqlite3 *db,
4421 const char *zFunctionName,
4422 int nArg,
4423 int eTextRep,
4424 void *pApp,
4425 void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4426 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4427 void (*xFinal)(sqlite3_context*)
4428 );
4429 SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
4430 sqlite3 *db,
4431 const void *zFunctionName,
4432 int nArg,
4433 int eTextRep,
4434 void *pApp,
4435 void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4436 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4437 void (*xFinal)(sqlite3_context*)
4438 );
4439 SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
4440 sqlite3 *db,
4441 const char *zFunctionName,
4442 int nArg,
4443 int eTextRep,
4444 void *pApp,
4445 void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4446 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4447 void (*xFinal)(sqlite3_context*),
4448 void(*xDestroy)(void*)
4449 );
4450
4451 /*
4452 ** CAPI3REF: Text Encodings
4453 **
@@ -4480,16 +4489,16 @@
4480 ** to be supported. However, new applications should avoid
4481 ** the use of these functions. To encourage programmers to avoid
4482 ** these functions, we will not explain what they do.
4483 */
4484 #ifndef SQLITE_OMIT_DEPRECATED
4485 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context*);
4486 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt*);
4487 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4488 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_global_recover(void);
4489 SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_thread_cleanup(void);
4490 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
4491 void*,sqlite3_int64);
4492 #endif
4493
4494 /*
4495 ** CAPI3REF: Obtaining SQL Values
@@ -4535,22 +4544,22 @@
4535 ** or [sqlite3_value_text16()].
4536 **
4537 ** These routines must be called from the same thread as
4538 ** the SQL function that supplied the [sqlite3_value*] parameters.
4539 */
4540 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value*);
4541 SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value*);
4542 SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value*);
4543 SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value*);
4544 SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value*);
4545 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value*);
4546 SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value*);
4547 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value*);
4548 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value*);
4549 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*);
4550 SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*);
4551 SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*);
4552
4553 /*
4554 ** CAPI3REF: Finding The Subtype Of SQL Values
4555 ** METHOD: sqlite3_value
4556 **
@@ -4562,11 +4571,11 @@
4562 **
4563 ** SQLite makes no use of subtype itself. It merely passes the subtype
4564 ** from the result of one [application-defined SQL function] into the
4565 ** input of another.
4566 */
4567 SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value*);
4568
4569 /*
4570 ** CAPI3REF: Copy And Free SQL Values
4571 ** METHOD: sqlite3_value
4572 **
@@ -4578,12 +4587,12 @@
4578 **
4579 ** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object
4580 ** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer
4581 ** then sqlite3_value_free(V) is a harmless no-op.
4582 */
4583 SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value*);
4584 SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value*);
4585
4586 /*
4587 ** CAPI3REF: Obtain Aggregate Function Context
4588 ** METHOD: sqlite3_context
4589 **
@@ -4624,11 +4633,11 @@
4624 ** function.
4625 **
4626 ** This routine must be called from the same thread in which
4627 ** the aggregate SQL function is running.
4628 */
4629 SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
4630
4631 /*
4632 ** CAPI3REF: User Data For Functions
4633 ** METHOD: sqlite3_context
4634 **
@@ -4639,11 +4648,11 @@
4639 ** registered the application defined function.
4640 **
4641 ** This routine must be called from the same thread in which
4642 ** the application-defined function is running.
4643 */
4644 SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context*);
4645
4646 /*
4647 ** CAPI3REF: Database Connection For Functions
4648 ** METHOD: sqlite3_context
4649 **
@@ -4651,11 +4660,11 @@
4651 ** the pointer to the [database connection] (the 1st parameter)
4652 ** of the [sqlite3_create_function()]
4653 ** and [sqlite3_create_function16()] routines that originally
4654 ** registered the application defined function.
4655 */
4656 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context*);
4657
4658 /*
4659 ** CAPI3REF: Function Auxiliary Data
4660 ** METHOD: sqlite3_context
4661 **
@@ -4704,12 +4713,12 @@
4704 ** values and [parameters] and expressions composed from the same.)^
4705 **
4706 ** These routines must be called from the same thread in which
4707 ** the SQL function is running.
4708 */
4709 SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context*, int N);
4710 SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
4711
4712
4713 /*
4714 ** CAPI3REF: Constants Defining Special Destructor Behavior
4715 **
@@ -4722,11 +4731,11 @@
4722 ** the content before returning.
4723 **
4724 ** The typedef is necessary to work around problems in certain
4725 ** C++ compilers.
4726 */
4727 typedef void (*sqlite3_destructor_type)(void*);
4728 #define SQLITE_STATIC ((sqlite3_destructor_type)0)
4729 #define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1)
4730
4731 /*
4732 ** CAPI3REF: Setting The Result Of An SQL Function
@@ -4841,31 +4850,31 @@
4841 **
4842 ** If these routines are called from within the different thread
4843 ** than the one containing the application-defined function that received
4844 ** the [sqlite3_context] pointer, the results are undefined.
4845 */
4846 SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
4847 SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(sqlite3_context*,const void*,
4848 sqlite3_uint64,void(*)(void*));
4849 SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context*, double);
4850 SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context*, const char*, int);
4851 SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context*, const void*, int);
4852 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context*);
4853 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context*);
4854 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context*, int);
4855 SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context*, int);
4856 SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
4857 SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context*);
4858 SQLITE_API void SQLITE_STDCALL sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
4859 SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
4860 void(*)(void*), unsigned char encoding);
4861 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
4862 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
4863 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
4864 SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
4865 SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n);
4866 SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
4867
4868
4869 /*
4870 ** CAPI3REF: Setting The Subtype Of An SQL Function
4871 ** METHOD: sqlite3_context
@@ -4876,11 +4885,11 @@
4876 ** of the subtype T are preserved in current versions of SQLite;
4877 ** higher order bits are discarded.
4878 ** The number of subtype bytes preserved by SQLite might increase
4879 ** in future releases of SQLite.
4880 */
4881 SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context*,unsigned int);
4882
4883 /*
4884 ** CAPI3REF: Define New Collating Sequences
4885 ** METHOD: sqlite3
4886 **
@@ -4958,31 +4967,31 @@
4958 ** is unfortunate but cannot be changed without breaking backwards
4959 ** compatibility.
4960 **
4961 ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].
4962 */
4963 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
4964 sqlite3*,
4965 const char *zName,
4966 int eTextRep,
4967 void *pArg,
4968 int(*xCompare)(void*,int,const void*,int,const void*)
4969 );
4970 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
4971 sqlite3*,
4972 const char *zName,
4973 int eTextRep,
4974 void *pArg,
4975 int(*xCompare)(void*,int,const void*,int,const void*),
4976 void(*xDestroy)(void*)
4977 );
4978 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
4979 sqlite3*,
4980 const void *zName,
4981 int eTextRep,
4982 void *pArg,
4983 int(*xCompare)(void*,int,const void*,int,const void*)
4984 );
4985
4986 /*
4987 ** CAPI3REF: Collation Needed Callbacks
4988 ** METHOD: sqlite3
@@ -5008,19 +5017,19 @@
5008 **
5009 ** The callback function should register the desired collation using
5010 ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or
5011 ** [sqlite3_create_collation_v2()].
5012 */
5013 SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
5014 sqlite3*,
5015 void*,
5016 void(*)(void*,sqlite3*,int eTextRep,const char*)
5017 );
5018 SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
5019 sqlite3*,
5020 void*,
5021 void(*)(void*,sqlite3*,int eTextRep,const void*)
5022 );
5023
5024 #ifdef SQLITE_HAS_CODEC
5025 /*
5026 ** Specify the key for an encrypted database. This routine should be
@@ -5027,15 +5036,15 @@
5027 ** called right after sqlite3_open().
5028 **
5029 ** The code to implement this API is not available in the public release
5030 ** of SQLite.
5031 */
5032 SQLITE_API int SQLITE_STDCALL sqlite3_key(
5033 sqlite3 *db, /* Database to be rekeyed */
5034 const void *pKey, int nKey /* The key */
5035 );
5036 SQLITE_API int SQLITE_STDCALL sqlite3_key_v2(
5037 sqlite3 *db, /* Database to be rekeyed */
5038 const char *zDbName, /* Name of the database */
5039 const void *pKey, int nKey /* The key */
5040 );
5041
@@ -5045,35 +5054,35 @@
5045 ** database is decrypted.
5046 **
5047 ** The code to implement this API is not available in the public release
5048 ** of SQLite.
5049 */
5050 SQLITE_API int SQLITE_STDCALL sqlite3_rekey(
5051 sqlite3 *db, /* Database to be rekeyed */
5052 const void *pKey, int nKey /* The new key */
5053 );
5054 SQLITE_API int SQLITE_STDCALL sqlite3_rekey_v2(
5055 sqlite3 *db, /* Database to be rekeyed */
5056 const char *zDbName, /* Name of the database */
5057 const void *pKey, int nKey /* The new key */
5058 );
5059
5060 /*
5061 ** Specify the activation key for a SEE database. Unless
5062 ** activated, none of the SEE routines will work.
5063 */
5064 SQLITE_API void SQLITE_STDCALL sqlite3_activate_see(
5065 const char *zPassPhrase /* Activation phrase */
5066 );
5067 #endif
5068
5069 #ifdef SQLITE_ENABLE_CEROD
5070 /*
5071 ** Specify the activation key for a CEROD database. Unless
5072 ** activated, none of the CEROD routines will work.
5073 */
5074 SQLITE_API void SQLITE_STDCALL sqlite3_activate_cerod(
5075 const char *zPassPhrase /* Activation phrase */
5076 );
5077 #endif
5078
5079 /*
@@ -5091,11 +5100,11 @@
5091 ** method of the default [sqlite3_vfs] object. If the xSleep() method
5092 ** of the default VFS is not implemented correctly, or not implemented at
5093 ** all, then the behavior of sqlite3_sleep() may deviate from the description
5094 ** in the previous paragraphs.
5095 */
5096 SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int);
5097
5098 /*
5099 ** CAPI3REF: Name Of The Folder Holding Temporary Files
5100 **
5101 ** ^(If this global variable is made to point to a string which is
@@ -5210,11 +5219,11 @@
5210 **
5211 ** If another thread changes the autocommit status of the database
5212 ** connection while this routine is running, then the return value
5213 ** is undefined.
5214 */
5215 SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3*);
5216
5217 /*
5218 ** CAPI3REF: Find The Database Handle Of A Prepared Statement
5219 ** METHOD: sqlite3_stmt
5220 **
@@ -5223,11 +5232,11 @@
5223 ** returned by sqlite3_db_handle is the same [database connection]
5224 ** that was the first argument
5225 ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
5226 ** create the statement in the first place.
5227 */
5228 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt*);
5229
5230 /*
5231 ** CAPI3REF: Return The Filename For A Database Connection
5232 ** METHOD: sqlite3
5233 **
@@ -5240,21 +5249,21 @@
5240 ** ^The filename returned by this function is the output of the
5241 ** xFullPathname method of the [VFS]. ^In other words, the filename
5242 ** will be an absolute pathname, even if the filename used
5243 ** to open the database originally was a URI or relative pathname.
5244 */
5245 SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
5246
5247 /*
5248 ** CAPI3REF: Determine if a database is read-only
5249 ** METHOD: sqlite3
5250 **
5251 ** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N
5252 ** of connection D is read-only, 0 if it is read/write, or -1 if N is not
5253 ** the name of a database on connection D.
5254 */
5255 SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
5256
5257 /*
5258 ** CAPI3REF: Find the next prepared statement
5259 ** METHOD: sqlite3
5260 **
@@ -5266,11 +5275,11 @@
5266 **
5267 ** The [database connection] pointer D in a call to
5268 ** [sqlite3_next_stmt(D,S)] must refer to an open database
5269 ** connection and in particular must not be a NULL pointer.
5270 */
5271 SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
5272
5273 /*
5274 ** CAPI3REF: Commit And Rollback Notification Callbacks
5275 ** METHOD: sqlite3
5276 **
@@ -5315,12 +5324,12 @@
5315 ** ^The rollback callback is not invoked if a transaction is
5316 ** automatically rolled back because the database connection is closed.
5317 **
5318 ** See also the [sqlite3_update_hook()] interface.
5319 */
5320 SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
5321 SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
5322
5323 /*
5324 ** CAPI3REF: Data Change Notification Callbacks
5325 ** METHOD: sqlite3
5326 **
@@ -5367,13 +5376,13 @@
5367 ** the first call on D.
5368 **
5369 ** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()],
5370 ** and [sqlite3_preupdate_hook()] interfaces.
5371 */
5372 SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
5373 sqlite3*,
5374 void(*)(void *,int ,char const *,char const *,sqlite3_int64),
5375 void*
5376 );
5377
5378 /*
5379 ** CAPI3REF: Enable Or Disable Shared Pager Cache
@@ -5407,11 +5416,11 @@
5407 ** This interface is threadsafe on processors where writing a
5408 ** 32-bit integer is atomic.
5409 **
5410 ** See Also: [SQLite Shared-Cache Mode]
5411 */
5412 SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int);
5413
5414 /*
5415 ** CAPI3REF: Attempt To Free Heap Memory
5416 **
5417 ** ^The sqlite3_release_memory() interface attempts to free N bytes
@@ -5423,11 +5432,11 @@
5423 ** ^The sqlite3_release_memory() routine is a no-op returning zero
5424 ** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5425 **
5426 ** See also: [sqlite3_db_release_memory()]
5427 */
5428 SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int);
5429
5430 /*
5431 ** CAPI3REF: Free Memory Used By A Database Connection
5432 ** METHOD: sqlite3
5433 **
@@ -5437,11 +5446,11 @@
5437 ** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
5438 ** omitted.
5439 **
5440 ** See also: [sqlite3_release_memory()]
5441 */
5442 SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3*);
5443
5444 /*
5445 ** CAPI3REF: Impose A Limit On Heap Size
5446 **
5447 ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the
@@ -5489,11 +5498,11 @@
5489 ** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5490 **
5491 ** The circumstances under which SQLite will enforce the soft heap limit may
5492 ** changes in future releases of SQLite.
5493 */
5494 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
5495
5496 /*
5497 ** CAPI3REF: Deprecated Soft Heap Limit Interface
5498 ** DEPRECATED
5499 **
@@ -5500,11 +5509,11 @@
5500 ** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
5501 ** interface. This routine is provided for historical compatibility
5502 ** only. All new applications should use the
5503 ** [sqlite3_soft_heap_limit64()] interface rather than this one.
5504 */
5505 SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_soft_heap_limit(int N);
5506
5507
5508 /*
5509 ** CAPI3REF: Extract Metadata About A Column Of A Table
5510 ** METHOD: sqlite3
@@ -5570,11 +5579,11 @@
5570 **
5571 ** ^This function causes all database schemas to be read from disk and
5572 ** parsed, if that has not already been done, and returns an error if
5573 ** any errors are encountered while loading the schema.
5574 */
5575 SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
5576 sqlite3 *db, /* Connection handle */
5577 const char *zDbName, /* Database name or NULL */
5578 const char *zTableName, /* Table name */
5579 const char *zColumnName, /* Column name */
5580 char const **pzDataType, /* OUTPUT: Declared data type */
@@ -5626,11 +5635,11 @@
5626 ** disabled and prevent SQL injections from giving attackers
5627 ** access to extension loading capabilities.
5628 **
5629 ** See also the [load_extension() SQL function].
5630 */
5631 SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
5632 sqlite3 *db, /* Load the extension into this database connection */
5633 const char *zFile, /* Name of the shared library containing extension */
5634 const char *zProc, /* Entry point. Derived from zFile if 0 */
5635 char **pzErrMsg /* Put error message here if not 0 */
5636 );
@@ -5658,11 +5667,11 @@
5658 ** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method
5659 ** rather than this interface, so the [load_extension()] SQL function
5660 ** remains disabled. This will prevent SQL injections from giving attackers
5661 ** access to extension loading capabilities.
5662 */
5663 SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
5664
5665 /*
5666 ** CAPI3REF: Automatically Load Statically Linked Extensions
5667 **
5668 ** ^This interface causes the xEntryPoint() function to be invoked for
@@ -5696,11 +5705,14 @@
5696 ** will be called more than once for each database connection that is opened.
5697 **
5698 ** See also: [sqlite3_reset_auto_extension()]
5699 ** and [sqlite3_cancel_auto_extension()]
5700 */
5701 SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void (*xEntryPoint)(void));
 
 
 
5702
5703 /*
5704 ** CAPI3REF: Cancel Automatic Extension Loading
5705 **
5706 ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
@@ -5708,19 +5720,21 @@
5708 ** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)]
5709 ** routine returns 1 if initialization routine X was successfully
5710 ** unregistered and it returns 0 if X was not on the list of initialization
5711 ** routines.
5712 */
5713 SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void (*xEntryPoint)(void));
 
 
5714
5715 /*
5716 ** CAPI3REF: Reset Automatic Extension Loading
5717 **
5718 ** ^This interface disables all automatic extensions previously
5719 ** registered using [sqlite3_auto_extension()].
5720 */
5721 SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void);
5722
5723 /*
5724 ** The interface to the virtual-table mechanism is currently considered
5725 ** to be experimental. The interface might change in incompatible ways.
5726 ** If this is a problem for you, do not use the interface at this time.
@@ -5753,41 +5767,41 @@
5753 ** of this structure must not change while it is registered with
5754 ** any database connection.
5755 */
5756 struct sqlite3_module {
5757 int iVersion;
5758 int (*xCreate)(sqlite3*, void *pAux,
5759 int argc, const char *const*argv,
5760 sqlite3_vtab **ppVTab, char**);
5761 int (*xConnect)(sqlite3*, void *pAux,
5762 int argc, const char *const*argv,
5763 sqlite3_vtab **ppVTab, char**);
5764 int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
5765 int (*xDisconnect)(sqlite3_vtab *pVTab);
5766 int (*xDestroy)(sqlite3_vtab *pVTab);
5767 int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);
5768 int (*xClose)(sqlite3_vtab_cursor*);
5769 int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
5770 int argc, sqlite3_value **argv);
5771 int (*xNext)(sqlite3_vtab_cursor*);
5772 int (*xEof)(sqlite3_vtab_cursor*);
5773 int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int);
5774 int (*xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid);
5775 int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *);
5776 int (*xBegin)(sqlite3_vtab *pVTab);
5777 int (*xSync)(sqlite3_vtab *pVTab);
5778 int (*xCommit)(sqlite3_vtab *pVTab);
5779 int (*xRollback)(sqlite3_vtab *pVTab);
5780 int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,
5781 void (**pxFunc)(sqlite3_context*,int,sqlite3_value**),
5782 void **ppArg);
5783 int (*xRename)(sqlite3_vtab *pVtab, const char *zNew);
5784 /* The methods above are in version 1 of the sqlite_module object. Those
5785 ** below are for version 2 and greater. */
5786 int (*xSavepoint)(sqlite3_vtab *pVTab, int);
5787 int (*xRelease)(sqlite3_vtab *pVTab, int);
5788 int (*xRollbackTo)(sqlite3_vtab *pVTab, int);
5789 };
5790
5791 /*
5792 ** CAPI3REF: Virtual Table Indexing Information
5793 ** KEYWORDS: sqlite3_index_info
@@ -5961,22 +5975,22 @@
5961 ** be invoked if the call to sqlite3_create_module_v2() fails.
5962 ** ^The sqlite3_create_module()
5963 ** interface is equivalent to sqlite3_create_module_v2() with a NULL
5964 ** destructor.
5965 */
5966 SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
5967 sqlite3 *db, /* SQLite connection to register module with */
5968 const char *zName, /* Name of the module */
5969 const sqlite3_module *p, /* Methods for the module */
5970 void *pClientData /* Client data for xCreate/xConnect */
5971 );
5972 SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
5973 sqlite3 *db, /* SQLite connection to register module with */
5974 const char *zName, /* Name of the module */
5975 const sqlite3_module *p, /* Methods for the module */
5976 void *pClientData, /* Client data for xCreate/xConnect */
5977 void(*xDestroy)(void*) /* Module destructor function */
5978 );
5979
5980 /*
5981 ** CAPI3REF: Virtual Table Instance Object
5982 ** KEYWORDS: sqlite3_vtab
@@ -6030,11 +6044,11 @@
6030 ** ^The [xCreate] and [xConnect] methods of a
6031 ** [virtual table module] call this interface
6032 ** to declare the format (the names and datatypes of the columns) of
6033 ** the virtual tables they implement.
6034 */
6035 SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
6036
6037 /*
6038 ** CAPI3REF: Overload A Function For A Virtual Table
6039 ** METHOD: sqlite3
6040 **
@@ -6049,11 +6063,11 @@
6049 ** of the new function always causes an exception to be thrown. So
6050 ** the new function is not good for anything by itself. Its only
6051 ** purpose is to be a placeholder function that can be overloaded
6052 ** by a [virtual table].
6053 */
6054 SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
6055
6056 /*
6057 ** The interface to the virtual-table mechanism defined above (back up
6058 ** to a comment remarkably similar to this one) is currently considered
6059 ** to be experimental. The interface might change in incompatible ways.
@@ -6148,11 +6162,11 @@
6148 ** zero-filled blob to read or write using the incremental-blob interface.
6149 **
6150 ** To avoid a resource leak, every open [BLOB handle] should eventually
6151 ** be released by a call to [sqlite3_blob_close()].
6152 */
6153 SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
6154 sqlite3*,
6155 const char *zDb,
6156 const char *zTable,
6157 const char *zColumn,
6158 sqlite3_int64 iRow,
@@ -6181,11 +6195,11 @@
6181 ** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
6182 ** always returns zero.
6183 **
6184 ** ^This function sets the database handle error code and message.
6185 */
6186 SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
6187
6188 /*
6189 ** CAPI3REF: Close A BLOB Handle
6190 ** DESTRUCTOR: sqlite3_blob
6191 **
@@ -6204,11 +6218,11 @@
6204 ** with a null pointer (such as would be returned by a failed call to
6205 ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function
6206 ** is passed a valid open blob handle, the values returned by the
6207 ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning.
6208 */
6209 SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *);
6210
6211 /*
6212 ** CAPI3REF: Return The Size Of An Open BLOB
6213 ** METHOD: sqlite3_blob
6214 **
@@ -6220,11 +6234,11 @@
6220 ** This routine only works on a [BLOB handle] which has been created
6221 ** by a prior successful call to [sqlite3_blob_open()] and which has not
6222 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6223 ** to this routine results in undefined and probably undesirable behavior.
6224 */
6225 SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *);
6226
6227 /*
6228 ** CAPI3REF: Read Data From A BLOB Incrementally
6229 ** METHOD: sqlite3_blob
6230 **
@@ -6249,11 +6263,11 @@
6249 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6250 ** to this routine results in undefined and probably undesirable behavior.
6251 **
6252 ** See also: [sqlite3_blob_write()].
6253 */
6254 SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
6255
6256 /*
6257 ** CAPI3REF: Write Data Into A BLOB Incrementally
6258 ** METHOD: sqlite3_blob
6259 **
@@ -6291,11 +6305,11 @@
6291 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6292 ** to this routine results in undefined and probably undesirable behavior.
6293 **
6294 ** See also: [sqlite3_blob_read()].
6295 */
6296 SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
6297
6298 /*
6299 ** CAPI3REF: Virtual File System Objects
6300 **
6301 ** A virtual filesystem (VFS) is an [sqlite3_vfs] object
@@ -6322,13 +6336,13 @@
6322 **
6323 ** ^Unregister a VFS with the sqlite3_vfs_unregister() interface.
6324 ** ^(If the default VFS is unregistered, another VFS is chosen as
6325 ** the default. The choice for the new VFS is arbitrary.)^
6326 */
6327 SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfsName);
6328 SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
6329 SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs*);
6330
6331 /*
6332 ** CAPI3REF: Mutexes
6333 **
6334 ** The SQLite core uses these routines for thread
@@ -6440,15 +6454,15 @@
6440 ** sqlite3_mutex_leave() is a NULL pointer, then all three routines
6441 ** behave as no-ops.
6442 **
6443 ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
6444 */
6445 SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int);
6446 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*);
6447 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*);
6448 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*);
6449 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*);
6450
6451 /*
6452 ** CAPI3REF: Mutex Methods Object
6453 **
6454 ** An instance of this structure defines the low-level routines
@@ -6513,19 +6527,19 @@
6513 ** If xMutexInit fails in any way, it is expected to clean up after itself
6514 ** prior to returning.
6515 */
6516 typedef struct sqlite3_mutex_methods sqlite3_mutex_methods;
6517 struct sqlite3_mutex_methods {
6518 int (*xMutexInit)(void);
6519 int (*xMutexEnd)(void);
6520 sqlite3_mutex *(*xMutexAlloc)(int);
6521 void (*xMutexFree)(sqlite3_mutex *);
6522 void (*xMutexEnter)(sqlite3_mutex *);
6523 int (*xMutexTry)(sqlite3_mutex *);
6524 void (*xMutexLeave)(sqlite3_mutex *);
6525 int (*xMutexHeld)(sqlite3_mutex *);
6526 int (*xMutexNotheld)(sqlite3_mutex *);
6527 };
6528
6529 /*
6530 ** CAPI3REF: Mutex Verification Routines
6531 **
@@ -6554,12 +6568,12 @@
6554 ** call to sqlite3_mutex_held() to fail, so a non-zero return is
6555 ** the appropriate thing to do. The sqlite3_mutex_notheld()
6556 ** interface should also return 1 when given a NULL pointer.
6557 */
6558 #ifndef NDEBUG
6559 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex*);
6560 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex*);
6561 #endif
6562
6563 /*
6564 ** CAPI3REF: Mutex Types
6565 **
@@ -6595,11 +6609,11 @@
6595 ** serializes access to the [database connection] given in the argument
6596 ** when the [threading mode] is Serialized.
6597 ** ^If the [threading mode] is Single-thread or Multi-thread then this
6598 ** routine returns a NULL pointer.
6599 */
6600 SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3*);
6601
6602 /*
6603 ** CAPI3REF: Low-Level Control Of Database Files
6604 ** METHOD: sqlite3
6605 **
@@ -6630,11 +6644,11 @@
6630 ** an incorrect zDbName and an SQLITE_ERROR return from the underlying
6631 ** xFileControl method.
6632 **
6633 ** See also: [SQLITE_FCNTL_LOCKSTATE]
6634 */
6635 SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
6636
6637 /*
6638 ** CAPI3REF: Testing Interface
6639 **
6640 ** ^The sqlite3_test_control() interface is used to read out internal
@@ -6712,12 +6726,12 @@
6712 ** be represented by a 32-bit integer, then the values returned by
6713 ** sqlite3_status() are undefined.
6714 **
6715 ** See also: [sqlite3_db_status()]
6716 */
6717 SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6718 SQLITE_API int SQLITE_STDCALL sqlite3_status64(
6719 int op,
6720 sqlite3_int64 *pCurrent,
6721 sqlite3_int64 *pHighwater,
6722 int resetFlag
6723 );
@@ -6838,11 +6852,11 @@
6838 ** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a
6839 ** non-zero [error code] on failure.
6840 **
6841 ** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
6842 */
6843 SQLITE_API int SQLITE_STDCALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
6844
6845 /*
6846 ** CAPI3REF: Status Parameters for database connections
6847 ** KEYWORDS: {SQLITE_DBSTATUS options}
6848 **
@@ -6981,11 +6995,11 @@
6981 ** ^If the resetFlg is true, then the counter is reset to zero after this
6982 ** interface call returns.
6983 **
6984 ** See also: [sqlite3_status()] and [sqlite3_db_status()].
6985 */
6986 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
6987
6988 /*
6989 ** CAPI3REF: Status Parameters for prepared statements
6990 ** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters}
6991 **
@@ -7217,22 +7231,22 @@
7217 */
7218 typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2;
7219 struct sqlite3_pcache_methods2 {
7220 int iVersion;
7221 void *pArg;
7222 int (*xInit)(void*);
7223 void (*xShutdown)(void*);
7224 sqlite3_pcache *(*xCreate)(int szPage, int szExtra, int bPurgeable);
7225 void (*xCachesize)(sqlite3_pcache*, int nCachesize);
7226 int (*xPagecount)(sqlite3_pcache*);
7227 sqlite3_pcache_page *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7228 void (*xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard);
7229 void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*,
7230 unsigned oldKey, unsigned newKey);
7231 void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
7232 void (*xDestroy)(sqlite3_pcache*);
7233 void (*xShrink)(sqlite3_pcache*);
7234 };
7235
7236 /*
7237 ** This is the obsolete pcache_methods object that has now been replaced
7238 ** by sqlite3_pcache_methods2. This object is not used by SQLite. It is
@@ -7239,20 +7253,20 @@
7239 ** retained in the header file for backwards compatibility only.
7240 */
7241 typedef struct sqlite3_pcache_methods sqlite3_pcache_methods;
7242 struct sqlite3_pcache_methods {
7243 void *pArg;
7244 int (*xInit)(void*);
7245 void (*xShutdown)(void*);
7246 sqlite3_pcache *(*xCreate)(int szPage, int bPurgeable);
7247 void (*xCachesize)(sqlite3_pcache*, int nCachesize);
7248 int (*xPagecount)(sqlite3_pcache*);
7249 void *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7250 void (*xUnpin)(sqlite3_pcache*, void*, int discard);
7251 void (*xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey);
7252 void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
7253 void (*xDestroy)(sqlite3_pcache*);
7254 };
7255
7256
7257 /*
7258 ** CAPI3REF: Online Backup Object
@@ -7450,20 +7464,20 @@
7450 ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()
7451 ** APIs are not strictly speaking threadsafe. If they are invoked at the
7452 ** same time as another thread is invoking sqlite3_backup_step() it is
7453 ** possible that they return invalid values.
7454 */
7455 SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
7456 sqlite3 *pDest, /* Destination database handle */
7457 const char *zDestName, /* Destination database name */
7458 sqlite3 *pSource, /* Source database handle */
7459 const char *zSourceName /* Source database name */
7460 );
7461 SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage);
7462 SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p);
7463 SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p);
7464 SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p);
7465
7466 /*
7467 ** CAPI3REF: Unlock Notification
7468 ** METHOD: sqlite3
7469 **
@@ -7576,13 +7590,13 @@
7576 ** by an sqlite3_step() call. ^(If there is a blocking connection, then the
7577 ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in
7578 ** the special "DROP TABLE/INDEX" case, the extended error code is just
7579 ** SQLITE_LOCKED.)^
7580 */
7581 SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
7582 sqlite3 *pBlocked, /* Waiting connection */
7583 void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */
7584 void *pNotifyArg /* Argument to pass to xNotify */
7585 );
7586
7587
7588 /*
@@ -7591,12 +7605,12 @@
7591 ** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications
7592 ** and extensions to compare the contents of two buffers containing UTF-8
7593 ** strings in a case-independent fashion, using the same definition of "case
7594 ** independence" that SQLite uses internally when comparing identifiers.
7595 */
7596 SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *, const char *);
7597 SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *, const char *, int);
7598
7599 /*
7600 ** CAPI3REF: String Globbing
7601 *
7602 ** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if
@@ -7609,11 +7623,11 @@
7609 ** Note that this routine returns zero on a match and non-zero if the strings
7610 ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
7611 **
7612 ** See also: [sqlite3_strlike()].
7613 */
7614 SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlob, const char *zStr);
7615
7616 /*
7617 ** CAPI3REF: String LIKE Matching
7618 *
7619 ** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if
@@ -7632,11 +7646,11 @@
7632 ** Note that this routine returns zero on a match and non-zero if the strings
7633 ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
7634 **
7635 ** See also: [sqlite3_strglob()].
7636 */
7637 SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
7638
7639 /*
7640 ** CAPI3REF: Error Logging Interface
7641 **
7642 ** ^The [sqlite3_log()] interface writes a message into the [error log]
@@ -7691,13 +7705,13 @@
7691 ** previously registered write-ahead log callback. ^Note that the
7692 ** [sqlite3_wal_autocheckpoint()] interface and the
7693 ** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will
7694 ** overwrite any prior [sqlite3_wal_hook()] settings.
7695 */
7696 SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
7697 sqlite3*,
7698 int(*)(void *,sqlite3*,const char*,int),
7699 void*
7700 );
7701
7702 /*
7703 ** CAPI3REF: Configure an auto-checkpoint
@@ -7726,11 +7740,11 @@
7726 ** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]
7727 ** pages. The use of this interface
7728 ** is only necessary if the default setting is found to be suboptimal
7729 ** for a particular application.
7730 */
7731 SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
7732
7733 /*
7734 ** CAPI3REF: Checkpoint a database
7735 ** METHOD: sqlite3
7736 **
@@ -7748,11 +7762,11 @@
7748 ** interface was added. This interface is retained for backwards
7749 ** compatibility and as a convenience for applications that need to manually
7750 ** start a callback but which do not need the full power (and corresponding
7751 ** complication) of [sqlite3_wal_checkpoint_v2()].
7752 */
7753 SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
7754
7755 /*
7756 ** CAPI3REF: Checkpoint a database
7757 ** METHOD: sqlite3
7758 **
@@ -7842,11 +7856,11 @@
7842 ** [sqlite3_errcode()] and [sqlite3_errmsg()].
7843 **
7844 ** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface
7845 ** from SQL.
7846 */
7847 SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
7848 sqlite3 *db, /* Database handle */
7849 const char *zDb, /* Name of attached database (or NULL) */
7850 int eMode, /* SQLITE_CHECKPOINT_* value */
7851 int *pnLog, /* OUT: Size of WAL log in frames */
7852 int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -7931,11 +7945,11 @@
7931 ** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL],
7932 ** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode
7933 ** of the SQL statement that triggered the call to the [xUpdate] method of the
7934 ** [virtual table].
7935 */
7936 SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *);
7937
7938 /*
7939 ** CAPI3REF: Conflict resolution modes
7940 ** KEYWORDS: {conflict resolution mode}
7941 **
@@ -8036,11 +8050,11 @@
8036 ** as if the loop did not exist - it returns non-zero and leave the variable
8037 ** that pOut points to unchanged.
8038 **
8039 ** See also: [sqlite3_stmt_scanstatus_reset()]
8040 */
8041 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus(
8042 sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
8043 int idx, /* Index of loop to report on */
8044 int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
8045 void *pOut /* Result written here */
8046 );
@@ -8052,11 +8066,11 @@
8052 ** ^Zero all [sqlite3_stmt_scanstatus()] related event counters.
8053 **
8054 ** This API is only available if the library is built with pre-processor
8055 ** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined.
8056 */
8057 SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
8058
8059 /*
8060 ** CAPI3REF: Flush caches to disk mid-transaction
8061 **
8062 ** ^If a write-transaction is open on [database connection] D when the
@@ -8084,11 +8098,11 @@
8084 ** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK.
8085 **
8086 ** ^This function does not set the database handle error code or message
8087 ** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions.
8088 */
8089 SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3*);
8090
8091 /*
8092 ** CAPI3REF: The pre-update hook.
8093 **
8094 ** ^These interfaces are only available if SQLite is compiled using the
@@ -8164,13 +8178,13 @@
8164 ** triggers; or 2 for changes resulting from triggers called by top-level
8165 ** triggers; and so forth.
8166 **
8167 ** See also: [sqlite3_update_hook()]
8168 */
8169 SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_STDCALL sqlite3_preupdate_hook(
8170 sqlite3 *db,
8171 void(*xPreUpdate)(
8172 void *pCtx, /* Copy of third arg to preupdate_hook() */
8173 sqlite3 *db, /* Database handle */
8174 int op, /* SQLITE_UPDATE, DELETE or INSERT */
8175 char const *zDb, /* Database name */
8176 char const *zName, /* Table name */
@@ -8177,14 +8191,14 @@
8177 sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */
8178 sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */
8179 ),
8180 void*
8181 );
8182 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **);
8183 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *);
8184 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *);
8185 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **);
8186
8187 /*
8188 ** CAPI3REF: Low-level system error code
8189 **
8190 ** ^Attempt to return the underlying operating system error code or error
@@ -8192,11 +8206,11 @@
8192 ** The return value is OS-dependent. For example, on unix systems, after
8193 ** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be
8194 ** called to get back the underlying "errno" that caused the problem, such
8195 ** as ENOSPC, EAUTH, EISDIR, and so forth.
8196 */
8197 SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3*);
8198
8199 /*
8200 ** CAPI3REF: Database Snapshot
8201 ** KEYWORDS: {snapshot}
8202 ** EXPERIMENTAL
@@ -8242,11 +8256,11 @@
8242 ** to avoid a memory leak.
8243 **
8244 ** The [sqlite3_snapshot_get()] interface is only available when the
8245 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8246 */
8247 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_get(
8248 sqlite3 *db,
8249 const char *zSchema,
8250 sqlite3_snapshot **ppSnapshot
8251 );
8252
@@ -8280,11 +8294,11 @@
8280 ** database connection in order to make it ready to use snapshots.)
8281 **
8282 ** The [sqlite3_snapshot_open()] interface is only available when the
8283 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8284 */
8285 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_open(
8286 sqlite3 *db,
8287 const char *zSchema,
8288 sqlite3_snapshot *pSnapshot
8289 );
8290
@@ -8297,11 +8311,11 @@
8297 ** using this routine to avoid a memory leak.
8298 **
8299 ** The [sqlite3_snapshot_free()] interface is only available when the
8300 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8301 */
8302 SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot*);
8303
8304 /*
8305 ** CAPI3REF: Compare the ages of two snapshot handles.
8306 ** EXPERIMENTAL
8307 **
@@ -8321,11 +8335,11 @@
8321 **
8322 ** Otherwise, this API returns a negative value if P1 refers to an older
8323 ** snapshot than P2, zero if the two handles refer to the same database
8324 ** snapshot, and a positive value if P1 is a newer snapshot than P2.
8325 */
8326 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_cmp(
8327 sqlite3_snapshot *p1,
8328 sqlite3_snapshot *p2
8329 );
8330
8331 /*
@@ -8379,14 +8393,14 @@
8379 ** Register a geometry callback named zGeom that can be used as part of an
8380 ** R-Tree geometry query as follows:
8381 **
8382 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
8383 */
8384 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
8385 sqlite3 *db,
8386 const char *zGeom,
8387 int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
8388 void *pContext
8389 );
8390
8391
8392 /*
@@ -8396,25 +8410,25 @@
8396 struct sqlite3_rtree_geometry {
8397 void *pContext; /* Copy of pContext passed to s_r_g_c() */
8398 int nParam; /* Size of array aParam[] */
8399 sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */
8400 void *pUser; /* Callback implementation user data */
8401 void (*xDelUser)(void *); /* Called by SQLite to clean up pUser */
8402 };
8403
8404 /*
8405 ** Register a 2nd-generation geometry callback named zScore that can be
8406 ** used as part of an R-Tree geometry query as follows:
8407 **
8408 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...)
8409 */
8410 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
8411 sqlite3 *db,
8412 const char *zQueryFunc,
8413 int (*xQueryFunc)(sqlite3_rtree_query_info*),
8414 void *pContext,
8415 void (*xDestructor)(void*)
8416 );
8417
8418
8419 /*
8420 ** A pointer to a structure of the following type is passed as the
@@ -8428,11 +8442,11 @@
8428 struct sqlite3_rtree_query_info {
8429 void *pContext; /* pContext from when function registered */
8430 int nParam; /* Number of function parameters */
8431 sqlite3_rtree_dbl *aParam; /* value of function parameters */
8432 void *pUser; /* callback can use this, if desired */
8433 void (*xDelUser)(void*); /* function to free pUser */
8434 sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */
8435 unsigned int *anQueue; /* Number of pending entries in the queue */
8436 int nCoord; /* Number of coordinates */
8437 int iLevel; /* Level of current node or entry */
8438 int mxLevel; /* The largest iLevel value in the tree */
@@ -8624,11 +8638,11 @@
8624 ** If xFilter returns 0, changes is not tracked. Note that once a table is
8625 ** attached, xFilter will not be called again.
8626 */
8627 void sqlite3session_table_filter(
8628 sqlite3_session *pSession, /* Session object */
8629 int(*xFilter)(
8630 void *pCtx, /* Copy of third arg to _filter_table() */
8631 const char *zTab /* Table name */
8632 ),
8633 void *pCtx /* First argument passed to xFilter */
8634 );
@@ -9199,11 +9213,11 @@
9199 ** An sqlite3_changegroup object is used to combine two or more changesets
9200 ** (or patchsets) into a single changeset (or patchset). A single changegroup
9201 ** object may combine changesets or patchsets, but not both. The output is
9202 ** always in the same format as the input.
9203 **
9204 ** If successful, this function returns SQLITE_OK and populates (*pp) with
9205 ** a pointer to a new sqlite3_changegroup object before returning. The caller
9206 ** should eventually free the returned object using a call to
9207 ** sqlite3changegroup_delete(). If an error occurs, an SQLite error code
9208 ** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL.
9209 **
@@ -9319,11 +9333,11 @@
9319 ** changes for tables that do not appear in the first changeset, they are
9320 ** appended onto the end of the output changeset, again in the order in
9321 ** which they are first encountered.
9322 **
9323 ** If an error occurs, an SQLite error code is returned and the output
9324 ** variables (*pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK
9325 ** is returned and the output variables are set to the size of and a
9326 ** pointer to the output buffer, respectively. In this case it is the
9327 ** responsibility of the caller to eventually free the buffer using a
9328 ** call to sqlite3_free().
9329 */
@@ -9476,15 +9490,15 @@
9476 */
9477 int sqlite3changeset_apply(
9478 sqlite3 *db, /* Apply change to "main" db of this handle */
9479 int nChangeset, /* Size of changeset in bytes */
9480 void *pChangeset, /* Changeset blob */
9481 int(*xFilter)(
9482 void *pCtx, /* Copy of sixth arg to _apply() */
9483 const char *zTab /* Table name */
9484 ),
9485 int(*xConflict)(
9486 void *pCtx, /* Copy of sixth arg to _apply() */
9487 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
9488 sqlite3_changeset_iter *p /* Handle describing change and conflict */
9489 ),
9490 void *pCtx /* First argument passed to xConflict */
@@ -9621,20 +9635,20 @@
9621 ** </pre>
9622 **
9623 ** Is replaced by:
9624 **
9625 ** <pre>
9626 ** &nbsp; int (*xInput)(void *pIn, void *pData, int *pnData),
9627 ** &nbsp; void *pIn,
9628 ** </pre>
9629 **
9630 ** Each time the xInput callback is invoked by the sessions module, the first
9631 ** argument passed is a copy of the supplied pIn context pointer. The second
9632 ** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no
9633 ** error occurs the xInput method should copy up to (*pnData) bytes of data
9634 ** into the buffer and set (*pnData) to the actual number of bytes copied
9635 ** before returning SQLITE_OK. If the input is completely exhausted, (*pnData)
9636 ** should be set to zero to indicate this. Or, if an error occurs, an SQLite
9637 ** error code should be returned. In all cases, if an xInput callback returns
9638 ** an error, all processing is abandoned and the streaming API function
9639 ** returns a copy of the error code to the caller.
9640 **
@@ -9655,11 +9669,11 @@
9655 ** </pre>
9656 **
9657 ** Is replaced by:
9658 **
9659 ** <pre>
9660 ** &nbsp; int (*xOutput)(void *pOut, const void *pData, int nData),
9661 ** &nbsp; void *pOut
9662 ** </pre>
9663 **
9664 ** The xOutput callback is invoked zero or more times to return data to
9665 ** the application. The first parameter passed to each call is a copy of the
@@ -9675,58 +9689,58 @@
9675 ** parameter set to a value less than or equal to zero. Other than this,
9676 ** no guarantees are made as to the size of the chunks of data returned.
9677 */
9678 int sqlite3changeset_apply_strm(
9679 sqlite3 *db, /* Apply change to "main" db of this handle */
9680 int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
9681 void *pIn, /* First arg for xInput */
9682 int(*xFilter)(
9683 void *pCtx, /* Copy of sixth arg to _apply() */
9684 const char *zTab /* Table name */
9685 ),
9686 int(*xConflict)(
9687 void *pCtx, /* Copy of sixth arg to _apply() */
9688 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
9689 sqlite3_changeset_iter *p /* Handle describing change and conflict */
9690 ),
9691 void *pCtx /* First argument passed to xConflict */
9692 );
9693 int sqlite3changeset_concat_strm(
9694 int (*xInputA)(void *pIn, void *pData, int *pnData),
9695 void *pInA,
9696 int (*xInputB)(void *pIn, void *pData, int *pnData),
9697 void *pInB,
9698 int (*xOutput)(void *pOut, const void *pData, int nData),
9699 void *pOut
9700 );
9701 int sqlite3changeset_invert_strm(
9702 int (*xInput)(void *pIn, void *pData, int *pnData),
9703 void *pIn,
9704 int (*xOutput)(void *pOut, const void *pData, int nData),
9705 void *pOut
9706 );
9707 int sqlite3changeset_start_strm(
9708 sqlite3_changeset_iter **pp,
9709 int (*xInput)(void *pIn, void *pData, int *pnData),
9710 void *pIn
9711 );
9712 int sqlite3session_changeset_strm(
9713 sqlite3_session *pSession,
9714 int (*xOutput)(void *pOut, const void *pData, int nData),
9715 void *pOut
9716 );
9717 int sqlite3session_patchset_strm(
9718 sqlite3_session *pSession,
9719 int (*xOutput)(void *pOut, const void *pData, int nData),
9720 void *pOut
9721 );
9722 int sqlite3changegroup_add_strm(sqlite3_changegroup*,
9723 int (*xInput)(void *pIn, void *pData, int *pnData),
9724 void *pIn
9725 );
9726 int sqlite3changegroup_output_strm(sqlite3_changegroup*,
9727 int (*xOutput)(void *pOut, const void *pData, int nData),
9728 void *pOut
9729 );
9730
9731
9732 /*
@@ -9777,11 +9791,11 @@
9777
9778 typedef struct Fts5ExtensionApi Fts5ExtensionApi;
9779 typedef struct Fts5Context Fts5Context;
9780 typedef struct Fts5PhraseIter Fts5PhraseIter;
9781
9782 typedef void (*fts5_extension_function)(
9783 const Fts5ExtensionApi *pApi, /* API offered by current FTS version */
9784 Fts5Context *pFts, /* First arg to pass to pApi functions */
9785 sqlite3_context *pCtx, /* Context for returning result/error */
9786 int nVal, /* Number of values in apVal[] array */
9787 sqlite3_value **apVal /* Array of trailing arguments */
@@ -9828,15 +9842,15 @@
9828 ** This function may be quite inefficient if used with an FTS5 table
9829 ** created with the "columnsize=0" option.
9830 **
9831 ** xColumnText:
9832 ** This function attempts to retrieve the text of column iCol of the
9833 ** current document. If successful, (*pz) is set to point to a buffer
9834 ** containing the text in utf-8 encoding, (*pn) is set to the size in bytes
9835 ** (not characters) of the buffer and SQLITE_OK is returned. Otherwise,
9836 ** if an error occurs, an SQLite error code is returned and the final values
9837 ** of (*pz) and (*pn) are undefined.
9838 **
9839 ** xPhraseCount:
9840 ** Returns the number of phrases in the current query expression.
9841 **
9842 ** xPhraseSize:
@@ -9941,11 +9955,11 @@
9941 ** xRowCount(pFts5, pnRow)
9942 **
9943 ** This function is used to retrieve the total number of rows in the table.
9944 ** In other words, the same value that would be returned by:
9945 **
9946 ** SELECT count(*) FROM ftstable;
9947 **
9948 ** xPhraseFirst()
9949 ** This function is used, along with type Fts5PhraseIter and the xPhraseNext
9950 ** method, to iterate through all instances of a single query phrase within
9951 ** the current row. This is the same information as is accessible via the
@@ -10008,43 +10022,43 @@
10008 ** See xPhraseFirstColumn above.
10009 */
10010 struct Fts5ExtensionApi {
10011 int iVersion; /* Currently always set to 3 */
10012
10013 void *(*xUserData)(Fts5Context*);
10014
10015 int (*xColumnCount)(Fts5Context*);
10016 int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow);
10017 int (*xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken);
10018
10019 int (*xTokenize)(Fts5Context*,
10020 const char *pText, int nText, /* Text to tokenize */
10021 void *pCtx, /* Context passed to xToken() */
10022 int (*xToken)(void*, int, const char*, int, int, int) /* Callback */
10023 );
10024
10025 int (*xPhraseCount)(Fts5Context*);
10026 int (*xPhraseSize)(Fts5Context*, int iPhrase);
10027
10028 int (*xInstCount)(Fts5Context*, int *pnInst);
10029 int (*xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff);
10030
10031 sqlite3_int64 (*xRowid)(Fts5Context*);
10032 int (*xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn);
10033 int (*xColumnSize)(Fts5Context*, int iCol, int *pnToken);
10034
10035 int (*xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData,
10036 int(*)(const Fts5ExtensionApi*,Fts5Context*,void*)
10037 );
10038 int (*xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*));
10039 void *(*xGetAuxdata)(Fts5Context*, int bClear);
10040
10041 int (*xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*);
10042 void (*xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff);
10043
10044 int (*xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*);
10045 void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol);
10046 };
10047
10048 /*
10049 ** CUSTOM AUXILIARY FUNCTIONS
10050 *************************************************************************/
@@ -10068,11 +10082,11 @@
10068 ** The second and third arguments are an array of nul-terminated strings
10069 ** containing the tokenizer arguments, if any, specified following the
10070 ** tokenizer name as part of the CREATE VIRTUAL TABLE statement used
10071 ** to create the FTS5 table.
10072 **
10073 ** The final argument is an output variable. If successful, (*ppOut)
10074 ** should be set to point to the new tokenizer handle and SQLITE_OK
10075 ** returned. If an error occurs, some value other than SQLITE_OK should
10076 ** be returned. In this case, fts5 assumes that the final value of *ppOut
10077 ** is undefined.
10078 **
@@ -10242,17 +10256,17 @@
10242 ** inefficient.
10243 */
10244 typedef struct Fts5Tokenizer Fts5Tokenizer;
10245 typedef struct fts5_tokenizer fts5_tokenizer;
10246 struct fts5_tokenizer {
10247 int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
10248 void (*xDelete)(Fts5Tokenizer*);
10249 int (*xTokenize)(Fts5Tokenizer*,
10250 void *pCtx,
10251 int flags, /* Mask of FTS5_TOKENIZE_* flags */
10252 const char *pText, int nText,
10253 int (*xToken)(
10254 void *pCtx, /* Copy of 2nd argument to xTokenize() */
10255 int tflags, /* Mask of FTS5_TOKEN_* flags */
10256 const char *pToken, /* Pointer to buffer containing token */
10257 int nToken, /* Size of token in bytes */
10258 int iStart, /* Byte offset of token within input text */
@@ -10281,33 +10295,33 @@
10281 typedef struct fts5_api fts5_api;
10282 struct fts5_api {
10283 int iVersion; /* Currently always set to 2 */
10284
10285 /* Create a new tokenizer */
10286 int (*xCreateTokenizer)(
10287 fts5_api *pApi,
10288 const char *zName,
10289 void *pContext,
10290 fts5_tokenizer *pTokenizer,
10291 void (*xDestroy)(void*)
10292 );
10293
10294 /* Find an existing tokenizer */
10295 int (*xFindTokenizer)(
10296 fts5_api *pApi,
10297 const char *zName,
10298 void **ppContext,
10299 fts5_tokenizer *pTokenizer
10300 );
10301
10302 /* Create a new auxiliary function */
10303 int (*xCreateFunction)(
10304 fts5_api *pApi,
10305 const char *zName,
10306 void *pContext,
10307 fts5_extension_function xFunction,
10308 void (*xDestroy)(void*)
10309 );
10310 };
10311
10312 /*
10313 ** END OF REGISTRATION API
10314
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -52,12 +52,21 @@
52 # define SQLITE_API
53 #endif
54 #ifndef SQLITE_CDECL
55 # define SQLITE_CDECL
56 #endif
57 #ifndef SQLITE_APICALL
58 # define SQLITE_APICALL
59 #endif
60 #ifndef SQLITE_STDCALL
61 # define SQLITE_STDCALL SQLITE_APICALL
62 #endif
63 #ifndef SQLITE_CALLBACK
64 # define SQLITE_CALLBACK
65 #endif
66 #ifndef SQLITE_SYSAPI
67 # define SQLITE_SYSAPI
68 #endif
69
70 /*
71 ** These no-op macros are used in front of interfaces to mark those
72 ** interfaces as either deprecated or experimental. New applications
@@ -111,11 +120,11 @@
120 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
121 ** [sqlite_version()] and [sqlite_source_id()].
122 */
123 #define SQLITE_VERSION "3.14.0"
124 #define SQLITE_VERSION_NUMBER 3014000
125 #define SQLITE_SOURCE_ID "2016-07-29 04:12:18 544c990afd3b64064cc4d970ec5d7eb23eeb9914"
126
127 /*
128 ** CAPI3REF: Run-Time Library Version Numbers
129 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
130 **
@@ -144,13 +153,13 @@
153 ** [SQLITE_SOURCE_ID] C preprocessor macro.
154 **
155 ** See also: [sqlite_version()] and [sqlite_source_id()].
156 */
157 SQLITE_API SQLITE_EXTERN const char sqlite3_version[];
158 SQLITE_API const char *SQLITE_APICALL sqlite3_libversion(void);
159 SQLITE_API const char *SQLITE_APICALL sqlite3_sourceid(void);
160 SQLITE_API int SQLITE_APICALL sqlite3_libversion_number(void);
161
162 /*
163 ** CAPI3REF: Run-Time Library Compilation Options Diagnostics
164 **
165 ** ^The sqlite3_compileoption_used() function returns 0 or 1
@@ -171,12 +180,12 @@
180 **
181 ** See also: SQL functions [sqlite_compileoption_used()] and
182 ** [sqlite_compileoption_get()] and the [compile_options pragma].
183 */
184 #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
185 SQLITE_API int SQLITE_APICALL sqlite3_compileoption_used(const char *zOptName);
186 SQLITE_API const char *SQLITE_APICALL sqlite3_compileoption_get(int N);
187 #endif
188
189 /*
190 ** CAPI3REF: Test To See If The Library Is Threadsafe
191 **
@@ -211,11 +220,11 @@
220 ** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
221 ** is unchanged by calls to sqlite3_config().)^
222 **
223 ** See the [threading mode] documentation for additional information.
224 */
225 SQLITE_API int SQLITE_APICALL sqlite3_threadsafe(void);
226
227 /*
228 ** CAPI3REF: Database Connection Handle
229 ** KEYWORDS: {database connection} {database connections}
230 **
@@ -308,19 +317,19 @@
317 ** from [sqlite3_open()], [sqlite3_open16()], or
318 ** [sqlite3_open_v2()], and not previously closed.
319 ** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
320 ** argument is a harmless no-op.
321 */
322 SQLITE_API int SQLITE_APICALL sqlite3_close(sqlite3*);
323 SQLITE_API int SQLITE_APICALL sqlite3_close_v2(sqlite3*);
324
325 /*
326 ** The type for a callback function.
327 ** This is legacy and deprecated. It is included for historical
328 ** compatibility and is not documented.
329 */
330 typedef int (SQLITE_CALLBACK *sqlite3_callback)(void*,int,char**, char**);
331
332 /*
333 ** CAPI3REF: One-Step Query Execution Interface
334 ** METHOD: sqlite3
335 **
@@ -380,14 +389,14 @@
389 ** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
390 ** <li> The application must not modify the SQL statement text passed into
391 ** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
392 ** </ul>
393 */
394 SQLITE_API int SQLITE_APICALL sqlite3_exec(
395 sqlite3*, /* An open database */
396 const char *sql, /* SQL to be evaluated */
397 int (SQLITE_CALLBACK *callback)(void*,int,char**,char**), /* Callback function */
398 void *, /* 1st argument to callback */
399 char **errmsg /* Error msg written here */
400 );
401
402 /*
@@ -731,30 +740,30 @@
740 ** database corruption.
741 */
742 typedef struct sqlite3_io_methods sqlite3_io_methods;
743 struct sqlite3_io_methods {
744 int iVersion;
745 int (SQLITE_CALLBACK *xClose)(sqlite3_file*);
746 int (SQLITE_CALLBACK *xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
747 int (SQLITE_CALLBACK *xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
748 int (SQLITE_CALLBACK *xTruncate)(sqlite3_file*, sqlite3_int64 size);
749 int (SQLITE_CALLBACK *xSync)(sqlite3_file*, int flags);
750 int (SQLITE_CALLBACK *xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
751 int (SQLITE_CALLBACK *xLock)(sqlite3_file*, int);
752 int (SQLITE_CALLBACK *xUnlock)(sqlite3_file*, int);
753 int (SQLITE_CALLBACK *xCheckReservedLock)(sqlite3_file*, int *pResOut);
754 int (SQLITE_CALLBACK *xFileControl)(sqlite3_file*, int op, void *pArg);
755 int (SQLITE_CALLBACK *xSectorSize)(sqlite3_file*);
756 int (SQLITE_CALLBACK *xDeviceCharacteristics)(sqlite3_file*);
757 /* Methods above are valid for version 1 */
758 int (SQLITE_CALLBACK *xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
759 int (SQLITE_CALLBACK *xShmLock)(sqlite3_file*, int offset, int n, int flags);
760 void (SQLITE_CALLBACK *xShmBarrier)(sqlite3_file*);
761 int (SQLITE_CALLBACK *xShmUnmap)(sqlite3_file*, int deleteFlag);
762 /* Methods above are valid for version 2 */
763 int (SQLITE_CALLBACK *xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
764 int (SQLITE_CALLBACK *xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p);
765 /* Methods above are valid for version 3 */
766 /* Additional methods may be added in future releases */
767 };
768
769 /*
@@ -926,11 +935,11 @@
935 ** ^The [SQLITE_FCNTL_BUSYHANDLER]
936 ** file-control may be invoked by SQLite on the database file handle
937 ** shortly after it is opened in order to provide a custom VFS with access
938 ** to the connections busy-handler callback. The argument is of type (void **)
939 ** - an array of two (void *) values. The first (void *) actually points
940 ** to a function of type (int (SQLITE_CALLBACK *)(void *)). In order to invoke the connections
941 ** busy-handler, this function should be invoked with the second (void *) in
942 ** the array as the only argument. If it returns non-zero, then the operation
943 ** should be retried. If it returns zero, the custom VFS should abandon the
944 ** current operation.
945 **
@@ -1192,43 +1201,43 @@
1201 ** or all of these interfaces to be NULL or for their behavior to change
1202 ** from one release to the next. Applications must not attempt to access
1203 ** any of these methods if the iVersion of the VFS is less than 3.
1204 */
1205 typedef struct sqlite3_vfs sqlite3_vfs;
1206 typedef void (SQLITE_SYSAPI *sqlite3_syscall_ptr)(void);
1207 struct sqlite3_vfs {
1208 int iVersion; /* Structure version number (currently 3) */
1209 int szOsFile; /* Size of subclassed sqlite3_file */
1210 int mxPathname; /* Maximum file pathname length */
1211 sqlite3_vfs *pNext; /* Next registered VFS */
1212 const char *zName; /* Name of this virtual file system */
1213 void *pAppData; /* Pointer to application-specific data */
1214 int (SQLITE_CALLBACK *xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
1215 int flags, int *pOutFlags);
1216 int (SQLITE_CALLBACK *xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
1217 int (SQLITE_CALLBACK *xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
1218 int (SQLITE_CALLBACK *xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
1219 void *(SQLITE_CALLBACK *xDlOpen)(sqlite3_vfs*, const char *zFilename);
1220 void (SQLITE_CALLBACK *xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
1221 void (SQLITE_CALLBACK *(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
1222 void (SQLITE_CALLBACK *xDlClose)(sqlite3_vfs*, void*);
1223 int (SQLITE_CALLBACK *xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
1224 int (SQLITE_CALLBACK *xSleep)(sqlite3_vfs*, int microseconds);
1225 int (SQLITE_CALLBACK *xCurrentTime)(sqlite3_vfs*, double*);
1226 int (SQLITE_CALLBACK *xGetLastError)(sqlite3_vfs*, int, char *);
1227 /*
1228 ** The methods above are in version 1 of the sqlite_vfs object
1229 ** definition. Those that follow are added in version 2 or later
1230 */
1231 int (SQLITE_CALLBACK *xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
1232 /*
1233 ** The methods above are in versions 1 and 2 of the sqlite_vfs object.
1234 ** Those below are for version 3 and greater.
1235 */
1236 int (SQLITE_CALLBACK *xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
1237 sqlite3_syscall_ptr (SQLITE_CALLBACK *xGetSystemCall)(sqlite3_vfs*, const char *zName);
1238 const char *(SQLITE_CALLBACK *xNextSystemCall)(sqlite3_vfs*, const char *zName);
1239 /*
1240 ** The methods above are in versions 1 through 3 of the sqlite_vfs object.
1241 ** New fields may be appended in future versions. The iVersion
1242 ** value will increment whenever this happens.
1243 */
@@ -1369,14 +1378,14 @@
1378 ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied
1379 ** implementation of sqlite3_os_init() or sqlite3_os_end()
1380 ** must return [SQLITE_OK] on success and some other [error code] upon
1381 ** failure.
1382 */
1383 SQLITE_API int SQLITE_APICALL sqlite3_initialize(void);
1384 SQLITE_API int SQLITE_APICALL sqlite3_shutdown(void);
1385 SQLITE_API int SQLITE_APICALL sqlite3_os_init(void);
1386 SQLITE_API int SQLITE_APICALL sqlite3_os_end(void);
1387
1388 /*
1389 ** CAPI3REF: Configuring The SQLite Library
1390 **
1391 ** The sqlite3_config() interface is used to make global configuration
@@ -1491,17 +1500,17 @@
1500 ** SQLite will never invoke xInit() more than once without an intervening
1501 ** call to xShutdown().
1502 */
1503 typedef struct sqlite3_mem_methods sqlite3_mem_methods;
1504 struct sqlite3_mem_methods {
1505 void *(SQLITE_CALLBACK *xMalloc)(int); /* Memory allocation function */
1506 void (SQLITE_CALLBACK *xFree)(void*); /* Free a prior allocation */
1507 void *(SQLITE_CALLBACK *xRealloc)(void*,int); /* Resize an allocation */
1508 int (SQLITE_CALLBACK *xSize)(void*); /* Return the size of an allocation */
1509 int (SQLITE_CALLBACK *xRoundup)(int); /* Round up request size to allocation size */
1510 int (SQLITE_CALLBACK *xInit)(void*); /* Initialize the memory allocator */
1511 void (SQLITE_CALLBACK *xShutdown)(void*); /* Deinitialize the memory allocator */
1512 void *pAppData; /* Argument to xInit() and xShutdown() */
1513 };
1514
1515 /*
1516 ** CAPI3REF: Configuration Options
@@ -1714,11 +1723,11 @@
1723 **
1724 ** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
1725 ** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
1726 ** global [error log].
1727 ** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a
1728 ** function with a call signature of void(SQLITE_CALLBACK *)(void*,int,const char*),
1729 ** and a pointer to void. ^If the function pointer is not NULL, it is
1730 ** invoked by [sqlite3_log()] to process each logging event. ^If the
1731 ** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op.
1732 ** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is
1733 ** passed through as the first parameter to the application-defined logger
@@ -1767,11 +1776,11 @@
1776 **
1777 ** [[SQLITE_CONFIG_SQLLOG]]
1778 ** <dt>SQLITE_CONFIG_SQLLOG
1779 ** <dd>This option is only available if sqlite is compiled with the
1780 ** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should
1781 ** be a pointer to a function of type void(SQLITE_CALLBACK *)(void*,sqlite3*,const char*, int).
1782 ** The second should be of type (void*). The callback is invoked by the library
1783 ** in three separate circumstances, identified by the value passed as the
1784 ** fourth parameter. If the fourth parameter is 0, then the database connection
1785 ** passed as the second argument has just been opened. The third argument
1786 ** points to a buffer containing the name of the main database file. If the
@@ -1965,11 +1974,11 @@
1974 **
1975 ** ^The sqlite3_extended_result_codes() routine enables or disables the
1976 ** [extended result codes] feature of SQLite. ^The extended result
1977 ** codes are disabled by default for historical compatibility.
1978 */
1979 SQLITE_API int SQLITE_APICALL sqlite3_extended_result_codes(sqlite3*, int onoff);
1980
1981 /*
1982 ** CAPI3REF: Last Insert Rowid
1983 ** METHOD: sqlite3
1984 **
@@ -2017,11 +2026,11 @@
2026 ** function is running and thus changes the last insert [rowid],
2027 ** then the value returned by [sqlite3_last_insert_rowid()] is
2028 ** unpredictable and might not equal either the old or the new
2029 ** last insert [rowid].
2030 */
2031 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_last_insert_rowid(sqlite3*);
2032
2033 /*
2034 ** CAPI3REF: Count The Number Of Rows Modified
2035 ** METHOD: sqlite3
2036 **
@@ -2070,11 +2079,11 @@
2079 **
2080 ** If a separate thread makes changes on the same database connection
2081 ** while [sqlite3_changes()] is running then the value returned
2082 ** is unpredictable and not meaningful.
2083 */
2084 SQLITE_API int SQLITE_APICALL sqlite3_changes(sqlite3*);
2085
2086 /*
2087 ** CAPI3REF: Total Number Of Rows Modified
2088 ** METHOD: sqlite3
2089 **
@@ -2094,11 +2103,11 @@
2103 **
2104 ** If a separate thread makes changes on the same database connection
2105 ** while [sqlite3_total_changes()] is running then the value
2106 ** returned is unpredictable and not meaningful.
2107 */
2108 SQLITE_API int SQLITE_APICALL sqlite3_total_changes(sqlite3*);
2109
2110 /*
2111 ** CAPI3REF: Interrupt A Long-Running Query
2112 ** METHOD: sqlite3
2113 **
@@ -2134,11 +2143,11 @@
2143 ** that are started after the sqlite3_interrupt() call returns.
2144 **
2145 ** If the database connection closes while [sqlite3_interrupt()]
2146 ** is running then bad things will likely happen.
2147 */
2148 SQLITE_API void SQLITE_APICALL sqlite3_interrupt(sqlite3*);
2149
2150 /*
2151 ** CAPI3REF: Determine If An SQL Statement Is Complete
2152 **
2153 ** These routines are useful during command-line input to determine if the
@@ -2169,12 +2178,12 @@
2178 ** UTF-8 string.
2179 **
2180 ** The input to [sqlite3_complete16()] must be a zero-terminated
2181 ** UTF-16 string in native byte order.
2182 */
2183 SQLITE_API int SQLITE_APICALL sqlite3_complete(const char *sql);
2184 SQLITE_API int SQLITE_APICALL sqlite3_complete16(const void *sql);
2185
2186 /*
2187 ** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
2188 ** KEYWORDS: {busy-handler callback} {busy handler}
2189 ** METHOD: sqlite3
@@ -2231,11 +2240,11 @@
2240 ** result in undefined behavior.
2241 **
2242 ** A busy handler must not close the database connection
2243 ** or [prepared statement] that invoked the busy handler.
2244 */
2245 SQLITE_API int SQLITE_APICALL sqlite3_busy_handler(sqlite3*, int(SQLITE_CALLBACK *)(void*,int), void*);
2246
2247 /*
2248 ** CAPI3REF: Set A Busy Timeout
2249 ** METHOD: sqlite3
2250 **
@@ -2254,11 +2263,11 @@
2263 ** was defined (using [sqlite3_busy_handler()]) prior to calling
2264 ** this routine, that other busy handler is cleared.)^
2265 **
2266 ** See also: [PRAGMA busy_timeout]
2267 */
2268 SQLITE_API int SQLITE_APICALL sqlite3_busy_timeout(sqlite3*, int ms);
2269
2270 /*
2271 ** CAPI3REF: Convenience Routines For Running Queries
2272 ** METHOD: sqlite3
2273 **
@@ -2329,19 +2338,19 @@
2338 ** interface defined here. As a consequence, errors that occur in the
2339 ** wrapper layer outside of the internal [sqlite3_exec()] call are not
2340 ** reflected in subsequent calls to [sqlite3_errcode()] or
2341 ** [sqlite3_errmsg()].
2342 */
2343 SQLITE_API int SQLITE_APICALL sqlite3_get_table(
2344 sqlite3 *db, /* An open database */
2345 const char *zSql, /* SQL to be evaluated */
2346 char ***pazResult, /* Results of the query */
2347 int *pnRow, /* Number of result rows written here */
2348 int *pnColumn, /* Number of result columns written here */
2349 char **pzErrmsg /* Error msg written here */
2350 );
2351 SQLITE_API void SQLITE_APICALL sqlite3_free_table(char **result);
2352
2353 /*
2354 ** CAPI3REF: Formatted String Printing Functions
2355 **
2356 ** These routines are work-alikes of the "printf()" family of functions
@@ -2444,13 +2453,13 @@
2453 ** ^(The "%z" formatting option works like "%s" but with the
2454 ** addition that after the string has been read and copied into
2455 ** the result, [sqlite3_free()] is called on the input string.)^
2456 */
2457 SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...);
2458 SQLITE_API char *SQLITE_APICALL sqlite3_vmprintf(const char*, va_list);
2459 SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...);
2460 SQLITE_API char *SQLITE_APICALL sqlite3_vsnprintf(int,char*,const char*, va_list);
2461
2462 /*
2463 ** CAPI3REF: Memory Allocation Subsystem
2464 **
2465 ** The SQLite core uses these three routines for all of its own
@@ -2536,16 +2545,16 @@
2545 **
2546 ** The application must not read or write any part of
2547 ** a block of memory after it has been released using
2548 ** [sqlite3_free()] or [sqlite3_realloc()].
2549 */
2550 SQLITE_API void *SQLITE_APICALL sqlite3_malloc(int);
2551 SQLITE_API void *SQLITE_APICALL sqlite3_malloc64(sqlite3_uint64);
2552 SQLITE_API void *SQLITE_APICALL sqlite3_realloc(void*, int);
2553 SQLITE_API void *SQLITE_APICALL sqlite3_realloc64(void*, sqlite3_uint64);
2554 SQLITE_API void SQLITE_APICALL sqlite3_free(void*);
2555 SQLITE_API sqlite3_uint64 SQLITE_APICALL sqlite3_msize(void*);
2556
2557 /*
2558 ** CAPI3REF: Memory Allocator Statistics
2559 **
2560 ** SQLite provides these two interfaces for reporting on the status
@@ -2566,12 +2575,12 @@
2575 ** [sqlite3_memory_used()] if and only if the parameter to
2576 ** [sqlite3_memory_highwater()] is true. ^The value returned
2577 ** by [sqlite3_memory_highwater(1)] is the high-water mark
2578 ** prior to the reset.
2579 */
2580 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_used(void);
2581 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_highwater(int resetFlag);
2582
2583 /*
2584 ** CAPI3REF: Pseudo-Random Number Generator
2585 **
2586 ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
@@ -2590,11 +2599,11 @@
2599 ** ^If the previous call to this routine had an N of 1 or more and a
2600 ** non-NULL P then the pseudo-randomness is generated
2601 ** internally and without recourse to the [sqlite3_vfs] xRandomness
2602 ** method.
2603 */
2604 SQLITE_API void SQLITE_APICALL sqlite3_randomness(int N, void *P);
2605
2606 /*
2607 ** CAPI3REF: Compile-Time Authorization Callbacks
2608 ** METHOD: sqlite3
2609 **
@@ -2673,13 +2682,13 @@
2682 ** [sqlite3_prepare()] or its variants. Authorization is not
2683 ** performed during statement evaluation in [sqlite3_step()], unless
2684 ** as stated in the previous paragraph, sqlite3_step() invokes
2685 ** sqlite3_prepare_v2() to reprepare a statement after a schema change.
2686 */
2687 SQLITE_API int SQLITE_APICALL sqlite3_set_authorizer(
2688 sqlite3*,
2689 int (SQLITE_CALLBACK *xAuth)(void*,int,const char*,const char*,const char*,const char*),
2690 void *pUserData
2691 );
2692
2693 /*
2694 ** CAPI3REF: Authorizer Return Codes
@@ -2781,14 +2790,14 @@
2790 ** digits in the time are meaningless. Future versions of SQLite
2791 ** might provide greater resolution on the profiler callback. The
2792 ** sqlite3_profile() function is considered experimental and is
2793 ** subject to change in future versions of SQLite.
2794 */
2795 SQLITE_API SQLITE_DEPRECATED void *SQLITE_APICALL sqlite3_trace(sqlite3*,
2796 void(SQLITE_CALLBACK *xTrace)(void*,const char*), void*);
2797 SQLITE_API SQLITE_DEPRECATED void *SQLITE_APICALL sqlite3_profile(sqlite3*,
2798 void(SQLITE_CALLBACK *xProfile)(void*,const char*,sqlite3_uint64), void*);
2799
2800 /*
2801 ** CAPI3REF: SQL Trace Event Codes
2802 ** KEYWORDS: SQLITE_TRACE
2803 **
@@ -2872,14 +2881,14 @@
2881 **
2882 ** The sqlite3_trace_v2() interface is intended to replace the legacy
2883 ** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which
2884 ** are deprecated.
2885 */
2886 SQLITE_API int SQLITE_APICALL sqlite3_trace_v2(
2887 sqlite3*,
2888 unsigned uMask,
2889 int(SQLITE_CALLBACK *xCallback)(unsigned,void*,void*,void*),
2890 void *pCtx
2891 );
2892
2893 /*
2894 ** CAPI3REF: Query Progress Callbacks
@@ -2911,11 +2920,11 @@
2920 ** the database connection that invoked the progress handler.
2921 ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
2922 ** database connections for the meaning of "modify" in this paragraph.
2923 **
2924 */
2925 SQLITE_API void SQLITE_APICALL sqlite3_progress_handler(sqlite3*, int, int(SQLITE_CALLBACK *)(void*), void*);
2926
2927 /*
2928 ** CAPI3REF: Opening A New Database Connection
2929 ** CONSTRUCTOR: sqlite3
2930 **
@@ -3140,19 +3149,19 @@
3149 ** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various
3150 ** features that require the use of temporary files may fail.
3151 **
3152 ** See also: [sqlite3_temp_directory]
3153 */
3154 SQLITE_API int SQLITE_APICALL sqlite3_open(
3155 const char *filename, /* Database filename (UTF-8) */
3156 sqlite3 **ppDb /* OUT: SQLite db handle */
3157 );
3158 SQLITE_API int SQLITE_APICALL sqlite3_open16(
3159 const void *filename, /* Database filename (UTF-16) */
3160 sqlite3 **ppDb /* OUT: SQLite db handle */
3161 );
3162 SQLITE_API int SQLITE_APICALL sqlite3_open_v2(
3163 const char *filename, /* Database filename (UTF-8) */
3164 sqlite3 **ppDb, /* OUT: SQLite db handle */
3165 int flags, /* Flags */
3166 const char *zVfs /* Name of VFS module to use */
3167 );
@@ -3194,13 +3203,13 @@
3203 ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and
3204 ** is not a database file pathname pointer that SQLite passed into the xOpen
3205 ** VFS method, then the behavior of this routine is undefined and probably
3206 ** undesirable.
3207 */
3208 SQLITE_API const char *SQLITE_APICALL sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3209 SQLITE_API int SQLITE_APICALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3210 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
3211
3212
3213 /*
3214 ** CAPI3REF: Error Codes And Messages
3215 ** METHOD: sqlite3
@@ -3240,15 +3249,15 @@
3249 **
3250 ** If an interface fails with SQLITE_MISUSE, that means the interface
3251 ** was invoked incorrectly by the application. In that case, the
3252 ** error code and message may or may not be set.
3253 */
3254 SQLITE_API int SQLITE_APICALL sqlite3_errcode(sqlite3 *db);
3255 SQLITE_API int SQLITE_APICALL sqlite3_extended_errcode(sqlite3 *db);
3256 SQLITE_API const char *SQLITE_APICALL sqlite3_errmsg(sqlite3*);
3257 SQLITE_API const void *SQLITE_APICALL sqlite3_errmsg16(sqlite3*);
3258 SQLITE_API const char *SQLITE_APICALL sqlite3_errstr(int);
3259
3260 /*
3261 ** CAPI3REF: Prepared Statement Object
3262 ** KEYWORDS: {prepared statement} {prepared statements}
3263 **
@@ -3312,11 +3321,11 @@
3321 ** created by an untrusted script can be contained using the
3322 ** [max_page_count] [PRAGMA].
3323 **
3324 ** New run-time limit categories may be added in future releases.
3325 */
3326 SQLITE_API int SQLITE_APICALL sqlite3_limit(sqlite3*, int id, int newVal);
3327
3328 /*
3329 ** CAPI3REF: Run-Time Limit Categories
3330 ** KEYWORDS: {limit category} {*limit categories}
3331 **
@@ -3464,32 +3473,32 @@
3473 ** or [GLOB] operator or if the parameter is compared to an indexed column
3474 ** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
3475 ** </li>
3476 ** </ol>
3477 */
3478 SQLITE_API int SQLITE_APICALL sqlite3_prepare(
3479 sqlite3 *db, /* Database handle */
3480 const char *zSql, /* SQL statement, UTF-8 encoded */
3481 int nByte, /* Maximum length of zSql in bytes. */
3482 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3483 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3484 );
3485 SQLITE_API int SQLITE_APICALL sqlite3_prepare_v2(
3486 sqlite3 *db, /* Database handle */
3487 const char *zSql, /* SQL statement, UTF-8 encoded */
3488 int nByte, /* Maximum length of zSql in bytes. */
3489 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3490 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3491 );
3492 SQLITE_API int SQLITE_APICALL sqlite3_prepare16(
3493 sqlite3 *db, /* Database handle */
3494 const void *zSql, /* SQL statement, UTF-16 encoded */
3495 int nByte, /* Maximum length of zSql in bytes. */
3496 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3497 const void **pzTail /* OUT: Pointer to unused portion of zSql */
3498 );
3499 SQLITE_API int SQLITE_APICALL sqlite3_prepare16_v2(
3500 sqlite3 *db, /* Database handle */
3501 const void *zSql, /* SQL statement, UTF-16 encoded */
3502 int nByte, /* Maximum length of zSql in bytes. */
3503 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3504 const void **pzTail /* OUT: Pointer to unused portion of zSql */
@@ -3524,12 +3533,12 @@
3533 ** automatically freed when the prepared statement is finalized.
3534 ** ^The string returned by sqlite3_expanded_sql(P), on the other hand,
3535 ** is obtained from [sqlite3_malloc()] and must be free by the application
3536 ** by passing it to [sqlite3_free()].
3537 */
3538 SQLITE_API const char *SQLITE_APICALL sqlite3_sql(sqlite3_stmt *pStmt);
3539 SQLITE_API char *SQLITE_APICALL sqlite3_expanded_sql(sqlite3_stmt *pStmt);
3540
3541 /*
3542 ** CAPI3REF: Determine If An SQL Statement Writes The Database
3543 ** METHOD: sqlite3_stmt
3544 **
@@ -3557,11 +3566,11 @@
3566 ** database. ^The [ATTACH] and [DETACH] statements also cause
3567 ** sqlite3_stmt_readonly() to return true since, while those statements
3568 ** change the configuration of a database connection, they do not make
3569 ** changes to the content of the database files on disk.
3570 */
3571 SQLITE_API int SQLITE_APICALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
3572
3573 /*
3574 ** CAPI3REF: Determine If A Prepared Statement Has Been Reset
3575 ** METHOD: sqlite3_stmt
3576 **
@@ -3578,11 +3587,11 @@
3587 ** to locate all prepared statements associated with a database
3588 ** connection that are in need of being reset. This can be used,
3589 ** for example, in diagnostic routines to search for prepared
3590 ** statements that are holding a transaction open.
3591 */
3592 SQLITE_API int SQLITE_APICALL sqlite3_stmt_busy(sqlite3_stmt*);
3593
3594 /*
3595 ** CAPI3REF: Dynamically Typed Value Object
3596 ** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
3597 **
@@ -3742,24 +3751,24 @@
3751 ** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails.
3752 **
3753 ** See also: [sqlite3_bind_parameter_count()],
3754 ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].
3755 */
3756 SQLITE_API int SQLITE_APICALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(SQLITE_CALLBACK *)(void*));
3757 SQLITE_API int SQLITE_APICALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
3758 void(SQLITE_CALLBACK *)(void*));
3759 SQLITE_API int SQLITE_APICALL sqlite3_bind_double(sqlite3_stmt*, int, double);
3760 SQLITE_API int SQLITE_APICALL sqlite3_bind_int(sqlite3_stmt*, int, int);
3761 SQLITE_API int SQLITE_APICALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
3762 SQLITE_API int SQLITE_APICALL sqlite3_bind_null(sqlite3_stmt*, int);
3763 SQLITE_API int SQLITE_APICALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(SQLITE_CALLBACK *)(void*));
3764 SQLITE_API int SQLITE_APICALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(SQLITE_CALLBACK *)(void*));
3765 SQLITE_API int SQLITE_APICALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
3766 void(SQLITE_CALLBACK *)(void*), unsigned char encoding);
3767 SQLITE_API int SQLITE_APICALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
3768 SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
3769 SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
3770
3771 /*
3772 ** CAPI3REF: Number Of SQL Parameters
3773 ** METHOD: sqlite3_stmt
3774 **
@@ -3776,11 +3785,11 @@
3785 **
3786 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3787 ** [sqlite3_bind_parameter_name()], and
3788 ** [sqlite3_bind_parameter_index()].
3789 */
3790 SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_count(sqlite3_stmt*);
3791
3792 /*
3793 ** CAPI3REF: Name Of A Host Parameter
3794 ** METHOD: sqlite3_stmt
3795 **
@@ -3804,11 +3813,11 @@
3813 **
3814 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3815 ** [sqlite3_bind_parameter_count()], and
3816 ** [sqlite3_bind_parameter_index()].
3817 */
3818 SQLITE_API const char *SQLITE_APICALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
3819
3820 /*
3821 ** CAPI3REF: Index Of A Parameter With A Given Name
3822 ** METHOD: sqlite3_stmt
3823 **
@@ -3821,21 +3830,21 @@
3830 **
3831 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3832 ** [sqlite3_bind_parameter_count()], and
3833 ** [sqlite3_bind_parameter_name()].
3834 */
3835 SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
3836
3837 /*
3838 ** CAPI3REF: Reset All Bindings On A Prepared Statement
3839 ** METHOD: sqlite3_stmt
3840 **
3841 ** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset
3842 ** the [sqlite3_bind_blob | bindings] on a [prepared statement].
3843 ** ^Use this routine to reset all host parameters to NULL.
3844 */
3845 SQLITE_API int SQLITE_APICALL sqlite3_clear_bindings(sqlite3_stmt*);
3846
3847 /*
3848 ** CAPI3REF: Number Of Columns In A Result Set
3849 ** METHOD: sqlite3_stmt
3850 **
@@ -3843,11 +3852,11 @@
3852 ** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
3853 ** statement that does not return data (for example an [UPDATE]).
3854 **
3855 ** See also: [sqlite3_data_count()]
3856 */
3857 SQLITE_API int SQLITE_APICALL sqlite3_column_count(sqlite3_stmt *pStmt);
3858
3859 /*
3860 ** CAPI3REF: Column Names In A Result Set
3861 ** METHOD: sqlite3_stmt
3862 **
@@ -3872,12 +3881,12 @@
3881 ** ^The name of a result column is the value of the "AS" clause for
3882 ** that column, if there is an AS clause. If there is no AS clause
3883 ** then the name of the column is unspecified and may change from
3884 ** one release of SQLite to the next.
3885 */
3886 SQLITE_API const char *SQLITE_APICALL sqlite3_column_name(sqlite3_stmt*, int N);
3887 SQLITE_API const void *SQLITE_APICALL sqlite3_column_name16(sqlite3_stmt*, int N);
3888
3889 /*
3890 ** CAPI3REF: Source Of Data In A Query Result
3891 ** METHOD: sqlite3_stmt
3892 **
@@ -3921,16 +3930,16 @@
3930 ** If two or more threads call one or more
3931 ** [sqlite3_column_database_name | column metadata interfaces]
3932 ** for the same [prepared statement] and result column
3933 ** at the same time then the results are undefined.
3934 */
3935 SQLITE_API const char *SQLITE_APICALL sqlite3_column_database_name(sqlite3_stmt*,int);
3936 SQLITE_API const void *SQLITE_APICALL sqlite3_column_database_name16(sqlite3_stmt*,int);
3937 SQLITE_API const char *SQLITE_APICALL sqlite3_column_table_name(sqlite3_stmt*,int);
3938 SQLITE_API const void *SQLITE_APICALL sqlite3_column_table_name16(sqlite3_stmt*,int);
3939 SQLITE_API const char *SQLITE_APICALL sqlite3_column_origin_name(sqlite3_stmt*,int);
3940 SQLITE_API const void *SQLITE_APICALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
3941
3942 /*
3943 ** CAPI3REF: Declared Datatype Of A Query Result
3944 ** METHOD: sqlite3_stmt
3945 **
@@ -3958,12 +3967,12 @@
3967 ** data stored in that column is of the declared type. SQLite is
3968 ** strongly typed, but the typing is dynamic not static. ^Type
3969 ** is associated with individual values, not with the containers
3970 ** used to hold those values.
3971 */
3972 SQLITE_API const char *SQLITE_APICALL sqlite3_column_decltype(sqlite3_stmt*,int);
3973 SQLITE_API const void *SQLITE_APICALL sqlite3_column_decltype16(sqlite3_stmt*,int);
3974
3975 /*
3976 ** CAPI3REF: Evaluate An SQL Statement
3977 ** METHOD: sqlite3_stmt
3978 **
@@ -4039,11 +4048,11 @@
4048 ** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
4049 ** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,
4050 ** then the more specific [error codes] are returned directly
4051 ** by sqlite3_step(). The use of the "v2" interface is recommended.
4052 */
4053 SQLITE_API int SQLITE_APICALL sqlite3_step(sqlite3_stmt*);
4054
4055 /*
4056 ** CAPI3REF: Number of columns in a result set
4057 ** METHOD: sqlite3_stmt
4058 **
@@ -4060,11 +4069,11 @@
4069 ** where it always returns zero since each step of that multi-step
4070 ** pragma returns 0 columns of data.
4071 **
4072 ** See also: [sqlite3_column_count()]
4073 */
4074 SQLITE_API int SQLITE_APICALL sqlite3_data_count(sqlite3_stmt *pStmt);
4075
4076 /*
4077 ** CAPI3REF: Fundamental Datatypes
4078 ** KEYWORDS: SQLITE_TEXT
4079 **
@@ -4250,20 +4259,20 @@
4259 ** of these routines, a default value is returned. The default value
4260 ** is either the integer 0, the floating point number 0.0, or a NULL
4261 ** pointer. Subsequent calls to [sqlite3_errcode()] will return
4262 ** [SQLITE_NOMEM].)^
4263 */
4264 SQLITE_API const void *SQLITE_APICALL sqlite3_column_blob(sqlite3_stmt*, int iCol);
4265 SQLITE_API int SQLITE_APICALL sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4266 SQLITE_API int SQLITE_APICALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4267 SQLITE_API double SQLITE_APICALL sqlite3_column_double(sqlite3_stmt*, int iCol);
4268 SQLITE_API int SQLITE_APICALL sqlite3_column_int(sqlite3_stmt*, int iCol);
4269 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_column_int64(sqlite3_stmt*, int iCol);
4270 SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_column_text(sqlite3_stmt*, int iCol);
4271 SQLITE_API const void *SQLITE_APICALL sqlite3_column_text16(sqlite3_stmt*, int iCol);
4272 SQLITE_API int SQLITE_APICALL sqlite3_column_type(sqlite3_stmt*, int iCol);
4273 SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_column_value(sqlite3_stmt*, int iCol);
4274
4275 /*
4276 ** CAPI3REF: Destroy A Prepared Statement Object
4277 ** DESTRUCTOR: sqlite3_stmt
4278 **
@@ -4287,11 +4296,11 @@
4296 ** resource leaks. It is a grievous error for the application to try to use
4297 ** a prepared statement after it has been finalized. Any use of a prepared
4298 ** statement after it has been finalized can result in undefined and
4299 ** undesirable behavior such as segfaults and heap corruption.
4300 */
4301 SQLITE_API int SQLITE_APICALL sqlite3_finalize(sqlite3_stmt *pStmt);
4302
4303 /*
4304 ** CAPI3REF: Reset A Prepared Statement Object
4305 ** METHOD: sqlite3_stmt
4306 **
@@ -4314,11 +4323,11 @@
4323 ** [sqlite3_reset(S)] returns an appropriate [error code].
4324 **
4325 ** ^The [sqlite3_reset(S)] interface does not change the values
4326 ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
4327 */
4328 SQLITE_API int SQLITE_APICALL sqlite3_reset(sqlite3_stmt *pStmt);
4329
4330 /*
4331 ** CAPI3REF: Create Or Redefine SQL Functions
4332 ** KEYWORDS: {function creation routines}
4333 ** KEYWORDS: {application-defined SQL function}
@@ -4414,40 +4423,40 @@
4423 ** ^An application-defined function is permitted to call other
4424 ** SQLite interfaces. However, such calls must not
4425 ** close the database connection nor finalize or reset the prepared
4426 ** statement in which the function is running.
4427 */
4428 SQLITE_API int SQLITE_APICALL sqlite3_create_function(
4429 sqlite3 *db,
4430 const char *zFunctionName,
4431 int nArg,
4432 int eTextRep,
4433 void *pApp,
4434 void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**),
4435 void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**),
4436 void (SQLITE_CALLBACK *xFinal)(sqlite3_context*)
4437 );
4438 SQLITE_API int SQLITE_APICALL sqlite3_create_function16(
4439 sqlite3 *db,
4440 const void *zFunctionName,
4441 int nArg,
4442 int eTextRep,
4443 void *pApp,
4444 void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**),
4445 void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**),
4446 void (SQLITE_CALLBACK *xFinal)(sqlite3_context*)
4447 );
4448 SQLITE_API int SQLITE_APICALL sqlite3_create_function_v2(
4449 sqlite3 *db,
4450 const char *zFunctionName,
4451 int nArg,
4452 int eTextRep,
4453 void *pApp,
4454 void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**),
4455 void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**),
4456 void (SQLITE_CALLBACK *xFinal)(sqlite3_context*),
4457 void(SQLITE_CALLBACK *xDestroy)(void*)
4458 );
4459
4460 /*
4461 ** CAPI3REF: Text Encodings
4462 **
@@ -4480,16 +4489,16 @@
4489 ** to be supported. However, new applications should avoid
4490 ** the use of these functions. To encourage programmers to avoid
4491 ** these functions, we will not explain what they do.
4492 */
4493 #ifndef SQLITE_OMIT_DEPRECATED
4494 SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_aggregate_count(sqlite3_context*);
4495 SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_expired(sqlite3_stmt*);
4496 SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4497 SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_global_recover(void);
4498 SQLITE_API SQLITE_DEPRECATED void SQLITE_APICALL sqlite3_thread_cleanup(void);
4499 SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_memory_alarm(void(SQLITE_CALLBACK *)(void*,sqlite3_int64,int),
4500 void*,sqlite3_int64);
4501 #endif
4502
4503 /*
4504 ** CAPI3REF: Obtaining SQL Values
@@ -4535,22 +4544,22 @@
4544 ** or [sqlite3_value_text16()].
4545 **
4546 ** These routines must be called from the same thread as
4547 ** the SQL function that supplied the [sqlite3_value*] parameters.
4548 */
4549 SQLITE_API const void *SQLITE_APICALL sqlite3_value_blob(sqlite3_value*);
4550 SQLITE_API int SQLITE_APICALL sqlite3_value_bytes(sqlite3_value*);
4551 SQLITE_API int SQLITE_APICALL sqlite3_value_bytes16(sqlite3_value*);
4552 SQLITE_API double SQLITE_APICALL sqlite3_value_double(sqlite3_value*);
4553 SQLITE_API int SQLITE_APICALL sqlite3_value_int(sqlite3_value*);
4554 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_value_int64(sqlite3_value*);
4555 SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_value_text(sqlite3_value*);
4556 SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16(sqlite3_value*);
4557 SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16le(sqlite3_value*);
4558 SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16be(sqlite3_value*);
4559 SQLITE_API int SQLITE_APICALL sqlite3_value_type(sqlite3_value*);
4560 SQLITE_API int SQLITE_APICALL sqlite3_value_numeric_type(sqlite3_value*);
4561
4562 /*
4563 ** CAPI3REF: Finding The Subtype Of SQL Values
4564 ** METHOD: sqlite3_value
4565 **
@@ -4562,11 +4571,11 @@
4571 **
4572 ** SQLite makes no use of subtype itself. It merely passes the subtype
4573 ** from the result of one [application-defined SQL function] into the
4574 ** input of another.
4575 */
4576 SQLITE_API unsigned int SQLITE_APICALL sqlite3_value_subtype(sqlite3_value*);
4577
4578 /*
4579 ** CAPI3REF: Copy And Free SQL Values
4580 ** METHOD: sqlite3_value
4581 **
@@ -4578,12 +4587,12 @@
4587 **
4588 ** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object
4589 ** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer
4590 ** then sqlite3_value_free(V) is a harmless no-op.
4591 */
4592 SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_value_dup(const sqlite3_value*);
4593 SQLITE_API void SQLITE_APICALL sqlite3_value_free(sqlite3_value*);
4594
4595 /*
4596 ** CAPI3REF: Obtain Aggregate Function Context
4597 ** METHOD: sqlite3_context
4598 **
@@ -4624,11 +4633,11 @@
4633 ** function.
4634 **
4635 ** This routine must be called from the same thread in which
4636 ** the aggregate SQL function is running.
4637 */
4638 SQLITE_API void *SQLITE_APICALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
4639
4640 /*
4641 ** CAPI3REF: User Data For Functions
4642 ** METHOD: sqlite3_context
4643 **
@@ -4639,11 +4648,11 @@
4648 ** registered the application defined function.
4649 **
4650 ** This routine must be called from the same thread in which
4651 ** the application-defined function is running.
4652 */
4653 SQLITE_API void *SQLITE_APICALL sqlite3_user_data(sqlite3_context*);
4654
4655 /*
4656 ** CAPI3REF: Database Connection For Functions
4657 ** METHOD: sqlite3_context
4658 **
@@ -4651,11 +4660,11 @@
4660 ** the pointer to the [database connection] (the 1st parameter)
4661 ** of the [sqlite3_create_function()]
4662 ** and [sqlite3_create_function16()] routines that originally
4663 ** registered the application defined function.
4664 */
4665 SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_context_db_handle(sqlite3_context*);
4666
4667 /*
4668 ** CAPI3REF: Function Auxiliary Data
4669 ** METHOD: sqlite3_context
4670 **
@@ -4704,12 +4713,12 @@
4713 ** values and [parameters] and expressions composed from the same.)^
4714 **
4715 ** These routines must be called from the same thread in which
4716 ** the SQL function is running.
4717 */
4718 SQLITE_API void *SQLITE_APICALL sqlite3_get_auxdata(sqlite3_context*, int N);
4719 SQLITE_API void SQLITE_APICALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (SQLITE_CALLBACK *)(void*));
4720
4721
4722 /*
4723 ** CAPI3REF: Constants Defining Special Destructor Behavior
4724 **
@@ -4722,11 +4731,11 @@
4731 ** the content before returning.
4732 **
4733 ** The typedef is necessary to work around problems in certain
4734 ** C++ compilers.
4735 */
4736 typedef void (SQLITE_CALLBACK *sqlite3_destructor_type)(void*);
4737 #define SQLITE_STATIC ((sqlite3_destructor_type)0)
4738 #define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1)
4739
4740 /*
4741 ** CAPI3REF: Setting The Result Of An SQL Function
@@ -4841,31 +4850,31 @@
4850 **
4851 ** If these routines are called from within the different thread
4852 ** than the one containing the application-defined function that received
4853 ** the [sqlite3_context] pointer, the results are undefined.
4854 */
4855 SQLITE_API void SQLITE_APICALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(SQLITE_CALLBACK *)(void*));
4856 SQLITE_API void SQLITE_APICALL sqlite3_result_blob64(sqlite3_context*,const void*,
4857 sqlite3_uint64,void(SQLITE_CALLBACK *)(void*));
4858 SQLITE_API void SQLITE_APICALL sqlite3_result_double(sqlite3_context*, double);
4859 SQLITE_API void SQLITE_APICALL sqlite3_result_error(sqlite3_context*, const char*, int);
4860 SQLITE_API void SQLITE_APICALL sqlite3_result_error16(sqlite3_context*, const void*, int);
4861 SQLITE_API void SQLITE_APICALL sqlite3_result_error_toobig(sqlite3_context*);
4862 SQLITE_API void SQLITE_APICALL sqlite3_result_error_nomem(sqlite3_context*);
4863 SQLITE_API void SQLITE_APICALL sqlite3_result_error_code(sqlite3_context*, int);
4864 SQLITE_API void SQLITE_APICALL sqlite3_result_int(sqlite3_context*, int);
4865 SQLITE_API void SQLITE_APICALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
4866 SQLITE_API void SQLITE_APICALL sqlite3_result_null(sqlite3_context*);
4867 SQLITE_API void SQLITE_APICALL sqlite3_result_text(sqlite3_context*, const char*, int, void(SQLITE_CALLBACK *)(void*));
4868 SQLITE_API void SQLITE_APICALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
4869 void(SQLITE_CALLBACK *)(void*), unsigned char encoding);
4870 SQLITE_API void SQLITE_APICALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(SQLITE_CALLBACK *)(void*));
4871 SQLITE_API void SQLITE_APICALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(SQLITE_CALLBACK *)(void*));
4872 SQLITE_API void SQLITE_APICALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(SQLITE_CALLBACK *)(void*));
4873 SQLITE_API void SQLITE_APICALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
4874 SQLITE_API void SQLITE_APICALL sqlite3_result_zeroblob(sqlite3_context*, int n);
4875 SQLITE_API int SQLITE_APICALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
4876
4877
4878 /*
4879 ** CAPI3REF: Setting The Subtype Of An SQL Function
4880 ** METHOD: sqlite3_context
@@ -4876,11 +4885,11 @@
4885 ** of the subtype T are preserved in current versions of SQLite;
4886 ** higher order bits are discarded.
4887 ** The number of subtype bytes preserved by SQLite might increase
4888 ** in future releases of SQLite.
4889 */
4890 SQLITE_API void SQLITE_APICALL sqlite3_result_subtype(sqlite3_context*,unsigned int);
4891
4892 /*
4893 ** CAPI3REF: Define New Collating Sequences
4894 ** METHOD: sqlite3
4895 **
@@ -4958,31 +4967,31 @@
4967 ** is unfortunate but cannot be changed without breaking backwards
4968 ** compatibility.
4969 **
4970 ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].
4971 */
4972 SQLITE_API int SQLITE_APICALL sqlite3_create_collation(
4973 sqlite3*,
4974 const char *zName,
4975 int eTextRep,
4976 void *pArg,
4977 int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*)
4978 );
4979 SQLITE_API int SQLITE_APICALL sqlite3_create_collation_v2(
4980 sqlite3*,
4981 const char *zName,
4982 int eTextRep,
4983 void *pArg,
4984 int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*),
4985 void(SQLITE_CALLBACK *xDestroy)(void*)
4986 );
4987 SQLITE_API int SQLITE_APICALL sqlite3_create_collation16(
4988 sqlite3*,
4989 const void *zName,
4990 int eTextRep,
4991 void *pArg,
4992 int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*)
4993 );
4994
4995 /*
4996 ** CAPI3REF: Collation Needed Callbacks
4997 ** METHOD: sqlite3
@@ -5008,19 +5017,19 @@
5017 **
5018 ** The callback function should register the desired collation using
5019 ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or
5020 ** [sqlite3_create_collation_v2()].
5021 */
5022 SQLITE_API int SQLITE_APICALL sqlite3_collation_needed(
5023 sqlite3*,
5024 void*,
5025 void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const char*)
5026 );
5027 SQLITE_API int SQLITE_APICALL sqlite3_collation_needed16(
5028 sqlite3*,
5029 void*,
5030 void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const void*)
5031 );
5032
5033 #ifdef SQLITE_HAS_CODEC
5034 /*
5035 ** Specify the key for an encrypted database. This routine should be
@@ -5027,15 +5036,15 @@
5036 ** called right after sqlite3_open().
5037 **
5038 ** The code to implement this API is not available in the public release
5039 ** of SQLite.
5040 */
5041 SQLITE_API int SQLITE_APICALL sqlite3_key(
5042 sqlite3 *db, /* Database to be rekeyed */
5043 const void *pKey, int nKey /* The key */
5044 );
5045 SQLITE_API int SQLITE_APICALL sqlite3_key_v2(
5046 sqlite3 *db, /* Database to be rekeyed */
5047 const char *zDbName, /* Name of the database */
5048 const void *pKey, int nKey /* The key */
5049 );
5050
@@ -5045,35 +5054,35 @@
5054 ** database is decrypted.
5055 **
5056 ** The code to implement this API is not available in the public release
5057 ** of SQLite.
5058 */
5059 SQLITE_API int SQLITE_APICALL sqlite3_rekey(
5060 sqlite3 *db, /* Database to be rekeyed */
5061 const void *pKey, int nKey /* The new key */
5062 );
5063 SQLITE_API int SQLITE_APICALL sqlite3_rekey_v2(
5064 sqlite3 *db, /* Database to be rekeyed */
5065 const char *zDbName, /* Name of the database */
5066 const void *pKey, int nKey /* The new key */
5067 );
5068
5069 /*
5070 ** Specify the activation key for a SEE database. Unless
5071 ** activated, none of the SEE routines will work.
5072 */
5073 SQLITE_API void SQLITE_APICALL sqlite3_activate_see(
5074 const char *zPassPhrase /* Activation phrase */
5075 );
5076 #endif
5077
5078 #ifdef SQLITE_ENABLE_CEROD
5079 /*
5080 ** Specify the activation key for a CEROD database. Unless
5081 ** activated, none of the CEROD routines will work.
5082 */
5083 SQLITE_API void SQLITE_APICALL sqlite3_activate_cerod(
5084 const char *zPassPhrase /* Activation phrase */
5085 );
5086 #endif
5087
5088 /*
@@ -5091,11 +5100,11 @@
5100 ** method of the default [sqlite3_vfs] object. If the xSleep() method
5101 ** of the default VFS is not implemented correctly, or not implemented at
5102 ** all, then the behavior of sqlite3_sleep() may deviate from the description
5103 ** in the previous paragraphs.
5104 */
5105 SQLITE_API int SQLITE_APICALL sqlite3_sleep(int);
5106
5107 /*
5108 ** CAPI3REF: Name Of The Folder Holding Temporary Files
5109 **
5110 ** ^(If this global variable is made to point to a string which is
@@ -5210,11 +5219,11 @@
5219 **
5220 ** If another thread changes the autocommit status of the database
5221 ** connection while this routine is running, then the return value
5222 ** is undefined.
5223 */
5224 SQLITE_API int SQLITE_APICALL sqlite3_get_autocommit(sqlite3*);
5225
5226 /*
5227 ** CAPI3REF: Find The Database Handle Of A Prepared Statement
5228 ** METHOD: sqlite3_stmt
5229 **
@@ -5223,11 +5232,11 @@
5232 ** returned by sqlite3_db_handle is the same [database connection]
5233 ** that was the first argument
5234 ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
5235 ** create the statement in the first place.
5236 */
5237 SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_db_handle(sqlite3_stmt*);
5238
5239 /*
5240 ** CAPI3REF: Return The Filename For A Database Connection
5241 ** METHOD: sqlite3
5242 **
@@ -5240,21 +5249,21 @@
5249 ** ^The filename returned by this function is the output of the
5250 ** xFullPathname method of the [VFS]. ^In other words, the filename
5251 ** will be an absolute pathname, even if the filename used
5252 ** to open the database originally was a URI or relative pathname.
5253 */
5254 SQLITE_API const char *SQLITE_APICALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
5255
5256 /*
5257 ** CAPI3REF: Determine if a database is read-only
5258 ** METHOD: sqlite3
5259 **
5260 ** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N
5261 ** of connection D is read-only, 0 if it is read/write, or -1 if N is not
5262 ** the name of a database on connection D.
5263 */
5264 SQLITE_API int SQLITE_APICALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
5265
5266 /*
5267 ** CAPI3REF: Find the next prepared statement
5268 ** METHOD: sqlite3
5269 **
@@ -5266,11 +5275,11 @@
5275 **
5276 ** The [database connection] pointer D in a call to
5277 ** [sqlite3_next_stmt(D,S)] must refer to an open database
5278 ** connection and in particular must not be a NULL pointer.
5279 */
5280 SQLITE_API sqlite3_stmt *SQLITE_APICALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
5281
5282 /*
5283 ** CAPI3REF: Commit And Rollback Notification Callbacks
5284 ** METHOD: sqlite3
5285 **
@@ -5315,12 +5324,12 @@
5324 ** ^The rollback callback is not invoked if a transaction is
5325 ** automatically rolled back because the database connection is closed.
5326 **
5327 ** See also the [sqlite3_update_hook()] interface.
5328 */
5329 SQLITE_API void *SQLITE_APICALL sqlite3_commit_hook(sqlite3*, int(SQLITE_CALLBACK *)(void*), void*);
5330 SQLITE_API void *SQLITE_APICALL sqlite3_rollback_hook(sqlite3*, void(SQLITE_CALLBACK *)(void *), void*);
5331
5332 /*
5333 ** CAPI3REF: Data Change Notification Callbacks
5334 ** METHOD: sqlite3
5335 **
@@ -5367,13 +5376,13 @@
5376 ** the first call on D.
5377 **
5378 ** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()],
5379 ** and [sqlite3_preupdate_hook()] interfaces.
5380 */
5381 SQLITE_API void *SQLITE_APICALL sqlite3_update_hook(
5382 sqlite3*,
5383 void(SQLITE_CALLBACK *)(void *,int ,char const *,char const *,sqlite3_int64),
5384 void*
5385 );
5386
5387 /*
5388 ** CAPI3REF: Enable Or Disable Shared Pager Cache
@@ -5407,11 +5416,11 @@
5416 ** This interface is threadsafe on processors where writing a
5417 ** 32-bit integer is atomic.
5418 **
5419 ** See Also: [SQLite Shared-Cache Mode]
5420 */
5421 SQLITE_API int SQLITE_APICALL sqlite3_enable_shared_cache(int);
5422
5423 /*
5424 ** CAPI3REF: Attempt To Free Heap Memory
5425 **
5426 ** ^The sqlite3_release_memory() interface attempts to free N bytes
@@ -5423,11 +5432,11 @@
5432 ** ^The sqlite3_release_memory() routine is a no-op returning zero
5433 ** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5434 **
5435 ** See also: [sqlite3_db_release_memory()]
5436 */
5437 SQLITE_API int SQLITE_APICALL sqlite3_release_memory(int);
5438
5439 /*
5440 ** CAPI3REF: Free Memory Used By A Database Connection
5441 ** METHOD: sqlite3
5442 **
@@ -5437,11 +5446,11 @@
5446 ** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
5447 ** omitted.
5448 **
5449 ** See also: [sqlite3_release_memory()]
5450 */
5451 SQLITE_API int SQLITE_APICALL sqlite3_db_release_memory(sqlite3*);
5452
5453 /*
5454 ** CAPI3REF: Impose A Limit On Heap Size
5455 **
5456 ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the
@@ -5489,11 +5498,11 @@
5498 ** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5499 **
5500 ** The circumstances under which SQLite will enforce the soft heap limit may
5501 ** changes in future releases of SQLite.
5502 */
5503 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
5504
5505 /*
5506 ** CAPI3REF: Deprecated Soft Heap Limit Interface
5507 ** DEPRECATED
5508 **
@@ -5500,11 +5509,11 @@
5509 ** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
5510 ** interface. This routine is provided for historical compatibility
5511 ** only. All new applications should use the
5512 ** [sqlite3_soft_heap_limit64()] interface rather than this one.
5513 */
5514 SQLITE_API SQLITE_DEPRECATED void SQLITE_APICALL sqlite3_soft_heap_limit(int N);
5515
5516
5517 /*
5518 ** CAPI3REF: Extract Metadata About A Column Of A Table
5519 ** METHOD: sqlite3
@@ -5570,11 +5579,11 @@
5579 **
5580 ** ^This function causes all database schemas to be read from disk and
5581 ** parsed, if that has not already been done, and returns an error if
5582 ** any errors are encountered while loading the schema.
5583 */
5584 SQLITE_API int SQLITE_APICALL sqlite3_table_column_metadata(
5585 sqlite3 *db, /* Connection handle */
5586 const char *zDbName, /* Database name or NULL */
5587 const char *zTableName, /* Table name */
5588 const char *zColumnName, /* Column name */
5589 char const **pzDataType, /* OUTPUT: Declared data type */
@@ -5626,11 +5635,11 @@
5635 ** disabled and prevent SQL injections from giving attackers
5636 ** access to extension loading capabilities.
5637 **
5638 ** See also the [load_extension() SQL function].
5639 */
5640 SQLITE_API int SQLITE_APICALL sqlite3_load_extension(
5641 sqlite3 *db, /* Load the extension into this database connection */
5642 const char *zFile, /* Name of the shared library containing extension */
5643 const char *zProc, /* Entry point. Derived from zFile if 0 */
5644 char **pzErrMsg /* Put error message here if not 0 */
5645 );
@@ -5658,11 +5667,11 @@
5667 ** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method
5668 ** rather than this interface, so the [load_extension()] SQL function
5669 ** remains disabled. This will prevent SQL injections from giving attackers
5670 ** access to extension loading capabilities.
5671 */
5672 SQLITE_API int SQLITE_APICALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
5673
5674 /*
5675 ** CAPI3REF: Automatically Load Statically Linked Extensions
5676 **
5677 ** ^This interface causes the xEntryPoint() function to be invoked for
@@ -5696,11 +5705,14 @@
5705 ** will be called more than once for each database connection that is opened.
5706 **
5707 ** See also: [sqlite3_reset_auto_extension()]
5708 ** and [sqlite3_cancel_auto_extension()]
5709 */
5710 typedef struct sqlite3_api_routines sqlite3_api_routines;
5711 SQLITE_API int SQLITE_APICALL sqlite3_auto_extension(
5712 int (SQLITE_CALLBACK *xEntryPoint)(sqlite3 *, char **, const sqlite3_api_routines *)
5713 );
5714
5715 /*
5716 ** CAPI3REF: Cancel Automatic Extension Loading
5717 **
5718 ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
@@ -5708,19 +5720,21 @@
5720 ** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)]
5721 ** routine returns 1 if initialization routine X was successfully
5722 ** unregistered and it returns 0 if X was not on the list of initialization
5723 ** routines.
5724 */
5725 SQLITE_API int SQLITE_APICALL sqlite3_cancel_auto_extension(
5726 int (SQLITE_CALLBACK *xEntryPoint)(sqlite3 *, char **, const sqlite3_api_routines *)
5727 );
5728
5729 /*
5730 ** CAPI3REF: Reset Automatic Extension Loading
5731 **
5732 ** ^This interface disables all automatic extensions previously
5733 ** registered using [sqlite3_auto_extension()].
5734 */
5735 SQLITE_API void SQLITE_APICALL sqlite3_reset_auto_extension(void);
5736
5737 /*
5738 ** The interface to the virtual-table mechanism is currently considered
5739 ** to be experimental. The interface might change in incompatible ways.
5740 ** If this is a problem for you, do not use the interface at this time.
@@ -5753,41 +5767,41 @@
5767 ** of this structure must not change while it is registered with
5768 ** any database connection.
5769 */
5770 struct sqlite3_module {
5771 int iVersion;
5772 int (SQLITE_CALLBACK *xCreate)(sqlite3*, void *pAux,
5773 int argc, const char *const*argv,
5774 sqlite3_vtab **ppVTab, char**);
5775 int (SQLITE_CALLBACK *xConnect)(sqlite3*, void *pAux,
5776 int argc, const char *const*argv,
5777 sqlite3_vtab **ppVTab, char**);
5778 int (SQLITE_CALLBACK *xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
5779 int (SQLITE_CALLBACK *xDisconnect)(sqlite3_vtab *pVTab);
5780 int (SQLITE_CALLBACK *xDestroy)(sqlite3_vtab *pVTab);
5781 int (SQLITE_CALLBACK *xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);
5782 int (SQLITE_CALLBACK *xClose)(sqlite3_vtab_cursor*);
5783 int (SQLITE_CALLBACK *xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
5784 int argc, sqlite3_value **argv);
5785 int (SQLITE_CALLBACK *xNext)(sqlite3_vtab_cursor*);
5786 int (SQLITE_CALLBACK *xEof)(sqlite3_vtab_cursor*);
5787 int (SQLITE_CALLBACK *xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int);
5788 int (SQLITE_CALLBACK *xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid);
5789 int (SQLITE_CALLBACK *xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *);
5790 int (SQLITE_CALLBACK *xBegin)(sqlite3_vtab *pVTab);
5791 int (SQLITE_CALLBACK *xSync)(sqlite3_vtab *pVTab);
5792 int (SQLITE_CALLBACK *xCommit)(sqlite3_vtab *pVTab);
5793 int (SQLITE_CALLBACK *xRollback)(sqlite3_vtab *pVTab);
5794 int (SQLITE_CALLBACK *xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,
5795 void (SQLITE_CALLBACK **pxFunc)(sqlite3_context*,int,sqlite3_value**),
5796 void **ppArg);
5797 int (SQLITE_CALLBACK *xRename)(sqlite3_vtab *pVtab, const char *zNew);
5798 /* The methods above are in version 1 of the sqlite_module object. Those
5799 ** below are for version 2 and greater. */
5800 int (SQLITE_CALLBACK *xSavepoint)(sqlite3_vtab *pVTab, int);
5801 int (SQLITE_CALLBACK *xRelease)(sqlite3_vtab *pVTab, int);
5802 int (SQLITE_CALLBACK *xRollbackTo)(sqlite3_vtab *pVTab, int);
5803 };
5804
5805 /*
5806 ** CAPI3REF: Virtual Table Indexing Information
5807 ** KEYWORDS: sqlite3_index_info
@@ -5961,22 +5975,22 @@
5975 ** be invoked if the call to sqlite3_create_module_v2() fails.
5976 ** ^The sqlite3_create_module()
5977 ** interface is equivalent to sqlite3_create_module_v2() with a NULL
5978 ** destructor.
5979 */
5980 SQLITE_API int SQLITE_APICALL sqlite3_create_module(
5981 sqlite3 *db, /* SQLite connection to register module with */
5982 const char *zName, /* Name of the module */
5983 const sqlite3_module *p, /* Methods for the module */
5984 void *pClientData /* Client data for xCreate/xConnect */
5985 );
5986 SQLITE_API int SQLITE_APICALL sqlite3_create_module_v2(
5987 sqlite3 *db, /* SQLite connection to register module with */
5988 const char *zName, /* Name of the module */
5989 const sqlite3_module *p, /* Methods for the module */
5990 void *pClientData, /* Client data for xCreate/xConnect */
5991 void(SQLITE_CALLBACK *xDestroy)(void*) /* Module destructor function */
5992 );
5993
5994 /*
5995 ** CAPI3REF: Virtual Table Instance Object
5996 ** KEYWORDS: sqlite3_vtab
@@ -6030,11 +6044,11 @@
6044 ** ^The [xCreate] and [xConnect] methods of a
6045 ** [virtual table module] call this interface
6046 ** to declare the format (the names and datatypes of the columns) of
6047 ** the virtual tables they implement.
6048 */
6049 SQLITE_API int SQLITE_APICALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
6050
6051 /*
6052 ** CAPI3REF: Overload A Function For A Virtual Table
6053 ** METHOD: sqlite3
6054 **
@@ -6049,11 +6063,11 @@
6063 ** of the new function always causes an exception to be thrown. So
6064 ** the new function is not good for anything by itself. Its only
6065 ** purpose is to be a placeholder function that can be overloaded
6066 ** by a [virtual table].
6067 */
6068 SQLITE_API int SQLITE_APICALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
6069
6070 /*
6071 ** The interface to the virtual-table mechanism defined above (back up
6072 ** to a comment remarkably similar to this one) is currently considered
6073 ** to be experimental. The interface might change in incompatible ways.
@@ -6148,11 +6162,11 @@
6162 ** zero-filled blob to read or write using the incremental-blob interface.
6163 **
6164 ** To avoid a resource leak, every open [BLOB handle] should eventually
6165 ** be released by a call to [sqlite3_blob_close()].
6166 */
6167 SQLITE_API int SQLITE_APICALL sqlite3_blob_open(
6168 sqlite3*,
6169 const char *zDb,
6170 const char *zTable,
6171 const char *zColumn,
6172 sqlite3_int64 iRow,
@@ -6181,11 +6195,11 @@
6195 ** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
6196 ** always returns zero.
6197 **
6198 ** ^This function sets the database handle error code and message.
6199 */
6200 SQLITE_API int SQLITE_APICALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
6201
6202 /*
6203 ** CAPI3REF: Close A BLOB Handle
6204 ** DESTRUCTOR: sqlite3_blob
6205 **
@@ -6204,11 +6218,11 @@
6218 ** with a null pointer (such as would be returned by a failed call to
6219 ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function
6220 ** is passed a valid open blob handle, the values returned by the
6221 ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning.
6222 */
6223 SQLITE_API int SQLITE_APICALL sqlite3_blob_close(sqlite3_blob *);
6224
6225 /*
6226 ** CAPI3REF: Return The Size Of An Open BLOB
6227 ** METHOD: sqlite3_blob
6228 **
@@ -6220,11 +6234,11 @@
6234 ** This routine only works on a [BLOB handle] which has been created
6235 ** by a prior successful call to [sqlite3_blob_open()] and which has not
6236 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6237 ** to this routine results in undefined and probably undesirable behavior.
6238 */
6239 SQLITE_API int SQLITE_APICALL sqlite3_blob_bytes(sqlite3_blob *);
6240
6241 /*
6242 ** CAPI3REF: Read Data From A BLOB Incrementally
6243 ** METHOD: sqlite3_blob
6244 **
@@ -6249,11 +6263,11 @@
6263 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6264 ** to this routine results in undefined and probably undesirable behavior.
6265 **
6266 ** See also: [sqlite3_blob_write()].
6267 */
6268 SQLITE_API int SQLITE_APICALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
6269
6270 /*
6271 ** CAPI3REF: Write Data Into A BLOB Incrementally
6272 ** METHOD: sqlite3_blob
6273 **
@@ -6291,11 +6305,11 @@
6305 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6306 ** to this routine results in undefined and probably undesirable behavior.
6307 **
6308 ** See also: [sqlite3_blob_read()].
6309 */
6310 SQLITE_API int SQLITE_APICALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
6311
6312 /*
6313 ** CAPI3REF: Virtual File System Objects
6314 **
6315 ** A virtual filesystem (VFS) is an [sqlite3_vfs] object
@@ -6322,13 +6336,13 @@
6336 **
6337 ** ^Unregister a VFS with the sqlite3_vfs_unregister() interface.
6338 ** ^(If the default VFS is unregistered, another VFS is chosen as
6339 ** the default. The choice for the new VFS is arbitrary.)^
6340 */
6341 SQLITE_API sqlite3_vfs *SQLITE_APICALL sqlite3_vfs_find(const char *zVfsName);
6342 SQLITE_API int SQLITE_APICALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
6343 SQLITE_API int SQLITE_APICALL sqlite3_vfs_unregister(sqlite3_vfs*);
6344
6345 /*
6346 ** CAPI3REF: Mutexes
6347 **
6348 ** The SQLite core uses these routines for thread
@@ -6440,15 +6454,15 @@
6454 ** sqlite3_mutex_leave() is a NULL pointer, then all three routines
6455 ** behave as no-ops.
6456 **
6457 ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
6458 */
6459 SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_mutex_alloc(int);
6460 SQLITE_API void SQLITE_APICALL sqlite3_mutex_free(sqlite3_mutex*);
6461 SQLITE_API void SQLITE_APICALL sqlite3_mutex_enter(sqlite3_mutex*);
6462 SQLITE_API int SQLITE_APICALL sqlite3_mutex_try(sqlite3_mutex*);
6463 SQLITE_API void SQLITE_APICALL sqlite3_mutex_leave(sqlite3_mutex*);
6464
6465 /*
6466 ** CAPI3REF: Mutex Methods Object
6467 **
6468 ** An instance of this structure defines the low-level routines
@@ -6513,19 +6527,19 @@
6527 ** If xMutexInit fails in any way, it is expected to clean up after itself
6528 ** prior to returning.
6529 */
6530 typedef struct sqlite3_mutex_methods sqlite3_mutex_methods;
6531 struct sqlite3_mutex_methods {
6532 int (SQLITE_CALLBACK *xMutexInit)(void);
6533 int (SQLITE_CALLBACK *xMutexEnd)(void);
6534 sqlite3_mutex *(SQLITE_CALLBACK *xMutexAlloc)(int);
6535 void (SQLITE_CALLBACK *xMutexFree)(sqlite3_mutex *);
6536 void (SQLITE_CALLBACK *xMutexEnter)(sqlite3_mutex *);
6537 int (SQLITE_CALLBACK *xMutexTry)(sqlite3_mutex *);
6538 void (SQLITE_CALLBACK *xMutexLeave)(sqlite3_mutex *);
6539 int (SQLITE_CALLBACK *xMutexHeld)(sqlite3_mutex *);
6540 int (SQLITE_CALLBACK *xMutexNotheld)(sqlite3_mutex *);
6541 };
6542
6543 /*
6544 ** CAPI3REF: Mutex Verification Routines
6545 **
@@ -6554,12 +6568,12 @@
6568 ** call to sqlite3_mutex_held() to fail, so a non-zero return is
6569 ** the appropriate thing to do. The sqlite3_mutex_notheld()
6570 ** interface should also return 1 when given a NULL pointer.
6571 */
6572 #ifndef NDEBUG
6573 SQLITE_API int SQLITE_APICALL sqlite3_mutex_held(sqlite3_mutex*);
6574 SQLITE_API int SQLITE_APICALL sqlite3_mutex_notheld(sqlite3_mutex*);
6575 #endif
6576
6577 /*
6578 ** CAPI3REF: Mutex Types
6579 **
@@ -6595,11 +6609,11 @@
6609 ** serializes access to the [database connection] given in the argument
6610 ** when the [threading mode] is Serialized.
6611 ** ^If the [threading mode] is Single-thread or Multi-thread then this
6612 ** routine returns a NULL pointer.
6613 */
6614 SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_db_mutex(sqlite3*);
6615
6616 /*
6617 ** CAPI3REF: Low-Level Control Of Database Files
6618 ** METHOD: sqlite3
6619 **
@@ -6630,11 +6644,11 @@
6644 ** an incorrect zDbName and an SQLITE_ERROR return from the underlying
6645 ** xFileControl method.
6646 **
6647 ** See also: [SQLITE_FCNTL_LOCKSTATE]
6648 */
6649 SQLITE_API int SQLITE_APICALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
6650
6651 /*
6652 ** CAPI3REF: Testing Interface
6653 **
6654 ** ^The sqlite3_test_control() interface is used to read out internal
@@ -6712,12 +6726,12 @@
6726 ** be represented by a 32-bit integer, then the values returned by
6727 ** sqlite3_status() are undefined.
6728 **
6729 ** See also: [sqlite3_db_status()]
6730 */
6731 SQLITE_API int SQLITE_APICALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6732 SQLITE_API int SQLITE_APICALL sqlite3_status64(
6733 int op,
6734 sqlite3_int64 *pCurrent,
6735 sqlite3_int64 *pHighwater,
6736 int resetFlag
6737 );
@@ -6838,11 +6852,11 @@
6852 ** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a
6853 ** non-zero [error code] on failure.
6854 **
6855 ** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
6856 */
6857 SQLITE_API int SQLITE_APICALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
6858
6859 /*
6860 ** CAPI3REF: Status Parameters for database connections
6861 ** KEYWORDS: {SQLITE_DBSTATUS options}
6862 **
@@ -6981,11 +6995,11 @@
6995 ** ^If the resetFlg is true, then the counter is reset to zero after this
6996 ** interface call returns.
6997 **
6998 ** See also: [sqlite3_status()] and [sqlite3_db_status()].
6999 */
7000 SQLITE_API int SQLITE_APICALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
7001
7002 /*
7003 ** CAPI3REF: Status Parameters for prepared statements
7004 ** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters}
7005 **
@@ -7217,22 +7231,22 @@
7231 */
7232 typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2;
7233 struct sqlite3_pcache_methods2 {
7234 int iVersion;
7235 void *pArg;
7236 int (SQLITE_CALLBACK *xInit)(void*);
7237 void (SQLITE_CALLBACK *xShutdown)(void*);
7238 sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int szExtra, int bPurgeable);
7239 void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize);
7240 int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*);
7241 sqlite3_pcache_page *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7242 void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard);
7243 void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, sqlite3_pcache_page*,
7244 unsigned oldKey, unsigned newKey);
7245 void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit);
7246 void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*);
7247 void (SQLITE_CALLBACK *xShrink)(sqlite3_pcache*);
7248 };
7249
7250 /*
7251 ** This is the obsolete pcache_methods object that has now been replaced
7252 ** by sqlite3_pcache_methods2. This object is not used by SQLite. It is
@@ -7239,20 +7253,20 @@
7253 ** retained in the header file for backwards compatibility only.
7254 */
7255 typedef struct sqlite3_pcache_methods sqlite3_pcache_methods;
7256 struct sqlite3_pcache_methods {
7257 void *pArg;
7258 int (SQLITE_CALLBACK *xInit)(void*);
7259 void (SQLITE_CALLBACK *xShutdown)(void*);
7260 sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int bPurgeable);
7261 void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize);
7262 int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*);
7263 void *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7264 void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, void*, int discard);
7265 void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey);
7266 void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit);
7267 void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*);
7268 };
7269
7270
7271 /*
7272 ** CAPI3REF: Online Backup Object
@@ -7450,20 +7464,20 @@
7464 ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()
7465 ** APIs are not strictly speaking threadsafe. If they are invoked at the
7466 ** same time as another thread is invoking sqlite3_backup_step() it is
7467 ** possible that they return invalid values.
7468 */
7469 SQLITE_API sqlite3_backup *SQLITE_APICALL sqlite3_backup_init(
7470 sqlite3 *pDest, /* Destination database handle */
7471 const char *zDestName, /* Destination database name */
7472 sqlite3 *pSource, /* Source database handle */
7473 const char *zSourceName /* Source database name */
7474 );
7475 SQLITE_API int SQLITE_APICALL sqlite3_backup_step(sqlite3_backup *p, int nPage);
7476 SQLITE_API int SQLITE_APICALL sqlite3_backup_finish(sqlite3_backup *p);
7477 SQLITE_API int SQLITE_APICALL sqlite3_backup_remaining(sqlite3_backup *p);
7478 SQLITE_API int SQLITE_APICALL sqlite3_backup_pagecount(sqlite3_backup *p);
7479
7480 /*
7481 ** CAPI3REF: Unlock Notification
7482 ** METHOD: sqlite3
7483 **
@@ -7576,13 +7590,13 @@
7590 ** by an sqlite3_step() call. ^(If there is a blocking connection, then the
7591 ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in
7592 ** the special "DROP TABLE/INDEX" case, the extended error code is just
7593 ** SQLITE_LOCKED.)^
7594 */
7595 SQLITE_API int SQLITE_APICALL sqlite3_unlock_notify(
7596 sqlite3 *pBlocked, /* Waiting connection */
7597 void (SQLITE_CALLBACK *xNotify)(void **apArg, int nArg), /* Callback function to invoke */
7598 void *pNotifyArg /* Argument to pass to xNotify */
7599 );
7600
7601
7602 /*
@@ -7591,12 +7605,12 @@
7605 ** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications
7606 ** and extensions to compare the contents of two buffers containing UTF-8
7607 ** strings in a case-independent fashion, using the same definition of "case
7608 ** independence" that SQLite uses internally when comparing identifiers.
7609 */
7610 SQLITE_API int SQLITE_APICALL sqlite3_stricmp(const char *, const char *);
7611 SQLITE_API int SQLITE_APICALL sqlite3_strnicmp(const char *, const char *, int);
7612
7613 /*
7614 ** CAPI3REF: String Globbing
7615 *
7616 ** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if
@@ -7609,11 +7623,11 @@
7623 ** Note that this routine returns zero on a match and non-zero if the strings
7624 ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
7625 **
7626 ** See also: [sqlite3_strlike()].
7627 */
7628 SQLITE_API int SQLITE_APICALL sqlite3_strglob(const char *zGlob, const char *zStr);
7629
7630 /*
7631 ** CAPI3REF: String LIKE Matching
7632 *
7633 ** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if
@@ -7632,11 +7646,11 @@
7646 ** Note that this routine returns zero on a match and non-zero if the strings
7647 ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
7648 **
7649 ** See also: [sqlite3_strglob()].
7650 */
7651 SQLITE_API int SQLITE_APICALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
7652
7653 /*
7654 ** CAPI3REF: Error Logging Interface
7655 **
7656 ** ^The [sqlite3_log()] interface writes a message into the [error log]
@@ -7691,13 +7705,13 @@
7705 ** previously registered write-ahead log callback. ^Note that the
7706 ** [sqlite3_wal_autocheckpoint()] interface and the
7707 ** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will
7708 ** overwrite any prior [sqlite3_wal_hook()] settings.
7709 */
7710 SQLITE_API void *SQLITE_APICALL sqlite3_wal_hook(
7711 sqlite3*,
7712 int(SQLITE_CALLBACK *)(void *,sqlite3*,const char*,int),
7713 void*
7714 );
7715
7716 /*
7717 ** CAPI3REF: Configure an auto-checkpoint
@@ -7726,11 +7740,11 @@
7740 ** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]
7741 ** pages. The use of this interface
7742 ** is only necessary if the default setting is found to be suboptimal
7743 ** for a particular application.
7744 */
7745 SQLITE_API int SQLITE_APICALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
7746
7747 /*
7748 ** CAPI3REF: Checkpoint a database
7749 ** METHOD: sqlite3
7750 **
@@ -7748,11 +7762,11 @@
7762 ** interface was added. This interface is retained for backwards
7763 ** compatibility and as a convenience for applications that need to manually
7764 ** start a callback but which do not need the full power (and corresponding
7765 ** complication) of [sqlite3_wal_checkpoint_v2()].
7766 */
7767 SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
7768
7769 /*
7770 ** CAPI3REF: Checkpoint a database
7771 ** METHOD: sqlite3
7772 **
@@ -7842,11 +7856,11 @@
7856 ** [sqlite3_errcode()] and [sqlite3_errmsg()].
7857 **
7858 ** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface
7859 ** from SQL.
7860 */
7861 SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint_v2(
7862 sqlite3 *db, /* Database handle */
7863 const char *zDb, /* Name of attached database (or NULL) */
7864 int eMode, /* SQLITE_CHECKPOINT_* value */
7865 int *pnLog, /* OUT: Size of WAL log in frames */
7866 int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -7931,11 +7945,11 @@
7945 ** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL],
7946 ** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode
7947 ** of the SQL statement that triggered the call to the [xUpdate] method of the
7948 ** [virtual table].
7949 */
7950 SQLITE_API int SQLITE_APICALL sqlite3_vtab_on_conflict(sqlite3 *);
7951
7952 /*
7953 ** CAPI3REF: Conflict resolution modes
7954 ** KEYWORDS: {conflict resolution mode}
7955 **
@@ -8036,11 +8050,11 @@
8050 ** as if the loop did not exist - it returns non-zero and leave the variable
8051 ** that pOut points to unchanged.
8052 **
8053 ** See also: [sqlite3_stmt_scanstatus_reset()]
8054 */
8055 SQLITE_API int SQLITE_APICALL sqlite3_stmt_scanstatus(
8056 sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
8057 int idx, /* Index of loop to report on */
8058 int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
8059 void *pOut /* Result written here */
8060 );
@@ -8052,11 +8066,11 @@
8066 ** ^Zero all [sqlite3_stmt_scanstatus()] related event counters.
8067 **
8068 ** This API is only available if the library is built with pre-processor
8069 ** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined.
8070 */
8071 SQLITE_API void SQLITE_APICALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
8072
8073 /*
8074 ** CAPI3REF: Flush caches to disk mid-transaction
8075 **
8076 ** ^If a write-transaction is open on [database connection] D when the
@@ -8084,11 +8098,11 @@
8098 ** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK.
8099 **
8100 ** ^This function does not set the database handle error code or message
8101 ** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions.
8102 */
8103 SQLITE_API int SQLITE_APICALL sqlite3_db_cacheflush(sqlite3*);
8104
8105 /*
8106 ** CAPI3REF: The pre-update hook.
8107 **
8108 ** ^These interfaces are only available if SQLite is compiled using the
@@ -8164,13 +8178,13 @@
8178 ** triggers; or 2 for changes resulting from triggers called by top-level
8179 ** triggers; and so forth.
8180 **
8181 ** See also: [sqlite3_update_hook()]
8182 */
8183 SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_APICALL sqlite3_preupdate_hook(
8184 sqlite3 *db,
8185 void(SQLITE_CALLBACK *xPreUpdate)(
8186 void *pCtx, /* Copy of third arg to preupdate_hook() */
8187 sqlite3 *db, /* Database handle */
8188 int op, /* SQLITE_UPDATE, DELETE or INSERT */
8189 char const *zDb, /* Database name */
8190 char const *zName, /* Table name */
@@ -8177,14 +8191,14 @@
8191 sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */
8192 sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */
8193 ),
8194 void*
8195 );
8196 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **);
8197 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_count(sqlite3 *);
8198 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_depth(sqlite3 *);
8199 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **);
8200
8201 /*
8202 ** CAPI3REF: Low-level system error code
8203 **
8204 ** ^Attempt to return the underlying operating system error code or error
@@ -8192,11 +8206,11 @@
8206 ** The return value is OS-dependent. For example, on unix systems, after
8207 ** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be
8208 ** called to get back the underlying "errno" that caused the problem, such
8209 ** as ENOSPC, EAUTH, EISDIR, and so forth.
8210 */
8211 SQLITE_API int SQLITE_APICALL sqlite3_system_errno(sqlite3*);
8212
8213 /*
8214 ** CAPI3REF: Database Snapshot
8215 ** KEYWORDS: {snapshot}
8216 ** EXPERIMENTAL
@@ -8242,11 +8256,11 @@
8256 ** to avoid a memory leak.
8257 **
8258 ** The [sqlite3_snapshot_get()] interface is only available when the
8259 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8260 */
8261 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_get(
8262 sqlite3 *db,
8263 const char *zSchema,
8264 sqlite3_snapshot **ppSnapshot
8265 );
8266
@@ -8280,11 +8294,11 @@
8294 ** database connection in order to make it ready to use snapshots.)
8295 **
8296 ** The [sqlite3_snapshot_open()] interface is only available when the
8297 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8298 */
8299 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_open(
8300 sqlite3 *db,
8301 const char *zSchema,
8302 sqlite3_snapshot *pSnapshot
8303 );
8304
@@ -8297,11 +8311,11 @@
8311 ** using this routine to avoid a memory leak.
8312 **
8313 ** The [sqlite3_snapshot_free()] interface is only available when the
8314 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8315 */
8316 SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_APICALL sqlite3_snapshot_free(sqlite3_snapshot*);
8317
8318 /*
8319 ** CAPI3REF: Compare the ages of two snapshot handles.
8320 ** EXPERIMENTAL
8321 **
@@ -8321,11 +8335,11 @@
8335 **
8336 ** Otherwise, this API returns a negative value if P1 refers to an older
8337 ** snapshot than P2, zero if the two handles refer to the same database
8338 ** snapshot, and a positive value if P1 is a newer snapshot than P2.
8339 */
8340 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_cmp(
8341 sqlite3_snapshot *p1,
8342 sqlite3_snapshot *p2
8343 );
8344
8345 /*
@@ -8379,14 +8393,14 @@
8393 ** Register a geometry callback named zGeom that can be used as part of an
8394 ** R-Tree geometry query as follows:
8395 **
8396 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
8397 */
8398 SQLITE_API int SQLITE_APICALL sqlite3_rtree_geometry_callback(
8399 sqlite3 *db,
8400 const char *zGeom,
8401 int (SQLITE_CALLBACK *xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
8402 void *pContext
8403 );
8404
8405
8406 /*
@@ -8396,25 +8410,25 @@
8410 struct sqlite3_rtree_geometry {
8411 void *pContext; /* Copy of pContext passed to s_r_g_c() */
8412 int nParam; /* Size of array aParam[] */
8413 sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */
8414 void *pUser; /* Callback implementation user data */
8415 void (SQLITE_CALLBACK *xDelUser)(void *); /* Called by SQLite to clean up pUser */
8416 };
8417
8418 /*
8419 ** Register a 2nd-generation geometry callback named zScore that can be
8420 ** used as part of an R-Tree geometry query as follows:
8421 **
8422 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...)
8423 */
8424 SQLITE_API int SQLITE_APICALL sqlite3_rtree_query_callback(
8425 sqlite3 *db,
8426 const char *zQueryFunc,
8427 int (SQLITE_CALLBACK *xQueryFunc)(sqlite3_rtree_query_info*),
8428 void *pContext,
8429 void (SQLITE_CALLBACK *xDestructor)(void*)
8430 );
8431
8432
8433 /*
8434 ** A pointer to a structure of the following type is passed as the
@@ -8428,11 +8442,11 @@
8442 struct sqlite3_rtree_query_info {
8443 void *pContext; /* pContext from when function registered */
8444 int nParam; /* Number of function parameters */
8445 sqlite3_rtree_dbl *aParam; /* value of function parameters */
8446 void *pUser; /* callback can use this, if desired */
8447 void (SQLITE_CALLBACK *xDelUser)(void*); /* function to free pUser */
8448 sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */
8449 unsigned int *anQueue; /* Number of pending entries in the queue */
8450 int nCoord; /* Number of coordinates */
8451 int iLevel; /* Level of current node or entry */
8452 int mxLevel; /* The largest iLevel value in the tree */
@@ -8624,11 +8638,11 @@
8638 ** If xFilter returns 0, changes is not tracked. Note that once a table is
8639 ** attached, xFilter will not be called again.
8640 */
8641 void sqlite3session_table_filter(
8642 sqlite3_session *pSession, /* Session object */
8643 int(SQLITE_CALLBACK *xFilter)(
8644 void *pCtx, /* Copy of third arg to _filter_table() */
8645 const char *zTab /* Table name */
8646 ),
8647 void *pCtx /* First argument passed to xFilter */
8648 );
@@ -9199,11 +9213,11 @@
9213 ** An sqlite3_changegroup object is used to combine two or more changesets
9214 ** (or patchsets) into a single changeset (or patchset). A single changegroup
9215 ** object may combine changesets or patchsets, but not both. The output is
9216 ** always in the same format as the input.
9217 **
9218 ** If successful, this function returns SQLITE_OK and populates (SQLITE_CALLBACK *pp) with
9219 ** a pointer to a new sqlite3_changegroup object before returning. The caller
9220 ** should eventually free the returned object using a call to
9221 ** sqlite3changegroup_delete(). If an error occurs, an SQLite error code
9222 ** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL.
9223 **
@@ -9319,11 +9333,11 @@
9333 ** changes for tables that do not appear in the first changeset, they are
9334 ** appended onto the end of the output changeset, again in the order in
9335 ** which they are first encountered.
9336 **
9337 ** If an error occurs, an SQLite error code is returned and the output
9338 ** variables (SQLITE_CALLBACK *pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK
9339 ** is returned and the output variables are set to the size of and a
9340 ** pointer to the output buffer, respectively. In this case it is the
9341 ** responsibility of the caller to eventually free the buffer using a
9342 ** call to sqlite3_free().
9343 */
@@ -9476,15 +9490,15 @@
9490 */
9491 int sqlite3changeset_apply(
9492 sqlite3 *db, /* Apply change to "main" db of this handle */
9493 int nChangeset, /* Size of changeset in bytes */
9494 void *pChangeset, /* Changeset blob */
9495 int(SQLITE_CALLBACK *xFilter)(
9496 void *pCtx, /* Copy of sixth arg to _apply() */
9497 const char *zTab /* Table name */
9498 ),
9499 int(SQLITE_CALLBACK *xConflict)(
9500 void *pCtx, /* Copy of sixth arg to _apply() */
9501 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
9502 sqlite3_changeset_iter *p /* Handle describing change and conflict */
9503 ),
9504 void *pCtx /* First argument passed to xConflict */
@@ -9621,20 +9635,20 @@
9635 ** </pre>
9636 **
9637 ** Is replaced by:
9638 **
9639 ** <pre>
9640 ** &nbsp; int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
9641 ** &nbsp; void *pIn,
9642 ** </pre>
9643 **
9644 ** Each time the xInput callback is invoked by the sessions module, the first
9645 ** argument passed is a copy of the supplied pIn context pointer. The second
9646 ** argument, pData, points to a buffer (SQLITE_CALLBACK *pnData) bytes in size. Assuming no
9647 ** error occurs the xInput method should copy up to (SQLITE_CALLBACK *pnData) bytes of data
9648 ** into the buffer and set (SQLITE_CALLBACK *pnData) to the actual number of bytes copied
9649 ** before returning SQLITE_OK. If the input is completely exhausted, (SQLITE_CALLBACK *pnData)
9650 ** should be set to zero to indicate this. Or, if an error occurs, an SQLite
9651 ** error code should be returned. In all cases, if an xInput callback returns
9652 ** an error, all processing is abandoned and the streaming API function
9653 ** returns a copy of the error code to the caller.
9654 **
@@ -9655,11 +9669,11 @@
9669 ** </pre>
9670 **
9671 ** Is replaced by:
9672 **
9673 ** <pre>
9674 ** &nbsp; int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9675 ** &nbsp; void *pOut
9676 ** </pre>
9677 **
9678 ** The xOutput callback is invoked zero or more times to return data to
9679 ** the application. The first parameter passed to each call is a copy of the
@@ -9675,58 +9689,58 @@
9689 ** parameter set to a value less than or equal to zero. Other than this,
9690 ** no guarantees are made as to the size of the chunks of data returned.
9691 */
9692 int sqlite3changeset_apply_strm(
9693 sqlite3 *db, /* Apply change to "main" db of this handle */
9694 int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), /* Input function */
9695 void *pIn, /* First arg for xInput */
9696 int(SQLITE_CALLBACK *xFilter)(
9697 void *pCtx, /* Copy of sixth arg to _apply() */
9698 const char *zTab /* Table name */
9699 ),
9700 int(SQLITE_CALLBACK *xConflict)(
9701 void *pCtx, /* Copy of sixth arg to _apply() */
9702 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
9703 sqlite3_changeset_iter *p /* Handle describing change and conflict */
9704 ),
9705 void *pCtx /* First argument passed to xConflict */
9706 );
9707 int sqlite3changeset_concat_strm(
9708 int (SQLITE_CALLBACK *xInputA)(void *pIn, void *pData, int *pnData),
9709 void *pInA,
9710 int (SQLITE_CALLBACK *xInputB)(void *pIn, void *pData, int *pnData),
9711 void *pInB,
9712 int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9713 void *pOut
9714 );
9715 int sqlite3changeset_invert_strm(
9716 int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
9717 void *pIn,
9718 int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9719 void *pOut
9720 );
9721 int sqlite3changeset_start_strm(
9722 sqlite3_changeset_iter **pp,
9723 int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
9724 void *pIn
9725 );
9726 int sqlite3session_changeset_strm(
9727 sqlite3_session *pSession,
9728 int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9729 void *pOut
9730 );
9731 int sqlite3session_patchset_strm(
9732 sqlite3_session *pSession,
9733 int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9734 void *pOut
9735 );
9736 int sqlite3changegroup_add_strm(sqlite3_changegroup*,
9737 int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
9738 void *pIn
9739 );
9740 int sqlite3changegroup_output_strm(sqlite3_changegroup*,
9741 int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9742 void *pOut
9743 );
9744
9745
9746 /*
@@ -9777,11 +9791,11 @@
9791
9792 typedef struct Fts5ExtensionApi Fts5ExtensionApi;
9793 typedef struct Fts5Context Fts5Context;
9794 typedef struct Fts5PhraseIter Fts5PhraseIter;
9795
9796 typedef void (SQLITE_CALLBACK *fts5_extension_function)(
9797 const Fts5ExtensionApi *pApi, /* API offered by current FTS version */
9798 Fts5Context *pFts, /* First arg to pass to pApi functions */
9799 sqlite3_context *pCtx, /* Context for returning result/error */
9800 int nVal, /* Number of values in apVal[] array */
9801 sqlite3_value **apVal /* Array of trailing arguments */
@@ -9828,15 +9842,15 @@
9842 ** This function may be quite inefficient if used with an FTS5 table
9843 ** created with the "columnsize=0" option.
9844 **
9845 ** xColumnText:
9846 ** This function attempts to retrieve the text of column iCol of the
9847 ** current document. If successful, (SQLITE_CALLBACK *pz) is set to point to a buffer
9848 ** containing the text in utf-8 encoding, (SQLITE_CALLBACK *pn) is set to the size in bytes
9849 ** (not characters) of the buffer and SQLITE_OK is returned. Otherwise,
9850 ** if an error occurs, an SQLite error code is returned and the final values
9851 ** of (SQLITE_CALLBACK *pz) and (*pn) are undefined.
9852 **
9853 ** xPhraseCount:
9854 ** Returns the number of phrases in the current query expression.
9855 **
9856 ** xPhraseSize:
@@ -9941,11 +9955,11 @@
9955 ** xRowCount(pFts5, pnRow)
9956 **
9957 ** This function is used to retrieve the total number of rows in the table.
9958 ** In other words, the same value that would be returned by:
9959 **
9960 ** SELECT count(SQLITE_CALLBACK *) FROM ftstable;
9961 **
9962 ** xPhraseFirst()
9963 ** This function is used, along with type Fts5PhraseIter and the xPhraseNext
9964 ** method, to iterate through all instances of a single query phrase within
9965 ** the current row. This is the same information as is accessible via the
@@ -10008,43 +10022,43 @@
10022 ** See xPhraseFirstColumn above.
10023 */
10024 struct Fts5ExtensionApi {
10025 int iVersion; /* Currently always set to 3 */
10026
10027 void *(SQLITE_CALLBACK *xUserData)(Fts5Context*);
10028
10029 int (SQLITE_CALLBACK *xColumnCount)(Fts5Context*);
10030 int (SQLITE_CALLBACK *xRowCount)(Fts5Context*, sqlite3_int64 *pnRow);
10031 int (SQLITE_CALLBACK *xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken);
10032
10033 int (SQLITE_CALLBACK *xTokenize)(Fts5Context*,
10034 const char *pText, int nText, /* Text to tokenize */
10035 void *pCtx, /* Context passed to xToken() */
10036 int (SQLITE_CALLBACK *xToken)(void*, int, const char*, int, int, int) /* Callback */
10037 );
10038
10039 int (SQLITE_CALLBACK *xPhraseCount)(Fts5Context*);
10040 int (SQLITE_CALLBACK *xPhraseSize)(Fts5Context*, int iPhrase);
10041
10042 int (SQLITE_CALLBACK *xInstCount)(Fts5Context*, int *pnInst);
10043 int (SQLITE_CALLBACK *xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff);
10044
10045 sqlite3_int64 (SQLITE_CALLBACK *xRowid)(Fts5Context*);
10046 int (SQLITE_CALLBACK *xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn);
10047 int (SQLITE_CALLBACK *xColumnSize)(Fts5Context*, int iCol, int *pnToken);
10048
10049 int (SQLITE_CALLBACK *xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData,
10050 int(SQLITE_CALLBACK *)(const Fts5ExtensionApi*,Fts5Context*,void*)
10051 );
10052 int (SQLITE_CALLBACK *xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*));
10053 void *(SQLITE_CALLBACK *xGetAuxdata)(Fts5Context*, int bClear);
10054
10055 int (SQLITE_CALLBACK *xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*);
10056 void (SQLITE_CALLBACK *xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff);
10057
10058 int (SQLITE_CALLBACK *xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*);
10059 void (SQLITE_CALLBACK *xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol);
10060 };
10061
10062 /*
10063 ** CUSTOM AUXILIARY FUNCTIONS
10064 *************************************************************************/
@@ -10068,11 +10082,11 @@
10082 ** The second and third arguments are an array of nul-terminated strings
10083 ** containing the tokenizer arguments, if any, specified following the
10084 ** tokenizer name as part of the CREATE VIRTUAL TABLE statement used
10085 ** to create the FTS5 table.
10086 **
10087 ** The final argument is an output variable. If successful, (SQLITE_CALLBACK *ppOut)
10088 ** should be set to point to the new tokenizer handle and SQLITE_OK
10089 ** returned. If an error occurs, some value other than SQLITE_OK should
10090 ** be returned. In this case, fts5 assumes that the final value of *ppOut
10091 ** is undefined.
10092 **
@@ -10242,17 +10256,17 @@
10256 ** inefficient.
10257 */
10258 typedef struct Fts5Tokenizer Fts5Tokenizer;
10259 typedef struct fts5_tokenizer fts5_tokenizer;
10260 struct fts5_tokenizer {
10261 int (SQLITE_CALLBACK *xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
10262 void (SQLITE_CALLBACK *xDelete)(Fts5Tokenizer*);
10263 int (SQLITE_CALLBACK *xTokenize)(Fts5Tokenizer*,
10264 void *pCtx,
10265 int flags, /* Mask of FTS5_TOKENIZE_* flags */
10266 const char *pText, int nText,
10267 int (SQLITE_CALLBACK *xToken)(
10268 void *pCtx, /* Copy of 2nd argument to xTokenize() */
10269 int tflags, /* Mask of FTS5_TOKEN_* flags */
10270 const char *pToken, /* Pointer to buffer containing token */
10271 int nToken, /* Size of token in bytes */
10272 int iStart, /* Byte offset of token within input text */
@@ -10281,33 +10295,33 @@
10295 typedef struct fts5_api fts5_api;
10296 struct fts5_api {
10297 int iVersion; /* Currently always set to 2 */
10298
10299 /* Create a new tokenizer */
10300 int (SQLITE_CALLBACK *xCreateTokenizer)(
10301 fts5_api *pApi,
10302 const char *zName,
10303 void *pContext,
10304 fts5_tokenizer *pTokenizer,
10305 void (SQLITE_CALLBACK *xDestroy)(void*)
10306 );
10307
10308 /* Find an existing tokenizer */
10309 int (SQLITE_CALLBACK *xFindTokenizer)(
10310 fts5_api *pApi,
10311 const char *zName,
10312 void **ppContext,
10313 fts5_tokenizer *pTokenizer
10314 );
10315
10316 /* Create a new auxiliary function */
10317 int (SQLITE_CALLBACK *xCreateFunction)(
10318 fts5_api *pApi,
10319 const char *zName,
10320 void *pContext,
10321 fts5_extension_function xFunction,
10322 void (SQLITE_CALLBACK *xDestroy)(void*)
10323 );
10324 };
10325
10326 /*
10327 ** END OF REGISTRATION API
10328

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button