Fossil SCM

Update the built-in SQLite to the second 3.14 beta.

drh 2016-08-04 14:11 trunk
Commit aa63cd405b1bb2d58dd5605007f6ff2fb5d0b4c7
2 files changed +812 -777 +458 -457
+812 -777
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -380,11 +380,11 @@
380380
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
381381
** [sqlite_version()] and [sqlite_source_id()].
382382
*/
383383
#define SQLITE_VERSION "3.14.0"
384384
#define SQLITE_VERSION_NUMBER 3014000
385
-#define SQLITE_SOURCE_ID "2016-08-02 08:45:26 7c38a79cdd42aaa45715aea330d10ca859098837"
385
+#define SQLITE_SOURCE_ID "2016-08-04 13:23:28 9adda385267d1a0ecff259b42a284913668441a2"
386386
387387
/*
388388
** CAPI3REF: Run-Time Library Version Numbers
389389
** KEYWORDS: sqlite3_version, sqlite3_sourceid
390390
**
@@ -413,13 +413,13 @@
413413
** [SQLITE_SOURCE_ID] C preprocessor macro.
414414
**
415415
** See also: [sqlite_version()] and [sqlite_source_id()].
416416
*/
417417
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);
418
+SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void);
419
+SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void);
420
+SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void);
421421
422422
/*
423423
** CAPI3REF: Run-Time Library Compilation Options Diagnostics
424424
**
425425
** ^The sqlite3_compileoption_used() function returns 0 or 1
@@ -440,12 +440,12 @@
440440
**
441441
** See also: SQL functions [sqlite_compileoption_used()] and
442442
** [sqlite_compileoption_get()] and the [compile_options pragma].
443443
*/
444444
#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);
445
+SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName);
446
+SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N);
447447
#endif
448448
449449
/*
450450
** CAPI3REF: Test To See If The Library Is Threadsafe
451451
**
@@ -480,11 +480,11 @@
480480
** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
481481
** is unchanged by calls to sqlite3_config().)^
482482
**
483483
** See the [threading mode] documentation for additional information.
484484
*/
485
-SQLITE_API int SQLITE_APICALL sqlite3_threadsafe(void);
485
+SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void);
486486
487487
/*
488488
** CAPI3REF: Database Connection Handle
489489
** KEYWORDS: {database connection} {database connections}
490490
**
@@ -577,19 +577,19 @@
577577
** from [sqlite3_open()], [sqlite3_open16()], or
578578
** [sqlite3_open_v2()], and not previously closed.
579579
** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
580580
** argument is a harmless no-op.
581581
*/
582
-SQLITE_API int SQLITE_APICALL sqlite3_close(sqlite3*);
583
-SQLITE_API int SQLITE_APICALL sqlite3_close_v2(sqlite3*);
582
+SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3*);
583
+SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3*);
584584
585585
/*
586586
** The type for a callback function.
587587
** This is legacy and deprecated. It is included for historical
588588
** compatibility and is not documented.
589589
*/
590
-typedef int (SQLITE_CALLBACK *sqlite3_callback)(void*,int,char**, char**);
590
+typedef int (*sqlite3_callback)(void*,int,char**, char**);
591591
592592
/*
593593
** CAPI3REF: One-Step Query Execution Interface
594594
** METHOD: sqlite3
595595
**
@@ -649,14 +649,14 @@
649649
** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
650650
** <li> The application must not modify the SQL statement text passed into
651651
** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
652652
** </ul>
653653
*/
654
-SQLITE_API int SQLITE_APICALL sqlite3_exec(
654
+SQLITE_API int SQLITE_STDCALL sqlite3_exec(
655655
sqlite3*, /* An open database */
656656
const char *sql, /* SQL to be evaluated */
657
- int (SQLITE_CALLBACK *callback)(void*,int,char**,char**), /* Callback function */
657
+ int (*callback)(void*,int,char**,char**), /* Callback function */
658658
void *, /* 1st argument to callback */
659659
char **errmsg /* Error msg written here */
660660
);
661661
662662
/*
@@ -1000,30 +1000,30 @@
10001000
** database corruption.
10011001
*/
10021002
typedef struct sqlite3_io_methods sqlite3_io_methods;
10031003
struct sqlite3_io_methods {
10041004
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*);
1005
+ int (*xClose)(sqlite3_file*);
1006
+ int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
1007
+ int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
1008
+ int (*xTruncate)(sqlite3_file*, sqlite3_int64 size);
1009
+ int (*xSync)(sqlite3_file*, int flags);
1010
+ int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
1011
+ int (*xLock)(sqlite3_file*, int);
1012
+ int (*xUnlock)(sqlite3_file*, int);
1013
+ int (*xCheckReservedLock)(sqlite3_file*, int *pResOut);
1014
+ int (*xFileControl)(sqlite3_file*, int op, void *pArg);
1015
+ int (*xSectorSize)(sqlite3_file*);
1016
+ int (*xDeviceCharacteristics)(sqlite3_file*);
10171017
/* 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);
1018
+ int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
1019
+ int (*xShmLock)(sqlite3_file*, int offset, int n, int flags);
1020
+ void (*xShmBarrier)(sqlite3_file*);
1021
+ int (*xShmUnmap)(sqlite3_file*, int deleteFlag);
10221022
/* 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);
1023
+ int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
1024
+ int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p);
10251025
/* Methods above are valid for version 3 */
10261026
/* Additional methods may be added in future releases */
10271027
};
10281028
10291029
/*
@@ -1195,11 +1195,11 @@
11951195
** ^The [SQLITE_FCNTL_BUSYHANDLER]
11961196
** file-control may be invoked by SQLite on the database file handle
11971197
** shortly after it is opened in order to provide a custom VFS with access
11981198
** to the connections busy-handler callback. The argument is of type (void **)
11991199
** - 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
1200
+** to a function of type (int (*)(void *)). In order to invoke the connections
12011201
** busy-handler, this function should be invoked with the second (void *) in
12021202
** the array as the only argument. If it returns non-zero, then the operation
12031203
** should be retried. If it returns zero, the custom VFS should abandon the
12041204
** current operation.
12051205
**
@@ -1471,43 +1471,43 @@
14711471
** or all of these interfaces to be NULL or for their behavior to change
14721472
** from one release to the next. Applications must not attempt to access
14731473
** any of these methods if the iVersion of the VFS is less than 3.
14741474
*/
14751475
typedef struct sqlite3_vfs sqlite3_vfs;
1476
-typedef void (SQLITE_SYSAPI *sqlite3_syscall_ptr)(void);
1476
+typedef void (*sqlite3_syscall_ptr)(void);
14771477
struct sqlite3_vfs {
14781478
int iVersion; /* Structure version number (currently 3) */
14791479
int szOsFile; /* Size of subclassed sqlite3_file */
14801480
int mxPathname; /* Maximum file pathname length */
14811481
sqlite3_vfs *pNext; /* Next registered VFS */
14821482
const char *zName; /* Name of this virtual file system */
14831483
void *pAppData; /* Pointer to application-specific data */
1484
- int (SQLITE_CALLBACK *xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
1484
+ int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
14851485
int flags, int *pOutFlags);
1486
- int (SQLITE_CALLBACK *xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
1487
- int (SQLITE_CALLBACK *xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
1488
- int (SQLITE_CALLBACK *xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
1489
- void *(SQLITE_CALLBACK *xDlOpen)(sqlite3_vfs*, const char *zFilename);
1490
- void (SQLITE_CALLBACK *xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
1491
- void (SQLITE_CALLBACK *(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
1492
- void (SQLITE_CALLBACK *xDlClose)(sqlite3_vfs*, void*);
1493
- int (SQLITE_CALLBACK *xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
1494
- int (SQLITE_CALLBACK *xSleep)(sqlite3_vfs*, int microseconds);
1495
- int (SQLITE_CALLBACK *xCurrentTime)(sqlite3_vfs*, double*);
1496
- int (SQLITE_CALLBACK *xGetLastError)(sqlite3_vfs*, int, char *);
1486
+ int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
1487
+ int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
1488
+ int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
1489
+ void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename);
1490
+ void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
1491
+ void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
1492
+ void (*xDlClose)(sqlite3_vfs*, void*);
1493
+ int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
1494
+ int (*xSleep)(sqlite3_vfs*, int microseconds);
1495
+ int (*xCurrentTime)(sqlite3_vfs*, double*);
1496
+ int (*xGetLastError)(sqlite3_vfs*, int, char *);
14971497
/*
14981498
** The methods above are in version 1 of the sqlite_vfs object
14991499
** definition. Those that follow are added in version 2 or later
15001500
*/
1501
- int (SQLITE_CALLBACK *xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
1501
+ int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
15021502
/*
15031503
** The methods above are in versions 1 and 2 of the sqlite_vfs object.
15041504
** Those below are for version 3 and greater.
15051505
*/
1506
- int (SQLITE_CALLBACK *xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
1507
- sqlite3_syscall_ptr (SQLITE_CALLBACK *xGetSystemCall)(sqlite3_vfs*, const char *zName);
1508
- const char *(SQLITE_CALLBACK *xNextSystemCall)(sqlite3_vfs*, const char *zName);
1506
+ int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
1507
+ sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName);
1508
+ const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName);
15091509
/*
15101510
** The methods above are in versions 1 through 3 of the sqlite_vfs object.
15111511
** New fields may be appended in future versions. The iVersion
15121512
** value will increment whenever this happens.
15131513
*/
@@ -1648,14 +1648,14 @@
16481648
** sqlite3_os_init() and sqlite3_os_end(). An application-supplied
16491649
** implementation of sqlite3_os_init() or sqlite3_os_end()
16501650
** must return [SQLITE_OK] on success and some other [error code] upon
16511651
** failure.
16521652
*/
1653
-SQLITE_API int SQLITE_APICALL sqlite3_initialize(void);
1654
-SQLITE_API int SQLITE_APICALL sqlite3_shutdown(void);
1655
-SQLITE_API int SQLITE_APICALL sqlite3_os_init(void);
1656
-SQLITE_API int SQLITE_APICALL sqlite3_os_end(void);
1653
+SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void);
1654
+SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void);
1655
+SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void);
1656
+SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void);
16571657
16581658
/*
16591659
** CAPI3REF: Configuring The SQLite Library
16601660
**
16611661
** The sqlite3_config() interface is used to make global configuration
@@ -1770,17 +1770,17 @@
17701770
** SQLite will never invoke xInit() more than once without an intervening
17711771
** call to xShutdown().
17721772
*/
17731773
typedef struct sqlite3_mem_methods sqlite3_mem_methods;
17741774
struct sqlite3_mem_methods {
1775
- void *(SQLITE_CALLBACK *xMalloc)(int); /* Memory allocation function */
1776
- void (SQLITE_CALLBACK *xFree)(void*); /* Free a prior allocation */
1777
- void *(SQLITE_CALLBACK *xRealloc)(void*,int); /* Resize an allocation */
1778
- int (SQLITE_CALLBACK *xSize)(void*); /* Return the size of an allocation */
1779
- int (SQLITE_CALLBACK *xRoundup)(int); /* Round up request size to allocation size */
1780
- int (SQLITE_CALLBACK *xInit)(void*); /* Initialize the memory allocator */
1781
- void (SQLITE_CALLBACK *xShutdown)(void*); /* Deinitialize the memory allocator */
1775
+ void *(*xMalloc)(int); /* Memory allocation function */
1776
+ void (*xFree)(void*); /* Free a prior allocation */
1777
+ void *(*xRealloc)(void*,int); /* Resize an allocation */
1778
+ int (*xSize)(void*); /* Return the size of an allocation */
1779
+ int (*xRoundup)(int); /* Round up request size to allocation size */
1780
+ int (*xInit)(void*); /* Initialize the memory allocator */
1781
+ void (*xShutdown)(void*); /* Deinitialize the memory allocator */
17821782
void *pAppData; /* Argument to xInit() and xShutdown() */
17831783
};
17841784
17851785
/*
17861786
** CAPI3REF: Configuration Options
@@ -1993,11 +1993,11 @@
19931993
**
19941994
** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
19951995
** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
19961996
** global [error log].
19971997
** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a
1998
-** function with a call signature of void(SQLITE_CALLBACK *)(void*,int,const char*),
1998
+** function with a call signature of void(*)(void*,int,const char*),
19991999
** and a pointer to void. ^If the function pointer is not NULL, it is
20002000
** invoked by [sqlite3_log()] to process each logging event. ^If the
20012001
** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op.
20022002
** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is
20032003
** passed through as the first parameter to the application-defined logger
@@ -2046,11 +2046,11 @@
20462046
**
20472047
** [[SQLITE_CONFIG_SQLLOG]]
20482048
** <dt>SQLITE_CONFIG_SQLLOG
20492049
** <dd>This option is only available if sqlite is compiled with the
20502050
** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should
2051
-** be a pointer to a function of type void(SQLITE_CALLBACK *)(void*,sqlite3*,const char*, int).
2051
+** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int).
20522052
** The second should be of type (void*). The callback is invoked by the library
20532053
** in three separate circumstances, identified by the value passed as the
20542054
** fourth parameter. If the fourth parameter is 0, then the database connection
20552055
** passed as the second argument has just been opened. The third argument
20562056
** points to a buffer containing the name of the main database file. If the
@@ -2244,11 +2244,11 @@
22442244
**
22452245
** ^The sqlite3_extended_result_codes() routine enables or disables the
22462246
** [extended result codes] feature of SQLite. ^The extended result
22472247
** codes are disabled by default for historical compatibility.
22482248
*/
2249
-SQLITE_API int SQLITE_APICALL sqlite3_extended_result_codes(sqlite3*, int onoff);
2249
+SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3*, int onoff);
22502250
22512251
/*
22522252
** CAPI3REF: Last Insert Rowid
22532253
** METHOD: sqlite3
22542254
**
@@ -2296,11 +2296,11 @@
22962296
** function is running and thus changes the last insert [rowid],
22972297
** then the value returned by [sqlite3_last_insert_rowid()] is
22982298
** unpredictable and might not equal either the old or the new
22992299
** last insert [rowid].
23002300
*/
2301
-SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_last_insert_rowid(sqlite3*);
2301
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3*);
23022302
23032303
/*
23042304
** CAPI3REF: Count The Number Of Rows Modified
23052305
** METHOD: sqlite3
23062306
**
@@ -2349,11 +2349,11 @@
23492349
**
23502350
** If a separate thread makes changes on the same database connection
23512351
** while [sqlite3_changes()] is running then the value returned
23522352
** is unpredictable and not meaningful.
23532353
*/
2354
-SQLITE_API int SQLITE_APICALL sqlite3_changes(sqlite3*);
2354
+SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3*);
23552355
23562356
/*
23572357
** CAPI3REF: Total Number Of Rows Modified
23582358
** METHOD: sqlite3
23592359
**
@@ -2373,11 +2373,11 @@
23732373
**
23742374
** If a separate thread makes changes on the same database connection
23752375
** while [sqlite3_total_changes()] is running then the value
23762376
** returned is unpredictable and not meaningful.
23772377
*/
2378
-SQLITE_API int SQLITE_APICALL sqlite3_total_changes(sqlite3*);
2378
+SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3*);
23792379
23802380
/*
23812381
** CAPI3REF: Interrupt A Long-Running Query
23822382
** METHOD: sqlite3
23832383
**
@@ -2413,11 +2413,11 @@
24132413
** that are started after the sqlite3_interrupt() call returns.
24142414
**
24152415
** If the database connection closes while [sqlite3_interrupt()]
24162416
** is running then bad things will likely happen.
24172417
*/
2418
-SQLITE_API void SQLITE_APICALL sqlite3_interrupt(sqlite3*);
2418
+SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3*);
24192419
24202420
/*
24212421
** CAPI3REF: Determine If An SQL Statement Is Complete
24222422
**
24232423
** These routines are useful during command-line input to determine if the
@@ -2448,12 +2448,12 @@
24482448
** UTF-8 string.
24492449
**
24502450
** The input to [sqlite3_complete16()] must be a zero-terminated
24512451
** UTF-16 string in native byte order.
24522452
*/
2453
-SQLITE_API int SQLITE_APICALL sqlite3_complete(const char *sql);
2454
-SQLITE_API int SQLITE_APICALL sqlite3_complete16(const void *sql);
2453
+SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *sql);
2454
+SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *sql);
24552455
24562456
/*
24572457
** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
24582458
** KEYWORDS: {busy-handler callback} {busy handler}
24592459
** METHOD: sqlite3
@@ -2510,11 +2510,11 @@
25102510
** result in undefined behavior.
25112511
**
25122512
** A busy handler must not close the database connection
25132513
** or [prepared statement] that invoked the busy handler.
25142514
*/
2515
-SQLITE_API int SQLITE_APICALL sqlite3_busy_handler(sqlite3*,int(SQLITE_CALLBACK *)(void*,int),void*);
2515
+SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(sqlite3*,int(*)(void*,int),void*);
25162516
25172517
/*
25182518
** CAPI3REF: Set A Busy Timeout
25192519
** METHOD: sqlite3
25202520
**
@@ -2533,11 +2533,11 @@
25332533
** was defined (using [sqlite3_busy_handler()]) prior to calling
25342534
** this routine, that other busy handler is cleared.)^
25352535
**
25362536
** See also: [PRAGMA busy_timeout]
25372537
*/
2538
-SQLITE_API int SQLITE_APICALL sqlite3_busy_timeout(sqlite3*, int ms);
2538
+SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3*, int ms);
25392539
25402540
/*
25412541
** CAPI3REF: Convenience Routines For Running Queries
25422542
** METHOD: sqlite3
25432543
**
@@ -2608,19 +2608,19 @@
26082608
** interface defined here. As a consequence, errors that occur in the
26092609
** wrapper layer outside of the internal [sqlite3_exec()] call are not
26102610
** reflected in subsequent calls to [sqlite3_errcode()] or
26112611
** [sqlite3_errmsg()].
26122612
*/
2613
-SQLITE_API int SQLITE_APICALL sqlite3_get_table(
2613
+SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
26142614
sqlite3 *db, /* An open database */
26152615
const char *zSql, /* SQL to be evaluated */
26162616
char ***pazResult, /* Results of the query */
26172617
int *pnRow, /* Number of result rows written here */
26182618
int *pnColumn, /* Number of result columns written here */
26192619
char **pzErrmsg /* Error msg written here */
26202620
);
2621
-SQLITE_API void SQLITE_APICALL sqlite3_free_table(char **result);
2621
+SQLITE_API void SQLITE_STDCALL sqlite3_free_table(char **result);
26222622
26232623
/*
26242624
** CAPI3REF: Formatted String Printing Functions
26252625
**
26262626
** These routines are work-alikes of the "printf()" family of functions
@@ -2723,13 +2723,13 @@
27232723
** ^(The "%z" formatting option works like "%s" but with the
27242724
** addition that after the string has been read and copied into
27252725
** the result, [sqlite3_free()] is called on the input string.)^
27262726
*/
27272727
SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...);
2728
-SQLITE_API char *SQLITE_APICALL sqlite3_vmprintf(const char*, va_list);
2728
+SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list);
27292729
SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...);
2730
-SQLITE_API char *SQLITE_APICALL sqlite3_vsnprintf(int,char*,const char*, va_list);
2730
+SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list);
27312731
27322732
/*
27332733
** CAPI3REF: Memory Allocation Subsystem
27342734
**
27352735
** The SQLite core uses these three routines for all of its own
@@ -2815,16 +2815,16 @@
28152815
**
28162816
** The application must not read or write any part of
28172817
** a block of memory after it has been released using
28182818
** [sqlite3_free()] or [sqlite3_realloc()].
28192819
*/
2820
-SQLITE_API void *SQLITE_APICALL sqlite3_malloc(int);
2821
-SQLITE_API void *SQLITE_APICALL sqlite3_malloc64(sqlite3_uint64);
2822
-SQLITE_API void *SQLITE_APICALL sqlite3_realloc(void*, int);
2823
-SQLITE_API void *SQLITE_APICALL sqlite3_realloc64(void*, sqlite3_uint64);
2824
-SQLITE_API void SQLITE_APICALL sqlite3_free(void*);
2825
-SQLITE_API sqlite3_uint64 SQLITE_APICALL sqlite3_msize(void*);
2820
+SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int);
2821
+SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64);
2822
+SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void*, int);
2823
+SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void*, sqlite3_uint64);
2824
+SQLITE_API void SQLITE_STDCALL sqlite3_free(void*);
2825
+SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void*);
28262826
28272827
/*
28282828
** CAPI3REF: Memory Allocator Statistics
28292829
**
28302830
** SQLite provides these two interfaces for reporting on the status
@@ -2845,12 +2845,12 @@
28452845
** [sqlite3_memory_used()] if and only if the parameter to
28462846
** [sqlite3_memory_highwater()] is true. ^The value returned
28472847
** by [sqlite3_memory_highwater(1)] is the high-water mark
28482848
** prior to the reset.
28492849
*/
2850
-SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_used(void);
2851
-SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_highwater(int resetFlag);
2850
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void);
2851
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag);
28522852
28532853
/*
28542854
** CAPI3REF: Pseudo-Random Number Generator
28552855
**
28562856
** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
@@ -2869,11 +2869,11 @@
28692869
** ^If the previous call to this routine had an N of 1 or more and a
28702870
** non-NULL P then the pseudo-randomness is generated
28712871
** internally and without recourse to the [sqlite3_vfs] xRandomness
28722872
** method.
28732873
*/
2874
-SQLITE_API void SQLITE_APICALL sqlite3_randomness(int N, void *P);
2874
+SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *P);
28752875
28762876
/*
28772877
** CAPI3REF: Compile-Time Authorization Callbacks
28782878
** METHOD: sqlite3
28792879
**
@@ -2952,13 +2952,13 @@
29522952
** [sqlite3_prepare()] or its variants. Authorization is not
29532953
** performed during statement evaluation in [sqlite3_step()], unless
29542954
** as stated in the previous paragraph, sqlite3_step() invokes
29552955
** sqlite3_prepare_v2() to reprepare a statement after a schema change.
29562956
*/
2957
-SQLITE_API int SQLITE_APICALL sqlite3_set_authorizer(
2957
+SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
29582958
sqlite3*,
2959
- int (SQLITE_CALLBACK *xAuth)(void*,int,const char*,const char*,const char*,const char*),
2959
+ int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
29602960
void *pUserData
29612961
);
29622962
29632963
/*
29642964
** CAPI3REF: Authorizer Return Codes
@@ -3060,14 +3060,14 @@
30603060
** digits in the time are meaningless. Future versions of SQLite
30613061
** might provide greater resolution on the profiler callback. The
30623062
** sqlite3_profile() function is considered experimental and is
30633063
** subject to change in future versions of SQLite.
30643064
*/
3065
-SQLITE_API SQLITE_DEPRECATED void *SQLITE_APICALL sqlite3_trace(sqlite3*,
3066
- void(SQLITE_CALLBACK *xTrace)(void*,const char*), void*);
3067
-SQLITE_API SQLITE_DEPRECATED void *SQLITE_APICALL sqlite3_profile(sqlite3*,
3068
- void(SQLITE_CALLBACK *xProfile)(void*,const char*,sqlite3_uint64), void*);
3065
+SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_trace(sqlite3*,
3066
+ void(*xTrace)(void*,const char*), void*);
3067
+SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_profile(sqlite3*,
3068
+ void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
30693069
30703070
/*
30713071
** CAPI3REF: SQL Trace Event Codes
30723072
** KEYWORDS: SQLITE_TRACE
30733073
**
@@ -3151,14 +3151,14 @@
31513151
**
31523152
** The sqlite3_trace_v2() interface is intended to replace the legacy
31533153
** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which
31543154
** are deprecated.
31553155
*/
3156
-SQLITE_API int SQLITE_APICALL sqlite3_trace_v2(
3156
+SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2(
31573157
sqlite3*,
31583158
unsigned uMask,
3159
- int(SQLITE_CALLBACK *xCallback)(unsigned,void*,void*,void*),
3159
+ int(*xCallback)(unsigned,void*,void*,void*),
31603160
void *pCtx
31613161
);
31623162
31633163
/*
31643164
** CAPI3REF: Query Progress Callbacks
@@ -3190,11 +3190,11 @@
31903190
** the database connection that invoked the progress handler.
31913191
** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
31923192
** database connections for the meaning of "modify" in this paragraph.
31933193
**
31943194
*/
3195
-SQLITE_API void SQLITE_APICALL sqlite3_progress_handler(sqlite3*, int, int(SQLITE_CALLBACK *)(void*), void*);
3195
+SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
31963196
31973197
/*
31983198
** CAPI3REF: Opening A New Database Connection
31993199
** CONSTRUCTOR: sqlite3
32003200
**
@@ -3419,19 +3419,19 @@
34193419
** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various
34203420
** features that require the use of temporary files may fail.
34213421
**
34223422
** See also: [sqlite3_temp_directory]
34233423
*/
3424
-SQLITE_API int SQLITE_APICALL sqlite3_open(
3424
+SQLITE_API int SQLITE_STDCALL sqlite3_open(
34253425
const char *filename, /* Database filename (UTF-8) */
34263426
sqlite3 **ppDb /* OUT: SQLite db handle */
34273427
);
3428
-SQLITE_API int SQLITE_APICALL sqlite3_open16(
3428
+SQLITE_API int SQLITE_STDCALL sqlite3_open16(
34293429
const void *filename, /* Database filename (UTF-16) */
34303430
sqlite3 **ppDb /* OUT: SQLite db handle */
34313431
);
3432
-SQLITE_API int SQLITE_APICALL sqlite3_open_v2(
3432
+SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
34333433
const char *filename, /* Database filename (UTF-8) */
34343434
sqlite3 **ppDb, /* OUT: SQLite db handle */
34353435
int flags, /* Flags */
34363436
const char *zVfs /* Name of VFS module to use */
34373437
);
@@ -3473,13 +3473,13 @@
34733473
** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and
34743474
** is not a database file pathname pointer that SQLite passed into the xOpen
34753475
** VFS method, then the behavior of this routine is undefined and probably
34763476
** undesirable.
34773477
*/
3478
-SQLITE_API const char *SQLITE_APICALL sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3479
-SQLITE_API int SQLITE_APICALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3480
-SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
3478
+SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3479
+SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3480
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
34813481
34823482
34833483
/*
34843484
** CAPI3REF: Error Codes And Messages
34853485
** METHOD: sqlite3
@@ -3519,15 +3519,15 @@
35193519
**
35203520
** If an interface fails with SQLITE_MISUSE, that means the interface
35213521
** was invoked incorrectly by the application. In that case, the
35223522
** error code and message may or may not be set.
35233523
*/
3524
-SQLITE_API int SQLITE_APICALL sqlite3_errcode(sqlite3 *db);
3525
-SQLITE_API int SQLITE_APICALL sqlite3_extended_errcode(sqlite3 *db);
3526
-SQLITE_API const char *SQLITE_APICALL sqlite3_errmsg(sqlite3*);
3527
-SQLITE_API const void *SQLITE_APICALL sqlite3_errmsg16(sqlite3*);
3528
-SQLITE_API const char *SQLITE_APICALL sqlite3_errstr(int);
3524
+SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db);
3525
+SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db);
3526
+SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*);
3527
+SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*);
3528
+SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int);
35293529
35303530
/*
35313531
** CAPI3REF: Prepared Statement Object
35323532
** KEYWORDS: {prepared statement} {prepared statements}
35333533
**
@@ -3591,11 +3591,11 @@
35913591
** created by an untrusted script can be contained using the
35923592
** [max_page_count] [PRAGMA].
35933593
**
35943594
** New run-time limit categories may be added in future releases.
35953595
*/
3596
-SQLITE_API int SQLITE_APICALL sqlite3_limit(sqlite3*, int id, int newVal);
3596
+SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3*, int id, int newVal);
35973597
35983598
/*
35993599
** CAPI3REF: Run-Time Limit Categories
36003600
** KEYWORDS: {limit category} {*limit categories}
36013601
**
@@ -3743,32 +3743,32 @@
37433743
** or [GLOB] operator or if the parameter is compared to an indexed column
37443744
** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
37453745
** </li>
37463746
** </ol>
37473747
*/
3748
-SQLITE_API int SQLITE_APICALL sqlite3_prepare(
3748
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
37493749
sqlite3 *db, /* Database handle */
37503750
const char *zSql, /* SQL statement, UTF-8 encoded */
37513751
int nByte, /* Maximum length of zSql in bytes. */
37523752
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
37533753
const char **pzTail /* OUT: Pointer to unused portion of zSql */
37543754
);
3755
-SQLITE_API int SQLITE_APICALL sqlite3_prepare_v2(
3755
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
37563756
sqlite3 *db, /* Database handle */
37573757
const char *zSql, /* SQL statement, UTF-8 encoded */
37583758
int nByte, /* Maximum length of zSql in bytes. */
37593759
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
37603760
const char **pzTail /* OUT: Pointer to unused portion of zSql */
37613761
);
3762
-SQLITE_API int SQLITE_APICALL sqlite3_prepare16(
3762
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
37633763
sqlite3 *db, /* Database handle */
37643764
const void *zSql, /* SQL statement, UTF-16 encoded */
37653765
int nByte, /* Maximum length of zSql in bytes. */
37663766
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
37673767
const void **pzTail /* OUT: Pointer to unused portion of zSql */
37683768
);
3769
-SQLITE_API int SQLITE_APICALL sqlite3_prepare16_v2(
3769
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
37703770
sqlite3 *db, /* Database handle */
37713771
const void *zSql, /* SQL statement, UTF-16 encoded */
37723772
int nByte, /* Maximum length of zSql in bytes. */
37733773
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
37743774
const void **pzTail /* OUT: Pointer to unused portion of zSql */
@@ -3803,12 +3803,12 @@
38033803
** automatically freed when the prepared statement is finalized.
38043804
** ^The string returned by sqlite3_expanded_sql(P), on the other hand,
38053805
** is obtained from [sqlite3_malloc()] and must be free by the application
38063806
** by passing it to [sqlite3_free()].
38073807
*/
3808
-SQLITE_API const char *SQLITE_APICALL sqlite3_sql(sqlite3_stmt *pStmt);
3809
-SQLITE_API char *SQLITE_APICALL sqlite3_expanded_sql(sqlite3_stmt *pStmt);
3808
+SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt);
3809
+SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt);
38103810
38113811
/*
38123812
** CAPI3REF: Determine If An SQL Statement Writes The Database
38133813
** METHOD: sqlite3_stmt
38143814
**
@@ -3836,11 +3836,11 @@
38363836
** database. ^The [ATTACH] and [DETACH] statements also cause
38373837
** sqlite3_stmt_readonly() to return true since, while those statements
38383838
** change the configuration of a database connection, they do not make
38393839
** changes to the content of the database files on disk.
38403840
*/
3841
-SQLITE_API int SQLITE_APICALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
3841
+SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
38423842
38433843
/*
38443844
** CAPI3REF: Determine If A Prepared Statement Has Been Reset
38453845
** METHOD: sqlite3_stmt
38463846
**
@@ -3857,11 +3857,11 @@
38573857
** to locate all prepared statements associated with a database
38583858
** connection that are in need of being reset. This can be used,
38593859
** for example, in diagnostic routines to search for prepared
38603860
** statements that are holding a transaction open.
38613861
*/
3862
-SQLITE_API int SQLITE_APICALL sqlite3_stmt_busy(sqlite3_stmt*);
3862
+SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt*);
38633863
38643864
/*
38653865
** CAPI3REF: Dynamically Typed Value Object
38663866
** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
38673867
**
@@ -4021,24 +4021,24 @@
40214021
** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails.
40224022
**
40234023
** See also: [sqlite3_bind_parameter_count()],
40244024
** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].
40254025
*/
4026
-SQLITE_API int SQLITE_APICALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(SQLITE_CALLBACK *)(void*));
4027
-SQLITE_API int SQLITE_APICALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
4028
- void(SQLITE_CALLBACK *)(void*));
4029
-SQLITE_API int SQLITE_APICALL sqlite3_bind_double(sqlite3_stmt*, int, double);
4030
-SQLITE_API int SQLITE_APICALL sqlite3_bind_int(sqlite3_stmt*, int, int);
4031
-SQLITE_API int SQLITE_APICALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
4032
-SQLITE_API int SQLITE_APICALL sqlite3_bind_null(sqlite3_stmt*, int);
4033
-SQLITE_API int SQLITE_APICALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(SQLITE_CALLBACK *)(void*));
4034
-SQLITE_API int SQLITE_APICALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(SQLITE_CALLBACK *)(void*));
4035
-SQLITE_API int SQLITE_APICALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
4036
- void(SQLITE_CALLBACK *)(void*), unsigned char encoding);
4037
-SQLITE_API int SQLITE_APICALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
4038
-SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
4039
-SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
4026
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
4027
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
4028
+ void(*)(void*));
4029
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt*, int, double);
4030
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt*, int, int);
4031
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
4032
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt*, int);
4033
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
4034
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
4035
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
4036
+ void(*)(void*), unsigned char encoding);
4037
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
4038
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
4039
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
40404040
40414041
/*
40424042
** CAPI3REF: Number Of SQL Parameters
40434043
** METHOD: sqlite3_stmt
40444044
**
@@ -4055,11 +4055,11 @@
40554055
**
40564056
** See also: [sqlite3_bind_blob|sqlite3_bind()],
40574057
** [sqlite3_bind_parameter_name()], and
40584058
** [sqlite3_bind_parameter_index()].
40594059
*/
4060
-SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_count(sqlite3_stmt*);
4060
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt*);
40614061
40624062
/*
40634063
** CAPI3REF: Name Of A Host Parameter
40644064
** METHOD: sqlite3_stmt
40654065
**
@@ -4083,11 +4083,11 @@
40834083
**
40844084
** See also: [sqlite3_bind_blob|sqlite3_bind()],
40854085
** [sqlite3_bind_parameter_count()], and
40864086
** [sqlite3_bind_parameter_index()].
40874087
*/
4088
-SQLITE_API const char *SQLITE_APICALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
4088
+SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
40894089
40904090
/*
40914091
** CAPI3REF: Index Of A Parameter With A Given Name
40924092
** METHOD: sqlite3_stmt
40934093
**
@@ -4100,21 +4100,21 @@
41004100
**
41014101
** See also: [sqlite3_bind_blob|sqlite3_bind()],
41024102
** [sqlite3_bind_parameter_count()], and
41034103
** [sqlite3_bind_parameter_name()].
41044104
*/
4105
-SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
4105
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
41064106
41074107
/*
41084108
** CAPI3REF: Reset All Bindings On A Prepared Statement
41094109
** METHOD: sqlite3_stmt
41104110
**
41114111
** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset
41124112
** the [sqlite3_bind_blob | bindings] on a [prepared statement].
41134113
** ^Use this routine to reset all host parameters to NULL.
41144114
*/
4115
-SQLITE_API int SQLITE_APICALL sqlite3_clear_bindings(sqlite3_stmt*);
4115
+SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt*);
41164116
41174117
/*
41184118
** CAPI3REF: Number Of Columns In A Result Set
41194119
** METHOD: sqlite3_stmt
41204120
**
@@ -4122,11 +4122,11 @@
41224122
** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
41234123
** statement that does not return data (for example an [UPDATE]).
41244124
**
41254125
** See also: [sqlite3_data_count()]
41264126
*/
4127
-SQLITE_API int SQLITE_APICALL sqlite3_column_count(sqlite3_stmt *pStmt);
4127
+SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt);
41284128
41294129
/*
41304130
** CAPI3REF: Column Names In A Result Set
41314131
** METHOD: sqlite3_stmt
41324132
**
@@ -4151,12 +4151,12 @@
41514151
** ^The name of a result column is the value of the "AS" clause for
41524152
** that column, if there is an AS clause. If there is no AS clause
41534153
** then the name of the column is unspecified and may change from
41544154
** one release of SQLite to the next.
41554155
*/
4156
-SQLITE_API const char *SQLITE_APICALL sqlite3_column_name(sqlite3_stmt*, int N);
4157
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_name16(sqlite3_stmt*, int N);
4156
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt*, int N);
4157
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt*, int N);
41584158
41594159
/*
41604160
** CAPI3REF: Source Of Data In A Query Result
41614161
** METHOD: sqlite3_stmt
41624162
**
@@ -4200,16 +4200,16 @@
42004200
** If two or more threads call one or more
42014201
** [sqlite3_column_database_name | column metadata interfaces]
42024202
** for the same [prepared statement] and result column
42034203
** at the same time then the results are undefined.
42044204
*/
4205
-SQLITE_API const char *SQLITE_APICALL sqlite3_column_database_name(sqlite3_stmt*,int);
4206
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_database_name16(sqlite3_stmt*,int);
4207
-SQLITE_API const char *SQLITE_APICALL sqlite3_column_table_name(sqlite3_stmt*,int);
4208
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_table_name16(sqlite3_stmt*,int);
4209
-SQLITE_API const char *SQLITE_APICALL sqlite3_column_origin_name(sqlite3_stmt*,int);
4210
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
4205
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int);
4206
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int);
4207
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int);
4208
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int);
4209
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int);
4210
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
42114211
42124212
/*
42134213
** CAPI3REF: Declared Datatype Of A Query Result
42144214
** METHOD: sqlite3_stmt
42154215
**
@@ -4237,12 +4237,12 @@
42374237
** data stored in that column is of the declared type. SQLite is
42384238
** strongly typed, but the typing is dynamic not static. ^Type
42394239
** is associated with individual values, not with the containers
42404240
** used to hold those values.
42414241
*/
4242
-SQLITE_API const char *SQLITE_APICALL sqlite3_column_decltype(sqlite3_stmt*,int);
4243
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_decltype16(sqlite3_stmt*,int);
4242
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt*,int);
4243
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt*,int);
42444244
42454245
/*
42464246
** CAPI3REF: Evaluate An SQL Statement
42474247
** METHOD: sqlite3_stmt
42484248
**
@@ -4318,11 +4318,11 @@
43184318
** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
43194319
** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,
43204320
** then the more specific [error codes] are returned directly
43214321
** by sqlite3_step(). The use of the "v2" interface is recommended.
43224322
*/
4323
-SQLITE_API int SQLITE_APICALL sqlite3_step(sqlite3_stmt*);
4323
+SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt*);
43244324
43254325
/*
43264326
** CAPI3REF: Number of columns in a result set
43274327
** METHOD: sqlite3_stmt
43284328
**
@@ -4339,11 +4339,11 @@
43394339
** where it always returns zero since each step of that multi-step
43404340
** pragma returns 0 columns of data.
43414341
**
43424342
** See also: [sqlite3_column_count()]
43434343
*/
4344
-SQLITE_API int SQLITE_APICALL sqlite3_data_count(sqlite3_stmt *pStmt);
4344
+SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt);
43454345
43464346
/*
43474347
** CAPI3REF: Fundamental Datatypes
43484348
** KEYWORDS: SQLITE_TEXT
43494349
**
@@ -4529,20 +4529,20 @@
45294529
** of these routines, a default value is returned. The default value
45304530
** is either the integer 0, the floating point number 0.0, or a NULL
45314531
** pointer. Subsequent calls to [sqlite3_errcode()] will return
45324532
** [SQLITE_NOMEM].)^
45334533
*/
4534
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_blob(sqlite3_stmt*, int iCol);
4535
-SQLITE_API int SQLITE_APICALL sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4536
-SQLITE_API int SQLITE_APICALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4537
-SQLITE_API double SQLITE_APICALL sqlite3_column_double(sqlite3_stmt*, int iCol);
4538
-SQLITE_API int SQLITE_APICALL sqlite3_column_int(sqlite3_stmt*, int iCol);
4539
-SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_column_int64(sqlite3_stmt*, int iCol);
4540
-SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_column_text(sqlite3_stmt*, int iCol);
4541
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_text16(sqlite3_stmt*, int iCol);
4542
-SQLITE_API int SQLITE_APICALL sqlite3_column_type(sqlite3_stmt*, int iCol);
4543
-SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_column_value(sqlite3_stmt*, int iCol);
4534
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt*, int iCol);
4535
+SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4536
+SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4537
+SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt*, int iCol);
4538
+SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt*, int iCol);
4539
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt*, int iCol);
4540
+SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt*, int iCol);
4541
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt*, int iCol);
4542
+SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt*, int iCol);
4543
+SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt*, int iCol);
45444544
45454545
/*
45464546
** CAPI3REF: Destroy A Prepared Statement Object
45474547
** DESTRUCTOR: sqlite3_stmt
45484548
**
@@ -4566,11 +4566,11 @@
45664566
** resource leaks. It is a grievous error for the application to try to use
45674567
** a prepared statement after it has been finalized. Any use of a prepared
45684568
** statement after it has been finalized can result in undefined and
45694569
** undesirable behavior such as segfaults and heap corruption.
45704570
*/
4571
-SQLITE_API int SQLITE_APICALL sqlite3_finalize(sqlite3_stmt *pStmt);
4571
+SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt);
45724572
45734573
/*
45744574
** CAPI3REF: Reset A Prepared Statement Object
45754575
** METHOD: sqlite3_stmt
45764576
**
@@ -4593,11 +4593,11 @@
45934593
** [sqlite3_reset(S)] returns an appropriate [error code].
45944594
**
45954595
** ^The [sqlite3_reset(S)] interface does not change the values
45964596
** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
45974597
*/
4598
-SQLITE_API int SQLITE_APICALL sqlite3_reset(sqlite3_stmt *pStmt);
4598
+SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt);
45994599
46004600
/*
46014601
** CAPI3REF: Create Or Redefine SQL Functions
46024602
** KEYWORDS: {function creation routines}
46034603
** KEYWORDS: {application-defined SQL function}
@@ -4693,40 +4693,40 @@
46934693
** ^An application-defined function is permitted to call other
46944694
** SQLite interfaces. However, such calls must not
46954695
** close the database connection nor finalize or reset the prepared
46964696
** statement in which the function is running.
46974697
*/
4698
-SQLITE_API int SQLITE_APICALL sqlite3_create_function(
4698
+SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
46994699
sqlite3 *db,
47004700
const char *zFunctionName,
47014701
int nArg,
47024702
int eTextRep,
47034703
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*)
4704
+ void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4705
+ void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4706
+ void (*xFinal)(sqlite3_context*)
47074707
);
4708
-SQLITE_API int SQLITE_APICALL sqlite3_create_function16(
4708
+SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
47094709
sqlite3 *db,
47104710
const void *zFunctionName,
47114711
int nArg,
47124712
int eTextRep,
47134713
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*)
4714
+ void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4715
+ void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4716
+ void (*xFinal)(sqlite3_context*)
47174717
);
4718
-SQLITE_API int SQLITE_APICALL sqlite3_create_function_v2(
4718
+SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
47194719
sqlite3 *db,
47204720
const char *zFunctionName,
47214721
int nArg,
47224722
int eTextRep,
47234723
void *pApp,
4724
- void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**),
4725
- void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**),
4726
- void (SQLITE_CALLBACK *xFinal)(sqlite3_context*),
4727
- void(SQLITE_CALLBACK *xDestroy)(void*)
4724
+ void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4725
+ void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4726
+ void (*xFinal)(sqlite3_context*),
4727
+ void(*xDestroy)(void*)
47284728
);
47294729
47304730
/*
47314731
** CAPI3REF: Text Encodings
47324732
**
@@ -4759,16 +4759,16 @@
47594759
** to be supported. However, new applications should avoid
47604760
** the use of these functions. To encourage programmers to avoid
47614761
** these functions, we will not explain what they do.
47624762
*/
47634763
#ifndef SQLITE_OMIT_DEPRECATED
4764
-SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_aggregate_count(sqlite3_context*);
4765
-SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_expired(sqlite3_stmt*);
4766
-SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4767
-SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_global_recover(void);
4768
-SQLITE_API SQLITE_DEPRECATED void SQLITE_APICALL sqlite3_thread_cleanup(void);
4769
-SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_memory_alarm(void(SQLITE_CALLBACK *)(void*,sqlite3_int64,int),
4764
+SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context*);
4765
+SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt*);
4766
+SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4767
+SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_global_recover(void);
4768
+SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_thread_cleanup(void);
4769
+SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
47704770
void*,sqlite3_int64);
47714771
#endif
47724772
47734773
/*
47744774
** CAPI3REF: Obtaining SQL Values
@@ -4814,22 +4814,22 @@
48144814
** or [sqlite3_value_text16()].
48154815
**
48164816
** These routines must be called from the same thread as
48174817
** the SQL function that supplied the [sqlite3_value*] parameters.
48184818
*/
4819
-SQLITE_API const void *SQLITE_APICALL sqlite3_value_blob(sqlite3_value*);
4820
-SQLITE_API int SQLITE_APICALL sqlite3_value_bytes(sqlite3_value*);
4821
-SQLITE_API int SQLITE_APICALL sqlite3_value_bytes16(sqlite3_value*);
4822
-SQLITE_API double SQLITE_APICALL sqlite3_value_double(sqlite3_value*);
4823
-SQLITE_API int SQLITE_APICALL sqlite3_value_int(sqlite3_value*);
4824
-SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_value_int64(sqlite3_value*);
4825
-SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_value_text(sqlite3_value*);
4826
-SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16(sqlite3_value*);
4827
-SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16le(sqlite3_value*);
4828
-SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16be(sqlite3_value*);
4829
-SQLITE_API int SQLITE_APICALL sqlite3_value_type(sqlite3_value*);
4830
-SQLITE_API int SQLITE_APICALL sqlite3_value_numeric_type(sqlite3_value*);
4819
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value*);
4820
+SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value*);
4821
+SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value*);
4822
+SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value*);
4823
+SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value*);
4824
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value*);
4825
+SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value*);
4826
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value*);
4827
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value*);
4828
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*);
4829
+SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*);
4830
+SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*);
48314831
48324832
/*
48334833
** CAPI3REF: Finding The Subtype Of SQL Values
48344834
** METHOD: sqlite3_value
48354835
**
@@ -4841,11 +4841,11 @@
48414841
**
48424842
** SQLite makes no use of subtype itself. It merely passes the subtype
48434843
** from the result of one [application-defined SQL function] into the
48444844
** input of another.
48454845
*/
4846
-SQLITE_API unsigned int SQLITE_APICALL sqlite3_value_subtype(sqlite3_value*);
4846
+SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value*);
48474847
48484848
/*
48494849
** CAPI3REF: Copy And Free SQL Values
48504850
** METHOD: sqlite3_value
48514851
**
@@ -4857,12 +4857,12 @@
48574857
**
48584858
** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object
48594859
** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer
48604860
** then sqlite3_value_free(V) is a harmless no-op.
48614861
*/
4862
-SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_value_dup(const sqlite3_value*);
4863
-SQLITE_API void SQLITE_APICALL sqlite3_value_free(sqlite3_value*);
4862
+SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value*);
4863
+SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value*);
48644864
48654865
/*
48664866
** CAPI3REF: Obtain Aggregate Function Context
48674867
** METHOD: sqlite3_context
48684868
**
@@ -4903,11 +4903,11 @@
49034903
** function.
49044904
**
49054905
** This routine must be called from the same thread in which
49064906
** the aggregate SQL function is running.
49074907
*/
4908
-SQLITE_API void *SQLITE_APICALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
4908
+SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
49094909
49104910
/*
49114911
** CAPI3REF: User Data For Functions
49124912
** METHOD: sqlite3_context
49134913
**
@@ -4918,11 +4918,11 @@
49184918
** registered the application defined function.
49194919
**
49204920
** This routine must be called from the same thread in which
49214921
** the application-defined function is running.
49224922
*/
4923
-SQLITE_API void *SQLITE_APICALL sqlite3_user_data(sqlite3_context*);
4923
+SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context*);
49244924
49254925
/*
49264926
** CAPI3REF: Database Connection For Functions
49274927
** METHOD: sqlite3_context
49284928
**
@@ -4930,11 +4930,11 @@
49304930
** the pointer to the [database connection] (the 1st parameter)
49314931
** of the [sqlite3_create_function()]
49324932
** and [sqlite3_create_function16()] routines that originally
49334933
** registered the application defined function.
49344934
*/
4935
-SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_context_db_handle(sqlite3_context*);
4935
+SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context*);
49364936
49374937
/*
49384938
** CAPI3REF: Function Auxiliary Data
49394939
** METHOD: sqlite3_context
49404940
**
@@ -4962,16 +4962,17 @@
49624962
** NULL if the metadata has been discarded.
49634963
** ^After each call to sqlite3_set_auxdata(C,N,P,X) where X is not NULL,
49644964
** SQLite will invoke the destructor function X with parameter P exactly
49654965
** once, when the metadata is discarded.
49664966
** SQLite is free to discard the metadata at any time, including: <ul>
4967
-** <li> when the corresponding function parameter changes, or
4968
-** <li> when [sqlite3_reset()] or [sqlite3_finalize()] is called for the
4969
-** SQL statement, or
4970
-** <li> when sqlite3_set_auxdata() is invoked again on the same parameter, or
4971
-** <li> during the original sqlite3_set_auxdata() call when a memory
4972
-** allocation error occurs. </ul>)^
4967
+** <li> ^(when the corresponding function parameter changes)^, or
4968
+** <li> ^(when [sqlite3_reset()] or [sqlite3_finalize()] is called for the
4969
+** SQL statement)^, or
4970
+** <li> ^(when sqlite3_set_auxdata() is invoked again on the same
4971
+** parameter)^, or
4972
+** <li> ^(during the original sqlite3_set_auxdata() call when a memory
4973
+** allocation error occurs.)^ </ul>
49734974
**
49744975
** Note the last bullet in particular. The destructor X in
49754976
** sqlite3_set_auxdata(C,N,P,X) might be called immediately, before the
49764977
** sqlite3_set_auxdata() interface even returns. Hence sqlite3_set_auxdata()
49774978
** should be called near the end of the function implementation and the
@@ -4983,12 +4984,12 @@
49834984
** values and [parameters] and expressions composed from the same.)^
49844985
**
49854986
** These routines must be called from the same thread in which
49864987
** the SQL function is running.
49874988
*/
4988
-SQLITE_API void *SQLITE_APICALL sqlite3_get_auxdata(sqlite3_context*, int N);
4989
-SQLITE_API void SQLITE_APICALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (SQLITE_CALLBACK *)(void*));
4989
+SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context*, int N);
4990
+SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
49904991
49914992
49924993
/*
49934994
** CAPI3REF: Constants Defining Special Destructor Behavior
49944995
**
@@ -5001,11 +5002,11 @@
50015002
** the content before returning.
50025003
**
50035004
** The typedef is necessary to work around problems in certain
50045005
** C++ compilers.
50055006
*/
5006
-typedef void (SQLITE_CALLBACK *sqlite3_destructor_type)(void*);
5007
+typedef void (*sqlite3_destructor_type)(void*);
50075008
#define SQLITE_STATIC ((sqlite3_destructor_type)0)
50085009
#define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1)
50095010
50105011
/*
50115012
** CAPI3REF: Setting The Result Of An SQL Function
@@ -5120,31 +5121,31 @@
51205121
**
51215122
** If these routines are called from within the different thread
51225123
** than the one containing the application-defined function that received
51235124
** the [sqlite3_context] pointer, the results are undefined.
51245125
*/
5125
-SQLITE_API void SQLITE_APICALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(SQLITE_CALLBACK *)(void*));
5126
-SQLITE_API void SQLITE_APICALL sqlite3_result_blob64(sqlite3_context*,const void*,
5127
- sqlite3_uint64,void(SQLITE_CALLBACK *)(void*));
5128
-SQLITE_API void SQLITE_APICALL sqlite3_result_double(sqlite3_context*, double);
5129
-SQLITE_API void SQLITE_APICALL sqlite3_result_error(sqlite3_context*, const char*, int);
5130
-SQLITE_API void SQLITE_APICALL sqlite3_result_error16(sqlite3_context*, const void*, int);
5131
-SQLITE_API void SQLITE_APICALL sqlite3_result_error_toobig(sqlite3_context*);
5132
-SQLITE_API void SQLITE_APICALL sqlite3_result_error_nomem(sqlite3_context*);
5133
-SQLITE_API void SQLITE_APICALL sqlite3_result_error_code(sqlite3_context*, int);
5134
-SQLITE_API void SQLITE_APICALL sqlite3_result_int(sqlite3_context*, int);
5135
-SQLITE_API void SQLITE_APICALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
5136
-SQLITE_API void SQLITE_APICALL sqlite3_result_null(sqlite3_context*);
5137
-SQLITE_API void SQLITE_APICALL sqlite3_result_text(sqlite3_context*, const char*, int, void(SQLITE_CALLBACK *)(void*));
5138
-SQLITE_API void SQLITE_APICALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
5139
- void(SQLITE_CALLBACK *)(void*), unsigned char encoding);
5140
-SQLITE_API void SQLITE_APICALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(SQLITE_CALLBACK *)(void*));
5141
-SQLITE_API void SQLITE_APICALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(SQLITE_CALLBACK *)(void*));
5142
-SQLITE_API void SQLITE_APICALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(SQLITE_CALLBACK *)(void*));
5143
-SQLITE_API void SQLITE_APICALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
5144
-SQLITE_API void SQLITE_APICALL sqlite3_result_zeroblob(sqlite3_context*, int n);
5145
-SQLITE_API int SQLITE_APICALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
5126
+SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
5127
+SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(sqlite3_context*,const void*,
5128
+ sqlite3_uint64,void(*)(void*));
5129
+SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context*, double);
5130
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context*, const char*, int);
5131
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context*, const void*, int);
5132
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context*);
5133
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context*);
5134
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context*, int);
5135
+SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context*, int);
5136
+SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
5137
+SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context*);
5138
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
5139
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
5140
+ void(*)(void*), unsigned char encoding);
5141
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
5142
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
5143
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
5144
+SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
5145
+SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n);
5146
+SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
51465147
51475148
51485149
/*
51495150
** CAPI3REF: Setting The Subtype Of An SQL Function
51505151
** METHOD: sqlite3_context
@@ -5155,11 +5156,11 @@
51555156
** of the subtype T are preserved in current versions of SQLite;
51565157
** higher order bits are discarded.
51575158
** The number of subtype bytes preserved by SQLite might increase
51585159
** in future releases of SQLite.
51595160
*/
5160
-SQLITE_API void SQLITE_APICALL sqlite3_result_subtype(sqlite3_context*,unsigned int);
5161
+SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context*,unsigned int);
51615162
51625163
/*
51635164
** CAPI3REF: Define New Collating Sequences
51645165
** METHOD: sqlite3
51655166
**
@@ -5237,31 +5238,31 @@
52375238
** is unfortunate but cannot be changed without breaking backwards
52385239
** compatibility.
52395240
**
52405241
** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].
52415242
*/
5242
-SQLITE_API int SQLITE_APICALL sqlite3_create_collation(
5243
+SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
52435244
sqlite3*,
52445245
const char *zName,
52455246
int eTextRep,
52465247
void *pArg,
5247
- int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*)
5248
+ int(*xCompare)(void*,int,const void*,int,const void*)
52485249
);
5249
-SQLITE_API int SQLITE_APICALL sqlite3_create_collation_v2(
5250
+SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
52505251
sqlite3*,
52515252
const char *zName,
52525253
int eTextRep,
52535254
void *pArg,
5254
- int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*),
5255
- void(SQLITE_CALLBACK *xDestroy)(void*)
5255
+ int(*xCompare)(void*,int,const void*,int,const void*),
5256
+ void(*xDestroy)(void*)
52565257
);
5257
-SQLITE_API int SQLITE_APICALL sqlite3_create_collation16(
5258
+SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
52585259
sqlite3*,
52595260
const void *zName,
52605261
int eTextRep,
52615262
void *pArg,
5262
- int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*)
5263
+ int(*xCompare)(void*,int,const void*,int,const void*)
52635264
);
52645265
52655266
/*
52665267
** CAPI3REF: Collation Needed Callbacks
52675268
** METHOD: sqlite3
@@ -5287,19 +5288,19 @@
52875288
**
52885289
** The callback function should register the desired collation using
52895290
** [sqlite3_create_collation()], [sqlite3_create_collation16()], or
52905291
** [sqlite3_create_collation_v2()].
52915292
*/
5292
-SQLITE_API int SQLITE_APICALL sqlite3_collation_needed(
5293
+SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
52935294
sqlite3*,
52945295
void*,
5295
- void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const char*)
5296
+ void(*)(void*,sqlite3*,int eTextRep,const char*)
52965297
);
5297
-SQLITE_API int SQLITE_APICALL sqlite3_collation_needed16(
5298
+SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
52985299
sqlite3*,
52995300
void*,
5300
- void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const void*)
5301
+ void(*)(void*,sqlite3*,int eTextRep,const void*)
53015302
);
53025303
53035304
#ifdef SQLITE_HAS_CODEC
53045305
/*
53055306
** Specify the key for an encrypted database. This routine should be
@@ -5306,15 +5307,15 @@
53065307
** called right after sqlite3_open().
53075308
**
53085309
** The code to implement this API is not available in the public release
53095310
** of SQLite.
53105311
*/
5311
-SQLITE_API int SQLITE_APICALL sqlite3_key(
5312
+SQLITE_API int SQLITE_STDCALL sqlite3_key(
53125313
sqlite3 *db, /* Database to be rekeyed */
53135314
const void *pKey, int nKey /* The key */
53145315
);
5315
-SQLITE_API int SQLITE_APICALL sqlite3_key_v2(
5316
+SQLITE_API int SQLITE_STDCALL sqlite3_key_v2(
53165317
sqlite3 *db, /* Database to be rekeyed */
53175318
const char *zDbName, /* Name of the database */
53185319
const void *pKey, int nKey /* The key */
53195320
);
53205321
@@ -5324,35 +5325,35 @@
53245325
** database is decrypted.
53255326
**
53265327
** The code to implement this API is not available in the public release
53275328
** of SQLite.
53285329
*/
5329
-SQLITE_API int SQLITE_APICALL sqlite3_rekey(
5330
+SQLITE_API int SQLITE_STDCALL sqlite3_rekey(
53305331
sqlite3 *db, /* Database to be rekeyed */
53315332
const void *pKey, int nKey /* The new key */
53325333
);
5333
-SQLITE_API int SQLITE_APICALL sqlite3_rekey_v2(
5334
+SQLITE_API int SQLITE_STDCALL sqlite3_rekey_v2(
53345335
sqlite3 *db, /* Database to be rekeyed */
53355336
const char *zDbName, /* Name of the database */
53365337
const void *pKey, int nKey /* The new key */
53375338
);
53385339
53395340
/*
53405341
** Specify the activation key for a SEE database. Unless
53415342
** activated, none of the SEE routines will work.
53425343
*/
5343
-SQLITE_API void SQLITE_APICALL sqlite3_activate_see(
5344
+SQLITE_API void SQLITE_STDCALL sqlite3_activate_see(
53445345
const char *zPassPhrase /* Activation phrase */
53455346
);
53465347
#endif
53475348
53485349
#ifdef SQLITE_ENABLE_CEROD
53495350
/*
53505351
** Specify the activation key for a CEROD database. Unless
53515352
** activated, none of the CEROD routines will work.
53525353
*/
5353
-SQLITE_API void SQLITE_APICALL sqlite3_activate_cerod(
5354
+SQLITE_API void SQLITE_STDCALL sqlite3_activate_cerod(
53545355
const char *zPassPhrase /* Activation phrase */
53555356
);
53565357
#endif
53575358
53585359
/*
@@ -5370,11 +5371,11 @@
53705371
** method of the default [sqlite3_vfs] object. If the xSleep() method
53715372
** of the default VFS is not implemented correctly, or not implemented at
53725373
** all, then the behavior of sqlite3_sleep() may deviate from the description
53735374
** in the previous paragraphs.
53745375
*/
5375
-SQLITE_API int SQLITE_APICALL sqlite3_sleep(int);
5376
+SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int);
53765377
53775378
/*
53785379
** CAPI3REF: Name Of The Folder Holding Temporary Files
53795380
**
53805381
** ^(If this global variable is made to point to a string which is
@@ -5489,11 +5490,11 @@
54895490
**
54905491
** If another thread changes the autocommit status of the database
54915492
** connection while this routine is running, then the return value
54925493
** is undefined.
54935494
*/
5494
-SQLITE_API int SQLITE_APICALL sqlite3_get_autocommit(sqlite3*);
5495
+SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3*);
54955496
54965497
/*
54975498
** CAPI3REF: Find The Database Handle Of A Prepared Statement
54985499
** METHOD: sqlite3_stmt
54995500
**
@@ -5502,11 +5503,11 @@
55025503
** returned by sqlite3_db_handle is the same [database connection]
55035504
** that was the first argument
55045505
** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
55055506
** create the statement in the first place.
55065507
*/
5507
-SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_db_handle(sqlite3_stmt*);
5508
+SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt*);
55085509
55095510
/*
55105511
** CAPI3REF: Return The Filename For A Database Connection
55115512
** METHOD: sqlite3
55125513
**
@@ -5519,21 +5520,21 @@
55195520
** ^The filename returned by this function is the output of the
55205521
** xFullPathname method of the [VFS]. ^In other words, the filename
55215522
** will be an absolute pathname, even if the filename used
55225523
** to open the database originally was a URI or relative pathname.
55235524
*/
5524
-SQLITE_API const char *SQLITE_APICALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
5525
+SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
55255526
55265527
/*
55275528
** CAPI3REF: Determine if a database is read-only
55285529
** METHOD: sqlite3
55295530
**
55305531
** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N
55315532
** of connection D is read-only, 0 if it is read/write, or -1 if N is not
55325533
** the name of a database on connection D.
55335534
*/
5534
-SQLITE_API int SQLITE_APICALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
5535
+SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
55355536
55365537
/*
55375538
** CAPI3REF: Find the next prepared statement
55385539
** METHOD: sqlite3
55395540
**
@@ -5545,11 +5546,11 @@
55455546
**
55465547
** The [database connection] pointer D in a call to
55475548
** [sqlite3_next_stmt(D,S)] must refer to an open database
55485549
** connection and in particular must not be a NULL pointer.
55495550
*/
5550
-SQLITE_API sqlite3_stmt *SQLITE_APICALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
5551
+SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
55515552
55525553
/*
55535554
** CAPI3REF: Commit And Rollback Notification Callbacks
55545555
** METHOD: sqlite3
55555556
**
@@ -5594,12 +5595,12 @@
55945595
** ^The rollback callback is not invoked if a transaction is
55955596
** automatically rolled back because the database connection is closed.
55965597
**
55975598
** See also the [sqlite3_update_hook()] interface.
55985599
*/
5599
-SQLITE_API void *SQLITE_APICALL sqlite3_commit_hook(sqlite3*, int(SQLITE_CALLBACK *)(void*), void*);
5600
-SQLITE_API void *SQLITE_APICALL sqlite3_rollback_hook(sqlite3*, void(SQLITE_CALLBACK *)(void *), void*);
5600
+SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
5601
+SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
56015602
56025603
/*
56035604
** CAPI3REF: Data Change Notification Callbacks
56045605
** METHOD: sqlite3
56055606
**
@@ -5646,13 +5647,13 @@
56465647
** the first call on D.
56475648
**
56485649
** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()],
56495650
** and [sqlite3_preupdate_hook()] interfaces.
56505651
*/
5651
-SQLITE_API void *SQLITE_APICALL sqlite3_update_hook(
5652
+SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
56525653
sqlite3*,
5653
- void(SQLITE_CALLBACK *)(void *,int ,char const *,char const *,sqlite3_int64),
5654
+ void(*)(void *,int ,char const *,char const *,sqlite3_int64),
56545655
void*
56555656
);
56565657
56575658
/*
56585659
** CAPI3REF: Enable Or Disable Shared Pager Cache
@@ -5686,11 +5687,11 @@
56865687
** This interface is threadsafe on processors where writing a
56875688
** 32-bit integer is atomic.
56885689
**
56895690
** See Also: [SQLite Shared-Cache Mode]
56905691
*/
5691
-SQLITE_API int SQLITE_APICALL sqlite3_enable_shared_cache(int);
5692
+SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int);
56925693
56935694
/*
56945695
** CAPI3REF: Attempt To Free Heap Memory
56955696
**
56965697
** ^The sqlite3_release_memory() interface attempts to free N bytes
@@ -5702,11 +5703,11 @@
57025703
** ^The sqlite3_release_memory() routine is a no-op returning zero
57035704
** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].
57045705
**
57055706
** See also: [sqlite3_db_release_memory()]
57065707
*/
5707
-SQLITE_API int SQLITE_APICALL sqlite3_release_memory(int);
5708
+SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int);
57085709
57095710
/*
57105711
** CAPI3REF: Free Memory Used By A Database Connection
57115712
** METHOD: sqlite3
57125713
**
@@ -5716,11 +5717,11 @@
57165717
** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
57175718
** omitted.
57185719
**
57195720
** See also: [sqlite3_release_memory()]
57205721
*/
5721
-SQLITE_API int SQLITE_APICALL sqlite3_db_release_memory(sqlite3*);
5722
+SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3*);
57225723
57235724
/*
57245725
** CAPI3REF: Impose A Limit On Heap Size
57255726
**
57265727
** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the
@@ -5768,11 +5769,11 @@
57685769
** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT].
57695770
**
57705771
** The circumstances under which SQLite will enforce the soft heap limit may
57715772
** changes in future releases of SQLite.
57725773
*/
5773
-SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
5774
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
57745775
57755776
/*
57765777
** CAPI3REF: Deprecated Soft Heap Limit Interface
57775778
** DEPRECATED
57785779
**
@@ -5779,11 +5780,11 @@
57795780
** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
57805781
** interface. This routine is provided for historical compatibility
57815782
** only. All new applications should use the
57825783
** [sqlite3_soft_heap_limit64()] interface rather than this one.
57835784
*/
5784
-SQLITE_API SQLITE_DEPRECATED void SQLITE_APICALL sqlite3_soft_heap_limit(int N);
5785
+SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_soft_heap_limit(int N);
57855786
57865787
57875788
/*
57885789
** CAPI3REF: Extract Metadata About A Column Of A Table
57895790
** METHOD: sqlite3
@@ -5849,11 +5850,11 @@
58495850
**
58505851
** ^This function causes all database schemas to be read from disk and
58515852
** parsed, if that has not already been done, and returns an error if
58525853
** any errors are encountered while loading the schema.
58535854
*/
5854
-SQLITE_API int SQLITE_APICALL sqlite3_table_column_metadata(
5855
+SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
58555856
sqlite3 *db, /* Connection handle */
58565857
const char *zDbName, /* Database name or NULL */
58575858
const char *zTableName, /* Table name */
58585859
const char *zColumnName, /* Column name */
58595860
char const **pzDataType, /* OUTPUT: Declared data type */
@@ -5905,11 +5906,11 @@
59055906
** disabled and prevent SQL injections from giving attackers
59065907
** access to extension loading capabilities.
59075908
**
59085909
** See also the [load_extension() SQL function].
59095910
*/
5910
-SQLITE_API int SQLITE_APICALL sqlite3_load_extension(
5911
+SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
59115912
sqlite3 *db, /* Load the extension into this database connection */
59125913
const char *zFile, /* Name of the shared library containing extension */
59135914
const char *zProc, /* Entry point. Derived from zFile if 0 */
59145915
char **pzErrMsg /* Put error message here if not 0 */
59155916
);
@@ -5928,20 +5929,20 @@
59285929
** to turn extension loading on and call it with onoff==0 to turn
59295930
** it back off again.
59305931
**
59315932
** ^This interface enables or disables both the C-API
59325933
** [sqlite3_load_extension()] and the SQL function [load_extension()].
5933
-** Use [sqlite3_db_config](db,[SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION],..)
5934
-** to enable or disable only the C-API.
5934
+** ^(Use [sqlite3_db_config](db,[SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION],..)
5935
+** to enable or disable only the C-API.)^
59355936
**
59365937
** <b>Security warning:</b> It is recommended that extension loading
59375938
** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method
59385939
** rather than this interface, so the [load_extension()] SQL function
59395940
** remains disabled. This will prevent SQL injections from giving attackers
59405941
** access to extension loading capabilities.
59415942
*/
5942
-SQLITE_API int SQLITE_APICALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
5943
+SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
59435944
59445945
/*
59455946
** CAPI3REF: Automatically Load Statically Linked Extensions
59465947
**
59475948
** ^This interface causes the xEntryPoint() function to be invoked for
@@ -5975,11 +5976,11 @@
59755976
** will be called more than once for each database connection that is opened.
59765977
**
59775978
** See also: [sqlite3_reset_auto_extension()]
59785979
** and [sqlite3_cancel_auto_extension()]
59795980
*/
5980
-SQLITE_API int SQLITE_APICALL sqlite3_auto_extension(void(SQLITE_CALLBACK *xEntryPoint)(void));
5981
+SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void(*xEntryPoint)(void));
59815982
59825983
/*
59835984
** CAPI3REF: Cancel Automatic Extension Loading
59845985
**
59855986
** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
@@ -5987,19 +5988,19 @@
59875988
** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)]
59885989
** routine returns 1 if initialization routine X was successfully
59895990
** unregistered and it returns 0 if X was not on the list of initialization
59905991
** routines.
59915992
*/
5992
-SQLITE_API int SQLITE_APICALL sqlite3_cancel_auto_extension(void(SQLITE_CALLBACK *xEntryPoint)(void));
5993
+SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void(*xEntryPoint)(void));
59935994
59945995
/*
59955996
** CAPI3REF: Reset Automatic Extension Loading
59965997
**
59975998
** ^This interface disables all automatic extensions previously
59985999
** registered using [sqlite3_auto_extension()].
59996000
*/
6000
-SQLITE_API void SQLITE_APICALL sqlite3_reset_auto_extension(void);
6001
+SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void);
60016002
60026003
/*
60036004
** The interface to the virtual-table mechanism is currently considered
60046005
** to be experimental. The interface might change in incompatible ways.
60056006
** If this is a problem for you, do not use the interface at this time.
@@ -6032,41 +6033,41 @@
60326033
** of this structure must not change while it is registered with
60336034
** any database connection.
60346035
*/
60356036
struct sqlite3_module {
60366037
int iVersion;
6037
- int (SQLITE_CALLBACK *xCreate)(sqlite3*, void *pAux,
6038
- int argc, const char *const*argv,
6039
- sqlite3_vtab **ppVTab, char**);
6040
- int (SQLITE_CALLBACK *xConnect)(sqlite3*, void *pAux,
6041
- int argc, const char *const*argv,
6042
- sqlite3_vtab **ppVTab, char**);
6043
- int (SQLITE_CALLBACK *xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
6044
- int (SQLITE_CALLBACK *xDisconnect)(sqlite3_vtab *pVTab);
6045
- int (SQLITE_CALLBACK *xDestroy)(sqlite3_vtab *pVTab);
6046
- int (SQLITE_CALLBACK *xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);
6047
- int (SQLITE_CALLBACK *xClose)(sqlite3_vtab_cursor*);
6048
- int (SQLITE_CALLBACK *xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
6049
- int argc, sqlite3_value **argv);
6050
- int (SQLITE_CALLBACK *xNext)(sqlite3_vtab_cursor*);
6051
- int (SQLITE_CALLBACK *xEof)(sqlite3_vtab_cursor*);
6052
- int (SQLITE_CALLBACK *xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int);
6053
- int (SQLITE_CALLBACK *xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid);
6054
- int (SQLITE_CALLBACK *xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *);
6055
- int (SQLITE_CALLBACK *xBegin)(sqlite3_vtab *pVTab);
6056
- int (SQLITE_CALLBACK *xSync)(sqlite3_vtab *pVTab);
6057
- int (SQLITE_CALLBACK *xCommit)(sqlite3_vtab *pVTab);
6058
- int (SQLITE_CALLBACK *xRollback)(sqlite3_vtab *pVTab);
6059
- int (SQLITE_CALLBACK *xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,
6060
- void (SQLITE_CALLBACK **pxFunc)(sqlite3_context*,int,sqlite3_value**),
6061
- void **ppArg);
6062
- int (SQLITE_CALLBACK *xRename)(sqlite3_vtab *pVtab, const char *zNew);
6063
- /* The methods above are in version 1 of the sqlite_module object. Those
6064
- ** below are for version 2 and greater. */
6065
- int (SQLITE_CALLBACK *xSavepoint)(sqlite3_vtab *pVTab, int);
6066
- int (SQLITE_CALLBACK *xRelease)(sqlite3_vtab *pVTab, int);
6067
- int (SQLITE_CALLBACK *xRollbackTo)(sqlite3_vtab *pVTab, int);
6038
+ int (*xCreate)(sqlite3*, void *pAux,
6039
+ int argc, const char *const*argv,
6040
+ sqlite3_vtab **ppVTab, char**);
6041
+ int (*xConnect)(sqlite3*, void *pAux,
6042
+ int argc, const char *const*argv,
6043
+ sqlite3_vtab **ppVTab, char**);
6044
+ int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
6045
+ int (*xDisconnect)(sqlite3_vtab *pVTab);
6046
+ int (*xDestroy)(sqlite3_vtab *pVTab);
6047
+ int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);
6048
+ int (*xClose)(sqlite3_vtab_cursor*);
6049
+ int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
6050
+ int argc, sqlite3_value **argv);
6051
+ int (*xNext)(sqlite3_vtab_cursor*);
6052
+ int (*xEof)(sqlite3_vtab_cursor*);
6053
+ int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int);
6054
+ int (*xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid);
6055
+ int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *);
6056
+ int (*xBegin)(sqlite3_vtab *pVTab);
6057
+ int (*xSync)(sqlite3_vtab *pVTab);
6058
+ int (*xCommit)(sqlite3_vtab *pVTab);
6059
+ int (*xRollback)(sqlite3_vtab *pVTab);
6060
+ int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,
6061
+ void (**pxFunc)(sqlite3_context*,int,sqlite3_value**),
6062
+ void **ppArg);
6063
+ int (*xRename)(sqlite3_vtab *pVtab, const char *zNew);
6064
+ /* The methods above are in version 1 of the sqlite_module object. Those
6065
+ ** below are for version 2 and greater. */
6066
+ int (*xSavepoint)(sqlite3_vtab *pVTab, int);
6067
+ int (*xRelease)(sqlite3_vtab *pVTab, int);
6068
+ int (*xRollbackTo)(sqlite3_vtab *pVTab, int);
60686069
};
60696070
60706071
/*
60716072
** CAPI3REF: Virtual Table Indexing Information
60726073
** KEYWORDS: sqlite3_index_info
@@ -6240,22 +6241,22 @@
62406241
** be invoked if the call to sqlite3_create_module_v2() fails.
62416242
** ^The sqlite3_create_module()
62426243
** interface is equivalent to sqlite3_create_module_v2() with a NULL
62436244
** destructor.
62446245
*/
6245
-SQLITE_API int SQLITE_APICALL sqlite3_create_module(
6246
+SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
62466247
sqlite3 *db, /* SQLite connection to register module with */
62476248
const char *zName, /* Name of the module */
62486249
const sqlite3_module *p, /* Methods for the module */
62496250
void *pClientData /* Client data for xCreate/xConnect */
62506251
);
6251
-SQLITE_API int SQLITE_APICALL sqlite3_create_module_v2(
6252
+SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
62526253
sqlite3 *db, /* SQLite connection to register module with */
62536254
const char *zName, /* Name of the module */
62546255
const sqlite3_module *p, /* Methods for the module */
62556256
void *pClientData, /* Client data for xCreate/xConnect */
6256
- void(SQLITE_CALLBACK *xDestroy)(void*) /* Module destructor function */
6257
+ void(*xDestroy)(void*) /* Module destructor function */
62576258
);
62586259
62596260
/*
62606261
** CAPI3REF: Virtual Table Instance Object
62616262
** KEYWORDS: sqlite3_vtab
@@ -6309,11 +6310,11 @@
63096310
** ^The [xCreate] and [xConnect] methods of a
63106311
** [virtual table module] call this interface
63116312
** to declare the format (the names and datatypes of the columns) of
63126313
** the virtual tables they implement.
63136314
*/
6314
-SQLITE_API int SQLITE_APICALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
6315
+SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
63156316
63166317
/*
63176318
** CAPI3REF: Overload A Function For A Virtual Table
63186319
** METHOD: sqlite3
63196320
**
@@ -6328,11 +6329,11 @@
63286329
** of the new function always causes an exception to be thrown. So
63296330
** the new function is not good for anything by itself. Its only
63306331
** purpose is to be a placeholder function that can be overloaded
63316332
** by a [virtual table].
63326333
*/
6333
-SQLITE_API int SQLITE_APICALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
6334
+SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
63346335
63356336
/*
63366337
** The interface to the virtual-table mechanism defined above (back up
63376338
** to a comment remarkably similar to this one) is currently considered
63386339
** to be experimental. The interface might change in incompatible ways.
@@ -6427,11 +6428,11 @@
64276428
** zero-filled blob to read or write using the incremental-blob interface.
64286429
**
64296430
** To avoid a resource leak, every open [BLOB handle] should eventually
64306431
** be released by a call to [sqlite3_blob_close()].
64316432
*/
6432
-SQLITE_API int SQLITE_APICALL sqlite3_blob_open(
6433
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
64336434
sqlite3*,
64346435
const char *zDb,
64356436
const char *zTable,
64366437
const char *zColumn,
64376438
sqlite3_int64 iRow,
@@ -6460,11 +6461,11 @@
64606461
** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
64616462
** always returns zero.
64626463
**
64636464
** ^This function sets the database handle error code and message.
64646465
*/
6465
-SQLITE_API int SQLITE_APICALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
6466
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
64666467
64676468
/*
64686469
** CAPI3REF: Close A BLOB Handle
64696470
** DESTRUCTOR: sqlite3_blob
64706471
**
@@ -6483,11 +6484,11 @@
64836484
** with a null pointer (such as would be returned by a failed call to
64846485
** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function
64856486
** is passed a valid open blob handle, the values returned by the
64866487
** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning.
64876488
*/
6488
-SQLITE_API int SQLITE_APICALL sqlite3_blob_close(sqlite3_blob *);
6489
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *);
64896490
64906491
/*
64916492
** CAPI3REF: Return The Size Of An Open BLOB
64926493
** METHOD: sqlite3_blob
64936494
**
@@ -6499,11 +6500,11 @@
64996500
** This routine only works on a [BLOB handle] which has been created
65006501
** by a prior successful call to [sqlite3_blob_open()] and which has not
65016502
** been closed by [sqlite3_blob_close()]. Passing any other pointer in
65026503
** to this routine results in undefined and probably undesirable behavior.
65036504
*/
6504
-SQLITE_API int SQLITE_APICALL sqlite3_blob_bytes(sqlite3_blob *);
6505
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *);
65056506
65066507
/*
65076508
** CAPI3REF: Read Data From A BLOB Incrementally
65086509
** METHOD: sqlite3_blob
65096510
**
@@ -6528,11 +6529,11 @@
65286529
** been closed by [sqlite3_blob_close()]. Passing any other pointer in
65296530
** to this routine results in undefined and probably undesirable behavior.
65306531
**
65316532
** See also: [sqlite3_blob_write()].
65326533
*/
6533
-SQLITE_API int SQLITE_APICALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
6534
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
65346535
65356536
/*
65366537
** CAPI3REF: Write Data Into A BLOB Incrementally
65376538
** METHOD: sqlite3_blob
65386539
**
@@ -6570,11 +6571,11 @@
65706571
** been closed by [sqlite3_blob_close()]. Passing any other pointer in
65716572
** to this routine results in undefined and probably undesirable behavior.
65726573
**
65736574
** See also: [sqlite3_blob_read()].
65746575
*/
6575
-SQLITE_API int SQLITE_APICALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
6576
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
65766577
65776578
/*
65786579
** CAPI3REF: Virtual File System Objects
65796580
**
65806581
** A virtual filesystem (VFS) is an [sqlite3_vfs] object
@@ -6601,13 +6602,13 @@
66016602
**
66026603
** ^Unregister a VFS with the sqlite3_vfs_unregister() interface.
66036604
** ^(If the default VFS is unregistered, another VFS is chosen as
66046605
** the default. The choice for the new VFS is arbitrary.)^
66056606
*/
6606
-SQLITE_API sqlite3_vfs *SQLITE_APICALL sqlite3_vfs_find(const char *zVfsName);
6607
-SQLITE_API int SQLITE_APICALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
6608
-SQLITE_API int SQLITE_APICALL sqlite3_vfs_unregister(sqlite3_vfs*);
6607
+SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfsName);
6608
+SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
6609
+SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs*);
66096610
66106611
/*
66116612
** CAPI3REF: Mutexes
66126613
**
66136614
** The SQLite core uses these routines for thread
@@ -6719,15 +6720,15 @@
67196720
** sqlite3_mutex_leave() is a NULL pointer, then all three routines
67206721
** behave as no-ops.
67216722
**
67226723
** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
67236724
*/
6724
-SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_mutex_alloc(int);
6725
-SQLITE_API void SQLITE_APICALL sqlite3_mutex_free(sqlite3_mutex*);
6726
-SQLITE_API void SQLITE_APICALL sqlite3_mutex_enter(sqlite3_mutex*);
6727
-SQLITE_API int SQLITE_APICALL sqlite3_mutex_try(sqlite3_mutex*);
6728
-SQLITE_API void SQLITE_APICALL sqlite3_mutex_leave(sqlite3_mutex*);
6725
+SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int);
6726
+SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*);
6727
+SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*);
6728
+SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*);
6729
+SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*);
67296730
67306731
/*
67316732
** CAPI3REF: Mutex Methods Object
67326733
**
67336734
** An instance of this structure defines the low-level routines
@@ -6792,19 +6793,19 @@
67926793
** If xMutexInit fails in any way, it is expected to clean up after itself
67936794
** prior to returning.
67946795
*/
67956796
typedef struct sqlite3_mutex_methods sqlite3_mutex_methods;
67966797
struct sqlite3_mutex_methods {
6797
- int (SQLITE_CALLBACK *xMutexInit)(void);
6798
- int (SQLITE_CALLBACK *xMutexEnd)(void);
6799
- sqlite3_mutex *(SQLITE_CALLBACK *xMutexAlloc)(int);
6800
- void (SQLITE_CALLBACK *xMutexFree)(sqlite3_mutex *);
6801
- void (SQLITE_CALLBACK *xMutexEnter)(sqlite3_mutex *);
6802
- int (SQLITE_CALLBACK *xMutexTry)(sqlite3_mutex *);
6803
- void (SQLITE_CALLBACK *xMutexLeave)(sqlite3_mutex *);
6804
- int (SQLITE_CALLBACK *xMutexHeld)(sqlite3_mutex *);
6805
- int (SQLITE_CALLBACK *xMutexNotheld)(sqlite3_mutex *);
6798
+ int (*xMutexInit)(void);
6799
+ int (*xMutexEnd)(void);
6800
+ sqlite3_mutex *(*xMutexAlloc)(int);
6801
+ void (*xMutexFree)(sqlite3_mutex *);
6802
+ void (*xMutexEnter)(sqlite3_mutex *);
6803
+ int (*xMutexTry)(sqlite3_mutex *);
6804
+ void (*xMutexLeave)(sqlite3_mutex *);
6805
+ int (*xMutexHeld)(sqlite3_mutex *);
6806
+ int (*xMutexNotheld)(sqlite3_mutex *);
68066807
};
68076808
68086809
/*
68096810
** CAPI3REF: Mutex Verification Routines
68106811
**
@@ -6833,12 +6834,12 @@
68336834
** call to sqlite3_mutex_held() to fail, so a non-zero return is
68346835
** the appropriate thing to do. The sqlite3_mutex_notheld()
68356836
** interface should also return 1 when given a NULL pointer.
68366837
*/
68376838
#ifndef NDEBUG
6838
-SQLITE_API int SQLITE_APICALL sqlite3_mutex_held(sqlite3_mutex*);
6839
-SQLITE_API int SQLITE_APICALL sqlite3_mutex_notheld(sqlite3_mutex*);
6839
+SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex*);
6840
+SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex*);
68406841
#endif
68416842
68426843
/*
68436844
** CAPI3REF: Mutex Types
68446845
**
@@ -6874,11 +6875,11 @@
68746875
** serializes access to the [database connection] given in the argument
68756876
** when the [threading mode] is Serialized.
68766877
** ^If the [threading mode] is Single-thread or Multi-thread then this
68776878
** routine returns a NULL pointer.
68786879
*/
6879
-SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_db_mutex(sqlite3*);
6880
+SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3*);
68806881
68816882
/*
68826883
** CAPI3REF: Low-Level Control Of Database Files
68836884
** METHOD: sqlite3
68846885
**
@@ -6909,11 +6910,11 @@
69096910
** an incorrect zDbName and an SQLITE_ERROR return from the underlying
69106911
** xFileControl method.
69116912
**
69126913
** See also: [SQLITE_FCNTL_LOCKSTATE]
69136914
*/
6914
-SQLITE_API int SQLITE_APICALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
6915
+SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
69156916
69166917
/*
69176918
** CAPI3REF: Testing Interface
69186919
**
69196920
** ^The sqlite3_test_control() interface is used to read out internal
@@ -6991,12 +6992,12 @@
69916992
** be represented by a 32-bit integer, then the values returned by
69926993
** sqlite3_status() are undefined.
69936994
**
69946995
** See also: [sqlite3_db_status()]
69956996
*/
6996
-SQLITE_API int SQLITE_APICALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6997
-SQLITE_API int SQLITE_APICALL sqlite3_status64(
6997
+SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6998
+SQLITE_API int SQLITE_STDCALL sqlite3_status64(
69986999
int op,
69997000
sqlite3_int64 *pCurrent,
70007001
sqlite3_int64 *pHighwater,
70017002
int resetFlag
70027003
);
@@ -7117,11 +7118,11 @@
71177118
** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a
71187119
** non-zero [error code] on failure.
71197120
**
71207121
** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
71217122
*/
7122
-SQLITE_API int SQLITE_APICALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
7123
+SQLITE_API int SQLITE_STDCALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
71237124
71247125
/*
71257126
** CAPI3REF: Status Parameters for database connections
71267127
** KEYWORDS: {SQLITE_DBSTATUS options}
71277128
**
@@ -7260,11 +7261,11 @@
72607261
** ^If the resetFlg is true, then the counter is reset to zero after this
72617262
** interface call returns.
72627263
**
72637264
** See also: [sqlite3_status()] and [sqlite3_db_status()].
72647265
*/
7265
-SQLITE_API int SQLITE_APICALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
7266
+SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
72667267
72677268
/*
72687269
** CAPI3REF: Status Parameters for prepared statements
72697270
** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters}
72707271
**
@@ -7496,22 +7497,22 @@
74967497
*/
74977498
typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2;
74987499
struct sqlite3_pcache_methods2 {
74997500
int iVersion;
75007501
void *pArg;
7501
- int (SQLITE_CALLBACK *xInit)(void*);
7502
- void (SQLITE_CALLBACK *xShutdown)(void*);
7503
- sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int szExtra, int bPurgeable);
7504
- void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize);
7505
- int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*);
7506
- sqlite3_pcache_page *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7507
- void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard);
7508
- void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, sqlite3_pcache_page*,
7502
+ int (*xInit)(void*);
7503
+ void (*xShutdown)(void*);
7504
+ sqlite3_pcache *(*xCreate)(int szPage, int szExtra, int bPurgeable);
7505
+ void (*xCachesize)(sqlite3_pcache*, int nCachesize);
7506
+ int (*xPagecount)(sqlite3_pcache*);
7507
+ sqlite3_pcache_page *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7508
+ void (*xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard);
7509
+ void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*,
75097510
unsigned oldKey, unsigned newKey);
7510
- void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit);
7511
- void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*);
7512
- void (SQLITE_CALLBACK *xShrink)(sqlite3_pcache*);
7511
+ void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
7512
+ void (*xDestroy)(sqlite3_pcache*);
7513
+ void (*xShrink)(sqlite3_pcache*);
75137514
};
75147515
75157516
/*
75167517
** This is the obsolete pcache_methods object that has now been replaced
75177518
** by sqlite3_pcache_methods2. This object is not used by SQLite. It is
@@ -7518,20 +7519,20 @@
75187519
** retained in the header file for backwards compatibility only.
75197520
*/
75207521
typedef struct sqlite3_pcache_methods sqlite3_pcache_methods;
75217522
struct sqlite3_pcache_methods {
75227523
void *pArg;
7523
- int (SQLITE_CALLBACK *xInit)(void*);
7524
- void (SQLITE_CALLBACK *xShutdown)(void*);
7525
- sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int bPurgeable);
7526
- void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize);
7527
- int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*);
7528
- void *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7529
- void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, void*, int discard);
7530
- void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey);
7531
- void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit);
7532
- void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*);
7524
+ int (*xInit)(void*);
7525
+ void (*xShutdown)(void*);
7526
+ sqlite3_pcache *(*xCreate)(int szPage, int bPurgeable);
7527
+ void (*xCachesize)(sqlite3_pcache*, int nCachesize);
7528
+ int (*xPagecount)(sqlite3_pcache*);
7529
+ void *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7530
+ void (*xUnpin)(sqlite3_pcache*, void*, int discard);
7531
+ void (*xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey);
7532
+ void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
7533
+ void (*xDestroy)(sqlite3_pcache*);
75337534
};
75347535
75357536
75367537
/*
75377538
** CAPI3REF: Online Backup Object
@@ -7729,20 +7730,20 @@
77297730
** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()
77307731
** APIs are not strictly speaking threadsafe. If they are invoked at the
77317732
** same time as another thread is invoking sqlite3_backup_step() it is
77327733
** possible that they return invalid values.
77337734
*/
7734
-SQLITE_API sqlite3_backup *SQLITE_APICALL sqlite3_backup_init(
7735
+SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
77357736
sqlite3 *pDest, /* Destination database handle */
77367737
const char *zDestName, /* Destination database name */
77377738
sqlite3 *pSource, /* Source database handle */
77387739
const char *zSourceName /* Source database name */
77397740
);
7740
-SQLITE_API int SQLITE_APICALL sqlite3_backup_step(sqlite3_backup *p, int nPage);
7741
-SQLITE_API int SQLITE_APICALL sqlite3_backup_finish(sqlite3_backup *p);
7742
-SQLITE_API int SQLITE_APICALL sqlite3_backup_remaining(sqlite3_backup *p);
7743
-SQLITE_API int SQLITE_APICALL sqlite3_backup_pagecount(sqlite3_backup *p);
7741
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage);
7742
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p);
7743
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p);
7744
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p);
77447745
77457746
/*
77467747
** CAPI3REF: Unlock Notification
77477748
** METHOD: sqlite3
77487749
**
@@ -7855,13 +7856,13 @@
78557856
** by an sqlite3_step() call. ^(If there is a blocking connection, then the
78567857
** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in
78577858
** the special "DROP TABLE/INDEX" case, the extended error code is just
78587859
** SQLITE_LOCKED.)^
78597860
*/
7860
-SQLITE_API int SQLITE_APICALL sqlite3_unlock_notify(
7861
+SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
78617862
sqlite3 *pBlocked, /* Waiting connection */
7862
- void (SQLITE_CALLBACK *xNotify)(void **apArg, int nArg), /* Callback function to invoke */
7863
+ void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */
78637864
void *pNotifyArg /* Argument to pass to xNotify */
78647865
);
78657866
78667867
78677868
/*
@@ -7870,12 +7871,12 @@
78707871
** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications
78717872
** and extensions to compare the contents of two buffers containing UTF-8
78727873
** strings in a case-independent fashion, using the same definition of "case
78737874
** independence" that SQLite uses internally when comparing identifiers.
78747875
*/
7875
-SQLITE_API int SQLITE_APICALL sqlite3_stricmp(const char *, const char *);
7876
-SQLITE_API int SQLITE_APICALL sqlite3_strnicmp(const char *, const char *, int);
7876
+SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *, const char *);
7877
+SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *, const char *, int);
78777878
78787879
/*
78797880
** CAPI3REF: String Globbing
78807881
*
78817882
** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if
@@ -7888,11 +7889,11 @@
78887889
** Note that this routine returns zero on a match and non-zero if the strings
78897890
** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
78907891
**
78917892
** See also: [sqlite3_strlike()].
78927893
*/
7893
-SQLITE_API int SQLITE_APICALL sqlite3_strglob(const char *zGlob, const char *zStr);
7894
+SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlob, const char *zStr);
78947895
78957896
/*
78967897
** CAPI3REF: String LIKE Matching
78977898
*
78987899
** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if
@@ -7911,11 +7912,11 @@
79117912
** Note that this routine returns zero on a match and non-zero if the strings
79127913
** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
79137914
**
79147915
** See also: [sqlite3_strglob()].
79157916
*/
7916
-SQLITE_API int SQLITE_APICALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
7917
+SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
79177918
79187919
/*
79197920
** CAPI3REF: Error Logging Interface
79207921
**
79217922
** ^The [sqlite3_log()] interface writes a message into the [error log]
@@ -7970,13 +7971,13 @@
79707971
** previously registered write-ahead log callback. ^Note that the
79717972
** [sqlite3_wal_autocheckpoint()] interface and the
79727973
** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will
79737974
** overwrite any prior [sqlite3_wal_hook()] settings.
79747975
*/
7975
-SQLITE_API void *SQLITE_APICALL sqlite3_wal_hook(
7976
+SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
79767977
sqlite3*,
7977
- int(SQLITE_CALLBACK *)(void *,sqlite3*,const char*,int),
7978
+ int(*)(void *,sqlite3*,const char*,int),
79787979
void*
79797980
);
79807981
79817982
/*
79827983
** CAPI3REF: Configure an auto-checkpoint
@@ -8005,11 +8006,11 @@
80058006
** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]
80068007
** pages. The use of this interface
80078008
** is only necessary if the default setting is found to be suboptimal
80088009
** for a particular application.
80098010
*/
8010
-SQLITE_API int SQLITE_APICALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
8011
+SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
80118012
80128013
/*
80138014
** CAPI3REF: Checkpoint a database
80148015
** METHOD: sqlite3
80158016
**
@@ -8027,11 +8028,11 @@
80278028
** interface was added. This interface is retained for backwards
80288029
** compatibility and as a convenience for applications that need to manually
80298030
** start a callback but which do not need the full power (and corresponding
80308031
** complication) of [sqlite3_wal_checkpoint_v2()].
80318032
*/
8032
-SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
8033
+SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
80338034
80348035
/*
80358036
** CAPI3REF: Checkpoint a database
80368037
** METHOD: sqlite3
80378038
**
@@ -8121,11 +8122,11 @@
81218122
** [sqlite3_errcode()] and [sqlite3_errmsg()].
81228123
**
81238124
** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface
81248125
** from SQL.
81258126
*/
8126
-SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint_v2(
8127
+SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
81278128
sqlite3 *db, /* Database handle */
81288129
const char *zDb, /* Name of attached database (or NULL) */
81298130
int eMode, /* SQLITE_CHECKPOINT_* value */
81308131
int *pnLog, /* OUT: Size of WAL log in frames */
81318132
int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -8210,11 +8211,11 @@
82108211
** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL],
82118212
** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode
82128213
** of the SQL statement that triggered the call to the [xUpdate] method of the
82138214
** [virtual table].
82148215
*/
8215
-SQLITE_API int SQLITE_APICALL sqlite3_vtab_on_conflict(sqlite3 *);
8216
+SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *);
82168217
82178218
/*
82188219
** CAPI3REF: Conflict resolution modes
82198220
** KEYWORDS: {conflict resolution mode}
82208221
**
@@ -8315,11 +8316,11 @@
83158316
** as if the loop did not exist - it returns non-zero and leave the variable
83168317
** that pOut points to unchanged.
83178318
**
83188319
** See also: [sqlite3_stmt_scanstatus_reset()]
83198320
*/
8320
-SQLITE_API int SQLITE_APICALL sqlite3_stmt_scanstatus(
8321
+SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus(
83218322
sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
83228323
int idx, /* Index of loop to report on */
83238324
int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
83248325
void *pOut /* Result written here */
83258326
);
@@ -8331,11 +8332,11 @@
83318332
** ^Zero all [sqlite3_stmt_scanstatus()] related event counters.
83328333
**
83338334
** This API is only available if the library is built with pre-processor
83348335
** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined.
83358336
*/
8336
-SQLITE_API void SQLITE_APICALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
8337
+SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
83378338
83388339
/*
83398340
** CAPI3REF: Flush caches to disk mid-transaction
83408341
**
83418342
** ^If a write-transaction is open on [database connection] D when the
@@ -8363,11 +8364,11 @@
83638364
** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK.
83648365
**
83658366
** ^This function does not set the database handle error code or message
83668367
** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions.
83678368
*/
8368
-SQLITE_API int SQLITE_APICALL sqlite3_db_cacheflush(sqlite3*);
8369
+SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3*);
83698370
83708371
/*
83718372
** CAPI3REF: The pre-update hook.
83728373
**
83738374
** ^These interfaces are only available if SQLite is compiled using the
@@ -8443,13 +8444,13 @@
84438444
** triggers; or 2 for changes resulting from triggers called by top-level
84448445
** triggers; and so forth.
84458446
**
84468447
** See also: [sqlite3_update_hook()]
84478448
*/
8448
-SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_APICALL sqlite3_preupdate_hook(
8449
+SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_STDCALL sqlite3_preupdate_hook(
84498450
sqlite3 *db,
8450
- void(SQLITE_CALLBACK *xPreUpdate)(
8451
+ void(*xPreUpdate)(
84518452
void *pCtx, /* Copy of third arg to preupdate_hook() */
84528453
sqlite3 *db, /* Database handle */
84538454
int op, /* SQLITE_UPDATE, DELETE or INSERT */
84548455
char const *zDb, /* Database name */
84558456
char const *zName, /* Table name */
@@ -8456,14 +8457,14 @@
84568457
sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */
84578458
sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */
84588459
),
84598460
void*
84608461
);
8461
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **);
8462
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_count(sqlite3 *);
8463
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_depth(sqlite3 *);
8464
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **);
8462
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **);
8463
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *);
8464
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *);
8465
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **);
84658466
84668467
/*
84678468
** CAPI3REF: Low-level system error code
84688469
**
84698470
** ^Attempt to return the underlying operating system error code or error
@@ -8471,11 +8472,11 @@
84718472
** The return value is OS-dependent. For example, on unix systems, after
84728473
** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be
84738474
** called to get back the underlying "errno" that caused the problem, such
84748475
** as ENOSPC, EAUTH, EISDIR, and so forth.
84758476
*/
8476
-SQLITE_API int SQLITE_APICALL sqlite3_system_errno(sqlite3*);
8477
+SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3*);
84778478
84788479
/*
84798480
** CAPI3REF: Database Snapshot
84808481
** KEYWORDS: {snapshot}
84818482
** EXPERIMENTAL
@@ -8521,11 +8522,11 @@
85218522
** to avoid a memory leak.
85228523
**
85238524
** The [sqlite3_snapshot_get()] interface is only available when the
85248525
** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
85258526
*/
8526
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_get(
8527
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_get(
85278528
sqlite3 *db,
85288529
const char *zSchema,
85298530
sqlite3_snapshot **ppSnapshot
85308531
);
85318532
@@ -8559,11 +8560,11 @@
85598560
** database connection in order to make it ready to use snapshots.)
85608561
**
85618562
** The [sqlite3_snapshot_open()] interface is only available when the
85628563
** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
85638564
*/
8564
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_open(
8565
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_open(
85658566
sqlite3 *db,
85668567
const char *zSchema,
85678568
sqlite3_snapshot *pSnapshot
85688569
);
85698570
@@ -8576,11 +8577,11 @@
85768577
** using this routine to avoid a memory leak.
85778578
**
85788579
** The [sqlite3_snapshot_free()] interface is only available when the
85798580
** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
85808581
*/
8581
-SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_APICALL sqlite3_snapshot_free(sqlite3_snapshot*);
8582
+SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot*);
85828583
85838584
/*
85848585
** CAPI3REF: Compare the ages of two snapshot handles.
85858586
** EXPERIMENTAL
85868587
**
@@ -8600,11 +8601,11 @@
86008601
**
86018602
** Otherwise, this API returns a negative value if P1 refers to an older
86028603
** snapshot than P2, zero if the two handles refer to the same database
86038604
** snapshot, and a positive value if P1 is a newer snapshot than P2.
86048605
*/
8605
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_cmp(
8606
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_cmp(
86068607
sqlite3_snapshot *p1,
86078608
sqlite3_snapshot *p2
86088609
);
86098610
86108611
/*
@@ -8658,14 +8659,14 @@
86588659
** Register a geometry callback named zGeom that can be used as part of an
86598660
** R-Tree geometry query as follows:
86608661
**
86618662
** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
86628663
*/
8663
-SQLITE_API int SQLITE_APICALL sqlite3_rtree_geometry_callback(
8664
+SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
86648665
sqlite3 *db,
86658666
const char *zGeom,
8666
- int (SQLITE_CALLBACK *xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
8667
+ int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
86678668
void *pContext
86688669
);
86698670
86708671
86718672
/*
@@ -8675,25 +8676,25 @@
86758676
struct sqlite3_rtree_geometry {
86768677
void *pContext; /* Copy of pContext passed to s_r_g_c() */
86778678
int nParam; /* Size of array aParam[] */
86788679
sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */
86798680
void *pUser; /* Callback implementation user data */
8680
- void (SQLITE_CALLBACK *xDelUser)(void *); /* Called by SQLite to clean up pUser */
8681
+ void (*xDelUser)(void *); /* Called by SQLite to clean up pUser */
86818682
};
86828683
86838684
/*
86848685
** Register a 2nd-generation geometry callback named zScore that can be
86858686
** used as part of an R-Tree geometry query as follows:
86868687
**
86878688
** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...)
86888689
*/
8689
-SQLITE_API int SQLITE_APICALL sqlite3_rtree_query_callback(
8690
+SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
86908691
sqlite3 *db,
86918692
const char *zQueryFunc,
8692
- int (SQLITE_CALLBACK *xQueryFunc)(sqlite3_rtree_query_info*),
8693
+ int (*xQueryFunc)(sqlite3_rtree_query_info*),
86938694
void *pContext,
8694
- void (SQLITE_CALLBACK *xDestructor)(void*)
8695
+ void (*xDestructor)(void*)
86958696
);
86968697
86978698
86988699
/*
86998700
** A pointer to a structure of the following type is passed as the
@@ -8707,11 +8708,11 @@
87078708
struct sqlite3_rtree_query_info {
87088709
void *pContext; /* pContext from when function registered */
87098710
int nParam; /* Number of function parameters */
87108711
sqlite3_rtree_dbl *aParam; /* value of function parameters */
87118712
void *pUser; /* callback can use this, if desired */
8712
- void (SQLITE_CALLBACK *xDelUser)(void*); /* function to free pUser */
8713
+ void (*xDelUser)(void*); /* function to free pUser */
87138714
sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */
87148715
unsigned int *anQueue; /* Number of pending entries in the queue */
87158716
int nCoord; /* Number of coordinates */
87168717
int iLevel; /* Level of current node or entry */
87178718
int mxLevel; /* The largest iLevel value in the tree */
@@ -8903,11 +8904,11 @@
89038904
** If xFilter returns 0, changes is not tracked. Note that once a table is
89048905
** attached, xFilter will not be called again.
89058906
*/
89068907
void sqlite3session_table_filter(
89078908
sqlite3_session *pSession, /* Session object */
8908
- int(SQLITE_CALLBACK *xFilter)(
8909
+ int(*xFilter)(
89098910
void *pCtx, /* Copy of third arg to _filter_table() */
89108911
const char *zTab /* Table name */
89118912
),
89128913
void *pCtx /* First argument passed to xFilter */
89138914
);
@@ -9478,11 +9479,11 @@
94789479
** An sqlite3_changegroup object is used to combine two or more changesets
94799480
** (or patchsets) into a single changeset (or patchset). A single changegroup
94809481
** object may combine changesets or patchsets, but not both. The output is
94819482
** always in the same format as the input.
94829483
**
9483
-** If successful, this function returns SQLITE_OK and populates (SQLITE_CALLBACK *pp) with
9484
+** If successful, this function returns SQLITE_OK and populates (*pp) with
94849485
** a pointer to a new sqlite3_changegroup object before returning. The caller
94859486
** should eventually free the returned object using a call to
94869487
** sqlite3changegroup_delete(). If an error occurs, an SQLite error code
94879488
** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL.
94889489
**
@@ -9598,11 +9599,11 @@
95989599
** changes for tables that do not appear in the first changeset, they are
95999600
** appended onto the end of the output changeset, again in the order in
96009601
** which they are first encountered.
96019602
**
96029603
** If an error occurs, an SQLite error code is returned and the output
9603
-** variables (SQLITE_CALLBACK *pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK
9604
+** variables (*pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK
96049605
** is returned and the output variables are set to the size of and a
96059606
** pointer to the output buffer, respectively. In this case it is the
96069607
** responsibility of the caller to eventually free the buffer using a
96079608
** call to sqlite3_free().
96089609
*/
@@ -9755,15 +9756,15 @@
97559756
*/
97569757
int sqlite3changeset_apply(
97579758
sqlite3 *db, /* Apply change to "main" db of this handle */
97589759
int nChangeset, /* Size of changeset in bytes */
97599760
void *pChangeset, /* Changeset blob */
9760
- int(SQLITE_CALLBACK *xFilter)(
9761
+ int(*xFilter)(
97619762
void *pCtx, /* Copy of sixth arg to _apply() */
97629763
const char *zTab /* Table name */
97639764
),
9764
- int(SQLITE_CALLBACK *xConflict)(
9765
+ int(*xConflict)(
97659766
void *pCtx, /* Copy of sixth arg to _apply() */
97669767
int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
97679768
sqlite3_changeset_iter *p /* Handle describing change and conflict */
97689769
),
97699770
void *pCtx /* First argument passed to xConflict */
@@ -9900,20 +9901,20 @@
99009901
** </pre>
99019902
**
99029903
** Is replaced by:
99039904
**
99049905
** <pre>
9905
-** &nbsp; int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
9906
+** &nbsp; int (*xInput)(void *pIn, void *pData, int *pnData),
99069907
** &nbsp; void *pIn,
99079908
** </pre>
99089909
**
99099910
** Each time the xInput callback is invoked by the sessions module, the first
99109911
** argument passed is a copy of the supplied pIn context pointer. The second
9911
-** argument, pData, points to a buffer (SQLITE_CALLBACK *pnData) bytes in size. Assuming no
9912
-** error occurs the xInput method should copy up to (SQLITE_CALLBACK *pnData) bytes of data
9913
-** into the buffer and set (SQLITE_CALLBACK *pnData) to the actual number of bytes copied
9914
-** before returning SQLITE_OK. If the input is completely exhausted, (SQLITE_CALLBACK *pnData)
9912
+** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no
9913
+** error occurs the xInput method should copy up to (*pnData) bytes of data
9914
+** into the buffer and set (*pnData) to the actual number of bytes copied
9915
+** before returning SQLITE_OK. If the input is completely exhausted, (*pnData)
99159916
** should be set to zero to indicate this. Or, if an error occurs, an SQLite
99169917
** error code should be returned. In all cases, if an xInput callback returns
99179918
** an error, all processing is abandoned and the streaming API function
99189919
** returns a copy of the error code to the caller.
99199920
**
@@ -9934,11 +9935,11 @@
99349935
** </pre>
99359936
**
99369937
** Is replaced by:
99379938
**
99389939
** <pre>
9939
-** &nbsp; int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9940
+** &nbsp; int (*xOutput)(void *pOut, const void *pData, int nData),
99409941
** &nbsp; void *pOut
99419942
** </pre>
99429943
**
99439944
** The xOutput callback is invoked zero or more times to return data to
99449945
** the application. The first parameter passed to each call is a copy of the
@@ -9954,58 +9955,58 @@
99549955
** parameter set to a value less than or equal to zero. Other than this,
99559956
** no guarantees are made as to the size of the chunks of data returned.
99569957
*/
99579958
int sqlite3changeset_apply_strm(
99589959
sqlite3 *db, /* Apply change to "main" db of this handle */
9959
- int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), /* Input function */
9960
+ int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
99609961
void *pIn, /* First arg for xInput */
9961
- int(SQLITE_CALLBACK *xFilter)(
9962
+ int(*xFilter)(
99629963
void *pCtx, /* Copy of sixth arg to _apply() */
99639964
const char *zTab /* Table name */
99649965
),
9965
- int(SQLITE_CALLBACK *xConflict)(
9966
+ int(*xConflict)(
99669967
void *pCtx, /* Copy of sixth arg to _apply() */
99679968
int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
99689969
sqlite3_changeset_iter *p /* Handle describing change and conflict */
99699970
),
99709971
void *pCtx /* First argument passed to xConflict */
99719972
);
99729973
int sqlite3changeset_concat_strm(
9973
- int (SQLITE_CALLBACK *xInputA)(void *pIn, void *pData, int *pnData),
9974
+ int (*xInputA)(void *pIn, void *pData, int *pnData),
99749975
void *pInA,
9975
- int (SQLITE_CALLBACK *xInputB)(void *pIn, void *pData, int *pnData),
9976
+ int (*xInputB)(void *pIn, void *pData, int *pnData),
99769977
void *pInB,
9977
- int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9978
+ int (*xOutput)(void *pOut, const void *pData, int nData),
99789979
void *pOut
99799980
);
99809981
int sqlite3changeset_invert_strm(
9981
- int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
9982
+ int (*xInput)(void *pIn, void *pData, int *pnData),
99829983
void *pIn,
9983
- int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9984
+ int (*xOutput)(void *pOut, const void *pData, int nData),
99849985
void *pOut
99859986
);
99869987
int sqlite3changeset_start_strm(
99879988
sqlite3_changeset_iter **pp,
9988
- int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
9989
+ int (*xInput)(void *pIn, void *pData, int *pnData),
99899990
void *pIn
99909991
);
99919992
int sqlite3session_changeset_strm(
99929993
sqlite3_session *pSession,
9993
- int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9994
+ int (*xOutput)(void *pOut, const void *pData, int nData),
99949995
void *pOut
99959996
);
99969997
int sqlite3session_patchset_strm(
99979998
sqlite3_session *pSession,
9998
- int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9999
+ int (*xOutput)(void *pOut, const void *pData, int nData),
999910000
void *pOut
1000010001
);
1000110002
int sqlite3changegroup_add_strm(sqlite3_changegroup*,
10002
- int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
10003
+ int (*xInput)(void *pIn, void *pData, int *pnData),
1000310004
void *pIn
1000410005
);
1000510006
int sqlite3changegroup_output_strm(sqlite3_changegroup*,
10006
- int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
10007
+ int (*xOutput)(void *pOut, const void *pData, int nData),
1000710008
void *pOut
1000810009
);
1000910010
1001010011
1001110012
/*
@@ -10056,11 +10057,11 @@
1005610057
1005710058
typedef struct Fts5ExtensionApi Fts5ExtensionApi;
1005810059
typedef struct Fts5Context Fts5Context;
1005910060
typedef struct Fts5PhraseIter Fts5PhraseIter;
1006010061
10061
-typedef void (SQLITE_CALLBACK *fts5_extension_function)(
10062
+typedef void (*fts5_extension_function)(
1006210063
const Fts5ExtensionApi *pApi, /* API offered by current FTS version */
1006310064
Fts5Context *pFts, /* First arg to pass to pApi functions */
1006410065
sqlite3_context *pCtx, /* Context for returning result/error */
1006510066
int nVal, /* Number of values in apVal[] array */
1006610067
sqlite3_value **apVal /* Array of trailing arguments */
@@ -10107,15 +10108,15 @@
1010710108
** This function may be quite inefficient if used with an FTS5 table
1010810109
** created with the "columnsize=0" option.
1010910110
**
1011010111
** xColumnText:
1011110112
** This function attempts to retrieve the text of column iCol of the
10112
-** current document. If successful, (SQLITE_CALLBACK *pz) is set to point to a buffer
10113
-** containing the text in utf-8 encoding, (SQLITE_CALLBACK *pn) is set to the size in bytes
10113
+** current document. If successful, (*pz) is set to point to a buffer
10114
+** containing the text in utf-8 encoding, (*pn) is set to the size in bytes
1011410115
** (not characters) of the buffer and SQLITE_OK is returned. Otherwise,
1011510116
** if an error occurs, an SQLite error code is returned and the final values
10116
-** of (SQLITE_CALLBACK *pz) and (*pn) are undefined.
10117
+** of (*pz) and (*pn) are undefined.
1011710118
**
1011810119
** xPhraseCount:
1011910120
** Returns the number of phrases in the current query expression.
1012010121
**
1012110122
** xPhraseSize:
@@ -10220,11 +10221,11 @@
1022010221
** xRowCount(pFts5, pnRow)
1022110222
**
1022210223
** This function is used to retrieve the total number of rows in the table.
1022310224
** In other words, the same value that would be returned by:
1022410225
**
10225
-** SELECT count(SQLITE_CALLBACK *) FROM ftstable;
10226
+** SELECT count(*) FROM ftstable;
1022610227
**
1022710228
** xPhraseFirst()
1022810229
** This function is used, along with type Fts5PhraseIter and the xPhraseNext
1022910230
** method, to iterate through all instances of a single query phrase within
1023010231
** the current row. This is the same information as is accessible via the
@@ -10287,43 +10288,43 @@
1028710288
** See xPhraseFirstColumn above.
1028810289
*/
1028910290
struct Fts5ExtensionApi {
1029010291
int iVersion; /* Currently always set to 3 */
1029110292
10292
- void *(SQLITE_CALLBACK *xUserData)(Fts5Context*);
10293
+ void *(*xUserData)(Fts5Context*);
1029310294
10294
- int (SQLITE_CALLBACK *xColumnCount)(Fts5Context*);
10295
- int (SQLITE_CALLBACK *xRowCount)(Fts5Context*, sqlite3_int64 *pnRow);
10296
- int (SQLITE_CALLBACK *xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken);
10295
+ int (*xColumnCount)(Fts5Context*);
10296
+ int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow);
10297
+ int (*xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken);
1029710298
10298
- int (SQLITE_CALLBACK *xTokenize)(Fts5Context*,
10299
+ int (*xTokenize)(Fts5Context*,
1029910300
const char *pText, int nText, /* Text to tokenize */
1030010301
void *pCtx, /* Context passed to xToken() */
10301
- int (SQLITE_CALLBACK *xToken)(void*, int, const char*, int, int, int) /* Callback */
10302
- );
10303
-
10304
- int (SQLITE_CALLBACK *xPhraseCount)(Fts5Context*);
10305
- int (SQLITE_CALLBACK *xPhraseSize)(Fts5Context*, int iPhrase);
10306
-
10307
- int (SQLITE_CALLBACK *xInstCount)(Fts5Context*, int *pnInst);
10308
- int (SQLITE_CALLBACK *xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff);
10309
-
10310
- sqlite3_int64 (SQLITE_CALLBACK *xRowid)(Fts5Context*);
10311
- int (SQLITE_CALLBACK *xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn);
10312
- int (SQLITE_CALLBACK *xColumnSize)(Fts5Context*, int iCol, int *pnToken);
10313
-
10314
- int (SQLITE_CALLBACK *xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData,
10315
- int(SQLITE_CALLBACK *)(const Fts5ExtensionApi*,Fts5Context*,void*)
10316
- );
10317
- int (SQLITE_CALLBACK *xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*));
10318
- void *(SQLITE_CALLBACK *xGetAuxdata)(Fts5Context*, int bClear);
10319
-
10320
- int (SQLITE_CALLBACK *xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*);
10321
- void (SQLITE_CALLBACK *xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff);
10322
-
10323
- int (SQLITE_CALLBACK *xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*);
10324
- void (SQLITE_CALLBACK *xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol);
10302
+ int (*xToken)(void*, int, const char*, int, int, int) /* Callback */
10303
+ );
10304
+
10305
+ int (*xPhraseCount)(Fts5Context*);
10306
+ int (*xPhraseSize)(Fts5Context*, int iPhrase);
10307
+
10308
+ int (*xInstCount)(Fts5Context*, int *pnInst);
10309
+ int (*xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff);
10310
+
10311
+ sqlite3_int64 (*xRowid)(Fts5Context*);
10312
+ int (*xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn);
10313
+ int (*xColumnSize)(Fts5Context*, int iCol, int *pnToken);
10314
+
10315
+ int (*xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData,
10316
+ int(*)(const Fts5ExtensionApi*,Fts5Context*,void*)
10317
+ );
10318
+ int (*xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*));
10319
+ void *(*xGetAuxdata)(Fts5Context*, int bClear);
10320
+
10321
+ int (*xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*);
10322
+ void (*xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff);
10323
+
10324
+ int (*xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*);
10325
+ void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol);
1032510326
};
1032610327
1032710328
/*
1032810329
** CUSTOM AUXILIARY FUNCTIONS
1032910330
*************************************************************************/
@@ -10347,11 +10348,11 @@
1034710348
** The second and third arguments are an array of nul-terminated strings
1034810349
** containing the tokenizer arguments, if any, specified following the
1034910350
** tokenizer name as part of the CREATE VIRTUAL TABLE statement used
1035010351
** to create the FTS5 table.
1035110352
**
10352
-** The final argument is an output variable. If successful, (SQLITE_CALLBACK *ppOut)
10353
+** The final argument is an output variable. If successful, (*ppOut)
1035310354
** should be set to point to the new tokenizer handle and SQLITE_OK
1035410355
** returned. If an error occurs, some value other than SQLITE_OK should
1035510356
** be returned. In this case, fts5 assumes that the final value of *ppOut
1035610357
** is undefined.
1035710358
**
@@ -10521,17 +10522,17 @@
1052110522
** inefficient.
1052210523
*/
1052310524
typedef struct Fts5Tokenizer Fts5Tokenizer;
1052410525
typedef struct fts5_tokenizer fts5_tokenizer;
1052510526
struct fts5_tokenizer {
10526
- int (SQLITE_CALLBACK *xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
10527
- void (SQLITE_CALLBACK *xDelete)(Fts5Tokenizer*);
10528
- int (SQLITE_CALLBACK *xTokenize)(Fts5Tokenizer*,
10527
+ int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
10528
+ void (*xDelete)(Fts5Tokenizer*);
10529
+ int (*xTokenize)(Fts5Tokenizer*,
1052910530
void *pCtx,
1053010531
int flags, /* Mask of FTS5_TOKENIZE_* flags */
1053110532
const char *pText, int nText,
10532
- int (SQLITE_CALLBACK *xToken)(
10533
+ int (*xToken)(
1053310534
void *pCtx, /* Copy of 2nd argument to xTokenize() */
1053410535
int tflags, /* Mask of FTS5_TOKEN_* flags */
1053510536
const char *pToken, /* Pointer to buffer containing token */
1053610537
int nToken, /* Size of token in bytes */
1053710538
int iStart, /* Byte offset of token within input text */
@@ -10560,33 +10561,33 @@
1056010561
typedef struct fts5_api fts5_api;
1056110562
struct fts5_api {
1056210563
int iVersion; /* Currently always set to 2 */
1056310564
1056410565
/* Create a new tokenizer */
10565
- int (SQLITE_CALLBACK *xCreateTokenizer)(
10566
+ int (*xCreateTokenizer)(
1056610567
fts5_api *pApi,
1056710568
const char *zName,
1056810569
void *pContext,
1056910570
fts5_tokenizer *pTokenizer,
10570
- void (SQLITE_CALLBACK *xDestroy)(void*)
10571
+ void (*xDestroy)(void*)
1057110572
);
1057210573
1057310574
/* Find an existing tokenizer */
10574
- int (SQLITE_CALLBACK *xFindTokenizer)(
10575
+ int (*xFindTokenizer)(
1057510576
fts5_api *pApi,
1057610577
const char *zName,
1057710578
void **ppContext,
1057810579
fts5_tokenizer *pTokenizer
1057910580
);
1058010581
1058110582
/* Create a new auxiliary function */
10582
- int (SQLITE_CALLBACK *xCreateFunction)(
10583
+ int (*xCreateFunction)(
1058310584
fts5_api *pApi,
1058410585
const char *zName,
1058510586
void *pContext,
1058610587
fts5_extension_function xFunction,
10587
- void (SQLITE_CALLBACK *xDestroy)(void*)
10588
+ void (*xDestroy)(void*)
1058810589
);
1058910590
};
1059010591
1059110592
/*
1059210593
** END OF REGISTRATION API
@@ -11900,12 +11901,12 @@
1190011901
*/
1190111902
#ifdef SQLITE_OMIT_WSD
1190211903
#define SQLITE_WSD const
1190311904
#define GLOBAL(t,v) (*(t*)sqlite3_wsd_find((void*)&(v), sizeof(v)))
1190411905
#define sqlite3GlobalConfig GLOBAL(struct Sqlite3Config, sqlite3Config)
11905
-SQLITE_API int SQLITE_APICALL sqlite3_wsd_init(int N, int J);
11906
-SQLITE_API void *SQLITE_APICALL sqlite3_wsd_find(void *K, int L);
11906
+SQLITE_API int SQLITE_STDCALL sqlite3_wsd_init(int N, int J);
11907
+SQLITE_API void *SQLITE_STDCALL sqlite3_wsd_find(void *K, int L);
1190711908
#else
1190811909
#define SQLITE_WSD
1190911910
#define GLOBAL(t,v) v
1191011911
#define sqlite3GlobalConfig sqlite3Config
1191111912
#endif
@@ -17560,11 +17561,11 @@
1756017561
** was used and false if not.
1756117562
**
1756217563
** The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix
1756317564
** is not required for a match.
1756417565
*/
17565
-SQLITE_API int SQLITE_APICALL sqlite3_compileoption_used(const char *zOptName){
17566
+SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName){
1756617567
int i, n;
1756717568
1756817569
#if SQLITE_ENABLE_API_ARMOR
1756917570
if( zOptName==0 ){
1757017571
(void)SQLITE_MISUSE_BKPT;
@@ -17588,11 +17589,11 @@
1758817589
1758917590
/*
1759017591
** Return the N-th compile-time option string. If N is out of range,
1759117592
** return a NULL pointer.
1759217593
*/
17593
-SQLITE_API const char *SQLITE_APICALL sqlite3_compileoption_get(int N){
17594
+SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N){
1759417595
if( N>=0 && N<ArraySize(azCompileOpt) ){
1759517596
return azCompileOpt[N];
1759617597
}
1759717598
return 0;
1759817599
}
@@ -18298,11 +18299,11 @@
1829818299
}
1829918300
1830018301
/*
1830118302
** Query status information.
1830218303
*/
18303
-SQLITE_API int SQLITE_APICALL sqlite3_status64(
18304
+SQLITE_API int SQLITE_STDCALL sqlite3_status64(
1830418305
int op,
1830518306
sqlite3_int64 *pCurrent,
1830618307
sqlite3_int64 *pHighwater,
1830718308
int resetFlag
1830818309
){
@@ -18323,11 +18324,11 @@
1832318324
}
1832418325
sqlite3_mutex_leave(pMutex);
1832518326
(void)pMutex; /* Prevent warning when SQLITE_THREADSAFE=0 */
1832618327
return SQLITE_OK;
1832718328
}
18328
-SQLITE_API int SQLITE_APICALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){
18329
+SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){
1832918330
sqlite3_int64 iCur = 0, iHwtr = 0;
1833018331
int rc;
1833118332
#ifdef SQLITE_ENABLE_API_ARMOR
1833218333
if( pCurrent==0 || pHighwater==0 ) return SQLITE_MISUSE_BKPT;
1833318334
#endif
@@ -18340,11 +18341,11 @@
1834018341
}
1834118342
1834218343
/*
1834318344
** Query status information for a single database connection
1834418345
*/
18345
-SQLITE_API int SQLITE_APICALL sqlite3_db_status(
18346
+SQLITE_API int SQLITE_STDCALL sqlite3_db_status(
1834618347
sqlite3 *db, /* The database connection whose status is desired */
1834718348
int op, /* Status verb */
1834818349
int *pCurrent, /* Write current value here */
1834918350
int *pHighwater, /* Write high-water mark here */
1835018351
int resetFlag /* Reset high-water mark if true */
@@ -19632,11 +19633,10 @@
1963219633
int argc,
1963319634
sqlite3_value **argv
1963419635
){
1963519636
time_t t;
1963619637
char *zFormat = (char *)sqlite3_user_data(context);
19637
- sqlite3 *db;
1963819638
sqlite3_int64 iT;
1963919639
struct tm *pTm;
1964019640
struct tm sNow;
1964119641
char zBuf[20];
1964219642
@@ -20018,11 +20018,11 @@
2001820018
2001920019
/*
2002020020
** Locate a VFS by name. If no name is given, simply return the
2002120021
** first VFS on the list.
2002220022
*/
20023
-SQLITE_API sqlite3_vfs *SQLITE_APICALL sqlite3_vfs_find(const char *zVfs){
20023
+SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfs){
2002420024
sqlite3_vfs *pVfs = 0;
2002520025
#if SQLITE_THREADSAFE
2002620026
sqlite3_mutex *mutex;
2002720027
#endif
2002820028
#ifndef SQLITE_OMIT_AUTOINIT
@@ -20064,11 +20064,11 @@
2006420064
/*
2006520065
** Register a VFS with the system. It is harmless to register the same
2006620066
** VFS multiple times. The new VFS becomes the default if makeDflt is
2006720067
** true.
2006820068
*/
20069
-SQLITE_API int SQLITE_APICALL sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){
20069
+SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){
2007020070
MUTEX_LOGIC(sqlite3_mutex *mutex;)
2007120071
#ifndef SQLITE_OMIT_AUTOINIT
2007220072
int rc = sqlite3_initialize();
2007320073
if( rc ) return rc;
2007420074
#endif
@@ -20092,11 +20092,11 @@
2009220092
}
2009320093
2009420094
/*
2009520095
** Unregister a VFS so that it is no longer accessible.
2009620096
*/
20097
-SQLITE_API int SQLITE_APICALL sqlite3_vfs_unregister(sqlite3_vfs *pVfs){
20097
+SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs *pVfs){
2009820098
#if SQLITE_THREADSAFE
2009920099
sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
2010020100
#endif
2010120101
sqlite3_mutex_enter(mutex);
2010220102
vfsUnlink(pVfs);
@@ -22443,11 +22443,11 @@
2244322443
}
2244422444
2244522445
/*
2244622446
** Retrieve a pointer to a static mutex or allocate a new dynamic one.
2244722447
*/
22448
-SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_mutex_alloc(int id){
22448
+SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int id){
2244922449
#ifndef SQLITE_OMIT_AUTOINIT
2245022450
if( id<=SQLITE_MUTEX_RECURSIVE && sqlite3_initialize() ) return 0;
2245122451
if( id>SQLITE_MUTEX_RECURSIVE && sqlite3MutexInit() ) return 0;
2245222452
#endif
2245322453
assert( sqlite3GlobalConfig.mutex.xMutexAlloc );
@@ -22464,11 +22464,11 @@
2246422464
}
2246522465
2246622466
/*
2246722467
** Free a dynamic mutex.
2246822468
*/
22469
-SQLITE_API void SQLITE_APICALL sqlite3_mutex_free(sqlite3_mutex *p){
22469
+SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex *p){
2247022470
if( p ){
2247122471
assert( sqlite3GlobalConfig.mutex.xMutexFree );
2247222472
sqlite3GlobalConfig.mutex.xMutexFree(p);
2247322473
}
2247422474
}
@@ -22475,11 +22475,11 @@
2247522475
2247622476
/*
2247722477
** Obtain the mutex p. If some other thread already has the mutex, block
2247822478
** until it can be obtained.
2247922479
*/
22480
-SQLITE_API void SQLITE_APICALL sqlite3_mutex_enter(sqlite3_mutex *p){
22480
+SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex *p){
2248122481
if( p ){
2248222482
assert( sqlite3GlobalConfig.mutex.xMutexEnter );
2248322483
sqlite3GlobalConfig.mutex.xMutexEnter(p);
2248422484
}
2248522485
}
@@ -22486,11 +22486,11 @@
2248622486
2248722487
/*
2248822488
** Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another
2248922489
** thread holds the mutex and it cannot be obtained, return SQLITE_BUSY.
2249022490
*/
22491
-SQLITE_API int SQLITE_APICALL sqlite3_mutex_try(sqlite3_mutex *p){
22491
+SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex *p){
2249222492
int rc = SQLITE_OK;
2249322493
if( p ){
2249422494
assert( sqlite3GlobalConfig.mutex.xMutexTry );
2249522495
return sqlite3GlobalConfig.mutex.xMutexTry(p);
2249622496
}
@@ -22501,11 +22501,11 @@
2250122501
** The sqlite3_mutex_leave() routine exits a mutex that was previously
2250222502
** entered by the same thread. The behavior is undefined if the mutex
2250322503
** is not currently entered. If a NULL pointer is passed as an argument
2250422504
** this function is a no-op.
2250522505
*/
22506
-SQLITE_API void SQLITE_APICALL sqlite3_mutex_leave(sqlite3_mutex *p){
22506
+SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex *p){
2250722507
if( p ){
2250822508
assert( sqlite3GlobalConfig.mutex.xMutexLeave );
2250922509
sqlite3GlobalConfig.mutex.xMutexLeave(p);
2251022510
}
2251122511
}
@@ -22513,15 +22513,15 @@
2251322513
#ifndef NDEBUG
2251422514
/*
2251522515
** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are
2251622516
** intended for use inside assert() statements.
2251722517
*/
22518
-SQLITE_API int SQLITE_APICALL sqlite3_mutex_held(sqlite3_mutex *p){
22518
+SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex *p){
2251922519
assert( p==0 || sqlite3GlobalConfig.mutex.xMutexHeld );
2252022520
return p==0 || sqlite3GlobalConfig.mutex.xMutexHeld(p);
2252122521
}
22522
-SQLITE_API int SQLITE_APICALL sqlite3_mutex_notheld(sqlite3_mutex *p){
22522
+SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex *p){
2252322523
assert( p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld );
2252422524
return p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld(p);
2252522525
}
2252622526
#endif
2252722527
@@ -23549,12 +23549,12 @@
2354923549
** of the sqlite3_initialize() and sqlite3_shutdown() processing, the
2355023550
** "interlocked" magic used here is probably not strictly necessary.
2355123551
*/
2355223552
static LONG SQLITE_WIN32_VOLATILE winMutex_lock = 0;
2355323553
23554
-SQLITE_API int SQLITE_APICALL sqlite3_win32_is_nt(void); /* os_win.c */
23555
-SQLITE_API void SQLITE_APICALL sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */
23554
+SQLITE_API int SQLITE_STDCALL sqlite3_win32_is_nt(void); /* os_win.c */
23555
+SQLITE_API void SQLITE_STDCALL sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */
2355623556
2355723557
static int winMutexInit(void){
2355823558
/* The first to increment to 1 does actual initialization */
2355923559
if( InterlockedCompareExchange(&winMutex_lock, 1, 0)==0 ){
2356023560
int i;
@@ -23850,11 +23850,11 @@
2385023850
/*
2385123851
** Attempt to release up to n bytes of non-essential memory currently
2385223852
** held by SQLite. An example of non-essential memory is memory used to
2385323853
** cache database pages that are not currently in use.
2385423854
*/
23855
-SQLITE_API int SQLITE_APICALL sqlite3_release_memory(int n){
23855
+SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int n){
2385623856
#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
2385723857
return sqlite3PcacheReleaseMemory(n);
2385823858
#else
2385923859
/* IMPLEMENTATION-OF: R-34391-24921 The sqlite3_release_memory() routine
2386023860
** is a no-op returning zero if SQLite is not compiled with
@@ -23909,11 +23909,11 @@
2390923909
/*
2391023910
** Deprecated external interface. It used to set an alarm callback
2391123911
** that was invoked when memory usage grew too large. Now it is a
2391223912
** no-op.
2391323913
*/
23914
-SQLITE_API int SQLITE_APICALL sqlite3_memory_alarm(
23914
+SQLITE_API int SQLITE_STDCALL sqlite3_memory_alarm(
2391523915
void(*xCallback)(void *pArg, sqlite3_int64 used,int N),
2391623916
void *pArg,
2391723917
sqlite3_int64 iThreshold
2391823918
){
2391923919
(void)xCallback;
@@ -23925,11 +23925,11 @@
2392523925
2392623926
/*
2392723927
** Set the soft heap-size limit for the library. Passing a zero or
2392823928
** negative value indicates no limit.
2392923929
*/
23930
-SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_soft_heap_limit64(sqlite3_int64 n){
23930
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 n){
2393123931
sqlite3_int64 priorLimit;
2393223932
sqlite3_int64 excess;
2393323933
sqlite3_int64 nUsed;
2393423934
#ifndef SQLITE_OMIT_AUTOINIT
2393523935
int rc = sqlite3_initialize();
@@ -23947,11 +23947,11 @@
2394723947
sqlite3_mutex_leave(mem0.mutex);
2394823948
excess = sqlite3_memory_used() - n;
2394923949
if( excess>0 ) sqlite3_release_memory((int)(excess & 0x7fffffff));
2395023950
return priorLimit;
2395123951
}
23952
-SQLITE_API void SQLITE_APICALL sqlite3_soft_heap_limit(int n){
23952
+SQLITE_API void SQLITE_STDCALL sqlite3_soft_heap_limit(int n){
2395323953
if( n<0 ) n = 0;
2395423954
sqlite3_soft_heap_limit64(n);
2395523955
}
2395623956
2395723957
/*
@@ -24016,11 +24016,11 @@
2401624016
}
2401724017
2401824018
/*
2401924019
** Return the amount of memory currently checked out.
2402024020
*/
24021
-SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_used(void){
24021
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void){
2402224022
sqlite3_int64 res, mx;
2402324023
sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, 0);
2402424024
return res;
2402524025
}
2402624026
@@ -24027,11 +24027,11 @@
2402724027
/*
2402824028
** Return the maximum amount of memory that has ever been
2402924029
** checked out since either the beginning of this process
2403024030
** or since the most recent reset.
2403124031
*/
24032
-SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_highwater(int resetFlag){
24032
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag){
2403324033
sqlite3_int64 res, mx;
2403424034
sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, resetFlag);
2403524035
return mx;
2403624036
}
2403724037
@@ -24107,17 +24107,17 @@
2410724107
/*
2410824108
** This version of the memory allocation is for use by the application.
2410924109
** First make sure the memory subsystem is initialized, then do the
2411024110
** allocation.
2411124111
*/
24112
-SQLITE_API void *SQLITE_APICALL sqlite3_malloc(int n){
24112
+SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int n){
2411324113
#ifndef SQLITE_OMIT_AUTOINIT
2411424114
if( sqlite3_initialize() ) return 0;
2411524115
#endif
2411624116
return n<=0 ? 0 : sqlite3Malloc(n);
2411724117
}
24118
-SQLITE_API void *SQLITE_APICALL sqlite3_malloc64(sqlite3_uint64 n){
24118
+SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64 n){
2411924119
#ifndef SQLITE_OMIT_AUTOINIT
2412024120
if( sqlite3_initialize() ) return 0;
2412124121
#endif
2412224122
return sqlite3Malloc(n);
2412324123
}
@@ -24256,20 +24256,20 @@
2425624256
}else{
2425724257
assert( sqlite3_mutex_held(db->mutex) );
2425824258
return db->lookaside.sz;
2425924259
}
2426024260
}
24261
-SQLITE_API sqlite3_uint64 SQLITE_APICALL sqlite3_msize(void *p){
24261
+SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void *p){
2426224262
assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) );
2426324263
assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
2426424264
return p ? sqlite3GlobalConfig.m.xSize(p) : 0;
2426524265
}
2426624266
2426724267
/*
2426824268
** Free memory previously obtained from sqlite3Malloc().
2426924269
*/
24270
-SQLITE_API void SQLITE_APICALL sqlite3_free(void *p){
24270
+SQLITE_API void SQLITE_STDCALL sqlite3_free(void *p){
2427124271
if( p==0 ) return; /* IMP: R-49053-54554 */
2427224272
assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
2427324273
assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) );
2427424274
if( sqlite3GlobalConfig.bMemstat ){
2427524275
sqlite3_mutex_enter(mem0.mutex);
@@ -24374,18 +24374,18 @@
2437424374
2437524375
/*
2437624376
** The public interface to sqlite3Realloc. Make sure that the memory
2437724377
** subsystem is initialized prior to invoking sqliteRealloc.
2437824378
*/
24379
-SQLITE_API void *SQLITE_APICALL sqlite3_realloc(void *pOld, int n){
24379
+SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void *pOld, int n){
2438024380
#ifndef SQLITE_OMIT_AUTOINIT
2438124381
if( sqlite3_initialize() ) return 0;
2438224382
#endif
2438324383
if( n<0 ) n = 0; /* IMP: R-26507-47431 */
2438424384
return sqlite3Realloc(pOld, n);
2438524385
}
24386
-SQLITE_API void *SQLITE_APICALL sqlite3_realloc64(void *pOld, sqlite3_uint64 n){
24386
+SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void *pOld, sqlite3_uint64 n){
2438724387
#ifndef SQLITE_OMIT_AUTOINIT
2438824388
if( sqlite3_initialize() ) return 0;
2438924389
#endif
2439024390
return sqlite3Realloc(pOld, n);
2439124391
}
@@ -25608,11 +25608,11 @@
2560825608
2560925609
/*
2561025610
** Print into memory obtained from sqlite3_malloc(). Omit the internal
2561125611
** %-conversion extensions.
2561225612
*/
25613
-SQLITE_API char *SQLITE_APICALL sqlite3_vmprintf(const char *zFormat, va_list ap){
25613
+SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char *zFormat, va_list ap){
2561425614
char *z;
2561525615
char zBase[SQLITE_PRINT_BUF_SIZE];
2561625616
StrAccum acc;
2561725617
2561825618
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -25657,11 +25657,11 @@
2565725657
** this without breaking compatibility, so we just have to live with the
2565825658
** mistake.
2565925659
**
2566025660
** sqlite3_vsnprintf() is the varargs version.
2566125661
*/
25662
-SQLITE_API char *SQLITE_APICALL sqlite3_vsnprintf(int n, char *zBuf, const char *zFormat, va_list ap){
25662
+SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int n, char *zBuf, const char *zFormat, va_list ap){
2566325663
StrAccum acc;
2566425664
if( n<=0 ) return zBuf;
2566525665
#ifdef SQLITE_ENABLE_API_ARMOR
2566625666
if( zBuf==0 || zFormat==0 ) {
2566725667
(void)SQLITE_MISUSE_BKPT;
@@ -26284,11 +26284,11 @@
2628426284
} sqlite3Prng;
2628526285
2628626286
/*
2628726287
** Return N random bytes.
2628826288
*/
26289
-SQLITE_API void SQLITE_APICALL sqlite3_randomness(int N, void *pBuf){
26289
+SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *pBuf){
2629026290
unsigned char t;
2629126291
unsigned char *zBuf = pBuf;
2629226292
2629326293
/* The "wsdPrng" macro will resolve to the pseudo-random number generator
2629426294
** state vector. If writable static data is unsupported on the target,
@@ -27487,11 +27487,11 @@
2748727487
** sqlite3_strnicmp() APIs allow applications and extensions to compare
2748827488
** the contents of two buffers containing UTF-8 strings in a
2748927489
** case-independent fashion, using the same definition of "case
2749027490
** independence" that SQLite uses internally when comparing identifiers.
2749127491
*/
27492
-SQLITE_API int SQLITE_APICALL sqlite3_stricmp(const char *zLeft, const char *zRight){
27492
+SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *zLeft, const char *zRight){
2749327493
if( zLeft==0 ){
2749427494
return zRight ? -1 : 0;
2749527495
}else if( zRight==0 ){
2749627496
return 1;
2749727497
}
@@ -27508,11 +27508,11 @@
2750827508
a++;
2750927509
b++;
2751027510
}
2751127511
return c;
2751227512
}
27513
-SQLITE_API int SQLITE_APICALL sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){
27513
+SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){
2751427514
register unsigned char *a, *b;
2751527515
if( zLeft==0 ){
2751627516
return zRight ? -1 : 0;
2751727517
}else if( zRight==0 ){
2751827518
return 1;
@@ -36807,11 +36807,11 @@
3680736807
** This routine is called once during SQLite initialization and by a
3680836808
** single thread. The memory allocation and mutex subsystems have not
3680936809
** necessarily been initialized when this routine is called, and so they
3681036810
** should not be used.
3681136811
*/
36812
-SQLITE_API int SQLITE_APICALL sqlite3_os_init(void){
36812
+SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void){
3681336813
/*
3681436814
** The following macro defines an initializer for an sqlite3_vfs object.
3681536815
** The name of the VFS is NAME. The pAppData is a pointer to a pointer
3681636816
** to the "finder" function. (pAppData is a pointer to a pointer because
3681736817
** silly C90 rules prohibit a void* from being cast to a function pointer
@@ -36906,11 +36906,11 @@
3690636906
**
3690736907
** Some operating systems might need to do some cleanup in this routine,
3690836908
** to release dynamically allocated objects. But not on unix.
3690936909
** This routine is a no-op for unix.
3691036910
*/
36911
-SQLITE_API int SQLITE_APICALL sqlite3_os_end(void){
36911
+SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void){
3691236912
return SQLITE_OK;
3691336913
}
3691436914
3691536915
#endif /* SQLITE_OS_UNIX */
3691636916
@@ -38341,11 +38341,11 @@
3834138341
** compact it. Upon success, SQLITE_OK will be returned. Upon failure, one
3834238342
** of SQLITE_NOMEM, SQLITE_ERROR, or SQLITE_NOTFOUND will be returned. The
3834338343
** "pnLargest" argument, if non-zero, will be used to return the size of the
3834438344
** largest committed free block in the heap, in bytes.
3834538345
*/
38346
-SQLITE_API int SQLITE_APICALL sqlite3_win32_compact_heap(LPUINT pnLargest){
38346
+SQLITE_API int SQLITE_STDCALL sqlite3_win32_compact_heap(LPUINT pnLargest){
3834738347
int rc = SQLITE_OK;
3834838348
UINT nLargest = 0;
3834938349
HANDLE hHeap;
3835038350
3835138351
winMemAssertMagic();
@@ -38381,11 +38381,11 @@
3838138381
** If a Win32 native heap has been configured, this function will attempt to
3838238382
** destroy and recreate it. If the Win32 native heap is not isolated and/or
3838338383
** the sqlite3_memory_used() function does not return zero, SQLITE_BUSY will
3838438384
** be returned and no changes will be made to the Win32 native heap.
3838538385
*/
38386
-SQLITE_API int SQLITE_APICALL sqlite3_win32_reset_heap(){
38386
+SQLITE_API int SQLITE_STDCALL sqlite3_win32_reset_heap(){
3838738387
int rc;
3838838388
MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */
3838938389
MUTEX_LOGIC( sqlite3_mutex *pMem; ) /* The memsys static mutex */
3839038390
MUTEX_LOGIC( pMaster = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); )
3839138391
MUTEX_LOGIC( pMem = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM); )
@@ -38426,11 +38426,11 @@
3842638426
/*
3842738427
** This function outputs the specified (ANSI) string to the Win32 debugger
3842838428
** (if available).
3842938429
*/
3843038430
38431
-SQLITE_API void SQLITE_APICALL sqlite3_win32_write_debug(const char *zBuf, int nBuf){
38431
+SQLITE_API void SQLITE_STDCALL sqlite3_win32_write_debug(const char *zBuf, int nBuf){
3843238432
char zDbgBuf[SQLITE_WIN32_DBG_BUF_SIZE];
3843338433
int nMin = MIN(nBuf, (SQLITE_WIN32_DBG_BUF_SIZE - 1)); /* may be negative. */
3843438434
if( nMin<-1 ) nMin = -1; /* all negative values become -1. */
3843538435
assert( nMin==-1 || nMin==0 || nMin<SQLITE_WIN32_DBG_BUF_SIZE );
3843638436
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -38472,11 +38472,11 @@
3847238472
*/
3847338473
#if SQLITE_OS_WINRT
3847438474
static HANDLE sleepObj = NULL;
3847538475
#endif
3847638476
38477
-SQLITE_API void SQLITE_APICALL sqlite3_win32_sleep(DWORD milliseconds){
38477
+SQLITE_API void SQLITE_STDCALL sqlite3_win32_sleep(DWORD milliseconds){
3847838478
#if SQLITE_OS_WINRT
3847938479
if ( sleepObj==NULL ){
3848038480
sleepObj = osCreateEventExW(NULL, NULL, CREATE_EVENT_MANUAL_RESET,
3848138481
SYNCHRONIZE);
3848238482
}
@@ -38521,11 +38521,11 @@
3852138521
3852238522
/*
3852338523
** This function determines if the machine is running a version of Windows
3852438524
** based on the NT kernel.
3852538525
*/
38526
-SQLITE_API int SQLITE_APICALL sqlite3_win32_is_nt(void){
38526
+SQLITE_API int SQLITE_STDCALL sqlite3_win32_is_nt(void){
3852738527
#if SQLITE_OS_WINRT
3852838528
/*
3852938529
** NOTE: The WinRT sub-platform is always assumed to be based on the NT
3853038530
** kernel.
3853138531
*/
@@ -38909,11 +38909,11 @@
3890938909
}
3891038910
3891138911
/*
3891238912
** This is a public wrapper for the winUtf8ToUnicode() function.
3891338913
*/
38914
-SQLITE_API LPWSTR SQLITE_APICALL sqlite3_win32_utf8_to_unicode(const char *zText){
38914
+SQLITE_API LPWSTR SQLITE_STDCALL sqlite3_win32_utf8_to_unicode(const char *zText){
3891538915
#ifdef SQLITE_ENABLE_API_ARMOR
3891638916
if( !zText ){
3891738917
(void)SQLITE_MISUSE_BKPT;
3891838918
return 0;
3891938919
}
@@ -38925,11 +38925,11 @@
3892538925
}
3892638926
3892738927
/*
3892838928
** This is a public wrapper for the winUnicodeToUtf8() function.
3892938929
*/
38930
-SQLITE_API char *SQLITE_APICALL sqlite3_win32_unicode_to_utf8(LPCWSTR zWideText){
38930
+SQLITE_API char *SQLITE_STDCALL sqlite3_win32_unicode_to_utf8(LPCWSTR zWideText){
3893138931
#ifdef SQLITE_ENABLE_API_ARMOR
3893238932
if( !zWideText ){
3893338933
(void)SQLITE_MISUSE_BKPT;
3893438934
return 0;
3893538935
}
@@ -38941,11 +38941,11 @@
3894138941
}
3894238942
3894338943
/*
3894438944
** This is a public wrapper for the winMbcsToUtf8() function.
3894538945
*/
38946
-SQLITE_API char *SQLITE_APICALL sqlite3_win32_mbcs_to_utf8(const char *zText){
38946
+SQLITE_API char *SQLITE_STDCALL sqlite3_win32_mbcs_to_utf8(const char *zText){
3894738947
#ifdef SQLITE_ENABLE_API_ARMOR
3894838948
if( !zText ){
3894938949
(void)SQLITE_MISUSE_BKPT;
3895038950
return 0;
3895138951
}
@@ -38957,11 +38957,11 @@
3895738957
}
3895838958
3895938959
/*
3896038960
** This is a public wrapper for the winMbcsToUtf8() function.
3896138961
*/
38962
-SQLITE_API char *SQLITE_APICALL sqlite3_win32_mbcs_to_utf8_v2(const char *zText, int useAnsi){
38962
+SQLITE_API char *SQLITE_STDCALL sqlite3_win32_mbcs_to_utf8_v2(const char *zText, int useAnsi){
3896338963
#ifdef SQLITE_ENABLE_API_ARMOR
3896438964
if( !zText ){
3896538965
(void)SQLITE_MISUSE_BKPT;
3896638966
return 0;
3896738967
}
@@ -38973,11 +38973,11 @@
3897338973
}
3897438974
3897538975
/*
3897638976
** This is a public wrapper for the winUtf8ToMbcs() function.
3897738977
*/
38978
-SQLITE_API char *SQLITE_APICALL sqlite3_win32_utf8_to_mbcs(const char *zText){
38978
+SQLITE_API char *SQLITE_STDCALL sqlite3_win32_utf8_to_mbcs(const char *zText){
3897938979
#ifdef SQLITE_ENABLE_API_ARMOR
3898038980
if( !zText ){
3898138981
(void)SQLITE_MISUSE_BKPT;
3898238982
return 0;
3898338983
}
@@ -38989,11 +38989,11 @@
3898938989
}
3899038990
3899138991
/*
3899238992
** This is a public wrapper for the winUtf8ToMbcs() function.
3899338993
*/
38994
-SQLITE_API char *SQLITE_APICALL sqlite3_win32_utf8_to_mbcs_v2(const char *zText, int useAnsi){
38994
+SQLITE_API char *SQLITE_STDCALL sqlite3_win32_utf8_to_mbcs_v2(const char *zText, int useAnsi){
3899538995
#ifdef SQLITE_ENABLE_API_ARMOR
3899638996
if( !zText ){
3899738997
(void)SQLITE_MISUSE_BKPT;
3899838998
return 0;
3899938999
}
@@ -39009,11 +39009,11 @@
3900939009
** the provided arguments. The type argument must be 1 in order to set the
3901039010
** data directory or 2 in order to set the temporary directory. The zValue
3901139011
** argument is the name of the directory to use. The return value will be
3901239012
** SQLITE_OK if successful.
3901339013
*/
39014
-SQLITE_API int SQLITE_APICALL sqlite3_win32_set_directory(DWORD type, LPCWSTR zValue){
39014
+SQLITE_API int SQLITE_STDCALL sqlite3_win32_set_directory(DWORD type, LPCWSTR zValue){
3901539015
char **ppDirectory = 0;
3901639016
#ifndef SQLITE_OMIT_AUTOINIT
3901739017
int rc = sqlite3_initialize();
3901839018
if( rc ) return rc;
3901939019
#endif
@@ -42927,11 +42927,11 @@
4292742927
}
4292842928
4292942929
/*
4293042930
** Initialize and deinitialize the operating system interface.
4293142931
*/
42932
-SQLITE_API int SQLITE_APICALL sqlite3_os_init(void){
42932
+SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void){
4293342933
static sqlite3_vfs winVfs = {
4293442934
3, /* iVersion */
4293542935
sizeof(winFile), /* szOsFile */
4293642936
SQLITE_WIN32_MAX_PATH_BYTES, /* mxPathname */
4293742937
0, /* pNext */
@@ -43058,11 +43058,11 @@
4305843058
#endif
4305943059
4306043060
return SQLITE_OK;
4306143061
}
4306243062
43063
-SQLITE_API int SQLITE_APICALL sqlite3_os_end(void){
43063
+SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void){
4306443064
#if SQLITE_OS_WINRT
4306543065
if( sleepObj!=NULL ){
4306643066
osCloseHandle(sleepObj);
4306743067
sleepObj = NULL;
4306843068
}
@@ -57053,11 +57053,11 @@
5705357053
5705457054
/*
5705557055
** Return a +ve value if snapshot p1 is newer than p2. A -ve value if
5705657056
** p1 is older than p2 and zero if p1 and p2 are the same snapshot.
5705757057
*/
57058
-SQLITE_API int SQLITE_APICALL sqlite3_snapshot_cmp(sqlite3_snapshot *p1, sqlite3_snapshot *p2){
57058
+SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_cmp(sqlite3_snapshot *p1, sqlite3_snapshot *p2){
5705957059
WalIndexHdr *pHdr1 = (WalIndexHdr*)p1;
5706057060
WalIndexHdr *pHdr2 = (WalIndexHdr*)p2;
5706157061
5706257062
/* aSalt[0] is a copy of the value stored in the wal file header. It
5706357063
** is incremented each time the wal file is restarted. */
@@ -58190,11 +58190,11 @@
5819058190
**
5819158191
** This routine has no effect on existing database connections.
5819258192
** The shared cache setting effects only future calls to
5819358193
** sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2().
5819458194
*/
58195
-SQLITE_API int SQLITE_APICALL sqlite3_enable_shared_cache(int enable){
58195
+SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int enable){
5819658196
sqlite3GlobalConfig.sharedCacheEnabled = enable;
5819758197
return SQLITE_OK;
5819858198
}
5819958199
#endif
5820058200
@@ -64489,11 +64489,11 @@
6448964489
}
6449064490
}
6449164491
6449264492
/*
6449364493
** A CellArray object contains a cache of pointers and sizes for a
64494
-** consecutive sequence of cells that might be held multiple pages.
64494
+** consecutive sequence of cells that might be held on multiple pages.
6449564495
*/
6449664496
typedef struct CellArray CellArray;
6449764497
struct CellArray {
6449864498
int nCell; /* Number of cells in apCell[] */
6449964499
MemPage *pRef; /* Reference page */
@@ -67963,11 +67963,11 @@
6796367963
** a pointer to the new sqlite3_backup object.
6796467964
**
6796567965
** If an error occurs, NULL is returned and an error code and error message
6796667966
** stored in database handle pDestDb.
6796767967
*/
67968
-SQLITE_API sqlite3_backup *SQLITE_APICALL sqlite3_backup_init(
67968
+SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
6796967969
sqlite3* pDestDb, /* Database to write to */
6797067970
const char *zDestDb, /* Name of database within pDestDb */
6797167971
sqlite3* pSrcDb, /* Database connection to read from */
6797267972
const char *zSrcDb /* Name of database within pSrcDb */
6797367973
){
@@ -68171,11 +68171,11 @@
6817168171
}
6817268172
6817368173
/*
6817468174
** Copy nPage pages from the source b-tree to the destination.
6817568175
*/
68176
-SQLITE_API int SQLITE_APICALL sqlite3_backup_step(sqlite3_backup *p, int nPage){
68176
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage){
6817768177
int rc;
6817868178
int destMode; /* Destination journal mode */
6817968179
int pgszSrc = 0; /* Source page size */
6818068180
int pgszDest = 0; /* Destination page size */
6818168181
@@ -68415,11 +68415,11 @@
6841568415
}
6841668416
6841768417
/*
6841868418
** Release all resources associated with an sqlite3_backup* handle.
6841968419
*/
68420
-SQLITE_API int SQLITE_APICALL sqlite3_backup_finish(sqlite3_backup *p){
68420
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p){
6842168421
sqlite3_backup **pp; /* Ptr to head of pagers backup list */
6842268422
sqlite3 *pSrcDb; /* Source database connection */
6842368423
int rc; /* Value to return */
6842468424
6842568425
/* Enter the mutexes */
@@ -68467,11 +68467,11 @@
6846768467
6846868468
/*
6846968469
** Return the number of pages still to be backed up as of the most recent
6847068470
** call to sqlite3_backup_step().
6847168471
*/
68472
-SQLITE_API int SQLITE_APICALL sqlite3_backup_remaining(sqlite3_backup *p){
68472
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p){
6847368473
#ifdef SQLITE_ENABLE_API_ARMOR
6847468474
if( p==0 ){
6847568475
(void)SQLITE_MISUSE_BKPT;
6847668476
return 0;
6847768477
}
@@ -68481,11 +68481,11 @@
6848168481
6848268482
/*
6848368483
** Return the total number of pages in the source database as of the most
6848468484
** recent call to sqlite3_backup_step().
6848568485
*/
68486
-SQLITE_API int SQLITE_APICALL sqlite3_backup_pagecount(sqlite3_backup *p){
68486
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p){
6848768487
#ifdef SQLITE_ENABLE_API_ARMOR
6848868488
if( p==0 ){
6848968489
(void)SQLITE_MISUSE_BKPT;
6849068490
return 0;
6849168491
}
@@ -74935,11 +74935,11 @@
7493574935
** execution environment changes in a way that would alter the program
7493674936
** that sqlite3_prepare() generates. For example, if new functions or
7493774937
** collating sequences are registered or if an authorizer function is
7493874938
** added or changed.
7493974939
*/
74940
-SQLITE_API int SQLITE_APICALL sqlite3_expired(sqlite3_stmt *pStmt){
74940
+SQLITE_API int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt *pStmt){
7494174941
Vdbe *p = (Vdbe*)pStmt;
7494274942
return p==0 || p->expired;
7494374943
}
7494474944
#endif
7494574945
@@ -75004,11 +75004,11 @@
7500475004
** machine.
7500575005
**
7500675006
** This routine sets the error code and string returned by
7500775007
** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
7500875008
*/
75009
-SQLITE_API int SQLITE_APICALL sqlite3_finalize(sqlite3_stmt *pStmt){
75009
+SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt){
7501075010
int rc;
7501175011
if( pStmt==0 ){
7501275012
/* IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL
7501375013
** pointer is a harmless no-op. */
7501475014
rc = SQLITE_OK;
@@ -75031,11 +75031,11 @@
7503175031
** the prior execution is returned.
7503275032
**
7503375033
** This routine sets the error code and string returned by
7503475034
** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
7503575035
*/
75036
-SQLITE_API int SQLITE_APICALL sqlite3_reset(sqlite3_stmt *pStmt){
75036
+SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt){
7503775037
int rc;
7503875038
if( pStmt==0 ){
7503975039
rc = SQLITE_OK;
7504075040
}else{
7504175041
Vdbe *v = (Vdbe*)pStmt;
@@ -75052,11 +75052,11 @@
7505275052
}
7505375053
7505475054
/*
7505575055
** Set all the parameters in the compiled SQL statement to NULL.
7505675056
*/
75057
-SQLITE_API int SQLITE_APICALL sqlite3_clear_bindings(sqlite3_stmt *pStmt){
75057
+SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt *pStmt){
7505875058
int i;
7505975059
int rc = SQLITE_OK;
7506075060
Vdbe *p = (Vdbe*)pStmt;
7506175061
#if SQLITE_THREADSAFE
7506275062
sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex;
@@ -75076,11 +75076,11 @@
7507675076
7507775077
/**************************** sqlite3_value_ *******************************
7507875078
** The following routines extract information from a Mem or sqlite3_value
7507975079
** structure.
7508075080
*/
75081
-SQLITE_API const void *SQLITE_APICALL sqlite3_value_blob(sqlite3_value *pVal){
75081
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value *pVal){
7508275082
Mem *p = (Mem*)pVal;
7508375083
if( p->flags & (MEM_Blob|MEM_Str) ){
7508475084
if( sqlite3VdbeMemExpandBlob(p)!=SQLITE_OK ){
7508575085
assert( p->flags==MEM_Null && p->z==0 );
7508675086
return 0;
@@ -75089,48 +75089,48 @@
7508975089
return p->n ? p->z : 0;
7509075090
}else{
7509175091
return sqlite3_value_text(pVal);
7509275092
}
7509375093
}
75094
-SQLITE_API int SQLITE_APICALL sqlite3_value_bytes(sqlite3_value *pVal){
75094
+SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value *pVal){
7509575095
return sqlite3ValueBytes(pVal, SQLITE_UTF8);
7509675096
}
75097
-SQLITE_API int SQLITE_APICALL sqlite3_value_bytes16(sqlite3_value *pVal){
75097
+SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value *pVal){
7509875098
return sqlite3ValueBytes(pVal, SQLITE_UTF16NATIVE);
7509975099
}
75100
-SQLITE_API double SQLITE_APICALL sqlite3_value_double(sqlite3_value *pVal){
75100
+SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value *pVal){
7510175101
return sqlite3VdbeRealValue((Mem*)pVal);
7510275102
}
75103
-SQLITE_API int SQLITE_APICALL sqlite3_value_int(sqlite3_value *pVal){
75103
+SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value *pVal){
7510475104
return (int)sqlite3VdbeIntValue((Mem*)pVal);
7510575105
}
75106
-SQLITE_API sqlite_int64 SQLITE_APICALL sqlite3_value_int64(sqlite3_value *pVal){
75106
+SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value *pVal){
7510775107
return sqlite3VdbeIntValue((Mem*)pVal);
7510875108
}
75109
-SQLITE_API unsigned int SQLITE_APICALL sqlite3_value_subtype(sqlite3_value *pVal){
75109
+SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value *pVal){
7511075110
Mem *pMem = (Mem*)pVal;
7511175111
return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0);
7511275112
}
75113
-SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_value_text(sqlite3_value *pVal){
75113
+SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value *pVal){
7511475114
return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
7511575115
}
7511675116
#ifndef SQLITE_OMIT_UTF16
75117
-SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16(sqlite3_value* pVal){
75117
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value* pVal){
7511875118
return sqlite3ValueText(pVal, SQLITE_UTF16NATIVE);
7511975119
}
75120
-SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16be(sqlite3_value *pVal){
75120
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value *pVal){
7512175121
return sqlite3ValueText(pVal, SQLITE_UTF16BE);
7512275122
}
75123
-SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16le(sqlite3_value *pVal){
75123
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value *pVal){
7512475124
return sqlite3ValueText(pVal, SQLITE_UTF16LE);
7512575125
}
7512675126
#endif /* SQLITE_OMIT_UTF16 */
7512775127
/* EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five
7512875128
** fundamental datatypes: 64-bit signed integer 64-bit IEEE floating
7512975129
** point number string BLOB NULL
7513075130
*/
75131
-SQLITE_API int SQLITE_APICALL sqlite3_value_type(sqlite3_value* pVal){
75131
+SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value* pVal){
7513275132
static const u8 aType[] = {
7513375133
SQLITE_BLOB, /* 0x00 */
7513475134
SQLITE_NULL, /* 0x01 */
7513575135
SQLITE_TEXT, /* 0x02 */
7513675136
SQLITE_NULL, /* 0x03 */
@@ -75166,11 +75166,11 @@
7516675166
return aType[pVal->flags&MEM_AffMask];
7516775167
}
7516875168
7516975169
/* Make a copy of an sqlite3_value object
7517075170
*/
75171
-SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_value_dup(const sqlite3_value *pOrig){
75171
+SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value *pOrig){
7517275172
sqlite3_value *pNew;
7517375173
if( pOrig==0 ) return 0;
7517475174
pNew = sqlite3_malloc( sizeof(*pNew) );
7517575175
if( pNew==0 ) return 0;
7517675176
memset(pNew, 0, sizeof(*pNew));
@@ -75189,11 +75189,11 @@
7518975189
}
7519075190
7519175191
/* Destroy an sqlite3_value object previously obtained from
7519275192
** sqlite3_value_dup().
7519375193
*/
75194
-SQLITE_API void SQLITE_APICALL sqlite3_value_free(sqlite3_value *pOld){
75194
+SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value *pOld){
7519575195
sqlite3ValueFree(pOld);
7519675196
}
7519775197
7519875198
7519975199
/**************************** sqlite3_result_ *******************************
@@ -75232,21 +75232,21 @@
7523275232
xDel((void*)p);
7523375233
}
7523475234
if( pCtx ) sqlite3_result_error_toobig(pCtx);
7523575235
return SQLITE_TOOBIG;
7523675236
}
75237
-SQLITE_API void SQLITE_APICALL sqlite3_result_blob(
75237
+SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(
7523875238
sqlite3_context *pCtx,
7523975239
const void *z,
7524075240
int n,
7524175241
void (*xDel)(void *)
7524275242
){
7524375243
assert( n>=0 );
7524475244
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7524575245
setResultStrOrError(pCtx, z, n, 0, xDel);
7524675246
}
75247
-SQLITE_API void SQLITE_APICALL sqlite3_result_blob64(
75247
+SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(
7524875248
sqlite3_context *pCtx,
7524975249
const void *z,
7525075250
sqlite3_uint64 n,
7525175251
void (*xDel)(void *)
7525275252
){
@@ -75256,56 +75256,56 @@
7525675256
(void)invokeValueDestructor(z, xDel, pCtx);
7525775257
}else{
7525875258
setResultStrOrError(pCtx, z, (int)n, 0, xDel);
7525975259
}
7526075260
}
75261
-SQLITE_API void SQLITE_APICALL sqlite3_result_double(sqlite3_context *pCtx, double rVal){
75261
+SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context *pCtx, double rVal){
7526275262
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7526375263
sqlite3VdbeMemSetDouble(pCtx->pOut, rVal);
7526475264
}
75265
-SQLITE_API void SQLITE_APICALL sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
75265
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
7526675266
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7526775267
pCtx->isError = SQLITE_ERROR;
7526875268
pCtx->fErrorOrAux = 1;
7526975269
sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF8, SQLITE_TRANSIENT);
7527075270
}
7527175271
#ifndef SQLITE_OMIT_UTF16
75272
-SQLITE_API void SQLITE_APICALL sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){
75272
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){
7527375273
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7527475274
pCtx->isError = SQLITE_ERROR;
7527575275
pCtx->fErrorOrAux = 1;
7527675276
sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF16NATIVE, SQLITE_TRANSIENT);
7527775277
}
7527875278
#endif
75279
-SQLITE_API void SQLITE_APICALL sqlite3_result_int(sqlite3_context *pCtx, int iVal){
75279
+SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context *pCtx, int iVal){
7528075280
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7528175281
sqlite3VdbeMemSetInt64(pCtx->pOut, (i64)iVal);
7528275282
}
75283
-SQLITE_API void SQLITE_APICALL sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
75283
+SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
7528475284
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7528575285
sqlite3VdbeMemSetInt64(pCtx->pOut, iVal);
7528675286
}
75287
-SQLITE_API void SQLITE_APICALL sqlite3_result_null(sqlite3_context *pCtx){
75287
+SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context *pCtx){
7528875288
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7528975289
sqlite3VdbeMemSetNull(pCtx->pOut);
7529075290
}
75291
-SQLITE_API void SQLITE_APICALL sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){
75291
+SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){
7529275292
Mem *pOut = pCtx->pOut;
7529375293
assert( sqlite3_mutex_held(pOut->db->mutex) );
7529475294
pOut->eSubtype = eSubtype & 0xff;
7529575295
pOut->flags |= MEM_Subtype;
7529675296
}
75297
-SQLITE_API void SQLITE_APICALL sqlite3_result_text(
75297
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text(
7529875298
sqlite3_context *pCtx,
7529975299
const char *z,
7530075300
int n,
7530175301
void (*xDel)(void *)
7530275302
){
7530375303
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7530475304
setResultStrOrError(pCtx, z, n, SQLITE_UTF8, xDel);
7530575305
}
75306
-SQLITE_API void SQLITE_APICALL sqlite3_result_text64(
75306
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(
7530775307
sqlite3_context *pCtx,
7530875308
const char *z,
7530975309
sqlite3_uint64 n,
7531075310
void (*xDel)(void *),
7531175311
unsigned char enc
@@ -75318,56 +75318,56 @@
7531875318
}else{
7531975319
setResultStrOrError(pCtx, z, (int)n, enc, xDel);
7532075320
}
7532175321
}
7532275322
#ifndef SQLITE_OMIT_UTF16
75323
-SQLITE_API void SQLITE_APICALL sqlite3_result_text16(
75323
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(
7532475324
sqlite3_context *pCtx,
7532575325
const void *z,
7532675326
int n,
7532775327
void (*xDel)(void *)
7532875328
){
7532975329
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7533075330
setResultStrOrError(pCtx, z, n, SQLITE_UTF16NATIVE, xDel);
7533175331
}
75332
-SQLITE_API void SQLITE_APICALL sqlite3_result_text16be(
75332
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(
7533375333
sqlite3_context *pCtx,
7533475334
const void *z,
7533575335
int n,
7533675336
void (*xDel)(void *)
7533775337
){
7533875338
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7533975339
setResultStrOrError(pCtx, z, n, SQLITE_UTF16BE, xDel);
7534075340
}
75341
-SQLITE_API void SQLITE_APICALL sqlite3_result_text16le(
75341
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(
7534275342
sqlite3_context *pCtx,
7534375343
const void *z,
7534475344
int n,
7534575345
void (*xDel)(void *)
7534675346
){
7534775347
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7534875348
setResultStrOrError(pCtx, z, n, SQLITE_UTF16LE, xDel);
7534975349
}
7535075350
#endif /* SQLITE_OMIT_UTF16 */
75351
-SQLITE_API void SQLITE_APICALL sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){
75351
+SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){
7535275352
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7535375353
sqlite3VdbeMemCopy(pCtx->pOut, pValue);
7535475354
}
75355
-SQLITE_API void SQLITE_APICALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){
75355
+SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){
7535675356
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7535775357
sqlite3VdbeMemSetZeroBlob(pCtx->pOut, n);
7535875358
}
75359
-SQLITE_API int SQLITE_APICALL sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){
75359
+SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){
7536075360
Mem *pOut = pCtx->pOut;
7536175361
assert( sqlite3_mutex_held(pOut->db->mutex) );
7536275362
if( n>(u64)pOut->db->aLimit[SQLITE_LIMIT_LENGTH] ){
7536375363
return SQLITE_TOOBIG;
7536475364
}
7536575365
sqlite3VdbeMemSetZeroBlob(pCtx->pOut, (int)n);
7536675366
return SQLITE_OK;
7536775367
}
75368
-SQLITE_API void SQLITE_APICALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){
75368
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){
7536975369
pCtx->isError = errCode;
7537075370
pCtx->fErrorOrAux = 1;
7537175371
#ifdef SQLITE_DEBUG
7537275372
if( pCtx->pVdbe ) pCtx->pVdbe->rcApp = errCode;
7537375373
#endif
@@ -75376,20 +75376,20 @@
7537675376
SQLITE_UTF8, SQLITE_STATIC);
7537775377
}
7537875378
}
7537975379
7538075380
/* Force an SQLITE_TOOBIG error. */
75381
-SQLITE_API void SQLITE_APICALL sqlite3_result_error_toobig(sqlite3_context *pCtx){
75381
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context *pCtx){
7538275382
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7538375383
pCtx->isError = SQLITE_TOOBIG;
7538475384
pCtx->fErrorOrAux = 1;
7538575385
sqlite3VdbeMemSetStr(pCtx->pOut, "string or blob too big", -1,
7538675386
SQLITE_UTF8, SQLITE_STATIC);
7538775387
}
7538875388
7538975389
/* An SQLITE_NOMEM error. */
75390
-SQLITE_API void SQLITE_APICALL sqlite3_result_error_nomem(sqlite3_context *pCtx){
75390
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context *pCtx){
7539175391
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7539275392
sqlite3VdbeMemSetNull(pCtx->pOut);
7539375393
pCtx->isError = SQLITE_NOMEM_BKPT;
7539475394
pCtx->fErrorOrAux = 1;
7539575395
sqlite3OomFault(pCtx->pOut->db);
@@ -75557,11 +75557,11 @@
7555775557
/*
7555875558
** This is the top-level implementation of sqlite3_step(). Call
7555975559
** sqlite3Step() to do most of the work. If a schema error occurs,
7556075560
** call sqlite3Reprepare() and try again.
7556175561
*/
75562
-SQLITE_API int SQLITE_APICALL sqlite3_step(sqlite3_stmt *pStmt){
75562
+SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt *pStmt){
7556375563
int rc = SQLITE_OK; /* Result from sqlite3Step() */
7556475564
int rc2 = SQLITE_OK; /* Result from sqlite3Reprepare() */
7556575565
Vdbe *v = (Vdbe*)pStmt; /* the prepared statement */
7556675566
int cnt = 0; /* Counter to prevent infinite loop of reprepares */
7556775567
sqlite3 *db; /* The database connection */
@@ -75608,11 +75608,11 @@
7560875608
7560975609
/*
7561075610
** Extract the user data from a sqlite3_context structure and return a
7561175611
** pointer to it.
7561275612
*/
75613
-SQLITE_API void *SQLITE_APICALL sqlite3_user_data(sqlite3_context *p){
75613
+SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context *p){
7561475614
assert( p && p->pFunc );
7561575615
return p->pFunc->pUserData;
7561675616
}
7561775617
7561875618
/*
@@ -75623,11 +75623,11 @@
7562375623
** returns a copy of the pointer to the database connection (the 1st
7562475624
** parameter) of the sqlite3_create_function() and
7562575625
** sqlite3_create_function16() routines that originally registered the
7562675626
** application defined function.
7562775627
*/
75628
-SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_context_db_handle(sqlite3_context *p){
75628
+SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context *p){
7562975629
assert( p && p->pOut );
7563075630
return p->pOut->db;
7563175631
}
7563275632
7563375633
/*
@@ -75699,11 +75699,11 @@
7569975699
/*
7570075700
** Allocate or return the aggregate context for a user function. A new
7570175701
** context is allocated on the first call. Subsequent calls return the
7570275702
** same context that was returned on prior calls.
7570375703
*/
75704
-SQLITE_API void *SQLITE_APICALL sqlite3_aggregate_context(sqlite3_context *p, int nByte){
75704
+SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context *p, int nByte){
7570575705
assert( p && p->pFunc && p->pFunc->xFinalize );
7570675706
assert( sqlite3_mutex_held(p->pOut->db->mutex) );
7570775707
testcase( nByte<0 );
7570875708
if( (p->pMem->flags & MEM_Agg)==0 ){
7570975709
return createAggContext(p, nByte);
@@ -75714,11 +75714,11 @@
7571475714
7571575715
/*
7571675716
** Return the auxiliary data pointer, if any, for the iArg'th argument to
7571775717
** the user-function defined by pCtx.
7571875718
*/
75719
-SQLITE_API void *SQLITE_APICALL sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
75719
+SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
7572075720
AuxData *pAuxData;
7572175721
7572275722
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7572375723
#if SQLITE_ENABLE_STAT3_OR_STAT4
7572475724
if( pCtx->pVdbe==0 ) return 0;
@@ -75735,11 +75735,11 @@
7573575735
/*
7573675736
** Set the auxiliary data pointer and delete function, for the iArg'th
7573775737
** argument to the user-function defined by pCtx. Any previous value is
7573875738
** deleted by calling the delete function specified when it was set.
7573975739
*/
75740
-SQLITE_API void SQLITE_APICALL sqlite3_set_auxdata(
75740
+SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(
7574175741
sqlite3_context *pCtx,
7574275742
int iArg,
7574375743
void *pAux,
7574475744
void (*xDelete)(void*)
7574575745
){
@@ -75790,29 +75790,29 @@
7579075790
** This function is deprecated. Do not use it for new code. It is
7579175791
** provide only to avoid breaking legacy code. New aggregate function
7579275792
** implementations should keep their own counts within their aggregate
7579375793
** context.
7579475794
*/
75795
-SQLITE_API int SQLITE_APICALL sqlite3_aggregate_count(sqlite3_context *p){
75795
+SQLITE_API int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context *p){
7579675796
assert( p && p->pMem && p->pFunc && p->pFunc->xFinalize );
7579775797
return p->pMem->n;
7579875798
}
7579975799
#endif
7580075800
7580175801
/*
7580275802
** Return the number of columns in the result set for the statement pStmt.
7580375803
*/
75804
-SQLITE_API int SQLITE_APICALL sqlite3_column_count(sqlite3_stmt *pStmt){
75804
+SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt){
7580575805
Vdbe *pVm = (Vdbe *)pStmt;
7580675806
return pVm ? pVm->nResColumn : 0;
7580775807
}
7580875808
7580975809
/*
7581075810
** Return the number of values available from the current row of the
7581175811
** currently executing statement pStmt.
7581275812
*/
75813
-SQLITE_API int SQLITE_APICALL sqlite3_data_count(sqlite3_stmt *pStmt){
75813
+SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt){
7581475814
Vdbe *pVm = (Vdbe *)pStmt;
7581575815
if( pVm==0 || pVm->pResultSet==0 ) return 0;
7581675816
return pVm->nResColumn;
7581775817
}
7581875818
@@ -75911,67 +75911,67 @@
7591175911
7591275912
/**************************** sqlite3_column_ *******************************
7591375913
** The following routines are used to access elements of the current row
7591475914
** in the result set.
7591575915
*/
75916
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_blob(sqlite3_stmt *pStmt, int i){
75916
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt *pStmt, int i){
7591775917
const void *val;
7591875918
val = sqlite3_value_blob( columnMem(pStmt,i) );
7591975919
/* Even though there is no encoding conversion, value_blob() might
7592075920
** need to call malloc() to expand the result of a zeroblob()
7592175921
** expression.
7592275922
*/
7592375923
columnMallocFailure(pStmt);
7592475924
return val;
7592575925
}
75926
-SQLITE_API int SQLITE_APICALL sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){
75926
+SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){
7592775927
int val = sqlite3_value_bytes( columnMem(pStmt,i) );
7592875928
columnMallocFailure(pStmt);
7592975929
return val;
7593075930
}
75931
-SQLITE_API int SQLITE_APICALL sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){
75931
+SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){
7593275932
int val = sqlite3_value_bytes16( columnMem(pStmt,i) );
7593375933
columnMallocFailure(pStmt);
7593475934
return val;
7593575935
}
75936
-SQLITE_API double SQLITE_APICALL sqlite3_column_double(sqlite3_stmt *pStmt, int i){
75936
+SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt *pStmt, int i){
7593775937
double val = sqlite3_value_double( columnMem(pStmt,i) );
7593875938
columnMallocFailure(pStmt);
7593975939
return val;
7594075940
}
75941
-SQLITE_API int SQLITE_APICALL sqlite3_column_int(sqlite3_stmt *pStmt, int i){
75941
+SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt *pStmt, int i){
7594275942
int val = sqlite3_value_int( columnMem(pStmt,i) );
7594375943
columnMallocFailure(pStmt);
7594475944
return val;
7594575945
}
75946
-SQLITE_API sqlite_int64 SQLITE_APICALL sqlite3_column_int64(sqlite3_stmt *pStmt, int i){
75946
+SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt *pStmt, int i){
7594775947
sqlite_int64 val = sqlite3_value_int64( columnMem(pStmt,i) );
7594875948
columnMallocFailure(pStmt);
7594975949
return val;
7595075950
}
75951
-SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_column_text(sqlite3_stmt *pStmt, int i){
75951
+SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt *pStmt, int i){
7595275952
const unsigned char *val = sqlite3_value_text( columnMem(pStmt,i) );
7595375953
columnMallocFailure(pStmt);
7595475954
return val;
7595575955
}
75956
-SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_column_value(sqlite3_stmt *pStmt, int i){
75956
+SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt *pStmt, int i){
7595775957
Mem *pOut = columnMem(pStmt, i);
7595875958
if( pOut->flags&MEM_Static ){
7595975959
pOut->flags &= ~MEM_Static;
7596075960
pOut->flags |= MEM_Ephem;
7596175961
}
7596275962
columnMallocFailure(pStmt);
7596375963
return (sqlite3_value *)pOut;
7596475964
}
7596575965
#ifndef SQLITE_OMIT_UTF16
75966
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_text16(sqlite3_stmt *pStmt, int i){
75966
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt *pStmt, int i){
7596775967
const void *val = sqlite3_value_text16( columnMem(pStmt,i) );
7596875968
columnMallocFailure(pStmt);
7596975969
return val;
7597075970
}
7597175971
#endif /* SQLITE_OMIT_UTF16 */
75972
-SQLITE_API int SQLITE_APICALL sqlite3_column_type(sqlite3_stmt *pStmt, int i){
75972
+SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt *pStmt, int i){
7597375973
int iType = sqlite3_value_type( columnMem(pStmt,i) );
7597475974
columnMallocFailure(pStmt);
7597575975
return iType;
7597675976
}
7597775977
@@ -76031,16 +76031,16 @@
7603176031
7603276032
/*
7603376033
** Return the name of the Nth column of the result set returned by SQL
7603476034
** statement pStmt.
7603576035
*/
76036
-SQLITE_API const char *SQLITE_APICALL sqlite3_column_name(sqlite3_stmt *pStmt, int N){
76036
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt *pStmt, int N){
7603776037
return columnName(
7603876038
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_NAME);
7603976039
}
7604076040
#ifndef SQLITE_OMIT_UTF16
76041
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_name16(sqlite3_stmt *pStmt, int N){
76041
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt *pStmt, int N){
7604276042
return columnName(
7604376043
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_NAME);
7604476044
}
7604576045
#endif
7604676046
@@ -76056,16 +76056,16 @@
7605676056
#ifndef SQLITE_OMIT_DECLTYPE
7605776057
/*
7605876058
** Return the column declaration type (if applicable) of the 'i'th column
7605976059
** of the result set of SQL statement pStmt.
7606076060
*/
76061
-SQLITE_API const char *SQLITE_APICALL sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){
76061
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){
7606276062
return columnName(
7606376063
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DECLTYPE);
7606476064
}
7606576065
#ifndef SQLITE_OMIT_UTF16
76066
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){
76066
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){
7606776067
return columnName(
7606876068
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DECLTYPE);
7606976069
}
7607076070
#endif /* SQLITE_OMIT_UTF16 */
7607176071
#endif /* SQLITE_OMIT_DECLTYPE */
@@ -76074,16 +76074,16 @@
7607476074
/*
7607576075
** Return the name of the database from which a result column derives.
7607676076
** NULL is returned if the result column is an expression or constant or
7607776077
** anything else which is not an unambiguous reference to a database column.
7607876078
*/
76079
-SQLITE_API const char *SQLITE_APICALL sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){
76079
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){
7608076080
return columnName(
7608176081
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DATABASE);
7608276082
}
7608376083
#ifndef SQLITE_OMIT_UTF16
76084
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){
76084
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){
7608576085
return columnName(
7608676086
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DATABASE);
7608776087
}
7608876088
#endif /* SQLITE_OMIT_UTF16 */
7608976089
@@ -76090,16 +76090,16 @@
7609076090
/*
7609176091
** Return the name of the table from which a result column derives.
7609276092
** NULL is returned if the result column is an expression or constant or
7609376093
** anything else which is not an unambiguous reference to a database column.
7609476094
*/
76095
-SQLITE_API const char *SQLITE_APICALL sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){
76095
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){
7609676096
return columnName(
7609776097
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_TABLE);
7609876098
}
7609976099
#ifndef SQLITE_OMIT_UTF16
76100
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){
76100
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){
7610176101
return columnName(
7610276102
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_TABLE);
7610376103
}
7610476104
#endif /* SQLITE_OMIT_UTF16 */
7610576105
@@ -76106,16 +76106,16 @@
7610676106
/*
7610776107
** Return the name of the table column from which a result column derives.
7610876108
** NULL is returned if the result column is an expression or constant or
7610976109
** anything else which is not an unambiguous reference to a database column.
7611076110
*/
76111
-SQLITE_API const char *SQLITE_APICALL sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){
76111
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){
7611276112
return columnName(
7611376113
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_COLUMN);
7611476114
}
7611576115
#ifndef SQLITE_OMIT_UTF16
76116
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){
76116
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){
7611776117
return columnName(
7611876118
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_COLUMN);
7611976119
}
7612076120
#endif /* SQLITE_OMIT_UTF16 */
7612176121
#endif /* SQLITE_ENABLE_COLUMN_METADATA */
@@ -76212,11 +76212,11 @@
7621276212
7621376213
7621476214
/*
7621576215
** Bind a blob value to an SQL statement variable.
7621676216
*/
76217
-SQLITE_API int SQLITE_APICALL sqlite3_bind_blob(
76217
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(
7621876218
sqlite3_stmt *pStmt,
7621976219
int i,
7622076220
const void *zData,
7622176221
int nData,
7622276222
void (*xDel)(void*)
@@ -76224,11 +76224,11 @@
7622476224
#ifdef SQLITE_ENABLE_API_ARMOR
7622576225
if( nData<0 ) return SQLITE_MISUSE_BKPT;
7622676226
#endif
7622776227
return bindText(pStmt, i, zData, nData, xDel, 0);
7622876228
}
76229
-SQLITE_API int SQLITE_APICALL sqlite3_bind_blob64(
76229
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(
7623076230
sqlite3_stmt *pStmt,
7623176231
int i,
7623276232
const void *zData,
7623376233
sqlite3_uint64 nData,
7623476234
void (*xDel)(void*)
@@ -76238,52 +76238,52 @@
7623876238
return invokeValueDestructor(zData, xDel, 0);
7623976239
}else{
7624076240
return bindText(pStmt, i, zData, (int)nData, xDel, 0);
7624176241
}
7624276242
}
76243
-SQLITE_API int SQLITE_APICALL sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
76243
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
7624476244
int rc;
7624576245
Vdbe *p = (Vdbe *)pStmt;
7624676246
rc = vdbeUnbind(p, i);
7624776247
if( rc==SQLITE_OK ){
7624876248
sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue);
7624976249
sqlite3_mutex_leave(p->db->mutex);
7625076250
}
7625176251
return rc;
7625276252
}
76253
-SQLITE_API int SQLITE_APICALL sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){
76253
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){
7625476254
return sqlite3_bind_int64(p, i, (i64)iValue);
7625576255
}
76256
-SQLITE_API int SQLITE_APICALL sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
76256
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
7625776257
int rc;
7625876258
Vdbe *p = (Vdbe *)pStmt;
7625976259
rc = vdbeUnbind(p, i);
7626076260
if( rc==SQLITE_OK ){
7626176261
sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue);
7626276262
sqlite3_mutex_leave(p->db->mutex);
7626376263
}
7626476264
return rc;
7626576265
}
76266
-SQLITE_API int SQLITE_APICALL sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
76266
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
7626776267
int rc;
7626876268
Vdbe *p = (Vdbe*)pStmt;
7626976269
rc = vdbeUnbind(p, i);
7627076270
if( rc==SQLITE_OK ){
7627176271
sqlite3_mutex_leave(p->db->mutex);
7627276272
}
7627376273
return rc;
7627476274
}
76275
-SQLITE_API int SQLITE_APICALL sqlite3_bind_text(
76275
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(
7627676276
sqlite3_stmt *pStmt,
7627776277
int i,
7627876278
const char *zData,
7627976279
int nData,
7628076280
void (*xDel)(void*)
7628176281
){
7628276282
return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8);
7628376283
}
76284
-SQLITE_API int SQLITE_APICALL sqlite3_bind_text64(
76284
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(
7628576285
sqlite3_stmt *pStmt,
7628676286
int i,
7628776287
const char *zData,
7628876288
sqlite3_uint64 nData,
7628976289
void (*xDel)(void*),
@@ -76296,21 +76296,21 @@
7629676296
if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE;
7629776297
return bindText(pStmt, i, zData, (int)nData, xDel, enc);
7629876298
}
7629976299
}
7630076300
#ifndef SQLITE_OMIT_UTF16
76301
-SQLITE_API int SQLITE_APICALL sqlite3_bind_text16(
76301
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(
7630276302
sqlite3_stmt *pStmt,
7630376303
int i,
7630476304
const void *zData,
7630576305
int nData,
7630676306
void (*xDel)(void*)
7630776307
){
7630876308
return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE);
7630976309
}
7631076310
#endif /* SQLITE_OMIT_UTF16 */
76311
-SQLITE_API int SQLITE_APICALL sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
76311
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
7631276312
int rc;
7631376313
switch( sqlite3_value_type((sqlite3_value*)pValue) ){
7631476314
case SQLITE_INTEGER: {
7631576315
rc = sqlite3_bind_int64(pStmt, i, pValue->u.i);
7631676316
break;
@@ -76337,21 +76337,21 @@
7633776337
break;
7633876338
}
7633976339
}
7634076340
return rc;
7634176341
}
76342
-SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
76342
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
7634376343
int rc;
7634476344
Vdbe *p = (Vdbe *)pStmt;
7634576345
rc = vdbeUnbind(p, i);
7634676346
if( rc==SQLITE_OK ){
7634776347
sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n);
7634876348
sqlite3_mutex_leave(p->db->mutex);
7634976349
}
7635076350
return rc;
7635176351
}
76352
-SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){
76352
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){
7635376353
int rc;
7635476354
Vdbe *p = (Vdbe *)pStmt;
7635576355
sqlite3_mutex_enter(p->db->mutex);
7635676356
if( n>(u64)p->db->aLimit[SQLITE_LIMIT_LENGTH] ){
7635776357
rc = SQLITE_TOOBIG;
@@ -76366,11 +76366,11 @@
7636676366
7636776367
/*
7636876368
** Return the number of wildcards that can be potentially bound to.
7636976369
** This routine is added to support DBD::SQLite.
7637076370
*/
76371
-SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
76371
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
7637276372
Vdbe *p = (Vdbe*)pStmt;
7637376373
return p ? p->nVar : 0;
7637476374
}
7637576375
7637676376
/*
@@ -76377,11 +76377,11 @@
7637776377
** Return the name of a wildcard parameter. Return NULL if the index
7637876378
** is out of range or if the wildcard is unnamed.
7637976379
**
7638076380
** The result is always UTF-8.
7638176381
*/
76382
-SQLITE_API const char *SQLITE_APICALL sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){
76382
+SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){
7638376383
Vdbe *p = (Vdbe*)pStmt;
7638476384
if( p==0 || i<1 || i>p->nzVar ){
7638576385
return 0;
7638676386
}
7638776387
return p->azVar[i-1];
@@ -76405,11 +76405,11 @@
7640576405
}
7640676406
}
7640776407
}
7640876408
return 0;
7640976409
}
76410
-SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
76410
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
7641176411
return sqlite3VdbeParameterIndex((Vdbe*)pStmt, zName, sqlite3Strlen30(zName));
7641276412
}
7641376413
7641476414
/*
7641576415
** Transfer all bindings from the first statement over to the second.
@@ -76439,11 +76439,11 @@
7643976439
**
7644076440
** If the two statements contain a different number of bindings, then
7644176441
** an SQLITE_ERROR is returned. Nothing else can go wrong, so otherwise
7644276442
** SQLITE_OK is returned.
7644376443
*/
76444
-SQLITE_API int SQLITE_APICALL sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
76444
+SQLITE_API int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
7644576445
Vdbe *pFrom = (Vdbe*)pFromStmt;
7644676446
Vdbe *pTo = (Vdbe*)pToStmt;
7644776447
if( pFrom->nVar!=pTo->nVar ){
7644876448
return SQLITE_ERROR;
7644976449
}
@@ -76461,26 +76461,26 @@
7646176461
** Return the sqlite3* database handle to which the prepared statement given
7646276462
** in the argument belongs. This is the same database handle that was
7646376463
** the first argument to the sqlite3_prepare() that was used to create
7646476464
** the statement in the first place.
7646576465
*/
76466
-SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_db_handle(sqlite3_stmt *pStmt){
76466
+SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt *pStmt){
7646776467
return pStmt ? ((Vdbe*)pStmt)->db : 0;
7646876468
}
7646976469
7647076470
/*
7647176471
** Return true if the prepared statement is guaranteed to not modify the
7647276472
** database.
7647376473
*/
76474
-SQLITE_API int SQLITE_APICALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt){
76474
+SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt){
7647576475
return pStmt ? ((Vdbe*)pStmt)->readOnly : 1;
7647676476
}
7647776477
7647876478
/*
7647976479
** Return true if the prepared statement is in need of being reset.
7648076480
*/
76481
-SQLITE_API int SQLITE_APICALL sqlite3_stmt_busy(sqlite3_stmt *pStmt){
76481
+SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt *pStmt){
7648276482
Vdbe *v = (Vdbe*)pStmt;
7648376483
return v!=0 && v->pc>=0 && v->magic==VDBE_MAGIC_RUN;
7648476484
}
7648576485
7648676486
/*
@@ -76487,11 +76487,11 @@
7648776487
** Return a pointer to the next prepared statement after pStmt associated
7648876488
** with database connection pDb. If pStmt is NULL, return the first
7648976489
** prepared statement for the database connection. Return NULL if there
7649076490
** are no more.
7649176491
*/
76492
-SQLITE_API sqlite3_stmt *SQLITE_APICALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){
76492
+SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){
7649376493
sqlite3_stmt *pNext;
7649476494
#ifdef SQLITE_ENABLE_API_ARMOR
7649576495
if( !sqlite3SafetyCheckOk(pDb) ){
7649676496
(void)SQLITE_MISUSE_BKPT;
7649776497
return 0;
@@ -76508,11 +76508,11 @@
7650876508
}
7650976509
7651076510
/*
7651176511
** Return the value of a status counter for a prepared statement
7651276512
*/
76513
-SQLITE_API int SQLITE_APICALL sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){
76513
+SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){
7651476514
Vdbe *pVdbe = (Vdbe*)pStmt;
7651576515
u32 v;
7651676516
#ifdef SQLITE_ENABLE_API_ARMOR
7651776517
if( !pStmt ){
7651876518
(void)SQLITE_MISUSE_BKPT;
@@ -76525,11 +76525,11 @@
7652576525
}
7652676526
7652776527
/*
7652876528
** Return the SQL associated with a prepared statement
7652976529
*/
76530
-SQLITE_API const char *SQLITE_APICALL sqlite3_sql(sqlite3_stmt *pStmt){
76530
+SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt){
7653176531
Vdbe *p = (Vdbe *)pStmt;
7653276532
return p ? p->zSql : 0;
7653376533
}
7653476534
7653576535
/*
@@ -76539,11 +76539,11 @@
7653976539
** freeing the returned string by passing it to sqlite3_free().
7654076540
**
7654176541
** The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of
7654276542
** expanded bound parameters.
7654376543
*/
76544
-SQLITE_API char *SQLITE_APICALL sqlite3_expanded_sql(sqlite3_stmt *pStmt){
76544
+SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt){
7654576545
#ifdef SQLITE_OMIT_TRACE
7654676546
return 0;
7654776547
#else
7654876548
char *z = 0;
7654976549
const char *zSql = sqlite3_sql(pStmt);
@@ -76581,11 +76581,11 @@
7658176581
7658276582
/*
7658376583
** This function is called from within a pre-update callback to retrieve
7658476584
** a field of the row currently being updated or deleted.
7658576585
*/
76586
-SQLITE_API int SQLITE_APICALL sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
76586
+SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
7658776587
PreUpdate *p = db->pPreUpdate;
7658876588
int rc = SQLITE_OK;
7658976589
7659076590
/* Test that this call is being made from within an SQLITE_DELETE or
7659176591
** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */
@@ -76636,11 +76636,11 @@
7663676636
#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
7663776637
/*
7663876638
** This function is called from within a pre-update callback to retrieve
7663976639
** the number of columns in the row being updated, deleted or inserted.
7664076640
*/
76641
-SQLITE_API int SQLITE_APICALL sqlite3_preupdate_count(sqlite3 *db){
76641
+SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *db){
7664276642
PreUpdate *p = db->pPreUpdate;
7664376643
return (p ? p->keyinfo.nField : 0);
7664476644
}
7664576645
#endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
7664676646
@@ -76654,11 +76654,11 @@
7665476654
** top-level trigger etc.).
7665576655
**
7665676656
** For the purposes of the previous paragraph, a foreign key CASCADE, SET NULL
7665776657
** or SET DEFAULT action is considered a trigger.
7665876658
*/
76659
-SQLITE_API int SQLITE_APICALL sqlite3_preupdate_depth(sqlite3 *db){
76659
+SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *db){
7666076660
PreUpdate *p = db->pPreUpdate;
7666176661
return (p ? p->v->nFrame : 0);
7666276662
}
7666376663
#endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
7666476664
@@ -76665,11 +76665,11 @@
7666576665
#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
7666676666
/*
7666776667
** This function is called from within a pre-update callback to retrieve
7666876668
** a field of the row currently being updated or inserted.
7666976669
*/
76670
-SQLITE_API int SQLITE_APICALL sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
76670
+SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
7667176671
PreUpdate *p = db->pPreUpdate;
7667276672
int rc = SQLITE_OK;
7667376673
Mem *pMem;
7667476674
7667576675
if( !p || p->op==SQLITE_DELETE ){
@@ -76739,11 +76739,11 @@
7673976739
7674076740
#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
7674176741
/*
7674276742
** Return status data for a single loop within query pStmt.
7674376743
*/
76744
-SQLITE_API int SQLITE_APICALL sqlite3_stmt_scanstatus(
76744
+SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus(
7674576745
sqlite3_stmt *pStmt, /* Prepared statement being queried */
7674676746
int idx, /* Index of loop to report on */
7674776747
int iScanStatusOp, /* Which metric to return */
7674876748
void *pOut /* OUT: Write the answer here */
7674976749
){
@@ -76798,11 +76798,11 @@
7679876798
}
7679976799
7680076800
/*
7680176801
** Zero all counters associated with the sqlite3_stmt_scanstatus() data.
7680276802
*/
76803
-SQLITE_API void SQLITE_APICALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){
76803
+SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){
7680476804
Vdbe *p = (Vdbe*)pStmt;
7680576805
memset(p->anExec, 0, p->nOp * sizeof(i64));
7680676806
}
7680776807
#endif /* SQLITE_ENABLE_STMT_SCANSTATUS */
7680876808
@@ -77325,11 +77325,11 @@
7732577325
** Try to convert the type of a function argument or a result column
7732677326
** into a numeric representation. Use either INTEGER or REAL whichever
7732777327
** is appropriate. But only do the conversion if it is possible without
7732877328
** loss of information and return the revised type of the argument.
7732977329
*/
77330
-SQLITE_API int SQLITE_APICALL sqlite3_value_numeric_type(sqlite3_value *pVal){
77330
+SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value *pVal){
7733177331
int eType = sqlite3_value_type(pVal);
7733277332
if( eType==SQLITE_TEXT ){
7733377333
Mem *pMem = (Mem*)pVal;
7733477334
applyNumericAffinity(pMem, 0);
7733577335
eType = sqlite3_value_type(pVal);
@@ -84177,11 +84177,11 @@
8417784177
}
8417884178
8417984179
/*
8418084180
** Open a blob handle.
8418184181
*/
84182
-SQLITE_API int SQLITE_APICALL sqlite3_blob_open(
84182
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
8418384183
sqlite3* db, /* The database connection */
8418484184
const char *zDb, /* The attached database containing the blob */
8418584185
const char *zTable, /* The table containing the blob */
8418684186
const char *zColumn, /* The column containing the blob */
8418784187
sqlite_int64 iRow, /* The row containing the glob */
@@ -84418,11 +84418,11 @@
8441884418
8441984419
/*
8442084420
** Close a blob handle that was previously created using
8442184421
** sqlite3_blob_open().
8442284422
*/
84423
-SQLITE_API int SQLITE_APICALL sqlite3_blob_close(sqlite3_blob *pBlob){
84423
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *pBlob){
8442484424
Incrblob *p = (Incrblob *)pBlob;
8442584425
int rc;
8442684426
sqlite3 *db;
8442784427
8442884428
if( p ){
@@ -84511,28 +84511,28 @@
8451184511
}
8451284512
8451384513
/*
8451484514
** Read data from a blob handle.
8451584515
*/
84516
-SQLITE_API int SQLITE_APICALL sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){
84516
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){
8451784517
return blobReadWrite(pBlob, z, n, iOffset, sqlite3BtreeData);
8451884518
}
8451984519
8452084520
/*
8452184521
** Write data to a blob handle.
8452284522
*/
84523
-SQLITE_API int SQLITE_APICALL sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){
84523
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){
8452484524
return blobReadWrite(pBlob, (void *)z, n, iOffset, sqlite3BtreePutData);
8452584525
}
8452684526
8452784527
/*
8452884528
** Query a blob handle for the size of the data.
8452984529
**
8453084530
** The Incrblob.nByte field is fixed for the lifetime of the Incrblob
8453184531
** so no mutex is required for access.
8453284532
*/
84533
-SQLITE_API int SQLITE_APICALL sqlite3_blob_bytes(sqlite3_blob *pBlob){
84533
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *pBlob){
8453484534
Incrblob *p = (Incrblob *)pBlob;
8453584535
return (p && p->pStmt) ? p->nByte : 0;
8453684536
}
8453784537
8453884538
/*
@@ -84543,11 +84543,11 @@
8454384543
** contain a blob or text value, then an error code is returned and the
8454484544
** database handle error code and message set. If this happens, then all
8454584545
** subsequent calls to sqlite3_blob_xxx() functions (except blob_close())
8454684546
** immediately return SQLITE_ABORT.
8454784547
*/
84548
-SQLITE_API int SQLITE_APICALL sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){
84548
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){
8454984549
int rc;
8455084550
Incrblob *p = (Incrblob *)pBlob;
8455184551
sqlite3 *db;
8455284552
8455384553
if( p==0 ) return SQLITE_MISUSE_BKPT;
@@ -88640,11 +88640,15 @@
8864088640
}
8864188641
if( is_agg && (pNC->ncFlags & NC_AllowAgg)==0 ){
8864288642
sqlite3ErrorMsg(pParse, "misuse of aggregate function %.*s()", nId,zId);
8864388643
pNC->nErr++;
8864488644
is_agg = 0;
88645
- }else if( no_such_func && pParse->db->init.busy==0 ){
88645
+ }else if( no_such_func && pParse->db->init.busy==0
88646
+#ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
88647
+ && pParse->explain==0
88648
+#endif
88649
+ ){
8864688650
sqlite3ErrorMsg(pParse, "no such function: %.*s", nId, zId);
8864788651
pNC->nErr++;
8864888652
}else if( wrong_num_args ){
8864988653
sqlite3ErrorMsg(pParse,"wrong number of arguments to function %.*s()",
8865088654
nId, zId);
@@ -92365,10 +92369,15 @@
9236592369
}
9236692370
nFarg = pFarg ? pFarg->nExpr : 0;
9236792371
assert( !ExprHasProperty(pExpr, EP_IntValue) );
9236892372
zId = pExpr->u.zToken;
9236992373
pDef = sqlite3FindFunction(db, zId, nFarg, enc, 0);
92374
+#ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
92375
+ if( pDef==0 && pParse->explain ){
92376
+ pDef = sqlite3FindFunction(db, "unknown", nFarg, enc, 0);
92377
+ }
92378
+#endif
9237092379
if( pDef==0 || pDef->xFinalize!=0 ){
9237192380
sqlite3ErrorMsg(pParse, "unknown function: %s()", zId);
9237292381
break;
9237392382
}
9237492383
@@ -97147,11 +97156,11 @@
9714797156
** and attempts to write the column will be ignored.
9714897157
**
9714997158
** Setting the auth function to NULL disables this hook. The default
9715097159
** setting of the auth function is NULL.
9715197160
*/
97152
-SQLITE_API int SQLITE_APICALL sqlite3_set_authorizer(
97161
+SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
9715397162
sqlite3 *db,
9715497163
int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
9715597164
void *pArg
9715697165
){
9715797166
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -103910,18 +103919,18 @@
103910103919
}
103911103920
103912103921
/*
103913103922
** The sqlite3_strglob() interface.
103914103923
*/
103915
-SQLITE_API int SQLITE_APICALL sqlite3_strglob(const char *zGlobPattern, const char *zString){
103924
+SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlobPattern, const char *zString){
103916103925
return patternCompare((u8*)zGlobPattern, (u8*)zString, &globInfo, '[')==0;
103917103926
}
103918103927
103919103928
/*
103920103929
** The sqlite3_strlike() interface.
103921103930
*/
103922
-SQLITE_API int SQLITE_APICALL sqlite3_strlike(const char *zPattern, const char *zStr, unsigned int esc){
103931
+SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zPattern, const char *zStr, unsigned int esc){
103923103932
return patternCompare((u8*)zPattern, (u8*)zStr, &likeInfoNorm, esc)==0;
103924103933
}
103925103934
103926103935
/*
103927103936
** Count the number of times that the LIKE operator (or GLOB which is
@@ -104473,10 +104482,30 @@
104473104482
}
104474104483
}
104475104484
sqlite3_result_text(context, (char*)zIn, nIn, SQLITE_TRANSIENT);
104476104485
}
104477104486
104487
+
104488
+#ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
104489
+/*
104490
+** The "unknown" function is automatically substituted in place of
104491
+** any unrecognized function name when doing an EXPLAIN or EXPLAIN QUERY PLAN
104492
+** when the SQLITE_ENABLE_UNKNOWN_FUNCTION compile-time option is used.
104493
+** When the "sqlite3" command-line shell is built using this functionality,
104494
+** that allows an EXPLAIN or EXPLAIN QUERY PLAN for complex queries
104495
+** involving application-defined functions to be examined in a generic
104496
+** sqlite3 shell.
104497
+*/
104498
+static void unknownFunc(
104499
+ sqlite3_context *context,
104500
+ int argc,
104501
+ sqlite3_value **argv
104502
+){
104503
+ /* no-op */
104504
+}
104505
+#endif /*SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION*/
104506
+
104478104507
104479104508
/* IMP: R-25361-16150 This function is omitted from SQLite by default. It
104480104509
** is only available if the SQLITE_SOUNDEX compile-time option is used
104481104510
** when SQLite is built.
104482104511
*/
@@ -104944,17 +104973,20 @@
104944104973
AGGREGATE(count, 1, 0, 0, countStep, countFinalize ),
104945104974
AGGREGATE(group_concat, 1, 0, 0, groupConcatStep, groupConcatFinalize),
104946104975
AGGREGATE(group_concat, 2, 0, 0, groupConcatStep, groupConcatFinalize),
104947104976
104948104977
LIKEFUNC(glob, 2, &globInfo, SQLITE_FUNC_LIKE|SQLITE_FUNC_CASE),
104949
- #ifdef SQLITE_CASE_SENSITIVE_LIKE
104978
+#ifdef SQLITE_CASE_SENSITIVE_LIKE
104950104979
LIKEFUNC(like, 2, &likeInfoAlt, SQLITE_FUNC_LIKE|SQLITE_FUNC_CASE),
104951104980
LIKEFUNC(like, 3, &likeInfoAlt, SQLITE_FUNC_LIKE|SQLITE_FUNC_CASE),
104952
- #else
104981
+#else
104953104982
LIKEFUNC(like, 2, &likeInfoNorm, SQLITE_FUNC_LIKE),
104954104983
LIKEFUNC(like, 3, &likeInfoNorm, SQLITE_FUNC_LIKE),
104955
- #endif
104984
+#endif
104985
+#ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
104986
+ FUNCTION(unknown, -1, 0, 0, unknownFunc ),
104987
+#endif
104956104988
FUNCTION(coalesce, 1, 0, 0, 0 ),
104957104989
FUNCTION(coalesce, 0, 0, 0, 0 ),
104958104990
FUNCTION2(coalesce, -1, 0, 0, noopFunc, SQLITE_FUNC_COALESCE),
104959104991
};
104960104992
#ifndef SQLITE_OMIT_ALTERTABLE
@@ -108613,11 +108645,11 @@
108613108645
** If the SQL is a query, then for each row in the query result
108614108646
** the xCallback() function is called. pArg becomes the first
108615108647
** argument to xCallback(). If xCallback=NULL then no callback
108616108648
** is invoked, even for queries.
108617108649
*/
108618
-SQLITE_API int SQLITE_APICALL sqlite3_exec(
108650
+SQLITE_API int SQLITE_STDCALL sqlite3_exec(
108619108651
sqlite3 *db, /* The database on which the SQL executes */
108620108652
const char *zSql, /* The SQL to be executed */
108621108653
sqlite3_callback xCallback, /* Invoke this callback routine */
108622108654
void *pArg, /* First argument to xCallback() */
108623108655
char **pzErrMsg /* Write error messages here */
@@ -109875,11 +109907,11 @@
109875109907
db->aExtension = aHandle;
109876109908
109877109909
db->aExtension[db->nExtension++] = handle;
109878109910
return SQLITE_OK;
109879109911
}
109880
-SQLITE_API int SQLITE_APICALL sqlite3_load_extension(
109912
+SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
109881109913
sqlite3 *db, /* Load the extension into this database connection */
109882109914
const char *zFile, /* Name of the shared library containing extension */
109883109915
const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */
109884109916
char **pzErrMsg /* Put error message here if not 0 */
109885109917
){
@@ -109906,11 +109938,11 @@
109906109938
109907109939
/*
109908109940
** Enable or disable extension loading. Extension loading is disabled by
109909109941
** default so as not to open security holes in older applications.
109910109942
*/
109911
-SQLITE_API int SQLITE_APICALL sqlite3_enable_load_extension(sqlite3 *db, int onoff){
109943
+SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff){
109912109944
sqlite3_mutex_enter(db->mutex);
109913109945
if( onoff ){
109914109946
db->flags |= SQLITE_LoadExtension|SQLITE_LoadExtFunc;
109915109947
}else{
109916109948
db->flags &= ~(SQLITE_LoadExtension|SQLITE_LoadExtFunc);
@@ -109963,11 +109995,11 @@
109963109995
109964109996
/*
109965109997
** Register a statically linked extension that is automatically
109966109998
** loaded by every new database connection.
109967109999
*/
109968
-SQLITE_API int SQLITE_APICALL sqlite3_auto_extension(
110000
+SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(
109969110001
void (*xInit)(void)
109970110002
){
109971110003
int rc = SQLITE_OK;
109972110004
#ifndef SQLITE_OMIT_AUTOINIT
109973110005
rc = sqlite3_initialize();
@@ -110010,11 +110042,11 @@
110010110042
** routine is a no-op.
110011110043
**
110012110044
** Return 1 if xInit was found on the list and removed. Return 0 if xInit
110013110045
** was not on the list.
110014110046
*/
110015
-SQLITE_API int SQLITE_APICALL sqlite3_cancel_auto_extension(
110047
+SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(
110016110048
void (*xInit)(void)
110017110049
){
110018110050
#if SQLITE_THREADSAFE
110019110051
sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
110020110052
#endif
@@ -110035,11 +110067,11 @@
110035110067
}
110036110068
110037110069
/*
110038110070
** Reset the automatic extension loading mechanism.
110039110071
*/
110040
-SQLITE_API void SQLITE_APICALL sqlite3_reset_auto_extension(void){
110072
+SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void){
110041110073
#ifndef SQLITE_OMIT_AUTOINIT
110042110074
if( sqlite3_initialize()==SQLITE_OK )
110043110075
#endif
110044110076
{
110045110077
#if SQLITE_THREADSAFE
@@ -113296,11 +113328,11 @@
113296113328
** and so if a schema change occurs, SQLITE_SCHEMA is returned by
113297113329
** sqlite3_step(). In the new version, the original SQL text is retained
113298113330
** and the statement is automatically recompiled if an schema change
113299113331
** occurs.
113300113332
*/
113301
-SQLITE_API int SQLITE_APICALL sqlite3_prepare(
113333
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
113302113334
sqlite3 *db, /* Database handle. */
113303113335
const char *zSql, /* UTF-8 encoded SQL statement. */
113304113336
int nBytes, /* Length of zSql in bytes. */
113305113337
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113306113338
const char **pzTail /* OUT: End of parsed string */
@@ -113308,11 +113340,11 @@
113308113340
int rc;
113309113341
rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,0,ppStmt,pzTail);
113310113342
assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
113311113343
return rc;
113312113344
}
113313
-SQLITE_API int SQLITE_APICALL sqlite3_prepare_v2(
113345
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
113314113346
sqlite3 *db, /* Database handle. */
113315113347
const char *zSql, /* UTF-8 encoded SQL statement. */
113316113348
int nBytes, /* Length of zSql in bytes. */
113317113349
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113318113350
const char **pzTail /* OUT: End of parsed string */
@@ -113384,11 +113416,11 @@
113384113416
** and so if a schema change occurs, SQLITE_SCHEMA is returned by
113385113417
** sqlite3_step(). In the new version, the original SQL text is retained
113386113418
** and the statement is automatically recompiled if an schema change
113387113419
** occurs.
113388113420
*/
113389
-SQLITE_API int SQLITE_APICALL sqlite3_prepare16(
113421
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
113390113422
sqlite3 *db, /* Database handle. */
113391113423
const void *zSql, /* UTF-16 encoded SQL statement. */
113392113424
int nBytes, /* Length of zSql in bytes. */
113393113425
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113394113426
const void **pzTail /* OUT: End of parsed string */
@@ -113396,11 +113428,11 @@
113396113428
int rc;
113397113429
rc = sqlite3Prepare16(db,zSql,nBytes,0,ppStmt,pzTail);
113398113430
assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
113399113431
return rc;
113400113432
}
113401
-SQLITE_API int SQLITE_APICALL sqlite3_prepare16_v2(
113433
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
113402113434
sqlite3 *db, /* Database handle. */
113403113435
const void *zSql, /* UTF-16 encoded SQL statement. */
113404113436
int nBytes, /* Length of zSql in bytes. */
113405113437
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113406113438
const void **pzTail /* OUT: End of parsed string */
@@ -119239,11 +119271,11 @@
119239119271
** The result that is written to ***pazResult is held in memory obtained
119240119272
** from malloc(). But the caller cannot free this memory directly.
119241119273
** Instead, the entire table should be passed to sqlite3_free_table() when
119242119274
** the calling procedure is finished using it.
119243119275
*/
119244
-SQLITE_API int SQLITE_APICALL sqlite3_get_table(
119276
+SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
119245119277
sqlite3 *db, /* The database on which the SQL executes */
119246119278
const char *zSql, /* The SQL to be executed */
119247119279
char ***pazResult, /* Write the result table here */
119248119280
int *pnRow, /* Write the number of rows in the result here */
119249119281
int *pnColumn, /* Write the number of columns of result here */
@@ -119308,11 +119340,11 @@
119308119340
}
119309119341
119310119342
/*
119311119343
** This routine frees the space the sqlite3_get_table() malloced.
119312119344
*/
119313
-SQLITE_API void SQLITE_APICALL sqlite3_free_table(
119345
+SQLITE_API void SQLITE_STDCALL sqlite3_free_table(
119314119346
char **azResult /* Result returned from sqlite3_get_table() */
119315119347
){
119316119348
if( azResult ){
119317119349
int i, n;
119318119350
azResult--;
@@ -121718,11 +121750,11 @@
121718121750
121719121751
121720121752
/*
121721121753
** External API function used to create a new virtual-table module.
121722121754
*/
121723
-SQLITE_API int SQLITE_APICALL sqlite3_create_module(
121755
+SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
121724121756
sqlite3 *db, /* Database in which module is registered */
121725121757
const char *zName, /* Name assigned to this module */
121726121758
const sqlite3_module *pModule, /* The definition of the module */
121727121759
void *pAux /* Context pointer for xCreate/xConnect */
121728121760
){
@@ -121733,11 +121765,11 @@
121733121765
}
121734121766
121735121767
/*
121736121768
** External API function used to create a new virtual-table module.
121737121769
*/
121738
-SQLITE_API int SQLITE_APICALL sqlite3_create_module_v2(
121770
+SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
121739121771
sqlite3 *db, /* Database in which module is registered */
121740121772
const char *zName, /* Name assigned to this module */
121741121773
const sqlite3_module *pModule, /* The definition of the module */
121742121774
void *pAux, /* Context pointer for xCreate/xConnect */
121743121775
void (*xDestroy)(void *) /* Module destructor function */
@@ -122357,11 +122389,11 @@
122357122389
/*
122358122390
** This function is used to set the schema of a virtual table. It is only
122359122391
** valid to call this function from within the xCreate() or xConnect() of a
122360122392
** virtual table module.
122361122393
*/
122362
-SQLITE_API int SQLITE_APICALL sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
122394
+SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
122363122395
VtabCtx *pCtx;
122364122396
Parse *pParse;
122365122397
int rc = SQLITE_OK;
122366122398
Table *pTab;
122367122399
char *zErr = 0;
@@ -122587,11 +122619,14 @@
122587122619
if( rc==SQLITE_OK ){
122588122620
rc = pModule->xBegin(pVTab->pVtab);
122589122621
if( rc==SQLITE_OK ){
122590122622
int iSvpt = db->nStatement + db->nSavepoint;
122591122623
addToVTrans(db, pVTab);
122592
- if( iSvpt ) rc = sqlite3VtabSavepoint(db, SAVEPOINT_BEGIN, iSvpt-1);
122624
+ if( iSvpt && pModule->xSavepoint ){
122625
+ pVTab->iSavepoint = iSvpt;
122626
+ rc = pModule->xSavepoint(pVTab->pVtab, iSvpt-1);
122627
+ }
122593122628
}
122594122629
}
122595122630
}
122596122631
return rc;
122597122632
}
@@ -122811,11 +122846,11 @@
122811122846
** table update operation currently in progress.
122812122847
**
122813122848
** The results of this routine are undefined unless it is called from
122814122849
** within an xUpdate method.
122815122850
*/
122816
-SQLITE_API int SQLITE_APICALL sqlite3_vtab_on_conflict(sqlite3 *db){
122851
+SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *db){
122817122852
static const unsigned char aMap[] = {
122818122853
SQLITE_ROLLBACK, SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_REPLACE
122819122854
};
122820122855
#ifdef SQLITE_ENABLE_API_ARMOR
122821122856
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -130601,11 +130636,11 @@
130601130636
}else{
130602130637
pWInfo->nOBSat = pFrom->isOrdered;
130603130638
pWInfo->revMask = pFrom->revLoop;
130604130639
if( pWInfo->nOBSat<=0 ){
130605130640
pWInfo->nOBSat = 0;
130606
- if( nLoop>0 ){
130641
+ if( nLoop>0 && (pFrom->aLoop[nLoop-1]->wsFlags & WHERE_ONEROW)==0 ){
130607130642
Bitmask m = 0;
130608130643
int rc = wherePathSatisfiesOrderBy(pWInfo, pWInfo->pOrderBy, pFrom,
130609130644
WHERE_ORDERBY_LIMIT, nLoop-1, pFrom->aLoop[nLoop-1], &m);
130610130645
if( rc==pWInfo->pOrderBy->nExpr ){
130611130646
pWInfo->bOrderedInnerLoop = 1;
@@ -136136,11 +136171,11 @@
136136136171
**
136137136172
** If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed
136138136173
** to recognize the end of a trigger can be omitted. All we have to do
136139136174
** is look for a semicolon that is not part of an string or comment.
136140136175
*/
136141
-SQLITE_API int SQLITE_APICALL sqlite3_complete(const char *zSql){
136176
+SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *zSql){
136142136177
u8 state = 0; /* Current state, using numbers defined in header comment */
136143136178
u8 token; /* Value of the next token */
136144136179
136145136180
#ifndef SQLITE_OMIT_TRIGGER
136146136181
/* A complex statement machine used to detect the end of a CREATE TRIGGER
@@ -136301,11 +136336,11 @@
136301136336
/*
136302136337
** This routine is the same as the sqlite3_complete() routine described
136303136338
** above, except that the parameter is required to be UTF-16 encoded, not
136304136339
** UTF-8.
136305136340
*/
136306
-SQLITE_API int SQLITE_APICALL sqlite3_complete16(const void *zSql){
136341
+SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *zSql){
136307136342
sqlite3_value *pVal;
136308136343
char const *zSql8;
136309136344
int rc;
136310136345
136311136346
#ifndef SQLITE_OMIT_AUTOINIT
@@ -136461,28 +136496,28 @@
136461136496
#endif
136462136497
136463136498
/* IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns
136464136499
** a pointer to the to the sqlite3_version[] string constant.
136465136500
*/
136466
-SQLITE_API const char *SQLITE_APICALL sqlite3_libversion(void){ return sqlite3_version; }
136501
+SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void){ return sqlite3_version; }
136467136502
136468136503
/* IMPLEMENTATION-OF: R-63124-39300 The sqlite3_sourceid() function returns a
136469136504
** pointer to a string constant whose value is the same as the
136470136505
** SQLITE_SOURCE_ID C preprocessor macro.
136471136506
*/
136472
-SQLITE_API const char *SQLITE_APICALL sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
136507
+SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
136473136508
136474136509
/* IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function
136475136510
** returns an integer equal to SQLITE_VERSION_NUMBER.
136476136511
*/
136477
-SQLITE_API int SQLITE_APICALL sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; }
136512
+SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; }
136478136513
136479136514
/* IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns
136480136515
** zero if and only if SQLite was compiled with mutexing code omitted due to
136481136516
** the SQLITE_THREADSAFE compile-time option being set to 0.
136482136517
*/
136483
-SQLITE_API int SQLITE_APICALL sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; }
136518
+SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; }
136484136519
136485136520
/*
136486136521
** When compiling the test fixture or with debugging enabled (on Win32),
136487136522
** this variable being set to non-zero will cause OSTRACE macros to emit
136488136523
** extra diagnostic information.
@@ -136551,11 +136586,11 @@
136551136586
** call by X completes.
136552136587
**
136553136588
** * Recursive calls to this routine from thread X return immediately
136554136589
** without blocking.
136555136590
*/
136556
-SQLITE_API int SQLITE_APICALL sqlite3_initialize(void){
136591
+SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void){
136557136592
MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */
136558136593
int rc; /* Result code */
136559136594
#ifdef SQLITE_EXTRA_INIT
136560136595
int bRunExtraInit = 0; /* Extra initialization needed */
136561136596
#endif
@@ -136717,11 +136752,11 @@
136717136752
** while any part of SQLite is otherwise in use in any thread. This
136718136753
** routine is not threadsafe. But it is safe to invoke this routine
136719136754
** on when SQLite is already shut down. If SQLite is already shut down
136720136755
** when this routine is invoked, then this routine is a harmless no-op.
136721136756
*/
136722
-SQLITE_API int SQLITE_APICALL sqlite3_shutdown(void){
136757
+SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void){
136723136758
#ifdef SQLITE_OMIT_WSD
136724136759
int rc = sqlite3_wsd_init(4096, 24);
136725136760
if( rc!=SQLITE_OK ){
136726136761
return rc;
136727136762
}
@@ -137136,11 +137171,11 @@
137136137171
}
137137137172
137138137173
/*
137139137174
** Return the mutex associated with a database connection.
137140137175
*/
137141
-SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_db_mutex(sqlite3 *db){
137176
+SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3 *db){
137142137177
#ifdef SQLITE_ENABLE_API_ARMOR
137143137178
if( !sqlite3SafetyCheckOk(db) ){
137144137179
(void)SQLITE_MISUSE_BKPT;
137145137180
return 0;
137146137181
}
@@ -137150,11 +137185,11 @@
137150137185
137151137186
/*
137152137187
** Free up as much memory as we can from the given database
137153137188
** connection.
137154137189
*/
137155
-SQLITE_API int SQLITE_APICALL sqlite3_db_release_memory(sqlite3 *db){
137190
+SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3 *db){
137156137191
int i;
137157137192
137158137193
#ifdef SQLITE_ENABLE_API_ARMOR
137159137194
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
137160137195
#endif
@@ -137174,11 +137209,11 @@
137174137209
137175137210
/*
137176137211
** Flush any dirty pages in the pager-cache for any attached database
137177137212
** to disk.
137178137213
*/
137179
-SQLITE_API int SQLITE_APICALL sqlite3_db_cacheflush(sqlite3 *db){
137214
+SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3 *db){
137180137215
int i;
137181137216
int rc = SQLITE_OK;
137182137217
int bSeenBusy = 0;
137183137218
137184137219
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -137324,11 +137359,11 @@
137324137359
}
137325137360
137326137361
/*
137327137362
** Return the ROWID of the most recent insert
137328137363
*/
137329
-SQLITE_API sqlite_int64 SQLITE_APICALL sqlite3_last_insert_rowid(sqlite3 *db){
137364
+SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3 *db){
137330137365
#ifdef SQLITE_ENABLE_API_ARMOR
137331137366
if( !sqlite3SafetyCheckOk(db) ){
137332137367
(void)SQLITE_MISUSE_BKPT;
137333137368
return 0;
137334137369
}
@@ -137337,11 +137372,11 @@
137337137372
}
137338137373
137339137374
/*
137340137375
** Return the number of changes in the most recent call to sqlite3_exec().
137341137376
*/
137342
-SQLITE_API int SQLITE_APICALL sqlite3_changes(sqlite3 *db){
137377
+SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3 *db){
137343137378
#ifdef SQLITE_ENABLE_API_ARMOR
137344137379
if( !sqlite3SafetyCheckOk(db) ){
137345137380
(void)SQLITE_MISUSE_BKPT;
137346137381
return 0;
137347137382
}
@@ -137350,11 +137385,11 @@
137350137385
}
137351137386
137352137387
/*
137353137388
** Return the number of changes since the database handle was opened.
137354137389
*/
137355
-SQLITE_API int SQLITE_APICALL sqlite3_total_changes(sqlite3 *db){
137390
+SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3 *db){
137356137391
#ifdef SQLITE_ENABLE_API_ARMOR
137357137392
if( !sqlite3SafetyCheckOk(db) ){
137358137393
(void)SQLITE_MISUSE_BKPT;
137359137394
return 0;
137360137395
}
@@ -137501,12 +137536,12 @@
137501137536
** statements or unfinished sqlite3_backups. The sqlite3_close_v2()
137502137537
** version forces the connection to become a zombie if there are
137503137538
** unclosed resources, and arranges for deallocation when the last
137504137539
** prepare statement or sqlite3_backup closes.
137505137540
*/
137506
-SQLITE_API int SQLITE_APICALL sqlite3_close(sqlite3 *db){ return sqlite3Close(db,0); }
137507
-SQLITE_API int SQLITE_APICALL sqlite3_close_v2(sqlite3 *db){ return sqlite3Close(db,1); }
137541
+SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3 *db){ return sqlite3Close(db,0); }
137542
+SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3 *db){ return sqlite3Close(db,1); }
137508137543
137509137544
137510137545
/*
137511137546
** Close the mutex on database connection db.
137512137547
**
@@ -137909,11 +137944,11 @@
137909137944
137910137945
/*
137911137946
** This routine sets the busy callback for an Sqlite database to the
137912137947
** given callback function with the given argument.
137913137948
*/
137914
-SQLITE_API int SQLITE_APICALL sqlite3_busy_handler(
137949
+SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(
137915137950
sqlite3 *db,
137916137951
int (*xBusy)(void*,int),
137917137952
void *pArg
137918137953
){
137919137954
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -137932,11 +137967,11 @@
137932137967
/*
137933137968
** This routine sets the progress callback for an Sqlite database to the
137934137969
** given callback function with the given argument. The progress callback will
137935137970
** be invoked every nOps opcodes.
137936137971
*/
137937
-SQLITE_API void SQLITE_APICALL sqlite3_progress_handler(
137972
+SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(
137938137973
sqlite3 *db,
137939137974
int nOps,
137940137975
int (*xProgress)(void*),
137941137976
void *pArg
137942137977
){
@@ -137963,11 +137998,11 @@
137963137998
137964137999
/*
137965138000
** This routine installs a default busy handler that waits for the
137966138001
** specified number of milliseconds before returning 0.
137967138002
*/
137968
-SQLITE_API int SQLITE_APICALL sqlite3_busy_timeout(sqlite3 *db, int ms){
138003
+SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3 *db, int ms){
137969138004
#ifdef SQLITE_ENABLE_API_ARMOR
137970138005
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
137971138006
#endif
137972138007
if( ms>0 ){
137973138008
sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db);
@@ -137979,11 +138014,11 @@
137979138014
}
137980138015
137981138016
/*
137982138017
** Cause any pending operation to stop at its earliest opportunity.
137983138018
*/
137984
-SQLITE_API void SQLITE_APICALL sqlite3_interrupt(sqlite3 *db){
138019
+SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3 *db){
137985138020
#ifdef SQLITE_ENABLE_API_ARMOR
137986138021
if( !sqlite3SafetyCheckOk(db) ){
137987138022
(void)SQLITE_MISUSE_BKPT;
137988138023
return;
137989138024
}
@@ -138095,11 +138130,11 @@
138095138130
}
138096138131
138097138132
/*
138098138133
** Create new user functions.
138099138134
*/
138100
-SQLITE_API int SQLITE_APICALL sqlite3_create_function(
138135
+SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
138101138136
sqlite3 *db,
138102138137
const char *zFunc,
138103138138
int nArg,
138104138139
int enc,
138105138140
void *p,
@@ -138109,11 +138144,11 @@
138109138144
){
138110138145
return sqlite3_create_function_v2(db, zFunc, nArg, enc, p, xSFunc, xStep,
138111138146
xFinal, 0);
138112138147
}
138113138148
138114
-SQLITE_API int SQLITE_APICALL sqlite3_create_function_v2(
138149
+SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
138115138150
sqlite3 *db,
138116138151
const char *zFunc,
138117138152
int nArg,
138118138153
int enc,
138119138154
void *p,
@@ -138152,11 +138187,11 @@
138152138187
sqlite3_mutex_leave(db->mutex);
138153138188
return rc;
138154138189
}
138155138190
138156138191
#ifndef SQLITE_OMIT_UTF16
138157
-SQLITE_API int SQLITE_APICALL sqlite3_create_function16(
138192
+SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
138158138193
sqlite3 *db,
138159138194
const void *zFunctionName,
138160138195
int nArg,
138161138196
int eTextRep,
138162138197
void *p,
@@ -138192,11 +138227,11 @@
138192138227
** When virtual tables intend to provide an overloaded function, they
138193138228
** should call this routine to make sure the global function exists.
138194138229
** A global function must exist in order for name resolution to work
138195138230
** properly.
138196138231
*/
138197
-SQLITE_API int SQLITE_APICALL sqlite3_overload_function(
138232
+SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(
138198138233
sqlite3 *db,
138199138234
const char *zName,
138200138235
int nArg
138201138236
){
138202138237
int rc = SQLITE_OK;
@@ -138224,11 +138259,11 @@
138224138259
** A NULL trace function means that no tracing is executes. A non-NULL
138225138260
** trace is a pointer to a function that is invoked at the start of each
138226138261
** SQL statement.
138227138262
*/
138228138263
#ifndef SQLITE_OMIT_DEPRECATED
138229
-SQLITE_API void *SQLITE_APICALL sqlite3_trace(sqlite3 *db, void(*xTrace)(void*,const char*), void *pArg){
138264
+SQLITE_API void *SQLITE_STDCALL sqlite3_trace(sqlite3 *db, void(*xTrace)(void*,const char*), void *pArg){
138230138265
void *pOld;
138231138266
138232138267
#ifdef SQLITE_ENABLE_API_ARMOR
138233138268
if( !sqlite3SafetyCheckOk(db) ){
138234138269
(void)SQLITE_MISUSE_BKPT;
@@ -138245,11 +138280,11 @@
138245138280
}
138246138281
#endif /* SQLITE_OMIT_DEPRECATED */
138247138282
138248138283
/* Register a trace callback using the version-2 interface.
138249138284
*/
138250
-SQLITE_API int SQLITE_APICALL sqlite3_trace_v2(
138285
+SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2(
138251138286
sqlite3 *db, /* Trace this connection */
138252138287
unsigned mTrace, /* Mask of events to be traced */
138253138288
int(*xTrace)(unsigned,void*,void*,void*), /* Callback to invoke */
138254138289
void *pArg /* Context */
138255138290
){
@@ -138273,11 +138308,11 @@
138273138308
**
138274138309
** A NULL profile function means that no profiling is executes. A non-NULL
138275138310
** profile is a pointer to a function that is invoked at the conclusion of
138276138311
** each SQL statement that is run.
138277138312
*/
138278
-SQLITE_API void *SQLITE_APICALL sqlite3_profile(
138313
+SQLITE_API void *SQLITE_STDCALL sqlite3_profile(
138279138314
sqlite3 *db,
138280138315
void (*xProfile)(void*,const char*,sqlite_uint64),
138281138316
void *pArg
138282138317
){
138283138318
void *pOld;
@@ -138301,11 +138336,11 @@
138301138336
/*
138302138337
** Register a function to be invoked when a transaction commits.
138303138338
** If the invoked function returns non-zero, then the commit becomes a
138304138339
** rollback.
138305138340
*/
138306
-SQLITE_API void *SQLITE_APICALL sqlite3_commit_hook(
138341
+SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(
138307138342
sqlite3 *db, /* Attach the hook to this database */
138308138343
int (*xCallback)(void*), /* Function to invoke on each commit */
138309138344
void *pArg /* Argument to the function */
138310138345
){
138311138346
void *pOld;
@@ -138326,11 +138361,11 @@
138326138361
138327138362
/*
138328138363
** Register a callback to be invoked each time a row is updated,
138329138364
** inserted or deleted using this database connection.
138330138365
*/
138331
-SQLITE_API void *SQLITE_APICALL sqlite3_update_hook(
138366
+SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
138332138367
sqlite3 *db, /* Attach the hook to this database */
138333138368
void (*xCallback)(void*,int,char const *,char const *,sqlite_int64),
138334138369
void *pArg /* Argument to the function */
138335138370
){
138336138371
void *pRet;
@@ -138351,11 +138386,11 @@
138351138386
138352138387
/*
138353138388
** Register a callback to be invoked each time a transaction is rolled
138354138389
** back by this database connection.
138355138390
*/
138356
-SQLITE_API void *SQLITE_APICALL sqlite3_rollback_hook(
138391
+SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(
138357138392
sqlite3 *db, /* Attach the hook to this database */
138358138393
void (*xCallback)(void*), /* Callback function */
138359138394
void *pArg /* Argument to the function */
138360138395
){
138361138396
void *pRet;
@@ -138377,11 +138412,11 @@
138377138412
#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
138378138413
/*
138379138414
** Register a callback to be invoked each time a row is updated,
138380138415
** inserted or deleted using this database connection.
138381138416
*/
138382
-SQLITE_API void *SQLITE_APICALL sqlite3_preupdate_hook(
138417
+SQLITE_API void *SQLITE_STDCALL sqlite3_preupdate_hook(
138383138418
sqlite3 *db, /* Attach the hook to this database */
138384138419
void(*xCallback)( /* Callback function */
138385138420
void*,sqlite3*,int,char const*,char const*,sqlite3_int64,sqlite3_int64),
138386138421
void *pArg /* First callback argument */
138387138422
){
@@ -138426,11 +138461,11 @@
138426138461
** The callback registered by this function replaces any existing callback
138427138462
** registered using sqlite3_wal_hook(). Likewise, registering a callback
138428138463
** using sqlite3_wal_hook() disables the automatic checkpoint mechanism
138429138464
** configured by this function.
138430138465
*/
138431
-SQLITE_API int SQLITE_APICALL sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){
138466
+SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){
138432138467
#ifdef SQLITE_OMIT_WAL
138433138468
UNUSED_PARAMETER(db);
138434138469
UNUSED_PARAMETER(nFrame);
138435138470
#else
138436138471
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -138447,11 +138482,11 @@
138447138482
138448138483
/*
138449138484
** Register a callback to be invoked each time a transaction is written
138450138485
** into the write-ahead-log by this database connection.
138451138486
*/
138452
-SQLITE_API void *SQLITE_APICALL sqlite3_wal_hook(
138487
+SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
138453138488
sqlite3 *db, /* Attach the hook to this db handle */
138454138489
int(*xCallback)(void *, sqlite3*, const char*, int),
138455138490
void *pArg /* First argument passed to xCallback() */
138456138491
){
138457138492
#ifndef SQLITE_OMIT_WAL
@@ -138474,11 +138509,11 @@
138474138509
}
138475138510
138476138511
/*
138477138512
** Checkpoint database zDb.
138478138513
*/
138479
-SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint_v2(
138514
+SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
138480138515
sqlite3 *db, /* Database handle */
138481138516
const char *zDb, /* Name of attached database (or NULL) */
138482138517
int eMode, /* SQLITE_CHECKPOINT_* value */
138483138518
int *pnLog, /* OUT: Size of WAL log in frames */
138484138519
int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -138529,11 +138564,11 @@
138529138564
/*
138530138565
** Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points
138531138566
** to contains a zero-length string, all attached databases are
138532138567
** checkpointed.
138533138568
*/
138534
-SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){
138569
+SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){
138535138570
/* EVIDENCE-OF: R-41613-20553 The sqlite3_wal_checkpoint(D,X) is equivalent to
138536138571
** sqlite3_wal_checkpoint_v2(D,X,SQLITE_CHECKPOINT_PASSIVE,0,0). */
138537138572
return sqlite3_wal_checkpoint_v2(db,zDb,SQLITE_CHECKPOINT_PASSIVE,0,0);
138538138573
}
138539138574
@@ -138620,11 +138655,11 @@
138620138655
138621138656
/*
138622138657
** Return UTF-8 encoded English language explanation of the most recent
138623138658
** error.
138624138659
*/
138625
-SQLITE_API const char *SQLITE_APICALL sqlite3_errmsg(sqlite3 *db){
138660
+SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3 *db){
138626138661
const char *z;
138627138662
if( !db ){
138628138663
return sqlite3ErrStr(SQLITE_NOMEM_BKPT);
138629138664
}
138630138665
if( !sqlite3SafetyCheckSickOrOk(db) ){
@@ -138648,11 +138683,11 @@
138648138683
#ifndef SQLITE_OMIT_UTF16
138649138684
/*
138650138685
** Return UTF-16 encoded English language explanation of the most recent
138651138686
** error.
138652138687
*/
138653
-SQLITE_API const void *SQLITE_APICALL sqlite3_errmsg16(sqlite3 *db){
138688
+SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3 *db){
138654138689
static const u16 outOfMem[] = {
138655138690
'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0
138656138691
};
138657138692
static const u16 misuse[] = {
138658138693
'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ',
@@ -138693,38 +138728,38 @@
138693138728
138694138729
/*
138695138730
** Return the most recent error code generated by an SQLite routine. If NULL is
138696138731
** passed to this function, we assume a malloc() failed during sqlite3_open().
138697138732
*/
138698
-SQLITE_API int SQLITE_APICALL sqlite3_errcode(sqlite3 *db){
138733
+SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db){
138699138734
if( db && !sqlite3SafetyCheckSickOrOk(db) ){
138700138735
return SQLITE_MISUSE_BKPT;
138701138736
}
138702138737
if( !db || db->mallocFailed ){
138703138738
return SQLITE_NOMEM_BKPT;
138704138739
}
138705138740
return db->errCode & db->errMask;
138706138741
}
138707
-SQLITE_API int SQLITE_APICALL sqlite3_extended_errcode(sqlite3 *db){
138742
+SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db){
138708138743
if( db && !sqlite3SafetyCheckSickOrOk(db) ){
138709138744
return SQLITE_MISUSE_BKPT;
138710138745
}
138711138746
if( !db || db->mallocFailed ){
138712138747
return SQLITE_NOMEM_BKPT;
138713138748
}
138714138749
return db->errCode;
138715138750
}
138716
-SQLITE_API int SQLITE_APICALL sqlite3_system_errno(sqlite3 *db){
138751
+SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3 *db){
138717138752
return db ? db->iSysErrno : 0;
138718138753
}
138719138754
138720138755
/*
138721138756
** Return a string that describes the kind of error specified in the
138722138757
** argument. For now, this simply calls the internal sqlite3ErrStr()
138723138758
** function.
138724138759
*/
138725
-SQLITE_API const char *SQLITE_APICALL sqlite3_errstr(int rc){
138760
+SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int rc){
138726138761
return sqlite3ErrStr(rc);
138727138762
}
138728138763
138729138764
/*
138730138765
** Create a new collating function for database "db". The name is zName
@@ -138868,11 +138903,11 @@
138868138903
**
138869138904
** A new lower limit does not shrink existing constructs.
138870138905
** It merely prevents new constructs that exceed the limit
138871138906
** from forming.
138872138907
*/
138873
-SQLITE_API int SQLITE_APICALL sqlite3_limit(sqlite3 *db, int limitId, int newLimit){
138908
+SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3 *db, int limitId, int newLimit){
138874138909
int oldLimit;
138875138910
138876138911
#ifdef SQLITE_ENABLE_API_ARMOR
138877138912
if( !sqlite3SafetyCheckOk(db) ){
138878138913
(void)SQLITE_MISUSE_BKPT;
@@ -139492,18 +139527,18 @@
139492139527
}
139493139528
139494139529
/*
139495139530
** Open a new database handle.
139496139531
*/
139497
-SQLITE_API int SQLITE_APICALL sqlite3_open(
139532
+SQLITE_API int SQLITE_STDCALL sqlite3_open(
139498139533
const char *zFilename,
139499139534
sqlite3 **ppDb
139500139535
){
139501139536
return openDatabase(zFilename, ppDb,
139502139537
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0);
139503139538
}
139504
-SQLITE_API int SQLITE_APICALL sqlite3_open_v2(
139539
+SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
139505139540
const char *filename, /* Database filename (UTF-8) */
139506139541
sqlite3 **ppDb, /* OUT: SQLite db handle */
139507139542
int flags, /* Flags */
139508139543
const char *zVfs /* Name of VFS module to use */
139509139544
){
@@ -139512,11 +139547,11 @@
139512139547
139513139548
#ifndef SQLITE_OMIT_UTF16
139514139549
/*
139515139550
** Open a new database handle.
139516139551
*/
139517
-SQLITE_API int SQLITE_APICALL sqlite3_open16(
139552
+SQLITE_API int SQLITE_STDCALL sqlite3_open16(
139518139553
const void *zFilename,
139519139554
sqlite3 **ppDb
139520139555
){
139521139556
char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */
139522139557
sqlite3_value *pVal;
@@ -139551,11 +139586,11 @@
139551139586
#endif /* SQLITE_OMIT_UTF16 */
139552139587
139553139588
/*
139554139589
** Register a new collation sequence with the database handle db.
139555139590
*/
139556
-SQLITE_API int SQLITE_APICALL sqlite3_create_collation(
139591
+SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
139557139592
sqlite3* db,
139558139593
const char *zName,
139559139594
int enc,
139560139595
void* pCtx,
139561139596
int(*xCompare)(void*,int,const void*,int,const void*)
@@ -139564,11 +139599,11 @@
139564139599
}
139565139600
139566139601
/*
139567139602
** Register a new collation sequence with the database handle db.
139568139603
*/
139569
-SQLITE_API int SQLITE_APICALL sqlite3_create_collation_v2(
139604
+SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
139570139605
sqlite3* db,
139571139606
const char *zName,
139572139607
int enc,
139573139608
void* pCtx,
139574139609
int(*xCompare)(void*,int,const void*,int,const void*),
@@ -139589,11 +139624,11 @@
139589139624
139590139625
#ifndef SQLITE_OMIT_UTF16
139591139626
/*
139592139627
** Register a new collation sequence with the database handle db.
139593139628
*/
139594
-SQLITE_API int SQLITE_APICALL sqlite3_create_collation16(
139629
+SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
139595139630
sqlite3* db,
139596139631
const void *zName,
139597139632
int enc,
139598139633
void* pCtx,
139599139634
int(*xCompare)(void*,int,const void*,int,const void*)
@@ -139619,11 +139654,11 @@
139619139654
139620139655
/*
139621139656
** Register a collation sequence factory callback with the database handle
139622139657
** db. Replace any previously installed collation sequence factory.
139623139658
*/
139624
-SQLITE_API int SQLITE_APICALL sqlite3_collation_needed(
139659
+SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
139625139660
sqlite3 *db,
139626139661
void *pCollNeededArg,
139627139662
void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*)
139628139663
){
139629139664
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -139640,11 +139675,11 @@
139640139675
#ifndef SQLITE_OMIT_UTF16
139641139676
/*
139642139677
** Register a collation sequence factory callback with the database handle
139643139678
** db. Replace any previously installed collation sequence factory.
139644139679
*/
139645
-SQLITE_API int SQLITE_APICALL sqlite3_collation_needed16(
139680
+SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
139646139681
sqlite3 *db,
139647139682
void *pCollNeededArg,
139648139683
void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*)
139649139684
){
139650139685
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -139662,11 +139697,11 @@
139662139697
#ifndef SQLITE_OMIT_DEPRECATED
139663139698
/*
139664139699
** This function is now an anachronism. It used to be used to recover from a
139665139700
** malloc() failure, but SQLite now does this automatically.
139666139701
*/
139667
-SQLITE_API int SQLITE_APICALL sqlite3_global_recover(void){
139702
+SQLITE_API int SQLITE_STDCALL sqlite3_global_recover(void){
139668139703
return SQLITE_OK;
139669139704
}
139670139705
#endif
139671139706
139672139707
/*
@@ -139673,11 +139708,11 @@
139673139708
** Test to see whether or not the database connection is in autocommit
139674139709
** mode. Return TRUE if it is and FALSE if not. Autocommit mode is on
139675139710
** by default. Autocommit is disabled by a BEGIN statement and reenabled
139676139711
** by the next COMMIT or ROLLBACK.
139677139712
*/
139678
-SQLITE_API int SQLITE_APICALL sqlite3_get_autocommit(sqlite3 *db){
139713
+SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3 *db){
139679139714
#ifdef SQLITE_ENABLE_API_ARMOR
139680139715
if( !sqlite3SafetyCheckOk(db) ){
139681139716
(void)SQLITE_MISUSE_BKPT;
139682139717
return 0;
139683139718
}
@@ -139730,19 +139765,19 @@
139730139765
** data for this thread has been deallocated.
139731139766
**
139732139767
** SQLite no longer uses thread-specific data so this routine is now a
139733139768
** no-op. It is retained for historical compatibility.
139734139769
*/
139735
-SQLITE_API void SQLITE_APICALL sqlite3_thread_cleanup(void){
139770
+SQLITE_API void SQLITE_STDCALL sqlite3_thread_cleanup(void){
139736139771
}
139737139772
#endif
139738139773
139739139774
/*
139740139775
** Return meta information about a specific column of a database table.
139741139776
** See comment in sqlite3.h (sqlite.h.in) for details.
139742139777
*/
139743
-SQLITE_API int SQLITE_APICALL sqlite3_table_column_metadata(
139778
+SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
139744139779
sqlite3 *db, /* Connection handle */
139745139780
const char *zDbName, /* Database name or NULL */
139746139781
const char *zTableName, /* Table name */
139747139782
const char *zColumnName, /* Column name */
139748139783
char const **pzDataType, /* OUTPUT: Declared data type */
@@ -139856,11 +139891,11 @@
139856139891
}
139857139892
139858139893
/*
139859139894
** Sleep for a little while. Return the amount of time slept.
139860139895
*/
139861
-SQLITE_API int SQLITE_APICALL sqlite3_sleep(int ms){
139896
+SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int ms){
139862139897
sqlite3_vfs *pVfs;
139863139898
int rc;
139864139899
pVfs = sqlite3_vfs_find(0);
139865139900
if( pVfs==0 ) return 0;
139866139901
@@ -139872,11 +139907,11 @@
139872139907
}
139873139908
139874139909
/*
139875139910
** Enable or disable the extended result codes.
139876139911
*/
139877
-SQLITE_API int SQLITE_APICALL sqlite3_extended_result_codes(sqlite3 *db, int onoff){
139912
+SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3 *db, int onoff){
139878139913
#ifdef SQLITE_ENABLE_API_ARMOR
139879139914
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
139880139915
#endif
139881139916
sqlite3_mutex_enter(db->mutex);
139882139917
db->errMask = onoff ? 0xffffffff : 0xff;
@@ -139885,11 +139920,11 @@
139885139920
}
139886139921
139887139922
/*
139888139923
** Invoke the xFileControl method on a particular database.
139889139924
*/
139890
-SQLITE_API int SQLITE_APICALL sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
139925
+SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
139891139926
int rc = SQLITE_ERROR;
139892139927
Btree *pBtree;
139893139928
139894139929
#ifdef SQLITE_ENABLE_API_ARMOR
139895139930
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -140270,11 +140305,11 @@
140270140305
** method of a VFS implementation. The zParam argument is the name of the
140271140306
** query parameter we seek. This routine returns the value of the zParam
140272140307
** parameter if it exists. If the parameter does not exist, this routine
140273140308
** returns a NULL pointer.
140274140309
*/
140275
-SQLITE_API const char *SQLITE_APICALL sqlite3_uri_parameter(const char *zFilename, const char *zParam){
140310
+SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam){
140276140311
if( zFilename==0 || zParam==0 ) return 0;
140277140312
zFilename += sqlite3Strlen30(zFilename) + 1;
140278140313
while( zFilename[0] ){
140279140314
int x = strcmp(zFilename, zParam);
140280140315
zFilename += sqlite3Strlen30(zFilename) + 1;
@@ -140285,20 +140320,20 @@
140285140320
}
140286140321
140287140322
/*
140288140323
** Return a boolean value for a query parameter.
140289140324
*/
140290
-SQLITE_API int SQLITE_APICALL sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){
140325
+SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){
140291140326
const char *z = sqlite3_uri_parameter(zFilename, zParam);
140292140327
bDflt = bDflt!=0;
140293140328
return z ? sqlite3GetBoolean(z, bDflt) : bDflt;
140294140329
}
140295140330
140296140331
/*
140297140332
** Return a 64-bit integer value for a query parameter.
140298140333
*/
140299
-SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_uri_int64(
140334
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(
140300140335
const char *zFilename, /* Filename as passed to xOpen */
140301140336
const char *zParam, /* URI parameter sought */
140302140337
sqlite3_int64 bDflt /* return if parameter is missing */
140303140338
){
140304140339
const char *z = sqlite3_uri_parameter(zFilename, zParam);
@@ -140326,11 +140361,11 @@
140326140361
140327140362
/*
140328140363
** Return the filename of the database associated with a database
140329140364
** connection.
140330140365
*/
140331
-SQLITE_API const char *SQLITE_APICALL sqlite3_db_filename(sqlite3 *db, const char *zDbName){
140366
+SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName){
140332140367
Btree *pBt;
140333140368
#ifdef SQLITE_ENABLE_API_ARMOR
140334140369
if( !sqlite3SafetyCheckOk(db) ){
140335140370
(void)SQLITE_MISUSE_BKPT;
140336140371
return 0;
@@ -140342,11 +140377,11 @@
140342140377
140343140378
/*
140344140379
** Return 1 if database is read-only or 0 if read/write. Return -1 if
140345140380
** no such database exists.
140346140381
*/
140347
-SQLITE_API int SQLITE_APICALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName){
140382
+SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName){
140348140383
Btree *pBt;
140349140384
#ifdef SQLITE_ENABLE_API_ARMOR
140350140385
if( !sqlite3SafetyCheckOk(db) ){
140351140386
(void)SQLITE_MISUSE_BKPT;
140352140387
return -1;
@@ -140359,11 +140394,11 @@
140359140394
#ifdef SQLITE_ENABLE_SNAPSHOT
140360140395
/*
140361140396
** Obtain a snapshot handle for the snapshot of database zDb currently
140362140397
** being read by handle db.
140363140398
*/
140364
-SQLITE_API int SQLITE_APICALL sqlite3_snapshot_get(
140399
+SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_get(
140365140400
sqlite3 *db,
140366140401
const char *zDb,
140367140402
sqlite3_snapshot **ppSnapshot
140368140403
){
140369140404
int rc = SQLITE_ERROR;
@@ -140394,11 +140429,11 @@
140394140429
}
140395140430
140396140431
/*
140397140432
** Open a read-transaction on the snapshot idendified by pSnapshot.
140398140433
*/
140399
-SQLITE_API int SQLITE_APICALL sqlite3_snapshot_open(
140434
+SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_open(
140400140435
sqlite3 *db,
140401140436
const char *zDb,
140402140437
sqlite3_snapshot *pSnapshot
140403140438
){
140404140439
int rc = SQLITE_ERROR;
@@ -140431,11 +140466,11 @@
140431140466
}
140432140467
140433140468
/*
140434140469
** Free a snapshot handle obtained from sqlite3_snapshot_get().
140435140470
*/
140436
-SQLITE_API void SQLITE_APICALL sqlite3_snapshot_free(sqlite3_snapshot *pSnapshot){
140471
+SQLITE_API void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot *pSnapshot){
140437140472
sqlite3_free(pSnapshot);
140438140473
}
140439140474
#endif /* SQLITE_ENABLE_SNAPSHOT */
140440140475
140441140476
/************** End of main.c ************************************************/
@@ -140585,11 +140620,11 @@
140585140620
**
140586140621
** Each call to this routine overrides any prior callbacks registered
140587140622
** on the same "db". If xNotify==0 then any prior callbacks are immediately
140588140623
** cancelled.
140589140624
*/
140590
-SQLITE_API int SQLITE_APICALL sqlite3_unlock_notify(
140625
+SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
140591140626
sqlite3 *db,
140592140627
void (*xNotify)(void **, int),
140593140628
void *pArg
140594140629
){
140595140630
int rc = SQLITE_OK;
@@ -147588,11 +147623,11 @@
147588147623
** Initialize API pointer table, if required.
147589147624
*/
147590147625
#ifdef _WIN32
147591147626
__declspec(dllexport)
147592147627
#endif
147593
-SQLITE_API int SQLITE_APICALL sqlite3_fts3_init(
147628
+SQLITE_API int SQLITE_STDCALL sqlite3_fts3_init(
147594147629
sqlite3 *db,
147595147630
char **pzErrMsg,
147596147631
const sqlite3_api_routines *pApi
147597147632
){
147598147633
SQLITE_EXTENSION_INIT2(pApi)
@@ -163389,11 +163424,11 @@
163389163424
}
163390163425
163391163426
/*
163392163427
** Register a new geometry function for use with the r-tree MATCH operator.
163393163428
*/
163394
-SQLITE_API int SQLITE_APICALL sqlite3_rtree_geometry_callback(
163429
+SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
163395163430
sqlite3 *db, /* Register SQL function on this connection */
163396163431
const char *zGeom, /* Name of the new SQL function */
163397163432
int (*xGeom)(sqlite3_rtree_geometry*,int,RtreeDValue*,int*), /* Callback */
163398163433
void *pContext /* Extra data associated with the callback */
163399163434
){
@@ -163413,11 +163448,11 @@
163413163448
163414163449
/*
163415163450
** Register a new 2nd-generation geometry function for use with the
163416163451
** r-tree MATCH operator.
163417163452
*/
163418
-SQLITE_API int SQLITE_APICALL sqlite3_rtree_query_callback(
163453
+SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
163419163454
sqlite3 *db, /* Register SQL function on this connection */
163420163455
const char *zQueryFunc, /* Name of new SQL function */
163421163456
int (*xQueryFunc)(sqlite3_rtree_query_info*), /* Callback */
163422163457
void *pContext, /* Extra data passed into the callback */
163423163458
void (*xDestructor)(void*) /* Destructor for the extra data */
@@ -163438,11 +163473,11 @@
163438163473
163439163474
#if !SQLITE_CORE
163440163475
#ifdef _WIN32
163441163476
__declspec(dllexport)
163442163477
#endif
163443
-SQLITE_API int SQLITE_APICALL sqlite3_rtree_init(
163478
+SQLITE_API int SQLITE_STDCALL sqlite3_rtree_init(
163444163479
sqlite3 *db,
163445163480
char **pzErrMsg,
163446163481
const sqlite3_api_routines *pApi
163447163482
){
163448163483
SQLITE_EXTENSION_INIT2(pApi)
@@ -163989,11 +164024,11 @@
163989164024
163990164025
#if !SQLITE_CORE
163991164026
#ifdef _WIN32
163992164027
__declspec(dllexport)
163993164028
#endif
163994
-SQLITE_API int SQLITE_APICALL sqlite3_icu_init(
164029
+SQLITE_API int SQLITE_STDCALL sqlite3_icu_init(
163995164030
sqlite3 *db,
163996164031
char **pzErrMsg,
163997164032
const sqlite3_api_routines *pApi
163998164033
){
163999164034
SQLITE_EXTENSION_INIT2(pApi)
@@ -164669,11 +164704,11 @@
164669164704
** IMPORTANT NOTE FOR ZIPVFS USERS: The RBU extension works with all of
164670164705
** SQLite's built-in VFSs, including the multiplexor VFS. However it does
164671164706
** not work out of the box with zipvfs. Refer to the comment describing
164672164707
** the zipvfs_create_vfs() API below for details on using RBU with zipvfs.
164673164708
*/
164674
-SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_open(
164709
+SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_open(
164675164710
const char *zTarget,
164676164711
const char *zRbu,
164677164712
const char *zState
164678164713
);
164679164714
@@ -164702,11 +164737,11 @@
164702164737
** As with sqlite3rbu_open(), Zipvfs users should rever to the comment
164703164738
** describing the sqlite3rbu_create_vfs() API function below for
164704164739
** a description of the complications associated with using RBU with
164705164740
** zipvfs databases.
164706164741
*/
164707
-SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_vacuum(
164742
+SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_vacuum(
164708164743
const char *zTarget,
164709164744
const char *zState
164710164745
);
164711164746
164712164747
/*
@@ -164738,11 +164773,11 @@
164738164773
** when sqlite3rbu_close() is called.
164739164774
**
164740164775
** Database handles returned by this function remain valid until the next
164741164776
** call to any sqlite3rbu_xxx() function other than sqlite3rbu_db().
164742164777
*/
164743
-SQLITE_API sqlite3 *SQLITE_APICALL sqlite3rbu_db(sqlite3rbu*, int bRbu);
164778
+SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3rbu_db(sqlite3rbu*, int bRbu);
164744164779
164745164780
/*
164746164781
** Do some work towards applying the RBU update to the target db.
164747164782
**
164748164783
** Return SQLITE_DONE if the update has been completely applied, or
@@ -164752,11 +164787,11 @@
164752164787
**
164753164788
** Once a call to sqlite3rbu_step() has returned a value other than
164754164789
** SQLITE_OK, all subsequent calls on the same RBU handle are no-ops
164755164790
** that immediately return the same value.
164756164791
*/
164757
-SQLITE_API int SQLITE_APICALL sqlite3rbu_step(sqlite3rbu *pRbu);
164792
+SQLITE_API int SQLITE_STDCALL sqlite3rbu_step(sqlite3rbu *pRbu);
164758164793
164759164794
/*
164760164795
** Force RBU to save its state to disk.
164761164796
**
164762164797
** If a power failure or application crash occurs during an update, following
@@ -164764,11 +164799,11 @@
164764164799
** was last saved. In other words, from the most recent successful call to
164765164800
** sqlite3rbu_close() or this function.
164766164801
**
164767164802
** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
164768164803
*/
164769
-SQLITE_API int SQLITE_APICALL sqlite3rbu_savestate(sqlite3rbu *pRbu);
164804
+SQLITE_API int SQLITE_STDCALL sqlite3rbu_savestate(sqlite3rbu *pRbu);
164770164805
164771164806
/*
164772164807
** Close an RBU handle.
164773164808
**
164774164809
** If the RBU update has been completely applied, mark the RBU database
@@ -164784,18 +164819,18 @@
164784164819
**
164785164820
** Otherwise, if no error occurs, this function returns SQLITE_OK if the
164786164821
** update has been partially applied, or SQLITE_DONE if it has been
164787164822
** completely applied.
164788164823
*/
164789
-SQLITE_API int SQLITE_APICALL sqlite3rbu_close(sqlite3rbu *pRbu, char **pzErrmsg);
164824
+SQLITE_API int SQLITE_STDCALL sqlite3rbu_close(sqlite3rbu *pRbu, char **pzErrmsg);
164790164825
164791164826
/*
164792164827
** Return the total number of key-value operations (inserts, deletes or
164793164828
** updates) that have been performed on the target database since the
164794164829
** current RBU update was started.
164795164830
*/
164796
-SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3rbu_progress(sqlite3rbu *pRbu);
164831
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3rbu_progress(sqlite3rbu *pRbu);
164797164832
164798164833
/*
164799164834
** Obtain permyriadage (permyriadage is to 10000 as percentage is to 100)
164800164835
** progress indications for the two stages of an RBU update. This API may
164801164836
** be useful for driving GUI progress indicators and similar.
@@ -164833,11 +164868,11 @@
164833164868
** permyriadage progress of the same stage. If the rbu_count table does
164834164869
** not exist, then (*pnOne) is set to -1 during stage 1. If the rbu_count
164835164870
** table exists but is not correctly populated, the value of the *pnOne
164836164871
** output variable during stage 1 is undefined.
164837164872
*/
164838
-SQLITE_API void SQLITE_APICALL sqlite3rbu_bp_progress(sqlite3rbu *pRbu, int *pnOne, int *pnTwo);
164873
+SQLITE_API void SQLITE_STDCALL sqlite3rbu_bp_progress(sqlite3rbu *pRbu, int *pnOne, int *pnTwo);
164839164874
164840164875
/*
164841164876
** Obtain an indication as to the current stage of an RBU update or vacuum.
164842164877
** This function always returns one of the SQLITE_RBU_STATE_XXX constants
164843164878
** defined in this file. Return values should be interpreted as follows:
@@ -164871,11 +164906,11 @@
164871164906
#define SQLITE_RBU_STATE_MOVE 2
164872164907
#define SQLITE_RBU_STATE_CHECKPOINT 3
164873164908
#define SQLITE_RBU_STATE_DONE 4
164874164909
#define SQLITE_RBU_STATE_ERROR 5
164875164910
164876
-SQLITE_API int SQLITE_APICALL sqlite3rbu_state(sqlite3rbu *pRbu);
164911
+SQLITE_API int SQLITE_STDCALL sqlite3rbu_state(sqlite3rbu *pRbu);
164877164912
164878164913
/*
164879164914
** Create an RBU VFS named zName that accesses the underlying file-system
164880164915
** via existing VFS zParent. Or, if the zParent parameter is passed NULL,
164881164916
** then the new RBU VFS uses the default system VFS to access the file-system.
@@ -164915,21 +164950,21 @@
164915164950
** The overhead of adding the "rbu" VFS to the system is negligible for
164916164951
** non-RBU users. There is no harm in an application accessing the
164917164952
** file-system via "rbu" all the time, even if it only uses RBU functionality
164918164953
** occasionally.
164919164954
*/
164920
-SQLITE_API int SQLITE_APICALL sqlite3rbu_create_vfs(const char *zName, const char *zParent);
164955
+SQLITE_API int SQLITE_STDCALL sqlite3rbu_create_vfs(const char *zName, const char *zParent);
164921164956
164922164957
/*
164923164958
** Deregister and destroy an RBU vfs created by an earlier call to
164924164959
** sqlite3rbu_create_vfs().
164925164960
**
164926164961
** VFS objects are not reference counted. If a VFS object is destroyed
164927164962
** before all database handles that use it have been closed, the results
164928164963
** are undefined.
164929164964
*/
164930
-SQLITE_API void SQLITE_APICALL sqlite3rbu_destroy_vfs(const char *zName);
164965
+SQLITE_API void SQLITE_STDCALL sqlite3rbu_destroy_vfs(const char *zName);
164931164966
164932164967
#if 0
164933164968
} /* end of the 'extern "C"' block */
164934164969
#endif
164935164970
@@ -168019,11 +168054,11 @@
168019168054
}
168020168055
168021168056
/*
168022168057
** Step the RBU object.
168023168058
*/
168024
-SQLITE_API int SQLITE_APICALL sqlite3rbu_step(sqlite3rbu *p){
168059
+SQLITE_API int SQLITE_STDCALL sqlite3rbu_step(sqlite3rbu *p){
168025168060
if( p ){
168026168061
switch( p->eStage ){
168027168062
case RBU_STAGE_OAL: {
168028168063
RbuObjIter *pIter = &p->objiter;
168029168064
@@ -168461,11 +168496,11 @@
168461168496
}
168462168497
168463168498
/*
168464168499
** Open and return a new RBU handle.
168465168500
*/
168466
-SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_open(
168501
+SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_open(
168467168502
const char *zTarget,
168468168503
const char *zRbu,
168469168504
const char *zState
168470168505
){
168471168506
/* TODO: Check that zTarget and zRbu are non-NULL */
@@ -168473,11 +168508,11 @@
168473168508
}
168474168509
168475168510
/*
168476168511
** Open a handle to begin or resume an RBU VACUUM operation.
168477168512
*/
168478
-SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_vacuum(
168513
+SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_vacuum(
168479168514
const char *zTarget,
168480168515
const char *zState
168481168516
){
168482168517
/* TODO: Check that both arguments are non-NULL */
168483168518
return openRbuHandle(0, zTarget, zState);
@@ -168484,11 +168519,11 @@
168484168519
}
168485168520
168486168521
/*
168487168522
** Return the database handle used by pRbu.
168488168523
*/
168489
-SQLITE_API sqlite3 *SQLITE_APICALL sqlite3rbu_db(sqlite3rbu *pRbu, int bRbu){
168524
+SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3rbu_db(sqlite3rbu *pRbu, int bRbu){
168490168525
sqlite3 *db = 0;
168491168526
if( pRbu ){
168492168527
db = (bRbu ? pRbu->dbRbu : pRbu->dbMain);
168493168528
}
168494168529
return db;
@@ -168516,11 +168551,11 @@
168516168551
}
168517168552
168518168553
/*
168519168554
** Close the RBU handle.
168520168555
*/
168521
-SQLITE_API int SQLITE_APICALL sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){
168556
+SQLITE_API int SQLITE_STDCALL sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){
168522168557
int rc;
168523168558
if( p ){
168524168559
168525168560
/* Commit the transaction to the *-oal file. */
168526168561
if( p->rc==SQLITE_OK && p->eStage==RBU_STAGE_OAL ){
@@ -168567,19 +168602,19 @@
168567168602
/*
168568168603
** Return the total number of key-value operations (inserts, deletes or
168569168604
** updates) that have been performed on the target database since the
168570168605
** current RBU update was started.
168571168606
*/
168572
-SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3rbu_progress(sqlite3rbu *pRbu){
168607
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3rbu_progress(sqlite3rbu *pRbu){
168573168608
return pRbu->nProgress;
168574168609
}
168575168610
168576168611
/*
168577168612
** Return permyriadage progress indications for the two main stages of
168578168613
** an RBU update.
168579168614
*/
168580
-SQLITE_API void SQLITE_APICALL sqlite3rbu_bp_progress(sqlite3rbu *p, int *pnOne, int *pnTwo){
168615
+SQLITE_API void SQLITE_STDCALL sqlite3rbu_bp_progress(sqlite3rbu *p, int *pnOne, int *pnTwo){
168581168616
const int MAX_PROGRESS = 10000;
168582168617
switch( p->eStage ){
168583168618
case RBU_STAGE_OAL:
168584168619
if( p->nPhaseOneStep>0 ){
168585168620
*pnOne = (int)(MAX_PROGRESS * (i64)p->nProgress/(i64)p->nPhaseOneStep);
@@ -168610,11 +168645,11 @@
168610168645
}
168611168646
168612168647
/*
168613168648
** Return the current state of the RBU vacuum or update operation.
168614168649
*/
168615
-SQLITE_API int SQLITE_APICALL sqlite3rbu_state(sqlite3rbu *p){
168650
+SQLITE_API int SQLITE_STDCALL sqlite3rbu_state(sqlite3rbu *p){
168616168651
int aRes[] = {
168617168652
0, SQLITE_RBU_STATE_OAL, SQLITE_RBU_STATE_MOVE,
168618168653
0, SQLITE_RBU_STATE_CHECKPOINT, SQLITE_RBU_STATE_DONE
168619168654
};
168620168655
@@ -168638,11 +168673,11 @@
168638168673
);
168639168674
return aRes[p->eStage];
168640168675
}
168641168676
}
168642168677
168643
-SQLITE_API int SQLITE_APICALL sqlite3rbu_savestate(sqlite3rbu *p){
168678
+SQLITE_API int SQLITE_STDCALL sqlite3rbu_savestate(sqlite3rbu *p){
168644168679
int rc = p->rc;
168645168680
if( rc==SQLITE_DONE ) return SQLITE_OK;
168646168681
168647168682
assert( p->eStage>=RBU_STAGE_OAL && p->eStage<=RBU_STAGE_DONE );
168648168683
if( p->eStage==RBU_STAGE_OAL ){
@@ -169465,11 +169500,11 @@
169465169500
169466169501
/*
169467169502
** Deregister and destroy an RBU vfs created by an earlier call to
169468169503
** sqlite3rbu_create_vfs().
169469169504
*/
169470
-SQLITE_API void SQLITE_APICALL sqlite3rbu_destroy_vfs(const char *zName){
169505
+SQLITE_API void SQLITE_STDCALL sqlite3rbu_destroy_vfs(const char *zName){
169471169506
sqlite3_vfs *pVfs = sqlite3_vfs_find(zName);
169472169507
if( pVfs && pVfs->xOpen==rbuVfsOpen ){
169473169508
sqlite3_mutex_free(((rbu_vfs*)pVfs)->mutex);
169474169509
sqlite3_vfs_unregister(pVfs);
169475169510
sqlite3_free(pVfs);
@@ -169479,11 +169514,11 @@
169479169514
/*
169480169515
** Create an RBU VFS named zName that accesses the underlying file-system
169481169516
** via existing VFS zParent. The new object is registered as a non-default
169482169517
** VFS with SQLite before returning.
169483169518
*/
169484
-SQLITE_API int SQLITE_APICALL sqlite3rbu_create_vfs(const char *zName, const char *zParent){
169519
+SQLITE_API int SQLITE_STDCALL sqlite3rbu_create_vfs(const char *zName, const char *zParent){
169485169520
169486169521
/* Template for VFS */
169487169522
static sqlite3_vfs vfs_template = {
169488169523
1, /* iVersion */
169489169524
0, /* szOsFile */
@@ -171724,11 +171759,11 @@
171724171759
}
171725171760
171726171761
return rc;
171727171762
}
171728171763
171729
-SQLITE_API int SQLITE_APICALL sqlite3session_diff(
171764
+SQLITE_API int SQLITE_STDCALL sqlite3session_diff(
171730171765
sqlite3_session *pSession,
171731171766
const char *zFrom,
171732171767
const char *zTbl,
171733171768
char **pzErrMsg
171734171769
){
@@ -171818,11 +171853,11 @@
171818171853
171819171854
/*
171820171855
** Create a session object. This session object will record changes to
171821171856
** database zDb attached to connection db.
171822171857
*/
171823
-SQLITE_API int SQLITE_APICALL sqlite3session_create(
171858
+SQLITE_API int SQLITE_STDCALL sqlite3session_create(
171824171859
sqlite3 *db, /* Database handle */
171825171860
const char *zDb, /* Name of db (e.g. "main") */
171826171861
sqlite3_session **ppSession /* OUT: New session object */
171827171862
){
171828171863
sqlite3_session *pNew; /* Newly allocated session object */
@@ -171880,11 +171915,11 @@
171880171915
}
171881171916
171882171917
/*
171883171918
** Delete a session object previously allocated using sqlite3session_create().
171884171919
*/
171885
-SQLITE_API void SQLITE_APICALL sqlite3session_delete(sqlite3_session *pSession){
171920
+SQLITE_API void SQLITE_STDCALL sqlite3session_delete(sqlite3_session *pSession){
171886171921
sqlite3 *db = pSession->db;
171887171922
sqlite3_session *pHead;
171888171923
sqlite3_session **pp;
171889171924
171890171925
/* Unlink the session from the linked list of sessions attached to the
@@ -171909,11 +171944,11 @@
171909171944
}
171910171945
171911171946
/*
171912171947
** Set a table filter on a Session Object.
171913171948
*/
171914
-SQLITE_API void SQLITE_APICALL sqlite3session_table_filter(
171949
+SQLITE_API void SQLITE_STDCALL sqlite3session_table_filter(
171915171950
sqlite3_session *pSession,
171916171951
int(*xFilter)(void*, const char*),
171917171952
void *pCtx /* First argument passed to xFilter */
171918171953
){
171919171954
pSession->bAutoAttach = 1;
@@ -171927,11 +171962,11 @@
171927171962
**
171928171963
** Only tables that have a PRIMARY KEY defined may be attached. It does
171929171964
** not matter if the PRIMARY KEY is an "INTEGER PRIMARY KEY" (rowid alias)
171930171965
** or not.
171931171966
*/
171932
-SQLITE_API int SQLITE_APICALL sqlite3session_attach(
171967
+SQLITE_API int SQLITE_STDCALL sqlite3session_attach(
171933171968
sqlite3_session *pSession, /* Session object */
171934171969
const char *zName /* Table name */
171935171970
){
171936171971
int rc = SQLITE_OK;
171937171972
sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
@@ -172617,11 +172652,11 @@
172617172652
** session object passed as the first argument.
172618172653
**
172619172654
** It is the responsibility of the caller to eventually free the buffer
172620172655
** using sqlite3_free().
172621172656
*/
172622
-SQLITE_API int SQLITE_APICALL sqlite3session_changeset(
172657
+SQLITE_API int SQLITE_STDCALL sqlite3session_changeset(
172623172658
sqlite3_session *pSession, /* Session object */
172624172659
int *pnChangeset, /* OUT: Size of buffer at *ppChangeset */
172625172660
void **ppChangeset /* OUT: Buffer containing changeset */
172626172661
){
172627172662
return sessionGenerateChangeset(pSession, 0, 0, 0, pnChangeset, ppChangeset);
@@ -172628,11 +172663,11 @@
172628172663
}
172629172664
172630172665
/*
172631172666
** Streaming version of sqlite3session_changeset().
172632172667
*/
172633
-SQLITE_API int SQLITE_APICALL sqlite3session_changeset_strm(
172668
+SQLITE_API int SQLITE_STDCALL sqlite3session_changeset_strm(
172634172669
sqlite3_session *pSession,
172635172670
int (*xOutput)(void *pOut, const void *pData, int nData),
172636172671
void *pOut
172637172672
){
172638172673
return sessionGenerateChangeset(pSession, 0, xOutput, pOut, 0, 0);
@@ -172639,11 +172674,11 @@
172639172674
}
172640172675
172641172676
/*
172642172677
** Streaming version of sqlite3session_patchset().
172643172678
*/
172644
-SQLITE_API int SQLITE_APICALL sqlite3session_patchset_strm(
172679
+SQLITE_API int SQLITE_STDCALL sqlite3session_patchset_strm(
172645172680
sqlite3_session *pSession,
172646172681
int (*xOutput)(void *pOut, const void *pData, int nData),
172647172682
void *pOut
172648172683
){
172649172684
return sessionGenerateChangeset(pSession, 1, xOutput, pOut, 0, 0);
@@ -172654,11 +172689,11 @@
172654172689
** session object passed as the first argument.
172655172690
**
172656172691
** It is the responsibility of the caller to eventually free the buffer
172657172692
** using sqlite3_free().
172658172693
*/
172659
-SQLITE_API int SQLITE_APICALL sqlite3session_patchset(
172694
+SQLITE_API int SQLITE_STDCALL sqlite3session_patchset(
172660172695
sqlite3_session *pSession, /* Session object */
172661172696
int *pnPatchset, /* OUT: Size of buffer at *ppChangeset */
172662172697
void **ppPatchset /* OUT: Buffer containing changeset */
172663172698
){
172664172699
return sessionGenerateChangeset(pSession, 1, 0, 0, pnPatchset, ppPatchset);
@@ -172665,11 +172700,11 @@
172665172700
}
172666172701
172667172702
/*
172668172703
** Enable or disable the session object passed as the first argument.
172669172704
*/
172670
-SQLITE_API int SQLITE_APICALL sqlite3session_enable(sqlite3_session *pSession, int bEnable){
172705
+SQLITE_API int SQLITE_STDCALL sqlite3session_enable(sqlite3_session *pSession, int bEnable){
172671172706
int ret;
172672172707
sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172673172708
if( bEnable>=0 ){
172674172709
pSession->bEnable = bEnable;
172675172710
}
@@ -172679,11 +172714,11 @@
172679172714
}
172680172715
172681172716
/*
172682172717
** Enable or disable the session object passed as the first argument.
172683172718
*/
172684
-SQLITE_API int SQLITE_APICALL sqlite3session_indirect(sqlite3_session *pSession, int bIndirect){
172719
+SQLITE_API int SQLITE_STDCALL sqlite3session_indirect(sqlite3_session *pSession, int bIndirect){
172685172720
int ret;
172686172721
sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172687172722
if( bIndirect>=0 ){
172688172723
pSession->bIndirect = bIndirect;
172689172724
}
@@ -172694,11 +172729,11 @@
172694172729
172695172730
/*
172696172731
** Return true if there have been no changes to monitored tables recorded
172697172732
** by the session object passed as the only argument.
172698172733
*/
172699
-SQLITE_API int SQLITE_APICALL sqlite3session_isempty(sqlite3_session *pSession){
172734
+SQLITE_API int SQLITE_STDCALL sqlite3session_isempty(sqlite3_session *pSession){
172700172735
int ret = 0;
172701172736
SessionTable *pTab;
172702172737
172703172738
sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172704172739
for(pTab=pSession->pTable; pTab && ret==0; pTab=pTab->pNext){
@@ -172744,11 +172779,11 @@
172744172779
}
172745172780
172746172781
/*
172747172782
** Create an iterator used to iterate through the contents of a changeset.
172748172783
*/
172749
-SQLITE_API int SQLITE_APICALL sqlite3changeset_start(
172784
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_start(
172750172785
sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
172751172786
int nChangeset, /* Size of buffer pChangeset in bytes */
172752172787
void *pChangeset /* Pointer to buffer containing changeset */
172753172788
){
172754172789
return sessionChangesetStart(pp, 0, 0, nChangeset, pChangeset);
@@ -172755,11 +172790,11 @@
172755172790
}
172756172791
172757172792
/*
172758172793
** Streaming version of sqlite3changeset_start().
172759172794
*/
172760
-SQLITE_API int SQLITE_APICALL sqlite3changeset_start_strm(
172795
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_start_strm(
172761172796
sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
172762172797
int (*xInput)(void *pIn, void *pData, int *pnData),
172763172798
void *pIn
172764172799
){
172765172800
return sessionChangesetStart(pp, xInput, pIn, 0, 0);
@@ -173176,20 +173211,20 @@
173176173211
** or SQLITE_CORRUPT.
173177173212
**
173178173213
** This function may not be called on iterators passed to a conflict handler
173179173214
** callback by changeset_apply().
173180173215
*/
173181
-SQLITE_API int SQLITE_APICALL sqlite3changeset_next(sqlite3_changeset_iter *p){
173216
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_next(sqlite3_changeset_iter *p){
173182173217
return sessionChangesetNext(p, 0, 0);
173183173218
}
173184173219
173185173220
/*
173186173221
** The following function extracts information on the current change
173187173222
** from a changeset iterator. It may only be called after changeset_next()
173188173223
** has returned SQLITE_ROW.
173189173224
*/
173190
-SQLITE_API int SQLITE_APICALL sqlite3changeset_op(
173225
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_op(
173191173226
sqlite3_changeset_iter *pIter, /* Iterator handle */
173192173227
const char **pzTab, /* OUT: Pointer to table name */
173193173228
int *pnCol, /* OUT: Number of columns in table */
173194173229
int *pOp, /* OUT: SQLITE_INSERT, DELETE or UPDATE */
173195173230
int *pbIndirect /* OUT: True if change is indirect */
@@ -173205,11 +173240,11 @@
173205173240
** Return information regarding the PRIMARY KEY and number of columns in
173206173241
** the database table affected by the change that pIter currently points
173207173242
** to. This function may only be called after changeset_next() returns
173208173243
** SQLITE_ROW.
173209173244
*/
173210
-SQLITE_API int SQLITE_APICALL sqlite3changeset_pk(
173245
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_pk(
173211173246
sqlite3_changeset_iter *pIter, /* Iterator object */
173212173247
unsigned char **pabPK, /* OUT: Array of boolean - true for PK cols */
173213173248
int *pnCol /* OUT: Number of entries in output array */
173214173249
){
173215173250
*pabPK = pIter->abPK;
@@ -173228,11 +173263,11 @@
173228173263
** was not modified and is not a PK column), set *ppValue to NULL.
173229173264
**
173230173265
** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is
173231173266
** not modified. Otherwise, SQLITE_OK.
173232173267
*/
173233
-SQLITE_API int SQLITE_APICALL sqlite3changeset_old(
173268
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_old(
173234173269
sqlite3_changeset_iter *pIter, /* Changeset iterator */
173235173270
int iVal, /* Index of old.* value to retrieve */
173236173271
sqlite3_value **ppValue /* OUT: Old value (or NULL pointer) */
173237173272
){
173238173273
if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_DELETE ){
@@ -173256,11 +173291,11 @@
173256173291
** was not modified), set *ppValue to NULL.
173257173292
**
173258173293
** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is
173259173294
** not modified. Otherwise, SQLITE_OK.
173260173295
*/
173261
-SQLITE_API int SQLITE_APICALL sqlite3changeset_new(
173296
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_new(
173262173297
sqlite3_changeset_iter *pIter, /* Changeset iterator */
173263173298
int iVal, /* Index of new.* value to retrieve */
173264173299
sqlite3_value **ppValue /* OUT: New value (or NULL pointer) */
173265173300
){
173266173301
if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_INSERT ){
@@ -173290,11 +173325,11 @@
173290173325
** containing the iVal'th value of the conflicting record.
173291173326
**
173292173327
** If value iVal is out-of-range or some other error occurs, an SQLite error
173293173328
** code is returned. Otherwise, SQLITE_OK.
173294173329
*/
173295
-SQLITE_API int SQLITE_APICALL sqlite3changeset_conflict(
173330
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_conflict(
173296173331
sqlite3_changeset_iter *pIter, /* Changeset iterator */
173297173332
int iVal, /* Index of conflict record value to fetch */
173298173333
sqlite3_value **ppValue /* OUT: Value from conflicting row */
173299173334
){
173300173335
if( !pIter->pConflict ){
@@ -173313,11 +173348,11 @@
173313173348
** it sets the output variable to the total number of known foreign key
173314173349
** violations in the destination database and returns SQLITE_OK.
173315173350
**
173316173351
** In all other cases this function returns SQLITE_MISUSE.
173317173352
*/
173318
-SQLITE_API int SQLITE_APICALL sqlite3changeset_fk_conflicts(
173353
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_fk_conflicts(
173319173354
sqlite3_changeset_iter *pIter, /* Changeset iterator */
173320173355
int *pnOut /* OUT: Number of FK violations */
173321173356
){
173322173357
if( pIter->pConflict || pIter->apValue ){
173323173358
return SQLITE_MISUSE;
@@ -173331,11 +173366,11 @@
173331173366
** Finalize an iterator allocated with sqlite3changeset_start().
173332173367
**
173333173368
** This function may not be called on iterators passed to a conflict handler
173334173369
** callback by changeset_apply().
173335173370
*/
173336
-SQLITE_API int SQLITE_APICALL sqlite3changeset_finalize(sqlite3_changeset_iter *p){
173371
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_finalize(sqlite3_changeset_iter *p){
173337173372
int rc = SQLITE_OK;
173338173373
if( p ){
173339173374
int i; /* Used to iterate through p->apValue[] */
173340173375
rc = p->rc;
173341173376
if( p->apValue ){
@@ -173505,11 +173540,11 @@
173505173540
173506173541
173507173542
/*
173508173543
** Invert a changeset object.
173509173544
*/
173510
-SQLITE_API int SQLITE_APICALL sqlite3changeset_invert(
173545
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_invert(
173511173546
int nChangeset, /* Number of bytes in input */
173512173547
const void *pChangeset, /* Input changeset */
173513173548
int *pnInverted, /* OUT: Number of bytes in output changeset */
173514173549
void **ppInverted /* OUT: Inverse of pChangeset */
173515173550
){
@@ -173524,11 +173559,11 @@
173524173559
}
173525173560
173526173561
/*
173527173562
** Streaming version of sqlite3changeset_invert().
173528173563
*/
173529
-SQLITE_API int SQLITE_APICALL sqlite3changeset_invert_strm(
173564
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_invert_strm(
173530173565
int (*xInput)(void *pIn, void *pData, int *pnData),
173531173566
void *pIn,
173532173567
int (*xOutput)(void *pOut, const void *pData, int nData),
173533173568
void *pOut
173534173569
){
@@ -174404,11 +174439,11 @@
174404174439
/*
174405174440
** Apply the changeset passed via pChangeset/nChangeset to the main database
174406174441
** attached to handle "db". Invoke the supplied conflict handler callback
174407174442
** to resolve any conflicts encountered while applying the change.
174408174443
*/
174409
-SQLITE_API int SQLITE_APICALL sqlite3changeset_apply(
174444
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_apply(
174410174445
sqlite3 *db, /* Apply change to "main" db of this handle */
174411174446
int nChangeset, /* Size of changeset in bytes */
174412174447
void *pChangeset, /* Changeset blob */
174413174448
int(*xFilter)(
174414174449
void *pCtx, /* Copy of sixth arg to _apply() */
@@ -174432,11 +174467,11 @@
174432174467
/*
174433174468
** Apply the changeset passed via xInput/pIn to the main database
174434174469
** attached to handle "db". Invoke the supplied conflict handler callback
174435174470
** to resolve any conflicts encountered while applying the change.
174436174471
*/
174437
-SQLITE_API int SQLITE_APICALL sqlite3changeset_apply_strm(
174472
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_apply_strm(
174438174473
sqlite3 *db, /* Apply change to "main" db of this handle */
174439174474
int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
174440174475
void *pIn, /* First arg for xInput */
174441174476
int(*xFilter)(
174442174477
void *pCtx, /* Copy of sixth arg to _apply() */
@@ -174767,11 +174802,11 @@
174767174802
}
174768174803
174769174804
/*
174770174805
** Allocate a new, empty, sqlite3_changegroup.
174771174806
*/
174772
-SQLITE_API int SQLITE_APICALL sqlite3changegroup_new(sqlite3_changegroup **pp){
174807
+SQLITE_API int SQLITE_STDCALL sqlite3changegroup_new(sqlite3_changegroup **pp){
174773174808
int rc = SQLITE_OK; /* Return code */
174774174809
sqlite3_changegroup *p; /* New object */
174775174810
p = (sqlite3_changegroup*)sqlite3_malloc(sizeof(sqlite3_changegroup));
174776174811
if( p==0 ){
174777174812
rc = SQLITE_NOMEM;
@@ -174784,11 +174819,11 @@
174784174819
174785174820
/*
174786174821
** Add the changeset currently stored in buffer pData, size nData bytes,
174787174822
** to changeset-group p.
174788174823
*/
174789
-SQLITE_API int SQLITE_APICALL sqlite3changegroup_add(sqlite3_changegroup *pGrp, int nData, void *pData){
174824
+SQLITE_API int SQLITE_STDCALL sqlite3changegroup_add(sqlite3_changegroup *pGrp, int nData, void *pData){
174790174825
sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */
174791174826
int rc; /* Return code */
174792174827
174793174828
rc = sqlite3changeset_start(&pIter, nData, pData);
174794174829
if( rc==SQLITE_OK ){
@@ -174800,11 +174835,11 @@
174800174835
174801174836
/*
174802174837
** Obtain a buffer containing a changeset representing the concatenation
174803174838
** of all changesets added to the group so far.
174804174839
*/
174805
-SQLITE_API int SQLITE_APICALL sqlite3changegroup_output(
174840
+SQLITE_API int SQLITE_STDCALL sqlite3changegroup_output(
174806174841
sqlite3_changegroup *pGrp,
174807174842
int *pnData,
174808174843
void **ppData
174809174844
){
174810174845
return sessionChangegroupOutput(pGrp, 0, 0, pnData, ppData);
@@ -174811,11 +174846,11 @@
174811174846
}
174812174847
174813174848
/*
174814174849
** Streaming versions of changegroup_add().
174815174850
*/
174816
-SQLITE_API int SQLITE_APICALL sqlite3changegroup_add_strm(
174851
+SQLITE_API int SQLITE_STDCALL sqlite3changegroup_add_strm(
174817174852
sqlite3_changegroup *pGrp,
174818174853
int (*xInput)(void *pIn, void *pData, int *pnData),
174819174854
void *pIn
174820174855
){
174821174856
sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */
@@ -174830,11 +174865,11 @@
174830174865
}
174831174866
174832174867
/*
174833174868
** Streaming versions of changegroup_output().
174834174869
*/
174835
-SQLITE_API int SQLITE_APICALL sqlite3changegroup_output_strm(
174870
+SQLITE_API int SQLITE_STDCALL sqlite3changegroup_output_strm(
174836174871
sqlite3_changegroup *pGrp,
174837174872
int (*xOutput)(void *pOut, const void *pData, int nData),
174838174873
void *pOut
174839174874
){
174840174875
return sessionChangegroupOutput(pGrp, xOutput, pOut, 0, 0);
@@ -174841,21 +174876,21 @@
174841174876
}
174842174877
174843174878
/*
174844174879
** Delete a changegroup object.
174845174880
*/
174846
-SQLITE_API void SQLITE_APICALL sqlite3changegroup_delete(sqlite3_changegroup *pGrp){
174881
+SQLITE_API void SQLITE_STDCALL sqlite3changegroup_delete(sqlite3_changegroup *pGrp){
174847174882
if( pGrp ){
174848174883
sessionDeleteTable(pGrp->pList);
174849174884
sqlite3_free(pGrp);
174850174885
}
174851174886
}
174852174887
174853174888
/*
174854174889
** Combine two changesets together.
174855174890
*/
174856
-SQLITE_API int SQLITE_APICALL sqlite3changeset_concat(
174891
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_concat(
174857174892
int nLeft, /* Number of bytes in lhs input */
174858174893
void *pLeft, /* Lhs input changeset */
174859174894
int nRight /* Number of bytes in rhs input */,
174860174895
void *pRight, /* Rhs input changeset */
174861174896
int *pnOut, /* OUT: Number of bytes in output changeset */
@@ -174880,11 +174915,11 @@
174880174915
}
174881174916
174882174917
/*
174883174918
** Streaming version of sqlite3changeset_concat().
174884174919
*/
174885
-SQLITE_API int SQLITE_APICALL sqlite3changeset_concat_strm(
174920
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_concat_strm(
174886174921
int (*xInputA)(void *pIn, void *pData, int *pnData),
174887174922
void *pInA,
174888174923
int (*xInputB)(void *pIn, void *pData, int *pnData),
174889174924
void *pInB,
174890174925
int (*xOutput)(void *pOut, const void *pData, int nData),
@@ -177112,11 +177147,11 @@
177112177147
177113177148
#ifndef SQLITE_CORE
177114177149
#ifdef _WIN32
177115177150
__declspec(dllexport)
177116177151
#endif
177117
-SQLITE_API int SQLITE_APICALL sqlite3_json_init(
177152
+SQLITE_API int SQLITE_STDCALL sqlite3_json_init(
177118177153
sqlite3 *db,
177119177154
char **pzErrMsg,
177120177155
const sqlite3_api_routines *pApi
177121177156
){
177122177157
SQLITE_EXTENSION_INIT2(pApi);
@@ -193945,11 +193980,11 @@
193945193980
int nArg, /* Number of args */
193946193981
sqlite3_value **apUnused /* Function arguments */
193947193982
){
193948193983
assert( nArg==0 );
193949193984
UNUSED_PARAM2(nArg, apUnused);
193950
- sqlite3_result_text(pCtx, "fts5: 2016-08-01 21:17:53 d8ef9f58643f13dd3d16dcde0d829ae08324f04b", -1, SQLITE_TRANSIENT);
193985
+ sqlite3_result_text(pCtx, "fts5: 2016-08-04 13:23:28 9adda385267d1a0ecff259b42a284913668441a2", -1, SQLITE_TRANSIENT);
193951193986
}
193952193987
193953193988
static int fts5Init(sqlite3 *db){
193954193989
static const sqlite3_module fts5Mod = {
193955193990
/* iVersion */ 2,
@@ -194033,11 +194068,11 @@
194033194068
*/
194034194069
#ifndef SQLITE_CORE
194035194070
#ifdef _WIN32
194036194071
__declspec(dllexport)
194037194072
#endif
194038
-SQLITE_API int SQLITE_APICALL sqlite3_fts_init(
194073
+SQLITE_API int SQLITE_STDCALL sqlite3_fts_init(
194039194074
sqlite3 *db,
194040194075
char **pzErrMsg,
194041194076
const sqlite3_api_routines *pApi
194042194077
){
194043194078
SQLITE_EXTENSION_INIT2(pApi);
@@ -194046,11 +194081,11 @@
194046194081
}
194047194082
194048194083
#ifdef _WIN32
194049194084
__declspec(dllexport)
194050194085
#endif
194051
-SQLITE_API int SQLITE_APICALL sqlite3_fts5_init(
194086
+SQLITE_API int SQLITE_STDCALL sqlite3_fts5_init(
194052194087
sqlite3 *db,
194053194088
char **pzErrMsg,
194054194089
const sqlite3_api_routines *pApi
194055194090
){
194056194091
SQLITE_EXTENSION_INIT2(pApi);
194057194092
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -380,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-08-02 08:45:26 7c38a79cdd42aaa45715aea330d10ca859098837"
386
387 /*
388 ** CAPI3REF: Run-Time Library Version Numbers
389 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
390 **
@@ -413,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
@@ -440,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 **
@@ -480,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 **
@@ -577,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 **
@@ -649,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 /*
@@ -1000,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 /*
@@ -1195,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 **
@@ -1471,43 +1471,43 @@
1471 ** or all of these interfaces to be NULL or for their behavior to change
1472 ** from one release to the next. Applications must not attempt to access
1473 ** any of these methods if the iVersion of the VFS is less than 3.
1474 */
1475 typedef struct sqlite3_vfs sqlite3_vfs;
1476 typedef void (SQLITE_SYSAPI *sqlite3_syscall_ptr)(void);
1477 struct sqlite3_vfs {
1478 int iVersion; /* Structure version number (currently 3) */
1479 int szOsFile; /* Size of subclassed sqlite3_file */
1480 int mxPathname; /* Maximum file pathname length */
1481 sqlite3_vfs *pNext; /* Next registered VFS */
1482 const char *zName; /* Name of this virtual file system */
1483 void *pAppData; /* Pointer to application-specific data */
1484 int (SQLITE_CALLBACK *xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
1485 int flags, int *pOutFlags);
1486 int (SQLITE_CALLBACK *xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
1487 int (SQLITE_CALLBACK *xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
1488 int (SQLITE_CALLBACK *xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
1489 void *(SQLITE_CALLBACK *xDlOpen)(sqlite3_vfs*, const char *zFilename);
1490 void (SQLITE_CALLBACK *xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
1491 void (SQLITE_CALLBACK *(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
1492 void (SQLITE_CALLBACK *xDlClose)(sqlite3_vfs*, void*);
1493 int (SQLITE_CALLBACK *xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
1494 int (SQLITE_CALLBACK *xSleep)(sqlite3_vfs*, int microseconds);
1495 int (SQLITE_CALLBACK *xCurrentTime)(sqlite3_vfs*, double*);
1496 int (SQLITE_CALLBACK *xGetLastError)(sqlite3_vfs*, int, char *);
1497 /*
1498 ** The methods above are in version 1 of the sqlite_vfs object
1499 ** definition. Those that follow are added in version 2 or later
1500 */
1501 int (SQLITE_CALLBACK *xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
1502 /*
1503 ** The methods above are in versions 1 and 2 of the sqlite_vfs object.
1504 ** Those below are for version 3 and greater.
1505 */
1506 int (SQLITE_CALLBACK *xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
1507 sqlite3_syscall_ptr (SQLITE_CALLBACK *xGetSystemCall)(sqlite3_vfs*, const char *zName);
1508 const char *(SQLITE_CALLBACK *xNextSystemCall)(sqlite3_vfs*, const char *zName);
1509 /*
1510 ** The methods above are in versions 1 through 3 of the sqlite_vfs object.
1511 ** New fields may be appended in future versions. The iVersion
1512 ** value will increment whenever this happens.
1513 */
@@ -1648,14 +1648,14 @@
1648 ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied
1649 ** implementation of sqlite3_os_init() or sqlite3_os_end()
1650 ** must return [SQLITE_OK] on success and some other [error code] upon
1651 ** failure.
1652 */
1653 SQLITE_API int SQLITE_APICALL sqlite3_initialize(void);
1654 SQLITE_API int SQLITE_APICALL sqlite3_shutdown(void);
1655 SQLITE_API int SQLITE_APICALL sqlite3_os_init(void);
1656 SQLITE_API int SQLITE_APICALL sqlite3_os_end(void);
1657
1658 /*
1659 ** CAPI3REF: Configuring The SQLite Library
1660 **
1661 ** The sqlite3_config() interface is used to make global configuration
@@ -1770,17 +1770,17 @@
1770 ** SQLite will never invoke xInit() more than once without an intervening
1771 ** call to xShutdown().
1772 */
1773 typedef struct sqlite3_mem_methods sqlite3_mem_methods;
1774 struct sqlite3_mem_methods {
1775 void *(SQLITE_CALLBACK *xMalloc)(int); /* Memory allocation function */
1776 void (SQLITE_CALLBACK *xFree)(void*); /* Free a prior allocation */
1777 void *(SQLITE_CALLBACK *xRealloc)(void*,int); /* Resize an allocation */
1778 int (SQLITE_CALLBACK *xSize)(void*); /* Return the size of an allocation */
1779 int (SQLITE_CALLBACK *xRoundup)(int); /* Round up request size to allocation size */
1780 int (SQLITE_CALLBACK *xInit)(void*); /* Initialize the memory allocator */
1781 void (SQLITE_CALLBACK *xShutdown)(void*); /* Deinitialize the memory allocator */
1782 void *pAppData; /* Argument to xInit() and xShutdown() */
1783 };
1784
1785 /*
1786 ** CAPI3REF: Configuration Options
@@ -1993,11 +1993,11 @@
1993 **
1994 ** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
1995 ** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
1996 ** global [error log].
1997 ** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a
1998 ** function with a call signature of void(SQLITE_CALLBACK *)(void*,int,const char*),
1999 ** and a pointer to void. ^If the function pointer is not NULL, it is
2000 ** invoked by [sqlite3_log()] to process each logging event. ^If the
2001 ** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op.
2002 ** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is
2003 ** passed through as the first parameter to the application-defined logger
@@ -2046,11 +2046,11 @@
2046 **
2047 ** [[SQLITE_CONFIG_SQLLOG]]
2048 ** <dt>SQLITE_CONFIG_SQLLOG
2049 ** <dd>This option is only available if sqlite is compiled with the
2050 ** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should
2051 ** be a pointer to a function of type void(SQLITE_CALLBACK *)(void*,sqlite3*,const char*, int).
2052 ** The second should be of type (void*). The callback is invoked by the library
2053 ** in three separate circumstances, identified by the value passed as the
2054 ** fourth parameter. If the fourth parameter is 0, then the database connection
2055 ** passed as the second argument has just been opened. The third argument
2056 ** points to a buffer containing the name of the main database file. If the
@@ -2244,11 +2244,11 @@
2244 **
2245 ** ^The sqlite3_extended_result_codes() routine enables or disables the
2246 ** [extended result codes] feature of SQLite. ^The extended result
2247 ** codes are disabled by default for historical compatibility.
2248 */
2249 SQLITE_API int SQLITE_APICALL sqlite3_extended_result_codes(sqlite3*, int onoff);
2250
2251 /*
2252 ** CAPI3REF: Last Insert Rowid
2253 ** METHOD: sqlite3
2254 **
@@ -2296,11 +2296,11 @@
2296 ** function is running and thus changes the last insert [rowid],
2297 ** then the value returned by [sqlite3_last_insert_rowid()] is
2298 ** unpredictable and might not equal either the old or the new
2299 ** last insert [rowid].
2300 */
2301 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_last_insert_rowid(sqlite3*);
2302
2303 /*
2304 ** CAPI3REF: Count The Number Of Rows Modified
2305 ** METHOD: sqlite3
2306 **
@@ -2349,11 +2349,11 @@
2349 **
2350 ** If a separate thread makes changes on the same database connection
2351 ** while [sqlite3_changes()] is running then the value returned
2352 ** is unpredictable and not meaningful.
2353 */
2354 SQLITE_API int SQLITE_APICALL sqlite3_changes(sqlite3*);
2355
2356 /*
2357 ** CAPI3REF: Total Number Of Rows Modified
2358 ** METHOD: sqlite3
2359 **
@@ -2373,11 +2373,11 @@
2373 **
2374 ** If a separate thread makes changes on the same database connection
2375 ** while [sqlite3_total_changes()] is running then the value
2376 ** returned is unpredictable and not meaningful.
2377 */
2378 SQLITE_API int SQLITE_APICALL sqlite3_total_changes(sqlite3*);
2379
2380 /*
2381 ** CAPI3REF: Interrupt A Long-Running Query
2382 ** METHOD: sqlite3
2383 **
@@ -2413,11 +2413,11 @@
2413 ** that are started after the sqlite3_interrupt() call returns.
2414 **
2415 ** If the database connection closes while [sqlite3_interrupt()]
2416 ** is running then bad things will likely happen.
2417 */
2418 SQLITE_API void SQLITE_APICALL sqlite3_interrupt(sqlite3*);
2419
2420 /*
2421 ** CAPI3REF: Determine If An SQL Statement Is Complete
2422 **
2423 ** These routines are useful during command-line input to determine if the
@@ -2448,12 +2448,12 @@
2448 ** UTF-8 string.
2449 **
2450 ** The input to [sqlite3_complete16()] must be a zero-terminated
2451 ** UTF-16 string in native byte order.
2452 */
2453 SQLITE_API int SQLITE_APICALL sqlite3_complete(const char *sql);
2454 SQLITE_API int SQLITE_APICALL sqlite3_complete16(const void *sql);
2455
2456 /*
2457 ** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
2458 ** KEYWORDS: {busy-handler callback} {busy handler}
2459 ** METHOD: sqlite3
@@ -2510,11 +2510,11 @@
2510 ** result in undefined behavior.
2511 **
2512 ** A busy handler must not close the database connection
2513 ** or [prepared statement] that invoked the busy handler.
2514 */
2515 SQLITE_API int SQLITE_APICALL sqlite3_busy_handler(sqlite3*,int(SQLITE_CALLBACK *)(void*,int),void*);
2516
2517 /*
2518 ** CAPI3REF: Set A Busy Timeout
2519 ** METHOD: sqlite3
2520 **
@@ -2533,11 +2533,11 @@
2533 ** was defined (using [sqlite3_busy_handler()]) prior to calling
2534 ** this routine, that other busy handler is cleared.)^
2535 **
2536 ** See also: [PRAGMA busy_timeout]
2537 */
2538 SQLITE_API int SQLITE_APICALL sqlite3_busy_timeout(sqlite3*, int ms);
2539
2540 /*
2541 ** CAPI3REF: Convenience Routines For Running Queries
2542 ** METHOD: sqlite3
2543 **
@@ -2608,19 +2608,19 @@
2608 ** interface defined here. As a consequence, errors that occur in the
2609 ** wrapper layer outside of the internal [sqlite3_exec()] call are not
2610 ** reflected in subsequent calls to [sqlite3_errcode()] or
2611 ** [sqlite3_errmsg()].
2612 */
2613 SQLITE_API int SQLITE_APICALL sqlite3_get_table(
2614 sqlite3 *db, /* An open database */
2615 const char *zSql, /* SQL to be evaluated */
2616 char ***pazResult, /* Results of the query */
2617 int *pnRow, /* Number of result rows written here */
2618 int *pnColumn, /* Number of result columns written here */
2619 char **pzErrmsg /* Error msg written here */
2620 );
2621 SQLITE_API void SQLITE_APICALL sqlite3_free_table(char **result);
2622
2623 /*
2624 ** CAPI3REF: Formatted String Printing Functions
2625 **
2626 ** These routines are work-alikes of the "printf()" family of functions
@@ -2723,13 +2723,13 @@
2723 ** ^(The "%z" formatting option works like "%s" but with the
2724 ** addition that after the string has been read and copied into
2725 ** the result, [sqlite3_free()] is called on the input string.)^
2726 */
2727 SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...);
2728 SQLITE_API char *SQLITE_APICALL sqlite3_vmprintf(const char*, va_list);
2729 SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...);
2730 SQLITE_API char *SQLITE_APICALL sqlite3_vsnprintf(int,char*,const char*, va_list);
2731
2732 /*
2733 ** CAPI3REF: Memory Allocation Subsystem
2734 **
2735 ** The SQLite core uses these three routines for all of its own
@@ -2815,16 +2815,16 @@
2815 **
2816 ** The application must not read or write any part of
2817 ** a block of memory after it has been released using
2818 ** [sqlite3_free()] or [sqlite3_realloc()].
2819 */
2820 SQLITE_API void *SQLITE_APICALL sqlite3_malloc(int);
2821 SQLITE_API void *SQLITE_APICALL sqlite3_malloc64(sqlite3_uint64);
2822 SQLITE_API void *SQLITE_APICALL sqlite3_realloc(void*, int);
2823 SQLITE_API void *SQLITE_APICALL sqlite3_realloc64(void*, sqlite3_uint64);
2824 SQLITE_API void SQLITE_APICALL sqlite3_free(void*);
2825 SQLITE_API sqlite3_uint64 SQLITE_APICALL sqlite3_msize(void*);
2826
2827 /*
2828 ** CAPI3REF: Memory Allocator Statistics
2829 **
2830 ** SQLite provides these two interfaces for reporting on the status
@@ -2845,12 +2845,12 @@
2845 ** [sqlite3_memory_used()] if and only if the parameter to
2846 ** [sqlite3_memory_highwater()] is true. ^The value returned
2847 ** by [sqlite3_memory_highwater(1)] is the high-water mark
2848 ** prior to the reset.
2849 */
2850 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_used(void);
2851 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_highwater(int resetFlag);
2852
2853 /*
2854 ** CAPI3REF: Pseudo-Random Number Generator
2855 **
2856 ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
@@ -2869,11 +2869,11 @@
2869 ** ^If the previous call to this routine had an N of 1 or more and a
2870 ** non-NULL P then the pseudo-randomness is generated
2871 ** internally and without recourse to the [sqlite3_vfs] xRandomness
2872 ** method.
2873 */
2874 SQLITE_API void SQLITE_APICALL sqlite3_randomness(int N, void *P);
2875
2876 /*
2877 ** CAPI3REF: Compile-Time Authorization Callbacks
2878 ** METHOD: sqlite3
2879 **
@@ -2952,13 +2952,13 @@
2952 ** [sqlite3_prepare()] or its variants. Authorization is not
2953 ** performed during statement evaluation in [sqlite3_step()], unless
2954 ** as stated in the previous paragraph, sqlite3_step() invokes
2955 ** sqlite3_prepare_v2() to reprepare a statement after a schema change.
2956 */
2957 SQLITE_API int SQLITE_APICALL sqlite3_set_authorizer(
2958 sqlite3*,
2959 int (SQLITE_CALLBACK *xAuth)(void*,int,const char*,const char*,const char*,const char*),
2960 void *pUserData
2961 );
2962
2963 /*
2964 ** CAPI3REF: Authorizer Return Codes
@@ -3060,14 +3060,14 @@
3060 ** digits in the time are meaningless. Future versions of SQLite
3061 ** might provide greater resolution on the profiler callback. The
3062 ** sqlite3_profile() function is considered experimental and is
3063 ** subject to change in future versions of SQLite.
3064 */
3065 SQLITE_API SQLITE_DEPRECATED void *SQLITE_APICALL sqlite3_trace(sqlite3*,
3066 void(SQLITE_CALLBACK *xTrace)(void*,const char*), void*);
3067 SQLITE_API SQLITE_DEPRECATED void *SQLITE_APICALL sqlite3_profile(sqlite3*,
3068 void(SQLITE_CALLBACK *xProfile)(void*,const char*,sqlite3_uint64), void*);
3069
3070 /*
3071 ** CAPI3REF: SQL Trace Event Codes
3072 ** KEYWORDS: SQLITE_TRACE
3073 **
@@ -3151,14 +3151,14 @@
3151 **
3152 ** The sqlite3_trace_v2() interface is intended to replace the legacy
3153 ** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which
3154 ** are deprecated.
3155 */
3156 SQLITE_API int SQLITE_APICALL sqlite3_trace_v2(
3157 sqlite3*,
3158 unsigned uMask,
3159 int(SQLITE_CALLBACK *xCallback)(unsigned,void*,void*,void*),
3160 void *pCtx
3161 );
3162
3163 /*
3164 ** CAPI3REF: Query Progress Callbacks
@@ -3190,11 +3190,11 @@
3190 ** the database connection that invoked the progress handler.
3191 ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
3192 ** database connections for the meaning of "modify" in this paragraph.
3193 **
3194 */
3195 SQLITE_API void SQLITE_APICALL sqlite3_progress_handler(sqlite3*, int, int(SQLITE_CALLBACK *)(void*), void*);
3196
3197 /*
3198 ** CAPI3REF: Opening A New Database Connection
3199 ** CONSTRUCTOR: sqlite3
3200 **
@@ -3419,19 +3419,19 @@
3419 ** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various
3420 ** features that require the use of temporary files may fail.
3421 **
3422 ** See also: [sqlite3_temp_directory]
3423 */
3424 SQLITE_API int SQLITE_APICALL sqlite3_open(
3425 const char *filename, /* Database filename (UTF-8) */
3426 sqlite3 **ppDb /* OUT: SQLite db handle */
3427 );
3428 SQLITE_API int SQLITE_APICALL sqlite3_open16(
3429 const void *filename, /* Database filename (UTF-16) */
3430 sqlite3 **ppDb /* OUT: SQLite db handle */
3431 );
3432 SQLITE_API int SQLITE_APICALL sqlite3_open_v2(
3433 const char *filename, /* Database filename (UTF-8) */
3434 sqlite3 **ppDb, /* OUT: SQLite db handle */
3435 int flags, /* Flags */
3436 const char *zVfs /* Name of VFS module to use */
3437 );
@@ -3473,13 +3473,13 @@
3473 ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and
3474 ** is not a database file pathname pointer that SQLite passed into the xOpen
3475 ** VFS method, then the behavior of this routine is undefined and probably
3476 ** undesirable.
3477 */
3478 SQLITE_API const char *SQLITE_APICALL sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3479 SQLITE_API int SQLITE_APICALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3480 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
3481
3482
3483 /*
3484 ** CAPI3REF: Error Codes And Messages
3485 ** METHOD: sqlite3
@@ -3519,15 +3519,15 @@
3519 **
3520 ** If an interface fails with SQLITE_MISUSE, that means the interface
3521 ** was invoked incorrectly by the application. In that case, the
3522 ** error code and message may or may not be set.
3523 */
3524 SQLITE_API int SQLITE_APICALL sqlite3_errcode(sqlite3 *db);
3525 SQLITE_API int SQLITE_APICALL sqlite3_extended_errcode(sqlite3 *db);
3526 SQLITE_API const char *SQLITE_APICALL sqlite3_errmsg(sqlite3*);
3527 SQLITE_API const void *SQLITE_APICALL sqlite3_errmsg16(sqlite3*);
3528 SQLITE_API const char *SQLITE_APICALL sqlite3_errstr(int);
3529
3530 /*
3531 ** CAPI3REF: Prepared Statement Object
3532 ** KEYWORDS: {prepared statement} {prepared statements}
3533 **
@@ -3591,11 +3591,11 @@
3591 ** created by an untrusted script can be contained using the
3592 ** [max_page_count] [PRAGMA].
3593 **
3594 ** New run-time limit categories may be added in future releases.
3595 */
3596 SQLITE_API int SQLITE_APICALL sqlite3_limit(sqlite3*, int id, int newVal);
3597
3598 /*
3599 ** CAPI3REF: Run-Time Limit Categories
3600 ** KEYWORDS: {limit category} {*limit categories}
3601 **
@@ -3743,32 +3743,32 @@
3743 ** or [GLOB] operator or if the parameter is compared to an indexed column
3744 ** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
3745 ** </li>
3746 ** </ol>
3747 */
3748 SQLITE_API int SQLITE_APICALL sqlite3_prepare(
3749 sqlite3 *db, /* Database handle */
3750 const char *zSql, /* SQL statement, UTF-8 encoded */
3751 int nByte, /* Maximum length of zSql in bytes. */
3752 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3753 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3754 );
3755 SQLITE_API int SQLITE_APICALL sqlite3_prepare_v2(
3756 sqlite3 *db, /* Database handle */
3757 const char *zSql, /* SQL statement, UTF-8 encoded */
3758 int nByte, /* Maximum length of zSql in bytes. */
3759 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3760 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3761 );
3762 SQLITE_API int SQLITE_APICALL sqlite3_prepare16(
3763 sqlite3 *db, /* Database handle */
3764 const void *zSql, /* SQL statement, UTF-16 encoded */
3765 int nByte, /* Maximum length of zSql in bytes. */
3766 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3767 const void **pzTail /* OUT: Pointer to unused portion of zSql */
3768 );
3769 SQLITE_API int SQLITE_APICALL sqlite3_prepare16_v2(
3770 sqlite3 *db, /* Database handle */
3771 const void *zSql, /* SQL statement, UTF-16 encoded */
3772 int nByte, /* Maximum length of zSql in bytes. */
3773 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3774 const void **pzTail /* OUT: Pointer to unused portion of zSql */
@@ -3803,12 +3803,12 @@
3803 ** automatically freed when the prepared statement is finalized.
3804 ** ^The string returned by sqlite3_expanded_sql(P), on the other hand,
3805 ** is obtained from [sqlite3_malloc()] and must be free by the application
3806 ** by passing it to [sqlite3_free()].
3807 */
3808 SQLITE_API const char *SQLITE_APICALL sqlite3_sql(sqlite3_stmt *pStmt);
3809 SQLITE_API char *SQLITE_APICALL sqlite3_expanded_sql(sqlite3_stmt *pStmt);
3810
3811 /*
3812 ** CAPI3REF: Determine If An SQL Statement Writes The Database
3813 ** METHOD: sqlite3_stmt
3814 **
@@ -3836,11 +3836,11 @@
3836 ** database. ^The [ATTACH] and [DETACH] statements also cause
3837 ** sqlite3_stmt_readonly() to return true since, while those statements
3838 ** change the configuration of a database connection, they do not make
3839 ** changes to the content of the database files on disk.
3840 */
3841 SQLITE_API int SQLITE_APICALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
3842
3843 /*
3844 ** CAPI3REF: Determine If A Prepared Statement Has Been Reset
3845 ** METHOD: sqlite3_stmt
3846 **
@@ -3857,11 +3857,11 @@
3857 ** to locate all prepared statements associated with a database
3858 ** connection that are in need of being reset. This can be used,
3859 ** for example, in diagnostic routines to search for prepared
3860 ** statements that are holding a transaction open.
3861 */
3862 SQLITE_API int SQLITE_APICALL sqlite3_stmt_busy(sqlite3_stmt*);
3863
3864 /*
3865 ** CAPI3REF: Dynamically Typed Value Object
3866 ** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
3867 **
@@ -4021,24 +4021,24 @@
4021 ** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails.
4022 **
4023 ** See also: [sqlite3_bind_parameter_count()],
4024 ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].
4025 */
4026 SQLITE_API int SQLITE_APICALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(SQLITE_CALLBACK *)(void*));
4027 SQLITE_API int SQLITE_APICALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
4028 void(SQLITE_CALLBACK *)(void*));
4029 SQLITE_API int SQLITE_APICALL sqlite3_bind_double(sqlite3_stmt*, int, double);
4030 SQLITE_API int SQLITE_APICALL sqlite3_bind_int(sqlite3_stmt*, int, int);
4031 SQLITE_API int SQLITE_APICALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
4032 SQLITE_API int SQLITE_APICALL sqlite3_bind_null(sqlite3_stmt*, int);
4033 SQLITE_API int SQLITE_APICALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(SQLITE_CALLBACK *)(void*));
4034 SQLITE_API int SQLITE_APICALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(SQLITE_CALLBACK *)(void*));
4035 SQLITE_API int SQLITE_APICALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
4036 void(SQLITE_CALLBACK *)(void*), unsigned char encoding);
4037 SQLITE_API int SQLITE_APICALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
4038 SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
4039 SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
4040
4041 /*
4042 ** CAPI3REF: Number Of SQL Parameters
4043 ** METHOD: sqlite3_stmt
4044 **
@@ -4055,11 +4055,11 @@
4055 **
4056 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
4057 ** [sqlite3_bind_parameter_name()], and
4058 ** [sqlite3_bind_parameter_index()].
4059 */
4060 SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_count(sqlite3_stmt*);
4061
4062 /*
4063 ** CAPI3REF: Name Of A Host Parameter
4064 ** METHOD: sqlite3_stmt
4065 **
@@ -4083,11 +4083,11 @@
4083 **
4084 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
4085 ** [sqlite3_bind_parameter_count()], and
4086 ** [sqlite3_bind_parameter_index()].
4087 */
4088 SQLITE_API const char *SQLITE_APICALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
4089
4090 /*
4091 ** CAPI3REF: Index Of A Parameter With A Given Name
4092 ** METHOD: sqlite3_stmt
4093 **
@@ -4100,21 +4100,21 @@
4100 **
4101 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
4102 ** [sqlite3_bind_parameter_count()], and
4103 ** [sqlite3_bind_parameter_name()].
4104 */
4105 SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
4106
4107 /*
4108 ** CAPI3REF: Reset All Bindings On A Prepared Statement
4109 ** METHOD: sqlite3_stmt
4110 **
4111 ** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset
4112 ** the [sqlite3_bind_blob | bindings] on a [prepared statement].
4113 ** ^Use this routine to reset all host parameters to NULL.
4114 */
4115 SQLITE_API int SQLITE_APICALL sqlite3_clear_bindings(sqlite3_stmt*);
4116
4117 /*
4118 ** CAPI3REF: Number Of Columns In A Result Set
4119 ** METHOD: sqlite3_stmt
4120 **
@@ -4122,11 +4122,11 @@
4122 ** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
4123 ** statement that does not return data (for example an [UPDATE]).
4124 **
4125 ** See also: [sqlite3_data_count()]
4126 */
4127 SQLITE_API int SQLITE_APICALL sqlite3_column_count(sqlite3_stmt *pStmt);
4128
4129 /*
4130 ** CAPI3REF: Column Names In A Result Set
4131 ** METHOD: sqlite3_stmt
4132 **
@@ -4151,12 +4151,12 @@
4151 ** ^The name of a result column is the value of the "AS" clause for
4152 ** that column, if there is an AS clause. If there is no AS clause
4153 ** then the name of the column is unspecified and may change from
4154 ** one release of SQLite to the next.
4155 */
4156 SQLITE_API const char *SQLITE_APICALL sqlite3_column_name(sqlite3_stmt*, int N);
4157 SQLITE_API const void *SQLITE_APICALL sqlite3_column_name16(sqlite3_stmt*, int N);
4158
4159 /*
4160 ** CAPI3REF: Source Of Data In A Query Result
4161 ** METHOD: sqlite3_stmt
4162 **
@@ -4200,16 +4200,16 @@
4200 ** If two or more threads call one or more
4201 ** [sqlite3_column_database_name | column metadata interfaces]
4202 ** for the same [prepared statement] and result column
4203 ** at the same time then the results are undefined.
4204 */
4205 SQLITE_API const char *SQLITE_APICALL sqlite3_column_database_name(sqlite3_stmt*,int);
4206 SQLITE_API const void *SQLITE_APICALL sqlite3_column_database_name16(sqlite3_stmt*,int);
4207 SQLITE_API const char *SQLITE_APICALL sqlite3_column_table_name(sqlite3_stmt*,int);
4208 SQLITE_API const void *SQLITE_APICALL sqlite3_column_table_name16(sqlite3_stmt*,int);
4209 SQLITE_API const char *SQLITE_APICALL sqlite3_column_origin_name(sqlite3_stmt*,int);
4210 SQLITE_API const void *SQLITE_APICALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
4211
4212 /*
4213 ** CAPI3REF: Declared Datatype Of A Query Result
4214 ** METHOD: sqlite3_stmt
4215 **
@@ -4237,12 +4237,12 @@
4237 ** data stored in that column is of the declared type. SQLite is
4238 ** strongly typed, but the typing is dynamic not static. ^Type
4239 ** is associated with individual values, not with the containers
4240 ** used to hold those values.
4241 */
4242 SQLITE_API const char *SQLITE_APICALL sqlite3_column_decltype(sqlite3_stmt*,int);
4243 SQLITE_API const void *SQLITE_APICALL sqlite3_column_decltype16(sqlite3_stmt*,int);
4244
4245 /*
4246 ** CAPI3REF: Evaluate An SQL Statement
4247 ** METHOD: sqlite3_stmt
4248 **
@@ -4318,11 +4318,11 @@
4318 ** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
4319 ** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,
4320 ** then the more specific [error codes] are returned directly
4321 ** by sqlite3_step(). The use of the "v2" interface is recommended.
4322 */
4323 SQLITE_API int SQLITE_APICALL sqlite3_step(sqlite3_stmt*);
4324
4325 /*
4326 ** CAPI3REF: Number of columns in a result set
4327 ** METHOD: sqlite3_stmt
4328 **
@@ -4339,11 +4339,11 @@
4339 ** where it always returns zero since each step of that multi-step
4340 ** pragma returns 0 columns of data.
4341 **
4342 ** See also: [sqlite3_column_count()]
4343 */
4344 SQLITE_API int SQLITE_APICALL sqlite3_data_count(sqlite3_stmt *pStmt);
4345
4346 /*
4347 ** CAPI3REF: Fundamental Datatypes
4348 ** KEYWORDS: SQLITE_TEXT
4349 **
@@ -4529,20 +4529,20 @@
4529 ** of these routines, a default value is returned. The default value
4530 ** is either the integer 0, the floating point number 0.0, or a NULL
4531 ** pointer. Subsequent calls to [sqlite3_errcode()] will return
4532 ** [SQLITE_NOMEM].)^
4533 */
4534 SQLITE_API const void *SQLITE_APICALL sqlite3_column_blob(sqlite3_stmt*, int iCol);
4535 SQLITE_API int SQLITE_APICALL sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4536 SQLITE_API int SQLITE_APICALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4537 SQLITE_API double SQLITE_APICALL sqlite3_column_double(sqlite3_stmt*, int iCol);
4538 SQLITE_API int SQLITE_APICALL sqlite3_column_int(sqlite3_stmt*, int iCol);
4539 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_column_int64(sqlite3_stmt*, int iCol);
4540 SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_column_text(sqlite3_stmt*, int iCol);
4541 SQLITE_API const void *SQLITE_APICALL sqlite3_column_text16(sqlite3_stmt*, int iCol);
4542 SQLITE_API int SQLITE_APICALL sqlite3_column_type(sqlite3_stmt*, int iCol);
4543 SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_column_value(sqlite3_stmt*, int iCol);
4544
4545 /*
4546 ** CAPI3REF: Destroy A Prepared Statement Object
4547 ** DESTRUCTOR: sqlite3_stmt
4548 **
@@ -4566,11 +4566,11 @@
4566 ** resource leaks. It is a grievous error for the application to try to use
4567 ** a prepared statement after it has been finalized. Any use of a prepared
4568 ** statement after it has been finalized can result in undefined and
4569 ** undesirable behavior such as segfaults and heap corruption.
4570 */
4571 SQLITE_API int SQLITE_APICALL sqlite3_finalize(sqlite3_stmt *pStmt);
4572
4573 /*
4574 ** CAPI3REF: Reset A Prepared Statement Object
4575 ** METHOD: sqlite3_stmt
4576 **
@@ -4593,11 +4593,11 @@
4593 ** [sqlite3_reset(S)] returns an appropriate [error code].
4594 **
4595 ** ^The [sqlite3_reset(S)] interface does not change the values
4596 ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
4597 */
4598 SQLITE_API int SQLITE_APICALL sqlite3_reset(sqlite3_stmt *pStmt);
4599
4600 /*
4601 ** CAPI3REF: Create Or Redefine SQL Functions
4602 ** KEYWORDS: {function creation routines}
4603 ** KEYWORDS: {application-defined SQL function}
@@ -4693,40 +4693,40 @@
4693 ** ^An application-defined function is permitted to call other
4694 ** SQLite interfaces. However, such calls must not
4695 ** close the database connection nor finalize or reset the prepared
4696 ** statement in which the function is running.
4697 */
4698 SQLITE_API int SQLITE_APICALL sqlite3_create_function(
4699 sqlite3 *db,
4700 const char *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_function16(
4709 sqlite3 *db,
4710 const void *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 );
4718 SQLITE_API int SQLITE_APICALL sqlite3_create_function_v2(
4719 sqlite3 *db,
4720 const char *zFunctionName,
4721 int nArg,
4722 int eTextRep,
4723 void *pApp,
4724 void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**),
4725 void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**),
4726 void (SQLITE_CALLBACK *xFinal)(sqlite3_context*),
4727 void(SQLITE_CALLBACK *xDestroy)(void*)
4728 );
4729
4730 /*
4731 ** CAPI3REF: Text Encodings
4732 **
@@ -4759,16 +4759,16 @@
4759 ** to be supported. However, new applications should avoid
4760 ** the use of these functions. To encourage programmers to avoid
4761 ** these functions, we will not explain what they do.
4762 */
4763 #ifndef SQLITE_OMIT_DEPRECATED
4764 SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_aggregate_count(sqlite3_context*);
4765 SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_expired(sqlite3_stmt*);
4766 SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4767 SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_global_recover(void);
4768 SQLITE_API SQLITE_DEPRECATED void SQLITE_APICALL sqlite3_thread_cleanup(void);
4769 SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_memory_alarm(void(SQLITE_CALLBACK *)(void*,sqlite3_int64,int),
4770 void*,sqlite3_int64);
4771 #endif
4772
4773 /*
4774 ** CAPI3REF: Obtaining SQL Values
@@ -4814,22 +4814,22 @@
4814 ** or [sqlite3_value_text16()].
4815 **
4816 ** These routines must be called from the same thread as
4817 ** the SQL function that supplied the [sqlite3_value*] parameters.
4818 */
4819 SQLITE_API const void *SQLITE_APICALL sqlite3_value_blob(sqlite3_value*);
4820 SQLITE_API int SQLITE_APICALL sqlite3_value_bytes(sqlite3_value*);
4821 SQLITE_API int SQLITE_APICALL sqlite3_value_bytes16(sqlite3_value*);
4822 SQLITE_API double SQLITE_APICALL sqlite3_value_double(sqlite3_value*);
4823 SQLITE_API int SQLITE_APICALL sqlite3_value_int(sqlite3_value*);
4824 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_value_int64(sqlite3_value*);
4825 SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_value_text(sqlite3_value*);
4826 SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16(sqlite3_value*);
4827 SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16le(sqlite3_value*);
4828 SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16be(sqlite3_value*);
4829 SQLITE_API int SQLITE_APICALL sqlite3_value_type(sqlite3_value*);
4830 SQLITE_API int SQLITE_APICALL sqlite3_value_numeric_type(sqlite3_value*);
4831
4832 /*
4833 ** CAPI3REF: Finding The Subtype Of SQL Values
4834 ** METHOD: sqlite3_value
4835 **
@@ -4841,11 +4841,11 @@
4841 **
4842 ** SQLite makes no use of subtype itself. It merely passes the subtype
4843 ** from the result of one [application-defined SQL function] into the
4844 ** input of another.
4845 */
4846 SQLITE_API unsigned int SQLITE_APICALL sqlite3_value_subtype(sqlite3_value*);
4847
4848 /*
4849 ** CAPI3REF: Copy And Free SQL Values
4850 ** METHOD: sqlite3_value
4851 **
@@ -4857,12 +4857,12 @@
4857 **
4858 ** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object
4859 ** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer
4860 ** then sqlite3_value_free(V) is a harmless no-op.
4861 */
4862 SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_value_dup(const sqlite3_value*);
4863 SQLITE_API void SQLITE_APICALL sqlite3_value_free(sqlite3_value*);
4864
4865 /*
4866 ** CAPI3REF: Obtain Aggregate Function Context
4867 ** METHOD: sqlite3_context
4868 **
@@ -4903,11 +4903,11 @@
4903 ** function.
4904 **
4905 ** This routine must be called from the same thread in which
4906 ** the aggregate SQL function is running.
4907 */
4908 SQLITE_API void *SQLITE_APICALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
4909
4910 /*
4911 ** CAPI3REF: User Data For Functions
4912 ** METHOD: sqlite3_context
4913 **
@@ -4918,11 +4918,11 @@
4918 ** registered the application defined function.
4919 **
4920 ** This routine must be called from the same thread in which
4921 ** the application-defined function is running.
4922 */
4923 SQLITE_API void *SQLITE_APICALL sqlite3_user_data(sqlite3_context*);
4924
4925 /*
4926 ** CAPI3REF: Database Connection For Functions
4927 ** METHOD: sqlite3_context
4928 **
@@ -4930,11 +4930,11 @@
4930 ** the pointer to the [database connection] (the 1st parameter)
4931 ** of the [sqlite3_create_function()]
4932 ** and [sqlite3_create_function16()] routines that originally
4933 ** registered the application defined function.
4934 */
4935 SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_context_db_handle(sqlite3_context*);
4936
4937 /*
4938 ** CAPI3REF: Function Auxiliary Data
4939 ** METHOD: sqlite3_context
4940 **
@@ -4962,16 +4962,17 @@
4962 ** NULL if the metadata has been discarded.
4963 ** ^After each call to sqlite3_set_auxdata(C,N,P,X) where X is not NULL,
4964 ** SQLite will invoke the destructor function X with parameter P exactly
4965 ** once, when the metadata is discarded.
4966 ** SQLite is free to discard the metadata at any time, including: <ul>
4967 ** <li> when the corresponding function parameter changes, or
4968 ** <li> when [sqlite3_reset()] or [sqlite3_finalize()] is called for the
4969 ** SQL statement, or
4970 ** <li> when sqlite3_set_auxdata() is invoked again on the same parameter, or
4971 ** <li> during the original sqlite3_set_auxdata() call when a memory
4972 ** allocation error occurs. </ul>)^
 
4973 **
4974 ** Note the last bullet in particular. The destructor X in
4975 ** sqlite3_set_auxdata(C,N,P,X) might be called immediately, before the
4976 ** sqlite3_set_auxdata() interface even returns. Hence sqlite3_set_auxdata()
4977 ** should be called near the end of the function implementation and the
@@ -4983,12 +4984,12 @@
4983 ** values and [parameters] and expressions composed from the same.)^
4984 **
4985 ** These routines must be called from the same thread in which
4986 ** the SQL function is running.
4987 */
4988 SQLITE_API void *SQLITE_APICALL sqlite3_get_auxdata(sqlite3_context*, int N);
4989 SQLITE_API void SQLITE_APICALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (SQLITE_CALLBACK *)(void*));
4990
4991
4992 /*
4993 ** CAPI3REF: Constants Defining Special Destructor Behavior
4994 **
@@ -5001,11 +5002,11 @@
5001 ** the content before returning.
5002 **
5003 ** The typedef is necessary to work around problems in certain
5004 ** C++ compilers.
5005 */
5006 typedef void (SQLITE_CALLBACK *sqlite3_destructor_type)(void*);
5007 #define SQLITE_STATIC ((sqlite3_destructor_type)0)
5008 #define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1)
5009
5010 /*
5011 ** CAPI3REF: Setting The Result Of An SQL Function
@@ -5120,31 +5121,31 @@
5120 **
5121 ** If these routines are called from within the different thread
5122 ** than the one containing the application-defined function that received
5123 ** the [sqlite3_context] pointer, the results are undefined.
5124 */
5125 SQLITE_API void SQLITE_APICALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(SQLITE_CALLBACK *)(void*));
5126 SQLITE_API void SQLITE_APICALL sqlite3_result_blob64(sqlite3_context*,const void*,
5127 sqlite3_uint64,void(SQLITE_CALLBACK *)(void*));
5128 SQLITE_API void SQLITE_APICALL sqlite3_result_double(sqlite3_context*, double);
5129 SQLITE_API void SQLITE_APICALL sqlite3_result_error(sqlite3_context*, const char*, int);
5130 SQLITE_API void SQLITE_APICALL sqlite3_result_error16(sqlite3_context*, const void*, int);
5131 SQLITE_API void SQLITE_APICALL sqlite3_result_error_toobig(sqlite3_context*);
5132 SQLITE_API void SQLITE_APICALL sqlite3_result_error_nomem(sqlite3_context*);
5133 SQLITE_API void SQLITE_APICALL sqlite3_result_error_code(sqlite3_context*, int);
5134 SQLITE_API void SQLITE_APICALL sqlite3_result_int(sqlite3_context*, int);
5135 SQLITE_API void SQLITE_APICALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
5136 SQLITE_API void SQLITE_APICALL sqlite3_result_null(sqlite3_context*);
5137 SQLITE_API void SQLITE_APICALL sqlite3_result_text(sqlite3_context*, const char*, int, void(SQLITE_CALLBACK *)(void*));
5138 SQLITE_API void SQLITE_APICALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
5139 void(SQLITE_CALLBACK *)(void*), unsigned char encoding);
5140 SQLITE_API void SQLITE_APICALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(SQLITE_CALLBACK *)(void*));
5141 SQLITE_API void SQLITE_APICALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(SQLITE_CALLBACK *)(void*));
5142 SQLITE_API void SQLITE_APICALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(SQLITE_CALLBACK *)(void*));
5143 SQLITE_API void SQLITE_APICALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
5144 SQLITE_API void SQLITE_APICALL sqlite3_result_zeroblob(sqlite3_context*, int n);
5145 SQLITE_API int SQLITE_APICALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
5146
5147
5148 /*
5149 ** CAPI3REF: Setting The Subtype Of An SQL Function
5150 ** METHOD: sqlite3_context
@@ -5155,11 +5156,11 @@
5155 ** of the subtype T are preserved in current versions of SQLite;
5156 ** higher order bits are discarded.
5157 ** The number of subtype bytes preserved by SQLite might increase
5158 ** in future releases of SQLite.
5159 */
5160 SQLITE_API void SQLITE_APICALL sqlite3_result_subtype(sqlite3_context*,unsigned int);
5161
5162 /*
5163 ** CAPI3REF: Define New Collating Sequences
5164 ** METHOD: sqlite3
5165 **
@@ -5237,31 +5238,31 @@
5237 ** is unfortunate but cannot be changed without breaking backwards
5238 ** compatibility.
5239 **
5240 ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].
5241 */
5242 SQLITE_API int SQLITE_APICALL sqlite3_create_collation(
5243 sqlite3*,
5244 const char *zName,
5245 int eTextRep,
5246 void *pArg,
5247 int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*)
5248 );
5249 SQLITE_API int SQLITE_APICALL sqlite3_create_collation_v2(
5250 sqlite3*,
5251 const char *zName,
5252 int eTextRep,
5253 void *pArg,
5254 int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*),
5255 void(SQLITE_CALLBACK *xDestroy)(void*)
5256 );
5257 SQLITE_API int SQLITE_APICALL sqlite3_create_collation16(
5258 sqlite3*,
5259 const void *zName,
5260 int eTextRep,
5261 void *pArg,
5262 int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*)
5263 );
5264
5265 /*
5266 ** CAPI3REF: Collation Needed Callbacks
5267 ** METHOD: sqlite3
@@ -5287,19 +5288,19 @@
5287 **
5288 ** The callback function should register the desired collation using
5289 ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or
5290 ** [sqlite3_create_collation_v2()].
5291 */
5292 SQLITE_API int SQLITE_APICALL sqlite3_collation_needed(
5293 sqlite3*,
5294 void*,
5295 void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const char*)
5296 );
5297 SQLITE_API int SQLITE_APICALL sqlite3_collation_needed16(
5298 sqlite3*,
5299 void*,
5300 void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const void*)
5301 );
5302
5303 #ifdef SQLITE_HAS_CODEC
5304 /*
5305 ** Specify the key for an encrypted database. This routine should be
@@ -5306,15 +5307,15 @@
5306 ** called right after sqlite3_open().
5307 **
5308 ** The code to implement this API is not available in the public release
5309 ** of SQLite.
5310 */
5311 SQLITE_API int SQLITE_APICALL sqlite3_key(
5312 sqlite3 *db, /* Database to be rekeyed */
5313 const void *pKey, int nKey /* The key */
5314 );
5315 SQLITE_API int SQLITE_APICALL sqlite3_key_v2(
5316 sqlite3 *db, /* Database to be rekeyed */
5317 const char *zDbName, /* Name of the database */
5318 const void *pKey, int nKey /* The key */
5319 );
5320
@@ -5324,35 +5325,35 @@
5324 ** database is decrypted.
5325 **
5326 ** The code to implement this API is not available in the public release
5327 ** of SQLite.
5328 */
5329 SQLITE_API int SQLITE_APICALL sqlite3_rekey(
5330 sqlite3 *db, /* Database to be rekeyed */
5331 const void *pKey, int nKey /* The new key */
5332 );
5333 SQLITE_API int SQLITE_APICALL sqlite3_rekey_v2(
5334 sqlite3 *db, /* Database to be rekeyed */
5335 const char *zDbName, /* Name of the database */
5336 const void *pKey, int nKey /* The new key */
5337 );
5338
5339 /*
5340 ** Specify the activation key for a SEE database. Unless
5341 ** activated, none of the SEE routines will work.
5342 */
5343 SQLITE_API void SQLITE_APICALL sqlite3_activate_see(
5344 const char *zPassPhrase /* Activation phrase */
5345 );
5346 #endif
5347
5348 #ifdef SQLITE_ENABLE_CEROD
5349 /*
5350 ** Specify the activation key for a CEROD database. Unless
5351 ** activated, none of the CEROD routines will work.
5352 */
5353 SQLITE_API void SQLITE_APICALL sqlite3_activate_cerod(
5354 const char *zPassPhrase /* Activation phrase */
5355 );
5356 #endif
5357
5358 /*
@@ -5370,11 +5371,11 @@
5370 ** method of the default [sqlite3_vfs] object. If the xSleep() method
5371 ** of the default VFS is not implemented correctly, or not implemented at
5372 ** all, then the behavior of sqlite3_sleep() may deviate from the description
5373 ** in the previous paragraphs.
5374 */
5375 SQLITE_API int SQLITE_APICALL sqlite3_sleep(int);
5376
5377 /*
5378 ** CAPI3REF: Name Of The Folder Holding Temporary Files
5379 **
5380 ** ^(If this global variable is made to point to a string which is
@@ -5489,11 +5490,11 @@
5489 **
5490 ** If another thread changes the autocommit status of the database
5491 ** connection while this routine is running, then the return value
5492 ** is undefined.
5493 */
5494 SQLITE_API int SQLITE_APICALL sqlite3_get_autocommit(sqlite3*);
5495
5496 /*
5497 ** CAPI3REF: Find The Database Handle Of A Prepared Statement
5498 ** METHOD: sqlite3_stmt
5499 **
@@ -5502,11 +5503,11 @@
5502 ** returned by sqlite3_db_handle is the same [database connection]
5503 ** that was the first argument
5504 ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
5505 ** create the statement in the first place.
5506 */
5507 SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_db_handle(sqlite3_stmt*);
5508
5509 /*
5510 ** CAPI3REF: Return The Filename For A Database Connection
5511 ** METHOD: sqlite3
5512 **
@@ -5519,21 +5520,21 @@
5519 ** ^The filename returned by this function is the output of the
5520 ** xFullPathname method of the [VFS]. ^In other words, the filename
5521 ** will be an absolute pathname, even if the filename used
5522 ** to open the database originally was a URI or relative pathname.
5523 */
5524 SQLITE_API const char *SQLITE_APICALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
5525
5526 /*
5527 ** CAPI3REF: Determine if a database is read-only
5528 ** METHOD: sqlite3
5529 **
5530 ** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N
5531 ** of connection D is read-only, 0 if it is read/write, or -1 if N is not
5532 ** the name of a database on connection D.
5533 */
5534 SQLITE_API int SQLITE_APICALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
5535
5536 /*
5537 ** CAPI3REF: Find the next prepared statement
5538 ** METHOD: sqlite3
5539 **
@@ -5545,11 +5546,11 @@
5545 **
5546 ** The [database connection] pointer D in a call to
5547 ** [sqlite3_next_stmt(D,S)] must refer to an open database
5548 ** connection and in particular must not be a NULL pointer.
5549 */
5550 SQLITE_API sqlite3_stmt *SQLITE_APICALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
5551
5552 /*
5553 ** CAPI3REF: Commit And Rollback Notification Callbacks
5554 ** METHOD: sqlite3
5555 **
@@ -5594,12 +5595,12 @@
5594 ** ^The rollback callback is not invoked if a transaction is
5595 ** automatically rolled back because the database connection is closed.
5596 **
5597 ** See also the [sqlite3_update_hook()] interface.
5598 */
5599 SQLITE_API void *SQLITE_APICALL sqlite3_commit_hook(sqlite3*, int(SQLITE_CALLBACK *)(void*), void*);
5600 SQLITE_API void *SQLITE_APICALL sqlite3_rollback_hook(sqlite3*, void(SQLITE_CALLBACK *)(void *), void*);
5601
5602 /*
5603 ** CAPI3REF: Data Change Notification Callbacks
5604 ** METHOD: sqlite3
5605 **
@@ -5646,13 +5647,13 @@
5646 ** the first call on D.
5647 **
5648 ** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()],
5649 ** and [sqlite3_preupdate_hook()] interfaces.
5650 */
5651 SQLITE_API void *SQLITE_APICALL sqlite3_update_hook(
5652 sqlite3*,
5653 void(SQLITE_CALLBACK *)(void *,int ,char const *,char const *,sqlite3_int64),
5654 void*
5655 );
5656
5657 /*
5658 ** CAPI3REF: Enable Or Disable Shared Pager Cache
@@ -5686,11 +5687,11 @@
5686 ** This interface is threadsafe on processors where writing a
5687 ** 32-bit integer is atomic.
5688 **
5689 ** See Also: [SQLite Shared-Cache Mode]
5690 */
5691 SQLITE_API int SQLITE_APICALL sqlite3_enable_shared_cache(int);
5692
5693 /*
5694 ** CAPI3REF: Attempt To Free Heap Memory
5695 **
5696 ** ^The sqlite3_release_memory() interface attempts to free N bytes
@@ -5702,11 +5703,11 @@
5702 ** ^The sqlite3_release_memory() routine is a no-op returning zero
5703 ** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5704 **
5705 ** See also: [sqlite3_db_release_memory()]
5706 */
5707 SQLITE_API int SQLITE_APICALL sqlite3_release_memory(int);
5708
5709 /*
5710 ** CAPI3REF: Free Memory Used By A Database Connection
5711 ** METHOD: sqlite3
5712 **
@@ -5716,11 +5717,11 @@
5716 ** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
5717 ** omitted.
5718 **
5719 ** See also: [sqlite3_release_memory()]
5720 */
5721 SQLITE_API int SQLITE_APICALL sqlite3_db_release_memory(sqlite3*);
5722
5723 /*
5724 ** CAPI3REF: Impose A Limit On Heap Size
5725 **
5726 ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the
@@ -5768,11 +5769,11 @@
5768 ** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5769 **
5770 ** The circumstances under which SQLite will enforce the soft heap limit may
5771 ** changes in future releases of SQLite.
5772 */
5773 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
5774
5775 /*
5776 ** CAPI3REF: Deprecated Soft Heap Limit Interface
5777 ** DEPRECATED
5778 **
@@ -5779,11 +5780,11 @@
5779 ** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
5780 ** interface. This routine is provided for historical compatibility
5781 ** only. All new applications should use the
5782 ** [sqlite3_soft_heap_limit64()] interface rather than this one.
5783 */
5784 SQLITE_API SQLITE_DEPRECATED void SQLITE_APICALL sqlite3_soft_heap_limit(int N);
5785
5786
5787 /*
5788 ** CAPI3REF: Extract Metadata About A Column Of A Table
5789 ** METHOD: sqlite3
@@ -5849,11 +5850,11 @@
5849 **
5850 ** ^This function causes all database schemas to be read from disk and
5851 ** parsed, if that has not already been done, and returns an error if
5852 ** any errors are encountered while loading the schema.
5853 */
5854 SQLITE_API int SQLITE_APICALL sqlite3_table_column_metadata(
5855 sqlite3 *db, /* Connection handle */
5856 const char *zDbName, /* Database name or NULL */
5857 const char *zTableName, /* Table name */
5858 const char *zColumnName, /* Column name */
5859 char const **pzDataType, /* OUTPUT: Declared data type */
@@ -5905,11 +5906,11 @@
5905 ** disabled and prevent SQL injections from giving attackers
5906 ** access to extension loading capabilities.
5907 **
5908 ** See also the [load_extension() SQL function].
5909 */
5910 SQLITE_API int SQLITE_APICALL sqlite3_load_extension(
5911 sqlite3 *db, /* Load the extension into this database connection */
5912 const char *zFile, /* Name of the shared library containing extension */
5913 const char *zProc, /* Entry point. Derived from zFile if 0 */
5914 char **pzErrMsg /* Put error message here if not 0 */
5915 );
@@ -5928,20 +5929,20 @@
5928 ** to turn extension loading on and call it with onoff==0 to turn
5929 ** it back off again.
5930 **
5931 ** ^This interface enables or disables both the C-API
5932 ** [sqlite3_load_extension()] and the SQL function [load_extension()].
5933 ** Use [sqlite3_db_config](db,[SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION],..)
5934 ** to enable or disable only the C-API.
5935 **
5936 ** <b>Security warning:</b> It is recommended that extension loading
5937 ** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method
5938 ** rather than this interface, so the [load_extension()] SQL function
5939 ** remains disabled. This will prevent SQL injections from giving attackers
5940 ** access to extension loading capabilities.
5941 */
5942 SQLITE_API int SQLITE_APICALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
5943
5944 /*
5945 ** CAPI3REF: Automatically Load Statically Linked Extensions
5946 **
5947 ** ^This interface causes the xEntryPoint() function to be invoked for
@@ -5975,11 +5976,11 @@
5975 ** will be called more than once for each database connection that is opened.
5976 **
5977 ** See also: [sqlite3_reset_auto_extension()]
5978 ** and [sqlite3_cancel_auto_extension()]
5979 */
5980 SQLITE_API int SQLITE_APICALL sqlite3_auto_extension(void(SQLITE_CALLBACK *xEntryPoint)(void));
5981
5982 /*
5983 ** CAPI3REF: Cancel Automatic Extension Loading
5984 **
5985 ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
@@ -5987,19 +5988,19 @@
5987 ** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)]
5988 ** routine returns 1 if initialization routine X was successfully
5989 ** unregistered and it returns 0 if X was not on the list of initialization
5990 ** routines.
5991 */
5992 SQLITE_API int SQLITE_APICALL sqlite3_cancel_auto_extension(void(SQLITE_CALLBACK *xEntryPoint)(void));
5993
5994 /*
5995 ** CAPI3REF: Reset Automatic Extension Loading
5996 **
5997 ** ^This interface disables all automatic extensions previously
5998 ** registered using [sqlite3_auto_extension()].
5999 */
6000 SQLITE_API void SQLITE_APICALL sqlite3_reset_auto_extension(void);
6001
6002 /*
6003 ** The interface to the virtual-table mechanism is currently considered
6004 ** to be experimental. The interface might change in incompatible ways.
6005 ** If this is a problem for you, do not use the interface at this time.
@@ -6032,41 +6033,41 @@
6032 ** of this structure must not change while it is registered with
6033 ** any database connection.
6034 */
6035 struct sqlite3_module {
6036 int iVersion;
6037 int (SQLITE_CALLBACK *xCreate)(sqlite3*, void *pAux,
6038 int argc, const char *const*argv,
6039 sqlite3_vtab **ppVTab, char**);
6040 int (SQLITE_CALLBACK *xConnect)(sqlite3*, void *pAux,
6041 int argc, const char *const*argv,
6042 sqlite3_vtab **ppVTab, char**);
6043 int (SQLITE_CALLBACK *xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
6044 int (SQLITE_CALLBACK *xDisconnect)(sqlite3_vtab *pVTab);
6045 int (SQLITE_CALLBACK *xDestroy)(sqlite3_vtab *pVTab);
6046 int (SQLITE_CALLBACK *xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);
6047 int (SQLITE_CALLBACK *xClose)(sqlite3_vtab_cursor*);
6048 int (SQLITE_CALLBACK *xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
6049 int argc, sqlite3_value **argv);
6050 int (SQLITE_CALLBACK *xNext)(sqlite3_vtab_cursor*);
6051 int (SQLITE_CALLBACK *xEof)(sqlite3_vtab_cursor*);
6052 int (SQLITE_CALLBACK *xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int);
6053 int (SQLITE_CALLBACK *xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid);
6054 int (SQLITE_CALLBACK *xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *);
6055 int (SQLITE_CALLBACK *xBegin)(sqlite3_vtab *pVTab);
6056 int (SQLITE_CALLBACK *xSync)(sqlite3_vtab *pVTab);
6057 int (SQLITE_CALLBACK *xCommit)(sqlite3_vtab *pVTab);
6058 int (SQLITE_CALLBACK *xRollback)(sqlite3_vtab *pVTab);
6059 int (SQLITE_CALLBACK *xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,
6060 void (SQLITE_CALLBACK **pxFunc)(sqlite3_context*,int,sqlite3_value**),
6061 void **ppArg);
6062 int (SQLITE_CALLBACK *xRename)(sqlite3_vtab *pVtab, const char *zNew);
6063 /* The methods above are in version 1 of the sqlite_module object. Those
6064 ** below are for version 2 and greater. */
6065 int (SQLITE_CALLBACK *xSavepoint)(sqlite3_vtab *pVTab, int);
6066 int (SQLITE_CALLBACK *xRelease)(sqlite3_vtab *pVTab, int);
6067 int (SQLITE_CALLBACK *xRollbackTo)(sqlite3_vtab *pVTab, int);
6068 };
6069
6070 /*
6071 ** CAPI3REF: Virtual Table Indexing Information
6072 ** KEYWORDS: sqlite3_index_info
@@ -6240,22 +6241,22 @@
6240 ** be invoked if the call to sqlite3_create_module_v2() fails.
6241 ** ^The sqlite3_create_module()
6242 ** interface is equivalent to sqlite3_create_module_v2() with a NULL
6243 ** destructor.
6244 */
6245 SQLITE_API int SQLITE_APICALL sqlite3_create_module(
6246 sqlite3 *db, /* SQLite connection to register module with */
6247 const char *zName, /* Name of the module */
6248 const sqlite3_module *p, /* Methods for the module */
6249 void *pClientData /* Client data for xCreate/xConnect */
6250 );
6251 SQLITE_API int SQLITE_APICALL sqlite3_create_module_v2(
6252 sqlite3 *db, /* SQLite connection to register module with */
6253 const char *zName, /* Name of the module */
6254 const sqlite3_module *p, /* Methods for the module */
6255 void *pClientData, /* Client data for xCreate/xConnect */
6256 void(SQLITE_CALLBACK *xDestroy)(void*) /* Module destructor function */
6257 );
6258
6259 /*
6260 ** CAPI3REF: Virtual Table Instance Object
6261 ** KEYWORDS: sqlite3_vtab
@@ -6309,11 +6310,11 @@
6309 ** ^The [xCreate] and [xConnect] methods of a
6310 ** [virtual table module] call this interface
6311 ** to declare the format (the names and datatypes of the columns) of
6312 ** the virtual tables they implement.
6313 */
6314 SQLITE_API int SQLITE_APICALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
6315
6316 /*
6317 ** CAPI3REF: Overload A Function For A Virtual Table
6318 ** METHOD: sqlite3
6319 **
@@ -6328,11 +6329,11 @@
6328 ** of the new function always causes an exception to be thrown. So
6329 ** the new function is not good for anything by itself. Its only
6330 ** purpose is to be a placeholder function that can be overloaded
6331 ** by a [virtual table].
6332 */
6333 SQLITE_API int SQLITE_APICALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
6334
6335 /*
6336 ** The interface to the virtual-table mechanism defined above (back up
6337 ** to a comment remarkably similar to this one) is currently considered
6338 ** to be experimental. The interface might change in incompatible ways.
@@ -6427,11 +6428,11 @@
6427 ** zero-filled blob to read or write using the incremental-blob interface.
6428 **
6429 ** To avoid a resource leak, every open [BLOB handle] should eventually
6430 ** be released by a call to [sqlite3_blob_close()].
6431 */
6432 SQLITE_API int SQLITE_APICALL sqlite3_blob_open(
6433 sqlite3*,
6434 const char *zDb,
6435 const char *zTable,
6436 const char *zColumn,
6437 sqlite3_int64 iRow,
@@ -6460,11 +6461,11 @@
6460 ** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
6461 ** always returns zero.
6462 **
6463 ** ^This function sets the database handle error code and message.
6464 */
6465 SQLITE_API int SQLITE_APICALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
6466
6467 /*
6468 ** CAPI3REF: Close A BLOB Handle
6469 ** DESTRUCTOR: sqlite3_blob
6470 **
@@ -6483,11 +6484,11 @@
6483 ** with a null pointer (such as would be returned by a failed call to
6484 ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function
6485 ** is passed a valid open blob handle, the values returned by the
6486 ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning.
6487 */
6488 SQLITE_API int SQLITE_APICALL sqlite3_blob_close(sqlite3_blob *);
6489
6490 /*
6491 ** CAPI3REF: Return The Size Of An Open BLOB
6492 ** METHOD: sqlite3_blob
6493 **
@@ -6499,11 +6500,11 @@
6499 ** This routine only works on a [BLOB handle] which has been created
6500 ** by a prior successful call to [sqlite3_blob_open()] and which has not
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 SQLITE_API int SQLITE_APICALL sqlite3_blob_bytes(sqlite3_blob *);
6505
6506 /*
6507 ** CAPI3REF: Read Data From A BLOB Incrementally
6508 ** METHOD: sqlite3_blob
6509 **
@@ -6528,11 +6529,11 @@
6528 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6529 ** to this routine results in undefined and probably undesirable behavior.
6530 **
6531 ** See also: [sqlite3_blob_write()].
6532 */
6533 SQLITE_API int SQLITE_APICALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
6534
6535 /*
6536 ** CAPI3REF: Write Data Into A BLOB Incrementally
6537 ** METHOD: sqlite3_blob
6538 **
@@ -6570,11 +6571,11 @@
6570 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6571 ** to this routine results in undefined and probably undesirable behavior.
6572 **
6573 ** See also: [sqlite3_blob_read()].
6574 */
6575 SQLITE_API int SQLITE_APICALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
6576
6577 /*
6578 ** CAPI3REF: Virtual File System Objects
6579 **
6580 ** A virtual filesystem (VFS) is an [sqlite3_vfs] object
@@ -6601,13 +6602,13 @@
6601 **
6602 ** ^Unregister a VFS with the sqlite3_vfs_unregister() interface.
6603 ** ^(If the default VFS is unregistered, another VFS is chosen as
6604 ** the default. The choice for the new VFS is arbitrary.)^
6605 */
6606 SQLITE_API sqlite3_vfs *SQLITE_APICALL sqlite3_vfs_find(const char *zVfsName);
6607 SQLITE_API int SQLITE_APICALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
6608 SQLITE_API int SQLITE_APICALL sqlite3_vfs_unregister(sqlite3_vfs*);
6609
6610 /*
6611 ** CAPI3REF: Mutexes
6612 **
6613 ** The SQLite core uses these routines for thread
@@ -6719,15 +6720,15 @@
6719 ** sqlite3_mutex_leave() is a NULL pointer, then all three routines
6720 ** behave as no-ops.
6721 **
6722 ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
6723 */
6724 SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_mutex_alloc(int);
6725 SQLITE_API void SQLITE_APICALL sqlite3_mutex_free(sqlite3_mutex*);
6726 SQLITE_API void SQLITE_APICALL sqlite3_mutex_enter(sqlite3_mutex*);
6727 SQLITE_API int SQLITE_APICALL sqlite3_mutex_try(sqlite3_mutex*);
6728 SQLITE_API void SQLITE_APICALL sqlite3_mutex_leave(sqlite3_mutex*);
6729
6730 /*
6731 ** CAPI3REF: Mutex Methods Object
6732 **
6733 ** An instance of this structure defines the low-level routines
@@ -6792,19 +6793,19 @@
6792 ** If xMutexInit fails in any way, it is expected to clean up after itself
6793 ** prior to returning.
6794 */
6795 typedef struct sqlite3_mutex_methods sqlite3_mutex_methods;
6796 struct sqlite3_mutex_methods {
6797 int (SQLITE_CALLBACK *xMutexInit)(void);
6798 int (SQLITE_CALLBACK *xMutexEnd)(void);
6799 sqlite3_mutex *(SQLITE_CALLBACK *xMutexAlloc)(int);
6800 void (SQLITE_CALLBACK *xMutexFree)(sqlite3_mutex *);
6801 void (SQLITE_CALLBACK *xMutexEnter)(sqlite3_mutex *);
6802 int (SQLITE_CALLBACK *xMutexTry)(sqlite3_mutex *);
6803 void (SQLITE_CALLBACK *xMutexLeave)(sqlite3_mutex *);
6804 int (SQLITE_CALLBACK *xMutexHeld)(sqlite3_mutex *);
6805 int (SQLITE_CALLBACK *xMutexNotheld)(sqlite3_mutex *);
6806 };
6807
6808 /*
6809 ** CAPI3REF: Mutex Verification Routines
6810 **
@@ -6833,12 +6834,12 @@
6833 ** call to sqlite3_mutex_held() to fail, so a non-zero return is
6834 ** the appropriate thing to do. The sqlite3_mutex_notheld()
6835 ** interface should also return 1 when given a NULL pointer.
6836 */
6837 #ifndef NDEBUG
6838 SQLITE_API int SQLITE_APICALL sqlite3_mutex_held(sqlite3_mutex*);
6839 SQLITE_API int SQLITE_APICALL sqlite3_mutex_notheld(sqlite3_mutex*);
6840 #endif
6841
6842 /*
6843 ** CAPI3REF: Mutex Types
6844 **
@@ -6874,11 +6875,11 @@
6874 ** serializes access to the [database connection] given in the argument
6875 ** when the [threading mode] is Serialized.
6876 ** ^If the [threading mode] is Single-thread or Multi-thread then this
6877 ** routine returns a NULL pointer.
6878 */
6879 SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_db_mutex(sqlite3*);
6880
6881 /*
6882 ** CAPI3REF: Low-Level Control Of Database Files
6883 ** METHOD: sqlite3
6884 **
@@ -6909,11 +6910,11 @@
6909 ** an incorrect zDbName and an SQLITE_ERROR return from the underlying
6910 ** xFileControl method.
6911 **
6912 ** See also: [SQLITE_FCNTL_LOCKSTATE]
6913 */
6914 SQLITE_API int SQLITE_APICALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
6915
6916 /*
6917 ** CAPI3REF: Testing Interface
6918 **
6919 ** ^The sqlite3_test_control() interface is used to read out internal
@@ -6991,12 +6992,12 @@
6991 ** be represented by a 32-bit integer, then the values returned by
6992 ** sqlite3_status() are undefined.
6993 **
6994 ** See also: [sqlite3_db_status()]
6995 */
6996 SQLITE_API int SQLITE_APICALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6997 SQLITE_API int SQLITE_APICALL sqlite3_status64(
6998 int op,
6999 sqlite3_int64 *pCurrent,
7000 sqlite3_int64 *pHighwater,
7001 int resetFlag
7002 );
@@ -7117,11 +7118,11 @@
7117 ** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a
7118 ** non-zero [error code] on failure.
7119 **
7120 ** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
7121 */
7122 SQLITE_API int SQLITE_APICALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
7123
7124 /*
7125 ** CAPI3REF: Status Parameters for database connections
7126 ** KEYWORDS: {SQLITE_DBSTATUS options}
7127 **
@@ -7260,11 +7261,11 @@
7260 ** ^If the resetFlg is true, then the counter is reset to zero after this
7261 ** interface call returns.
7262 **
7263 ** See also: [sqlite3_status()] and [sqlite3_db_status()].
7264 */
7265 SQLITE_API int SQLITE_APICALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
7266
7267 /*
7268 ** CAPI3REF: Status Parameters for prepared statements
7269 ** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters}
7270 **
@@ -7496,22 +7497,22 @@
7496 */
7497 typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2;
7498 struct sqlite3_pcache_methods2 {
7499 int iVersion;
7500 void *pArg;
7501 int (SQLITE_CALLBACK *xInit)(void*);
7502 void (SQLITE_CALLBACK *xShutdown)(void*);
7503 sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int szExtra, int bPurgeable);
7504 void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize);
7505 int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*);
7506 sqlite3_pcache_page *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7507 void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard);
7508 void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, sqlite3_pcache_page*,
7509 unsigned oldKey, unsigned newKey);
7510 void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit);
7511 void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*);
7512 void (SQLITE_CALLBACK *xShrink)(sqlite3_pcache*);
7513 };
7514
7515 /*
7516 ** This is the obsolete pcache_methods object that has now been replaced
7517 ** by sqlite3_pcache_methods2. This object is not used by SQLite. It is
@@ -7518,20 +7519,20 @@
7518 ** retained in the header file for backwards compatibility only.
7519 */
7520 typedef struct sqlite3_pcache_methods sqlite3_pcache_methods;
7521 struct sqlite3_pcache_methods {
7522 void *pArg;
7523 int (SQLITE_CALLBACK *xInit)(void*);
7524 void (SQLITE_CALLBACK *xShutdown)(void*);
7525 sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int bPurgeable);
7526 void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize);
7527 int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*);
7528 void *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7529 void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, void*, int discard);
7530 void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey);
7531 void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit);
7532 void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*);
7533 };
7534
7535
7536 /*
7537 ** CAPI3REF: Online Backup Object
@@ -7729,20 +7730,20 @@
7729 ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()
7730 ** APIs are not strictly speaking threadsafe. If they are invoked at the
7731 ** same time as another thread is invoking sqlite3_backup_step() it is
7732 ** possible that they return invalid values.
7733 */
7734 SQLITE_API sqlite3_backup *SQLITE_APICALL sqlite3_backup_init(
7735 sqlite3 *pDest, /* Destination database handle */
7736 const char *zDestName, /* Destination database name */
7737 sqlite3 *pSource, /* Source database handle */
7738 const char *zSourceName /* Source database name */
7739 );
7740 SQLITE_API int SQLITE_APICALL sqlite3_backup_step(sqlite3_backup *p, int nPage);
7741 SQLITE_API int SQLITE_APICALL sqlite3_backup_finish(sqlite3_backup *p);
7742 SQLITE_API int SQLITE_APICALL sqlite3_backup_remaining(sqlite3_backup *p);
7743 SQLITE_API int SQLITE_APICALL sqlite3_backup_pagecount(sqlite3_backup *p);
7744
7745 /*
7746 ** CAPI3REF: Unlock Notification
7747 ** METHOD: sqlite3
7748 **
@@ -7855,13 +7856,13 @@
7855 ** by an sqlite3_step() call. ^(If there is a blocking connection, then the
7856 ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in
7857 ** the special "DROP TABLE/INDEX" case, the extended error code is just
7858 ** SQLITE_LOCKED.)^
7859 */
7860 SQLITE_API int SQLITE_APICALL sqlite3_unlock_notify(
7861 sqlite3 *pBlocked, /* Waiting connection */
7862 void (SQLITE_CALLBACK *xNotify)(void **apArg, int nArg), /* Callback function to invoke */
7863 void *pNotifyArg /* Argument to pass to xNotify */
7864 );
7865
7866
7867 /*
@@ -7870,12 +7871,12 @@
7870 ** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications
7871 ** and extensions to compare the contents of two buffers containing UTF-8
7872 ** strings in a case-independent fashion, using the same definition of "case
7873 ** independence" that SQLite uses internally when comparing identifiers.
7874 */
7875 SQLITE_API int SQLITE_APICALL sqlite3_stricmp(const char *, const char *);
7876 SQLITE_API int SQLITE_APICALL sqlite3_strnicmp(const char *, const char *, int);
7877
7878 /*
7879 ** CAPI3REF: String Globbing
7880 *
7881 ** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if
@@ -7888,11 +7889,11 @@
7888 ** Note that this routine returns zero on a match and non-zero if the strings
7889 ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
7890 **
7891 ** See also: [sqlite3_strlike()].
7892 */
7893 SQLITE_API int SQLITE_APICALL sqlite3_strglob(const char *zGlob, const char *zStr);
7894
7895 /*
7896 ** CAPI3REF: String LIKE Matching
7897 *
7898 ** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if
@@ -7911,11 +7912,11 @@
7911 ** Note that this routine returns zero on a match and non-zero if the strings
7912 ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
7913 **
7914 ** See also: [sqlite3_strglob()].
7915 */
7916 SQLITE_API int SQLITE_APICALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
7917
7918 /*
7919 ** CAPI3REF: Error Logging Interface
7920 **
7921 ** ^The [sqlite3_log()] interface writes a message into the [error log]
@@ -7970,13 +7971,13 @@
7970 ** previously registered write-ahead log callback. ^Note that the
7971 ** [sqlite3_wal_autocheckpoint()] interface and the
7972 ** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will
7973 ** overwrite any prior [sqlite3_wal_hook()] settings.
7974 */
7975 SQLITE_API void *SQLITE_APICALL sqlite3_wal_hook(
7976 sqlite3*,
7977 int(SQLITE_CALLBACK *)(void *,sqlite3*,const char*,int),
7978 void*
7979 );
7980
7981 /*
7982 ** CAPI3REF: Configure an auto-checkpoint
@@ -8005,11 +8006,11 @@
8005 ** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]
8006 ** pages. The use of this interface
8007 ** is only necessary if the default setting is found to be suboptimal
8008 ** for a particular application.
8009 */
8010 SQLITE_API int SQLITE_APICALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
8011
8012 /*
8013 ** CAPI3REF: Checkpoint a database
8014 ** METHOD: sqlite3
8015 **
@@ -8027,11 +8028,11 @@
8027 ** interface was added. This interface is retained for backwards
8028 ** compatibility and as a convenience for applications that need to manually
8029 ** start a callback but which do not need the full power (and corresponding
8030 ** complication) of [sqlite3_wal_checkpoint_v2()].
8031 */
8032 SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
8033
8034 /*
8035 ** CAPI3REF: Checkpoint a database
8036 ** METHOD: sqlite3
8037 **
@@ -8121,11 +8122,11 @@
8121 ** [sqlite3_errcode()] and [sqlite3_errmsg()].
8122 **
8123 ** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface
8124 ** from SQL.
8125 */
8126 SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint_v2(
8127 sqlite3 *db, /* Database handle */
8128 const char *zDb, /* Name of attached database (or NULL) */
8129 int eMode, /* SQLITE_CHECKPOINT_* value */
8130 int *pnLog, /* OUT: Size of WAL log in frames */
8131 int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -8210,11 +8211,11 @@
8210 ** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL],
8211 ** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode
8212 ** of the SQL statement that triggered the call to the [xUpdate] method of the
8213 ** [virtual table].
8214 */
8215 SQLITE_API int SQLITE_APICALL sqlite3_vtab_on_conflict(sqlite3 *);
8216
8217 /*
8218 ** CAPI3REF: Conflict resolution modes
8219 ** KEYWORDS: {conflict resolution mode}
8220 **
@@ -8315,11 +8316,11 @@
8315 ** as if the loop did not exist - it returns non-zero and leave the variable
8316 ** that pOut points to unchanged.
8317 **
8318 ** See also: [sqlite3_stmt_scanstatus_reset()]
8319 */
8320 SQLITE_API int SQLITE_APICALL sqlite3_stmt_scanstatus(
8321 sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
8322 int idx, /* Index of loop to report on */
8323 int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
8324 void *pOut /* Result written here */
8325 );
@@ -8331,11 +8332,11 @@
8331 ** ^Zero all [sqlite3_stmt_scanstatus()] related event counters.
8332 **
8333 ** This API is only available if the library is built with pre-processor
8334 ** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined.
8335 */
8336 SQLITE_API void SQLITE_APICALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
8337
8338 /*
8339 ** CAPI3REF: Flush caches to disk mid-transaction
8340 **
8341 ** ^If a write-transaction is open on [database connection] D when the
@@ -8363,11 +8364,11 @@
8363 ** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK.
8364 **
8365 ** ^This function does not set the database handle error code or message
8366 ** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions.
8367 */
8368 SQLITE_API int SQLITE_APICALL sqlite3_db_cacheflush(sqlite3*);
8369
8370 /*
8371 ** CAPI3REF: The pre-update hook.
8372 **
8373 ** ^These interfaces are only available if SQLite is compiled using the
@@ -8443,13 +8444,13 @@
8443 ** triggers; or 2 for changes resulting from triggers called by top-level
8444 ** triggers; and so forth.
8445 **
8446 ** See also: [sqlite3_update_hook()]
8447 */
8448 SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_APICALL sqlite3_preupdate_hook(
8449 sqlite3 *db,
8450 void(SQLITE_CALLBACK *xPreUpdate)(
8451 void *pCtx, /* Copy of third arg to preupdate_hook() */
8452 sqlite3 *db, /* Database handle */
8453 int op, /* SQLITE_UPDATE, DELETE or INSERT */
8454 char const *zDb, /* Database name */
8455 char const *zName, /* Table name */
@@ -8456,14 +8457,14 @@
8456 sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */
8457 sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */
8458 ),
8459 void*
8460 );
8461 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **);
8462 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_count(sqlite3 *);
8463 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_depth(sqlite3 *);
8464 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **);
8465
8466 /*
8467 ** CAPI3REF: Low-level system error code
8468 **
8469 ** ^Attempt to return the underlying operating system error code or error
@@ -8471,11 +8472,11 @@
8471 ** The return value is OS-dependent. For example, on unix systems, after
8472 ** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be
8473 ** called to get back the underlying "errno" that caused the problem, such
8474 ** as ENOSPC, EAUTH, EISDIR, and so forth.
8475 */
8476 SQLITE_API int SQLITE_APICALL sqlite3_system_errno(sqlite3*);
8477
8478 /*
8479 ** CAPI3REF: Database Snapshot
8480 ** KEYWORDS: {snapshot}
8481 ** EXPERIMENTAL
@@ -8521,11 +8522,11 @@
8521 ** to avoid a memory leak.
8522 **
8523 ** The [sqlite3_snapshot_get()] interface is only available when the
8524 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8525 */
8526 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_get(
8527 sqlite3 *db,
8528 const char *zSchema,
8529 sqlite3_snapshot **ppSnapshot
8530 );
8531
@@ -8559,11 +8560,11 @@
8559 ** database connection in order to make it ready to use snapshots.)
8560 **
8561 ** The [sqlite3_snapshot_open()] interface is only available when the
8562 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8563 */
8564 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_open(
8565 sqlite3 *db,
8566 const char *zSchema,
8567 sqlite3_snapshot *pSnapshot
8568 );
8569
@@ -8576,11 +8577,11 @@
8576 ** using this routine to avoid a memory leak.
8577 **
8578 ** The [sqlite3_snapshot_free()] interface is only available when the
8579 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8580 */
8581 SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_APICALL sqlite3_snapshot_free(sqlite3_snapshot*);
8582
8583 /*
8584 ** CAPI3REF: Compare the ages of two snapshot handles.
8585 ** EXPERIMENTAL
8586 **
@@ -8600,11 +8601,11 @@
8600 **
8601 ** Otherwise, this API returns a negative value if P1 refers to an older
8602 ** snapshot than P2, zero if the two handles refer to the same database
8603 ** snapshot, and a positive value if P1 is a newer snapshot than P2.
8604 */
8605 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_cmp(
8606 sqlite3_snapshot *p1,
8607 sqlite3_snapshot *p2
8608 );
8609
8610 /*
@@ -8658,14 +8659,14 @@
8658 ** Register a geometry callback named zGeom that can be used as part of an
8659 ** R-Tree geometry query as follows:
8660 **
8661 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
8662 */
8663 SQLITE_API int SQLITE_APICALL sqlite3_rtree_geometry_callback(
8664 sqlite3 *db,
8665 const char *zGeom,
8666 int (SQLITE_CALLBACK *xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
8667 void *pContext
8668 );
8669
8670
8671 /*
@@ -8675,25 +8676,25 @@
8675 struct sqlite3_rtree_geometry {
8676 void *pContext; /* Copy of pContext passed to s_r_g_c() */
8677 int nParam; /* Size of array aParam[] */
8678 sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */
8679 void *pUser; /* Callback implementation user data */
8680 void (SQLITE_CALLBACK *xDelUser)(void *); /* Called by SQLite to clean up pUser */
8681 };
8682
8683 /*
8684 ** Register a 2nd-generation geometry callback named zScore that can be
8685 ** used as part of an R-Tree geometry query as follows:
8686 **
8687 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...)
8688 */
8689 SQLITE_API int SQLITE_APICALL sqlite3_rtree_query_callback(
8690 sqlite3 *db,
8691 const char *zQueryFunc,
8692 int (SQLITE_CALLBACK *xQueryFunc)(sqlite3_rtree_query_info*),
8693 void *pContext,
8694 void (SQLITE_CALLBACK *xDestructor)(void*)
8695 );
8696
8697
8698 /*
8699 ** A pointer to a structure of the following type is passed as the
@@ -8707,11 +8708,11 @@
8707 struct sqlite3_rtree_query_info {
8708 void *pContext; /* pContext from when function registered */
8709 int nParam; /* Number of function parameters */
8710 sqlite3_rtree_dbl *aParam; /* value of function parameters */
8711 void *pUser; /* callback can use this, if desired */
8712 void (SQLITE_CALLBACK *xDelUser)(void*); /* function to free pUser */
8713 sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */
8714 unsigned int *anQueue; /* Number of pending entries in the queue */
8715 int nCoord; /* Number of coordinates */
8716 int iLevel; /* Level of current node or entry */
8717 int mxLevel; /* The largest iLevel value in the tree */
@@ -8903,11 +8904,11 @@
8903 ** If xFilter returns 0, changes is not tracked. Note that once a table is
8904 ** attached, xFilter will not be called again.
8905 */
8906 void sqlite3session_table_filter(
8907 sqlite3_session *pSession, /* Session object */
8908 int(SQLITE_CALLBACK *xFilter)(
8909 void *pCtx, /* Copy of third arg to _filter_table() */
8910 const char *zTab /* Table name */
8911 ),
8912 void *pCtx /* First argument passed to xFilter */
8913 );
@@ -9478,11 +9479,11 @@
9478 ** An sqlite3_changegroup object is used to combine two or more changesets
9479 ** (or patchsets) into a single changeset (or patchset). A single changegroup
9480 ** object may combine changesets or patchsets, but not both. The output is
9481 ** always in the same format as the input.
9482 **
9483 ** If successful, this function returns SQLITE_OK and populates (SQLITE_CALLBACK *pp) with
9484 ** a pointer to a new sqlite3_changegroup object before returning. The caller
9485 ** should eventually free the returned object using a call to
9486 ** sqlite3changegroup_delete(). If an error occurs, an SQLite error code
9487 ** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL.
9488 **
@@ -9598,11 +9599,11 @@
9598 ** changes for tables that do not appear in the first changeset, they are
9599 ** appended onto the end of the output changeset, again in the order in
9600 ** which they are first encountered.
9601 **
9602 ** If an error occurs, an SQLite error code is returned and the output
9603 ** variables (SQLITE_CALLBACK *pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK
9604 ** is returned and the output variables are set to the size of and a
9605 ** pointer to the output buffer, respectively. In this case it is the
9606 ** responsibility of the caller to eventually free the buffer using a
9607 ** call to sqlite3_free().
9608 */
@@ -9755,15 +9756,15 @@
9755 */
9756 int sqlite3changeset_apply(
9757 sqlite3 *db, /* Apply change to "main" db of this handle */
9758 int nChangeset, /* Size of changeset in bytes */
9759 void *pChangeset, /* Changeset blob */
9760 int(SQLITE_CALLBACK *xFilter)(
9761 void *pCtx, /* Copy of sixth arg to _apply() */
9762 const char *zTab /* Table name */
9763 ),
9764 int(SQLITE_CALLBACK *xConflict)(
9765 void *pCtx, /* Copy of sixth arg to _apply() */
9766 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
9767 sqlite3_changeset_iter *p /* Handle describing change and conflict */
9768 ),
9769 void *pCtx /* First argument passed to xConflict */
@@ -9900,20 +9901,20 @@
9900 ** </pre>
9901 **
9902 ** Is replaced by:
9903 **
9904 ** <pre>
9905 ** &nbsp; int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
9906 ** &nbsp; void *pIn,
9907 ** </pre>
9908 **
9909 ** Each time the xInput callback is invoked by the sessions module, the first
9910 ** argument passed is a copy of the supplied pIn context pointer. The second
9911 ** argument, pData, points to a buffer (SQLITE_CALLBACK *pnData) bytes in size. Assuming no
9912 ** error occurs the xInput method should copy up to (SQLITE_CALLBACK *pnData) bytes of data
9913 ** into the buffer and set (SQLITE_CALLBACK *pnData) to the actual number of bytes copied
9914 ** before returning SQLITE_OK. If the input is completely exhausted, (SQLITE_CALLBACK *pnData)
9915 ** should be set to zero to indicate this. Or, if an error occurs, an SQLite
9916 ** error code should be returned. In all cases, if an xInput callback returns
9917 ** an error, all processing is abandoned and the streaming API function
9918 ** returns a copy of the error code to the caller.
9919 **
@@ -9934,11 +9935,11 @@
9934 ** </pre>
9935 **
9936 ** Is replaced by:
9937 **
9938 ** <pre>
9939 ** &nbsp; int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9940 ** &nbsp; void *pOut
9941 ** </pre>
9942 **
9943 ** The xOutput callback is invoked zero or more times to return data to
9944 ** the application. The first parameter passed to each call is a copy of the
@@ -9954,58 +9955,58 @@
9954 ** parameter set to a value less than or equal to zero. Other than this,
9955 ** no guarantees are made as to the size of the chunks of data returned.
9956 */
9957 int sqlite3changeset_apply_strm(
9958 sqlite3 *db, /* Apply change to "main" db of this handle */
9959 int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), /* Input function */
9960 void *pIn, /* First arg for xInput */
9961 int(SQLITE_CALLBACK *xFilter)(
9962 void *pCtx, /* Copy of sixth arg to _apply() */
9963 const char *zTab /* Table name */
9964 ),
9965 int(SQLITE_CALLBACK *xConflict)(
9966 void *pCtx, /* Copy of sixth arg to _apply() */
9967 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
9968 sqlite3_changeset_iter *p /* Handle describing change and conflict */
9969 ),
9970 void *pCtx /* First argument passed to xConflict */
9971 );
9972 int sqlite3changeset_concat_strm(
9973 int (SQLITE_CALLBACK *xInputA)(void *pIn, void *pData, int *pnData),
9974 void *pInA,
9975 int (SQLITE_CALLBACK *xInputB)(void *pIn, void *pData, int *pnData),
9976 void *pInB,
9977 int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9978 void *pOut
9979 );
9980 int sqlite3changeset_invert_strm(
9981 int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
9982 void *pIn,
9983 int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9984 void *pOut
9985 );
9986 int sqlite3changeset_start_strm(
9987 sqlite3_changeset_iter **pp,
9988 int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
9989 void *pIn
9990 );
9991 int sqlite3session_changeset_strm(
9992 sqlite3_session *pSession,
9993 int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9994 void *pOut
9995 );
9996 int sqlite3session_patchset_strm(
9997 sqlite3_session *pSession,
9998 int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9999 void *pOut
10000 );
10001 int sqlite3changegroup_add_strm(sqlite3_changegroup*,
10002 int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
10003 void *pIn
10004 );
10005 int sqlite3changegroup_output_strm(sqlite3_changegroup*,
10006 int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
10007 void *pOut
10008 );
10009
10010
10011 /*
@@ -10056,11 +10057,11 @@
10056
10057 typedef struct Fts5ExtensionApi Fts5ExtensionApi;
10058 typedef struct Fts5Context Fts5Context;
10059 typedef struct Fts5PhraseIter Fts5PhraseIter;
10060
10061 typedef void (SQLITE_CALLBACK *fts5_extension_function)(
10062 const Fts5ExtensionApi *pApi, /* API offered by current FTS version */
10063 Fts5Context *pFts, /* First arg to pass to pApi functions */
10064 sqlite3_context *pCtx, /* Context for returning result/error */
10065 int nVal, /* Number of values in apVal[] array */
10066 sqlite3_value **apVal /* Array of trailing arguments */
@@ -10107,15 +10108,15 @@
10107 ** This function may be quite inefficient if used with an FTS5 table
10108 ** created with the "columnsize=0" option.
10109 **
10110 ** xColumnText:
10111 ** This function attempts to retrieve the text of column iCol of the
10112 ** current document. If successful, (SQLITE_CALLBACK *pz) is set to point to a buffer
10113 ** containing the text in utf-8 encoding, (SQLITE_CALLBACK *pn) is set to the size in bytes
10114 ** (not characters) of the buffer and SQLITE_OK is returned. Otherwise,
10115 ** if an error occurs, an SQLite error code is returned and the final values
10116 ** of (SQLITE_CALLBACK *pz) and (*pn) are undefined.
10117 **
10118 ** xPhraseCount:
10119 ** Returns the number of phrases in the current query expression.
10120 **
10121 ** xPhraseSize:
@@ -10220,11 +10221,11 @@
10220 ** xRowCount(pFts5, pnRow)
10221 **
10222 ** This function is used to retrieve the total number of rows in the table.
10223 ** In other words, the same value that would be returned by:
10224 **
10225 ** SELECT count(SQLITE_CALLBACK *) FROM ftstable;
10226 **
10227 ** xPhraseFirst()
10228 ** This function is used, along with type Fts5PhraseIter and the xPhraseNext
10229 ** method, to iterate through all instances of a single query phrase within
10230 ** the current row. This is the same information as is accessible via the
@@ -10287,43 +10288,43 @@
10287 ** See xPhraseFirstColumn above.
10288 */
10289 struct Fts5ExtensionApi {
10290 int iVersion; /* Currently always set to 3 */
10291
10292 void *(SQLITE_CALLBACK *xUserData)(Fts5Context*);
10293
10294 int (SQLITE_CALLBACK *xColumnCount)(Fts5Context*);
10295 int (SQLITE_CALLBACK *xRowCount)(Fts5Context*, sqlite3_int64 *pnRow);
10296 int (SQLITE_CALLBACK *xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken);
10297
10298 int (SQLITE_CALLBACK *xTokenize)(Fts5Context*,
10299 const char *pText, int nText, /* Text to tokenize */
10300 void *pCtx, /* Context passed to xToken() */
10301 int (SQLITE_CALLBACK *xToken)(void*, int, const char*, int, int, int) /* Callback */
10302 );
10303
10304 int (SQLITE_CALLBACK *xPhraseCount)(Fts5Context*);
10305 int (SQLITE_CALLBACK *xPhraseSize)(Fts5Context*, int iPhrase);
10306
10307 int (SQLITE_CALLBACK *xInstCount)(Fts5Context*, int *pnInst);
10308 int (SQLITE_CALLBACK *xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff);
10309
10310 sqlite3_int64 (SQLITE_CALLBACK *xRowid)(Fts5Context*);
10311 int (SQLITE_CALLBACK *xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn);
10312 int (SQLITE_CALLBACK *xColumnSize)(Fts5Context*, int iCol, int *pnToken);
10313
10314 int (SQLITE_CALLBACK *xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData,
10315 int(SQLITE_CALLBACK *)(const Fts5ExtensionApi*,Fts5Context*,void*)
10316 );
10317 int (SQLITE_CALLBACK *xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*));
10318 void *(SQLITE_CALLBACK *xGetAuxdata)(Fts5Context*, int bClear);
10319
10320 int (SQLITE_CALLBACK *xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*);
10321 void (SQLITE_CALLBACK *xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff);
10322
10323 int (SQLITE_CALLBACK *xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*);
10324 void (SQLITE_CALLBACK *xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol);
10325 };
10326
10327 /*
10328 ** CUSTOM AUXILIARY FUNCTIONS
10329 *************************************************************************/
@@ -10347,11 +10348,11 @@
10347 ** The second and third arguments are an array of nul-terminated strings
10348 ** containing the tokenizer arguments, if any, specified following the
10349 ** tokenizer name as part of the CREATE VIRTUAL TABLE statement used
10350 ** to create the FTS5 table.
10351 **
10352 ** The final argument is an output variable. If successful, (SQLITE_CALLBACK *ppOut)
10353 ** should be set to point to the new tokenizer handle and SQLITE_OK
10354 ** returned. If an error occurs, some value other than SQLITE_OK should
10355 ** be returned. In this case, fts5 assumes that the final value of *ppOut
10356 ** is undefined.
10357 **
@@ -10521,17 +10522,17 @@
10521 ** inefficient.
10522 */
10523 typedef struct Fts5Tokenizer Fts5Tokenizer;
10524 typedef struct fts5_tokenizer fts5_tokenizer;
10525 struct fts5_tokenizer {
10526 int (SQLITE_CALLBACK *xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
10527 void (SQLITE_CALLBACK *xDelete)(Fts5Tokenizer*);
10528 int (SQLITE_CALLBACK *xTokenize)(Fts5Tokenizer*,
10529 void *pCtx,
10530 int flags, /* Mask of FTS5_TOKENIZE_* flags */
10531 const char *pText, int nText,
10532 int (SQLITE_CALLBACK *xToken)(
10533 void *pCtx, /* Copy of 2nd argument to xTokenize() */
10534 int tflags, /* Mask of FTS5_TOKEN_* flags */
10535 const char *pToken, /* Pointer to buffer containing token */
10536 int nToken, /* Size of token in bytes */
10537 int iStart, /* Byte offset of token within input text */
@@ -10560,33 +10561,33 @@
10560 typedef struct fts5_api fts5_api;
10561 struct fts5_api {
10562 int iVersion; /* Currently always set to 2 */
10563
10564 /* Create a new tokenizer */
10565 int (SQLITE_CALLBACK *xCreateTokenizer)(
10566 fts5_api *pApi,
10567 const char *zName,
10568 void *pContext,
10569 fts5_tokenizer *pTokenizer,
10570 void (SQLITE_CALLBACK *xDestroy)(void*)
10571 );
10572
10573 /* Find an existing tokenizer */
10574 int (SQLITE_CALLBACK *xFindTokenizer)(
10575 fts5_api *pApi,
10576 const char *zName,
10577 void **ppContext,
10578 fts5_tokenizer *pTokenizer
10579 );
10580
10581 /* Create a new auxiliary function */
10582 int (SQLITE_CALLBACK *xCreateFunction)(
10583 fts5_api *pApi,
10584 const char *zName,
10585 void *pContext,
10586 fts5_extension_function xFunction,
10587 void (SQLITE_CALLBACK *xDestroy)(void*)
10588 );
10589 };
10590
10591 /*
10592 ** END OF REGISTRATION API
@@ -11900,12 +11901,12 @@
11900 */
11901 #ifdef SQLITE_OMIT_WSD
11902 #define SQLITE_WSD const
11903 #define GLOBAL(t,v) (*(t*)sqlite3_wsd_find((void*)&(v), sizeof(v)))
11904 #define sqlite3GlobalConfig GLOBAL(struct Sqlite3Config, sqlite3Config)
11905 SQLITE_API int SQLITE_APICALL sqlite3_wsd_init(int N, int J);
11906 SQLITE_API void *SQLITE_APICALL sqlite3_wsd_find(void *K, int L);
11907 #else
11908 #define SQLITE_WSD
11909 #define GLOBAL(t,v) v
11910 #define sqlite3GlobalConfig sqlite3Config
11911 #endif
@@ -17560,11 +17561,11 @@
17560 ** was used and false if not.
17561 **
17562 ** The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix
17563 ** is not required for a match.
17564 */
17565 SQLITE_API int SQLITE_APICALL sqlite3_compileoption_used(const char *zOptName){
17566 int i, n;
17567
17568 #if SQLITE_ENABLE_API_ARMOR
17569 if( zOptName==0 ){
17570 (void)SQLITE_MISUSE_BKPT;
@@ -17588,11 +17589,11 @@
17588
17589 /*
17590 ** Return the N-th compile-time option string. If N is out of range,
17591 ** return a NULL pointer.
17592 */
17593 SQLITE_API const char *SQLITE_APICALL sqlite3_compileoption_get(int N){
17594 if( N>=0 && N<ArraySize(azCompileOpt) ){
17595 return azCompileOpt[N];
17596 }
17597 return 0;
17598 }
@@ -18298,11 +18299,11 @@
18298 }
18299
18300 /*
18301 ** Query status information.
18302 */
18303 SQLITE_API int SQLITE_APICALL sqlite3_status64(
18304 int op,
18305 sqlite3_int64 *pCurrent,
18306 sqlite3_int64 *pHighwater,
18307 int resetFlag
18308 ){
@@ -18323,11 +18324,11 @@
18323 }
18324 sqlite3_mutex_leave(pMutex);
18325 (void)pMutex; /* Prevent warning when SQLITE_THREADSAFE=0 */
18326 return SQLITE_OK;
18327 }
18328 SQLITE_API int SQLITE_APICALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){
18329 sqlite3_int64 iCur = 0, iHwtr = 0;
18330 int rc;
18331 #ifdef SQLITE_ENABLE_API_ARMOR
18332 if( pCurrent==0 || pHighwater==0 ) return SQLITE_MISUSE_BKPT;
18333 #endif
@@ -18340,11 +18341,11 @@
18340 }
18341
18342 /*
18343 ** Query status information for a single database connection
18344 */
18345 SQLITE_API int SQLITE_APICALL sqlite3_db_status(
18346 sqlite3 *db, /* The database connection whose status is desired */
18347 int op, /* Status verb */
18348 int *pCurrent, /* Write current value here */
18349 int *pHighwater, /* Write high-water mark here */
18350 int resetFlag /* Reset high-water mark if true */
@@ -19632,11 +19633,10 @@
19632 int argc,
19633 sqlite3_value **argv
19634 ){
19635 time_t t;
19636 char *zFormat = (char *)sqlite3_user_data(context);
19637 sqlite3 *db;
19638 sqlite3_int64 iT;
19639 struct tm *pTm;
19640 struct tm sNow;
19641 char zBuf[20];
19642
@@ -20018,11 +20018,11 @@
20018
20019 /*
20020 ** Locate a VFS by name. If no name is given, simply return the
20021 ** first VFS on the list.
20022 */
20023 SQLITE_API sqlite3_vfs *SQLITE_APICALL sqlite3_vfs_find(const char *zVfs){
20024 sqlite3_vfs *pVfs = 0;
20025 #if SQLITE_THREADSAFE
20026 sqlite3_mutex *mutex;
20027 #endif
20028 #ifndef SQLITE_OMIT_AUTOINIT
@@ -20064,11 +20064,11 @@
20064 /*
20065 ** Register a VFS with the system. It is harmless to register the same
20066 ** VFS multiple times. The new VFS becomes the default if makeDflt is
20067 ** true.
20068 */
20069 SQLITE_API int SQLITE_APICALL sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){
20070 MUTEX_LOGIC(sqlite3_mutex *mutex;)
20071 #ifndef SQLITE_OMIT_AUTOINIT
20072 int rc = sqlite3_initialize();
20073 if( rc ) return rc;
20074 #endif
@@ -20092,11 +20092,11 @@
20092 }
20093
20094 /*
20095 ** Unregister a VFS so that it is no longer accessible.
20096 */
20097 SQLITE_API int SQLITE_APICALL sqlite3_vfs_unregister(sqlite3_vfs *pVfs){
20098 #if SQLITE_THREADSAFE
20099 sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
20100 #endif
20101 sqlite3_mutex_enter(mutex);
20102 vfsUnlink(pVfs);
@@ -22443,11 +22443,11 @@
22443 }
22444
22445 /*
22446 ** Retrieve a pointer to a static mutex or allocate a new dynamic one.
22447 */
22448 SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_mutex_alloc(int id){
22449 #ifndef SQLITE_OMIT_AUTOINIT
22450 if( id<=SQLITE_MUTEX_RECURSIVE && sqlite3_initialize() ) return 0;
22451 if( id>SQLITE_MUTEX_RECURSIVE && sqlite3MutexInit() ) return 0;
22452 #endif
22453 assert( sqlite3GlobalConfig.mutex.xMutexAlloc );
@@ -22464,11 +22464,11 @@
22464 }
22465
22466 /*
22467 ** Free a dynamic mutex.
22468 */
22469 SQLITE_API void SQLITE_APICALL sqlite3_mutex_free(sqlite3_mutex *p){
22470 if( p ){
22471 assert( sqlite3GlobalConfig.mutex.xMutexFree );
22472 sqlite3GlobalConfig.mutex.xMutexFree(p);
22473 }
22474 }
@@ -22475,11 +22475,11 @@
22475
22476 /*
22477 ** Obtain the mutex p. If some other thread already has the mutex, block
22478 ** until it can be obtained.
22479 */
22480 SQLITE_API void SQLITE_APICALL sqlite3_mutex_enter(sqlite3_mutex *p){
22481 if( p ){
22482 assert( sqlite3GlobalConfig.mutex.xMutexEnter );
22483 sqlite3GlobalConfig.mutex.xMutexEnter(p);
22484 }
22485 }
@@ -22486,11 +22486,11 @@
22486
22487 /*
22488 ** Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another
22489 ** thread holds the mutex and it cannot be obtained, return SQLITE_BUSY.
22490 */
22491 SQLITE_API int SQLITE_APICALL sqlite3_mutex_try(sqlite3_mutex *p){
22492 int rc = SQLITE_OK;
22493 if( p ){
22494 assert( sqlite3GlobalConfig.mutex.xMutexTry );
22495 return sqlite3GlobalConfig.mutex.xMutexTry(p);
22496 }
@@ -22501,11 +22501,11 @@
22501 ** The sqlite3_mutex_leave() routine exits a mutex that was previously
22502 ** entered by the same thread. The behavior is undefined if the mutex
22503 ** is not currently entered. If a NULL pointer is passed as an argument
22504 ** this function is a no-op.
22505 */
22506 SQLITE_API void SQLITE_APICALL sqlite3_mutex_leave(sqlite3_mutex *p){
22507 if( p ){
22508 assert( sqlite3GlobalConfig.mutex.xMutexLeave );
22509 sqlite3GlobalConfig.mutex.xMutexLeave(p);
22510 }
22511 }
@@ -22513,15 +22513,15 @@
22513 #ifndef NDEBUG
22514 /*
22515 ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are
22516 ** intended for use inside assert() statements.
22517 */
22518 SQLITE_API int SQLITE_APICALL sqlite3_mutex_held(sqlite3_mutex *p){
22519 assert( p==0 || sqlite3GlobalConfig.mutex.xMutexHeld );
22520 return p==0 || sqlite3GlobalConfig.mutex.xMutexHeld(p);
22521 }
22522 SQLITE_API int SQLITE_APICALL sqlite3_mutex_notheld(sqlite3_mutex *p){
22523 assert( p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld );
22524 return p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld(p);
22525 }
22526 #endif
22527
@@ -23549,12 +23549,12 @@
23549 ** of the sqlite3_initialize() and sqlite3_shutdown() processing, the
23550 ** "interlocked" magic used here is probably not strictly necessary.
23551 */
23552 static LONG SQLITE_WIN32_VOLATILE winMutex_lock = 0;
23553
23554 SQLITE_API int SQLITE_APICALL sqlite3_win32_is_nt(void); /* os_win.c */
23555 SQLITE_API void SQLITE_APICALL sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */
23556
23557 static int winMutexInit(void){
23558 /* The first to increment to 1 does actual initialization */
23559 if( InterlockedCompareExchange(&winMutex_lock, 1, 0)==0 ){
23560 int i;
@@ -23850,11 +23850,11 @@
23850 /*
23851 ** Attempt to release up to n bytes of non-essential memory currently
23852 ** held by SQLite. An example of non-essential memory is memory used to
23853 ** cache database pages that are not currently in use.
23854 */
23855 SQLITE_API int SQLITE_APICALL sqlite3_release_memory(int n){
23856 #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
23857 return sqlite3PcacheReleaseMemory(n);
23858 #else
23859 /* IMPLEMENTATION-OF: R-34391-24921 The sqlite3_release_memory() routine
23860 ** is a no-op returning zero if SQLite is not compiled with
@@ -23909,11 +23909,11 @@
23909 /*
23910 ** Deprecated external interface. It used to set an alarm callback
23911 ** that was invoked when memory usage grew too large. Now it is a
23912 ** no-op.
23913 */
23914 SQLITE_API int SQLITE_APICALL sqlite3_memory_alarm(
23915 void(*xCallback)(void *pArg, sqlite3_int64 used,int N),
23916 void *pArg,
23917 sqlite3_int64 iThreshold
23918 ){
23919 (void)xCallback;
@@ -23925,11 +23925,11 @@
23925
23926 /*
23927 ** Set the soft heap-size limit for the library. Passing a zero or
23928 ** negative value indicates no limit.
23929 */
23930 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_soft_heap_limit64(sqlite3_int64 n){
23931 sqlite3_int64 priorLimit;
23932 sqlite3_int64 excess;
23933 sqlite3_int64 nUsed;
23934 #ifndef SQLITE_OMIT_AUTOINIT
23935 int rc = sqlite3_initialize();
@@ -23947,11 +23947,11 @@
23947 sqlite3_mutex_leave(mem0.mutex);
23948 excess = sqlite3_memory_used() - n;
23949 if( excess>0 ) sqlite3_release_memory((int)(excess & 0x7fffffff));
23950 return priorLimit;
23951 }
23952 SQLITE_API void SQLITE_APICALL sqlite3_soft_heap_limit(int n){
23953 if( n<0 ) n = 0;
23954 sqlite3_soft_heap_limit64(n);
23955 }
23956
23957 /*
@@ -24016,11 +24016,11 @@
24016 }
24017
24018 /*
24019 ** Return the amount of memory currently checked out.
24020 */
24021 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_used(void){
24022 sqlite3_int64 res, mx;
24023 sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, 0);
24024 return res;
24025 }
24026
@@ -24027,11 +24027,11 @@
24027 /*
24028 ** Return the maximum amount of memory that has ever been
24029 ** checked out since either the beginning of this process
24030 ** or since the most recent reset.
24031 */
24032 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_highwater(int resetFlag){
24033 sqlite3_int64 res, mx;
24034 sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, resetFlag);
24035 return mx;
24036 }
24037
@@ -24107,17 +24107,17 @@
24107 /*
24108 ** This version of the memory allocation is for use by the application.
24109 ** First make sure the memory subsystem is initialized, then do the
24110 ** allocation.
24111 */
24112 SQLITE_API void *SQLITE_APICALL sqlite3_malloc(int n){
24113 #ifndef SQLITE_OMIT_AUTOINIT
24114 if( sqlite3_initialize() ) return 0;
24115 #endif
24116 return n<=0 ? 0 : sqlite3Malloc(n);
24117 }
24118 SQLITE_API void *SQLITE_APICALL sqlite3_malloc64(sqlite3_uint64 n){
24119 #ifndef SQLITE_OMIT_AUTOINIT
24120 if( sqlite3_initialize() ) return 0;
24121 #endif
24122 return sqlite3Malloc(n);
24123 }
@@ -24256,20 +24256,20 @@
24256 }else{
24257 assert( sqlite3_mutex_held(db->mutex) );
24258 return db->lookaside.sz;
24259 }
24260 }
24261 SQLITE_API sqlite3_uint64 SQLITE_APICALL sqlite3_msize(void *p){
24262 assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) );
24263 assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
24264 return p ? sqlite3GlobalConfig.m.xSize(p) : 0;
24265 }
24266
24267 /*
24268 ** Free memory previously obtained from sqlite3Malloc().
24269 */
24270 SQLITE_API void SQLITE_APICALL sqlite3_free(void *p){
24271 if( p==0 ) return; /* IMP: R-49053-54554 */
24272 assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
24273 assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) );
24274 if( sqlite3GlobalConfig.bMemstat ){
24275 sqlite3_mutex_enter(mem0.mutex);
@@ -24374,18 +24374,18 @@
24374
24375 /*
24376 ** The public interface to sqlite3Realloc. Make sure that the memory
24377 ** subsystem is initialized prior to invoking sqliteRealloc.
24378 */
24379 SQLITE_API void *SQLITE_APICALL sqlite3_realloc(void *pOld, int n){
24380 #ifndef SQLITE_OMIT_AUTOINIT
24381 if( sqlite3_initialize() ) return 0;
24382 #endif
24383 if( n<0 ) n = 0; /* IMP: R-26507-47431 */
24384 return sqlite3Realloc(pOld, n);
24385 }
24386 SQLITE_API void *SQLITE_APICALL sqlite3_realloc64(void *pOld, sqlite3_uint64 n){
24387 #ifndef SQLITE_OMIT_AUTOINIT
24388 if( sqlite3_initialize() ) return 0;
24389 #endif
24390 return sqlite3Realloc(pOld, n);
24391 }
@@ -25608,11 +25608,11 @@
25608
25609 /*
25610 ** Print into memory obtained from sqlite3_malloc(). Omit the internal
25611 ** %-conversion extensions.
25612 */
25613 SQLITE_API char *SQLITE_APICALL sqlite3_vmprintf(const char *zFormat, va_list ap){
25614 char *z;
25615 char zBase[SQLITE_PRINT_BUF_SIZE];
25616 StrAccum acc;
25617
25618 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -25657,11 +25657,11 @@
25657 ** this without breaking compatibility, so we just have to live with the
25658 ** mistake.
25659 **
25660 ** sqlite3_vsnprintf() is the varargs version.
25661 */
25662 SQLITE_API char *SQLITE_APICALL sqlite3_vsnprintf(int n, char *zBuf, const char *zFormat, va_list ap){
25663 StrAccum acc;
25664 if( n<=0 ) return zBuf;
25665 #ifdef SQLITE_ENABLE_API_ARMOR
25666 if( zBuf==0 || zFormat==0 ) {
25667 (void)SQLITE_MISUSE_BKPT;
@@ -26284,11 +26284,11 @@
26284 } sqlite3Prng;
26285
26286 /*
26287 ** Return N random bytes.
26288 */
26289 SQLITE_API void SQLITE_APICALL sqlite3_randomness(int N, void *pBuf){
26290 unsigned char t;
26291 unsigned char *zBuf = pBuf;
26292
26293 /* The "wsdPrng" macro will resolve to the pseudo-random number generator
26294 ** state vector. If writable static data is unsupported on the target,
@@ -27487,11 +27487,11 @@
27487 ** sqlite3_strnicmp() APIs allow applications and extensions to compare
27488 ** the contents of two buffers containing UTF-8 strings in a
27489 ** case-independent fashion, using the same definition of "case
27490 ** independence" that SQLite uses internally when comparing identifiers.
27491 */
27492 SQLITE_API int SQLITE_APICALL sqlite3_stricmp(const char *zLeft, const char *zRight){
27493 if( zLeft==0 ){
27494 return zRight ? -1 : 0;
27495 }else if( zRight==0 ){
27496 return 1;
27497 }
@@ -27508,11 +27508,11 @@
27508 a++;
27509 b++;
27510 }
27511 return c;
27512 }
27513 SQLITE_API int SQLITE_APICALL sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){
27514 register unsigned char *a, *b;
27515 if( zLeft==0 ){
27516 return zRight ? -1 : 0;
27517 }else if( zRight==0 ){
27518 return 1;
@@ -36807,11 +36807,11 @@
36807 ** This routine is called once during SQLite initialization and by a
36808 ** single thread. The memory allocation and mutex subsystems have not
36809 ** necessarily been initialized when this routine is called, and so they
36810 ** should not be used.
36811 */
36812 SQLITE_API int SQLITE_APICALL sqlite3_os_init(void){
36813 /*
36814 ** The following macro defines an initializer for an sqlite3_vfs object.
36815 ** The name of the VFS is NAME. The pAppData is a pointer to a pointer
36816 ** to the "finder" function. (pAppData is a pointer to a pointer because
36817 ** silly C90 rules prohibit a void* from being cast to a function pointer
@@ -36906,11 +36906,11 @@
36906 **
36907 ** Some operating systems might need to do some cleanup in this routine,
36908 ** to release dynamically allocated objects. But not on unix.
36909 ** This routine is a no-op for unix.
36910 */
36911 SQLITE_API int SQLITE_APICALL sqlite3_os_end(void){
36912 return SQLITE_OK;
36913 }
36914
36915 #endif /* SQLITE_OS_UNIX */
36916
@@ -38341,11 +38341,11 @@
38341 ** compact it. Upon success, SQLITE_OK will be returned. Upon failure, one
38342 ** of SQLITE_NOMEM, SQLITE_ERROR, or SQLITE_NOTFOUND will be returned. The
38343 ** "pnLargest" argument, if non-zero, will be used to return the size of the
38344 ** largest committed free block in the heap, in bytes.
38345 */
38346 SQLITE_API int SQLITE_APICALL sqlite3_win32_compact_heap(LPUINT pnLargest){
38347 int rc = SQLITE_OK;
38348 UINT nLargest = 0;
38349 HANDLE hHeap;
38350
38351 winMemAssertMagic();
@@ -38381,11 +38381,11 @@
38381 ** If a Win32 native heap has been configured, this function will attempt to
38382 ** destroy and recreate it. If the Win32 native heap is not isolated and/or
38383 ** the sqlite3_memory_used() function does not return zero, SQLITE_BUSY will
38384 ** be returned and no changes will be made to the Win32 native heap.
38385 */
38386 SQLITE_API int SQLITE_APICALL sqlite3_win32_reset_heap(){
38387 int rc;
38388 MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */
38389 MUTEX_LOGIC( sqlite3_mutex *pMem; ) /* The memsys static mutex */
38390 MUTEX_LOGIC( pMaster = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); )
38391 MUTEX_LOGIC( pMem = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM); )
@@ -38426,11 +38426,11 @@
38426 /*
38427 ** This function outputs the specified (ANSI) string to the Win32 debugger
38428 ** (if available).
38429 */
38430
38431 SQLITE_API void SQLITE_APICALL sqlite3_win32_write_debug(const char *zBuf, int nBuf){
38432 char zDbgBuf[SQLITE_WIN32_DBG_BUF_SIZE];
38433 int nMin = MIN(nBuf, (SQLITE_WIN32_DBG_BUF_SIZE - 1)); /* may be negative. */
38434 if( nMin<-1 ) nMin = -1; /* all negative values become -1. */
38435 assert( nMin==-1 || nMin==0 || nMin<SQLITE_WIN32_DBG_BUF_SIZE );
38436 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -38472,11 +38472,11 @@
38472 */
38473 #if SQLITE_OS_WINRT
38474 static HANDLE sleepObj = NULL;
38475 #endif
38476
38477 SQLITE_API void SQLITE_APICALL sqlite3_win32_sleep(DWORD milliseconds){
38478 #if SQLITE_OS_WINRT
38479 if ( sleepObj==NULL ){
38480 sleepObj = osCreateEventExW(NULL, NULL, CREATE_EVENT_MANUAL_RESET,
38481 SYNCHRONIZE);
38482 }
@@ -38521,11 +38521,11 @@
38521
38522 /*
38523 ** This function determines if the machine is running a version of Windows
38524 ** based on the NT kernel.
38525 */
38526 SQLITE_API int SQLITE_APICALL sqlite3_win32_is_nt(void){
38527 #if SQLITE_OS_WINRT
38528 /*
38529 ** NOTE: The WinRT sub-platform is always assumed to be based on the NT
38530 ** kernel.
38531 */
@@ -38909,11 +38909,11 @@
38909 }
38910
38911 /*
38912 ** This is a public wrapper for the winUtf8ToUnicode() function.
38913 */
38914 SQLITE_API LPWSTR SQLITE_APICALL sqlite3_win32_utf8_to_unicode(const char *zText){
38915 #ifdef SQLITE_ENABLE_API_ARMOR
38916 if( !zText ){
38917 (void)SQLITE_MISUSE_BKPT;
38918 return 0;
38919 }
@@ -38925,11 +38925,11 @@
38925 }
38926
38927 /*
38928 ** This is a public wrapper for the winUnicodeToUtf8() function.
38929 */
38930 SQLITE_API char *SQLITE_APICALL sqlite3_win32_unicode_to_utf8(LPCWSTR zWideText){
38931 #ifdef SQLITE_ENABLE_API_ARMOR
38932 if( !zWideText ){
38933 (void)SQLITE_MISUSE_BKPT;
38934 return 0;
38935 }
@@ -38941,11 +38941,11 @@
38941 }
38942
38943 /*
38944 ** This is a public wrapper for the winMbcsToUtf8() function.
38945 */
38946 SQLITE_API char *SQLITE_APICALL sqlite3_win32_mbcs_to_utf8(const char *zText){
38947 #ifdef SQLITE_ENABLE_API_ARMOR
38948 if( !zText ){
38949 (void)SQLITE_MISUSE_BKPT;
38950 return 0;
38951 }
@@ -38957,11 +38957,11 @@
38957 }
38958
38959 /*
38960 ** This is a public wrapper for the winMbcsToUtf8() function.
38961 */
38962 SQLITE_API char *SQLITE_APICALL sqlite3_win32_mbcs_to_utf8_v2(const char *zText, int useAnsi){
38963 #ifdef SQLITE_ENABLE_API_ARMOR
38964 if( !zText ){
38965 (void)SQLITE_MISUSE_BKPT;
38966 return 0;
38967 }
@@ -38973,11 +38973,11 @@
38973 }
38974
38975 /*
38976 ** This is a public wrapper for the winUtf8ToMbcs() function.
38977 */
38978 SQLITE_API char *SQLITE_APICALL sqlite3_win32_utf8_to_mbcs(const char *zText){
38979 #ifdef SQLITE_ENABLE_API_ARMOR
38980 if( !zText ){
38981 (void)SQLITE_MISUSE_BKPT;
38982 return 0;
38983 }
@@ -38989,11 +38989,11 @@
38989 }
38990
38991 /*
38992 ** This is a public wrapper for the winUtf8ToMbcs() function.
38993 */
38994 SQLITE_API char *SQLITE_APICALL sqlite3_win32_utf8_to_mbcs_v2(const char *zText, int useAnsi){
38995 #ifdef SQLITE_ENABLE_API_ARMOR
38996 if( !zText ){
38997 (void)SQLITE_MISUSE_BKPT;
38998 return 0;
38999 }
@@ -39009,11 +39009,11 @@
39009 ** the provided arguments. The type argument must be 1 in order to set the
39010 ** data directory or 2 in order to set the temporary directory. The zValue
39011 ** argument is the name of the directory to use. The return value will be
39012 ** SQLITE_OK if successful.
39013 */
39014 SQLITE_API int SQLITE_APICALL sqlite3_win32_set_directory(DWORD type, LPCWSTR zValue){
39015 char **ppDirectory = 0;
39016 #ifndef SQLITE_OMIT_AUTOINIT
39017 int rc = sqlite3_initialize();
39018 if( rc ) return rc;
39019 #endif
@@ -42927,11 +42927,11 @@
42927 }
42928
42929 /*
42930 ** Initialize and deinitialize the operating system interface.
42931 */
42932 SQLITE_API int SQLITE_APICALL sqlite3_os_init(void){
42933 static sqlite3_vfs winVfs = {
42934 3, /* iVersion */
42935 sizeof(winFile), /* szOsFile */
42936 SQLITE_WIN32_MAX_PATH_BYTES, /* mxPathname */
42937 0, /* pNext */
@@ -43058,11 +43058,11 @@
43058 #endif
43059
43060 return SQLITE_OK;
43061 }
43062
43063 SQLITE_API int SQLITE_APICALL sqlite3_os_end(void){
43064 #if SQLITE_OS_WINRT
43065 if( sleepObj!=NULL ){
43066 osCloseHandle(sleepObj);
43067 sleepObj = NULL;
43068 }
@@ -57053,11 +57053,11 @@
57053
57054 /*
57055 ** Return a +ve value if snapshot p1 is newer than p2. A -ve value if
57056 ** p1 is older than p2 and zero if p1 and p2 are the same snapshot.
57057 */
57058 SQLITE_API int SQLITE_APICALL sqlite3_snapshot_cmp(sqlite3_snapshot *p1, sqlite3_snapshot *p2){
57059 WalIndexHdr *pHdr1 = (WalIndexHdr*)p1;
57060 WalIndexHdr *pHdr2 = (WalIndexHdr*)p2;
57061
57062 /* aSalt[0] is a copy of the value stored in the wal file header. It
57063 ** is incremented each time the wal file is restarted. */
@@ -58190,11 +58190,11 @@
58190 **
58191 ** This routine has no effect on existing database connections.
58192 ** The shared cache setting effects only future calls to
58193 ** sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2().
58194 */
58195 SQLITE_API int SQLITE_APICALL sqlite3_enable_shared_cache(int enable){
58196 sqlite3GlobalConfig.sharedCacheEnabled = enable;
58197 return SQLITE_OK;
58198 }
58199 #endif
58200
@@ -64489,11 +64489,11 @@
64489 }
64490 }
64491
64492 /*
64493 ** A CellArray object contains a cache of pointers and sizes for a
64494 ** consecutive sequence of cells that might be held multiple pages.
64495 */
64496 typedef struct CellArray CellArray;
64497 struct CellArray {
64498 int nCell; /* Number of cells in apCell[] */
64499 MemPage *pRef; /* Reference page */
@@ -67963,11 +67963,11 @@
67963 ** a pointer to the new sqlite3_backup object.
67964 **
67965 ** If an error occurs, NULL is returned and an error code and error message
67966 ** stored in database handle pDestDb.
67967 */
67968 SQLITE_API sqlite3_backup *SQLITE_APICALL sqlite3_backup_init(
67969 sqlite3* pDestDb, /* Database to write to */
67970 const char *zDestDb, /* Name of database within pDestDb */
67971 sqlite3* pSrcDb, /* Database connection to read from */
67972 const char *zSrcDb /* Name of database within pSrcDb */
67973 ){
@@ -68171,11 +68171,11 @@
68171 }
68172
68173 /*
68174 ** Copy nPage pages from the source b-tree to the destination.
68175 */
68176 SQLITE_API int SQLITE_APICALL sqlite3_backup_step(sqlite3_backup *p, int nPage){
68177 int rc;
68178 int destMode; /* Destination journal mode */
68179 int pgszSrc = 0; /* Source page size */
68180 int pgszDest = 0; /* Destination page size */
68181
@@ -68415,11 +68415,11 @@
68415 }
68416
68417 /*
68418 ** Release all resources associated with an sqlite3_backup* handle.
68419 */
68420 SQLITE_API int SQLITE_APICALL sqlite3_backup_finish(sqlite3_backup *p){
68421 sqlite3_backup **pp; /* Ptr to head of pagers backup list */
68422 sqlite3 *pSrcDb; /* Source database connection */
68423 int rc; /* Value to return */
68424
68425 /* Enter the mutexes */
@@ -68467,11 +68467,11 @@
68467
68468 /*
68469 ** Return the number of pages still to be backed up as of the most recent
68470 ** call to sqlite3_backup_step().
68471 */
68472 SQLITE_API int SQLITE_APICALL sqlite3_backup_remaining(sqlite3_backup *p){
68473 #ifdef SQLITE_ENABLE_API_ARMOR
68474 if( p==0 ){
68475 (void)SQLITE_MISUSE_BKPT;
68476 return 0;
68477 }
@@ -68481,11 +68481,11 @@
68481
68482 /*
68483 ** Return the total number of pages in the source database as of the most
68484 ** recent call to sqlite3_backup_step().
68485 */
68486 SQLITE_API int SQLITE_APICALL sqlite3_backup_pagecount(sqlite3_backup *p){
68487 #ifdef SQLITE_ENABLE_API_ARMOR
68488 if( p==0 ){
68489 (void)SQLITE_MISUSE_BKPT;
68490 return 0;
68491 }
@@ -74935,11 +74935,11 @@
74935 ** execution environment changes in a way that would alter the program
74936 ** that sqlite3_prepare() generates. For example, if new functions or
74937 ** collating sequences are registered or if an authorizer function is
74938 ** added or changed.
74939 */
74940 SQLITE_API int SQLITE_APICALL sqlite3_expired(sqlite3_stmt *pStmt){
74941 Vdbe *p = (Vdbe*)pStmt;
74942 return p==0 || p->expired;
74943 }
74944 #endif
74945
@@ -75004,11 +75004,11 @@
75004 ** machine.
75005 **
75006 ** This routine sets the error code and string returned by
75007 ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
75008 */
75009 SQLITE_API int SQLITE_APICALL sqlite3_finalize(sqlite3_stmt *pStmt){
75010 int rc;
75011 if( pStmt==0 ){
75012 /* IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL
75013 ** pointer is a harmless no-op. */
75014 rc = SQLITE_OK;
@@ -75031,11 +75031,11 @@
75031 ** the prior execution is returned.
75032 **
75033 ** This routine sets the error code and string returned by
75034 ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
75035 */
75036 SQLITE_API int SQLITE_APICALL sqlite3_reset(sqlite3_stmt *pStmt){
75037 int rc;
75038 if( pStmt==0 ){
75039 rc = SQLITE_OK;
75040 }else{
75041 Vdbe *v = (Vdbe*)pStmt;
@@ -75052,11 +75052,11 @@
75052 }
75053
75054 /*
75055 ** Set all the parameters in the compiled SQL statement to NULL.
75056 */
75057 SQLITE_API int SQLITE_APICALL sqlite3_clear_bindings(sqlite3_stmt *pStmt){
75058 int i;
75059 int rc = SQLITE_OK;
75060 Vdbe *p = (Vdbe*)pStmt;
75061 #if SQLITE_THREADSAFE
75062 sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex;
@@ -75076,11 +75076,11 @@
75076
75077 /**************************** sqlite3_value_ *******************************
75078 ** The following routines extract information from a Mem or sqlite3_value
75079 ** structure.
75080 */
75081 SQLITE_API const void *SQLITE_APICALL sqlite3_value_blob(sqlite3_value *pVal){
75082 Mem *p = (Mem*)pVal;
75083 if( p->flags & (MEM_Blob|MEM_Str) ){
75084 if( sqlite3VdbeMemExpandBlob(p)!=SQLITE_OK ){
75085 assert( p->flags==MEM_Null && p->z==0 );
75086 return 0;
@@ -75089,48 +75089,48 @@
75089 return p->n ? p->z : 0;
75090 }else{
75091 return sqlite3_value_text(pVal);
75092 }
75093 }
75094 SQLITE_API int SQLITE_APICALL sqlite3_value_bytes(sqlite3_value *pVal){
75095 return sqlite3ValueBytes(pVal, SQLITE_UTF8);
75096 }
75097 SQLITE_API int SQLITE_APICALL sqlite3_value_bytes16(sqlite3_value *pVal){
75098 return sqlite3ValueBytes(pVal, SQLITE_UTF16NATIVE);
75099 }
75100 SQLITE_API double SQLITE_APICALL sqlite3_value_double(sqlite3_value *pVal){
75101 return sqlite3VdbeRealValue((Mem*)pVal);
75102 }
75103 SQLITE_API int SQLITE_APICALL sqlite3_value_int(sqlite3_value *pVal){
75104 return (int)sqlite3VdbeIntValue((Mem*)pVal);
75105 }
75106 SQLITE_API sqlite_int64 SQLITE_APICALL sqlite3_value_int64(sqlite3_value *pVal){
75107 return sqlite3VdbeIntValue((Mem*)pVal);
75108 }
75109 SQLITE_API unsigned int SQLITE_APICALL sqlite3_value_subtype(sqlite3_value *pVal){
75110 Mem *pMem = (Mem*)pVal;
75111 return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0);
75112 }
75113 SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_value_text(sqlite3_value *pVal){
75114 return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
75115 }
75116 #ifndef SQLITE_OMIT_UTF16
75117 SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16(sqlite3_value* pVal){
75118 return sqlite3ValueText(pVal, SQLITE_UTF16NATIVE);
75119 }
75120 SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16be(sqlite3_value *pVal){
75121 return sqlite3ValueText(pVal, SQLITE_UTF16BE);
75122 }
75123 SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16le(sqlite3_value *pVal){
75124 return sqlite3ValueText(pVal, SQLITE_UTF16LE);
75125 }
75126 #endif /* SQLITE_OMIT_UTF16 */
75127 /* EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five
75128 ** fundamental datatypes: 64-bit signed integer 64-bit IEEE floating
75129 ** point number string BLOB NULL
75130 */
75131 SQLITE_API int SQLITE_APICALL sqlite3_value_type(sqlite3_value* pVal){
75132 static const u8 aType[] = {
75133 SQLITE_BLOB, /* 0x00 */
75134 SQLITE_NULL, /* 0x01 */
75135 SQLITE_TEXT, /* 0x02 */
75136 SQLITE_NULL, /* 0x03 */
@@ -75166,11 +75166,11 @@
75166 return aType[pVal->flags&MEM_AffMask];
75167 }
75168
75169 /* Make a copy of an sqlite3_value object
75170 */
75171 SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_value_dup(const sqlite3_value *pOrig){
75172 sqlite3_value *pNew;
75173 if( pOrig==0 ) return 0;
75174 pNew = sqlite3_malloc( sizeof(*pNew) );
75175 if( pNew==0 ) return 0;
75176 memset(pNew, 0, sizeof(*pNew));
@@ -75189,11 +75189,11 @@
75189 }
75190
75191 /* Destroy an sqlite3_value object previously obtained from
75192 ** sqlite3_value_dup().
75193 */
75194 SQLITE_API void SQLITE_APICALL sqlite3_value_free(sqlite3_value *pOld){
75195 sqlite3ValueFree(pOld);
75196 }
75197
75198
75199 /**************************** sqlite3_result_ *******************************
@@ -75232,21 +75232,21 @@
75232 xDel((void*)p);
75233 }
75234 if( pCtx ) sqlite3_result_error_toobig(pCtx);
75235 return SQLITE_TOOBIG;
75236 }
75237 SQLITE_API void SQLITE_APICALL sqlite3_result_blob(
75238 sqlite3_context *pCtx,
75239 const void *z,
75240 int n,
75241 void (*xDel)(void *)
75242 ){
75243 assert( n>=0 );
75244 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75245 setResultStrOrError(pCtx, z, n, 0, xDel);
75246 }
75247 SQLITE_API void SQLITE_APICALL sqlite3_result_blob64(
75248 sqlite3_context *pCtx,
75249 const void *z,
75250 sqlite3_uint64 n,
75251 void (*xDel)(void *)
75252 ){
@@ -75256,56 +75256,56 @@
75256 (void)invokeValueDestructor(z, xDel, pCtx);
75257 }else{
75258 setResultStrOrError(pCtx, z, (int)n, 0, xDel);
75259 }
75260 }
75261 SQLITE_API void SQLITE_APICALL sqlite3_result_double(sqlite3_context *pCtx, double rVal){
75262 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75263 sqlite3VdbeMemSetDouble(pCtx->pOut, rVal);
75264 }
75265 SQLITE_API void SQLITE_APICALL sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
75266 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75267 pCtx->isError = SQLITE_ERROR;
75268 pCtx->fErrorOrAux = 1;
75269 sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF8, SQLITE_TRANSIENT);
75270 }
75271 #ifndef SQLITE_OMIT_UTF16
75272 SQLITE_API void SQLITE_APICALL sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){
75273 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75274 pCtx->isError = SQLITE_ERROR;
75275 pCtx->fErrorOrAux = 1;
75276 sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF16NATIVE, SQLITE_TRANSIENT);
75277 }
75278 #endif
75279 SQLITE_API void SQLITE_APICALL sqlite3_result_int(sqlite3_context *pCtx, int iVal){
75280 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75281 sqlite3VdbeMemSetInt64(pCtx->pOut, (i64)iVal);
75282 }
75283 SQLITE_API void SQLITE_APICALL sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
75284 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75285 sqlite3VdbeMemSetInt64(pCtx->pOut, iVal);
75286 }
75287 SQLITE_API void SQLITE_APICALL sqlite3_result_null(sqlite3_context *pCtx){
75288 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75289 sqlite3VdbeMemSetNull(pCtx->pOut);
75290 }
75291 SQLITE_API void SQLITE_APICALL sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){
75292 Mem *pOut = pCtx->pOut;
75293 assert( sqlite3_mutex_held(pOut->db->mutex) );
75294 pOut->eSubtype = eSubtype & 0xff;
75295 pOut->flags |= MEM_Subtype;
75296 }
75297 SQLITE_API void SQLITE_APICALL sqlite3_result_text(
75298 sqlite3_context *pCtx,
75299 const char *z,
75300 int n,
75301 void (*xDel)(void *)
75302 ){
75303 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75304 setResultStrOrError(pCtx, z, n, SQLITE_UTF8, xDel);
75305 }
75306 SQLITE_API void SQLITE_APICALL sqlite3_result_text64(
75307 sqlite3_context *pCtx,
75308 const char *z,
75309 sqlite3_uint64 n,
75310 void (*xDel)(void *),
75311 unsigned char enc
@@ -75318,56 +75318,56 @@
75318 }else{
75319 setResultStrOrError(pCtx, z, (int)n, enc, xDel);
75320 }
75321 }
75322 #ifndef SQLITE_OMIT_UTF16
75323 SQLITE_API void SQLITE_APICALL sqlite3_result_text16(
75324 sqlite3_context *pCtx,
75325 const void *z,
75326 int n,
75327 void (*xDel)(void *)
75328 ){
75329 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75330 setResultStrOrError(pCtx, z, n, SQLITE_UTF16NATIVE, xDel);
75331 }
75332 SQLITE_API void SQLITE_APICALL sqlite3_result_text16be(
75333 sqlite3_context *pCtx,
75334 const void *z,
75335 int n,
75336 void (*xDel)(void *)
75337 ){
75338 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75339 setResultStrOrError(pCtx, z, n, SQLITE_UTF16BE, xDel);
75340 }
75341 SQLITE_API void SQLITE_APICALL sqlite3_result_text16le(
75342 sqlite3_context *pCtx,
75343 const void *z,
75344 int n,
75345 void (*xDel)(void *)
75346 ){
75347 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75348 setResultStrOrError(pCtx, z, n, SQLITE_UTF16LE, xDel);
75349 }
75350 #endif /* SQLITE_OMIT_UTF16 */
75351 SQLITE_API void SQLITE_APICALL sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){
75352 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75353 sqlite3VdbeMemCopy(pCtx->pOut, pValue);
75354 }
75355 SQLITE_API void SQLITE_APICALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){
75356 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75357 sqlite3VdbeMemSetZeroBlob(pCtx->pOut, n);
75358 }
75359 SQLITE_API int SQLITE_APICALL sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){
75360 Mem *pOut = pCtx->pOut;
75361 assert( sqlite3_mutex_held(pOut->db->mutex) );
75362 if( n>(u64)pOut->db->aLimit[SQLITE_LIMIT_LENGTH] ){
75363 return SQLITE_TOOBIG;
75364 }
75365 sqlite3VdbeMemSetZeroBlob(pCtx->pOut, (int)n);
75366 return SQLITE_OK;
75367 }
75368 SQLITE_API void SQLITE_APICALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){
75369 pCtx->isError = errCode;
75370 pCtx->fErrorOrAux = 1;
75371 #ifdef SQLITE_DEBUG
75372 if( pCtx->pVdbe ) pCtx->pVdbe->rcApp = errCode;
75373 #endif
@@ -75376,20 +75376,20 @@
75376 SQLITE_UTF8, SQLITE_STATIC);
75377 }
75378 }
75379
75380 /* Force an SQLITE_TOOBIG error. */
75381 SQLITE_API void SQLITE_APICALL sqlite3_result_error_toobig(sqlite3_context *pCtx){
75382 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75383 pCtx->isError = SQLITE_TOOBIG;
75384 pCtx->fErrorOrAux = 1;
75385 sqlite3VdbeMemSetStr(pCtx->pOut, "string or blob too big", -1,
75386 SQLITE_UTF8, SQLITE_STATIC);
75387 }
75388
75389 /* An SQLITE_NOMEM error. */
75390 SQLITE_API void SQLITE_APICALL sqlite3_result_error_nomem(sqlite3_context *pCtx){
75391 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75392 sqlite3VdbeMemSetNull(pCtx->pOut);
75393 pCtx->isError = SQLITE_NOMEM_BKPT;
75394 pCtx->fErrorOrAux = 1;
75395 sqlite3OomFault(pCtx->pOut->db);
@@ -75557,11 +75557,11 @@
75557 /*
75558 ** This is the top-level implementation of sqlite3_step(). Call
75559 ** sqlite3Step() to do most of the work. If a schema error occurs,
75560 ** call sqlite3Reprepare() and try again.
75561 */
75562 SQLITE_API int SQLITE_APICALL sqlite3_step(sqlite3_stmt *pStmt){
75563 int rc = SQLITE_OK; /* Result from sqlite3Step() */
75564 int rc2 = SQLITE_OK; /* Result from sqlite3Reprepare() */
75565 Vdbe *v = (Vdbe*)pStmt; /* the prepared statement */
75566 int cnt = 0; /* Counter to prevent infinite loop of reprepares */
75567 sqlite3 *db; /* The database connection */
@@ -75608,11 +75608,11 @@
75608
75609 /*
75610 ** Extract the user data from a sqlite3_context structure and return a
75611 ** pointer to it.
75612 */
75613 SQLITE_API void *SQLITE_APICALL sqlite3_user_data(sqlite3_context *p){
75614 assert( p && p->pFunc );
75615 return p->pFunc->pUserData;
75616 }
75617
75618 /*
@@ -75623,11 +75623,11 @@
75623 ** returns a copy of the pointer to the database connection (the 1st
75624 ** parameter) of the sqlite3_create_function() and
75625 ** sqlite3_create_function16() routines that originally registered the
75626 ** application defined function.
75627 */
75628 SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_context_db_handle(sqlite3_context *p){
75629 assert( p && p->pOut );
75630 return p->pOut->db;
75631 }
75632
75633 /*
@@ -75699,11 +75699,11 @@
75699 /*
75700 ** Allocate or return the aggregate context for a user function. A new
75701 ** context is allocated on the first call. Subsequent calls return the
75702 ** same context that was returned on prior calls.
75703 */
75704 SQLITE_API void *SQLITE_APICALL sqlite3_aggregate_context(sqlite3_context *p, int nByte){
75705 assert( p && p->pFunc && p->pFunc->xFinalize );
75706 assert( sqlite3_mutex_held(p->pOut->db->mutex) );
75707 testcase( nByte<0 );
75708 if( (p->pMem->flags & MEM_Agg)==0 ){
75709 return createAggContext(p, nByte);
@@ -75714,11 +75714,11 @@
75714
75715 /*
75716 ** Return the auxiliary data pointer, if any, for the iArg'th argument to
75717 ** the user-function defined by pCtx.
75718 */
75719 SQLITE_API void *SQLITE_APICALL sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
75720 AuxData *pAuxData;
75721
75722 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75723 #if SQLITE_ENABLE_STAT3_OR_STAT4
75724 if( pCtx->pVdbe==0 ) return 0;
@@ -75735,11 +75735,11 @@
75735 /*
75736 ** Set the auxiliary data pointer and delete function, for the iArg'th
75737 ** argument to the user-function defined by pCtx. Any previous value is
75738 ** deleted by calling the delete function specified when it was set.
75739 */
75740 SQLITE_API void SQLITE_APICALL sqlite3_set_auxdata(
75741 sqlite3_context *pCtx,
75742 int iArg,
75743 void *pAux,
75744 void (*xDelete)(void*)
75745 ){
@@ -75790,29 +75790,29 @@
75790 ** This function is deprecated. Do not use it for new code. It is
75791 ** provide only to avoid breaking legacy code. New aggregate function
75792 ** implementations should keep their own counts within their aggregate
75793 ** context.
75794 */
75795 SQLITE_API int SQLITE_APICALL sqlite3_aggregate_count(sqlite3_context *p){
75796 assert( p && p->pMem && p->pFunc && p->pFunc->xFinalize );
75797 return p->pMem->n;
75798 }
75799 #endif
75800
75801 /*
75802 ** Return the number of columns in the result set for the statement pStmt.
75803 */
75804 SQLITE_API int SQLITE_APICALL sqlite3_column_count(sqlite3_stmt *pStmt){
75805 Vdbe *pVm = (Vdbe *)pStmt;
75806 return pVm ? pVm->nResColumn : 0;
75807 }
75808
75809 /*
75810 ** Return the number of values available from the current row of the
75811 ** currently executing statement pStmt.
75812 */
75813 SQLITE_API int SQLITE_APICALL sqlite3_data_count(sqlite3_stmt *pStmt){
75814 Vdbe *pVm = (Vdbe *)pStmt;
75815 if( pVm==0 || pVm->pResultSet==0 ) return 0;
75816 return pVm->nResColumn;
75817 }
75818
@@ -75911,67 +75911,67 @@
75911
75912 /**************************** sqlite3_column_ *******************************
75913 ** The following routines are used to access elements of the current row
75914 ** in the result set.
75915 */
75916 SQLITE_API const void *SQLITE_APICALL sqlite3_column_blob(sqlite3_stmt *pStmt, int i){
75917 const void *val;
75918 val = sqlite3_value_blob( columnMem(pStmt,i) );
75919 /* Even though there is no encoding conversion, value_blob() might
75920 ** need to call malloc() to expand the result of a zeroblob()
75921 ** expression.
75922 */
75923 columnMallocFailure(pStmt);
75924 return val;
75925 }
75926 SQLITE_API int SQLITE_APICALL sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){
75927 int val = sqlite3_value_bytes( columnMem(pStmt,i) );
75928 columnMallocFailure(pStmt);
75929 return val;
75930 }
75931 SQLITE_API int SQLITE_APICALL sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){
75932 int val = sqlite3_value_bytes16( columnMem(pStmt,i) );
75933 columnMallocFailure(pStmt);
75934 return val;
75935 }
75936 SQLITE_API double SQLITE_APICALL sqlite3_column_double(sqlite3_stmt *pStmt, int i){
75937 double val = sqlite3_value_double( columnMem(pStmt,i) );
75938 columnMallocFailure(pStmt);
75939 return val;
75940 }
75941 SQLITE_API int SQLITE_APICALL sqlite3_column_int(sqlite3_stmt *pStmt, int i){
75942 int val = sqlite3_value_int( columnMem(pStmt,i) );
75943 columnMallocFailure(pStmt);
75944 return val;
75945 }
75946 SQLITE_API sqlite_int64 SQLITE_APICALL sqlite3_column_int64(sqlite3_stmt *pStmt, int i){
75947 sqlite_int64 val = sqlite3_value_int64( columnMem(pStmt,i) );
75948 columnMallocFailure(pStmt);
75949 return val;
75950 }
75951 SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_column_text(sqlite3_stmt *pStmt, int i){
75952 const unsigned char *val = sqlite3_value_text( columnMem(pStmt,i) );
75953 columnMallocFailure(pStmt);
75954 return val;
75955 }
75956 SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_column_value(sqlite3_stmt *pStmt, int i){
75957 Mem *pOut = columnMem(pStmt, i);
75958 if( pOut->flags&MEM_Static ){
75959 pOut->flags &= ~MEM_Static;
75960 pOut->flags |= MEM_Ephem;
75961 }
75962 columnMallocFailure(pStmt);
75963 return (sqlite3_value *)pOut;
75964 }
75965 #ifndef SQLITE_OMIT_UTF16
75966 SQLITE_API const void *SQLITE_APICALL sqlite3_column_text16(sqlite3_stmt *pStmt, int i){
75967 const void *val = sqlite3_value_text16( columnMem(pStmt,i) );
75968 columnMallocFailure(pStmt);
75969 return val;
75970 }
75971 #endif /* SQLITE_OMIT_UTF16 */
75972 SQLITE_API int SQLITE_APICALL sqlite3_column_type(sqlite3_stmt *pStmt, int i){
75973 int iType = sqlite3_value_type( columnMem(pStmt,i) );
75974 columnMallocFailure(pStmt);
75975 return iType;
75976 }
75977
@@ -76031,16 +76031,16 @@
76031
76032 /*
76033 ** Return the name of the Nth column of the result set returned by SQL
76034 ** statement pStmt.
76035 */
76036 SQLITE_API const char *SQLITE_APICALL sqlite3_column_name(sqlite3_stmt *pStmt, int N){
76037 return columnName(
76038 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_NAME);
76039 }
76040 #ifndef SQLITE_OMIT_UTF16
76041 SQLITE_API const void *SQLITE_APICALL sqlite3_column_name16(sqlite3_stmt *pStmt, int N){
76042 return columnName(
76043 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_NAME);
76044 }
76045 #endif
76046
@@ -76056,16 +76056,16 @@
76056 #ifndef SQLITE_OMIT_DECLTYPE
76057 /*
76058 ** Return the column declaration type (if applicable) of the 'i'th column
76059 ** of the result set of SQL statement pStmt.
76060 */
76061 SQLITE_API const char *SQLITE_APICALL sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){
76062 return columnName(
76063 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DECLTYPE);
76064 }
76065 #ifndef SQLITE_OMIT_UTF16
76066 SQLITE_API const void *SQLITE_APICALL sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){
76067 return columnName(
76068 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DECLTYPE);
76069 }
76070 #endif /* SQLITE_OMIT_UTF16 */
76071 #endif /* SQLITE_OMIT_DECLTYPE */
@@ -76074,16 +76074,16 @@
76074 /*
76075 ** Return the name of the database from which a result column derives.
76076 ** NULL is returned if the result column is an expression or constant or
76077 ** anything else which is not an unambiguous reference to a database column.
76078 */
76079 SQLITE_API const char *SQLITE_APICALL sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){
76080 return columnName(
76081 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DATABASE);
76082 }
76083 #ifndef SQLITE_OMIT_UTF16
76084 SQLITE_API const void *SQLITE_APICALL sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){
76085 return columnName(
76086 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DATABASE);
76087 }
76088 #endif /* SQLITE_OMIT_UTF16 */
76089
@@ -76090,16 +76090,16 @@
76090 /*
76091 ** Return the name of the table from which a result column derives.
76092 ** NULL is returned if the result column is an expression or constant or
76093 ** anything else which is not an unambiguous reference to a database column.
76094 */
76095 SQLITE_API const char *SQLITE_APICALL sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){
76096 return columnName(
76097 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_TABLE);
76098 }
76099 #ifndef SQLITE_OMIT_UTF16
76100 SQLITE_API const void *SQLITE_APICALL sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){
76101 return columnName(
76102 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_TABLE);
76103 }
76104 #endif /* SQLITE_OMIT_UTF16 */
76105
@@ -76106,16 +76106,16 @@
76106 /*
76107 ** Return the name of the table column from which a result column derives.
76108 ** NULL is returned if the result column is an expression or constant or
76109 ** anything else which is not an unambiguous reference to a database column.
76110 */
76111 SQLITE_API const char *SQLITE_APICALL sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){
76112 return columnName(
76113 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_COLUMN);
76114 }
76115 #ifndef SQLITE_OMIT_UTF16
76116 SQLITE_API const void *SQLITE_APICALL sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){
76117 return columnName(
76118 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_COLUMN);
76119 }
76120 #endif /* SQLITE_OMIT_UTF16 */
76121 #endif /* SQLITE_ENABLE_COLUMN_METADATA */
@@ -76212,11 +76212,11 @@
76212
76213
76214 /*
76215 ** Bind a blob value to an SQL statement variable.
76216 */
76217 SQLITE_API int SQLITE_APICALL sqlite3_bind_blob(
76218 sqlite3_stmt *pStmt,
76219 int i,
76220 const void *zData,
76221 int nData,
76222 void (*xDel)(void*)
@@ -76224,11 +76224,11 @@
76224 #ifdef SQLITE_ENABLE_API_ARMOR
76225 if( nData<0 ) return SQLITE_MISUSE_BKPT;
76226 #endif
76227 return bindText(pStmt, i, zData, nData, xDel, 0);
76228 }
76229 SQLITE_API int SQLITE_APICALL sqlite3_bind_blob64(
76230 sqlite3_stmt *pStmt,
76231 int i,
76232 const void *zData,
76233 sqlite3_uint64 nData,
76234 void (*xDel)(void*)
@@ -76238,52 +76238,52 @@
76238 return invokeValueDestructor(zData, xDel, 0);
76239 }else{
76240 return bindText(pStmt, i, zData, (int)nData, xDel, 0);
76241 }
76242 }
76243 SQLITE_API int SQLITE_APICALL sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
76244 int rc;
76245 Vdbe *p = (Vdbe *)pStmt;
76246 rc = vdbeUnbind(p, i);
76247 if( rc==SQLITE_OK ){
76248 sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue);
76249 sqlite3_mutex_leave(p->db->mutex);
76250 }
76251 return rc;
76252 }
76253 SQLITE_API int SQLITE_APICALL sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){
76254 return sqlite3_bind_int64(p, i, (i64)iValue);
76255 }
76256 SQLITE_API int SQLITE_APICALL sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
76257 int rc;
76258 Vdbe *p = (Vdbe *)pStmt;
76259 rc = vdbeUnbind(p, i);
76260 if( rc==SQLITE_OK ){
76261 sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue);
76262 sqlite3_mutex_leave(p->db->mutex);
76263 }
76264 return rc;
76265 }
76266 SQLITE_API int SQLITE_APICALL sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
76267 int rc;
76268 Vdbe *p = (Vdbe*)pStmt;
76269 rc = vdbeUnbind(p, i);
76270 if( rc==SQLITE_OK ){
76271 sqlite3_mutex_leave(p->db->mutex);
76272 }
76273 return rc;
76274 }
76275 SQLITE_API int SQLITE_APICALL sqlite3_bind_text(
76276 sqlite3_stmt *pStmt,
76277 int i,
76278 const char *zData,
76279 int nData,
76280 void (*xDel)(void*)
76281 ){
76282 return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8);
76283 }
76284 SQLITE_API int SQLITE_APICALL sqlite3_bind_text64(
76285 sqlite3_stmt *pStmt,
76286 int i,
76287 const char *zData,
76288 sqlite3_uint64 nData,
76289 void (*xDel)(void*),
@@ -76296,21 +76296,21 @@
76296 if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE;
76297 return bindText(pStmt, i, zData, (int)nData, xDel, enc);
76298 }
76299 }
76300 #ifndef SQLITE_OMIT_UTF16
76301 SQLITE_API int SQLITE_APICALL sqlite3_bind_text16(
76302 sqlite3_stmt *pStmt,
76303 int i,
76304 const void *zData,
76305 int nData,
76306 void (*xDel)(void*)
76307 ){
76308 return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE);
76309 }
76310 #endif /* SQLITE_OMIT_UTF16 */
76311 SQLITE_API int SQLITE_APICALL sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
76312 int rc;
76313 switch( sqlite3_value_type((sqlite3_value*)pValue) ){
76314 case SQLITE_INTEGER: {
76315 rc = sqlite3_bind_int64(pStmt, i, pValue->u.i);
76316 break;
@@ -76337,21 +76337,21 @@
76337 break;
76338 }
76339 }
76340 return rc;
76341 }
76342 SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
76343 int rc;
76344 Vdbe *p = (Vdbe *)pStmt;
76345 rc = vdbeUnbind(p, i);
76346 if( rc==SQLITE_OK ){
76347 sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n);
76348 sqlite3_mutex_leave(p->db->mutex);
76349 }
76350 return rc;
76351 }
76352 SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){
76353 int rc;
76354 Vdbe *p = (Vdbe *)pStmt;
76355 sqlite3_mutex_enter(p->db->mutex);
76356 if( n>(u64)p->db->aLimit[SQLITE_LIMIT_LENGTH] ){
76357 rc = SQLITE_TOOBIG;
@@ -76366,11 +76366,11 @@
76366
76367 /*
76368 ** Return the number of wildcards that can be potentially bound to.
76369 ** This routine is added to support DBD::SQLite.
76370 */
76371 SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
76372 Vdbe *p = (Vdbe*)pStmt;
76373 return p ? p->nVar : 0;
76374 }
76375
76376 /*
@@ -76377,11 +76377,11 @@
76377 ** Return the name of a wildcard parameter. Return NULL if the index
76378 ** is out of range or if the wildcard is unnamed.
76379 **
76380 ** The result is always UTF-8.
76381 */
76382 SQLITE_API const char *SQLITE_APICALL sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){
76383 Vdbe *p = (Vdbe*)pStmt;
76384 if( p==0 || i<1 || i>p->nzVar ){
76385 return 0;
76386 }
76387 return p->azVar[i-1];
@@ -76405,11 +76405,11 @@
76405 }
76406 }
76407 }
76408 return 0;
76409 }
76410 SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
76411 return sqlite3VdbeParameterIndex((Vdbe*)pStmt, zName, sqlite3Strlen30(zName));
76412 }
76413
76414 /*
76415 ** Transfer all bindings from the first statement over to the second.
@@ -76439,11 +76439,11 @@
76439 **
76440 ** If the two statements contain a different number of bindings, then
76441 ** an SQLITE_ERROR is returned. Nothing else can go wrong, so otherwise
76442 ** SQLITE_OK is returned.
76443 */
76444 SQLITE_API int SQLITE_APICALL sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
76445 Vdbe *pFrom = (Vdbe*)pFromStmt;
76446 Vdbe *pTo = (Vdbe*)pToStmt;
76447 if( pFrom->nVar!=pTo->nVar ){
76448 return SQLITE_ERROR;
76449 }
@@ -76461,26 +76461,26 @@
76461 ** Return the sqlite3* database handle to which the prepared statement given
76462 ** in the argument belongs. This is the same database handle that was
76463 ** the first argument to the sqlite3_prepare() that was used to create
76464 ** the statement in the first place.
76465 */
76466 SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_db_handle(sqlite3_stmt *pStmt){
76467 return pStmt ? ((Vdbe*)pStmt)->db : 0;
76468 }
76469
76470 /*
76471 ** Return true if the prepared statement is guaranteed to not modify the
76472 ** database.
76473 */
76474 SQLITE_API int SQLITE_APICALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt){
76475 return pStmt ? ((Vdbe*)pStmt)->readOnly : 1;
76476 }
76477
76478 /*
76479 ** Return true if the prepared statement is in need of being reset.
76480 */
76481 SQLITE_API int SQLITE_APICALL sqlite3_stmt_busy(sqlite3_stmt *pStmt){
76482 Vdbe *v = (Vdbe*)pStmt;
76483 return v!=0 && v->pc>=0 && v->magic==VDBE_MAGIC_RUN;
76484 }
76485
76486 /*
@@ -76487,11 +76487,11 @@
76487 ** Return a pointer to the next prepared statement after pStmt associated
76488 ** with database connection pDb. If pStmt is NULL, return the first
76489 ** prepared statement for the database connection. Return NULL if there
76490 ** are no more.
76491 */
76492 SQLITE_API sqlite3_stmt *SQLITE_APICALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){
76493 sqlite3_stmt *pNext;
76494 #ifdef SQLITE_ENABLE_API_ARMOR
76495 if( !sqlite3SafetyCheckOk(pDb) ){
76496 (void)SQLITE_MISUSE_BKPT;
76497 return 0;
@@ -76508,11 +76508,11 @@
76508 }
76509
76510 /*
76511 ** Return the value of a status counter for a prepared statement
76512 */
76513 SQLITE_API int SQLITE_APICALL sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){
76514 Vdbe *pVdbe = (Vdbe*)pStmt;
76515 u32 v;
76516 #ifdef SQLITE_ENABLE_API_ARMOR
76517 if( !pStmt ){
76518 (void)SQLITE_MISUSE_BKPT;
@@ -76525,11 +76525,11 @@
76525 }
76526
76527 /*
76528 ** Return the SQL associated with a prepared statement
76529 */
76530 SQLITE_API const char *SQLITE_APICALL sqlite3_sql(sqlite3_stmt *pStmt){
76531 Vdbe *p = (Vdbe *)pStmt;
76532 return p ? p->zSql : 0;
76533 }
76534
76535 /*
@@ -76539,11 +76539,11 @@
76539 ** freeing the returned string by passing it to sqlite3_free().
76540 **
76541 ** The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of
76542 ** expanded bound parameters.
76543 */
76544 SQLITE_API char *SQLITE_APICALL sqlite3_expanded_sql(sqlite3_stmt *pStmt){
76545 #ifdef SQLITE_OMIT_TRACE
76546 return 0;
76547 #else
76548 char *z = 0;
76549 const char *zSql = sqlite3_sql(pStmt);
@@ -76581,11 +76581,11 @@
76581
76582 /*
76583 ** This function is called from within a pre-update callback to retrieve
76584 ** a field of the row currently being updated or deleted.
76585 */
76586 SQLITE_API int SQLITE_APICALL sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
76587 PreUpdate *p = db->pPreUpdate;
76588 int rc = SQLITE_OK;
76589
76590 /* Test that this call is being made from within an SQLITE_DELETE or
76591 ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */
@@ -76636,11 +76636,11 @@
76636 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
76637 /*
76638 ** This function is called from within a pre-update callback to retrieve
76639 ** the number of columns in the row being updated, deleted or inserted.
76640 */
76641 SQLITE_API int SQLITE_APICALL sqlite3_preupdate_count(sqlite3 *db){
76642 PreUpdate *p = db->pPreUpdate;
76643 return (p ? p->keyinfo.nField : 0);
76644 }
76645 #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
76646
@@ -76654,11 +76654,11 @@
76654 ** top-level trigger etc.).
76655 **
76656 ** For the purposes of the previous paragraph, a foreign key CASCADE, SET NULL
76657 ** or SET DEFAULT action is considered a trigger.
76658 */
76659 SQLITE_API int SQLITE_APICALL sqlite3_preupdate_depth(sqlite3 *db){
76660 PreUpdate *p = db->pPreUpdate;
76661 return (p ? p->v->nFrame : 0);
76662 }
76663 #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
76664
@@ -76665,11 +76665,11 @@
76665 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
76666 /*
76667 ** This function is called from within a pre-update callback to retrieve
76668 ** a field of the row currently being updated or inserted.
76669 */
76670 SQLITE_API int SQLITE_APICALL sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
76671 PreUpdate *p = db->pPreUpdate;
76672 int rc = SQLITE_OK;
76673 Mem *pMem;
76674
76675 if( !p || p->op==SQLITE_DELETE ){
@@ -76739,11 +76739,11 @@
76739
76740 #ifdef SQLITE_ENABLE_STMT_SCANSTATUS
76741 /*
76742 ** Return status data for a single loop within query pStmt.
76743 */
76744 SQLITE_API int SQLITE_APICALL sqlite3_stmt_scanstatus(
76745 sqlite3_stmt *pStmt, /* Prepared statement being queried */
76746 int idx, /* Index of loop to report on */
76747 int iScanStatusOp, /* Which metric to return */
76748 void *pOut /* OUT: Write the answer here */
76749 ){
@@ -76798,11 +76798,11 @@
76798 }
76799
76800 /*
76801 ** Zero all counters associated with the sqlite3_stmt_scanstatus() data.
76802 */
76803 SQLITE_API void SQLITE_APICALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){
76804 Vdbe *p = (Vdbe*)pStmt;
76805 memset(p->anExec, 0, p->nOp * sizeof(i64));
76806 }
76807 #endif /* SQLITE_ENABLE_STMT_SCANSTATUS */
76808
@@ -77325,11 +77325,11 @@
77325 ** Try to convert the type of a function argument or a result column
77326 ** into a numeric representation. Use either INTEGER or REAL whichever
77327 ** is appropriate. But only do the conversion if it is possible without
77328 ** loss of information and return the revised type of the argument.
77329 */
77330 SQLITE_API int SQLITE_APICALL sqlite3_value_numeric_type(sqlite3_value *pVal){
77331 int eType = sqlite3_value_type(pVal);
77332 if( eType==SQLITE_TEXT ){
77333 Mem *pMem = (Mem*)pVal;
77334 applyNumericAffinity(pMem, 0);
77335 eType = sqlite3_value_type(pVal);
@@ -84177,11 +84177,11 @@
84177 }
84178
84179 /*
84180 ** Open a blob handle.
84181 */
84182 SQLITE_API int SQLITE_APICALL sqlite3_blob_open(
84183 sqlite3* db, /* The database connection */
84184 const char *zDb, /* The attached database containing the blob */
84185 const char *zTable, /* The table containing the blob */
84186 const char *zColumn, /* The column containing the blob */
84187 sqlite_int64 iRow, /* The row containing the glob */
@@ -84418,11 +84418,11 @@
84418
84419 /*
84420 ** Close a blob handle that was previously created using
84421 ** sqlite3_blob_open().
84422 */
84423 SQLITE_API int SQLITE_APICALL sqlite3_blob_close(sqlite3_blob *pBlob){
84424 Incrblob *p = (Incrblob *)pBlob;
84425 int rc;
84426 sqlite3 *db;
84427
84428 if( p ){
@@ -84511,28 +84511,28 @@
84511 }
84512
84513 /*
84514 ** Read data from a blob handle.
84515 */
84516 SQLITE_API int SQLITE_APICALL sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){
84517 return blobReadWrite(pBlob, z, n, iOffset, sqlite3BtreeData);
84518 }
84519
84520 /*
84521 ** Write data to a blob handle.
84522 */
84523 SQLITE_API int SQLITE_APICALL sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){
84524 return blobReadWrite(pBlob, (void *)z, n, iOffset, sqlite3BtreePutData);
84525 }
84526
84527 /*
84528 ** Query a blob handle for the size of the data.
84529 **
84530 ** The Incrblob.nByte field is fixed for the lifetime of the Incrblob
84531 ** so no mutex is required for access.
84532 */
84533 SQLITE_API int SQLITE_APICALL sqlite3_blob_bytes(sqlite3_blob *pBlob){
84534 Incrblob *p = (Incrblob *)pBlob;
84535 return (p && p->pStmt) ? p->nByte : 0;
84536 }
84537
84538 /*
@@ -84543,11 +84543,11 @@
84543 ** contain a blob or text value, then an error code is returned and the
84544 ** database handle error code and message set. If this happens, then all
84545 ** subsequent calls to sqlite3_blob_xxx() functions (except blob_close())
84546 ** immediately return SQLITE_ABORT.
84547 */
84548 SQLITE_API int SQLITE_APICALL sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){
84549 int rc;
84550 Incrblob *p = (Incrblob *)pBlob;
84551 sqlite3 *db;
84552
84553 if( p==0 ) return SQLITE_MISUSE_BKPT;
@@ -88640,11 +88640,15 @@
88640 }
88641 if( is_agg && (pNC->ncFlags & NC_AllowAgg)==0 ){
88642 sqlite3ErrorMsg(pParse, "misuse of aggregate function %.*s()", nId,zId);
88643 pNC->nErr++;
88644 is_agg = 0;
88645 }else if( no_such_func && pParse->db->init.busy==0 ){
 
 
 
 
88646 sqlite3ErrorMsg(pParse, "no such function: %.*s", nId, zId);
88647 pNC->nErr++;
88648 }else if( wrong_num_args ){
88649 sqlite3ErrorMsg(pParse,"wrong number of arguments to function %.*s()",
88650 nId, zId);
@@ -92365,10 +92369,15 @@
92365 }
92366 nFarg = pFarg ? pFarg->nExpr : 0;
92367 assert( !ExprHasProperty(pExpr, EP_IntValue) );
92368 zId = pExpr->u.zToken;
92369 pDef = sqlite3FindFunction(db, zId, nFarg, enc, 0);
 
 
 
 
 
92370 if( pDef==0 || pDef->xFinalize!=0 ){
92371 sqlite3ErrorMsg(pParse, "unknown function: %s()", zId);
92372 break;
92373 }
92374
@@ -97147,11 +97156,11 @@
97147 ** and attempts to write the column will be ignored.
97148 **
97149 ** Setting the auth function to NULL disables this hook. The default
97150 ** setting of the auth function is NULL.
97151 */
97152 SQLITE_API int SQLITE_APICALL sqlite3_set_authorizer(
97153 sqlite3 *db,
97154 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
97155 void *pArg
97156 ){
97157 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -103910,18 +103919,18 @@
103910 }
103911
103912 /*
103913 ** The sqlite3_strglob() interface.
103914 */
103915 SQLITE_API int SQLITE_APICALL sqlite3_strglob(const char *zGlobPattern, const char *zString){
103916 return patternCompare((u8*)zGlobPattern, (u8*)zString, &globInfo, '[')==0;
103917 }
103918
103919 /*
103920 ** The sqlite3_strlike() interface.
103921 */
103922 SQLITE_API int SQLITE_APICALL sqlite3_strlike(const char *zPattern, const char *zStr, unsigned int esc){
103923 return patternCompare((u8*)zPattern, (u8*)zStr, &likeInfoNorm, esc)==0;
103924 }
103925
103926 /*
103927 ** Count the number of times that the LIKE operator (or GLOB which is
@@ -104473,10 +104482,30 @@
104473 }
104474 }
104475 sqlite3_result_text(context, (char*)zIn, nIn, SQLITE_TRANSIENT);
104476 }
104477
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104478
104479 /* IMP: R-25361-16150 This function is omitted from SQLite by default. It
104480 ** is only available if the SQLITE_SOUNDEX compile-time option is used
104481 ** when SQLite is built.
104482 */
@@ -104944,17 +104973,20 @@
104944 AGGREGATE(count, 1, 0, 0, countStep, countFinalize ),
104945 AGGREGATE(group_concat, 1, 0, 0, groupConcatStep, groupConcatFinalize),
104946 AGGREGATE(group_concat, 2, 0, 0, groupConcatStep, groupConcatFinalize),
104947
104948 LIKEFUNC(glob, 2, &globInfo, SQLITE_FUNC_LIKE|SQLITE_FUNC_CASE),
104949 #ifdef SQLITE_CASE_SENSITIVE_LIKE
104950 LIKEFUNC(like, 2, &likeInfoAlt, SQLITE_FUNC_LIKE|SQLITE_FUNC_CASE),
104951 LIKEFUNC(like, 3, &likeInfoAlt, SQLITE_FUNC_LIKE|SQLITE_FUNC_CASE),
104952 #else
104953 LIKEFUNC(like, 2, &likeInfoNorm, SQLITE_FUNC_LIKE),
104954 LIKEFUNC(like, 3, &likeInfoNorm, SQLITE_FUNC_LIKE),
104955 #endif
 
 
 
104956 FUNCTION(coalesce, 1, 0, 0, 0 ),
104957 FUNCTION(coalesce, 0, 0, 0, 0 ),
104958 FUNCTION2(coalesce, -1, 0, 0, noopFunc, SQLITE_FUNC_COALESCE),
104959 };
104960 #ifndef SQLITE_OMIT_ALTERTABLE
@@ -108613,11 +108645,11 @@
108613 ** If the SQL is a query, then for each row in the query result
108614 ** the xCallback() function is called. pArg becomes the first
108615 ** argument to xCallback(). If xCallback=NULL then no callback
108616 ** is invoked, even for queries.
108617 */
108618 SQLITE_API int SQLITE_APICALL sqlite3_exec(
108619 sqlite3 *db, /* The database on which the SQL executes */
108620 const char *zSql, /* The SQL to be executed */
108621 sqlite3_callback xCallback, /* Invoke this callback routine */
108622 void *pArg, /* First argument to xCallback() */
108623 char **pzErrMsg /* Write error messages here */
@@ -109875,11 +109907,11 @@
109875 db->aExtension = aHandle;
109876
109877 db->aExtension[db->nExtension++] = handle;
109878 return SQLITE_OK;
109879 }
109880 SQLITE_API int SQLITE_APICALL sqlite3_load_extension(
109881 sqlite3 *db, /* Load the extension into this database connection */
109882 const char *zFile, /* Name of the shared library containing extension */
109883 const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */
109884 char **pzErrMsg /* Put error message here if not 0 */
109885 ){
@@ -109906,11 +109938,11 @@
109906
109907 /*
109908 ** Enable or disable extension loading. Extension loading is disabled by
109909 ** default so as not to open security holes in older applications.
109910 */
109911 SQLITE_API int SQLITE_APICALL sqlite3_enable_load_extension(sqlite3 *db, int onoff){
109912 sqlite3_mutex_enter(db->mutex);
109913 if( onoff ){
109914 db->flags |= SQLITE_LoadExtension|SQLITE_LoadExtFunc;
109915 }else{
109916 db->flags &= ~(SQLITE_LoadExtension|SQLITE_LoadExtFunc);
@@ -109963,11 +109995,11 @@
109963
109964 /*
109965 ** Register a statically linked extension that is automatically
109966 ** loaded by every new database connection.
109967 */
109968 SQLITE_API int SQLITE_APICALL sqlite3_auto_extension(
109969 void (*xInit)(void)
109970 ){
109971 int rc = SQLITE_OK;
109972 #ifndef SQLITE_OMIT_AUTOINIT
109973 rc = sqlite3_initialize();
@@ -110010,11 +110042,11 @@
110010 ** routine is a no-op.
110011 **
110012 ** Return 1 if xInit was found on the list and removed. Return 0 if xInit
110013 ** was not on the list.
110014 */
110015 SQLITE_API int SQLITE_APICALL sqlite3_cancel_auto_extension(
110016 void (*xInit)(void)
110017 ){
110018 #if SQLITE_THREADSAFE
110019 sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
110020 #endif
@@ -110035,11 +110067,11 @@
110035 }
110036
110037 /*
110038 ** Reset the automatic extension loading mechanism.
110039 */
110040 SQLITE_API void SQLITE_APICALL sqlite3_reset_auto_extension(void){
110041 #ifndef SQLITE_OMIT_AUTOINIT
110042 if( sqlite3_initialize()==SQLITE_OK )
110043 #endif
110044 {
110045 #if SQLITE_THREADSAFE
@@ -113296,11 +113328,11 @@
113296 ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
113297 ** sqlite3_step(). In the new version, the original SQL text is retained
113298 ** and the statement is automatically recompiled if an schema change
113299 ** occurs.
113300 */
113301 SQLITE_API int SQLITE_APICALL sqlite3_prepare(
113302 sqlite3 *db, /* Database handle. */
113303 const char *zSql, /* UTF-8 encoded SQL statement. */
113304 int nBytes, /* Length of zSql in bytes. */
113305 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113306 const char **pzTail /* OUT: End of parsed string */
@@ -113308,11 +113340,11 @@
113308 int rc;
113309 rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,0,ppStmt,pzTail);
113310 assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
113311 return rc;
113312 }
113313 SQLITE_API int SQLITE_APICALL sqlite3_prepare_v2(
113314 sqlite3 *db, /* Database handle. */
113315 const char *zSql, /* UTF-8 encoded SQL statement. */
113316 int nBytes, /* Length of zSql in bytes. */
113317 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113318 const char **pzTail /* OUT: End of parsed string */
@@ -113384,11 +113416,11 @@
113384 ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
113385 ** sqlite3_step(). In the new version, the original SQL text is retained
113386 ** and the statement is automatically recompiled if an schema change
113387 ** occurs.
113388 */
113389 SQLITE_API int SQLITE_APICALL sqlite3_prepare16(
113390 sqlite3 *db, /* Database handle. */
113391 const void *zSql, /* UTF-16 encoded SQL statement. */
113392 int nBytes, /* Length of zSql in bytes. */
113393 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113394 const void **pzTail /* OUT: End of parsed string */
@@ -113396,11 +113428,11 @@
113396 int rc;
113397 rc = sqlite3Prepare16(db,zSql,nBytes,0,ppStmt,pzTail);
113398 assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
113399 return rc;
113400 }
113401 SQLITE_API int SQLITE_APICALL sqlite3_prepare16_v2(
113402 sqlite3 *db, /* Database handle. */
113403 const void *zSql, /* UTF-16 encoded SQL statement. */
113404 int nBytes, /* Length of zSql in bytes. */
113405 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113406 const void **pzTail /* OUT: End of parsed string */
@@ -119239,11 +119271,11 @@
119239 ** The result that is written to ***pazResult is held in memory obtained
119240 ** from malloc(). But the caller cannot free this memory directly.
119241 ** Instead, the entire table should be passed to sqlite3_free_table() when
119242 ** the calling procedure is finished using it.
119243 */
119244 SQLITE_API int SQLITE_APICALL sqlite3_get_table(
119245 sqlite3 *db, /* The database on which the SQL executes */
119246 const char *zSql, /* The SQL to be executed */
119247 char ***pazResult, /* Write the result table here */
119248 int *pnRow, /* Write the number of rows in the result here */
119249 int *pnColumn, /* Write the number of columns of result here */
@@ -119308,11 +119340,11 @@
119308 }
119309
119310 /*
119311 ** This routine frees the space the sqlite3_get_table() malloced.
119312 */
119313 SQLITE_API void SQLITE_APICALL sqlite3_free_table(
119314 char **azResult /* Result returned from sqlite3_get_table() */
119315 ){
119316 if( azResult ){
119317 int i, n;
119318 azResult--;
@@ -121718,11 +121750,11 @@
121718
121719
121720 /*
121721 ** External API function used to create a new virtual-table module.
121722 */
121723 SQLITE_API int SQLITE_APICALL sqlite3_create_module(
121724 sqlite3 *db, /* Database in which module is registered */
121725 const char *zName, /* Name assigned to this module */
121726 const sqlite3_module *pModule, /* The definition of the module */
121727 void *pAux /* Context pointer for xCreate/xConnect */
121728 ){
@@ -121733,11 +121765,11 @@
121733 }
121734
121735 /*
121736 ** External API function used to create a new virtual-table module.
121737 */
121738 SQLITE_API int SQLITE_APICALL sqlite3_create_module_v2(
121739 sqlite3 *db, /* Database in which module is registered */
121740 const char *zName, /* Name assigned to this module */
121741 const sqlite3_module *pModule, /* The definition of the module */
121742 void *pAux, /* Context pointer for xCreate/xConnect */
121743 void (*xDestroy)(void *) /* Module destructor function */
@@ -122357,11 +122389,11 @@
122357 /*
122358 ** This function is used to set the schema of a virtual table. It is only
122359 ** valid to call this function from within the xCreate() or xConnect() of a
122360 ** virtual table module.
122361 */
122362 SQLITE_API int SQLITE_APICALL sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
122363 VtabCtx *pCtx;
122364 Parse *pParse;
122365 int rc = SQLITE_OK;
122366 Table *pTab;
122367 char *zErr = 0;
@@ -122587,11 +122619,14 @@
122587 if( rc==SQLITE_OK ){
122588 rc = pModule->xBegin(pVTab->pVtab);
122589 if( rc==SQLITE_OK ){
122590 int iSvpt = db->nStatement + db->nSavepoint;
122591 addToVTrans(db, pVTab);
122592 if( iSvpt ) rc = sqlite3VtabSavepoint(db, SAVEPOINT_BEGIN, iSvpt-1);
 
 
 
122593 }
122594 }
122595 }
122596 return rc;
122597 }
@@ -122811,11 +122846,11 @@
122811 ** table update operation currently in progress.
122812 **
122813 ** The results of this routine are undefined unless it is called from
122814 ** within an xUpdate method.
122815 */
122816 SQLITE_API int SQLITE_APICALL sqlite3_vtab_on_conflict(sqlite3 *db){
122817 static const unsigned char aMap[] = {
122818 SQLITE_ROLLBACK, SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_REPLACE
122819 };
122820 #ifdef SQLITE_ENABLE_API_ARMOR
122821 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -130601,11 +130636,11 @@
130601 }else{
130602 pWInfo->nOBSat = pFrom->isOrdered;
130603 pWInfo->revMask = pFrom->revLoop;
130604 if( pWInfo->nOBSat<=0 ){
130605 pWInfo->nOBSat = 0;
130606 if( nLoop>0 ){
130607 Bitmask m = 0;
130608 int rc = wherePathSatisfiesOrderBy(pWInfo, pWInfo->pOrderBy, pFrom,
130609 WHERE_ORDERBY_LIMIT, nLoop-1, pFrom->aLoop[nLoop-1], &m);
130610 if( rc==pWInfo->pOrderBy->nExpr ){
130611 pWInfo->bOrderedInnerLoop = 1;
@@ -136136,11 +136171,11 @@
136136 **
136137 ** If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed
136138 ** to recognize the end of a trigger can be omitted. All we have to do
136139 ** is look for a semicolon that is not part of an string or comment.
136140 */
136141 SQLITE_API int SQLITE_APICALL sqlite3_complete(const char *zSql){
136142 u8 state = 0; /* Current state, using numbers defined in header comment */
136143 u8 token; /* Value of the next token */
136144
136145 #ifndef SQLITE_OMIT_TRIGGER
136146 /* A complex statement machine used to detect the end of a CREATE TRIGGER
@@ -136301,11 +136336,11 @@
136301 /*
136302 ** This routine is the same as the sqlite3_complete() routine described
136303 ** above, except that the parameter is required to be UTF-16 encoded, not
136304 ** UTF-8.
136305 */
136306 SQLITE_API int SQLITE_APICALL sqlite3_complete16(const void *zSql){
136307 sqlite3_value *pVal;
136308 char const *zSql8;
136309 int rc;
136310
136311 #ifndef SQLITE_OMIT_AUTOINIT
@@ -136461,28 +136496,28 @@
136461 #endif
136462
136463 /* IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns
136464 ** a pointer to the to the sqlite3_version[] string constant.
136465 */
136466 SQLITE_API const char *SQLITE_APICALL sqlite3_libversion(void){ return sqlite3_version; }
136467
136468 /* IMPLEMENTATION-OF: R-63124-39300 The sqlite3_sourceid() function returns a
136469 ** pointer to a string constant whose value is the same as the
136470 ** SQLITE_SOURCE_ID C preprocessor macro.
136471 */
136472 SQLITE_API const char *SQLITE_APICALL sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
136473
136474 /* IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function
136475 ** returns an integer equal to SQLITE_VERSION_NUMBER.
136476 */
136477 SQLITE_API int SQLITE_APICALL sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; }
136478
136479 /* IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns
136480 ** zero if and only if SQLite was compiled with mutexing code omitted due to
136481 ** the SQLITE_THREADSAFE compile-time option being set to 0.
136482 */
136483 SQLITE_API int SQLITE_APICALL sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; }
136484
136485 /*
136486 ** When compiling the test fixture or with debugging enabled (on Win32),
136487 ** this variable being set to non-zero will cause OSTRACE macros to emit
136488 ** extra diagnostic information.
@@ -136551,11 +136586,11 @@
136551 ** call by X completes.
136552 **
136553 ** * Recursive calls to this routine from thread X return immediately
136554 ** without blocking.
136555 */
136556 SQLITE_API int SQLITE_APICALL sqlite3_initialize(void){
136557 MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */
136558 int rc; /* Result code */
136559 #ifdef SQLITE_EXTRA_INIT
136560 int bRunExtraInit = 0; /* Extra initialization needed */
136561 #endif
@@ -136717,11 +136752,11 @@
136717 ** while any part of SQLite is otherwise in use in any thread. This
136718 ** routine is not threadsafe. But it is safe to invoke this routine
136719 ** on when SQLite is already shut down. If SQLite is already shut down
136720 ** when this routine is invoked, then this routine is a harmless no-op.
136721 */
136722 SQLITE_API int SQLITE_APICALL sqlite3_shutdown(void){
136723 #ifdef SQLITE_OMIT_WSD
136724 int rc = sqlite3_wsd_init(4096, 24);
136725 if( rc!=SQLITE_OK ){
136726 return rc;
136727 }
@@ -137136,11 +137171,11 @@
137136 }
137137
137138 /*
137139 ** Return the mutex associated with a database connection.
137140 */
137141 SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_db_mutex(sqlite3 *db){
137142 #ifdef SQLITE_ENABLE_API_ARMOR
137143 if( !sqlite3SafetyCheckOk(db) ){
137144 (void)SQLITE_MISUSE_BKPT;
137145 return 0;
137146 }
@@ -137150,11 +137185,11 @@
137150
137151 /*
137152 ** Free up as much memory as we can from the given database
137153 ** connection.
137154 */
137155 SQLITE_API int SQLITE_APICALL sqlite3_db_release_memory(sqlite3 *db){
137156 int i;
137157
137158 #ifdef SQLITE_ENABLE_API_ARMOR
137159 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
137160 #endif
@@ -137174,11 +137209,11 @@
137174
137175 /*
137176 ** Flush any dirty pages in the pager-cache for any attached database
137177 ** to disk.
137178 */
137179 SQLITE_API int SQLITE_APICALL sqlite3_db_cacheflush(sqlite3 *db){
137180 int i;
137181 int rc = SQLITE_OK;
137182 int bSeenBusy = 0;
137183
137184 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -137324,11 +137359,11 @@
137324 }
137325
137326 /*
137327 ** Return the ROWID of the most recent insert
137328 */
137329 SQLITE_API sqlite_int64 SQLITE_APICALL sqlite3_last_insert_rowid(sqlite3 *db){
137330 #ifdef SQLITE_ENABLE_API_ARMOR
137331 if( !sqlite3SafetyCheckOk(db) ){
137332 (void)SQLITE_MISUSE_BKPT;
137333 return 0;
137334 }
@@ -137337,11 +137372,11 @@
137337 }
137338
137339 /*
137340 ** Return the number of changes in the most recent call to sqlite3_exec().
137341 */
137342 SQLITE_API int SQLITE_APICALL sqlite3_changes(sqlite3 *db){
137343 #ifdef SQLITE_ENABLE_API_ARMOR
137344 if( !sqlite3SafetyCheckOk(db) ){
137345 (void)SQLITE_MISUSE_BKPT;
137346 return 0;
137347 }
@@ -137350,11 +137385,11 @@
137350 }
137351
137352 /*
137353 ** Return the number of changes since the database handle was opened.
137354 */
137355 SQLITE_API int SQLITE_APICALL sqlite3_total_changes(sqlite3 *db){
137356 #ifdef SQLITE_ENABLE_API_ARMOR
137357 if( !sqlite3SafetyCheckOk(db) ){
137358 (void)SQLITE_MISUSE_BKPT;
137359 return 0;
137360 }
@@ -137501,12 +137536,12 @@
137501 ** statements or unfinished sqlite3_backups. The sqlite3_close_v2()
137502 ** version forces the connection to become a zombie if there are
137503 ** unclosed resources, and arranges for deallocation when the last
137504 ** prepare statement or sqlite3_backup closes.
137505 */
137506 SQLITE_API int SQLITE_APICALL sqlite3_close(sqlite3 *db){ return sqlite3Close(db,0); }
137507 SQLITE_API int SQLITE_APICALL sqlite3_close_v2(sqlite3 *db){ return sqlite3Close(db,1); }
137508
137509
137510 /*
137511 ** Close the mutex on database connection db.
137512 **
@@ -137909,11 +137944,11 @@
137909
137910 /*
137911 ** This routine sets the busy callback for an Sqlite database to the
137912 ** given callback function with the given argument.
137913 */
137914 SQLITE_API int SQLITE_APICALL sqlite3_busy_handler(
137915 sqlite3 *db,
137916 int (*xBusy)(void*,int),
137917 void *pArg
137918 ){
137919 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -137932,11 +137967,11 @@
137932 /*
137933 ** This routine sets the progress callback for an Sqlite database to the
137934 ** given callback function with the given argument. The progress callback will
137935 ** be invoked every nOps opcodes.
137936 */
137937 SQLITE_API void SQLITE_APICALL sqlite3_progress_handler(
137938 sqlite3 *db,
137939 int nOps,
137940 int (*xProgress)(void*),
137941 void *pArg
137942 ){
@@ -137963,11 +137998,11 @@
137963
137964 /*
137965 ** This routine installs a default busy handler that waits for the
137966 ** specified number of milliseconds before returning 0.
137967 */
137968 SQLITE_API int SQLITE_APICALL sqlite3_busy_timeout(sqlite3 *db, int ms){
137969 #ifdef SQLITE_ENABLE_API_ARMOR
137970 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
137971 #endif
137972 if( ms>0 ){
137973 sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db);
@@ -137979,11 +138014,11 @@
137979 }
137980
137981 /*
137982 ** Cause any pending operation to stop at its earliest opportunity.
137983 */
137984 SQLITE_API void SQLITE_APICALL sqlite3_interrupt(sqlite3 *db){
137985 #ifdef SQLITE_ENABLE_API_ARMOR
137986 if( !sqlite3SafetyCheckOk(db) ){
137987 (void)SQLITE_MISUSE_BKPT;
137988 return;
137989 }
@@ -138095,11 +138130,11 @@
138095 }
138096
138097 /*
138098 ** Create new user functions.
138099 */
138100 SQLITE_API int SQLITE_APICALL sqlite3_create_function(
138101 sqlite3 *db,
138102 const char *zFunc,
138103 int nArg,
138104 int enc,
138105 void *p,
@@ -138109,11 +138144,11 @@
138109 ){
138110 return sqlite3_create_function_v2(db, zFunc, nArg, enc, p, xSFunc, xStep,
138111 xFinal, 0);
138112 }
138113
138114 SQLITE_API int SQLITE_APICALL sqlite3_create_function_v2(
138115 sqlite3 *db,
138116 const char *zFunc,
138117 int nArg,
138118 int enc,
138119 void *p,
@@ -138152,11 +138187,11 @@
138152 sqlite3_mutex_leave(db->mutex);
138153 return rc;
138154 }
138155
138156 #ifndef SQLITE_OMIT_UTF16
138157 SQLITE_API int SQLITE_APICALL sqlite3_create_function16(
138158 sqlite3 *db,
138159 const void *zFunctionName,
138160 int nArg,
138161 int eTextRep,
138162 void *p,
@@ -138192,11 +138227,11 @@
138192 ** When virtual tables intend to provide an overloaded function, they
138193 ** should call this routine to make sure the global function exists.
138194 ** A global function must exist in order for name resolution to work
138195 ** properly.
138196 */
138197 SQLITE_API int SQLITE_APICALL sqlite3_overload_function(
138198 sqlite3 *db,
138199 const char *zName,
138200 int nArg
138201 ){
138202 int rc = SQLITE_OK;
@@ -138224,11 +138259,11 @@
138224 ** A NULL trace function means that no tracing is executes. A non-NULL
138225 ** trace is a pointer to a function that is invoked at the start of each
138226 ** SQL statement.
138227 */
138228 #ifndef SQLITE_OMIT_DEPRECATED
138229 SQLITE_API void *SQLITE_APICALL sqlite3_trace(sqlite3 *db, void(*xTrace)(void*,const char*), void *pArg){
138230 void *pOld;
138231
138232 #ifdef SQLITE_ENABLE_API_ARMOR
138233 if( !sqlite3SafetyCheckOk(db) ){
138234 (void)SQLITE_MISUSE_BKPT;
@@ -138245,11 +138280,11 @@
138245 }
138246 #endif /* SQLITE_OMIT_DEPRECATED */
138247
138248 /* Register a trace callback using the version-2 interface.
138249 */
138250 SQLITE_API int SQLITE_APICALL sqlite3_trace_v2(
138251 sqlite3 *db, /* Trace this connection */
138252 unsigned mTrace, /* Mask of events to be traced */
138253 int(*xTrace)(unsigned,void*,void*,void*), /* Callback to invoke */
138254 void *pArg /* Context */
138255 ){
@@ -138273,11 +138308,11 @@
138273 **
138274 ** A NULL profile function means that no profiling is executes. A non-NULL
138275 ** profile is a pointer to a function that is invoked at the conclusion of
138276 ** each SQL statement that is run.
138277 */
138278 SQLITE_API void *SQLITE_APICALL sqlite3_profile(
138279 sqlite3 *db,
138280 void (*xProfile)(void*,const char*,sqlite_uint64),
138281 void *pArg
138282 ){
138283 void *pOld;
@@ -138301,11 +138336,11 @@
138301 /*
138302 ** Register a function to be invoked when a transaction commits.
138303 ** If the invoked function returns non-zero, then the commit becomes a
138304 ** rollback.
138305 */
138306 SQLITE_API void *SQLITE_APICALL sqlite3_commit_hook(
138307 sqlite3 *db, /* Attach the hook to this database */
138308 int (*xCallback)(void*), /* Function to invoke on each commit */
138309 void *pArg /* Argument to the function */
138310 ){
138311 void *pOld;
@@ -138326,11 +138361,11 @@
138326
138327 /*
138328 ** Register a callback to be invoked each time a row is updated,
138329 ** inserted or deleted using this database connection.
138330 */
138331 SQLITE_API void *SQLITE_APICALL sqlite3_update_hook(
138332 sqlite3 *db, /* Attach the hook to this database */
138333 void (*xCallback)(void*,int,char const *,char const *,sqlite_int64),
138334 void *pArg /* Argument to the function */
138335 ){
138336 void *pRet;
@@ -138351,11 +138386,11 @@
138351
138352 /*
138353 ** Register a callback to be invoked each time a transaction is rolled
138354 ** back by this database connection.
138355 */
138356 SQLITE_API void *SQLITE_APICALL sqlite3_rollback_hook(
138357 sqlite3 *db, /* Attach the hook to this database */
138358 void (*xCallback)(void*), /* Callback function */
138359 void *pArg /* Argument to the function */
138360 ){
138361 void *pRet;
@@ -138377,11 +138412,11 @@
138377 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
138378 /*
138379 ** Register a callback to be invoked each time a row is updated,
138380 ** inserted or deleted using this database connection.
138381 */
138382 SQLITE_API void *SQLITE_APICALL sqlite3_preupdate_hook(
138383 sqlite3 *db, /* Attach the hook to this database */
138384 void(*xCallback)( /* Callback function */
138385 void*,sqlite3*,int,char const*,char const*,sqlite3_int64,sqlite3_int64),
138386 void *pArg /* First callback argument */
138387 ){
@@ -138426,11 +138461,11 @@
138426 ** The callback registered by this function replaces any existing callback
138427 ** registered using sqlite3_wal_hook(). Likewise, registering a callback
138428 ** using sqlite3_wal_hook() disables the automatic checkpoint mechanism
138429 ** configured by this function.
138430 */
138431 SQLITE_API int SQLITE_APICALL sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){
138432 #ifdef SQLITE_OMIT_WAL
138433 UNUSED_PARAMETER(db);
138434 UNUSED_PARAMETER(nFrame);
138435 #else
138436 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -138447,11 +138482,11 @@
138447
138448 /*
138449 ** Register a callback to be invoked each time a transaction is written
138450 ** into the write-ahead-log by this database connection.
138451 */
138452 SQLITE_API void *SQLITE_APICALL sqlite3_wal_hook(
138453 sqlite3 *db, /* Attach the hook to this db handle */
138454 int(*xCallback)(void *, sqlite3*, const char*, int),
138455 void *pArg /* First argument passed to xCallback() */
138456 ){
138457 #ifndef SQLITE_OMIT_WAL
@@ -138474,11 +138509,11 @@
138474 }
138475
138476 /*
138477 ** Checkpoint database zDb.
138478 */
138479 SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint_v2(
138480 sqlite3 *db, /* Database handle */
138481 const char *zDb, /* Name of attached database (or NULL) */
138482 int eMode, /* SQLITE_CHECKPOINT_* value */
138483 int *pnLog, /* OUT: Size of WAL log in frames */
138484 int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -138529,11 +138564,11 @@
138529 /*
138530 ** Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points
138531 ** to contains a zero-length string, all attached databases are
138532 ** checkpointed.
138533 */
138534 SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){
138535 /* EVIDENCE-OF: R-41613-20553 The sqlite3_wal_checkpoint(D,X) is equivalent to
138536 ** sqlite3_wal_checkpoint_v2(D,X,SQLITE_CHECKPOINT_PASSIVE,0,0). */
138537 return sqlite3_wal_checkpoint_v2(db,zDb,SQLITE_CHECKPOINT_PASSIVE,0,0);
138538 }
138539
@@ -138620,11 +138655,11 @@
138620
138621 /*
138622 ** Return UTF-8 encoded English language explanation of the most recent
138623 ** error.
138624 */
138625 SQLITE_API const char *SQLITE_APICALL sqlite3_errmsg(sqlite3 *db){
138626 const char *z;
138627 if( !db ){
138628 return sqlite3ErrStr(SQLITE_NOMEM_BKPT);
138629 }
138630 if( !sqlite3SafetyCheckSickOrOk(db) ){
@@ -138648,11 +138683,11 @@
138648 #ifndef SQLITE_OMIT_UTF16
138649 /*
138650 ** Return UTF-16 encoded English language explanation of the most recent
138651 ** error.
138652 */
138653 SQLITE_API const void *SQLITE_APICALL sqlite3_errmsg16(sqlite3 *db){
138654 static const u16 outOfMem[] = {
138655 'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0
138656 };
138657 static const u16 misuse[] = {
138658 'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ',
@@ -138693,38 +138728,38 @@
138693
138694 /*
138695 ** Return the most recent error code generated by an SQLite routine. If NULL is
138696 ** passed to this function, we assume a malloc() failed during sqlite3_open().
138697 */
138698 SQLITE_API int SQLITE_APICALL sqlite3_errcode(sqlite3 *db){
138699 if( db && !sqlite3SafetyCheckSickOrOk(db) ){
138700 return SQLITE_MISUSE_BKPT;
138701 }
138702 if( !db || db->mallocFailed ){
138703 return SQLITE_NOMEM_BKPT;
138704 }
138705 return db->errCode & db->errMask;
138706 }
138707 SQLITE_API int SQLITE_APICALL sqlite3_extended_errcode(sqlite3 *db){
138708 if( db && !sqlite3SafetyCheckSickOrOk(db) ){
138709 return SQLITE_MISUSE_BKPT;
138710 }
138711 if( !db || db->mallocFailed ){
138712 return SQLITE_NOMEM_BKPT;
138713 }
138714 return db->errCode;
138715 }
138716 SQLITE_API int SQLITE_APICALL sqlite3_system_errno(sqlite3 *db){
138717 return db ? db->iSysErrno : 0;
138718 }
138719
138720 /*
138721 ** Return a string that describes the kind of error specified in the
138722 ** argument. For now, this simply calls the internal sqlite3ErrStr()
138723 ** function.
138724 */
138725 SQLITE_API const char *SQLITE_APICALL sqlite3_errstr(int rc){
138726 return sqlite3ErrStr(rc);
138727 }
138728
138729 /*
138730 ** Create a new collating function for database "db". The name is zName
@@ -138868,11 +138903,11 @@
138868 **
138869 ** A new lower limit does not shrink existing constructs.
138870 ** It merely prevents new constructs that exceed the limit
138871 ** from forming.
138872 */
138873 SQLITE_API int SQLITE_APICALL sqlite3_limit(sqlite3 *db, int limitId, int newLimit){
138874 int oldLimit;
138875
138876 #ifdef SQLITE_ENABLE_API_ARMOR
138877 if( !sqlite3SafetyCheckOk(db) ){
138878 (void)SQLITE_MISUSE_BKPT;
@@ -139492,18 +139527,18 @@
139492 }
139493
139494 /*
139495 ** Open a new database handle.
139496 */
139497 SQLITE_API int SQLITE_APICALL sqlite3_open(
139498 const char *zFilename,
139499 sqlite3 **ppDb
139500 ){
139501 return openDatabase(zFilename, ppDb,
139502 SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0);
139503 }
139504 SQLITE_API int SQLITE_APICALL sqlite3_open_v2(
139505 const char *filename, /* Database filename (UTF-8) */
139506 sqlite3 **ppDb, /* OUT: SQLite db handle */
139507 int flags, /* Flags */
139508 const char *zVfs /* Name of VFS module to use */
139509 ){
@@ -139512,11 +139547,11 @@
139512
139513 #ifndef SQLITE_OMIT_UTF16
139514 /*
139515 ** Open a new database handle.
139516 */
139517 SQLITE_API int SQLITE_APICALL sqlite3_open16(
139518 const void *zFilename,
139519 sqlite3 **ppDb
139520 ){
139521 char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */
139522 sqlite3_value *pVal;
@@ -139551,11 +139586,11 @@
139551 #endif /* SQLITE_OMIT_UTF16 */
139552
139553 /*
139554 ** Register a new collation sequence with the database handle db.
139555 */
139556 SQLITE_API int SQLITE_APICALL sqlite3_create_collation(
139557 sqlite3* db,
139558 const char *zName,
139559 int enc,
139560 void* pCtx,
139561 int(*xCompare)(void*,int,const void*,int,const void*)
@@ -139564,11 +139599,11 @@
139564 }
139565
139566 /*
139567 ** Register a new collation sequence with the database handle db.
139568 */
139569 SQLITE_API int SQLITE_APICALL sqlite3_create_collation_v2(
139570 sqlite3* db,
139571 const char *zName,
139572 int enc,
139573 void* pCtx,
139574 int(*xCompare)(void*,int,const void*,int,const void*),
@@ -139589,11 +139624,11 @@
139589
139590 #ifndef SQLITE_OMIT_UTF16
139591 /*
139592 ** Register a new collation sequence with the database handle db.
139593 */
139594 SQLITE_API int SQLITE_APICALL sqlite3_create_collation16(
139595 sqlite3* db,
139596 const void *zName,
139597 int enc,
139598 void* pCtx,
139599 int(*xCompare)(void*,int,const void*,int,const void*)
@@ -139619,11 +139654,11 @@
139619
139620 /*
139621 ** Register a collation sequence factory callback with the database handle
139622 ** db. Replace any previously installed collation sequence factory.
139623 */
139624 SQLITE_API int SQLITE_APICALL sqlite3_collation_needed(
139625 sqlite3 *db,
139626 void *pCollNeededArg,
139627 void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*)
139628 ){
139629 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -139640,11 +139675,11 @@
139640 #ifndef SQLITE_OMIT_UTF16
139641 /*
139642 ** Register a collation sequence factory callback with the database handle
139643 ** db. Replace any previously installed collation sequence factory.
139644 */
139645 SQLITE_API int SQLITE_APICALL sqlite3_collation_needed16(
139646 sqlite3 *db,
139647 void *pCollNeededArg,
139648 void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*)
139649 ){
139650 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -139662,11 +139697,11 @@
139662 #ifndef SQLITE_OMIT_DEPRECATED
139663 /*
139664 ** This function is now an anachronism. It used to be used to recover from a
139665 ** malloc() failure, but SQLite now does this automatically.
139666 */
139667 SQLITE_API int SQLITE_APICALL sqlite3_global_recover(void){
139668 return SQLITE_OK;
139669 }
139670 #endif
139671
139672 /*
@@ -139673,11 +139708,11 @@
139673 ** Test to see whether or not the database connection is in autocommit
139674 ** mode. Return TRUE if it is and FALSE if not. Autocommit mode is on
139675 ** by default. Autocommit is disabled by a BEGIN statement and reenabled
139676 ** by the next COMMIT or ROLLBACK.
139677 */
139678 SQLITE_API int SQLITE_APICALL sqlite3_get_autocommit(sqlite3 *db){
139679 #ifdef SQLITE_ENABLE_API_ARMOR
139680 if( !sqlite3SafetyCheckOk(db) ){
139681 (void)SQLITE_MISUSE_BKPT;
139682 return 0;
139683 }
@@ -139730,19 +139765,19 @@
139730 ** data for this thread has been deallocated.
139731 **
139732 ** SQLite no longer uses thread-specific data so this routine is now a
139733 ** no-op. It is retained for historical compatibility.
139734 */
139735 SQLITE_API void SQLITE_APICALL sqlite3_thread_cleanup(void){
139736 }
139737 #endif
139738
139739 /*
139740 ** Return meta information about a specific column of a database table.
139741 ** See comment in sqlite3.h (sqlite.h.in) for details.
139742 */
139743 SQLITE_API int SQLITE_APICALL sqlite3_table_column_metadata(
139744 sqlite3 *db, /* Connection handle */
139745 const char *zDbName, /* Database name or NULL */
139746 const char *zTableName, /* Table name */
139747 const char *zColumnName, /* Column name */
139748 char const **pzDataType, /* OUTPUT: Declared data type */
@@ -139856,11 +139891,11 @@
139856 }
139857
139858 /*
139859 ** Sleep for a little while. Return the amount of time slept.
139860 */
139861 SQLITE_API int SQLITE_APICALL sqlite3_sleep(int ms){
139862 sqlite3_vfs *pVfs;
139863 int rc;
139864 pVfs = sqlite3_vfs_find(0);
139865 if( pVfs==0 ) return 0;
139866
@@ -139872,11 +139907,11 @@
139872 }
139873
139874 /*
139875 ** Enable or disable the extended result codes.
139876 */
139877 SQLITE_API int SQLITE_APICALL sqlite3_extended_result_codes(sqlite3 *db, int onoff){
139878 #ifdef SQLITE_ENABLE_API_ARMOR
139879 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
139880 #endif
139881 sqlite3_mutex_enter(db->mutex);
139882 db->errMask = onoff ? 0xffffffff : 0xff;
@@ -139885,11 +139920,11 @@
139885 }
139886
139887 /*
139888 ** Invoke the xFileControl method on a particular database.
139889 */
139890 SQLITE_API int SQLITE_APICALL sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
139891 int rc = SQLITE_ERROR;
139892 Btree *pBtree;
139893
139894 #ifdef SQLITE_ENABLE_API_ARMOR
139895 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -140270,11 +140305,11 @@
140270 ** method of a VFS implementation. The zParam argument is the name of the
140271 ** query parameter we seek. This routine returns the value of the zParam
140272 ** parameter if it exists. If the parameter does not exist, this routine
140273 ** returns a NULL pointer.
140274 */
140275 SQLITE_API const char *SQLITE_APICALL sqlite3_uri_parameter(const char *zFilename, const char *zParam){
140276 if( zFilename==0 || zParam==0 ) return 0;
140277 zFilename += sqlite3Strlen30(zFilename) + 1;
140278 while( zFilename[0] ){
140279 int x = strcmp(zFilename, zParam);
140280 zFilename += sqlite3Strlen30(zFilename) + 1;
@@ -140285,20 +140320,20 @@
140285 }
140286
140287 /*
140288 ** Return a boolean value for a query parameter.
140289 */
140290 SQLITE_API int SQLITE_APICALL sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){
140291 const char *z = sqlite3_uri_parameter(zFilename, zParam);
140292 bDflt = bDflt!=0;
140293 return z ? sqlite3GetBoolean(z, bDflt) : bDflt;
140294 }
140295
140296 /*
140297 ** Return a 64-bit integer value for a query parameter.
140298 */
140299 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_uri_int64(
140300 const char *zFilename, /* Filename as passed to xOpen */
140301 const char *zParam, /* URI parameter sought */
140302 sqlite3_int64 bDflt /* return if parameter is missing */
140303 ){
140304 const char *z = sqlite3_uri_parameter(zFilename, zParam);
@@ -140326,11 +140361,11 @@
140326
140327 /*
140328 ** Return the filename of the database associated with a database
140329 ** connection.
140330 */
140331 SQLITE_API const char *SQLITE_APICALL sqlite3_db_filename(sqlite3 *db, const char *zDbName){
140332 Btree *pBt;
140333 #ifdef SQLITE_ENABLE_API_ARMOR
140334 if( !sqlite3SafetyCheckOk(db) ){
140335 (void)SQLITE_MISUSE_BKPT;
140336 return 0;
@@ -140342,11 +140377,11 @@
140342
140343 /*
140344 ** Return 1 if database is read-only or 0 if read/write. Return -1 if
140345 ** no such database exists.
140346 */
140347 SQLITE_API int SQLITE_APICALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName){
140348 Btree *pBt;
140349 #ifdef SQLITE_ENABLE_API_ARMOR
140350 if( !sqlite3SafetyCheckOk(db) ){
140351 (void)SQLITE_MISUSE_BKPT;
140352 return -1;
@@ -140359,11 +140394,11 @@
140359 #ifdef SQLITE_ENABLE_SNAPSHOT
140360 /*
140361 ** Obtain a snapshot handle for the snapshot of database zDb currently
140362 ** being read by handle db.
140363 */
140364 SQLITE_API int SQLITE_APICALL sqlite3_snapshot_get(
140365 sqlite3 *db,
140366 const char *zDb,
140367 sqlite3_snapshot **ppSnapshot
140368 ){
140369 int rc = SQLITE_ERROR;
@@ -140394,11 +140429,11 @@
140394 }
140395
140396 /*
140397 ** Open a read-transaction on the snapshot idendified by pSnapshot.
140398 */
140399 SQLITE_API int SQLITE_APICALL sqlite3_snapshot_open(
140400 sqlite3 *db,
140401 const char *zDb,
140402 sqlite3_snapshot *pSnapshot
140403 ){
140404 int rc = SQLITE_ERROR;
@@ -140431,11 +140466,11 @@
140431 }
140432
140433 /*
140434 ** Free a snapshot handle obtained from sqlite3_snapshot_get().
140435 */
140436 SQLITE_API void SQLITE_APICALL sqlite3_snapshot_free(sqlite3_snapshot *pSnapshot){
140437 sqlite3_free(pSnapshot);
140438 }
140439 #endif /* SQLITE_ENABLE_SNAPSHOT */
140440
140441 /************** End of main.c ************************************************/
@@ -140585,11 +140620,11 @@
140585 **
140586 ** Each call to this routine overrides any prior callbacks registered
140587 ** on the same "db". If xNotify==0 then any prior callbacks are immediately
140588 ** cancelled.
140589 */
140590 SQLITE_API int SQLITE_APICALL sqlite3_unlock_notify(
140591 sqlite3 *db,
140592 void (*xNotify)(void **, int),
140593 void *pArg
140594 ){
140595 int rc = SQLITE_OK;
@@ -147588,11 +147623,11 @@
147588 ** Initialize API pointer table, if required.
147589 */
147590 #ifdef _WIN32
147591 __declspec(dllexport)
147592 #endif
147593 SQLITE_API int SQLITE_APICALL sqlite3_fts3_init(
147594 sqlite3 *db,
147595 char **pzErrMsg,
147596 const sqlite3_api_routines *pApi
147597 ){
147598 SQLITE_EXTENSION_INIT2(pApi)
@@ -163389,11 +163424,11 @@
163389 }
163390
163391 /*
163392 ** Register a new geometry function for use with the r-tree MATCH operator.
163393 */
163394 SQLITE_API int SQLITE_APICALL sqlite3_rtree_geometry_callback(
163395 sqlite3 *db, /* Register SQL function on this connection */
163396 const char *zGeom, /* Name of the new SQL function */
163397 int (*xGeom)(sqlite3_rtree_geometry*,int,RtreeDValue*,int*), /* Callback */
163398 void *pContext /* Extra data associated with the callback */
163399 ){
@@ -163413,11 +163448,11 @@
163413
163414 /*
163415 ** Register a new 2nd-generation geometry function for use with the
163416 ** r-tree MATCH operator.
163417 */
163418 SQLITE_API int SQLITE_APICALL sqlite3_rtree_query_callback(
163419 sqlite3 *db, /* Register SQL function on this connection */
163420 const char *zQueryFunc, /* Name of new SQL function */
163421 int (*xQueryFunc)(sqlite3_rtree_query_info*), /* Callback */
163422 void *pContext, /* Extra data passed into the callback */
163423 void (*xDestructor)(void*) /* Destructor for the extra data */
@@ -163438,11 +163473,11 @@
163438
163439 #if !SQLITE_CORE
163440 #ifdef _WIN32
163441 __declspec(dllexport)
163442 #endif
163443 SQLITE_API int SQLITE_APICALL sqlite3_rtree_init(
163444 sqlite3 *db,
163445 char **pzErrMsg,
163446 const sqlite3_api_routines *pApi
163447 ){
163448 SQLITE_EXTENSION_INIT2(pApi)
@@ -163989,11 +164024,11 @@
163989
163990 #if !SQLITE_CORE
163991 #ifdef _WIN32
163992 __declspec(dllexport)
163993 #endif
163994 SQLITE_API int SQLITE_APICALL sqlite3_icu_init(
163995 sqlite3 *db,
163996 char **pzErrMsg,
163997 const sqlite3_api_routines *pApi
163998 ){
163999 SQLITE_EXTENSION_INIT2(pApi)
@@ -164669,11 +164704,11 @@
164669 ** IMPORTANT NOTE FOR ZIPVFS USERS: The RBU extension works with all of
164670 ** SQLite's built-in VFSs, including the multiplexor VFS. However it does
164671 ** not work out of the box with zipvfs. Refer to the comment describing
164672 ** the zipvfs_create_vfs() API below for details on using RBU with zipvfs.
164673 */
164674 SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_open(
164675 const char *zTarget,
164676 const char *zRbu,
164677 const char *zState
164678 );
164679
@@ -164702,11 +164737,11 @@
164702 ** As with sqlite3rbu_open(), Zipvfs users should rever to the comment
164703 ** describing the sqlite3rbu_create_vfs() API function below for
164704 ** a description of the complications associated with using RBU with
164705 ** zipvfs databases.
164706 */
164707 SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_vacuum(
164708 const char *zTarget,
164709 const char *zState
164710 );
164711
164712 /*
@@ -164738,11 +164773,11 @@
164738 ** when sqlite3rbu_close() is called.
164739 **
164740 ** Database handles returned by this function remain valid until the next
164741 ** call to any sqlite3rbu_xxx() function other than sqlite3rbu_db().
164742 */
164743 SQLITE_API sqlite3 *SQLITE_APICALL sqlite3rbu_db(sqlite3rbu*, int bRbu);
164744
164745 /*
164746 ** Do some work towards applying the RBU update to the target db.
164747 **
164748 ** Return SQLITE_DONE if the update has been completely applied, or
@@ -164752,11 +164787,11 @@
164752 **
164753 ** Once a call to sqlite3rbu_step() has returned a value other than
164754 ** SQLITE_OK, all subsequent calls on the same RBU handle are no-ops
164755 ** that immediately return the same value.
164756 */
164757 SQLITE_API int SQLITE_APICALL sqlite3rbu_step(sqlite3rbu *pRbu);
164758
164759 /*
164760 ** Force RBU to save its state to disk.
164761 **
164762 ** If a power failure or application crash occurs during an update, following
@@ -164764,11 +164799,11 @@
164764 ** was last saved. In other words, from the most recent successful call to
164765 ** sqlite3rbu_close() or this function.
164766 **
164767 ** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
164768 */
164769 SQLITE_API int SQLITE_APICALL sqlite3rbu_savestate(sqlite3rbu *pRbu);
164770
164771 /*
164772 ** Close an RBU handle.
164773 **
164774 ** If the RBU update has been completely applied, mark the RBU database
@@ -164784,18 +164819,18 @@
164784 **
164785 ** Otherwise, if no error occurs, this function returns SQLITE_OK if the
164786 ** update has been partially applied, or SQLITE_DONE if it has been
164787 ** completely applied.
164788 */
164789 SQLITE_API int SQLITE_APICALL sqlite3rbu_close(sqlite3rbu *pRbu, char **pzErrmsg);
164790
164791 /*
164792 ** Return the total number of key-value operations (inserts, deletes or
164793 ** updates) that have been performed on the target database since the
164794 ** current RBU update was started.
164795 */
164796 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3rbu_progress(sqlite3rbu *pRbu);
164797
164798 /*
164799 ** Obtain permyriadage (permyriadage is to 10000 as percentage is to 100)
164800 ** progress indications for the two stages of an RBU update. This API may
164801 ** be useful for driving GUI progress indicators and similar.
@@ -164833,11 +164868,11 @@
164833 ** permyriadage progress of the same stage. If the rbu_count table does
164834 ** not exist, then (*pnOne) is set to -1 during stage 1. If the rbu_count
164835 ** table exists but is not correctly populated, the value of the *pnOne
164836 ** output variable during stage 1 is undefined.
164837 */
164838 SQLITE_API void SQLITE_APICALL sqlite3rbu_bp_progress(sqlite3rbu *pRbu, int *pnOne, int *pnTwo);
164839
164840 /*
164841 ** Obtain an indication as to the current stage of an RBU update or vacuum.
164842 ** This function always returns one of the SQLITE_RBU_STATE_XXX constants
164843 ** defined in this file. Return values should be interpreted as follows:
@@ -164871,11 +164906,11 @@
164871 #define SQLITE_RBU_STATE_MOVE 2
164872 #define SQLITE_RBU_STATE_CHECKPOINT 3
164873 #define SQLITE_RBU_STATE_DONE 4
164874 #define SQLITE_RBU_STATE_ERROR 5
164875
164876 SQLITE_API int SQLITE_APICALL sqlite3rbu_state(sqlite3rbu *pRbu);
164877
164878 /*
164879 ** Create an RBU VFS named zName that accesses the underlying file-system
164880 ** via existing VFS zParent. Or, if the zParent parameter is passed NULL,
164881 ** then the new RBU VFS uses the default system VFS to access the file-system.
@@ -164915,21 +164950,21 @@
164915 ** The overhead of adding the "rbu" VFS to the system is negligible for
164916 ** non-RBU users. There is no harm in an application accessing the
164917 ** file-system via "rbu" all the time, even if it only uses RBU functionality
164918 ** occasionally.
164919 */
164920 SQLITE_API int SQLITE_APICALL sqlite3rbu_create_vfs(const char *zName, const char *zParent);
164921
164922 /*
164923 ** Deregister and destroy an RBU vfs created by an earlier call to
164924 ** sqlite3rbu_create_vfs().
164925 **
164926 ** VFS objects are not reference counted. If a VFS object is destroyed
164927 ** before all database handles that use it have been closed, the results
164928 ** are undefined.
164929 */
164930 SQLITE_API void SQLITE_APICALL sqlite3rbu_destroy_vfs(const char *zName);
164931
164932 #if 0
164933 } /* end of the 'extern "C"' block */
164934 #endif
164935
@@ -168019,11 +168054,11 @@
168019 }
168020
168021 /*
168022 ** Step the RBU object.
168023 */
168024 SQLITE_API int SQLITE_APICALL sqlite3rbu_step(sqlite3rbu *p){
168025 if( p ){
168026 switch( p->eStage ){
168027 case RBU_STAGE_OAL: {
168028 RbuObjIter *pIter = &p->objiter;
168029
@@ -168461,11 +168496,11 @@
168461 }
168462
168463 /*
168464 ** Open and return a new RBU handle.
168465 */
168466 SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_open(
168467 const char *zTarget,
168468 const char *zRbu,
168469 const char *zState
168470 ){
168471 /* TODO: Check that zTarget and zRbu are non-NULL */
@@ -168473,11 +168508,11 @@
168473 }
168474
168475 /*
168476 ** Open a handle to begin or resume an RBU VACUUM operation.
168477 */
168478 SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_vacuum(
168479 const char *zTarget,
168480 const char *zState
168481 ){
168482 /* TODO: Check that both arguments are non-NULL */
168483 return openRbuHandle(0, zTarget, zState);
@@ -168484,11 +168519,11 @@
168484 }
168485
168486 /*
168487 ** Return the database handle used by pRbu.
168488 */
168489 SQLITE_API sqlite3 *SQLITE_APICALL sqlite3rbu_db(sqlite3rbu *pRbu, int bRbu){
168490 sqlite3 *db = 0;
168491 if( pRbu ){
168492 db = (bRbu ? pRbu->dbRbu : pRbu->dbMain);
168493 }
168494 return db;
@@ -168516,11 +168551,11 @@
168516 }
168517
168518 /*
168519 ** Close the RBU handle.
168520 */
168521 SQLITE_API int SQLITE_APICALL sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){
168522 int rc;
168523 if( p ){
168524
168525 /* Commit the transaction to the *-oal file. */
168526 if( p->rc==SQLITE_OK && p->eStage==RBU_STAGE_OAL ){
@@ -168567,19 +168602,19 @@
168567 /*
168568 ** Return the total number of key-value operations (inserts, deletes or
168569 ** updates) that have been performed on the target database since the
168570 ** current RBU update was started.
168571 */
168572 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3rbu_progress(sqlite3rbu *pRbu){
168573 return pRbu->nProgress;
168574 }
168575
168576 /*
168577 ** Return permyriadage progress indications for the two main stages of
168578 ** an RBU update.
168579 */
168580 SQLITE_API void SQLITE_APICALL sqlite3rbu_bp_progress(sqlite3rbu *p, int *pnOne, int *pnTwo){
168581 const int MAX_PROGRESS = 10000;
168582 switch( p->eStage ){
168583 case RBU_STAGE_OAL:
168584 if( p->nPhaseOneStep>0 ){
168585 *pnOne = (int)(MAX_PROGRESS * (i64)p->nProgress/(i64)p->nPhaseOneStep);
@@ -168610,11 +168645,11 @@
168610 }
168611
168612 /*
168613 ** Return the current state of the RBU vacuum or update operation.
168614 */
168615 SQLITE_API int SQLITE_APICALL sqlite3rbu_state(sqlite3rbu *p){
168616 int aRes[] = {
168617 0, SQLITE_RBU_STATE_OAL, SQLITE_RBU_STATE_MOVE,
168618 0, SQLITE_RBU_STATE_CHECKPOINT, SQLITE_RBU_STATE_DONE
168619 };
168620
@@ -168638,11 +168673,11 @@
168638 );
168639 return aRes[p->eStage];
168640 }
168641 }
168642
168643 SQLITE_API int SQLITE_APICALL sqlite3rbu_savestate(sqlite3rbu *p){
168644 int rc = p->rc;
168645 if( rc==SQLITE_DONE ) return SQLITE_OK;
168646
168647 assert( p->eStage>=RBU_STAGE_OAL && p->eStage<=RBU_STAGE_DONE );
168648 if( p->eStage==RBU_STAGE_OAL ){
@@ -169465,11 +169500,11 @@
169465
169466 /*
169467 ** Deregister and destroy an RBU vfs created by an earlier call to
169468 ** sqlite3rbu_create_vfs().
169469 */
169470 SQLITE_API void SQLITE_APICALL sqlite3rbu_destroy_vfs(const char *zName){
169471 sqlite3_vfs *pVfs = sqlite3_vfs_find(zName);
169472 if( pVfs && pVfs->xOpen==rbuVfsOpen ){
169473 sqlite3_mutex_free(((rbu_vfs*)pVfs)->mutex);
169474 sqlite3_vfs_unregister(pVfs);
169475 sqlite3_free(pVfs);
@@ -169479,11 +169514,11 @@
169479 /*
169480 ** Create an RBU VFS named zName that accesses the underlying file-system
169481 ** via existing VFS zParent. The new object is registered as a non-default
169482 ** VFS with SQLite before returning.
169483 */
169484 SQLITE_API int SQLITE_APICALL sqlite3rbu_create_vfs(const char *zName, const char *zParent){
169485
169486 /* Template for VFS */
169487 static sqlite3_vfs vfs_template = {
169488 1, /* iVersion */
169489 0, /* szOsFile */
@@ -171724,11 +171759,11 @@
171724 }
171725
171726 return rc;
171727 }
171728
171729 SQLITE_API int SQLITE_APICALL sqlite3session_diff(
171730 sqlite3_session *pSession,
171731 const char *zFrom,
171732 const char *zTbl,
171733 char **pzErrMsg
171734 ){
@@ -171818,11 +171853,11 @@
171818
171819 /*
171820 ** Create a session object. This session object will record changes to
171821 ** database zDb attached to connection db.
171822 */
171823 SQLITE_API int SQLITE_APICALL sqlite3session_create(
171824 sqlite3 *db, /* Database handle */
171825 const char *zDb, /* Name of db (e.g. "main") */
171826 sqlite3_session **ppSession /* OUT: New session object */
171827 ){
171828 sqlite3_session *pNew; /* Newly allocated session object */
@@ -171880,11 +171915,11 @@
171880 }
171881
171882 /*
171883 ** Delete a session object previously allocated using sqlite3session_create().
171884 */
171885 SQLITE_API void SQLITE_APICALL sqlite3session_delete(sqlite3_session *pSession){
171886 sqlite3 *db = pSession->db;
171887 sqlite3_session *pHead;
171888 sqlite3_session **pp;
171889
171890 /* Unlink the session from the linked list of sessions attached to the
@@ -171909,11 +171944,11 @@
171909 }
171910
171911 /*
171912 ** Set a table filter on a Session Object.
171913 */
171914 SQLITE_API void SQLITE_APICALL sqlite3session_table_filter(
171915 sqlite3_session *pSession,
171916 int(*xFilter)(void*, const char*),
171917 void *pCtx /* First argument passed to xFilter */
171918 ){
171919 pSession->bAutoAttach = 1;
@@ -171927,11 +171962,11 @@
171927 **
171928 ** Only tables that have a PRIMARY KEY defined may be attached. It does
171929 ** not matter if the PRIMARY KEY is an "INTEGER PRIMARY KEY" (rowid alias)
171930 ** or not.
171931 */
171932 SQLITE_API int SQLITE_APICALL sqlite3session_attach(
171933 sqlite3_session *pSession, /* Session object */
171934 const char *zName /* Table name */
171935 ){
171936 int rc = SQLITE_OK;
171937 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
@@ -172617,11 +172652,11 @@
172617 ** session object passed as the first argument.
172618 **
172619 ** It is the responsibility of the caller to eventually free the buffer
172620 ** using sqlite3_free().
172621 */
172622 SQLITE_API int SQLITE_APICALL sqlite3session_changeset(
172623 sqlite3_session *pSession, /* Session object */
172624 int *pnChangeset, /* OUT: Size of buffer at *ppChangeset */
172625 void **ppChangeset /* OUT: Buffer containing changeset */
172626 ){
172627 return sessionGenerateChangeset(pSession, 0, 0, 0, pnChangeset, ppChangeset);
@@ -172628,11 +172663,11 @@
172628 }
172629
172630 /*
172631 ** Streaming version of sqlite3session_changeset().
172632 */
172633 SQLITE_API int SQLITE_APICALL sqlite3session_changeset_strm(
172634 sqlite3_session *pSession,
172635 int (*xOutput)(void *pOut, const void *pData, int nData),
172636 void *pOut
172637 ){
172638 return sessionGenerateChangeset(pSession, 0, xOutput, pOut, 0, 0);
@@ -172639,11 +172674,11 @@
172639 }
172640
172641 /*
172642 ** Streaming version of sqlite3session_patchset().
172643 */
172644 SQLITE_API int SQLITE_APICALL sqlite3session_patchset_strm(
172645 sqlite3_session *pSession,
172646 int (*xOutput)(void *pOut, const void *pData, int nData),
172647 void *pOut
172648 ){
172649 return sessionGenerateChangeset(pSession, 1, xOutput, pOut, 0, 0);
@@ -172654,11 +172689,11 @@
172654 ** session object passed as the first argument.
172655 **
172656 ** It is the responsibility of the caller to eventually free the buffer
172657 ** using sqlite3_free().
172658 */
172659 SQLITE_API int SQLITE_APICALL sqlite3session_patchset(
172660 sqlite3_session *pSession, /* Session object */
172661 int *pnPatchset, /* OUT: Size of buffer at *ppChangeset */
172662 void **ppPatchset /* OUT: Buffer containing changeset */
172663 ){
172664 return sessionGenerateChangeset(pSession, 1, 0, 0, pnPatchset, ppPatchset);
@@ -172665,11 +172700,11 @@
172665 }
172666
172667 /*
172668 ** Enable or disable the session object passed as the first argument.
172669 */
172670 SQLITE_API int SQLITE_APICALL sqlite3session_enable(sqlite3_session *pSession, int bEnable){
172671 int ret;
172672 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172673 if( bEnable>=0 ){
172674 pSession->bEnable = bEnable;
172675 }
@@ -172679,11 +172714,11 @@
172679 }
172680
172681 /*
172682 ** Enable or disable the session object passed as the first argument.
172683 */
172684 SQLITE_API int SQLITE_APICALL sqlite3session_indirect(sqlite3_session *pSession, int bIndirect){
172685 int ret;
172686 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172687 if( bIndirect>=0 ){
172688 pSession->bIndirect = bIndirect;
172689 }
@@ -172694,11 +172729,11 @@
172694
172695 /*
172696 ** Return true if there have been no changes to monitored tables recorded
172697 ** by the session object passed as the only argument.
172698 */
172699 SQLITE_API int SQLITE_APICALL sqlite3session_isempty(sqlite3_session *pSession){
172700 int ret = 0;
172701 SessionTable *pTab;
172702
172703 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172704 for(pTab=pSession->pTable; pTab && ret==0; pTab=pTab->pNext){
@@ -172744,11 +172779,11 @@
172744 }
172745
172746 /*
172747 ** Create an iterator used to iterate through the contents of a changeset.
172748 */
172749 SQLITE_API int SQLITE_APICALL sqlite3changeset_start(
172750 sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
172751 int nChangeset, /* Size of buffer pChangeset in bytes */
172752 void *pChangeset /* Pointer to buffer containing changeset */
172753 ){
172754 return sessionChangesetStart(pp, 0, 0, nChangeset, pChangeset);
@@ -172755,11 +172790,11 @@
172755 }
172756
172757 /*
172758 ** Streaming version of sqlite3changeset_start().
172759 */
172760 SQLITE_API int SQLITE_APICALL sqlite3changeset_start_strm(
172761 sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
172762 int (*xInput)(void *pIn, void *pData, int *pnData),
172763 void *pIn
172764 ){
172765 return sessionChangesetStart(pp, xInput, pIn, 0, 0);
@@ -173176,20 +173211,20 @@
173176 ** or SQLITE_CORRUPT.
173177 **
173178 ** This function may not be called on iterators passed to a conflict handler
173179 ** callback by changeset_apply().
173180 */
173181 SQLITE_API int SQLITE_APICALL sqlite3changeset_next(sqlite3_changeset_iter *p){
173182 return sessionChangesetNext(p, 0, 0);
173183 }
173184
173185 /*
173186 ** The following function extracts information on the current change
173187 ** from a changeset iterator. It may only be called after changeset_next()
173188 ** has returned SQLITE_ROW.
173189 */
173190 SQLITE_API int SQLITE_APICALL sqlite3changeset_op(
173191 sqlite3_changeset_iter *pIter, /* Iterator handle */
173192 const char **pzTab, /* OUT: Pointer to table name */
173193 int *pnCol, /* OUT: Number of columns in table */
173194 int *pOp, /* OUT: SQLITE_INSERT, DELETE or UPDATE */
173195 int *pbIndirect /* OUT: True if change is indirect */
@@ -173205,11 +173240,11 @@
173205 ** Return information regarding the PRIMARY KEY and number of columns in
173206 ** the database table affected by the change that pIter currently points
173207 ** to. This function may only be called after changeset_next() returns
173208 ** SQLITE_ROW.
173209 */
173210 SQLITE_API int SQLITE_APICALL sqlite3changeset_pk(
173211 sqlite3_changeset_iter *pIter, /* Iterator object */
173212 unsigned char **pabPK, /* OUT: Array of boolean - true for PK cols */
173213 int *pnCol /* OUT: Number of entries in output array */
173214 ){
173215 *pabPK = pIter->abPK;
@@ -173228,11 +173263,11 @@
173228 ** was not modified and is not a PK column), set *ppValue to NULL.
173229 **
173230 ** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is
173231 ** not modified. Otherwise, SQLITE_OK.
173232 */
173233 SQLITE_API int SQLITE_APICALL sqlite3changeset_old(
173234 sqlite3_changeset_iter *pIter, /* Changeset iterator */
173235 int iVal, /* Index of old.* value to retrieve */
173236 sqlite3_value **ppValue /* OUT: Old value (or NULL pointer) */
173237 ){
173238 if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_DELETE ){
@@ -173256,11 +173291,11 @@
173256 ** was not modified), set *ppValue to NULL.
173257 **
173258 ** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is
173259 ** not modified. Otherwise, SQLITE_OK.
173260 */
173261 SQLITE_API int SQLITE_APICALL sqlite3changeset_new(
173262 sqlite3_changeset_iter *pIter, /* Changeset iterator */
173263 int iVal, /* Index of new.* value to retrieve */
173264 sqlite3_value **ppValue /* OUT: New value (or NULL pointer) */
173265 ){
173266 if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_INSERT ){
@@ -173290,11 +173325,11 @@
173290 ** containing the iVal'th value of the conflicting record.
173291 **
173292 ** If value iVal is out-of-range or some other error occurs, an SQLite error
173293 ** code is returned. Otherwise, SQLITE_OK.
173294 */
173295 SQLITE_API int SQLITE_APICALL sqlite3changeset_conflict(
173296 sqlite3_changeset_iter *pIter, /* Changeset iterator */
173297 int iVal, /* Index of conflict record value to fetch */
173298 sqlite3_value **ppValue /* OUT: Value from conflicting row */
173299 ){
173300 if( !pIter->pConflict ){
@@ -173313,11 +173348,11 @@
173313 ** it sets the output variable to the total number of known foreign key
173314 ** violations in the destination database and returns SQLITE_OK.
173315 **
173316 ** In all other cases this function returns SQLITE_MISUSE.
173317 */
173318 SQLITE_API int SQLITE_APICALL sqlite3changeset_fk_conflicts(
173319 sqlite3_changeset_iter *pIter, /* Changeset iterator */
173320 int *pnOut /* OUT: Number of FK violations */
173321 ){
173322 if( pIter->pConflict || pIter->apValue ){
173323 return SQLITE_MISUSE;
@@ -173331,11 +173366,11 @@
173331 ** Finalize an iterator allocated with sqlite3changeset_start().
173332 **
173333 ** This function may not be called on iterators passed to a conflict handler
173334 ** callback by changeset_apply().
173335 */
173336 SQLITE_API int SQLITE_APICALL sqlite3changeset_finalize(sqlite3_changeset_iter *p){
173337 int rc = SQLITE_OK;
173338 if( p ){
173339 int i; /* Used to iterate through p->apValue[] */
173340 rc = p->rc;
173341 if( p->apValue ){
@@ -173505,11 +173540,11 @@
173505
173506
173507 /*
173508 ** Invert a changeset object.
173509 */
173510 SQLITE_API int SQLITE_APICALL sqlite3changeset_invert(
173511 int nChangeset, /* Number of bytes in input */
173512 const void *pChangeset, /* Input changeset */
173513 int *pnInverted, /* OUT: Number of bytes in output changeset */
173514 void **ppInverted /* OUT: Inverse of pChangeset */
173515 ){
@@ -173524,11 +173559,11 @@
173524 }
173525
173526 /*
173527 ** Streaming version of sqlite3changeset_invert().
173528 */
173529 SQLITE_API int SQLITE_APICALL sqlite3changeset_invert_strm(
173530 int (*xInput)(void *pIn, void *pData, int *pnData),
173531 void *pIn,
173532 int (*xOutput)(void *pOut, const void *pData, int nData),
173533 void *pOut
173534 ){
@@ -174404,11 +174439,11 @@
174404 /*
174405 ** Apply the changeset passed via pChangeset/nChangeset to the main database
174406 ** attached to handle "db". Invoke the supplied conflict handler callback
174407 ** to resolve any conflicts encountered while applying the change.
174408 */
174409 SQLITE_API int SQLITE_APICALL sqlite3changeset_apply(
174410 sqlite3 *db, /* Apply change to "main" db of this handle */
174411 int nChangeset, /* Size of changeset in bytes */
174412 void *pChangeset, /* Changeset blob */
174413 int(*xFilter)(
174414 void *pCtx, /* Copy of sixth arg to _apply() */
@@ -174432,11 +174467,11 @@
174432 /*
174433 ** Apply the changeset passed via xInput/pIn to the main database
174434 ** attached to handle "db". Invoke the supplied conflict handler callback
174435 ** to resolve any conflicts encountered while applying the change.
174436 */
174437 SQLITE_API int SQLITE_APICALL sqlite3changeset_apply_strm(
174438 sqlite3 *db, /* Apply change to "main" db of this handle */
174439 int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
174440 void *pIn, /* First arg for xInput */
174441 int(*xFilter)(
174442 void *pCtx, /* Copy of sixth arg to _apply() */
@@ -174767,11 +174802,11 @@
174767 }
174768
174769 /*
174770 ** Allocate a new, empty, sqlite3_changegroup.
174771 */
174772 SQLITE_API int SQLITE_APICALL sqlite3changegroup_new(sqlite3_changegroup **pp){
174773 int rc = SQLITE_OK; /* Return code */
174774 sqlite3_changegroup *p; /* New object */
174775 p = (sqlite3_changegroup*)sqlite3_malloc(sizeof(sqlite3_changegroup));
174776 if( p==0 ){
174777 rc = SQLITE_NOMEM;
@@ -174784,11 +174819,11 @@
174784
174785 /*
174786 ** Add the changeset currently stored in buffer pData, size nData bytes,
174787 ** to changeset-group p.
174788 */
174789 SQLITE_API int SQLITE_APICALL sqlite3changegroup_add(sqlite3_changegroup *pGrp, int nData, void *pData){
174790 sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */
174791 int rc; /* Return code */
174792
174793 rc = sqlite3changeset_start(&pIter, nData, pData);
174794 if( rc==SQLITE_OK ){
@@ -174800,11 +174835,11 @@
174800
174801 /*
174802 ** Obtain a buffer containing a changeset representing the concatenation
174803 ** of all changesets added to the group so far.
174804 */
174805 SQLITE_API int SQLITE_APICALL sqlite3changegroup_output(
174806 sqlite3_changegroup *pGrp,
174807 int *pnData,
174808 void **ppData
174809 ){
174810 return sessionChangegroupOutput(pGrp, 0, 0, pnData, ppData);
@@ -174811,11 +174846,11 @@
174811 }
174812
174813 /*
174814 ** Streaming versions of changegroup_add().
174815 */
174816 SQLITE_API int SQLITE_APICALL sqlite3changegroup_add_strm(
174817 sqlite3_changegroup *pGrp,
174818 int (*xInput)(void *pIn, void *pData, int *pnData),
174819 void *pIn
174820 ){
174821 sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */
@@ -174830,11 +174865,11 @@
174830 }
174831
174832 /*
174833 ** Streaming versions of changegroup_output().
174834 */
174835 SQLITE_API int SQLITE_APICALL sqlite3changegroup_output_strm(
174836 sqlite3_changegroup *pGrp,
174837 int (*xOutput)(void *pOut, const void *pData, int nData),
174838 void *pOut
174839 ){
174840 return sessionChangegroupOutput(pGrp, xOutput, pOut, 0, 0);
@@ -174841,21 +174876,21 @@
174841 }
174842
174843 /*
174844 ** Delete a changegroup object.
174845 */
174846 SQLITE_API void SQLITE_APICALL sqlite3changegroup_delete(sqlite3_changegroup *pGrp){
174847 if( pGrp ){
174848 sessionDeleteTable(pGrp->pList);
174849 sqlite3_free(pGrp);
174850 }
174851 }
174852
174853 /*
174854 ** Combine two changesets together.
174855 */
174856 SQLITE_API int SQLITE_APICALL sqlite3changeset_concat(
174857 int nLeft, /* Number of bytes in lhs input */
174858 void *pLeft, /* Lhs input changeset */
174859 int nRight /* Number of bytes in rhs input */,
174860 void *pRight, /* Rhs input changeset */
174861 int *pnOut, /* OUT: Number of bytes in output changeset */
@@ -174880,11 +174915,11 @@
174880 }
174881
174882 /*
174883 ** Streaming version of sqlite3changeset_concat().
174884 */
174885 SQLITE_API int SQLITE_APICALL sqlite3changeset_concat_strm(
174886 int (*xInputA)(void *pIn, void *pData, int *pnData),
174887 void *pInA,
174888 int (*xInputB)(void *pIn, void *pData, int *pnData),
174889 void *pInB,
174890 int (*xOutput)(void *pOut, const void *pData, int nData),
@@ -177112,11 +177147,11 @@
177112
177113 #ifndef SQLITE_CORE
177114 #ifdef _WIN32
177115 __declspec(dllexport)
177116 #endif
177117 SQLITE_API int SQLITE_APICALL sqlite3_json_init(
177118 sqlite3 *db,
177119 char **pzErrMsg,
177120 const sqlite3_api_routines *pApi
177121 ){
177122 SQLITE_EXTENSION_INIT2(pApi);
@@ -193945,11 +193980,11 @@
193945 int nArg, /* Number of args */
193946 sqlite3_value **apUnused /* Function arguments */
193947 ){
193948 assert( nArg==0 );
193949 UNUSED_PARAM2(nArg, apUnused);
193950 sqlite3_result_text(pCtx, "fts5: 2016-08-01 21:17:53 d8ef9f58643f13dd3d16dcde0d829ae08324f04b", -1, SQLITE_TRANSIENT);
193951 }
193952
193953 static int fts5Init(sqlite3 *db){
193954 static const sqlite3_module fts5Mod = {
193955 /* iVersion */ 2,
@@ -194033,11 +194068,11 @@
194033 */
194034 #ifndef SQLITE_CORE
194035 #ifdef _WIN32
194036 __declspec(dllexport)
194037 #endif
194038 SQLITE_API int SQLITE_APICALL sqlite3_fts_init(
194039 sqlite3 *db,
194040 char **pzErrMsg,
194041 const sqlite3_api_routines *pApi
194042 ){
194043 SQLITE_EXTENSION_INIT2(pApi);
@@ -194046,11 +194081,11 @@
194046 }
194047
194048 #ifdef _WIN32
194049 __declspec(dllexport)
194050 #endif
194051 SQLITE_API int SQLITE_APICALL sqlite3_fts5_init(
194052 sqlite3 *db,
194053 char **pzErrMsg,
194054 const sqlite3_api_routines *pApi
194055 ){
194056 SQLITE_EXTENSION_INIT2(pApi);
194057
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -380,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-08-04 13:23:28 9adda385267d1a0ecff259b42a284913668441a2"
386
387 /*
388 ** CAPI3REF: Run-Time Library Version Numbers
389 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
390 **
@@ -413,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_STDCALL sqlite3_libversion(void);
419 SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void);
420 SQLITE_API int SQLITE_STDCALL 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
@@ -440,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_STDCALL sqlite3_compileoption_used(const char *zOptName);
446 SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N);
447 #endif
448
449 /*
450 ** CAPI3REF: Test To See If The Library Is Threadsafe
451 **
@@ -480,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_STDCALL sqlite3_threadsafe(void);
486
487 /*
488 ** CAPI3REF: Database Connection Handle
489 ** KEYWORDS: {database connection} {database connections}
490 **
@@ -577,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_STDCALL sqlite3_close(sqlite3*);
583 SQLITE_API int SQLITE_STDCALL 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 (*sqlite3_callback)(void*,int,char**, char**);
591
592 /*
593 ** CAPI3REF: One-Step Query Execution Interface
594 ** METHOD: sqlite3
595 **
@@ -649,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_STDCALL sqlite3_exec(
655 sqlite3*, /* An open database */
656 const char *sql, /* SQL to be evaluated */
657 int (*callback)(void*,int,char**,char**), /* Callback function */
658 void *, /* 1st argument to callback */
659 char **errmsg /* Error msg written here */
660 );
661
662 /*
@@ -1000,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 (*xClose)(sqlite3_file*);
1006 int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
1007 int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
1008 int (*xTruncate)(sqlite3_file*, sqlite3_int64 size);
1009 int (*xSync)(sqlite3_file*, int flags);
1010 int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
1011 int (*xLock)(sqlite3_file*, int);
1012 int (*xUnlock)(sqlite3_file*, int);
1013 int (*xCheckReservedLock)(sqlite3_file*, int *pResOut);
1014 int (*xFileControl)(sqlite3_file*, int op, void *pArg);
1015 int (*xSectorSize)(sqlite3_file*);
1016 int (*xDeviceCharacteristics)(sqlite3_file*);
1017 /* Methods above are valid for version 1 */
1018 int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
1019 int (*xShmLock)(sqlite3_file*, int offset, int n, int flags);
1020 void (*xShmBarrier)(sqlite3_file*);
1021 int (*xShmUnmap)(sqlite3_file*, int deleteFlag);
1022 /* Methods above are valid for version 2 */
1023 int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
1024 int (*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 /*
@@ -1195,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 (*)(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 **
@@ -1471,43 +1471,43 @@
1471 ** or all of these interfaces to be NULL or for their behavior to change
1472 ** from one release to the next. Applications must not attempt to access
1473 ** any of these methods if the iVersion of the VFS is less than 3.
1474 */
1475 typedef struct sqlite3_vfs sqlite3_vfs;
1476 typedef void (*sqlite3_syscall_ptr)(void);
1477 struct sqlite3_vfs {
1478 int iVersion; /* Structure version number (currently 3) */
1479 int szOsFile; /* Size of subclassed sqlite3_file */
1480 int mxPathname; /* Maximum file pathname length */
1481 sqlite3_vfs *pNext; /* Next registered VFS */
1482 const char *zName; /* Name of this virtual file system */
1483 void *pAppData; /* Pointer to application-specific data */
1484 int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
1485 int flags, int *pOutFlags);
1486 int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
1487 int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
1488 int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
1489 void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename);
1490 void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
1491 void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
1492 void (*xDlClose)(sqlite3_vfs*, void*);
1493 int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
1494 int (*xSleep)(sqlite3_vfs*, int microseconds);
1495 int (*xCurrentTime)(sqlite3_vfs*, double*);
1496 int (*xGetLastError)(sqlite3_vfs*, int, char *);
1497 /*
1498 ** The methods above are in version 1 of the sqlite_vfs object
1499 ** definition. Those that follow are added in version 2 or later
1500 */
1501 int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
1502 /*
1503 ** The methods above are in versions 1 and 2 of the sqlite_vfs object.
1504 ** Those below are for version 3 and greater.
1505 */
1506 int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
1507 sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName);
1508 const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName);
1509 /*
1510 ** The methods above are in versions 1 through 3 of the sqlite_vfs object.
1511 ** New fields may be appended in future versions. The iVersion
1512 ** value will increment whenever this happens.
1513 */
@@ -1648,14 +1648,14 @@
1648 ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied
1649 ** implementation of sqlite3_os_init() or sqlite3_os_end()
1650 ** must return [SQLITE_OK] on success and some other [error code] upon
1651 ** failure.
1652 */
1653 SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void);
1654 SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void);
1655 SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void);
1656 SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void);
1657
1658 /*
1659 ** CAPI3REF: Configuring The SQLite Library
1660 **
1661 ** The sqlite3_config() interface is used to make global configuration
@@ -1770,17 +1770,17 @@
1770 ** SQLite will never invoke xInit() more than once without an intervening
1771 ** call to xShutdown().
1772 */
1773 typedef struct sqlite3_mem_methods sqlite3_mem_methods;
1774 struct sqlite3_mem_methods {
1775 void *(*xMalloc)(int); /* Memory allocation function */
1776 void (*xFree)(void*); /* Free a prior allocation */
1777 void *(*xRealloc)(void*,int); /* Resize an allocation */
1778 int (*xSize)(void*); /* Return the size of an allocation */
1779 int (*xRoundup)(int); /* Round up request size to allocation size */
1780 int (*xInit)(void*); /* Initialize the memory allocator */
1781 void (*xShutdown)(void*); /* Deinitialize the memory allocator */
1782 void *pAppData; /* Argument to xInit() and xShutdown() */
1783 };
1784
1785 /*
1786 ** CAPI3REF: Configuration Options
@@ -1993,11 +1993,11 @@
1993 **
1994 ** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
1995 ** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
1996 ** global [error log].
1997 ** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a
1998 ** function with a call signature of void(*)(void*,int,const char*),
1999 ** and a pointer to void. ^If the function pointer is not NULL, it is
2000 ** invoked by [sqlite3_log()] to process each logging event. ^If the
2001 ** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op.
2002 ** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is
2003 ** passed through as the first parameter to the application-defined logger
@@ -2046,11 +2046,11 @@
2046 **
2047 ** [[SQLITE_CONFIG_SQLLOG]]
2048 ** <dt>SQLITE_CONFIG_SQLLOG
2049 ** <dd>This option is only available if sqlite is compiled with the
2050 ** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should
2051 ** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int).
2052 ** The second should be of type (void*). The callback is invoked by the library
2053 ** in three separate circumstances, identified by the value passed as the
2054 ** fourth parameter. If the fourth parameter is 0, then the database connection
2055 ** passed as the second argument has just been opened. The third argument
2056 ** points to a buffer containing the name of the main database file. If the
@@ -2244,11 +2244,11 @@
2244 **
2245 ** ^The sqlite3_extended_result_codes() routine enables or disables the
2246 ** [extended result codes] feature of SQLite. ^The extended result
2247 ** codes are disabled by default for historical compatibility.
2248 */
2249 SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3*, int onoff);
2250
2251 /*
2252 ** CAPI3REF: Last Insert Rowid
2253 ** METHOD: sqlite3
2254 **
@@ -2296,11 +2296,11 @@
2296 ** function is running and thus changes the last insert [rowid],
2297 ** then the value returned by [sqlite3_last_insert_rowid()] is
2298 ** unpredictable and might not equal either the old or the new
2299 ** last insert [rowid].
2300 */
2301 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3*);
2302
2303 /*
2304 ** CAPI3REF: Count The Number Of Rows Modified
2305 ** METHOD: sqlite3
2306 **
@@ -2349,11 +2349,11 @@
2349 **
2350 ** If a separate thread makes changes on the same database connection
2351 ** while [sqlite3_changes()] is running then the value returned
2352 ** is unpredictable and not meaningful.
2353 */
2354 SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3*);
2355
2356 /*
2357 ** CAPI3REF: Total Number Of Rows Modified
2358 ** METHOD: sqlite3
2359 **
@@ -2373,11 +2373,11 @@
2373 **
2374 ** If a separate thread makes changes on the same database connection
2375 ** while [sqlite3_total_changes()] is running then the value
2376 ** returned is unpredictable and not meaningful.
2377 */
2378 SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3*);
2379
2380 /*
2381 ** CAPI3REF: Interrupt A Long-Running Query
2382 ** METHOD: sqlite3
2383 **
@@ -2413,11 +2413,11 @@
2413 ** that are started after the sqlite3_interrupt() call returns.
2414 **
2415 ** If the database connection closes while [sqlite3_interrupt()]
2416 ** is running then bad things will likely happen.
2417 */
2418 SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3*);
2419
2420 /*
2421 ** CAPI3REF: Determine If An SQL Statement Is Complete
2422 **
2423 ** These routines are useful during command-line input to determine if the
@@ -2448,12 +2448,12 @@
2448 ** UTF-8 string.
2449 **
2450 ** The input to [sqlite3_complete16()] must be a zero-terminated
2451 ** UTF-16 string in native byte order.
2452 */
2453 SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *sql);
2454 SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *sql);
2455
2456 /*
2457 ** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
2458 ** KEYWORDS: {busy-handler callback} {busy handler}
2459 ** METHOD: sqlite3
@@ -2510,11 +2510,11 @@
2510 ** result in undefined behavior.
2511 **
2512 ** A busy handler must not close the database connection
2513 ** or [prepared statement] that invoked the busy handler.
2514 */
2515 SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(sqlite3*,int(*)(void*,int),void*);
2516
2517 /*
2518 ** CAPI3REF: Set A Busy Timeout
2519 ** METHOD: sqlite3
2520 **
@@ -2533,11 +2533,11 @@
2533 ** was defined (using [sqlite3_busy_handler()]) prior to calling
2534 ** this routine, that other busy handler is cleared.)^
2535 **
2536 ** See also: [PRAGMA busy_timeout]
2537 */
2538 SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3*, int ms);
2539
2540 /*
2541 ** CAPI3REF: Convenience Routines For Running Queries
2542 ** METHOD: sqlite3
2543 **
@@ -2608,19 +2608,19 @@
2608 ** interface defined here. As a consequence, errors that occur in the
2609 ** wrapper layer outside of the internal [sqlite3_exec()] call are not
2610 ** reflected in subsequent calls to [sqlite3_errcode()] or
2611 ** [sqlite3_errmsg()].
2612 */
2613 SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
2614 sqlite3 *db, /* An open database */
2615 const char *zSql, /* SQL to be evaluated */
2616 char ***pazResult, /* Results of the query */
2617 int *pnRow, /* Number of result rows written here */
2618 int *pnColumn, /* Number of result columns written here */
2619 char **pzErrmsg /* Error msg written here */
2620 );
2621 SQLITE_API void SQLITE_STDCALL sqlite3_free_table(char **result);
2622
2623 /*
2624 ** CAPI3REF: Formatted String Printing Functions
2625 **
2626 ** These routines are work-alikes of the "printf()" family of functions
@@ -2723,13 +2723,13 @@
2723 ** ^(The "%z" formatting option works like "%s" but with the
2724 ** addition that after the string has been read and copied into
2725 ** the result, [sqlite3_free()] is called on the input string.)^
2726 */
2727 SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...);
2728 SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list);
2729 SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...);
2730 SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list);
2731
2732 /*
2733 ** CAPI3REF: Memory Allocation Subsystem
2734 **
2735 ** The SQLite core uses these three routines for all of its own
@@ -2815,16 +2815,16 @@
2815 **
2816 ** The application must not read or write any part of
2817 ** a block of memory after it has been released using
2818 ** [sqlite3_free()] or [sqlite3_realloc()].
2819 */
2820 SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int);
2821 SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64);
2822 SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void*, int);
2823 SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void*, sqlite3_uint64);
2824 SQLITE_API void SQLITE_STDCALL sqlite3_free(void*);
2825 SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void*);
2826
2827 /*
2828 ** CAPI3REF: Memory Allocator Statistics
2829 **
2830 ** SQLite provides these two interfaces for reporting on the status
@@ -2845,12 +2845,12 @@
2845 ** [sqlite3_memory_used()] if and only if the parameter to
2846 ** [sqlite3_memory_highwater()] is true. ^The value returned
2847 ** by [sqlite3_memory_highwater(1)] is the high-water mark
2848 ** prior to the reset.
2849 */
2850 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void);
2851 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag);
2852
2853 /*
2854 ** CAPI3REF: Pseudo-Random Number Generator
2855 **
2856 ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
@@ -2869,11 +2869,11 @@
2869 ** ^If the previous call to this routine had an N of 1 or more and a
2870 ** non-NULL P then the pseudo-randomness is generated
2871 ** internally and without recourse to the [sqlite3_vfs] xRandomness
2872 ** method.
2873 */
2874 SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *P);
2875
2876 /*
2877 ** CAPI3REF: Compile-Time Authorization Callbacks
2878 ** METHOD: sqlite3
2879 **
@@ -2952,13 +2952,13 @@
2952 ** [sqlite3_prepare()] or its variants. Authorization is not
2953 ** performed during statement evaluation in [sqlite3_step()], unless
2954 ** as stated in the previous paragraph, sqlite3_step() invokes
2955 ** sqlite3_prepare_v2() to reprepare a statement after a schema change.
2956 */
2957 SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
2958 sqlite3*,
2959 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
2960 void *pUserData
2961 );
2962
2963 /*
2964 ** CAPI3REF: Authorizer Return Codes
@@ -3060,14 +3060,14 @@
3060 ** digits in the time are meaningless. Future versions of SQLite
3061 ** might provide greater resolution on the profiler callback. The
3062 ** sqlite3_profile() function is considered experimental and is
3063 ** subject to change in future versions of SQLite.
3064 */
3065 SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_trace(sqlite3*,
3066 void(*xTrace)(void*,const char*), void*);
3067 SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_profile(sqlite3*,
3068 void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
3069
3070 /*
3071 ** CAPI3REF: SQL Trace Event Codes
3072 ** KEYWORDS: SQLITE_TRACE
3073 **
@@ -3151,14 +3151,14 @@
3151 **
3152 ** The sqlite3_trace_v2() interface is intended to replace the legacy
3153 ** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which
3154 ** are deprecated.
3155 */
3156 SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2(
3157 sqlite3*,
3158 unsigned uMask,
3159 int(*xCallback)(unsigned,void*,void*,void*),
3160 void *pCtx
3161 );
3162
3163 /*
3164 ** CAPI3REF: Query Progress Callbacks
@@ -3190,11 +3190,11 @@
3190 ** the database connection that invoked the progress handler.
3191 ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
3192 ** database connections for the meaning of "modify" in this paragraph.
3193 **
3194 */
3195 SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
3196
3197 /*
3198 ** CAPI3REF: Opening A New Database Connection
3199 ** CONSTRUCTOR: sqlite3
3200 **
@@ -3419,19 +3419,19 @@
3419 ** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various
3420 ** features that require the use of temporary files may fail.
3421 **
3422 ** See also: [sqlite3_temp_directory]
3423 */
3424 SQLITE_API int SQLITE_STDCALL sqlite3_open(
3425 const char *filename, /* Database filename (UTF-8) */
3426 sqlite3 **ppDb /* OUT: SQLite db handle */
3427 );
3428 SQLITE_API int SQLITE_STDCALL sqlite3_open16(
3429 const void *filename, /* Database filename (UTF-16) */
3430 sqlite3 **ppDb /* OUT: SQLite db handle */
3431 );
3432 SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
3433 const char *filename, /* Database filename (UTF-8) */
3434 sqlite3 **ppDb, /* OUT: SQLite db handle */
3435 int flags, /* Flags */
3436 const char *zVfs /* Name of VFS module to use */
3437 );
@@ -3473,13 +3473,13 @@
3473 ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and
3474 ** is not a database file pathname pointer that SQLite passed into the xOpen
3475 ** VFS method, then the behavior of this routine is undefined and probably
3476 ** undesirable.
3477 */
3478 SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3479 SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3480 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
3481
3482
3483 /*
3484 ** CAPI3REF: Error Codes And Messages
3485 ** METHOD: sqlite3
@@ -3519,15 +3519,15 @@
3519 **
3520 ** If an interface fails with SQLITE_MISUSE, that means the interface
3521 ** was invoked incorrectly by the application. In that case, the
3522 ** error code and message may or may not be set.
3523 */
3524 SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db);
3525 SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db);
3526 SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*);
3527 SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*);
3528 SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int);
3529
3530 /*
3531 ** CAPI3REF: Prepared Statement Object
3532 ** KEYWORDS: {prepared statement} {prepared statements}
3533 **
@@ -3591,11 +3591,11 @@
3591 ** created by an untrusted script can be contained using the
3592 ** [max_page_count] [PRAGMA].
3593 **
3594 ** New run-time limit categories may be added in future releases.
3595 */
3596 SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3*, int id, int newVal);
3597
3598 /*
3599 ** CAPI3REF: Run-Time Limit Categories
3600 ** KEYWORDS: {limit category} {*limit categories}
3601 **
@@ -3743,32 +3743,32 @@
3743 ** or [GLOB] operator or if the parameter is compared to an indexed column
3744 ** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
3745 ** </li>
3746 ** </ol>
3747 */
3748 SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
3749 sqlite3 *db, /* Database handle */
3750 const char *zSql, /* SQL statement, UTF-8 encoded */
3751 int nByte, /* Maximum length of zSql in bytes. */
3752 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3753 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3754 );
3755 SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
3756 sqlite3 *db, /* Database handle */
3757 const char *zSql, /* SQL statement, UTF-8 encoded */
3758 int nByte, /* Maximum length of zSql in bytes. */
3759 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3760 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3761 );
3762 SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
3763 sqlite3 *db, /* Database handle */
3764 const void *zSql, /* SQL statement, UTF-16 encoded */
3765 int nByte, /* Maximum length of zSql in bytes. */
3766 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3767 const void **pzTail /* OUT: Pointer to unused portion of zSql */
3768 );
3769 SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
3770 sqlite3 *db, /* Database handle */
3771 const void *zSql, /* SQL statement, UTF-16 encoded */
3772 int nByte, /* Maximum length of zSql in bytes. */
3773 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3774 const void **pzTail /* OUT: Pointer to unused portion of zSql */
@@ -3803,12 +3803,12 @@
3803 ** automatically freed when the prepared statement is finalized.
3804 ** ^The string returned by sqlite3_expanded_sql(P), on the other hand,
3805 ** is obtained from [sqlite3_malloc()] and must be free by the application
3806 ** by passing it to [sqlite3_free()].
3807 */
3808 SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt);
3809 SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt);
3810
3811 /*
3812 ** CAPI3REF: Determine If An SQL Statement Writes The Database
3813 ** METHOD: sqlite3_stmt
3814 **
@@ -3836,11 +3836,11 @@
3836 ** database. ^The [ATTACH] and [DETACH] statements also cause
3837 ** sqlite3_stmt_readonly() to return true since, while those statements
3838 ** change the configuration of a database connection, they do not make
3839 ** changes to the content of the database files on disk.
3840 */
3841 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
3842
3843 /*
3844 ** CAPI3REF: Determine If A Prepared Statement Has Been Reset
3845 ** METHOD: sqlite3_stmt
3846 **
@@ -3857,11 +3857,11 @@
3857 ** to locate all prepared statements associated with a database
3858 ** connection that are in need of being reset. This can be used,
3859 ** for example, in diagnostic routines to search for prepared
3860 ** statements that are holding a transaction open.
3861 */
3862 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt*);
3863
3864 /*
3865 ** CAPI3REF: Dynamically Typed Value Object
3866 ** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
3867 **
@@ -4021,24 +4021,24 @@
4021 ** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails.
4022 **
4023 ** See also: [sqlite3_bind_parameter_count()],
4024 ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].
4025 */
4026 SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
4027 SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
4028 void(*)(void*));
4029 SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt*, int, double);
4030 SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt*, int, int);
4031 SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
4032 SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt*, int);
4033 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
4034 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
4035 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
4036 void(*)(void*), unsigned char encoding);
4037 SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
4038 SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
4039 SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
4040
4041 /*
4042 ** CAPI3REF: Number Of SQL Parameters
4043 ** METHOD: sqlite3_stmt
4044 **
@@ -4055,11 +4055,11 @@
4055 **
4056 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
4057 ** [sqlite3_bind_parameter_name()], and
4058 ** [sqlite3_bind_parameter_index()].
4059 */
4060 SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt*);
4061
4062 /*
4063 ** CAPI3REF: Name Of A Host Parameter
4064 ** METHOD: sqlite3_stmt
4065 **
@@ -4083,11 +4083,11 @@
4083 **
4084 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
4085 ** [sqlite3_bind_parameter_count()], and
4086 ** [sqlite3_bind_parameter_index()].
4087 */
4088 SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
4089
4090 /*
4091 ** CAPI3REF: Index Of A Parameter With A Given Name
4092 ** METHOD: sqlite3_stmt
4093 **
@@ -4100,21 +4100,21 @@
4100 **
4101 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
4102 ** [sqlite3_bind_parameter_count()], and
4103 ** [sqlite3_bind_parameter_name()].
4104 */
4105 SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
4106
4107 /*
4108 ** CAPI3REF: Reset All Bindings On A Prepared Statement
4109 ** METHOD: sqlite3_stmt
4110 **
4111 ** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset
4112 ** the [sqlite3_bind_blob | bindings] on a [prepared statement].
4113 ** ^Use this routine to reset all host parameters to NULL.
4114 */
4115 SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt*);
4116
4117 /*
4118 ** CAPI3REF: Number Of Columns In A Result Set
4119 ** METHOD: sqlite3_stmt
4120 **
@@ -4122,11 +4122,11 @@
4122 ** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
4123 ** statement that does not return data (for example an [UPDATE]).
4124 **
4125 ** See also: [sqlite3_data_count()]
4126 */
4127 SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt);
4128
4129 /*
4130 ** CAPI3REF: Column Names In A Result Set
4131 ** METHOD: sqlite3_stmt
4132 **
@@ -4151,12 +4151,12 @@
4151 ** ^The name of a result column is the value of the "AS" clause for
4152 ** that column, if there is an AS clause. If there is no AS clause
4153 ** then the name of the column is unspecified and may change from
4154 ** one release of SQLite to the next.
4155 */
4156 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt*, int N);
4157 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt*, int N);
4158
4159 /*
4160 ** CAPI3REF: Source Of Data In A Query Result
4161 ** METHOD: sqlite3_stmt
4162 **
@@ -4200,16 +4200,16 @@
4200 ** If two or more threads call one or more
4201 ** [sqlite3_column_database_name | column metadata interfaces]
4202 ** for the same [prepared statement] and result column
4203 ** at the same time then the results are undefined.
4204 */
4205 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int);
4206 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int);
4207 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int);
4208 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int);
4209 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int);
4210 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
4211
4212 /*
4213 ** CAPI3REF: Declared Datatype Of A Query Result
4214 ** METHOD: sqlite3_stmt
4215 **
@@ -4237,12 +4237,12 @@
4237 ** data stored in that column is of the declared type. SQLite is
4238 ** strongly typed, but the typing is dynamic not static. ^Type
4239 ** is associated with individual values, not with the containers
4240 ** used to hold those values.
4241 */
4242 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt*,int);
4243 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt*,int);
4244
4245 /*
4246 ** CAPI3REF: Evaluate An SQL Statement
4247 ** METHOD: sqlite3_stmt
4248 **
@@ -4318,11 +4318,11 @@
4318 ** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
4319 ** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,
4320 ** then the more specific [error codes] are returned directly
4321 ** by sqlite3_step(). The use of the "v2" interface is recommended.
4322 */
4323 SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt*);
4324
4325 /*
4326 ** CAPI3REF: Number of columns in a result set
4327 ** METHOD: sqlite3_stmt
4328 **
@@ -4339,11 +4339,11 @@
4339 ** where it always returns zero since each step of that multi-step
4340 ** pragma returns 0 columns of data.
4341 **
4342 ** See also: [sqlite3_column_count()]
4343 */
4344 SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt);
4345
4346 /*
4347 ** CAPI3REF: Fundamental Datatypes
4348 ** KEYWORDS: SQLITE_TEXT
4349 **
@@ -4529,20 +4529,20 @@
4529 ** of these routines, a default value is returned. The default value
4530 ** is either the integer 0, the floating point number 0.0, or a NULL
4531 ** pointer. Subsequent calls to [sqlite3_errcode()] will return
4532 ** [SQLITE_NOMEM].)^
4533 */
4534 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt*, int iCol);
4535 SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4536 SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4537 SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt*, int iCol);
4538 SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt*, int iCol);
4539 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt*, int iCol);
4540 SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt*, int iCol);
4541 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt*, int iCol);
4542 SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt*, int iCol);
4543 SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt*, int iCol);
4544
4545 /*
4546 ** CAPI3REF: Destroy A Prepared Statement Object
4547 ** DESTRUCTOR: sqlite3_stmt
4548 **
@@ -4566,11 +4566,11 @@
4566 ** resource leaks. It is a grievous error for the application to try to use
4567 ** a prepared statement after it has been finalized. Any use of a prepared
4568 ** statement after it has been finalized can result in undefined and
4569 ** undesirable behavior such as segfaults and heap corruption.
4570 */
4571 SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt);
4572
4573 /*
4574 ** CAPI3REF: Reset A Prepared Statement Object
4575 ** METHOD: sqlite3_stmt
4576 **
@@ -4593,11 +4593,11 @@
4593 ** [sqlite3_reset(S)] returns an appropriate [error code].
4594 **
4595 ** ^The [sqlite3_reset(S)] interface does not change the values
4596 ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
4597 */
4598 SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt);
4599
4600 /*
4601 ** CAPI3REF: Create Or Redefine SQL Functions
4602 ** KEYWORDS: {function creation routines}
4603 ** KEYWORDS: {application-defined SQL function}
@@ -4693,40 +4693,40 @@
4693 ** ^An application-defined function is permitted to call other
4694 ** SQLite interfaces. However, such calls must not
4695 ** close the database connection nor finalize or reset the prepared
4696 ** statement in which the function is running.
4697 */
4698 SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
4699 sqlite3 *db,
4700 const char *zFunctionName,
4701 int nArg,
4702 int eTextRep,
4703 void *pApp,
4704 void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4705 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4706 void (*xFinal)(sqlite3_context*)
4707 );
4708 SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
4709 sqlite3 *db,
4710 const void *zFunctionName,
4711 int nArg,
4712 int eTextRep,
4713 void *pApp,
4714 void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4715 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4716 void (*xFinal)(sqlite3_context*)
4717 );
4718 SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
4719 sqlite3 *db,
4720 const char *zFunctionName,
4721 int nArg,
4722 int eTextRep,
4723 void *pApp,
4724 void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4725 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4726 void (*xFinal)(sqlite3_context*),
4727 void(*xDestroy)(void*)
4728 );
4729
4730 /*
4731 ** CAPI3REF: Text Encodings
4732 **
@@ -4759,16 +4759,16 @@
4759 ** to be supported. However, new applications should avoid
4760 ** the use of these functions. To encourage programmers to avoid
4761 ** these functions, we will not explain what they do.
4762 */
4763 #ifndef SQLITE_OMIT_DEPRECATED
4764 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context*);
4765 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt*);
4766 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4767 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_global_recover(void);
4768 SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_thread_cleanup(void);
4769 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
4770 void*,sqlite3_int64);
4771 #endif
4772
4773 /*
4774 ** CAPI3REF: Obtaining SQL Values
@@ -4814,22 +4814,22 @@
4814 ** or [sqlite3_value_text16()].
4815 **
4816 ** These routines must be called from the same thread as
4817 ** the SQL function that supplied the [sqlite3_value*] parameters.
4818 */
4819 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value*);
4820 SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value*);
4821 SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value*);
4822 SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value*);
4823 SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value*);
4824 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value*);
4825 SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value*);
4826 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value*);
4827 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value*);
4828 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*);
4829 SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*);
4830 SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*);
4831
4832 /*
4833 ** CAPI3REF: Finding The Subtype Of SQL Values
4834 ** METHOD: sqlite3_value
4835 **
@@ -4841,11 +4841,11 @@
4841 **
4842 ** SQLite makes no use of subtype itself. It merely passes the subtype
4843 ** from the result of one [application-defined SQL function] into the
4844 ** input of another.
4845 */
4846 SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value*);
4847
4848 /*
4849 ** CAPI3REF: Copy And Free SQL Values
4850 ** METHOD: sqlite3_value
4851 **
@@ -4857,12 +4857,12 @@
4857 **
4858 ** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object
4859 ** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer
4860 ** then sqlite3_value_free(V) is a harmless no-op.
4861 */
4862 SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value*);
4863 SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value*);
4864
4865 /*
4866 ** CAPI3REF: Obtain Aggregate Function Context
4867 ** METHOD: sqlite3_context
4868 **
@@ -4903,11 +4903,11 @@
4903 ** function.
4904 **
4905 ** This routine must be called from the same thread in which
4906 ** the aggregate SQL function is running.
4907 */
4908 SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
4909
4910 /*
4911 ** CAPI3REF: User Data For Functions
4912 ** METHOD: sqlite3_context
4913 **
@@ -4918,11 +4918,11 @@
4918 ** registered the application defined function.
4919 **
4920 ** This routine must be called from the same thread in which
4921 ** the application-defined function is running.
4922 */
4923 SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context*);
4924
4925 /*
4926 ** CAPI3REF: Database Connection For Functions
4927 ** METHOD: sqlite3_context
4928 **
@@ -4930,11 +4930,11 @@
4930 ** the pointer to the [database connection] (the 1st parameter)
4931 ** of the [sqlite3_create_function()]
4932 ** and [sqlite3_create_function16()] routines that originally
4933 ** registered the application defined function.
4934 */
4935 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context*);
4936
4937 /*
4938 ** CAPI3REF: Function Auxiliary Data
4939 ** METHOD: sqlite3_context
4940 **
@@ -4962,16 +4962,17 @@
4962 ** NULL if the metadata has been discarded.
4963 ** ^After each call to sqlite3_set_auxdata(C,N,P,X) where X is not NULL,
4964 ** SQLite will invoke the destructor function X with parameter P exactly
4965 ** once, when the metadata is discarded.
4966 ** SQLite is free to discard the metadata at any time, including: <ul>
4967 ** <li> ^(when the corresponding function parameter changes)^, or
4968 ** <li> ^(when [sqlite3_reset()] or [sqlite3_finalize()] is called for the
4969 ** SQL statement)^, or
4970 ** <li> ^(when sqlite3_set_auxdata() is invoked again on the same
4971 ** parameter)^, or
4972 ** <li> ^(during the original sqlite3_set_auxdata() call when a memory
4973 ** allocation error occurs.)^ </ul>
4974 **
4975 ** Note the last bullet in particular. The destructor X in
4976 ** sqlite3_set_auxdata(C,N,P,X) might be called immediately, before the
4977 ** sqlite3_set_auxdata() interface even returns. Hence sqlite3_set_auxdata()
4978 ** should be called near the end of the function implementation and the
@@ -4983,12 +4984,12 @@
4984 ** values and [parameters] and expressions composed from the same.)^
4985 **
4986 ** These routines must be called from the same thread in which
4987 ** the SQL function is running.
4988 */
4989 SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context*, int N);
4990 SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
4991
4992
4993 /*
4994 ** CAPI3REF: Constants Defining Special Destructor Behavior
4995 **
@@ -5001,11 +5002,11 @@
5002 ** the content before returning.
5003 **
5004 ** The typedef is necessary to work around problems in certain
5005 ** C++ compilers.
5006 */
5007 typedef void (*sqlite3_destructor_type)(void*);
5008 #define SQLITE_STATIC ((sqlite3_destructor_type)0)
5009 #define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1)
5010
5011 /*
5012 ** CAPI3REF: Setting The Result Of An SQL Function
@@ -5120,31 +5121,31 @@
5121 **
5122 ** If these routines are called from within the different thread
5123 ** than the one containing the application-defined function that received
5124 ** the [sqlite3_context] pointer, the results are undefined.
5125 */
5126 SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
5127 SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(sqlite3_context*,const void*,
5128 sqlite3_uint64,void(*)(void*));
5129 SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context*, double);
5130 SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context*, const char*, int);
5131 SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context*, const void*, int);
5132 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context*);
5133 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context*);
5134 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context*, int);
5135 SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context*, int);
5136 SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
5137 SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context*);
5138 SQLITE_API void SQLITE_STDCALL sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
5139 SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
5140 void(*)(void*), unsigned char encoding);
5141 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
5142 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
5143 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
5144 SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
5145 SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n);
5146 SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
5147
5148
5149 /*
5150 ** CAPI3REF: Setting The Subtype Of An SQL Function
5151 ** METHOD: sqlite3_context
@@ -5155,11 +5156,11 @@
5156 ** of the subtype T are preserved in current versions of SQLite;
5157 ** higher order bits are discarded.
5158 ** The number of subtype bytes preserved by SQLite might increase
5159 ** in future releases of SQLite.
5160 */
5161 SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context*,unsigned int);
5162
5163 /*
5164 ** CAPI3REF: Define New Collating Sequences
5165 ** METHOD: sqlite3
5166 **
@@ -5237,31 +5238,31 @@
5238 ** is unfortunate but cannot be changed without breaking backwards
5239 ** compatibility.
5240 **
5241 ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].
5242 */
5243 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
5244 sqlite3*,
5245 const char *zName,
5246 int eTextRep,
5247 void *pArg,
5248 int(*xCompare)(void*,int,const void*,int,const void*)
5249 );
5250 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
5251 sqlite3*,
5252 const char *zName,
5253 int eTextRep,
5254 void *pArg,
5255 int(*xCompare)(void*,int,const void*,int,const void*),
5256 void(*xDestroy)(void*)
5257 );
5258 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
5259 sqlite3*,
5260 const void *zName,
5261 int eTextRep,
5262 void *pArg,
5263 int(*xCompare)(void*,int,const void*,int,const void*)
5264 );
5265
5266 /*
5267 ** CAPI3REF: Collation Needed Callbacks
5268 ** METHOD: sqlite3
@@ -5287,19 +5288,19 @@
5288 **
5289 ** The callback function should register the desired collation using
5290 ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or
5291 ** [sqlite3_create_collation_v2()].
5292 */
5293 SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
5294 sqlite3*,
5295 void*,
5296 void(*)(void*,sqlite3*,int eTextRep,const char*)
5297 );
5298 SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
5299 sqlite3*,
5300 void*,
5301 void(*)(void*,sqlite3*,int eTextRep,const void*)
5302 );
5303
5304 #ifdef SQLITE_HAS_CODEC
5305 /*
5306 ** Specify the key for an encrypted database. This routine should be
@@ -5306,15 +5307,15 @@
5307 ** called right after sqlite3_open().
5308 **
5309 ** The code to implement this API is not available in the public release
5310 ** of SQLite.
5311 */
5312 SQLITE_API int SQLITE_STDCALL sqlite3_key(
5313 sqlite3 *db, /* Database to be rekeyed */
5314 const void *pKey, int nKey /* The key */
5315 );
5316 SQLITE_API int SQLITE_STDCALL sqlite3_key_v2(
5317 sqlite3 *db, /* Database to be rekeyed */
5318 const char *zDbName, /* Name of the database */
5319 const void *pKey, int nKey /* The key */
5320 );
5321
@@ -5324,35 +5325,35 @@
5325 ** database is decrypted.
5326 **
5327 ** The code to implement this API is not available in the public release
5328 ** of SQLite.
5329 */
5330 SQLITE_API int SQLITE_STDCALL sqlite3_rekey(
5331 sqlite3 *db, /* Database to be rekeyed */
5332 const void *pKey, int nKey /* The new key */
5333 );
5334 SQLITE_API int SQLITE_STDCALL sqlite3_rekey_v2(
5335 sqlite3 *db, /* Database to be rekeyed */
5336 const char *zDbName, /* Name of the database */
5337 const void *pKey, int nKey /* The new key */
5338 );
5339
5340 /*
5341 ** Specify the activation key for a SEE database. Unless
5342 ** activated, none of the SEE routines will work.
5343 */
5344 SQLITE_API void SQLITE_STDCALL sqlite3_activate_see(
5345 const char *zPassPhrase /* Activation phrase */
5346 );
5347 #endif
5348
5349 #ifdef SQLITE_ENABLE_CEROD
5350 /*
5351 ** Specify the activation key for a CEROD database. Unless
5352 ** activated, none of the CEROD routines will work.
5353 */
5354 SQLITE_API void SQLITE_STDCALL sqlite3_activate_cerod(
5355 const char *zPassPhrase /* Activation phrase */
5356 );
5357 #endif
5358
5359 /*
@@ -5370,11 +5371,11 @@
5371 ** method of the default [sqlite3_vfs] object. If the xSleep() method
5372 ** of the default VFS is not implemented correctly, or not implemented at
5373 ** all, then the behavior of sqlite3_sleep() may deviate from the description
5374 ** in the previous paragraphs.
5375 */
5376 SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int);
5377
5378 /*
5379 ** CAPI3REF: Name Of The Folder Holding Temporary Files
5380 **
5381 ** ^(If this global variable is made to point to a string which is
@@ -5489,11 +5490,11 @@
5490 **
5491 ** If another thread changes the autocommit status of the database
5492 ** connection while this routine is running, then the return value
5493 ** is undefined.
5494 */
5495 SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3*);
5496
5497 /*
5498 ** CAPI3REF: Find The Database Handle Of A Prepared Statement
5499 ** METHOD: sqlite3_stmt
5500 **
@@ -5502,11 +5503,11 @@
5503 ** returned by sqlite3_db_handle is the same [database connection]
5504 ** that was the first argument
5505 ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
5506 ** create the statement in the first place.
5507 */
5508 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt*);
5509
5510 /*
5511 ** CAPI3REF: Return The Filename For A Database Connection
5512 ** METHOD: sqlite3
5513 **
@@ -5519,21 +5520,21 @@
5520 ** ^The filename returned by this function is the output of the
5521 ** xFullPathname method of the [VFS]. ^In other words, the filename
5522 ** will be an absolute pathname, even if the filename used
5523 ** to open the database originally was a URI or relative pathname.
5524 */
5525 SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
5526
5527 /*
5528 ** CAPI3REF: Determine if a database is read-only
5529 ** METHOD: sqlite3
5530 **
5531 ** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N
5532 ** of connection D is read-only, 0 if it is read/write, or -1 if N is not
5533 ** the name of a database on connection D.
5534 */
5535 SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
5536
5537 /*
5538 ** CAPI3REF: Find the next prepared statement
5539 ** METHOD: sqlite3
5540 **
@@ -5545,11 +5546,11 @@
5546 **
5547 ** The [database connection] pointer D in a call to
5548 ** [sqlite3_next_stmt(D,S)] must refer to an open database
5549 ** connection and in particular must not be a NULL pointer.
5550 */
5551 SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
5552
5553 /*
5554 ** CAPI3REF: Commit And Rollback Notification Callbacks
5555 ** METHOD: sqlite3
5556 **
@@ -5594,12 +5595,12 @@
5595 ** ^The rollback callback is not invoked if a transaction is
5596 ** automatically rolled back because the database connection is closed.
5597 **
5598 ** See also the [sqlite3_update_hook()] interface.
5599 */
5600 SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
5601 SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
5602
5603 /*
5604 ** CAPI3REF: Data Change Notification Callbacks
5605 ** METHOD: sqlite3
5606 **
@@ -5646,13 +5647,13 @@
5647 ** the first call on D.
5648 **
5649 ** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()],
5650 ** and [sqlite3_preupdate_hook()] interfaces.
5651 */
5652 SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
5653 sqlite3*,
5654 void(*)(void *,int ,char const *,char const *,sqlite3_int64),
5655 void*
5656 );
5657
5658 /*
5659 ** CAPI3REF: Enable Or Disable Shared Pager Cache
@@ -5686,11 +5687,11 @@
5687 ** This interface is threadsafe on processors where writing a
5688 ** 32-bit integer is atomic.
5689 **
5690 ** See Also: [SQLite Shared-Cache Mode]
5691 */
5692 SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int);
5693
5694 /*
5695 ** CAPI3REF: Attempt To Free Heap Memory
5696 **
5697 ** ^The sqlite3_release_memory() interface attempts to free N bytes
@@ -5702,11 +5703,11 @@
5703 ** ^The sqlite3_release_memory() routine is a no-op returning zero
5704 ** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5705 **
5706 ** See also: [sqlite3_db_release_memory()]
5707 */
5708 SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int);
5709
5710 /*
5711 ** CAPI3REF: Free Memory Used By A Database Connection
5712 ** METHOD: sqlite3
5713 **
@@ -5716,11 +5717,11 @@
5717 ** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
5718 ** omitted.
5719 **
5720 ** See also: [sqlite3_release_memory()]
5721 */
5722 SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3*);
5723
5724 /*
5725 ** CAPI3REF: Impose A Limit On Heap Size
5726 **
5727 ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the
@@ -5768,11 +5769,11 @@
5769 ** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5770 **
5771 ** The circumstances under which SQLite will enforce the soft heap limit may
5772 ** changes in future releases of SQLite.
5773 */
5774 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
5775
5776 /*
5777 ** CAPI3REF: Deprecated Soft Heap Limit Interface
5778 ** DEPRECATED
5779 **
@@ -5779,11 +5780,11 @@
5780 ** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
5781 ** interface. This routine is provided for historical compatibility
5782 ** only. All new applications should use the
5783 ** [sqlite3_soft_heap_limit64()] interface rather than this one.
5784 */
5785 SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_soft_heap_limit(int N);
5786
5787
5788 /*
5789 ** CAPI3REF: Extract Metadata About A Column Of A Table
5790 ** METHOD: sqlite3
@@ -5849,11 +5850,11 @@
5850 **
5851 ** ^This function causes all database schemas to be read from disk and
5852 ** parsed, if that has not already been done, and returns an error if
5853 ** any errors are encountered while loading the schema.
5854 */
5855 SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
5856 sqlite3 *db, /* Connection handle */
5857 const char *zDbName, /* Database name or NULL */
5858 const char *zTableName, /* Table name */
5859 const char *zColumnName, /* Column name */
5860 char const **pzDataType, /* OUTPUT: Declared data type */
@@ -5905,11 +5906,11 @@
5906 ** disabled and prevent SQL injections from giving attackers
5907 ** access to extension loading capabilities.
5908 **
5909 ** See also the [load_extension() SQL function].
5910 */
5911 SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
5912 sqlite3 *db, /* Load the extension into this database connection */
5913 const char *zFile, /* Name of the shared library containing extension */
5914 const char *zProc, /* Entry point. Derived from zFile if 0 */
5915 char **pzErrMsg /* Put error message here if not 0 */
5916 );
@@ -5928,20 +5929,20 @@
5929 ** to turn extension loading on and call it with onoff==0 to turn
5930 ** it back off again.
5931 **
5932 ** ^This interface enables or disables both the C-API
5933 ** [sqlite3_load_extension()] and the SQL function [load_extension()].
5934 ** ^(Use [sqlite3_db_config](db,[SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION],..)
5935 ** to enable or disable only the C-API.)^
5936 **
5937 ** <b>Security warning:</b> It is recommended that extension loading
5938 ** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method
5939 ** rather than this interface, so the [load_extension()] SQL function
5940 ** remains disabled. This will prevent SQL injections from giving attackers
5941 ** access to extension loading capabilities.
5942 */
5943 SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
5944
5945 /*
5946 ** CAPI3REF: Automatically Load Statically Linked Extensions
5947 **
5948 ** ^This interface causes the xEntryPoint() function to be invoked for
@@ -5975,11 +5976,11 @@
5976 ** will be called more than once for each database connection that is opened.
5977 **
5978 ** See also: [sqlite3_reset_auto_extension()]
5979 ** and [sqlite3_cancel_auto_extension()]
5980 */
5981 SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void(*xEntryPoint)(void));
5982
5983 /*
5984 ** CAPI3REF: Cancel Automatic Extension Loading
5985 **
5986 ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
@@ -5987,19 +5988,19 @@
5988 ** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)]
5989 ** routine returns 1 if initialization routine X was successfully
5990 ** unregistered and it returns 0 if X was not on the list of initialization
5991 ** routines.
5992 */
5993 SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void(*xEntryPoint)(void));
5994
5995 /*
5996 ** CAPI3REF: Reset Automatic Extension Loading
5997 **
5998 ** ^This interface disables all automatic extensions previously
5999 ** registered using [sqlite3_auto_extension()].
6000 */
6001 SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void);
6002
6003 /*
6004 ** The interface to the virtual-table mechanism is currently considered
6005 ** to be experimental. The interface might change in incompatible ways.
6006 ** If this is a problem for you, do not use the interface at this time.
@@ -6032,41 +6033,41 @@
6033 ** of this structure must not change while it is registered with
6034 ** any database connection.
6035 */
6036 struct sqlite3_module {
6037 int iVersion;
6038 int (*xCreate)(sqlite3*, void *pAux,
6039 int argc, const char *const*argv,
6040 sqlite3_vtab **ppVTab, char**);
6041 int (*xConnect)(sqlite3*, void *pAux,
6042 int argc, const char *const*argv,
6043 sqlite3_vtab **ppVTab, char**);
6044 int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
6045 int (*xDisconnect)(sqlite3_vtab *pVTab);
6046 int (*xDestroy)(sqlite3_vtab *pVTab);
6047 int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);
6048 int (*xClose)(sqlite3_vtab_cursor*);
6049 int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
6050 int argc, sqlite3_value **argv);
6051 int (*xNext)(sqlite3_vtab_cursor*);
6052 int (*xEof)(sqlite3_vtab_cursor*);
6053 int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int);
6054 int (*xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid);
6055 int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *);
6056 int (*xBegin)(sqlite3_vtab *pVTab);
6057 int (*xSync)(sqlite3_vtab *pVTab);
6058 int (*xCommit)(sqlite3_vtab *pVTab);
6059 int (*xRollback)(sqlite3_vtab *pVTab);
6060 int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,
6061 void (**pxFunc)(sqlite3_context*,int,sqlite3_value**),
6062 void **ppArg);
6063 int (*xRename)(sqlite3_vtab *pVtab, const char *zNew);
6064 /* The methods above are in version 1 of the sqlite_module object. Those
6065 ** below are for version 2 and greater. */
6066 int (*xSavepoint)(sqlite3_vtab *pVTab, int);
6067 int (*xRelease)(sqlite3_vtab *pVTab, int);
6068 int (*xRollbackTo)(sqlite3_vtab *pVTab, int);
6069 };
6070
6071 /*
6072 ** CAPI3REF: Virtual Table Indexing Information
6073 ** KEYWORDS: sqlite3_index_info
@@ -6240,22 +6241,22 @@
6241 ** be invoked if the call to sqlite3_create_module_v2() fails.
6242 ** ^The sqlite3_create_module()
6243 ** interface is equivalent to sqlite3_create_module_v2() with a NULL
6244 ** destructor.
6245 */
6246 SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
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 );
6252 SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
6253 sqlite3 *db, /* SQLite connection to register module with */
6254 const char *zName, /* Name of the module */
6255 const sqlite3_module *p, /* Methods for the module */
6256 void *pClientData, /* Client data for xCreate/xConnect */
6257 void(*xDestroy)(void*) /* Module destructor function */
6258 );
6259
6260 /*
6261 ** CAPI3REF: Virtual Table Instance Object
6262 ** KEYWORDS: sqlite3_vtab
@@ -6309,11 +6310,11 @@
6310 ** ^The [xCreate] and [xConnect] methods of a
6311 ** [virtual table module] call this interface
6312 ** to declare the format (the names and datatypes of the columns) of
6313 ** the virtual tables they implement.
6314 */
6315 SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
6316
6317 /*
6318 ** CAPI3REF: Overload A Function For A Virtual Table
6319 ** METHOD: sqlite3
6320 **
@@ -6328,11 +6329,11 @@
6329 ** of the new function always causes an exception to be thrown. So
6330 ** the new function is not good for anything by itself. Its only
6331 ** purpose is to be a placeholder function that can be overloaded
6332 ** by a [virtual table].
6333 */
6334 SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
6335
6336 /*
6337 ** The interface to the virtual-table mechanism defined above (back up
6338 ** to a comment remarkably similar to this one) is currently considered
6339 ** to be experimental. The interface might change in incompatible ways.
@@ -6427,11 +6428,11 @@
6428 ** zero-filled blob to read or write using the incremental-blob interface.
6429 **
6430 ** To avoid a resource leak, every open [BLOB handle] should eventually
6431 ** be released by a call to [sqlite3_blob_close()].
6432 */
6433 SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
6434 sqlite3*,
6435 const char *zDb,
6436 const char *zTable,
6437 const char *zColumn,
6438 sqlite3_int64 iRow,
@@ -6460,11 +6461,11 @@
6461 ** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
6462 ** always returns zero.
6463 **
6464 ** ^This function sets the database handle error code and message.
6465 */
6466 SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
6467
6468 /*
6469 ** CAPI3REF: Close A BLOB Handle
6470 ** DESTRUCTOR: sqlite3_blob
6471 **
@@ -6483,11 +6484,11 @@
6484 ** with a null pointer (such as would be returned by a failed call to
6485 ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function
6486 ** is passed a valid open blob handle, the values returned by the
6487 ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning.
6488 */
6489 SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *);
6490
6491 /*
6492 ** CAPI3REF: Return The Size Of An Open BLOB
6493 ** METHOD: sqlite3_blob
6494 **
@@ -6499,11 +6500,11 @@
6500 ** This routine only works on a [BLOB handle] which has been created
6501 ** by a prior successful call to [sqlite3_blob_open()] and which has not
6502 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6503 ** to this routine results in undefined and probably undesirable behavior.
6504 */
6505 SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *);
6506
6507 /*
6508 ** CAPI3REF: Read Data From A BLOB Incrementally
6509 ** METHOD: sqlite3_blob
6510 **
@@ -6528,11 +6529,11 @@
6529 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6530 ** to this routine results in undefined and probably undesirable behavior.
6531 **
6532 ** See also: [sqlite3_blob_write()].
6533 */
6534 SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
6535
6536 /*
6537 ** CAPI3REF: Write Data Into A BLOB Incrementally
6538 ** METHOD: sqlite3_blob
6539 **
@@ -6570,11 +6571,11 @@
6571 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6572 ** to this routine results in undefined and probably undesirable behavior.
6573 **
6574 ** See also: [sqlite3_blob_read()].
6575 */
6576 SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
6577
6578 /*
6579 ** CAPI3REF: Virtual File System Objects
6580 **
6581 ** A virtual filesystem (VFS) is an [sqlite3_vfs] object
@@ -6601,13 +6602,13 @@
6602 **
6603 ** ^Unregister a VFS with the sqlite3_vfs_unregister() interface.
6604 ** ^(If the default VFS is unregistered, another VFS is chosen as
6605 ** the default. The choice for the new VFS is arbitrary.)^
6606 */
6607 SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfsName);
6608 SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
6609 SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs*);
6610
6611 /*
6612 ** CAPI3REF: Mutexes
6613 **
6614 ** The SQLite core uses these routines for thread
@@ -6719,15 +6720,15 @@
6720 ** sqlite3_mutex_leave() is a NULL pointer, then all three routines
6721 ** behave as no-ops.
6722 **
6723 ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
6724 */
6725 SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int);
6726 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*);
6727 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*);
6728 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*);
6729 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*);
6730
6731 /*
6732 ** CAPI3REF: Mutex Methods Object
6733 **
6734 ** An instance of this structure defines the low-level routines
@@ -6792,19 +6793,19 @@
6793 ** If xMutexInit fails in any way, it is expected to clean up after itself
6794 ** prior to returning.
6795 */
6796 typedef struct sqlite3_mutex_methods sqlite3_mutex_methods;
6797 struct sqlite3_mutex_methods {
6798 int (*xMutexInit)(void);
6799 int (*xMutexEnd)(void);
6800 sqlite3_mutex *(*xMutexAlloc)(int);
6801 void (*xMutexFree)(sqlite3_mutex *);
6802 void (*xMutexEnter)(sqlite3_mutex *);
6803 int (*xMutexTry)(sqlite3_mutex *);
6804 void (*xMutexLeave)(sqlite3_mutex *);
6805 int (*xMutexHeld)(sqlite3_mutex *);
6806 int (*xMutexNotheld)(sqlite3_mutex *);
6807 };
6808
6809 /*
6810 ** CAPI3REF: Mutex Verification Routines
6811 **
@@ -6833,12 +6834,12 @@
6834 ** call to sqlite3_mutex_held() to fail, so a non-zero return is
6835 ** the appropriate thing to do. The sqlite3_mutex_notheld()
6836 ** interface should also return 1 when given a NULL pointer.
6837 */
6838 #ifndef NDEBUG
6839 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex*);
6840 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex*);
6841 #endif
6842
6843 /*
6844 ** CAPI3REF: Mutex Types
6845 **
@@ -6874,11 +6875,11 @@
6875 ** serializes access to the [database connection] given in the argument
6876 ** when the [threading mode] is Serialized.
6877 ** ^If the [threading mode] is Single-thread or Multi-thread then this
6878 ** routine returns a NULL pointer.
6879 */
6880 SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3*);
6881
6882 /*
6883 ** CAPI3REF: Low-Level Control Of Database Files
6884 ** METHOD: sqlite3
6885 **
@@ -6909,11 +6910,11 @@
6910 ** an incorrect zDbName and an SQLITE_ERROR return from the underlying
6911 ** xFileControl method.
6912 **
6913 ** See also: [SQLITE_FCNTL_LOCKSTATE]
6914 */
6915 SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
6916
6917 /*
6918 ** CAPI3REF: Testing Interface
6919 **
6920 ** ^The sqlite3_test_control() interface is used to read out internal
@@ -6991,12 +6992,12 @@
6992 ** be represented by a 32-bit integer, then the values returned by
6993 ** sqlite3_status() are undefined.
6994 **
6995 ** See also: [sqlite3_db_status()]
6996 */
6997 SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6998 SQLITE_API int SQLITE_STDCALL sqlite3_status64(
6999 int op,
7000 sqlite3_int64 *pCurrent,
7001 sqlite3_int64 *pHighwater,
7002 int resetFlag
7003 );
@@ -7117,11 +7118,11 @@
7118 ** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a
7119 ** non-zero [error code] on failure.
7120 **
7121 ** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
7122 */
7123 SQLITE_API int SQLITE_STDCALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
7124
7125 /*
7126 ** CAPI3REF: Status Parameters for database connections
7127 ** KEYWORDS: {SQLITE_DBSTATUS options}
7128 **
@@ -7260,11 +7261,11 @@
7261 ** ^If the resetFlg is true, then the counter is reset to zero after this
7262 ** interface call returns.
7263 **
7264 ** See also: [sqlite3_status()] and [sqlite3_db_status()].
7265 */
7266 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
7267
7268 /*
7269 ** CAPI3REF: Status Parameters for prepared statements
7270 ** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters}
7271 **
@@ -7496,22 +7497,22 @@
7497 */
7498 typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2;
7499 struct sqlite3_pcache_methods2 {
7500 int iVersion;
7501 void *pArg;
7502 int (*xInit)(void*);
7503 void (*xShutdown)(void*);
7504 sqlite3_pcache *(*xCreate)(int szPage, int szExtra, int bPurgeable);
7505 void (*xCachesize)(sqlite3_pcache*, int nCachesize);
7506 int (*xPagecount)(sqlite3_pcache*);
7507 sqlite3_pcache_page *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7508 void (*xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard);
7509 void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*,
7510 unsigned oldKey, unsigned newKey);
7511 void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
7512 void (*xDestroy)(sqlite3_pcache*);
7513 void (*xShrink)(sqlite3_pcache*);
7514 };
7515
7516 /*
7517 ** This is the obsolete pcache_methods object that has now been replaced
7518 ** by sqlite3_pcache_methods2. This object is not used by SQLite. It is
@@ -7518,20 +7519,20 @@
7519 ** retained in the header file for backwards compatibility only.
7520 */
7521 typedef struct sqlite3_pcache_methods sqlite3_pcache_methods;
7522 struct sqlite3_pcache_methods {
7523 void *pArg;
7524 int (*xInit)(void*);
7525 void (*xShutdown)(void*);
7526 sqlite3_pcache *(*xCreate)(int szPage, int bPurgeable);
7527 void (*xCachesize)(sqlite3_pcache*, int nCachesize);
7528 int (*xPagecount)(sqlite3_pcache*);
7529 void *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7530 void (*xUnpin)(sqlite3_pcache*, void*, int discard);
7531 void (*xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey);
7532 void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
7533 void (*xDestroy)(sqlite3_pcache*);
7534 };
7535
7536
7537 /*
7538 ** CAPI3REF: Online Backup Object
@@ -7729,20 +7730,20 @@
7730 ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()
7731 ** APIs are not strictly speaking threadsafe. If they are invoked at the
7732 ** same time as another thread is invoking sqlite3_backup_step() it is
7733 ** possible that they return invalid values.
7734 */
7735 SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
7736 sqlite3 *pDest, /* Destination database handle */
7737 const char *zDestName, /* Destination database name */
7738 sqlite3 *pSource, /* Source database handle */
7739 const char *zSourceName /* Source database name */
7740 );
7741 SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage);
7742 SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p);
7743 SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p);
7744 SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p);
7745
7746 /*
7747 ** CAPI3REF: Unlock Notification
7748 ** METHOD: sqlite3
7749 **
@@ -7855,13 +7856,13 @@
7856 ** by an sqlite3_step() call. ^(If there is a blocking connection, then the
7857 ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in
7858 ** the special "DROP TABLE/INDEX" case, the extended error code is just
7859 ** SQLITE_LOCKED.)^
7860 */
7861 SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
7862 sqlite3 *pBlocked, /* Waiting connection */
7863 void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */
7864 void *pNotifyArg /* Argument to pass to xNotify */
7865 );
7866
7867
7868 /*
@@ -7870,12 +7871,12 @@
7871 ** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications
7872 ** and extensions to compare the contents of two buffers containing UTF-8
7873 ** strings in a case-independent fashion, using the same definition of "case
7874 ** independence" that SQLite uses internally when comparing identifiers.
7875 */
7876 SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *, const char *);
7877 SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *, const char *, int);
7878
7879 /*
7880 ** CAPI3REF: String Globbing
7881 *
7882 ** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if
@@ -7888,11 +7889,11 @@
7889 ** Note that this routine returns zero on a match and non-zero if the strings
7890 ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
7891 **
7892 ** See also: [sqlite3_strlike()].
7893 */
7894 SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlob, const char *zStr);
7895
7896 /*
7897 ** CAPI3REF: String LIKE Matching
7898 *
7899 ** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if
@@ -7911,11 +7912,11 @@
7912 ** Note that this routine returns zero on a match and non-zero if the strings
7913 ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
7914 **
7915 ** See also: [sqlite3_strglob()].
7916 */
7917 SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
7918
7919 /*
7920 ** CAPI3REF: Error Logging Interface
7921 **
7922 ** ^The [sqlite3_log()] interface writes a message into the [error log]
@@ -7970,13 +7971,13 @@
7971 ** previously registered write-ahead log callback. ^Note that the
7972 ** [sqlite3_wal_autocheckpoint()] interface and the
7973 ** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will
7974 ** overwrite any prior [sqlite3_wal_hook()] settings.
7975 */
7976 SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
7977 sqlite3*,
7978 int(*)(void *,sqlite3*,const char*,int),
7979 void*
7980 );
7981
7982 /*
7983 ** CAPI3REF: Configure an auto-checkpoint
@@ -8005,11 +8006,11 @@
8006 ** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]
8007 ** pages. The use of this interface
8008 ** is only necessary if the default setting is found to be suboptimal
8009 ** for a particular application.
8010 */
8011 SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
8012
8013 /*
8014 ** CAPI3REF: Checkpoint a database
8015 ** METHOD: sqlite3
8016 **
@@ -8027,11 +8028,11 @@
8028 ** interface was added. This interface is retained for backwards
8029 ** compatibility and as a convenience for applications that need to manually
8030 ** start a callback but which do not need the full power (and corresponding
8031 ** complication) of [sqlite3_wal_checkpoint_v2()].
8032 */
8033 SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
8034
8035 /*
8036 ** CAPI3REF: Checkpoint a database
8037 ** METHOD: sqlite3
8038 **
@@ -8121,11 +8122,11 @@
8122 ** [sqlite3_errcode()] and [sqlite3_errmsg()].
8123 **
8124 ** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface
8125 ** from SQL.
8126 */
8127 SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
8128 sqlite3 *db, /* Database handle */
8129 const char *zDb, /* Name of attached database (or NULL) */
8130 int eMode, /* SQLITE_CHECKPOINT_* value */
8131 int *pnLog, /* OUT: Size of WAL log in frames */
8132 int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -8210,11 +8211,11 @@
8211 ** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL],
8212 ** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode
8213 ** of the SQL statement that triggered the call to the [xUpdate] method of the
8214 ** [virtual table].
8215 */
8216 SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *);
8217
8218 /*
8219 ** CAPI3REF: Conflict resolution modes
8220 ** KEYWORDS: {conflict resolution mode}
8221 **
@@ -8315,11 +8316,11 @@
8316 ** as if the loop did not exist - it returns non-zero and leave the variable
8317 ** that pOut points to unchanged.
8318 **
8319 ** See also: [sqlite3_stmt_scanstatus_reset()]
8320 */
8321 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus(
8322 sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
8323 int idx, /* Index of loop to report on */
8324 int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
8325 void *pOut /* Result written here */
8326 );
@@ -8331,11 +8332,11 @@
8332 ** ^Zero all [sqlite3_stmt_scanstatus()] related event counters.
8333 **
8334 ** This API is only available if the library is built with pre-processor
8335 ** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined.
8336 */
8337 SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
8338
8339 /*
8340 ** CAPI3REF: Flush caches to disk mid-transaction
8341 **
8342 ** ^If a write-transaction is open on [database connection] D when the
@@ -8363,11 +8364,11 @@
8364 ** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK.
8365 **
8366 ** ^This function does not set the database handle error code or message
8367 ** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions.
8368 */
8369 SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3*);
8370
8371 /*
8372 ** CAPI3REF: The pre-update hook.
8373 **
8374 ** ^These interfaces are only available if SQLite is compiled using the
@@ -8443,13 +8444,13 @@
8444 ** triggers; or 2 for changes resulting from triggers called by top-level
8445 ** triggers; and so forth.
8446 **
8447 ** See also: [sqlite3_update_hook()]
8448 */
8449 SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_STDCALL sqlite3_preupdate_hook(
8450 sqlite3 *db,
8451 void(*xPreUpdate)(
8452 void *pCtx, /* Copy of third arg to preupdate_hook() */
8453 sqlite3 *db, /* Database handle */
8454 int op, /* SQLITE_UPDATE, DELETE or INSERT */
8455 char const *zDb, /* Database name */
8456 char const *zName, /* Table name */
@@ -8456,14 +8457,14 @@
8457 sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */
8458 sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */
8459 ),
8460 void*
8461 );
8462 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **);
8463 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *);
8464 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *);
8465 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **);
8466
8467 /*
8468 ** CAPI3REF: Low-level system error code
8469 **
8470 ** ^Attempt to return the underlying operating system error code or error
@@ -8471,11 +8472,11 @@
8472 ** The return value is OS-dependent. For example, on unix systems, after
8473 ** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be
8474 ** called to get back the underlying "errno" that caused the problem, such
8475 ** as ENOSPC, EAUTH, EISDIR, and so forth.
8476 */
8477 SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3*);
8478
8479 /*
8480 ** CAPI3REF: Database Snapshot
8481 ** KEYWORDS: {snapshot}
8482 ** EXPERIMENTAL
@@ -8521,11 +8522,11 @@
8522 ** to avoid a memory leak.
8523 **
8524 ** The [sqlite3_snapshot_get()] interface is only available when the
8525 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8526 */
8527 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_get(
8528 sqlite3 *db,
8529 const char *zSchema,
8530 sqlite3_snapshot **ppSnapshot
8531 );
8532
@@ -8559,11 +8560,11 @@
8560 ** database connection in order to make it ready to use snapshots.)
8561 **
8562 ** The [sqlite3_snapshot_open()] interface is only available when the
8563 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8564 */
8565 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_open(
8566 sqlite3 *db,
8567 const char *zSchema,
8568 sqlite3_snapshot *pSnapshot
8569 );
8570
@@ -8576,11 +8577,11 @@
8577 ** using this routine to avoid a memory leak.
8578 **
8579 ** The [sqlite3_snapshot_free()] interface is only available when the
8580 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8581 */
8582 SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot*);
8583
8584 /*
8585 ** CAPI3REF: Compare the ages of two snapshot handles.
8586 ** EXPERIMENTAL
8587 **
@@ -8600,11 +8601,11 @@
8601 **
8602 ** Otherwise, this API returns a negative value if P1 refers to an older
8603 ** snapshot than P2, zero if the two handles refer to the same database
8604 ** snapshot, and a positive value if P1 is a newer snapshot than P2.
8605 */
8606 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_cmp(
8607 sqlite3_snapshot *p1,
8608 sqlite3_snapshot *p2
8609 );
8610
8611 /*
@@ -8658,14 +8659,14 @@
8659 ** Register a geometry callback named zGeom that can be used as part of an
8660 ** R-Tree geometry query as follows:
8661 **
8662 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
8663 */
8664 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
8665 sqlite3 *db,
8666 const char *zGeom,
8667 int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
8668 void *pContext
8669 );
8670
8671
8672 /*
@@ -8675,25 +8676,25 @@
8676 struct sqlite3_rtree_geometry {
8677 void *pContext; /* Copy of pContext passed to s_r_g_c() */
8678 int nParam; /* Size of array aParam[] */
8679 sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */
8680 void *pUser; /* Callback implementation user data */
8681 void (*xDelUser)(void *); /* Called by SQLite to clean up pUser */
8682 };
8683
8684 /*
8685 ** Register a 2nd-generation geometry callback named zScore that can be
8686 ** used as part of an R-Tree geometry query as follows:
8687 **
8688 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...)
8689 */
8690 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
8691 sqlite3 *db,
8692 const char *zQueryFunc,
8693 int (*xQueryFunc)(sqlite3_rtree_query_info*),
8694 void *pContext,
8695 void (*xDestructor)(void*)
8696 );
8697
8698
8699 /*
8700 ** A pointer to a structure of the following type is passed as the
@@ -8707,11 +8708,11 @@
8708 struct sqlite3_rtree_query_info {
8709 void *pContext; /* pContext from when function registered */
8710 int nParam; /* Number of function parameters */
8711 sqlite3_rtree_dbl *aParam; /* value of function parameters */
8712 void *pUser; /* callback can use this, if desired */
8713 void (*xDelUser)(void*); /* function to free pUser */
8714 sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */
8715 unsigned int *anQueue; /* Number of pending entries in the queue */
8716 int nCoord; /* Number of coordinates */
8717 int iLevel; /* Level of current node or entry */
8718 int mxLevel; /* The largest iLevel value in the tree */
@@ -8903,11 +8904,11 @@
8904 ** If xFilter returns 0, changes is not tracked. Note that once a table is
8905 ** attached, xFilter will not be called again.
8906 */
8907 void sqlite3session_table_filter(
8908 sqlite3_session *pSession, /* Session object */
8909 int(*xFilter)(
8910 void *pCtx, /* Copy of third arg to _filter_table() */
8911 const char *zTab /* Table name */
8912 ),
8913 void *pCtx /* First argument passed to xFilter */
8914 );
@@ -9478,11 +9479,11 @@
9479 ** An sqlite3_changegroup object is used to combine two or more changesets
9480 ** (or patchsets) into a single changeset (or patchset). A single changegroup
9481 ** object may combine changesets or patchsets, but not both. The output is
9482 ** always in the same format as the input.
9483 **
9484 ** If successful, this function returns SQLITE_OK and populates (*pp) with
9485 ** a pointer to a new sqlite3_changegroup object before returning. The caller
9486 ** should eventually free the returned object using a call to
9487 ** sqlite3changegroup_delete(). If an error occurs, an SQLite error code
9488 ** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL.
9489 **
@@ -9598,11 +9599,11 @@
9599 ** changes for tables that do not appear in the first changeset, they are
9600 ** appended onto the end of the output changeset, again in the order in
9601 ** which they are first encountered.
9602 **
9603 ** If an error occurs, an SQLite error code is returned and the output
9604 ** variables (*pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK
9605 ** is returned and the output variables are set to the size of and a
9606 ** pointer to the output buffer, respectively. In this case it is the
9607 ** responsibility of the caller to eventually free the buffer using a
9608 ** call to sqlite3_free().
9609 */
@@ -9755,15 +9756,15 @@
9756 */
9757 int sqlite3changeset_apply(
9758 sqlite3 *db, /* Apply change to "main" db of this handle */
9759 int nChangeset, /* Size of changeset in bytes */
9760 void *pChangeset, /* Changeset blob */
9761 int(*xFilter)(
9762 void *pCtx, /* Copy of sixth arg to _apply() */
9763 const char *zTab /* Table name */
9764 ),
9765 int(*xConflict)(
9766 void *pCtx, /* Copy of sixth arg to _apply() */
9767 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
9768 sqlite3_changeset_iter *p /* Handle describing change and conflict */
9769 ),
9770 void *pCtx /* First argument passed to xConflict */
@@ -9900,20 +9901,20 @@
9901 ** </pre>
9902 **
9903 ** Is replaced by:
9904 **
9905 ** <pre>
9906 ** &nbsp; int (*xInput)(void *pIn, void *pData, int *pnData),
9907 ** &nbsp; void *pIn,
9908 ** </pre>
9909 **
9910 ** Each time the xInput callback is invoked by the sessions module, the first
9911 ** argument passed is a copy of the supplied pIn context pointer. The second
9912 ** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no
9913 ** error occurs the xInput method should copy up to (*pnData) bytes of data
9914 ** into the buffer and set (*pnData) to the actual number of bytes copied
9915 ** before returning SQLITE_OK. If the input is completely exhausted, (*pnData)
9916 ** should be set to zero to indicate this. Or, if an error occurs, an SQLite
9917 ** error code should be returned. In all cases, if an xInput callback returns
9918 ** an error, all processing is abandoned and the streaming API function
9919 ** returns a copy of the error code to the caller.
9920 **
@@ -9934,11 +9935,11 @@
9935 ** </pre>
9936 **
9937 ** Is replaced by:
9938 **
9939 ** <pre>
9940 ** &nbsp; int (*xOutput)(void *pOut, const void *pData, int nData),
9941 ** &nbsp; void *pOut
9942 ** </pre>
9943 **
9944 ** The xOutput callback is invoked zero or more times to return data to
9945 ** the application. The first parameter passed to each call is a copy of the
@@ -9954,58 +9955,58 @@
9955 ** parameter set to a value less than or equal to zero. Other than this,
9956 ** no guarantees are made as to the size of the chunks of data returned.
9957 */
9958 int sqlite3changeset_apply_strm(
9959 sqlite3 *db, /* Apply change to "main" db of this handle */
9960 int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
9961 void *pIn, /* First arg for xInput */
9962 int(*xFilter)(
9963 void *pCtx, /* Copy of sixth arg to _apply() */
9964 const char *zTab /* Table name */
9965 ),
9966 int(*xConflict)(
9967 void *pCtx, /* Copy of sixth arg to _apply() */
9968 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
9969 sqlite3_changeset_iter *p /* Handle describing change and conflict */
9970 ),
9971 void *pCtx /* First argument passed to xConflict */
9972 );
9973 int sqlite3changeset_concat_strm(
9974 int (*xInputA)(void *pIn, void *pData, int *pnData),
9975 void *pInA,
9976 int (*xInputB)(void *pIn, void *pData, int *pnData),
9977 void *pInB,
9978 int (*xOutput)(void *pOut, const void *pData, int nData),
9979 void *pOut
9980 );
9981 int sqlite3changeset_invert_strm(
9982 int (*xInput)(void *pIn, void *pData, int *pnData),
9983 void *pIn,
9984 int (*xOutput)(void *pOut, const void *pData, int nData),
9985 void *pOut
9986 );
9987 int sqlite3changeset_start_strm(
9988 sqlite3_changeset_iter **pp,
9989 int (*xInput)(void *pIn, void *pData, int *pnData),
9990 void *pIn
9991 );
9992 int sqlite3session_changeset_strm(
9993 sqlite3_session *pSession,
9994 int (*xOutput)(void *pOut, const void *pData, int nData),
9995 void *pOut
9996 );
9997 int sqlite3session_patchset_strm(
9998 sqlite3_session *pSession,
9999 int (*xOutput)(void *pOut, const void *pData, int nData),
10000 void *pOut
10001 );
10002 int sqlite3changegroup_add_strm(sqlite3_changegroup*,
10003 int (*xInput)(void *pIn, void *pData, int *pnData),
10004 void *pIn
10005 );
10006 int sqlite3changegroup_output_strm(sqlite3_changegroup*,
10007 int (*xOutput)(void *pOut, const void *pData, int nData),
10008 void *pOut
10009 );
10010
10011
10012 /*
@@ -10056,11 +10057,11 @@
10057
10058 typedef struct Fts5ExtensionApi Fts5ExtensionApi;
10059 typedef struct Fts5Context Fts5Context;
10060 typedef struct Fts5PhraseIter Fts5PhraseIter;
10061
10062 typedef void (*fts5_extension_function)(
10063 const Fts5ExtensionApi *pApi, /* API offered by current FTS version */
10064 Fts5Context *pFts, /* First arg to pass to pApi functions */
10065 sqlite3_context *pCtx, /* Context for returning result/error */
10066 int nVal, /* Number of values in apVal[] array */
10067 sqlite3_value **apVal /* Array of trailing arguments */
@@ -10107,15 +10108,15 @@
10108 ** This function may be quite inefficient if used with an FTS5 table
10109 ** created with the "columnsize=0" option.
10110 **
10111 ** xColumnText:
10112 ** This function attempts to retrieve the text of column iCol of the
10113 ** current document. If successful, (*pz) is set to point to a buffer
10114 ** containing the text in utf-8 encoding, (*pn) is set to the size in bytes
10115 ** (not characters) of the buffer and SQLITE_OK is returned. Otherwise,
10116 ** if an error occurs, an SQLite error code is returned and the final values
10117 ** of (*pz) and (*pn) are undefined.
10118 **
10119 ** xPhraseCount:
10120 ** Returns the number of phrases in the current query expression.
10121 **
10122 ** xPhraseSize:
@@ -10220,11 +10221,11 @@
10221 ** xRowCount(pFts5, pnRow)
10222 **
10223 ** This function is used to retrieve the total number of rows in the table.
10224 ** In other words, the same value that would be returned by:
10225 **
10226 ** SELECT count(*) FROM ftstable;
10227 **
10228 ** xPhraseFirst()
10229 ** This function is used, along with type Fts5PhraseIter and the xPhraseNext
10230 ** method, to iterate through all instances of a single query phrase within
10231 ** the current row. This is the same information as is accessible via the
@@ -10287,43 +10288,43 @@
10288 ** See xPhraseFirstColumn above.
10289 */
10290 struct Fts5ExtensionApi {
10291 int iVersion; /* Currently always set to 3 */
10292
10293 void *(*xUserData)(Fts5Context*);
10294
10295 int (*xColumnCount)(Fts5Context*);
10296 int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow);
10297 int (*xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken);
10298
10299 int (*xTokenize)(Fts5Context*,
10300 const char *pText, int nText, /* Text to tokenize */
10301 void *pCtx, /* Context passed to xToken() */
10302 int (*xToken)(void*, int, const char*, int, int, int) /* Callback */
10303 );
10304
10305 int (*xPhraseCount)(Fts5Context*);
10306 int (*xPhraseSize)(Fts5Context*, int iPhrase);
10307
10308 int (*xInstCount)(Fts5Context*, int *pnInst);
10309 int (*xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff);
10310
10311 sqlite3_int64 (*xRowid)(Fts5Context*);
10312 int (*xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn);
10313 int (*xColumnSize)(Fts5Context*, int iCol, int *pnToken);
10314
10315 int (*xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData,
10316 int(*)(const Fts5ExtensionApi*,Fts5Context*,void*)
10317 );
10318 int (*xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*));
10319 void *(*xGetAuxdata)(Fts5Context*, int bClear);
10320
10321 int (*xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*);
10322 void (*xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff);
10323
10324 int (*xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*);
10325 void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol);
10326 };
10327
10328 /*
10329 ** CUSTOM AUXILIARY FUNCTIONS
10330 *************************************************************************/
@@ -10347,11 +10348,11 @@
10348 ** The second and third arguments are an array of nul-terminated strings
10349 ** containing the tokenizer arguments, if any, specified following the
10350 ** tokenizer name as part of the CREATE VIRTUAL TABLE statement used
10351 ** to create the FTS5 table.
10352 **
10353 ** The final argument is an output variable. If successful, (*ppOut)
10354 ** should be set to point to the new tokenizer handle and SQLITE_OK
10355 ** returned. If an error occurs, some value other than SQLITE_OK should
10356 ** be returned. In this case, fts5 assumes that the final value of *ppOut
10357 ** is undefined.
10358 **
@@ -10521,17 +10522,17 @@
10522 ** inefficient.
10523 */
10524 typedef struct Fts5Tokenizer Fts5Tokenizer;
10525 typedef struct fts5_tokenizer fts5_tokenizer;
10526 struct fts5_tokenizer {
10527 int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
10528 void (*xDelete)(Fts5Tokenizer*);
10529 int (*xTokenize)(Fts5Tokenizer*,
10530 void *pCtx,
10531 int flags, /* Mask of FTS5_TOKENIZE_* flags */
10532 const char *pText, int nText,
10533 int (*xToken)(
10534 void *pCtx, /* Copy of 2nd argument to xTokenize() */
10535 int tflags, /* Mask of FTS5_TOKEN_* flags */
10536 const char *pToken, /* Pointer to buffer containing token */
10537 int nToken, /* Size of token in bytes */
10538 int iStart, /* Byte offset of token within input text */
@@ -10560,33 +10561,33 @@
10561 typedef struct fts5_api fts5_api;
10562 struct fts5_api {
10563 int iVersion; /* Currently always set to 2 */
10564
10565 /* Create a new tokenizer */
10566 int (*xCreateTokenizer)(
10567 fts5_api *pApi,
10568 const char *zName,
10569 void *pContext,
10570 fts5_tokenizer *pTokenizer,
10571 void (*xDestroy)(void*)
10572 );
10573
10574 /* Find an existing tokenizer */
10575 int (*xFindTokenizer)(
10576 fts5_api *pApi,
10577 const char *zName,
10578 void **ppContext,
10579 fts5_tokenizer *pTokenizer
10580 );
10581
10582 /* Create a new auxiliary function */
10583 int (*xCreateFunction)(
10584 fts5_api *pApi,
10585 const char *zName,
10586 void *pContext,
10587 fts5_extension_function xFunction,
10588 void (*xDestroy)(void*)
10589 );
10590 };
10591
10592 /*
10593 ** END OF REGISTRATION API
@@ -11900,12 +11901,12 @@
11901 */
11902 #ifdef SQLITE_OMIT_WSD
11903 #define SQLITE_WSD const
11904 #define GLOBAL(t,v) (*(t*)sqlite3_wsd_find((void*)&(v), sizeof(v)))
11905 #define sqlite3GlobalConfig GLOBAL(struct Sqlite3Config, sqlite3Config)
11906 SQLITE_API int SQLITE_STDCALL sqlite3_wsd_init(int N, int J);
11907 SQLITE_API void *SQLITE_STDCALL sqlite3_wsd_find(void *K, int L);
11908 #else
11909 #define SQLITE_WSD
11910 #define GLOBAL(t,v) v
11911 #define sqlite3GlobalConfig sqlite3Config
11912 #endif
@@ -17560,11 +17561,11 @@
17561 ** was used and false if not.
17562 **
17563 ** The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix
17564 ** is not required for a match.
17565 */
17566 SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName){
17567 int i, n;
17568
17569 #if SQLITE_ENABLE_API_ARMOR
17570 if( zOptName==0 ){
17571 (void)SQLITE_MISUSE_BKPT;
@@ -17588,11 +17589,11 @@
17589
17590 /*
17591 ** Return the N-th compile-time option string. If N is out of range,
17592 ** return a NULL pointer.
17593 */
17594 SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N){
17595 if( N>=0 && N<ArraySize(azCompileOpt) ){
17596 return azCompileOpt[N];
17597 }
17598 return 0;
17599 }
@@ -18298,11 +18299,11 @@
18299 }
18300
18301 /*
18302 ** Query status information.
18303 */
18304 SQLITE_API int SQLITE_STDCALL sqlite3_status64(
18305 int op,
18306 sqlite3_int64 *pCurrent,
18307 sqlite3_int64 *pHighwater,
18308 int resetFlag
18309 ){
@@ -18323,11 +18324,11 @@
18324 }
18325 sqlite3_mutex_leave(pMutex);
18326 (void)pMutex; /* Prevent warning when SQLITE_THREADSAFE=0 */
18327 return SQLITE_OK;
18328 }
18329 SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){
18330 sqlite3_int64 iCur = 0, iHwtr = 0;
18331 int rc;
18332 #ifdef SQLITE_ENABLE_API_ARMOR
18333 if( pCurrent==0 || pHighwater==0 ) return SQLITE_MISUSE_BKPT;
18334 #endif
@@ -18340,11 +18341,11 @@
18341 }
18342
18343 /*
18344 ** Query status information for a single database connection
18345 */
18346 SQLITE_API int SQLITE_STDCALL sqlite3_db_status(
18347 sqlite3 *db, /* The database connection whose status is desired */
18348 int op, /* Status verb */
18349 int *pCurrent, /* Write current value here */
18350 int *pHighwater, /* Write high-water mark here */
18351 int resetFlag /* Reset high-water mark if true */
@@ -19632,11 +19633,10 @@
19633 int argc,
19634 sqlite3_value **argv
19635 ){
19636 time_t t;
19637 char *zFormat = (char *)sqlite3_user_data(context);
 
19638 sqlite3_int64 iT;
19639 struct tm *pTm;
19640 struct tm sNow;
19641 char zBuf[20];
19642
@@ -20018,11 +20018,11 @@
20018
20019 /*
20020 ** Locate a VFS by name. If no name is given, simply return the
20021 ** first VFS on the list.
20022 */
20023 SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfs){
20024 sqlite3_vfs *pVfs = 0;
20025 #if SQLITE_THREADSAFE
20026 sqlite3_mutex *mutex;
20027 #endif
20028 #ifndef SQLITE_OMIT_AUTOINIT
@@ -20064,11 +20064,11 @@
20064 /*
20065 ** Register a VFS with the system. It is harmless to register the same
20066 ** VFS multiple times. The new VFS becomes the default if makeDflt is
20067 ** true.
20068 */
20069 SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){
20070 MUTEX_LOGIC(sqlite3_mutex *mutex;)
20071 #ifndef SQLITE_OMIT_AUTOINIT
20072 int rc = sqlite3_initialize();
20073 if( rc ) return rc;
20074 #endif
@@ -20092,11 +20092,11 @@
20092 }
20093
20094 /*
20095 ** Unregister a VFS so that it is no longer accessible.
20096 */
20097 SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs *pVfs){
20098 #if SQLITE_THREADSAFE
20099 sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
20100 #endif
20101 sqlite3_mutex_enter(mutex);
20102 vfsUnlink(pVfs);
@@ -22443,11 +22443,11 @@
22443 }
22444
22445 /*
22446 ** Retrieve a pointer to a static mutex or allocate a new dynamic one.
22447 */
22448 SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int id){
22449 #ifndef SQLITE_OMIT_AUTOINIT
22450 if( id<=SQLITE_MUTEX_RECURSIVE && sqlite3_initialize() ) return 0;
22451 if( id>SQLITE_MUTEX_RECURSIVE && sqlite3MutexInit() ) return 0;
22452 #endif
22453 assert( sqlite3GlobalConfig.mutex.xMutexAlloc );
@@ -22464,11 +22464,11 @@
22464 }
22465
22466 /*
22467 ** Free a dynamic mutex.
22468 */
22469 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex *p){
22470 if( p ){
22471 assert( sqlite3GlobalConfig.mutex.xMutexFree );
22472 sqlite3GlobalConfig.mutex.xMutexFree(p);
22473 }
22474 }
@@ -22475,11 +22475,11 @@
22475
22476 /*
22477 ** Obtain the mutex p. If some other thread already has the mutex, block
22478 ** until it can be obtained.
22479 */
22480 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex *p){
22481 if( p ){
22482 assert( sqlite3GlobalConfig.mutex.xMutexEnter );
22483 sqlite3GlobalConfig.mutex.xMutexEnter(p);
22484 }
22485 }
@@ -22486,11 +22486,11 @@
22486
22487 /*
22488 ** Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another
22489 ** thread holds the mutex and it cannot be obtained, return SQLITE_BUSY.
22490 */
22491 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex *p){
22492 int rc = SQLITE_OK;
22493 if( p ){
22494 assert( sqlite3GlobalConfig.mutex.xMutexTry );
22495 return sqlite3GlobalConfig.mutex.xMutexTry(p);
22496 }
@@ -22501,11 +22501,11 @@
22501 ** The sqlite3_mutex_leave() routine exits a mutex that was previously
22502 ** entered by the same thread. The behavior is undefined if the mutex
22503 ** is not currently entered. If a NULL pointer is passed as an argument
22504 ** this function is a no-op.
22505 */
22506 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex *p){
22507 if( p ){
22508 assert( sqlite3GlobalConfig.mutex.xMutexLeave );
22509 sqlite3GlobalConfig.mutex.xMutexLeave(p);
22510 }
22511 }
@@ -22513,15 +22513,15 @@
22513 #ifndef NDEBUG
22514 /*
22515 ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are
22516 ** intended for use inside assert() statements.
22517 */
22518 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex *p){
22519 assert( p==0 || sqlite3GlobalConfig.mutex.xMutexHeld );
22520 return p==0 || sqlite3GlobalConfig.mutex.xMutexHeld(p);
22521 }
22522 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex *p){
22523 assert( p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld );
22524 return p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld(p);
22525 }
22526 #endif
22527
@@ -23549,12 +23549,12 @@
23549 ** of the sqlite3_initialize() and sqlite3_shutdown() processing, the
23550 ** "interlocked" magic used here is probably not strictly necessary.
23551 */
23552 static LONG SQLITE_WIN32_VOLATILE winMutex_lock = 0;
23553
23554 SQLITE_API int SQLITE_STDCALL sqlite3_win32_is_nt(void); /* os_win.c */
23555 SQLITE_API void SQLITE_STDCALL sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */
23556
23557 static int winMutexInit(void){
23558 /* The first to increment to 1 does actual initialization */
23559 if( InterlockedCompareExchange(&winMutex_lock, 1, 0)==0 ){
23560 int i;
@@ -23850,11 +23850,11 @@
23850 /*
23851 ** Attempt to release up to n bytes of non-essential memory currently
23852 ** held by SQLite. An example of non-essential memory is memory used to
23853 ** cache database pages that are not currently in use.
23854 */
23855 SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int n){
23856 #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
23857 return sqlite3PcacheReleaseMemory(n);
23858 #else
23859 /* IMPLEMENTATION-OF: R-34391-24921 The sqlite3_release_memory() routine
23860 ** is a no-op returning zero if SQLite is not compiled with
@@ -23909,11 +23909,11 @@
23909 /*
23910 ** Deprecated external interface. It used to set an alarm callback
23911 ** that was invoked when memory usage grew too large. Now it is a
23912 ** no-op.
23913 */
23914 SQLITE_API int SQLITE_STDCALL sqlite3_memory_alarm(
23915 void(*xCallback)(void *pArg, sqlite3_int64 used,int N),
23916 void *pArg,
23917 sqlite3_int64 iThreshold
23918 ){
23919 (void)xCallback;
@@ -23925,11 +23925,11 @@
23925
23926 /*
23927 ** Set the soft heap-size limit for the library. Passing a zero or
23928 ** negative value indicates no limit.
23929 */
23930 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 n){
23931 sqlite3_int64 priorLimit;
23932 sqlite3_int64 excess;
23933 sqlite3_int64 nUsed;
23934 #ifndef SQLITE_OMIT_AUTOINIT
23935 int rc = sqlite3_initialize();
@@ -23947,11 +23947,11 @@
23947 sqlite3_mutex_leave(mem0.mutex);
23948 excess = sqlite3_memory_used() - n;
23949 if( excess>0 ) sqlite3_release_memory((int)(excess & 0x7fffffff));
23950 return priorLimit;
23951 }
23952 SQLITE_API void SQLITE_STDCALL sqlite3_soft_heap_limit(int n){
23953 if( n<0 ) n = 0;
23954 sqlite3_soft_heap_limit64(n);
23955 }
23956
23957 /*
@@ -24016,11 +24016,11 @@
24016 }
24017
24018 /*
24019 ** Return the amount of memory currently checked out.
24020 */
24021 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void){
24022 sqlite3_int64 res, mx;
24023 sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, 0);
24024 return res;
24025 }
24026
@@ -24027,11 +24027,11 @@
24027 /*
24028 ** Return the maximum amount of memory that has ever been
24029 ** checked out since either the beginning of this process
24030 ** or since the most recent reset.
24031 */
24032 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag){
24033 sqlite3_int64 res, mx;
24034 sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, resetFlag);
24035 return mx;
24036 }
24037
@@ -24107,17 +24107,17 @@
24107 /*
24108 ** This version of the memory allocation is for use by the application.
24109 ** First make sure the memory subsystem is initialized, then do the
24110 ** allocation.
24111 */
24112 SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int n){
24113 #ifndef SQLITE_OMIT_AUTOINIT
24114 if( sqlite3_initialize() ) return 0;
24115 #endif
24116 return n<=0 ? 0 : sqlite3Malloc(n);
24117 }
24118 SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64 n){
24119 #ifndef SQLITE_OMIT_AUTOINIT
24120 if( sqlite3_initialize() ) return 0;
24121 #endif
24122 return sqlite3Malloc(n);
24123 }
@@ -24256,20 +24256,20 @@
24256 }else{
24257 assert( sqlite3_mutex_held(db->mutex) );
24258 return db->lookaside.sz;
24259 }
24260 }
24261 SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void *p){
24262 assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) );
24263 assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
24264 return p ? sqlite3GlobalConfig.m.xSize(p) : 0;
24265 }
24266
24267 /*
24268 ** Free memory previously obtained from sqlite3Malloc().
24269 */
24270 SQLITE_API void SQLITE_STDCALL sqlite3_free(void *p){
24271 if( p==0 ) return; /* IMP: R-49053-54554 */
24272 assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
24273 assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) );
24274 if( sqlite3GlobalConfig.bMemstat ){
24275 sqlite3_mutex_enter(mem0.mutex);
@@ -24374,18 +24374,18 @@
24374
24375 /*
24376 ** The public interface to sqlite3Realloc. Make sure that the memory
24377 ** subsystem is initialized prior to invoking sqliteRealloc.
24378 */
24379 SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void *pOld, int n){
24380 #ifndef SQLITE_OMIT_AUTOINIT
24381 if( sqlite3_initialize() ) return 0;
24382 #endif
24383 if( n<0 ) n = 0; /* IMP: R-26507-47431 */
24384 return sqlite3Realloc(pOld, n);
24385 }
24386 SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void *pOld, sqlite3_uint64 n){
24387 #ifndef SQLITE_OMIT_AUTOINIT
24388 if( sqlite3_initialize() ) return 0;
24389 #endif
24390 return sqlite3Realloc(pOld, n);
24391 }
@@ -25608,11 +25608,11 @@
25608
25609 /*
25610 ** Print into memory obtained from sqlite3_malloc(). Omit the internal
25611 ** %-conversion extensions.
25612 */
25613 SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char *zFormat, va_list ap){
25614 char *z;
25615 char zBase[SQLITE_PRINT_BUF_SIZE];
25616 StrAccum acc;
25617
25618 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -25657,11 +25657,11 @@
25657 ** this without breaking compatibility, so we just have to live with the
25658 ** mistake.
25659 **
25660 ** sqlite3_vsnprintf() is the varargs version.
25661 */
25662 SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int n, char *zBuf, const char *zFormat, va_list ap){
25663 StrAccum acc;
25664 if( n<=0 ) return zBuf;
25665 #ifdef SQLITE_ENABLE_API_ARMOR
25666 if( zBuf==0 || zFormat==0 ) {
25667 (void)SQLITE_MISUSE_BKPT;
@@ -26284,11 +26284,11 @@
26284 } sqlite3Prng;
26285
26286 /*
26287 ** Return N random bytes.
26288 */
26289 SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *pBuf){
26290 unsigned char t;
26291 unsigned char *zBuf = pBuf;
26292
26293 /* The "wsdPrng" macro will resolve to the pseudo-random number generator
26294 ** state vector. If writable static data is unsupported on the target,
@@ -27487,11 +27487,11 @@
27487 ** sqlite3_strnicmp() APIs allow applications and extensions to compare
27488 ** the contents of two buffers containing UTF-8 strings in a
27489 ** case-independent fashion, using the same definition of "case
27490 ** independence" that SQLite uses internally when comparing identifiers.
27491 */
27492 SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *zLeft, const char *zRight){
27493 if( zLeft==0 ){
27494 return zRight ? -1 : 0;
27495 }else if( zRight==0 ){
27496 return 1;
27497 }
@@ -27508,11 +27508,11 @@
27508 a++;
27509 b++;
27510 }
27511 return c;
27512 }
27513 SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){
27514 register unsigned char *a, *b;
27515 if( zLeft==0 ){
27516 return zRight ? -1 : 0;
27517 }else if( zRight==0 ){
27518 return 1;
@@ -36807,11 +36807,11 @@
36807 ** This routine is called once during SQLite initialization and by a
36808 ** single thread. The memory allocation and mutex subsystems have not
36809 ** necessarily been initialized when this routine is called, and so they
36810 ** should not be used.
36811 */
36812 SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void){
36813 /*
36814 ** The following macro defines an initializer for an sqlite3_vfs object.
36815 ** The name of the VFS is NAME. The pAppData is a pointer to a pointer
36816 ** to the "finder" function. (pAppData is a pointer to a pointer because
36817 ** silly C90 rules prohibit a void* from being cast to a function pointer
@@ -36906,11 +36906,11 @@
36906 **
36907 ** Some operating systems might need to do some cleanup in this routine,
36908 ** to release dynamically allocated objects. But not on unix.
36909 ** This routine is a no-op for unix.
36910 */
36911 SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void){
36912 return SQLITE_OK;
36913 }
36914
36915 #endif /* SQLITE_OS_UNIX */
36916
@@ -38341,11 +38341,11 @@
38341 ** compact it. Upon success, SQLITE_OK will be returned. Upon failure, one
38342 ** of SQLITE_NOMEM, SQLITE_ERROR, or SQLITE_NOTFOUND will be returned. The
38343 ** "pnLargest" argument, if non-zero, will be used to return the size of the
38344 ** largest committed free block in the heap, in bytes.
38345 */
38346 SQLITE_API int SQLITE_STDCALL sqlite3_win32_compact_heap(LPUINT pnLargest){
38347 int rc = SQLITE_OK;
38348 UINT nLargest = 0;
38349 HANDLE hHeap;
38350
38351 winMemAssertMagic();
@@ -38381,11 +38381,11 @@
38381 ** If a Win32 native heap has been configured, this function will attempt to
38382 ** destroy and recreate it. If the Win32 native heap is not isolated and/or
38383 ** the sqlite3_memory_used() function does not return zero, SQLITE_BUSY will
38384 ** be returned and no changes will be made to the Win32 native heap.
38385 */
38386 SQLITE_API int SQLITE_STDCALL sqlite3_win32_reset_heap(){
38387 int rc;
38388 MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */
38389 MUTEX_LOGIC( sqlite3_mutex *pMem; ) /* The memsys static mutex */
38390 MUTEX_LOGIC( pMaster = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); )
38391 MUTEX_LOGIC( pMem = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM); )
@@ -38426,11 +38426,11 @@
38426 /*
38427 ** This function outputs the specified (ANSI) string to the Win32 debugger
38428 ** (if available).
38429 */
38430
38431 SQLITE_API void SQLITE_STDCALL sqlite3_win32_write_debug(const char *zBuf, int nBuf){
38432 char zDbgBuf[SQLITE_WIN32_DBG_BUF_SIZE];
38433 int nMin = MIN(nBuf, (SQLITE_WIN32_DBG_BUF_SIZE - 1)); /* may be negative. */
38434 if( nMin<-1 ) nMin = -1; /* all negative values become -1. */
38435 assert( nMin==-1 || nMin==0 || nMin<SQLITE_WIN32_DBG_BUF_SIZE );
38436 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -38472,11 +38472,11 @@
38472 */
38473 #if SQLITE_OS_WINRT
38474 static HANDLE sleepObj = NULL;
38475 #endif
38476
38477 SQLITE_API void SQLITE_STDCALL sqlite3_win32_sleep(DWORD milliseconds){
38478 #if SQLITE_OS_WINRT
38479 if ( sleepObj==NULL ){
38480 sleepObj = osCreateEventExW(NULL, NULL, CREATE_EVENT_MANUAL_RESET,
38481 SYNCHRONIZE);
38482 }
@@ -38521,11 +38521,11 @@
38521
38522 /*
38523 ** This function determines if the machine is running a version of Windows
38524 ** based on the NT kernel.
38525 */
38526 SQLITE_API int SQLITE_STDCALL sqlite3_win32_is_nt(void){
38527 #if SQLITE_OS_WINRT
38528 /*
38529 ** NOTE: The WinRT sub-platform is always assumed to be based on the NT
38530 ** kernel.
38531 */
@@ -38909,11 +38909,11 @@
38909 }
38910
38911 /*
38912 ** This is a public wrapper for the winUtf8ToUnicode() function.
38913 */
38914 SQLITE_API LPWSTR SQLITE_STDCALL sqlite3_win32_utf8_to_unicode(const char *zText){
38915 #ifdef SQLITE_ENABLE_API_ARMOR
38916 if( !zText ){
38917 (void)SQLITE_MISUSE_BKPT;
38918 return 0;
38919 }
@@ -38925,11 +38925,11 @@
38925 }
38926
38927 /*
38928 ** This is a public wrapper for the winUnicodeToUtf8() function.
38929 */
38930 SQLITE_API char *SQLITE_STDCALL sqlite3_win32_unicode_to_utf8(LPCWSTR zWideText){
38931 #ifdef SQLITE_ENABLE_API_ARMOR
38932 if( !zWideText ){
38933 (void)SQLITE_MISUSE_BKPT;
38934 return 0;
38935 }
@@ -38941,11 +38941,11 @@
38941 }
38942
38943 /*
38944 ** This is a public wrapper for the winMbcsToUtf8() function.
38945 */
38946 SQLITE_API char *SQLITE_STDCALL sqlite3_win32_mbcs_to_utf8(const char *zText){
38947 #ifdef SQLITE_ENABLE_API_ARMOR
38948 if( !zText ){
38949 (void)SQLITE_MISUSE_BKPT;
38950 return 0;
38951 }
@@ -38957,11 +38957,11 @@
38957 }
38958
38959 /*
38960 ** This is a public wrapper for the winMbcsToUtf8() function.
38961 */
38962 SQLITE_API char *SQLITE_STDCALL sqlite3_win32_mbcs_to_utf8_v2(const char *zText, int useAnsi){
38963 #ifdef SQLITE_ENABLE_API_ARMOR
38964 if( !zText ){
38965 (void)SQLITE_MISUSE_BKPT;
38966 return 0;
38967 }
@@ -38973,11 +38973,11 @@
38973 }
38974
38975 /*
38976 ** This is a public wrapper for the winUtf8ToMbcs() function.
38977 */
38978 SQLITE_API char *SQLITE_STDCALL sqlite3_win32_utf8_to_mbcs(const char *zText){
38979 #ifdef SQLITE_ENABLE_API_ARMOR
38980 if( !zText ){
38981 (void)SQLITE_MISUSE_BKPT;
38982 return 0;
38983 }
@@ -38989,11 +38989,11 @@
38989 }
38990
38991 /*
38992 ** This is a public wrapper for the winUtf8ToMbcs() function.
38993 */
38994 SQLITE_API char *SQLITE_STDCALL sqlite3_win32_utf8_to_mbcs_v2(const char *zText, int useAnsi){
38995 #ifdef SQLITE_ENABLE_API_ARMOR
38996 if( !zText ){
38997 (void)SQLITE_MISUSE_BKPT;
38998 return 0;
38999 }
@@ -39009,11 +39009,11 @@
39009 ** the provided arguments. The type argument must be 1 in order to set the
39010 ** data directory or 2 in order to set the temporary directory. The zValue
39011 ** argument is the name of the directory to use. The return value will be
39012 ** SQLITE_OK if successful.
39013 */
39014 SQLITE_API int SQLITE_STDCALL sqlite3_win32_set_directory(DWORD type, LPCWSTR zValue){
39015 char **ppDirectory = 0;
39016 #ifndef SQLITE_OMIT_AUTOINIT
39017 int rc = sqlite3_initialize();
39018 if( rc ) return rc;
39019 #endif
@@ -42927,11 +42927,11 @@
42927 }
42928
42929 /*
42930 ** Initialize and deinitialize the operating system interface.
42931 */
42932 SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void){
42933 static sqlite3_vfs winVfs = {
42934 3, /* iVersion */
42935 sizeof(winFile), /* szOsFile */
42936 SQLITE_WIN32_MAX_PATH_BYTES, /* mxPathname */
42937 0, /* pNext */
@@ -43058,11 +43058,11 @@
43058 #endif
43059
43060 return SQLITE_OK;
43061 }
43062
43063 SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void){
43064 #if SQLITE_OS_WINRT
43065 if( sleepObj!=NULL ){
43066 osCloseHandle(sleepObj);
43067 sleepObj = NULL;
43068 }
@@ -57053,11 +57053,11 @@
57053
57054 /*
57055 ** Return a +ve value if snapshot p1 is newer than p2. A -ve value if
57056 ** p1 is older than p2 and zero if p1 and p2 are the same snapshot.
57057 */
57058 SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_cmp(sqlite3_snapshot *p1, sqlite3_snapshot *p2){
57059 WalIndexHdr *pHdr1 = (WalIndexHdr*)p1;
57060 WalIndexHdr *pHdr2 = (WalIndexHdr*)p2;
57061
57062 /* aSalt[0] is a copy of the value stored in the wal file header. It
57063 ** is incremented each time the wal file is restarted. */
@@ -58190,11 +58190,11 @@
58190 **
58191 ** This routine has no effect on existing database connections.
58192 ** The shared cache setting effects only future calls to
58193 ** sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2().
58194 */
58195 SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int enable){
58196 sqlite3GlobalConfig.sharedCacheEnabled = enable;
58197 return SQLITE_OK;
58198 }
58199 #endif
58200
@@ -64489,11 +64489,11 @@
64489 }
64490 }
64491
64492 /*
64493 ** A CellArray object contains a cache of pointers and sizes for a
64494 ** consecutive sequence of cells that might be held on multiple pages.
64495 */
64496 typedef struct CellArray CellArray;
64497 struct CellArray {
64498 int nCell; /* Number of cells in apCell[] */
64499 MemPage *pRef; /* Reference page */
@@ -67963,11 +67963,11 @@
67963 ** a pointer to the new sqlite3_backup object.
67964 **
67965 ** If an error occurs, NULL is returned and an error code and error message
67966 ** stored in database handle pDestDb.
67967 */
67968 SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
67969 sqlite3* pDestDb, /* Database to write to */
67970 const char *zDestDb, /* Name of database within pDestDb */
67971 sqlite3* pSrcDb, /* Database connection to read from */
67972 const char *zSrcDb /* Name of database within pSrcDb */
67973 ){
@@ -68171,11 +68171,11 @@
68171 }
68172
68173 /*
68174 ** Copy nPage pages from the source b-tree to the destination.
68175 */
68176 SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage){
68177 int rc;
68178 int destMode; /* Destination journal mode */
68179 int pgszSrc = 0; /* Source page size */
68180 int pgszDest = 0; /* Destination page size */
68181
@@ -68415,11 +68415,11 @@
68415 }
68416
68417 /*
68418 ** Release all resources associated with an sqlite3_backup* handle.
68419 */
68420 SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p){
68421 sqlite3_backup **pp; /* Ptr to head of pagers backup list */
68422 sqlite3 *pSrcDb; /* Source database connection */
68423 int rc; /* Value to return */
68424
68425 /* Enter the mutexes */
@@ -68467,11 +68467,11 @@
68467
68468 /*
68469 ** Return the number of pages still to be backed up as of the most recent
68470 ** call to sqlite3_backup_step().
68471 */
68472 SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p){
68473 #ifdef SQLITE_ENABLE_API_ARMOR
68474 if( p==0 ){
68475 (void)SQLITE_MISUSE_BKPT;
68476 return 0;
68477 }
@@ -68481,11 +68481,11 @@
68481
68482 /*
68483 ** Return the total number of pages in the source database as of the most
68484 ** recent call to sqlite3_backup_step().
68485 */
68486 SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p){
68487 #ifdef SQLITE_ENABLE_API_ARMOR
68488 if( p==0 ){
68489 (void)SQLITE_MISUSE_BKPT;
68490 return 0;
68491 }
@@ -74935,11 +74935,11 @@
74935 ** execution environment changes in a way that would alter the program
74936 ** that sqlite3_prepare() generates. For example, if new functions or
74937 ** collating sequences are registered or if an authorizer function is
74938 ** added or changed.
74939 */
74940 SQLITE_API int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt *pStmt){
74941 Vdbe *p = (Vdbe*)pStmt;
74942 return p==0 || p->expired;
74943 }
74944 #endif
74945
@@ -75004,11 +75004,11 @@
75004 ** machine.
75005 **
75006 ** This routine sets the error code and string returned by
75007 ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
75008 */
75009 SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt){
75010 int rc;
75011 if( pStmt==0 ){
75012 /* IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL
75013 ** pointer is a harmless no-op. */
75014 rc = SQLITE_OK;
@@ -75031,11 +75031,11 @@
75031 ** the prior execution is returned.
75032 **
75033 ** This routine sets the error code and string returned by
75034 ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
75035 */
75036 SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt){
75037 int rc;
75038 if( pStmt==0 ){
75039 rc = SQLITE_OK;
75040 }else{
75041 Vdbe *v = (Vdbe*)pStmt;
@@ -75052,11 +75052,11 @@
75052 }
75053
75054 /*
75055 ** Set all the parameters in the compiled SQL statement to NULL.
75056 */
75057 SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt *pStmt){
75058 int i;
75059 int rc = SQLITE_OK;
75060 Vdbe *p = (Vdbe*)pStmt;
75061 #if SQLITE_THREADSAFE
75062 sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex;
@@ -75076,11 +75076,11 @@
75076
75077 /**************************** sqlite3_value_ *******************************
75078 ** The following routines extract information from a Mem or sqlite3_value
75079 ** structure.
75080 */
75081 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value *pVal){
75082 Mem *p = (Mem*)pVal;
75083 if( p->flags & (MEM_Blob|MEM_Str) ){
75084 if( sqlite3VdbeMemExpandBlob(p)!=SQLITE_OK ){
75085 assert( p->flags==MEM_Null && p->z==0 );
75086 return 0;
@@ -75089,48 +75089,48 @@
75089 return p->n ? p->z : 0;
75090 }else{
75091 return sqlite3_value_text(pVal);
75092 }
75093 }
75094 SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value *pVal){
75095 return sqlite3ValueBytes(pVal, SQLITE_UTF8);
75096 }
75097 SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value *pVal){
75098 return sqlite3ValueBytes(pVal, SQLITE_UTF16NATIVE);
75099 }
75100 SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value *pVal){
75101 return sqlite3VdbeRealValue((Mem*)pVal);
75102 }
75103 SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value *pVal){
75104 return (int)sqlite3VdbeIntValue((Mem*)pVal);
75105 }
75106 SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value *pVal){
75107 return sqlite3VdbeIntValue((Mem*)pVal);
75108 }
75109 SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value *pVal){
75110 Mem *pMem = (Mem*)pVal;
75111 return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0);
75112 }
75113 SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value *pVal){
75114 return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
75115 }
75116 #ifndef SQLITE_OMIT_UTF16
75117 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value* pVal){
75118 return sqlite3ValueText(pVal, SQLITE_UTF16NATIVE);
75119 }
75120 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value *pVal){
75121 return sqlite3ValueText(pVal, SQLITE_UTF16BE);
75122 }
75123 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value *pVal){
75124 return sqlite3ValueText(pVal, SQLITE_UTF16LE);
75125 }
75126 #endif /* SQLITE_OMIT_UTF16 */
75127 /* EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five
75128 ** fundamental datatypes: 64-bit signed integer 64-bit IEEE floating
75129 ** point number string BLOB NULL
75130 */
75131 SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value* pVal){
75132 static const u8 aType[] = {
75133 SQLITE_BLOB, /* 0x00 */
75134 SQLITE_NULL, /* 0x01 */
75135 SQLITE_TEXT, /* 0x02 */
75136 SQLITE_NULL, /* 0x03 */
@@ -75166,11 +75166,11 @@
75166 return aType[pVal->flags&MEM_AffMask];
75167 }
75168
75169 /* Make a copy of an sqlite3_value object
75170 */
75171 SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value *pOrig){
75172 sqlite3_value *pNew;
75173 if( pOrig==0 ) return 0;
75174 pNew = sqlite3_malloc( sizeof(*pNew) );
75175 if( pNew==0 ) return 0;
75176 memset(pNew, 0, sizeof(*pNew));
@@ -75189,11 +75189,11 @@
75189 }
75190
75191 /* Destroy an sqlite3_value object previously obtained from
75192 ** sqlite3_value_dup().
75193 */
75194 SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value *pOld){
75195 sqlite3ValueFree(pOld);
75196 }
75197
75198
75199 /**************************** sqlite3_result_ *******************************
@@ -75232,21 +75232,21 @@
75232 xDel((void*)p);
75233 }
75234 if( pCtx ) sqlite3_result_error_toobig(pCtx);
75235 return SQLITE_TOOBIG;
75236 }
75237 SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(
75238 sqlite3_context *pCtx,
75239 const void *z,
75240 int n,
75241 void (*xDel)(void *)
75242 ){
75243 assert( n>=0 );
75244 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75245 setResultStrOrError(pCtx, z, n, 0, xDel);
75246 }
75247 SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(
75248 sqlite3_context *pCtx,
75249 const void *z,
75250 sqlite3_uint64 n,
75251 void (*xDel)(void *)
75252 ){
@@ -75256,56 +75256,56 @@
75256 (void)invokeValueDestructor(z, xDel, pCtx);
75257 }else{
75258 setResultStrOrError(pCtx, z, (int)n, 0, xDel);
75259 }
75260 }
75261 SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context *pCtx, double rVal){
75262 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75263 sqlite3VdbeMemSetDouble(pCtx->pOut, rVal);
75264 }
75265 SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
75266 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75267 pCtx->isError = SQLITE_ERROR;
75268 pCtx->fErrorOrAux = 1;
75269 sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF8, SQLITE_TRANSIENT);
75270 }
75271 #ifndef SQLITE_OMIT_UTF16
75272 SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){
75273 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75274 pCtx->isError = SQLITE_ERROR;
75275 pCtx->fErrorOrAux = 1;
75276 sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF16NATIVE, SQLITE_TRANSIENT);
75277 }
75278 #endif
75279 SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context *pCtx, int iVal){
75280 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75281 sqlite3VdbeMemSetInt64(pCtx->pOut, (i64)iVal);
75282 }
75283 SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
75284 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75285 sqlite3VdbeMemSetInt64(pCtx->pOut, iVal);
75286 }
75287 SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context *pCtx){
75288 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75289 sqlite3VdbeMemSetNull(pCtx->pOut);
75290 }
75291 SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){
75292 Mem *pOut = pCtx->pOut;
75293 assert( sqlite3_mutex_held(pOut->db->mutex) );
75294 pOut->eSubtype = eSubtype & 0xff;
75295 pOut->flags |= MEM_Subtype;
75296 }
75297 SQLITE_API void SQLITE_STDCALL sqlite3_result_text(
75298 sqlite3_context *pCtx,
75299 const char *z,
75300 int n,
75301 void (*xDel)(void *)
75302 ){
75303 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75304 setResultStrOrError(pCtx, z, n, SQLITE_UTF8, xDel);
75305 }
75306 SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(
75307 sqlite3_context *pCtx,
75308 const char *z,
75309 sqlite3_uint64 n,
75310 void (*xDel)(void *),
75311 unsigned char enc
@@ -75318,56 +75318,56 @@
75318 }else{
75319 setResultStrOrError(pCtx, z, (int)n, enc, xDel);
75320 }
75321 }
75322 #ifndef SQLITE_OMIT_UTF16
75323 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(
75324 sqlite3_context *pCtx,
75325 const void *z,
75326 int n,
75327 void (*xDel)(void *)
75328 ){
75329 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75330 setResultStrOrError(pCtx, z, n, SQLITE_UTF16NATIVE, xDel);
75331 }
75332 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(
75333 sqlite3_context *pCtx,
75334 const void *z,
75335 int n,
75336 void (*xDel)(void *)
75337 ){
75338 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75339 setResultStrOrError(pCtx, z, n, SQLITE_UTF16BE, xDel);
75340 }
75341 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(
75342 sqlite3_context *pCtx,
75343 const void *z,
75344 int n,
75345 void (*xDel)(void *)
75346 ){
75347 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75348 setResultStrOrError(pCtx, z, n, SQLITE_UTF16LE, xDel);
75349 }
75350 #endif /* SQLITE_OMIT_UTF16 */
75351 SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){
75352 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75353 sqlite3VdbeMemCopy(pCtx->pOut, pValue);
75354 }
75355 SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){
75356 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75357 sqlite3VdbeMemSetZeroBlob(pCtx->pOut, n);
75358 }
75359 SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){
75360 Mem *pOut = pCtx->pOut;
75361 assert( sqlite3_mutex_held(pOut->db->mutex) );
75362 if( n>(u64)pOut->db->aLimit[SQLITE_LIMIT_LENGTH] ){
75363 return SQLITE_TOOBIG;
75364 }
75365 sqlite3VdbeMemSetZeroBlob(pCtx->pOut, (int)n);
75366 return SQLITE_OK;
75367 }
75368 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){
75369 pCtx->isError = errCode;
75370 pCtx->fErrorOrAux = 1;
75371 #ifdef SQLITE_DEBUG
75372 if( pCtx->pVdbe ) pCtx->pVdbe->rcApp = errCode;
75373 #endif
@@ -75376,20 +75376,20 @@
75376 SQLITE_UTF8, SQLITE_STATIC);
75377 }
75378 }
75379
75380 /* Force an SQLITE_TOOBIG error. */
75381 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context *pCtx){
75382 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75383 pCtx->isError = SQLITE_TOOBIG;
75384 pCtx->fErrorOrAux = 1;
75385 sqlite3VdbeMemSetStr(pCtx->pOut, "string or blob too big", -1,
75386 SQLITE_UTF8, SQLITE_STATIC);
75387 }
75388
75389 /* An SQLITE_NOMEM error. */
75390 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context *pCtx){
75391 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75392 sqlite3VdbeMemSetNull(pCtx->pOut);
75393 pCtx->isError = SQLITE_NOMEM_BKPT;
75394 pCtx->fErrorOrAux = 1;
75395 sqlite3OomFault(pCtx->pOut->db);
@@ -75557,11 +75557,11 @@
75557 /*
75558 ** This is the top-level implementation of sqlite3_step(). Call
75559 ** sqlite3Step() to do most of the work. If a schema error occurs,
75560 ** call sqlite3Reprepare() and try again.
75561 */
75562 SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt *pStmt){
75563 int rc = SQLITE_OK; /* Result from sqlite3Step() */
75564 int rc2 = SQLITE_OK; /* Result from sqlite3Reprepare() */
75565 Vdbe *v = (Vdbe*)pStmt; /* the prepared statement */
75566 int cnt = 0; /* Counter to prevent infinite loop of reprepares */
75567 sqlite3 *db; /* The database connection */
@@ -75608,11 +75608,11 @@
75608
75609 /*
75610 ** Extract the user data from a sqlite3_context structure and return a
75611 ** pointer to it.
75612 */
75613 SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context *p){
75614 assert( p && p->pFunc );
75615 return p->pFunc->pUserData;
75616 }
75617
75618 /*
@@ -75623,11 +75623,11 @@
75623 ** returns a copy of the pointer to the database connection (the 1st
75624 ** parameter) of the sqlite3_create_function() and
75625 ** sqlite3_create_function16() routines that originally registered the
75626 ** application defined function.
75627 */
75628 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context *p){
75629 assert( p && p->pOut );
75630 return p->pOut->db;
75631 }
75632
75633 /*
@@ -75699,11 +75699,11 @@
75699 /*
75700 ** Allocate or return the aggregate context for a user function. A new
75701 ** context is allocated on the first call. Subsequent calls return the
75702 ** same context that was returned on prior calls.
75703 */
75704 SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context *p, int nByte){
75705 assert( p && p->pFunc && p->pFunc->xFinalize );
75706 assert( sqlite3_mutex_held(p->pOut->db->mutex) );
75707 testcase( nByte<0 );
75708 if( (p->pMem->flags & MEM_Agg)==0 ){
75709 return createAggContext(p, nByte);
@@ -75714,11 +75714,11 @@
75714
75715 /*
75716 ** Return the auxiliary data pointer, if any, for the iArg'th argument to
75717 ** the user-function defined by pCtx.
75718 */
75719 SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
75720 AuxData *pAuxData;
75721
75722 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75723 #if SQLITE_ENABLE_STAT3_OR_STAT4
75724 if( pCtx->pVdbe==0 ) return 0;
@@ -75735,11 +75735,11 @@
75735 /*
75736 ** Set the auxiliary data pointer and delete function, for the iArg'th
75737 ** argument to the user-function defined by pCtx. Any previous value is
75738 ** deleted by calling the delete function specified when it was set.
75739 */
75740 SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(
75741 sqlite3_context *pCtx,
75742 int iArg,
75743 void *pAux,
75744 void (*xDelete)(void*)
75745 ){
@@ -75790,29 +75790,29 @@
75790 ** This function is deprecated. Do not use it for new code. It is
75791 ** provide only to avoid breaking legacy code. New aggregate function
75792 ** implementations should keep their own counts within their aggregate
75793 ** context.
75794 */
75795 SQLITE_API int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context *p){
75796 assert( p && p->pMem && p->pFunc && p->pFunc->xFinalize );
75797 return p->pMem->n;
75798 }
75799 #endif
75800
75801 /*
75802 ** Return the number of columns in the result set for the statement pStmt.
75803 */
75804 SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt){
75805 Vdbe *pVm = (Vdbe *)pStmt;
75806 return pVm ? pVm->nResColumn : 0;
75807 }
75808
75809 /*
75810 ** Return the number of values available from the current row of the
75811 ** currently executing statement pStmt.
75812 */
75813 SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt){
75814 Vdbe *pVm = (Vdbe *)pStmt;
75815 if( pVm==0 || pVm->pResultSet==0 ) return 0;
75816 return pVm->nResColumn;
75817 }
75818
@@ -75911,67 +75911,67 @@
75911
75912 /**************************** sqlite3_column_ *******************************
75913 ** The following routines are used to access elements of the current row
75914 ** in the result set.
75915 */
75916 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt *pStmt, int i){
75917 const void *val;
75918 val = sqlite3_value_blob( columnMem(pStmt,i) );
75919 /* Even though there is no encoding conversion, value_blob() might
75920 ** need to call malloc() to expand the result of a zeroblob()
75921 ** expression.
75922 */
75923 columnMallocFailure(pStmt);
75924 return val;
75925 }
75926 SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){
75927 int val = sqlite3_value_bytes( columnMem(pStmt,i) );
75928 columnMallocFailure(pStmt);
75929 return val;
75930 }
75931 SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){
75932 int val = sqlite3_value_bytes16( columnMem(pStmt,i) );
75933 columnMallocFailure(pStmt);
75934 return val;
75935 }
75936 SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt *pStmt, int i){
75937 double val = sqlite3_value_double( columnMem(pStmt,i) );
75938 columnMallocFailure(pStmt);
75939 return val;
75940 }
75941 SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt *pStmt, int i){
75942 int val = sqlite3_value_int( columnMem(pStmt,i) );
75943 columnMallocFailure(pStmt);
75944 return val;
75945 }
75946 SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt *pStmt, int i){
75947 sqlite_int64 val = sqlite3_value_int64( columnMem(pStmt,i) );
75948 columnMallocFailure(pStmt);
75949 return val;
75950 }
75951 SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt *pStmt, int i){
75952 const unsigned char *val = sqlite3_value_text( columnMem(pStmt,i) );
75953 columnMallocFailure(pStmt);
75954 return val;
75955 }
75956 SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt *pStmt, int i){
75957 Mem *pOut = columnMem(pStmt, i);
75958 if( pOut->flags&MEM_Static ){
75959 pOut->flags &= ~MEM_Static;
75960 pOut->flags |= MEM_Ephem;
75961 }
75962 columnMallocFailure(pStmt);
75963 return (sqlite3_value *)pOut;
75964 }
75965 #ifndef SQLITE_OMIT_UTF16
75966 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt *pStmt, int i){
75967 const void *val = sqlite3_value_text16( columnMem(pStmt,i) );
75968 columnMallocFailure(pStmt);
75969 return val;
75970 }
75971 #endif /* SQLITE_OMIT_UTF16 */
75972 SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt *pStmt, int i){
75973 int iType = sqlite3_value_type( columnMem(pStmt,i) );
75974 columnMallocFailure(pStmt);
75975 return iType;
75976 }
75977
@@ -76031,16 +76031,16 @@
76031
76032 /*
76033 ** Return the name of the Nth column of the result set returned by SQL
76034 ** statement pStmt.
76035 */
76036 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt *pStmt, int N){
76037 return columnName(
76038 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_NAME);
76039 }
76040 #ifndef SQLITE_OMIT_UTF16
76041 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt *pStmt, int N){
76042 return columnName(
76043 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_NAME);
76044 }
76045 #endif
76046
@@ -76056,16 +76056,16 @@
76056 #ifndef SQLITE_OMIT_DECLTYPE
76057 /*
76058 ** Return the column declaration type (if applicable) of the 'i'th column
76059 ** of the result set of SQL statement pStmt.
76060 */
76061 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){
76062 return columnName(
76063 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DECLTYPE);
76064 }
76065 #ifndef SQLITE_OMIT_UTF16
76066 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){
76067 return columnName(
76068 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DECLTYPE);
76069 }
76070 #endif /* SQLITE_OMIT_UTF16 */
76071 #endif /* SQLITE_OMIT_DECLTYPE */
@@ -76074,16 +76074,16 @@
76074 /*
76075 ** Return the name of the database from which a result column derives.
76076 ** NULL is returned if the result column is an expression or constant or
76077 ** anything else which is not an unambiguous reference to a database column.
76078 */
76079 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){
76080 return columnName(
76081 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DATABASE);
76082 }
76083 #ifndef SQLITE_OMIT_UTF16
76084 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){
76085 return columnName(
76086 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DATABASE);
76087 }
76088 #endif /* SQLITE_OMIT_UTF16 */
76089
@@ -76090,16 +76090,16 @@
76090 /*
76091 ** Return the name of the table from which a result column derives.
76092 ** NULL is returned if the result column is an expression or constant or
76093 ** anything else which is not an unambiguous reference to a database column.
76094 */
76095 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){
76096 return columnName(
76097 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_TABLE);
76098 }
76099 #ifndef SQLITE_OMIT_UTF16
76100 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){
76101 return columnName(
76102 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_TABLE);
76103 }
76104 #endif /* SQLITE_OMIT_UTF16 */
76105
@@ -76106,16 +76106,16 @@
76106 /*
76107 ** Return the name of the table column from which a result column derives.
76108 ** NULL is returned if the result column is an expression or constant or
76109 ** anything else which is not an unambiguous reference to a database column.
76110 */
76111 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){
76112 return columnName(
76113 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_COLUMN);
76114 }
76115 #ifndef SQLITE_OMIT_UTF16
76116 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){
76117 return columnName(
76118 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_COLUMN);
76119 }
76120 #endif /* SQLITE_OMIT_UTF16 */
76121 #endif /* SQLITE_ENABLE_COLUMN_METADATA */
@@ -76212,11 +76212,11 @@
76212
76213
76214 /*
76215 ** Bind a blob value to an SQL statement variable.
76216 */
76217 SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(
76218 sqlite3_stmt *pStmt,
76219 int i,
76220 const void *zData,
76221 int nData,
76222 void (*xDel)(void*)
@@ -76224,11 +76224,11 @@
76224 #ifdef SQLITE_ENABLE_API_ARMOR
76225 if( nData<0 ) return SQLITE_MISUSE_BKPT;
76226 #endif
76227 return bindText(pStmt, i, zData, nData, xDel, 0);
76228 }
76229 SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(
76230 sqlite3_stmt *pStmt,
76231 int i,
76232 const void *zData,
76233 sqlite3_uint64 nData,
76234 void (*xDel)(void*)
@@ -76238,52 +76238,52 @@
76238 return invokeValueDestructor(zData, xDel, 0);
76239 }else{
76240 return bindText(pStmt, i, zData, (int)nData, xDel, 0);
76241 }
76242 }
76243 SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
76244 int rc;
76245 Vdbe *p = (Vdbe *)pStmt;
76246 rc = vdbeUnbind(p, i);
76247 if( rc==SQLITE_OK ){
76248 sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue);
76249 sqlite3_mutex_leave(p->db->mutex);
76250 }
76251 return rc;
76252 }
76253 SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){
76254 return sqlite3_bind_int64(p, i, (i64)iValue);
76255 }
76256 SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
76257 int rc;
76258 Vdbe *p = (Vdbe *)pStmt;
76259 rc = vdbeUnbind(p, i);
76260 if( rc==SQLITE_OK ){
76261 sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue);
76262 sqlite3_mutex_leave(p->db->mutex);
76263 }
76264 return rc;
76265 }
76266 SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
76267 int rc;
76268 Vdbe *p = (Vdbe*)pStmt;
76269 rc = vdbeUnbind(p, i);
76270 if( rc==SQLITE_OK ){
76271 sqlite3_mutex_leave(p->db->mutex);
76272 }
76273 return rc;
76274 }
76275 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(
76276 sqlite3_stmt *pStmt,
76277 int i,
76278 const char *zData,
76279 int nData,
76280 void (*xDel)(void*)
76281 ){
76282 return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8);
76283 }
76284 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(
76285 sqlite3_stmt *pStmt,
76286 int i,
76287 const char *zData,
76288 sqlite3_uint64 nData,
76289 void (*xDel)(void*),
@@ -76296,21 +76296,21 @@
76296 if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE;
76297 return bindText(pStmt, i, zData, (int)nData, xDel, enc);
76298 }
76299 }
76300 #ifndef SQLITE_OMIT_UTF16
76301 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(
76302 sqlite3_stmt *pStmt,
76303 int i,
76304 const void *zData,
76305 int nData,
76306 void (*xDel)(void*)
76307 ){
76308 return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE);
76309 }
76310 #endif /* SQLITE_OMIT_UTF16 */
76311 SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
76312 int rc;
76313 switch( sqlite3_value_type((sqlite3_value*)pValue) ){
76314 case SQLITE_INTEGER: {
76315 rc = sqlite3_bind_int64(pStmt, i, pValue->u.i);
76316 break;
@@ -76337,21 +76337,21 @@
76337 break;
76338 }
76339 }
76340 return rc;
76341 }
76342 SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
76343 int rc;
76344 Vdbe *p = (Vdbe *)pStmt;
76345 rc = vdbeUnbind(p, i);
76346 if( rc==SQLITE_OK ){
76347 sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n);
76348 sqlite3_mutex_leave(p->db->mutex);
76349 }
76350 return rc;
76351 }
76352 SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){
76353 int rc;
76354 Vdbe *p = (Vdbe *)pStmt;
76355 sqlite3_mutex_enter(p->db->mutex);
76356 if( n>(u64)p->db->aLimit[SQLITE_LIMIT_LENGTH] ){
76357 rc = SQLITE_TOOBIG;
@@ -76366,11 +76366,11 @@
76366
76367 /*
76368 ** Return the number of wildcards that can be potentially bound to.
76369 ** This routine is added to support DBD::SQLite.
76370 */
76371 SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
76372 Vdbe *p = (Vdbe*)pStmt;
76373 return p ? p->nVar : 0;
76374 }
76375
76376 /*
@@ -76377,11 +76377,11 @@
76377 ** Return the name of a wildcard parameter. Return NULL if the index
76378 ** is out of range or if the wildcard is unnamed.
76379 **
76380 ** The result is always UTF-8.
76381 */
76382 SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){
76383 Vdbe *p = (Vdbe*)pStmt;
76384 if( p==0 || i<1 || i>p->nzVar ){
76385 return 0;
76386 }
76387 return p->azVar[i-1];
@@ -76405,11 +76405,11 @@
76405 }
76406 }
76407 }
76408 return 0;
76409 }
76410 SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
76411 return sqlite3VdbeParameterIndex((Vdbe*)pStmt, zName, sqlite3Strlen30(zName));
76412 }
76413
76414 /*
76415 ** Transfer all bindings from the first statement over to the second.
@@ -76439,11 +76439,11 @@
76439 **
76440 ** If the two statements contain a different number of bindings, then
76441 ** an SQLITE_ERROR is returned. Nothing else can go wrong, so otherwise
76442 ** SQLITE_OK is returned.
76443 */
76444 SQLITE_API int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
76445 Vdbe *pFrom = (Vdbe*)pFromStmt;
76446 Vdbe *pTo = (Vdbe*)pToStmt;
76447 if( pFrom->nVar!=pTo->nVar ){
76448 return SQLITE_ERROR;
76449 }
@@ -76461,26 +76461,26 @@
76461 ** Return the sqlite3* database handle to which the prepared statement given
76462 ** in the argument belongs. This is the same database handle that was
76463 ** the first argument to the sqlite3_prepare() that was used to create
76464 ** the statement in the first place.
76465 */
76466 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt *pStmt){
76467 return pStmt ? ((Vdbe*)pStmt)->db : 0;
76468 }
76469
76470 /*
76471 ** Return true if the prepared statement is guaranteed to not modify the
76472 ** database.
76473 */
76474 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt){
76475 return pStmt ? ((Vdbe*)pStmt)->readOnly : 1;
76476 }
76477
76478 /*
76479 ** Return true if the prepared statement is in need of being reset.
76480 */
76481 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt *pStmt){
76482 Vdbe *v = (Vdbe*)pStmt;
76483 return v!=0 && v->pc>=0 && v->magic==VDBE_MAGIC_RUN;
76484 }
76485
76486 /*
@@ -76487,11 +76487,11 @@
76487 ** Return a pointer to the next prepared statement after pStmt associated
76488 ** with database connection pDb. If pStmt is NULL, return the first
76489 ** prepared statement for the database connection. Return NULL if there
76490 ** are no more.
76491 */
76492 SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){
76493 sqlite3_stmt *pNext;
76494 #ifdef SQLITE_ENABLE_API_ARMOR
76495 if( !sqlite3SafetyCheckOk(pDb) ){
76496 (void)SQLITE_MISUSE_BKPT;
76497 return 0;
@@ -76508,11 +76508,11 @@
76508 }
76509
76510 /*
76511 ** Return the value of a status counter for a prepared statement
76512 */
76513 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){
76514 Vdbe *pVdbe = (Vdbe*)pStmt;
76515 u32 v;
76516 #ifdef SQLITE_ENABLE_API_ARMOR
76517 if( !pStmt ){
76518 (void)SQLITE_MISUSE_BKPT;
@@ -76525,11 +76525,11 @@
76525 }
76526
76527 /*
76528 ** Return the SQL associated with a prepared statement
76529 */
76530 SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt){
76531 Vdbe *p = (Vdbe *)pStmt;
76532 return p ? p->zSql : 0;
76533 }
76534
76535 /*
@@ -76539,11 +76539,11 @@
76539 ** freeing the returned string by passing it to sqlite3_free().
76540 **
76541 ** The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of
76542 ** expanded bound parameters.
76543 */
76544 SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt){
76545 #ifdef SQLITE_OMIT_TRACE
76546 return 0;
76547 #else
76548 char *z = 0;
76549 const char *zSql = sqlite3_sql(pStmt);
@@ -76581,11 +76581,11 @@
76581
76582 /*
76583 ** This function is called from within a pre-update callback to retrieve
76584 ** a field of the row currently being updated or deleted.
76585 */
76586 SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
76587 PreUpdate *p = db->pPreUpdate;
76588 int rc = SQLITE_OK;
76589
76590 /* Test that this call is being made from within an SQLITE_DELETE or
76591 ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */
@@ -76636,11 +76636,11 @@
76636 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
76637 /*
76638 ** This function is called from within a pre-update callback to retrieve
76639 ** the number of columns in the row being updated, deleted or inserted.
76640 */
76641 SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *db){
76642 PreUpdate *p = db->pPreUpdate;
76643 return (p ? p->keyinfo.nField : 0);
76644 }
76645 #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
76646
@@ -76654,11 +76654,11 @@
76654 ** top-level trigger etc.).
76655 **
76656 ** For the purposes of the previous paragraph, a foreign key CASCADE, SET NULL
76657 ** or SET DEFAULT action is considered a trigger.
76658 */
76659 SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *db){
76660 PreUpdate *p = db->pPreUpdate;
76661 return (p ? p->v->nFrame : 0);
76662 }
76663 #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
76664
@@ -76665,11 +76665,11 @@
76665 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
76666 /*
76667 ** This function is called from within a pre-update callback to retrieve
76668 ** a field of the row currently being updated or inserted.
76669 */
76670 SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
76671 PreUpdate *p = db->pPreUpdate;
76672 int rc = SQLITE_OK;
76673 Mem *pMem;
76674
76675 if( !p || p->op==SQLITE_DELETE ){
@@ -76739,11 +76739,11 @@
76739
76740 #ifdef SQLITE_ENABLE_STMT_SCANSTATUS
76741 /*
76742 ** Return status data for a single loop within query pStmt.
76743 */
76744 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus(
76745 sqlite3_stmt *pStmt, /* Prepared statement being queried */
76746 int idx, /* Index of loop to report on */
76747 int iScanStatusOp, /* Which metric to return */
76748 void *pOut /* OUT: Write the answer here */
76749 ){
@@ -76798,11 +76798,11 @@
76798 }
76799
76800 /*
76801 ** Zero all counters associated with the sqlite3_stmt_scanstatus() data.
76802 */
76803 SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){
76804 Vdbe *p = (Vdbe*)pStmt;
76805 memset(p->anExec, 0, p->nOp * sizeof(i64));
76806 }
76807 #endif /* SQLITE_ENABLE_STMT_SCANSTATUS */
76808
@@ -77325,11 +77325,11 @@
77325 ** Try to convert the type of a function argument or a result column
77326 ** into a numeric representation. Use either INTEGER or REAL whichever
77327 ** is appropriate. But only do the conversion if it is possible without
77328 ** loss of information and return the revised type of the argument.
77329 */
77330 SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value *pVal){
77331 int eType = sqlite3_value_type(pVal);
77332 if( eType==SQLITE_TEXT ){
77333 Mem *pMem = (Mem*)pVal;
77334 applyNumericAffinity(pMem, 0);
77335 eType = sqlite3_value_type(pVal);
@@ -84177,11 +84177,11 @@
84177 }
84178
84179 /*
84180 ** Open a blob handle.
84181 */
84182 SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
84183 sqlite3* db, /* The database connection */
84184 const char *zDb, /* The attached database containing the blob */
84185 const char *zTable, /* The table containing the blob */
84186 const char *zColumn, /* The column containing the blob */
84187 sqlite_int64 iRow, /* The row containing the glob */
@@ -84418,11 +84418,11 @@
84418
84419 /*
84420 ** Close a blob handle that was previously created using
84421 ** sqlite3_blob_open().
84422 */
84423 SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *pBlob){
84424 Incrblob *p = (Incrblob *)pBlob;
84425 int rc;
84426 sqlite3 *db;
84427
84428 if( p ){
@@ -84511,28 +84511,28 @@
84511 }
84512
84513 /*
84514 ** Read data from a blob handle.
84515 */
84516 SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){
84517 return blobReadWrite(pBlob, z, n, iOffset, sqlite3BtreeData);
84518 }
84519
84520 /*
84521 ** Write data to a blob handle.
84522 */
84523 SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){
84524 return blobReadWrite(pBlob, (void *)z, n, iOffset, sqlite3BtreePutData);
84525 }
84526
84527 /*
84528 ** Query a blob handle for the size of the data.
84529 **
84530 ** The Incrblob.nByte field is fixed for the lifetime of the Incrblob
84531 ** so no mutex is required for access.
84532 */
84533 SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *pBlob){
84534 Incrblob *p = (Incrblob *)pBlob;
84535 return (p && p->pStmt) ? p->nByte : 0;
84536 }
84537
84538 /*
@@ -84543,11 +84543,11 @@
84543 ** contain a blob or text value, then an error code is returned and the
84544 ** database handle error code and message set. If this happens, then all
84545 ** subsequent calls to sqlite3_blob_xxx() functions (except blob_close())
84546 ** immediately return SQLITE_ABORT.
84547 */
84548 SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){
84549 int rc;
84550 Incrblob *p = (Incrblob *)pBlob;
84551 sqlite3 *db;
84552
84553 if( p==0 ) return SQLITE_MISUSE_BKPT;
@@ -88640,11 +88640,15 @@
88640 }
88641 if( is_agg && (pNC->ncFlags & NC_AllowAgg)==0 ){
88642 sqlite3ErrorMsg(pParse, "misuse of aggregate function %.*s()", nId,zId);
88643 pNC->nErr++;
88644 is_agg = 0;
88645 }else if( no_such_func && pParse->db->init.busy==0
88646 #ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
88647 && pParse->explain==0
88648 #endif
88649 ){
88650 sqlite3ErrorMsg(pParse, "no such function: %.*s", nId, zId);
88651 pNC->nErr++;
88652 }else if( wrong_num_args ){
88653 sqlite3ErrorMsg(pParse,"wrong number of arguments to function %.*s()",
88654 nId, zId);
@@ -92365,10 +92369,15 @@
92369 }
92370 nFarg = pFarg ? pFarg->nExpr : 0;
92371 assert( !ExprHasProperty(pExpr, EP_IntValue) );
92372 zId = pExpr->u.zToken;
92373 pDef = sqlite3FindFunction(db, zId, nFarg, enc, 0);
92374 #ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
92375 if( pDef==0 && pParse->explain ){
92376 pDef = sqlite3FindFunction(db, "unknown", nFarg, enc, 0);
92377 }
92378 #endif
92379 if( pDef==0 || pDef->xFinalize!=0 ){
92380 sqlite3ErrorMsg(pParse, "unknown function: %s()", zId);
92381 break;
92382 }
92383
@@ -97147,11 +97156,11 @@
97156 ** and attempts to write the column will be ignored.
97157 **
97158 ** Setting the auth function to NULL disables this hook. The default
97159 ** setting of the auth function is NULL.
97160 */
97161 SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
97162 sqlite3 *db,
97163 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
97164 void *pArg
97165 ){
97166 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -103910,18 +103919,18 @@
103919 }
103920
103921 /*
103922 ** The sqlite3_strglob() interface.
103923 */
103924 SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlobPattern, const char *zString){
103925 return patternCompare((u8*)zGlobPattern, (u8*)zString, &globInfo, '[')==0;
103926 }
103927
103928 /*
103929 ** The sqlite3_strlike() interface.
103930 */
103931 SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zPattern, const char *zStr, unsigned int esc){
103932 return patternCompare((u8*)zPattern, (u8*)zStr, &likeInfoNorm, esc)==0;
103933 }
103934
103935 /*
103936 ** Count the number of times that the LIKE operator (or GLOB which is
@@ -104473,10 +104482,30 @@
104482 }
104483 }
104484 sqlite3_result_text(context, (char*)zIn, nIn, SQLITE_TRANSIENT);
104485 }
104486
104487
104488 #ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
104489 /*
104490 ** The "unknown" function is automatically substituted in place of
104491 ** any unrecognized function name when doing an EXPLAIN or EXPLAIN QUERY PLAN
104492 ** when the SQLITE_ENABLE_UNKNOWN_FUNCTION compile-time option is used.
104493 ** When the "sqlite3" command-line shell is built using this functionality,
104494 ** that allows an EXPLAIN or EXPLAIN QUERY PLAN for complex queries
104495 ** involving application-defined functions to be examined in a generic
104496 ** sqlite3 shell.
104497 */
104498 static void unknownFunc(
104499 sqlite3_context *context,
104500 int argc,
104501 sqlite3_value **argv
104502 ){
104503 /* no-op */
104504 }
104505 #endif /*SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION*/
104506
104507
104508 /* IMP: R-25361-16150 This function is omitted from SQLite by default. It
104509 ** is only available if the SQLITE_SOUNDEX compile-time option is used
104510 ** when SQLite is built.
104511 */
@@ -104944,17 +104973,20 @@
104973 AGGREGATE(count, 1, 0, 0, countStep, countFinalize ),
104974 AGGREGATE(group_concat, 1, 0, 0, groupConcatStep, groupConcatFinalize),
104975 AGGREGATE(group_concat, 2, 0, 0, groupConcatStep, groupConcatFinalize),
104976
104977 LIKEFUNC(glob, 2, &globInfo, SQLITE_FUNC_LIKE|SQLITE_FUNC_CASE),
104978 #ifdef SQLITE_CASE_SENSITIVE_LIKE
104979 LIKEFUNC(like, 2, &likeInfoAlt, SQLITE_FUNC_LIKE|SQLITE_FUNC_CASE),
104980 LIKEFUNC(like, 3, &likeInfoAlt, SQLITE_FUNC_LIKE|SQLITE_FUNC_CASE),
104981 #else
104982 LIKEFUNC(like, 2, &likeInfoNorm, SQLITE_FUNC_LIKE),
104983 LIKEFUNC(like, 3, &likeInfoNorm, SQLITE_FUNC_LIKE),
104984 #endif
104985 #ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
104986 FUNCTION(unknown, -1, 0, 0, unknownFunc ),
104987 #endif
104988 FUNCTION(coalesce, 1, 0, 0, 0 ),
104989 FUNCTION(coalesce, 0, 0, 0, 0 ),
104990 FUNCTION2(coalesce, -1, 0, 0, noopFunc, SQLITE_FUNC_COALESCE),
104991 };
104992 #ifndef SQLITE_OMIT_ALTERTABLE
@@ -108613,11 +108645,11 @@
108645 ** If the SQL is a query, then for each row in the query result
108646 ** the xCallback() function is called. pArg becomes the first
108647 ** argument to xCallback(). If xCallback=NULL then no callback
108648 ** is invoked, even for queries.
108649 */
108650 SQLITE_API int SQLITE_STDCALL sqlite3_exec(
108651 sqlite3 *db, /* The database on which the SQL executes */
108652 const char *zSql, /* The SQL to be executed */
108653 sqlite3_callback xCallback, /* Invoke this callback routine */
108654 void *pArg, /* First argument to xCallback() */
108655 char **pzErrMsg /* Write error messages here */
@@ -109875,11 +109907,11 @@
109907 db->aExtension = aHandle;
109908
109909 db->aExtension[db->nExtension++] = handle;
109910 return SQLITE_OK;
109911 }
109912 SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
109913 sqlite3 *db, /* Load the extension into this database connection */
109914 const char *zFile, /* Name of the shared library containing extension */
109915 const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */
109916 char **pzErrMsg /* Put error message here if not 0 */
109917 ){
@@ -109906,11 +109938,11 @@
109938
109939 /*
109940 ** Enable or disable extension loading. Extension loading is disabled by
109941 ** default so as not to open security holes in older applications.
109942 */
109943 SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff){
109944 sqlite3_mutex_enter(db->mutex);
109945 if( onoff ){
109946 db->flags |= SQLITE_LoadExtension|SQLITE_LoadExtFunc;
109947 }else{
109948 db->flags &= ~(SQLITE_LoadExtension|SQLITE_LoadExtFunc);
@@ -109963,11 +109995,11 @@
109995
109996 /*
109997 ** Register a statically linked extension that is automatically
109998 ** loaded by every new database connection.
109999 */
110000 SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(
110001 void (*xInit)(void)
110002 ){
110003 int rc = SQLITE_OK;
110004 #ifndef SQLITE_OMIT_AUTOINIT
110005 rc = sqlite3_initialize();
@@ -110010,11 +110042,11 @@
110042 ** routine is a no-op.
110043 **
110044 ** Return 1 if xInit was found on the list and removed. Return 0 if xInit
110045 ** was not on the list.
110046 */
110047 SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(
110048 void (*xInit)(void)
110049 ){
110050 #if SQLITE_THREADSAFE
110051 sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
110052 #endif
@@ -110035,11 +110067,11 @@
110067 }
110068
110069 /*
110070 ** Reset the automatic extension loading mechanism.
110071 */
110072 SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void){
110073 #ifndef SQLITE_OMIT_AUTOINIT
110074 if( sqlite3_initialize()==SQLITE_OK )
110075 #endif
110076 {
110077 #if SQLITE_THREADSAFE
@@ -113296,11 +113328,11 @@
113328 ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
113329 ** sqlite3_step(). In the new version, the original SQL text is retained
113330 ** and the statement is automatically recompiled if an schema change
113331 ** occurs.
113332 */
113333 SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
113334 sqlite3 *db, /* Database handle. */
113335 const char *zSql, /* UTF-8 encoded SQL statement. */
113336 int nBytes, /* Length of zSql in bytes. */
113337 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113338 const char **pzTail /* OUT: End of parsed string */
@@ -113308,11 +113340,11 @@
113340 int rc;
113341 rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,0,ppStmt,pzTail);
113342 assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
113343 return rc;
113344 }
113345 SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
113346 sqlite3 *db, /* Database handle. */
113347 const char *zSql, /* UTF-8 encoded SQL statement. */
113348 int nBytes, /* Length of zSql in bytes. */
113349 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113350 const char **pzTail /* OUT: End of parsed string */
@@ -113384,11 +113416,11 @@
113416 ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
113417 ** sqlite3_step(). In the new version, the original SQL text is retained
113418 ** and the statement is automatically recompiled if an schema change
113419 ** occurs.
113420 */
113421 SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
113422 sqlite3 *db, /* Database handle. */
113423 const void *zSql, /* UTF-16 encoded SQL statement. */
113424 int nBytes, /* Length of zSql in bytes. */
113425 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113426 const void **pzTail /* OUT: End of parsed string */
@@ -113396,11 +113428,11 @@
113428 int rc;
113429 rc = sqlite3Prepare16(db,zSql,nBytes,0,ppStmt,pzTail);
113430 assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
113431 return rc;
113432 }
113433 SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
113434 sqlite3 *db, /* Database handle. */
113435 const void *zSql, /* UTF-16 encoded SQL statement. */
113436 int nBytes, /* Length of zSql in bytes. */
113437 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113438 const void **pzTail /* OUT: End of parsed string */
@@ -119239,11 +119271,11 @@
119271 ** The result that is written to ***pazResult is held in memory obtained
119272 ** from malloc(). But the caller cannot free this memory directly.
119273 ** Instead, the entire table should be passed to sqlite3_free_table() when
119274 ** the calling procedure is finished using it.
119275 */
119276 SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
119277 sqlite3 *db, /* The database on which the SQL executes */
119278 const char *zSql, /* The SQL to be executed */
119279 char ***pazResult, /* Write the result table here */
119280 int *pnRow, /* Write the number of rows in the result here */
119281 int *pnColumn, /* Write the number of columns of result here */
@@ -119308,11 +119340,11 @@
119340 }
119341
119342 /*
119343 ** This routine frees the space the sqlite3_get_table() malloced.
119344 */
119345 SQLITE_API void SQLITE_STDCALL sqlite3_free_table(
119346 char **azResult /* Result returned from sqlite3_get_table() */
119347 ){
119348 if( azResult ){
119349 int i, n;
119350 azResult--;
@@ -121718,11 +121750,11 @@
121750
121751
121752 /*
121753 ** External API function used to create a new virtual-table module.
121754 */
121755 SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
121756 sqlite3 *db, /* Database in which module is registered */
121757 const char *zName, /* Name assigned to this module */
121758 const sqlite3_module *pModule, /* The definition of the module */
121759 void *pAux /* Context pointer for xCreate/xConnect */
121760 ){
@@ -121733,11 +121765,11 @@
121765 }
121766
121767 /*
121768 ** External API function used to create a new virtual-table module.
121769 */
121770 SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
121771 sqlite3 *db, /* Database in which module is registered */
121772 const char *zName, /* Name assigned to this module */
121773 const sqlite3_module *pModule, /* The definition of the module */
121774 void *pAux, /* Context pointer for xCreate/xConnect */
121775 void (*xDestroy)(void *) /* Module destructor function */
@@ -122357,11 +122389,11 @@
122389 /*
122390 ** This function is used to set the schema of a virtual table. It is only
122391 ** valid to call this function from within the xCreate() or xConnect() of a
122392 ** virtual table module.
122393 */
122394 SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
122395 VtabCtx *pCtx;
122396 Parse *pParse;
122397 int rc = SQLITE_OK;
122398 Table *pTab;
122399 char *zErr = 0;
@@ -122587,11 +122619,14 @@
122619 if( rc==SQLITE_OK ){
122620 rc = pModule->xBegin(pVTab->pVtab);
122621 if( rc==SQLITE_OK ){
122622 int iSvpt = db->nStatement + db->nSavepoint;
122623 addToVTrans(db, pVTab);
122624 if( iSvpt && pModule->xSavepoint ){
122625 pVTab->iSavepoint = iSvpt;
122626 rc = pModule->xSavepoint(pVTab->pVtab, iSvpt-1);
122627 }
122628 }
122629 }
122630 }
122631 return rc;
122632 }
@@ -122811,11 +122846,11 @@
122846 ** table update operation currently in progress.
122847 **
122848 ** The results of this routine are undefined unless it is called from
122849 ** within an xUpdate method.
122850 */
122851 SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *db){
122852 static const unsigned char aMap[] = {
122853 SQLITE_ROLLBACK, SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_REPLACE
122854 };
122855 #ifdef SQLITE_ENABLE_API_ARMOR
122856 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -130601,11 +130636,11 @@
130636 }else{
130637 pWInfo->nOBSat = pFrom->isOrdered;
130638 pWInfo->revMask = pFrom->revLoop;
130639 if( pWInfo->nOBSat<=0 ){
130640 pWInfo->nOBSat = 0;
130641 if( nLoop>0 && (pFrom->aLoop[nLoop-1]->wsFlags & WHERE_ONEROW)==0 ){
130642 Bitmask m = 0;
130643 int rc = wherePathSatisfiesOrderBy(pWInfo, pWInfo->pOrderBy, pFrom,
130644 WHERE_ORDERBY_LIMIT, nLoop-1, pFrom->aLoop[nLoop-1], &m);
130645 if( rc==pWInfo->pOrderBy->nExpr ){
130646 pWInfo->bOrderedInnerLoop = 1;
@@ -136136,11 +136171,11 @@
136171 **
136172 ** If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed
136173 ** to recognize the end of a trigger can be omitted. All we have to do
136174 ** is look for a semicolon that is not part of an string or comment.
136175 */
136176 SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *zSql){
136177 u8 state = 0; /* Current state, using numbers defined in header comment */
136178 u8 token; /* Value of the next token */
136179
136180 #ifndef SQLITE_OMIT_TRIGGER
136181 /* A complex statement machine used to detect the end of a CREATE TRIGGER
@@ -136301,11 +136336,11 @@
136336 /*
136337 ** This routine is the same as the sqlite3_complete() routine described
136338 ** above, except that the parameter is required to be UTF-16 encoded, not
136339 ** UTF-8.
136340 */
136341 SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *zSql){
136342 sqlite3_value *pVal;
136343 char const *zSql8;
136344 int rc;
136345
136346 #ifndef SQLITE_OMIT_AUTOINIT
@@ -136461,28 +136496,28 @@
136496 #endif
136497
136498 /* IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns
136499 ** a pointer to the to the sqlite3_version[] string constant.
136500 */
136501 SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void){ return sqlite3_version; }
136502
136503 /* IMPLEMENTATION-OF: R-63124-39300 The sqlite3_sourceid() function returns a
136504 ** pointer to a string constant whose value is the same as the
136505 ** SQLITE_SOURCE_ID C preprocessor macro.
136506 */
136507 SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
136508
136509 /* IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function
136510 ** returns an integer equal to SQLITE_VERSION_NUMBER.
136511 */
136512 SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; }
136513
136514 /* IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns
136515 ** zero if and only if SQLite was compiled with mutexing code omitted due to
136516 ** the SQLITE_THREADSAFE compile-time option being set to 0.
136517 */
136518 SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; }
136519
136520 /*
136521 ** When compiling the test fixture or with debugging enabled (on Win32),
136522 ** this variable being set to non-zero will cause OSTRACE macros to emit
136523 ** extra diagnostic information.
@@ -136551,11 +136586,11 @@
136586 ** call by X completes.
136587 **
136588 ** * Recursive calls to this routine from thread X return immediately
136589 ** without blocking.
136590 */
136591 SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void){
136592 MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */
136593 int rc; /* Result code */
136594 #ifdef SQLITE_EXTRA_INIT
136595 int bRunExtraInit = 0; /* Extra initialization needed */
136596 #endif
@@ -136717,11 +136752,11 @@
136752 ** while any part of SQLite is otherwise in use in any thread. This
136753 ** routine is not threadsafe. But it is safe to invoke this routine
136754 ** on when SQLite is already shut down. If SQLite is already shut down
136755 ** when this routine is invoked, then this routine is a harmless no-op.
136756 */
136757 SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void){
136758 #ifdef SQLITE_OMIT_WSD
136759 int rc = sqlite3_wsd_init(4096, 24);
136760 if( rc!=SQLITE_OK ){
136761 return rc;
136762 }
@@ -137136,11 +137171,11 @@
137171 }
137172
137173 /*
137174 ** Return the mutex associated with a database connection.
137175 */
137176 SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3 *db){
137177 #ifdef SQLITE_ENABLE_API_ARMOR
137178 if( !sqlite3SafetyCheckOk(db) ){
137179 (void)SQLITE_MISUSE_BKPT;
137180 return 0;
137181 }
@@ -137150,11 +137185,11 @@
137185
137186 /*
137187 ** Free up as much memory as we can from the given database
137188 ** connection.
137189 */
137190 SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3 *db){
137191 int i;
137192
137193 #ifdef SQLITE_ENABLE_API_ARMOR
137194 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
137195 #endif
@@ -137174,11 +137209,11 @@
137209
137210 /*
137211 ** Flush any dirty pages in the pager-cache for any attached database
137212 ** to disk.
137213 */
137214 SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3 *db){
137215 int i;
137216 int rc = SQLITE_OK;
137217 int bSeenBusy = 0;
137218
137219 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -137324,11 +137359,11 @@
137359 }
137360
137361 /*
137362 ** Return the ROWID of the most recent insert
137363 */
137364 SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3 *db){
137365 #ifdef SQLITE_ENABLE_API_ARMOR
137366 if( !sqlite3SafetyCheckOk(db) ){
137367 (void)SQLITE_MISUSE_BKPT;
137368 return 0;
137369 }
@@ -137337,11 +137372,11 @@
137372 }
137373
137374 /*
137375 ** Return the number of changes in the most recent call to sqlite3_exec().
137376 */
137377 SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3 *db){
137378 #ifdef SQLITE_ENABLE_API_ARMOR
137379 if( !sqlite3SafetyCheckOk(db) ){
137380 (void)SQLITE_MISUSE_BKPT;
137381 return 0;
137382 }
@@ -137350,11 +137385,11 @@
137385 }
137386
137387 /*
137388 ** Return the number of changes since the database handle was opened.
137389 */
137390 SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3 *db){
137391 #ifdef SQLITE_ENABLE_API_ARMOR
137392 if( !sqlite3SafetyCheckOk(db) ){
137393 (void)SQLITE_MISUSE_BKPT;
137394 return 0;
137395 }
@@ -137501,12 +137536,12 @@
137536 ** statements or unfinished sqlite3_backups. The sqlite3_close_v2()
137537 ** version forces the connection to become a zombie if there are
137538 ** unclosed resources, and arranges for deallocation when the last
137539 ** prepare statement or sqlite3_backup closes.
137540 */
137541 SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3 *db){ return sqlite3Close(db,0); }
137542 SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3 *db){ return sqlite3Close(db,1); }
137543
137544
137545 /*
137546 ** Close the mutex on database connection db.
137547 **
@@ -137909,11 +137944,11 @@
137944
137945 /*
137946 ** This routine sets the busy callback for an Sqlite database to the
137947 ** given callback function with the given argument.
137948 */
137949 SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(
137950 sqlite3 *db,
137951 int (*xBusy)(void*,int),
137952 void *pArg
137953 ){
137954 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -137932,11 +137967,11 @@
137967 /*
137968 ** This routine sets the progress callback for an Sqlite database to the
137969 ** given callback function with the given argument. The progress callback will
137970 ** be invoked every nOps opcodes.
137971 */
137972 SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(
137973 sqlite3 *db,
137974 int nOps,
137975 int (*xProgress)(void*),
137976 void *pArg
137977 ){
@@ -137963,11 +137998,11 @@
137998
137999 /*
138000 ** This routine installs a default busy handler that waits for the
138001 ** specified number of milliseconds before returning 0.
138002 */
138003 SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3 *db, int ms){
138004 #ifdef SQLITE_ENABLE_API_ARMOR
138005 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
138006 #endif
138007 if( ms>0 ){
138008 sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db);
@@ -137979,11 +138014,11 @@
138014 }
138015
138016 /*
138017 ** Cause any pending operation to stop at its earliest opportunity.
138018 */
138019 SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3 *db){
138020 #ifdef SQLITE_ENABLE_API_ARMOR
138021 if( !sqlite3SafetyCheckOk(db) ){
138022 (void)SQLITE_MISUSE_BKPT;
138023 return;
138024 }
@@ -138095,11 +138130,11 @@
138130 }
138131
138132 /*
138133 ** Create new user functions.
138134 */
138135 SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
138136 sqlite3 *db,
138137 const char *zFunc,
138138 int nArg,
138139 int enc,
138140 void *p,
@@ -138109,11 +138144,11 @@
138144 ){
138145 return sqlite3_create_function_v2(db, zFunc, nArg, enc, p, xSFunc, xStep,
138146 xFinal, 0);
138147 }
138148
138149 SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
138150 sqlite3 *db,
138151 const char *zFunc,
138152 int nArg,
138153 int enc,
138154 void *p,
@@ -138152,11 +138187,11 @@
138187 sqlite3_mutex_leave(db->mutex);
138188 return rc;
138189 }
138190
138191 #ifndef SQLITE_OMIT_UTF16
138192 SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
138193 sqlite3 *db,
138194 const void *zFunctionName,
138195 int nArg,
138196 int eTextRep,
138197 void *p,
@@ -138192,11 +138227,11 @@
138227 ** When virtual tables intend to provide an overloaded function, they
138228 ** should call this routine to make sure the global function exists.
138229 ** A global function must exist in order for name resolution to work
138230 ** properly.
138231 */
138232 SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(
138233 sqlite3 *db,
138234 const char *zName,
138235 int nArg
138236 ){
138237 int rc = SQLITE_OK;
@@ -138224,11 +138259,11 @@
138259 ** A NULL trace function means that no tracing is executes. A non-NULL
138260 ** trace is a pointer to a function that is invoked at the start of each
138261 ** SQL statement.
138262 */
138263 #ifndef SQLITE_OMIT_DEPRECATED
138264 SQLITE_API void *SQLITE_STDCALL sqlite3_trace(sqlite3 *db, void(*xTrace)(void*,const char*), void *pArg){
138265 void *pOld;
138266
138267 #ifdef SQLITE_ENABLE_API_ARMOR
138268 if( !sqlite3SafetyCheckOk(db) ){
138269 (void)SQLITE_MISUSE_BKPT;
@@ -138245,11 +138280,11 @@
138280 }
138281 #endif /* SQLITE_OMIT_DEPRECATED */
138282
138283 /* Register a trace callback using the version-2 interface.
138284 */
138285 SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2(
138286 sqlite3 *db, /* Trace this connection */
138287 unsigned mTrace, /* Mask of events to be traced */
138288 int(*xTrace)(unsigned,void*,void*,void*), /* Callback to invoke */
138289 void *pArg /* Context */
138290 ){
@@ -138273,11 +138308,11 @@
138308 **
138309 ** A NULL profile function means that no profiling is executes. A non-NULL
138310 ** profile is a pointer to a function that is invoked at the conclusion of
138311 ** each SQL statement that is run.
138312 */
138313 SQLITE_API void *SQLITE_STDCALL sqlite3_profile(
138314 sqlite3 *db,
138315 void (*xProfile)(void*,const char*,sqlite_uint64),
138316 void *pArg
138317 ){
138318 void *pOld;
@@ -138301,11 +138336,11 @@
138336 /*
138337 ** Register a function to be invoked when a transaction commits.
138338 ** If the invoked function returns non-zero, then the commit becomes a
138339 ** rollback.
138340 */
138341 SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(
138342 sqlite3 *db, /* Attach the hook to this database */
138343 int (*xCallback)(void*), /* Function to invoke on each commit */
138344 void *pArg /* Argument to the function */
138345 ){
138346 void *pOld;
@@ -138326,11 +138361,11 @@
138361
138362 /*
138363 ** Register a callback to be invoked each time a row is updated,
138364 ** inserted or deleted using this database connection.
138365 */
138366 SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
138367 sqlite3 *db, /* Attach the hook to this database */
138368 void (*xCallback)(void*,int,char const *,char const *,sqlite_int64),
138369 void *pArg /* Argument to the function */
138370 ){
138371 void *pRet;
@@ -138351,11 +138386,11 @@
138386
138387 /*
138388 ** Register a callback to be invoked each time a transaction is rolled
138389 ** back by this database connection.
138390 */
138391 SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(
138392 sqlite3 *db, /* Attach the hook to this database */
138393 void (*xCallback)(void*), /* Callback function */
138394 void *pArg /* Argument to the function */
138395 ){
138396 void *pRet;
@@ -138377,11 +138412,11 @@
138412 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
138413 /*
138414 ** Register a callback to be invoked each time a row is updated,
138415 ** inserted or deleted using this database connection.
138416 */
138417 SQLITE_API void *SQLITE_STDCALL sqlite3_preupdate_hook(
138418 sqlite3 *db, /* Attach the hook to this database */
138419 void(*xCallback)( /* Callback function */
138420 void*,sqlite3*,int,char const*,char const*,sqlite3_int64,sqlite3_int64),
138421 void *pArg /* First callback argument */
138422 ){
@@ -138426,11 +138461,11 @@
138461 ** The callback registered by this function replaces any existing callback
138462 ** registered using sqlite3_wal_hook(). Likewise, registering a callback
138463 ** using sqlite3_wal_hook() disables the automatic checkpoint mechanism
138464 ** configured by this function.
138465 */
138466 SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){
138467 #ifdef SQLITE_OMIT_WAL
138468 UNUSED_PARAMETER(db);
138469 UNUSED_PARAMETER(nFrame);
138470 #else
138471 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -138447,11 +138482,11 @@
138482
138483 /*
138484 ** Register a callback to be invoked each time a transaction is written
138485 ** into the write-ahead-log by this database connection.
138486 */
138487 SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
138488 sqlite3 *db, /* Attach the hook to this db handle */
138489 int(*xCallback)(void *, sqlite3*, const char*, int),
138490 void *pArg /* First argument passed to xCallback() */
138491 ){
138492 #ifndef SQLITE_OMIT_WAL
@@ -138474,11 +138509,11 @@
138509 }
138510
138511 /*
138512 ** Checkpoint database zDb.
138513 */
138514 SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
138515 sqlite3 *db, /* Database handle */
138516 const char *zDb, /* Name of attached database (or NULL) */
138517 int eMode, /* SQLITE_CHECKPOINT_* value */
138518 int *pnLog, /* OUT: Size of WAL log in frames */
138519 int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -138529,11 +138564,11 @@
138564 /*
138565 ** Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points
138566 ** to contains a zero-length string, all attached databases are
138567 ** checkpointed.
138568 */
138569 SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){
138570 /* EVIDENCE-OF: R-41613-20553 The sqlite3_wal_checkpoint(D,X) is equivalent to
138571 ** sqlite3_wal_checkpoint_v2(D,X,SQLITE_CHECKPOINT_PASSIVE,0,0). */
138572 return sqlite3_wal_checkpoint_v2(db,zDb,SQLITE_CHECKPOINT_PASSIVE,0,0);
138573 }
138574
@@ -138620,11 +138655,11 @@
138655
138656 /*
138657 ** Return UTF-8 encoded English language explanation of the most recent
138658 ** error.
138659 */
138660 SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3 *db){
138661 const char *z;
138662 if( !db ){
138663 return sqlite3ErrStr(SQLITE_NOMEM_BKPT);
138664 }
138665 if( !sqlite3SafetyCheckSickOrOk(db) ){
@@ -138648,11 +138683,11 @@
138683 #ifndef SQLITE_OMIT_UTF16
138684 /*
138685 ** Return UTF-16 encoded English language explanation of the most recent
138686 ** error.
138687 */
138688 SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3 *db){
138689 static const u16 outOfMem[] = {
138690 'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0
138691 };
138692 static const u16 misuse[] = {
138693 'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ',
@@ -138693,38 +138728,38 @@
138728
138729 /*
138730 ** Return the most recent error code generated by an SQLite routine. If NULL is
138731 ** passed to this function, we assume a malloc() failed during sqlite3_open().
138732 */
138733 SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db){
138734 if( db && !sqlite3SafetyCheckSickOrOk(db) ){
138735 return SQLITE_MISUSE_BKPT;
138736 }
138737 if( !db || db->mallocFailed ){
138738 return SQLITE_NOMEM_BKPT;
138739 }
138740 return db->errCode & db->errMask;
138741 }
138742 SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db){
138743 if( db && !sqlite3SafetyCheckSickOrOk(db) ){
138744 return SQLITE_MISUSE_BKPT;
138745 }
138746 if( !db || db->mallocFailed ){
138747 return SQLITE_NOMEM_BKPT;
138748 }
138749 return db->errCode;
138750 }
138751 SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3 *db){
138752 return db ? db->iSysErrno : 0;
138753 }
138754
138755 /*
138756 ** Return a string that describes the kind of error specified in the
138757 ** argument. For now, this simply calls the internal sqlite3ErrStr()
138758 ** function.
138759 */
138760 SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int rc){
138761 return sqlite3ErrStr(rc);
138762 }
138763
138764 /*
138765 ** Create a new collating function for database "db". The name is zName
@@ -138868,11 +138903,11 @@
138903 **
138904 ** A new lower limit does not shrink existing constructs.
138905 ** It merely prevents new constructs that exceed the limit
138906 ** from forming.
138907 */
138908 SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3 *db, int limitId, int newLimit){
138909 int oldLimit;
138910
138911 #ifdef SQLITE_ENABLE_API_ARMOR
138912 if( !sqlite3SafetyCheckOk(db) ){
138913 (void)SQLITE_MISUSE_BKPT;
@@ -139492,18 +139527,18 @@
139527 }
139528
139529 /*
139530 ** Open a new database handle.
139531 */
139532 SQLITE_API int SQLITE_STDCALL sqlite3_open(
139533 const char *zFilename,
139534 sqlite3 **ppDb
139535 ){
139536 return openDatabase(zFilename, ppDb,
139537 SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0);
139538 }
139539 SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
139540 const char *filename, /* Database filename (UTF-8) */
139541 sqlite3 **ppDb, /* OUT: SQLite db handle */
139542 int flags, /* Flags */
139543 const char *zVfs /* Name of VFS module to use */
139544 ){
@@ -139512,11 +139547,11 @@
139547
139548 #ifndef SQLITE_OMIT_UTF16
139549 /*
139550 ** Open a new database handle.
139551 */
139552 SQLITE_API int SQLITE_STDCALL sqlite3_open16(
139553 const void *zFilename,
139554 sqlite3 **ppDb
139555 ){
139556 char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */
139557 sqlite3_value *pVal;
@@ -139551,11 +139586,11 @@
139586 #endif /* SQLITE_OMIT_UTF16 */
139587
139588 /*
139589 ** Register a new collation sequence with the database handle db.
139590 */
139591 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
139592 sqlite3* db,
139593 const char *zName,
139594 int enc,
139595 void* pCtx,
139596 int(*xCompare)(void*,int,const void*,int,const void*)
@@ -139564,11 +139599,11 @@
139599 }
139600
139601 /*
139602 ** Register a new collation sequence with the database handle db.
139603 */
139604 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
139605 sqlite3* db,
139606 const char *zName,
139607 int enc,
139608 void* pCtx,
139609 int(*xCompare)(void*,int,const void*,int,const void*),
@@ -139589,11 +139624,11 @@
139624
139625 #ifndef SQLITE_OMIT_UTF16
139626 /*
139627 ** Register a new collation sequence with the database handle db.
139628 */
139629 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
139630 sqlite3* db,
139631 const void *zName,
139632 int enc,
139633 void* pCtx,
139634 int(*xCompare)(void*,int,const void*,int,const void*)
@@ -139619,11 +139654,11 @@
139654
139655 /*
139656 ** Register a collation sequence factory callback with the database handle
139657 ** db. Replace any previously installed collation sequence factory.
139658 */
139659 SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
139660 sqlite3 *db,
139661 void *pCollNeededArg,
139662 void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*)
139663 ){
139664 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -139640,11 +139675,11 @@
139675 #ifndef SQLITE_OMIT_UTF16
139676 /*
139677 ** Register a collation sequence factory callback with the database handle
139678 ** db. Replace any previously installed collation sequence factory.
139679 */
139680 SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
139681 sqlite3 *db,
139682 void *pCollNeededArg,
139683 void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*)
139684 ){
139685 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -139662,11 +139697,11 @@
139697 #ifndef SQLITE_OMIT_DEPRECATED
139698 /*
139699 ** This function is now an anachronism. It used to be used to recover from a
139700 ** malloc() failure, but SQLite now does this automatically.
139701 */
139702 SQLITE_API int SQLITE_STDCALL sqlite3_global_recover(void){
139703 return SQLITE_OK;
139704 }
139705 #endif
139706
139707 /*
@@ -139673,11 +139708,11 @@
139708 ** Test to see whether or not the database connection is in autocommit
139709 ** mode. Return TRUE if it is and FALSE if not. Autocommit mode is on
139710 ** by default. Autocommit is disabled by a BEGIN statement and reenabled
139711 ** by the next COMMIT or ROLLBACK.
139712 */
139713 SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3 *db){
139714 #ifdef SQLITE_ENABLE_API_ARMOR
139715 if( !sqlite3SafetyCheckOk(db) ){
139716 (void)SQLITE_MISUSE_BKPT;
139717 return 0;
139718 }
@@ -139730,19 +139765,19 @@
139765 ** data for this thread has been deallocated.
139766 **
139767 ** SQLite no longer uses thread-specific data so this routine is now a
139768 ** no-op. It is retained for historical compatibility.
139769 */
139770 SQLITE_API void SQLITE_STDCALL sqlite3_thread_cleanup(void){
139771 }
139772 #endif
139773
139774 /*
139775 ** Return meta information about a specific column of a database table.
139776 ** See comment in sqlite3.h (sqlite.h.in) for details.
139777 */
139778 SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
139779 sqlite3 *db, /* Connection handle */
139780 const char *zDbName, /* Database name or NULL */
139781 const char *zTableName, /* Table name */
139782 const char *zColumnName, /* Column name */
139783 char const **pzDataType, /* OUTPUT: Declared data type */
@@ -139856,11 +139891,11 @@
139891 }
139892
139893 /*
139894 ** Sleep for a little while. Return the amount of time slept.
139895 */
139896 SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int ms){
139897 sqlite3_vfs *pVfs;
139898 int rc;
139899 pVfs = sqlite3_vfs_find(0);
139900 if( pVfs==0 ) return 0;
139901
@@ -139872,11 +139907,11 @@
139907 }
139908
139909 /*
139910 ** Enable or disable the extended result codes.
139911 */
139912 SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3 *db, int onoff){
139913 #ifdef SQLITE_ENABLE_API_ARMOR
139914 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
139915 #endif
139916 sqlite3_mutex_enter(db->mutex);
139917 db->errMask = onoff ? 0xffffffff : 0xff;
@@ -139885,11 +139920,11 @@
139920 }
139921
139922 /*
139923 ** Invoke the xFileControl method on a particular database.
139924 */
139925 SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
139926 int rc = SQLITE_ERROR;
139927 Btree *pBtree;
139928
139929 #ifdef SQLITE_ENABLE_API_ARMOR
139930 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -140270,11 +140305,11 @@
140305 ** method of a VFS implementation. The zParam argument is the name of the
140306 ** query parameter we seek. This routine returns the value of the zParam
140307 ** parameter if it exists. If the parameter does not exist, this routine
140308 ** returns a NULL pointer.
140309 */
140310 SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam){
140311 if( zFilename==0 || zParam==0 ) return 0;
140312 zFilename += sqlite3Strlen30(zFilename) + 1;
140313 while( zFilename[0] ){
140314 int x = strcmp(zFilename, zParam);
140315 zFilename += sqlite3Strlen30(zFilename) + 1;
@@ -140285,20 +140320,20 @@
140320 }
140321
140322 /*
140323 ** Return a boolean value for a query parameter.
140324 */
140325 SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){
140326 const char *z = sqlite3_uri_parameter(zFilename, zParam);
140327 bDflt = bDflt!=0;
140328 return z ? sqlite3GetBoolean(z, bDflt) : bDflt;
140329 }
140330
140331 /*
140332 ** Return a 64-bit integer value for a query parameter.
140333 */
140334 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(
140335 const char *zFilename, /* Filename as passed to xOpen */
140336 const char *zParam, /* URI parameter sought */
140337 sqlite3_int64 bDflt /* return if parameter is missing */
140338 ){
140339 const char *z = sqlite3_uri_parameter(zFilename, zParam);
@@ -140326,11 +140361,11 @@
140361
140362 /*
140363 ** Return the filename of the database associated with a database
140364 ** connection.
140365 */
140366 SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName){
140367 Btree *pBt;
140368 #ifdef SQLITE_ENABLE_API_ARMOR
140369 if( !sqlite3SafetyCheckOk(db) ){
140370 (void)SQLITE_MISUSE_BKPT;
140371 return 0;
@@ -140342,11 +140377,11 @@
140377
140378 /*
140379 ** Return 1 if database is read-only or 0 if read/write. Return -1 if
140380 ** no such database exists.
140381 */
140382 SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName){
140383 Btree *pBt;
140384 #ifdef SQLITE_ENABLE_API_ARMOR
140385 if( !sqlite3SafetyCheckOk(db) ){
140386 (void)SQLITE_MISUSE_BKPT;
140387 return -1;
@@ -140359,11 +140394,11 @@
140394 #ifdef SQLITE_ENABLE_SNAPSHOT
140395 /*
140396 ** Obtain a snapshot handle for the snapshot of database zDb currently
140397 ** being read by handle db.
140398 */
140399 SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_get(
140400 sqlite3 *db,
140401 const char *zDb,
140402 sqlite3_snapshot **ppSnapshot
140403 ){
140404 int rc = SQLITE_ERROR;
@@ -140394,11 +140429,11 @@
140429 }
140430
140431 /*
140432 ** Open a read-transaction on the snapshot idendified by pSnapshot.
140433 */
140434 SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_open(
140435 sqlite3 *db,
140436 const char *zDb,
140437 sqlite3_snapshot *pSnapshot
140438 ){
140439 int rc = SQLITE_ERROR;
@@ -140431,11 +140466,11 @@
140466 }
140467
140468 /*
140469 ** Free a snapshot handle obtained from sqlite3_snapshot_get().
140470 */
140471 SQLITE_API void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot *pSnapshot){
140472 sqlite3_free(pSnapshot);
140473 }
140474 #endif /* SQLITE_ENABLE_SNAPSHOT */
140475
140476 /************** End of main.c ************************************************/
@@ -140585,11 +140620,11 @@
140620 **
140621 ** Each call to this routine overrides any prior callbacks registered
140622 ** on the same "db". If xNotify==0 then any prior callbacks are immediately
140623 ** cancelled.
140624 */
140625 SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
140626 sqlite3 *db,
140627 void (*xNotify)(void **, int),
140628 void *pArg
140629 ){
140630 int rc = SQLITE_OK;
@@ -147588,11 +147623,11 @@
147623 ** Initialize API pointer table, if required.
147624 */
147625 #ifdef _WIN32
147626 __declspec(dllexport)
147627 #endif
147628 SQLITE_API int SQLITE_STDCALL sqlite3_fts3_init(
147629 sqlite3 *db,
147630 char **pzErrMsg,
147631 const sqlite3_api_routines *pApi
147632 ){
147633 SQLITE_EXTENSION_INIT2(pApi)
@@ -163389,11 +163424,11 @@
163424 }
163425
163426 /*
163427 ** Register a new geometry function for use with the r-tree MATCH operator.
163428 */
163429 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
163430 sqlite3 *db, /* Register SQL function on this connection */
163431 const char *zGeom, /* Name of the new SQL function */
163432 int (*xGeom)(sqlite3_rtree_geometry*,int,RtreeDValue*,int*), /* Callback */
163433 void *pContext /* Extra data associated with the callback */
163434 ){
@@ -163413,11 +163448,11 @@
163448
163449 /*
163450 ** Register a new 2nd-generation geometry function for use with the
163451 ** r-tree MATCH operator.
163452 */
163453 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
163454 sqlite3 *db, /* Register SQL function on this connection */
163455 const char *zQueryFunc, /* Name of new SQL function */
163456 int (*xQueryFunc)(sqlite3_rtree_query_info*), /* Callback */
163457 void *pContext, /* Extra data passed into the callback */
163458 void (*xDestructor)(void*) /* Destructor for the extra data */
@@ -163438,11 +163473,11 @@
163473
163474 #if !SQLITE_CORE
163475 #ifdef _WIN32
163476 __declspec(dllexport)
163477 #endif
163478 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_init(
163479 sqlite3 *db,
163480 char **pzErrMsg,
163481 const sqlite3_api_routines *pApi
163482 ){
163483 SQLITE_EXTENSION_INIT2(pApi)
@@ -163989,11 +164024,11 @@
164024
164025 #if !SQLITE_CORE
164026 #ifdef _WIN32
164027 __declspec(dllexport)
164028 #endif
164029 SQLITE_API int SQLITE_STDCALL sqlite3_icu_init(
164030 sqlite3 *db,
164031 char **pzErrMsg,
164032 const sqlite3_api_routines *pApi
164033 ){
164034 SQLITE_EXTENSION_INIT2(pApi)
@@ -164669,11 +164704,11 @@
164704 ** IMPORTANT NOTE FOR ZIPVFS USERS: The RBU extension works with all of
164705 ** SQLite's built-in VFSs, including the multiplexor VFS. However it does
164706 ** not work out of the box with zipvfs. Refer to the comment describing
164707 ** the zipvfs_create_vfs() API below for details on using RBU with zipvfs.
164708 */
164709 SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_open(
164710 const char *zTarget,
164711 const char *zRbu,
164712 const char *zState
164713 );
164714
@@ -164702,11 +164737,11 @@
164737 ** As with sqlite3rbu_open(), Zipvfs users should rever to the comment
164738 ** describing the sqlite3rbu_create_vfs() API function below for
164739 ** a description of the complications associated with using RBU with
164740 ** zipvfs databases.
164741 */
164742 SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_vacuum(
164743 const char *zTarget,
164744 const char *zState
164745 );
164746
164747 /*
@@ -164738,11 +164773,11 @@
164773 ** when sqlite3rbu_close() is called.
164774 **
164775 ** Database handles returned by this function remain valid until the next
164776 ** call to any sqlite3rbu_xxx() function other than sqlite3rbu_db().
164777 */
164778 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3rbu_db(sqlite3rbu*, int bRbu);
164779
164780 /*
164781 ** Do some work towards applying the RBU update to the target db.
164782 **
164783 ** Return SQLITE_DONE if the update has been completely applied, or
@@ -164752,11 +164787,11 @@
164787 **
164788 ** Once a call to sqlite3rbu_step() has returned a value other than
164789 ** SQLITE_OK, all subsequent calls on the same RBU handle are no-ops
164790 ** that immediately return the same value.
164791 */
164792 SQLITE_API int SQLITE_STDCALL sqlite3rbu_step(sqlite3rbu *pRbu);
164793
164794 /*
164795 ** Force RBU to save its state to disk.
164796 **
164797 ** If a power failure or application crash occurs during an update, following
@@ -164764,11 +164799,11 @@
164799 ** was last saved. In other words, from the most recent successful call to
164800 ** sqlite3rbu_close() or this function.
164801 **
164802 ** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
164803 */
164804 SQLITE_API int SQLITE_STDCALL sqlite3rbu_savestate(sqlite3rbu *pRbu);
164805
164806 /*
164807 ** Close an RBU handle.
164808 **
164809 ** If the RBU update has been completely applied, mark the RBU database
@@ -164784,18 +164819,18 @@
164819 **
164820 ** Otherwise, if no error occurs, this function returns SQLITE_OK if the
164821 ** update has been partially applied, or SQLITE_DONE if it has been
164822 ** completely applied.
164823 */
164824 SQLITE_API int SQLITE_STDCALL sqlite3rbu_close(sqlite3rbu *pRbu, char **pzErrmsg);
164825
164826 /*
164827 ** Return the total number of key-value operations (inserts, deletes or
164828 ** updates) that have been performed on the target database since the
164829 ** current RBU update was started.
164830 */
164831 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3rbu_progress(sqlite3rbu *pRbu);
164832
164833 /*
164834 ** Obtain permyriadage (permyriadage is to 10000 as percentage is to 100)
164835 ** progress indications for the two stages of an RBU update. This API may
164836 ** be useful for driving GUI progress indicators and similar.
@@ -164833,11 +164868,11 @@
164868 ** permyriadage progress of the same stage. If the rbu_count table does
164869 ** not exist, then (*pnOne) is set to -1 during stage 1. If the rbu_count
164870 ** table exists but is not correctly populated, the value of the *pnOne
164871 ** output variable during stage 1 is undefined.
164872 */
164873 SQLITE_API void SQLITE_STDCALL sqlite3rbu_bp_progress(sqlite3rbu *pRbu, int *pnOne, int *pnTwo);
164874
164875 /*
164876 ** Obtain an indication as to the current stage of an RBU update or vacuum.
164877 ** This function always returns one of the SQLITE_RBU_STATE_XXX constants
164878 ** defined in this file. Return values should be interpreted as follows:
@@ -164871,11 +164906,11 @@
164906 #define SQLITE_RBU_STATE_MOVE 2
164907 #define SQLITE_RBU_STATE_CHECKPOINT 3
164908 #define SQLITE_RBU_STATE_DONE 4
164909 #define SQLITE_RBU_STATE_ERROR 5
164910
164911 SQLITE_API int SQLITE_STDCALL sqlite3rbu_state(sqlite3rbu *pRbu);
164912
164913 /*
164914 ** Create an RBU VFS named zName that accesses the underlying file-system
164915 ** via existing VFS zParent. Or, if the zParent parameter is passed NULL,
164916 ** then the new RBU VFS uses the default system VFS to access the file-system.
@@ -164915,21 +164950,21 @@
164950 ** The overhead of adding the "rbu" VFS to the system is negligible for
164951 ** non-RBU users. There is no harm in an application accessing the
164952 ** file-system via "rbu" all the time, even if it only uses RBU functionality
164953 ** occasionally.
164954 */
164955 SQLITE_API int SQLITE_STDCALL sqlite3rbu_create_vfs(const char *zName, const char *zParent);
164956
164957 /*
164958 ** Deregister and destroy an RBU vfs created by an earlier call to
164959 ** sqlite3rbu_create_vfs().
164960 **
164961 ** VFS objects are not reference counted. If a VFS object is destroyed
164962 ** before all database handles that use it have been closed, the results
164963 ** are undefined.
164964 */
164965 SQLITE_API void SQLITE_STDCALL sqlite3rbu_destroy_vfs(const char *zName);
164966
164967 #if 0
164968 } /* end of the 'extern "C"' block */
164969 #endif
164970
@@ -168019,11 +168054,11 @@
168054 }
168055
168056 /*
168057 ** Step the RBU object.
168058 */
168059 SQLITE_API int SQLITE_STDCALL sqlite3rbu_step(sqlite3rbu *p){
168060 if( p ){
168061 switch( p->eStage ){
168062 case RBU_STAGE_OAL: {
168063 RbuObjIter *pIter = &p->objiter;
168064
@@ -168461,11 +168496,11 @@
168496 }
168497
168498 /*
168499 ** Open and return a new RBU handle.
168500 */
168501 SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_open(
168502 const char *zTarget,
168503 const char *zRbu,
168504 const char *zState
168505 ){
168506 /* TODO: Check that zTarget and zRbu are non-NULL */
@@ -168473,11 +168508,11 @@
168508 }
168509
168510 /*
168511 ** Open a handle to begin or resume an RBU VACUUM operation.
168512 */
168513 SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_vacuum(
168514 const char *zTarget,
168515 const char *zState
168516 ){
168517 /* TODO: Check that both arguments are non-NULL */
168518 return openRbuHandle(0, zTarget, zState);
@@ -168484,11 +168519,11 @@
168519 }
168520
168521 /*
168522 ** Return the database handle used by pRbu.
168523 */
168524 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3rbu_db(sqlite3rbu *pRbu, int bRbu){
168525 sqlite3 *db = 0;
168526 if( pRbu ){
168527 db = (bRbu ? pRbu->dbRbu : pRbu->dbMain);
168528 }
168529 return db;
@@ -168516,11 +168551,11 @@
168551 }
168552
168553 /*
168554 ** Close the RBU handle.
168555 */
168556 SQLITE_API int SQLITE_STDCALL sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){
168557 int rc;
168558 if( p ){
168559
168560 /* Commit the transaction to the *-oal file. */
168561 if( p->rc==SQLITE_OK && p->eStage==RBU_STAGE_OAL ){
@@ -168567,19 +168602,19 @@
168602 /*
168603 ** Return the total number of key-value operations (inserts, deletes or
168604 ** updates) that have been performed on the target database since the
168605 ** current RBU update was started.
168606 */
168607 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3rbu_progress(sqlite3rbu *pRbu){
168608 return pRbu->nProgress;
168609 }
168610
168611 /*
168612 ** Return permyriadage progress indications for the two main stages of
168613 ** an RBU update.
168614 */
168615 SQLITE_API void SQLITE_STDCALL sqlite3rbu_bp_progress(sqlite3rbu *p, int *pnOne, int *pnTwo){
168616 const int MAX_PROGRESS = 10000;
168617 switch( p->eStage ){
168618 case RBU_STAGE_OAL:
168619 if( p->nPhaseOneStep>0 ){
168620 *pnOne = (int)(MAX_PROGRESS * (i64)p->nProgress/(i64)p->nPhaseOneStep);
@@ -168610,11 +168645,11 @@
168645 }
168646
168647 /*
168648 ** Return the current state of the RBU vacuum or update operation.
168649 */
168650 SQLITE_API int SQLITE_STDCALL sqlite3rbu_state(sqlite3rbu *p){
168651 int aRes[] = {
168652 0, SQLITE_RBU_STATE_OAL, SQLITE_RBU_STATE_MOVE,
168653 0, SQLITE_RBU_STATE_CHECKPOINT, SQLITE_RBU_STATE_DONE
168654 };
168655
@@ -168638,11 +168673,11 @@
168673 );
168674 return aRes[p->eStage];
168675 }
168676 }
168677
168678 SQLITE_API int SQLITE_STDCALL sqlite3rbu_savestate(sqlite3rbu *p){
168679 int rc = p->rc;
168680 if( rc==SQLITE_DONE ) return SQLITE_OK;
168681
168682 assert( p->eStage>=RBU_STAGE_OAL && p->eStage<=RBU_STAGE_DONE );
168683 if( p->eStage==RBU_STAGE_OAL ){
@@ -169465,11 +169500,11 @@
169500
169501 /*
169502 ** Deregister and destroy an RBU vfs created by an earlier call to
169503 ** sqlite3rbu_create_vfs().
169504 */
169505 SQLITE_API void SQLITE_STDCALL sqlite3rbu_destroy_vfs(const char *zName){
169506 sqlite3_vfs *pVfs = sqlite3_vfs_find(zName);
169507 if( pVfs && pVfs->xOpen==rbuVfsOpen ){
169508 sqlite3_mutex_free(((rbu_vfs*)pVfs)->mutex);
169509 sqlite3_vfs_unregister(pVfs);
169510 sqlite3_free(pVfs);
@@ -169479,11 +169514,11 @@
169514 /*
169515 ** Create an RBU VFS named zName that accesses the underlying file-system
169516 ** via existing VFS zParent. The new object is registered as a non-default
169517 ** VFS with SQLite before returning.
169518 */
169519 SQLITE_API int SQLITE_STDCALL sqlite3rbu_create_vfs(const char *zName, const char *zParent){
169520
169521 /* Template for VFS */
169522 static sqlite3_vfs vfs_template = {
169523 1, /* iVersion */
169524 0, /* szOsFile */
@@ -171724,11 +171759,11 @@
171759 }
171760
171761 return rc;
171762 }
171763
171764 SQLITE_API int SQLITE_STDCALL sqlite3session_diff(
171765 sqlite3_session *pSession,
171766 const char *zFrom,
171767 const char *zTbl,
171768 char **pzErrMsg
171769 ){
@@ -171818,11 +171853,11 @@
171853
171854 /*
171855 ** Create a session object. This session object will record changes to
171856 ** database zDb attached to connection db.
171857 */
171858 SQLITE_API int SQLITE_STDCALL sqlite3session_create(
171859 sqlite3 *db, /* Database handle */
171860 const char *zDb, /* Name of db (e.g. "main") */
171861 sqlite3_session **ppSession /* OUT: New session object */
171862 ){
171863 sqlite3_session *pNew; /* Newly allocated session object */
@@ -171880,11 +171915,11 @@
171915 }
171916
171917 /*
171918 ** Delete a session object previously allocated using sqlite3session_create().
171919 */
171920 SQLITE_API void SQLITE_STDCALL sqlite3session_delete(sqlite3_session *pSession){
171921 sqlite3 *db = pSession->db;
171922 sqlite3_session *pHead;
171923 sqlite3_session **pp;
171924
171925 /* Unlink the session from the linked list of sessions attached to the
@@ -171909,11 +171944,11 @@
171944 }
171945
171946 /*
171947 ** Set a table filter on a Session Object.
171948 */
171949 SQLITE_API void SQLITE_STDCALL sqlite3session_table_filter(
171950 sqlite3_session *pSession,
171951 int(*xFilter)(void*, const char*),
171952 void *pCtx /* First argument passed to xFilter */
171953 ){
171954 pSession->bAutoAttach = 1;
@@ -171927,11 +171962,11 @@
171962 **
171963 ** Only tables that have a PRIMARY KEY defined may be attached. It does
171964 ** not matter if the PRIMARY KEY is an "INTEGER PRIMARY KEY" (rowid alias)
171965 ** or not.
171966 */
171967 SQLITE_API int SQLITE_STDCALL sqlite3session_attach(
171968 sqlite3_session *pSession, /* Session object */
171969 const char *zName /* Table name */
171970 ){
171971 int rc = SQLITE_OK;
171972 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
@@ -172617,11 +172652,11 @@
172652 ** session object passed as the first argument.
172653 **
172654 ** It is the responsibility of the caller to eventually free the buffer
172655 ** using sqlite3_free().
172656 */
172657 SQLITE_API int SQLITE_STDCALL sqlite3session_changeset(
172658 sqlite3_session *pSession, /* Session object */
172659 int *pnChangeset, /* OUT: Size of buffer at *ppChangeset */
172660 void **ppChangeset /* OUT: Buffer containing changeset */
172661 ){
172662 return sessionGenerateChangeset(pSession, 0, 0, 0, pnChangeset, ppChangeset);
@@ -172628,11 +172663,11 @@
172663 }
172664
172665 /*
172666 ** Streaming version of sqlite3session_changeset().
172667 */
172668 SQLITE_API int SQLITE_STDCALL sqlite3session_changeset_strm(
172669 sqlite3_session *pSession,
172670 int (*xOutput)(void *pOut, const void *pData, int nData),
172671 void *pOut
172672 ){
172673 return sessionGenerateChangeset(pSession, 0, xOutput, pOut, 0, 0);
@@ -172639,11 +172674,11 @@
172674 }
172675
172676 /*
172677 ** Streaming version of sqlite3session_patchset().
172678 */
172679 SQLITE_API int SQLITE_STDCALL sqlite3session_patchset_strm(
172680 sqlite3_session *pSession,
172681 int (*xOutput)(void *pOut, const void *pData, int nData),
172682 void *pOut
172683 ){
172684 return sessionGenerateChangeset(pSession, 1, xOutput, pOut, 0, 0);
@@ -172654,11 +172689,11 @@
172689 ** session object passed as the first argument.
172690 **
172691 ** It is the responsibility of the caller to eventually free the buffer
172692 ** using sqlite3_free().
172693 */
172694 SQLITE_API int SQLITE_STDCALL sqlite3session_patchset(
172695 sqlite3_session *pSession, /* Session object */
172696 int *pnPatchset, /* OUT: Size of buffer at *ppChangeset */
172697 void **ppPatchset /* OUT: Buffer containing changeset */
172698 ){
172699 return sessionGenerateChangeset(pSession, 1, 0, 0, pnPatchset, ppPatchset);
@@ -172665,11 +172700,11 @@
172700 }
172701
172702 /*
172703 ** Enable or disable the session object passed as the first argument.
172704 */
172705 SQLITE_API int SQLITE_STDCALL sqlite3session_enable(sqlite3_session *pSession, int bEnable){
172706 int ret;
172707 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172708 if( bEnable>=0 ){
172709 pSession->bEnable = bEnable;
172710 }
@@ -172679,11 +172714,11 @@
172714 }
172715
172716 /*
172717 ** Enable or disable the session object passed as the first argument.
172718 */
172719 SQLITE_API int SQLITE_STDCALL sqlite3session_indirect(sqlite3_session *pSession, int bIndirect){
172720 int ret;
172721 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172722 if( bIndirect>=0 ){
172723 pSession->bIndirect = bIndirect;
172724 }
@@ -172694,11 +172729,11 @@
172729
172730 /*
172731 ** Return true if there have been no changes to monitored tables recorded
172732 ** by the session object passed as the only argument.
172733 */
172734 SQLITE_API int SQLITE_STDCALL sqlite3session_isempty(sqlite3_session *pSession){
172735 int ret = 0;
172736 SessionTable *pTab;
172737
172738 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172739 for(pTab=pSession->pTable; pTab && ret==0; pTab=pTab->pNext){
@@ -172744,11 +172779,11 @@
172779 }
172780
172781 /*
172782 ** Create an iterator used to iterate through the contents of a changeset.
172783 */
172784 SQLITE_API int SQLITE_STDCALL sqlite3changeset_start(
172785 sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
172786 int nChangeset, /* Size of buffer pChangeset in bytes */
172787 void *pChangeset /* Pointer to buffer containing changeset */
172788 ){
172789 return sessionChangesetStart(pp, 0, 0, nChangeset, pChangeset);
@@ -172755,11 +172790,11 @@
172790 }
172791
172792 /*
172793 ** Streaming version of sqlite3changeset_start().
172794 */
172795 SQLITE_API int SQLITE_STDCALL sqlite3changeset_start_strm(
172796 sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
172797 int (*xInput)(void *pIn, void *pData, int *pnData),
172798 void *pIn
172799 ){
172800 return sessionChangesetStart(pp, xInput, pIn, 0, 0);
@@ -173176,20 +173211,20 @@
173211 ** or SQLITE_CORRUPT.
173212 **
173213 ** This function may not be called on iterators passed to a conflict handler
173214 ** callback by changeset_apply().
173215 */
173216 SQLITE_API int SQLITE_STDCALL sqlite3changeset_next(sqlite3_changeset_iter *p){
173217 return sessionChangesetNext(p, 0, 0);
173218 }
173219
173220 /*
173221 ** The following function extracts information on the current change
173222 ** from a changeset iterator. It may only be called after changeset_next()
173223 ** has returned SQLITE_ROW.
173224 */
173225 SQLITE_API int SQLITE_STDCALL sqlite3changeset_op(
173226 sqlite3_changeset_iter *pIter, /* Iterator handle */
173227 const char **pzTab, /* OUT: Pointer to table name */
173228 int *pnCol, /* OUT: Number of columns in table */
173229 int *pOp, /* OUT: SQLITE_INSERT, DELETE or UPDATE */
173230 int *pbIndirect /* OUT: True if change is indirect */
@@ -173205,11 +173240,11 @@
173240 ** Return information regarding the PRIMARY KEY and number of columns in
173241 ** the database table affected by the change that pIter currently points
173242 ** to. This function may only be called after changeset_next() returns
173243 ** SQLITE_ROW.
173244 */
173245 SQLITE_API int SQLITE_STDCALL sqlite3changeset_pk(
173246 sqlite3_changeset_iter *pIter, /* Iterator object */
173247 unsigned char **pabPK, /* OUT: Array of boolean - true for PK cols */
173248 int *pnCol /* OUT: Number of entries in output array */
173249 ){
173250 *pabPK = pIter->abPK;
@@ -173228,11 +173263,11 @@
173263 ** was not modified and is not a PK column), 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_STDCALL sqlite3changeset_old(
173269 sqlite3_changeset_iter *pIter, /* Changeset iterator */
173270 int iVal, /* Index of old.* value to retrieve */
173271 sqlite3_value **ppValue /* OUT: Old value (or NULL pointer) */
173272 ){
173273 if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_DELETE ){
@@ -173256,11 +173291,11 @@
173291 ** was not modified), set *ppValue to NULL.
173292 **
173293 ** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is
173294 ** not modified. Otherwise, SQLITE_OK.
173295 */
173296 SQLITE_API int SQLITE_STDCALL sqlite3changeset_new(
173297 sqlite3_changeset_iter *pIter, /* Changeset iterator */
173298 int iVal, /* Index of new.* value to retrieve */
173299 sqlite3_value **ppValue /* OUT: New value (or NULL pointer) */
173300 ){
173301 if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_INSERT ){
@@ -173290,11 +173325,11 @@
173325 ** containing the iVal'th value of the conflicting record.
173326 **
173327 ** If value iVal is out-of-range or some other error occurs, an SQLite error
173328 ** code is returned. Otherwise, SQLITE_OK.
173329 */
173330 SQLITE_API int SQLITE_STDCALL sqlite3changeset_conflict(
173331 sqlite3_changeset_iter *pIter, /* Changeset iterator */
173332 int iVal, /* Index of conflict record value to fetch */
173333 sqlite3_value **ppValue /* OUT: Value from conflicting row */
173334 ){
173335 if( !pIter->pConflict ){
@@ -173313,11 +173348,11 @@
173348 ** it sets the output variable to the total number of known foreign key
173349 ** violations in the destination database and returns SQLITE_OK.
173350 **
173351 ** In all other cases this function returns SQLITE_MISUSE.
173352 */
173353 SQLITE_API int SQLITE_STDCALL sqlite3changeset_fk_conflicts(
173354 sqlite3_changeset_iter *pIter, /* Changeset iterator */
173355 int *pnOut /* OUT: Number of FK violations */
173356 ){
173357 if( pIter->pConflict || pIter->apValue ){
173358 return SQLITE_MISUSE;
@@ -173331,11 +173366,11 @@
173366 ** Finalize an iterator allocated with sqlite3changeset_start().
173367 **
173368 ** This function may not be called on iterators passed to a conflict handler
173369 ** callback by changeset_apply().
173370 */
173371 SQLITE_API int SQLITE_STDCALL sqlite3changeset_finalize(sqlite3_changeset_iter *p){
173372 int rc = SQLITE_OK;
173373 if( p ){
173374 int i; /* Used to iterate through p->apValue[] */
173375 rc = p->rc;
173376 if( p->apValue ){
@@ -173505,11 +173540,11 @@
173540
173541
173542 /*
173543 ** Invert a changeset object.
173544 */
173545 SQLITE_API int SQLITE_STDCALL sqlite3changeset_invert(
173546 int nChangeset, /* Number of bytes in input */
173547 const void *pChangeset, /* Input changeset */
173548 int *pnInverted, /* OUT: Number of bytes in output changeset */
173549 void **ppInverted /* OUT: Inverse of pChangeset */
173550 ){
@@ -173524,11 +173559,11 @@
173559 }
173560
173561 /*
173562 ** Streaming version of sqlite3changeset_invert().
173563 */
173564 SQLITE_API int SQLITE_STDCALL sqlite3changeset_invert_strm(
173565 int (*xInput)(void *pIn, void *pData, int *pnData),
173566 void *pIn,
173567 int (*xOutput)(void *pOut, const void *pData, int nData),
173568 void *pOut
173569 ){
@@ -174404,11 +174439,11 @@
174439 /*
174440 ** Apply the changeset passed via pChangeset/nChangeset 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_STDCALL sqlite3changeset_apply(
174445 sqlite3 *db, /* Apply change to "main" db of this handle */
174446 int nChangeset, /* Size of changeset in bytes */
174447 void *pChangeset, /* Changeset blob */
174448 int(*xFilter)(
174449 void *pCtx, /* Copy of sixth arg to _apply() */
@@ -174432,11 +174467,11 @@
174467 /*
174468 ** Apply the changeset passed via xInput/pIn to the main database
174469 ** attached to handle "db". Invoke the supplied conflict handler callback
174470 ** to resolve any conflicts encountered while applying the change.
174471 */
174472 SQLITE_API int SQLITE_STDCALL sqlite3changeset_apply_strm(
174473 sqlite3 *db, /* Apply change to "main" db of this handle */
174474 int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
174475 void *pIn, /* First arg for xInput */
174476 int(*xFilter)(
174477 void *pCtx, /* Copy of sixth arg to _apply() */
@@ -174767,11 +174802,11 @@
174802 }
174803
174804 /*
174805 ** Allocate a new, empty, sqlite3_changegroup.
174806 */
174807 SQLITE_API int SQLITE_STDCALL sqlite3changegroup_new(sqlite3_changegroup **pp){
174808 int rc = SQLITE_OK; /* Return code */
174809 sqlite3_changegroup *p; /* New object */
174810 p = (sqlite3_changegroup*)sqlite3_malloc(sizeof(sqlite3_changegroup));
174811 if( p==0 ){
174812 rc = SQLITE_NOMEM;
@@ -174784,11 +174819,11 @@
174819
174820 /*
174821 ** Add the changeset currently stored in buffer pData, size nData bytes,
174822 ** to changeset-group p.
174823 */
174824 SQLITE_API int SQLITE_STDCALL sqlite3changegroup_add(sqlite3_changegroup *pGrp, int nData, void *pData){
174825 sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */
174826 int rc; /* Return code */
174827
174828 rc = sqlite3changeset_start(&pIter, nData, pData);
174829 if( rc==SQLITE_OK ){
@@ -174800,11 +174835,11 @@
174835
174836 /*
174837 ** Obtain a buffer containing a changeset representing the concatenation
174838 ** of all changesets added to the group so far.
174839 */
174840 SQLITE_API int SQLITE_STDCALL sqlite3changegroup_output(
174841 sqlite3_changegroup *pGrp,
174842 int *pnData,
174843 void **ppData
174844 ){
174845 return sessionChangegroupOutput(pGrp, 0, 0, pnData, ppData);
@@ -174811,11 +174846,11 @@
174846 }
174847
174848 /*
174849 ** Streaming versions of changegroup_add().
174850 */
174851 SQLITE_API int SQLITE_STDCALL sqlite3changegroup_add_strm(
174852 sqlite3_changegroup *pGrp,
174853 int (*xInput)(void *pIn, void *pData, int *pnData),
174854 void *pIn
174855 ){
174856 sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */
@@ -174830,11 +174865,11 @@
174865 }
174866
174867 /*
174868 ** Streaming versions of changegroup_output().
174869 */
174870 SQLITE_API int SQLITE_STDCALL sqlite3changegroup_output_strm(
174871 sqlite3_changegroup *pGrp,
174872 int (*xOutput)(void *pOut, const void *pData, int nData),
174873 void *pOut
174874 ){
174875 return sessionChangegroupOutput(pGrp, xOutput, pOut, 0, 0);
@@ -174841,21 +174876,21 @@
174876 }
174877
174878 /*
174879 ** Delete a changegroup object.
174880 */
174881 SQLITE_API void SQLITE_STDCALL sqlite3changegroup_delete(sqlite3_changegroup *pGrp){
174882 if( pGrp ){
174883 sessionDeleteTable(pGrp->pList);
174884 sqlite3_free(pGrp);
174885 }
174886 }
174887
174888 /*
174889 ** Combine two changesets together.
174890 */
174891 SQLITE_API int SQLITE_STDCALL sqlite3changeset_concat(
174892 int nLeft, /* Number of bytes in lhs input */
174893 void *pLeft, /* Lhs input changeset */
174894 int nRight /* Number of bytes in rhs input */,
174895 void *pRight, /* Rhs input changeset */
174896 int *pnOut, /* OUT: Number of bytes in output changeset */
@@ -174880,11 +174915,11 @@
174915 }
174916
174917 /*
174918 ** Streaming version of sqlite3changeset_concat().
174919 */
174920 SQLITE_API int SQLITE_STDCALL sqlite3changeset_concat_strm(
174921 int (*xInputA)(void *pIn, void *pData, int *pnData),
174922 void *pInA,
174923 int (*xInputB)(void *pIn, void *pData, int *pnData),
174924 void *pInB,
174925 int (*xOutput)(void *pOut, const void *pData, int nData),
@@ -177112,11 +177147,11 @@
177147
177148 #ifndef SQLITE_CORE
177149 #ifdef _WIN32
177150 __declspec(dllexport)
177151 #endif
177152 SQLITE_API int SQLITE_STDCALL sqlite3_json_init(
177153 sqlite3 *db,
177154 char **pzErrMsg,
177155 const sqlite3_api_routines *pApi
177156 ){
177157 SQLITE_EXTENSION_INIT2(pApi);
@@ -193945,11 +193980,11 @@
193980 int nArg, /* Number of args */
193981 sqlite3_value **apUnused /* Function arguments */
193982 ){
193983 assert( nArg==0 );
193984 UNUSED_PARAM2(nArg, apUnused);
193985 sqlite3_result_text(pCtx, "fts5: 2016-08-04 13:23:28 9adda385267d1a0ecff259b42a284913668441a2", -1, SQLITE_TRANSIENT);
193986 }
193987
193988 static int fts5Init(sqlite3 *db){
193989 static const sqlite3_module fts5Mod = {
193990 /* iVersion */ 2,
@@ -194033,11 +194068,11 @@
194068 */
194069 #ifndef SQLITE_CORE
194070 #ifdef _WIN32
194071 __declspec(dllexport)
194072 #endif
194073 SQLITE_API int SQLITE_STDCALL sqlite3_fts_init(
194074 sqlite3 *db,
194075 char **pzErrMsg,
194076 const sqlite3_api_routines *pApi
194077 ){
194078 SQLITE_EXTENSION_INIT2(pApi);
@@ -194046,11 +194081,11 @@
194081 }
194082
194083 #ifdef _WIN32
194084 __declspec(dllexport)
194085 #endif
194086 SQLITE_API int SQLITE_STDCALL sqlite3_fts5_init(
194087 sqlite3 *db,
194088 char **pzErrMsg,
194089 const sqlite3_api_routines *pApi
194090 ){
194091 SQLITE_EXTENSION_INIT2(pApi);
194092
+458 -457
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -120,11 +120,11 @@
120120
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
121121
** [sqlite_version()] and [sqlite_source_id()].
122122
*/
123123
#define SQLITE_VERSION "3.14.0"
124124
#define SQLITE_VERSION_NUMBER 3014000
125
-#define SQLITE_SOURCE_ID "2016-08-02 08:45:26 7c38a79cdd42aaa45715aea330d10ca859098837"
125
+#define SQLITE_SOURCE_ID "2016-08-04 13:23:28 9adda385267d1a0ecff259b42a284913668441a2"
126126
127127
/*
128128
** CAPI3REF: Run-Time Library Version Numbers
129129
** KEYWORDS: sqlite3_version, sqlite3_sourceid
130130
**
@@ -153,13 +153,13 @@
153153
** [SQLITE_SOURCE_ID] C preprocessor macro.
154154
**
155155
** See also: [sqlite_version()] and [sqlite_source_id()].
156156
*/
157157
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);
158
+SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void);
159
+SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void);
160
+SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void);
161161
162162
/*
163163
** CAPI3REF: Run-Time Library Compilation Options Diagnostics
164164
**
165165
** ^The sqlite3_compileoption_used() function returns 0 or 1
@@ -180,12 +180,12 @@
180180
**
181181
** See also: SQL functions [sqlite_compileoption_used()] and
182182
** [sqlite_compileoption_get()] and the [compile_options pragma].
183183
*/
184184
#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);
185
+SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName);
186
+SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N);
187187
#endif
188188
189189
/*
190190
** CAPI3REF: Test To See If The Library Is Threadsafe
191191
**
@@ -220,11 +220,11 @@
220220
** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
221221
** is unchanged by calls to sqlite3_config().)^
222222
**
223223
** See the [threading mode] documentation for additional information.
224224
*/
225
-SQLITE_API int SQLITE_APICALL sqlite3_threadsafe(void);
225
+SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void);
226226
227227
/*
228228
** CAPI3REF: Database Connection Handle
229229
** KEYWORDS: {database connection} {database connections}
230230
**
@@ -317,19 +317,19 @@
317317
** from [sqlite3_open()], [sqlite3_open16()], or
318318
** [sqlite3_open_v2()], and not previously closed.
319319
** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
320320
** argument is a harmless no-op.
321321
*/
322
-SQLITE_API int SQLITE_APICALL sqlite3_close(sqlite3*);
323
-SQLITE_API int SQLITE_APICALL sqlite3_close_v2(sqlite3*);
322
+SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3*);
323
+SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3*);
324324
325325
/*
326326
** The type for a callback function.
327327
** This is legacy and deprecated. It is included for historical
328328
** compatibility and is not documented.
329329
*/
330
-typedef int (SQLITE_CALLBACK *sqlite3_callback)(void*,int,char**, char**);
330
+typedef int (*sqlite3_callback)(void*,int,char**, char**);
331331
332332
/*
333333
** CAPI3REF: One-Step Query Execution Interface
334334
** METHOD: sqlite3
335335
**
@@ -389,14 +389,14 @@
389389
** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
390390
** <li> The application must not modify the SQL statement text passed into
391391
** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
392392
** </ul>
393393
*/
394
-SQLITE_API int SQLITE_APICALL sqlite3_exec(
394
+SQLITE_API int SQLITE_STDCALL sqlite3_exec(
395395
sqlite3*, /* An open database */
396396
const char *sql, /* SQL to be evaluated */
397
- int (SQLITE_CALLBACK *callback)(void*,int,char**,char**), /* Callback function */
397
+ int (*callback)(void*,int,char**,char**), /* Callback function */
398398
void *, /* 1st argument to callback */
399399
char **errmsg /* Error msg written here */
400400
);
401401
402402
/*
@@ -740,30 +740,30 @@
740740
** database corruption.
741741
*/
742742
typedef struct sqlite3_io_methods sqlite3_io_methods;
743743
struct sqlite3_io_methods {
744744
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*);
745
+ int (*xClose)(sqlite3_file*);
746
+ int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
747
+ int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
748
+ int (*xTruncate)(sqlite3_file*, sqlite3_int64 size);
749
+ int (*xSync)(sqlite3_file*, int flags);
750
+ int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
751
+ int (*xLock)(sqlite3_file*, int);
752
+ int (*xUnlock)(sqlite3_file*, int);
753
+ int (*xCheckReservedLock)(sqlite3_file*, int *pResOut);
754
+ int (*xFileControl)(sqlite3_file*, int op, void *pArg);
755
+ int (*xSectorSize)(sqlite3_file*);
756
+ int (*xDeviceCharacteristics)(sqlite3_file*);
757757
/* 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);
758
+ int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
759
+ int (*xShmLock)(sqlite3_file*, int offset, int n, int flags);
760
+ void (*xShmBarrier)(sqlite3_file*);
761
+ int (*xShmUnmap)(sqlite3_file*, int deleteFlag);
762762
/* 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);
763
+ int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
764
+ int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p);
765765
/* Methods above are valid for version 3 */
766766
/* Additional methods may be added in future releases */
767767
};
768768
769769
/*
@@ -935,11 +935,11 @@
935935
** ^The [SQLITE_FCNTL_BUSYHANDLER]
936936
** file-control may be invoked by SQLite on the database file handle
937937
** shortly after it is opened in order to provide a custom VFS with access
938938
** to the connections busy-handler callback. The argument is of type (void **)
939939
** - 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
940
+** to a function of type (int (*)(void *)). In order to invoke the connections
941941
** busy-handler, this function should be invoked with the second (void *) in
942942
** the array as the only argument. If it returns non-zero, then the operation
943943
** should be retried. If it returns zero, the custom VFS should abandon the
944944
** current operation.
945945
**
@@ -1211,43 +1211,43 @@
12111211
** or all of these interfaces to be NULL or for their behavior to change
12121212
** from one release to the next. Applications must not attempt to access
12131213
** any of these methods if the iVersion of the VFS is less than 3.
12141214
*/
12151215
typedef struct sqlite3_vfs sqlite3_vfs;
1216
-typedef void (SQLITE_SYSAPI *sqlite3_syscall_ptr)(void);
1216
+typedef void (*sqlite3_syscall_ptr)(void);
12171217
struct sqlite3_vfs {
12181218
int iVersion; /* Structure version number (currently 3) */
12191219
int szOsFile; /* Size of subclassed sqlite3_file */
12201220
int mxPathname; /* Maximum file pathname length */
12211221
sqlite3_vfs *pNext; /* Next registered VFS */
12221222
const char *zName; /* Name of this virtual file system */
12231223
void *pAppData; /* Pointer to application-specific data */
1224
- int (SQLITE_CALLBACK *xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
1224
+ int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
12251225
int flags, int *pOutFlags);
1226
- int (SQLITE_CALLBACK *xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
1227
- int (SQLITE_CALLBACK *xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
1228
- int (SQLITE_CALLBACK *xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
1229
- void *(SQLITE_CALLBACK *xDlOpen)(sqlite3_vfs*, const char *zFilename);
1230
- void (SQLITE_CALLBACK *xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
1231
- void (SQLITE_CALLBACK *(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
1232
- void (SQLITE_CALLBACK *xDlClose)(sqlite3_vfs*, void*);
1233
- int (SQLITE_CALLBACK *xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
1234
- int (SQLITE_CALLBACK *xSleep)(sqlite3_vfs*, int microseconds);
1235
- int (SQLITE_CALLBACK *xCurrentTime)(sqlite3_vfs*, double*);
1236
- int (SQLITE_CALLBACK *xGetLastError)(sqlite3_vfs*, int, char *);
1226
+ int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
1227
+ int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
1228
+ int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
1229
+ void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename);
1230
+ void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
1231
+ void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
1232
+ void (*xDlClose)(sqlite3_vfs*, void*);
1233
+ int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
1234
+ int (*xSleep)(sqlite3_vfs*, int microseconds);
1235
+ int (*xCurrentTime)(sqlite3_vfs*, double*);
1236
+ int (*xGetLastError)(sqlite3_vfs*, int, char *);
12371237
/*
12381238
** The methods above are in version 1 of the sqlite_vfs object
12391239
** definition. Those that follow are added in version 2 or later
12401240
*/
1241
- int (SQLITE_CALLBACK *xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
1241
+ int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
12421242
/*
12431243
** The methods above are in versions 1 and 2 of the sqlite_vfs object.
12441244
** Those below are for version 3 and greater.
12451245
*/
1246
- int (SQLITE_CALLBACK *xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
1247
- sqlite3_syscall_ptr (SQLITE_CALLBACK *xGetSystemCall)(sqlite3_vfs*, const char *zName);
1248
- const char *(SQLITE_CALLBACK *xNextSystemCall)(sqlite3_vfs*, const char *zName);
1246
+ int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
1247
+ sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName);
1248
+ const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName);
12491249
/*
12501250
** The methods above are in versions 1 through 3 of the sqlite_vfs object.
12511251
** New fields may be appended in future versions. The iVersion
12521252
** value will increment whenever this happens.
12531253
*/
@@ -1388,14 +1388,14 @@
13881388
** sqlite3_os_init() and sqlite3_os_end(). An application-supplied
13891389
** implementation of sqlite3_os_init() or sqlite3_os_end()
13901390
** must return [SQLITE_OK] on success and some other [error code] upon
13911391
** failure.
13921392
*/
1393
-SQLITE_API int SQLITE_APICALL sqlite3_initialize(void);
1394
-SQLITE_API int SQLITE_APICALL sqlite3_shutdown(void);
1395
-SQLITE_API int SQLITE_APICALL sqlite3_os_init(void);
1396
-SQLITE_API int SQLITE_APICALL sqlite3_os_end(void);
1393
+SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void);
1394
+SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void);
1395
+SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void);
1396
+SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void);
13971397
13981398
/*
13991399
** CAPI3REF: Configuring The SQLite Library
14001400
**
14011401
** The sqlite3_config() interface is used to make global configuration
@@ -1510,17 +1510,17 @@
15101510
** SQLite will never invoke xInit() more than once without an intervening
15111511
** call to xShutdown().
15121512
*/
15131513
typedef struct sqlite3_mem_methods sqlite3_mem_methods;
15141514
struct sqlite3_mem_methods {
1515
- void *(SQLITE_CALLBACK *xMalloc)(int); /* Memory allocation function */
1516
- void (SQLITE_CALLBACK *xFree)(void*); /* Free a prior allocation */
1517
- void *(SQLITE_CALLBACK *xRealloc)(void*,int); /* Resize an allocation */
1518
- int (SQLITE_CALLBACK *xSize)(void*); /* Return the size of an allocation */
1519
- int (SQLITE_CALLBACK *xRoundup)(int); /* Round up request size to allocation size */
1520
- int (SQLITE_CALLBACK *xInit)(void*); /* Initialize the memory allocator */
1521
- void (SQLITE_CALLBACK *xShutdown)(void*); /* Deinitialize the memory allocator */
1515
+ void *(*xMalloc)(int); /* Memory allocation function */
1516
+ void (*xFree)(void*); /* Free a prior allocation */
1517
+ void *(*xRealloc)(void*,int); /* Resize an allocation */
1518
+ int (*xSize)(void*); /* Return the size of an allocation */
1519
+ int (*xRoundup)(int); /* Round up request size to allocation size */
1520
+ int (*xInit)(void*); /* Initialize the memory allocator */
1521
+ void (*xShutdown)(void*); /* Deinitialize the memory allocator */
15221522
void *pAppData; /* Argument to xInit() and xShutdown() */
15231523
};
15241524
15251525
/*
15261526
** CAPI3REF: Configuration Options
@@ -1733,11 +1733,11 @@
17331733
**
17341734
** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
17351735
** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
17361736
** global [error log].
17371737
** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a
1738
-** function with a call signature of void(SQLITE_CALLBACK *)(void*,int,const char*),
1738
+** function with a call signature of void(*)(void*,int,const char*),
17391739
** and a pointer to void. ^If the function pointer is not NULL, it is
17401740
** invoked by [sqlite3_log()] to process each logging event. ^If the
17411741
** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op.
17421742
** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is
17431743
** passed through as the first parameter to the application-defined logger
@@ -1786,11 +1786,11 @@
17861786
**
17871787
** [[SQLITE_CONFIG_SQLLOG]]
17881788
** <dt>SQLITE_CONFIG_SQLLOG
17891789
** <dd>This option is only available if sqlite is compiled with the
17901790
** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should
1791
-** be a pointer to a function of type void(SQLITE_CALLBACK *)(void*,sqlite3*,const char*, int).
1791
+** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int).
17921792
** The second should be of type (void*). The callback is invoked by the library
17931793
** in three separate circumstances, identified by the value passed as the
17941794
** fourth parameter. If the fourth parameter is 0, then the database connection
17951795
** passed as the second argument has just been opened. The third argument
17961796
** points to a buffer containing the name of the main database file. If the
@@ -1984,11 +1984,11 @@
19841984
**
19851985
** ^The sqlite3_extended_result_codes() routine enables or disables the
19861986
** [extended result codes] feature of SQLite. ^The extended result
19871987
** codes are disabled by default for historical compatibility.
19881988
*/
1989
-SQLITE_API int SQLITE_APICALL sqlite3_extended_result_codes(sqlite3*, int onoff);
1989
+SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3*, int onoff);
19901990
19911991
/*
19921992
** CAPI3REF: Last Insert Rowid
19931993
** METHOD: sqlite3
19941994
**
@@ -2036,11 +2036,11 @@
20362036
** function is running and thus changes the last insert [rowid],
20372037
** then the value returned by [sqlite3_last_insert_rowid()] is
20382038
** unpredictable and might not equal either the old or the new
20392039
** last insert [rowid].
20402040
*/
2041
-SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_last_insert_rowid(sqlite3*);
2041
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3*);
20422042
20432043
/*
20442044
** CAPI3REF: Count The Number Of Rows Modified
20452045
** METHOD: sqlite3
20462046
**
@@ -2089,11 +2089,11 @@
20892089
**
20902090
** If a separate thread makes changes on the same database connection
20912091
** while [sqlite3_changes()] is running then the value returned
20922092
** is unpredictable and not meaningful.
20932093
*/
2094
-SQLITE_API int SQLITE_APICALL sqlite3_changes(sqlite3*);
2094
+SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3*);
20952095
20962096
/*
20972097
** CAPI3REF: Total Number Of Rows Modified
20982098
** METHOD: sqlite3
20992099
**
@@ -2113,11 +2113,11 @@
21132113
**
21142114
** If a separate thread makes changes on the same database connection
21152115
** while [sqlite3_total_changes()] is running then the value
21162116
** returned is unpredictable and not meaningful.
21172117
*/
2118
-SQLITE_API int SQLITE_APICALL sqlite3_total_changes(sqlite3*);
2118
+SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3*);
21192119
21202120
/*
21212121
** CAPI3REF: Interrupt A Long-Running Query
21222122
** METHOD: sqlite3
21232123
**
@@ -2153,11 +2153,11 @@
21532153
** that are started after the sqlite3_interrupt() call returns.
21542154
**
21552155
** If the database connection closes while [sqlite3_interrupt()]
21562156
** is running then bad things will likely happen.
21572157
*/
2158
-SQLITE_API void SQLITE_APICALL sqlite3_interrupt(sqlite3*);
2158
+SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3*);
21592159
21602160
/*
21612161
** CAPI3REF: Determine If An SQL Statement Is Complete
21622162
**
21632163
** These routines are useful during command-line input to determine if the
@@ -2188,12 +2188,12 @@
21882188
** UTF-8 string.
21892189
**
21902190
** The input to [sqlite3_complete16()] must be a zero-terminated
21912191
** UTF-16 string in native byte order.
21922192
*/
2193
-SQLITE_API int SQLITE_APICALL sqlite3_complete(const char *sql);
2194
-SQLITE_API int SQLITE_APICALL sqlite3_complete16(const void *sql);
2193
+SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *sql);
2194
+SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *sql);
21952195
21962196
/*
21972197
** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
21982198
** KEYWORDS: {busy-handler callback} {busy handler}
21992199
** METHOD: sqlite3
@@ -2250,11 +2250,11 @@
22502250
** result in undefined behavior.
22512251
**
22522252
** A busy handler must not close the database connection
22532253
** or [prepared statement] that invoked the busy handler.
22542254
*/
2255
-SQLITE_API int SQLITE_APICALL sqlite3_busy_handler(sqlite3*,int(SQLITE_CALLBACK *)(void*,int),void*);
2255
+SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(sqlite3*,int(*)(void*,int),void*);
22562256
22572257
/*
22582258
** CAPI3REF: Set A Busy Timeout
22592259
** METHOD: sqlite3
22602260
**
@@ -2273,11 +2273,11 @@
22732273
** was defined (using [sqlite3_busy_handler()]) prior to calling
22742274
** this routine, that other busy handler is cleared.)^
22752275
**
22762276
** See also: [PRAGMA busy_timeout]
22772277
*/
2278
-SQLITE_API int SQLITE_APICALL sqlite3_busy_timeout(sqlite3*, int ms);
2278
+SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3*, int ms);
22792279
22802280
/*
22812281
** CAPI3REF: Convenience Routines For Running Queries
22822282
** METHOD: sqlite3
22832283
**
@@ -2348,19 +2348,19 @@
23482348
** interface defined here. As a consequence, errors that occur in the
23492349
** wrapper layer outside of the internal [sqlite3_exec()] call are not
23502350
** reflected in subsequent calls to [sqlite3_errcode()] or
23512351
** [sqlite3_errmsg()].
23522352
*/
2353
-SQLITE_API int SQLITE_APICALL sqlite3_get_table(
2353
+SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
23542354
sqlite3 *db, /* An open database */
23552355
const char *zSql, /* SQL to be evaluated */
23562356
char ***pazResult, /* Results of the query */
23572357
int *pnRow, /* Number of result rows written here */
23582358
int *pnColumn, /* Number of result columns written here */
23592359
char **pzErrmsg /* Error msg written here */
23602360
);
2361
-SQLITE_API void SQLITE_APICALL sqlite3_free_table(char **result);
2361
+SQLITE_API void SQLITE_STDCALL sqlite3_free_table(char **result);
23622362
23632363
/*
23642364
** CAPI3REF: Formatted String Printing Functions
23652365
**
23662366
** These routines are work-alikes of the "printf()" family of functions
@@ -2463,13 +2463,13 @@
24632463
** ^(The "%z" formatting option works like "%s" but with the
24642464
** addition that after the string has been read and copied into
24652465
** the result, [sqlite3_free()] is called on the input string.)^
24662466
*/
24672467
SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...);
2468
-SQLITE_API char *SQLITE_APICALL sqlite3_vmprintf(const char*, va_list);
2468
+SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list);
24692469
SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...);
2470
-SQLITE_API char *SQLITE_APICALL sqlite3_vsnprintf(int,char*,const char*, va_list);
2470
+SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list);
24712471
24722472
/*
24732473
** CAPI3REF: Memory Allocation Subsystem
24742474
**
24752475
** The SQLite core uses these three routines for all of its own
@@ -2555,16 +2555,16 @@
25552555
**
25562556
** The application must not read or write any part of
25572557
** a block of memory after it has been released using
25582558
** [sqlite3_free()] or [sqlite3_realloc()].
25592559
*/
2560
-SQLITE_API void *SQLITE_APICALL sqlite3_malloc(int);
2561
-SQLITE_API void *SQLITE_APICALL sqlite3_malloc64(sqlite3_uint64);
2562
-SQLITE_API void *SQLITE_APICALL sqlite3_realloc(void*, int);
2563
-SQLITE_API void *SQLITE_APICALL sqlite3_realloc64(void*, sqlite3_uint64);
2564
-SQLITE_API void SQLITE_APICALL sqlite3_free(void*);
2565
-SQLITE_API sqlite3_uint64 SQLITE_APICALL sqlite3_msize(void*);
2560
+SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int);
2561
+SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64);
2562
+SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void*, int);
2563
+SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void*, sqlite3_uint64);
2564
+SQLITE_API void SQLITE_STDCALL sqlite3_free(void*);
2565
+SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void*);
25662566
25672567
/*
25682568
** CAPI3REF: Memory Allocator Statistics
25692569
**
25702570
** SQLite provides these two interfaces for reporting on the status
@@ -2585,12 +2585,12 @@
25852585
** [sqlite3_memory_used()] if and only if the parameter to
25862586
** [sqlite3_memory_highwater()] is true. ^The value returned
25872587
** by [sqlite3_memory_highwater(1)] is the high-water mark
25882588
** prior to the reset.
25892589
*/
2590
-SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_used(void);
2591
-SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_highwater(int resetFlag);
2590
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void);
2591
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag);
25922592
25932593
/*
25942594
** CAPI3REF: Pseudo-Random Number Generator
25952595
**
25962596
** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
@@ -2609,11 +2609,11 @@
26092609
** ^If the previous call to this routine had an N of 1 or more and a
26102610
** non-NULL P then the pseudo-randomness is generated
26112611
** internally and without recourse to the [sqlite3_vfs] xRandomness
26122612
** method.
26132613
*/
2614
-SQLITE_API void SQLITE_APICALL sqlite3_randomness(int N, void *P);
2614
+SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *P);
26152615
26162616
/*
26172617
** CAPI3REF: Compile-Time Authorization Callbacks
26182618
** METHOD: sqlite3
26192619
**
@@ -2692,13 +2692,13 @@
26922692
** [sqlite3_prepare()] or its variants. Authorization is not
26932693
** performed during statement evaluation in [sqlite3_step()], unless
26942694
** as stated in the previous paragraph, sqlite3_step() invokes
26952695
** sqlite3_prepare_v2() to reprepare a statement after a schema change.
26962696
*/
2697
-SQLITE_API int SQLITE_APICALL sqlite3_set_authorizer(
2697
+SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
26982698
sqlite3*,
2699
- int (SQLITE_CALLBACK *xAuth)(void*,int,const char*,const char*,const char*,const char*),
2699
+ int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
27002700
void *pUserData
27012701
);
27022702
27032703
/*
27042704
** CAPI3REF: Authorizer Return Codes
@@ -2800,14 +2800,14 @@
28002800
** digits in the time are meaningless. Future versions of SQLite
28012801
** might provide greater resolution on the profiler callback. The
28022802
** sqlite3_profile() function is considered experimental and is
28032803
** subject to change in future versions of SQLite.
28042804
*/
2805
-SQLITE_API SQLITE_DEPRECATED void *SQLITE_APICALL sqlite3_trace(sqlite3*,
2806
- void(SQLITE_CALLBACK *xTrace)(void*,const char*), void*);
2807
-SQLITE_API SQLITE_DEPRECATED void *SQLITE_APICALL sqlite3_profile(sqlite3*,
2808
- void(SQLITE_CALLBACK *xProfile)(void*,const char*,sqlite3_uint64), void*);
2805
+SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_trace(sqlite3*,
2806
+ void(*xTrace)(void*,const char*), void*);
2807
+SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_profile(sqlite3*,
2808
+ void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
28092809
28102810
/*
28112811
** CAPI3REF: SQL Trace Event Codes
28122812
** KEYWORDS: SQLITE_TRACE
28132813
**
@@ -2891,14 +2891,14 @@
28912891
**
28922892
** The sqlite3_trace_v2() interface is intended to replace the legacy
28932893
** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which
28942894
** are deprecated.
28952895
*/
2896
-SQLITE_API int SQLITE_APICALL sqlite3_trace_v2(
2896
+SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2(
28972897
sqlite3*,
28982898
unsigned uMask,
2899
- int(SQLITE_CALLBACK *xCallback)(unsigned,void*,void*,void*),
2899
+ int(*xCallback)(unsigned,void*,void*,void*),
29002900
void *pCtx
29012901
);
29022902
29032903
/*
29042904
** CAPI3REF: Query Progress Callbacks
@@ -2930,11 +2930,11 @@
29302930
** the database connection that invoked the progress handler.
29312931
** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
29322932
** database connections for the meaning of "modify" in this paragraph.
29332933
**
29342934
*/
2935
-SQLITE_API void SQLITE_APICALL sqlite3_progress_handler(sqlite3*, int, int(SQLITE_CALLBACK *)(void*), void*);
2935
+SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
29362936
29372937
/*
29382938
** CAPI3REF: Opening A New Database Connection
29392939
** CONSTRUCTOR: sqlite3
29402940
**
@@ -3159,19 +3159,19 @@
31593159
** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various
31603160
** features that require the use of temporary files may fail.
31613161
**
31623162
** See also: [sqlite3_temp_directory]
31633163
*/
3164
-SQLITE_API int SQLITE_APICALL sqlite3_open(
3164
+SQLITE_API int SQLITE_STDCALL sqlite3_open(
31653165
const char *filename, /* Database filename (UTF-8) */
31663166
sqlite3 **ppDb /* OUT: SQLite db handle */
31673167
);
3168
-SQLITE_API int SQLITE_APICALL sqlite3_open16(
3168
+SQLITE_API int SQLITE_STDCALL sqlite3_open16(
31693169
const void *filename, /* Database filename (UTF-16) */
31703170
sqlite3 **ppDb /* OUT: SQLite db handle */
31713171
);
3172
-SQLITE_API int SQLITE_APICALL sqlite3_open_v2(
3172
+SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
31733173
const char *filename, /* Database filename (UTF-8) */
31743174
sqlite3 **ppDb, /* OUT: SQLite db handle */
31753175
int flags, /* Flags */
31763176
const char *zVfs /* Name of VFS module to use */
31773177
);
@@ -3213,13 +3213,13 @@
32133213
** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and
32143214
** is not a database file pathname pointer that SQLite passed into the xOpen
32153215
** VFS method, then the behavior of this routine is undefined and probably
32163216
** undesirable.
32173217
*/
3218
-SQLITE_API const char *SQLITE_APICALL sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3219
-SQLITE_API int SQLITE_APICALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3220
-SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
3218
+SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3219
+SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3220
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
32213221
32223222
32233223
/*
32243224
** CAPI3REF: Error Codes And Messages
32253225
** METHOD: sqlite3
@@ -3259,15 +3259,15 @@
32593259
**
32603260
** If an interface fails with SQLITE_MISUSE, that means the interface
32613261
** was invoked incorrectly by the application. In that case, the
32623262
** error code and message may or may not be set.
32633263
*/
3264
-SQLITE_API int SQLITE_APICALL sqlite3_errcode(sqlite3 *db);
3265
-SQLITE_API int SQLITE_APICALL sqlite3_extended_errcode(sqlite3 *db);
3266
-SQLITE_API const char *SQLITE_APICALL sqlite3_errmsg(sqlite3*);
3267
-SQLITE_API const void *SQLITE_APICALL sqlite3_errmsg16(sqlite3*);
3268
-SQLITE_API const char *SQLITE_APICALL sqlite3_errstr(int);
3264
+SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db);
3265
+SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db);
3266
+SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*);
3267
+SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*);
3268
+SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int);
32693269
32703270
/*
32713271
** CAPI3REF: Prepared Statement Object
32723272
** KEYWORDS: {prepared statement} {prepared statements}
32733273
**
@@ -3331,11 +3331,11 @@
33313331
** created by an untrusted script can be contained using the
33323332
** [max_page_count] [PRAGMA].
33333333
**
33343334
** New run-time limit categories may be added in future releases.
33353335
*/
3336
-SQLITE_API int SQLITE_APICALL sqlite3_limit(sqlite3*, int id, int newVal);
3336
+SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3*, int id, int newVal);
33373337
33383338
/*
33393339
** CAPI3REF: Run-Time Limit Categories
33403340
** KEYWORDS: {limit category} {*limit categories}
33413341
**
@@ -3483,32 +3483,32 @@
34833483
** or [GLOB] operator or if the parameter is compared to an indexed column
34843484
** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
34853485
** </li>
34863486
** </ol>
34873487
*/
3488
-SQLITE_API int SQLITE_APICALL sqlite3_prepare(
3488
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
34893489
sqlite3 *db, /* Database handle */
34903490
const char *zSql, /* SQL statement, UTF-8 encoded */
34913491
int nByte, /* Maximum length of zSql in bytes. */
34923492
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
34933493
const char **pzTail /* OUT: Pointer to unused portion of zSql */
34943494
);
3495
-SQLITE_API int SQLITE_APICALL sqlite3_prepare_v2(
3495
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
34963496
sqlite3 *db, /* Database handle */
34973497
const char *zSql, /* SQL statement, UTF-8 encoded */
34983498
int nByte, /* Maximum length of zSql in bytes. */
34993499
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
35003500
const char **pzTail /* OUT: Pointer to unused portion of zSql */
35013501
);
3502
-SQLITE_API int SQLITE_APICALL sqlite3_prepare16(
3502
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
35033503
sqlite3 *db, /* Database handle */
35043504
const void *zSql, /* SQL statement, UTF-16 encoded */
35053505
int nByte, /* Maximum length of zSql in bytes. */
35063506
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
35073507
const void **pzTail /* OUT: Pointer to unused portion of zSql */
35083508
);
3509
-SQLITE_API int SQLITE_APICALL sqlite3_prepare16_v2(
3509
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
35103510
sqlite3 *db, /* Database handle */
35113511
const void *zSql, /* SQL statement, UTF-16 encoded */
35123512
int nByte, /* Maximum length of zSql in bytes. */
35133513
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
35143514
const void **pzTail /* OUT: Pointer to unused portion of zSql */
@@ -3543,12 +3543,12 @@
35433543
** automatically freed when the prepared statement is finalized.
35443544
** ^The string returned by sqlite3_expanded_sql(P), on the other hand,
35453545
** is obtained from [sqlite3_malloc()] and must be free by the application
35463546
** by passing it to [sqlite3_free()].
35473547
*/
3548
-SQLITE_API const char *SQLITE_APICALL sqlite3_sql(sqlite3_stmt *pStmt);
3549
-SQLITE_API char *SQLITE_APICALL sqlite3_expanded_sql(sqlite3_stmt *pStmt);
3548
+SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt);
3549
+SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt);
35503550
35513551
/*
35523552
** CAPI3REF: Determine If An SQL Statement Writes The Database
35533553
** METHOD: sqlite3_stmt
35543554
**
@@ -3576,11 +3576,11 @@
35763576
** database. ^The [ATTACH] and [DETACH] statements also cause
35773577
** sqlite3_stmt_readonly() to return true since, while those statements
35783578
** change the configuration of a database connection, they do not make
35793579
** changes to the content of the database files on disk.
35803580
*/
3581
-SQLITE_API int SQLITE_APICALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
3581
+SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
35823582
35833583
/*
35843584
** CAPI3REF: Determine If A Prepared Statement Has Been Reset
35853585
** METHOD: sqlite3_stmt
35863586
**
@@ -3597,11 +3597,11 @@
35973597
** to locate all prepared statements associated with a database
35983598
** connection that are in need of being reset. This can be used,
35993599
** for example, in diagnostic routines to search for prepared
36003600
** statements that are holding a transaction open.
36013601
*/
3602
-SQLITE_API int SQLITE_APICALL sqlite3_stmt_busy(sqlite3_stmt*);
3602
+SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt*);
36033603
36043604
/*
36053605
** CAPI3REF: Dynamically Typed Value Object
36063606
** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
36073607
**
@@ -3761,24 +3761,24 @@
37613761
** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails.
37623762
**
37633763
** See also: [sqlite3_bind_parameter_count()],
37643764
** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].
37653765
*/
3766
-SQLITE_API int SQLITE_APICALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(SQLITE_CALLBACK *)(void*));
3767
-SQLITE_API int SQLITE_APICALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
3768
- void(SQLITE_CALLBACK *)(void*));
3769
-SQLITE_API int SQLITE_APICALL sqlite3_bind_double(sqlite3_stmt*, int, double);
3770
-SQLITE_API int SQLITE_APICALL sqlite3_bind_int(sqlite3_stmt*, int, int);
3771
-SQLITE_API int SQLITE_APICALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
3772
-SQLITE_API int SQLITE_APICALL sqlite3_bind_null(sqlite3_stmt*, int);
3773
-SQLITE_API int SQLITE_APICALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(SQLITE_CALLBACK *)(void*));
3774
-SQLITE_API int SQLITE_APICALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(SQLITE_CALLBACK *)(void*));
3775
-SQLITE_API int SQLITE_APICALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
3776
- void(SQLITE_CALLBACK *)(void*), unsigned char encoding);
3777
-SQLITE_API int SQLITE_APICALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
3778
-SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
3779
-SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
3766
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
3767
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
3768
+ void(*)(void*));
3769
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt*, int, double);
3770
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt*, int, int);
3771
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
3772
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt*, int);
3773
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
3774
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
3775
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
3776
+ void(*)(void*), unsigned char encoding);
3777
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
3778
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
3779
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
37803780
37813781
/*
37823782
** CAPI3REF: Number Of SQL Parameters
37833783
** METHOD: sqlite3_stmt
37843784
**
@@ -3795,11 +3795,11 @@
37953795
**
37963796
** See also: [sqlite3_bind_blob|sqlite3_bind()],
37973797
** [sqlite3_bind_parameter_name()], and
37983798
** [sqlite3_bind_parameter_index()].
37993799
*/
3800
-SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_count(sqlite3_stmt*);
3800
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt*);
38013801
38023802
/*
38033803
** CAPI3REF: Name Of A Host Parameter
38043804
** METHOD: sqlite3_stmt
38053805
**
@@ -3823,11 +3823,11 @@
38233823
**
38243824
** See also: [sqlite3_bind_blob|sqlite3_bind()],
38253825
** [sqlite3_bind_parameter_count()], and
38263826
** [sqlite3_bind_parameter_index()].
38273827
*/
3828
-SQLITE_API const char *SQLITE_APICALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
3828
+SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
38293829
38303830
/*
38313831
** CAPI3REF: Index Of A Parameter With A Given Name
38323832
** METHOD: sqlite3_stmt
38333833
**
@@ -3840,21 +3840,21 @@
38403840
**
38413841
** See also: [sqlite3_bind_blob|sqlite3_bind()],
38423842
** [sqlite3_bind_parameter_count()], and
38433843
** [sqlite3_bind_parameter_name()].
38443844
*/
3845
-SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
3845
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
38463846
38473847
/*
38483848
** CAPI3REF: Reset All Bindings On A Prepared Statement
38493849
** METHOD: sqlite3_stmt
38503850
**
38513851
** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset
38523852
** the [sqlite3_bind_blob | bindings] on a [prepared statement].
38533853
** ^Use this routine to reset all host parameters to NULL.
38543854
*/
3855
-SQLITE_API int SQLITE_APICALL sqlite3_clear_bindings(sqlite3_stmt*);
3855
+SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt*);
38563856
38573857
/*
38583858
** CAPI3REF: Number Of Columns In A Result Set
38593859
** METHOD: sqlite3_stmt
38603860
**
@@ -3862,11 +3862,11 @@
38623862
** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
38633863
** statement that does not return data (for example an [UPDATE]).
38643864
**
38653865
** See also: [sqlite3_data_count()]
38663866
*/
3867
-SQLITE_API int SQLITE_APICALL sqlite3_column_count(sqlite3_stmt *pStmt);
3867
+SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt);
38683868
38693869
/*
38703870
** CAPI3REF: Column Names In A Result Set
38713871
** METHOD: sqlite3_stmt
38723872
**
@@ -3891,12 +3891,12 @@
38913891
** ^The name of a result column is the value of the "AS" clause for
38923892
** that column, if there is an AS clause. If there is no AS clause
38933893
** then the name of the column is unspecified and may change from
38943894
** one release of SQLite to the next.
38953895
*/
3896
-SQLITE_API const char *SQLITE_APICALL sqlite3_column_name(sqlite3_stmt*, int N);
3897
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_name16(sqlite3_stmt*, int N);
3896
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt*, int N);
3897
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt*, int N);
38983898
38993899
/*
39003900
** CAPI3REF: Source Of Data In A Query Result
39013901
** METHOD: sqlite3_stmt
39023902
**
@@ -3940,16 +3940,16 @@
39403940
** If two or more threads call one or more
39413941
** [sqlite3_column_database_name | column metadata interfaces]
39423942
** for the same [prepared statement] and result column
39433943
** at the same time then the results are undefined.
39443944
*/
3945
-SQLITE_API const char *SQLITE_APICALL sqlite3_column_database_name(sqlite3_stmt*,int);
3946
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_database_name16(sqlite3_stmt*,int);
3947
-SQLITE_API const char *SQLITE_APICALL sqlite3_column_table_name(sqlite3_stmt*,int);
3948
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_table_name16(sqlite3_stmt*,int);
3949
-SQLITE_API const char *SQLITE_APICALL sqlite3_column_origin_name(sqlite3_stmt*,int);
3950
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
3945
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int);
3946
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int);
3947
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int);
3948
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int);
3949
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int);
3950
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
39513951
39523952
/*
39533953
** CAPI3REF: Declared Datatype Of A Query Result
39543954
** METHOD: sqlite3_stmt
39553955
**
@@ -3977,12 +3977,12 @@
39773977
** data stored in that column is of the declared type. SQLite is
39783978
** strongly typed, but the typing is dynamic not static. ^Type
39793979
** is associated with individual values, not with the containers
39803980
** used to hold those values.
39813981
*/
3982
-SQLITE_API const char *SQLITE_APICALL sqlite3_column_decltype(sqlite3_stmt*,int);
3983
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_decltype16(sqlite3_stmt*,int);
3982
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt*,int);
3983
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt*,int);
39843984
39853985
/*
39863986
** CAPI3REF: Evaluate An SQL Statement
39873987
** METHOD: sqlite3_stmt
39883988
**
@@ -4058,11 +4058,11 @@
40584058
** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
40594059
** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,
40604060
** then the more specific [error codes] are returned directly
40614061
** by sqlite3_step(). The use of the "v2" interface is recommended.
40624062
*/
4063
-SQLITE_API int SQLITE_APICALL sqlite3_step(sqlite3_stmt*);
4063
+SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt*);
40644064
40654065
/*
40664066
** CAPI3REF: Number of columns in a result set
40674067
** METHOD: sqlite3_stmt
40684068
**
@@ -4079,11 +4079,11 @@
40794079
** where it always returns zero since each step of that multi-step
40804080
** pragma returns 0 columns of data.
40814081
**
40824082
** See also: [sqlite3_column_count()]
40834083
*/
4084
-SQLITE_API int SQLITE_APICALL sqlite3_data_count(sqlite3_stmt *pStmt);
4084
+SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt);
40854085
40864086
/*
40874087
** CAPI3REF: Fundamental Datatypes
40884088
** KEYWORDS: SQLITE_TEXT
40894089
**
@@ -4269,20 +4269,20 @@
42694269
** of these routines, a default value is returned. The default value
42704270
** is either the integer 0, the floating point number 0.0, or a NULL
42714271
** pointer. Subsequent calls to [sqlite3_errcode()] will return
42724272
** [SQLITE_NOMEM].)^
42734273
*/
4274
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_blob(sqlite3_stmt*, int iCol);
4275
-SQLITE_API int SQLITE_APICALL sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4276
-SQLITE_API int SQLITE_APICALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4277
-SQLITE_API double SQLITE_APICALL sqlite3_column_double(sqlite3_stmt*, int iCol);
4278
-SQLITE_API int SQLITE_APICALL sqlite3_column_int(sqlite3_stmt*, int iCol);
4279
-SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_column_int64(sqlite3_stmt*, int iCol);
4280
-SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_column_text(sqlite3_stmt*, int iCol);
4281
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_text16(sqlite3_stmt*, int iCol);
4282
-SQLITE_API int SQLITE_APICALL sqlite3_column_type(sqlite3_stmt*, int iCol);
4283
-SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_column_value(sqlite3_stmt*, int iCol);
4274
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt*, int iCol);
4275
+SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4276
+SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4277
+SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt*, int iCol);
4278
+SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt*, int iCol);
4279
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt*, int iCol);
4280
+SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt*, int iCol);
4281
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt*, int iCol);
4282
+SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt*, int iCol);
4283
+SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt*, int iCol);
42844284
42854285
/*
42864286
** CAPI3REF: Destroy A Prepared Statement Object
42874287
** DESTRUCTOR: sqlite3_stmt
42884288
**
@@ -4306,11 +4306,11 @@
43064306
** resource leaks. It is a grievous error for the application to try to use
43074307
** a prepared statement after it has been finalized. Any use of a prepared
43084308
** statement after it has been finalized can result in undefined and
43094309
** undesirable behavior such as segfaults and heap corruption.
43104310
*/
4311
-SQLITE_API int SQLITE_APICALL sqlite3_finalize(sqlite3_stmt *pStmt);
4311
+SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt);
43124312
43134313
/*
43144314
** CAPI3REF: Reset A Prepared Statement Object
43154315
** METHOD: sqlite3_stmt
43164316
**
@@ -4333,11 +4333,11 @@
43334333
** [sqlite3_reset(S)] returns an appropriate [error code].
43344334
**
43354335
** ^The [sqlite3_reset(S)] interface does not change the values
43364336
** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
43374337
*/
4338
-SQLITE_API int SQLITE_APICALL sqlite3_reset(sqlite3_stmt *pStmt);
4338
+SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt);
43394339
43404340
/*
43414341
** CAPI3REF: Create Or Redefine SQL Functions
43424342
** KEYWORDS: {function creation routines}
43434343
** KEYWORDS: {application-defined SQL function}
@@ -4433,40 +4433,40 @@
44334433
** ^An application-defined function is permitted to call other
44344434
** SQLite interfaces. However, such calls must not
44354435
** close the database connection nor finalize or reset the prepared
44364436
** statement in which the function is running.
44374437
*/
4438
-SQLITE_API int SQLITE_APICALL sqlite3_create_function(
4438
+SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
44394439
sqlite3 *db,
44404440
const char *zFunctionName,
44414441
int nArg,
44424442
int eTextRep,
44434443
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*)
4444
+ void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4445
+ void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4446
+ void (*xFinal)(sqlite3_context*)
44474447
);
4448
-SQLITE_API int SQLITE_APICALL sqlite3_create_function16(
4448
+SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
44494449
sqlite3 *db,
44504450
const void *zFunctionName,
44514451
int nArg,
44524452
int eTextRep,
44534453
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*)
4454
+ void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4455
+ void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4456
+ void (*xFinal)(sqlite3_context*)
44574457
);
4458
-SQLITE_API int SQLITE_APICALL sqlite3_create_function_v2(
4458
+SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
44594459
sqlite3 *db,
44604460
const char *zFunctionName,
44614461
int nArg,
44624462
int eTextRep,
44634463
void *pApp,
4464
- void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**),
4465
- void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**),
4466
- void (SQLITE_CALLBACK *xFinal)(sqlite3_context*),
4467
- void(SQLITE_CALLBACK *xDestroy)(void*)
4464
+ void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4465
+ void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4466
+ void (*xFinal)(sqlite3_context*),
4467
+ void(*xDestroy)(void*)
44684468
);
44694469
44704470
/*
44714471
** CAPI3REF: Text Encodings
44724472
**
@@ -4499,16 +4499,16 @@
44994499
** to be supported. However, new applications should avoid
45004500
** the use of these functions. To encourage programmers to avoid
45014501
** these functions, we will not explain what they do.
45024502
*/
45034503
#ifndef SQLITE_OMIT_DEPRECATED
4504
-SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_aggregate_count(sqlite3_context*);
4505
-SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_expired(sqlite3_stmt*);
4506
-SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4507
-SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_global_recover(void);
4508
-SQLITE_API SQLITE_DEPRECATED void SQLITE_APICALL sqlite3_thread_cleanup(void);
4509
-SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_memory_alarm(void(SQLITE_CALLBACK *)(void*,sqlite3_int64,int),
4504
+SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context*);
4505
+SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt*);
4506
+SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4507
+SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_global_recover(void);
4508
+SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_thread_cleanup(void);
4509
+SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
45104510
void*,sqlite3_int64);
45114511
#endif
45124512
45134513
/*
45144514
** CAPI3REF: Obtaining SQL Values
@@ -4554,22 +4554,22 @@
45544554
** or [sqlite3_value_text16()].
45554555
**
45564556
** These routines must be called from the same thread as
45574557
** the SQL function that supplied the [sqlite3_value*] parameters.
45584558
*/
4559
-SQLITE_API const void *SQLITE_APICALL sqlite3_value_blob(sqlite3_value*);
4560
-SQLITE_API int SQLITE_APICALL sqlite3_value_bytes(sqlite3_value*);
4561
-SQLITE_API int SQLITE_APICALL sqlite3_value_bytes16(sqlite3_value*);
4562
-SQLITE_API double SQLITE_APICALL sqlite3_value_double(sqlite3_value*);
4563
-SQLITE_API int SQLITE_APICALL sqlite3_value_int(sqlite3_value*);
4564
-SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_value_int64(sqlite3_value*);
4565
-SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_value_text(sqlite3_value*);
4566
-SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16(sqlite3_value*);
4567
-SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16le(sqlite3_value*);
4568
-SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16be(sqlite3_value*);
4569
-SQLITE_API int SQLITE_APICALL sqlite3_value_type(sqlite3_value*);
4570
-SQLITE_API int SQLITE_APICALL sqlite3_value_numeric_type(sqlite3_value*);
4559
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value*);
4560
+SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value*);
4561
+SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value*);
4562
+SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value*);
4563
+SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value*);
4564
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value*);
4565
+SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value*);
4566
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value*);
4567
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value*);
4568
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*);
4569
+SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*);
4570
+SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*);
45714571
45724572
/*
45734573
** CAPI3REF: Finding The Subtype Of SQL Values
45744574
** METHOD: sqlite3_value
45754575
**
@@ -4581,11 +4581,11 @@
45814581
**
45824582
** SQLite makes no use of subtype itself. It merely passes the subtype
45834583
** from the result of one [application-defined SQL function] into the
45844584
** input of another.
45854585
*/
4586
-SQLITE_API unsigned int SQLITE_APICALL sqlite3_value_subtype(sqlite3_value*);
4586
+SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value*);
45874587
45884588
/*
45894589
** CAPI3REF: Copy And Free SQL Values
45904590
** METHOD: sqlite3_value
45914591
**
@@ -4597,12 +4597,12 @@
45974597
**
45984598
** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object
45994599
** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer
46004600
** then sqlite3_value_free(V) is a harmless no-op.
46014601
*/
4602
-SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_value_dup(const sqlite3_value*);
4603
-SQLITE_API void SQLITE_APICALL sqlite3_value_free(sqlite3_value*);
4602
+SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value*);
4603
+SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value*);
46044604
46054605
/*
46064606
** CAPI3REF: Obtain Aggregate Function Context
46074607
** METHOD: sqlite3_context
46084608
**
@@ -4643,11 +4643,11 @@
46434643
** function.
46444644
**
46454645
** This routine must be called from the same thread in which
46464646
** the aggregate SQL function is running.
46474647
*/
4648
-SQLITE_API void *SQLITE_APICALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
4648
+SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
46494649
46504650
/*
46514651
** CAPI3REF: User Data For Functions
46524652
** METHOD: sqlite3_context
46534653
**
@@ -4658,11 +4658,11 @@
46584658
** registered the application defined function.
46594659
**
46604660
** This routine must be called from the same thread in which
46614661
** the application-defined function is running.
46624662
*/
4663
-SQLITE_API void *SQLITE_APICALL sqlite3_user_data(sqlite3_context*);
4663
+SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context*);
46644664
46654665
/*
46664666
** CAPI3REF: Database Connection For Functions
46674667
** METHOD: sqlite3_context
46684668
**
@@ -4670,11 +4670,11 @@
46704670
** the pointer to the [database connection] (the 1st parameter)
46714671
** of the [sqlite3_create_function()]
46724672
** and [sqlite3_create_function16()] routines that originally
46734673
** registered the application defined function.
46744674
*/
4675
-SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_context_db_handle(sqlite3_context*);
4675
+SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context*);
46764676
46774677
/*
46784678
** CAPI3REF: Function Auxiliary Data
46794679
** METHOD: sqlite3_context
46804680
**
@@ -4702,16 +4702,17 @@
47024702
** NULL if the metadata has been discarded.
47034703
** ^After each call to sqlite3_set_auxdata(C,N,P,X) where X is not NULL,
47044704
** SQLite will invoke the destructor function X with parameter P exactly
47054705
** once, when the metadata is discarded.
47064706
** SQLite is free to discard the metadata at any time, including: <ul>
4707
-** <li> when the corresponding function parameter changes, or
4708
-** <li> when [sqlite3_reset()] or [sqlite3_finalize()] is called for the
4709
-** SQL statement, or
4710
-** <li> when sqlite3_set_auxdata() is invoked again on the same parameter, or
4711
-** <li> during the original sqlite3_set_auxdata() call when a memory
4712
-** allocation error occurs. </ul>)^
4707
+** <li> ^(when the corresponding function parameter changes)^, or
4708
+** <li> ^(when [sqlite3_reset()] or [sqlite3_finalize()] is called for the
4709
+** SQL statement)^, or
4710
+** <li> ^(when sqlite3_set_auxdata() is invoked again on the same
4711
+** parameter)^, or
4712
+** <li> ^(during the original sqlite3_set_auxdata() call when a memory
4713
+** allocation error occurs.)^ </ul>
47134714
**
47144715
** Note the last bullet in particular. The destructor X in
47154716
** sqlite3_set_auxdata(C,N,P,X) might be called immediately, before the
47164717
** sqlite3_set_auxdata() interface even returns. Hence sqlite3_set_auxdata()
47174718
** should be called near the end of the function implementation and the
@@ -4723,12 +4724,12 @@
47234724
** values and [parameters] and expressions composed from the same.)^
47244725
**
47254726
** These routines must be called from the same thread in which
47264727
** the SQL function is running.
47274728
*/
4728
-SQLITE_API void *SQLITE_APICALL sqlite3_get_auxdata(sqlite3_context*, int N);
4729
-SQLITE_API void SQLITE_APICALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (SQLITE_CALLBACK *)(void*));
4729
+SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context*, int N);
4730
+SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
47304731
47314732
47324733
/*
47334734
** CAPI3REF: Constants Defining Special Destructor Behavior
47344735
**
@@ -4741,11 +4742,11 @@
47414742
** the content before returning.
47424743
**
47434744
** The typedef is necessary to work around problems in certain
47444745
** C++ compilers.
47454746
*/
4746
-typedef void (SQLITE_CALLBACK *sqlite3_destructor_type)(void*);
4747
+typedef void (*sqlite3_destructor_type)(void*);
47474748
#define SQLITE_STATIC ((sqlite3_destructor_type)0)
47484749
#define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1)
47494750
47504751
/*
47514752
** CAPI3REF: Setting The Result Of An SQL Function
@@ -4860,31 +4861,31 @@
48604861
**
48614862
** If these routines are called from within the different thread
48624863
** than the one containing the application-defined function that received
48634864
** the [sqlite3_context] pointer, the results are undefined.
48644865
*/
4865
-SQLITE_API void SQLITE_APICALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(SQLITE_CALLBACK *)(void*));
4866
-SQLITE_API void SQLITE_APICALL sqlite3_result_blob64(sqlite3_context*,const void*,
4867
- sqlite3_uint64,void(SQLITE_CALLBACK *)(void*));
4868
-SQLITE_API void SQLITE_APICALL sqlite3_result_double(sqlite3_context*, double);
4869
-SQLITE_API void SQLITE_APICALL sqlite3_result_error(sqlite3_context*, const char*, int);
4870
-SQLITE_API void SQLITE_APICALL sqlite3_result_error16(sqlite3_context*, const void*, int);
4871
-SQLITE_API void SQLITE_APICALL sqlite3_result_error_toobig(sqlite3_context*);
4872
-SQLITE_API void SQLITE_APICALL sqlite3_result_error_nomem(sqlite3_context*);
4873
-SQLITE_API void SQLITE_APICALL sqlite3_result_error_code(sqlite3_context*, int);
4874
-SQLITE_API void SQLITE_APICALL sqlite3_result_int(sqlite3_context*, int);
4875
-SQLITE_API void SQLITE_APICALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
4876
-SQLITE_API void SQLITE_APICALL sqlite3_result_null(sqlite3_context*);
4877
-SQLITE_API void SQLITE_APICALL sqlite3_result_text(sqlite3_context*, const char*, int, void(SQLITE_CALLBACK *)(void*));
4878
-SQLITE_API void SQLITE_APICALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
4879
- void(SQLITE_CALLBACK *)(void*), unsigned char encoding);
4880
-SQLITE_API void SQLITE_APICALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(SQLITE_CALLBACK *)(void*));
4881
-SQLITE_API void SQLITE_APICALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(SQLITE_CALLBACK *)(void*));
4882
-SQLITE_API void SQLITE_APICALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(SQLITE_CALLBACK *)(void*));
4883
-SQLITE_API void SQLITE_APICALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
4884
-SQLITE_API void SQLITE_APICALL sqlite3_result_zeroblob(sqlite3_context*, int n);
4885
-SQLITE_API int SQLITE_APICALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
4866
+SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
4867
+SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(sqlite3_context*,const void*,
4868
+ sqlite3_uint64,void(*)(void*));
4869
+SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context*, double);
4870
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context*, const char*, int);
4871
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context*, const void*, int);
4872
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context*);
4873
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context*);
4874
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context*, int);
4875
+SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context*, int);
4876
+SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
4877
+SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context*);
4878
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
4879
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
4880
+ void(*)(void*), unsigned char encoding);
4881
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
4882
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
4883
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
4884
+SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
4885
+SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n);
4886
+SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
48864887
48874888
48884889
/*
48894890
** CAPI3REF: Setting The Subtype Of An SQL Function
48904891
** METHOD: sqlite3_context
@@ -4895,11 +4896,11 @@
48954896
** of the subtype T are preserved in current versions of SQLite;
48964897
** higher order bits are discarded.
48974898
** The number of subtype bytes preserved by SQLite might increase
48984899
** in future releases of SQLite.
48994900
*/
4900
-SQLITE_API void SQLITE_APICALL sqlite3_result_subtype(sqlite3_context*,unsigned int);
4901
+SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context*,unsigned int);
49014902
49024903
/*
49034904
** CAPI3REF: Define New Collating Sequences
49044905
** METHOD: sqlite3
49054906
**
@@ -4977,31 +4978,31 @@
49774978
** is unfortunate but cannot be changed without breaking backwards
49784979
** compatibility.
49794980
**
49804981
** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].
49814982
*/
4982
-SQLITE_API int SQLITE_APICALL sqlite3_create_collation(
4983
+SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
49834984
sqlite3*,
49844985
const char *zName,
49854986
int eTextRep,
49864987
void *pArg,
4987
- int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*)
4988
+ int(*xCompare)(void*,int,const void*,int,const void*)
49884989
);
4989
-SQLITE_API int SQLITE_APICALL sqlite3_create_collation_v2(
4990
+SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
49904991
sqlite3*,
49914992
const char *zName,
49924993
int eTextRep,
49934994
void *pArg,
4994
- int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*),
4995
- void(SQLITE_CALLBACK *xDestroy)(void*)
4995
+ int(*xCompare)(void*,int,const void*,int,const void*),
4996
+ void(*xDestroy)(void*)
49964997
);
4997
-SQLITE_API int SQLITE_APICALL sqlite3_create_collation16(
4998
+SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
49984999
sqlite3*,
49995000
const void *zName,
50005001
int eTextRep,
50015002
void *pArg,
5002
- int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*)
5003
+ int(*xCompare)(void*,int,const void*,int,const void*)
50035004
);
50045005
50055006
/*
50065007
** CAPI3REF: Collation Needed Callbacks
50075008
** METHOD: sqlite3
@@ -5027,19 +5028,19 @@
50275028
**
50285029
** The callback function should register the desired collation using
50295030
** [sqlite3_create_collation()], [sqlite3_create_collation16()], or
50305031
** [sqlite3_create_collation_v2()].
50315032
*/
5032
-SQLITE_API int SQLITE_APICALL sqlite3_collation_needed(
5033
+SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
50335034
sqlite3*,
50345035
void*,
5035
- void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const char*)
5036
+ void(*)(void*,sqlite3*,int eTextRep,const char*)
50365037
);
5037
-SQLITE_API int SQLITE_APICALL sqlite3_collation_needed16(
5038
+SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
50385039
sqlite3*,
50395040
void*,
5040
- void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const void*)
5041
+ void(*)(void*,sqlite3*,int eTextRep,const void*)
50415042
);
50425043
50435044
#ifdef SQLITE_HAS_CODEC
50445045
/*
50455046
** Specify the key for an encrypted database. This routine should be
@@ -5046,15 +5047,15 @@
50465047
** called right after sqlite3_open().
50475048
**
50485049
** The code to implement this API is not available in the public release
50495050
** of SQLite.
50505051
*/
5051
-SQLITE_API int SQLITE_APICALL sqlite3_key(
5052
+SQLITE_API int SQLITE_STDCALL sqlite3_key(
50525053
sqlite3 *db, /* Database to be rekeyed */
50535054
const void *pKey, int nKey /* The key */
50545055
);
5055
-SQLITE_API int SQLITE_APICALL sqlite3_key_v2(
5056
+SQLITE_API int SQLITE_STDCALL sqlite3_key_v2(
50565057
sqlite3 *db, /* Database to be rekeyed */
50575058
const char *zDbName, /* Name of the database */
50585059
const void *pKey, int nKey /* The key */
50595060
);
50605061
@@ -5064,35 +5065,35 @@
50645065
** database is decrypted.
50655066
**
50665067
** The code to implement this API is not available in the public release
50675068
** of SQLite.
50685069
*/
5069
-SQLITE_API int SQLITE_APICALL sqlite3_rekey(
5070
+SQLITE_API int SQLITE_STDCALL sqlite3_rekey(
50705071
sqlite3 *db, /* Database to be rekeyed */
50715072
const void *pKey, int nKey /* The new key */
50725073
);
5073
-SQLITE_API int SQLITE_APICALL sqlite3_rekey_v2(
5074
+SQLITE_API int SQLITE_STDCALL sqlite3_rekey_v2(
50745075
sqlite3 *db, /* Database to be rekeyed */
50755076
const char *zDbName, /* Name of the database */
50765077
const void *pKey, int nKey /* The new key */
50775078
);
50785079
50795080
/*
50805081
** Specify the activation key for a SEE database. Unless
50815082
** activated, none of the SEE routines will work.
50825083
*/
5083
-SQLITE_API void SQLITE_APICALL sqlite3_activate_see(
5084
+SQLITE_API void SQLITE_STDCALL sqlite3_activate_see(
50845085
const char *zPassPhrase /* Activation phrase */
50855086
);
50865087
#endif
50875088
50885089
#ifdef SQLITE_ENABLE_CEROD
50895090
/*
50905091
** Specify the activation key for a CEROD database. Unless
50915092
** activated, none of the CEROD routines will work.
50925093
*/
5093
-SQLITE_API void SQLITE_APICALL sqlite3_activate_cerod(
5094
+SQLITE_API void SQLITE_STDCALL sqlite3_activate_cerod(
50945095
const char *zPassPhrase /* Activation phrase */
50955096
);
50965097
#endif
50975098
50985099
/*
@@ -5110,11 +5111,11 @@
51105111
** method of the default [sqlite3_vfs] object. If the xSleep() method
51115112
** of the default VFS is not implemented correctly, or not implemented at
51125113
** all, then the behavior of sqlite3_sleep() may deviate from the description
51135114
** in the previous paragraphs.
51145115
*/
5115
-SQLITE_API int SQLITE_APICALL sqlite3_sleep(int);
5116
+SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int);
51165117
51175118
/*
51185119
** CAPI3REF: Name Of The Folder Holding Temporary Files
51195120
**
51205121
** ^(If this global variable is made to point to a string which is
@@ -5229,11 +5230,11 @@
52295230
**
52305231
** If another thread changes the autocommit status of the database
52315232
** connection while this routine is running, then the return value
52325233
** is undefined.
52335234
*/
5234
-SQLITE_API int SQLITE_APICALL sqlite3_get_autocommit(sqlite3*);
5235
+SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3*);
52355236
52365237
/*
52375238
** CAPI3REF: Find The Database Handle Of A Prepared Statement
52385239
** METHOD: sqlite3_stmt
52395240
**
@@ -5242,11 +5243,11 @@
52425243
** returned by sqlite3_db_handle is the same [database connection]
52435244
** that was the first argument
52445245
** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
52455246
** create the statement in the first place.
52465247
*/
5247
-SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_db_handle(sqlite3_stmt*);
5248
+SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt*);
52485249
52495250
/*
52505251
** CAPI3REF: Return The Filename For A Database Connection
52515252
** METHOD: sqlite3
52525253
**
@@ -5259,21 +5260,21 @@
52595260
** ^The filename returned by this function is the output of the
52605261
** xFullPathname method of the [VFS]. ^In other words, the filename
52615262
** will be an absolute pathname, even if the filename used
52625263
** to open the database originally was a URI or relative pathname.
52635264
*/
5264
-SQLITE_API const char *SQLITE_APICALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
5265
+SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
52655266
52665267
/*
52675268
** CAPI3REF: Determine if a database is read-only
52685269
** METHOD: sqlite3
52695270
**
52705271
** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N
52715272
** of connection D is read-only, 0 if it is read/write, or -1 if N is not
52725273
** the name of a database on connection D.
52735274
*/
5274
-SQLITE_API int SQLITE_APICALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
5275
+SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
52755276
52765277
/*
52775278
** CAPI3REF: Find the next prepared statement
52785279
** METHOD: sqlite3
52795280
**
@@ -5285,11 +5286,11 @@
52855286
**
52865287
** The [database connection] pointer D in a call to
52875288
** [sqlite3_next_stmt(D,S)] must refer to an open database
52885289
** connection and in particular must not be a NULL pointer.
52895290
*/
5290
-SQLITE_API sqlite3_stmt *SQLITE_APICALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
5291
+SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
52915292
52925293
/*
52935294
** CAPI3REF: Commit And Rollback Notification Callbacks
52945295
** METHOD: sqlite3
52955296
**
@@ -5334,12 +5335,12 @@
53345335
** ^The rollback callback is not invoked if a transaction is
53355336
** automatically rolled back because the database connection is closed.
53365337
**
53375338
** See also the [sqlite3_update_hook()] interface.
53385339
*/
5339
-SQLITE_API void *SQLITE_APICALL sqlite3_commit_hook(sqlite3*, int(SQLITE_CALLBACK *)(void*), void*);
5340
-SQLITE_API void *SQLITE_APICALL sqlite3_rollback_hook(sqlite3*, void(SQLITE_CALLBACK *)(void *), void*);
5340
+SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
5341
+SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
53415342
53425343
/*
53435344
** CAPI3REF: Data Change Notification Callbacks
53445345
** METHOD: sqlite3
53455346
**
@@ -5386,13 +5387,13 @@
53865387
** the first call on D.
53875388
**
53885389
** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()],
53895390
** and [sqlite3_preupdate_hook()] interfaces.
53905391
*/
5391
-SQLITE_API void *SQLITE_APICALL sqlite3_update_hook(
5392
+SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
53925393
sqlite3*,
5393
- void(SQLITE_CALLBACK *)(void *,int ,char const *,char const *,sqlite3_int64),
5394
+ void(*)(void *,int ,char const *,char const *,sqlite3_int64),
53945395
void*
53955396
);
53965397
53975398
/*
53985399
** CAPI3REF: Enable Or Disable Shared Pager Cache
@@ -5426,11 +5427,11 @@
54265427
** This interface is threadsafe on processors where writing a
54275428
** 32-bit integer is atomic.
54285429
**
54295430
** See Also: [SQLite Shared-Cache Mode]
54305431
*/
5431
-SQLITE_API int SQLITE_APICALL sqlite3_enable_shared_cache(int);
5432
+SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int);
54325433
54335434
/*
54345435
** CAPI3REF: Attempt To Free Heap Memory
54355436
**
54365437
** ^The sqlite3_release_memory() interface attempts to free N bytes
@@ -5442,11 +5443,11 @@
54425443
** ^The sqlite3_release_memory() routine is a no-op returning zero
54435444
** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].
54445445
**
54455446
** See also: [sqlite3_db_release_memory()]
54465447
*/
5447
-SQLITE_API int SQLITE_APICALL sqlite3_release_memory(int);
5448
+SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int);
54485449
54495450
/*
54505451
** CAPI3REF: Free Memory Used By A Database Connection
54515452
** METHOD: sqlite3
54525453
**
@@ -5456,11 +5457,11 @@
54565457
** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
54575458
** omitted.
54585459
**
54595460
** See also: [sqlite3_release_memory()]
54605461
*/
5461
-SQLITE_API int SQLITE_APICALL sqlite3_db_release_memory(sqlite3*);
5462
+SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3*);
54625463
54635464
/*
54645465
** CAPI3REF: Impose A Limit On Heap Size
54655466
**
54665467
** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the
@@ -5508,11 +5509,11 @@
55085509
** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT].
55095510
**
55105511
** The circumstances under which SQLite will enforce the soft heap limit may
55115512
** changes in future releases of SQLite.
55125513
*/
5513
-SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
5514
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
55145515
55155516
/*
55165517
** CAPI3REF: Deprecated Soft Heap Limit Interface
55175518
** DEPRECATED
55185519
**
@@ -5519,11 +5520,11 @@
55195520
** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
55205521
** interface. This routine is provided for historical compatibility
55215522
** only. All new applications should use the
55225523
** [sqlite3_soft_heap_limit64()] interface rather than this one.
55235524
*/
5524
-SQLITE_API SQLITE_DEPRECATED void SQLITE_APICALL sqlite3_soft_heap_limit(int N);
5525
+SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_soft_heap_limit(int N);
55255526
55265527
55275528
/*
55285529
** CAPI3REF: Extract Metadata About A Column Of A Table
55295530
** METHOD: sqlite3
@@ -5589,11 +5590,11 @@
55895590
**
55905591
** ^This function causes all database schemas to be read from disk and
55915592
** parsed, if that has not already been done, and returns an error if
55925593
** any errors are encountered while loading the schema.
55935594
*/
5594
-SQLITE_API int SQLITE_APICALL sqlite3_table_column_metadata(
5595
+SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
55955596
sqlite3 *db, /* Connection handle */
55965597
const char *zDbName, /* Database name or NULL */
55975598
const char *zTableName, /* Table name */
55985599
const char *zColumnName, /* Column name */
55995600
char const **pzDataType, /* OUTPUT: Declared data type */
@@ -5645,11 +5646,11 @@
56455646
** disabled and prevent SQL injections from giving attackers
56465647
** access to extension loading capabilities.
56475648
**
56485649
** See also the [load_extension() SQL function].
56495650
*/
5650
-SQLITE_API int SQLITE_APICALL sqlite3_load_extension(
5651
+SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
56515652
sqlite3 *db, /* Load the extension into this database connection */
56525653
const char *zFile, /* Name of the shared library containing extension */
56535654
const char *zProc, /* Entry point. Derived from zFile if 0 */
56545655
char **pzErrMsg /* Put error message here if not 0 */
56555656
);
@@ -5668,20 +5669,20 @@
56685669
** to turn extension loading on and call it with onoff==0 to turn
56695670
** it back off again.
56705671
**
56715672
** ^This interface enables or disables both the C-API
56725673
** [sqlite3_load_extension()] and the SQL function [load_extension()].
5673
-** Use [sqlite3_db_config](db,[SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION],..)
5674
-** to enable or disable only the C-API.
5674
+** ^(Use [sqlite3_db_config](db,[SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION],..)
5675
+** to enable or disable only the C-API.)^
56755676
**
56765677
** <b>Security warning:</b> It is recommended that extension loading
56775678
** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method
56785679
** rather than this interface, so the [load_extension()] SQL function
56795680
** remains disabled. This will prevent SQL injections from giving attackers
56805681
** access to extension loading capabilities.
56815682
*/
5682
-SQLITE_API int SQLITE_APICALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
5683
+SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
56835684
56845685
/*
56855686
** CAPI3REF: Automatically Load Statically Linked Extensions
56865687
**
56875688
** ^This interface causes the xEntryPoint() function to be invoked for
@@ -5715,11 +5716,11 @@
57155716
** will be called more than once for each database connection that is opened.
57165717
**
57175718
** See also: [sqlite3_reset_auto_extension()]
57185719
** and [sqlite3_cancel_auto_extension()]
57195720
*/
5720
-SQLITE_API int SQLITE_APICALL sqlite3_auto_extension(void(SQLITE_CALLBACK *xEntryPoint)(void));
5721
+SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void(*xEntryPoint)(void));
57215722
57225723
/*
57235724
** CAPI3REF: Cancel Automatic Extension Loading
57245725
**
57255726
** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
@@ -5727,19 +5728,19 @@
57275728
** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)]
57285729
** routine returns 1 if initialization routine X was successfully
57295730
** unregistered and it returns 0 if X was not on the list of initialization
57305731
** routines.
57315732
*/
5732
-SQLITE_API int SQLITE_APICALL sqlite3_cancel_auto_extension(void(SQLITE_CALLBACK *xEntryPoint)(void));
5733
+SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void(*xEntryPoint)(void));
57335734
57345735
/*
57355736
** CAPI3REF: Reset Automatic Extension Loading
57365737
**
57375738
** ^This interface disables all automatic extensions previously
57385739
** registered using [sqlite3_auto_extension()].
57395740
*/
5740
-SQLITE_API void SQLITE_APICALL sqlite3_reset_auto_extension(void);
5741
+SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void);
57415742
57425743
/*
57435744
** The interface to the virtual-table mechanism is currently considered
57445745
** to be experimental. The interface might change in incompatible ways.
57455746
** If this is a problem for you, do not use the interface at this time.
@@ -5772,41 +5773,41 @@
57725773
** of this structure must not change while it is registered with
57735774
** any database connection.
57745775
*/
57755776
struct sqlite3_module {
57765777
int iVersion;
5777
- int (SQLITE_CALLBACK *xCreate)(sqlite3*, void *pAux,
5778
- int argc, const char *const*argv,
5779
- sqlite3_vtab **ppVTab, char**);
5780
- int (SQLITE_CALLBACK *xConnect)(sqlite3*, void *pAux,
5781
- int argc, const char *const*argv,
5782
- sqlite3_vtab **ppVTab, char**);
5783
- int (SQLITE_CALLBACK *xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
5784
- int (SQLITE_CALLBACK *xDisconnect)(sqlite3_vtab *pVTab);
5785
- int (SQLITE_CALLBACK *xDestroy)(sqlite3_vtab *pVTab);
5786
- int (SQLITE_CALLBACK *xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);
5787
- int (SQLITE_CALLBACK *xClose)(sqlite3_vtab_cursor*);
5788
- int (SQLITE_CALLBACK *xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
5789
- int argc, sqlite3_value **argv);
5790
- int (SQLITE_CALLBACK *xNext)(sqlite3_vtab_cursor*);
5791
- int (SQLITE_CALLBACK *xEof)(sqlite3_vtab_cursor*);
5792
- int (SQLITE_CALLBACK *xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int);
5793
- int (SQLITE_CALLBACK *xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid);
5794
- int (SQLITE_CALLBACK *xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *);
5795
- int (SQLITE_CALLBACK *xBegin)(sqlite3_vtab *pVTab);
5796
- int (SQLITE_CALLBACK *xSync)(sqlite3_vtab *pVTab);
5797
- int (SQLITE_CALLBACK *xCommit)(sqlite3_vtab *pVTab);
5798
- int (SQLITE_CALLBACK *xRollback)(sqlite3_vtab *pVTab);
5799
- int (SQLITE_CALLBACK *xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,
5800
- void (SQLITE_CALLBACK **pxFunc)(sqlite3_context*,int,sqlite3_value**),
5801
- void **ppArg);
5802
- int (SQLITE_CALLBACK *xRename)(sqlite3_vtab *pVtab, const char *zNew);
5803
- /* The methods above are in version 1 of the sqlite_module object. Those
5804
- ** below are for version 2 and greater. */
5805
- int (SQLITE_CALLBACK *xSavepoint)(sqlite3_vtab *pVTab, int);
5806
- int (SQLITE_CALLBACK *xRelease)(sqlite3_vtab *pVTab, int);
5807
- int (SQLITE_CALLBACK *xRollbackTo)(sqlite3_vtab *pVTab, int);
5778
+ int (*xCreate)(sqlite3*, void *pAux,
5779
+ int argc, const char *const*argv,
5780
+ sqlite3_vtab **ppVTab, char**);
5781
+ int (*xConnect)(sqlite3*, void *pAux,
5782
+ int argc, const char *const*argv,
5783
+ sqlite3_vtab **ppVTab, char**);
5784
+ int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
5785
+ int (*xDisconnect)(sqlite3_vtab *pVTab);
5786
+ int (*xDestroy)(sqlite3_vtab *pVTab);
5787
+ int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);
5788
+ int (*xClose)(sqlite3_vtab_cursor*);
5789
+ int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
5790
+ int argc, sqlite3_value **argv);
5791
+ int (*xNext)(sqlite3_vtab_cursor*);
5792
+ int (*xEof)(sqlite3_vtab_cursor*);
5793
+ int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int);
5794
+ int (*xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid);
5795
+ int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *);
5796
+ int (*xBegin)(sqlite3_vtab *pVTab);
5797
+ int (*xSync)(sqlite3_vtab *pVTab);
5798
+ int (*xCommit)(sqlite3_vtab *pVTab);
5799
+ int (*xRollback)(sqlite3_vtab *pVTab);
5800
+ int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,
5801
+ void (**pxFunc)(sqlite3_context*,int,sqlite3_value**),
5802
+ void **ppArg);
5803
+ int (*xRename)(sqlite3_vtab *pVtab, const char *zNew);
5804
+ /* The methods above are in version 1 of the sqlite_module object. Those
5805
+ ** below are for version 2 and greater. */
5806
+ int (*xSavepoint)(sqlite3_vtab *pVTab, int);
5807
+ int (*xRelease)(sqlite3_vtab *pVTab, int);
5808
+ int (*xRollbackTo)(sqlite3_vtab *pVTab, int);
58085809
};
58095810
58105811
/*
58115812
** CAPI3REF: Virtual Table Indexing Information
58125813
** KEYWORDS: sqlite3_index_info
@@ -5980,22 +5981,22 @@
59805981
** be invoked if the call to sqlite3_create_module_v2() fails.
59815982
** ^The sqlite3_create_module()
59825983
** interface is equivalent to sqlite3_create_module_v2() with a NULL
59835984
** destructor.
59845985
*/
5985
-SQLITE_API int SQLITE_APICALL sqlite3_create_module(
5986
+SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
59865987
sqlite3 *db, /* SQLite connection to register module with */
59875988
const char *zName, /* Name of the module */
59885989
const sqlite3_module *p, /* Methods for the module */
59895990
void *pClientData /* Client data for xCreate/xConnect */
59905991
);
5991
-SQLITE_API int SQLITE_APICALL sqlite3_create_module_v2(
5992
+SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
59925993
sqlite3 *db, /* SQLite connection to register module with */
59935994
const char *zName, /* Name of the module */
59945995
const sqlite3_module *p, /* Methods for the module */
59955996
void *pClientData, /* Client data for xCreate/xConnect */
5996
- void(SQLITE_CALLBACK *xDestroy)(void*) /* Module destructor function */
5997
+ void(*xDestroy)(void*) /* Module destructor function */
59975998
);
59985999
59996000
/*
60006001
** CAPI3REF: Virtual Table Instance Object
60016002
** KEYWORDS: sqlite3_vtab
@@ -6049,11 +6050,11 @@
60496050
** ^The [xCreate] and [xConnect] methods of a
60506051
** [virtual table module] call this interface
60516052
** to declare the format (the names and datatypes of the columns) of
60526053
** the virtual tables they implement.
60536054
*/
6054
-SQLITE_API int SQLITE_APICALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
6055
+SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
60556056
60566057
/*
60576058
** CAPI3REF: Overload A Function For A Virtual Table
60586059
** METHOD: sqlite3
60596060
**
@@ -6068,11 +6069,11 @@
60686069
** of the new function always causes an exception to be thrown. So
60696070
** the new function is not good for anything by itself. Its only
60706071
** purpose is to be a placeholder function that can be overloaded
60716072
** by a [virtual table].
60726073
*/
6073
-SQLITE_API int SQLITE_APICALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
6074
+SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
60746075
60756076
/*
60766077
** The interface to the virtual-table mechanism defined above (back up
60776078
** to a comment remarkably similar to this one) is currently considered
60786079
** to be experimental. The interface might change in incompatible ways.
@@ -6167,11 +6168,11 @@
61676168
** zero-filled blob to read or write using the incremental-blob interface.
61686169
**
61696170
** To avoid a resource leak, every open [BLOB handle] should eventually
61706171
** be released by a call to [sqlite3_blob_close()].
61716172
*/
6172
-SQLITE_API int SQLITE_APICALL sqlite3_blob_open(
6173
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
61736174
sqlite3*,
61746175
const char *zDb,
61756176
const char *zTable,
61766177
const char *zColumn,
61776178
sqlite3_int64 iRow,
@@ -6200,11 +6201,11 @@
62006201
** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
62016202
** always returns zero.
62026203
**
62036204
** ^This function sets the database handle error code and message.
62046205
*/
6205
-SQLITE_API int SQLITE_APICALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
6206
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
62066207
62076208
/*
62086209
** CAPI3REF: Close A BLOB Handle
62096210
** DESTRUCTOR: sqlite3_blob
62106211
**
@@ -6223,11 +6224,11 @@
62236224
** with a null pointer (such as would be returned by a failed call to
62246225
** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function
62256226
** is passed a valid open blob handle, the values returned by the
62266227
** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning.
62276228
*/
6228
-SQLITE_API int SQLITE_APICALL sqlite3_blob_close(sqlite3_blob *);
6229
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *);
62296230
62306231
/*
62316232
** CAPI3REF: Return The Size Of An Open BLOB
62326233
** METHOD: sqlite3_blob
62336234
**
@@ -6239,11 +6240,11 @@
62396240
** This routine only works on a [BLOB handle] which has been created
62406241
** by a prior successful call to [sqlite3_blob_open()] and which has not
62416242
** been closed by [sqlite3_blob_close()]. Passing any other pointer in
62426243
** to this routine results in undefined and probably undesirable behavior.
62436244
*/
6244
-SQLITE_API int SQLITE_APICALL sqlite3_blob_bytes(sqlite3_blob *);
6245
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *);
62456246
62466247
/*
62476248
** CAPI3REF: Read Data From A BLOB Incrementally
62486249
** METHOD: sqlite3_blob
62496250
**
@@ -6268,11 +6269,11 @@
62686269
** been closed by [sqlite3_blob_close()]. Passing any other pointer in
62696270
** to this routine results in undefined and probably undesirable behavior.
62706271
**
62716272
** See also: [sqlite3_blob_write()].
62726273
*/
6273
-SQLITE_API int SQLITE_APICALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
6274
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
62746275
62756276
/*
62766277
** CAPI3REF: Write Data Into A BLOB Incrementally
62776278
** METHOD: sqlite3_blob
62786279
**
@@ -6310,11 +6311,11 @@
63106311
** been closed by [sqlite3_blob_close()]. Passing any other pointer in
63116312
** to this routine results in undefined and probably undesirable behavior.
63126313
**
63136314
** See also: [sqlite3_blob_read()].
63146315
*/
6315
-SQLITE_API int SQLITE_APICALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
6316
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
63166317
63176318
/*
63186319
** CAPI3REF: Virtual File System Objects
63196320
**
63206321
** A virtual filesystem (VFS) is an [sqlite3_vfs] object
@@ -6341,13 +6342,13 @@
63416342
**
63426343
** ^Unregister a VFS with the sqlite3_vfs_unregister() interface.
63436344
** ^(If the default VFS is unregistered, another VFS is chosen as
63446345
** the default. The choice for the new VFS is arbitrary.)^
63456346
*/
6346
-SQLITE_API sqlite3_vfs *SQLITE_APICALL sqlite3_vfs_find(const char *zVfsName);
6347
-SQLITE_API int SQLITE_APICALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
6348
-SQLITE_API int SQLITE_APICALL sqlite3_vfs_unregister(sqlite3_vfs*);
6347
+SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfsName);
6348
+SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
6349
+SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs*);
63496350
63506351
/*
63516352
** CAPI3REF: Mutexes
63526353
**
63536354
** The SQLite core uses these routines for thread
@@ -6459,15 +6460,15 @@
64596460
** sqlite3_mutex_leave() is a NULL pointer, then all three routines
64606461
** behave as no-ops.
64616462
**
64626463
** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
64636464
*/
6464
-SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_mutex_alloc(int);
6465
-SQLITE_API void SQLITE_APICALL sqlite3_mutex_free(sqlite3_mutex*);
6466
-SQLITE_API void SQLITE_APICALL sqlite3_mutex_enter(sqlite3_mutex*);
6467
-SQLITE_API int SQLITE_APICALL sqlite3_mutex_try(sqlite3_mutex*);
6468
-SQLITE_API void SQLITE_APICALL sqlite3_mutex_leave(sqlite3_mutex*);
6465
+SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int);
6466
+SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*);
6467
+SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*);
6468
+SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*);
6469
+SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*);
64696470
64706471
/*
64716472
** CAPI3REF: Mutex Methods Object
64726473
**
64736474
** An instance of this structure defines the low-level routines
@@ -6532,19 +6533,19 @@
65326533
** If xMutexInit fails in any way, it is expected to clean up after itself
65336534
** prior to returning.
65346535
*/
65356536
typedef struct sqlite3_mutex_methods sqlite3_mutex_methods;
65366537
struct sqlite3_mutex_methods {
6537
- int (SQLITE_CALLBACK *xMutexInit)(void);
6538
- int (SQLITE_CALLBACK *xMutexEnd)(void);
6539
- sqlite3_mutex *(SQLITE_CALLBACK *xMutexAlloc)(int);
6540
- void (SQLITE_CALLBACK *xMutexFree)(sqlite3_mutex *);
6541
- void (SQLITE_CALLBACK *xMutexEnter)(sqlite3_mutex *);
6542
- int (SQLITE_CALLBACK *xMutexTry)(sqlite3_mutex *);
6543
- void (SQLITE_CALLBACK *xMutexLeave)(sqlite3_mutex *);
6544
- int (SQLITE_CALLBACK *xMutexHeld)(sqlite3_mutex *);
6545
- int (SQLITE_CALLBACK *xMutexNotheld)(sqlite3_mutex *);
6538
+ int (*xMutexInit)(void);
6539
+ int (*xMutexEnd)(void);
6540
+ sqlite3_mutex *(*xMutexAlloc)(int);
6541
+ void (*xMutexFree)(sqlite3_mutex *);
6542
+ void (*xMutexEnter)(sqlite3_mutex *);
6543
+ int (*xMutexTry)(sqlite3_mutex *);
6544
+ void (*xMutexLeave)(sqlite3_mutex *);
6545
+ int (*xMutexHeld)(sqlite3_mutex *);
6546
+ int (*xMutexNotheld)(sqlite3_mutex *);
65466547
};
65476548
65486549
/*
65496550
** CAPI3REF: Mutex Verification Routines
65506551
**
@@ -6573,12 +6574,12 @@
65736574
** call to sqlite3_mutex_held() to fail, so a non-zero return is
65746575
** the appropriate thing to do. The sqlite3_mutex_notheld()
65756576
** interface should also return 1 when given a NULL pointer.
65766577
*/
65776578
#ifndef NDEBUG
6578
-SQLITE_API int SQLITE_APICALL sqlite3_mutex_held(sqlite3_mutex*);
6579
-SQLITE_API int SQLITE_APICALL sqlite3_mutex_notheld(sqlite3_mutex*);
6579
+SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex*);
6580
+SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex*);
65806581
#endif
65816582
65826583
/*
65836584
** CAPI3REF: Mutex Types
65846585
**
@@ -6614,11 +6615,11 @@
66146615
** serializes access to the [database connection] given in the argument
66156616
** when the [threading mode] is Serialized.
66166617
** ^If the [threading mode] is Single-thread or Multi-thread then this
66176618
** routine returns a NULL pointer.
66186619
*/
6619
-SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_db_mutex(sqlite3*);
6620
+SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3*);
66206621
66216622
/*
66226623
** CAPI3REF: Low-Level Control Of Database Files
66236624
** METHOD: sqlite3
66246625
**
@@ -6649,11 +6650,11 @@
66496650
** an incorrect zDbName and an SQLITE_ERROR return from the underlying
66506651
** xFileControl method.
66516652
**
66526653
** See also: [SQLITE_FCNTL_LOCKSTATE]
66536654
*/
6654
-SQLITE_API int SQLITE_APICALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
6655
+SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
66556656
66566657
/*
66576658
** CAPI3REF: Testing Interface
66586659
**
66596660
** ^The sqlite3_test_control() interface is used to read out internal
@@ -6731,12 +6732,12 @@
67316732
** be represented by a 32-bit integer, then the values returned by
67326733
** sqlite3_status() are undefined.
67336734
**
67346735
** See also: [sqlite3_db_status()]
67356736
*/
6736
-SQLITE_API int SQLITE_APICALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6737
-SQLITE_API int SQLITE_APICALL sqlite3_status64(
6737
+SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6738
+SQLITE_API int SQLITE_STDCALL sqlite3_status64(
67386739
int op,
67396740
sqlite3_int64 *pCurrent,
67406741
sqlite3_int64 *pHighwater,
67416742
int resetFlag
67426743
);
@@ -6857,11 +6858,11 @@
68576858
** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a
68586859
** non-zero [error code] on failure.
68596860
**
68606861
** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
68616862
*/
6862
-SQLITE_API int SQLITE_APICALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
6863
+SQLITE_API int SQLITE_STDCALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
68636864
68646865
/*
68656866
** CAPI3REF: Status Parameters for database connections
68666867
** KEYWORDS: {SQLITE_DBSTATUS options}
68676868
**
@@ -7000,11 +7001,11 @@
70007001
** ^If the resetFlg is true, then the counter is reset to zero after this
70017002
** interface call returns.
70027003
**
70037004
** See also: [sqlite3_status()] and [sqlite3_db_status()].
70047005
*/
7005
-SQLITE_API int SQLITE_APICALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
7006
+SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
70067007
70077008
/*
70087009
** CAPI3REF: Status Parameters for prepared statements
70097010
** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters}
70107011
**
@@ -7236,22 +7237,22 @@
72367237
*/
72377238
typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2;
72387239
struct sqlite3_pcache_methods2 {
72397240
int iVersion;
72407241
void *pArg;
7241
- int (SQLITE_CALLBACK *xInit)(void*);
7242
- void (SQLITE_CALLBACK *xShutdown)(void*);
7243
- sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int szExtra, int bPurgeable);
7244
- void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize);
7245
- int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*);
7246
- sqlite3_pcache_page *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7247
- void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard);
7248
- void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, sqlite3_pcache_page*,
7242
+ int (*xInit)(void*);
7243
+ void (*xShutdown)(void*);
7244
+ sqlite3_pcache *(*xCreate)(int szPage, int szExtra, int bPurgeable);
7245
+ void (*xCachesize)(sqlite3_pcache*, int nCachesize);
7246
+ int (*xPagecount)(sqlite3_pcache*);
7247
+ sqlite3_pcache_page *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7248
+ void (*xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard);
7249
+ void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*,
72497250
unsigned oldKey, unsigned newKey);
7250
- void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit);
7251
- void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*);
7252
- void (SQLITE_CALLBACK *xShrink)(sqlite3_pcache*);
7251
+ void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
7252
+ void (*xDestroy)(sqlite3_pcache*);
7253
+ void (*xShrink)(sqlite3_pcache*);
72537254
};
72547255
72557256
/*
72567257
** This is the obsolete pcache_methods object that has now been replaced
72577258
** by sqlite3_pcache_methods2. This object is not used by SQLite. It is
@@ -7258,20 +7259,20 @@
72587259
** retained in the header file for backwards compatibility only.
72597260
*/
72607261
typedef struct sqlite3_pcache_methods sqlite3_pcache_methods;
72617262
struct sqlite3_pcache_methods {
72627263
void *pArg;
7263
- int (SQLITE_CALLBACK *xInit)(void*);
7264
- void (SQLITE_CALLBACK *xShutdown)(void*);
7265
- sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int bPurgeable);
7266
- void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize);
7267
- int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*);
7268
- void *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7269
- void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, void*, int discard);
7270
- void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey);
7271
- void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit);
7272
- void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*);
7264
+ int (*xInit)(void*);
7265
+ void (*xShutdown)(void*);
7266
+ sqlite3_pcache *(*xCreate)(int szPage, int bPurgeable);
7267
+ void (*xCachesize)(sqlite3_pcache*, int nCachesize);
7268
+ int (*xPagecount)(sqlite3_pcache*);
7269
+ void *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7270
+ void (*xUnpin)(sqlite3_pcache*, void*, int discard);
7271
+ void (*xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey);
7272
+ void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
7273
+ void (*xDestroy)(sqlite3_pcache*);
72737274
};
72747275
72757276
72767277
/*
72777278
** CAPI3REF: Online Backup Object
@@ -7469,20 +7470,20 @@
74697470
** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()
74707471
** APIs are not strictly speaking threadsafe. If they are invoked at the
74717472
** same time as another thread is invoking sqlite3_backup_step() it is
74727473
** possible that they return invalid values.
74737474
*/
7474
-SQLITE_API sqlite3_backup *SQLITE_APICALL sqlite3_backup_init(
7475
+SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
74757476
sqlite3 *pDest, /* Destination database handle */
74767477
const char *zDestName, /* Destination database name */
74777478
sqlite3 *pSource, /* Source database handle */
74787479
const char *zSourceName /* Source database name */
74797480
);
7480
-SQLITE_API int SQLITE_APICALL sqlite3_backup_step(sqlite3_backup *p, int nPage);
7481
-SQLITE_API int SQLITE_APICALL sqlite3_backup_finish(sqlite3_backup *p);
7482
-SQLITE_API int SQLITE_APICALL sqlite3_backup_remaining(sqlite3_backup *p);
7483
-SQLITE_API int SQLITE_APICALL sqlite3_backup_pagecount(sqlite3_backup *p);
7481
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage);
7482
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p);
7483
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p);
7484
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p);
74847485
74857486
/*
74867487
** CAPI3REF: Unlock Notification
74877488
** METHOD: sqlite3
74887489
**
@@ -7595,13 +7596,13 @@
75957596
** by an sqlite3_step() call. ^(If there is a blocking connection, then the
75967597
** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in
75977598
** the special "DROP TABLE/INDEX" case, the extended error code is just
75987599
** SQLITE_LOCKED.)^
75997600
*/
7600
-SQLITE_API int SQLITE_APICALL sqlite3_unlock_notify(
7601
+SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
76017602
sqlite3 *pBlocked, /* Waiting connection */
7602
- void (SQLITE_CALLBACK *xNotify)(void **apArg, int nArg), /* Callback function to invoke */
7603
+ void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */
76037604
void *pNotifyArg /* Argument to pass to xNotify */
76047605
);
76057606
76067607
76077608
/*
@@ -7610,12 +7611,12 @@
76107611
** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications
76117612
** and extensions to compare the contents of two buffers containing UTF-8
76127613
** strings in a case-independent fashion, using the same definition of "case
76137614
** independence" that SQLite uses internally when comparing identifiers.
76147615
*/
7615
-SQLITE_API int SQLITE_APICALL sqlite3_stricmp(const char *, const char *);
7616
-SQLITE_API int SQLITE_APICALL sqlite3_strnicmp(const char *, const char *, int);
7616
+SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *, const char *);
7617
+SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *, const char *, int);
76177618
76187619
/*
76197620
** CAPI3REF: String Globbing
76207621
*
76217622
** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if
@@ -7628,11 +7629,11 @@
76287629
** Note that this routine returns zero on a match and non-zero if the strings
76297630
** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
76307631
**
76317632
** See also: [sqlite3_strlike()].
76327633
*/
7633
-SQLITE_API int SQLITE_APICALL sqlite3_strglob(const char *zGlob, const char *zStr);
7634
+SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlob, const char *zStr);
76347635
76357636
/*
76367637
** CAPI3REF: String LIKE Matching
76377638
*
76387639
** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if
@@ -7651,11 +7652,11 @@
76517652
** Note that this routine returns zero on a match and non-zero if the strings
76527653
** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
76537654
**
76547655
** See also: [sqlite3_strglob()].
76557656
*/
7656
-SQLITE_API int SQLITE_APICALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
7657
+SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
76577658
76587659
/*
76597660
** CAPI3REF: Error Logging Interface
76607661
**
76617662
** ^The [sqlite3_log()] interface writes a message into the [error log]
@@ -7710,13 +7711,13 @@
77107711
** previously registered write-ahead log callback. ^Note that the
77117712
** [sqlite3_wal_autocheckpoint()] interface and the
77127713
** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will
77137714
** overwrite any prior [sqlite3_wal_hook()] settings.
77147715
*/
7715
-SQLITE_API void *SQLITE_APICALL sqlite3_wal_hook(
7716
+SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
77167717
sqlite3*,
7717
- int(SQLITE_CALLBACK *)(void *,sqlite3*,const char*,int),
7718
+ int(*)(void *,sqlite3*,const char*,int),
77187719
void*
77197720
);
77207721
77217722
/*
77227723
** CAPI3REF: Configure an auto-checkpoint
@@ -7745,11 +7746,11 @@
77457746
** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]
77467747
** pages. The use of this interface
77477748
** is only necessary if the default setting is found to be suboptimal
77487749
** for a particular application.
77497750
*/
7750
-SQLITE_API int SQLITE_APICALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
7751
+SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
77517752
77527753
/*
77537754
** CAPI3REF: Checkpoint a database
77547755
** METHOD: sqlite3
77557756
**
@@ -7767,11 +7768,11 @@
77677768
** interface was added. This interface is retained for backwards
77687769
** compatibility and as a convenience for applications that need to manually
77697770
** start a callback but which do not need the full power (and corresponding
77707771
** complication) of [sqlite3_wal_checkpoint_v2()].
77717772
*/
7772
-SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
7773
+SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
77737774
77747775
/*
77757776
** CAPI3REF: Checkpoint a database
77767777
** METHOD: sqlite3
77777778
**
@@ -7861,11 +7862,11 @@
78617862
** [sqlite3_errcode()] and [sqlite3_errmsg()].
78627863
**
78637864
** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface
78647865
** from SQL.
78657866
*/
7866
-SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint_v2(
7867
+SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
78677868
sqlite3 *db, /* Database handle */
78687869
const char *zDb, /* Name of attached database (or NULL) */
78697870
int eMode, /* SQLITE_CHECKPOINT_* value */
78707871
int *pnLog, /* OUT: Size of WAL log in frames */
78717872
int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -7950,11 +7951,11 @@
79507951
** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL],
79517952
** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode
79527953
** of the SQL statement that triggered the call to the [xUpdate] method of the
79537954
** [virtual table].
79547955
*/
7955
-SQLITE_API int SQLITE_APICALL sqlite3_vtab_on_conflict(sqlite3 *);
7956
+SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *);
79567957
79577958
/*
79587959
** CAPI3REF: Conflict resolution modes
79597960
** KEYWORDS: {conflict resolution mode}
79607961
**
@@ -8055,11 +8056,11 @@
80558056
** as if the loop did not exist - it returns non-zero and leave the variable
80568057
** that pOut points to unchanged.
80578058
**
80588059
** See also: [sqlite3_stmt_scanstatus_reset()]
80598060
*/
8060
-SQLITE_API int SQLITE_APICALL sqlite3_stmt_scanstatus(
8061
+SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus(
80618062
sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
80628063
int idx, /* Index of loop to report on */
80638064
int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
80648065
void *pOut /* Result written here */
80658066
);
@@ -8071,11 +8072,11 @@
80718072
** ^Zero all [sqlite3_stmt_scanstatus()] related event counters.
80728073
**
80738074
** This API is only available if the library is built with pre-processor
80748075
** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined.
80758076
*/
8076
-SQLITE_API void SQLITE_APICALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
8077
+SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
80778078
80788079
/*
80798080
** CAPI3REF: Flush caches to disk mid-transaction
80808081
**
80818082
** ^If a write-transaction is open on [database connection] D when the
@@ -8103,11 +8104,11 @@
81038104
** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK.
81048105
**
81058106
** ^This function does not set the database handle error code or message
81068107
** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions.
81078108
*/
8108
-SQLITE_API int SQLITE_APICALL sqlite3_db_cacheflush(sqlite3*);
8109
+SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3*);
81098110
81108111
/*
81118112
** CAPI3REF: The pre-update hook.
81128113
**
81138114
** ^These interfaces are only available if SQLite is compiled using the
@@ -8183,13 +8184,13 @@
81838184
** triggers; or 2 for changes resulting from triggers called by top-level
81848185
** triggers; and so forth.
81858186
**
81868187
** See also: [sqlite3_update_hook()]
81878188
*/
8188
-SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_APICALL sqlite3_preupdate_hook(
8189
+SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_STDCALL sqlite3_preupdate_hook(
81898190
sqlite3 *db,
8190
- void(SQLITE_CALLBACK *xPreUpdate)(
8191
+ void(*xPreUpdate)(
81918192
void *pCtx, /* Copy of third arg to preupdate_hook() */
81928193
sqlite3 *db, /* Database handle */
81938194
int op, /* SQLITE_UPDATE, DELETE or INSERT */
81948195
char const *zDb, /* Database name */
81958196
char const *zName, /* Table name */
@@ -8196,14 +8197,14 @@
81968197
sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */
81978198
sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */
81988199
),
81998200
void*
82008201
);
8201
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **);
8202
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_count(sqlite3 *);
8203
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_depth(sqlite3 *);
8204
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **);
8202
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **);
8203
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *);
8204
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *);
8205
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **);
82058206
82068207
/*
82078208
** CAPI3REF: Low-level system error code
82088209
**
82098210
** ^Attempt to return the underlying operating system error code or error
@@ -8211,11 +8212,11 @@
82118212
** The return value is OS-dependent. For example, on unix systems, after
82128213
** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be
82138214
** called to get back the underlying "errno" that caused the problem, such
82148215
** as ENOSPC, EAUTH, EISDIR, and so forth.
82158216
*/
8216
-SQLITE_API int SQLITE_APICALL sqlite3_system_errno(sqlite3*);
8217
+SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3*);
82178218
82188219
/*
82198220
** CAPI3REF: Database Snapshot
82208221
** KEYWORDS: {snapshot}
82218222
** EXPERIMENTAL
@@ -8261,11 +8262,11 @@
82618262
** to avoid a memory leak.
82628263
**
82638264
** The [sqlite3_snapshot_get()] interface is only available when the
82648265
** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
82658266
*/
8266
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_get(
8267
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_get(
82678268
sqlite3 *db,
82688269
const char *zSchema,
82698270
sqlite3_snapshot **ppSnapshot
82708271
);
82718272
@@ -8299,11 +8300,11 @@
82998300
** database connection in order to make it ready to use snapshots.)
83008301
**
83018302
** The [sqlite3_snapshot_open()] interface is only available when the
83028303
** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
83038304
*/
8304
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_open(
8305
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_open(
83058306
sqlite3 *db,
83068307
const char *zSchema,
83078308
sqlite3_snapshot *pSnapshot
83088309
);
83098310
@@ -8316,11 +8317,11 @@
83168317
** using this routine to avoid a memory leak.
83178318
**
83188319
** The [sqlite3_snapshot_free()] interface is only available when the
83198320
** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
83208321
*/
8321
-SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_APICALL sqlite3_snapshot_free(sqlite3_snapshot*);
8322
+SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot*);
83228323
83238324
/*
83248325
** CAPI3REF: Compare the ages of two snapshot handles.
83258326
** EXPERIMENTAL
83268327
**
@@ -8340,11 +8341,11 @@
83408341
**
83418342
** Otherwise, this API returns a negative value if P1 refers to an older
83428343
** snapshot than P2, zero if the two handles refer to the same database
83438344
** snapshot, and a positive value if P1 is a newer snapshot than P2.
83448345
*/
8345
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_cmp(
8346
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_cmp(
83468347
sqlite3_snapshot *p1,
83478348
sqlite3_snapshot *p2
83488349
);
83498350
83508351
/*
@@ -8398,14 +8399,14 @@
83988399
** Register a geometry callback named zGeom that can be used as part of an
83998400
** R-Tree geometry query as follows:
84008401
**
84018402
** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
84028403
*/
8403
-SQLITE_API int SQLITE_APICALL sqlite3_rtree_geometry_callback(
8404
+SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
84048405
sqlite3 *db,
84058406
const char *zGeom,
8406
- int (SQLITE_CALLBACK *xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
8407
+ int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
84078408
void *pContext
84088409
);
84098410
84108411
84118412
/*
@@ -8415,25 +8416,25 @@
84158416
struct sqlite3_rtree_geometry {
84168417
void *pContext; /* Copy of pContext passed to s_r_g_c() */
84178418
int nParam; /* Size of array aParam[] */
84188419
sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */
84198420
void *pUser; /* Callback implementation user data */
8420
- void (SQLITE_CALLBACK *xDelUser)(void *); /* Called by SQLite to clean up pUser */
8421
+ void (*xDelUser)(void *); /* Called by SQLite to clean up pUser */
84218422
};
84228423
84238424
/*
84248425
** Register a 2nd-generation geometry callback named zScore that can be
84258426
** used as part of an R-Tree geometry query as follows:
84268427
**
84278428
** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...)
84288429
*/
8429
-SQLITE_API int SQLITE_APICALL sqlite3_rtree_query_callback(
8430
+SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
84308431
sqlite3 *db,
84318432
const char *zQueryFunc,
8432
- int (SQLITE_CALLBACK *xQueryFunc)(sqlite3_rtree_query_info*),
8433
+ int (*xQueryFunc)(sqlite3_rtree_query_info*),
84338434
void *pContext,
8434
- void (SQLITE_CALLBACK *xDestructor)(void*)
8435
+ void (*xDestructor)(void*)
84358436
);
84368437
84378438
84388439
/*
84398440
** A pointer to a structure of the following type is passed as the
@@ -8447,11 +8448,11 @@
84478448
struct sqlite3_rtree_query_info {
84488449
void *pContext; /* pContext from when function registered */
84498450
int nParam; /* Number of function parameters */
84508451
sqlite3_rtree_dbl *aParam; /* value of function parameters */
84518452
void *pUser; /* callback can use this, if desired */
8452
- void (SQLITE_CALLBACK *xDelUser)(void*); /* function to free pUser */
8453
+ void (*xDelUser)(void*); /* function to free pUser */
84538454
sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */
84548455
unsigned int *anQueue; /* Number of pending entries in the queue */
84558456
int nCoord; /* Number of coordinates */
84568457
int iLevel; /* Level of current node or entry */
84578458
int mxLevel; /* The largest iLevel value in the tree */
@@ -8643,11 +8644,11 @@
86438644
** If xFilter returns 0, changes is not tracked. Note that once a table is
86448645
** attached, xFilter will not be called again.
86458646
*/
86468647
void sqlite3session_table_filter(
86478648
sqlite3_session *pSession, /* Session object */
8648
- int(SQLITE_CALLBACK *xFilter)(
8649
+ int(*xFilter)(
86498650
void *pCtx, /* Copy of third arg to _filter_table() */
86508651
const char *zTab /* Table name */
86518652
),
86528653
void *pCtx /* First argument passed to xFilter */
86538654
);
@@ -9218,11 +9219,11 @@
92189219
** An sqlite3_changegroup object is used to combine two or more changesets
92199220
** (or patchsets) into a single changeset (or patchset). A single changegroup
92209221
** object may combine changesets or patchsets, but not both. The output is
92219222
** always in the same format as the input.
92229223
**
9223
-** If successful, this function returns SQLITE_OK and populates (SQLITE_CALLBACK *pp) with
9224
+** If successful, this function returns SQLITE_OK and populates (*pp) with
92249225
** a pointer to a new sqlite3_changegroup object before returning. The caller
92259226
** should eventually free the returned object using a call to
92269227
** sqlite3changegroup_delete(). If an error occurs, an SQLite error code
92279228
** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL.
92289229
**
@@ -9338,11 +9339,11 @@
93389339
** changes for tables that do not appear in the first changeset, they are
93399340
** appended onto the end of the output changeset, again in the order in
93409341
** which they are first encountered.
93419342
**
93429343
** If an error occurs, an SQLite error code is returned and the output
9343
-** variables (SQLITE_CALLBACK *pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK
9344
+** variables (*pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK
93449345
** is returned and the output variables are set to the size of and a
93459346
** pointer to the output buffer, respectively. In this case it is the
93469347
** responsibility of the caller to eventually free the buffer using a
93479348
** call to sqlite3_free().
93489349
*/
@@ -9495,15 +9496,15 @@
94959496
*/
94969497
int sqlite3changeset_apply(
94979498
sqlite3 *db, /* Apply change to "main" db of this handle */
94989499
int nChangeset, /* Size of changeset in bytes */
94999500
void *pChangeset, /* Changeset blob */
9500
- int(SQLITE_CALLBACK *xFilter)(
9501
+ int(*xFilter)(
95019502
void *pCtx, /* Copy of sixth arg to _apply() */
95029503
const char *zTab /* Table name */
95039504
),
9504
- int(SQLITE_CALLBACK *xConflict)(
9505
+ int(*xConflict)(
95059506
void *pCtx, /* Copy of sixth arg to _apply() */
95069507
int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
95079508
sqlite3_changeset_iter *p /* Handle describing change and conflict */
95089509
),
95099510
void *pCtx /* First argument passed to xConflict */
@@ -9640,20 +9641,20 @@
96409641
** </pre>
96419642
**
96429643
** Is replaced by:
96439644
**
96449645
** <pre>
9645
-** &nbsp; int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
9646
+** &nbsp; int (*xInput)(void *pIn, void *pData, int *pnData),
96469647
** &nbsp; void *pIn,
96479648
** </pre>
96489649
**
96499650
** Each time the xInput callback is invoked by the sessions module, the first
96509651
** argument passed is a copy of the supplied pIn context pointer. The second
9651
-** argument, pData, points to a buffer (SQLITE_CALLBACK *pnData) bytes in size. Assuming no
9652
-** error occurs the xInput method should copy up to (SQLITE_CALLBACK *pnData) bytes of data
9653
-** into the buffer and set (SQLITE_CALLBACK *pnData) to the actual number of bytes copied
9654
-** before returning SQLITE_OK. If the input is completely exhausted, (SQLITE_CALLBACK *pnData)
9652
+** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no
9653
+** error occurs the xInput method should copy up to (*pnData) bytes of data
9654
+** into the buffer and set (*pnData) to the actual number of bytes copied
9655
+** before returning SQLITE_OK. If the input is completely exhausted, (*pnData)
96559656
** should be set to zero to indicate this. Or, if an error occurs, an SQLite
96569657
** error code should be returned. In all cases, if an xInput callback returns
96579658
** an error, all processing is abandoned and the streaming API function
96589659
** returns a copy of the error code to the caller.
96599660
**
@@ -9674,11 +9675,11 @@
96749675
** </pre>
96759676
**
96769677
** Is replaced by:
96779678
**
96789679
** <pre>
9679
-** &nbsp; int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9680
+** &nbsp; int (*xOutput)(void *pOut, const void *pData, int nData),
96809681
** &nbsp; void *pOut
96819682
** </pre>
96829683
**
96839684
** The xOutput callback is invoked zero or more times to return data to
96849685
** the application. The first parameter passed to each call is a copy of the
@@ -9694,58 +9695,58 @@
96949695
** parameter set to a value less than or equal to zero. Other than this,
96959696
** no guarantees are made as to the size of the chunks of data returned.
96969697
*/
96979698
int sqlite3changeset_apply_strm(
96989699
sqlite3 *db, /* Apply change to "main" db of this handle */
9699
- int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), /* Input function */
9700
+ int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
97009701
void *pIn, /* First arg for xInput */
9701
- int(SQLITE_CALLBACK *xFilter)(
9702
+ int(*xFilter)(
97029703
void *pCtx, /* Copy of sixth arg to _apply() */
97039704
const char *zTab /* Table name */
97049705
),
9705
- int(SQLITE_CALLBACK *xConflict)(
9706
+ int(*xConflict)(
97069707
void *pCtx, /* Copy of sixth arg to _apply() */
97079708
int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
97089709
sqlite3_changeset_iter *p /* Handle describing change and conflict */
97099710
),
97109711
void *pCtx /* First argument passed to xConflict */
97119712
);
97129713
int sqlite3changeset_concat_strm(
9713
- int (SQLITE_CALLBACK *xInputA)(void *pIn, void *pData, int *pnData),
9714
+ int (*xInputA)(void *pIn, void *pData, int *pnData),
97149715
void *pInA,
9715
- int (SQLITE_CALLBACK *xInputB)(void *pIn, void *pData, int *pnData),
9716
+ int (*xInputB)(void *pIn, void *pData, int *pnData),
97169717
void *pInB,
9717
- int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9718
+ int (*xOutput)(void *pOut, const void *pData, int nData),
97189719
void *pOut
97199720
);
97209721
int sqlite3changeset_invert_strm(
9721
- int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
9722
+ int (*xInput)(void *pIn, void *pData, int *pnData),
97229723
void *pIn,
9723
- int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9724
+ int (*xOutput)(void *pOut, const void *pData, int nData),
97249725
void *pOut
97259726
);
97269727
int sqlite3changeset_start_strm(
97279728
sqlite3_changeset_iter **pp,
9728
- int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
9729
+ int (*xInput)(void *pIn, void *pData, int *pnData),
97299730
void *pIn
97309731
);
97319732
int sqlite3session_changeset_strm(
97329733
sqlite3_session *pSession,
9733
- int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9734
+ int (*xOutput)(void *pOut, const void *pData, int nData),
97349735
void *pOut
97359736
);
97369737
int sqlite3session_patchset_strm(
97379738
sqlite3_session *pSession,
9738
- int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9739
+ int (*xOutput)(void *pOut, const void *pData, int nData),
97399740
void *pOut
97409741
);
97419742
int sqlite3changegroup_add_strm(sqlite3_changegroup*,
9742
- int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
9743
+ int (*xInput)(void *pIn, void *pData, int *pnData),
97439744
void *pIn
97449745
);
97459746
int sqlite3changegroup_output_strm(sqlite3_changegroup*,
9746
- int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9747
+ int (*xOutput)(void *pOut, const void *pData, int nData),
97479748
void *pOut
97489749
);
97499750
97509751
97519752
/*
@@ -9796,11 +9797,11 @@
97969797
97979798
typedef struct Fts5ExtensionApi Fts5ExtensionApi;
97989799
typedef struct Fts5Context Fts5Context;
97999800
typedef struct Fts5PhraseIter Fts5PhraseIter;
98009801
9801
-typedef void (SQLITE_CALLBACK *fts5_extension_function)(
9802
+typedef void (*fts5_extension_function)(
98029803
const Fts5ExtensionApi *pApi, /* API offered by current FTS version */
98039804
Fts5Context *pFts, /* First arg to pass to pApi functions */
98049805
sqlite3_context *pCtx, /* Context for returning result/error */
98059806
int nVal, /* Number of values in apVal[] array */
98069807
sqlite3_value **apVal /* Array of trailing arguments */
@@ -9847,15 +9848,15 @@
98479848
** This function may be quite inefficient if used with an FTS5 table
98489849
** created with the "columnsize=0" option.
98499850
**
98509851
** xColumnText:
98519852
** This function attempts to retrieve the text of column iCol of the
9852
-** current document. If successful, (SQLITE_CALLBACK *pz) is set to point to a buffer
9853
-** containing the text in utf-8 encoding, (SQLITE_CALLBACK *pn) is set to the size in bytes
9853
+** current document. If successful, (*pz) is set to point to a buffer
9854
+** containing the text in utf-8 encoding, (*pn) is set to the size in bytes
98549855
** (not characters) of the buffer and SQLITE_OK is returned. Otherwise,
98559856
** if an error occurs, an SQLite error code is returned and the final values
9856
-** of (SQLITE_CALLBACK *pz) and (*pn) are undefined.
9857
+** of (*pz) and (*pn) are undefined.
98579858
**
98589859
** xPhraseCount:
98599860
** Returns the number of phrases in the current query expression.
98609861
**
98619862
** xPhraseSize:
@@ -9960,11 +9961,11 @@
99609961
** xRowCount(pFts5, pnRow)
99619962
**
99629963
** This function is used to retrieve the total number of rows in the table.
99639964
** In other words, the same value that would be returned by:
99649965
**
9965
-** SELECT count(SQLITE_CALLBACK *) FROM ftstable;
9966
+** SELECT count(*) FROM ftstable;
99669967
**
99679968
** xPhraseFirst()
99689969
** This function is used, along with type Fts5PhraseIter and the xPhraseNext
99699970
** method, to iterate through all instances of a single query phrase within
99709971
** the current row. This is the same information as is accessible via the
@@ -10027,43 +10028,43 @@
1002710028
** See xPhraseFirstColumn above.
1002810029
*/
1002910030
struct Fts5ExtensionApi {
1003010031
int iVersion; /* Currently always set to 3 */
1003110032
10032
- void *(SQLITE_CALLBACK *xUserData)(Fts5Context*);
10033
+ void *(*xUserData)(Fts5Context*);
1003310034
10034
- int (SQLITE_CALLBACK *xColumnCount)(Fts5Context*);
10035
- int (SQLITE_CALLBACK *xRowCount)(Fts5Context*, sqlite3_int64 *pnRow);
10036
- int (SQLITE_CALLBACK *xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken);
10035
+ int (*xColumnCount)(Fts5Context*);
10036
+ int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow);
10037
+ int (*xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken);
1003710038
10038
- int (SQLITE_CALLBACK *xTokenize)(Fts5Context*,
10039
+ int (*xTokenize)(Fts5Context*,
1003910040
const char *pText, int nText, /* Text to tokenize */
1004010041
void *pCtx, /* Context passed to xToken() */
10041
- int (SQLITE_CALLBACK *xToken)(void*, int, const char*, int, int, int) /* Callback */
10042
- );
10043
-
10044
- int (SQLITE_CALLBACK *xPhraseCount)(Fts5Context*);
10045
- int (SQLITE_CALLBACK *xPhraseSize)(Fts5Context*, int iPhrase);
10046
-
10047
- int (SQLITE_CALLBACK *xInstCount)(Fts5Context*, int *pnInst);
10048
- int (SQLITE_CALLBACK *xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff);
10049
-
10050
- sqlite3_int64 (SQLITE_CALLBACK *xRowid)(Fts5Context*);
10051
- int (SQLITE_CALLBACK *xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn);
10052
- int (SQLITE_CALLBACK *xColumnSize)(Fts5Context*, int iCol, int *pnToken);
10053
-
10054
- int (SQLITE_CALLBACK *xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData,
10055
- int(SQLITE_CALLBACK *)(const Fts5ExtensionApi*,Fts5Context*,void*)
10056
- );
10057
- int (SQLITE_CALLBACK *xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*));
10058
- void *(SQLITE_CALLBACK *xGetAuxdata)(Fts5Context*, int bClear);
10059
-
10060
- int (SQLITE_CALLBACK *xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*);
10061
- void (SQLITE_CALLBACK *xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff);
10062
-
10063
- int (SQLITE_CALLBACK *xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*);
10064
- void (SQLITE_CALLBACK *xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol);
10042
+ int (*xToken)(void*, int, const char*, int, int, int) /* Callback */
10043
+ );
10044
+
10045
+ int (*xPhraseCount)(Fts5Context*);
10046
+ int (*xPhraseSize)(Fts5Context*, int iPhrase);
10047
+
10048
+ int (*xInstCount)(Fts5Context*, int *pnInst);
10049
+ int (*xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff);
10050
+
10051
+ sqlite3_int64 (*xRowid)(Fts5Context*);
10052
+ int (*xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn);
10053
+ int (*xColumnSize)(Fts5Context*, int iCol, int *pnToken);
10054
+
10055
+ int (*xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData,
10056
+ int(*)(const Fts5ExtensionApi*,Fts5Context*,void*)
10057
+ );
10058
+ int (*xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*));
10059
+ void *(*xGetAuxdata)(Fts5Context*, int bClear);
10060
+
10061
+ int (*xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*);
10062
+ void (*xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff);
10063
+
10064
+ int (*xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*);
10065
+ void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol);
1006510066
};
1006610067
1006710068
/*
1006810069
** CUSTOM AUXILIARY FUNCTIONS
1006910070
*************************************************************************/
@@ -10087,11 +10088,11 @@
1008710088
** The second and third arguments are an array of nul-terminated strings
1008810089
** containing the tokenizer arguments, if any, specified following the
1008910090
** tokenizer name as part of the CREATE VIRTUAL TABLE statement used
1009010091
** to create the FTS5 table.
1009110092
**
10092
-** The final argument is an output variable. If successful, (SQLITE_CALLBACK *ppOut)
10093
+** The final argument is an output variable. If successful, (*ppOut)
1009310094
** should be set to point to the new tokenizer handle and SQLITE_OK
1009410095
** returned. If an error occurs, some value other than SQLITE_OK should
1009510096
** be returned. In this case, fts5 assumes that the final value of *ppOut
1009610097
** is undefined.
1009710098
**
@@ -10261,17 +10262,17 @@
1026110262
** inefficient.
1026210263
*/
1026310264
typedef struct Fts5Tokenizer Fts5Tokenizer;
1026410265
typedef struct fts5_tokenizer fts5_tokenizer;
1026510266
struct fts5_tokenizer {
10266
- int (SQLITE_CALLBACK *xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
10267
- void (SQLITE_CALLBACK *xDelete)(Fts5Tokenizer*);
10268
- int (SQLITE_CALLBACK *xTokenize)(Fts5Tokenizer*,
10267
+ int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
10268
+ void (*xDelete)(Fts5Tokenizer*);
10269
+ int (*xTokenize)(Fts5Tokenizer*,
1026910270
void *pCtx,
1027010271
int flags, /* Mask of FTS5_TOKENIZE_* flags */
1027110272
const char *pText, int nText,
10272
- int (SQLITE_CALLBACK *xToken)(
10273
+ int (*xToken)(
1027310274
void *pCtx, /* Copy of 2nd argument to xTokenize() */
1027410275
int tflags, /* Mask of FTS5_TOKEN_* flags */
1027510276
const char *pToken, /* Pointer to buffer containing token */
1027610277
int nToken, /* Size of token in bytes */
1027710278
int iStart, /* Byte offset of token within input text */
@@ -10300,33 +10301,33 @@
1030010301
typedef struct fts5_api fts5_api;
1030110302
struct fts5_api {
1030210303
int iVersion; /* Currently always set to 2 */
1030310304
1030410305
/* Create a new tokenizer */
10305
- int (SQLITE_CALLBACK *xCreateTokenizer)(
10306
+ int (*xCreateTokenizer)(
1030610307
fts5_api *pApi,
1030710308
const char *zName,
1030810309
void *pContext,
1030910310
fts5_tokenizer *pTokenizer,
10310
- void (SQLITE_CALLBACK *xDestroy)(void*)
10311
+ void (*xDestroy)(void*)
1031110312
);
1031210313
1031310314
/* Find an existing tokenizer */
10314
- int (SQLITE_CALLBACK *xFindTokenizer)(
10315
+ int (*xFindTokenizer)(
1031510316
fts5_api *pApi,
1031610317
const char *zName,
1031710318
void **ppContext,
1031810319
fts5_tokenizer *pTokenizer
1031910320
);
1032010321
1032110322
/* Create a new auxiliary function */
10322
- int (SQLITE_CALLBACK *xCreateFunction)(
10323
+ int (*xCreateFunction)(
1032310324
fts5_api *pApi,
1032410325
const char *zName,
1032510326
void *pContext,
1032610327
fts5_extension_function xFunction,
10327
- void (SQLITE_CALLBACK *xDestroy)(void*)
10328
+ void (*xDestroy)(void*)
1032810329
);
1032910330
};
1033010331
1033110332
/*
1033210333
** END OF REGISTRATION API
1033310334
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -120,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-08-02 08:45:26 7c38a79cdd42aaa45715aea330d10ca859098837"
126
127 /*
128 ** CAPI3REF: Run-Time Library Version Numbers
129 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
130 **
@@ -153,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
@@ -180,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 **
@@ -220,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 **
@@ -317,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 **
@@ -389,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 /*
@@ -740,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 /*
@@ -935,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 **
@@ -1211,43 +1211,43 @@
1211 ** or all of these interfaces to be NULL or for their behavior to change
1212 ** from one release to the next. Applications must not attempt to access
1213 ** any of these methods if the iVersion of the VFS is less than 3.
1214 */
1215 typedef struct sqlite3_vfs sqlite3_vfs;
1216 typedef void (SQLITE_SYSAPI *sqlite3_syscall_ptr)(void);
1217 struct sqlite3_vfs {
1218 int iVersion; /* Structure version number (currently 3) */
1219 int szOsFile; /* Size of subclassed sqlite3_file */
1220 int mxPathname; /* Maximum file pathname length */
1221 sqlite3_vfs *pNext; /* Next registered VFS */
1222 const char *zName; /* Name of this virtual file system */
1223 void *pAppData; /* Pointer to application-specific data */
1224 int (SQLITE_CALLBACK *xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
1225 int flags, int *pOutFlags);
1226 int (SQLITE_CALLBACK *xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
1227 int (SQLITE_CALLBACK *xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
1228 int (SQLITE_CALLBACK *xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
1229 void *(SQLITE_CALLBACK *xDlOpen)(sqlite3_vfs*, const char *zFilename);
1230 void (SQLITE_CALLBACK *xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
1231 void (SQLITE_CALLBACK *(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
1232 void (SQLITE_CALLBACK *xDlClose)(sqlite3_vfs*, void*);
1233 int (SQLITE_CALLBACK *xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
1234 int (SQLITE_CALLBACK *xSleep)(sqlite3_vfs*, int microseconds);
1235 int (SQLITE_CALLBACK *xCurrentTime)(sqlite3_vfs*, double*);
1236 int (SQLITE_CALLBACK *xGetLastError)(sqlite3_vfs*, int, char *);
1237 /*
1238 ** The methods above are in version 1 of the sqlite_vfs object
1239 ** definition. Those that follow are added in version 2 or later
1240 */
1241 int (SQLITE_CALLBACK *xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
1242 /*
1243 ** The methods above are in versions 1 and 2 of the sqlite_vfs object.
1244 ** Those below are for version 3 and greater.
1245 */
1246 int (SQLITE_CALLBACK *xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
1247 sqlite3_syscall_ptr (SQLITE_CALLBACK *xGetSystemCall)(sqlite3_vfs*, const char *zName);
1248 const char *(SQLITE_CALLBACK *xNextSystemCall)(sqlite3_vfs*, const char *zName);
1249 /*
1250 ** The methods above are in versions 1 through 3 of the sqlite_vfs object.
1251 ** New fields may be appended in future versions. The iVersion
1252 ** value will increment whenever this happens.
1253 */
@@ -1388,14 +1388,14 @@
1388 ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied
1389 ** implementation of sqlite3_os_init() or sqlite3_os_end()
1390 ** must return [SQLITE_OK] on success and some other [error code] upon
1391 ** failure.
1392 */
1393 SQLITE_API int SQLITE_APICALL sqlite3_initialize(void);
1394 SQLITE_API int SQLITE_APICALL sqlite3_shutdown(void);
1395 SQLITE_API int SQLITE_APICALL sqlite3_os_init(void);
1396 SQLITE_API int SQLITE_APICALL sqlite3_os_end(void);
1397
1398 /*
1399 ** CAPI3REF: Configuring The SQLite Library
1400 **
1401 ** The sqlite3_config() interface is used to make global configuration
@@ -1510,17 +1510,17 @@
1510 ** SQLite will never invoke xInit() more than once without an intervening
1511 ** call to xShutdown().
1512 */
1513 typedef struct sqlite3_mem_methods sqlite3_mem_methods;
1514 struct sqlite3_mem_methods {
1515 void *(SQLITE_CALLBACK *xMalloc)(int); /* Memory allocation function */
1516 void (SQLITE_CALLBACK *xFree)(void*); /* Free a prior allocation */
1517 void *(SQLITE_CALLBACK *xRealloc)(void*,int); /* Resize an allocation */
1518 int (SQLITE_CALLBACK *xSize)(void*); /* Return the size of an allocation */
1519 int (SQLITE_CALLBACK *xRoundup)(int); /* Round up request size to allocation size */
1520 int (SQLITE_CALLBACK *xInit)(void*); /* Initialize the memory allocator */
1521 void (SQLITE_CALLBACK *xShutdown)(void*); /* Deinitialize the memory allocator */
1522 void *pAppData; /* Argument to xInit() and xShutdown() */
1523 };
1524
1525 /*
1526 ** CAPI3REF: Configuration Options
@@ -1733,11 +1733,11 @@
1733 **
1734 ** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
1735 ** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
1736 ** global [error log].
1737 ** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a
1738 ** function with a call signature of void(SQLITE_CALLBACK *)(void*,int,const char*),
1739 ** and a pointer to void. ^If the function pointer is not NULL, it is
1740 ** invoked by [sqlite3_log()] to process each logging event. ^If the
1741 ** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op.
1742 ** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is
1743 ** passed through as the first parameter to the application-defined logger
@@ -1786,11 +1786,11 @@
1786 **
1787 ** [[SQLITE_CONFIG_SQLLOG]]
1788 ** <dt>SQLITE_CONFIG_SQLLOG
1789 ** <dd>This option is only available if sqlite is compiled with the
1790 ** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should
1791 ** be a pointer to a function of type void(SQLITE_CALLBACK *)(void*,sqlite3*,const char*, int).
1792 ** The second should be of type (void*). The callback is invoked by the library
1793 ** in three separate circumstances, identified by the value passed as the
1794 ** fourth parameter. If the fourth parameter is 0, then the database connection
1795 ** passed as the second argument has just been opened. The third argument
1796 ** points to a buffer containing the name of the main database file. If the
@@ -1984,11 +1984,11 @@
1984 **
1985 ** ^The sqlite3_extended_result_codes() routine enables or disables the
1986 ** [extended result codes] feature of SQLite. ^The extended result
1987 ** codes are disabled by default for historical compatibility.
1988 */
1989 SQLITE_API int SQLITE_APICALL sqlite3_extended_result_codes(sqlite3*, int onoff);
1990
1991 /*
1992 ** CAPI3REF: Last Insert Rowid
1993 ** METHOD: sqlite3
1994 **
@@ -2036,11 +2036,11 @@
2036 ** function is running and thus changes the last insert [rowid],
2037 ** then the value returned by [sqlite3_last_insert_rowid()] is
2038 ** unpredictable and might not equal either the old or the new
2039 ** last insert [rowid].
2040 */
2041 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_last_insert_rowid(sqlite3*);
2042
2043 /*
2044 ** CAPI3REF: Count The Number Of Rows Modified
2045 ** METHOD: sqlite3
2046 **
@@ -2089,11 +2089,11 @@
2089 **
2090 ** If a separate thread makes changes on the same database connection
2091 ** while [sqlite3_changes()] is running then the value returned
2092 ** is unpredictable and not meaningful.
2093 */
2094 SQLITE_API int SQLITE_APICALL sqlite3_changes(sqlite3*);
2095
2096 /*
2097 ** CAPI3REF: Total Number Of Rows Modified
2098 ** METHOD: sqlite3
2099 **
@@ -2113,11 +2113,11 @@
2113 **
2114 ** If a separate thread makes changes on the same database connection
2115 ** while [sqlite3_total_changes()] is running then the value
2116 ** returned is unpredictable and not meaningful.
2117 */
2118 SQLITE_API int SQLITE_APICALL sqlite3_total_changes(sqlite3*);
2119
2120 /*
2121 ** CAPI3REF: Interrupt A Long-Running Query
2122 ** METHOD: sqlite3
2123 **
@@ -2153,11 +2153,11 @@
2153 ** that are started after the sqlite3_interrupt() call returns.
2154 **
2155 ** If the database connection closes while [sqlite3_interrupt()]
2156 ** is running then bad things will likely happen.
2157 */
2158 SQLITE_API void SQLITE_APICALL sqlite3_interrupt(sqlite3*);
2159
2160 /*
2161 ** CAPI3REF: Determine If An SQL Statement Is Complete
2162 **
2163 ** These routines are useful during command-line input to determine if the
@@ -2188,12 +2188,12 @@
2188 ** UTF-8 string.
2189 **
2190 ** The input to [sqlite3_complete16()] must be a zero-terminated
2191 ** UTF-16 string in native byte order.
2192 */
2193 SQLITE_API int SQLITE_APICALL sqlite3_complete(const char *sql);
2194 SQLITE_API int SQLITE_APICALL sqlite3_complete16(const void *sql);
2195
2196 /*
2197 ** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
2198 ** KEYWORDS: {busy-handler callback} {busy handler}
2199 ** METHOD: sqlite3
@@ -2250,11 +2250,11 @@
2250 ** result in undefined behavior.
2251 **
2252 ** A busy handler must not close the database connection
2253 ** or [prepared statement] that invoked the busy handler.
2254 */
2255 SQLITE_API int SQLITE_APICALL sqlite3_busy_handler(sqlite3*,int(SQLITE_CALLBACK *)(void*,int),void*);
2256
2257 /*
2258 ** CAPI3REF: Set A Busy Timeout
2259 ** METHOD: sqlite3
2260 **
@@ -2273,11 +2273,11 @@
2273 ** was defined (using [sqlite3_busy_handler()]) prior to calling
2274 ** this routine, that other busy handler is cleared.)^
2275 **
2276 ** See also: [PRAGMA busy_timeout]
2277 */
2278 SQLITE_API int SQLITE_APICALL sqlite3_busy_timeout(sqlite3*, int ms);
2279
2280 /*
2281 ** CAPI3REF: Convenience Routines For Running Queries
2282 ** METHOD: sqlite3
2283 **
@@ -2348,19 +2348,19 @@
2348 ** interface defined here. As a consequence, errors that occur in the
2349 ** wrapper layer outside of the internal [sqlite3_exec()] call are not
2350 ** reflected in subsequent calls to [sqlite3_errcode()] or
2351 ** [sqlite3_errmsg()].
2352 */
2353 SQLITE_API int SQLITE_APICALL sqlite3_get_table(
2354 sqlite3 *db, /* An open database */
2355 const char *zSql, /* SQL to be evaluated */
2356 char ***pazResult, /* Results of the query */
2357 int *pnRow, /* Number of result rows written here */
2358 int *pnColumn, /* Number of result columns written here */
2359 char **pzErrmsg /* Error msg written here */
2360 );
2361 SQLITE_API void SQLITE_APICALL sqlite3_free_table(char **result);
2362
2363 /*
2364 ** CAPI3REF: Formatted String Printing Functions
2365 **
2366 ** These routines are work-alikes of the "printf()" family of functions
@@ -2463,13 +2463,13 @@
2463 ** ^(The "%z" formatting option works like "%s" but with the
2464 ** addition that after the string has been read and copied into
2465 ** the result, [sqlite3_free()] is called on the input string.)^
2466 */
2467 SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...);
2468 SQLITE_API char *SQLITE_APICALL sqlite3_vmprintf(const char*, va_list);
2469 SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...);
2470 SQLITE_API char *SQLITE_APICALL sqlite3_vsnprintf(int,char*,const char*, va_list);
2471
2472 /*
2473 ** CAPI3REF: Memory Allocation Subsystem
2474 **
2475 ** The SQLite core uses these three routines for all of its own
@@ -2555,16 +2555,16 @@
2555 **
2556 ** The application must not read or write any part of
2557 ** a block of memory after it has been released using
2558 ** [sqlite3_free()] or [sqlite3_realloc()].
2559 */
2560 SQLITE_API void *SQLITE_APICALL sqlite3_malloc(int);
2561 SQLITE_API void *SQLITE_APICALL sqlite3_malloc64(sqlite3_uint64);
2562 SQLITE_API void *SQLITE_APICALL sqlite3_realloc(void*, int);
2563 SQLITE_API void *SQLITE_APICALL sqlite3_realloc64(void*, sqlite3_uint64);
2564 SQLITE_API void SQLITE_APICALL sqlite3_free(void*);
2565 SQLITE_API sqlite3_uint64 SQLITE_APICALL sqlite3_msize(void*);
2566
2567 /*
2568 ** CAPI3REF: Memory Allocator Statistics
2569 **
2570 ** SQLite provides these two interfaces for reporting on the status
@@ -2585,12 +2585,12 @@
2585 ** [sqlite3_memory_used()] if and only if the parameter to
2586 ** [sqlite3_memory_highwater()] is true. ^The value returned
2587 ** by [sqlite3_memory_highwater(1)] is the high-water mark
2588 ** prior to the reset.
2589 */
2590 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_used(void);
2591 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_highwater(int resetFlag);
2592
2593 /*
2594 ** CAPI3REF: Pseudo-Random Number Generator
2595 **
2596 ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
@@ -2609,11 +2609,11 @@
2609 ** ^If the previous call to this routine had an N of 1 or more and a
2610 ** non-NULL P then the pseudo-randomness is generated
2611 ** internally and without recourse to the [sqlite3_vfs] xRandomness
2612 ** method.
2613 */
2614 SQLITE_API void SQLITE_APICALL sqlite3_randomness(int N, void *P);
2615
2616 /*
2617 ** CAPI3REF: Compile-Time Authorization Callbacks
2618 ** METHOD: sqlite3
2619 **
@@ -2692,13 +2692,13 @@
2692 ** [sqlite3_prepare()] or its variants. Authorization is not
2693 ** performed during statement evaluation in [sqlite3_step()], unless
2694 ** as stated in the previous paragraph, sqlite3_step() invokes
2695 ** sqlite3_prepare_v2() to reprepare a statement after a schema change.
2696 */
2697 SQLITE_API int SQLITE_APICALL sqlite3_set_authorizer(
2698 sqlite3*,
2699 int (SQLITE_CALLBACK *xAuth)(void*,int,const char*,const char*,const char*,const char*),
2700 void *pUserData
2701 );
2702
2703 /*
2704 ** CAPI3REF: Authorizer Return Codes
@@ -2800,14 +2800,14 @@
2800 ** digits in the time are meaningless. Future versions of SQLite
2801 ** might provide greater resolution on the profiler callback. The
2802 ** sqlite3_profile() function is considered experimental and is
2803 ** subject to change in future versions of SQLite.
2804 */
2805 SQLITE_API SQLITE_DEPRECATED void *SQLITE_APICALL sqlite3_trace(sqlite3*,
2806 void(SQLITE_CALLBACK *xTrace)(void*,const char*), void*);
2807 SQLITE_API SQLITE_DEPRECATED void *SQLITE_APICALL sqlite3_profile(sqlite3*,
2808 void(SQLITE_CALLBACK *xProfile)(void*,const char*,sqlite3_uint64), void*);
2809
2810 /*
2811 ** CAPI3REF: SQL Trace Event Codes
2812 ** KEYWORDS: SQLITE_TRACE
2813 **
@@ -2891,14 +2891,14 @@
2891 **
2892 ** The sqlite3_trace_v2() interface is intended to replace the legacy
2893 ** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which
2894 ** are deprecated.
2895 */
2896 SQLITE_API int SQLITE_APICALL sqlite3_trace_v2(
2897 sqlite3*,
2898 unsigned uMask,
2899 int(SQLITE_CALLBACK *xCallback)(unsigned,void*,void*,void*),
2900 void *pCtx
2901 );
2902
2903 /*
2904 ** CAPI3REF: Query Progress Callbacks
@@ -2930,11 +2930,11 @@
2930 ** the database connection that invoked the progress handler.
2931 ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
2932 ** database connections for the meaning of "modify" in this paragraph.
2933 **
2934 */
2935 SQLITE_API void SQLITE_APICALL sqlite3_progress_handler(sqlite3*, int, int(SQLITE_CALLBACK *)(void*), void*);
2936
2937 /*
2938 ** CAPI3REF: Opening A New Database Connection
2939 ** CONSTRUCTOR: sqlite3
2940 **
@@ -3159,19 +3159,19 @@
3159 ** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various
3160 ** features that require the use of temporary files may fail.
3161 **
3162 ** See also: [sqlite3_temp_directory]
3163 */
3164 SQLITE_API int SQLITE_APICALL sqlite3_open(
3165 const char *filename, /* Database filename (UTF-8) */
3166 sqlite3 **ppDb /* OUT: SQLite db handle */
3167 );
3168 SQLITE_API int SQLITE_APICALL sqlite3_open16(
3169 const void *filename, /* Database filename (UTF-16) */
3170 sqlite3 **ppDb /* OUT: SQLite db handle */
3171 );
3172 SQLITE_API int SQLITE_APICALL sqlite3_open_v2(
3173 const char *filename, /* Database filename (UTF-8) */
3174 sqlite3 **ppDb, /* OUT: SQLite db handle */
3175 int flags, /* Flags */
3176 const char *zVfs /* Name of VFS module to use */
3177 );
@@ -3213,13 +3213,13 @@
3213 ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and
3214 ** is not a database file pathname pointer that SQLite passed into the xOpen
3215 ** VFS method, then the behavior of this routine is undefined and probably
3216 ** undesirable.
3217 */
3218 SQLITE_API const char *SQLITE_APICALL sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3219 SQLITE_API int SQLITE_APICALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3220 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
3221
3222
3223 /*
3224 ** CAPI3REF: Error Codes And Messages
3225 ** METHOD: sqlite3
@@ -3259,15 +3259,15 @@
3259 **
3260 ** If an interface fails with SQLITE_MISUSE, that means the interface
3261 ** was invoked incorrectly by the application. In that case, the
3262 ** error code and message may or may not be set.
3263 */
3264 SQLITE_API int SQLITE_APICALL sqlite3_errcode(sqlite3 *db);
3265 SQLITE_API int SQLITE_APICALL sqlite3_extended_errcode(sqlite3 *db);
3266 SQLITE_API const char *SQLITE_APICALL sqlite3_errmsg(sqlite3*);
3267 SQLITE_API const void *SQLITE_APICALL sqlite3_errmsg16(sqlite3*);
3268 SQLITE_API const char *SQLITE_APICALL sqlite3_errstr(int);
3269
3270 /*
3271 ** CAPI3REF: Prepared Statement Object
3272 ** KEYWORDS: {prepared statement} {prepared statements}
3273 **
@@ -3331,11 +3331,11 @@
3331 ** created by an untrusted script can be contained using the
3332 ** [max_page_count] [PRAGMA].
3333 **
3334 ** New run-time limit categories may be added in future releases.
3335 */
3336 SQLITE_API int SQLITE_APICALL sqlite3_limit(sqlite3*, int id, int newVal);
3337
3338 /*
3339 ** CAPI3REF: Run-Time Limit Categories
3340 ** KEYWORDS: {limit category} {*limit categories}
3341 **
@@ -3483,32 +3483,32 @@
3483 ** or [GLOB] operator or if the parameter is compared to an indexed column
3484 ** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
3485 ** </li>
3486 ** </ol>
3487 */
3488 SQLITE_API int SQLITE_APICALL sqlite3_prepare(
3489 sqlite3 *db, /* Database handle */
3490 const char *zSql, /* SQL statement, UTF-8 encoded */
3491 int nByte, /* Maximum length of zSql in bytes. */
3492 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3493 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3494 );
3495 SQLITE_API int SQLITE_APICALL sqlite3_prepare_v2(
3496 sqlite3 *db, /* Database handle */
3497 const char *zSql, /* SQL statement, UTF-8 encoded */
3498 int nByte, /* Maximum length of zSql in bytes. */
3499 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3500 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3501 );
3502 SQLITE_API int SQLITE_APICALL sqlite3_prepare16(
3503 sqlite3 *db, /* Database handle */
3504 const void *zSql, /* SQL statement, UTF-16 encoded */
3505 int nByte, /* Maximum length of zSql in bytes. */
3506 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3507 const void **pzTail /* OUT: Pointer to unused portion of zSql */
3508 );
3509 SQLITE_API int SQLITE_APICALL sqlite3_prepare16_v2(
3510 sqlite3 *db, /* Database handle */
3511 const void *zSql, /* SQL statement, UTF-16 encoded */
3512 int nByte, /* Maximum length of zSql in bytes. */
3513 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3514 const void **pzTail /* OUT: Pointer to unused portion of zSql */
@@ -3543,12 +3543,12 @@
3543 ** automatically freed when the prepared statement is finalized.
3544 ** ^The string returned by sqlite3_expanded_sql(P), on the other hand,
3545 ** is obtained from [sqlite3_malloc()] and must be free by the application
3546 ** by passing it to [sqlite3_free()].
3547 */
3548 SQLITE_API const char *SQLITE_APICALL sqlite3_sql(sqlite3_stmt *pStmt);
3549 SQLITE_API char *SQLITE_APICALL sqlite3_expanded_sql(sqlite3_stmt *pStmt);
3550
3551 /*
3552 ** CAPI3REF: Determine If An SQL Statement Writes The Database
3553 ** METHOD: sqlite3_stmt
3554 **
@@ -3576,11 +3576,11 @@
3576 ** database. ^The [ATTACH] and [DETACH] statements also cause
3577 ** sqlite3_stmt_readonly() to return true since, while those statements
3578 ** change the configuration of a database connection, they do not make
3579 ** changes to the content of the database files on disk.
3580 */
3581 SQLITE_API int SQLITE_APICALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
3582
3583 /*
3584 ** CAPI3REF: Determine If A Prepared Statement Has Been Reset
3585 ** METHOD: sqlite3_stmt
3586 **
@@ -3597,11 +3597,11 @@
3597 ** to locate all prepared statements associated with a database
3598 ** connection that are in need of being reset. This can be used,
3599 ** for example, in diagnostic routines to search for prepared
3600 ** statements that are holding a transaction open.
3601 */
3602 SQLITE_API int SQLITE_APICALL sqlite3_stmt_busy(sqlite3_stmt*);
3603
3604 /*
3605 ** CAPI3REF: Dynamically Typed Value Object
3606 ** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
3607 **
@@ -3761,24 +3761,24 @@
3761 ** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails.
3762 **
3763 ** See also: [sqlite3_bind_parameter_count()],
3764 ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].
3765 */
3766 SQLITE_API int SQLITE_APICALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(SQLITE_CALLBACK *)(void*));
3767 SQLITE_API int SQLITE_APICALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
3768 void(SQLITE_CALLBACK *)(void*));
3769 SQLITE_API int SQLITE_APICALL sqlite3_bind_double(sqlite3_stmt*, int, double);
3770 SQLITE_API int SQLITE_APICALL sqlite3_bind_int(sqlite3_stmt*, int, int);
3771 SQLITE_API int SQLITE_APICALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
3772 SQLITE_API int SQLITE_APICALL sqlite3_bind_null(sqlite3_stmt*, int);
3773 SQLITE_API int SQLITE_APICALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(SQLITE_CALLBACK *)(void*));
3774 SQLITE_API int SQLITE_APICALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(SQLITE_CALLBACK *)(void*));
3775 SQLITE_API int SQLITE_APICALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
3776 void(SQLITE_CALLBACK *)(void*), unsigned char encoding);
3777 SQLITE_API int SQLITE_APICALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
3778 SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
3779 SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
3780
3781 /*
3782 ** CAPI3REF: Number Of SQL Parameters
3783 ** METHOD: sqlite3_stmt
3784 **
@@ -3795,11 +3795,11 @@
3795 **
3796 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3797 ** [sqlite3_bind_parameter_name()], and
3798 ** [sqlite3_bind_parameter_index()].
3799 */
3800 SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_count(sqlite3_stmt*);
3801
3802 /*
3803 ** CAPI3REF: Name Of A Host Parameter
3804 ** METHOD: sqlite3_stmt
3805 **
@@ -3823,11 +3823,11 @@
3823 **
3824 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3825 ** [sqlite3_bind_parameter_count()], and
3826 ** [sqlite3_bind_parameter_index()].
3827 */
3828 SQLITE_API const char *SQLITE_APICALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
3829
3830 /*
3831 ** CAPI3REF: Index Of A Parameter With A Given Name
3832 ** METHOD: sqlite3_stmt
3833 **
@@ -3840,21 +3840,21 @@
3840 **
3841 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3842 ** [sqlite3_bind_parameter_count()], and
3843 ** [sqlite3_bind_parameter_name()].
3844 */
3845 SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
3846
3847 /*
3848 ** CAPI3REF: Reset All Bindings On A Prepared Statement
3849 ** METHOD: sqlite3_stmt
3850 **
3851 ** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset
3852 ** the [sqlite3_bind_blob | bindings] on a [prepared statement].
3853 ** ^Use this routine to reset all host parameters to NULL.
3854 */
3855 SQLITE_API int SQLITE_APICALL sqlite3_clear_bindings(sqlite3_stmt*);
3856
3857 /*
3858 ** CAPI3REF: Number Of Columns In A Result Set
3859 ** METHOD: sqlite3_stmt
3860 **
@@ -3862,11 +3862,11 @@
3862 ** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
3863 ** statement that does not return data (for example an [UPDATE]).
3864 **
3865 ** See also: [sqlite3_data_count()]
3866 */
3867 SQLITE_API int SQLITE_APICALL sqlite3_column_count(sqlite3_stmt *pStmt);
3868
3869 /*
3870 ** CAPI3REF: Column Names In A Result Set
3871 ** METHOD: sqlite3_stmt
3872 **
@@ -3891,12 +3891,12 @@
3891 ** ^The name of a result column is the value of the "AS" clause for
3892 ** that column, if there is an AS clause. If there is no AS clause
3893 ** then the name of the column is unspecified and may change from
3894 ** one release of SQLite to the next.
3895 */
3896 SQLITE_API const char *SQLITE_APICALL sqlite3_column_name(sqlite3_stmt*, int N);
3897 SQLITE_API const void *SQLITE_APICALL sqlite3_column_name16(sqlite3_stmt*, int N);
3898
3899 /*
3900 ** CAPI3REF: Source Of Data In A Query Result
3901 ** METHOD: sqlite3_stmt
3902 **
@@ -3940,16 +3940,16 @@
3940 ** If two or more threads call one or more
3941 ** [sqlite3_column_database_name | column metadata interfaces]
3942 ** for the same [prepared statement] and result column
3943 ** at the same time then the results are undefined.
3944 */
3945 SQLITE_API const char *SQLITE_APICALL sqlite3_column_database_name(sqlite3_stmt*,int);
3946 SQLITE_API const void *SQLITE_APICALL sqlite3_column_database_name16(sqlite3_stmt*,int);
3947 SQLITE_API const char *SQLITE_APICALL sqlite3_column_table_name(sqlite3_stmt*,int);
3948 SQLITE_API const void *SQLITE_APICALL sqlite3_column_table_name16(sqlite3_stmt*,int);
3949 SQLITE_API const char *SQLITE_APICALL sqlite3_column_origin_name(sqlite3_stmt*,int);
3950 SQLITE_API const void *SQLITE_APICALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
3951
3952 /*
3953 ** CAPI3REF: Declared Datatype Of A Query Result
3954 ** METHOD: sqlite3_stmt
3955 **
@@ -3977,12 +3977,12 @@
3977 ** data stored in that column is of the declared type. SQLite is
3978 ** strongly typed, but the typing is dynamic not static. ^Type
3979 ** is associated with individual values, not with the containers
3980 ** used to hold those values.
3981 */
3982 SQLITE_API const char *SQLITE_APICALL sqlite3_column_decltype(sqlite3_stmt*,int);
3983 SQLITE_API const void *SQLITE_APICALL sqlite3_column_decltype16(sqlite3_stmt*,int);
3984
3985 /*
3986 ** CAPI3REF: Evaluate An SQL Statement
3987 ** METHOD: sqlite3_stmt
3988 **
@@ -4058,11 +4058,11 @@
4058 ** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
4059 ** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,
4060 ** then the more specific [error codes] are returned directly
4061 ** by sqlite3_step(). The use of the "v2" interface is recommended.
4062 */
4063 SQLITE_API int SQLITE_APICALL sqlite3_step(sqlite3_stmt*);
4064
4065 /*
4066 ** CAPI3REF: Number of columns in a result set
4067 ** METHOD: sqlite3_stmt
4068 **
@@ -4079,11 +4079,11 @@
4079 ** where it always returns zero since each step of that multi-step
4080 ** pragma returns 0 columns of data.
4081 **
4082 ** See also: [sqlite3_column_count()]
4083 */
4084 SQLITE_API int SQLITE_APICALL sqlite3_data_count(sqlite3_stmt *pStmt);
4085
4086 /*
4087 ** CAPI3REF: Fundamental Datatypes
4088 ** KEYWORDS: SQLITE_TEXT
4089 **
@@ -4269,20 +4269,20 @@
4269 ** of these routines, a default value is returned. The default value
4270 ** is either the integer 0, the floating point number 0.0, or a NULL
4271 ** pointer. Subsequent calls to [sqlite3_errcode()] will return
4272 ** [SQLITE_NOMEM].)^
4273 */
4274 SQLITE_API const void *SQLITE_APICALL sqlite3_column_blob(sqlite3_stmt*, int iCol);
4275 SQLITE_API int SQLITE_APICALL sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4276 SQLITE_API int SQLITE_APICALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4277 SQLITE_API double SQLITE_APICALL sqlite3_column_double(sqlite3_stmt*, int iCol);
4278 SQLITE_API int SQLITE_APICALL sqlite3_column_int(sqlite3_stmt*, int iCol);
4279 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_column_int64(sqlite3_stmt*, int iCol);
4280 SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_column_text(sqlite3_stmt*, int iCol);
4281 SQLITE_API const void *SQLITE_APICALL sqlite3_column_text16(sqlite3_stmt*, int iCol);
4282 SQLITE_API int SQLITE_APICALL sqlite3_column_type(sqlite3_stmt*, int iCol);
4283 SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_column_value(sqlite3_stmt*, int iCol);
4284
4285 /*
4286 ** CAPI3REF: Destroy A Prepared Statement Object
4287 ** DESTRUCTOR: sqlite3_stmt
4288 **
@@ -4306,11 +4306,11 @@
4306 ** resource leaks. It is a grievous error for the application to try to use
4307 ** a prepared statement after it has been finalized. Any use of a prepared
4308 ** statement after it has been finalized can result in undefined and
4309 ** undesirable behavior such as segfaults and heap corruption.
4310 */
4311 SQLITE_API int SQLITE_APICALL sqlite3_finalize(sqlite3_stmt *pStmt);
4312
4313 /*
4314 ** CAPI3REF: Reset A Prepared Statement Object
4315 ** METHOD: sqlite3_stmt
4316 **
@@ -4333,11 +4333,11 @@
4333 ** [sqlite3_reset(S)] returns an appropriate [error code].
4334 **
4335 ** ^The [sqlite3_reset(S)] interface does not change the values
4336 ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
4337 */
4338 SQLITE_API int SQLITE_APICALL sqlite3_reset(sqlite3_stmt *pStmt);
4339
4340 /*
4341 ** CAPI3REF: Create Or Redefine SQL Functions
4342 ** KEYWORDS: {function creation routines}
4343 ** KEYWORDS: {application-defined SQL function}
@@ -4433,40 +4433,40 @@
4433 ** ^An application-defined function is permitted to call other
4434 ** SQLite interfaces. However, such calls must not
4435 ** close the database connection nor finalize or reset the prepared
4436 ** statement in which the function is running.
4437 */
4438 SQLITE_API int SQLITE_APICALL sqlite3_create_function(
4439 sqlite3 *db,
4440 const char *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_function16(
4449 sqlite3 *db,
4450 const void *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 );
4458 SQLITE_API int SQLITE_APICALL sqlite3_create_function_v2(
4459 sqlite3 *db,
4460 const char *zFunctionName,
4461 int nArg,
4462 int eTextRep,
4463 void *pApp,
4464 void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**),
4465 void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**),
4466 void (SQLITE_CALLBACK *xFinal)(sqlite3_context*),
4467 void(SQLITE_CALLBACK *xDestroy)(void*)
4468 );
4469
4470 /*
4471 ** CAPI3REF: Text Encodings
4472 **
@@ -4499,16 +4499,16 @@
4499 ** to be supported. However, new applications should avoid
4500 ** the use of these functions. To encourage programmers to avoid
4501 ** these functions, we will not explain what they do.
4502 */
4503 #ifndef SQLITE_OMIT_DEPRECATED
4504 SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_aggregate_count(sqlite3_context*);
4505 SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_expired(sqlite3_stmt*);
4506 SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4507 SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_global_recover(void);
4508 SQLITE_API SQLITE_DEPRECATED void SQLITE_APICALL sqlite3_thread_cleanup(void);
4509 SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_memory_alarm(void(SQLITE_CALLBACK *)(void*,sqlite3_int64,int),
4510 void*,sqlite3_int64);
4511 #endif
4512
4513 /*
4514 ** CAPI3REF: Obtaining SQL Values
@@ -4554,22 +4554,22 @@
4554 ** or [sqlite3_value_text16()].
4555 **
4556 ** These routines must be called from the same thread as
4557 ** the SQL function that supplied the [sqlite3_value*] parameters.
4558 */
4559 SQLITE_API const void *SQLITE_APICALL sqlite3_value_blob(sqlite3_value*);
4560 SQLITE_API int SQLITE_APICALL sqlite3_value_bytes(sqlite3_value*);
4561 SQLITE_API int SQLITE_APICALL sqlite3_value_bytes16(sqlite3_value*);
4562 SQLITE_API double SQLITE_APICALL sqlite3_value_double(sqlite3_value*);
4563 SQLITE_API int SQLITE_APICALL sqlite3_value_int(sqlite3_value*);
4564 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_value_int64(sqlite3_value*);
4565 SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_value_text(sqlite3_value*);
4566 SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16(sqlite3_value*);
4567 SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16le(sqlite3_value*);
4568 SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16be(sqlite3_value*);
4569 SQLITE_API int SQLITE_APICALL sqlite3_value_type(sqlite3_value*);
4570 SQLITE_API int SQLITE_APICALL sqlite3_value_numeric_type(sqlite3_value*);
4571
4572 /*
4573 ** CAPI3REF: Finding The Subtype Of SQL Values
4574 ** METHOD: sqlite3_value
4575 **
@@ -4581,11 +4581,11 @@
4581 **
4582 ** SQLite makes no use of subtype itself. It merely passes the subtype
4583 ** from the result of one [application-defined SQL function] into the
4584 ** input of another.
4585 */
4586 SQLITE_API unsigned int SQLITE_APICALL sqlite3_value_subtype(sqlite3_value*);
4587
4588 /*
4589 ** CAPI3REF: Copy And Free SQL Values
4590 ** METHOD: sqlite3_value
4591 **
@@ -4597,12 +4597,12 @@
4597 **
4598 ** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object
4599 ** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer
4600 ** then sqlite3_value_free(V) is a harmless no-op.
4601 */
4602 SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_value_dup(const sqlite3_value*);
4603 SQLITE_API void SQLITE_APICALL sqlite3_value_free(sqlite3_value*);
4604
4605 /*
4606 ** CAPI3REF: Obtain Aggregate Function Context
4607 ** METHOD: sqlite3_context
4608 **
@@ -4643,11 +4643,11 @@
4643 ** function.
4644 **
4645 ** This routine must be called from the same thread in which
4646 ** the aggregate SQL function is running.
4647 */
4648 SQLITE_API void *SQLITE_APICALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
4649
4650 /*
4651 ** CAPI3REF: User Data For Functions
4652 ** METHOD: sqlite3_context
4653 **
@@ -4658,11 +4658,11 @@
4658 ** registered the application defined function.
4659 **
4660 ** This routine must be called from the same thread in which
4661 ** the application-defined function is running.
4662 */
4663 SQLITE_API void *SQLITE_APICALL sqlite3_user_data(sqlite3_context*);
4664
4665 /*
4666 ** CAPI3REF: Database Connection For Functions
4667 ** METHOD: sqlite3_context
4668 **
@@ -4670,11 +4670,11 @@
4670 ** the pointer to the [database connection] (the 1st parameter)
4671 ** of the [sqlite3_create_function()]
4672 ** and [sqlite3_create_function16()] routines that originally
4673 ** registered the application defined function.
4674 */
4675 SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_context_db_handle(sqlite3_context*);
4676
4677 /*
4678 ** CAPI3REF: Function Auxiliary Data
4679 ** METHOD: sqlite3_context
4680 **
@@ -4702,16 +4702,17 @@
4702 ** NULL if the metadata has been discarded.
4703 ** ^After each call to sqlite3_set_auxdata(C,N,P,X) where X is not NULL,
4704 ** SQLite will invoke the destructor function X with parameter P exactly
4705 ** once, when the metadata is discarded.
4706 ** SQLite is free to discard the metadata at any time, including: <ul>
4707 ** <li> when the corresponding function parameter changes, or
4708 ** <li> when [sqlite3_reset()] or [sqlite3_finalize()] is called for the
4709 ** SQL statement, or
4710 ** <li> when sqlite3_set_auxdata() is invoked again on the same parameter, or
4711 ** <li> during the original sqlite3_set_auxdata() call when a memory
4712 ** allocation error occurs. </ul>)^
 
4713 **
4714 ** Note the last bullet in particular. The destructor X in
4715 ** sqlite3_set_auxdata(C,N,P,X) might be called immediately, before the
4716 ** sqlite3_set_auxdata() interface even returns. Hence sqlite3_set_auxdata()
4717 ** should be called near the end of the function implementation and the
@@ -4723,12 +4724,12 @@
4723 ** values and [parameters] and expressions composed from the same.)^
4724 **
4725 ** These routines must be called from the same thread in which
4726 ** the SQL function is running.
4727 */
4728 SQLITE_API void *SQLITE_APICALL sqlite3_get_auxdata(sqlite3_context*, int N);
4729 SQLITE_API void SQLITE_APICALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (SQLITE_CALLBACK *)(void*));
4730
4731
4732 /*
4733 ** CAPI3REF: Constants Defining Special Destructor Behavior
4734 **
@@ -4741,11 +4742,11 @@
4741 ** the content before returning.
4742 **
4743 ** The typedef is necessary to work around problems in certain
4744 ** C++ compilers.
4745 */
4746 typedef void (SQLITE_CALLBACK *sqlite3_destructor_type)(void*);
4747 #define SQLITE_STATIC ((sqlite3_destructor_type)0)
4748 #define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1)
4749
4750 /*
4751 ** CAPI3REF: Setting The Result Of An SQL Function
@@ -4860,31 +4861,31 @@
4860 **
4861 ** If these routines are called from within the different thread
4862 ** than the one containing the application-defined function that received
4863 ** the [sqlite3_context] pointer, the results are undefined.
4864 */
4865 SQLITE_API void SQLITE_APICALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(SQLITE_CALLBACK *)(void*));
4866 SQLITE_API void SQLITE_APICALL sqlite3_result_blob64(sqlite3_context*,const void*,
4867 sqlite3_uint64,void(SQLITE_CALLBACK *)(void*));
4868 SQLITE_API void SQLITE_APICALL sqlite3_result_double(sqlite3_context*, double);
4869 SQLITE_API void SQLITE_APICALL sqlite3_result_error(sqlite3_context*, const char*, int);
4870 SQLITE_API void SQLITE_APICALL sqlite3_result_error16(sqlite3_context*, const void*, int);
4871 SQLITE_API void SQLITE_APICALL sqlite3_result_error_toobig(sqlite3_context*);
4872 SQLITE_API void SQLITE_APICALL sqlite3_result_error_nomem(sqlite3_context*);
4873 SQLITE_API void SQLITE_APICALL sqlite3_result_error_code(sqlite3_context*, int);
4874 SQLITE_API void SQLITE_APICALL sqlite3_result_int(sqlite3_context*, int);
4875 SQLITE_API void SQLITE_APICALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
4876 SQLITE_API void SQLITE_APICALL sqlite3_result_null(sqlite3_context*);
4877 SQLITE_API void SQLITE_APICALL sqlite3_result_text(sqlite3_context*, const char*, int, void(SQLITE_CALLBACK *)(void*));
4878 SQLITE_API void SQLITE_APICALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
4879 void(SQLITE_CALLBACK *)(void*), unsigned char encoding);
4880 SQLITE_API void SQLITE_APICALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(SQLITE_CALLBACK *)(void*));
4881 SQLITE_API void SQLITE_APICALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(SQLITE_CALLBACK *)(void*));
4882 SQLITE_API void SQLITE_APICALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(SQLITE_CALLBACK *)(void*));
4883 SQLITE_API void SQLITE_APICALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
4884 SQLITE_API void SQLITE_APICALL sqlite3_result_zeroblob(sqlite3_context*, int n);
4885 SQLITE_API int SQLITE_APICALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
4886
4887
4888 /*
4889 ** CAPI3REF: Setting The Subtype Of An SQL Function
4890 ** METHOD: sqlite3_context
@@ -4895,11 +4896,11 @@
4895 ** of the subtype T are preserved in current versions of SQLite;
4896 ** higher order bits are discarded.
4897 ** The number of subtype bytes preserved by SQLite might increase
4898 ** in future releases of SQLite.
4899 */
4900 SQLITE_API void SQLITE_APICALL sqlite3_result_subtype(sqlite3_context*,unsigned int);
4901
4902 /*
4903 ** CAPI3REF: Define New Collating Sequences
4904 ** METHOD: sqlite3
4905 **
@@ -4977,31 +4978,31 @@
4977 ** is unfortunate but cannot be changed without breaking backwards
4978 ** compatibility.
4979 **
4980 ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].
4981 */
4982 SQLITE_API int SQLITE_APICALL sqlite3_create_collation(
4983 sqlite3*,
4984 const char *zName,
4985 int eTextRep,
4986 void *pArg,
4987 int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*)
4988 );
4989 SQLITE_API int SQLITE_APICALL sqlite3_create_collation_v2(
4990 sqlite3*,
4991 const char *zName,
4992 int eTextRep,
4993 void *pArg,
4994 int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*),
4995 void(SQLITE_CALLBACK *xDestroy)(void*)
4996 );
4997 SQLITE_API int SQLITE_APICALL sqlite3_create_collation16(
4998 sqlite3*,
4999 const void *zName,
5000 int eTextRep,
5001 void *pArg,
5002 int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*)
5003 );
5004
5005 /*
5006 ** CAPI3REF: Collation Needed Callbacks
5007 ** METHOD: sqlite3
@@ -5027,19 +5028,19 @@
5027 **
5028 ** The callback function should register the desired collation using
5029 ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or
5030 ** [sqlite3_create_collation_v2()].
5031 */
5032 SQLITE_API int SQLITE_APICALL sqlite3_collation_needed(
5033 sqlite3*,
5034 void*,
5035 void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const char*)
5036 );
5037 SQLITE_API int SQLITE_APICALL sqlite3_collation_needed16(
5038 sqlite3*,
5039 void*,
5040 void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const void*)
5041 );
5042
5043 #ifdef SQLITE_HAS_CODEC
5044 /*
5045 ** Specify the key for an encrypted database. This routine should be
@@ -5046,15 +5047,15 @@
5046 ** called right after sqlite3_open().
5047 **
5048 ** The code to implement this API is not available in the public release
5049 ** of SQLite.
5050 */
5051 SQLITE_API int SQLITE_APICALL sqlite3_key(
5052 sqlite3 *db, /* Database to be rekeyed */
5053 const void *pKey, int nKey /* The key */
5054 );
5055 SQLITE_API int SQLITE_APICALL sqlite3_key_v2(
5056 sqlite3 *db, /* Database to be rekeyed */
5057 const char *zDbName, /* Name of the database */
5058 const void *pKey, int nKey /* The key */
5059 );
5060
@@ -5064,35 +5065,35 @@
5064 ** database is decrypted.
5065 **
5066 ** The code to implement this API is not available in the public release
5067 ** of SQLite.
5068 */
5069 SQLITE_API int SQLITE_APICALL sqlite3_rekey(
5070 sqlite3 *db, /* Database to be rekeyed */
5071 const void *pKey, int nKey /* The new key */
5072 );
5073 SQLITE_API int SQLITE_APICALL sqlite3_rekey_v2(
5074 sqlite3 *db, /* Database to be rekeyed */
5075 const char *zDbName, /* Name of the database */
5076 const void *pKey, int nKey /* The new key */
5077 );
5078
5079 /*
5080 ** Specify the activation key for a SEE database. Unless
5081 ** activated, none of the SEE routines will work.
5082 */
5083 SQLITE_API void SQLITE_APICALL sqlite3_activate_see(
5084 const char *zPassPhrase /* Activation phrase */
5085 );
5086 #endif
5087
5088 #ifdef SQLITE_ENABLE_CEROD
5089 /*
5090 ** Specify the activation key for a CEROD database. Unless
5091 ** activated, none of the CEROD routines will work.
5092 */
5093 SQLITE_API void SQLITE_APICALL sqlite3_activate_cerod(
5094 const char *zPassPhrase /* Activation phrase */
5095 );
5096 #endif
5097
5098 /*
@@ -5110,11 +5111,11 @@
5110 ** method of the default [sqlite3_vfs] object. If the xSleep() method
5111 ** of the default VFS is not implemented correctly, or not implemented at
5112 ** all, then the behavior of sqlite3_sleep() may deviate from the description
5113 ** in the previous paragraphs.
5114 */
5115 SQLITE_API int SQLITE_APICALL sqlite3_sleep(int);
5116
5117 /*
5118 ** CAPI3REF: Name Of The Folder Holding Temporary Files
5119 **
5120 ** ^(If this global variable is made to point to a string which is
@@ -5229,11 +5230,11 @@
5229 **
5230 ** If another thread changes the autocommit status of the database
5231 ** connection while this routine is running, then the return value
5232 ** is undefined.
5233 */
5234 SQLITE_API int SQLITE_APICALL sqlite3_get_autocommit(sqlite3*);
5235
5236 /*
5237 ** CAPI3REF: Find The Database Handle Of A Prepared Statement
5238 ** METHOD: sqlite3_stmt
5239 **
@@ -5242,11 +5243,11 @@
5242 ** returned by sqlite3_db_handle is the same [database connection]
5243 ** that was the first argument
5244 ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
5245 ** create the statement in the first place.
5246 */
5247 SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_db_handle(sqlite3_stmt*);
5248
5249 /*
5250 ** CAPI3REF: Return The Filename For A Database Connection
5251 ** METHOD: sqlite3
5252 **
@@ -5259,21 +5260,21 @@
5259 ** ^The filename returned by this function is the output of the
5260 ** xFullPathname method of the [VFS]. ^In other words, the filename
5261 ** will be an absolute pathname, even if the filename used
5262 ** to open the database originally was a URI or relative pathname.
5263 */
5264 SQLITE_API const char *SQLITE_APICALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
5265
5266 /*
5267 ** CAPI3REF: Determine if a database is read-only
5268 ** METHOD: sqlite3
5269 **
5270 ** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N
5271 ** of connection D is read-only, 0 if it is read/write, or -1 if N is not
5272 ** the name of a database on connection D.
5273 */
5274 SQLITE_API int SQLITE_APICALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
5275
5276 /*
5277 ** CAPI3REF: Find the next prepared statement
5278 ** METHOD: sqlite3
5279 **
@@ -5285,11 +5286,11 @@
5285 **
5286 ** The [database connection] pointer D in a call to
5287 ** [sqlite3_next_stmt(D,S)] must refer to an open database
5288 ** connection and in particular must not be a NULL pointer.
5289 */
5290 SQLITE_API sqlite3_stmt *SQLITE_APICALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
5291
5292 /*
5293 ** CAPI3REF: Commit And Rollback Notification Callbacks
5294 ** METHOD: sqlite3
5295 **
@@ -5334,12 +5335,12 @@
5334 ** ^The rollback callback is not invoked if a transaction is
5335 ** automatically rolled back because the database connection is closed.
5336 **
5337 ** See also the [sqlite3_update_hook()] interface.
5338 */
5339 SQLITE_API void *SQLITE_APICALL sqlite3_commit_hook(sqlite3*, int(SQLITE_CALLBACK *)(void*), void*);
5340 SQLITE_API void *SQLITE_APICALL sqlite3_rollback_hook(sqlite3*, void(SQLITE_CALLBACK *)(void *), void*);
5341
5342 /*
5343 ** CAPI3REF: Data Change Notification Callbacks
5344 ** METHOD: sqlite3
5345 **
@@ -5386,13 +5387,13 @@
5386 ** the first call on D.
5387 **
5388 ** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()],
5389 ** and [sqlite3_preupdate_hook()] interfaces.
5390 */
5391 SQLITE_API void *SQLITE_APICALL sqlite3_update_hook(
5392 sqlite3*,
5393 void(SQLITE_CALLBACK *)(void *,int ,char const *,char const *,sqlite3_int64),
5394 void*
5395 );
5396
5397 /*
5398 ** CAPI3REF: Enable Or Disable Shared Pager Cache
@@ -5426,11 +5427,11 @@
5426 ** This interface is threadsafe on processors where writing a
5427 ** 32-bit integer is atomic.
5428 **
5429 ** See Also: [SQLite Shared-Cache Mode]
5430 */
5431 SQLITE_API int SQLITE_APICALL sqlite3_enable_shared_cache(int);
5432
5433 /*
5434 ** CAPI3REF: Attempt To Free Heap Memory
5435 **
5436 ** ^The sqlite3_release_memory() interface attempts to free N bytes
@@ -5442,11 +5443,11 @@
5442 ** ^The sqlite3_release_memory() routine is a no-op returning zero
5443 ** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5444 **
5445 ** See also: [sqlite3_db_release_memory()]
5446 */
5447 SQLITE_API int SQLITE_APICALL sqlite3_release_memory(int);
5448
5449 /*
5450 ** CAPI3REF: Free Memory Used By A Database Connection
5451 ** METHOD: sqlite3
5452 **
@@ -5456,11 +5457,11 @@
5456 ** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
5457 ** omitted.
5458 **
5459 ** See also: [sqlite3_release_memory()]
5460 */
5461 SQLITE_API int SQLITE_APICALL sqlite3_db_release_memory(sqlite3*);
5462
5463 /*
5464 ** CAPI3REF: Impose A Limit On Heap Size
5465 **
5466 ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the
@@ -5508,11 +5509,11 @@
5508 ** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5509 **
5510 ** The circumstances under which SQLite will enforce the soft heap limit may
5511 ** changes in future releases of SQLite.
5512 */
5513 SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
5514
5515 /*
5516 ** CAPI3REF: Deprecated Soft Heap Limit Interface
5517 ** DEPRECATED
5518 **
@@ -5519,11 +5520,11 @@
5519 ** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
5520 ** interface. This routine is provided for historical compatibility
5521 ** only. All new applications should use the
5522 ** [sqlite3_soft_heap_limit64()] interface rather than this one.
5523 */
5524 SQLITE_API SQLITE_DEPRECATED void SQLITE_APICALL sqlite3_soft_heap_limit(int N);
5525
5526
5527 /*
5528 ** CAPI3REF: Extract Metadata About A Column Of A Table
5529 ** METHOD: sqlite3
@@ -5589,11 +5590,11 @@
5589 **
5590 ** ^This function causes all database schemas to be read from disk and
5591 ** parsed, if that has not already been done, and returns an error if
5592 ** any errors are encountered while loading the schema.
5593 */
5594 SQLITE_API int SQLITE_APICALL sqlite3_table_column_metadata(
5595 sqlite3 *db, /* Connection handle */
5596 const char *zDbName, /* Database name or NULL */
5597 const char *zTableName, /* Table name */
5598 const char *zColumnName, /* Column name */
5599 char const **pzDataType, /* OUTPUT: Declared data type */
@@ -5645,11 +5646,11 @@
5645 ** disabled and prevent SQL injections from giving attackers
5646 ** access to extension loading capabilities.
5647 **
5648 ** See also the [load_extension() SQL function].
5649 */
5650 SQLITE_API int SQLITE_APICALL sqlite3_load_extension(
5651 sqlite3 *db, /* Load the extension into this database connection */
5652 const char *zFile, /* Name of the shared library containing extension */
5653 const char *zProc, /* Entry point. Derived from zFile if 0 */
5654 char **pzErrMsg /* Put error message here if not 0 */
5655 );
@@ -5668,20 +5669,20 @@
5668 ** to turn extension loading on and call it with onoff==0 to turn
5669 ** it back off again.
5670 **
5671 ** ^This interface enables or disables both the C-API
5672 ** [sqlite3_load_extension()] and the SQL function [load_extension()].
5673 ** Use [sqlite3_db_config](db,[SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION],..)
5674 ** to enable or disable only the C-API.
5675 **
5676 ** <b>Security warning:</b> It is recommended that extension loading
5677 ** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method
5678 ** rather than this interface, so the [load_extension()] SQL function
5679 ** remains disabled. This will prevent SQL injections from giving attackers
5680 ** access to extension loading capabilities.
5681 */
5682 SQLITE_API int SQLITE_APICALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
5683
5684 /*
5685 ** CAPI3REF: Automatically Load Statically Linked Extensions
5686 **
5687 ** ^This interface causes the xEntryPoint() function to be invoked for
@@ -5715,11 +5716,11 @@
5715 ** will be called more than once for each database connection that is opened.
5716 **
5717 ** See also: [sqlite3_reset_auto_extension()]
5718 ** and [sqlite3_cancel_auto_extension()]
5719 */
5720 SQLITE_API int SQLITE_APICALL sqlite3_auto_extension(void(SQLITE_CALLBACK *xEntryPoint)(void));
5721
5722 /*
5723 ** CAPI3REF: Cancel Automatic Extension Loading
5724 **
5725 ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
@@ -5727,19 +5728,19 @@
5727 ** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)]
5728 ** routine returns 1 if initialization routine X was successfully
5729 ** unregistered and it returns 0 if X was not on the list of initialization
5730 ** routines.
5731 */
5732 SQLITE_API int SQLITE_APICALL sqlite3_cancel_auto_extension(void(SQLITE_CALLBACK *xEntryPoint)(void));
5733
5734 /*
5735 ** CAPI3REF: Reset Automatic Extension Loading
5736 **
5737 ** ^This interface disables all automatic extensions previously
5738 ** registered using [sqlite3_auto_extension()].
5739 */
5740 SQLITE_API void SQLITE_APICALL sqlite3_reset_auto_extension(void);
5741
5742 /*
5743 ** The interface to the virtual-table mechanism is currently considered
5744 ** to be experimental. The interface might change in incompatible ways.
5745 ** If this is a problem for you, do not use the interface at this time.
@@ -5772,41 +5773,41 @@
5772 ** of this structure must not change while it is registered with
5773 ** any database connection.
5774 */
5775 struct sqlite3_module {
5776 int iVersion;
5777 int (SQLITE_CALLBACK *xCreate)(sqlite3*, void *pAux,
5778 int argc, const char *const*argv,
5779 sqlite3_vtab **ppVTab, char**);
5780 int (SQLITE_CALLBACK *xConnect)(sqlite3*, void *pAux,
5781 int argc, const char *const*argv,
5782 sqlite3_vtab **ppVTab, char**);
5783 int (SQLITE_CALLBACK *xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
5784 int (SQLITE_CALLBACK *xDisconnect)(sqlite3_vtab *pVTab);
5785 int (SQLITE_CALLBACK *xDestroy)(sqlite3_vtab *pVTab);
5786 int (SQLITE_CALLBACK *xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);
5787 int (SQLITE_CALLBACK *xClose)(sqlite3_vtab_cursor*);
5788 int (SQLITE_CALLBACK *xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
5789 int argc, sqlite3_value **argv);
5790 int (SQLITE_CALLBACK *xNext)(sqlite3_vtab_cursor*);
5791 int (SQLITE_CALLBACK *xEof)(sqlite3_vtab_cursor*);
5792 int (SQLITE_CALLBACK *xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int);
5793 int (SQLITE_CALLBACK *xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid);
5794 int (SQLITE_CALLBACK *xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *);
5795 int (SQLITE_CALLBACK *xBegin)(sqlite3_vtab *pVTab);
5796 int (SQLITE_CALLBACK *xSync)(sqlite3_vtab *pVTab);
5797 int (SQLITE_CALLBACK *xCommit)(sqlite3_vtab *pVTab);
5798 int (SQLITE_CALLBACK *xRollback)(sqlite3_vtab *pVTab);
5799 int (SQLITE_CALLBACK *xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,
5800 void (SQLITE_CALLBACK **pxFunc)(sqlite3_context*,int,sqlite3_value**),
5801 void **ppArg);
5802 int (SQLITE_CALLBACK *xRename)(sqlite3_vtab *pVtab, const char *zNew);
5803 /* The methods above are in version 1 of the sqlite_module object. Those
5804 ** below are for version 2 and greater. */
5805 int (SQLITE_CALLBACK *xSavepoint)(sqlite3_vtab *pVTab, int);
5806 int (SQLITE_CALLBACK *xRelease)(sqlite3_vtab *pVTab, int);
5807 int (SQLITE_CALLBACK *xRollbackTo)(sqlite3_vtab *pVTab, int);
5808 };
5809
5810 /*
5811 ** CAPI3REF: Virtual Table Indexing Information
5812 ** KEYWORDS: sqlite3_index_info
@@ -5980,22 +5981,22 @@
5980 ** be invoked if the call to sqlite3_create_module_v2() fails.
5981 ** ^The sqlite3_create_module()
5982 ** interface is equivalent to sqlite3_create_module_v2() with a NULL
5983 ** destructor.
5984 */
5985 SQLITE_API int SQLITE_APICALL sqlite3_create_module(
5986 sqlite3 *db, /* SQLite connection to register module with */
5987 const char *zName, /* Name of the module */
5988 const sqlite3_module *p, /* Methods for the module */
5989 void *pClientData /* Client data for xCreate/xConnect */
5990 );
5991 SQLITE_API int SQLITE_APICALL sqlite3_create_module_v2(
5992 sqlite3 *db, /* SQLite connection to register module with */
5993 const char *zName, /* Name of the module */
5994 const sqlite3_module *p, /* Methods for the module */
5995 void *pClientData, /* Client data for xCreate/xConnect */
5996 void(SQLITE_CALLBACK *xDestroy)(void*) /* Module destructor function */
5997 );
5998
5999 /*
6000 ** CAPI3REF: Virtual Table Instance Object
6001 ** KEYWORDS: sqlite3_vtab
@@ -6049,11 +6050,11 @@
6049 ** ^The [xCreate] and [xConnect] methods of a
6050 ** [virtual table module] call this interface
6051 ** to declare the format (the names and datatypes of the columns) of
6052 ** the virtual tables they implement.
6053 */
6054 SQLITE_API int SQLITE_APICALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
6055
6056 /*
6057 ** CAPI3REF: Overload A Function For A Virtual Table
6058 ** METHOD: sqlite3
6059 **
@@ -6068,11 +6069,11 @@
6068 ** of the new function always causes an exception to be thrown. So
6069 ** the new function is not good for anything by itself. Its only
6070 ** purpose is to be a placeholder function that can be overloaded
6071 ** by a [virtual table].
6072 */
6073 SQLITE_API int SQLITE_APICALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
6074
6075 /*
6076 ** The interface to the virtual-table mechanism defined above (back up
6077 ** to a comment remarkably similar to this one) is currently considered
6078 ** to be experimental. The interface might change in incompatible ways.
@@ -6167,11 +6168,11 @@
6167 ** zero-filled blob to read or write using the incremental-blob interface.
6168 **
6169 ** To avoid a resource leak, every open [BLOB handle] should eventually
6170 ** be released by a call to [sqlite3_blob_close()].
6171 */
6172 SQLITE_API int SQLITE_APICALL sqlite3_blob_open(
6173 sqlite3*,
6174 const char *zDb,
6175 const char *zTable,
6176 const char *zColumn,
6177 sqlite3_int64 iRow,
@@ -6200,11 +6201,11 @@
6200 ** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
6201 ** always returns zero.
6202 **
6203 ** ^This function sets the database handle error code and message.
6204 */
6205 SQLITE_API int SQLITE_APICALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
6206
6207 /*
6208 ** CAPI3REF: Close A BLOB Handle
6209 ** DESTRUCTOR: sqlite3_blob
6210 **
@@ -6223,11 +6224,11 @@
6223 ** with a null pointer (such as would be returned by a failed call to
6224 ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function
6225 ** is passed a valid open blob handle, the values returned by the
6226 ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning.
6227 */
6228 SQLITE_API int SQLITE_APICALL sqlite3_blob_close(sqlite3_blob *);
6229
6230 /*
6231 ** CAPI3REF: Return The Size Of An Open BLOB
6232 ** METHOD: sqlite3_blob
6233 **
@@ -6239,11 +6240,11 @@
6239 ** This routine only works on a [BLOB handle] which has been created
6240 ** by a prior successful call to [sqlite3_blob_open()] and which has not
6241 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6242 ** to this routine results in undefined and probably undesirable behavior.
6243 */
6244 SQLITE_API int SQLITE_APICALL sqlite3_blob_bytes(sqlite3_blob *);
6245
6246 /*
6247 ** CAPI3REF: Read Data From A BLOB Incrementally
6248 ** METHOD: sqlite3_blob
6249 **
@@ -6268,11 +6269,11 @@
6268 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6269 ** to this routine results in undefined and probably undesirable behavior.
6270 **
6271 ** See also: [sqlite3_blob_write()].
6272 */
6273 SQLITE_API int SQLITE_APICALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
6274
6275 /*
6276 ** CAPI3REF: Write Data Into A BLOB Incrementally
6277 ** METHOD: sqlite3_blob
6278 **
@@ -6310,11 +6311,11 @@
6310 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6311 ** to this routine results in undefined and probably undesirable behavior.
6312 **
6313 ** See also: [sqlite3_blob_read()].
6314 */
6315 SQLITE_API int SQLITE_APICALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
6316
6317 /*
6318 ** CAPI3REF: Virtual File System Objects
6319 **
6320 ** A virtual filesystem (VFS) is an [sqlite3_vfs] object
@@ -6341,13 +6342,13 @@
6341 **
6342 ** ^Unregister a VFS with the sqlite3_vfs_unregister() interface.
6343 ** ^(If the default VFS is unregistered, another VFS is chosen as
6344 ** the default. The choice for the new VFS is arbitrary.)^
6345 */
6346 SQLITE_API sqlite3_vfs *SQLITE_APICALL sqlite3_vfs_find(const char *zVfsName);
6347 SQLITE_API int SQLITE_APICALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
6348 SQLITE_API int SQLITE_APICALL sqlite3_vfs_unregister(sqlite3_vfs*);
6349
6350 /*
6351 ** CAPI3REF: Mutexes
6352 **
6353 ** The SQLite core uses these routines for thread
@@ -6459,15 +6460,15 @@
6459 ** sqlite3_mutex_leave() is a NULL pointer, then all three routines
6460 ** behave as no-ops.
6461 **
6462 ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
6463 */
6464 SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_mutex_alloc(int);
6465 SQLITE_API void SQLITE_APICALL sqlite3_mutex_free(sqlite3_mutex*);
6466 SQLITE_API void SQLITE_APICALL sqlite3_mutex_enter(sqlite3_mutex*);
6467 SQLITE_API int SQLITE_APICALL sqlite3_mutex_try(sqlite3_mutex*);
6468 SQLITE_API void SQLITE_APICALL sqlite3_mutex_leave(sqlite3_mutex*);
6469
6470 /*
6471 ** CAPI3REF: Mutex Methods Object
6472 **
6473 ** An instance of this structure defines the low-level routines
@@ -6532,19 +6533,19 @@
6532 ** If xMutexInit fails in any way, it is expected to clean up after itself
6533 ** prior to returning.
6534 */
6535 typedef struct sqlite3_mutex_methods sqlite3_mutex_methods;
6536 struct sqlite3_mutex_methods {
6537 int (SQLITE_CALLBACK *xMutexInit)(void);
6538 int (SQLITE_CALLBACK *xMutexEnd)(void);
6539 sqlite3_mutex *(SQLITE_CALLBACK *xMutexAlloc)(int);
6540 void (SQLITE_CALLBACK *xMutexFree)(sqlite3_mutex *);
6541 void (SQLITE_CALLBACK *xMutexEnter)(sqlite3_mutex *);
6542 int (SQLITE_CALLBACK *xMutexTry)(sqlite3_mutex *);
6543 void (SQLITE_CALLBACK *xMutexLeave)(sqlite3_mutex *);
6544 int (SQLITE_CALLBACK *xMutexHeld)(sqlite3_mutex *);
6545 int (SQLITE_CALLBACK *xMutexNotheld)(sqlite3_mutex *);
6546 };
6547
6548 /*
6549 ** CAPI3REF: Mutex Verification Routines
6550 **
@@ -6573,12 +6574,12 @@
6573 ** call to sqlite3_mutex_held() to fail, so a non-zero return is
6574 ** the appropriate thing to do. The sqlite3_mutex_notheld()
6575 ** interface should also return 1 when given a NULL pointer.
6576 */
6577 #ifndef NDEBUG
6578 SQLITE_API int SQLITE_APICALL sqlite3_mutex_held(sqlite3_mutex*);
6579 SQLITE_API int SQLITE_APICALL sqlite3_mutex_notheld(sqlite3_mutex*);
6580 #endif
6581
6582 /*
6583 ** CAPI3REF: Mutex Types
6584 **
@@ -6614,11 +6615,11 @@
6614 ** serializes access to the [database connection] given in the argument
6615 ** when the [threading mode] is Serialized.
6616 ** ^If the [threading mode] is Single-thread or Multi-thread then this
6617 ** routine returns a NULL pointer.
6618 */
6619 SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_db_mutex(sqlite3*);
6620
6621 /*
6622 ** CAPI3REF: Low-Level Control Of Database Files
6623 ** METHOD: sqlite3
6624 **
@@ -6649,11 +6650,11 @@
6649 ** an incorrect zDbName and an SQLITE_ERROR return from the underlying
6650 ** xFileControl method.
6651 **
6652 ** See also: [SQLITE_FCNTL_LOCKSTATE]
6653 */
6654 SQLITE_API int SQLITE_APICALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
6655
6656 /*
6657 ** CAPI3REF: Testing Interface
6658 **
6659 ** ^The sqlite3_test_control() interface is used to read out internal
@@ -6731,12 +6732,12 @@
6731 ** be represented by a 32-bit integer, then the values returned by
6732 ** sqlite3_status() are undefined.
6733 **
6734 ** See also: [sqlite3_db_status()]
6735 */
6736 SQLITE_API int SQLITE_APICALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6737 SQLITE_API int SQLITE_APICALL sqlite3_status64(
6738 int op,
6739 sqlite3_int64 *pCurrent,
6740 sqlite3_int64 *pHighwater,
6741 int resetFlag
6742 );
@@ -6857,11 +6858,11 @@
6857 ** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a
6858 ** non-zero [error code] on failure.
6859 **
6860 ** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
6861 */
6862 SQLITE_API int SQLITE_APICALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
6863
6864 /*
6865 ** CAPI3REF: Status Parameters for database connections
6866 ** KEYWORDS: {SQLITE_DBSTATUS options}
6867 **
@@ -7000,11 +7001,11 @@
7000 ** ^If the resetFlg is true, then the counter is reset to zero after this
7001 ** interface call returns.
7002 **
7003 ** See also: [sqlite3_status()] and [sqlite3_db_status()].
7004 */
7005 SQLITE_API int SQLITE_APICALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
7006
7007 /*
7008 ** CAPI3REF: Status Parameters for prepared statements
7009 ** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters}
7010 **
@@ -7236,22 +7237,22 @@
7236 */
7237 typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2;
7238 struct sqlite3_pcache_methods2 {
7239 int iVersion;
7240 void *pArg;
7241 int (SQLITE_CALLBACK *xInit)(void*);
7242 void (SQLITE_CALLBACK *xShutdown)(void*);
7243 sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int szExtra, int bPurgeable);
7244 void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize);
7245 int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*);
7246 sqlite3_pcache_page *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7247 void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard);
7248 void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, sqlite3_pcache_page*,
7249 unsigned oldKey, unsigned newKey);
7250 void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit);
7251 void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*);
7252 void (SQLITE_CALLBACK *xShrink)(sqlite3_pcache*);
7253 };
7254
7255 /*
7256 ** This is the obsolete pcache_methods object that has now been replaced
7257 ** by sqlite3_pcache_methods2. This object is not used by SQLite. It is
@@ -7258,20 +7259,20 @@
7258 ** retained in the header file for backwards compatibility only.
7259 */
7260 typedef struct sqlite3_pcache_methods sqlite3_pcache_methods;
7261 struct sqlite3_pcache_methods {
7262 void *pArg;
7263 int (SQLITE_CALLBACK *xInit)(void*);
7264 void (SQLITE_CALLBACK *xShutdown)(void*);
7265 sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int bPurgeable);
7266 void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize);
7267 int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*);
7268 void *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7269 void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, void*, int discard);
7270 void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey);
7271 void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit);
7272 void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*);
7273 };
7274
7275
7276 /*
7277 ** CAPI3REF: Online Backup Object
@@ -7469,20 +7470,20 @@
7469 ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()
7470 ** APIs are not strictly speaking threadsafe. If they are invoked at the
7471 ** same time as another thread is invoking sqlite3_backup_step() it is
7472 ** possible that they return invalid values.
7473 */
7474 SQLITE_API sqlite3_backup *SQLITE_APICALL sqlite3_backup_init(
7475 sqlite3 *pDest, /* Destination database handle */
7476 const char *zDestName, /* Destination database name */
7477 sqlite3 *pSource, /* Source database handle */
7478 const char *zSourceName /* Source database name */
7479 );
7480 SQLITE_API int SQLITE_APICALL sqlite3_backup_step(sqlite3_backup *p, int nPage);
7481 SQLITE_API int SQLITE_APICALL sqlite3_backup_finish(sqlite3_backup *p);
7482 SQLITE_API int SQLITE_APICALL sqlite3_backup_remaining(sqlite3_backup *p);
7483 SQLITE_API int SQLITE_APICALL sqlite3_backup_pagecount(sqlite3_backup *p);
7484
7485 /*
7486 ** CAPI3REF: Unlock Notification
7487 ** METHOD: sqlite3
7488 **
@@ -7595,13 +7596,13 @@
7595 ** by an sqlite3_step() call. ^(If there is a blocking connection, then the
7596 ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in
7597 ** the special "DROP TABLE/INDEX" case, the extended error code is just
7598 ** SQLITE_LOCKED.)^
7599 */
7600 SQLITE_API int SQLITE_APICALL sqlite3_unlock_notify(
7601 sqlite3 *pBlocked, /* Waiting connection */
7602 void (SQLITE_CALLBACK *xNotify)(void **apArg, int nArg), /* Callback function to invoke */
7603 void *pNotifyArg /* Argument to pass to xNotify */
7604 );
7605
7606
7607 /*
@@ -7610,12 +7611,12 @@
7610 ** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications
7611 ** and extensions to compare the contents of two buffers containing UTF-8
7612 ** strings in a case-independent fashion, using the same definition of "case
7613 ** independence" that SQLite uses internally when comparing identifiers.
7614 */
7615 SQLITE_API int SQLITE_APICALL sqlite3_stricmp(const char *, const char *);
7616 SQLITE_API int SQLITE_APICALL sqlite3_strnicmp(const char *, const char *, int);
7617
7618 /*
7619 ** CAPI3REF: String Globbing
7620 *
7621 ** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if
@@ -7628,11 +7629,11 @@
7628 ** Note that this routine returns zero on a match and non-zero if the strings
7629 ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
7630 **
7631 ** See also: [sqlite3_strlike()].
7632 */
7633 SQLITE_API int SQLITE_APICALL sqlite3_strglob(const char *zGlob, const char *zStr);
7634
7635 /*
7636 ** CAPI3REF: String LIKE Matching
7637 *
7638 ** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if
@@ -7651,11 +7652,11 @@
7651 ** Note that this routine returns zero on a match and non-zero if the strings
7652 ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
7653 **
7654 ** See also: [sqlite3_strglob()].
7655 */
7656 SQLITE_API int SQLITE_APICALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
7657
7658 /*
7659 ** CAPI3REF: Error Logging Interface
7660 **
7661 ** ^The [sqlite3_log()] interface writes a message into the [error log]
@@ -7710,13 +7711,13 @@
7710 ** previously registered write-ahead log callback. ^Note that the
7711 ** [sqlite3_wal_autocheckpoint()] interface and the
7712 ** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will
7713 ** overwrite any prior [sqlite3_wal_hook()] settings.
7714 */
7715 SQLITE_API void *SQLITE_APICALL sqlite3_wal_hook(
7716 sqlite3*,
7717 int(SQLITE_CALLBACK *)(void *,sqlite3*,const char*,int),
7718 void*
7719 );
7720
7721 /*
7722 ** CAPI3REF: Configure an auto-checkpoint
@@ -7745,11 +7746,11 @@
7745 ** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]
7746 ** pages. The use of this interface
7747 ** is only necessary if the default setting is found to be suboptimal
7748 ** for a particular application.
7749 */
7750 SQLITE_API int SQLITE_APICALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
7751
7752 /*
7753 ** CAPI3REF: Checkpoint a database
7754 ** METHOD: sqlite3
7755 **
@@ -7767,11 +7768,11 @@
7767 ** interface was added. This interface is retained for backwards
7768 ** compatibility and as a convenience for applications that need to manually
7769 ** start a callback but which do not need the full power (and corresponding
7770 ** complication) of [sqlite3_wal_checkpoint_v2()].
7771 */
7772 SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
7773
7774 /*
7775 ** CAPI3REF: Checkpoint a database
7776 ** METHOD: sqlite3
7777 **
@@ -7861,11 +7862,11 @@
7861 ** [sqlite3_errcode()] and [sqlite3_errmsg()].
7862 **
7863 ** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface
7864 ** from SQL.
7865 */
7866 SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint_v2(
7867 sqlite3 *db, /* Database handle */
7868 const char *zDb, /* Name of attached database (or NULL) */
7869 int eMode, /* SQLITE_CHECKPOINT_* value */
7870 int *pnLog, /* OUT: Size of WAL log in frames */
7871 int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -7950,11 +7951,11 @@
7950 ** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL],
7951 ** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode
7952 ** of the SQL statement that triggered the call to the [xUpdate] method of the
7953 ** [virtual table].
7954 */
7955 SQLITE_API int SQLITE_APICALL sqlite3_vtab_on_conflict(sqlite3 *);
7956
7957 /*
7958 ** CAPI3REF: Conflict resolution modes
7959 ** KEYWORDS: {conflict resolution mode}
7960 **
@@ -8055,11 +8056,11 @@
8055 ** as if the loop did not exist - it returns non-zero and leave the variable
8056 ** that pOut points to unchanged.
8057 **
8058 ** See also: [sqlite3_stmt_scanstatus_reset()]
8059 */
8060 SQLITE_API int SQLITE_APICALL sqlite3_stmt_scanstatus(
8061 sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
8062 int idx, /* Index of loop to report on */
8063 int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
8064 void *pOut /* Result written here */
8065 );
@@ -8071,11 +8072,11 @@
8071 ** ^Zero all [sqlite3_stmt_scanstatus()] related event counters.
8072 **
8073 ** This API is only available if the library is built with pre-processor
8074 ** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined.
8075 */
8076 SQLITE_API void SQLITE_APICALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
8077
8078 /*
8079 ** CAPI3REF: Flush caches to disk mid-transaction
8080 **
8081 ** ^If a write-transaction is open on [database connection] D when the
@@ -8103,11 +8104,11 @@
8103 ** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK.
8104 **
8105 ** ^This function does not set the database handle error code or message
8106 ** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions.
8107 */
8108 SQLITE_API int SQLITE_APICALL sqlite3_db_cacheflush(sqlite3*);
8109
8110 /*
8111 ** CAPI3REF: The pre-update hook.
8112 **
8113 ** ^These interfaces are only available if SQLite is compiled using the
@@ -8183,13 +8184,13 @@
8183 ** triggers; or 2 for changes resulting from triggers called by top-level
8184 ** triggers; and so forth.
8185 **
8186 ** See also: [sqlite3_update_hook()]
8187 */
8188 SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_APICALL sqlite3_preupdate_hook(
8189 sqlite3 *db,
8190 void(SQLITE_CALLBACK *xPreUpdate)(
8191 void *pCtx, /* Copy of third arg to preupdate_hook() */
8192 sqlite3 *db, /* Database handle */
8193 int op, /* SQLITE_UPDATE, DELETE or INSERT */
8194 char const *zDb, /* Database name */
8195 char const *zName, /* Table name */
@@ -8196,14 +8197,14 @@
8196 sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */
8197 sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */
8198 ),
8199 void*
8200 );
8201 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **);
8202 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_count(sqlite3 *);
8203 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_depth(sqlite3 *);
8204 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **);
8205
8206 /*
8207 ** CAPI3REF: Low-level system error code
8208 **
8209 ** ^Attempt to return the underlying operating system error code or error
@@ -8211,11 +8212,11 @@
8211 ** The return value is OS-dependent. For example, on unix systems, after
8212 ** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be
8213 ** called to get back the underlying "errno" that caused the problem, such
8214 ** as ENOSPC, EAUTH, EISDIR, and so forth.
8215 */
8216 SQLITE_API int SQLITE_APICALL sqlite3_system_errno(sqlite3*);
8217
8218 /*
8219 ** CAPI3REF: Database Snapshot
8220 ** KEYWORDS: {snapshot}
8221 ** EXPERIMENTAL
@@ -8261,11 +8262,11 @@
8261 ** to avoid a memory leak.
8262 **
8263 ** The [sqlite3_snapshot_get()] interface is only available when the
8264 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8265 */
8266 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_get(
8267 sqlite3 *db,
8268 const char *zSchema,
8269 sqlite3_snapshot **ppSnapshot
8270 );
8271
@@ -8299,11 +8300,11 @@
8299 ** database connection in order to make it ready to use snapshots.)
8300 **
8301 ** The [sqlite3_snapshot_open()] interface is only available when the
8302 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8303 */
8304 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_open(
8305 sqlite3 *db,
8306 const char *zSchema,
8307 sqlite3_snapshot *pSnapshot
8308 );
8309
@@ -8316,11 +8317,11 @@
8316 ** using this routine to avoid a memory leak.
8317 **
8318 ** The [sqlite3_snapshot_free()] interface is only available when the
8319 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8320 */
8321 SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_APICALL sqlite3_snapshot_free(sqlite3_snapshot*);
8322
8323 /*
8324 ** CAPI3REF: Compare the ages of two snapshot handles.
8325 ** EXPERIMENTAL
8326 **
@@ -8340,11 +8341,11 @@
8340 **
8341 ** Otherwise, this API returns a negative value if P1 refers to an older
8342 ** snapshot than P2, zero if the two handles refer to the same database
8343 ** snapshot, and a positive value if P1 is a newer snapshot than P2.
8344 */
8345 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_cmp(
8346 sqlite3_snapshot *p1,
8347 sqlite3_snapshot *p2
8348 );
8349
8350 /*
@@ -8398,14 +8399,14 @@
8398 ** Register a geometry callback named zGeom that can be used as part of an
8399 ** R-Tree geometry query as follows:
8400 **
8401 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
8402 */
8403 SQLITE_API int SQLITE_APICALL sqlite3_rtree_geometry_callback(
8404 sqlite3 *db,
8405 const char *zGeom,
8406 int (SQLITE_CALLBACK *xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
8407 void *pContext
8408 );
8409
8410
8411 /*
@@ -8415,25 +8416,25 @@
8415 struct sqlite3_rtree_geometry {
8416 void *pContext; /* Copy of pContext passed to s_r_g_c() */
8417 int nParam; /* Size of array aParam[] */
8418 sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */
8419 void *pUser; /* Callback implementation user data */
8420 void (SQLITE_CALLBACK *xDelUser)(void *); /* Called by SQLite to clean up pUser */
8421 };
8422
8423 /*
8424 ** Register a 2nd-generation geometry callback named zScore that can be
8425 ** used as part of an R-Tree geometry query as follows:
8426 **
8427 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...)
8428 */
8429 SQLITE_API int SQLITE_APICALL sqlite3_rtree_query_callback(
8430 sqlite3 *db,
8431 const char *zQueryFunc,
8432 int (SQLITE_CALLBACK *xQueryFunc)(sqlite3_rtree_query_info*),
8433 void *pContext,
8434 void (SQLITE_CALLBACK *xDestructor)(void*)
8435 );
8436
8437
8438 /*
8439 ** A pointer to a structure of the following type is passed as the
@@ -8447,11 +8448,11 @@
8447 struct sqlite3_rtree_query_info {
8448 void *pContext; /* pContext from when function registered */
8449 int nParam; /* Number of function parameters */
8450 sqlite3_rtree_dbl *aParam; /* value of function parameters */
8451 void *pUser; /* callback can use this, if desired */
8452 void (SQLITE_CALLBACK *xDelUser)(void*); /* function to free pUser */
8453 sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */
8454 unsigned int *anQueue; /* Number of pending entries in the queue */
8455 int nCoord; /* Number of coordinates */
8456 int iLevel; /* Level of current node or entry */
8457 int mxLevel; /* The largest iLevel value in the tree */
@@ -8643,11 +8644,11 @@
8643 ** If xFilter returns 0, changes is not tracked. Note that once a table is
8644 ** attached, xFilter will not be called again.
8645 */
8646 void sqlite3session_table_filter(
8647 sqlite3_session *pSession, /* Session object */
8648 int(SQLITE_CALLBACK *xFilter)(
8649 void *pCtx, /* Copy of third arg to _filter_table() */
8650 const char *zTab /* Table name */
8651 ),
8652 void *pCtx /* First argument passed to xFilter */
8653 );
@@ -9218,11 +9219,11 @@
9218 ** An sqlite3_changegroup object is used to combine two or more changesets
9219 ** (or patchsets) into a single changeset (or patchset). A single changegroup
9220 ** object may combine changesets or patchsets, but not both. The output is
9221 ** always in the same format as the input.
9222 **
9223 ** If successful, this function returns SQLITE_OK and populates (SQLITE_CALLBACK *pp) with
9224 ** a pointer to a new sqlite3_changegroup object before returning. The caller
9225 ** should eventually free the returned object using a call to
9226 ** sqlite3changegroup_delete(). If an error occurs, an SQLite error code
9227 ** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL.
9228 **
@@ -9338,11 +9339,11 @@
9338 ** changes for tables that do not appear in the first changeset, they are
9339 ** appended onto the end of the output changeset, again in the order in
9340 ** which they are first encountered.
9341 **
9342 ** If an error occurs, an SQLite error code is returned and the output
9343 ** variables (SQLITE_CALLBACK *pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK
9344 ** is returned and the output variables are set to the size of and a
9345 ** pointer to the output buffer, respectively. In this case it is the
9346 ** responsibility of the caller to eventually free the buffer using a
9347 ** call to sqlite3_free().
9348 */
@@ -9495,15 +9496,15 @@
9495 */
9496 int sqlite3changeset_apply(
9497 sqlite3 *db, /* Apply change to "main" db of this handle */
9498 int nChangeset, /* Size of changeset in bytes */
9499 void *pChangeset, /* Changeset blob */
9500 int(SQLITE_CALLBACK *xFilter)(
9501 void *pCtx, /* Copy of sixth arg to _apply() */
9502 const char *zTab /* Table name */
9503 ),
9504 int(SQLITE_CALLBACK *xConflict)(
9505 void *pCtx, /* Copy of sixth arg to _apply() */
9506 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
9507 sqlite3_changeset_iter *p /* Handle describing change and conflict */
9508 ),
9509 void *pCtx /* First argument passed to xConflict */
@@ -9640,20 +9641,20 @@
9640 ** </pre>
9641 **
9642 ** Is replaced by:
9643 **
9644 ** <pre>
9645 ** &nbsp; int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
9646 ** &nbsp; void *pIn,
9647 ** </pre>
9648 **
9649 ** Each time the xInput callback is invoked by the sessions module, the first
9650 ** argument passed is a copy of the supplied pIn context pointer. The second
9651 ** argument, pData, points to a buffer (SQLITE_CALLBACK *pnData) bytes in size. Assuming no
9652 ** error occurs the xInput method should copy up to (SQLITE_CALLBACK *pnData) bytes of data
9653 ** into the buffer and set (SQLITE_CALLBACK *pnData) to the actual number of bytes copied
9654 ** before returning SQLITE_OK. If the input is completely exhausted, (SQLITE_CALLBACK *pnData)
9655 ** should be set to zero to indicate this. Or, if an error occurs, an SQLite
9656 ** error code should be returned. In all cases, if an xInput callback returns
9657 ** an error, all processing is abandoned and the streaming API function
9658 ** returns a copy of the error code to the caller.
9659 **
@@ -9674,11 +9675,11 @@
9674 ** </pre>
9675 **
9676 ** Is replaced by:
9677 **
9678 ** <pre>
9679 ** &nbsp; int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9680 ** &nbsp; void *pOut
9681 ** </pre>
9682 **
9683 ** The xOutput callback is invoked zero or more times to return data to
9684 ** the application. The first parameter passed to each call is a copy of the
@@ -9694,58 +9695,58 @@
9694 ** parameter set to a value less than or equal to zero. Other than this,
9695 ** no guarantees are made as to the size of the chunks of data returned.
9696 */
9697 int sqlite3changeset_apply_strm(
9698 sqlite3 *db, /* Apply change to "main" db of this handle */
9699 int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), /* Input function */
9700 void *pIn, /* First arg for xInput */
9701 int(SQLITE_CALLBACK *xFilter)(
9702 void *pCtx, /* Copy of sixth arg to _apply() */
9703 const char *zTab /* Table name */
9704 ),
9705 int(SQLITE_CALLBACK *xConflict)(
9706 void *pCtx, /* Copy of sixth arg to _apply() */
9707 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
9708 sqlite3_changeset_iter *p /* Handle describing change and conflict */
9709 ),
9710 void *pCtx /* First argument passed to xConflict */
9711 );
9712 int sqlite3changeset_concat_strm(
9713 int (SQLITE_CALLBACK *xInputA)(void *pIn, void *pData, int *pnData),
9714 void *pInA,
9715 int (SQLITE_CALLBACK *xInputB)(void *pIn, void *pData, int *pnData),
9716 void *pInB,
9717 int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9718 void *pOut
9719 );
9720 int sqlite3changeset_invert_strm(
9721 int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
9722 void *pIn,
9723 int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9724 void *pOut
9725 );
9726 int sqlite3changeset_start_strm(
9727 sqlite3_changeset_iter **pp,
9728 int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
9729 void *pIn
9730 );
9731 int sqlite3session_changeset_strm(
9732 sqlite3_session *pSession,
9733 int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9734 void *pOut
9735 );
9736 int sqlite3session_patchset_strm(
9737 sqlite3_session *pSession,
9738 int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9739 void *pOut
9740 );
9741 int sqlite3changegroup_add_strm(sqlite3_changegroup*,
9742 int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
9743 void *pIn
9744 );
9745 int sqlite3changegroup_output_strm(sqlite3_changegroup*,
9746 int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
9747 void *pOut
9748 );
9749
9750
9751 /*
@@ -9796,11 +9797,11 @@
9796
9797 typedef struct Fts5ExtensionApi Fts5ExtensionApi;
9798 typedef struct Fts5Context Fts5Context;
9799 typedef struct Fts5PhraseIter Fts5PhraseIter;
9800
9801 typedef void (SQLITE_CALLBACK *fts5_extension_function)(
9802 const Fts5ExtensionApi *pApi, /* API offered by current FTS version */
9803 Fts5Context *pFts, /* First arg to pass to pApi functions */
9804 sqlite3_context *pCtx, /* Context for returning result/error */
9805 int nVal, /* Number of values in apVal[] array */
9806 sqlite3_value **apVal /* Array of trailing arguments */
@@ -9847,15 +9848,15 @@
9847 ** This function may be quite inefficient if used with an FTS5 table
9848 ** created with the "columnsize=0" option.
9849 **
9850 ** xColumnText:
9851 ** This function attempts to retrieve the text of column iCol of the
9852 ** current document. If successful, (SQLITE_CALLBACK *pz) is set to point to a buffer
9853 ** containing the text in utf-8 encoding, (SQLITE_CALLBACK *pn) is set to the size in bytes
9854 ** (not characters) of the buffer and SQLITE_OK is returned. Otherwise,
9855 ** if an error occurs, an SQLite error code is returned and the final values
9856 ** of (SQLITE_CALLBACK *pz) and (*pn) are undefined.
9857 **
9858 ** xPhraseCount:
9859 ** Returns the number of phrases in the current query expression.
9860 **
9861 ** xPhraseSize:
@@ -9960,11 +9961,11 @@
9960 ** xRowCount(pFts5, pnRow)
9961 **
9962 ** This function is used to retrieve the total number of rows in the table.
9963 ** In other words, the same value that would be returned by:
9964 **
9965 ** SELECT count(SQLITE_CALLBACK *) FROM ftstable;
9966 **
9967 ** xPhraseFirst()
9968 ** This function is used, along with type Fts5PhraseIter and the xPhraseNext
9969 ** method, to iterate through all instances of a single query phrase within
9970 ** the current row. This is the same information as is accessible via the
@@ -10027,43 +10028,43 @@
10027 ** See xPhraseFirstColumn above.
10028 */
10029 struct Fts5ExtensionApi {
10030 int iVersion; /* Currently always set to 3 */
10031
10032 void *(SQLITE_CALLBACK *xUserData)(Fts5Context*);
10033
10034 int (SQLITE_CALLBACK *xColumnCount)(Fts5Context*);
10035 int (SQLITE_CALLBACK *xRowCount)(Fts5Context*, sqlite3_int64 *pnRow);
10036 int (SQLITE_CALLBACK *xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken);
10037
10038 int (SQLITE_CALLBACK *xTokenize)(Fts5Context*,
10039 const char *pText, int nText, /* Text to tokenize */
10040 void *pCtx, /* Context passed to xToken() */
10041 int (SQLITE_CALLBACK *xToken)(void*, int, const char*, int, int, int) /* Callback */
10042 );
10043
10044 int (SQLITE_CALLBACK *xPhraseCount)(Fts5Context*);
10045 int (SQLITE_CALLBACK *xPhraseSize)(Fts5Context*, int iPhrase);
10046
10047 int (SQLITE_CALLBACK *xInstCount)(Fts5Context*, int *pnInst);
10048 int (SQLITE_CALLBACK *xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff);
10049
10050 sqlite3_int64 (SQLITE_CALLBACK *xRowid)(Fts5Context*);
10051 int (SQLITE_CALLBACK *xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn);
10052 int (SQLITE_CALLBACK *xColumnSize)(Fts5Context*, int iCol, int *pnToken);
10053
10054 int (SQLITE_CALLBACK *xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData,
10055 int(SQLITE_CALLBACK *)(const Fts5ExtensionApi*,Fts5Context*,void*)
10056 );
10057 int (SQLITE_CALLBACK *xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*));
10058 void *(SQLITE_CALLBACK *xGetAuxdata)(Fts5Context*, int bClear);
10059
10060 int (SQLITE_CALLBACK *xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*);
10061 void (SQLITE_CALLBACK *xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff);
10062
10063 int (SQLITE_CALLBACK *xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*);
10064 void (SQLITE_CALLBACK *xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol);
10065 };
10066
10067 /*
10068 ** CUSTOM AUXILIARY FUNCTIONS
10069 *************************************************************************/
@@ -10087,11 +10088,11 @@
10087 ** The second and third arguments are an array of nul-terminated strings
10088 ** containing the tokenizer arguments, if any, specified following the
10089 ** tokenizer name as part of the CREATE VIRTUAL TABLE statement used
10090 ** to create the FTS5 table.
10091 **
10092 ** The final argument is an output variable. If successful, (SQLITE_CALLBACK *ppOut)
10093 ** should be set to point to the new tokenizer handle and SQLITE_OK
10094 ** returned. If an error occurs, some value other than SQLITE_OK should
10095 ** be returned. In this case, fts5 assumes that the final value of *ppOut
10096 ** is undefined.
10097 **
@@ -10261,17 +10262,17 @@
10261 ** inefficient.
10262 */
10263 typedef struct Fts5Tokenizer Fts5Tokenizer;
10264 typedef struct fts5_tokenizer fts5_tokenizer;
10265 struct fts5_tokenizer {
10266 int (SQLITE_CALLBACK *xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
10267 void (SQLITE_CALLBACK *xDelete)(Fts5Tokenizer*);
10268 int (SQLITE_CALLBACK *xTokenize)(Fts5Tokenizer*,
10269 void *pCtx,
10270 int flags, /* Mask of FTS5_TOKENIZE_* flags */
10271 const char *pText, int nText,
10272 int (SQLITE_CALLBACK *xToken)(
10273 void *pCtx, /* Copy of 2nd argument to xTokenize() */
10274 int tflags, /* Mask of FTS5_TOKEN_* flags */
10275 const char *pToken, /* Pointer to buffer containing token */
10276 int nToken, /* Size of token in bytes */
10277 int iStart, /* Byte offset of token within input text */
@@ -10300,33 +10301,33 @@
10300 typedef struct fts5_api fts5_api;
10301 struct fts5_api {
10302 int iVersion; /* Currently always set to 2 */
10303
10304 /* Create a new tokenizer */
10305 int (SQLITE_CALLBACK *xCreateTokenizer)(
10306 fts5_api *pApi,
10307 const char *zName,
10308 void *pContext,
10309 fts5_tokenizer *pTokenizer,
10310 void (SQLITE_CALLBACK *xDestroy)(void*)
10311 );
10312
10313 /* Find an existing tokenizer */
10314 int (SQLITE_CALLBACK *xFindTokenizer)(
10315 fts5_api *pApi,
10316 const char *zName,
10317 void **ppContext,
10318 fts5_tokenizer *pTokenizer
10319 );
10320
10321 /* Create a new auxiliary function */
10322 int (SQLITE_CALLBACK *xCreateFunction)(
10323 fts5_api *pApi,
10324 const char *zName,
10325 void *pContext,
10326 fts5_extension_function xFunction,
10327 void (SQLITE_CALLBACK *xDestroy)(void*)
10328 );
10329 };
10330
10331 /*
10332 ** END OF REGISTRATION API
10333
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -120,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-08-04 13:23:28 9adda385267d1a0ecff259b42a284913668441a2"
126
127 /*
128 ** CAPI3REF: Run-Time Library Version Numbers
129 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
130 **
@@ -153,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_STDCALL sqlite3_libversion(void);
159 SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void);
160 SQLITE_API int SQLITE_STDCALL 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
@@ -180,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_STDCALL sqlite3_compileoption_used(const char *zOptName);
186 SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N);
187 #endif
188
189 /*
190 ** CAPI3REF: Test To See If The Library Is Threadsafe
191 **
@@ -220,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_STDCALL sqlite3_threadsafe(void);
226
227 /*
228 ** CAPI3REF: Database Connection Handle
229 ** KEYWORDS: {database connection} {database connections}
230 **
@@ -317,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_STDCALL sqlite3_close(sqlite3*);
323 SQLITE_API int SQLITE_STDCALL 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 (*sqlite3_callback)(void*,int,char**, char**);
331
332 /*
333 ** CAPI3REF: One-Step Query Execution Interface
334 ** METHOD: sqlite3
335 **
@@ -389,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_STDCALL sqlite3_exec(
395 sqlite3*, /* An open database */
396 const char *sql, /* SQL to be evaluated */
397 int (*callback)(void*,int,char**,char**), /* Callback function */
398 void *, /* 1st argument to callback */
399 char **errmsg /* Error msg written here */
400 );
401
402 /*
@@ -740,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 (*xClose)(sqlite3_file*);
746 int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
747 int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
748 int (*xTruncate)(sqlite3_file*, sqlite3_int64 size);
749 int (*xSync)(sqlite3_file*, int flags);
750 int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
751 int (*xLock)(sqlite3_file*, int);
752 int (*xUnlock)(sqlite3_file*, int);
753 int (*xCheckReservedLock)(sqlite3_file*, int *pResOut);
754 int (*xFileControl)(sqlite3_file*, int op, void *pArg);
755 int (*xSectorSize)(sqlite3_file*);
756 int (*xDeviceCharacteristics)(sqlite3_file*);
757 /* Methods above are valid for version 1 */
758 int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
759 int (*xShmLock)(sqlite3_file*, int offset, int n, int flags);
760 void (*xShmBarrier)(sqlite3_file*);
761 int (*xShmUnmap)(sqlite3_file*, int deleteFlag);
762 /* Methods above are valid for version 2 */
763 int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
764 int (*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 /*
@@ -935,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 (*)(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 **
@@ -1211,43 +1211,43 @@
1211 ** or all of these interfaces to be NULL or for their behavior to change
1212 ** from one release to the next. Applications must not attempt to access
1213 ** any of these methods if the iVersion of the VFS is less than 3.
1214 */
1215 typedef struct sqlite3_vfs sqlite3_vfs;
1216 typedef void (*sqlite3_syscall_ptr)(void);
1217 struct sqlite3_vfs {
1218 int iVersion; /* Structure version number (currently 3) */
1219 int szOsFile; /* Size of subclassed sqlite3_file */
1220 int mxPathname; /* Maximum file pathname length */
1221 sqlite3_vfs *pNext; /* Next registered VFS */
1222 const char *zName; /* Name of this virtual file system */
1223 void *pAppData; /* Pointer to application-specific data */
1224 int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
1225 int flags, int *pOutFlags);
1226 int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
1227 int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
1228 int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
1229 void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename);
1230 void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
1231 void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
1232 void (*xDlClose)(sqlite3_vfs*, void*);
1233 int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
1234 int (*xSleep)(sqlite3_vfs*, int microseconds);
1235 int (*xCurrentTime)(sqlite3_vfs*, double*);
1236 int (*xGetLastError)(sqlite3_vfs*, int, char *);
1237 /*
1238 ** The methods above are in version 1 of the sqlite_vfs object
1239 ** definition. Those that follow are added in version 2 or later
1240 */
1241 int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
1242 /*
1243 ** The methods above are in versions 1 and 2 of the sqlite_vfs object.
1244 ** Those below are for version 3 and greater.
1245 */
1246 int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
1247 sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName);
1248 const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName);
1249 /*
1250 ** The methods above are in versions 1 through 3 of the sqlite_vfs object.
1251 ** New fields may be appended in future versions. The iVersion
1252 ** value will increment whenever this happens.
1253 */
@@ -1388,14 +1388,14 @@
1388 ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied
1389 ** implementation of sqlite3_os_init() or sqlite3_os_end()
1390 ** must return [SQLITE_OK] on success and some other [error code] upon
1391 ** failure.
1392 */
1393 SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void);
1394 SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void);
1395 SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void);
1396 SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void);
1397
1398 /*
1399 ** CAPI3REF: Configuring The SQLite Library
1400 **
1401 ** The sqlite3_config() interface is used to make global configuration
@@ -1510,17 +1510,17 @@
1510 ** SQLite will never invoke xInit() more than once without an intervening
1511 ** call to xShutdown().
1512 */
1513 typedef struct sqlite3_mem_methods sqlite3_mem_methods;
1514 struct sqlite3_mem_methods {
1515 void *(*xMalloc)(int); /* Memory allocation function */
1516 void (*xFree)(void*); /* Free a prior allocation */
1517 void *(*xRealloc)(void*,int); /* Resize an allocation */
1518 int (*xSize)(void*); /* Return the size of an allocation */
1519 int (*xRoundup)(int); /* Round up request size to allocation size */
1520 int (*xInit)(void*); /* Initialize the memory allocator */
1521 void (*xShutdown)(void*); /* Deinitialize the memory allocator */
1522 void *pAppData; /* Argument to xInit() and xShutdown() */
1523 };
1524
1525 /*
1526 ** CAPI3REF: Configuration Options
@@ -1733,11 +1733,11 @@
1733 **
1734 ** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
1735 ** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
1736 ** global [error log].
1737 ** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a
1738 ** function with a call signature of void(*)(void*,int,const char*),
1739 ** and a pointer to void. ^If the function pointer is not NULL, it is
1740 ** invoked by [sqlite3_log()] to process each logging event. ^If the
1741 ** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op.
1742 ** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is
1743 ** passed through as the first parameter to the application-defined logger
@@ -1786,11 +1786,11 @@
1786 **
1787 ** [[SQLITE_CONFIG_SQLLOG]]
1788 ** <dt>SQLITE_CONFIG_SQLLOG
1789 ** <dd>This option is only available if sqlite is compiled with the
1790 ** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should
1791 ** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int).
1792 ** The second should be of type (void*). The callback is invoked by the library
1793 ** in three separate circumstances, identified by the value passed as the
1794 ** fourth parameter. If the fourth parameter is 0, then the database connection
1795 ** passed as the second argument has just been opened. The third argument
1796 ** points to a buffer containing the name of the main database file. If the
@@ -1984,11 +1984,11 @@
1984 **
1985 ** ^The sqlite3_extended_result_codes() routine enables or disables the
1986 ** [extended result codes] feature of SQLite. ^The extended result
1987 ** codes are disabled by default for historical compatibility.
1988 */
1989 SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3*, int onoff);
1990
1991 /*
1992 ** CAPI3REF: Last Insert Rowid
1993 ** METHOD: sqlite3
1994 **
@@ -2036,11 +2036,11 @@
2036 ** function is running and thus changes the last insert [rowid],
2037 ** then the value returned by [sqlite3_last_insert_rowid()] is
2038 ** unpredictable and might not equal either the old or the new
2039 ** last insert [rowid].
2040 */
2041 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3*);
2042
2043 /*
2044 ** CAPI3REF: Count The Number Of Rows Modified
2045 ** METHOD: sqlite3
2046 **
@@ -2089,11 +2089,11 @@
2089 **
2090 ** If a separate thread makes changes on the same database connection
2091 ** while [sqlite3_changes()] is running then the value returned
2092 ** is unpredictable and not meaningful.
2093 */
2094 SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3*);
2095
2096 /*
2097 ** CAPI3REF: Total Number Of Rows Modified
2098 ** METHOD: sqlite3
2099 **
@@ -2113,11 +2113,11 @@
2113 **
2114 ** If a separate thread makes changes on the same database connection
2115 ** while [sqlite3_total_changes()] is running then the value
2116 ** returned is unpredictable and not meaningful.
2117 */
2118 SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3*);
2119
2120 /*
2121 ** CAPI3REF: Interrupt A Long-Running Query
2122 ** METHOD: sqlite3
2123 **
@@ -2153,11 +2153,11 @@
2153 ** that are started after the sqlite3_interrupt() call returns.
2154 **
2155 ** If the database connection closes while [sqlite3_interrupt()]
2156 ** is running then bad things will likely happen.
2157 */
2158 SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3*);
2159
2160 /*
2161 ** CAPI3REF: Determine If An SQL Statement Is Complete
2162 **
2163 ** These routines are useful during command-line input to determine if the
@@ -2188,12 +2188,12 @@
2188 ** UTF-8 string.
2189 **
2190 ** The input to [sqlite3_complete16()] must be a zero-terminated
2191 ** UTF-16 string in native byte order.
2192 */
2193 SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *sql);
2194 SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *sql);
2195
2196 /*
2197 ** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
2198 ** KEYWORDS: {busy-handler callback} {busy handler}
2199 ** METHOD: sqlite3
@@ -2250,11 +2250,11 @@
2250 ** result in undefined behavior.
2251 **
2252 ** A busy handler must not close the database connection
2253 ** or [prepared statement] that invoked the busy handler.
2254 */
2255 SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(sqlite3*,int(*)(void*,int),void*);
2256
2257 /*
2258 ** CAPI3REF: Set A Busy Timeout
2259 ** METHOD: sqlite3
2260 **
@@ -2273,11 +2273,11 @@
2273 ** was defined (using [sqlite3_busy_handler()]) prior to calling
2274 ** this routine, that other busy handler is cleared.)^
2275 **
2276 ** See also: [PRAGMA busy_timeout]
2277 */
2278 SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3*, int ms);
2279
2280 /*
2281 ** CAPI3REF: Convenience Routines For Running Queries
2282 ** METHOD: sqlite3
2283 **
@@ -2348,19 +2348,19 @@
2348 ** interface defined here. As a consequence, errors that occur in the
2349 ** wrapper layer outside of the internal [sqlite3_exec()] call are not
2350 ** reflected in subsequent calls to [sqlite3_errcode()] or
2351 ** [sqlite3_errmsg()].
2352 */
2353 SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
2354 sqlite3 *db, /* An open database */
2355 const char *zSql, /* SQL to be evaluated */
2356 char ***pazResult, /* Results of the query */
2357 int *pnRow, /* Number of result rows written here */
2358 int *pnColumn, /* Number of result columns written here */
2359 char **pzErrmsg /* Error msg written here */
2360 );
2361 SQLITE_API void SQLITE_STDCALL sqlite3_free_table(char **result);
2362
2363 /*
2364 ** CAPI3REF: Formatted String Printing Functions
2365 **
2366 ** These routines are work-alikes of the "printf()" family of functions
@@ -2463,13 +2463,13 @@
2463 ** ^(The "%z" formatting option works like "%s" but with the
2464 ** addition that after the string has been read and copied into
2465 ** the result, [sqlite3_free()] is called on the input string.)^
2466 */
2467 SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...);
2468 SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list);
2469 SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...);
2470 SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list);
2471
2472 /*
2473 ** CAPI3REF: Memory Allocation Subsystem
2474 **
2475 ** The SQLite core uses these three routines for all of its own
@@ -2555,16 +2555,16 @@
2555 **
2556 ** The application must not read or write any part of
2557 ** a block of memory after it has been released using
2558 ** [sqlite3_free()] or [sqlite3_realloc()].
2559 */
2560 SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int);
2561 SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64);
2562 SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void*, int);
2563 SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void*, sqlite3_uint64);
2564 SQLITE_API void SQLITE_STDCALL sqlite3_free(void*);
2565 SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void*);
2566
2567 /*
2568 ** CAPI3REF: Memory Allocator Statistics
2569 **
2570 ** SQLite provides these two interfaces for reporting on the status
@@ -2585,12 +2585,12 @@
2585 ** [sqlite3_memory_used()] if and only if the parameter to
2586 ** [sqlite3_memory_highwater()] is true. ^The value returned
2587 ** by [sqlite3_memory_highwater(1)] is the high-water mark
2588 ** prior to the reset.
2589 */
2590 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void);
2591 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag);
2592
2593 /*
2594 ** CAPI3REF: Pseudo-Random Number Generator
2595 **
2596 ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
@@ -2609,11 +2609,11 @@
2609 ** ^If the previous call to this routine had an N of 1 or more and a
2610 ** non-NULL P then the pseudo-randomness is generated
2611 ** internally and without recourse to the [sqlite3_vfs] xRandomness
2612 ** method.
2613 */
2614 SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *P);
2615
2616 /*
2617 ** CAPI3REF: Compile-Time Authorization Callbacks
2618 ** METHOD: sqlite3
2619 **
@@ -2692,13 +2692,13 @@
2692 ** [sqlite3_prepare()] or its variants. Authorization is not
2693 ** performed during statement evaluation in [sqlite3_step()], unless
2694 ** as stated in the previous paragraph, sqlite3_step() invokes
2695 ** sqlite3_prepare_v2() to reprepare a statement after a schema change.
2696 */
2697 SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
2698 sqlite3*,
2699 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
2700 void *pUserData
2701 );
2702
2703 /*
2704 ** CAPI3REF: Authorizer Return Codes
@@ -2800,14 +2800,14 @@
2800 ** digits in the time are meaningless. Future versions of SQLite
2801 ** might provide greater resolution on the profiler callback. The
2802 ** sqlite3_profile() function is considered experimental and is
2803 ** subject to change in future versions of SQLite.
2804 */
2805 SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_trace(sqlite3*,
2806 void(*xTrace)(void*,const char*), void*);
2807 SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_profile(sqlite3*,
2808 void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
2809
2810 /*
2811 ** CAPI3REF: SQL Trace Event Codes
2812 ** KEYWORDS: SQLITE_TRACE
2813 **
@@ -2891,14 +2891,14 @@
2891 **
2892 ** The sqlite3_trace_v2() interface is intended to replace the legacy
2893 ** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which
2894 ** are deprecated.
2895 */
2896 SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2(
2897 sqlite3*,
2898 unsigned uMask,
2899 int(*xCallback)(unsigned,void*,void*,void*),
2900 void *pCtx
2901 );
2902
2903 /*
2904 ** CAPI3REF: Query Progress Callbacks
@@ -2930,11 +2930,11 @@
2930 ** the database connection that invoked the progress handler.
2931 ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
2932 ** database connections for the meaning of "modify" in this paragraph.
2933 **
2934 */
2935 SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
2936
2937 /*
2938 ** CAPI3REF: Opening A New Database Connection
2939 ** CONSTRUCTOR: sqlite3
2940 **
@@ -3159,19 +3159,19 @@
3159 ** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various
3160 ** features that require the use of temporary files may fail.
3161 **
3162 ** See also: [sqlite3_temp_directory]
3163 */
3164 SQLITE_API int SQLITE_STDCALL sqlite3_open(
3165 const char *filename, /* Database filename (UTF-8) */
3166 sqlite3 **ppDb /* OUT: SQLite db handle */
3167 );
3168 SQLITE_API int SQLITE_STDCALL sqlite3_open16(
3169 const void *filename, /* Database filename (UTF-16) */
3170 sqlite3 **ppDb /* OUT: SQLite db handle */
3171 );
3172 SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
3173 const char *filename, /* Database filename (UTF-8) */
3174 sqlite3 **ppDb, /* OUT: SQLite db handle */
3175 int flags, /* Flags */
3176 const char *zVfs /* Name of VFS module to use */
3177 );
@@ -3213,13 +3213,13 @@
3213 ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and
3214 ** is not a database file pathname pointer that SQLite passed into the xOpen
3215 ** VFS method, then the behavior of this routine is undefined and probably
3216 ** undesirable.
3217 */
3218 SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3219 SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3220 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
3221
3222
3223 /*
3224 ** CAPI3REF: Error Codes And Messages
3225 ** METHOD: sqlite3
@@ -3259,15 +3259,15 @@
3259 **
3260 ** If an interface fails with SQLITE_MISUSE, that means the interface
3261 ** was invoked incorrectly by the application. In that case, the
3262 ** error code and message may or may not be set.
3263 */
3264 SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db);
3265 SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db);
3266 SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*);
3267 SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*);
3268 SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int);
3269
3270 /*
3271 ** CAPI3REF: Prepared Statement Object
3272 ** KEYWORDS: {prepared statement} {prepared statements}
3273 **
@@ -3331,11 +3331,11 @@
3331 ** created by an untrusted script can be contained using the
3332 ** [max_page_count] [PRAGMA].
3333 **
3334 ** New run-time limit categories may be added in future releases.
3335 */
3336 SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3*, int id, int newVal);
3337
3338 /*
3339 ** CAPI3REF: Run-Time Limit Categories
3340 ** KEYWORDS: {limit category} {*limit categories}
3341 **
@@ -3483,32 +3483,32 @@
3483 ** or [GLOB] operator or if the parameter is compared to an indexed column
3484 ** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
3485 ** </li>
3486 ** </ol>
3487 */
3488 SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
3489 sqlite3 *db, /* Database handle */
3490 const char *zSql, /* SQL statement, UTF-8 encoded */
3491 int nByte, /* Maximum length of zSql in bytes. */
3492 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3493 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3494 );
3495 SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
3496 sqlite3 *db, /* Database handle */
3497 const char *zSql, /* SQL statement, UTF-8 encoded */
3498 int nByte, /* Maximum length of zSql in bytes. */
3499 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3500 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3501 );
3502 SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
3503 sqlite3 *db, /* Database handle */
3504 const void *zSql, /* SQL statement, UTF-16 encoded */
3505 int nByte, /* Maximum length of zSql in bytes. */
3506 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3507 const void **pzTail /* OUT: Pointer to unused portion of zSql */
3508 );
3509 SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
3510 sqlite3 *db, /* Database handle */
3511 const void *zSql, /* SQL statement, UTF-16 encoded */
3512 int nByte, /* Maximum length of zSql in bytes. */
3513 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3514 const void **pzTail /* OUT: Pointer to unused portion of zSql */
@@ -3543,12 +3543,12 @@
3543 ** automatically freed when the prepared statement is finalized.
3544 ** ^The string returned by sqlite3_expanded_sql(P), on the other hand,
3545 ** is obtained from [sqlite3_malloc()] and must be free by the application
3546 ** by passing it to [sqlite3_free()].
3547 */
3548 SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt);
3549 SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt);
3550
3551 /*
3552 ** CAPI3REF: Determine If An SQL Statement Writes The Database
3553 ** METHOD: sqlite3_stmt
3554 **
@@ -3576,11 +3576,11 @@
3576 ** database. ^The [ATTACH] and [DETACH] statements also cause
3577 ** sqlite3_stmt_readonly() to return true since, while those statements
3578 ** change the configuration of a database connection, they do not make
3579 ** changes to the content of the database files on disk.
3580 */
3581 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
3582
3583 /*
3584 ** CAPI3REF: Determine If A Prepared Statement Has Been Reset
3585 ** METHOD: sqlite3_stmt
3586 **
@@ -3597,11 +3597,11 @@
3597 ** to locate all prepared statements associated with a database
3598 ** connection that are in need of being reset. This can be used,
3599 ** for example, in diagnostic routines to search for prepared
3600 ** statements that are holding a transaction open.
3601 */
3602 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt*);
3603
3604 /*
3605 ** CAPI3REF: Dynamically Typed Value Object
3606 ** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
3607 **
@@ -3761,24 +3761,24 @@
3761 ** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails.
3762 **
3763 ** See also: [sqlite3_bind_parameter_count()],
3764 ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].
3765 */
3766 SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
3767 SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
3768 void(*)(void*));
3769 SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt*, int, double);
3770 SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt*, int, int);
3771 SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
3772 SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt*, int);
3773 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
3774 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
3775 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
3776 void(*)(void*), unsigned char encoding);
3777 SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
3778 SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
3779 SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
3780
3781 /*
3782 ** CAPI3REF: Number Of SQL Parameters
3783 ** METHOD: sqlite3_stmt
3784 **
@@ -3795,11 +3795,11 @@
3795 **
3796 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3797 ** [sqlite3_bind_parameter_name()], and
3798 ** [sqlite3_bind_parameter_index()].
3799 */
3800 SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt*);
3801
3802 /*
3803 ** CAPI3REF: Name Of A Host Parameter
3804 ** METHOD: sqlite3_stmt
3805 **
@@ -3823,11 +3823,11 @@
3823 **
3824 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3825 ** [sqlite3_bind_parameter_count()], and
3826 ** [sqlite3_bind_parameter_index()].
3827 */
3828 SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
3829
3830 /*
3831 ** CAPI3REF: Index Of A Parameter With A Given Name
3832 ** METHOD: sqlite3_stmt
3833 **
@@ -3840,21 +3840,21 @@
3840 **
3841 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3842 ** [sqlite3_bind_parameter_count()], and
3843 ** [sqlite3_bind_parameter_name()].
3844 */
3845 SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
3846
3847 /*
3848 ** CAPI3REF: Reset All Bindings On A Prepared Statement
3849 ** METHOD: sqlite3_stmt
3850 **
3851 ** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset
3852 ** the [sqlite3_bind_blob | bindings] on a [prepared statement].
3853 ** ^Use this routine to reset all host parameters to NULL.
3854 */
3855 SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt*);
3856
3857 /*
3858 ** CAPI3REF: Number Of Columns In A Result Set
3859 ** METHOD: sqlite3_stmt
3860 **
@@ -3862,11 +3862,11 @@
3862 ** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
3863 ** statement that does not return data (for example an [UPDATE]).
3864 **
3865 ** See also: [sqlite3_data_count()]
3866 */
3867 SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt);
3868
3869 /*
3870 ** CAPI3REF: Column Names In A Result Set
3871 ** METHOD: sqlite3_stmt
3872 **
@@ -3891,12 +3891,12 @@
3891 ** ^The name of a result column is the value of the "AS" clause for
3892 ** that column, if there is an AS clause. If there is no AS clause
3893 ** then the name of the column is unspecified and may change from
3894 ** one release of SQLite to the next.
3895 */
3896 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt*, int N);
3897 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt*, int N);
3898
3899 /*
3900 ** CAPI3REF: Source Of Data In A Query Result
3901 ** METHOD: sqlite3_stmt
3902 **
@@ -3940,16 +3940,16 @@
3940 ** If two or more threads call one or more
3941 ** [sqlite3_column_database_name | column metadata interfaces]
3942 ** for the same [prepared statement] and result column
3943 ** at the same time then the results are undefined.
3944 */
3945 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int);
3946 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int);
3947 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int);
3948 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int);
3949 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int);
3950 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
3951
3952 /*
3953 ** CAPI3REF: Declared Datatype Of A Query Result
3954 ** METHOD: sqlite3_stmt
3955 **
@@ -3977,12 +3977,12 @@
3977 ** data stored in that column is of the declared type. SQLite is
3978 ** strongly typed, but the typing is dynamic not static. ^Type
3979 ** is associated with individual values, not with the containers
3980 ** used to hold those values.
3981 */
3982 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt*,int);
3983 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt*,int);
3984
3985 /*
3986 ** CAPI3REF: Evaluate An SQL Statement
3987 ** METHOD: sqlite3_stmt
3988 **
@@ -4058,11 +4058,11 @@
4058 ** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
4059 ** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,
4060 ** then the more specific [error codes] are returned directly
4061 ** by sqlite3_step(). The use of the "v2" interface is recommended.
4062 */
4063 SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt*);
4064
4065 /*
4066 ** CAPI3REF: Number of columns in a result set
4067 ** METHOD: sqlite3_stmt
4068 **
@@ -4079,11 +4079,11 @@
4079 ** where it always returns zero since each step of that multi-step
4080 ** pragma returns 0 columns of data.
4081 **
4082 ** See also: [sqlite3_column_count()]
4083 */
4084 SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt);
4085
4086 /*
4087 ** CAPI3REF: Fundamental Datatypes
4088 ** KEYWORDS: SQLITE_TEXT
4089 **
@@ -4269,20 +4269,20 @@
4269 ** of these routines, a default value is returned. The default value
4270 ** is either the integer 0, the floating point number 0.0, or a NULL
4271 ** pointer. Subsequent calls to [sqlite3_errcode()] will return
4272 ** [SQLITE_NOMEM].)^
4273 */
4274 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt*, int iCol);
4275 SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4276 SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4277 SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt*, int iCol);
4278 SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt*, int iCol);
4279 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt*, int iCol);
4280 SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt*, int iCol);
4281 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt*, int iCol);
4282 SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt*, int iCol);
4283 SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt*, int iCol);
4284
4285 /*
4286 ** CAPI3REF: Destroy A Prepared Statement Object
4287 ** DESTRUCTOR: sqlite3_stmt
4288 **
@@ -4306,11 +4306,11 @@
4306 ** resource leaks. It is a grievous error for the application to try to use
4307 ** a prepared statement after it has been finalized. Any use of a prepared
4308 ** statement after it has been finalized can result in undefined and
4309 ** undesirable behavior such as segfaults and heap corruption.
4310 */
4311 SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt);
4312
4313 /*
4314 ** CAPI3REF: Reset A Prepared Statement Object
4315 ** METHOD: sqlite3_stmt
4316 **
@@ -4333,11 +4333,11 @@
4333 ** [sqlite3_reset(S)] returns an appropriate [error code].
4334 **
4335 ** ^The [sqlite3_reset(S)] interface does not change the values
4336 ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
4337 */
4338 SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt);
4339
4340 /*
4341 ** CAPI3REF: Create Or Redefine SQL Functions
4342 ** KEYWORDS: {function creation routines}
4343 ** KEYWORDS: {application-defined SQL function}
@@ -4433,40 +4433,40 @@
4433 ** ^An application-defined function is permitted to call other
4434 ** SQLite interfaces. However, such calls must not
4435 ** close the database connection nor finalize or reset the prepared
4436 ** statement in which the function is running.
4437 */
4438 SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
4439 sqlite3 *db,
4440 const char *zFunctionName,
4441 int nArg,
4442 int eTextRep,
4443 void *pApp,
4444 void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4445 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4446 void (*xFinal)(sqlite3_context*)
4447 );
4448 SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
4449 sqlite3 *db,
4450 const void *zFunctionName,
4451 int nArg,
4452 int eTextRep,
4453 void *pApp,
4454 void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4455 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4456 void (*xFinal)(sqlite3_context*)
4457 );
4458 SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
4459 sqlite3 *db,
4460 const char *zFunctionName,
4461 int nArg,
4462 int eTextRep,
4463 void *pApp,
4464 void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4465 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4466 void (*xFinal)(sqlite3_context*),
4467 void(*xDestroy)(void*)
4468 );
4469
4470 /*
4471 ** CAPI3REF: Text Encodings
4472 **
@@ -4499,16 +4499,16 @@
4499 ** to be supported. However, new applications should avoid
4500 ** the use of these functions. To encourage programmers to avoid
4501 ** these functions, we will not explain what they do.
4502 */
4503 #ifndef SQLITE_OMIT_DEPRECATED
4504 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context*);
4505 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt*);
4506 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4507 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_global_recover(void);
4508 SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_thread_cleanup(void);
4509 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
4510 void*,sqlite3_int64);
4511 #endif
4512
4513 /*
4514 ** CAPI3REF: Obtaining SQL Values
@@ -4554,22 +4554,22 @@
4554 ** or [sqlite3_value_text16()].
4555 **
4556 ** These routines must be called from the same thread as
4557 ** the SQL function that supplied the [sqlite3_value*] parameters.
4558 */
4559 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value*);
4560 SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value*);
4561 SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value*);
4562 SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value*);
4563 SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value*);
4564 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value*);
4565 SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value*);
4566 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value*);
4567 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value*);
4568 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*);
4569 SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*);
4570 SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*);
4571
4572 /*
4573 ** CAPI3REF: Finding The Subtype Of SQL Values
4574 ** METHOD: sqlite3_value
4575 **
@@ -4581,11 +4581,11 @@
4581 **
4582 ** SQLite makes no use of subtype itself. It merely passes the subtype
4583 ** from the result of one [application-defined SQL function] into the
4584 ** input of another.
4585 */
4586 SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value*);
4587
4588 /*
4589 ** CAPI3REF: Copy And Free SQL Values
4590 ** METHOD: sqlite3_value
4591 **
@@ -4597,12 +4597,12 @@
4597 **
4598 ** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object
4599 ** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer
4600 ** then sqlite3_value_free(V) is a harmless no-op.
4601 */
4602 SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value*);
4603 SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value*);
4604
4605 /*
4606 ** CAPI3REF: Obtain Aggregate Function Context
4607 ** METHOD: sqlite3_context
4608 **
@@ -4643,11 +4643,11 @@
4643 ** function.
4644 **
4645 ** This routine must be called from the same thread in which
4646 ** the aggregate SQL function is running.
4647 */
4648 SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
4649
4650 /*
4651 ** CAPI3REF: User Data For Functions
4652 ** METHOD: sqlite3_context
4653 **
@@ -4658,11 +4658,11 @@
4658 ** registered the application defined function.
4659 **
4660 ** This routine must be called from the same thread in which
4661 ** the application-defined function is running.
4662 */
4663 SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context*);
4664
4665 /*
4666 ** CAPI3REF: Database Connection For Functions
4667 ** METHOD: sqlite3_context
4668 **
@@ -4670,11 +4670,11 @@
4670 ** the pointer to the [database connection] (the 1st parameter)
4671 ** of the [sqlite3_create_function()]
4672 ** and [sqlite3_create_function16()] routines that originally
4673 ** registered the application defined function.
4674 */
4675 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context*);
4676
4677 /*
4678 ** CAPI3REF: Function Auxiliary Data
4679 ** METHOD: sqlite3_context
4680 **
@@ -4702,16 +4702,17 @@
4702 ** NULL if the metadata has been discarded.
4703 ** ^After each call to sqlite3_set_auxdata(C,N,P,X) where X is not NULL,
4704 ** SQLite will invoke the destructor function X with parameter P exactly
4705 ** once, when the metadata is discarded.
4706 ** SQLite is free to discard the metadata at any time, including: <ul>
4707 ** <li> ^(when the corresponding function parameter changes)^, or
4708 ** <li> ^(when [sqlite3_reset()] or [sqlite3_finalize()] is called for the
4709 ** SQL statement)^, or
4710 ** <li> ^(when sqlite3_set_auxdata() is invoked again on the same
4711 ** parameter)^, or
4712 ** <li> ^(during the original sqlite3_set_auxdata() call when a memory
4713 ** allocation error occurs.)^ </ul>
4714 **
4715 ** Note the last bullet in particular. The destructor X in
4716 ** sqlite3_set_auxdata(C,N,P,X) might be called immediately, before the
4717 ** sqlite3_set_auxdata() interface even returns. Hence sqlite3_set_auxdata()
4718 ** should be called near the end of the function implementation and the
@@ -4723,12 +4724,12 @@
4724 ** values and [parameters] and expressions composed from the same.)^
4725 **
4726 ** These routines must be called from the same thread in which
4727 ** the SQL function is running.
4728 */
4729 SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context*, int N);
4730 SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
4731
4732
4733 /*
4734 ** CAPI3REF: Constants Defining Special Destructor Behavior
4735 **
@@ -4741,11 +4742,11 @@
4742 ** the content before returning.
4743 **
4744 ** The typedef is necessary to work around problems in certain
4745 ** C++ compilers.
4746 */
4747 typedef void (*sqlite3_destructor_type)(void*);
4748 #define SQLITE_STATIC ((sqlite3_destructor_type)0)
4749 #define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1)
4750
4751 /*
4752 ** CAPI3REF: Setting The Result Of An SQL Function
@@ -4860,31 +4861,31 @@
4861 **
4862 ** If these routines are called from within the different thread
4863 ** than the one containing the application-defined function that received
4864 ** the [sqlite3_context] pointer, the results are undefined.
4865 */
4866 SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
4867 SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(sqlite3_context*,const void*,
4868 sqlite3_uint64,void(*)(void*));
4869 SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context*, double);
4870 SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context*, const char*, int);
4871 SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context*, const void*, int);
4872 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context*);
4873 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context*);
4874 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context*, int);
4875 SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context*, int);
4876 SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
4877 SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context*);
4878 SQLITE_API void SQLITE_STDCALL sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
4879 SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
4880 void(*)(void*), unsigned char encoding);
4881 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
4882 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
4883 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
4884 SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
4885 SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n);
4886 SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
4887
4888
4889 /*
4890 ** CAPI3REF: Setting The Subtype Of An SQL Function
4891 ** METHOD: sqlite3_context
@@ -4895,11 +4896,11 @@
4896 ** of the subtype T are preserved in current versions of SQLite;
4897 ** higher order bits are discarded.
4898 ** The number of subtype bytes preserved by SQLite might increase
4899 ** in future releases of SQLite.
4900 */
4901 SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context*,unsigned int);
4902
4903 /*
4904 ** CAPI3REF: Define New Collating Sequences
4905 ** METHOD: sqlite3
4906 **
@@ -4977,31 +4978,31 @@
4978 ** is unfortunate but cannot be changed without breaking backwards
4979 ** compatibility.
4980 **
4981 ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].
4982 */
4983 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
4984 sqlite3*,
4985 const char *zName,
4986 int eTextRep,
4987 void *pArg,
4988 int(*xCompare)(void*,int,const void*,int,const void*)
4989 );
4990 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
4991 sqlite3*,
4992 const char *zName,
4993 int eTextRep,
4994 void *pArg,
4995 int(*xCompare)(void*,int,const void*,int,const void*),
4996 void(*xDestroy)(void*)
4997 );
4998 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
4999 sqlite3*,
5000 const void *zName,
5001 int eTextRep,
5002 void *pArg,
5003 int(*xCompare)(void*,int,const void*,int,const void*)
5004 );
5005
5006 /*
5007 ** CAPI3REF: Collation Needed Callbacks
5008 ** METHOD: sqlite3
@@ -5027,19 +5028,19 @@
5028 **
5029 ** The callback function should register the desired collation using
5030 ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or
5031 ** [sqlite3_create_collation_v2()].
5032 */
5033 SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
5034 sqlite3*,
5035 void*,
5036 void(*)(void*,sqlite3*,int eTextRep,const char*)
5037 );
5038 SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
5039 sqlite3*,
5040 void*,
5041 void(*)(void*,sqlite3*,int eTextRep,const void*)
5042 );
5043
5044 #ifdef SQLITE_HAS_CODEC
5045 /*
5046 ** Specify the key for an encrypted database. This routine should be
@@ -5046,15 +5047,15 @@
5047 ** called right after sqlite3_open().
5048 **
5049 ** The code to implement this API is not available in the public release
5050 ** of SQLite.
5051 */
5052 SQLITE_API int SQLITE_STDCALL sqlite3_key(
5053 sqlite3 *db, /* Database to be rekeyed */
5054 const void *pKey, int nKey /* The key */
5055 );
5056 SQLITE_API int SQLITE_STDCALL sqlite3_key_v2(
5057 sqlite3 *db, /* Database to be rekeyed */
5058 const char *zDbName, /* Name of the database */
5059 const void *pKey, int nKey /* The key */
5060 );
5061
@@ -5064,35 +5065,35 @@
5065 ** database is decrypted.
5066 **
5067 ** The code to implement this API is not available in the public release
5068 ** of SQLite.
5069 */
5070 SQLITE_API int SQLITE_STDCALL sqlite3_rekey(
5071 sqlite3 *db, /* Database to be rekeyed */
5072 const void *pKey, int nKey /* The new key */
5073 );
5074 SQLITE_API int SQLITE_STDCALL sqlite3_rekey_v2(
5075 sqlite3 *db, /* Database to be rekeyed */
5076 const char *zDbName, /* Name of the database */
5077 const void *pKey, int nKey /* The new key */
5078 );
5079
5080 /*
5081 ** Specify the activation key for a SEE database. Unless
5082 ** activated, none of the SEE routines will work.
5083 */
5084 SQLITE_API void SQLITE_STDCALL sqlite3_activate_see(
5085 const char *zPassPhrase /* Activation phrase */
5086 );
5087 #endif
5088
5089 #ifdef SQLITE_ENABLE_CEROD
5090 /*
5091 ** Specify the activation key for a CEROD database. Unless
5092 ** activated, none of the CEROD routines will work.
5093 */
5094 SQLITE_API void SQLITE_STDCALL sqlite3_activate_cerod(
5095 const char *zPassPhrase /* Activation phrase */
5096 );
5097 #endif
5098
5099 /*
@@ -5110,11 +5111,11 @@
5111 ** method of the default [sqlite3_vfs] object. If the xSleep() method
5112 ** of the default VFS is not implemented correctly, or not implemented at
5113 ** all, then the behavior of sqlite3_sleep() may deviate from the description
5114 ** in the previous paragraphs.
5115 */
5116 SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int);
5117
5118 /*
5119 ** CAPI3REF: Name Of The Folder Holding Temporary Files
5120 **
5121 ** ^(If this global variable is made to point to a string which is
@@ -5229,11 +5230,11 @@
5230 **
5231 ** If another thread changes the autocommit status of the database
5232 ** connection while this routine is running, then the return value
5233 ** is undefined.
5234 */
5235 SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3*);
5236
5237 /*
5238 ** CAPI3REF: Find The Database Handle Of A Prepared Statement
5239 ** METHOD: sqlite3_stmt
5240 **
@@ -5242,11 +5243,11 @@
5243 ** returned by sqlite3_db_handle is the same [database connection]
5244 ** that was the first argument
5245 ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
5246 ** create the statement in the first place.
5247 */
5248 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt*);
5249
5250 /*
5251 ** CAPI3REF: Return The Filename For A Database Connection
5252 ** METHOD: sqlite3
5253 **
@@ -5259,21 +5260,21 @@
5260 ** ^The filename returned by this function is the output of the
5261 ** xFullPathname method of the [VFS]. ^In other words, the filename
5262 ** will be an absolute pathname, even if the filename used
5263 ** to open the database originally was a URI or relative pathname.
5264 */
5265 SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
5266
5267 /*
5268 ** CAPI3REF: Determine if a database is read-only
5269 ** METHOD: sqlite3
5270 **
5271 ** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N
5272 ** of connection D is read-only, 0 if it is read/write, or -1 if N is not
5273 ** the name of a database on connection D.
5274 */
5275 SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
5276
5277 /*
5278 ** CAPI3REF: Find the next prepared statement
5279 ** METHOD: sqlite3
5280 **
@@ -5285,11 +5286,11 @@
5286 **
5287 ** The [database connection] pointer D in a call to
5288 ** [sqlite3_next_stmt(D,S)] must refer to an open database
5289 ** connection and in particular must not be a NULL pointer.
5290 */
5291 SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
5292
5293 /*
5294 ** CAPI3REF: Commit And Rollback Notification Callbacks
5295 ** METHOD: sqlite3
5296 **
@@ -5334,12 +5335,12 @@
5335 ** ^The rollback callback is not invoked if a transaction is
5336 ** automatically rolled back because the database connection is closed.
5337 **
5338 ** See also the [sqlite3_update_hook()] interface.
5339 */
5340 SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
5341 SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
5342
5343 /*
5344 ** CAPI3REF: Data Change Notification Callbacks
5345 ** METHOD: sqlite3
5346 **
@@ -5386,13 +5387,13 @@
5387 ** the first call on D.
5388 **
5389 ** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()],
5390 ** and [sqlite3_preupdate_hook()] interfaces.
5391 */
5392 SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
5393 sqlite3*,
5394 void(*)(void *,int ,char const *,char const *,sqlite3_int64),
5395 void*
5396 );
5397
5398 /*
5399 ** CAPI3REF: Enable Or Disable Shared Pager Cache
@@ -5426,11 +5427,11 @@
5427 ** This interface is threadsafe on processors where writing a
5428 ** 32-bit integer is atomic.
5429 **
5430 ** See Also: [SQLite Shared-Cache Mode]
5431 */
5432 SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int);
5433
5434 /*
5435 ** CAPI3REF: Attempt To Free Heap Memory
5436 **
5437 ** ^The sqlite3_release_memory() interface attempts to free N bytes
@@ -5442,11 +5443,11 @@
5443 ** ^The sqlite3_release_memory() routine is a no-op returning zero
5444 ** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5445 **
5446 ** See also: [sqlite3_db_release_memory()]
5447 */
5448 SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int);
5449
5450 /*
5451 ** CAPI3REF: Free Memory Used By A Database Connection
5452 ** METHOD: sqlite3
5453 **
@@ -5456,11 +5457,11 @@
5457 ** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
5458 ** omitted.
5459 **
5460 ** See also: [sqlite3_release_memory()]
5461 */
5462 SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3*);
5463
5464 /*
5465 ** CAPI3REF: Impose A Limit On Heap Size
5466 **
5467 ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the
@@ -5508,11 +5509,11 @@
5509 ** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5510 **
5511 ** The circumstances under which SQLite will enforce the soft heap limit may
5512 ** changes in future releases of SQLite.
5513 */
5514 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
5515
5516 /*
5517 ** CAPI3REF: Deprecated Soft Heap Limit Interface
5518 ** DEPRECATED
5519 **
@@ -5519,11 +5520,11 @@
5520 ** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
5521 ** interface. This routine is provided for historical compatibility
5522 ** only. All new applications should use the
5523 ** [sqlite3_soft_heap_limit64()] interface rather than this one.
5524 */
5525 SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_soft_heap_limit(int N);
5526
5527
5528 /*
5529 ** CAPI3REF: Extract Metadata About A Column Of A Table
5530 ** METHOD: sqlite3
@@ -5589,11 +5590,11 @@
5590 **
5591 ** ^This function causes all database schemas to be read from disk and
5592 ** parsed, if that has not already been done, and returns an error if
5593 ** any errors are encountered while loading the schema.
5594 */
5595 SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
5596 sqlite3 *db, /* Connection handle */
5597 const char *zDbName, /* Database name or NULL */
5598 const char *zTableName, /* Table name */
5599 const char *zColumnName, /* Column name */
5600 char const **pzDataType, /* OUTPUT: Declared data type */
@@ -5645,11 +5646,11 @@
5646 ** disabled and prevent SQL injections from giving attackers
5647 ** access to extension loading capabilities.
5648 **
5649 ** See also the [load_extension() SQL function].
5650 */
5651 SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
5652 sqlite3 *db, /* Load the extension into this database connection */
5653 const char *zFile, /* Name of the shared library containing extension */
5654 const char *zProc, /* Entry point. Derived from zFile if 0 */
5655 char **pzErrMsg /* Put error message here if not 0 */
5656 );
@@ -5668,20 +5669,20 @@
5669 ** to turn extension loading on and call it with onoff==0 to turn
5670 ** it back off again.
5671 **
5672 ** ^This interface enables or disables both the C-API
5673 ** [sqlite3_load_extension()] and the SQL function [load_extension()].
5674 ** ^(Use [sqlite3_db_config](db,[SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION],..)
5675 ** to enable or disable only the C-API.)^
5676 **
5677 ** <b>Security warning:</b> It is recommended that extension loading
5678 ** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method
5679 ** rather than this interface, so the [load_extension()] SQL function
5680 ** remains disabled. This will prevent SQL injections from giving attackers
5681 ** access to extension loading capabilities.
5682 */
5683 SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
5684
5685 /*
5686 ** CAPI3REF: Automatically Load Statically Linked Extensions
5687 **
5688 ** ^This interface causes the xEntryPoint() function to be invoked for
@@ -5715,11 +5716,11 @@
5716 ** will be called more than once for each database connection that is opened.
5717 **
5718 ** See also: [sqlite3_reset_auto_extension()]
5719 ** and [sqlite3_cancel_auto_extension()]
5720 */
5721 SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void(*xEntryPoint)(void));
5722
5723 /*
5724 ** CAPI3REF: Cancel Automatic Extension Loading
5725 **
5726 ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
@@ -5727,19 +5728,19 @@
5728 ** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)]
5729 ** routine returns 1 if initialization routine X was successfully
5730 ** unregistered and it returns 0 if X was not on the list of initialization
5731 ** routines.
5732 */
5733 SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void(*xEntryPoint)(void));
5734
5735 /*
5736 ** CAPI3REF: Reset Automatic Extension Loading
5737 **
5738 ** ^This interface disables all automatic extensions previously
5739 ** registered using [sqlite3_auto_extension()].
5740 */
5741 SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void);
5742
5743 /*
5744 ** The interface to the virtual-table mechanism is currently considered
5745 ** to be experimental. The interface might change in incompatible ways.
5746 ** If this is a problem for you, do not use the interface at this time.
@@ -5772,41 +5773,41 @@
5773 ** of this structure must not change while it is registered with
5774 ** any database connection.
5775 */
5776 struct sqlite3_module {
5777 int iVersion;
5778 int (*xCreate)(sqlite3*, void *pAux,
5779 int argc, const char *const*argv,
5780 sqlite3_vtab **ppVTab, char**);
5781 int (*xConnect)(sqlite3*, void *pAux,
5782 int argc, const char *const*argv,
5783 sqlite3_vtab **ppVTab, char**);
5784 int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
5785 int (*xDisconnect)(sqlite3_vtab *pVTab);
5786 int (*xDestroy)(sqlite3_vtab *pVTab);
5787 int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);
5788 int (*xClose)(sqlite3_vtab_cursor*);
5789 int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
5790 int argc, sqlite3_value **argv);
5791 int (*xNext)(sqlite3_vtab_cursor*);
5792 int (*xEof)(sqlite3_vtab_cursor*);
5793 int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int);
5794 int (*xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid);
5795 int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *);
5796 int (*xBegin)(sqlite3_vtab *pVTab);
5797 int (*xSync)(sqlite3_vtab *pVTab);
5798 int (*xCommit)(sqlite3_vtab *pVTab);
5799 int (*xRollback)(sqlite3_vtab *pVTab);
5800 int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,
5801 void (**pxFunc)(sqlite3_context*,int,sqlite3_value**),
5802 void **ppArg);
5803 int (*xRename)(sqlite3_vtab *pVtab, const char *zNew);
5804 /* The methods above are in version 1 of the sqlite_module object. Those
5805 ** below are for version 2 and greater. */
5806 int (*xSavepoint)(sqlite3_vtab *pVTab, int);
5807 int (*xRelease)(sqlite3_vtab *pVTab, int);
5808 int (*xRollbackTo)(sqlite3_vtab *pVTab, int);
5809 };
5810
5811 /*
5812 ** CAPI3REF: Virtual Table Indexing Information
5813 ** KEYWORDS: sqlite3_index_info
@@ -5980,22 +5981,22 @@
5981 ** be invoked if the call to sqlite3_create_module_v2() fails.
5982 ** ^The sqlite3_create_module()
5983 ** interface is equivalent to sqlite3_create_module_v2() with a NULL
5984 ** destructor.
5985 */
5986 SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
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 );
5992 SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
5993 sqlite3 *db, /* SQLite connection to register module with */
5994 const char *zName, /* Name of the module */
5995 const sqlite3_module *p, /* Methods for the module */
5996 void *pClientData, /* Client data for xCreate/xConnect */
5997 void(*xDestroy)(void*) /* Module destructor function */
5998 );
5999
6000 /*
6001 ** CAPI3REF: Virtual Table Instance Object
6002 ** KEYWORDS: sqlite3_vtab
@@ -6049,11 +6050,11 @@
6050 ** ^The [xCreate] and [xConnect] methods of a
6051 ** [virtual table module] call this interface
6052 ** to declare the format (the names and datatypes of the columns) of
6053 ** the virtual tables they implement.
6054 */
6055 SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
6056
6057 /*
6058 ** CAPI3REF: Overload A Function For A Virtual Table
6059 ** METHOD: sqlite3
6060 **
@@ -6068,11 +6069,11 @@
6069 ** of the new function always causes an exception to be thrown. So
6070 ** the new function is not good for anything by itself. Its only
6071 ** purpose is to be a placeholder function that can be overloaded
6072 ** by a [virtual table].
6073 */
6074 SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
6075
6076 /*
6077 ** The interface to the virtual-table mechanism defined above (back up
6078 ** to a comment remarkably similar to this one) is currently considered
6079 ** to be experimental. The interface might change in incompatible ways.
@@ -6167,11 +6168,11 @@
6168 ** zero-filled blob to read or write using the incremental-blob interface.
6169 **
6170 ** To avoid a resource leak, every open [BLOB handle] should eventually
6171 ** be released by a call to [sqlite3_blob_close()].
6172 */
6173 SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
6174 sqlite3*,
6175 const char *zDb,
6176 const char *zTable,
6177 const char *zColumn,
6178 sqlite3_int64 iRow,
@@ -6200,11 +6201,11 @@
6201 ** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
6202 ** always returns zero.
6203 **
6204 ** ^This function sets the database handle error code and message.
6205 */
6206 SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
6207
6208 /*
6209 ** CAPI3REF: Close A BLOB Handle
6210 ** DESTRUCTOR: sqlite3_blob
6211 **
@@ -6223,11 +6224,11 @@
6224 ** with a null pointer (such as would be returned by a failed call to
6225 ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function
6226 ** is passed a valid open blob handle, the values returned by the
6227 ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning.
6228 */
6229 SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *);
6230
6231 /*
6232 ** CAPI3REF: Return The Size Of An Open BLOB
6233 ** METHOD: sqlite3_blob
6234 **
@@ -6239,11 +6240,11 @@
6240 ** This routine only works on a [BLOB handle] which has been created
6241 ** by a prior successful call to [sqlite3_blob_open()] and which has not
6242 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6243 ** to this routine results in undefined and probably undesirable behavior.
6244 */
6245 SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *);
6246
6247 /*
6248 ** CAPI3REF: Read Data From A BLOB Incrementally
6249 ** METHOD: sqlite3_blob
6250 **
@@ -6268,11 +6269,11 @@
6269 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6270 ** to this routine results in undefined and probably undesirable behavior.
6271 **
6272 ** See also: [sqlite3_blob_write()].
6273 */
6274 SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
6275
6276 /*
6277 ** CAPI3REF: Write Data Into A BLOB Incrementally
6278 ** METHOD: sqlite3_blob
6279 **
@@ -6310,11 +6311,11 @@
6311 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6312 ** to this routine results in undefined and probably undesirable behavior.
6313 **
6314 ** See also: [sqlite3_blob_read()].
6315 */
6316 SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
6317
6318 /*
6319 ** CAPI3REF: Virtual File System Objects
6320 **
6321 ** A virtual filesystem (VFS) is an [sqlite3_vfs] object
@@ -6341,13 +6342,13 @@
6342 **
6343 ** ^Unregister a VFS with the sqlite3_vfs_unregister() interface.
6344 ** ^(If the default VFS is unregistered, another VFS is chosen as
6345 ** the default. The choice for the new VFS is arbitrary.)^
6346 */
6347 SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfsName);
6348 SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
6349 SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs*);
6350
6351 /*
6352 ** CAPI3REF: Mutexes
6353 **
6354 ** The SQLite core uses these routines for thread
@@ -6459,15 +6460,15 @@
6460 ** sqlite3_mutex_leave() is a NULL pointer, then all three routines
6461 ** behave as no-ops.
6462 **
6463 ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
6464 */
6465 SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int);
6466 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*);
6467 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*);
6468 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*);
6469 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*);
6470
6471 /*
6472 ** CAPI3REF: Mutex Methods Object
6473 **
6474 ** An instance of this structure defines the low-level routines
@@ -6532,19 +6533,19 @@
6533 ** If xMutexInit fails in any way, it is expected to clean up after itself
6534 ** prior to returning.
6535 */
6536 typedef struct sqlite3_mutex_methods sqlite3_mutex_methods;
6537 struct sqlite3_mutex_methods {
6538 int (*xMutexInit)(void);
6539 int (*xMutexEnd)(void);
6540 sqlite3_mutex *(*xMutexAlloc)(int);
6541 void (*xMutexFree)(sqlite3_mutex *);
6542 void (*xMutexEnter)(sqlite3_mutex *);
6543 int (*xMutexTry)(sqlite3_mutex *);
6544 void (*xMutexLeave)(sqlite3_mutex *);
6545 int (*xMutexHeld)(sqlite3_mutex *);
6546 int (*xMutexNotheld)(sqlite3_mutex *);
6547 };
6548
6549 /*
6550 ** CAPI3REF: Mutex Verification Routines
6551 **
@@ -6573,12 +6574,12 @@
6574 ** call to sqlite3_mutex_held() to fail, so a non-zero return is
6575 ** the appropriate thing to do. The sqlite3_mutex_notheld()
6576 ** interface should also return 1 when given a NULL pointer.
6577 */
6578 #ifndef NDEBUG
6579 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex*);
6580 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex*);
6581 #endif
6582
6583 /*
6584 ** CAPI3REF: Mutex Types
6585 **
@@ -6614,11 +6615,11 @@
6615 ** serializes access to the [database connection] given in the argument
6616 ** when the [threading mode] is Serialized.
6617 ** ^If the [threading mode] is Single-thread or Multi-thread then this
6618 ** routine returns a NULL pointer.
6619 */
6620 SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3*);
6621
6622 /*
6623 ** CAPI3REF: Low-Level Control Of Database Files
6624 ** METHOD: sqlite3
6625 **
@@ -6649,11 +6650,11 @@
6650 ** an incorrect zDbName and an SQLITE_ERROR return from the underlying
6651 ** xFileControl method.
6652 **
6653 ** See also: [SQLITE_FCNTL_LOCKSTATE]
6654 */
6655 SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
6656
6657 /*
6658 ** CAPI3REF: Testing Interface
6659 **
6660 ** ^The sqlite3_test_control() interface is used to read out internal
@@ -6731,12 +6732,12 @@
6732 ** be represented by a 32-bit integer, then the values returned by
6733 ** sqlite3_status() are undefined.
6734 **
6735 ** See also: [sqlite3_db_status()]
6736 */
6737 SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6738 SQLITE_API int SQLITE_STDCALL sqlite3_status64(
6739 int op,
6740 sqlite3_int64 *pCurrent,
6741 sqlite3_int64 *pHighwater,
6742 int resetFlag
6743 );
@@ -6857,11 +6858,11 @@
6858 ** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a
6859 ** non-zero [error code] on failure.
6860 **
6861 ** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
6862 */
6863 SQLITE_API int SQLITE_STDCALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
6864
6865 /*
6866 ** CAPI3REF: Status Parameters for database connections
6867 ** KEYWORDS: {SQLITE_DBSTATUS options}
6868 **
@@ -7000,11 +7001,11 @@
7001 ** ^If the resetFlg is true, then the counter is reset to zero after this
7002 ** interface call returns.
7003 **
7004 ** See also: [sqlite3_status()] and [sqlite3_db_status()].
7005 */
7006 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
7007
7008 /*
7009 ** CAPI3REF: Status Parameters for prepared statements
7010 ** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters}
7011 **
@@ -7236,22 +7237,22 @@
7237 */
7238 typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2;
7239 struct sqlite3_pcache_methods2 {
7240 int iVersion;
7241 void *pArg;
7242 int (*xInit)(void*);
7243 void (*xShutdown)(void*);
7244 sqlite3_pcache *(*xCreate)(int szPage, int szExtra, int bPurgeable);
7245 void (*xCachesize)(sqlite3_pcache*, int nCachesize);
7246 int (*xPagecount)(sqlite3_pcache*);
7247 sqlite3_pcache_page *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7248 void (*xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard);
7249 void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*,
7250 unsigned oldKey, unsigned newKey);
7251 void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
7252 void (*xDestroy)(sqlite3_pcache*);
7253 void (*xShrink)(sqlite3_pcache*);
7254 };
7255
7256 /*
7257 ** This is the obsolete pcache_methods object that has now been replaced
7258 ** by sqlite3_pcache_methods2. This object is not used by SQLite. It is
@@ -7258,20 +7259,20 @@
7259 ** retained in the header file for backwards compatibility only.
7260 */
7261 typedef struct sqlite3_pcache_methods sqlite3_pcache_methods;
7262 struct sqlite3_pcache_methods {
7263 void *pArg;
7264 int (*xInit)(void*);
7265 void (*xShutdown)(void*);
7266 sqlite3_pcache *(*xCreate)(int szPage, int bPurgeable);
7267 void (*xCachesize)(sqlite3_pcache*, int nCachesize);
7268 int (*xPagecount)(sqlite3_pcache*);
7269 void *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7270 void (*xUnpin)(sqlite3_pcache*, void*, int discard);
7271 void (*xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey);
7272 void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
7273 void (*xDestroy)(sqlite3_pcache*);
7274 };
7275
7276
7277 /*
7278 ** CAPI3REF: Online Backup Object
@@ -7469,20 +7470,20 @@
7470 ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()
7471 ** APIs are not strictly speaking threadsafe. If they are invoked at the
7472 ** same time as another thread is invoking sqlite3_backup_step() it is
7473 ** possible that they return invalid values.
7474 */
7475 SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
7476 sqlite3 *pDest, /* Destination database handle */
7477 const char *zDestName, /* Destination database name */
7478 sqlite3 *pSource, /* Source database handle */
7479 const char *zSourceName /* Source database name */
7480 );
7481 SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage);
7482 SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p);
7483 SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p);
7484 SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p);
7485
7486 /*
7487 ** CAPI3REF: Unlock Notification
7488 ** METHOD: sqlite3
7489 **
@@ -7595,13 +7596,13 @@
7596 ** by an sqlite3_step() call. ^(If there is a blocking connection, then the
7597 ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in
7598 ** the special "DROP TABLE/INDEX" case, the extended error code is just
7599 ** SQLITE_LOCKED.)^
7600 */
7601 SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
7602 sqlite3 *pBlocked, /* Waiting connection */
7603 void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */
7604 void *pNotifyArg /* Argument to pass to xNotify */
7605 );
7606
7607
7608 /*
@@ -7610,12 +7611,12 @@
7611 ** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications
7612 ** and extensions to compare the contents of two buffers containing UTF-8
7613 ** strings in a case-independent fashion, using the same definition of "case
7614 ** independence" that SQLite uses internally when comparing identifiers.
7615 */
7616 SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *, const char *);
7617 SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *, const char *, int);
7618
7619 /*
7620 ** CAPI3REF: String Globbing
7621 *
7622 ** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if
@@ -7628,11 +7629,11 @@
7629 ** Note that this routine returns zero on a match and non-zero if the strings
7630 ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
7631 **
7632 ** See also: [sqlite3_strlike()].
7633 */
7634 SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlob, const char *zStr);
7635
7636 /*
7637 ** CAPI3REF: String LIKE Matching
7638 *
7639 ** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if
@@ -7651,11 +7652,11 @@
7652 ** Note that this routine returns zero on a match and non-zero if the strings
7653 ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
7654 **
7655 ** See also: [sqlite3_strglob()].
7656 */
7657 SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
7658
7659 /*
7660 ** CAPI3REF: Error Logging Interface
7661 **
7662 ** ^The [sqlite3_log()] interface writes a message into the [error log]
@@ -7710,13 +7711,13 @@
7711 ** previously registered write-ahead log callback. ^Note that the
7712 ** [sqlite3_wal_autocheckpoint()] interface and the
7713 ** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will
7714 ** overwrite any prior [sqlite3_wal_hook()] settings.
7715 */
7716 SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
7717 sqlite3*,
7718 int(*)(void *,sqlite3*,const char*,int),
7719 void*
7720 );
7721
7722 /*
7723 ** CAPI3REF: Configure an auto-checkpoint
@@ -7745,11 +7746,11 @@
7746 ** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]
7747 ** pages. The use of this interface
7748 ** is only necessary if the default setting is found to be suboptimal
7749 ** for a particular application.
7750 */
7751 SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
7752
7753 /*
7754 ** CAPI3REF: Checkpoint a database
7755 ** METHOD: sqlite3
7756 **
@@ -7767,11 +7768,11 @@
7768 ** interface was added. This interface is retained for backwards
7769 ** compatibility and as a convenience for applications that need to manually
7770 ** start a callback but which do not need the full power (and corresponding
7771 ** complication) of [sqlite3_wal_checkpoint_v2()].
7772 */
7773 SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
7774
7775 /*
7776 ** CAPI3REF: Checkpoint a database
7777 ** METHOD: sqlite3
7778 **
@@ -7861,11 +7862,11 @@
7862 ** [sqlite3_errcode()] and [sqlite3_errmsg()].
7863 **
7864 ** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface
7865 ** from SQL.
7866 */
7867 SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
7868 sqlite3 *db, /* Database handle */
7869 const char *zDb, /* Name of attached database (or NULL) */
7870 int eMode, /* SQLITE_CHECKPOINT_* value */
7871 int *pnLog, /* OUT: Size of WAL log in frames */
7872 int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -7950,11 +7951,11 @@
7951 ** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL],
7952 ** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode
7953 ** of the SQL statement that triggered the call to the [xUpdate] method of the
7954 ** [virtual table].
7955 */
7956 SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *);
7957
7958 /*
7959 ** CAPI3REF: Conflict resolution modes
7960 ** KEYWORDS: {conflict resolution mode}
7961 **
@@ -8055,11 +8056,11 @@
8056 ** as if the loop did not exist - it returns non-zero and leave the variable
8057 ** that pOut points to unchanged.
8058 **
8059 ** See also: [sqlite3_stmt_scanstatus_reset()]
8060 */
8061 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus(
8062 sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
8063 int idx, /* Index of loop to report on */
8064 int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
8065 void *pOut /* Result written here */
8066 );
@@ -8071,11 +8072,11 @@
8072 ** ^Zero all [sqlite3_stmt_scanstatus()] related event counters.
8073 **
8074 ** This API is only available if the library is built with pre-processor
8075 ** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined.
8076 */
8077 SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
8078
8079 /*
8080 ** CAPI3REF: Flush caches to disk mid-transaction
8081 **
8082 ** ^If a write-transaction is open on [database connection] D when the
@@ -8103,11 +8104,11 @@
8104 ** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK.
8105 **
8106 ** ^This function does not set the database handle error code or message
8107 ** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions.
8108 */
8109 SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3*);
8110
8111 /*
8112 ** CAPI3REF: The pre-update hook.
8113 **
8114 ** ^These interfaces are only available if SQLite is compiled using the
@@ -8183,13 +8184,13 @@
8184 ** triggers; or 2 for changes resulting from triggers called by top-level
8185 ** triggers; and so forth.
8186 **
8187 ** See also: [sqlite3_update_hook()]
8188 */
8189 SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_STDCALL sqlite3_preupdate_hook(
8190 sqlite3 *db,
8191 void(*xPreUpdate)(
8192 void *pCtx, /* Copy of third arg to preupdate_hook() */
8193 sqlite3 *db, /* Database handle */
8194 int op, /* SQLITE_UPDATE, DELETE or INSERT */
8195 char const *zDb, /* Database name */
8196 char const *zName, /* Table name */
@@ -8196,14 +8197,14 @@
8197 sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */
8198 sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */
8199 ),
8200 void*
8201 );
8202 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **);
8203 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *);
8204 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *);
8205 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **);
8206
8207 /*
8208 ** CAPI3REF: Low-level system error code
8209 **
8210 ** ^Attempt to return the underlying operating system error code or error
@@ -8211,11 +8212,11 @@
8212 ** The return value is OS-dependent. For example, on unix systems, after
8213 ** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be
8214 ** called to get back the underlying "errno" that caused the problem, such
8215 ** as ENOSPC, EAUTH, EISDIR, and so forth.
8216 */
8217 SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3*);
8218
8219 /*
8220 ** CAPI3REF: Database Snapshot
8221 ** KEYWORDS: {snapshot}
8222 ** EXPERIMENTAL
@@ -8261,11 +8262,11 @@
8262 ** to avoid a memory leak.
8263 **
8264 ** The [sqlite3_snapshot_get()] interface is only available when the
8265 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8266 */
8267 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_get(
8268 sqlite3 *db,
8269 const char *zSchema,
8270 sqlite3_snapshot **ppSnapshot
8271 );
8272
@@ -8299,11 +8300,11 @@
8300 ** database connection in order to make it ready to use snapshots.)
8301 **
8302 ** The [sqlite3_snapshot_open()] interface is only available when the
8303 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8304 */
8305 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_open(
8306 sqlite3 *db,
8307 const char *zSchema,
8308 sqlite3_snapshot *pSnapshot
8309 );
8310
@@ -8316,11 +8317,11 @@
8317 ** using this routine to avoid a memory leak.
8318 **
8319 ** The [sqlite3_snapshot_free()] interface is only available when the
8320 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8321 */
8322 SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot*);
8323
8324 /*
8325 ** CAPI3REF: Compare the ages of two snapshot handles.
8326 ** EXPERIMENTAL
8327 **
@@ -8340,11 +8341,11 @@
8341 **
8342 ** Otherwise, this API returns a negative value if P1 refers to an older
8343 ** snapshot than P2, zero if the two handles refer to the same database
8344 ** snapshot, and a positive value if P1 is a newer snapshot than P2.
8345 */
8346 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_cmp(
8347 sqlite3_snapshot *p1,
8348 sqlite3_snapshot *p2
8349 );
8350
8351 /*
@@ -8398,14 +8399,14 @@
8399 ** Register a geometry callback named zGeom that can be used as part of an
8400 ** R-Tree geometry query as follows:
8401 **
8402 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
8403 */
8404 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
8405 sqlite3 *db,
8406 const char *zGeom,
8407 int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
8408 void *pContext
8409 );
8410
8411
8412 /*
@@ -8415,25 +8416,25 @@
8416 struct sqlite3_rtree_geometry {
8417 void *pContext; /* Copy of pContext passed to s_r_g_c() */
8418 int nParam; /* Size of array aParam[] */
8419 sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */
8420 void *pUser; /* Callback implementation user data */
8421 void (*xDelUser)(void *); /* Called by SQLite to clean up pUser */
8422 };
8423
8424 /*
8425 ** Register a 2nd-generation geometry callback named zScore that can be
8426 ** used as part of an R-Tree geometry query as follows:
8427 **
8428 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...)
8429 */
8430 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
8431 sqlite3 *db,
8432 const char *zQueryFunc,
8433 int (*xQueryFunc)(sqlite3_rtree_query_info*),
8434 void *pContext,
8435 void (*xDestructor)(void*)
8436 );
8437
8438
8439 /*
8440 ** A pointer to a structure of the following type is passed as the
@@ -8447,11 +8448,11 @@
8448 struct sqlite3_rtree_query_info {
8449 void *pContext; /* pContext from when function registered */
8450 int nParam; /* Number of function parameters */
8451 sqlite3_rtree_dbl *aParam; /* value of function parameters */
8452 void *pUser; /* callback can use this, if desired */
8453 void (*xDelUser)(void*); /* function to free pUser */
8454 sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */
8455 unsigned int *anQueue; /* Number of pending entries in the queue */
8456 int nCoord; /* Number of coordinates */
8457 int iLevel; /* Level of current node or entry */
8458 int mxLevel; /* The largest iLevel value in the tree */
@@ -8643,11 +8644,11 @@
8644 ** If xFilter returns 0, changes is not tracked. Note that once a table is
8645 ** attached, xFilter will not be called again.
8646 */
8647 void sqlite3session_table_filter(
8648 sqlite3_session *pSession, /* Session object */
8649 int(*xFilter)(
8650 void *pCtx, /* Copy of third arg to _filter_table() */
8651 const char *zTab /* Table name */
8652 ),
8653 void *pCtx /* First argument passed to xFilter */
8654 );
@@ -9218,11 +9219,11 @@
9219 ** An sqlite3_changegroup object is used to combine two or more changesets
9220 ** (or patchsets) into a single changeset (or patchset). A single changegroup
9221 ** object may combine changesets or patchsets, but not both. The output is
9222 ** always in the same format as the input.
9223 **
9224 ** If successful, this function returns SQLITE_OK and populates (*pp) with
9225 ** a pointer to a new sqlite3_changegroup object before returning. The caller
9226 ** should eventually free the returned object using a call to
9227 ** sqlite3changegroup_delete(). If an error occurs, an SQLite error code
9228 ** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL.
9229 **
@@ -9338,11 +9339,11 @@
9339 ** changes for tables that do not appear in the first changeset, they are
9340 ** appended onto the end of the output changeset, again in the order in
9341 ** which they are first encountered.
9342 **
9343 ** If an error occurs, an SQLite error code is returned and the output
9344 ** variables (*pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK
9345 ** is returned and the output variables are set to the size of and a
9346 ** pointer to the output buffer, respectively. In this case it is the
9347 ** responsibility of the caller to eventually free the buffer using a
9348 ** call to sqlite3_free().
9349 */
@@ -9495,15 +9496,15 @@
9496 */
9497 int sqlite3changeset_apply(
9498 sqlite3 *db, /* Apply change to "main" db of this handle */
9499 int nChangeset, /* Size of changeset in bytes */
9500 void *pChangeset, /* Changeset blob */
9501 int(*xFilter)(
9502 void *pCtx, /* Copy of sixth arg to _apply() */
9503 const char *zTab /* Table name */
9504 ),
9505 int(*xConflict)(
9506 void *pCtx, /* Copy of sixth arg to _apply() */
9507 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
9508 sqlite3_changeset_iter *p /* Handle describing change and conflict */
9509 ),
9510 void *pCtx /* First argument passed to xConflict */
@@ -9640,20 +9641,20 @@
9641 ** </pre>
9642 **
9643 ** Is replaced by:
9644 **
9645 ** <pre>
9646 ** &nbsp; int (*xInput)(void *pIn, void *pData, int *pnData),
9647 ** &nbsp; void *pIn,
9648 ** </pre>
9649 **
9650 ** Each time the xInput callback is invoked by the sessions module, the first
9651 ** argument passed is a copy of the supplied pIn context pointer. The second
9652 ** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no
9653 ** error occurs the xInput method should copy up to (*pnData) bytes of data
9654 ** into the buffer and set (*pnData) to the actual number of bytes copied
9655 ** before returning SQLITE_OK. If the input is completely exhausted, (*pnData)
9656 ** should be set to zero to indicate this. Or, if an error occurs, an SQLite
9657 ** error code should be returned. In all cases, if an xInput callback returns
9658 ** an error, all processing is abandoned and the streaming API function
9659 ** returns a copy of the error code to the caller.
9660 **
@@ -9674,11 +9675,11 @@
9675 ** </pre>
9676 **
9677 ** Is replaced by:
9678 **
9679 ** <pre>
9680 ** &nbsp; int (*xOutput)(void *pOut, const void *pData, int nData),
9681 ** &nbsp; void *pOut
9682 ** </pre>
9683 **
9684 ** The xOutput callback is invoked zero or more times to return data to
9685 ** the application. The first parameter passed to each call is a copy of the
@@ -9694,58 +9695,58 @@
9695 ** parameter set to a value less than or equal to zero. Other than this,
9696 ** no guarantees are made as to the size of the chunks of data returned.
9697 */
9698 int sqlite3changeset_apply_strm(
9699 sqlite3 *db, /* Apply change to "main" db of this handle */
9700 int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
9701 void *pIn, /* First arg for xInput */
9702 int(*xFilter)(
9703 void *pCtx, /* Copy of sixth arg to _apply() */
9704 const char *zTab /* Table name */
9705 ),
9706 int(*xConflict)(
9707 void *pCtx, /* Copy of sixth arg to _apply() */
9708 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
9709 sqlite3_changeset_iter *p /* Handle describing change and conflict */
9710 ),
9711 void *pCtx /* First argument passed to xConflict */
9712 );
9713 int sqlite3changeset_concat_strm(
9714 int (*xInputA)(void *pIn, void *pData, int *pnData),
9715 void *pInA,
9716 int (*xInputB)(void *pIn, void *pData, int *pnData),
9717 void *pInB,
9718 int (*xOutput)(void *pOut, const void *pData, int nData),
9719 void *pOut
9720 );
9721 int sqlite3changeset_invert_strm(
9722 int (*xInput)(void *pIn, void *pData, int *pnData),
9723 void *pIn,
9724 int (*xOutput)(void *pOut, const void *pData, int nData),
9725 void *pOut
9726 );
9727 int sqlite3changeset_start_strm(
9728 sqlite3_changeset_iter **pp,
9729 int (*xInput)(void *pIn, void *pData, int *pnData),
9730 void *pIn
9731 );
9732 int sqlite3session_changeset_strm(
9733 sqlite3_session *pSession,
9734 int (*xOutput)(void *pOut, const void *pData, int nData),
9735 void *pOut
9736 );
9737 int sqlite3session_patchset_strm(
9738 sqlite3_session *pSession,
9739 int (*xOutput)(void *pOut, const void *pData, int nData),
9740 void *pOut
9741 );
9742 int sqlite3changegroup_add_strm(sqlite3_changegroup*,
9743 int (*xInput)(void *pIn, void *pData, int *pnData),
9744 void *pIn
9745 );
9746 int sqlite3changegroup_output_strm(sqlite3_changegroup*,
9747 int (*xOutput)(void *pOut, const void *pData, int nData),
9748 void *pOut
9749 );
9750
9751
9752 /*
@@ -9796,11 +9797,11 @@
9797
9798 typedef struct Fts5ExtensionApi Fts5ExtensionApi;
9799 typedef struct Fts5Context Fts5Context;
9800 typedef struct Fts5PhraseIter Fts5PhraseIter;
9801
9802 typedef void (*fts5_extension_function)(
9803 const Fts5ExtensionApi *pApi, /* API offered by current FTS version */
9804 Fts5Context *pFts, /* First arg to pass to pApi functions */
9805 sqlite3_context *pCtx, /* Context for returning result/error */
9806 int nVal, /* Number of values in apVal[] array */
9807 sqlite3_value **apVal /* Array of trailing arguments */
@@ -9847,15 +9848,15 @@
9848 ** This function may be quite inefficient if used with an FTS5 table
9849 ** created with the "columnsize=0" option.
9850 **
9851 ** xColumnText:
9852 ** This function attempts to retrieve the text of column iCol of the
9853 ** current document. If successful, (*pz) is set to point to a buffer
9854 ** containing the text in utf-8 encoding, (*pn) is set to the size in bytes
9855 ** (not characters) of the buffer and SQLITE_OK is returned. Otherwise,
9856 ** if an error occurs, an SQLite error code is returned and the final values
9857 ** of (*pz) and (*pn) are undefined.
9858 **
9859 ** xPhraseCount:
9860 ** Returns the number of phrases in the current query expression.
9861 **
9862 ** xPhraseSize:
@@ -9960,11 +9961,11 @@
9961 ** xRowCount(pFts5, pnRow)
9962 **
9963 ** This function is used to retrieve the total number of rows in the table.
9964 ** In other words, the same value that would be returned by:
9965 **
9966 ** SELECT count(*) FROM ftstable;
9967 **
9968 ** xPhraseFirst()
9969 ** This function is used, along with type Fts5PhraseIter and the xPhraseNext
9970 ** method, to iterate through all instances of a single query phrase within
9971 ** the current row. This is the same information as is accessible via the
@@ -10027,43 +10028,43 @@
10028 ** See xPhraseFirstColumn above.
10029 */
10030 struct Fts5ExtensionApi {
10031 int iVersion; /* Currently always set to 3 */
10032
10033 void *(*xUserData)(Fts5Context*);
10034
10035 int (*xColumnCount)(Fts5Context*);
10036 int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow);
10037 int (*xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken);
10038
10039 int (*xTokenize)(Fts5Context*,
10040 const char *pText, int nText, /* Text to tokenize */
10041 void *pCtx, /* Context passed to xToken() */
10042 int (*xToken)(void*, int, const char*, int, int, int) /* Callback */
10043 );
10044
10045 int (*xPhraseCount)(Fts5Context*);
10046 int (*xPhraseSize)(Fts5Context*, int iPhrase);
10047
10048 int (*xInstCount)(Fts5Context*, int *pnInst);
10049 int (*xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff);
10050
10051 sqlite3_int64 (*xRowid)(Fts5Context*);
10052 int (*xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn);
10053 int (*xColumnSize)(Fts5Context*, int iCol, int *pnToken);
10054
10055 int (*xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData,
10056 int(*)(const Fts5ExtensionApi*,Fts5Context*,void*)
10057 );
10058 int (*xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*));
10059 void *(*xGetAuxdata)(Fts5Context*, int bClear);
10060
10061 int (*xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*);
10062 void (*xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff);
10063
10064 int (*xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*);
10065 void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol);
10066 };
10067
10068 /*
10069 ** CUSTOM AUXILIARY FUNCTIONS
10070 *************************************************************************/
@@ -10087,11 +10088,11 @@
10088 ** The second and third arguments are an array of nul-terminated strings
10089 ** containing the tokenizer arguments, if any, specified following the
10090 ** tokenizer name as part of the CREATE VIRTUAL TABLE statement used
10091 ** to create the FTS5 table.
10092 **
10093 ** The final argument is an output variable. If successful, (*ppOut)
10094 ** should be set to point to the new tokenizer handle and SQLITE_OK
10095 ** returned. If an error occurs, some value other than SQLITE_OK should
10096 ** be returned. In this case, fts5 assumes that the final value of *ppOut
10097 ** is undefined.
10098 **
@@ -10261,17 +10262,17 @@
10262 ** inefficient.
10263 */
10264 typedef struct Fts5Tokenizer Fts5Tokenizer;
10265 typedef struct fts5_tokenizer fts5_tokenizer;
10266 struct fts5_tokenizer {
10267 int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
10268 void (*xDelete)(Fts5Tokenizer*);
10269 int (*xTokenize)(Fts5Tokenizer*,
10270 void *pCtx,
10271 int flags, /* Mask of FTS5_TOKENIZE_* flags */
10272 const char *pText, int nText,
10273 int (*xToken)(
10274 void *pCtx, /* Copy of 2nd argument to xTokenize() */
10275 int tflags, /* Mask of FTS5_TOKEN_* flags */
10276 const char *pToken, /* Pointer to buffer containing token */
10277 int nToken, /* Size of token in bytes */
10278 int iStart, /* Byte offset of token within input text */
@@ -10300,33 +10301,33 @@
10301 typedef struct fts5_api fts5_api;
10302 struct fts5_api {
10303 int iVersion; /* Currently always set to 2 */
10304
10305 /* Create a new tokenizer */
10306 int (*xCreateTokenizer)(
10307 fts5_api *pApi,
10308 const char *zName,
10309 void *pContext,
10310 fts5_tokenizer *pTokenizer,
10311 void (*xDestroy)(void*)
10312 );
10313
10314 /* Find an existing tokenizer */
10315 int (*xFindTokenizer)(
10316 fts5_api *pApi,
10317 const char *zName,
10318 void **ppContext,
10319 fts5_tokenizer *pTokenizer
10320 );
10321
10322 /* Create a new auxiliary function */
10323 int (*xCreateFunction)(
10324 fts5_api *pApi,
10325 const char *zName,
10326 void *pContext,
10327 fts5_extension_function xFunction,
10328 void (*xDestroy)(void*)
10329 );
10330 };
10331
10332 /*
10333 ** END OF REGISTRATION API
10334

Keyboard Shortcuts

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