Fossil SCM

Merge updates from trunk.

drh 2016-08-08 14:44 jan-manifest-tags merge
Commit f63576a79652366103f68dd54f68974fabb9d17d
+1 -1
--- src/branch.c
+++ src/branch.c
@@ -188,11 +188,11 @@
188188
#define BRL_CLOSED_ONLY 0x001 /* Show only closed branches */
189189
#define BRL_OPEN_ONLY 0x002 /* Show only open branches */
190190
#define BRL_BOTH 0x003 /* Show both open and closed branches */
191191
#define BRL_OPEN_CLOSED_MASK 0x003
192192
#define BRL_MTIME 0x004 /* Include lastest check-in time */
193
-#dfeine BRL_ORDERBY_MTIME 0x008 /* Sort by MTIME. (otherwise sort by name)*/
193
+#define BRL_ORDERBY_MTIME 0x008 /* Sort by MTIME. (otherwise sort by name)*/
194194
195195
#endif /* INTERFACE */
196196
197197
/*
198198
** Prepare a query that will list branches.
199199
--- src/branch.c
+++ src/branch.c
@@ -188,11 +188,11 @@
188 #define BRL_CLOSED_ONLY 0x001 /* Show only closed branches */
189 #define BRL_OPEN_ONLY 0x002 /* Show only open branches */
190 #define BRL_BOTH 0x003 /* Show both open and closed branches */
191 #define BRL_OPEN_CLOSED_MASK 0x003
192 #define BRL_MTIME 0x004 /* Include lastest check-in time */
193 #dfeine BRL_ORDERBY_MTIME 0x008 /* Sort by MTIME. (otherwise sort by name)*/
194
195 #endif /* INTERFACE */
196
197 /*
198 ** Prepare a query that will list branches.
199
--- src/branch.c
+++ src/branch.c
@@ -188,11 +188,11 @@
188 #define BRL_CLOSED_ONLY 0x001 /* Show only closed branches */
189 #define BRL_OPEN_ONLY 0x002 /* Show only open branches */
190 #define BRL_BOTH 0x003 /* Show both open and closed branches */
191 #define BRL_OPEN_CLOSED_MASK 0x003
192 #define BRL_MTIME 0x004 /* Include lastest check-in time */
193 #define BRL_ORDERBY_MTIME 0x008 /* Sort by MTIME. (otherwise sort by name)*/
194
195 #endif /* INTERFACE */
196
197 /*
198 ** Prepare a query that will list branches.
199
+60 -9
--- src/main.c
+++ src/main.c
@@ -2023,24 +2023,75 @@
20232023
}
20242024
20252025
/*
20262026
** COMMAND: cgi*
20272027
**
2028
-** Usage: %fossil ?cgi? SCRIPT
2028
+** Usage: %fossil ?cgi? FILE
2029
+**
2030
+** This command causes Fossil to generate reply to a CGI request.
20292031
**
2030
-** The SCRIPT argument is the name of a file that is the CGI script
2031
-** that is being run. The command name, "cgi", may be omitted if
2032
-** the GATEWAY_INTERFACE environment variable is set to "CGI" (which
2033
-** should always be the case for CGI scripts run by a webserver.) The
2034
-** SCRIPT file should look something like this:
2032
+** The FILE argument is the name of a control file that provides Fossil
2033
+** with important information such as where to find its repository. In
2034
+** a typical CGI deployment, FILE is the name of the CGI script and will
2035
+** typically look something like this:
20352036
**
20362037
** #!/usr/bin/fossil
20372038
** repository: /home/somebody/project.db
20382039
**
2039
-** The second line defines the name of the repository. After locating
2040
-** the repository, fossil will generate a webpage on stdout based on
2041
-** the values of standard CGI environment variables.
2040
+** The command name, "cgi", may be omitted if the GATEWAY_INTERFACE
2041
+** environment variable is set to "CGI", which should always be the
2042
+** case for CGI scripts run by a webserver. Fossil ignores any lines
2043
+** that begin with "#".
2044
+**
2045
+** The following control lines are recognized:
2046
+**
2047
+** repository: PATH Name of the Fossil repository
2048
+**
2049
+** directory: PATH Name of a directory containing many Fossil
2050
+** repositories whose names all end with ".fossil".
2051
+** There should only be one of "repository:"
2052
+** or "directory:"
2053
+**
2054
+** notfound: URL When in "directory:" mode, redirect to
2055
+** URL if no suitable repository is found.
2056
+**
2057
+** repolist When in "directory:" mode, display a page
2058
+** showing a list of available repositories if
2059
+** the URL is "/".
2060
+**
2061
+** localauth Grant administrator privileges to connections
2062
+** from 127.0.0.1 or ::1.
2063
+**
2064
+** skin: LABEL Use the built-in skin called LABEL rather than
2065
+** the default. If there are no skins called LABEL
2066
+** then this line is a no-op.
2067
+**
2068
+** files: GLOBLIST GLOBLIST is a comma-separated list of GLOB
2069
+** patterns that specify files that can be
2070
+** returned verbatim. This feature allows Fossil
2071
+** to act as a web server returning static
2072
+** content.
2073
+**
2074
+** setenv: NAME VALUE Set environment variable NAME to VALUE. Or
2075
+** if VALUE is omitted, unset NAME.
2076
+**
2077
+** HOME: PATH Shorthand for "setenv: HOME PATH"
2078
+**
2079
+** debug: FILE Causing debugging information to be written
2080
+** into FILE.
2081
+**
2082
+** errorlog: FILE Warnings, errors, and panics written to FILE.
2083
+**
2084
+** redirect: REPO URL Extract the "name" query parameter and search
2085
+** REPO for a check-in or ticket that matches the
2086
+** value of "name", then redirect to URL. There
2087
+** can be multiple "redirect:" lines that are
2088
+** processed in order. If the REPO is "*", then
2089
+** an unconditional redirect to URL is taken.
2090
+**
2091
+** Most CGI files contain only a "repository:" line. It is uncommon to
2092
+** use any other option.
20422093
**
20432094
** See also: http, server, winsrv
20442095
*/
20452096
void cmd_cgi(void){
20462097
const char *zFile;
20472098
--- src/main.c
+++ src/main.c
@@ -2023,24 +2023,75 @@
2023 }
2024
2025 /*
2026 ** COMMAND: cgi*
2027 **
2028 ** Usage: %fossil ?cgi? SCRIPT
 
 
2029 **
2030 ** The SCRIPT argument is the name of a file that is the CGI script
2031 ** that is being run. The command name, "cgi", may be omitted if
2032 ** the GATEWAY_INTERFACE environment variable is set to "CGI" (which
2033 ** should always be the case for CGI scripts run by a webserver.) The
2034 ** SCRIPT file should look something like this:
2035 **
2036 ** #!/usr/bin/fossil
2037 ** repository: /home/somebody/project.db
2038 **
2039 ** The second line defines the name of the repository. After locating
2040 ** the repository, fossil will generate a webpage on stdout based on
2041 ** the values of standard CGI environment variables.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2042 **
2043 ** See also: http, server, winsrv
2044 */
2045 void cmd_cgi(void){
2046 const char *zFile;
2047
--- src/main.c
+++ src/main.c
@@ -2023,24 +2023,75 @@
2023 }
2024
2025 /*
2026 ** COMMAND: cgi*
2027 **
2028 ** Usage: %fossil ?cgi? FILE
2029 **
2030 ** This command causes Fossil to generate reply to a CGI request.
2031 **
2032 ** The FILE argument is the name of a control file that provides Fossil
2033 ** with important information such as where to find its repository. In
2034 ** a typical CGI deployment, FILE is the name of the CGI script and will
2035 ** typically look something like this:
 
2036 **
2037 ** #!/usr/bin/fossil
2038 ** repository: /home/somebody/project.db
2039 **
2040 ** The command name, "cgi", may be omitted if the GATEWAY_INTERFACE
2041 ** environment variable is set to "CGI", which should always be the
2042 ** case for CGI scripts run by a webserver. Fossil ignores any lines
2043 ** that begin with "#".
2044 **
2045 ** The following control lines are recognized:
2046 **
2047 ** repository: PATH Name of the Fossil repository
2048 **
2049 ** directory: PATH Name of a directory containing many Fossil
2050 ** repositories whose names all end with ".fossil".
2051 ** There should only be one of "repository:"
2052 ** or "directory:"
2053 **
2054 ** notfound: URL When in "directory:" mode, redirect to
2055 ** URL if no suitable repository is found.
2056 **
2057 ** repolist When in "directory:" mode, display a page
2058 ** showing a list of available repositories if
2059 ** the URL is "/".
2060 **
2061 ** localauth Grant administrator privileges to connections
2062 ** from 127.0.0.1 or ::1.
2063 **
2064 ** skin: LABEL Use the built-in skin called LABEL rather than
2065 ** the default. If there are no skins called LABEL
2066 ** then this line is a no-op.
2067 **
2068 ** files: GLOBLIST GLOBLIST is a comma-separated list of GLOB
2069 ** patterns that specify files that can be
2070 ** returned verbatim. This feature allows Fossil
2071 ** to act as a web server returning static
2072 ** content.
2073 **
2074 ** setenv: NAME VALUE Set environment variable NAME to VALUE. Or
2075 ** if VALUE is omitted, unset NAME.
2076 **
2077 ** HOME: PATH Shorthand for "setenv: HOME PATH"
2078 **
2079 ** debug: FILE Causing debugging information to be written
2080 ** into FILE.
2081 **
2082 ** errorlog: FILE Warnings, errors, and panics written to FILE.
2083 **
2084 ** redirect: REPO URL Extract the "name" query parameter and search
2085 ** REPO for a check-in or ticket that matches the
2086 ** value of "name", then redirect to URL. There
2087 ** can be multiple "redirect:" lines that are
2088 ** processed in order. If the REPO is "*", then
2089 ** an unconditional redirect to URL is taken.
2090 **
2091 ** Most CGI files contain only a "repository:" line. It is uncommon to
2092 ** use any other option.
2093 **
2094 ** See also: http, server, winsrv
2095 */
2096 void cmd_cgi(void){
2097 const char *zFile;
2098
+1 -1
--- src/purge.c
+++ src/purge.c
@@ -460,11 +460,11 @@
460460
** ==== WARNING: This command can potentially destroy historical data and ====
461461
** ==== leave your repository in a goofy state. Know what you are doing! ====
462462
** ==== Make a backup of your repository before using this command! ====
463463
**
464464
** ==== FURTHER WARNING: This command is a work-in-progress and may yet ====
465
-** ==== contains bugs. ====
465
+** ==== contain bugs. ====
466466
**
467467
** fossil purge artifacts UUID... ?OPTIONS?
468468
**
469469
** Move arbitrary artifacts identified by the UUID list into the
470470
** graveyard.
471471
--- src/purge.c
+++ src/purge.c
@@ -460,11 +460,11 @@
460 ** ==== WARNING: This command can potentially destroy historical data and ====
461 ** ==== leave your repository in a goofy state. Know what you are doing! ====
462 ** ==== Make a backup of your repository before using this command! ====
463 **
464 ** ==== FURTHER WARNING: This command is a work-in-progress and may yet ====
465 ** ==== contains bugs. ====
466 **
467 ** fossil purge artifacts UUID... ?OPTIONS?
468 **
469 ** Move arbitrary artifacts identified by the UUID list into the
470 ** graveyard.
471
--- src/purge.c
+++ src/purge.c
@@ -460,11 +460,11 @@
460 ** ==== WARNING: This command can potentially destroy historical data and ====
461 ** ==== leave your repository in a goofy state. Know what you are doing! ====
462 ** ==== Make a backup of your repository before using this command! ====
463 **
464 ** ==== FURTHER WARNING: This command is a work-in-progress and may yet ====
465 ** ==== contain bugs. ====
466 **
467 ** fossil purge artifacts UUID... ?OPTIONS?
468 **
469 ** Move arbitrary artifacts identified by the UUID list into the
470 ** graveyard.
471
--- src/setup.c
+++ src/setup.c
@@ -115,10 +115,12 @@
115115
setup_menu_entry("Moderation", "setup_modreq",
116116
"Enable/Disable requiring moderator approval of Wiki and/or Ticket"
117117
" changes and attachments.");
118118
setup_menu_entry("Ad-Unit", "setup_adunit",
119119
"Edit HTML text for an ad unit inserted after the menu bar");
120
+ setup_menu_entry("Web-Cache", "cachestat",
121
+ "View the status of the expensive-page cache");
120122
setup_menu_entry("Logo", "setup_logo",
121123
"Change the logo and background images for the server");
122124
setup_menu_entry("Shunned", "shun",
123125
"Show artifacts that are shunned by this repository");
124126
setup_menu_entry("Artifact Receipts Log", "rcvfromlist",
125127
--- src/setup.c
+++ src/setup.c
@@ -115,10 +115,12 @@
115 setup_menu_entry("Moderation", "setup_modreq",
116 "Enable/Disable requiring moderator approval of Wiki and/or Ticket"
117 " changes and attachments.");
118 setup_menu_entry("Ad-Unit", "setup_adunit",
119 "Edit HTML text for an ad unit inserted after the menu bar");
 
 
120 setup_menu_entry("Logo", "setup_logo",
121 "Change the logo and background images for the server");
122 setup_menu_entry("Shunned", "shun",
123 "Show artifacts that are shunned by this repository");
124 setup_menu_entry("Artifact Receipts Log", "rcvfromlist",
125
--- src/setup.c
+++ src/setup.c
@@ -115,10 +115,12 @@
115 setup_menu_entry("Moderation", "setup_modreq",
116 "Enable/Disable requiring moderator approval of Wiki and/or Ticket"
117 " changes and attachments.");
118 setup_menu_entry("Ad-Unit", "setup_adunit",
119 "Edit HTML text for an ad unit inserted after the menu bar");
120 setup_menu_entry("Web-Cache", "cachestat",
121 "View the status of the expensive-page cache");
122 setup_menu_entry("Logo", "setup_logo",
123 "Change the logo and background images for the server");
124 setup_menu_entry("Shunned", "shun",
125 "Show artifacts that are shunned by this repository");
126 setup_menu_entry("Artifact Receipts Log", "rcvfromlist",
127
+841 -788
--- 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-08 13:40:27 d5e98057028abcf7217d0d2b2e29bbbcdf09d6de"
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
@@ -2217,11 +2217,11 @@
22172217
** interface independently of the [load_extension()] SQL function.
22182218
** The [sqlite3_enable_load_extension()] API enables or disables both the
22192219
** C-API [sqlite3_load_extension()] and the SQL function [load_extension()].
22202220
** There should be two additional arguments.
22212221
** When the first argument to this interface is 1, then only the C-API is
2222
-** enabled and the SQL function remains disabled. If the first argment to
2222
+** enabled and the SQL function remains disabled. If the first argument to
22232223
** this interface is 0, then both the C-API and the SQL function are disabled.
22242224
** If the first argument is -1, then no changes are made to state of either the
22252225
** C-API or the SQL function.
22262226
** The second parameter is a pointer to an integer into which
22272227
** is written 0 or 1 to indicate whether [sqlite3_load_extension()] interface
@@ -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
@@ -5794,11 +5795,11 @@
57945795
** interface returns SQLITE_OK and fills in the non-NULL pointers in
57955796
** the final five arguments with appropriate values if the specified
57965797
** column exists. ^The sqlite3_table_column_metadata() interface returns
57975798
** SQLITE_ERROR and if the specified column does not exist.
57985799
** ^If the column-name parameter to sqlite3_table_column_metadata() is a
5799
-** NULL pointer, then this routine simply checks for the existance of the
5800
+** NULL pointer, then this routine simply checks for the existence of the
58005801
** table and returns SQLITE_OK if the table exists and SQLITE_ERROR if it
58015802
** does not.
58025803
**
58035804
** ^The column is identified by the second, third and fourth parameters to
58045805
** this function. ^(The second parameter is either the name of the database
@@ -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
@@ -8389,11 +8390,11 @@
83898390
** tables.
83908391
**
83918392
** ^The second parameter to the preupdate callback is a pointer to
83928393
** the [database connection] that registered the preupdate hook.
83938394
** ^The third parameter to the preupdate callback is one of the constants
8394
-** [SQLITE_INSERT], [SQLITE_DELETE], or [SQLITE_UPDATE] to indentify the
8395
+** [SQLITE_INSERT], [SQLITE_DELETE], or [SQLITE_UPDATE] to identify the
83958396
** kind of update operation that is about to occur.
83968397
** ^(The fourth parameter to the preupdate callback is the name of the
83978398
** database within the database connection that is being modified. This
83988399
** will be "main" for the main database or "temp" for TEMP tables or
83998400
** the name given after the AS keyword in the [ATTACH] statement for attached
@@ -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
*************************************************************************/
@@ -10336,11 +10337,11 @@
1033610337
** following structure. All structure methods must be defined, setting
1033710338
** any member of the fts5_tokenizer struct to NULL leads to undefined
1033810339
** behaviour. The structure methods are expected to function as follows:
1033910340
**
1034010341
** xCreate:
10341
-** This function is used to allocate and inititalize a tokenizer instance.
10342
+** This function is used to allocate and initialize a tokenizer instance.
1034210343
** A tokenizer instance is required to actually tokenize text.
1034310344
**
1034410345
** The first argument passed to this function is a copy of the (void*)
1034510346
** pointer provided by the application when the fts5_tokenizer object
1034610347
** was registered with FTS5 (the third argument to xCreateTokenizer()).
@@ -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
@@ -10595,11 +10596,10 @@
1059510596
#if 0
1059610597
} /* end of the 'extern "C"' block */
1059710598
#endif
1059810599
1059910600
#endif /* _FTS5_H */
10600
-
1060110601
1060210602
/******** End of fts5.h *********/
1060310603
1060410604
/************** End of sqlite3.h *********************************************/
1060510605
/************** Continuing where we left off in sqliteInt.h ******************/
@@ -11900,12 +11900,12 @@
1190011900
*/
1190111901
#ifdef SQLITE_OMIT_WSD
1190211902
#define SQLITE_WSD const
1190311903
#define GLOBAL(t,v) (*(t*)sqlite3_wsd_find((void*)&(v), sizeof(v)))
1190411904
#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);
11905
+SQLITE_API int SQLITE_STDCALL sqlite3_wsd_init(int N, int J);
11906
+SQLITE_API void *SQLITE_STDCALL sqlite3_wsd_find(void *K, int L);
1190711907
#else
1190811908
#define SQLITE_WSD
1190911909
#define GLOBAL(t,v) v
1191011910
#define sqlite3GlobalConfig sqlite3Config
1191111911
#endif
@@ -13083,10 +13083,11 @@
1308313083
SQLITE_PRIVATE sqlite3_file *sqlite3PagerJrnlFile(Pager*);
1308413084
SQLITE_PRIVATE const char *sqlite3PagerJournalname(Pager*);
1308513085
SQLITE_PRIVATE void *sqlite3PagerTempSpace(Pager*);
1308613086
SQLITE_PRIVATE int sqlite3PagerIsMemdb(Pager*);
1308713087
SQLITE_PRIVATE void sqlite3PagerCacheStat(Pager *, int, int, int *);
13088
+SQLITE_PRIVATE void sqlite3PagerClearCache(Pager*);
1308813089
SQLITE_PRIVATE int sqlite3SectorSize(sqlite3_file *);
1308913090
1309013091
/* Functions used to truncate the database file. */
1309113092
SQLITE_PRIVATE void sqlite3PagerTruncateImage(Pager*,Pgno);
1309213093
@@ -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
}
@@ -53411,10 +53411,21 @@
5341153411
** sqlite3BackupUpdate() only.
5341253412
*/
5341353413
SQLITE_PRIVATE sqlite3_backup **sqlite3PagerBackupPtr(Pager *pPager){
5341453414
return &pPager->pBackup;
5341553415
}
53416
+
53417
+#ifndef SQLITE_OMIT_VACUUM
53418
+/*
53419
+** Unless this is an in-memory or temporary database, clear the pager cache.
53420
+*/
53421
+SQLITE_PRIVATE void sqlite3PagerClearCache(Pager *pPager){
53422
+ assert( MEMDB==0 || pPager->tempFile );
53423
+ if( pPager->tempFile==0 ) pager_reset(pPager);
53424
+}
53425
+#endif
53426
+
5341653427
5341753428
#ifndef SQLITE_OMIT_WAL
5341853429
/*
5341953430
** This function is called when the user invokes "PRAGMA wal_checkpoint",
5342053431
** "PRAGMA wal_blocking_checkpoint" or calls the sqlite3_wal_checkpoint()
@@ -53636,11 +53647,10 @@
5363653647
SQLITE_PRIVATE int sqlite3PagerWalFramesize(Pager *pPager){
5363753648
assert( pPager->eState>=PAGER_READER );
5363853649
return sqlite3WalFramesize(pPager->pWal);
5363953650
}
5364053651
#endif
53641
-
5364253652
5364353653
#endif /* SQLITE_OMIT_DISKIO */
5364453654
5364553655
/************** End of pager.c ***********************************************/
5364653656
/************** Begin file wal.c *********************************************/
@@ -57053,11 +57063,11 @@
5705357063
5705457064
/*
5705557065
** Return a +ve value if snapshot p1 is newer than p2. A -ve value if
5705657066
** p1 is older than p2 and zero if p1 and p2 are the same snapshot.
5705757067
*/
57058
-SQLITE_API int SQLITE_APICALL sqlite3_snapshot_cmp(sqlite3_snapshot *p1, sqlite3_snapshot *p2){
57068
+SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_cmp(sqlite3_snapshot *p1, sqlite3_snapshot *p2){
5705957069
WalIndexHdr *pHdr1 = (WalIndexHdr*)p1;
5706057070
WalIndexHdr *pHdr2 = (WalIndexHdr*)p2;
5706157071
5706257072
/* aSalt[0] is a copy of the value stored in the wal file header. It
5706357073
** is incremented each time the wal file is restarted. */
@@ -58190,11 +58200,11 @@
5819058200
**
5819158201
** This routine has no effect on existing database connections.
5819258202
** The shared cache setting effects only future calls to
5819358203
** sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2().
5819458204
*/
58195
-SQLITE_API int SQLITE_APICALL sqlite3_enable_shared_cache(int enable){
58205
+SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int enable){
5819658206
sqlite3GlobalConfig.sharedCacheEnabled = enable;
5819758207
return SQLITE_OK;
5819858208
}
5819958209
#endif
5820058210
@@ -64489,11 +64499,11 @@
6448964499
}
6449064500
}
6449164501
6449264502
/*
6449364503
** A CellArray object contains a cache of pointers and sizes for a
64494
-** consecutive sequence of cells that might be held multiple pages.
64504
+** consecutive sequence of cells that might be held on multiple pages.
6449564505
*/
6449664506
typedef struct CellArray CellArray;
6449764507
struct CellArray {
6449864508
int nCell; /* Number of cells in apCell[] */
6449964509
MemPage *pRef; /* Reference page */
@@ -67963,11 +67973,11 @@
6796367973
** a pointer to the new sqlite3_backup object.
6796467974
**
6796567975
** If an error occurs, NULL is returned and an error code and error message
6796667976
** stored in database handle pDestDb.
6796767977
*/
67968
-SQLITE_API sqlite3_backup *SQLITE_APICALL sqlite3_backup_init(
67978
+SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
6796967979
sqlite3* pDestDb, /* Database to write to */
6797067980
const char *zDestDb, /* Name of database within pDestDb */
6797167981
sqlite3* pSrcDb, /* Database connection to read from */
6797267982
const char *zSrcDb /* Name of database within pSrcDb */
6797367983
){
@@ -68171,11 +68181,11 @@
6817168181
}
6817268182
6817368183
/*
6817468184
** Copy nPage pages from the source b-tree to the destination.
6817568185
*/
68176
-SQLITE_API int SQLITE_APICALL sqlite3_backup_step(sqlite3_backup *p, int nPage){
68186
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage){
6817768187
int rc;
6817868188
int destMode; /* Destination journal mode */
6817968189
int pgszSrc = 0; /* Source page size */
6818068190
int pgszDest = 0; /* Destination page size */
6818168191
@@ -68415,11 +68425,11 @@
6841568425
}
6841668426
6841768427
/*
6841868428
** Release all resources associated with an sqlite3_backup* handle.
6841968429
*/
68420
-SQLITE_API int SQLITE_APICALL sqlite3_backup_finish(sqlite3_backup *p){
68430
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p){
6842168431
sqlite3_backup **pp; /* Ptr to head of pagers backup list */
6842268432
sqlite3 *pSrcDb; /* Source database connection */
6842368433
int rc; /* Value to return */
6842468434
6842568435
/* Enter the mutexes */
@@ -68467,11 +68477,11 @@
6846768477
6846868478
/*
6846968479
** Return the number of pages still to be backed up as of the most recent
6847068480
** call to sqlite3_backup_step().
6847168481
*/
68472
-SQLITE_API int SQLITE_APICALL sqlite3_backup_remaining(sqlite3_backup *p){
68482
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p){
6847368483
#ifdef SQLITE_ENABLE_API_ARMOR
6847468484
if( p==0 ){
6847568485
(void)SQLITE_MISUSE_BKPT;
6847668486
return 0;
6847768487
}
@@ -68481,11 +68491,11 @@
6848168491
6848268492
/*
6848368493
** Return the total number of pages in the source database as of the most
6848468494
** recent call to sqlite3_backup_step().
6848568495
*/
68486
-SQLITE_API int SQLITE_APICALL sqlite3_backup_pagecount(sqlite3_backup *p){
68496
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p){
6848768497
#ifdef SQLITE_ENABLE_API_ARMOR
6848868498
if( p==0 ){
6848968499
(void)SQLITE_MISUSE_BKPT;
6849068500
return 0;
6849168501
}
@@ -68596,17 +68606,19 @@
6859668606
/* 0x7FFFFFFF is the hard limit for the number of pages in a database
6859768607
** file. By passing this as the number of pages to copy to
6859868608
** sqlite3_backup_step(), we can guarantee that the copy finishes
6859968609
** within a single call (unless an error occurs). The assert() statement
6860068610
** checks this assumption - (p->rc) should be set to either SQLITE_DONE
68601
- ** or an error code.
68602
- */
68611
+ ** or an error code. */
6860368612
sqlite3_backup_step(&b, 0x7FFFFFFF);
6860468613
assert( b.rc!=SQLITE_OK );
68614
+
6860568615
rc = sqlite3_backup_finish(&b);
6860668616
if( rc==SQLITE_OK ){
6860768617
pTo->pBt->btsFlags &= ~BTS_PAGESIZE_FIXED;
68618
+ }else{
68619
+ sqlite3PagerClearCache(sqlite3BtreePager(b.pDest));
6860868620
}
6860968621
6861068622
assert( sqlite3BtreeIsInTrans(pTo)==0 );
6861168623
copy_finished:
6861268624
sqlite3BtreeLeave(pFrom);
@@ -74935,11 +74947,11 @@
7493574947
** execution environment changes in a way that would alter the program
7493674948
** that sqlite3_prepare() generates. For example, if new functions or
7493774949
** collating sequences are registered or if an authorizer function is
7493874950
** added or changed.
7493974951
*/
74940
-SQLITE_API int SQLITE_APICALL sqlite3_expired(sqlite3_stmt *pStmt){
74952
+SQLITE_API int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt *pStmt){
7494174953
Vdbe *p = (Vdbe*)pStmt;
7494274954
return p==0 || p->expired;
7494374955
}
7494474956
#endif
7494574957
@@ -75004,11 +75016,11 @@
7500475016
** machine.
7500575017
**
7500675018
** This routine sets the error code and string returned by
7500775019
** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
7500875020
*/
75009
-SQLITE_API int SQLITE_APICALL sqlite3_finalize(sqlite3_stmt *pStmt){
75021
+SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt){
7501075022
int rc;
7501175023
if( pStmt==0 ){
7501275024
/* IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL
7501375025
** pointer is a harmless no-op. */
7501475026
rc = SQLITE_OK;
@@ -75031,11 +75043,11 @@
7503175043
** the prior execution is returned.
7503275044
**
7503375045
** This routine sets the error code and string returned by
7503475046
** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
7503575047
*/
75036
-SQLITE_API int SQLITE_APICALL sqlite3_reset(sqlite3_stmt *pStmt){
75048
+SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt){
7503775049
int rc;
7503875050
if( pStmt==0 ){
7503975051
rc = SQLITE_OK;
7504075052
}else{
7504175053
Vdbe *v = (Vdbe*)pStmt;
@@ -75052,11 +75064,11 @@
7505275064
}
7505375065
7505475066
/*
7505575067
** Set all the parameters in the compiled SQL statement to NULL.
7505675068
*/
75057
-SQLITE_API int SQLITE_APICALL sqlite3_clear_bindings(sqlite3_stmt *pStmt){
75069
+SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt *pStmt){
7505875070
int i;
7505975071
int rc = SQLITE_OK;
7506075072
Vdbe *p = (Vdbe*)pStmt;
7506175073
#if SQLITE_THREADSAFE
7506275074
sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex;
@@ -75076,11 +75088,11 @@
7507675088
7507775089
/**************************** sqlite3_value_ *******************************
7507875090
** The following routines extract information from a Mem or sqlite3_value
7507975091
** structure.
7508075092
*/
75081
-SQLITE_API const void *SQLITE_APICALL sqlite3_value_blob(sqlite3_value *pVal){
75093
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value *pVal){
7508275094
Mem *p = (Mem*)pVal;
7508375095
if( p->flags & (MEM_Blob|MEM_Str) ){
7508475096
if( sqlite3VdbeMemExpandBlob(p)!=SQLITE_OK ){
7508575097
assert( p->flags==MEM_Null && p->z==0 );
7508675098
return 0;
@@ -75089,48 +75101,48 @@
7508975101
return p->n ? p->z : 0;
7509075102
}else{
7509175103
return sqlite3_value_text(pVal);
7509275104
}
7509375105
}
75094
-SQLITE_API int SQLITE_APICALL sqlite3_value_bytes(sqlite3_value *pVal){
75106
+SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value *pVal){
7509575107
return sqlite3ValueBytes(pVal, SQLITE_UTF8);
7509675108
}
75097
-SQLITE_API int SQLITE_APICALL sqlite3_value_bytes16(sqlite3_value *pVal){
75109
+SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value *pVal){
7509875110
return sqlite3ValueBytes(pVal, SQLITE_UTF16NATIVE);
7509975111
}
75100
-SQLITE_API double SQLITE_APICALL sqlite3_value_double(sqlite3_value *pVal){
75112
+SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value *pVal){
7510175113
return sqlite3VdbeRealValue((Mem*)pVal);
7510275114
}
75103
-SQLITE_API int SQLITE_APICALL sqlite3_value_int(sqlite3_value *pVal){
75115
+SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value *pVal){
7510475116
return (int)sqlite3VdbeIntValue((Mem*)pVal);
7510575117
}
75106
-SQLITE_API sqlite_int64 SQLITE_APICALL sqlite3_value_int64(sqlite3_value *pVal){
75118
+SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value *pVal){
7510775119
return sqlite3VdbeIntValue((Mem*)pVal);
7510875120
}
75109
-SQLITE_API unsigned int SQLITE_APICALL sqlite3_value_subtype(sqlite3_value *pVal){
75121
+SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value *pVal){
7511075122
Mem *pMem = (Mem*)pVal;
7511175123
return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0);
7511275124
}
75113
-SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_value_text(sqlite3_value *pVal){
75125
+SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value *pVal){
7511475126
return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
7511575127
}
7511675128
#ifndef SQLITE_OMIT_UTF16
75117
-SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16(sqlite3_value* pVal){
75129
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value* pVal){
7511875130
return sqlite3ValueText(pVal, SQLITE_UTF16NATIVE);
7511975131
}
75120
-SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16be(sqlite3_value *pVal){
75132
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value *pVal){
7512175133
return sqlite3ValueText(pVal, SQLITE_UTF16BE);
7512275134
}
75123
-SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16le(sqlite3_value *pVal){
75135
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value *pVal){
7512475136
return sqlite3ValueText(pVal, SQLITE_UTF16LE);
7512575137
}
7512675138
#endif /* SQLITE_OMIT_UTF16 */
7512775139
/* EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five
7512875140
** fundamental datatypes: 64-bit signed integer 64-bit IEEE floating
7512975141
** point number string BLOB NULL
7513075142
*/
75131
-SQLITE_API int SQLITE_APICALL sqlite3_value_type(sqlite3_value* pVal){
75143
+SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value* pVal){
7513275144
static const u8 aType[] = {
7513375145
SQLITE_BLOB, /* 0x00 */
7513475146
SQLITE_NULL, /* 0x01 */
7513575147
SQLITE_TEXT, /* 0x02 */
7513675148
SQLITE_NULL, /* 0x03 */
@@ -75166,11 +75178,11 @@
7516675178
return aType[pVal->flags&MEM_AffMask];
7516775179
}
7516875180
7516975181
/* Make a copy of an sqlite3_value object
7517075182
*/
75171
-SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_value_dup(const sqlite3_value *pOrig){
75183
+SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value *pOrig){
7517275184
sqlite3_value *pNew;
7517375185
if( pOrig==0 ) return 0;
7517475186
pNew = sqlite3_malloc( sizeof(*pNew) );
7517575187
if( pNew==0 ) return 0;
7517675188
memset(pNew, 0, sizeof(*pNew));
@@ -75189,11 +75201,11 @@
7518975201
}
7519075202
7519175203
/* Destroy an sqlite3_value object previously obtained from
7519275204
** sqlite3_value_dup().
7519375205
*/
75194
-SQLITE_API void SQLITE_APICALL sqlite3_value_free(sqlite3_value *pOld){
75206
+SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value *pOld){
7519575207
sqlite3ValueFree(pOld);
7519675208
}
7519775209
7519875210
7519975211
/**************************** sqlite3_result_ *******************************
@@ -75232,21 +75244,21 @@
7523275244
xDel((void*)p);
7523375245
}
7523475246
if( pCtx ) sqlite3_result_error_toobig(pCtx);
7523575247
return SQLITE_TOOBIG;
7523675248
}
75237
-SQLITE_API void SQLITE_APICALL sqlite3_result_blob(
75249
+SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(
7523875250
sqlite3_context *pCtx,
7523975251
const void *z,
7524075252
int n,
7524175253
void (*xDel)(void *)
7524275254
){
7524375255
assert( n>=0 );
7524475256
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7524575257
setResultStrOrError(pCtx, z, n, 0, xDel);
7524675258
}
75247
-SQLITE_API void SQLITE_APICALL sqlite3_result_blob64(
75259
+SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(
7524875260
sqlite3_context *pCtx,
7524975261
const void *z,
7525075262
sqlite3_uint64 n,
7525175263
void (*xDel)(void *)
7525275264
){
@@ -75256,56 +75268,56 @@
7525675268
(void)invokeValueDestructor(z, xDel, pCtx);
7525775269
}else{
7525875270
setResultStrOrError(pCtx, z, (int)n, 0, xDel);
7525975271
}
7526075272
}
75261
-SQLITE_API void SQLITE_APICALL sqlite3_result_double(sqlite3_context *pCtx, double rVal){
75273
+SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context *pCtx, double rVal){
7526275274
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7526375275
sqlite3VdbeMemSetDouble(pCtx->pOut, rVal);
7526475276
}
75265
-SQLITE_API void SQLITE_APICALL sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
75277
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
7526675278
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7526775279
pCtx->isError = SQLITE_ERROR;
7526875280
pCtx->fErrorOrAux = 1;
7526975281
sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF8, SQLITE_TRANSIENT);
7527075282
}
7527175283
#ifndef SQLITE_OMIT_UTF16
75272
-SQLITE_API void SQLITE_APICALL sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){
75284
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){
7527375285
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7527475286
pCtx->isError = SQLITE_ERROR;
7527575287
pCtx->fErrorOrAux = 1;
7527675288
sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF16NATIVE, SQLITE_TRANSIENT);
7527775289
}
7527875290
#endif
75279
-SQLITE_API void SQLITE_APICALL sqlite3_result_int(sqlite3_context *pCtx, int iVal){
75291
+SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context *pCtx, int iVal){
7528075292
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7528175293
sqlite3VdbeMemSetInt64(pCtx->pOut, (i64)iVal);
7528275294
}
75283
-SQLITE_API void SQLITE_APICALL sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
75295
+SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
7528475296
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7528575297
sqlite3VdbeMemSetInt64(pCtx->pOut, iVal);
7528675298
}
75287
-SQLITE_API void SQLITE_APICALL sqlite3_result_null(sqlite3_context *pCtx){
75299
+SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context *pCtx){
7528875300
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7528975301
sqlite3VdbeMemSetNull(pCtx->pOut);
7529075302
}
75291
-SQLITE_API void SQLITE_APICALL sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){
75303
+SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){
7529275304
Mem *pOut = pCtx->pOut;
7529375305
assert( sqlite3_mutex_held(pOut->db->mutex) );
7529475306
pOut->eSubtype = eSubtype & 0xff;
7529575307
pOut->flags |= MEM_Subtype;
7529675308
}
75297
-SQLITE_API void SQLITE_APICALL sqlite3_result_text(
75309
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text(
7529875310
sqlite3_context *pCtx,
7529975311
const char *z,
7530075312
int n,
7530175313
void (*xDel)(void *)
7530275314
){
7530375315
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7530475316
setResultStrOrError(pCtx, z, n, SQLITE_UTF8, xDel);
7530575317
}
75306
-SQLITE_API void SQLITE_APICALL sqlite3_result_text64(
75318
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(
7530775319
sqlite3_context *pCtx,
7530875320
const char *z,
7530975321
sqlite3_uint64 n,
7531075322
void (*xDel)(void *),
7531175323
unsigned char enc
@@ -75318,56 +75330,56 @@
7531875330
}else{
7531975331
setResultStrOrError(pCtx, z, (int)n, enc, xDel);
7532075332
}
7532175333
}
7532275334
#ifndef SQLITE_OMIT_UTF16
75323
-SQLITE_API void SQLITE_APICALL sqlite3_result_text16(
75335
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(
7532475336
sqlite3_context *pCtx,
7532575337
const void *z,
7532675338
int n,
7532775339
void (*xDel)(void *)
7532875340
){
7532975341
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7533075342
setResultStrOrError(pCtx, z, n, SQLITE_UTF16NATIVE, xDel);
7533175343
}
75332
-SQLITE_API void SQLITE_APICALL sqlite3_result_text16be(
75344
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(
7533375345
sqlite3_context *pCtx,
7533475346
const void *z,
7533575347
int n,
7533675348
void (*xDel)(void *)
7533775349
){
7533875350
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7533975351
setResultStrOrError(pCtx, z, n, SQLITE_UTF16BE, xDel);
7534075352
}
75341
-SQLITE_API void SQLITE_APICALL sqlite3_result_text16le(
75353
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(
7534275354
sqlite3_context *pCtx,
7534375355
const void *z,
7534475356
int n,
7534575357
void (*xDel)(void *)
7534675358
){
7534775359
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7534875360
setResultStrOrError(pCtx, z, n, SQLITE_UTF16LE, xDel);
7534975361
}
7535075362
#endif /* SQLITE_OMIT_UTF16 */
75351
-SQLITE_API void SQLITE_APICALL sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){
75363
+SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){
7535275364
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7535375365
sqlite3VdbeMemCopy(pCtx->pOut, pValue);
7535475366
}
75355
-SQLITE_API void SQLITE_APICALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){
75367
+SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){
7535675368
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7535775369
sqlite3VdbeMemSetZeroBlob(pCtx->pOut, n);
7535875370
}
75359
-SQLITE_API int SQLITE_APICALL sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){
75371
+SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){
7536075372
Mem *pOut = pCtx->pOut;
7536175373
assert( sqlite3_mutex_held(pOut->db->mutex) );
7536275374
if( n>(u64)pOut->db->aLimit[SQLITE_LIMIT_LENGTH] ){
7536375375
return SQLITE_TOOBIG;
7536475376
}
7536575377
sqlite3VdbeMemSetZeroBlob(pCtx->pOut, (int)n);
7536675378
return SQLITE_OK;
7536775379
}
75368
-SQLITE_API void SQLITE_APICALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){
75380
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){
7536975381
pCtx->isError = errCode;
7537075382
pCtx->fErrorOrAux = 1;
7537175383
#ifdef SQLITE_DEBUG
7537275384
if( pCtx->pVdbe ) pCtx->pVdbe->rcApp = errCode;
7537375385
#endif
@@ -75376,20 +75388,20 @@
7537675388
SQLITE_UTF8, SQLITE_STATIC);
7537775389
}
7537875390
}
7537975391
7538075392
/* Force an SQLITE_TOOBIG error. */
75381
-SQLITE_API void SQLITE_APICALL sqlite3_result_error_toobig(sqlite3_context *pCtx){
75393
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context *pCtx){
7538275394
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7538375395
pCtx->isError = SQLITE_TOOBIG;
7538475396
pCtx->fErrorOrAux = 1;
7538575397
sqlite3VdbeMemSetStr(pCtx->pOut, "string or blob too big", -1,
7538675398
SQLITE_UTF8, SQLITE_STATIC);
7538775399
}
7538875400
7538975401
/* An SQLITE_NOMEM error. */
75390
-SQLITE_API void SQLITE_APICALL sqlite3_result_error_nomem(sqlite3_context *pCtx){
75402
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context *pCtx){
7539175403
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7539275404
sqlite3VdbeMemSetNull(pCtx->pOut);
7539375405
pCtx->isError = SQLITE_NOMEM_BKPT;
7539475406
pCtx->fErrorOrAux = 1;
7539575407
sqlite3OomFault(pCtx->pOut->db);
@@ -75557,11 +75569,11 @@
7555775569
/*
7555875570
** This is the top-level implementation of sqlite3_step(). Call
7555975571
** sqlite3Step() to do most of the work. If a schema error occurs,
7556075572
** call sqlite3Reprepare() and try again.
7556175573
*/
75562
-SQLITE_API int SQLITE_APICALL sqlite3_step(sqlite3_stmt *pStmt){
75574
+SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt *pStmt){
7556375575
int rc = SQLITE_OK; /* Result from sqlite3Step() */
7556475576
int rc2 = SQLITE_OK; /* Result from sqlite3Reprepare() */
7556575577
Vdbe *v = (Vdbe*)pStmt; /* the prepared statement */
7556675578
int cnt = 0; /* Counter to prevent infinite loop of reprepares */
7556775579
sqlite3 *db; /* The database connection */
@@ -75608,11 +75620,11 @@
7560875620
7560975621
/*
7561075622
** Extract the user data from a sqlite3_context structure and return a
7561175623
** pointer to it.
7561275624
*/
75613
-SQLITE_API void *SQLITE_APICALL sqlite3_user_data(sqlite3_context *p){
75625
+SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context *p){
7561475626
assert( p && p->pFunc );
7561575627
return p->pFunc->pUserData;
7561675628
}
7561775629
7561875630
/*
@@ -75623,11 +75635,11 @@
7562375635
** returns a copy of the pointer to the database connection (the 1st
7562475636
** parameter) of the sqlite3_create_function() and
7562575637
** sqlite3_create_function16() routines that originally registered the
7562675638
** application defined function.
7562775639
*/
75628
-SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_context_db_handle(sqlite3_context *p){
75640
+SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context *p){
7562975641
assert( p && p->pOut );
7563075642
return p->pOut->db;
7563175643
}
7563275644
7563375645
/*
@@ -75699,11 +75711,11 @@
7569975711
/*
7570075712
** Allocate or return the aggregate context for a user function. A new
7570175713
** context is allocated on the first call. Subsequent calls return the
7570275714
** same context that was returned on prior calls.
7570375715
*/
75704
-SQLITE_API void *SQLITE_APICALL sqlite3_aggregate_context(sqlite3_context *p, int nByte){
75716
+SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context *p, int nByte){
7570575717
assert( p && p->pFunc && p->pFunc->xFinalize );
7570675718
assert( sqlite3_mutex_held(p->pOut->db->mutex) );
7570775719
testcase( nByte<0 );
7570875720
if( (p->pMem->flags & MEM_Agg)==0 ){
7570975721
return createAggContext(p, nByte);
@@ -75714,11 +75726,11 @@
7571475726
7571575727
/*
7571675728
** Return the auxiliary data pointer, if any, for the iArg'th argument to
7571775729
** the user-function defined by pCtx.
7571875730
*/
75719
-SQLITE_API void *SQLITE_APICALL sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
75731
+SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
7572075732
AuxData *pAuxData;
7572175733
7572275734
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7572375735
#if SQLITE_ENABLE_STAT3_OR_STAT4
7572475736
if( pCtx->pVdbe==0 ) return 0;
@@ -75735,11 +75747,11 @@
7573575747
/*
7573675748
** Set the auxiliary data pointer and delete function, for the iArg'th
7573775749
** argument to the user-function defined by pCtx. Any previous value is
7573875750
** deleted by calling the delete function specified when it was set.
7573975751
*/
75740
-SQLITE_API void SQLITE_APICALL sqlite3_set_auxdata(
75752
+SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(
7574175753
sqlite3_context *pCtx,
7574275754
int iArg,
7574375755
void *pAux,
7574475756
void (*xDelete)(void*)
7574575757
){
@@ -75790,29 +75802,29 @@
7579075802
** This function is deprecated. Do not use it for new code. It is
7579175803
** provide only to avoid breaking legacy code. New aggregate function
7579275804
** implementations should keep their own counts within their aggregate
7579375805
** context.
7579475806
*/
75795
-SQLITE_API int SQLITE_APICALL sqlite3_aggregate_count(sqlite3_context *p){
75807
+SQLITE_API int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context *p){
7579675808
assert( p && p->pMem && p->pFunc && p->pFunc->xFinalize );
7579775809
return p->pMem->n;
7579875810
}
7579975811
#endif
7580075812
7580175813
/*
7580275814
** Return the number of columns in the result set for the statement pStmt.
7580375815
*/
75804
-SQLITE_API int SQLITE_APICALL sqlite3_column_count(sqlite3_stmt *pStmt){
75816
+SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt){
7580575817
Vdbe *pVm = (Vdbe *)pStmt;
7580675818
return pVm ? pVm->nResColumn : 0;
7580775819
}
7580875820
7580975821
/*
7581075822
** Return the number of values available from the current row of the
7581175823
** currently executing statement pStmt.
7581275824
*/
75813
-SQLITE_API int SQLITE_APICALL sqlite3_data_count(sqlite3_stmt *pStmt){
75825
+SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt){
7581475826
Vdbe *pVm = (Vdbe *)pStmt;
7581575827
if( pVm==0 || pVm->pResultSet==0 ) return 0;
7581675828
return pVm->nResColumn;
7581775829
}
7581875830
@@ -75911,67 +75923,67 @@
7591175923
7591275924
/**************************** sqlite3_column_ *******************************
7591375925
** The following routines are used to access elements of the current row
7591475926
** in the result set.
7591575927
*/
75916
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_blob(sqlite3_stmt *pStmt, int i){
75928
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt *pStmt, int i){
7591775929
const void *val;
7591875930
val = sqlite3_value_blob( columnMem(pStmt,i) );
7591975931
/* Even though there is no encoding conversion, value_blob() might
7592075932
** need to call malloc() to expand the result of a zeroblob()
7592175933
** expression.
7592275934
*/
7592375935
columnMallocFailure(pStmt);
7592475936
return val;
7592575937
}
75926
-SQLITE_API int SQLITE_APICALL sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){
75938
+SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){
7592775939
int val = sqlite3_value_bytes( columnMem(pStmt,i) );
7592875940
columnMallocFailure(pStmt);
7592975941
return val;
7593075942
}
75931
-SQLITE_API int SQLITE_APICALL sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){
75943
+SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){
7593275944
int val = sqlite3_value_bytes16( columnMem(pStmt,i) );
7593375945
columnMallocFailure(pStmt);
7593475946
return val;
7593575947
}
75936
-SQLITE_API double SQLITE_APICALL sqlite3_column_double(sqlite3_stmt *pStmt, int i){
75948
+SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt *pStmt, int i){
7593775949
double val = sqlite3_value_double( columnMem(pStmt,i) );
7593875950
columnMallocFailure(pStmt);
7593975951
return val;
7594075952
}
75941
-SQLITE_API int SQLITE_APICALL sqlite3_column_int(sqlite3_stmt *pStmt, int i){
75953
+SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt *pStmt, int i){
7594275954
int val = sqlite3_value_int( columnMem(pStmt,i) );
7594375955
columnMallocFailure(pStmt);
7594475956
return val;
7594575957
}
75946
-SQLITE_API sqlite_int64 SQLITE_APICALL sqlite3_column_int64(sqlite3_stmt *pStmt, int i){
75958
+SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt *pStmt, int i){
7594775959
sqlite_int64 val = sqlite3_value_int64( columnMem(pStmt,i) );
7594875960
columnMallocFailure(pStmt);
7594975961
return val;
7595075962
}
75951
-SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_column_text(sqlite3_stmt *pStmt, int i){
75963
+SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt *pStmt, int i){
7595275964
const unsigned char *val = sqlite3_value_text( columnMem(pStmt,i) );
7595375965
columnMallocFailure(pStmt);
7595475966
return val;
7595575967
}
75956
-SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_column_value(sqlite3_stmt *pStmt, int i){
75968
+SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt *pStmt, int i){
7595775969
Mem *pOut = columnMem(pStmt, i);
7595875970
if( pOut->flags&MEM_Static ){
7595975971
pOut->flags &= ~MEM_Static;
7596075972
pOut->flags |= MEM_Ephem;
7596175973
}
7596275974
columnMallocFailure(pStmt);
7596375975
return (sqlite3_value *)pOut;
7596475976
}
7596575977
#ifndef SQLITE_OMIT_UTF16
75966
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_text16(sqlite3_stmt *pStmt, int i){
75978
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt *pStmt, int i){
7596775979
const void *val = sqlite3_value_text16( columnMem(pStmt,i) );
7596875980
columnMallocFailure(pStmt);
7596975981
return val;
7597075982
}
7597175983
#endif /* SQLITE_OMIT_UTF16 */
75972
-SQLITE_API int SQLITE_APICALL sqlite3_column_type(sqlite3_stmt *pStmt, int i){
75984
+SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt *pStmt, int i){
7597375985
int iType = sqlite3_value_type( columnMem(pStmt,i) );
7597475986
columnMallocFailure(pStmt);
7597575987
return iType;
7597675988
}
7597775989
@@ -76031,16 +76043,16 @@
7603176043
7603276044
/*
7603376045
** Return the name of the Nth column of the result set returned by SQL
7603476046
** statement pStmt.
7603576047
*/
76036
-SQLITE_API const char *SQLITE_APICALL sqlite3_column_name(sqlite3_stmt *pStmt, int N){
76048
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt *pStmt, int N){
7603776049
return columnName(
7603876050
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_NAME);
7603976051
}
7604076052
#ifndef SQLITE_OMIT_UTF16
76041
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_name16(sqlite3_stmt *pStmt, int N){
76053
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt *pStmt, int N){
7604276054
return columnName(
7604376055
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_NAME);
7604476056
}
7604576057
#endif
7604676058
@@ -76056,16 +76068,16 @@
7605676068
#ifndef SQLITE_OMIT_DECLTYPE
7605776069
/*
7605876070
** Return the column declaration type (if applicable) of the 'i'th column
7605976071
** of the result set of SQL statement pStmt.
7606076072
*/
76061
-SQLITE_API const char *SQLITE_APICALL sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){
76073
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){
7606276074
return columnName(
7606376075
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DECLTYPE);
7606476076
}
7606576077
#ifndef SQLITE_OMIT_UTF16
76066
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){
76078
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){
7606776079
return columnName(
7606876080
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DECLTYPE);
7606976081
}
7607076082
#endif /* SQLITE_OMIT_UTF16 */
7607176083
#endif /* SQLITE_OMIT_DECLTYPE */
@@ -76074,16 +76086,16 @@
7607476086
/*
7607576087
** Return the name of the database from which a result column derives.
7607676088
** NULL is returned if the result column is an expression or constant or
7607776089
** anything else which is not an unambiguous reference to a database column.
7607876090
*/
76079
-SQLITE_API const char *SQLITE_APICALL sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){
76091
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){
7608076092
return columnName(
7608176093
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DATABASE);
7608276094
}
7608376095
#ifndef SQLITE_OMIT_UTF16
76084
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){
76096
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){
7608576097
return columnName(
7608676098
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DATABASE);
7608776099
}
7608876100
#endif /* SQLITE_OMIT_UTF16 */
7608976101
@@ -76090,16 +76102,16 @@
7609076102
/*
7609176103
** Return the name of the table from which a result column derives.
7609276104
** NULL is returned if the result column is an expression or constant or
7609376105
** anything else which is not an unambiguous reference to a database column.
7609476106
*/
76095
-SQLITE_API const char *SQLITE_APICALL sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){
76107
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){
7609676108
return columnName(
7609776109
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_TABLE);
7609876110
}
7609976111
#ifndef SQLITE_OMIT_UTF16
76100
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){
76112
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){
7610176113
return columnName(
7610276114
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_TABLE);
7610376115
}
7610476116
#endif /* SQLITE_OMIT_UTF16 */
7610576117
@@ -76106,16 +76118,16 @@
7610676118
/*
7610776119
** Return the name of the table column from which a result column derives.
7610876120
** NULL is returned if the result column is an expression or constant or
7610976121
** anything else which is not an unambiguous reference to a database column.
7611076122
*/
76111
-SQLITE_API const char *SQLITE_APICALL sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){
76123
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){
7611276124
return columnName(
7611376125
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_COLUMN);
7611476126
}
7611576127
#ifndef SQLITE_OMIT_UTF16
76116
-SQLITE_API const void *SQLITE_APICALL sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){
76128
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){
7611776129
return columnName(
7611876130
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_COLUMN);
7611976131
}
7612076132
#endif /* SQLITE_OMIT_UTF16 */
7612176133
#endif /* SQLITE_ENABLE_COLUMN_METADATA */
@@ -76212,11 +76224,11 @@
7621276224
7621376225
7621476226
/*
7621576227
** Bind a blob value to an SQL statement variable.
7621676228
*/
76217
-SQLITE_API int SQLITE_APICALL sqlite3_bind_blob(
76229
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(
7621876230
sqlite3_stmt *pStmt,
7621976231
int i,
7622076232
const void *zData,
7622176233
int nData,
7622276234
void (*xDel)(void*)
@@ -76224,11 +76236,11 @@
7622476236
#ifdef SQLITE_ENABLE_API_ARMOR
7622576237
if( nData<0 ) return SQLITE_MISUSE_BKPT;
7622676238
#endif
7622776239
return bindText(pStmt, i, zData, nData, xDel, 0);
7622876240
}
76229
-SQLITE_API int SQLITE_APICALL sqlite3_bind_blob64(
76241
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(
7623076242
sqlite3_stmt *pStmt,
7623176243
int i,
7623276244
const void *zData,
7623376245
sqlite3_uint64 nData,
7623476246
void (*xDel)(void*)
@@ -76238,52 +76250,52 @@
7623876250
return invokeValueDestructor(zData, xDel, 0);
7623976251
}else{
7624076252
return bindText(pStmt, i, zData, (int)nData, xDel, 0);
7624176253
}
7624276254
}
76243
-SQLITE_API int SQLITE_APICALL sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
76255
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
7624476256
int rc;
7624576257
Vdbe *p = (Vdbe *)pStmt;
7624676258
rc = vdbeUnbind(p, i);
7624776259
if( rc==SQLITE_OK ){
7624876260
sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue);
7624976261
sqlite3_mutex_leave(p->db->mutex);
7625076262
}
7625176263
return rc;
7625276264
}
76253
-SQLITE_API int SQLITE_APICALL sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){
76265
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){
7625476266
return sqlite3_bind_int64(p, i, (i64)iValue);
7625576267
}
76256
-SQLITE_API int SQLITE_APICALL sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
76268
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
7625776269
int rc;
7625876270
Vdbe *p = (Vdbe *)pStmt;
7625976271
rc = vdbeUnbind(p, i);
7626076272
if( rc==SQLITE_OK ){
7626176273
sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue);
7626276274
sqlite3_mutex_leave(p->db->mutex);
7626376275
}
7626476276
return rc;
7626576277
}
76266
-SQLITE_API int SQLITE_APICALL sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
76278
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
7626776279
int rc;
7626876280
Vdbe *p = (Vdbe*)pStmt;
7626976281
rc = vdbeUnbind(p, i);
7627076282
if( rc==SQLITE_OK ){
7627176283
sqlite3_mutex_leave(p->db->mutex);
7627276284
}
7627376285
return rc;
7627476286
}
76275
-SQLITE_API int SQLITE_APICALL sqlite3_bind_text(
76287
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(
7627676288
sqlite3_stmt *pStmt,
7627776289
int i,
7627876290
const char *zData,
7627976291
int nData,
7628076292
void (*xDel)(void*)
7628176293
){
7628276294
return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8);
7628376295
}
76284
-SQLITE_API int SQLITE_APICALL sqlite3_bind_text64(
76296
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(
7628576297
sqlite3_stmt *pStmt,
7628676298
int i,
7628776299
const char *zData,
7628876300
sqlite3_uint64 nData,
7628976301
void (*xDel)(void*),
@@ -76296,21 +76308,21 @@
7629676308
if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE;
7629776309
return bindText(pStmt, i, zData, (int)nData, xDel, enc);
7629876310
}
7629976311
}
7630076312
#ifndef SQLITE_OMIT_UTF16
76301
-SQLITE_API int SQLITE_APICALL sqlite3_bind_text16(
76313
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(
7630276314
sqlite3_stmt *pStmt,
7630376315
int i,
7630476316
const void *zData,
7630576317
int nData,
7630676318
void (*xDel)(void*)
7630776319
){
7630876320
return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE);
7630976321
}
7631076322
#endif /* SQLITE_OMIT_UTF16 */
76311
-SQLITE_API int SQLITE_APICALL sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
76323
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
7631276324
int rc;
7631376325
switch( sqlite3_value_type((sqlite3_value*)pValue) ){
7631476326
case SQLITE_INTEGER: {
7631576327
rc = sqlite3_bind_int64(pStmt, i, pValue->u.i);
7631676328
break;
@@ -76337,21 +76349,21 @@
7633776349
break;
7633876350
}
7633976351
}
7634076352
return rc;
7634176353
}
76342
-SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
76354
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
7634376355
int rc;
7634476356
Vdbe *p = (Vdbe *)pStmt;
7634576357
rc = vdbeUnbind(p, i);
7634676358
if( rc==SQLITE_OK ){
7634776359
sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n);
7634876360
sqlite3_mutex_leave(p->db->mutex);
7634976361
}
7635076362
return rc;
7635176363
}
76352
-SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){
76364
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){
7635376365
int rc;
7635476366
Vdbe *p = (Vdbe *)pStmt;
7635576367
sqlite3_mutex_enter(p->db->mutex);
7635676368
if( n>(u64)p->db->aLimit[SQLITE_LIMIT_LENGTH] ){
7635776369
rc = SQLITE_TOOBIG;
@@ -76366,11 +76378,11 @@
7636676378
7636776379
/*
7636876380
** Return the number of wildcards that can be potentially bound to.
7636976381
** This routine is added to support DBD::SQLite.
7637076382
*/
76371
-SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
76383
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
7637276384
Vdbe *p = (Vdbe*)pStmt;
7637376385
return p ? p->nVar : 0;
7637476386
}
7637576387
7637676388
/*
@@ -76377,11 +76389,11 @@
7637776389
** Return the name of a wildcard parameter. Return NULL if the index
7637876390
** is out of range or if the wildcard is unnamed.
7637976391
**
7638076392
** The result is always UTF-8.
7638176393
*/
76382
-SQLITE_API const char *SQLITE_APICALL sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){
76394
+SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){
7638376395
Vdbe *p = (Vdbe*)pStmt;
7638476396
if( p==0 || i<1 || i>p->nzVar ){
7638576397
return 0;
7638676398
}
7638776399
return p->azVar[i-1];
@@ -76405,11 +76417,11 @@
7640576417
}
7640676418
}
7640776419
}
7640876420
return 0;
7640976421
}
76410
-SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
76422
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
7641176423
return sqlite3VdbeParameterIndex((Vdbe*)pStmt, zName, sqlite3Strlen30(zName));
7641276424
}
7641376425
7641476426
/*
7641576427
** Transfer all bindings from the first statement over to the second.
@@ -76439,11 +76451,11 @@
7643976451
**
7644076452
** If the two statements contain a different number of bindings, then
7644176453
** an SQLITE_ERROR is returned. Nothing else can go wrong, so otherwise
7644276454
** SQLITE_OK is returned.
7644376455
*/
76444
-SQLITE_API int SQLITE_APICALL sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
76456
+SQLITE_API int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
7644576457
Vdbe *pFrom = (Vdbe*)pFromStmt;
7644676458
Vdbe *pTo = (Vdbe*)pToStmt;
7644776459
if( pFrom->nVar!=pTo->nVar ){
7644876460
return SQLITE_ERROR;
7644976461
}
@@ -76461,26 +76473,26 @@
7646176473
** Return the sqlite3* database handle to which the prepared statement given
7646276474
** in the argument belongs. This is the same database handle that was
7646376475
** the first argument to the sqlite3_prepare() that was used to create
7646476476
** the statement in the first place.
7646576477
*/
76466
-SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_db_handle(sqlite3_stmt *pStmt){
76478
+SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt *pStmt){
7646776479
return pStmt ? ((Vdbe*)pStmt)->db : 0;
7646876480
}
7646976481
7647076482
/*
7647176483
** Return true if the prepared statement is guaranteed to not modify the
7647276484
** database.
7647376485
*/
76474
-SQLITE_API int SQLITE_APICALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt){
76486
+SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt){
7647576487
return pStmt ? ((Vdbe*)pStmt)->readOnly : 1;
7647676488
}
7647776489
7647876490
/*
7647976491
** Return true if the prepared statement is in need of being reset.
7648076492
*/
76481
-SQLITE_API int SQLITE_APICALL sqlite3_stmt_busy(sqlite3_stmt *pStmt){
76493
+SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt *pStmt){
7648276494
Vdbe *v = (Vdbe*)pStmt;
7648376495
return v!=0 && v->pc>=0 && v->magic==VDBE_MAGIC_RUN;
7648476496
}
7648576497
7648676498
/*
@@ -76487,11 +76499,11 @@
7648776499
** Return a pointer to the next prepared statement after pStmt associated
7648876500
** with database connection pDb. If pStmt is NULL, return the first
7648976501
** prepared statement for the database connection. Return NULL if there
7649076502
** are no more.
7649176503
*/
76492
-SQLITE_API sqlite3_stmt *SQLITE_APICALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){
76504
+SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){
7649376505
sqlite3_stmt *pNext;
7649476506
#ifdef SQLITE_ENABLE_API_ARMOR
7649576507
if( !sqlite3SafetyCheckOk(pDb) ){
7649676508
(void)SQLITE_MISUSE_BKPT;
7649776509
return 0;
@@ -76508,11 +76520,11 @@
7650876520
}
7650976521
7651076522
/*
7651176523
** Return the value of a status counter for a prepared statement
7651276524
*/
76513
-SQLITE_API int SQLITE_APICALL sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){
76525
+SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){
7651476526
Vdbe *pVdbe = (Vdbe*)pStmt;
7651576527
u32 v;
7651676528
#ifdef SQLITE_ENABLE_API_ARMOR
7651776529
if( !pStmt ){
7651876530
(void)SQLITE_MISUSE_BKPT;
@@ -76525,11 +76537,11 @@
7652576537
}
7652676538
7652776539
/*
7652876540
** Return the SQL associated with a prepared statement
7652976541
*/
76530
-SQLITE_API const char *SQLITE_APICALL sqlite3_sql(sqlite3_stmt *pStmt){
76542
+SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt){
7653176543
Vdbe *p = (Vdbe *)pStmt;
7653276544
return p ? p->zSql : 0;
7653376545
}
7653476546
7653576547
/*
@@ -76539,11 +76551,11 @@
7653976551
** freeing the returned string by passing it to sqlite3_free().
7654076552
**
7654176553
** The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of
7654276554
** expanded bound parameters.
7654376555
*/
76544
-SQLITE_API char *SQLITE_APICALL sqlite3_expanded_sql(sqlite3_stmt *pStmt){
76556
+SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt){
7654576557
#ifdef SQLITE_OMIT_TRACE
7654676558
return 0;
7654776559
#else
7654876560
char *z = 0;
7654976561
const char *zSql = sqlite3_sql(pStmt);
@@ -76581,11 +76593,11 @@
7658176593
7658276594
/*
7658376595
** This function is called from within a pre-update callback to retrieve
7658476596
** a field of the row currently being updated or deleted.
7658576597
*/
76586
-SQLITE_API int SQLITE_APICALL sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
76598
+SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
7658776599
PreUpdate *p = db->pPreUpdate;
7658876600
int rc = SQLITE_OK;
7658976601
7659076602
/* Test that this call is being made from within an SQLITE_DELETE or
7659176603
** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */
@@ -76636,11 +76648,11 @@
7663676648
#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
7663776649
/*
7663876650
** This function is called from within a pre-update callback to retrieve
7663976651
** the number of columns in the row being updated, deleted or inserted.
7664076652
*/
76641
-SQLITE_API int SQLITE_APICALL sqlite3_preupdate_count(sqlite3 *db){
76653
+SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *db){
7664276654
PreUpdate *p = db->pPreUpdate;
7664376655
return (p ? p->keyinfo.nField : 0);
7664476656
}
7664576657
#endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
7664676658
@@ -76654,11 +76666,11 @@
7665476666
** top-level trigger etc.).
7665576667
**
7665676668
** For the purposes of the previous paragraph, a foreign key CASCADE, SET NULL
7665776669
** or SET DEFAULT action is considered a trigger.
7665876670
*/
76659
-SQLITE_API int SQLITE_APICALL sqlite3_preupdate_depth(sqlite3 *db){
76671
+SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *db){
7666076672
PreUpdate *p = db->pPreUpdate;
7666176673
return (p ? p->v->nFrame : 0);
7666276674
}
7666376675
#endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
7666476676
@@ -76665,11 +76677,11 @@
7666576677
#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
7666676678
/*
7666776679
** This function is called from within a pre-update callback to retrieve
7666876680
** a field of the row currently being updated or inserted.
7666976681
*/
76670
-SQLITE_API int SQLITE_APICALL sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
76682
+SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
7667176683
PreUpdate *p = db->pPreUpdate;
7667276684
int rc = SQLITE_OK;
7667376685
Mem *pMem;
7667476686
7667576687
if( !p || p->op==SQLITE_DELETE ){
@@ -76739,11 +76751,11 @@
7673976751
7674076752
#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
7674176753
/*
7674276754
** Return status data for a single loop within query pStmt.
7674376755
*/
76744
-SQLITE_API int SQLITE_APICALL sqlite3_stmt_scanstatus(
76756
+SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus(
7674576757
sqlite3_stmt *pStmt, /* Prepared statement being queried */
7674676758
int idx, /* Index of loop to report on */
7674776759
int iScanStatusOp, /* Which metric to return */
7674876760
void *pOut /* OUT: Write the answer here */
7674976761
){
@@ -76798,11 +76810,11 @@
7679876810
}
7679976811
7680076812
/*
7680176813
** Zero all counters associated with the sqlite3_stmt_scanstatus() data.
7680276814
*/
76803
-SQLITE_API void SQLITE_APICALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){
76815
+SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){
7680476816
Vdbe *p = (Vdbe*)pStmt;
7680576817
memset(p->anExec, 0, p->nOp * sizeof(i64));
7680676818
}
7680776819
#endif /* SQLITE_ENABLE_STMT_SCANSTATUS */
7680876820
@@ -77325,11 +77337,11 @@
7732577337
** Try to convert the type of a function argument or a result column
7732677338
** into a numeric representation. Use either INTEGER or REAL whichever
7732777339
** is appropriate. But only do the conversion if it is possible without
7732877340
** loss of information and return the revised type of the argument.
7732977341
*/
77330
-SQLITE_API int SQLITE_APICALL sqlite3_value_numeric_type(sqlite3_value *pVal){
77342
+SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value *pVal){
7733177343
int eType = sqlite3_value_type(pVal);
7733277344
if( eType==SQLITE_TEXT ){
7733377345
Mem *pMem = (Mem*)pVal;
7733477346
applyNumericAffinity(pMem, 0);
7733577347
eType = sqlite3_value_type(pVal);
@@ -84177,11 +84189,11 @@
8417784189
}
8417884190
8417984191
/*
8418084192
** Open a blob handle.
8418184193
*/
84182
-SQLITE_API int SQLITE_APICALL sqlite3_blob_open(
84194
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
8418384195
sqlite3* db, /* The database connection */
8418484196
const char *zDb, /* The attached database containing the blob */
8418584197
const char *zTable, /* The table containing the blob */
8418684198
const char *zColumn, /* The column containing the blob */
8418784199
sqlite_int64 iRow, /* The row containing the glob */
@@ -84418,11 +84430,11 @@
8441884430
8441984431
/*
8442084432
** Close a blob handle that was previously created using
8442184433
** sqlite3_blob_open().
8442284434
*/
84423
-SQLITE_API int SQLITE_APICALL sqlite3_blob_close(sqlite3_blob *pBlob){
84435
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *pBlob){
8442484436
Incrblob *p = (Incrblob *)pBlob;
8442584437
int rc;
8442684438
sqlite3 *db;
8442784439
8442884440
if( p ){
@@ -84511,28 +84523,28 @@
8451184523
}
8451284524
8451384525
/*
8451484526
** Read data from a blob handle.
8451584527
*/
84516
-SQLITE_API int SQLITE_APICALL sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){
84528
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){
8451784529
return blobReadWrite(pBlob, z, n, iOffset, sqlite3BtreeData);
8451884530
}
8451984531
8452084532
/*
8452184533
** Write data to a blob handle.
8452284534
*/
84523
-SQLITE_API int SQLITE_APICALL sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){
84535
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){
8452484536
return blobReadWrite(pBlob, (void *)z, n, iOffset, sqlite3BtreePutData);
8452584537
}
8452684538
8452784539
/*
8452884540
** Query a blob handle for the size of the data.
8452984541
**
8453084542
** The Incrblob.nByte field is fixed for the lifetime of the Incrblob
8453184543
** so no mutex is required for access.
8453284544
*/
84533
-SQLITE_API int SQLITE_APICALL sqlite3_blob_bytes(sqlite3_blob *pBlob){
84545
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *pBlob){
8453484546
Incrblob *p = (Incrblob *)pBlob;
8453584547
return (p && p->pStmt) ? p->nByte : 0;
8453684548
}
8453784549
8453884550
/*
@@ -84543,11 +84555,11 @@
8454384555
** contain a blob or text value, then an error code is returned and the
8454484556
** database handle error code and message set. If this happens, then all
8454584557
** subsequent calls to sqlite3_blob_xxx() functions (except blob_close())
8454684558
** immediately return SQLITE_ABORT.
8454784559
*/
84548
-SQLITE_API int SQLITE_APICALL sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){
84560
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){
8454984561
int rc;
8455084562
Incrblob *p = (Incrblob *)pBlob;
8455184563
sqlite3 *db;
8455284564
8455384565
if( p==0 ) return SQLITE_MISUSE_BKPT;
@@ -88640,11 +88652,15 @@
8864088652
}
8864188653
if( is_agg && (pNC->ncFlags & NC_AllowAgg)==0 ){
8864288654
sqlite3ErrorMsg(pParse, "misuse of aggregate function %.*s()", nId,zId);
8864388655
pNC->nErr++;
8864488656
is_agg = 0;
88645
- }else if( no_such_func && pParse->db->init.busy==0 ){
88657
+ }else if( no_such_func && pParse->db->init.busy==0
88658
+#ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
88659
+ && pParse->explain==0
88660
+#endif
88661
+ ){
8864688662
sqlite3ErrorMsg(pParse, "no such function: %.*s", nId, zId);
8864788663
pNC->nErr++;
8864888664
}else if( wrong_num_args ){
8864988665
sqlite3ErrorMsg(pParse,"wrong number of arguments to function %.*s()",
8865088666
nId, zId);
@@ -92365,10 +92381,15 @@
9236592381
}
9236692382
nFarg = pFarg ? pFarg->nExpr : 0;
9236792383
assert( !ExprHasProperty(pExpr, EP_IntValue) );
9236892384
zId = pExpr->u.zToken;
9236992385
pDef = sqlite3FindFunction(db, zId, nFarg, enc, 0);
92386
+#ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
92387
+ if( pDef==0 && pParse->explain ){
92388
+ pDef = sqlite3FindFunction(db, "unknown", nFarg, enc, 0);
92389
+ }
92390
+#endif
9237092391
if( pDef==0 || pDef->xFinalize!=0 ){
9237192392
sqlite3ErrorMsg(pParse, "unknown function: %s()", zId);
9237292393
break;
9237392394
}
9237492395
@@ -97147,11 +97168,11 @@
9714797168
** and attempts to write the column will be ignored.
9714897169
**
9714997170
** Setting the auth function to NULL disables this hook. The default
9715097171
** setting of the auth function is NULL.
9715197172
*/
97152
-SQLITE_API int SQLITE_APICALL sqlite3_set_authorizer(
97173
+SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
9715397174
sqlite3 *db,
9715497175
int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
9715597176
void *pArg
9715697177
){
9715797178
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -100381,10 +100402,17 @@
100381100402
for(pLoop=pTab->pIndex, n=1; pLoop; pLoop=pLoop->pNext, n++){}
100382100403
zName = sqlite3MPrintf(db, "sqlite_autoindex_%s_%d", pTab->zName, n);
100383100404
if( zName==0 ){
100384100405
goto exit_create_index;
100385100406
}
100407
+
100408
+ /* Automatic index names generated from within sqlite3_declare_vtab()
100409
+ ** must have names that are distinct from normal automatic index names.
100410
+ ** The following statement converts "sqlite3_autoindex..." into
100411
+ ** "sqlite3_butoindex..." in order to make the names distinct.
100412
+ ** The "vtab_err.test" test demonstrates the need of this statement. */
100413
+ if( IN_DECLARE_VTAB ) zName[7]++;
100386100414
}
100387100415
100388100416
/* Check for authorization to create an index.
100389100417
*/
100390100418
#ifndef SQLITE_OMIT_AUTHORIZATION
@@ -103910,18 +103938,18 @@
103910103938
}
103911103939
103912103940
/*
103913103941
** The sqlite3_strglob() interface.
103914103942
*/
103915
-SQLITE_API int SQLITE_APICALL sqlite3_strglob(const char *zGlobPattern, const char *zString){
103943
+SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlobPattern, const char *zString){
103916103944
return patternCompare((u8*)zGlobPattern, (u8*)zString, &globInfo, '[')==0;
103917103945
}
103918103946
103919103947
/*
103920103948
** The sqlite3_strlike() interface.
103921103949
*/
103922
-SQLITE_API int SQLITE_APICALL sqlite3_strlike(const char *zPattern, const char *zStr, unsigned int esc){
103950
+SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zPattern, const char *zStr, unsigned int esc){
103923103951
return patternCompare((u8*)zPattern, (u8*)zStr, &likeInfoNorm, esc)==0;
103924103952
}
103925103953
103926103954
/*
103927103955
** Count the number of times that the LIKE operator (or GLOB which is
@@ -104473,10 +104501,30 @@
104473104501
}
104474104502
}
104475104503
sqlite3_result_text(context, (char*)zIn, nIn, SQLITE_TRANSIENT);
104476104504
}
104477104505
104506
+
104507
+#ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
104508
+/*
104509
+** The "unknown" function is automatically substituted in place of
104510
+** any unrecognized function name when doing an EXPLAIN or EXPLAIN QUERY PLAN
104511
+** when the SQLITE_ENABLE_UNKNOWN_FUNCTION compile-time option is used.
104512
+** When the "sqlite3" command-line shell is built using this functionality,
104513
+** that allows an EXPLAIN or EXPLAIN QUERY PLAN for complex queries
104514
+** involving application-defined functions to be examined in a generic
104515
+** sqlite3 shell.
104516
+*/
104517
+static void unknownFunc(
104518
+ sqlite3_context *context,
104519
+ int argc,
104520
+ sqlite3_value **argv
104521
+){
104522
+ /* no-op */
104523
+}
104524
+#endif /*SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION*/
104525
+
104478104526
104479104527
/* IMP: R-25361-16150 This function is omitted from SQLite by default. It
104480104528
** is only available if the SQLITE_SOUNDEX compile-time option is used
104481104529
** when SQLite is built.
104482104530
*/
@@ -104944,17 +104992,20 @@
104944104992
AGGREGATE(count, 1, 0, 0, countStep, countFinalize ),
104945104993
AGGREGATE(group_concat, 1, 0, 0, groupConcatStep, groupConcatFinalize),
104946104994
AGGREGATE(group_concat, 2, 0, 0, groupConcatStep, groupConcatFinalize),
104947104995
104948104996
LIKEFUNC(glob, 2, &globInfo, SQLITE_FUNC_LIKE|SQLITE_FUNC_CASE),
104949
- #ifdef SQLITE_CASE_SENSITIVE_LIKE
104997
+#ifdef SQLITE_CASE_SENSITIVE_LIKE
104950104998
LIKEFUNC(like, 2, &likeInfoAlt, SQLITE_FUNC_LIKE|SQLITE_FUNC_CASE),
104951104999
LIKEFUNC(like, 3, &likeInfoAlt, SQLITE_FUNC_LIKE|SQLITE_FUNC_CASE),
104952
- #else
105000
+#else
104953105001
LIKEFUNC(like, 2, &likeInfoNorm, SQLITE_FUNC_LIKE),
104954105002
LIKEFUNC(like, 3, &likeInfoNorm, SQLITE_FUNC_LIKE),
104955
- #endif
105003
+#endif
105004
+#ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
105005
+ FUNCTION(unknown, -1, 0, 0, unknownFunc ),
105006
+#endif
104956105007
FUNCTION(coalesce, 1, 0, 0, 0 ),
104957105008
FUNCTION(coalesce, 0, 0, 0, 0 ),
104958105009
FUNCTION2(coalesce, -1, 0, 0, noopFunc, SQLITE_FUNC_COALESCE),
104959105010
};
104960105011
#ifndef SQLITE_OMIT_ALTERTABLE
@@ -108613,11 +108664,11 @@
108613108664
** If the SQL is a query, then for each row in the query result
108614108665
** the xCallback() function is called. pArg becomes the first
108615108666
** argument to xCallback(). If xCallback=NULL then no callback
108616108667
** is invoked, even for queries.
108617108668
*/
108618
-SQLITE_API int SQLITE_APICALL sqlite3_exec(
108669
+SQLITE_API int SQLITE_STDCALL sqlite3_exec(
108619108670
sqlite3 *db, /* The database on which the SQL executes */
108620108671
const char *zSql, /* The SQL to be executed */
108621108672
sqlite3_callback xCallback, /* Invoke this callback routine */
108622108673
void *pArg, /* First argument to xCallback() */
108623108674
char **pzErrMsg /* Write error messages here */
@@ -109875,11 +109926,11 @@
109875109926
db->aExtension = aHandle;
109876109927
109877109928
db->aExtension[db->nExtension++] = handle;
109878109929
return SQLITE_OK;
109879109930
}
109880
-SQLITE_API int SQLITE_APICALL sqlite3_load_extension(
109931
+SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
109881109932
sqlite3 *db, /* Load the extension into this database connection */
109882109933
const char *zFile, /* Name of the shared library containing extension */
109883109934
const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */
109884109935
char **pzErrMsg /* Put error message here if not 0 */
109885109936
){
@@ -109906,11 +109957,11 @@
109906109957
109907109958
/*
109908109959
** Enable or disable extension loading. Extension loading is disabled by
109909109960
** default so as not to open security holes in older applications.
109910109961
*/
109911
-SQLITE_API int SQLITE_APICALL sqlite3_enable_load_extension(sqlite3 *db, int onoff){
109962
+SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff){
109912109963
sqlite3_mutex_enter(db->mutex);
109913109964
if( onoff ){
109914109965
db->flags |= SQLITE_LoadExtension|SQLITE_LoadExtFunc;
109915109966
}else{
109916109967
db->flags &= ~(SQLITE_LoadExtension|SQLITE_LoadExtFunc);
@@ -109963,11 +110014,11 @@
109963110014
109964110015
/*
109965110016
** Register a statically linked extension that is automatically
109966110017
** loaded by every new database connection.
109967110018
*/
109968
-SQLITE_API int SQLITE_APICALL sqlite3_auto_extension(
110019
+SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(
109969110020
void (*xInit)(void)
109970110021
){
109971110022
int rc = SQLITE_OK;
109972110023
#ifndef SQLITE_OMIT_AUTOINIT
109973110024
rc = sqlite3_initialize();
@@ -110010,11 +110061,11 @@
110010110061
** routine is a no-op.
110011110062
**
110012110063
** Return 1 if xInit was found on the list and removed. Return 0 if xInit
110013110064
** was not on the list.
110014110065
*/
110015
-SQLITE_API int SQLITE_APICALL sqlite3_cancel_auto_extension(
110066
+SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(
110016110067
void (*xInit)(void)
110017110068
){
110018110069
#if SQLITE_THREADSAFE
110019110070
sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
110020110071
#endif
@@ -110035,11 +110086,11 @@
110035110086
}
110036110087
110037110088
/*
110038110089
** Reset the automatic extension loading mechanism.
110039110090
*/
110040
-SQLITE_API void SQLITE_APICALL sqlite3_reset_auto_extension(void){
110091
+SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void){
110041110092
#ifndef SQLITE_OMIT_AUTOINIT
110042110093
if( sqlite3_initialize()==SQLITE_OK )
110043110094
#endif
110044110095
{
110045110096
#if SQLITE_THREADSAFE
@@ -113296,11 +113347,11 @@
113296113347
** and so if a schema change occurs, SQLITE_SCHEMA is returned by
113297113348
** sqlite3_step(). In the new version, the original SQL text is retained
113298113349
** and the statement is automatically recompiled if an schema change
113299113350
** occurs.
113300113351
*/
113301
-SQLITE_API int SQLITE_APICALL sqlite3_prepare(
113352
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
113302113353
sqlite3 *db, /* Database handle. */
113303113354
const char *zSql, /* UTF-8 encoded SQL statement. */
113304113355
int nBytes, /* Length of zSql in bytes. */
113305113356
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113306113357
const char **pzTail /* OUT: End of parsed string */
@@ -113308,11 +113359,11 @@
113308113359
int rc;
113309113360
rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,0,ppStmt,pzTail);
113310113361
assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
113311113362
return rc;
113312113363
}
113313
-SQLITE_API int SQLITE_APICALL sqlite3_prepare_v2(
113364
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
113314113365
sqlite3 *db, /* Database handle. */
113315113366
const char *zSql, /* UTF-8 encoded SQL statement. */
113316113367
int nBytes, /* Length of zSql in bytes. */
113317113368
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113318113369
const char **pzTail /* OUT: End of parsed string */
@@ -113384,11 +113435,11 @@
113384113435
** and so if a schema change occurs, SQLITE_SCHEMA is returned by
113385113436
** sqlite3_step(). In the new version, the original SQL text is retained
113386113437
** and the statement is automatically recompiled if an schema change
113387113438
** occurs.
113388113439
*/
113389
-SQLITE_API int SQLITE_APICALL sqlite3_prepare16(
113440
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
113390113441
sqlite3 *db, /* Database handle. */
113391113442
const void *zSql, /* UTF-16 encoded SQL statement. */
113392113443
int nBytes, /* Length of zSql in bytes. */
113393113444
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113394113445
const void **pzTail /* OUT: End of parsed string */
@@ -113396,11 +113447,11 @@
113396113447
int rc;
113397113448
rc = sqlite3Prepare16(db,zSql,nBytes,0,ppStmt,pzTail);
113398113449
assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
113399113450
return rc;
113400113451
}
113401
-SQLITE_API int SQLITE_APICALL sqlite3_prepare16_v2(
113452
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
113402113453
sqlite3 *db, /* Database handle. */
113403113454
const void *zSql, /* UTF-16 encoded SQL statement. */
113404113455
int nBytes, /* Length of zSql in bytes. */
113405113456
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113406113457
const void **pzTail /* OUT: End of parsed string */
@@ -119239,11 +119290,11 @@
119239119290
** The result that is written to ***pazResult is held in memory obtained
119240119291
** from malloc(). But the caller cannot free this memory directly.
119241119292
** Instead, the entire table should be passed to sqlite3_free_table() when
119242119293
** the calling procedure is finished using it.
119243119294
*/
119244
-SQLITE_API int SQLITE_APICALL sqlite3_get_table(
119295
+SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
119245119296
sqlite3 *db, /* The database on which the SQL executes */
119246119297
const char *zSql, /* The SQL to be executed */
119247119298
char ***pazResult, /* Write the result table here */
119248119299
int *pnRow, /* Write the number of rows in the result here */
119249119300
int *pnColumn, /* Write the number of columns of result here */
@@ -119308,11 +119359,11 @@
119308119359
}
119309119360
119310119361
/*
119311119362
** This routine frees the space the sqlite3_get_table() malloced.
119312119363
*/
119313
-SQLITE_API void SQLITE_APICALL sqlite3_free_table(
119364
+SQLITE_API void SQLITE_STDCALL sqlite3_free_table(
119314119365
char **azResult /* Result returned from sqlite3_get_table() */
119315119366
){
119316119367
if( azResult ){
119317119368
int i, n;
119318119369
azResult--;
@@ -121718,11 +121769,11 @@
121718121769
121719121770
121720121771
/*
121721121772
** External API function used to create a new virtual-table module.
121722121773
*/
121723
-SQLITE_API int SQLITE_APICALL sqlite3_create_module(
121774
+SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
121724121775
sqlite3 *db, /* Database in which module is registered */
121725121776
const char *zName, /* Name assigned to this module */
121726121777
const sqlite3_module *pModule, /* The definition of the module */
121727121778
void *pAux /* Context pointer for xCreate/xConnect */
121728121779
){
@@ -121733,11 +121784,11 @@
121733121784
}
121734121785
121735121786
/*
121736121787
** External API function used to create a new virtual-table module.
121737121788
*/
121738
-SQLITE_API int SQLITE_APICALL sqlite3_create_module_v2(
121789
+SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
121739121790
sqlite3 *db, /* Database in which module is registered */
121740121791
const char *zName, /* Name assigned to this module */
121741121792
const sqlite3_module *pModule, /* The definition of the module */
121742121793
void *pAux, /* Context pointer for xCreate/xConnect */
121743121794
void (*xDestroy)(void *) /* Module destructor function */
@@ -122357,11 +122408,11 @@
122357122408
/*
122358122409
** This function is used to set the schema of a virtual table. It is only
122359122410
** valid to call this function from within the xCreate() or xConnect() of a
122360122411
** virtual table module.
122361122412
*/
122362
-SQLITE_API int SQLITE_APICALL sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
122413
+SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
122363122414
VtabCtx *pCtx;
122364122415
Parse *pParse;
122365122416
int rc = SQLITE_OK;
122366122417
Table *pTab;
122367122418
char *zErr = 0;
@@ -122447,11 +122498,11 @@
122447122498
SQLITE_PRIVATE int sqlite3VtabCallDestroy(sqlite3 *db, int iDb, const char *zTab){
122448122499
int rc = SQLITE_OK;
122449122500
Table *pTab;
122450122501
122451122502
pTab = sqlite3FindTable(db, zTab, db->aDb[iDb].zName);
122452
- if( ALWAYS(pTab!=0 && pTab->pVTable!=0) ){
122503
+ if( pTab!=0 && ALWAYS(pTab->pVTable!=0) ){
122453122504
VTable *p;
122454122505
int (*xDestroy)(sqlite3_vtab *);
122455122506
for(p=pTab->pVTable; p; p=p->pNext){
122456122507
assert( p->pVtab );
122457122508
if( p->pVtab->nRef>0 ){
@@ -122587,11 +122638,14 @@
122587122638
if( rc==SQLITE_OK ){
122588122639
rc = pModule->xBegin(pVTab->pVtab);
122589122640
if( rc==SQLITE_OK ){
122590122641
int iSvpt = db->nStatement + db->nSavepoint;
122591122642
addToVTrans(db, pVTab);
122592
- if( iSvpt ) rc = sqlite3VtabSavepoint(db, SAVEPOINT_BEGIN, iSvpt-1);
122643
+ if( iSvpt && pModule->xSavepoint ){
122644
+ pVTab->iSavepoint = iSvpt;
122645
+ rc = pModule->xSavepoint(pVTab->pVtab, iSvpt-1);
122646
+ }
122593122647
}
122594122648
}
122595122649
}
122596122650
return rc;
122597122651
}
@@ -122811,11 +122865,11 @@
122811122865
** table update operation currently in progress.
122812122866
**
122813122867
** The results of this routine are undefined unless it is called from
122814122868
** within an xUpdate method.
122815122869
*/
122816
-SQLITE_API int SQLITE_APICALL sqlite3_vtab_on_conflict(sqlite3 *db){
122870
+SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *db){
122817122871
static const unsigned char aMap[] = {
122818122872
SQLITE_ROLLBACK, SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_REPLACE
122819122873
};
122820122874
#ifdef SQLITE_ENABLE_API_ARMOR
122821122875
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -130601,11 +130655,11 @@
130601130655
}else{
130602130656
pWInfo->nOBSat = pFrom->isOrdered;
130603130657
pWInfo->revMask = pFrom->revLoop;
130604130658
if( pWInfo->nOBSat<=0 ){
130605130659
pWInfo->nOBSat = 0;
130606
- if( nLoop>0 ){
130660
+ if( nLoop>0 && (pFrom->aLoop[nLoop-1]->wsFlags & WHERE_ONEROW)==0 ){
130607130661
Bitmask m = 0;
130608130662
int rc = wherePathSatisfiesOrderBy(pWInfo, pWInfo->pOrderBy, pFrom,
130609130663
WHERE_ORDERBY_LIMIT, nLoop-1, pFrom->aLoop[nLoop-1], &m);
130610130664
if( rc==pWInfo->pOrderBy->nExpr ){
130611130665
pWInfo->bOrderedInnerLoop = 1;
@@ -136136,11 +136190,11 @@
136136136190
**
136137136191
** If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed
136138136192
** to recognize the end of a trigger can be omitted. All we have to do
136139136193
** is look for a semicolon that is not part of an string or comment.
136140136194
*/
136141
-SQLITE_API int SQLITE_APICALL sqlite3_complete(const char *zSql){
136195
+SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *zSql){
136142136196
u8 state = 0; /* Current state, using numbers defined in header comment */
136143136197
u8 token; /* Value of the next token */
136144136198
136145136199
#ifndef SQLITE_OMIT_TRIGGER
136146136200
/* A complex statement machine used to detect the end of a CREATE TRIGGER
@@ -136301,11 +136355,11 @@
136301136355
/*
136302136356
** This routine is the same as the sqlite3_complete() routine described
136303136357
** above, except that the parameter is required to be UTF-16 encoded, not
136304136358
** UTF-8.
136305136359
*/
136306
-SQLITE_API int SQLITE_APICALL sqlite3_complete16(const void *zSql){
136360
+SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *zSql){
136307136361
sqlite3_value *pVal;
136308136362
char const *zSql8;
136309136363
int rc;
136310136364
136311136365
#ifndef SQLITE_OMIT_AUTOINIT
@@ -136461,28 +136515,28 @@
136461136515
#endif
136462136516
136463136517
/* IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns
136464136518
** a pointer to the to the sqlite3_version[] string constant.
136465136519
*/
136466
-SQLITE_API const char *SQLITE_APICALL sqlite3_libversion(void){ return sqlite3_version; }
136520
+SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void){ return sqlite3_version; }
136467136521
136468136522
/* IMPLEMENTATION-OF: R-63124-39300 The sqlite3_sourceid() function returns a
136469136523
** pointer to a string constant whose value is the same as the
136470136524
** SQLITE_SOURCE_ID C preprocessor macro.
136471136525
*/
136472
-SQLITE_API const char *SQLITE_APICALL sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
136526
+SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
136473136527
136474136528
/* IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function
136475136529
** returns an integer equal to SQLITE_VERSION_NUMBER.
136476136530
*/
136477
-SQLITE_API int SQLITE_APICALL sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; }
136531
+SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; }
136478136532
136479136533
/* IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns
136480136534
** zero if and only if SQLite was compiled with mutexing code omitted due to
136481136535
** the SQLITE_THREADSAFE compile-time option being set to 0.
136482136536
*/
136483
-SQLITE_API int SQLITE_APICALL sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; }
136537
+SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; }
136484136538
136485136539
/*
136486136540
** When compiling the test fixture or with debugging enabled (on Win32),
136487136541
** this variable being set to non-zero will cause OSTRACE macros to emit
136488136542
** extra diagnostic information.
@@ -136551,11 +136605,11 @@
136551136605
** call by X completes.
136552136606
**
136553136607
** * Recursive calls to this routine from thread X return immediately
136554136608
** without blocking.
136555136609
*/
136556
-SQLITE_API int SQLITE_APICALL sqlite3_initialize(void){
136610
+SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void){
136557136611
MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */
136558136612
int rc; /* Result code */
136559136613
#ifdef SQLITE_EXTRA_INIT
136560136614
int bRunExtraInit = 0; /* Extra initialization needed */
136561136615
#endif
@@ -136717,11 +136771,11 @@
136717136771
** while any part of SQLite is otherwise in use in any thread. This
136718136772
** routine is not threadsafe. But it is safe to invoke this routine
136719136773
** on when SQLite is already shut down. If SQLite is already shut down
136720136774
** when this routine is invoked, then this routine is a harmless no-op.
136721136775
*/
136722
-SQLITE_API int SQLITE_APICALL sqlite3_shutdown(void){
136776
+SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void){
136723136777
#ifdef SQLITE_OMIT_WSD
136724136778
int rc = sqlite3_wsd_init(4096, 24);
136725136779
if( rc!=SQLITE_OK ){
136726136780
return rc;
136727136781
}
@@ -137136,11 +137190,11 @@
137136137190
}
137137137191
137138137192
/*
137139137193
** Return the mutex associated with a database connection.
137140137194
*/
137141
-SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_db_mutex(sqlite3 *db){
137195
+SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3 *db){
137142137196
#ifdef SQLITE_ENABLE_API_ARMOR
137143137197
if( !sqlite3SafetyCheckOk(db) ){
137144137198
(void)SQLITE_MISUSE_BKPT;
137145137199
return 0;
137146137200
}
@@ -137150,11 +137204,11 @@
137150137204
137151137205
/*
137152137206
** Free up as much memory as we can from the given database
137153137207
** connection.
137154137208
*/
137155
-SQLITE_API int SQLITE_APICALL sqlite3_db_release_memory(sqlite3 *db){
137209
+SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3 *db){
137156137210
int i;
137157137211
137158137212
#ifdef SQLITE_ENABLE_API_ARMOR
137159137213
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
137160137214
#endif
@@ -137174,11 +137228,11 @@
137174137228
137175137229
/*
137176137230
** Flush any dirty pages in the pager-cache for any attached database
137177137231
** to disk.
137178137232
*/
137179
-SQLITE_API int SQLITE_APICALL sqlite3_db_cacheflush(sqlite3 *db){
137233
+SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3 *db){
137180137234
int i;
137181137235
int rc = SQLITE_OK;
137182137236
int bSeenBusy = 0;
137183137237
137184137238
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -137324,11 +137378,11 @@
137324137378
}
137325137379
137326137380
/*
137327137381
** Return the ROWID of the most recent insert
137328137382
*/
137329
-SQLITE_API sqlite_int64 SQLITE_APICALL sqlite3_last_insert_rowid(sqlite3 *db){
137383
+SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3 *db){
137330137384
#ifdef SQLITE_ENABLE_API_ARMOR
137331137385
if( !sqlite3SafetyCheckOk(db) ){
137332137386
(void)SQLITE_MISUSE_BKPT;
137333137387
return 0;
137334137388
}
@@ -137337,11 +137391,11 @@
137337137391
}
137338137392
137339137393
/*
137340137394
** Return the number of changes in the most recent call to sqlite3_exec().
137341137395
*/
137342
-SQLITE_API int SQLITE_APICALL sqlite3_changes(sqlite3 *db){
137396
+SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3 *db){
137343137397
#ifdef SQLITE_ENABLE_API_ARMOR
137344137398
if( !sqlite3SafetyCheckOk(db) ){
137345137399
(void)SQLITE_MISUSE_BKPT;
137346137400
return 0;
137347137401
}
@@ -137350,11 +137404,11 @@
137350137404
}
137351137405
137352137406
/*
137353137407
** Return the number of changes since the database handle was opened.
137354137408
*/
137355
-SQLITE_API int SQLITE_APICALL sqlite3_total_changes(sqlite3 *db){
137409
+SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3 *db){
137356137410
#ifdef SQLITE_ENABLE_API_ARMOR
137357137411
if( !sqlite3SafetyCheckOk(db) ){
137358137412
(void)SQLITE_MISUSE_BKPT;
137359137413
return 0;
137360137414
}
@@ -137501,12 +137555,12 @@
137501137555
** statements or unfinished sqlite3_backups. The sqlite3_close_v2()
137502137556
** version forces the connection to become a zombie if there are
137503137557
** unclosed resources, and arranges for deallocation when the last
137504137558
** prepare statement or sqlite3_backup closes.
137505137559
*/
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); }
137560
+SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3 *db){ return sqlite3Close(db,0); }
137561
+SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3 *db){ return sqlite3Close(db,1); }
137508137562
137509137563
137510137564
/*
137511137565
** Close the mutex on database connection db.
137512137566
**
@@ -137909,11 +137963,11 @@
137909137963
137910137964
/*
137911137965
** This routine sets the busy callback for an Sqlite database to the
137912137966
** given callback function with the given argument.
137913137967
*/
137914
-SQLITE_API int SQLITE_APICALL sqlite3_busy_handler(
137968
+SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(
137915137969
sqlite3 *db,
137916137970
int (*xBusy)(void*,int),
137917137971
void *pArg
137918137972
){
137919137973
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -137932,11 +137986,11 @@
137932137986
/*
137933137987
** This routine sets the progress callback for an Sqlite database to the
137934137988
** given callback function with the given argument. The progress callback will
137935137989
** be invoked every nOps opcodes.
137936137990
*/
137937
-SQLITE_API void SQLITE_APICALL sqlite3_progress_handler(
137991
+SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(
137938137992
sqlite3 *db,
137939137993
int nOps,
137940137994
int (*xProgress)(void*),
137941137995
void *pArg
137942137996
){
@@ -137963,11 +138017,11 @@
137963138017
137964138018
/*
137965138019
** This routine installs a default busy handler that waits for the
137966138020
** specified number of milliseconds before returning 0.
137967138021
*/
137968
-SQLITE_API int SQLITE_APICALL sqlite3_busy_timeout(sqlite3 *db, int ms){
138022
+SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3 *db, int ms){
137969138023
#ifdef SQLITE_ENABLE_API_ARMOR
137970138024
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
137971138025
#endif
137972138026
if( ms>0 ){
137973138027
sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db);
@@ -137979,11 +138033,11 @@
137979138033
}
137980138034
137981138035
/*
137982138036
** Cause any pending operation to stop at its earliest opportunity.
137983138037
*/
137984
-SQLITE_API void SQLITE_APICALL sqlite3_interrupt(sqlite3 *db){
138038
+SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3 *db){
137985138039
#ifdef SQLITE_ENABLE_API_ARMOR
137986138040
if( !sqlite3SafetyCheckOk(db) ){
137987138041
(void)SQLITE_MISUSE_BKPT;
137988138042
return;
137989138043
}
@@ -138095,11 +138149,11 @@
138095138149
}
138096138150
138097138151
/*
138098138152
** Create new user functions.
138099138153
*/
138100
-SQLITE_API int SQLITE_APICALL sqlite3_create_function(
138154
+SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
138101138155
sqlite3 *db,
138102138156
const char *zFunc,
138103138157
int nArg,
138104138158
int enc,
138105138159
void *p,
@@ -138109,11 +138163,11 @@
138109138163
){
138110138164
return sqlite3_create_function_v2(db, zFunc, nArg, enc, p, xSFunc, xStep,
138111138165
xFinal, 0);
138112138166
}
138113138167
138114
-SQLITE_API int SQLITE_APICALL sqlite3_create_function_v2(
138168
+SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
138115138169
sqlite3 *db,
138116138170
const char *zFunc,
138117138171
int nArg,
138118138172
int enc,
138119138173
void *p,
@@ -138152,11 +138206,11 @@
138152138206
sqlite3_mutex_leave(db->mutex);
138153138207
return rc;
138154138208
}
138155138209
138156138210
#ifndef SQLITE_OMIT_UTF16
138157
-SQLITE_API int SQLITE_APICALL sqlite3_create_function16(
138211
+SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
138158138212
sqlite3 *db,
138159138213
const void *zFunctionName,
138160138214
int nArg,
138161138215
int eTextRep,
138162138216
void *p,
@@ -138192,11 +138246,11 @@
138192138246
** When virtual tables intend to provide an overloaded function, they
138193138247
** should call this routine to make sure the global function exists.
138194138248
** A global function must exist in order for name resolution to work
138195138249
** properly.
138196138250
*/
138197
-SQLITE_API int SQLITE_APICALL sqlite3_overload_function(
138251
+SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(
138198138252
sqlite3 *db,
138199138253
const char *zName,
138200138254
int nArg
138201138255
){
138202138256
int rc = SQLITE_OK;
@@ -138224,11 +138278,11 @@
138224138278
** A NULL trace function means that no tracing is executes. A non-NULL
138225138279
** trace is a pointer to a function that is invoked at the start of each
138226138280
** SQL statement.
138227138281
*/
138228138282
#ifndef SQLITE_OMIT_DEPRECATED
138229
-SQLITE_API void *SQLITE_APICALL sqlite3_trace(sqlite3 *db, void(*xTrace)(void*,const char*), void *pArg){
138283
+SQLITE_API void *SQLITE_STDCALL sqlite3_trace(sqlite3 *db, void(*xTrace)(void*,const char*), void *pArg){
138230138284
void *pOld;
138231138285
138232138286
#ifdef SQLITE_ENABLE_API_ARMOR
138233138287
if( !sqlite3SafetyCheckOk(db) ){
138234138288
(void)SQLITE_MISUSE_BKPT;
@@ -138245,11 +138299,11 @@
138245138299
}
138246138300
#endif /* SQLITE_OMIT_DEPRECATED */
138247138301
138248138302
/* Register a trace callback using the version-2 interface.
138249138303
*/
138250
-SQLITE_API int SQLITE_APICALL sqlite3_trace_v2(
138304
+SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2(
138251138305
sqlite3 *db, /* Trace this connection */
138252138306
unsigned mTrace, /* Mask of events to be traced */
138253138307
int(*xTrace)(unsigned,void*,void*,void*), /* Callback to invoke */
138254138308
void *pArg /* Context */
138255138309
){
@@ -138273,11 +138327,11 @@
138273138327
**
138274138328
** A NULL profile function means that no profiling is executes. A non-NULL
138275138329
** profile is a pointer to a function that is invoked at the conclusion of
138276138330
** each SQL statement that is run.
138277138331
*/
138278
-SQLITE_API void *SQLITE_APICALL sqlite3_profile(
138332
+SQLITE_API void *SQLITE_STDCALL sqlite3_profile(
138279138333
sqlite3 *db,
138280138334
void (*xProfile)(void*,const char*,sqlite_uint64),
138281138335
void *pArg
138282138336
){
138283138337
void *pOld;
@@ -138301,11 +138355,11 @@
138301138355
/*
138302138356
** Register a function to be invoked when a transaction commits.
138303138357
** If the invoked function returns non-zero, then the commit becomes a
138304138358
** rollback.
138305138359
*/
138306
-SQLITE_API void *SQLITE_APICALL sqlite3_commit_hook(
138360
+SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(
138307138361
sqlite3 *db, /* Attach the hook to this database */
138308138362
int (*xCallback)(void*), /* Function to invoke on each commit */
138309138363
void *pArg /* Argument to the function */
138310138364
){
138311138365
void *pOld;
@@ -138326,11 +138380,11 @@
138326138380
138327138381
/*
138328138382
** Register a callback to be invoked each time a row is updated,
138329138383
** inserted or deleted using this database connection.
138330138384
*/
138331
-SQLITE_API void *SQLITE_APICALL sqlite3_update_hook(
138385
+SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
138332138386
sqlite3 *db, /* Attach the hook to this database */
138333138387
void (*xCallback)(void*,int,char const *,char const *,sqlite_int64),
138334138388
void *pArg /* Argument to the function */
138335138389
){
138336138390
void *pRet;
@@ -138351,11 +138405,11 @@
138351138405
138352138406
/*
138353138407
** Register a callback to be invoked each time a transaction is rolled
138354138408
** back by this database connection.
138355138409
*/
138356
-SQLITE_API void *SQLITE_APICALL sqlite3_rollback_hook(
138410
+SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(
138357138411
sqlite3 *db, /* Attach the hook to this database */
138358138412
void (*xCallback)(void*), /* Callback function */
138359138413
void *pArg /* Argument to the function */
138360138414
){
138361138415
void *pRet;
@@ -138377,11 +138431,11 @@
138377138431
#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
138378138432
/*
138379138433
** Register a callback to be invoked each time a row is updated,
138380138434
** inserted or deleted using this database connection.
138381138435
*/
138382
-SQLITE_API void *SQLITE_APICALL sqlite3_preupdate_hook(
138436
+SQLITE_API void *SQLITE_STDCALL sqlite3_preupdate_hook(
138383138437
sqlite3 *db, /* Attach the hook to this database */
138384138438
void(*xCallback)( /* Callback function */
138385138439
void*,sqlite3*,int,char const*,char const*,sqlite3_int64,sqlite3_int64),
138386138440
void *pArg /* First callback argument */
138387138441
){
@@ -138426,11 +138480,11 @@
138426138480
** The callback registered by this function replaces any existing callback
138427138481
** registered using sqlite3_wal_hook(). Likewise, registering a callback
138428138482
** using sqlite3_wal_hook() disables the automatic checkpoint mechanism
138429138483
** configured by this function.
138430138484
*/
138431
-SQLITE_API int SQLITE_APICALL sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){
138485
+SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){
138432138486
#ifdef SQLITE_OMIT_WAL
138433138487
UNUSED_PARAMETER(db);
138434138488
UNUSED_PARAMETER(nFrame);
138435138489
#else
138436138490
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -138447,11 +138501,11 @@
138447138501
138448138502
/*
138449138503
** Register a callback to be invoked each time a transaction is written
138450138504
** into the write-ahead-log by this database connection.
138451138505
*/
138452
-SQLITE_API void *SQLITE_APICALL sqlite3_wal_hook(
138506
+SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
138453138507
sqlite3 *db, /* Attach the hook to this db handle */
138454138508
int(*xCallback)(void *, sqlite3*, const char*, int),
138455138509
void *pArg /* First argument passed to xCallback() */
138456138510
){
138457138511
#ifndef SQLITE_OMIT_WAL
@@ -138474,11 +138528,11 @@
138474138528
}
138475138529
138476138530
/*
138477138531
** Checkpoint database zDb.
138478138532
*/
138479
-SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint_v2(
138533
+SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
138480138534
sqlite3 *db, /* Database handle */
138481138535
const char *zDb, /* Name of attached database (or NULL) */
138482138536
int eMode, /* SQLITE_CHECKPOINT_* value */
138483138537
int *pnLog, /* OUT: Size of WAL log in frames */
138484138538
int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -138529,11 +138583,11 @@
138529138583
/*
138530138584
** Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points
138531138585
** to contains a zero-length string, all attached databases are
138532138586
** checkpointed.
138533138587
*/
138534
-SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){
138588
+SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){
138535138589
/* EVIDENCE-OF: R-41613-20553 The sqlite3_wal_checkpoint(D,X) is equivalent to
138536138590
** sqlite3_wal_checkpoint_v2(D,X,SQLITE_CHECKPOINT_PASSIVE,0,0). */
138537138591
return sqlite3_wal_checkpoint_v2(db,zDb,SQLITE_CHECKPOINT_PASSIVE,0,0);
138538138592
}
138539138593
@@ -138620,11 +138674,11 @@
138620138674
138621138675
/*
138622138676
** Return UTF-8 encoded English language explanation of the most recent
138623138677
** error.
138624138678
*/
138625
-SQLITE_API const char *SQLITE_APICALL sqlite3_errmsg(sqlite3 *db){
138679
+SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3 *db){
138626138680
const char *z;
138627138681
if( !db ){
138628138682
return sqlite3ErrStr(SQLITE_NOMEM_BKPT);
138629138683
}
138630138684
if( !sqlite3SafetyCheckSickOrOk(db) ){
@@ -138648,11 +138702,11 @@
138648138702
#ifndef SQLITE_OMIT_UTF16
138649138703
/*
138650138704
** Return UTF-16 encoded English language explanation of the most recent
138651138705
** error.
138652138706
*/
138653
-SQLITE_API const void *SQLITE_APICALL sqlite3_errmsg16(sqlite3 *db){
138707
+SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3 *db){
138654138708
static const u16 outOfMem[] = {
138655138709
'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0
138656138710
};
138657138711
static const u16 misuse[] = {
138658138712
'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ',
@@ -138693,38 +138747,38 @@
138693138747
138694138748
/*
138695138749
** Return the most recent error code generated by an SQLite routine. If NULL is
138696138750
** passed to this function, we assume a malloc() failed during sqlite3_open().
138697138751
*/
138698
-SQLITE_API int SQLITE_APICALL sqlite3_errcode(sqlite3 *db){
138752
+SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db){
138699138753
if( db && !sqlite3SafetyCheckSickOrOk(db) ){
138700138754
return SQLITE_MISUSE_BKPT;
138701138755
}
138702138756
if( !db || db->mallocFailed ){
138703138757
return SQLITE_NOMEM_BKPT;
138704138758
}
138705138759
return db->errCode & db->errMask;
138706138760
}
138707
-SQLITE_API int SQLITE_APICALL sqlite3_extended_errcode(sqlite3 *db){
138761
+SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db){
138708138762
if( db && !sqlite3SafetyCheckSickOrOk(db) ){
138709138763
return SQLITE_MISUSE_BKPT;
138710138764
}
138711138765
if( !db || db->mallocFailed ){
138712138766
return SQLITE_NOMEM_BKPT;
138713138767
}
138714138768
return db->errCode;
138715138769
}
138716
-SQLITE_API int SQLITE_APICALL sqlite3_system_errno(sqlite3 *db){
138770
+SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3 *db){
138717138771
return db ? db->iSysErrno : 0;
138718138772
}
138719138773
138720138774
/*
138721138775
** Return a string that describes the kind of error specified in the
138722138776
** argument. For now, this simply calls the internal sqlite3ErrStr()
138723138777
** function.
138724138778
*/
138725
-SQLITE_API const char *SQLITE_APICALL sqlite3_errstr(int rc){
138779
+SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int rc){
138726138780
return sqlite3ErrStr(rc);
138727138781
}
138728138782
138729138783
/*
138730138784
** Create a new collating function for database "db". The name is zName
@@ -138868,11 +138922,11 @@
138868138922
**
138869138923
** A new lower limit does not shrink existing constructs.
138870138924
** It merely prevents new constructs that exceed the limit
138871138925
** from forming.
138872138926
*/
138873
-SQLITE_API int SQLITE_APICALL sqlite3_limit(sqlite3 *db, int limitId, int newLimit){
138927
+SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3 *db, int limitId, int newLimit){
138874138928
int oldLimit;
138875138929
138876138930
#ifdef SQLITE_ENABLE_API_ARMOR
138877138931
if( !sqlite3SafetyCheckOk(db) ){
138878138932
(void)SQLITE_MISUSE_BKPT;
@@ -139492,18 +139546,18 @@
139492139546
}
139493139547
139494139548
/*
139495139549
** Open a new database handle.
139496139550
*/
139497
-SQLITE_API int SQLITE_APICALL sqlite3_open(
139551
+SQLITE_API int SQLITE_STDCALL sqlite3_open(
139498139552
const char *zFilename,
139499139553
sqlite3 **ppDb
139500139554
){
139501139555
return openDatabase(zFilename, ppDb,
139502139556
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0);
139503139557
}
139504
-SQLITE_API int SQLITE_APICALL sqlite3_open_v2(
139558
+SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
139505139559
const char *filename, /* Database filename (UTF-8) */
139506139560
sqlite3 **ppDb, /* OUT: SQLite db handle */
139507139561
int flags, /* Flags */
139508139562
const char *zVfs /* Name of VFS module to use */
139509139563
){
@@ -139512,11 +139566,11 @@
139512139566
139513139567
#ifndef SQLITE_OMIT_UTF16
139514139568
/*
139515139569
** Open a new database handle.
139516139570
*/
139517
-SQLITE_API int SQLITE_APICALL sqlite3_open16(
139571
+SQLITE_API int SQLITE_STDCALL sqlite3_open16(
139518139572
const void *zFilename,
139519139573
sqlite3 **ppDb
139520139574
){
139521139575
char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */
139522139576
sqlite3_value *pVal;
@@ -139551,11 +139605,11 @@
139551139605
#endif /* SQLITE_OMIT_UTF16 */
139552139606
139553139607
/*
139554139608
** Register a new collation sequence with the database handle db.
139555139609
*/
139556
-SQLITE_API int SQLITE_APICALL sqlite3_create_collation(
139610
+SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
139557139611
sqlite3* db,
139558139612
const char *zName,
139559139613
int enc,
139560139614
void* pCtx,
139561139615
int(*xCompare)(void*,int,const void*,int,const void*)
@@ -139564,11 +139618,11 @@
139564139618
}
139565139619
139566139620
/*
139567139621
** Register a new collation sequence with the database handle db.
139568139622
*/
139569
-SQLITE_API int SQLITE_APICALL sqlite3_create_collation_v2(
139623
+SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
139570139624
sqlite3* db,
139571139625
const char *zName,
139572139626
int enc,
139573139627
void* pCtx,
139574139628
int(*xCompare)(void*,int,const void*,int,const void*),
@@ -139589,11 +139643,11 @@
139589139643
139590139644
#ifndef SQLITE_OMIT_UTF16
139591139645
/*
139592139646
** Register a new collation sequence with the database handle db.
139593139647
*/
139594
-SQLITE_API int SQLITE_APICALL sqlite3_create_collation16(
139648
+SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
139595139649
sqlite3* db,
139596139650
const void *zName,
139597139651
int enc,
139598139652
void* pCtx,
139599139653
int(*xCompare)(void*,int,const void*,int,const void*)
@@ -139619,11 +139673,11 @@
139619139673
139620139674
/*
139621139675
** Register a collation sequence factory callback with the database handle
139622139676
** db. Replace any previously installed collation sequence factory.
139623139677
*/
139624
-SQLITE_API int SQLITE_APICALL sqlite3_collation_needed(
139678
+SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
139625139679
sqlite3 *db,
139626139680
void *pCollNeededArg,
139627139681
void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*)
139628139682
){
139629139683
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -139640,11 +139694,11 @@
139640139694
#ifndef SQLITE_OMIT_UTF16
139641139695
/*
139642139696
** Register a collation sequence factory callback with the database handle
139643139697
** db. Replace any previously installed collation sequence factory.
139644139698
*/
139645
-SQLITE_API int SQLITE_APICALL sqlite3_collation_needed16(
139699
+SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
139646139700
sqlite3 *db,
139647139701
void *pCollNeededArg,
139648139702
void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*)
139649139703
){
139650139704
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -139662,11 +139716,11 @@
139662139716
#ifndef SQLITE_OMIT_DEPRECATED
139663139717
/*
139664139718
** This function is now an anachronism. It used to be used to recover from a
139665139719
** malloc() failure, but SQLite now does this automatically.
139666139720
*/
139667
-SQLITE_API int SQLITE_APICALL sqlite3_global_recover(void){
139721
+SQLITE_API int SQLITE_STDCALL sqlite3_global_recover(void){
139668139722
return SQLITE_OK;
139669139723
}
139670139724
#endif
139671139725
139672139726
/*
@@ -139673,11 +139727,11 @@
139673139727
** Test to see whether or not the database connection is in autocommit
139674139728
** mode. Return TRUE if it is and FALSE if not. Autocommit mode is on
139675139729
** by default. Autocommit is disabled by a BEGIN statement and reenabled
139676139730
** by the next COMMIT or ROLLBACK.
139677139731
*/
139678
-SQLITE_API int SQLITE_APICALL sqlite3_get_autocommit(sqlite3 *db){
139732
+SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3 *db){
139679139733
#ifdef SQLITE_ENABLE_API_ARMOR
139680139734
if( !sqlite3SafetyCheckOk(db) ){
139681139735
(void)SQLITE_MISUSE_BKPT;
139682139736
return 0;
139683139737
}
@@ -139730,19 +139784,19 @@
139730139784
** data for this thread has been deallocated.
139731139785
**
139732139786
** SQLite no longer uses thread-specific data so this routine is now a
139733139787
** no-op. It is retained for historical compatibility.
139734139788
*/
139735
-SQLITE_API void SQLITE_APICALL sqlite3_thread_cleanup(void){
139789
+SQLITE_API void SQLITE_STDCALL sqlite3_thread_cleanup(void){
139736139790
}
139737139791
#endif
139738139792
139739139793
/*
139740139794
** Return meta information about a specific column of a database table.
139741139795
** See comment in sqlite3.h (sqlite.h.in) for details.
139742139796
*/
139743
-SQLITE_API int SQLITE_APICALL sqlite3_table_column_metadata(
139797
+SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
139744139798
sqlite3 *db, /* Connection handle */
139745139799
const char *zDbName, /* Database name or NULL */
139746139800
const char *zTableName, /* Table name */
139747139801
const char *zColumnName, /* Column name */
139748139802
char const **pzDataType, /* OUTPUT: Declared data type */
@@ -139856,11 +139910,11 @@
139856139910
}
139857139911
139858139912
/*
139859139913
** Sleep for a little while. Return the amount of time slept.
139860139914
*/
139861
-SQLITE_API int SQLITE_APICALL sqlite3_sleep(int ms){
139915
+SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int ms){
139862139916
sqlite3_vfs *pVfs;
139863139917
int rc;
139864139918
pVfs = sqlite3_vfs_find(0);
139865139919
if( pVfs==0 ) return 0;
139866139920
@@ -139872,11 +139926,11 @@
139872139926
}
139873139927
139874139928
/*
139875139929
** Enable or disable the extended result codes.
139876139930
*/
139877
-SQLITE_API int SQLITE_APICALL sqlite3_extended_result_codes(sqlite3 *db, int onoff){
139931
+SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3 *db, int onoff){
139878139932
#ifdef SQLITE_ENABLE_API_ARMOR
139879139933
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
139880139934
#endif
139881139935
sqlite3_mutex_enter(db->mutex);
139882139936
db->errMask = onoff ? 0xffffffff : 0xff;
@@ -139885,11 +139939,11 @@
139885139939
}
139886139940
139887139941
/*
139888139942
** Invoke the xFileControl method on a particular database.
139889139943
*/
139890
-SQLITE_API int SQLITE_APICALL sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
139944
+SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
139891139945
int rc = SQLITE_ERROR;
139892139946
Btree *pBtree;
139893139947
139894139948
#ifdef SQLITE_ENABLE_API_ARMOR
139895139949
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -140270,11 +140324,11 @@
140270140324
** method of a VFS implementation. The zParam argument is the name of the
140271140325
** query parameter we seek. This routine returns the value of the zParam
140272140326
** parameter if it exists. If the parameter does not exist, this routine
140273140327
** returns a NULL pointer.
140274140328
*/
140275
-SQLITE_API const char *SQLITE_APICALL sqlite3_uri_parameter(const char *zFilename, const char *zParam){
140329
+SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam){
140276140330
if( zFilename==0 || zParam==0 ) return 0;
140277140331
zFilename += sqlite3Strlen30(zFilename) + 1;
140278140332
while( zFilename[0] ){
140279140333
int x = strcmp(zFilename, zParam);
140280140334
zFilename += sqlite3Strlen30(zFilename) + 1;
@@ -140285,20 +140339,20 @@
140285140339
}
140286140340
140287140341
/*
140288140342
** Return a boolean value for a query parameter.
140289140343
*/
140290
-SQLITE_API int SQLITE_APICALL sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){
140344
+SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){
140291140345
const char *z = sqlite3_uri_parameter(zFilename, zParam);
140292140346
bDflt = bDflt!=0;
140293140347
return z ? sqlite3GetBoolean(z, bDflt) : bDflt;
140294140348
}
140295140349
140296140350
/*
140297140351
** Return a 64-bit integer value for a query parameter.
140298140352
*/
140299
-SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_uri_int64(
140353
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(
140300140354
const char *zFilename, /* Filename as passed to xOpen */
140301140355
const char *zParam, /* URI parameter sought */
140302140356
sqlite3_int64 bDflt /* return if parameter is missing */
140303140357
){
140304140358
const char *z = sqlite3_uri_parameter(zFilename, zParam);
@@ -140326,11 +140380,11 @@
140326140380
140327140381
/*
140328140382
** Return the filename of the database associated with a database
140329140383
** connection.
140330140384
*/
140331
-SQLITE_API const char *SQLITE_APICALL sqlite3_db_filename(sqlite3 *db, const char *zDbName){
140385
+SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName){
140332140386
Btree *pBt;
140333140387
#ifdef SQLITE_ENABLE_API_ARMOR
140334140388
if( !sqlite3SafetyCheckOk(db) ){
140335140389
(void)SQLITE_MISUSE_BKPT;
140336140390
return 0;
@@ -140342,11 +140396,11 @@
140342140396
140343140397
/*
140344140398
** Return 1 if database is read-only or 0 if read/write. Return -1 if
140345140399
** no such database exists.
140346140400
*/
140347
-SQLITE_API int SQLITE_APICALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName){
140401
+SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName){
140348140402
Btree *pBt;
140349140403
#ifdef SQLITE_ENABLE_API_ARMOR
140350140404
if( !sqlite3SafetyCheckOk(db) ){
140351140405
(void)SQLITE_MISUSE_BKPT;
140352140406
return -1;
@@ -140359,11 +140413,11 @@
140359140413
#ifdef SQLITE_ENABLE_SNAPSHOT
140360140414
/*
140361140415
** Obtain a snapshot handle for the snapshot of database zDb currently
140362140416
** being read by handle db.
140363140417
*/
140364
-SQLITE_API int SQLITE_APICALL sqlite3_snapshot_get(
140418
+SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_get(
140365140419
sqlite3 *db,
140366140420
const char *zDb,
140367140421
sqlite3_snapshot **ppSnapshot
140368140422
){
140369140423
int rc = SQLITE_ERROR;
@@ -140394,11 +140448,11 @@
140394140448
}
140395140449
140396140450
/*
140397140451
** Open a read-transaction on the snapshot idendified by pSnapshot.
140398140452
*/
140399
-SQLITE_API int SQLITE_APICALL sqlite3_snapshot_open(
140453
+SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_open(
140400140454
sqlite3 *db,
140401140455
const char *zDb,
140402140456
sqlite3_snapshot *pSnapshot
140403140457
){
140404140458
int rc = SQLITE_ERROR;
@@ -140431,11 +140485,11 @@
140431140485
}
140432140486
140433140487
/*
140434140488
** Free a snapshot handle obtained from sqlite3_snapshot_get().
140435140489
*/
140436
-SQLITE_API void SQLITE_APICALL sqlite3_snapshot_free(sqlite3_snapshot *pSnapshot){
140490
+SQLITE_API void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot *pSnapshot){
140437140491
sqlite3_free(pSnapshot);
140438140492
}
140439140493
#endif /* SQLITE_ENABLE_SNAPSHOT */
140440140494
140441140495
/************** End of main.c ************************************************/
@@ -140585,11 +140639,11 @@
140585140639
**
140586140640
** Each call to this routine overrides any prior callbacks registered
140587140641
** on the same "db". If xNotify==0 then any prior callbacks are immediately
140588140642
** cancelled.
140589140643
*/
140590
-SQLITE_API int SQLITE_APICALL sqlite3_unlock_notify(
140644
+SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
140591140645
sqlite3 *db,
140592140646
void (*xNotify)(void **, int),
140593140647
void *pArg
140594140648
){
140595140649
int rc = SQLITE_OK;
@@ -147588,11 +147642,11 @@
147588147642
** Initialize API pointer table, if required.
147589147643
*/
147590147644
#ifdef _WIN32
147591147645
__declspec(dllexport)
147592147646
#endif
147593
-SQLITE_API int SQLITE_APICALL sqlite3_fts3_init(
147647
+SQLITE_API int SQLITE_STDCALL sqlite3_fts3_init(
147594147648
sqlite3 *db,
147595147649
char **pzErrMsg,
147596147650
const sqlite3_api_routines *pApi
147597147651
){
147598147652
SQLITE_EXTENSION_INIT2(pApi)
@@ -163389,11 +163443,11 @@
163389163443
}
163390163444
163391163445
/*
163392163446
** Register a new geometry function for use with the r-tree MATCH operator.
163393163447
*/
163394
-SQLITE_API int SQLITE_APICALL sqlite3_rtree_geometry_callback(
163448
+SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
163395163449
sqlite3 *db, /* Register SQL function on this connection */
163396163450
const char *zGeom, /* Name of the new SQL function */
163397163451
int (*xGeom)(sqlite3_rtree_geometry*,int,RtreeDValue*,int*), /* Callback */
163398163452
void *pContext /* Extra data associated with the callback */
163399163453
){
@@ -163413,11 +163467,11 @@
163413163467
163414163468
/*
163415163469
** Register a new 2nd-generation geometry function for use with the
163416163470
** r-tree MATCH operator.
163417163471
*/
163418
-SQLITE_API int SQLITE_APICALL sqlite3_rtree_query_callback(
163472
+SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
163419163473
sqlite3 *db, /* Register SQL function on this connection */
163420163474
const char *zQueryFunc, /* Name of new SQL function */
163421163475
int (*xQueryFunc)(sqlite3_rtree_query_info*), /* Callback */
163422163476
void *pContext, /* Extra data passed into the callback */
163423163477
void (*xDestructor)(void*) /* Destructor for the extra data */
@@ -163438,11 +163492,11 @@
163438163492
163439163493
#if !SQLITE_CORE
163440163494
#ifdef _WIN32
163441163495
__declspec(dllexport)
163442163496
#endif
163443
-SQLITE_API int SQLITE_APICALL sqlite3_rtree_init(
163497
+SQLITE_API int SQLITE_STDCALL sqlite3_rtree_init(
163444163498
sqlite3 *db,
163445163499
char **pzErrMsg,
163446163500
const sqlite3_api_routines *pApi
163447163501
){
163448163502
SQLITE_EXTENSION_INIT2(pApi)
@@ -163989,11 +164043,11 @@
163989164043
163990164044
#if !SQLITE_CORE
163991164045
#ifdef _WIN32
163992164046
__declspec(dllexport)
163993164047
#endif
163994
-SQLITE_API int SQLITE_APICALL sqlite3_icu_init(
164048
+SQLITE_API int SQLITE_STDCALL sqlite3_icu_init(
163995164049
sqlite3 *db,
163996164050
char **pzErrMsg,
163997164051
const sqlite3_api_routines *pApi
163998164052
){
163999164053
SQLITE_EXTENSION_INIT2(pApi)
@@ -164669,11 +164723,11 @@
164669164723
** IMPORTANT NOTE FOR ZIPVFS USERS: The RBU extension works with all of
164670164724
** SQLite's built-in VFSs, including the multiplexor VFS. However it does
164671164725
** not work out of the box with zipvfs. Refer to the comment describing
164672164726
** the zipvfs_create_vfs() API below for details on using RBU with zipvfs.
164673164727
*/
164674
-SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_open(
164728
+SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_open(
164675164729
const char *zTarget,
164676164730
const char *zRbu,
164677164731
const char *zState
164678164732
);
164679164733
@@ -164702,11 +164756,11 @@
164702164756
** As with sqlite3rbu_open(), Zipvfs users should rever to the comment
164703164757
** describing the sqlite3rbu_create_vfs() API function below for
164704164758
** a description of the complications associated with using RBU with
164705164759
** zipvfs databases.
164706164760
*/
164707
-SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_vacuum(
164761
+SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_vacuum(
164708164762
const char *zTarget,
164709164763
const char *zState
164710164764
);
164711164765
164712164766
/*
@@ -164738,11 +164792,11 @@
164738164792
** when sqlite3rbu_close() is called.
164739164793
**
164740164794
** Database handles returned by this function remain valid until the next
164741164795
** call to any sqlite3rbu_xxx() function other than sqlite3rbu_db().
164742164796
*/
164743
-SQLITE_API sqlite3 *SQLITE_APICALL sqlite3rbu_db(sqlite3rbu*, int bRbu);
164797
+SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3rbu_db(sqlite3rbu*, int bRbu);
164744164798
164745164799
/*
164746164800
** Do some work towards applying the RBU update to the target db.
164747164801
**
164748164802
** Return SQLITE_DONE if the update has been completely applied, or
@@ -164752,11 +164806,11 @@
164752164806
**
164753164807
** Once a call to sqlite3rbu_step() has returned a value other than
164754164808
** SQLITE_OK, all subsequent calls on the same RBU handle are no-ops
164755164809
** that immediately return the same value.
164756164810
*/
164757
-SQLITE_API int SQLITE_APICALL sqlite3rbu_step(sqlite3rbu *pRbu);
164811
+SQLITE_API int SQLITE_STDCALL sqlite3rbu_step(sqlite3rbu *pRbu);
164758164812
164759164813
/*
164760164814
** Force RBU to save its state to disk.
164761164815
**
164762164816
** If a power failure or application crash occurs during an update, following
@@ -164764,11 +164818,11 @@
164764164818
** was last saved. In other words, from the most recent successful call to
164765164819
** sqlite3rbu_close() or this function.
164766164820
**
164767164821
** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
164768164822
*/
164769
-SQLITE_API int SQLITE_APICALL sqlite3rbu_savestate(sqlite3rbu *pRbu);
164823
+SQLITE_API int SQLITE_STDCALL sqlite3rbu_savestate(sqlite3rbu *pRbu);
164770164824
164771164825
/*
164772164826
** Close an RBU handle.
164773164827
**
164774164828
** If the RBU update has been completely applied, mark the RBU database
@@ -164784,18 +164838,18 @@
164784164838
**
164785164839
** Otherwise, if no error occurs, this function returns SQLITE_OK if the
164786164840
** update has been partially applied, or SQLITE_DONE if it has been
164787164841
** completely applied.
164788164842
*/
164789
-SQLITE_API int SQLITE_APICALL sqlite3rbu_close(sqlite3rbu *pRbu, char **pzErrmsg);
164843
+SQLITE_API int SQLITE_STDCALL sqlite3rbu_close(sqlite3rbu *pRbu, char **pzErrmsg);
164790164844
164791164845
/*
164792164846
** Return the total number of key-value operations (inserts, deletes or
164793164847
** updates) that have been performed on the target database since the
164794164848
** current RBU update was started.
164795164849
*/
164796
-SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3rbu_progress(sqlite3rbu *pRbu);
164850
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3rbu_progress(sqlite3rbu *pRbu);
164797164851
164798164852
/*
164799164853
** Obtain permyriadage (permyriadage is to 10000 as percentage is to 100)
164800164854
** progress indications for the two stages of an RBU update. This API may
164801164855
** be useful for driving GUI progress indicators and similar.
@@ -164833,11 +164887,11 @@
164833164887
** permyriadage progress of the same stage. If the rbu_count table does
164834164888
** not exist, then (*pnOne) is set to -1 during stage 1. If the rbu_count
164835164889
** table exists but is not correctly populated, the value of the *pnOne
164836164890
** output variable during stage 1 is undefined.
164837164891
*/
164838
-SQLITE_API void SQLITE_APICALL sqlite3rbu_bp_progress(sqlite3rbu *pRbu, int *pnOne, int *pnTwo);
164892
+SQLITE_API void SQLITE_STDCALL sqlite3rbu_bp_progress(sqlite3rbu *pRbu, int *pnOne, int *pnTwo);
164839164893
164840164894
/*
164841164895
** Obtain an indication as to the current stage of an RBU update or vacuum.
164842164896
** This function always returns one of the SQLITE_RBU_STATE_XXX constants
164843164897
** defined in this file. Return values should be interpreted as follows:
@@ -164871,11 +164925,11 @@
164871164925
#define SQLITE_RBU_STATE_MOVE 2
164872164926
#define SQLITE_RBU_STATE_CHECKPOINT 3
164873164927
#define SQLITE_RBU_STATE_DONE 4
164874164928
#define SQLITE_RBU_STATE_ERROR 5
164875164929
164876
-SQLITE_API int SQLITE_APICALL sqlite3rbu_state(sqlite3rbu *pRbu);
164930
+SQLITE_API int SQLITE_STDCALL sqlite3rbu_state(sqlite3rbu *pRbu);
164877164931
164878164932
/*
164879164933
** Create an RBU VFS named zName that accesses the underlying file-system
164880164934
** via existing VFS zParent. Or, if the zParent parameter is passed NULL,
164881164935
** then the new RBU VFS uses the default system VFS to access the file-system.
@@ -164915,21 +164969,21 @@
164915164969
** The overhead of adding the "rbu" VFS to the system is negligible for
164916164970
** non-RBU users. There is no harm in an application accessing the
164917164971
** file-system via "rbu" all the time, even if it only uses RBU functionality
164918164972
** occasionally.
164919164973
*/
164920
-SQLITE_API int SQLITE_APICALL sqlite3rbu_create_vfs(const char *zName, const char *zParent);
164974
+SQLITE_API int SQLITE_STDCALL sqlite3rbu_create_vfs(const char *zName, const char *zParent);
164921164975
164922164976
/*
164923164977
** Deregister and destroy an RBU vfs created by an earlier call to
164924164978
** sqlite3rbu_create_vfs().
164925164979
**
164926164980
** VFS objects are not reference counted. If a VFS object is destroyed
164927164981
** before all database handles that use it have been closed, the results
164928164982
** are undefined.
164929164983
*/
164930
-SQLITE_API void SQLITE_APICALL sqlite3rbu_destroy_vfs(const char *zName);
164984
+SQLITE_API void SQLITE_STDCALL sqlite3rbu_destroy_vfs(const char *zName);
164931164985
164932164986
#if 0
164933164987
} /* end of the 'extern "C"' block */
164934164988
#endif
164935164989
@@ -168019,11 +168073,11 @@
168019168073
}
168020168074
168021168075
/*
168022168076
** Step the RBU object.
168023168077
*/
168024
-SQLITE_API int SQLITE_APICALL sqlite3rbu_step(sqlite3rbu *p){
168078
+SQLITE_API int SQLITE_STDCALL sqlite3rbu_step(sqlite3rbu *p){
168025168079
if( p ){
168026168080
switch( p->eStage ){
168027168081
case RBU_STAGE_OAL: {
168028168082
RbuObjIter *pIter = &p->objiter;
168029168083
@@ -168461,11 +168515,11 @@
168461168515
}
168462168516
168463168517
/*
168464168518
** Open and return a new RBU handle.
168465168519
*/
168466
-SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_open(
168520
+SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_open(
168467168521
const char *zTarget,
168468168522
const char *zRbu,
168469168523
const char *zState
168470168524
){
168471168525
/* TODO: Check that zTarget and zRbu are non-NULL */
@@ -168473,11 +168527,11 @@
168473168527
}
168474168528
168475168529
/*
168476168530
** Open a handle to begin or resume an RBU VACUUM operation.
168477168531
*/
168478
-SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_vacuum(
168532
+SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_vacuum(
168479168533
const char *zTarget,
168480168534
const char *zState
168481168535
){
168482168536
/* TODO: Check that both arguments are non-NULL */
168483168537
return openRbuHandle(0, zTarget, zState);
@@ -168484,11 +168538,11 @@
168484168538
}
168485168539
168486168540
/*
168487168541
** Return the database handle used by pRbu.
168488168542
*/
168489
-SQLITE_API sqlite3 *SQLITE_APICALL sqlite3rbu_db(sqlite3rbu *pRbu, int bRbu){
168543
+SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3rbu_db(sqlite3rbu *pRbu, int bRbu){
168490168544
sqlite3 *db = 0;
168491168545
if( pRbu ){
168492168546
db = (bRbu ? pRbu->dbRbu : pRbu->dbMain);
168493168547
}
168494168548
return db;
@@ -168516,11 +168570,11 @@
168516168570
}
168517168571
168518168572
/*
168519168573
** Close the RBU handle.
168520168574
*/
168521
-SQLITE_API int SQLITE_APICALL sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){
168575
+SQLITE_API int SQLITE_STDCALL sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){
168522168576
int rc;
168523168577
if( p ){
168524168578
168525168579
/* Commit the transaction to the *-oal file. */
168526168580
if( p->rc==SQLITE_OK && p->eStage==RBU_STAGE_OAL ){
@@ -168567,19 +168621,19 @@
168567168621
/*
168568168622
** Return the total number of key-value operations (inserts, deletes or
168569168623
** updates) that have been performed on the target database since the
168570168624
** current RBU update was started.
168571168625
*/
168572
-SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3rbu_progress(sqlite3rbu *pRbu){
168626
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3rbu_progress(sqlite3rbu *pRbu){
168573168627
return pRbu->nProgress;
168574168628
}
168575168629
168576168630
/*
168577168631
** Return permyriadage progress indications for the two main stages of
168578168632
** an RBU update.
168579168633
*/
168580
-SQLITE_API void SQLITE_APICALL sqlite3rbu_bp_progress(sqlite3rbu *p, int *pnOne, int *pnTwo){
168634
+SQLITE_API void SQLITE_STDCALL sqlite3rbu_bp_progress(sqlite3rbu *p, int *pnOne, int *pnTwo){
168581168635
const int MAX_PROGRESS = 10000;
168582168636
switch( p->eStage ){
168583168637
case RBU_STAGE_OAL:
168584168638
if( p->nPhaseOneStep>0 ){
168585168639
*pnOne = (int)(MAX_PROGRESS * (i64)p->nProgress/(i64)p->nPhaseOneStep);
@@ -168610,11 +168664,11 @@
168610168664
}
168611168665
168612168666
/*
168613168667
** Return the current state of the RBU vacuum or update operation.
168614168668
*/
168615
-SQLITE_API int SQLITE_APICALL sqlite3rbu_state(sqlite3rbu *p){
168669
+SQLITE_API int SQLITE_STDCALL sqlite3rbu_state(sqlite3rbu *p){
168616168670
int aRes[] = {
168617168671
0, SQLITE_RBU_STATE_OAL, SQLITE_RBU_STATE_MOVE,
168618168672
0, SQLITE_RBU_STATE_CHECKPOINT, SQLITE_RBU_STATE_DONE
168619168673
};
168620168674
@@ -168638,11 +168692,11 @@
168638168692
);
168639168693
return aRes[p->eStage];
168640168694
}
168641168695
}
168642168696
168643
-SQLITE_API int SQLITE_APICALL sqlite3rbu_savestate(sqlite3rbu *p){
168697
+SQLITE_API int SQLITE_STDCALL sqlite3rbu_savestate(sqlite3rbu *p){
168644168698
int rc = p->rc;
168645168699
if( rc==SQLITE_DONE ) return SQLITE_OK;
168646168700
168647168701
assert( p->eStage>=RBU_STAGE_OAL && p->eStage<=RBU_STAGE_DONE );
168648168702
if( p->eStage==RBU_STAGE_OAL ){
@@ -169465,11 +169519,11 @@
169465169519
169466169520
/*
169467169521
** Deregister and destroy an RBU vfs created by an earlier call to
169468169522
** sqlite3rbu_create_vfs().
169469169523
*/
169470
-SQLITE_API void SQLITE_APICALL sqlite3rbu_destroy_vfs(const char *zName){
169524
+SQLITE_API void SQLITE_STDCALL sqlite3rbu_destroy_vfs(const char *zName){
169471169525
sqlite3_vfs *pVfs = sqlite3_vfs_find(zName);
169472169526
if( pVfs && pVfs->xOpen==rbuVfsOpen ){
169473169527
sqlite3_mutex_free(((rbu_vfs*)pVfs)->mutex);
169474169528
sqlite3_vfs_unregister(pVfs);
169475169529
sqlite3_free(pVfs);
@@ -169479,11 +169533,11 @@
169479169533
/*
169480169534
** Create an RBU VFS named zName that accesses the underlying file-system
169481169535
** via existing VFS zParent. The new object is registered as a non-default
169482169536
** VFS with SQLite before returning.
169483169537
*/
169484
-SQLITE_API int SQLITE_APICALL sqlite3rbu_create_vfs(const char *zName, const char *zParent){
169538
+SQLITE_API int SQLITE_STDCALL sqlite3rbu_create_vfs(const char *zName, const char *zParent){
169485169539
169486169540
/* Template for VFS */
169487169541
static sqlite3_vfs vfs_template = {
169488169542
1, /* iVersion */
169489169543
0, /* szOsFile */
@@ -171724,11 +171778,11 @@
171724171778
}
171725171779
171726171780
return rc;
171727171781
}
171728171782
171729
-SQLITE_API int SQLITE_APICALL sqlite3session_diff(
171783
+SQLITE_API int SQLITE_STDCALL sqlite3session_diff(
171730171784
sqlite3_session *pSession,
171731171785
const char *zFrom,
171732171786
const char *zTbl,
171733171787
char **pzErrMsg
171734171788
){
@@ -171818,11 +171872,11 @@
171818171872
171819171873
/*
171820171874
** Create a session object. This session object will record changes to
171821171875
** database zDb attached to connection db.
171822171876
*/
171823
-SQLITE_API int SQLITE_APICALL sqlite3session_create(
171877
+SQLITE_API int SQLITE_STDCALL sqlite3session_create(
171824171878
sqlite3 *db, /* Database handle */
171825171879
const char *zDb, /* Name of db (e.g. "main") */
171826171880
sqlite3_session **ppSession /* OUT: New session object */
171827171881
){
171828171882
sqlite3_session *pNew; /* Newly allocated session object */
@@ -171880,11 +171934,11 @@
171880171934
}
171881171935
171882171936
/*
171883171937
** Delete a session object previously allocated using sqlite3session_create().
171884171938
*/
171885
-SQLITE_API void SQLITE_APICALL sqlite3session_delete(sqlite3_session *pSession){
171939
+SQLITE_API void SQLITE_STDCALL sqlite3session_delete(sqlite3_session *pSession){
171886171940
sqlite3 *db = pSession->db;
171887171941
sqlite3_session *pHead;
171888171942
sqlite3_session **pp;
171889171943
171890171944
/* Unlink the session from the linked list of sessions attached to the
@@ -171909,11 +171963,11 @@
171909171963
}
171910171964
171911171965
/*
171912171966
** Set a table filter on a Session Object.
171913171967
*/
171914
-SQLITE_API void SQLITE_APICALL sqlite3session_table_filter(
171968
+SQLITE_API void SQLITE_STDCALL sqlite3session_table_filter(
171915171969
sqlite3_session *pSession,
171916171970
int(*xFilter)(void*, const char*),
171917171971
void *pCtx /* First argument passed to xFilter */
171918171972
){
171919171973
pSession->bAutoAttach = 1;
@@ -171927,11 +171981,11 @@
171927171981
**
171928171982
** Only tables that have a PRIMARY KEY defined may be attached. It does
171929171983
** not matter if the PRIMARY KEY is an "INTEGER PRIMARY KEY" (rowid alias)
171930171984
** or not.
171931171985
*/
171932
-SQLITE_API int SQLITE_APICALL sqlite3session_attach(
171986
+SQLITE_API int SQLITE_STDCALL sqlite3session_attach(
171933171987
sqlite3_session *pSession, /* Session object */
171934171988
const char *zName /* Table name */
171935171989
){
171936171990
int rc = SQLITE_OK;
171937171991
sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
@@ -172617,11 +172671,11 @@
172617172671
** session object passed as the first argument.
172618172672
**
172619172673
** It is the responsibility of the caller to eventually free the buffer
172620172674
** using sqlite3_free().
172621172675
*/
172622
-SQLITE_API int SQLITE_APICALL sqlite3session_changeset(
172676
+SQLITE_API int SQLITE_STDCALL sqlite3session_changeset(
172623172677
sqlite3_session *pSession, /* Session object */
172624172678
int *pnChangeset, /* OUT: Size of buffer at *ppChangeset */
172625172679
void **ppChangeset /* OUT: Buffer containing changeset */
172626172680
){
172627172681
return sessionGenerateChangeset(pSession, 0, 0, 0, pnChangeset, ppChangeset);
@@ -172628,11 +172682,11 @@
172628172682
}
172629172683
172630172684
/*
172631172685
** Streaming version of sqlite3session_changeset().
172632172686
*/
172633
-SQLITE_API int SQLITE_APICALL sqlite3session_changeset_strm(
172687
+SQLITE_API int SQLITE_STDCALL sqlite3session_changeset_strm(
172634172688
sqlite3_session *pSession,
172635172689
int (*xOutput)(void *pOut, const void *pData, int nData),
172636172690
void *pOut
172637172691
){
172638172692
return sessionGenerateChangeset(pSession, 0, xOutput, pOut, 0, 0);
@@ -172639,11 +172693,11 @@
172639172693
}
172640172694
172641172695
/*
172642172696
** Streaming version of sqlite3session_patchset().
172643172697
*/
172644
-SQLITE_API int SQLITE_APICALL sqlite3session_patchset_strm(
172698
+SQLITE_API int SQLITE_STDCALL sqlite3session_patchset_strm(
172645172699
sqlite3_session *pSession,
172646172700
int (*xOutput)(void *pOut, const void *pData, int nData),
172647172701
void *pOut
172648172702
){
172649172703
return sessionGenerateChangeset(pSession, 1, xOutput, pOut, 0, 0);
@@ -172654,11 +172708,11 @@
172654172708
** session object passed as the first argument.
172655172709
**
172656172710
** It is the responsibility of the caller to eventually free the buffer
172657172711
** using sqlite3_free().
172658172712
*/
172659
-SQLITE_API int SQLITE_APICALL sqlite3session_patchset(
172713
+SQLITE_API int SQLITE_STDCALL sqlite3session_patchset(
172660172714
sqlite3_session *pSession, /* Session object */
172661172715
int *pnPatchset, /* OUT: Size of buffer at *ppChangeset */
172662172716
void **ppPatchset /* OUT: Buffer containing changeset */
172663172717
){
172664172718
return sessionGenerateChangeset(pSession, 1, 0, 0, pnPatchset, ppPatchset);
@@ -172665,11 +172719,11 @@
172665172719
}
172666172720
172667172721
/*
172668172722
** Enable or disable the session object passed as the first argument.
172669172723
*/
172670
-SQLITE_API int SQLITE_APICALL sqlite3session_enable(sqlite3_session *pSession, int bEnable){
172724
+SQLITE_API int SQLITE_STDCALL sqlite3session_enable(sqlite3_session *pSession, int bEnable){
172671172725
int ret;
172672172726
sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172673172727
if( bEnable>=0 ){
172674172728
pSession->bEnable = bEnable;
172675172729
}
@@ -172679,11 +172733,11 @@
172679172733
}
172680172734
172681172735
/*
172682172736
** Enable or disable the session object passed as the first argument.
172683172737
*/
172684
-SQLITE_API int SQLITE_APICALL sqlite3session_indirect(sqlite3_session *pSession, int bIndirect){
172738
+SQLITE_API int SQLITE_STDCALL sqlite3session_indirect(sqlite3_session *pSession, int bIndirect){
172685172739
int ret;
172686172740
sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172687172741
if( bIndirect>=0 ){
172688172742
pSession->bIndirect = bIndirect;
172689172743
}
@@ -172694,11 +172748,11 @@
172694172748
172695172749
/*
172696172750
** Return true if there have been no changes to monitored tables recorded
172697172751
** by the session object passed as the only argument.
172698172752
*/
172699
-SQLITE_API int SQLITE_APICALL sqlite3session_isempty(sqlite3_session *pSession){
172753
+SQLITE_API int SQLITE_STDCALL sqlite3session_isempty(sqlite3_session *pSession){
172700172754
int ret = 0;
172701172755
SessionTable *pTab;
172702172756
172703172757
sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172704172758
for(pTab=pSession->pTable; pTab && ret==0; pTab=pTab->pNext){
@@ -172744,11 +172798,11 @@
172744172798
}
172745172799
172746172800
/*
172747172801
** Create an iterator used to iterate through the contents of a changeset.
172748172802
*/
172749
-SQLITE_API int SQLITE_APICALL sqlite3changeset_start(
172803
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_start(
172750172804
sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
172751172805
int nChangeset, /* Size of buffer pChangeset in bytes */
172752172806
void *pChangeset /* Pointer to buffer containing changeset */
172753172807
){
172754172808
return sessionChangesetStart(pp, 0, 0, nChangeset, pChangeset);
@@ -172755,11 +172809,11 @@
172755172809
}
172756172810
172757172811
/*
172758172812
** Streaming version of sqlite3changeset_start().
172759172813
*/
172760
-SQLITE_API int SQLITE_APICALL sqlite3changeset_start_strm(
172814
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_start_strm(
172761172815
sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
172762172816
int (*xInput)(void *pIn, void *pData, int *pnData),
172763172817
void *pIn
172764172818
){
172765172819
return sessionChangesetStart(pp, xInput, pIn, 0, 0);
@@ -173176,20 +173230,20 @@
173176173230
** or SQLITE_CORRUPT.
173177173231
**
173178173232
** This function may not be called on iterators passed to a conflict handler
173179173233
** callback by changeset_apply().
173180173234
*/
173181
-SQLITE_API int SQLITE_APICALL sqlite3changeset_next(sqlite3_changeset_iter *p){
173235
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_next(sqlite3_changeset_iter *p){
173182173236
return sessionChangesetNext(p, 0, 0);
173183173237
}
173184173238
173185173239
/*
173186173240
** The following function extracts information on the current change
173187173241
** from a changeset iterator. It may only be called after changeset_next()
173188173242
** has returned SQLITE_ROW.
173189173243
*/
173190
-SQLITE_API int SQLITE_APICALL sqlite3changeset_op(
173244
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_op(
173191173245
sqlite3_changeset_iter *pIter, /* Iterator handle */
173192173246
const char **pzTab, /* OUT: Pointer to table name */
173193173247
int *pnCol, /* OUT: Number of columns in table */
173194173248
int *pOp, /* OUT: SQLITE_INSERT, DELETE or UPDATE */
173195173249
int *pbIndirect /* OUT: True if change is indirect */
@@ -173205,11 +173259,11 @@
173205173259
** Return information regarding the PRIMARY KEY and number of columns in
173206173260
** the database table affected by the change that pIter currently points
173207173261
** to. This function may only be called after changeset_next() returns
173208173262
** SQLITE_ROW.
173209173263
*/
173210
-SQLITE_API int SQLITE_APICALL sqlite3changeset_pk(
173264
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_pk(
173211173265
sqlite3_changeset_iter *pIter, /* Iterator object */
173212173266
unsigned char **pabPK, /* OUT: Array of boolean - true for PK cols */
173213173267
int *pnCol /* OUT: Number of entries in output array */
173214173268
){
173215173269
*pabPK = pIter->abPK;
@@ -173228,11 +173282,11 @@
173228173282
** was not modified and is not a PK column), set *ppValue to NULL.
173229173283
**
173230173284
** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is
173231173285
** not modified. Otherwise, SQLITE_OK.
173232173286
*/
173233
-SQLITE_API int SQLITE_APICALL sqlite3changeset_old(
173287
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_old(
173234173288
sqlite3_changeset_iter *pIter, /* Changeset iterator */
173235173289
int iVal, /* Index of old.* value to retrieve */
173236173290
sqlite3_value **ppValue /* OUT: Old value (or NULL pointer) */
173237173291
){
173238173292
if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_DELETE ){
@@ -173256,11 +173310,11 @@
173256173310
** was not modified), set *ppValue to NULL.
173257173311
**
173258173312
** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is
173259173313
** not modified. Otherwise, SQLITE_OK.
173260173314
*/
173261
-SQLITE_API int SQLITE_APICALL sqlite3changeset_new(
173315
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_new(
173262173316
sqlite3_changeset_iter *pIter, /* Changeset iterator */
173263173317
int iVal, /* Index of new.* value to retrieve */
173264173318
sqlite3_value **ppValue /* OUT: New value (or NULL pointer) */
173265173319
){
173266173320
if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_INSERT ){
@@ -173290,11 +173344,11 @@
173290173344
** containing the iVal'th value of the conflicting record.
173291173345
**
173292173346
** If value iVal is out-of-range or some other error occurs, an SQLite error
173293173347
** code is returned. Otherwise, SQLITE_OK.
173294173348
*/
173295
-SQLITE_API int SQLITE_APICALL sqlite3changeset_conflict(
173349
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_conflict(
173296173350
sqlite3_changeset_iter *pIter, /* Changeset iterator */
173297173351
int iVal, /* Index of conflict record value to fetch */
173298173352
sqlite3_value **ppValue /* OUT: Value from conflicting row */
173299173353
){
173300173354
if( !pIter->pConflict ){
@@ -173313,11 +173367,11 @@
173313173367
** it sets the output variable to the total number of known foreign key
173314173368
** violations in the destination database and returns SQLITE_OK.
173315173369
**
173316173370
** In all other cases this function returns SQLITE_MISUSE.
173317173371
*/
173318
-SQLITE_API int SQLITE_APICALL sqlite3changeset_fk_conflicts(
173372
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_fk_conflicts(
173319173373
sqlite3_changeset_iter *pIter, /* Changeset iterator */
173320173374
int *pnOut /* OUT: Number of FK violations */
173321173375
){
173322173376
if( pIter->pConflict || pIter->apValue ){
173323173377
return SQLITE_MISUSE;
@@ -173331,11 +173385,11 @@
173331173385
** Finalize an iterator allocated with sqlite3changeset_start().
173332173386
**
173333173387
** This function may not be called on iterators passed to a conflict handler
173334173388
** callback by changeset_apply().
173335173389
*/
173336
-SQLITE_API int SQLITE_APICALL sqlite3changeset_finalize(sqlite3_changeset_iter *p){
173390
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_finalize(sqlite3_changeset_iter *p){
173337173391
int rc = SQLITE_OK;
173338173392
if( p ){
173339173393
int i; /* Used to iterate through p->apValue[] */
173340173394
rc = p->rc;
173341173395
if( p->apValue ){
@@ -173505,11 +173559,11 @@
173505173559
173506173560
173507173561
/*
173508173562
** Invert a changeset object.
173509173563
*/
173510
-SQLITE_API int SQLITE_APICALL sqlite3changeset_invert(
173564
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_invert(
173511173565
int nChangeset, /* Number of bytes in input */
173512173566
const void *pChangeset, /* Input changeset */
173513173567
int *pnInverted, /* OUT: Number of bytes in output changeset */
173514173568
void **ppInverted /* OUT: Inverse of pChangeset */
173515173569
){
@@ -173524,11 +173578,11 @@
173524173578
}
173525173579
173526173580
/*
173527173581
** Streaming version of sqlite3changeset_invert().
173528173582
*/
173529
-SQLITE_API int SQLITE_APICALL sqlite3changeset_invert_strm(
173583
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_invert_strm(
173530173584
int (*xInput)(void *pIn, void *pData, int *pnData),
173531173585
void *pIn,
173532173586
int (*xOutput)(void *pOut, const void *pData, int nData),
173533173587
void *pOut
173534173588
){
@@ -174404,11 +174458,11 @@
174404174458
/*
174405174459
** Apply the changeset passed via pChangeset/nChangeset to the main database
174406174460
** attached to handle "db". Invoke the supplied conflict handler callback
174407174461
** to resolve any conflicts encountered while applying the change.
174408174462
*/
174409
-SQLITE_API int SQLITE_APICALL sqlite3changeset_apply(
174463
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_apply(
174410174464
sqlite3 *db, /* Apply change to "main" db of this handle */
174411174465
int nChangeset, /* Size of changeset in bytes */
174412174466
void *pChangeset, /* Changeset blob */
174413174467
int(*xFilter)(
174414174468
void *pCtx, /* Copy of sixth arg to _apply() */
@@ -174432,11 +174486,11 @@
174432174486
/*
174433174487
** Apply the changeset passed via xInput/pIn to the main database
174434174488
** attached to handle "db". Invoke the supplied conflict handler callback
174435174489
** to resolve any conflicts encountered while applying the change.
174436174490
*/
174437
-SQLITE_API int SQLITE_APICALL sqlite3changeset_apply_strm(
174491
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_apply_strm(
174438174492
sqlite3 *db, /* Apply change to "main" db of this handle */
174439174493
int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
174440174494
void *pIn, /* First arg for xInput */
174441174495
int(*xFilter)(
174442174496
void *pCtx, /* Copy of sixth arg to _apply() */
@@ -174767,11 +174821,11 @@
174767174821
}
174768174822
174769174823
/*
174770174824
** Allocate a new, empty, sqlite3_changegroup.
174771174825
*/
174772
-SQLITE_API int SQLITE_APICALL sqlite3changegroup_new(sqlite3_changegroup **pp){
174826
+SQLITE_API int SQLITE_STDCALL sqlite3changegroup_new(sqlite3_changegroup **pp){
174773174827
int rc = SQLITE_OK; /* Return code */
174774174828
sqlite3_changegroup *p; /* New object */
174775174829
p = (sqlite3_changegroup*)sqlite3_malloc(sizeof(sqlite3_changegroup));
174776174830
if( p==0 ){
174777174831
rc = SQLITE_NOMEM;
@@ -174784,11 +174838,11 @@
174784174838
174785174839
/*
174786174840
** Add the changeset currently stored in buffer pData, size nData bytes,
174787174841
** to changeset-group p.
174788174842
*/
174789
-SQLITE_API int SQLITE_APICALL sqlite3changegroup_add(sqlite3_changegroup *pGrp, int nData, void *pData){
174843
+SQLITE_API int SQLITE_STDCALL sqlite3changegroup_add(sqlite3_changegroup *pGrp, int nData, void *pData){
174790174844
sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */
174791174845
int rc; /* Return code */
174792174846
174793174847
rc = sqlite3changeset_start(&pIter, nData, pData);
174794174848
if( rc==SQLITE_OK ){
@@ -174800,11 +174854,11 @@
174800174854
174801174855
/*
174802174856
** Obtain a buffer containing a changeset representing the concatenation
174803174857
** of all changesets added to the group so far.
174804174858
*/
174805
-SQLITE_API int SQLITE_APICALL sqlite3changegroup_output(
174859
+SQLITE_API int SQLITE_STDCALL sqlite3changegroup_output(
174806174860
sqlite3_changegroup *pGrp,
174807174861
int *pnData,
174808174862
void **ppData
174809174863
){
174810174864
return sessionChangegroupOutput(pGrp, 0, 0, pnData, ppData);
@@ -174811,11 +174865,11 @@
174811174865
}
174812174866
174813174867
/*
174814174868
** Streaming versions of changegroup_add().
174815174869
*/
174816
-SQLITE_API int SQLITE_APICALL sqlite3changegroup_add_strm(
174870
+SQLITE_API int SQLITE_STDCALL sqlite3changegroup_add_strm(
174817174871
sqlite3_changegroup *pGrp,
174818174872
int (*xInput)(void *pIn, void *pData, int *pnData),
174819174873
void *pIn
174820174874
){
174821174875
sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */
@@ -174830,11 +174884,11 @@
174830174884
}
174831174885
174832174886
/*
174833174887
** Streaming versions of changegroup_output().
174834174888
*/
174835
-SQLITE_API int SQLITE_APICALL sqlite3changegroup_output_strm(
174889
+SQLITE_API int SQLITE_STDCALL sqlite3changegroup_output_strm(
174836174890
sqlite3_changegroup *pGrp,
174837174891
int (*xOutput)(void *pOut, const void *pData, int nData),
174838174892
void *pOut
174839174893
){
174840174894
return sessionChangegroupOutput(pGrp, xOutput, pOut, 0, 0);
@@ -174841,21 +174895,21 @@
174841174895
}
174842174896
174843174897
/*
174844174898
** Delete a changegroup object.
174845174899
*/
174846
-SQLITE_API void SQLITE_APICALL sqlite3changegroup_delete(sqlite3_changegroup *pGrp){
174900
+SQLITE_API void SQLITE_STDCALL sqlite3changegroup_delete(sqlite3_changegroup *pGrp){
174847174901
if( pGrp ){
174848174902
sessionDeleteTable(pGrp->pList);
174849174903
sqlite3_free(pGrp);
174850174904
}
174851174905
}
174852174906
174853174907
/*
174854174908
** Combine two changesets together.
174855174909
*/
174856
-SQLITE_API int SQLITE_APICALL sqlite3changeset_concat(
174910
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_concat(
174857174911
int nLeft, /* Number of bytes in lhs input */
174858174912
void *pLeft, /* Lhs input changeset */
174859174913
int nRight /* Number of bytes in rhs input */,
174860174914
void *pRight, /* Rhs input changeset */
174861174915
int *pnOut, /* OUT: Number of bytes in output changeset */
@@ -174880,11 +174934,11 @@
174880174934
}
174881174935
174882174936
/*
174883174937
** Streaming version of sqlite3changeset_concat().
174884174938
*/
174885
-SQLITE_API int SQLITE_APICALL sqlite3changeset_concat_strm(
174939
+SQLITE_API int SQLITE_STDCALL sqlite3changeset_concat_strm(
174886174940
int (*xInputA)(void *pIn, void *pData, int *pnData),
174887174941
void *pInA,
174888174942
int (*xInputB)(void *pIn, void *pData, int *pnData),
174889174943
void *pInB,
174890174944
int (*xOutput)(void *pOut, const void *pData, int nData),
@@ -177112,11 +177166,11 @@
177112177166
177113177167
#ifndef SQLITE_CORE
177114177168
#ifdef _WIN32
177115177169
__declspec(dllexport)
177116177170
#endif
177117
-SQLITE_API int SQLITE_APICALL sqlite3_json_init(
177171
+SQLITE_API int SQLITE_STDCALL sqlite3_json_init(
177118177172
sqlite3 *db,
177119177173
char **pzErrMsg,
177120177174
const sqlite3_api_routines *pApi
177121177175
){
177122177176
SQLITE_EXTENSION_INIT2(pApi);
@@ -177457,11 +177511,11 @@
177457177511
** following structure. All structure methods must be defined, setting
177458177512
** any member of the fts5_tokenizer struct to NULL leads to undefined
177459177513
** behaviour. The structure methods are expected to function as follows:
177460177514
**
177461177515
** xCreate:
177462
-** This function is used to allocate and inititalize a tokenizer instance.
177516
+** This function is used to allocate and initialize a tokenizer instance.
177463177517
** A tokenizer instance is required to actually tokenize text.
177464177518
**
177465177519
** The first argument passed to this function is a copy of the (void*)
177466177520
** pointer provided by the application when the fts5_tokenizer object
177467177521
** was registered with FTS5 (the third argument to xCreateTokenizer()).
@@ -177716,11 +177770,10 @@
177716177770
#if 0
177717177771
} /* end of the 'extern "C"' block */
177718177772
#endif
177719177773
177720177774
#endif /* _FTS5_H */
177721
-
177722177775
177723177776
/*
177724177777
** 2014 May 31
177725177778
**
177726177779
** The author disclaims copyright to this source code. In place of
@@ -193945,11 +193998,11 @@
193945193998
int nArg, /* Number of args */
193946193999
sqlite3_value **apUnused /* Function arguments */
193947194000
){
193948194001
assert( nArg==0 );
193949194002
UNUSED_PARAM2(nArg, apUnused);
193950
- sqlite3_result_text(pCtx, "fts5: 2016-08-01 21:17:53 d8ef9f58643f13dd3d16dcde0d829ae08324f04b", -1, SQLITE_TRANSIENT);
194003
+ sqlite3_result_text(pCtx, "fts5: 2016-08-05 20:54:45 95578898835b933901603bd4d5e063f1219a016f", -1, SQLITE_TRANSIENT);
193951194004
}
193952194005
193953194006
static int fts5Init(sqlite3 *db){
193954194007
static const sqlite3_module fts5Mod = {
193955194008
/* iVersion */ 2,
@@ -194033,11 +194086,11 @@
194033194086
*/
194034194087
#ifndef SQLITE_CORE
194035194088
#ifdef _WIN32
194036194089
__declspec(dllexport)
194037194090
#endif
194038
-SQLITE_API int SQLITE_APICALL sqlite3_fts_init(
194091
+SQLITE_API int SQLITE_STDCALL sqlite3_fts_init(
194039194092
sqlite3 *db,
194040194093
char **pzErrMsg,
194041194094
const sqlite3_api_routines *pApi
194042194095
){
194043194096
SQLITE_EXTENSION_INIT2(pApi);
@@ -194046,11 +194099,11 @@
194046194099
}
194047194100
194048194101
#ifdef _WIN32
194049194102
__declspec(dllexport)
194050194103
#endif
194051
-SQLITE_API int SQLITE_APICALL sqlite3_fts5_init(
194104
+SQLITE_API int SQLITE_STDCALL sqlite3_fts5_init(
194052194105
sqlite3 *db,
194053194106
char **pzErrMsg,
194054194107
const sqlite3_api_routines *pApi
194055194108
){
194056194109
SQLITE_EXTENSION_INIT2(pApi);
194057194110
--- 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
@@ -2217,11 +2217,11 @@
2217 ** interface independently of the [load_extension()] SQL function.
2218 ** The [sqlite3_enable_load_extension()] API enables or disables both the
2219 ** C-API [sqlite3_load_extension()] and the SQL function [load_extension()].
2220 ** There should be two additional arguments.
2221 ** When the first argument to this interface is 1, then only the C-API is
2222 ** enabled and the SQL function remains disabled. If the first argment to
2223 ** this interface is 0, then both the C-API and the SQL function are disabled.
2224 ** If the first argument is -1, then no changes are made to state of either the
2225 ** C-API or the SQL function.
2226 ** The second parameter is a pointer to an integer into which
2227 ** is written 0 or 1 to indicate whether [sqlite3_load_extension()] interface
@@ -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
@@ -5794,11 +5795,11 @@
5794 ** interface returns SQLITE_OK and fills in the non-NULL pointers in
5795 ** the final five arguments with appropriate values if the specified
5796 ** column exists. ^The sqlite3_table_column_metadata() interface returns
5797 ** SQLITE_ERROR and if the specified column does not exist.
5798 ** ^If the column-name parameter to sqlite3_table_column_metadata() is a
5799 ** NULL pointer, then this routine simply checks for the existance of the
5800 ** table and returns SQLITE_OK if the table exists and SQLITE_ERROR if it
5801 ** does not.
5802 **
5803 ** ^The column is identified by the second, third and fourth parameters to
5804 ** this function. ^(The second parameter is either the name of the database
@@ -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
@@ -8389,11 +8390,11 @@
8389 ** tables.
8390 **
8391 ** ^The second parameter to the preupdate callback is a pointer to
8392 ** the [database connection] that registered the preupdate hook.
8393 ** ^The third parameter to the preupdate callback is one of the constants
8394 ** [SQLITE_INSERT], [SQLITE_DELETE], or [SQLITE_UPDATE] to indentify the
8395 ** kind of update operation that is about to occur.
8396 ** ^(The fourth parameter to the preupdate callback is the name of the
8397 ** database within the database connection that is being modified. This
8398 ** will be "main" for the main database or "temp" for TEMP tables or
8399 ** the name given after the AS keyword in the [ATTACH] statement for attached
@@ -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 *************************************************************************/
@@ -10336,11 +10337,11 @@
10336 ** following structure. All structure methods must be defined, setting
10337 ** any member of the fts5_tokenizer struct to NULL leads to undefined
10338 ** behaviour. The structure methods are expected to function as follows:
10339 **
10340 ** xCreate:
10341 ** This function is used to allocate and inititalize a tokenizer instance.
10342 ** A tokenizer instance is required to actually tokenize text.
10343 **
10344 ** The first argument passed to this function is a copy of the (void*)
10345 ** pointer provided by the application when the fts5_tokenizer object
10346 ** was registered with FTS5 (the third argument to xCreateTokenizer()).
@@ -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
@@ -10595,11 +10596,10 @@
10595 #if 0
10596 } /* end of the 'extern "C"' block */
10597 #endif
10598
10599 #endif /* _FTS5_H */
10600
10601
10602 /******** End of fts5.h *********/
10603
10604 /************** End of sqlite3.h *********************************************/
10605 /************** Continuing where we left off in sqliteInt.h ******************/
@@ -11900,12 +11900,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
@@ -13083,10 +13083,11 @@
13083 SQLITE_PRIVATE sqlite3_file *sqlite3PagerJrnlFile(Pager*);
13084 SQLITE_PRIVATE const char *sqlite3PagerJournalname(Pager*);
13085 SQLITE_PRIVATE void *sqlite3PagerTempSpace(Pager*);
13086 SQLITE_PRIVATE int sqlite3PagerIsMemdb(Pager*);
13087 SQLITE_PRIVATE void sqlite3PagerCacheStat(Pager *, int, int, int *);
 
13088 SQLITE_PRIVATE int sqlite3SectorSize(sqlite3_file *);
13089
13090 /* Functions used to truncate the database file. */
13091 SQLITE_PRIVATE void sqlite3PagerTruncateImage(Pager*,Pgno);
13092
@@ -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 }
@@ -53411,10 +53411,21 @@
53411 ** sqlite3BackupUpdate() only.
53412 */
53413 SQLITE_PRIVATE sqlite3_backup **sqlite3PagerBackupPtr(Pager *pPager){
53414 return &pPager->pBackup;
53415 }
 
 
 
 
 
 
 
 
 
 
 
53416
53417 #ifndef SQLITE_OMIT_WAL
53418 /*
53419 ** This function is called when the user invokes "PRAGMA wal_checkpoint",
53420 ** "PRAGMA wal_blocking_checkpoint" or calls the sqlite3_wal_checkpoint()
@@ -53636,11 +53647,10 @@
53636 SQLITE_PRIVATE int sqlite3PagerWalFramesize(Pager *pPager){
53637 assert( pPager->eState>=PAGER_READER );
53638 return sqlite3WalFramesize(pPager->pWal);
53639 }
53640 #endif
53641
53642
53643 #endif /* SQLITE_OMIT_DISKIO */
53644
53645 /************** End of pager.c ***********************************************/
53646 /************** Begin file wal.c *********************************************/
@@ -57053,11 +57063,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 +58200,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 +64499,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 +67973,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 +68181,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 +68425,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 +68477,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 +68491,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 }
@@ -68596,17 +68606,19 @@
68596 /* 0x7FFFFFFF is the hard limit for the number of pages in a database
68597 ** file. By passing this as the number of pages to copy to
68598 ** sqlite3_backup_step(), we can guarantee that the copy finishes
68599 ** within a single call (unless an error occurs). The assert() statement
68600 ** checks this assumption - (p->rc) should be set to either SQLITE_DONE
68601 ** or an error code.
68602 */
68603 sqlite3_backup_step(&b, 0x7FFFFFFF);
68604 assert( b.rc!=SQLITE_OK );
 
68605 rc = sqlite3_backup_finish(&b);
68606 if( rc==SQLITE_OK ){
68607 pTo->pBt->btsFlags &= ~BTS_PAGESIZE_FIXED;
 
 
68608 }
68609
68610 assert( sqlite3BtreeIsInTrans(pTo)==0 );
68611 copy_finished:
68612 sqlite3BtreeLeave(pFrom);
@@ -74935,11 +74947,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 +75016,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 +75043,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 +75064,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 +75088,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 +75101,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 +75178,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 +75201,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 +75244,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 +75268,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 +75330,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 +75388,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 +75569,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 +75620,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 +75635,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 +75711,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 +75726,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 +75747,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 +75802,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 +75923,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 +76043,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 +76068,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 +76086,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 +76102,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 +76118,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 +76224,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 +76236,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 +76250,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 +76308,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 +76349,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 +76378,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 +76389,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 +76417,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 +76451,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 +76473,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 +76499,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 +76520,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 +76537,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 +76551,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 +76593,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 +76648,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 +76666,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 +76677,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 +76751,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 +76810,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 +77337,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 +84189,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 +84430,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 +84523,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 +84555,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 +88652,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 +92381,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 +97168,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
@@ -100381,10 +100402,17 @@
100381 for(pLoop=pTab->pIndex, n=1; pLoop; pLoop=pLoop->pNext, n++){}
100382 zName = sqlite3MPrintf(db, "sqlite_autoindex_%s_%d", pTab->zName, n);
100383 if( zName==0 ){
100384 goto exit_create_index;
100385 }
 
 
 
 
 
 
 
100386 }
100387
100388 /* Check for authorization to create an index.
100389 */
100390 #ifndef SQLITE_OMIT_AUTHORIZATION
@@ -103910,18 +103938,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 +104501,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 +104992,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 +108664,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 +109926,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 +109957,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 +110014,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 +110061,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 +110086,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 +113347,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 +113359,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 +113435,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 +113447,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 +119290,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 +119359,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 +121769,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 +121784,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 +122408,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;
@@ -122447,11 +122498,11 @@
122447 SQLITE_PRIVATE int sqlite3VtabCallDestroy(sqlite3 *db, int iDb, const char *zTab){
122448 int rc = SQLITE_OK;
122449 Table *pTab;
122450
122451 pTab = sqlite3FindTable(db, zTab, db->aDb[iDb].zName);
122452 if( ALWAYS(pTab!=0 && pTab->pVTable!=0) ){
122453 VTable *p;
122454 int (*xDestroy)(sqlite3_vtab *);
122455 for(p=pTab->pVTable; p; p=p->pNext){
122456 assert( p->pVtab );
122457 if( p->pVtab->nRef>0 ){
@@ -122587,11 +122638,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 +122865,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 +130655,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 +136190,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 +136355,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 +136515,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 +136605,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 +136771,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 +137190,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 +137204,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 +137228,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 +137378,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 +137391,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 +137404,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 +137555,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 +137963,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 +137986,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 +138017,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 +138033,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 +138149,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 +138163,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 +138206,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 +138246,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 +138278,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 +138299,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 +138327,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 +138355,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 +138380,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 +138405,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 +138431,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 +138480,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 +138501,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 +138528,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 +138583,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 +138674,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 +138702,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 +138747,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 +138922,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 +139546,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 +139566,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 +139605,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 +139618,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 +139643,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 +139673,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 +139694,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 +139716,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 +139727,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 +139784,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 +139910,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 +139926,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 +139939,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 +140324,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 +140339,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 +140380,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 +140396,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 +140413,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 +140448,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 +140485,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 +140639,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 +147642,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 +163443,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 +163467,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 +163492,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 +164043,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 +164723,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 +164756,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 +164792,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 +164806,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 +164818,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 +164838,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 +164887,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 +164925,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 +164969,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 +168073,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 +168515,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 +168527,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 +168538,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 +168570,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 +168621,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 +168664,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 +168692,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 +169519,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 +169533,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 +171778,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 +171872,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 +171934,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 +171963,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 +171981,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 +172671,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 +172682,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 +172693,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 +172708,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 +172719,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 +172733,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 +172748,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 +172798,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 +172809,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 +173230,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 +173259,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 +173282,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 +173310,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 +173344,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 +173367,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 +173385,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 +173559,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 +173578,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 +174458,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 +174486,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 +174821,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 +174838,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 +174854,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 +174865,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 +174884,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 +174895,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 +174934,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 +177166,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);
@@ -177457,11 +177511,11 @@
177457 ** following structure. All structure methods must be defined, setting
177458 ** any member of the fts5_tokenizer struct to NULL leads to undefined
177459 ** behaviour. The structure methods are expected to function as follows:
177460 **
177461 ** xCreate:
177462 ** This function is used to allocate and inititalize a tokenizer instance.
177463 ** A tokenizer instance is required to actually tokenize text.
177464 **
177465 ** The first argument passed to this function is a copy of the (void*)
177466 ** pointer provided by the application when the fts5_tokenizer object
177467 ** was registered with FTS5 (the third argument to xCreateTokenizer()).
@@ -177716,11 +177770,10 @@
177716 #if 0
177717 } /* end of the 'extern "C"' block */
177718 #endif
177719
177720 #endif /* _FTS5_H */
177721
177722
177723 /*
177724 ** 2014 May 31
177725 **
177726 ** The author disclaims copyright to this source code. In place of
@@ -193945,11 +193998,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 +194086,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 +194099,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-08 13:40:27 d5e98057028abcf7217d0d2b2e29bbbcdf09d6de"
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
@@ -2217,11 +2217,11 @@
2217 ** interface independently of the [load_extension()] SQL function.
2218 ** The [sqlite3_enable_load_extension()] API enables or disables both the
2219 ** C-API [sqlite3_load_extension()] and the SQL function [load_extension()].
2220 ** There should be two additional arguments.
2221 ** When the first argument to this interface is 1, then only the C-API is
2222 ** enabled and the SQL function remains disabled. If the first argument to
2223 ** this interface is 0, then both the C-API and the SQL function are disabled.
2224 ** If the first argument is -1, then no changes are made to state of either the
2225 ** C-API or the SQL function.
2226 ** The second parameter is a pointer to an integer into which
2227 ** is written 0 or 1 to indicate whether [sqlite3_load_extension()] interface
@@ -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
@@ -5794,11 +5795,11 @@
5795 ** interface returns SQLITE_OK and fills in the non-NULL pointers in
5796 ** the final five arguments with appropriate values if the specified
5797 ** column exists. ^The sqlite3_table_column_metadata() interface returns
5798 ** SQLITE_ERROR and if the specified column does not exist.
5799 ** ^If the column-name parameter to sqlite3_table_column_metadata() is a
5800 ** NULL pointer, then this routine simply checks for the existence of the
5801 ** table and returns SQLITE_OK if the table exists and SQLITE_ERROR if it
5802 ** does not.
5803 **
5804 ** ^The column is identified by the second, third and fourth parameters to
5805 ** this function. ^(The second parameter is either the name of the database
@@ -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
@@ -8389,11 +8390,11 @@
8390 ** tables.
8391 **
8392 ** ^The second parameter to the preupdate callback is a pointer to
8393 ** the [database connection] that registered the preupdate hook.
8394 ** ^The third parameter to the preupdate callback is one of the constants
8395 ** [SQLITE_INSERT], [SQLITE_DELETE], or [SQLITE_UPDATE] to identify the
8396 ** kind of update operation that is about to occur.
8397 ** ^(The fourth parameter to the preupdate callback is the name of the
8398 ** database within the database connection that is being modified. This
8399 ** will be "main" for the main database or "temp" for TEMP tables or
8400 ** the name given after the AS keyword in the [ATTACH] statement for attached
@@ -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 *************************************************************************/
@@ -10336,11 +10337,11 @@
10337 ** following structure. All structure methods must be defined, setting
10338 ** any member of the fts5_tokenizer struct to NULL leads to undefined
10339 ** behaviour. The structure methods are expected to function as follows:
10340 **
10341 ** xCreate:
10342 ** This function is used to allocate and initialize a tokenizer instance.
10343 ** A tokenizer instance is required to actually tokenize text.
10344 **
10345 ** The first argument passed to this function is a copy of the (void*)
10346 ** pointer provided by the application when the fts5_tokenizer object
10347 ** was registered with FTS5 (the third argument to xCreateTokenizer()).
@@ -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
@@ -10595,11 +10596,10 @@
10596 #if 0
10597 } /* end of the 'extern "C"' block */
10598 #endif
10599
10600 #endif /* _FTS5_H */
 
10601
10602 /******** End of fts5.h *********/
10603
10604 /************** End of sqlite3.h *********************************************/
10605 /************** Continuing where we left off in sqliteInt.h ******************/
@@ -11900,12 +11900,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_STDCALL sqlite3_wsd_init(int N, int J);
11906 SQLITE_API void *SQLITE_STDCALL 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
@@ -13083,10 +13083,11 @@
13083 SQLITE_PRIVATE sqlite3_file *sqlite3PagerJrnlFile(Pager*);
13084 SQLITE_PRIVATE const char *sqlite3PagerJournalname(Pager*);
13085 SQLITE_PRIVATE void *sqlite3PagerTempSpace(Pager*);
13086 SQLITE_PRIVATE int sqlite3PagerIsMemdb(Pager*);
13087 SQLITE_PRIVATE void sqlite3PagerCacheStat(Pager *, int, int, int *);
13088 SQLITE_PRIVATE void sqlite3PagerClearCache(Pager*);
13089 SQLITE_PRIVATE int sqlite3SectorSize(sqlite3_file *);
13090
13091 /* Functions used to truncate the database file. */
13092 SQLITE_PRIVATE void sqlite3PagerTruncateImage(Pager*,Pgno);
13093
@@ -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 }
@@ -53411,10 +53411,21 @@
53411 ** sqlite3BackupUpdate() only.
53412 */
53413 SQLITE_PRIVATE sqlite3_backup **sqlite3PagerBackupPtr(Pager *pPager){
53414 return &pPager->pBackup;
53415 }
53416
53417 #ifndef SQLITE_OMIT_VACUUM
53418 /*
53419 ** Unless this is an in-memory or temporary database, clear the pager cache.
53420 */
53421 SQLITE_PRIVATE void sqlite3PagerClearCache(Pager *pPager){
53422 assert( MEMDB==0 || pPager->tempFile );
53423 if( pPager->tempFile==0 ) pager_reset(pPager);
53424 }
53425 #endif
53426
53427
53428 #ifndef SQLITE_OMIT_WAL
53429 /*
53430 ** This function is called when the user invokes "PRAGMA wal_checkpoint",
53431 ** "PRAGMA wal_blocking_checkpoint" or calls the sqlite3_wal_checkpoint()
@@ -53636,11 +53647,10 @@
53647 SQLITE_PRIVATE int sqlite3PagerWalFramesize(Pager *pPager){
53648 assert( pPager->eState>=PAGER_READER );
53649 return sqlite3WalFramesize(pPager->pWal);
53650 }
53651 #endif
 
53652
53653 #endif /* SQLITE_OMIT_DISKIO */
53654
53655 /************** End of pager.c ***********************************************/
53656 /************** Begin file wal.c *********************************************/
@@ -57053,11 +57063,11 @@
57063
57064 /*
57065 ** Return a +ve value if snapshot p1 is newer than p2. A -ve value if
57066 ** p1 is older than p2 and zero if p1 and p2 are the same snapshot.
57067 */
57068 SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_cmp(sqlite3_snapshot *p1, sqlite3_snapshot *p2){
57069 WalIndexHdr *pHdr1 = (WalIndexHdr*)p1;
57070 WalIndexHdr *pHdr2 = (WalIndexHdr*)p2;
57071
57072 /* aSalt[0] is a copy of the value stored in the wal file header. It
57073 ** is incremented each time the wal file is restarted. */
@@ -58190,11 +58200,11 @@
58200 **
58201 ** This routine has no effect on existing database connections.
58202 ** The shared cache setting effects only future calls to
58203 ** sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2().
58204 */
58205 SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int enable){
58206 sqlite3GlobalConfig.sharedCacheEnabled = enable;
58207 return SQLITE_OK;
58208 }
58209 #endif
58210
@@ -64489,11 +64499,11 @@
64499 }
64500 }
64501
64502 /*
64503 ** A CellArray object contains a cache of pointers and sizes for a
64504 ** consecutive sequence of cells that might be held on multiple pages.
64505 */
64506 typedef struct CellArray CellArray;
64507 struct CellArray {
64508 int nCell; /* Number of cells in apCell[] */
64509 MemPage *pRef; /* Reference page */
@@ -67963,11 +67973,11 @@
67973 ** a pointer to the new sqlite3_backup object.
67974 **
67975 ** If an error occurs, NULL is returned and an error code and error message
67976 ** stored in database handle pDestDb.
67977 */
67978 SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
67979 sqlite3* pDestDb, /* Database to write to */
67980 const char *zDestDb, /* Name of database within pDestDb */
67981 sqlite3* pSrcDb, /* Database connection to read from */
67982 const char *zSrcDb /* Name of database within pSrcDb */
67983 ){
@@ -68171,11 +68181,11 @@
68181 }
68182
68183 /*
68184 ** Copy nPage pages from the source b-tree to the destination.
68185 */
68186 SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage){
68187 int rc;
68188 int destMode; /* Destination journal mode */
68189 int pgszSrc = 0; /* Source page size */
68190 int pgszDest = 0; /* Destination page size */
68191
@@ -68415,11 +68425,11 @@
68425 }
68426
68427 /*
68428 ** Release all resources associated with an sqlite3_backup* handle.
68429 */
68430 SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p){
68431 sqlite3_backup **pp; /* Ptr to head of pagers backup list */
68432 sqlite3 *pSrcDb; /* Source database connection */
68433 int rc; /* Value to return */
68434
68435 /* Enter the mutexes */
@@ -68467,11 +68477,11 @@
68477
68478 /*
68479 ** Return the number of pages still to be backed up as of the most recent
68480 ** call to sqlite3_backup_step().
68481 */
68482 SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p){
68483 #ifdef SQLITE_ENABLE_API_ARMOR
68484 if( p==0 ){
68485 (void)SQLITE_MISUSE_BKPT;
68486 return 0;
68487 }
@@ -68481,11 +68491,11 @@
68491
68492 /*
68493 ** Return the total number of pages in the source database as of the most
68494 ** recent call to sqlite3_backup_step().
68495 */
68496 SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p){
68497 #ifdef SQLITE_ENABLE_API_ARMOR
68498 if( p==0 ){
68499 (void)SQLITE_MISUSE_BKPT;
68500 return 0;
68501 }
@@ -68596,17 +68606,19 @@
68606 /* 0x7FFFFFFF is the hard limit for the number of pages in a database
68607 ** file. By passing this as the number of pages to copy to
68608 ** sqlite3_backup_step(), we can guarantee that the copy finishes
68609 ** within a single call (unless an error occurs). The assert() statement
68610 ** checks this assumption - (p->rc) should be set to either SQLITE_DONE
68611 ** or an error code. */
 
68612 sqlite3_backup_step(&b, 0x7FFFFFFF);
68613 assert( b.rc!=SQLITE_OK );
68614
68615 rc = sqlite3_backup_finish(&b);
68616 if( rc==SQLITE_OK ){
68617 pTo->pBt->btsFlags &= ~BTS_PAGESIZE_FIXED;
68618 }else{
68619 sqlite3PagerClearCache(sqlite3BtreePager(b.pDest));
68620 }
68621
68622 assert( sqlite3BtreeIsInTrans(pTo)==0 );
68623 copy_finished:
68624 sqlite3BtreeLeave(pFrom);
@@ -74935,11 +74947,11 @@
74947 ** execution environment changes in a way that would alter the program
74948 ** that sqlite3_prepare() generates. For example, if new functions or
74949 ** collating sequences are registered or if an authorizer function is
74950 ** added or changed.
74951 */
74952 SQLITE_API int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt *pStmt){
74953 Vdbe *p = (Vdbe*)pStmt;
74954 return p==0 || p->expired;
74955 }
74956 #endif
74957
@@ -75004,11 +75016,11 @@
75016 ** machine.
75017 **
75018 ** This routine sets the error code and string returned by
75019 ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
75020 */
75021 SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt){
75022 int rc;
75023 if( pStmt==0 ){
75024 /* IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL
75025 ** pointer is a harmless no-op. */
75026 rc = SQLITE_OK;
@@ -75031,11 +75043,11 @@
75043 ** the prior execution is returned.
75044 **
75045 ** This routine sets the error code and string returned by
75046 ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
75047 */
75048 SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt){
75049 int rc;
75050 if( pStmt==0 ){
75051 rc = SQLITE_OK;
75052 }else{
75053 Vdbe *v = (Vdbe*)pStmt;
@@ -75052,11 +75064,11 @@
75064 }
75065
75066 /*
75067 ** Set all the parameters in the compiled SQL statement to NULL.
75068 */
75069 SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt *pStmt){
75070 int i;
75071 int rc = SQLITE_OK;
75072 Vdbe *p = (Vdbe*)pStmt;
75073 #if SQLITE_THREADSAFE
75074 sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex;
@@ -75076,11 +75088,11 @@
75088
75089 /**************************** sqlite3_value_ *******************************
75090 ** The following routines extract information from a Mem or sqlite3_value
75091 ** structure.
75092 */
75093 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value *pVal){
75094 Mem *p = (Mem*)pVal;
75095 if( p->flags & (MEM_Blob|MEM_Str) ){
75096 if( sqlite3VdbeMemExpandBlob(p)!=SQLITE_OK ){
75097 assert( p->flags==MEM_Null && p->z==0 );
75098 return 0;
@@ -75089,48 +75101,48 @@
75101 return p->n ? p->z : 0;
75102 }else{
75103 return sqlite3_value_text(pVal);
75104 }
75105 }
75106 SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value *pVal){
75107 return sqlite3ValueBytes(pVal, SQLITE_UTF8);
75108 }
75109 SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value *pVal){
75110 return sqlite3ValueBytes(pVal, SQLITE_UTF16NATIVE);
75111 }
75112 SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value *pVal){
75113 return sqlite3VdbeRealValue((Mem*)pVal);
75114 }
75115 SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value *pVal){
75116 return (int)sqlite3VdbeIntValue((Mem*)pVal);
75117 }
75118 SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value *pVal){
75119 return sqlite3VdbeIntValue((Mem*)pVal);
75120 }
75121 SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value *pVal){
75122 Mem *pMem = (Mem*)pVal;
75123 return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0);
75124 }
75125 SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value *pVal){
75126 return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
75127 }
75128 #ifndef SQLITE_OMIT_UTF16
75129 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value* pVal){
75130 return sqlite3ValueText(pVal, SQLITE_UTF16NATIVE);
75131 }
75132 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value *pVal){
75133 return sqlite3ValueText(pVal, SQLITE_UTF16BE);
75134 }
75135 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value *pVal){
75136 return sqlite3ValueText(pVal, SQLITE_UTF16LE);
75137 }
75138 #endif /* SQLITE_OMIT_UTF16 */
75139 /* EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five
75140 ** fundamental datatypes: 64-bit signed integer 64-bit IEEE floating
75141 ** point number string BLOB NULL
75142 */
75143 SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value* pVal){
75144 static const u8 aType[] = {
75145 SQLITE_BLOB, /* 0x00 */
75146 SQLITE_NULL, /* 0x01 */
75147 SQLITE_TEXT, /* 0x02 */
75148 SQLITE_NULL, /* 0x03 */
@@ -75166,11 +75178,11 @@
75178 return aType[pVal->flags&MEM_AffMask];
75179 }
75180
75181 /* Make a copy of an sqlite3_value object
75182 */
75183 SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value *pOrig){
75184 sqlite3_value *pNew;
75185 if( pOrig==0 ) return 0;
75186 pNew = sqlite3_malloc( sizeof(*pNew) );
75187 if( pNew==0 ) return 0;
75188 memset(pNew, 0, sizeof(*pNew));
@@ -75189,11 +75201,11 @@
75201 }
75202
75203 /* Destroy an sqlite3_value object previously obtained from
75204 ** sqlite3_value_dup().
75205 */
75206 SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value *pOld){
75207 sqlite3ValueFree(pOld);
75208 }
75209
75210
75211 /**************************** sqlite3_result_ *******************************
@@ -75232,21 +75244,21 @@
75244 xDel((void*)p);
75245 }
75246 if( pCtx ) sqlite3_result_error_toobig(pCtx);
75247 return SQLITE_TOOBIG;
75248 }
75249 SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(
75250 sqlite3_context *pCtx,
75251 const void *z,
75252 int n,
75253 void (*xDel)(void *)
75254 ){
75255 assert( n>=0 );
75256 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75257 setResultStrOrError(pCtx, z, n, 0, xDel);
75258 }
75259 SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(
75260 sqlite3_context *pCtx,
75261 const void *z,
75262 sqlite3_uint64 n,
75263 void (*xDel)(void *)
75264 ){
@@ -75256,56 +75268,56 @@
75268 (void)invokeValueDestructor(z, xDel, pCtx);
75269 }else{
75270 setResultStrOrError(pCtx, z, (int)n, 0, xDel);
75271 }
75272 }
75273 SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context *pCtx, double rVal){
75274 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75275 sqlite3VdbeMemSetDouble(pCtx->pOut, rVal);
75276 }
75277 SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
75278 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75279 pCtx->isError = SQLITE_ERROR;
75280 pCtx->fErrorOrAux = 1;
75281 sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF8, SQLITE_TRANSIENT);
75282 }
75283 #ifndef SQLITE_OMIT_UTF16
75284 SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){
75285 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75286 pCtx->isError = SQLITE_ERROR;
75287 pCtx->fErrorOrAux = 1;
75288 sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF16NATIVE, SQLITE_TRANSIENT);
75289 }
75290 #endif
75291 SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context *pCtx, int iVal){
75292 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75293 sqlite3VdbeMemSetInt64(pCtx->pOut, (i64)iVal);
75294 }
75295 SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
75296 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75297 sqlite3VdbeMemSetInt64(pCtx->pOut, iVal);
75298 }
75299 SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context *pCtx){
75300 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75301 sqlite3VdbeMemSetNull(pCtx->pOut);
75302 }
75303 SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){
75304 Mem *pOut = pCtx->pOut;
75305 assert( sqlite3_mutex_held(pOut->db->mutex) );
75306 pOut->eSubtype = eSubtype & 0xff;
75307 pOut->flags |= MEM_Subtype;
75308 }
75309 SQLITE_API void SQLITE_STDCALL sqlite3_result_text(
75310 sqlite3_context *pCtx,
75311 const char *z,
75312 int n,
75313 void (*xDel)(void *)
75314 ){
75315 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75316 setResultStrOrError(pCtx, z, n, SQLITE_UTF8, xDel);
75317 }
75318 SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(
75319 sqlite3_context *pCtx,
75320 const char *z,
75321 sqlite3_uint64 n,
75322 void (*xDel)(void *),
75323 unsigned char enc
@@ -75318,56 +75330,56 @@
75330 }else{
75331 setResultStrOrError(pCtx, z, (int)n, enc, xDel);
75332 }
75333 }
75334 #ifndef SQLITE_OMIT_UTF16
75335 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(
75336 sqlite3_context *pCtx,
75337 const void *z,
75338 int n,
75339 void (*xDel)(void *)
75340 ){
75341 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75342 setResultStrOrError(pCtx, z, n, SQLITE_UTF16NATIVE, xDel);
75343 }
75344 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(
75345 sqlite3_context *pCtx,
75346 const void *z,
75347 int n,
75348 void (*xDel)(void *)
75349 ){
75350 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75351 setResultStrOrError(pCtx, z, n, SQLITE_UTF16BE, xDel);
75352 }
75353 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(
75354 sqlite3_context *pCtx,
75355 const void *z,
75356 int n,
75357 void (*xDel)(void *)
75358 ){
75359 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75360 setResultStrOrError(pCtx, z, n, SQLITE_UTF16LE, xDel);
75361 }
75362 #endif /* SQLITE_OMIT_UTF16 */
75363 SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){
75364 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75365 sqlite3VdbeMemCopy(pCtx->pOut, pValue);
75366 }
75367 SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){
75368 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75369 sqlite3VdbeMemSetZeroBlob(pCtx->pOut, n);
75370 }
75371 SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){
75372 Mem *pOut = pCtx->pOut;
75373 assert( sqlite3_mutex_held(pOut->db->mutex) );
75374 if( n>(u64)pOut->db->aLimit[SQLITE_LIMIT_LENGTH] ){
75375 return SQLITE_TOOBIG;
75376 }
75377 sqlite3VdbeMemSetZeroBlob(pCtx->pOut, (int)n);
75378 return SQLITE_OK;
75379 }
75380 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){
75381 pCtx->isError = errCode;
75382 pCtx->fErrorOrAux = 1;
75383 #ifdef SQLITE_DEBUG
75384 if( pCtx->pVdbe ) pCtx->pVdbe->rcApp = errCode;
75385 #endif
@@ -75376,20 +75388,20 @@
75388 SQLITE_UTF8, SQLITE_STATIC);
75389 }
75390 }
75391
75392 /* Force an SQLITE_TOOBIG error. */
75393 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context *pCtx){
75394 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75395 pCtx->isError = SQLITE_TOOBIG;
75396 pCtx->fErrorOrAux = 1;
75397 sqlite3VdbeMemSetStr(pCtx->pOut, "string or blob too big", -1,
75398 SQLITE_UTF8, SQLITE_STATIC);
75399 }
75400
75401 /* An SQLITE_NOMEM error. */
75402 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context *pCtx){
75403 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75404 sqlite3VdbeMemSetNull(pCtx->pOut);
75405 pCtx->isError = SQLITE_NOMEM_BKPT;
75406 pCtx->fErrorOrAux = 1;
75407 sqlite3OomFault(pCtx->pOut->db);
@@ -75557,11 +75569,11 @@
75569 /*
75570 ** This is the top-level implementation of sqlite3_step(). Call
75571 ** sqlite3Step() to do most of the work. If a schema error occurs,
75572 ** call sqlite3Reprepare() and try again.
75573 */
75574 SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt *pStmt){
75575 int rc = SQLITE_OK; /* Result from sqlite3Step() */
75576 int rc2 = SQLITE_OK; /* Result from sqlite3Reprepare() */
75577 Vdbe *v = (Vdbe*)pStmt; /* the prepared statement */
75578 int cnt = 0; /* Counter to prevent infinite loop of reprepares */
75579 sqlite3 *db; /* The database connection */
@@ -75608,11 +75620,11 @@
75620
75621 /*
75622 ** Extract the user data from a sqlite3_context structure and return a
75623 ** pointer to it.
75624 */
75625 SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context *p){
75626 assert( p && p->pFunc );
75627 return p->pFunc->pUserData;
75628 }
75629
75630 /*
@@ -75623,11 +75635,11 @@
75635 ** returns a copy of the pointer to the database connection (the 1st
75636 ** parameter) of the sqlite3_create_function() and
75637 ** sqlite3_create_function16() routines that originally registered the
75638 ** application defined function.
75639 */
75640 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context *p){
75641 assert( p && p->pOut );
75642 return p->pOut->db;
75643 }
75644
75645 /*
@@ -75699,11 +75711,11 @@
75711 /*
75712 ** Allocate or return the aggregate context for a user function. A new
75713 ** context is allocated on the first call. Subsequent calls return the
75714 ** same context that was returned on prior calls.
75715 */
75716 SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context *p, int nByte){
75717 assert( p && p->pFunc && p->pFunc->xFinalize );
75718 assert( sqlite3_mutex_held(p->pOut->db->mutex) );
75719 testcase( nByte<0 );
75720 if( (p->pMem->flags & MEM_Agg)==0 ){
75721 return createAggContext(p, nByte);
@@ -75714,11 +75726,11 @@
75726
75727 /*
75728 ** Return the auxiliary data pointer, if any, for the iArg'th argument to
75729 ** the user-function defined by pCtx.
75730 */
75731 SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
75732 AuxData *pAuxData;
75733
75734 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75735 #if SQLITE_ENABLE_STAT3_OR_STAT4
75736 if( pCtx->pVdbe==0 ) return 0;
@@ -75735,11 +75747,11 @@
75747 /*
75748 ** Set the auxiliary data pointer and delete function, for the iArg'th
75749 ** argument to the user-function defined by pCtx. Any previous value is
75750 ** deleted by calling the delete function specified when it was set.
75751 */
75752 SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(
75753 sqlite3_context *pCtx,
75754 int iArg,
75755 void *pAux,
75756 void (*xDelete)(void*)
75757 ){
@@ -75790,29 +75802,29 @@
75802 ** This function is deprecated. Do not use it for new code. It is
75803 ** provide only to avoid breaking legacy code. New aggregate function
75804 ** implementations should keep their own counts within their aggregate
75805 ** context.
75806 */
75807 SQLITE_API int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context *p){
75808 assert( p && p->pMem && p->pFunc && p->pFunc->xFinalize );
75809 return p->pMem->n;
75810 }
75811 #endif
75812
75813 /*
75814 ** Return the number of columns in the result set for the statement pStmt.
75815 */
75816 SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt){
75817 Vdbe *pVm = (Vdbe *)pStmt;
75818 return pVm ? pVm->nResColumn : 0;
75819 }
75820
75821 /*
75822 ** Return the number of values available from the current row of the
75823 ** currently executing statement pStmt.
75824 */
75825 SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt){
75826 Vdbe *pVm = (Vdbe *)pStmt;
75827 if( pVm==0 || pVm->pResultSet==0 ) return 0;
75828 return pVm->nResColumn;
75829 }
75830
@@ -75911,67 +75923,67 @@
75923
75924 /**************************** sqlite3_column_ *******************************
75925 ** The following routines are used to access elements of the current row
75926 ** in the result set.
75927 */
75928 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt *pStmt, int i){
75929 const void *val;
75930 val = sqlite3_value_blob( columnMem(pStmt,i) );
75931 /* Even though there is no encoding conversion, value_blob() might
75932 ** need to call malloc() to expand the result of a zeroblob()
75933 ** expression.
75934 */
75935 columnMallocFailure(pStmt);
75936 return val;
75937 }
75938 SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){
75939 int val = sqlite3_value_bytes( columnMem(pStmt,i) );
75940 columnMallocFailure(pStmt);
75941 return val;
75942 }
75943 SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){
75944 int val = sqlite3_value_bytes16( columnMem(pStmt,i) );
75945 columnMallocFailure(pStmt);
75946 return val;
75947 }
75948 SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt *pStmt, int i){
75949 double val = sqlite3_value_double( columnMem(pStmt,i) );
75950 columnMallocFailure(pStmt);
75951 return val;
75952 }
75953 SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt *pStmt, int i){
75954 int val = sqlite3_value_int( columnMem(pStmt,i) );
75955 columnMallocFailure(pStmt);
75956 return val;
75957 }
75958 SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt *pStmt, int i){
75959 sqlite_int64 val = sqlite3_value_int64( columnMem(pStmt,i) );
75960 columnMallocFailure(pStmt);
75961 return val;
75962 }
75963 SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt *pStmt, int i){
75964 const unsigned char *val = sqlite3_value_text( columnMem(pStmt,i) );
75965 columnMallocFailure(pStmt);
75966 return val;
75967 }
75968 SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt *pStmt, int i){
75969 Mem *pOut = columnMem(pStmt, i);
75970 if( pOut->flags&MEM_Static ){
75971 pOut->flags &= ~MEM_Static;
75972 pOut->flags |= MEM_Ephem;
75973 }
75974 columnMallocFailure(pStmt);
75975 return (sqlite3_value *)pOut;
75976 }
75977 #ifndef SQLITE_OMIT_UTF16
75978 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt *pStmt, int i){
75979 const void *val = sqlite3_value_text16( columnMem(pStmt,i) );
75980 columnMallocFailure(pStmt);
75981 return val;
75982 }
75983 #endif /* SQLITE_OMIT_UTF16 */
75984 SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt *pStmt, int i){
75985 int iType = sqlite3_value_type( columnMem(pStmt,i) );
75986 columnMallocFailure(pStmt);
75987 return iType;
75988 }
75989
@@ -76031,16 +76043,16 @@
76043
76044 /*
76045 ** Return the name of the Nth column of the result set returned by SQL
76046 ** statement pStmt.
76047 */
76048 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt *pStmt, int N){
76049 return columnName(
76050 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_NAME);
76051 }
76052 #ifndef SQLITE_OMIT_UTF16
76053 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt *pStmt, int N){
76054 return columnName(
76055 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_NAME);
76056 }
76057 #endif
76058
@@ -76056,16 +76068,16 @@
76068 #ifndef SQLITE_OMIT_DECLTYPE
76069 /*
76070 ** Return the column declaration type (if applicable) of the 'i'th column
76071 ** of the result set of SQL statement pStmt.
76072 */
76073 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){
76074 return columnName(
76075 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DECLTYPE);
76076 }
76077 #ifndef SQLITE_OMIT_UTF16
76078 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){
76079 return columnName(
76080 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DECLTYPE);
76081 }
76082 #endif /* SQLITE_OMIT_UTF16 */
76083 #endif /* SQLITE_OMIT_DECLTYPE */
@@ -76074,16 +76086,16 @@
76086 /*
76087 ** Return the name of the database from which a result column derives.
76088 ** NULL is returned if the result column is an expression or constant or
76089 ** anything else which is not an unambiguous reference to a database column.
76090 */
76091 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){
76092 return columnName(
76093 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DATABASE);
76094 }
76095 #ifndef SQLITE_OMIT_UTF16
76096 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){
76097 return columnName(
76098 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DATABASE);
76099 }
76100 #endif /* SQLITE_OMIT_UTF16 */
76101
@@ -76090,16 +76102,16 @@
76102 /*
76103 ** Return the name of the table from which a result column derives.
76104 ** NULL is returned if the result column is an expression or constant or
76105 ** anything else which is not an unambiguous reference to a database column.
76106 */
76107 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){
76108 return columnName(
76109 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_TABLE);
76110 }
76111 #ifndef SQLITE_OMIT_UTF16
76112 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){
76113 return columnName(
76114 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_TABLE);
76115 }
76116 #endif /* SQLITE_OMIT_UTF16 */
76117
@@ -76106,16 +76118,16 @@
76118 /*
76119 ** Return the name of the table column from which a result column derives.
76120 ** NULL is returned if the result column is an expression or constant or
76121 ** anything else which is not an unambiguous reference to a database column.
76122 */
76123 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){
76124 return columnName(
76125 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_COLUMN);
76126 }
76127 #ifndef SQLITE_OMIT_UTF16
76128 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){
76129 return columnName(
76130 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_COLUMN);
76131 }
76132 #endif /* SQLITE_OMIT_UTF16 */
76133 #endif /* SQLITE_ENABLE_COLUMN_METADATA */
@@ -76212,11 +76224,11 @@
76224
76225
76226 /*
76227 ** Bind a blob value to an SQL statement variable.
76228 */
76229 SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(
76230 sqlite3_stmt *pStmt,
76231 int i,
76232 const void *zData,
76233 int nData,
76234 void (*xDel)(void*)
@@ -76224,11 +76236,11 @@
76236 #ifdef SQLITE_ENABLE_API_ARMOR
76237 if( nData<0 ) return SQLITE_MISUSE_BKPT;
76238 #endif
76239 return bindText(pStmt, i, zData, nData, xDel, 0);
76240 }
76241 SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(
76242 sqlite3_stmt *pStmt,
76243 int i,
76244 const void *zData,
76245 sqlite3_uint64 nData,
76246 void (*xDel)(void*)
@@ -76238,52 +76250,52 @@
76250 return invokeValueDestructor(zData, xDel, 0);
76251 }else{
76252 return bindText(pStmt, i, zData, (int)nData, xDel, 0);
76253 }
76254 }
76255 SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
76256 int rc;
76257 Vdbe *p = (Vdbe *)pStmt;
76258 rc = vdbeUnbind(p, i);
76259 if( rc==SQLITE_OK ){
76260 sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue);
76261 sqlite3_mutex_leave(p->db->mutex);
76262 }
76263 return rc;
76264 }
76265 SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){
76266 return sqlite3_bind_int64(p, i, (i64)iValue);
76267 }
76268 SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
76269 int rc;
76270 Vdbe *p = (Vdbe *)pStmt;
76271 rc = vdbeUnbind(p, i);
76272 if( rc==SQLITE_OK ){
76273 sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue);
76274 sqlite3_mutex_leave(p->db->mutex);
76275 }
76276 return rc;
76277 }
76278 SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
76279 int rc;
76280 Vdbe *p = (Vdbe*)pStmt;
76281 rc = vdbeUnbind(p, i);
76282 if( rc==SQLITE_OK ){
76283 sqlite3_mutex_leave(p->db->mutex);
76284 }
76285 return rc;
76286 }
76287 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(
76288 sqlite3_stmt *pStmt,
76289 int i,
76290 const char *zData,
76291 int nData,
76292 void (*xDel)(void*)
76293 ){
76294 return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8);
76295 }
76296 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(
76297 sqlite3_stmt *pStmt,
76298 int i,
76299 const char *zData,
76300 sqlite3_uint64 nData,
76301 void (*xDel)(void*),
@@ -76296,21 +76308,21 @@
76308 if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE;
76309 return bindText(pStmt, i, zData, (int)nData, xDel, enc);
76310 }
76311 }
76312 #ifndef SQLITE_OMIT_UTF16
76313 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(
76314 sqlite3_stmt *pStmt,
76315 int i,
76316 const void *zData,
76317 int nData,
76318 void (*xDel)(void*)
76319 ){
76320 return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE);
76321 }
76322 #endif /* SQLITE_OMIT_UTF16 */
76323 SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
76324 int rc;
76325 switch( sqlite3_value_type((sqlite3_value*)pValue) ){
76326 case SQLITE_INTEGER: {
76327 rc = sqlite3_bind_int64(pStmt, i, pValue->u.i);
76328 break;
@@ -76337,21 +76349,21 @@
76349 break;
76350 }
76351 }
76352 return rc;
76353 }
76354 SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
76355 int rc;
76356 Vdbe *p = (Vdbe *)pStmt;
76357 rc = vdbeUnbind(p, i);
76358 if( rc==SQLITE_OK ){
76359 sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n);
76360 sqlite3_mutex_leave(p->db->mutex);
76361 }
76362 return rc;
76363 }
76364 SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){
76365 int rc;
76366 Vdbe *p = (Vdbe *)pStmt;
76367 sqlite3_mutex_enter(p->db->mutex);
76368 if( n>(u64)p->db->aLimit[SQLITE_LIMIT_LENGTH] ){
76369 rc = SQLITE_TOOBIG;
@@ -76366,11 +76378,11 @@
76378
76379 /*
76380 ** Return the number of wildcards that can be potentially bound to.
76381 ** This routine is added to support DBD::SQLite.
76382 */
76383 SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
76384 Vdbe *p = (Vdbe*)pStmt;
76385 return p ? p->nVar : 0;
76386 }
76387
76388 /*
@@ -76377,11 +76389,11 @@
76389 ** Return the name of a wildcard parameter. Return NULL if the index
76390 ** is out of range or if the wildcard is unnamed.
76391 **
76392 ** The result is always UTF-8.
76393 */
76394 SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){
76395 Vdbe *p = (Vdbe*)pStmt;
76396 if( p==0 || i<1 || i>p->nzVar ){
76397 return 0;
76398 }
76399 return p->azVar[i-1];
@@ -76405,11 +76417,11 @@
76417 }
76418 }
76419 }
76420 return 0;
76421 }
76422 SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
76423 return sqlite3VdbeParameterIndex((Vdbe*)pStmt, zName, sqlite3Strlen30(zName));
76424 }
76425
76426 /*
76427 ** Transfer all bindings from the first statement over to the second.
@@ -76439,11 +76451,11 @@
76451 **
76452 ** If the two statements contain a different number of bindings, then
76453 ** an SQLITE_ERROR is returned. Nothing else can go wrong, so otherwise
76454 ** SQLITE_OK is returned.
76455 */
76456 SQLITE_API int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
76457 Vdbe *pFrom = (Vdbe*)pFromStmt;
76458 Vdbe *pTo = (Vdbe*)pToStmt;
76459 if( pFrom->nVar!=pTo->nVar ){
76460 return SQLITE_ERROR;
76461 }
@@ -76461,26 +76473,26 @@
76473 ** Return the sqlite3* database handle to which the prepared statement given
76474 ** in the argument belongs. This is the same database handle that was
76475 ** the first argument to the sqlite3_prepare() that was used to create
76476 ** the statement in the first place.
76477 */
76478 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt *pStmt){
76479 return pStmt ? ((Vdbe*)pStmt)->db : 0;
76480 }
76481
76482 /*
76483 ** Return true if the prepared statement is guaranteed to not modify the
76484 ** database.
76485 */
76486 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt){
76487 return pStmt ? ((Vdbe*)pStmt)->readOnly : 1;
76488 }
76489
76490 /*
76491 ** Return true if the prepared statement is in need of being reset.
76492 */
76493 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt *pStmt){
76494 Vdbe *v = (Vdbe*)pStmt;
76495 return v!=0 && v->pc>=0 && v->magic==VDBE_MAGIC_RUN;
76496 }
76497
76498 /*
@@ -76487,11 +76499,11 @@
76499 ** Return a pointer to the next prepared statement after pStmt associated
76500 ** with database connection pDb. If pStmt is NULL, return the first
76501 ** prepared statement for the database connection. Return NULL if there
76502 ** are no more.
76503 */
76504 SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){
76505 sqlite3_stmt *pNext;
76506 #ifdef SQLITE_ENABLE_API_ARMOR
76507 if( !sqlite3SafetyCheckOk(pDb) ){
76508 (void)SQLITE_MISUSE_BKPT;
76509 return 0;
@@ -76508,11 +76520,11 @@
76520 }
76521
76522 /*
76523 ** Return the value of a status counter for a prepared statement
76524 */
76525 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){
76526 Vdbe *pVdbe = (Vdbe*)pStmt;
76527 u32 v;
76528 #ifdef SQLITE_ENABLE_API_ARMOR
76529 if( !pStmt ){
76530 (void)SQLITE_MISUSE_BKPT;
@@ -76525,11 +76537,11 @@
76537 }
76538
76539 /*
76540 ** Return the SQL associated with a prepared statement
76541 */
76542 SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt){
76543 Vdbe *p = (Vdbe *)pStmt;
76544 return p ? p->zSql : 0;
76545 }
76546
76547 /*
@@ -76539,11 +76551,11 @@
76551 ** freeing the returned string by passing it to sqlite3_free().
76552 **
76553 ** The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of
76554 ** expanded bound parameters.
76555 */
76556 SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt){
76557 #ifdef SQLITE_OMIT_TRACE
76558 return 0;
76559 #else
76560 char *z = 0;
76561 const char *zSql = sqlite3_sql(pStmt);
@@ -76581,11 +76593,11 @@
76593
76594 /*
76595 ** This function is called from within a pre-update callback to retrieve
76596 ** a field of the row currently being updated or deleted.
76597 */
76598 SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
76599 PreUpdate *p = db->pPreUpdate;
76600 int rc = SQLITE_OK;
76601
76602 /* Test that this call is being made from within an SQLITE_DELETE or
76603 ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */
@@ -76636,11 +76648,11 @@
76648 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
76649 /*
76650 ** This function is called from within a pre-update callback to retrieve
76651 ** the number of columns in the row being updated, deleted or inserted.
76652 */
76653 SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *db){
76654 PreUpdate *p = db->pPreUpdate;
76655 return (p ? p->keyinfo.nField : 0);
76656 }
76657 #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
76658
@@ -76654,11 +76666,11 @@
76666 ** top-level trigger etc.).
76667 **
76668 ** For the purposes of the previous paragraph, a foreign key CASCADE, SET NULL
76669 ** or SET DEFAULT action is considered a trigger.
76670 */
76671 SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *db){
76672 PreUpdate *p = db->pPreUpdate;
76673 return (p ? p->v->nFrame : 0);
76674 }
76675 #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
76676
@@ -76665,11 +76677,11 @@
76677 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
76678 /*
76679 ** This function is called from within a pre-update callback to retrieve
76680 ** a field of the row currently being updated or inserted.
76681 */
76682 SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
76683 PreUpdate *p = db->pPreUpdate;
76684 int rc = SQLITE_OK;
76685 Mem *pMem;
76686
76687 if( !p || p->op==SQLITE_DELETE ){
@@ -76739,11 +76751,11 @@
76751
76752 #ifdef SQLITE_ENABLE_STMT_SCANSTATUS
76753 /*
76754 ** Return status data for a single loop within query pStmt.
76755 */
76756 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus(
76757 sqlite3_stmt *pStmt, /* Prepared statement being queried */
76758 int idx, /* Index of loop to report on */
76759 int iScanStatusOp, /* Which metric to return */
76760 void *pOut /* OUT: Write the answer here */
76761 ){
@@ -76798,11 +76810,11 @@
76810 }
76811
76812 /*
76813 ** Zero all counters associated with the sqlite3_stmt_scanstatus() data.
76814 */
76815 SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){
76816 Vdbe *p = (Vdbe*)pStmt;
76817 memset(p->anExec, 0, p->nOp * sizeof(i64));
76818 }
76819 #endif /* SQLITE_ENABLE_STMT_SCANSTATUS */
76820
@@ -77325,11 +77337,11 @@
77337 ** Try to convert the type of a function argument or a result column
77338 ** into a numeric representation. Use either INTEGER or REAL whichever
77339 ** is appropriate. But only do the conversion if it is possible without
77340 ** loss of information and return the revised type of the argument.
77341 */
77342 SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value *pVal){
77343 int eType = sqlite3_value_type(pVal);
77344 if( eType==SQLITE_TEXT ){
77345 Mem *pMem = (Mem*)pVal;
77346 applyNumericAffinity(pMem, 0);
77347 eType = sqlite3_value_type(pVal);
@@ -84177,11 +84189,11 @@
84189 }
84190
84191 /*
84192 ** Open a blob handle.
84193 */
84194 SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
84195 sqlite3* db, /* The database connection */
84196 const char *zDb, /* The attached database containing the blob */
84197 const char *zTable, /* The table containing the blob */
84198 const char *zColumn, /* The column containing the blob */
84199 sqlite_int64 iRow, /* The row containing the glob */
@@ -84418,11 +84430,11 @@
84430
84431 /*
84432 ** Close a blob handle that was previously created using
84433 ** sqlite3_blob_open().
84434 */
84435 SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *pBlob){
84436 Incrblob *p = (Incrblob *)pBlob;
84437 int rc;
84438 sqlite3 *db;
84439
84440 if( p ){
@@ -84511,28 +84523,28 @@
84523 }
84524
84525 /*
84526 ** Read data from a blob handle.
84527 */
84528 SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){
84529 return blobReadWrite(pBlob, z, n, iOffset, sqlite3BtreeData);
84530 }
84531
84532 /*
84533 ** Write data to a blob handle.
84534 */
84535 SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){
84536 return blobReadWrite(pBlob, (void *)z, n, iOffset, sqlite3BtreePutData);
84537 }
84538
84539 /*
84540 ** Query a blob handle for the size of the data.
84541 **
84542 ** The Incrblob.nByte field is fixed for the lifetime of the Incrblob
84543 ** so no mutex is required for access.
84544 */
84545 SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *pBlob){
84546 Incrblob *p = (Incrblob *)pBlob;
84547 return (p && p->pStmt) ? p->nByte : 0;
84548 }
84549
84550 /*
@@ -84543,11 +84555,11 @@
84555 ** contain a blob or text value, then an error code is returned and the
84556 ** database handle error code and message set. If this happens, then all
84557 ** subsequent calls to sqlite3_blob_xxx() functions (except blob_close())
84558 ** immediately return SQLITE_ABORT.
84559 */
84560 SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){
84561 int rc;
84562 Incrblob *p = (Incrblob *)pBlob;
84563 sqlite3 *db;
84564
84565 if( p==0 ) return SQLITE_MISUSE_BKPT;
@@ -88640,11 +88652,15 @@
88652 }
88653 if( is_agg && (pNC->ncFlags & NC_AllowAgg)==0 ){
88654 sqlite3ErrorMsg(pParse, "misuse of aggregate function %.*s()", nId,zId);
88655 pNC->nErr++;
88656 is_agg = 0;
88657 }else if( no_such_func && pParse->db->init.busy==0
88658 #ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
88659 && pParse->explain==0
88660 #endif
88661 ){
88662 sqlite3ErrorMsg(pParse, "no such function: %.*s", nId, zId);
88663 pNC->nErr++;
88664 }else if( wrong_num_args ){
88665 sqlite3ErrorMsg(pParse,"wrong number of arguments to function %.*s()",
88666 nId, zId);
@@ -92365,10 +92381,15 @@
92381 }
92382 nFarg = pFarg ? pFarg->nExpr : 0;
92383 assert( !ExprHasProperty(pExpr, EP_IntValue) );
92384 zId = pExpr->u.zToken;
92385 pDef = sqlite3FindFunction(db, zId, nFarg, enc, 0);
92386 #ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
92387 if( pDef==0 && pParse->explain ){
92388 pDef = sqlite3FindFunction(db, "unknown", nFarg, enc, 0);
92389 }
92390 #endif
92391 if( pDef==0 || pDef->xFinalize!=0 ){
92392 sqlite3ErrorMsg(pParse, "unknown function: %s()", zId);
92393 break;
92394 }
92395
@@ -97147,11 +97168,11 @@
97168 ** and attempts to write the column will be ignored.
97169 **
97170 ** Setting the auth function to NULL disables this hook. The default
97171 ** setting of the auth function is NULL.
97172 */
97173 SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
97174 sqlite3 *db,
97175 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
97176 void *pArg
97177 ){
97178 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -100381,10 +100402,17 @@
100402 for(pLoop=pTab->pIndex, n=1; pLoop; pLoop=pLoop->pNext, n++){}
100403 zName = sqlite3MPrintf(db, "sqlite_autoindex_%s_%d", pTab->zName, n);
100404 if( zName==0 ){
100405 goto exit_create_index;
100406 }
100407
100408 /* Automatic index names generated from within sqlite3_declare_vtab()
100409 ** must have names that are distinct from normal automatic index names.
100410 ** The following statement converts "sqlite3_autoindex..." into
100411 ** "sqlite3_butoindex..." in order to make the names distinct.
100412 ** The "vtab_err.test" test demonstrates the need of this statement. */
100413 if( IN_DECLARE_VTAB ) zName[7]++;
100414 }
100415
100416 /* Check for authorization to create an index.
100417 */
100418 #ifndef SQLITE_OMIT_AUTHORIZATION
@@ -103910,18 +103938,18 @@
103938 }
103939
103940 /*
103941 ** The sqlite3_strglob() interface.
103942 */
103943 SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlobPattern, const char *zString){
103944 return patternCompare((u8*)zGlobPattern, (u8*)zString, &globInfo, '[')==0;
103945 }
103946
103947 /*
103948 ** The sqlite3_strlike() interface.
103949 */
103950 SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zPattern, const char *zStr, unsigned int esc){
103951 return patternCompare((u8*)zPattern, (u8*)zStr, &likeInfoNorm, esc)==0;
103952 }
103953
103954 /*
103955 ** Count the number of times that the LIKE operator (or GLOB which is
@@ -104473,10 +104501,30 @@
104501 }
104502 }
104503 sqlite3_result_text(context, (char*)zIn, nIn, SQLITE_TRANSIENT);
104504 }
104505
104506
104507 #ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
104508 /*
104509 ** The "unknown" function is automatically substituted in place of
104510 ** any unrecognized function name when doing an EXPLAIN or EXPLAIN QUERY PLAN
104511 ** when the SQLITE_ENABLE_UNKNOWN_FUNCTION compile-time option is used.
104512 ** When the "sqlite3" command-line shell is built using this functionality,
104513 ** that allows an EXPLAIN or EXPLAIN QUERY PLAN for complex queries
104514 ** involving application-defined functions to be examined in a generic
104515 ** sqlite3 shell.
104516 */
104517 static void unknownFunc(
104518 sqlite3_context *context,
104519 int argc,
104520 sqlite3_value **argv
104521 ){
104522 /* no-op */
104523 }
104524 #endif /*SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION*/
104525
104526
104527 /* IMP: R-25361-16150 This function is omitted from SQLite by default. It
104528 ** is only available if the SQLITE_SOUNDEX compile-time option is used
104529 ** when SQLite is built.
104530 */
@@ -104944,17 +104992,20 @@
104992 AGGREGATE(count, 1, 0, 0, countStep, countFinalize ),
104993 AGGREGATE(group_concat, 1, 0, 0, groupConcatStep, groupConcatFinalize),
104994 AGGREGATE(group_concat, 2, 0, 0, groupConcatStep, groupConcatFinalize),
104995
104996 LIKEFUNC(glob, 2, &globInfo, SQLITE_FUNC_LIKE|SQLITE_FUNC_CASE),
104997 #ifdef SQLITE_CASE_SENSITIVE_LIKE
104998 LIKEFUNC(like, 2, &likeInfoAlt, SQLITE_FUNC_LIKE|SQLITE_FUNC_CASE),
104999 LIKEFUNC(like, 3, &likeInfoAlt, SQLITE_FUNC_LIKE|SQLITE_FUNC_CASE),
105000 #else
105001 LIKEFUNC(like, 2, &likeInfoNorm, SQLITE_FUNC_LIKE),
105002 LIKEFUNC(like, 3, &likeInfoNorm, SQLITE_FUNC_LIKE),
105003 #endif
105004 #ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
105005 FUNCTION(unknown, -1, 0, 0, unknownFunc ),
105006 #endif
105007 FUNCTION(coalesce, 1, 0, 0, 0 ),
105008 FUNCTION(coalesce, 0, 0, 0, 0 ),
105009 FUNCTION2(coalesce, -1, 0, 0, noopFunc, SQLITE_FUNC_COALESCE),
105010 };
105011 #ifndef SQLITE_OMIT_ALTERTABLE
@@ -108613,11 +108664,11 @@
108664 ** If the SQL is a query, then for each row in the query result
108665 ** the xCallback() function is called. pArg becomes the first
108666 ** argument to xCallback(). If xCallback=NULL then no callback
108667 ** is invoked, even for queries.
108668 */
108669 SQLITE_API int SQLITE_STDCALL sqlite3_exec(
108670 sqlite3 *db, /* The database on which the SQL executes */
108671 const char *zSql, /* The SQL to be executed */
108672 sqlite3_callback xCallback, /* Invoke this callback routine */
108673 void *pArg, /* First argument to xCallback() */
108674 char **pzErrMsg /* Write error messages here */
@@ -109875,11 +109926,11 @@
109926 db->aExtension = aHandle;
109927
109928 db->aExtension[db->nExtension++] = handle;
109929 return SQLITE_OK;
109930 }
109931 SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
109932 sqlite3 *db, /* Load the extension into this database connection */
109933 const char *zFile, /* Name of the shared library containing extension */
109934 const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */
109935 char **pzErrMsg /* Put error message here if not 0 */
109936 ){
@@ -109906,11 +109957,11 @@
109957
109958 /*
109959 ** Enable or disable extension loading. Extension loading is disabled by
109960 ** default so as not to open security holes in older applications.
109961 */
109962 SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff){
109963 sqlite3_mutex_enter(db->mutex);
109964 if( onoff ){
109965 db->flags |= SQLITE_LoadExtension|SQLITE_LoadExtFunc;
109966 }else{
109967 db->flags &= ~(SQLITE_LoadExtension|SQLITE_LoadExtFunc);
@@ -109963,11 +110014,11 @@
110014
110015 /*
110016 ** Register a statically linked extension that is automatically
110017 ** loaded by every new database connection.
110018 */
110019 SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(
110020 void (*xInit)(void)
110021 ){
110022 int rc = SQLITE_OK;
110023 #ifndef SQLITE_OMIT_AUTOINIT
110024 rc = sqlite3_initialize();
@@ -110010,11 +110061,11 @@
110061 ** routine is a no-op.
110062 **
110063 ** Return 1 if xInit was found on the list and removed. Return 0 if xInit
110064 ** was not on the list.
110065 */
110066 SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(
110067 void (*xInit)(void)
110068 ){
110069 #if SQLITE_THREADSAFE
110070 sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
110071 #endif
@@ -110035,11 +110086,11 @@
110086 }
110087
110088 /*
110089 ** Reset the automatic extension loading mechanism.
110090 */
110091 SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void){
110092 #ifndef SQLITE_OMIT_AUTOINIT
110093 if( sqlite3_initialize()==SQLITE_OK )
110094 #endif
110095 {
110096 #if SQLITE_THREADSAFE
@@ -113296,11 +113347,11 @@
113347 ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
113348 ** sqlite3_step(). In the new version, the original SQL text is retained
113349 ** and the statement is automatically recompiled if an schema change
113350 ** occurs.
113351 */
113352 SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
113353 sqlite3 *db, /* Database handle. */
113354 const char *zSql, /* UTF-8 encoded SQL statement. */
113355 int nBytes, /* Length of zSql in bytes. */
113356 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113357 const char **pzTail /* OUT: End of parsed string */
@@ -113308,11 +113359,11 @@
113359 int rc;
113360 rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,0,ppStmt,pzTail);
113361 assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
113362 return rc;
113363 }
113364 SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
113365 sqlite3 *db, /* Database handle. */
113366 const char *zSql, /* UTF-8 encoded SQL statement. */
113367 int nBytes, /* Length of zSql in bytes. */
113368 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113369 const char **pzTail /* OUT: End of parsed string */
@@ -113384,11 +113435,11 @@
113435 ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
113436 ** sqlite3_step(). In the new version, the original SQL text is retained
113437 ** and the statement is automatically recompiled if an schema change
113438 ** occurs.
113439 */
113440 SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
113441 sqlite3 *db, /* Database handle. */
113442 const void *zSql, /* UTF-16 encoded SQL statement. */
113443 int nBytes, /* Length of zSql in bytes. */
113444 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113445 const void **pzTail /* OUT: End of parsed string */
@@ -113396,11 +113447,11 @@
113447 int rc;
113448 rc = sqlite3Prepare16(db,zSql,nBytes,0,ppStmt,pzTail);
113449 assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
113450 return rc;
113451 }
113452 SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
113453 sqlite3 *db, /* Database handle. */
113454 const void *zSql, /* UTF-16 encoded SQL statement. */
113455 int nBytes, /* Length of zSql in bytes. */
113456 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113457 const void **pzTail /* OUT: End of parsed string */
@@ -119239,11 +119290,11 @@
119290 ** The result that is written to ***pazResult is held in memory obtained
119291 ** from malloc(). But the caller cannot free this memory directly.
119292 ** Instead, the entire table should be passed to sqlite3_free_table() when
119293 ** the calling procedure is finished using it.
119294 */
119295 SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
119296 sqlite3 *db, /* The database on which the SQL executes */
119297 const char *zSql, /* The SQL to be executed */
119298 char ***pazResult, /* Write the result table here */
119299 int *pnRow, /* Write the number of rows in the result here */
119300 int *pnColumn, /* Write the number of columns of result here */
@@ -119308,11 +119359,11 @@
119359 }
119360
119361 /*
119362 ** This routine frees the space the sqlite3_get_table() malloced.
119363 */
119364 SQLITE_API void SQLITE_STDCALL sqlite3_free_table(
119365 char **azResult /* Result returned from sqlite3_get_table() */
119366 ){
119367 if( azResult ){
119368 int i, n;
119369 azResult--;
@@ -121718,11 +121769,11 @@
121769
121770
121771 /*
121772 ** External API function used to create a new virtual-table module.
121773 */
121774 SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
121775 sqlite3 *db, /* Database in which module is registered */
121776 const char *zName, /* Name assigned to this module */
121777 const sqlite3_module *pModule, /* The definition of the module */
121778 void *pAux /* Context pointer for xCreate/xConnect */
121779 ){
@@ -121733,11 +121784,11 @@
121784 }
121785
121786 /*
121787 ** External API function used to create a new virtual-table module.
121788 */
121789 SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
121790 sqlite3 *db, /* Database in which module is registered */
121791 const char *zName, /* Name assigned to this module */
121792 const sqlite3_module *pModule, /* The definition of the module */
121793 void *pAux, /* Context pointer for xCreate/xConnect */
121794 void (*xDestroy)(void *) /* Module destructor function */
@@ -122357,11 +122408,11 @@
122408 /*
122409 ** This function is used to set the schema of a virtual table. It is only
122410 ** valid to call this function from within the xCreate() or xConnect() of a
122411 ** virtual table module.
122412 */
122413 SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
122414 VtabCtx *pCtx;
122415 Parse *pParse;
122416 int rc = SQLITE_OK;
122417 Table *pTab;
122418 char *zErr = 0;
@@ -122447,11 +122498,11 @@
122498 SQLITE_PRIVATE int sqlite3VtabCallDestroy(sqlite3 *db, int iDb, const char *zTab){
122499 int rc = SQLITE_OK;
122500 Table *pTab;
122501
122502 pTab = sqlite3FindTable(db, zTab, db->aDb[iDb].zName);
122503 if( pTab!=0 && ALWAYS(pTab->pVTable!=0) ){
122504 VTable *p;
122505 int (*xDestroy)(sqlite3_vtab *);
122506 for(p=pTab->pVTable; p; p=p->pNext){
122507 assert( p->pVtab );
122508 if( p->pVtab->nRef>0 ){
@@ -122587,11 +122638,14 @@
122638 if( rc==SQLITE_OK ){
122639 rc = pModule->xBegin(pVTab->pVtab);
122640 if( rc==SQLITE_OK ){
122641 int iSvpt = db->nStatement + db->nSavepoint;
122642 addToVTrans(db, pVTab);
122643 if( iSvpt && pModule->xSavepoint ){
122644 pVTab->iSavepoint = iSvpt;
122645 rc = pModule->xSavepoint(pVTab->pVtab, iSvpt-1);
122646 }
122647 }
122648 }
122649 }
122650 return rc;
122651 }
@@ -122811,11 +122865,11 @@
122865 ** table update operation currently in progress.
122866 **
122867 ** The results of this routine are undefined unless it is called from
122868 ** within an xUpdate method.
122869 */
122870 SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *db){
122871 static const unsigned char aMap[] = {
122872 SQLITE_ROLLBACK, SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_REPLACE
122873 };
122874 #ifdef SQLITE_ENABLE_API_ARMOR
122875 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -130601,11 +130655,11 @@
130655 }else{
130656 pWInfo->nOBSat = pFrom->isOrdered;
130657 pWInfo->revMask = pFrom->revLoop;
130658 if( pWInfo->nOBSat<=0 ){
130659 pWInfo->nOBSat = 0;
130660 if( nLoop>0 && (pFrom->aLoop[nLoop-1]->wsFlags & WHERE_ONEROW)==0 ){
130661 Bitmask m = 0;
130662 int rc = wherePathSatisfiesOrderBy(pWInfo, pWInfo->pOrderBy, pFrom,
130663 WHERE_ORDERBY_LIMIT, nLoop-1, pFrom->aLoop[nLoop-1], &m);
130664 if( rc==pWInfo->pOrderBy->nExpr ){
130665 pWInfo->bOrderedInnerLoop = 1;
@@ -136136,11 +136190,11 @@
136190 **
136191 ** If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed
136192 ** to recognize the end of a trigger can be omitted. All we have to do
136193 ** is look for a semicolon that is not part of an string or comment.
136194 */
136195 SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *zSql){
136196 u8 state = 0; /* Current state, using numbers defined in header comment */
136197 u8 token; /* Value of the next token */
136198
136199 #ifndef SQLITE_OMIT_TRIGGER
136200 /* A complex statement machine used to detect the end of a CREATE TRIGGER
@@ -136301,11 +136355,11 @@
136355 /*
136356 ** This routine is the same as the sqlite3_complete() routine described
136357 ** above, except that the parameter is required to be UTF-16 encoded, not
136358 ** UTF-8.
136359 */
136360 SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *zSql){
136361 sqlite3_value *pVal;
136362 char const *zSql8;
136363 int rc;
136364
136365 #ifndef SQLITE_OMIT_AUTOINIT
@@ -136461,28 +136515,28 @@
136515 #endif
136516
136517 /* IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns
136518 ** a pointer to the to the sqlite3_version[] string constant.
136519 */
136520 SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void){ return sqlite3_version; }
136521
136522 /* IMPLEMENTATION-OF: R-63124-39300 The sqlite3_sourceid() function returns a
136523 ** pointer to a string constant whose value is the same as the
136524 ** SQLITE_SOURCE_ID C preprocessor macro.
136525 */
136526 SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
136527
136528 /* IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function
136529 ** returns an integer equal to SQLITE_VERSION_NUMBER.
136530 */
136531 SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; }
136532
136533 /* IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns
136534 ** zero if and only if SQLite was compiled with mutexing code omitted due to
136535 ** the SQLITE_THREADSAFE compile-time option being set to 0.
136536 */
136537 SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; }
136538
136539 /*
136540 ** When compiling the test fixture or with debugging enabled (on Win32),
136541 ** this variable being set to non-zero will cause OSTRACE macros to emit
136542 ** extra diagnostic information.
@@ -136551,11 +136605,11 @@
136605 ** call by X completes.
136606 **
136607 ** * Recursive calls to this routine from thread X return immediately
136608 ** without blocking.
136609 */
136610 SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void){
136611 MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */
136612 int rc; /* Result code */
136613 #ifdef SQLITE_EXTRA_INIT
136614 int bRunExtraInit = 0; /* Extra initialization needed */
136615 #endif
@@ -136717,11 +136771,11 @@
136771 ** while any part of SQLite is otherwise in use in any thread. This
136772 ** routine is not threadsafe. But it is safe to invoke this routine
136773 ** on when SQLite is already shut down. If SQLite is already shut down
136774 ** when this routine is invoked, then this routine is a harmless no-op.
136775 */
136776 SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void){
136777 #ifdef SQLITE_OMIT_WSD
136778 int rc = sqlite3_wsd_init(4096, 24);
136779 if( rc!=SQLITE_OK ){
136780 return rc;
136781 }
@@ -137136,11 +137190,11 @@
137190 }
137191
137192 /*
137193 ** Return the mutex associated with a database connection.
137194 */
137195 SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3 *db){
137196 #ifdef SQLITE_ENABLE_API_ARMOR
137197 if( !sqlite3SafetyCheckOk(db) ){
137198 (void)SQLITE_MISUSE_BKPT;
137199 return 0;
137200 }
@@ -137150,11 +137204,11 @@
137204
137205 /*
137206 ** Free up as much memory as we can from the given database
137207 ** connection.
137208 */
137209 SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3 *db){
137210 int i;
137211
137212 #ifdef SQLITE_ENABLE_API_ARMOR
137213 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
137214 #endif
@@ -137174,11 +137228,11 @@
137228
137229 /*
137230 ** Flush any dirty pages in the pager-cache for any attached database
137231 ** to disk.
137232 */
137233 SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3 *db){
137234 int i;
137235 int rc = SQLITE_OK;
137236 int bSeenBusy = 0;
137237
137238 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -137324,11 +137378,11 @@
137378 }
137379
137380 /*
137381 ** Return the ROWID of the most recent insert
137382 */
137383 SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3 *db){
137384 #ifdef SQLITE_ENABLE_API_ARMOR
137385 if( !sqlite3SafetyCheckOk(db) ){
137386 (void)SQLITE_MISUSE_BKPT;
137387 return 0;
137388 }
@@ -137337,11 +137391,11 @@
137391 }
137392
137393 /*
137394 ** Return the number of changes in the most recent call to sqlite3_exec().
137395 */
137396 SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3 *db){
137397 #ifdef SQLITE_ENABLE_API_ARMOR
137398 if( !sqlite3SafetyCheckOk(db) ){
137399 (void)SQLITE_MISUSE_BKPT;
137400 return 0;
137401 }
@@ -137350,11 +137404,11 @@
137404 }
137405
137406 /*
137407 ** Return the number of changes since the database handle was opened.
137408 */
137409 SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3 *db){
137410 #ifdef SQLITE_ENABLE_API_ARMOR
137411 if( !sqlite3SafetyCheckOk(db) ){
137412 (void)SQLITE_MISUSE_BKPT;
137413 return 0;
137414 }
@@ -137501,12 +137555,12 @@
137555 ** statements or unfinished sqlite3_backups. The sqlite3_close_v2()
137556 ** version forces the connection to become a zombie if there are
137557 ** unclosed resources, and arranges for deallocation when the last
137558 ** prepare statement or sqlite3_backup closes.
137559 */
137560 SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3 *db){ return sqlite3Close(db,0); }
137561 SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3 *db){ return sqlite3Close(db,1); }
137562
137563
137564 /*
137565 ** Close the mutex on database connection db.
137566 **
@@ -137909,11 +137963,11 @@
137963
137964 /*
137965 ** This routine sets the busy callback for an Sqlite database to the
137966 ** given callback function with the given argument.
137967 */
137968 SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(
137969 sqlite3 *db,
137970 int (*xBusy)(void*,int),
137971 void *pArg
137972 ){
137973 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -137932,11 +137986,11 @@
137986 /*
137987 ** This routine sets the progress callback for an Sqlite database to the
137988 ** given callback function with the given argument. The progress callback will
137989 ** be invoked every nOps opcodes.
137990 */
137991 SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(
137992 sqlite3 *db,
137993 int nOps,
137994 int (*xProgress)(void*),
137995 void *pArg
137996 ){
@@ -137963,11 +138017,11 @@
138017
138018 /*
138019 ** This routine installs a default busy handler that waits for the
138020 ** specified number of milliseconds before returning 0.
138021 */
138022 SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3 *db, int ms){
138023 #ifdef SQLITE_ENABLE_API_ARMOR
138024 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
138025 #endif
138026 if( ms>0 ){
138027 sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db);
@@ -137979,11 +138033,11 @@
138033 }
138034
138035 /*
138036 ** Cause any pending operation to stop at its earliest opportunity.
138037 */
138038 SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3 *db){
138039 #ifdef SQLITE_ENABLE_API_ARMOR
138040 if( !sqlite3SafetyCheckOk(db) ){
138041 (void)SQLITE_MISUSE_BKPT;
138042 return;
138043 }
@@ -138095,11 +138149,11 @@
138149 }
138150
138151 /*
138152 ** Create new user functions.
138153 */
138154 SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
138155 sqlite3 *db,
138156 const char *zFunc,
138157 int nArg,
138158 int enc,
138159 void *p,
@@ -138109,11 +138163,11 @@
138163 ){
138164 return sqlite3_create_function_v2(db, zFunc, nArg, enc, p, xSFunc, xStep,
138165 xFinal, 0);
138166 }
138167
138168 SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
138169 sqlite3 *db,
138170 const char *zFunc,
138171 int nArg,
138172 int enc,
138173 void *p,
@@ -138152,11 +138206,11 @@
138206 sqlite3_mutex_leave(db->mutex);
138207 return rc;
138208 }
138209
138210 #ifndef SQLITE_OMIT_UTF16
138211 SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
138212 sqlite3 *db,
138213 const void *zFunctionName,
138214 int nArg,
138215 int eTextRep,
138216 void *p,
@@ -138192,11 +138246,11 @@
138246 ** When virtual tables intend to provide an overloaded function, they
138247 ** should call this routine to make sure the global function exists.
138248 ** A global function must exist in order for name resolution to work
138249 ** properly.
138250 */
138251 SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(
138252 sqlite3 *db,
138253 const char *zName,
138254 int nArg
138255 ){
138256 int rc = SQLITE_OK;
@@ -138224,11 +138278,11 @@
138278 ** A NULL trace function means that no tracing is executes. A non-NULL
138279 ** trace is a pointer to a function that is invoked at the start of each
138280 ** SQL statement.
138281 */
138282 #ifndef SQLITE_OMIT_DEPRECATED
138283 SQLITE_API void *SQLITE_STDCALL sqlite3_trace(sqlite3 *db, void(*xTrace)(void*,const char*), void *pArg){
138284 void *pOld;
138285
138286 #ifdef SQLITE_ENABLE_API_ARMOR
138287 if( !sqlite3SafetyCheckOk(db) ){
138288 (void)SQLITE_MISUSE_BKPT;
@@ -138245,11 +138299,11 @@
138299 }
138300 #endif /* SQLITE_OMIT_DEPRECATED */
138301
138302 /* Register a trace callback using the version-2 interface.
138303 */
138304 SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2(
138305 sqlite3 *db, /* Trace this connection */
138306 unsigned mTrace, /* Mask of events to be traced */
138307 int(*xTrace)(unsigned,void*,void*,void*), /* Callback to invoke */
138308 void *pArg /* Context */
138309 ){
@@ -138273,11 +138327,11 @@
138327 **
138328 ** A NULL profile function means that no profiling is executes. A non-NULL
138329 ** profile is a pointer to a function that is invoked at the conclusion of
138330 ** each SQL statement that is run.
138331 */
138332 SQLITE_API void *SQLITE_STDCALL sqlite3_profile(
138333 sqlite3 *db,
138334 void (*xProfile)(void*,const char*,sqlite_uint64),
138335 void *pArg
138336 ){
138337 void *pOld;
@@ -138301,11 +138355,11 @@
138355 /*
138356 ** Register a function to be invoked when a transaction commits.
138357 ** If the invoked function returns non-zero, then the commit becomes a
138358 ** rollback.
138359 */
138360 SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(
138361 sqlite3 *db, /* Attach the hook to this database */
138362 int (*xCallback)(void*), /* Function to invoke on each commit */
138363 void *pArg /* Argument to the function */
138364 ){
138365 void *pOld;
@@ -138326,11 +138380,11 @@
138380
138381 /*
138382 ** Register a callback to be invoked each time a row is updated,
138383 ** inserted or deleted using this database connection.
138384 */
138385 SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
138386 sqlite3 *db, /* Attach the hook to this database */
138387 void (*xCallback)(void*,int,char const *,char const *,sqlite_int64),
138388 void *pArg /* Argument to the function */
138389 ){
138390 void *pRet;
@@ -138351,11 +138405,11 @@
138405
138406 /*
138407 ** Register a callback to be invoked each time a transaction is rolled
138408 ** back by this database connection.
138409 */
138410 SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(
138411 sqlite3 *db, /* Attach the hook to this database */
138412 void (*xCallback)(void*), /* Callback function */
138413 void *pArg /* Argument to the function */
138414 ){
138415 void *pRet;
@@ -138377,11 +138431,11 @@
138431 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
138432 /*
138433 ** Register a callback to be invoked each time a row is updated,
138434 ** inserted or deleted using this database connection.
138435 */
138436 SQLITE_API void *SQLITE_STDCALL sqlite3_preupdate_hook(
138437 sqlite3 *db, /* Attach the hook to this database */
138438 void(*xCallback)( /* Callback function */
138439 void*,sqlite3*,int,char const*,char const*,sqlite3_int64,sqlite3_int64),
138440 void *pArg /* First callback argument */
138441 ){
@@ -138426,11 +138480,11 @@
138480 ** The callback registered by this function replaces any existing callback
138481 ** registered using sqlite3_wal_hook(). Likewise, registering a callback
138482 ** using sqlite3_wal_hook() disables the automatic checkpoint mechanism
138483 ** configured by this function.
138484 */
138485 SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){
138486 #ifdef SQLITE_OMIT_WAL
138487 UNUSED_PARAMETER(db);
138488 UNUSED_PARAMETER(nFrame);
138489 #else
138490 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -138447,11 +138501,11 @@
138501
138502 /*
138503 ** Register a callback to be invoked each time a transaction is written
138504 ** into the write-ahead-log by this database connection.
138505 */
138506 SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
138507 sqlite3 *db, /* Attach the hook to this db handle */
138508 int(*xCallback)(void *, sqlite3*, const char*, int),
138509 void *pArg /* First argument passed to xCallback() */
138510 ){
138511 #ifndef SQLITE_OMIT_WAL
@@ -138474,11 +138528,11 @@
138528 }
138529
138530 /*
138531 ** Checkpoint database zDb.
138532 */
138533 SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
138534 sqlite3 *db, /* Database handle */
138535 const char *zDb, /* Name of attached database (or NULL) */
138536 int eMode, /* SQLITE_CHECKPOINT_* value */
138537 int *pnLog, /* OUT: Size of WAL log in frames */
138538 int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -138529,11 +138583,11 @@
138583 /*
138584 ** Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points
138585 ** to contains a zero-length string, all attached databases are
138586 ** checkpointed.
138587 */
138588 SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){
138589 /* EVIDENCE-OF: R-41613-20553 The sqlite3_wal_checkpoint(D,X) is equivalent to
138590 ** sqlite3_wal_checkpoint_v2(D,X,SQLITE_CHECKPOINT_PASSIVE,0,0). */
138591 return sqlite3_wal_checkpoint_v2(db,zDb,SQLITE_CHECKPOINT_PASSIVE,0,0);
138592 }
138593
@@ -138620,11 +138674,11 @@
138674
138675 /*
138676 ** Return UTF-8 encoded English language explanation of the most recent
138677 ** error.
138678 */
138679 SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3 *db){
138680 const char *z;
138681 if( !db ){
138682 return sqlite3ErrStr(SQLITE_NOMEM_BKPT);
138683 }
138684 if( !sqlite3SafetyCheckSickOrOk(db) ){
@@ -138648,11 +138702,11 @@
138702 #ifndef SQLITE_OMIT_UTF16
138703 /*
138704 ** Return UTF-16 encoded English language explanation of the most recent
138705 ** error.
138706 */
138707 SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3 *db){
138708 static const u16 outOfMem[] = {
138709 'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0
138710 };
138711 static const u16 misuse[] = {
138712 'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ',
@@ -138693,38 +138747,38 @@
138747
138748 /*
138749 ** Return the most recent error code generated by an SQLite routine. If NULL is
138750 ** passed to this function, we assume a malloc() failed during sqlite3_open().
138751 */
138752 SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db){
138753 if( db && !sqlite3SafetyCheckSickOrOk(db) ){
138754 return SQLITE_MISUSE_BKPT;
138755 }
138756 if( !db || db->mallocFailed ){
138757 return SQLITE_NOMEM_BKPT;
138758 }
138759 return db->errCode & db->errMask;
138760 }
138761 SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db){
138762 if( db && !sqlite3SafetyCheckSickOrOk(db) ){
138763 return SQLITE_MISUSE_BKPT;
138764 }
138765 if( !db || db->mallocFailed ){
138766 return SQLITE_NOMEM_BKPT;
138767 }
138768 return db->errCode;
138769 }
138770 SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3 *db){
138771 return db ? db->iSysErrno : 0;
138772 }
138773
138774 /*
138775 ** Return a string that describes the kind of error specified in the
138776 ** argument. For now, this simply calls the internal sqlite3ErrStr()
138777 ** function.
138778 */
138779 SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int rc){
138780 return sqlite3ErrStr(rc);
138781 }
138782
138783 /*
138784 ** Create a new collating function for database "db". The name is zName
@@ -138868,11 +138922,11 @@
138922 **
138923 ** A new lower limit does not shrink existing constructs.
138924 ** It merely prevents new constructs that exceed the limit
138925 ** from forming.
138926 */
138927 SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3 *db, int limitId, int newLimit){
138928 int oldLimit;
138929
138930 #ifdef SQLITE_ENABLE_API_ARMOR
138931 if( !sqlite3SafetyCheckOk(db) ){
138932 (void)SQLITE_MISUSE_BKPT;
@@ -139492,18 +139546,18 @@
139546 }
139547
139548 /*
139549 ** Open a new database handle.
139550 */
139551 SQLITE_API int SQLITE_STDCALL sqlite3_open(
139552 const char *zFilename,
139553 sqlite3 **ppDb
139554 ){
139555 return openDatabase(zFilename, ppDb,
139556 SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0);
139557 }
139558 SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
139559 const char *filename, /* Database filename (UTF-8) */
139560 sqlite3 **ppDb, /* OUT: SQLite db handle */
139561 int flags, /* Flags */
139562 const char *zVfs /* Name of VFS module to use */
139563 ){
@@ -139512,11 +139566,11 @@
139566
139567 #ifndef SQLITE_OMIT_UTF16
139568 /*
139569 ** Open a new database handle.
139570 */
139571 SQLITE_API int SQLITE_STDCALL sqlite3_open16(
139572 const void *zFilename,
139573 sqlite3 **ppDb
139574 ){
139575 char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */
139576 sqlite3_value *pVal;
@@ -139551,11 +139605,11 @@
139605 #endif /* SQLITE_OMIT_UTF16 */
139606
139607 /*
139608 ** Register a new collation sequence with the database handle db.
139609 */
139610 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
139611 sqlite3* db,
139612 const char *zName,
139613 int enc,
139614 void* pCtx,
139615 int(*xCompare)(void*,int,const void*,int,const void*)
@@ -139564,11 +139618,11 @@
139618 }
139619
139620 /*
139621 ** Register a new collation sequence with the database handle db.
139622 */
139623 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
139624 sqlite3* db,
139625 const char *zName,
139626 int enc,
139627 void* pCtx,
139628 int(*xCompare)(void*,int,const void*,int,const void*),
@@ -139589,11 +139643,11 @@
139643
139644 #ifndef SQLITE_OMIT_UTF16
139645 /*
139646 ** Register a new collation sequence with the database handle db.
139647 */
139648 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
139649 sqlite3* db,
139650 const void *zName,
139651 int enc,
139652 void* pCtx,
139653 int(*xCompare)(void*,int,const void*,int,const void*)
@@ -139619,11 +139673,11 @@
139673
139674 /*
139675 ** Register a collation sequence factory callback with the database handle
139676 ** db. Replace any previously installed collation sequence factory.
139677 */
139678 SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
139679 sqlite3 *db,
139680 void *pCollNeededArg,
139681 void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*)
139682 ){
139683 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -139640,11 +139694,11 @@
139694 #ifndef SQLITE_OMIT_UTF16
139695 /*
139696 ** Register a collation sequence factory callback with the database handle
139697 ** db. Replace any previously installed collation sequence factory.
139698 */
139699 SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
139700 sqlite3 *db,
139701 void *pCollNeededArg,
139702 void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*)
139703 ){
139704 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -139662,11 +139716,11 @@
139716 #ifndef SQLITE_OMIT_DEPRECATED
139717 /*
139718 ** This function is now an anachronism. It used to be used to recover from a
139719 ** malloc() failure, but SQLite now does this automatically.
139720 */
139721 SQLITE_API int SQLITE_STDCALL sqlite3_global_recover(void){
139722 return SQLITE_OK;
139723 }
139724 #endif
139725
139726 /*
@@ -139673,11 +139727,11 @@
139727 ** Test to see whether or not the database connection is in autocommit
139728 ** mode. Return TRUE if it is and FALSE if not. Autocommit mode is on
139729 ** by default. Autocommit is disabled by a BEGIN statement and reenabled
139730 ** by the next COMMIT or ROLLBACK.
139731 */
139732 SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3 *db){
139733 #ifdef SQLITE_ENABLE_API_ARMOR
139734 if( !sqlite3SafetyCheckOk(db) ){
139735 (void)SQLITE_MISUSE_BKPT;
139736 return 0;
139737 }
@@ -139730,19 +139784,19 @@
139784 ** data for this thread has been deallocated.
139785 **
139786 ** SQLite no longer uses thread-specific data so this routine is now a
139787 ** no-op. It is retained for historical compatibility.
139788 */
139789 SQLITE_API void SQLITE_STDCALL sqlite3_thread_cleanup(void){
139790 }
139791 #endif
139792
139793 /*
139794 ** Return meta information about a specific column of a database table.
139795 ** See comment in sqlite3.h (sqlite.h.in) for details.
139796 */
139797 SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
139798 sqlite3 *db, /* Connection handle */
139799 const char *zDbName, /* Database name or NULL */
139800 const char *zTableName, /* Table name */
139801 const char *zColumnName, /* Column name */
139802 char const **pzDataType, /* OUTPUT: Declared data type */
@@ -139856,11 +139910,11 @@
139910 }
139911
139912 /*
139913 ** Sleep for a little while. Return the amount of time slept.
139914 */
139915 SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int ms){
139916 sqlite3_vfs *pVfs;
139917 int rc;
139918 pVfs = sqlite3_vfs_find(0);
139919 if( pVfs==0 ) return 0;
139920
@@ -139872,11 +139926,11 @@
139926 }
139927
139928 /*
139929 ** Enable or disable the extended result codes.
139930 */
139931 SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3 *db, int onoff){
139932 #ifdef SQLITE_ENABLE_API_ARMOR
139933 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
139934 #endif
139935 sqlite3_mutex_enter(db->mutex);
139936 db->errMask = onoff ? 0xffffffff : 0xff;
@@ -139885,11 +139939,11 @@
139939 }
139940
139941 /*
139942 ** Invoke the xFileControl method on a particular database.
139943 */
139944 SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
139945 int rc = SQLITE_ERROR;
139946 Btree *pBtree;
139947
139948 #ifdef SQLITE_ENABLE_API_ARMOR
139949 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -140270,11 +140324,11 @@
140324 ** method of a VFS implementation. The zParam argument is the name of the
140325 ** query parameter we seek. This routine returns the value of the zParam
140326 ** parameter if it exists. If the parameter does not exist, this routine
140327 ** returns a NULL pointer.
140328 */
140329 SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam){
140330 if( zFilename==0 || zParam==0 ) return 0;
140331 zFilename += sqlite3Strlen30(zFilename) + 1;
140332 while( zFilename[0] ){
140333 int x = strcmp(zFilename, zParam);
140334 zFilename += sqlite3Strlen30(zFilename) + 1;
@@ -140285,20 +140339,20 @@
140339 }
140340
140341 /*
140342 ** Return a boolean value for a query parameter.
140343 */
140344 SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){
140345 const char *z = sqlite3_uri_parameter(zFilename, zParam);
140346 bDflt = bDflt!=0;
140347 return z ? sqlite3GetBoolean(z, bDflt) : bDflt;
140348 }
140349
140350 /*
140351 ** Return a 64-bit integer value for a query parameter.
140352 */
140353 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(
140354 const char *zFilename, /* Filename as passed to xOpen */
140355 const char *zParam, /* URI parameter sought */
140356 sqlite3_int64 bDflt /* return if parameter is missing */
140357 ){
140358 const char *z = sqlite3_uri_parameter(zFilename, zParam);
@@ -140326,11 +140380,11 @@
140380
140381 /*
140382 ** Return the filename of the database associated with a database
140383 ** connection.
140384 */
140385 SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName){
140386 Btree *pBt;
140387 #ifdef SQLITE_ENABLE_API_ARMOR
140388 if( !sqlite3SafetyCheckOk(db) ){
140389 (void)SQLITE_MISUSE_BKPT;
140390 return 0;
@@ -140342,11 +140396,11 @@
140396
140397 /*
140398 ** Return 1 if database is read-only or 0 if read/write. Return -1 if
140399 ** no such database exists.
140400 */
140401 SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName){
140402 Btree *pBt;
140403 #ifdef SQLITE_ENABLE_API_ARMOR
140404 if( !sqlite3SafetyCheckOk(db) ){
140405 (void)SQLITE_MISUSE_BKPT;
140406 return -1;
@@ -140359,11 +140413,11 @@
140413 #ifdef SQLITE_ENABLE_SNAPSHOT
140414 /*
140415 ** Obtain a snapshot handle for the snapshot of database zDb currently
140416 ** being read by handle db.
140417 */
140418 SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_get(
140419 sqlite3 *db,
140420 const char *zDb,
140421 sqlite3_snapshot **ppSnapshot
140422 ){
140423 int rc = SQLITE_ERROR;
@@ -140394,11 +140448,11 @@
140448 }
140449
140450 /*
140451 ** Open a read-transaction on the snapshot idendified by pSnapshot.
140452 */
140453 SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_open(
140454 sqlite3 *db,
140455 const char *zDb,
140456 sqlite3_snapshot *pSnapshot
140457 ){
140458 int rc = SQLITE_ERROR;
@@ -140431,11 +140485,11 @@
140485 }
140486
140487 /*
140488 ** Free a snapshot handle obtained from sqlite3_snapshot_get().
140489 */
140490 SQLITE_API void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot *pSnapshot){
140491 sqlite3_free(pSnapshot);
140492 }
140493 #endif /* SQLITE_ENABLE_SNAPSHOT */
140494
140495 /************** End of main.c ************************************************/
@@ -140585,11 +140639,11 @@
140639 **
140640 ** Each call to this routine overrides any prior callbacks registered
140641 ** on the same "db". If xNotify==0 then any prior callbacks are immediately
140642 ** cancelled.
140643 */
140644 SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
140645 sqlite3 *db,
140646 void (*xNotify)(void **, int),
140647 void *pArg
140648 ){
140649 int rc = SQLITE_OK;
@@ -147588,11 +147642,11 @@
147642 ** Initialize API pointer table, if required.
147643 */
147644 #ifdef _WIN32
147645 __declspec(dllexport)
147646 #endif
147647 SQLITE_API int SQLITE_STDCALL sqlite3_fts3_init(
147648 sqlite3 *db,
147649 char **pzErrMsg,
147650 const sqlite3_api_routines *pApi
147651 ){
147652 SQLITE_EXTENSION_INIT2(pApi)
@@ -163389,11 +163443,11 @@
163443 }
163444
163445 /*
163446 ** Register a new geometry function for use with the r-tree MATCH operator.
163447 */
163448 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
163449 sqlite3 *db, /* Register SQL function on this connection */
163450 const char *zGeom, /* Name of the new SQL function */
163451 int (*xGeom)(sqlite3_rtree_geometry*,int,RtreeDValue*,int*), /* Callback */
163452 void *pContext /* Extra data associated with the callback */
163453 ){
@@ -163413,11 +163467,11 @@
163467
163468 /*
163469 ** Register a new 2nd-generation geometry function for use with the
163470 ** r-tree MATCH operator.
163471 */
163472 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
163473 sqlite3 *db, /* Register SQL function on this connection */
163474 const char *zQueryFunc, /* Name of new SQL function */
163475 int (*xQueryFunc)(sqlite3_rtree_query_info*), /* Callback */
163476 void *pContext, /* Extra data passed into the callback */
163477 void (*xDestructor)(void*) /* Destructor for the extra data */
@@ -163438,11 +163492,11 @@
163492
163493 #if !SQLITE_CORE
163494 #ifdef _WIN32
163495 __declspec(dllexport)
163496 #endif
163497 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_init(
163498 sqlite3 *db,
163499 char **pzErrMsg,
163500 const sqlite3_api_routines *pApi
163501 ){
163502 SQLITE_EXTENSION_INIT2(pApi)
@@ -163989,11 +164043,11 @@
164043
164044 #if !SQLITE_CORE
164045 #ifdef _WIN32
164046 __declspec(dllexport)
164047 #endif
164048 SQLITE_API int SQLITE_STDCALL sqlite3_icu_init(
164049 sqlite3 *db,
164050 char **pzErrMsg,
164051 const sqlite3_api_routines *pApi
164052 ){
164053 SQLITE_EXTENSION_INIT2(pApi)
@@ -164669,11 +164723,11 @@
164723 ** IMPORTANT NOTE FOR ZIPVFS USERS: The RBU extension works with all of
164724 ** SQLite's built-in VFSs, including the multiplexor VFS. However it does
164725 ** not work out of the box with zipvfs. Refer to the comment describing
164726 ** the zipvfs_create_vfs() API below for details on using RBU with zipvfs.
164727 */
164728 SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_open(
164729 const char *zTarget,
164730 const char *zRbu,
164731 const char *zState
164732 );
164733
@@ -164702,11 +164756,11 @@
164756 ** As with sqlite3rbu_open(), Zipvfs users should rever to the comment
164757 ** describing the sqlite3rbu_create_vfs() API function below for
164758 ** a description of the complications associated with using RBU with
164759 ** zipvfs databases.
164760 */
164761 SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_vacuum(
164762 const char *zTarget,
164763 const char *zState
164764 );
164765
164766 /*
@@ -164738,11 +164792,11 @@
164792 ** when sqlite3rbu_close() is called.
164793 **
164794 ** Database handles returned by this function remain valid until the next
164795 ** call to any sqlite3rbu_xxx() function other than sqlite3rbu_db().
164796 */
164797 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3rbu_db(sqlite3rbu*, int bRbu);
164798
164799 /*
164800 ** Do some work towards applying the RBU update to the target db.
164801 **
164802 ** Return SQLITE_DONE if the update has been completely applied, or
@@ -164752,11 +164806,11 @@
164806 **
164807 ** Once a call to sqlite3rbu_step() has returned a value other than
164808 ** SQLITE_OK, all subsequent calls on the same RBU handle are no-ops
164809 ** that immediately return the same value.
164810 */
164811 SQLITE_API int SQLITE_STDCALL sqlite3rbu_step(sqlite3rbu *pRbu);
164812
164813 /*
164814 ** Force RBU to save its state to disk.
164815 **
164816 ** If a power failure or application crash occurs during an update, following
@@ -164764,11 +164818,11 @@
164818 ** was last saved. In other words, from the most recent successful call to
164819 ** sqlite3rbu_close() or this function.
164820 **
164821 ** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
164822 */
164823 SQLITE_API int SQLITE_STDCALL sqlite3rbu_savestate(sqlite3rbu *pRbu);
164824
164825 /*
164826 ** Close an RBU handle.
164827 **
164828 ** If the RBU update has been completely applied, mark the RBU database
@@ -164784,18 +164838,18 @@
164838 **
164839 ** Otherwise, if no error occurs, this function returns SQLITE_OK if the
164840 ** update has been partially applied, or SQLITE_DONE if it has been
164841 ** completely applied.
164842 */
164843 SQLITE_API int SQLITE_STDCALL sqlite3rbu_close(sqlite3rbu *pRbu, char **pzErrmsg);
164844
164845 /*
164846 ** Return the total number of key-value operations (inserts, deletes or
164847 ** updates) that have been performed on the target database since the
164848 ** current RBU update was started.
164849 */
164850 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3rbu_progress(sqlite3rbu *pRbu);
164851
164852 /*
164853 ** Obtain permyriadage (permyriadage is to 10000 as percentage is to 100)
164854 ** progress indications for the two stages of an RBU update. This API may
164855 ** be useful for driving GUI progress indicators and similar.
@@ -164833,11 +164887,11 @@
164887 ** permyriadage progress of the same stage. If the rbu_count table does
164888 ** not exist, then (*pnOne) is set to -1 during stage 1. If the rbu_count
164889 ** table exists but is not correctly populated, the value of the *pnOne
164890 ** output variable during stage 1 is undefined.
164891 */
164892 SQLITE_API void SQLITE_STDCALL sqlite3rbu_bp_progress(sqlite3rbu *pRbu, int *pnOne, int *pnTwo);
164893
164894 /*
164895 ** Obtain an indication as to the current stage of an RBU update or vacuum.
164896 ** This function always returns one of the SQLITE_RBU_STATE_XXX constants
164897 ** defined in this file. Return values should be interpreted as follows:
@@ -164871,11 +164925,11 @@
164925 #define SQLITE_RBU_STATE_MOVE 2
164926 #define SQLITE_RBU_STATE_CHECKPOINT 3
164927 #define SQLITE_RBU_STATE_DONE 4
164928 #define SQLITE_RBU_STATE_ERROR 5
164929
164930 SQLITE_API int SQLITE_STDCALL sqlite3rbu_state(sqlite3rbu *pRbu);
164931
164932 /*
164933 ** Create an RBU VFS named zName that accesses the underlying file-system
164934 ** via existing VFS zParent. Or, if the zParent parameter is passed NULL,
164935 ** then the new RBU VFS uses the default system VFS to access the file-system.
@@ -164915,21 +164969,21 @@
164969 ** The overhead of adding the "rbu" VFS to the system is negligible for
164970 ** non-RBU users. There is no harm in an application accessing the
164971 ** file-system via "rbu" all the time, even if it only uses RBU functionality
164972 ** occasionally.
164973 */
164974 SQLITE_API int SQLITE_STDCALL sqlite3rbu_create_vfs(const char *zName, const char *zParent);
164975
164976 /*
164977 ** Deregister and destroy an RBU vfs created by an earlier call to
164978 ** sqlite3rbu_create_vfs().
164979 **
164980 ** VFS objects are not reference counted. If a VFS object is destroyed
164981 ** before all database handles that use it have been closed, the results
164982 ** are undefined.
164983 */
164984 SQLITE_API void SQLITE_STDCALL sqlite3rbu_destroy_vfs(const char *zName);
164985
164986 #if 0
164987 } /* end of the 'extern "C"' block */
164988 #endif
164989
@@ -168019,11 +168073,11 @@
168073 }
168074
168075 /*
168076 ** Step the RBU object.
168077 */
168078 SQLITE_API int SQLITE_STDCALL sqlite3rbu_step(sqlite3rbu *p){
168079 if( p ){
168080 switch( p->eStage ){
168081 case RBU_STAGE_OAL: {
168082 RbuObjIter *pIter = &p->objiter;
168083
@@ -168461,11 +168515,11 @@
168515 }
168516
168517 /*
168518 ** Open and return a new RBU handle.
168519 */
168520 SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_open(
168521 const char *zTarget,
168522 const char *zRbu,
168523 const char *zState
168524 ){
168525 /* TODO: Check that zTarget and zRbu are non-NULL */
@@ -168473,11 +168527,11 @@
168527 }
168528
168529 /*
168530 ** Open a handle to begin or resume an RBU VACUUM operation.
168531 */
168532 SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_vacuum(
168533 const char *zTarget,
168534 const char *zState
168535 ){
168536 /* TODO: Check that both arguments are non-NULL */
168537 return openRbuHandle(0, zTarget, zState);
@@ -168484,11 +168538,11 @@
168538 }
168539
168540 /*
168541 ** Return the database handle used by pRbu.
168542 */
168543 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3rbu_db(sqlite3rbu *pRbu, int bRbu){
168544 sqlite3 *db = 0;
168545 if( pRbu ){
168546 db = (bRbu ? pRbu->dbRbu : pRbu->dbMain);
168547 }
168548 return db;
@@ -168516,11 +168570,11 @@
168570 }
168571
168572 /*
168573 ** Close the RBU handle.
168574 */
168575 SQLITE_API int SQLITE_STDCALL sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){
168576 int rc;
168577 if( p ){
168578
168579 /* Commit the transaction to the *-oal file. */
168580 if( p->rc==SQLITE_OK && p->eStage==RBU_STAGE_OAL ){
@@ -168567,19 +168621,19 @@
168621 /*
168622 ** Return the total number of key-value operations (inserts, deletes or
168623 ** updates) that have been performed on the target database since the
168624 ** current RBU update was started.
168625 */
168626 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3rbu_progress(sqlite3rbu *pRbu){
168627 return pRbu->nProgress;
168628 }
168629
168630 /*
168631 ** Return permyriadage progress indications for the two main stages of
168632 ** an RBU update.
168633 */
168634 SQLITE_API void SQLITE_STDCALL sqlite3rbu_bp_progress(sqlite3rbu *p, int *pnOne, int *pnTwo){
168635 const int MAX_PROGRESS = 10000;
168636 switch( p->eStage ){
168637 case RBU_STAGE_OAL:
168638 if( p->nPhaseOneStep>0 ){
168639 *pnOne = (int)(MAX_PROGRESS * (i64)p->nProgress/(i64)p->nPhaseOneStep);
@@ -168610,11 +168664,11 @@
168664 }
168665
168666 /*
168667 ** Return the current state of the RBU vacuum or update operation.
168668 */
168669 SQLITE_API int SQLITE_STDCALL sqlite3rbu_state(sqlite3rbu *p){
168670 int aRes[] = {
168671 0, SQLITE_RBU_STATE_OAL, SQLITE_RBU_STATE_MOVE,
168672 0, SQLITE_RBU_STATE_CHECKPOINT, SQLITE_RBU_STATE_DONE
168673 };
168674
@@ -168638,11 +168692,11 @@
168692 );
168693 return aRes[p->eStage];
168694 }
168695 }
168696
168697 SQLITE_API int SQLITE_STDCALL sqlite3rbu_savestate(sqlite3rbu *p){
168698 int rc = p->rc;
168699 if( rc==SQLITE_DONE ) return SQLITE_OK;
168700
168701 assert( p->eStage>=RBU_STAGE_OAL && p->eStage<=RBU_STAGE_DONE );
168702 if( p->eStage==RBU_STAGE_OAL ){
@@ -169465,11 +169519,11 @@
169519
169520 /*
169521 ** Deregister and destroy an RBU vfs created by an earlier call to
169522 ** sqlite3rbu_create_vfs().
169523 */
169524 SQLITE_API void SQLITE_STDCALL sqlite3rbu_destroy_vfs(const char *zName){
169525 sqlite3_vfs *pVfs = sqlite3_vfs_find(zName);
169526 if( pVfs && pVfs->xOpen==rbuVfsOpen ){
169527 sqlite3_mutex_free(((rbu_vfs*)pVfs)->mutex);
169528 sqlite3_vfs_unregister(pVfs);
169529 sqlite3_free(pVfs);
@@ -169479,11 +169533,11 @@
169533 /*
169534 ** Create an RBU VFS named zName that accesses the underlying file-system
169535 ** via existing VFS zParent. The new object is registered as a non-default
169536 ** VFS with SQLite before returning.
169537 */
169538 SQLITE_API int SQLITE_STDCALL sqlite3rbu_create_vfs(const char *zName, const char *zParent){
169539
169540 /* Template for VFS */
169541 static sqlite3_vfs vfs_template = {
169542 1, /* iVersion */
169543 0, /* szOsFile */
@@ -171724,11 +171778,11 @@
171778 }
171779
171780 return rc;
171781 }
171782
171783 SQLITE_API int SQLITE_STDCALL sqlite3session_diff(
171784 sqlite3_session *pSession,
171785 const char *zFrom,
171786 const char *zTbl,
171787 char **pzErrMsg
171788 ){
@@ -171818,11 +171872,11 @@
171872
171873 /*
171874 ** Create a session object. This session object will record changes to
171875 ** database zDb attached to connection db.
171876 */
171877 SQLITE_API int SQLITE_STDCALL sqlite3session_create(
171878 sqlite3 *db, /* Database handle */
171879 const char *zDb, /* Name of db (e.g. "main") */
171880 sqlite3_session **ppSession /* OUT: New session object */
171881 ){
171882 sqlite3_session *pNew; /* Newly allocated session object */
@@ -171880,11 +171934,11 @@
171934 }
171935
171936 /*
171937 ** Delete a session object previously allocated using sqlite3session_create().
171938 */
171939 SQLITE_API void SQLITE_STDCALL sqlite3session_delete(sqlite3_session *pSession){
171940 sqlite3 *db = pSession->db;
171941 sqlite3_session *pHead;
171942 sqlite3_session **pp;
171943
171944 /* Unlink the session from the linked list of sessions attached to the
@@ -171909,11 +171963,11 @@
171963 }
171964
171965 /*
171966 ** Set a table filter on a Session Object.
171967 */
171968 SQLITE_API void SQLITE_STDCALL sqlite3session_table_filter(
171969 sqlite3_session *pSession,
171970 int(*xFilter)(void*, const char*),
171971 void *pCtx /* First argument passed to xFilter */
171972 ){
171973 pSession->bAutoAttach = 1;
@@ -171927,11 +171981,11 @@
171981 **
171982 ** Only tables that have a PRIMARY KEY defined may be attached. It does
171983 ** not matter if the PRIMARY KEY is an "INTEGER PRIMARY KEY" (rowid alias)
171984 ** or not.
171985 */
171986 SQLITE_API int SQLITE_STDCALL sqlite3session_attach(
171987 sqlite3_session *pSession, /* Session object */
171988 const char *zName /* Table name */
171989 ){
171990 int rc = SQLITE_OK;
171991 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
@@ -172617,11 +172671,11 @@
172671 ** session object passed as the first argument.
172672 **
172673 ** It is the responsibility of the caller to eventually free the buffer
172674 ** using sqlite3_free().
172675 */
172676 SQLITE_API int SQLITE_STDCALL sqlite3session_changeset(
172677 sqlite3_session *pSession, /* Session object */
172678 int *pnChangeset, /* OUT: Size of buffer at *ppChangeset */
172679 void **ppChangeset /* OUT: Buffer containing changeset */
172680 ){
172681 return sessionGenerateChangeset(pSession, 0, 0, 0, pnChangeset, ppChangeset);
@@ -172628,11 +172682,11 @@
172682 }
172683
172684 /*
172685 ** Streaming version of sqlite3session_changeset().
172686 */
172687 SQLITE_API int SQLITE_STDCALL sqlite3session_changeset_strm(
172688 sqlite3_session *pSession,
172689 int (*xOutput)(void *pOut, const void *pData, int nData),
172690 void *pOut
172691 ){
172692 return sessionGenerateChangeset(pSession, 0, xOutput, pOut, 0, 0);
@@ -172639,11 +172693,11 @@
172693 }
172694
172695 /*
172696 ** Streaming version of sqlite3session_patchset().
172697 */
172698 SQLITE_API int SQLITE_STDCALL sqlite3session_patchset_strm(
172699 sqlite3_session *pSession,
172700 int (*xOutput)(void *pOut, const void *pData, int nData),
172701 void *pOut
172702 ){
172703 return sessionGenerateChangeset(pSession, 1, xOutput, pOut, 0, 0);
@@ -172654,11 +172708,11 @@
172708 ** session object passed as the first argument.
172709 **
172710 ** It is the responsibility of the caller to eventually free the buffer
172711 ** using sqlite3_free().
172712 */
172713 SQLITE_API int SQLITE_STDCALL sqlite3session_patchset(
172714 sqlite3_session *pSession, /* Session object */
172715 int *pnPatchset, /* OUT: Size of buffer at *ppChangeset */
172716 void **ppPatchset /* OUT: Buffer containing changeset */
172717 ){
172718 return sessionGenerateChangeset(pSession, 1, 0, 0, pnPatchset, ppPatchset);
@@ -172665,11 +172719,11 @@
172719 }
172720
172721 /*
172722 ** Enable or disable the session object passed as the first argument.
172723 */
172724 SQLITE_API int SQLITE_STDCALL sqlite3session_enable(sqlite3_session *pSession, int bEnable){
172725 int ret;
172726 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172727 if( bEnable>=0 ){
172728 pSession->bEnable = bEnable;
172729 }
@@ -172679,11 +172733,11 @@
172733 }
172734
172735 /*
172736 ** Enable or disable the session object passed as the first argument.
172737 */
172738 SQLITE_API int SQLITE_STDCALL sqlite3session_indirect(sqlite3_session *pSession, int bIndirect){
172739 int ret;
172740 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172741 if( bIndirect>=0 ){
172742 pSession->bIndirect = bIndirect;
172743 }
@@ -172694,11 +172748,11 @@
172748
172749 /*
172750 ** Return true if there have been no changes to monitored tables recorded
172751 ** by the session object passed as the only argument.
172752 */
172753 SQLITE_API int SQLITE_STDCALL sqlite3session_isempty(sqlite3_session *pSession){
172754 int ret = 0;
172755 SessionTable *pTab;
172756
172757 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172758 for(pTab=pSession->pTable; pTab && ret==0; pTab=pTab->pNext){
@@ -172744,11 +172798,11 @@
172798 }
172799
172800 /*
172801 ** Create an iterator used to iterate through the contents of a changeset.
172802 */
172803 SQLITE_API int SQLITE_STDCALL sqlite3changeset_start(
172804 sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
172805 int nChangeset, /* Size of buffer pChangeset in bytes */
172806 void *pChangeset /* Pointer to buffer containing changeset */
172807 ){
172808 return sessionChangesetStart(pp, 0, 0, nChangeset, pChangeset);
@@ -172755,11 +172809,11 @@
172809 }
172810
172811 /*
172812 ** Streaming version of sqlite3changeset_start().
172813 */
172814 SQLITE_API int SQLITE_STDCALL sqlite3changeset_start_strm(
172815 sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
172816 int (*xInput)(void *pIn, void *pData, int *pnData),
172817 void *pIn
172818 ){
172819 return sessionChangesetStart(pp, xInput, pIn, 0, 0);
@@ -173176,20 +173230,20 @@
173230 ** or SQLITE_CORRUPT.
173231 **
173232 ** This function may not be called on iterators passed to a conflict handler
173233 ** callback by changeset_apply().
173234 */
173235 SQLITE_API int SQLITE_STDCALL sqlite3changeset_next(sqlite3_changeset_iter *p){
173236 return sessionChangesetNext(p, 0, 0);
173237 }
173238
173239 /*
173240 ** The following function extracts information on the current change
173241 ** from a changeset iterator. It may only be called after changeset_next()
173242 ** has returned SQLITE_ROW.
173243 */
173244 SQLITE_API int SQLITE_STDCALL sqlite3changeset_op(
173245 sqlite3_changeset_iter *pIter, /* Iterator handle */
173246 const char **pzTab, /* OUT: Pointer to table name */
173247 int *pnCol, /* OUT: Number of columns in table */
173248 int *pOp, /* OUT: SQLITE_INSERT, DELETE or UPDATE */
173249 int *pbIndirect /* OUT: True if change is indirect */
@@ -173205,11 +173259,11 @@
173259 ** Return information regarding the PRIMARY KEY and number of columns in
173260 ** the database table affected by the change that pIter currently points
173261 ** to. This function may only be called after changeset_next() returns
173262 ** SQLITE_ROW.
173263 */
173264 SQLITE_API int SQLITE_STDCALL sqlite3changeset_pk(
173265 sqlite3_changeset_iter *pIter, /* Iterator object */
173266 unsigned char **pabPK, /* OUT: Array of boolean - true for PK cols */
173267 int *pnCol /* OUT: Number of entries in output array */
173268 ){
173269 *pabPK = pIter->abPK;
@@ -173228,11 +173282,11 @@
173282 ** was not modified and is not a PK column), set *ppValue to NULL.
173283 **
173284 ** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is
173285 ** not modified. Otherwise, SQLITE_OK.
173286 */
173287 SQLITE_API int SQLITE_STDCALL sqlite3changeset_old(
173288 sqlite3_changeset_iter *pIter, /* Changeset iterator */
173289 int iVal, /* Index of old.* value to retrieve */
173290 sqlite3_value **ppValue /* OUT: Old value (or NULL pointer) */
173291 ){
173292 if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_DELETE ){
@@ -173256,11 +173310,11 @@
173310 ** was not modified), set *ppValue to NULL.
173311 **
173312 ** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is
173313 ** not modified. Otherwise, SQLITE_OK.
173314 */
173315 SQLITE_API int SQLITE_STDCALL sqlite3changeset_new(
173316 sqlite3_changeset_iter *pIter, /* Changeset iterator */
173317 int iVal, /* Index of new.* value to retrieve */
173318 sqlite3_value **ppValue /* OUT: New value (or NULL pointer) */
173319 ){
173320 if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_INSERT ){
@@ -173290,11 +173344,11 @@
173344 ** containing the iVal'th value of the conflicting record.
173345 **
173346 ** If value iVal is out-of-range or some other error occurs, an SQLite error
173347 ** code is returned. Otherwise, SQLITE_OK.
173348 */
173349 SQLITE_API int SQLITE_STDCALL sqlite3changeset_conflict(
173350 sqlite3_changeset_iter *pIter, /* Changeset iterator */
173351 int iVal, /* Index of conflict record value to fetch */
173352 sqlite3_value **ppValue /* OUT: Value from conflicting row */
173353 ){
173354 if( !pIter->pConflict ){
@@ -173313,11 +173367,11 @@
173367 ** it sets the output variable to the total number of known foreign key
173368 ** violations in the destination database and returns SQLITE_OK.
173369 **
173370 ** In all other cases this function returns SQLITE_MISUSE.
173371 */
173372 SQLITE_API int SQLITE_STDCALL sqlite3changeset_fk_conflicts(
173373 sqlite3_changeset_iter *pIter, /* Changeset iterator */
173374 int *pnOut /* OUT: Number of FK violations */
173375 ){
173376 if( pIter->pConflict || pIter->apValue ){
173377 return SQLITE_MISUSE;
@@ -173331,11 +173385,11 @@
173385 ** Finalize an iterator allocated with sqlite3changeset_start().
173386 **
173387 ** This function may not be called on iterators passed to a conflict handler
173388 ** callback by changeset_apply().
173389 */
173390 SQLITE_API int SQLITE_STDCALL sqlite3changeset_finalize(sqlite3_changeset_iter *p){
173391 int rc = SQLITE_OK;
173392 if( p ){
173393 int i; /* Used to iterate through p->apValue[] */
173394 rc = p->rc;
173395 if( p->apValue ){
@@ -173505,11 +173559,11 @@
173559
173560
173561 /*
173562 ** Invert a changeset object.
173563 */
173564 SQLITE_API int SQLITE_STDCALL sqlite3changeset_invert(
173565 int nChangeset, /* Number of bytes in input */
173566 const void *pChangeset, /* Input changeset */
173567 int *pnInverted, /* OUT: Number of bytes in output changeset */
173568 void **ppInverted /* OUT: Inverse of pChangeset */
173569 ){
@@ -173524,11 +173578,11 @@
173578 }
173579
173580 /*
173581 ** Streaming version of sqlite3changeset_invert().
173582 */
173583 SQLITE_API int SQLITE_STDCALL sqlite3changeset_invert_strm(
173584 int (*xInput)(void *pIn, void *pData, int *pnData),
173585 void *pIn,
173586 int (*xOutput)(void *pOut, const void *pData, int nData),
173587 void *pOut
173588 ){
@@ -174404,11 +174458,11 @@
174458 /*
174459 ** Apply the changeset passed via pChangeset/nChangeset to the main database
174460 ** attached to handle "db". Invoke the supplied conflict handler callback
174461 ** to resolve any conflicts encountered while applying the change.
174462 */
174463 SQLITE_API int SQLITE_STDCALL sqlite3changeset_apply(
174464 sqlite3 *db, /* Apply change to "main" db of this handle */
174465 int nChangeset, /* Size of changeset in bytes */
174466 void *pChangeset, /* Changeset blob */
174467 int(*xFilter)(
174468 void *pCtx, /* Copy of sixth arg to _apply() */
@@ -174432,11 +174486,11 @@
174486 /*
174487 ** Apply the changeset passed via xInput/pIn to the main database
174488 ** attached to handle "db". Invoke the supplied conflict handler callback
174489 ** to resolve any conflicts encountered while applying the change.
174490 */
174491 SQLITE_API int SQLITE_STDCALL sqlite3changeset_apply_strm(
174492 sqlite3 *db, /* Apply change to "main" db of this handle */
174493 int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
174494 void *pIn, /* First arg for xInput */
174495 int(*xFilter)(
174496 void *pCtx, /* Copy of sixth arg to _apply() */
@@ -174767,11 +174821,11 @@
174821 }
174822
174823 /*
174824 ** Allocate a new, empty, sqlite3_changegroup.
174825 */
174826 SQLITE_API int SQLITE_STDCALL sqlite3changegroup_new(sqlite3_changegroup **pp){
174827 int rc = SQLITE_OK; /* Return code */
174828 sqlite3_changegroup *p; /* New object */
174829 p = (sqlite3_changegroup*)sqlite3_malloc(sizeof(sqlite3_changegroup));
174830 if( p==0 ){
174831 rc = SQLITE_NOMEM;
@@ -174784,11 +174838,11 @@
174838
174839 /*
174840 ** Add the changeset currently stored in buffer pData, size nData bytes,
174841 ** to changeset-group p.
174842 */
174843 SQLITE_API int SQLITE_STDCALL sqlite3changegroup_add(sqlite3_changegroup *pGrp, int nData, void *pData){
174844 sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */
174845 int rc; /* Return code */
174846
174847 rc = sqlite3changeset_start(&pIter, nData, pData);
174848 if( rc==SQLITE_OK ){
@@ -174800,11 +174854,11 @@
174854
174855 /*
174856 ** Obtain a buffer containing a changeset representing the concatenation
174857 ** of all changesets added to the group so far.
174858 */
174859 SQLITE_API int SQLITE_STDCALL sqlite3changegroup_output(
174860 sqlite3_changegroup *pGrp,
174861 int *pnData,
174862 void **ppData
174863 ){
174864 return sessionChangegroupOutput(pGrp, 0, 0, pnData, ppData);
@@ -174811,11 +174865,11 @@
174865 }
174866
174867 /*
174868 ** Streaming versions of changegroup_add().
174869 */
174870 SQLITE_API int SQLITE_STDCALL sqlite3changegroup_add_strm(
174871 sqlite3_changegroup *pGrp,
174872 int (*xInput)(void *pIn, void *pData, int *pnData),
174873 void *pIn
174874 ){
174875 sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */
@@ -174830,11 +174884,11 @@
174884 }
174885
174886 /*
174887 ** Streaming versions of changegroup_output().
174888 */
174889 SQLITE_API int SQLITE_STDCALL sqlite3changegroup_output_strm(
174890 sqlite3_changegroup *pGrp,
174891 int (*xOutput)(void *pOut, const void *pData, int nData),
174892 void *pOut
174893 ){
174894 return sessionChangegroupOutput(pGrp, xOutput, pOut, 0, 0);
@@ -174841,21 +174895,21 @@
174895 }
174896
174897 /*
174898 ** Delete a changegroup object.
174899 */
174900 SQLITE_API void SQLITE_STDCALL sqlite3changegroup_delete(sqlite3_changegroup *pGrp){
174901 if( pGrp ){
174902 sessionDeleteTable(pGrp->pList);
174903 sqlite3_free(pGrp);
174904 }
174905 }
174906
174907 /*
174908 ** Combine two changesets together.
174909 */
174910 SQLITE_API int SQLITE_STDCALL sqlite3changeset_concat(
174911 int nLeft, /* Number of bytes in lhs input */
174912 void *pLeft, /* Lhs input changeset */
174913 int nRight /* Number of bytes in rhs input */,
174914 void *pRight, /* Rhs input changeset */
174915 int *pnOut, /* OUT: Number of bytes in output changeset */
@@ -174880,11 +174934,11 @@
174934 }
174935
174936 /*
174937 ** Streaming version of sqlite3changeset_concat().
174938 */
174939 SQLITE_API int SQLITE_STDCALL sqlite3changeset_concat_strm(
174940 int (*xInputA)(void *pIn, void *pData, int *pnData),
174941 void *pInA,
174942 int (*xInputB)(void *pIn, void *pData, int *pnData),
174943 void *pInB,
174944 int (*xOutput)(void *pOut, const void *pData, int nData),
@@ -177112,11 +177166,11 @@
177166
177167 #ifndef SQLITE_CORE
177168 #ifdef _WIN32
177169 __declspec(dllexport)
177170 #endif
177171 SQLITE_API int SQLITE_STDCALL sqlite3_json_init(
177172 sqlite3 *db,
177173 char **pzErrMsg,
177174 const sqlite3_api_routines *pApi
177175 ){
177176 SQLITE_EXTENSION_INIT2(pApi);
@@ -177457,11 +177511,11 @@
177511 ** following structure. All structure methods must be defined, setting
177512 ** any member of the fts5_tokenizer struct to NULL leads to undefined
177513 ** behaviour. The structure methods are expected to function as follows:
177514 **
177515 ** xCreate:
177516 ** This function is used to allocate and initialize a tokenizer instance.
177517 ** A tokenizer instance is required to actually tokenize text.
177518 **
177519 ** The first argument passed to this function is a copy of the (void*)
177520 ** pointer provided by the application when the fts5_tokenizer object
177521 ** was registered with FTS5 (the third argument to xCreateTokenizer()).
@@ -177716,11 +177770,10 @@
177770 #if 0
177771 } /* end of the 'extern "C"' block */
177772 #endif
177773
177774 #endif /* _FTS5_H */
 
177775
177776 /*
177777 ** 2014 May 31
177778 **
177779 ** The author disclaims copyright to this source code. In place of
@@ -193945,11 +193998,11 @@
193998 int nArg, /* Number of args */
193999 sqlite3_value **apUnused /* Function arguments */
194000 ){
194001 assert( nArg==0 );
194002 UNUSED_PARAM2(nArg, apUnused);
194003 sqlite3_result_text(pCtx, "fts5: 2016-08-05 20:54:45 95578898835b933901603bd4d5e063f1219a016f", -1, SQLITE_TRANSIENT);
194004 }
194005
194006 static int fts5Init(sqlite3 *db){
194007 static const sqlite3_module fts5Mod = {
194008 /* iVersion */ 2,
@@ -194033,11 +194086,11 @@
194086 */
194087 #ifndef SQLITE_CORE
194088 #ifdef _WIN32
194089 __declspec(dllexport)
194090 #endif
194091 SQLITE_API int SQLITE_STDCALL sqlite3_fts_init(
194092 sqlite3 *db,
194093 char **pzErrMsg,
194094 const sqlite3_api_routines *pApi
194095 ){
194096 SQLITE_EXTENSION_INIT2(pApi);
@@ -194046,11 +194099,11 @@
194099 }
194100
194101 #ifdef _WIN32
194102 __declspec(dllexport)
194103 #endif
194104 SQLITE_API int SQLITE_STDCALL sqlite3_fts5_init(
194105 sqlite3 *db,
194106 char **pzErrMsg,
194107 const sqlite3_api_routines *pApi
194108 ){
194109 SQLITE_EXTENSION_INIT2(pApi);
194110
+462 -462
--- 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-08 13:40:27 d5e98057028abcf7217d0d2b2e29bbbcdf09d6de"
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
@@ -1957,11 +1957,11 @@
19571957
** interface independently of the [load_extension()] SQL function.
19581958
** The [sqlite3_enable_load_extension()] API enables or disables both the
19591959
** C-API [sqlite3_load_extension()] and the SQL function [load_extension()].
19601960
** There should be two additional arguments.
19611961
** When the first argument to this interface is 1, then only the C-API is
1962
-** enabled and the SQL function remains disabled. If the first argment to
1962
+** enabled and the SQL function remains disabled. If the first argument to
19631963
** this interface is 0, then both the C-API and the SQL function are disabled.
19641964
** If the first argument is -1, then no changes are made to state of either the
19651965
** C-API or the SQL function.
19661966
** The second parameter is a pointer to an integer into which
19671967
** is written 0 or 1 to indicate whether [sqlite3_load_extension()] interface
@@ -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
@@ -5534,11 +5535,11 @@
55345535
** interface returns SQLITE_OK and fills in the non-NULL pointers in
55355536
** the final five arguments with appropriate values if the specified
55365537
** column exists. ^The sqlite3_table_column_metadata() interface returns
55375538
** SQLITE_ERROR and if the specified column does not exist.
55385539
** ^If the column-name parameter to sqlite3_table_column_metadata() is a
5539
-** NULL pointer, then this routine simply checks for the existance of the
5540
+** NULL pointer, then this routine simply checks for the existence of the
55405541
** table and returns SQLITE_OK if the table exists and SQLITE_ERROR if it
55415542
** does not.
55425543
**
55435544
** ^The column is identified by the second, third and fourth parameters to
55445545
** this function. ^(The second parameter is either the name of the database
@@ -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
@@ -8129,11 +8130,11 @@
81298130
** tables.
81308131
**
81318132
** ^The second parameter to the preupdate callback is a pointer to
81328133
** the [database connection] that registered the preupdate hook.
81338134
** ^The third parameter to the preupdate callback is one of the constants
8134
-** [SQLITE_INSERT], [SQLITE_DELETE], or [SQLITE_UPDATE] to indentify the
8135
+** [SQLITE_INSERT], [SQLITE_DELETE], or [SQLITE_UPDATE] to identify the
81358136
** kind of update operation that is about to occur.
81368137
** ^(The fourth parameter to the preupdate callback is the name of the
81378138
** database within the database connection that is being modified. This
81388139
** will be "main" for the main database or "temp" for TEMP tables or
81398140
** the name given after the AS keyword in the [ATTACH] statement for attached
@@ -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
*************************************************************************/
@@ -10076,11 +10077,11 @@
1007610077
** following structure. All structure methods must be defined, setting
1007710078
** any member of the fts5_tokenizer struct to NULL leads to undefined
1007810079
** behaviour. The structure methods are expected to function as follows:
1007910080
**
1008010081
** xCreate:
10081
-** This function is used to allocate and inititalize a tokenizer instance.
10082
+** This function is used to allocate and initialize a tokenizer instance.
1008210083
** A tokenizer instance is required to actually tokenize text.
1008310084
**
1008410085
** The first argument passed to this function is a copy of the (void*)
1008510086
** pointer provided by the application when the fts5_tokenizer object
1008610087
** was registered with FTS5 (the third argument to xCreateTokenizer()).
@@ -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
@@ -10335,8 +10336,7 @@
1033510336
#ifdef __cplusplus
1033610337
} /* end of the 'extern "C"' block */
1033710338
#endif
1033810339
1033910340
#endif /* _FTS5_H */
10340
-
1034110341
1034210342
/******** End of fts5.h *********/
1034310343
--- 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
@@ -1957,11 +1957,11 @@
1957 ** interface independently of the [load_extension()] SQL function.
1958 ** The [sqlite3_enable_load_extension()] API enables or disables both the
1959 ** C-API [sqlite3_load_extension()] and the SQL function [load_extension()].
1960 ** There should be two additional arguments.
1961 ** When the first argument to this interface is 1, then only the C-API is
1962 ** enabled and the SQL function remains disabled. If the first argment to
1963 ** this interface is 0, then both the C-API and the SQL function are disabled.
1964 ** If the first argument is -1, then no changes are made to state of either the
1965 ** C-API or the SQL function.
1966 ** The second parameter is a pointer to an integer into which
1967 ** is written 0 or 1 to indicate whether [sqlite3_load_extension()] interface
@@ -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
@@ -5534,11 +5535,11 @@
5534 ** interface returns SQLITE_OK and fills in the non-NULL pointers in
5535 ** the final five arguments with appropriate values if the specified
5536 ** column exists. ^The sqlite3_table_column_metadata() interface returns
5537 ** SQLITE_ERROR and if the specified column does not exist.
5538 ** ^If the column-name parameter to sqlite3_table_column_metadata() is a
5539 ** NULL pointer, then this routine simply checks for the existance of the
5540 ** table and returns SQLITE_OK if the table exists and SQLITE_ERROR if it
5541 ** does not.
5542 **
5543 ** ^The column is identified by the second, third and fourth parameters to
5544 ** this function. ^(The second parameter is either the name of the database
@@ -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
@@ -8129,11 +8130,11 @@
8129 ** tables.
8130 **
8131 ** ^The second parameter to the preupdate callback is a pointer to
8132 ** the [database connection] that registered the preupdate hook.
8133 ** ^The third parameter to the preupdate callback is one of the constants
8134 ** [SQLITE_INSERT], [SQLITE_DELETE], or [SQLITE_UPDATE] to indentify the
8135 ** kind of update operation that is about to occur.
8136 ** ^(The fourth parameter to the preupdate callback is the name of the
8137 ** database within the database connection that is being modified. This
8138 ** will be "main" for the main database or "temp" for TEMP tables or
8139 ** the name given after the AS keyword in the [ATTACH] statement for attached
@@ -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 *************************************************************************/
@@ -10076,11 +10077,11 @@
10076 ** following structure. All structure methods must be defined, setting
10077 ** any member of the fts5_tokenizer struct to NULL leads to undefined
10078 ** behaviour. The structure methods are expected to function as follows:
10079 **
10080 ** xCreate:
10081 ** This function is used to allocate and inititalize a tokenizer instance.
10082 ** A tokenizer instance is required to actually tokenize text.
10083 **
10084 ** The first argument passed to this function is a copy of the (void*)
10085 ** pointer provided by the application when the fts5_tokenizer object
10086 ** was registered with FTS5 (the third argument to xCreateTokenizer()).
@@ -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
@@ -10335,8 +10336,7 @@
10335 #ifdef __cplusplus
10336 } /* end of the 'extern "C"' block */
10337 #endif
10338
10339 #endif /* _FTS5_H */
10340
10341
10342 /******** End of fts5.h *********/
10343
--- 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-08 13:40:27 d5e98057028abcf7217d0d2b2e29bbbcdf09d6de"
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
@@ -1957,11 +1957,11 @@
1957 ** interface independently of the [load_extension()] SQL function.
1958 ** The [sqlite3_enable_load_extension()] API enables or disables both the
1959 ** C-API [sqlite3_load_extension()] and the SQL function [load_extension()].
1960 ** There should be two additional arguments.
1961 ** When the first argument to this interface is 1, then only the C-API is
1962 ** enabled and the SQL function remains disabled. If the first argument to
1963 ** this interface is 0, then both the C-API and the SQL function are disabled.
1964 ** If the first argument is -1, then no changes are made to state of either the
1965 ** C-API or the SQL function.
1966 ** The second parameter is a pointer to an integer into which
1967 ** is written 0 or 1 to indicate whether [sqlite3_load_extension()] interface
@@ -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
@@ -5534,11 +5535,11 @@
5535 ** interface returns SQLITE_OK and fills in the non-NULL pointers in
5536 ** the final five arguments with appropriate values if the specified
5537 ** column exists. ^The sqlite3_table_column_metadata() interface returns
5538 ** SQLITE_ERROR and if the specified column does not exist.
5539 ** ^If the column-name parameter to sqlite3_table_column_metadata() is a
5540 ** NULL pointer, then this routine simply checks for the existence of the
5541 ** table and returns SQLITE_OK if the table exists and SQLITE_ERROR if it
5542 ** does not.
5543 **
5544 ** ^The column is identified by the second, third and fourth parameters to
5545 ** this function. ^(The second parameter is either the name of the database
@@ -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
@@ -8129,11 +8130,11 @@
8130 ** tables.
8131 **
8132 ** ^The second parameter to the preupdate callback is a pointer to
8133 ** the [database connection] that registered the preupdate hook.
8134 ** ^The third parameter to the preupdate callback is one of the constants
8135 ** [SQLITE_INSERT], [SQLITE_DELETE], or [SQLITE_UPDATE] to identify the
8136 ** kind of update operation that is about to occur.
8137 ** ^(The fourth parameter to the preupdate callback is the name of the
8138 ** database within the database connection that is being modified. This
8139 ** will be "main" for the main database or "temp" for TEMP tables or
8140 ** the name given after the AS keyword in the [ATTACH] statement for attached
@@ -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 *************************************************************************/
@@ -10076,11 +10077,11 @@
10077 ** following structure. All structure methods must be defined, setting
10078 ** any member of the fts5_tokenizer struct to NULL leads to undefined
10079 ** behaviour. The structure methods are expected to function as follows:
10080 **
10081 ** xCreate:
10082 ** This function is used to allocate and initialize a tokenizer instance.
10083 ** A tokenizer instance is required to actually tokenize text.
10084 **
10085 ** The first argument passed to this function is a copy of the (void*)
10086 ** pointer provided by the application when the fts5_tokenizer object
10087 ** was registered with FTS5 (the third argument to xCreateTokenizer()).
@@ -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
@@ -10335,8 +10336,7 @@
10336 #ifdef __cplusplus
10337 } /* end of the 'extern "C"' block */
10338 #endif
10339
10340 #endif /* _FTS5_H */
 
10341
10342 /******** End of fts5.h *********/
10343
+2 -2
--- src/sync.c
+++ src/sync.c
@@ -233,11 +233,11 @@
233233
** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol,
234234
** if required by the remote website
235235
** --ipv4 Use only IPv4, not IPv6
236236
** --once Do not remember URL for subsequent syncs
237237
** --proxy PROXY Use the specified HTTP proxy
238
-** --private Pull private branches too
238
+** --private Push private branches too
239239
** -R|--repository REPO Repository to pull into
240240
** --ssl-identity FILE Local SSL credentials, if requested by remote
241241
** --ssh-command SSH Use SSH as the "ssh" command
242242
** -v|--verbose Additional (debugging) output
243243
** --verily Exchange extra information with the remote
@@ -278,11 +278,11 @@
278278
** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol,
279279
** if required by the remote website
280280
** --ipv4 Use only IPv4, not IPv6
281281
** --once Do not remember URL for subsequent syncs
282282
** --proxy PROXY Use the specified HTTP proxy
283
-** --private Pull private branches too
283
+** --private Sync private branches too
284284
** -R|--repository REPO Repository to pull into
285285
** --ssl-identity FILE Local SSL credentials, if requested by remote
286286
** --ssh-command SSH Use SSH as the "ssh" command
287287
** -v|--verbose Additional (debugging) output
288288
** --verily Exchange extra information with the remote
289289
290290
ADDED www/aboutcgi.wiki
--- src/sync.c
+++ src/sync.c
@@ -233,11 +233,11 @@
233 ** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol,
234 ** if required by the remote website
235 ** --ipv4 Use only IPv4, not IPv6
236 ** --once Do not remember URL for subsequent syncs
237 ** --proxy PROXY Use the specified HTTP proxy
238 ** --private Pull private branches too
239 ** -R|--repository REPO Repository to pull into
240 ** --ssl-identity FILE Local SSL credentials, if requested by remote
241 ** --ssh-command SSH Use SSH as the "ssh" command
242 ** -v|--verbose Additional (debugging) output
243 ** --verily Exchange extra information with the remote
@@ -278,11 +278,11 @@
278 ** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol,
279 ** if required by the remote website
280 ** --ipv4 Use only IPv4, not IPv6
281 ** --once Do not remember URL for subsequent syncs
282 ** --proxy PROXY Use the specified HTTP proxy
283 ** --private Pull private branches too
284 ** -R|--repository REPO Repository to pull into
285 ** --ssl-identity FILE Local SSL credentials, if requested by remote
286 ** --ssh-command SSH Use SSH as the "ssh" command
287 ** -v|--verbose Additional (debugging) output
288 ** --verily Exchange extra information with the remote
289
290 DDED www/aboutcgi.wiki
--- src/sync.c
+++ src/sync.c
@@ -233,11 +233,11 @@
233 ** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol,
234 ** if required by the remote website
235 ** --ipv4 Use only IPv4, not IPv6
236 ** --once Do not remember URL for subsequent syncs
237 ** --proxy PROXY Use the specified HTTP proxy
238 ** --private Push private branches too
239 ** -R|--repository REPO Repository to pull into
240 ** --ssl-identity FILE Local SSL credentials, if requested by remote
241 ** --ssh-command SSH Use SSH as the "ssh" command
242 ** -v|--verbose Additional (debugging) output
243 ** --verily Exchange extra information with the remote
@@ -278,11 +278,11 @@
278 ** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol,
279 ** if required by the remote website
280 ** --ipv4 Use only IPv4, not IPv6
281 ** --once Do not remember URL for subsequent syncs
282 ** --proxy PROXY Use the specified HTTP proxy
283 ** --private Sync private branches too
284 ** -R|--repository REPO Repository to pull into
285 ** --ssl-identity FILE Local SSL credentials, if requested by remote
286 ** --ssh-command SSH Use SSH as the "ssh" command
287 ** -v|--verbose Additional (debugging) output
288 ** --verily Exchange extra information with the remote
289
290 DDED www/aboutcgi.wiki
--- a/www/aboutcgi.wiki
+++ b/www/aboutcgi.wiki
@@ -0,0 +1,125 @@
1
+<title>How C<h2>Introduction</h2><blockquote>le>
2
+
3
+<h2>Introduction</h2>
4
+
5
+<p>CGI or "Common Gateway Interface" is a venerable yet reliable technique for
6
+generating dynamic web content. This article gives a quick background on how
7
+CGI works and describes how Fossil can act as a CGI service.
8
+<p>This is a "how it works" guide. If you just want to set up Fossil
9
+as a CGI server, see the [./server.wiki | Fossil Server Setup] page.eview Of CGI</h2>
10
+
11
+An HTTP<blockquote R<p>request is a block of text that is sent by a client application
12
+(usually a web browser) and arrives at the web server over a network
13
+connection. The HTTP request contains a URL that describes the information
14
+being requested. The URL in the HTTP request is typically the same URL
15
+that appears in the URL bar at the top of the web bra "?" character followed by
16
+query parameters. The HTTP will usually also contain other information
17
+such as the name of the application that made the request, whether or
18
+not the requesting application can accept a compressed reply, POST
19
+parameters from forms, and so fexver is to interpret the HTTP request and<p>erpret the HTTP request and formulate
20
+an appropriate reply.
21
+The web server is free to interpret the_HTTP .
22
+Buest in any way it_HTTP request in any way it wants,
23
+but most web servers fwww.fossil-scm.org/fossile: details may vary from one web server to another.)
24
+
25
+Suppose <p>he URL in the HTTP request looks lURL inppropriate reply.
26
+search tb></blockquote> servers will search their content area for files that match
27
+some prefix of the URL. The search starts with <b>/one</b>, then goes to
28
+<b>/one/two</b>, then <b>/one/two/timeline</b>, and finally
29
+<b>/one/two/timeline/f
30
+at describchecked. The search stops at the first
31
+match.
32
+
33
+Suppose the first match is <b>/one/<p>two</b>. If <b>/one/two</b> is an
34
+ordinary file in the content area, then that file is returned as static
35
+content. The "<b>/timeline/four</b>" suffix is silently ignored.
36
+
37
+If <b>/one/two</b> is a CGI script <p>
38
+e/two</b> is an
39
+ordinar<title>How C<h2>Introduction</h2><blockquote>le>
40
+
41
+<h2>Introduction</h2>
42
+
43
+CGI or "Common Gateway Interface" is a venerable yet reliable tech2>It application
44
+(usually a web browser) and arrives at the web server over a network
45
+connection. The HTTP request contains a URL that describes the information
46
+being requested. The URL in the HTTP request is typically the same URL
47
+that appears in the URL bar at the top of the web bra "?" character followed by
48
+query parameters. The HTTP will usually also contain other information
49
+such as the name of the application that made the request, whether or
50
+not the requesting application can accept a compressed reply, POS uested. The URL in the HTTP request is typically the same URL
51
+that appears in the URL bar at the top of the web bra "?" character followed by
52
+query parameters. The HTTP will usually also contain other information
53
+such as the name of the application that made the request, whether or
54
+not the requesting application can accept a compressed forms, and so fexver is to interpret the HTTP request and<p>erpret the HTTP request and formulate
55
+an appropriate reply.
56
+The web server is free to interpret the_HTTP .
57
+Buest in any way it_HTTP request in any way it wants,
58
+but most web servers fwww.fossil-scm.org/fossile: details may vary from one web server to another.)
59
+
60
+Suppose <p>he URL in the HTTP request looks lURL inppropriate reply.
61
+search tb></blockquote> servers will search their content area for files that m r "Common Gateway Interface" is a venerable yet reliable technique for
62
+generating dynamic web content. This article gives a quick background on how
63
+CGI works and describes how Fossil can act as a CGI service.
64
+<p>This is a "how it works" guide. If you just want to set up Fo<<b>/one/<p>two</b>. If <b>/one/two</b> is an
65
+ordinary file in the content area, then that file is returned as static
66
+content. The "<b>/timeline/four</b>" suffix is silently ignored.
67
+
68
+If <b>/one/two</b> is a CGI script <p>
69
+e/two</b> is an
70
+ordinar<title>How C<h2>Introduction</h2><blockquote>le>
71
+
72
+<h2>Introduction</h2>
73
+
74
+CGI or "Common Gateway Interface" is a venerable yet reliable tech2>It application
75
+(usually a web browser) and arrives at the web server over a network
76
+connection. The HTTP request contains a URL that describes the information
77
+being requested. The URL in the HTTP request is typically the same URL
78
+that appears in the URL bar at the top of the web bra "?" character followed by
79
+query parameters. The HTTP will usually also contain other information
80
+such as the name of the application that made the request, whether or
81
+not the requesting application can accept a compressed reply, POST
82
+parameters from forms, and so forth.
83
+
84
+The job of the web server is to interpret the so fexver is to interpret the HTTP request arpret the HTTP request and formulate
85
+an appropriate reply.
86
+The web server is free to interpret the_HTTP .
87
+Buest in any way it_HTTP request in any way it wants,
88
+but most web servers fwww.fossil-scm.org/fossile: details may vary from one web server to another.)
89
+
90
+Suppose <p>he URL in the HTTP request looks lURL inppropriate reply.
91
+search tb></blockquote> servers will search their content area for files that match
92
+some prefix of the URL. The search starts with <b>/one</b>, then goes to
93
+<b>/one/two</b>, then <br>/one/two/timeline</b>, and finally
94
+<b>/one/two/timeline/four</b> is checked. The search stops at the first
95
+match.
96
+
97
+Suppose the first match is <b>/one/<p>two</b>. If <b>/one/two</b> is an
98
+ordinary file in the content area, then that file is returned as static
99
+content. The "<b>/timeline/four</b>" suffix is silently ignored.
100
+
101
+If <b>/one/two</b> is a CGI script <p>
102
+e/two</b> is an
103
+ordinar<title>How C<h2>Introduction</h2><blockquote>le>
104
+
105
+<h2>Introduction</h2>
106
+
107
+CGI or "Common Gateway Interface" is a venerable yet reliable tech2>It application
108
+(usually a web browser) and arrives at the web server over a network
109
+connection. The HTTP request contains a URL that describes the information
110
+being requested. The URL in the HTTP request is typically the same URL
111
+that appears in the URL bar at the top of the web bra "?" character followed by
112
+query parameters. The HTTP will usually also contain other information
113
+such as the name of the application that made the reques t, whether or
114
+not the requesting application can accept a compressed reply, POST
115
+parameters from forms, and so forth.
116
+
117
+The job of the web server is to interpret the HTTP request andwww.fossil-scm.org/fossil
118
+Many Fossil servers implementwww.fossil-scm.org/fossil/three?abc=xyz|test-env]
119
+webpage that shows some of the CGI environment
120
+variables that Fossil pays attention to.
121
+
122
+In addition to setting various CGI environment variables, if the HTTP
123
+request conta<p>, if the HTTP
124
+request contains POST content, then the web server relays the POST content
125
+to standard input of the CGI s
--- a/www/aboutcgi.wiki
+++ b/www/aboutcgi.wiki
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/www/aboutcgi.wiki
+++ b/www/aboutcgi.wiki
@@ -0,0 +1,125 @@
1 <title>How C<h2>Introduction</h2><blockquote>le>
2
3 <h2>Introduction</h2>
4
5 <p>CGI or "Common Gateway Interface" is a venerable yet reliable technique for
6 generating dynamic web content. This article gives a quick background on how
7 CGI works and describes how Fossil can act as a CGI service.
8 <p>This is a "how it works" guide. If you just want to set up Fossil
9 as a CGI server, see the [./server.wiki | Fossil Server Setup] page.eview Of CGI</h2>
10
11 An HTTP<blockquote R<p>request is a block of text that is sent by a client application
12 (usually a web browser) and arrives at the web server over a network
13 connection. The HTTP request contains a URL that describes the information
14 being requested. The URL in the HTTP request is typically the same URL
15 that appears in the URL bar at the top of the web bra "?" character followed by
16 query parameters. The HTTP will usually also contain other information
17 such as the name of the application that made the request, whether or
18 not the requesting application can accept a compressed reply, POST
19 parameters from forms, and so fexver is to interpret the HTTP request and<p>erpret the HTTP request and formulate
20 an appropriate reply.
21 The web server is free to interpret the_HTTP .
22 Buest in any way it_HTTP request in any way it wants,
23 but most web servers fwww.fossil-scm.org/fossile: details may vary from one web server to another.)
24
25 Suppose <p>he URL in the HTTP request looks lURL inppropriate reply.
26 search tb></blockquote> servers will search their content area for files that match
27 some prefix of the URL. The search starts with <b>/one</b>, then goes to
28 <b>/one/two</b>, then <b>/one/two/timeline</b>, and finally
29 <b>/one/two/timeline/f
30 at describchecked. The search stops at the first
31 match.
32
33 Suppose the first match is <b>/one/<p>two</b>. If <b>/one/two</b> is an
34 ordinary file in the content area, then that file is returned as static
35 content. The "<b>/timeline/four</b>" suffix is silently ignored.
36
37 If <b>/one/two</b> is a CGI script <p>
38 e/two</b> is an
39 ordinar<title>How C<h2>Introduction</h2><blockquote>le>
40
41 <h2>Introduction</h2>
42
43 CGI or "Common Gateway Interface" is a venerable yet reliable tech2>It application
44 (usually a web browser) and arrives at the web server over a network
45 connection. The HTTP request contains a URL that describes the information
46 being requested. The URL in the HTTP request is typically the same URL
47 that appears in the URL bar at the top of the web bra "?" character followed by
48 query parameters. The HTTP will usually also contain other information
49 such as the name of the application that made the request, whether or
50 not the requesting application can accept a compressed reply, POS uested. The URL in the HTTP request is typically the same URL
51 that appears in the URL bar at the top of the web bra "?" character followed by
52 query parameters. The HTTP will usually also contain other information
53 such as the name of the application that made the request, whether or
54 not the requesting application can accept a compressed forms, and so fexver is to interpret the HTTP request and<p>erpret the HTTP request and formulate
55 an appropriate reply.
56 The web server is free to interpret the_HTTP .
57 Buest in any way it_HTTP request in any way it wants,
58 but most web servers fwww.fossil-scm.org/fossile: details may vary from one web server to another.)
59
60 Suppose <p>he URL in the HTTP request looks lURL inppropriate reply.
61 search tb></blockquote> servers will search their content area for files that m r "Common Gateway Interface" is a venerable yet reliable technique for
62 generating dynamic web content. This article gives a quick background on how
63 CGI works and describes how Fossil can act as a CGI service.
64 <p>This is a "how it works" guide. If you just want to set up Fo<<b>/one/<p>two</b>. If <b>/one/two</b> is an
65 ordinary file in the content area, then that file is returned as static
66 content. The "<b>/timeline/four</b>" suffix is silently ignored.
67
68 If <b>/one/two</b> is a CGI script <p>
69 e/two</b> is an
70 ordinar<title>How C<h2>Introduction</h2><blockquote>le>
71
72 <h2>Introduction</h2>
73
74 CGI or "Common Gateway Interface" is a venerable yet reliable tech2>It application
75 (usually a web browser) and arrives at the web server over a network
76 connection. The HTTP request contains a URL that describes the information
77 being requested. The URL in the HTTP request is typically the same URL
78 that appears in the URL bar at the top of the web bra "?" character followed by
79 query parameters. The HTTP will usually also contain other information
80 such as the name of the application that made the request, whether or
81 not the requesting application can accept a compressed reply, POST
82 parameters from forms, and so forth.
83
84 The job of the web server is to interpret the so fexver is to interpret the HTTP request arpret the HTTP request and formulate
85 an appropriate reply.
86 The web server is free to interpret the_HTTP .
87 Buest in any way it_HTTP request in any way it wants,
88 but most web servers fwww.fossil-scm.org/fossile: details may vary from one web server to another.)
89
90 Suppose <p>he URL in the HTTP request looks lURL inppropriate reply.
91 search tb></blockquote> servers will search their content area for files that match
92 some prefix of the URL. The search starts with <b>/one</b>, then goes to
93 <b>/one/two</b>, then <br>/one/two/timeline</b>, and finally
94 <b>/one/two/timeline/four</b> is checked. The search stops at the first
95 match.
96
97 Suppose the first match is <b>/one/<p>two</b>. If <b>/one/two</b> is an
98 ordinary file in the content area, then that file is returned as static
99 content. The "<b>/timeline/four</b>" suffix is silently ignored.
100
101 If <b>/one/two</b> is a CGI script <p>
102 e/two</b> is an
103 ordinar<title>How C<h2>Introduction</h2><blockquote>le>
104
105 <h2>Introduction</h2>
106
107 CGI or "Common Gateway Interface" is a venerable yet reliable tech2>It application
108 (usually a web browser) and arrives at the web server over a network
109 connection. The HTTP request contains a URL that describes the information
110 being requested. The URL in the HTTP request is typically the same URL
111 that appears in the URL bar at the top of the web bra "?" character followed by
112 query parameters. The HTTP will usually also contain other information
113 such as the name of the application that made the reques t, whether or
114 not the requesting application can accept a compressed reply, POST
115 parameters from forms, and so forth.
116
117 The job of the web server is to interpret the HTTP request andwww.fossil-scm.org/fossil
118 Many Fossil servers implementwww.fossil-scm.org/fossil/three?abc=xyz|test-env]
119 webpage that shows some of the CGI environment
120 variables that Fossil pays attention to.
121
122 In addition to setting various CGI environment variables, if the HTTP
123 request conta<p>, if the HTTP
124 request contains POST content, then the web server relays the POST content
125 to standard input of the CGI s
--- www/mkindex.tcl
+++ www/mkindex.tcl
@@ -5,10 +5,11 @@
55
#
66
# tclsh mkindex.tcl
77
#
88
99
set doclist {
10
+ aboutcgi.wiki {How CGI Works In Fossil}
1011
adding_code.wiki {Adding New Features To Fossil}
1112
adding_code.wiki {Hacking Fossil}
1213
antibot.wiki {Defense against Spiders and Bots}
1314
blame.wiki {The Annotate/Blame Algorithm Of Fossil}
1415
branching.wiki {Branching, Forking, Merging, and Tagging}
1516
--- www/mkindex.tcl
+++ www/mkindex.tcl
@@ -5,10 +5,11 @@
5 #
6 # tclsh mkindex.tcl
7 #
8
9 set doclist {
 
10 adding_code.wiki {Adding New Features To Fossil}
11 adding_code.wiki {Hacking Fossil}
12 antibot.wiki {Defense against Spiders and Bots}
13 blame.wiki {The Annotate/Blame Algorithm Of Fossil}
14 branching.wiki {Branching, Forking, Merging, and Tagging}
15
--- www/mkindex.tcl
+++ www/mkindex.tcl
@@ -5,10 +5,11 @@
5 #
6 # tclsh mkindex.tcl
7 #
8
9 set doclist {
10 aboutcgi.wiki {How CGI Works In Fossil}
11 adding_code.wiki {Adding New Features To Fossil}
12 adding_code.wiki {Hacking Fossil}
13 antibot.wiki {Defense against Spiders and Bots}
14 blame.wiki {The Annotate/Blame Algorithm Of Fossil}
15 branching.wiki {Branching, Forking, Merging, and Tagging}
16
--- www/permutedindex.html
+++ www/permutedindex.html
@@ -35,10 +35,11 @@
3535
<li><a href="antibot.wiki">Bots &mdash; Defense against Spiders and</a></li>
3636
<li><a href="private.wiki">Branches &mdash; Creating, Syncing, and Deleting Private</a></li>
3737
<li><a href="branching.wiki">Branching, Forking, Merging, and Tagging</a></li>
3838
<li><a href="bugtheory.wiki">Bug Tracking In Fossil</a></li>
3939
<li><a href="makefile.wiki">Build Process &mdash; The Fossil</a></li>
40
+<li><a href="aboutcgi.wiki">CGI Works In Fossil &mdash; How</a></li>
4041
<li><a href="changes.wiki">Changelog &mdash; Fossil</a></li>
4142
<li><a href="checkin_names.wiki">Check-in And Version Names</a></li>
4243
<li><a href="checkin.wiki">Check-in Checklist</a></li>
4344
<li><a href="checkin.wiki">Checklist &mdash; Check-in</a></li>
4445
<li><a href="../test/release-checklist.wiki">Checklist &mdash; Pre-Release Testing</a></li>
@@ -110,10 +111,11 @@
110111
<li><a href="hacker-howto.wiki">Hacker How-To</a></li>
111112
<li><a href="adding_code.wiki">Hacking Fossil</a></li>
112113
<li><a href="hints.wiki">Hints &mdash; Fossil Tips And Usage</a></li>
113114
<li><a href="index.wiki">Home Page</a></li>
114115
<li><a href="selfhost.wiki">Hosting Repositories &mdash; Fossil Self</a></li>
116
+<li><a href="aboutcgi.wiki">How CGI Works In Fossil</a></li>
115117
<li><a href="server.wiki">How To Configure A Fossil Server</a></li>
116118
<li><a href="newrepo.wiki">How To Create A New Fossil Repository</a></li>
117119
<li><a href="encryptedrepos.wiki">How To Use Encrypted Repositories</a></li>
118120
<li><a href="hacker-howto.wiki">How-To &mdash; Hacker</a></li>
119121
<li><a href="fossil-from-msvc.wiki">IDE &mdash; Integrating Fossil in the Microsoft Express 2010</a></li>
@@ -209,6 +211,7 @@
209211
<li><a href="customskin.md">Web Pages &mdash; Theming: Customizing The Appearance of</a></li>
210212
<li><a href="webpage-ex.md">Webpage Examples</a></li>
211213
<li><a href="quotes.wiki">What People Are Saying About Fossil, Git, and DVCSes in General &mdash; Quotes:</a></li>
212214
<li><a href="wikitheory.wiki">Wiki In Fossil</a></li>
213215
<li><a href="ssl.wiki">with Fossil &mdash; Using SSL</a></li>
216
+<li><a href="aboutcgi.wiki">Works In Fossil &mdash; How CGI</a></li>
214217
</ul></div>
215218
--- www/permutedindex.html
+++ www/permutedindex.html
@@ -35,10 +35,11 @@
35 <li><a href="antibot.wiki">Bots &mdash; Defense against Spiders and</a></li>
36 <li><a href="private.wiki">Branches &mdash; Creating, Syncing, and Deleting Private</a></li>
37 <li><a href="branching.wiki">Branching, Forking, Merging, and Tagging</a></li>
38 <li><a href="bugtheory.wiki">Bug Tracking In Fossil</a></li>
39 <li><a href="makefile.wiki">Build Process &mdash; The Fossil</a></li>
 
40 <li><a href="changes.wiki">Changelog &mdash; Fossil</a></li>
41 <li><a href="checkin_names.wiki">Check-in And Version Names</a></li>
42 <li><a href="checkin.wiki">Check-in Checklist</a></li>
43 <li><a href="checkin.wiki">Checklist &mdash; Check-in</a></li>
44 <li><a href="../test/release-checklist.wiki">Checklist &mdash; Pre-Release Testing</a></li>
@@ -110,10 +111,11 @@
110 <li><a href="hacker-howto.wiki">Hacker How-To</a></li>
111 <li><a href="adding_code.wiki">Hacking Fossil</a></li>
112 <li><a href="hints.wiki">Hints &mdash; Fossil Tips And Usage</a></li>
113 <li><a href="index.wiki">Home Page</a></li>
114 <li><a href="selfhost.wiki">Hosting Repositories &mdash; Fossil Self</a></li>
 
115 <li><a href="server.wiki">How To Configure A Fossil Server</a></li>
116 <li><a href="newrepo.wiki">How To Create A New Fossil Repository</a></li>
117 <li><a href="encryptedrepos.wiki">How To Use Encrypted Repositories</a></li>
118 <li><a href="hacker-howto.wiki">How-To &mdash; Hacker</a></li>
119 <li><a href="fossil-from-msvc.wiki">IDE &mdash; Integrating Fossil in the Microsoft Express 2010</a></li>
@@ -209,6 +211,7 @@
209 <li><a href="customskin.md">Web Pages &mdash; Theming: Customizing The Appearance of</a></li>
210 <li><a href="webpage-ex.md">Webpage Examples</a></li>
211 <li><a href="quotes.wiki">What People Are Saying About Fossil, Git, and DVCSes in General &mdash; Quotes:</a></li>
212 <li><a href="wikitheory.wiki">Wiki In Fossil</a></li>
213 <li><a href="ssl.wiki">with Fossil &mdash; Using SSL</a></li>
 
214 </ul></div>
215
--- www/permutedindex.html
+++ www/permutedindex.html
@@ -35,10 +35,11 @@
35 <li><a href="antibot.wiki">Bots &mdash; Defense against Spiders and</a></li>
36 <li><a href="private.wiki">Branches &mdash; Creating, Syncing, and Deleting Private</a></li>
37 <li><a href="branching.wiki">Branching, Forking, Merging, and Tagging</a></li>
38 <li><a href="bugtheory.wiki">Bug Tracking In Fossil</a></li>
39 <li><a href="makefile.wiki">Build Process &mdash; The Fossil</a></li>
40 <li><a href="aboutcgi.wiki">CGI Works In Fossil &mdash; How</a></li>
41 <li><a href="changes.wiki">Changelog &mdash; Fossil</a></li>
42 <li><a href="checkin_names.wiki">Check-in And Version Names</a></li>
43 <li><a href="checkin.wiki">Check-in Checklist</a></li>
44 <li><a href="checkin.wiki">Checklist &mdash; Check-in</a></li>
45 <li><a href="../test/release-checklist.wiki">Checklist &mdash; Pre-Release Testing</a></li>
@@ -110,10 +111,11 @@
111 <li><a href="hacker-howto.wiki">Hacker How-To</a></li>
112 <li><a href="adding_code.wiki">Hacking Fossil</a></li>
113 <li><a href="hints.wiki">Hints &mdash; Fossil Tips And Usage</a></li>
114 <li><a href="index.wiki">Home Page</a></li>
115 <li><a href="selfhost.wiki">Hosting Repositories &mdash; Fossil Self</a></li>
116 <li><a href="aboutcgi.wiki">How CGI Works In Fossil</a></li>
117 <li><a href="server.wiki">How To Configure A Fossil Server</a></li>
118 <li><a href="newrepo.wiki">How To Create A New Fossil Repository</a></li>
119 <li><a href="encryptedrepos.wiki">How To Use Encrypted Repositories</a></li>
120 <li><a href="hacker-howto.wiki">How-To &mdash; Hacker</a></li>
121 <li><a href="fossil-from-msvc.wiki">IDE &mdash; Integrating Fossil in the Microsoft Express 2010</a></li>
@@ -209,6 +211,7 @@
211 <li><a href="customskin.md">Web Pages &mdash; Theming: Customizing The Appearance of</a></li>
212 <li><a href="webpage-ex.md">Webpage Examples</a></li>
213 <li><a href="quotes.wiki">What People Are Saying About Fossil, Git, and DVCSes in General &mdash; Quotes:</a></li>
214 <li><a href="wikitheory.wiki">Wiki In Fossil</a></li>
215 <li><a href="ssl.wiki">with Fossil &mdash; Using SSL</a></li>
216 <li><a href="aboutcgi.wiki">Works In Fossil &mdash; How CGI</a></li>
217 </ul></div>
218
+6 -1
--- www/server.wiki
+++ www/server.wiki
@@ -5,11 +5,16 @@
55
For example, the complete [https://www.fossil-scm.org/] website, including the
66
page you are now reading (but excepting the
77
[https://www.fossil-scm.org/download.html|download page]),
88
is just a Fossil server displaying the content of the
99
self-hosting repository for Fossil.</p>
10
-<p>This article is a guide for setting up your own Fossil server.</p></blockquote>
10
+<p>This article is a guide for setting up your own Fossil server.
11
+<p>See "[./aboutcgi.wiki|How CGI Works In Fossil]" for background
12
+information on the underlying CGI technology.
13
+See "[./sync.wiki|The Fossil Sync Protocol]" for information on the
14
+wire protocol used for client/server communication.</p>
15
+</blockquote>
1116
<h2>Overview</h2><blockquote>
1217
There are basically four ways to set up a Fossil server:
1318
<ol>
1419
<li>A stand-alone server
1520
<li>Using inetd or xinetd or stunnel
1621
--- www/server.wiki
+++ www/server.wiki
@@ -5,11 +5,16 @@
5 For example, the complete [https://www.fossil-scm.org/] website, including the
6 page you are now reading (but excepting the
7 [https://www.fossil-scm.org/download.html|download page]),
8 is just a Fossil server displaying the content of the
9 self-hosting repository for Fossil.</p>
10 <p>This article is a guide for setting up your own Fossil server.</p></blockquote>
 
 
 
 
 
11 <h2>Overview</h2><blockquote>
12 There are basically four ways to set up a Fossil server:
13 <ol>
14 <li>A stand-alone server
15 <li>Using inetd or xinetd or stunnel
16
--- www/server.wiki
+++ www/server.wiki
@@ -5,11 +5,16 @@
5 For example, the complete [https://www.fossil-scm.org/] website, including the
6 page you are now reading (but excepting the
7 [https://www.fossil-scm.org/download.html|download page]),
8 is just a Fossil server displaying the content of the
9 self-hosting repository for Fossil.</p>
10 <p>This article is a guide for setting up your own Fossil server.
11 <p>See "[./aboutcgi.wiki|How CGI Works In Fossil]" for background
12 information on the underlying CGI technology.
13 See "[./sync.wiki|The Fossil Sync Protocol]" for information on the
14 wire protocol used for client/server communication.</p>
15 </blockquote>
16 <h2>Overview</h2><blockquote>
17 There are basically four ways to set up a Fossil server:
18 <ol>
19 <li>A stand-alone server
20 <li>Using inetd or xinetd or stunnel
21
+96 -27
--- www/sync.wiki
+++ www/sync.wiki
@@ -1,20 +1,16 @@
11
<title>The Fossil Sync Protocol</title>
22
3
-<p>Fossil supports commands <b>push</b>, <b>pull</b>, and <b>sync</b>
4
-for transferring information from one repository to another. The
5
-command is run on the client repository. A URL for the server repository
6
-is specified as part of the command. This document describes what happens
7
-behind the scenes in order to synchronize the information on the two
8
-repositories.</p>
3
+<p>This document describes the wire protocol used to synchronize
4
+content between two Fossil repositories.</p>
95
106
<h2>1.0 Overview</h2>
117
128
<p>The global state of a fossil repository consists of an unordered
139
collection of artifacts. Each artifact is identified by its SHA1 hash
1410
expressed as a 40-character lower-case hexadecimal string.
15
-Synchronization is simply the process of sharing artifacts between
11
+Synchronization is the process of sharing artifacts between
1612
servers so that all servers have copies of all artifacts. Because
1713
artifacts are unordered, the order in which artifacts are received
1814
at a server is inconsequential. It is assumed that the SHA1 hashes
1915
of artifacts are unique - that every artifact has a different SHA1 hash.
2016
To a first approximation, synchronization proceeds by sharing lists
@@ -26,15 +22,16 @@
2622
shared to a few hundred.</p>
2723
2824
<p>Each repository also has local state. The local state determines
2925
the web-page formatting preferences, authorized users, ticket formats,
3026
and similar information that varies from one repository to another.
31
-The local state is not transferred by the <b>push</b>, <b>pull</b>,
32
-and <b>sync</b> command, though some local state is transferred during
33
-a <b>clone</b> in order to initialize the local state of the new
34
-repository. The <b>configuration push</b> and <b>configuration pull</b>
35
-commands can be used to send or receive local state.</p>
27
+The local state is not using transferred during a sync. Except,
28
+some local state is transferred during a [/help?cmd=clone|clone]
29
+in order to initialize the local state of the new repository. And
30
+the [/help?cmd=configuration|config push] and
31
+[/help?cmd=configuration|config pull]
32
+commands can be an administrator to sync local state.</p>
3633
3734
3835
<h2>2.0 Transport</h2>
3936
4037
<p>All communication between client and server is via HTTP requests.
@@ -43,20 +40,31 @@
4340
request.</p>
4441
4542
<p>The server might be running as an independent server
4643
using the <b>server</b> command, or it might be launched from
4744
inetd or xinetd using the <b>http</b> command. Or the server might
48
-be launched from CGI. The details of how the server is configured
49
-to "listen" for incoming HTTP requests is immaterial. The important
50
-point is that the server is listening for requests and the client
51
-is the issuer of the requests.</p>
45
+be launched from CGI.
46
+(See "[./server.wiki|How To Configure A Fossil Server]" for details.)
47
+The specifics of how the server listens
48
+for incoming HTTP requests is immaterial to this protocol.
49
+The important point is that the server is listening for requests and
50
+the client is the issuer of the requests.</p>
5251
5352
<p>A single push, pull, or sync might involve multiple HTTP requests.
5453
The client maintains state between all requests. But on the server
5554
side, each request is independent. The server does not preserve
5655
any information about the client from one request to the next.</p>
5756
57
+<h4>2.0.1 Encrypted Transport</h4>
58
+
59
+<p>In the current implementation of Fossil, the server only
60
+understands HTTP requests. The client can send either
61
+clear-text HTTP requests or encrypted HTTPS requests. But when
62
+HTTPS requests are sent, they first must be decrypted by a webserver
63
+or proxy before being passed to the Fossil server. This limitation
64
+may be relaxed in a future release.</p>
65
+
5866
<h3>2.1 Server Identification</h3>
5967
6068
<p>The server is identified by a URL argument that accompanies the
6169
push, pull, or sync command on the client. (As a convenience to
6270
users, the URL can be omitted on the client command and the same URL
@@ -233,10 +241,26 @@
233241
delta artifact.</p>
234242
235243
<p>Unlike file cards, cfile cards are only sent in one direction during a
236244
clone from server to client for clone protocol version "3" or greater.</p>
237245
246
+<h4>3.3.3 Private artifacts</h4>
247
+
248
+<p>"Private" content consist of artifacts that are not normally synced.
249
+However, private content will be synced when the
250
+the [/help?cmd=sync|fossil sync] command includes the "--private" option.
251
+</p>
252
+
253
+<p>Private content is marked by a "private" card:
254
+
255
+<blockquote>
256
+<b>private</b>
257
+</blockquote>
258
+
259
+<p>The private card has no arguments and must directly precede a
260
+file card that contains the private content.</p>
261
+
238262
<h3>3.4 Push and Pull Cards</h3>
239263
240264
<p>Among the first cards in a client-to-server message are
241265
the push and pull cards. The push card tells the server that
242266
the client is pushing content. The pull card tells the server
@@ -255,10 +279,12 @@
255279
for the transaction to proceed.</p>
256280
257281
<p>The server will also send a push card back to the client
258282
during a clone. This is how the client determines what project
259283
code to put in the new repository it is constructing.</p>
284
+
285
+<p>The <i>servercode</i> argument is currently unused.
260286
261287
<h3>3.5 Clone Cards</h3>
262288
263289
<p>A clone card works like a pull card in that it is sent from
264290
client to server in order to tell the server that the client
@@ -320,19 +346,23 @@
320346
<p>An igot card can be sent from either client to server or from
321347
server to client in order to indicate that the sender holds a copy
322348
of a particular artifact. The format is:</p>
323349
324350
<blockquote>
325
-<b>igot</b> <i>artifact-id</i>
351
+<b>igot</b> <i>artifact-id</i> ?<i>flag</i>?
326352
</blockquote>
327353
328
-<p>The argument of the igot card is the ID of the artifact that
354
+<p>The first argument of the igot card is the ID of the artifact that
329355
the sender possesses.
330356
The receiver of an igot card will typically check to see if
331357
it also holds the same artifact and if not it will request the artifact
332358
using a gimme card in either the reply or in the next message.</p>
333359
360
+<p>If the second argument exists and is "1", then the artifact
361
+identified by the first argument is private on the sender and should
362
+be ignored unless a "--private" [/help?cmd=sync|sync] is occurring.
363
+
334364
<h3>3.7 Gimme Cards</h3>
335365
336366
<p>A gimme card is sent from either client to server or from server
337367
to client. The gimme card asks the receiver to send a particular
338368
artifact back to the sender. The format of a gimme card is this:</p>
@@ -477,11 +507,50 @@
477507
it had sent a corresponding reqconfig card in its request.
478508
479509
<p>The content of the configuration item is used to overwrite the
480510
corresponding configuration data in the receiver.
481511
482
-<h3>3.11 Error Cards</h3>
512
+<h3>3.11 Pragma Cards</h3>
513
+
514
+<p>The client may try to influence the behavior of the server by
515
+issuing a pragma card:
516
+
517
+<blockquote>
518
+<b>pragma</i> <i>name value...</i>
519
+</blockquote>
520
+
521
+<p>The "pragma" card has at least one argument which is the pragma name.
522
+The pragma name defines what the pragma does.
523
+A pragma might have zero or more "value" arguments
524
+depending on the pragma name.
525
+
526
+<p>New pragma names may be added to the protocol from time to time
527
+in order to enhance the capabilities of Fossil.
528
+Unknown pragmas are silently ignored, for backwards compatibility.
529
+
530
+<p>The following are the known pragma names as of 2016-08-03:
531
+
532
+<ol>
533
+<li><p><b>send-private</b>
534
+<p>The send-private pragma instructs the server to send all of its
535
+private artifacts to the client. The server will only obey this
536
+request if the user has the "x" or "Private" privilege.
537
+
538
+<li><p><b>send-catalog</b>
539
+<p>The send-catalog pragma instructs the server to transmit igot
540
+cards for every known artifact. This can help the client and server
541
+to get back in synchronization after a prior protocol error. The
542
+"--verily" option to the [/help?cmd=sync|fossil sync] command causes
543
+the send-catalog pragma to be transmitted.</p>
544
+</ol>
545
+
546
+<h3>3.12 Comment Cards</h3>
547
+
548
+<p>Any card that begins with "#" (ASCII 0x23) is a comment card and
549
+is silently ignored.</p>
550
+
551
+<h3>3.13 Error Cards</h3>
483552
484553
<p>If the server discovers anything wrong with a request, it generates
485554
an error card in its reply. When the client sees the error card,
486555
it displays an error message to the user and aborts the sync
487556
operation. An error card looks like this:</p>
@@ -497,16 +566,11 @@
497566
(ASCII 0x5C) is represented as two backslashes "\\". Apart from
498567
space and newline, no other whitespace characters nor any
499568
unprintable characters are allowed in
500569
the error message.</p>
501570
502
-<h3>3.12 Comment Cards</h3>
503
-
504
-<p>Any card that begins with "#" (ASCII 0x23) is a comment card and
505
-is silently ignored.</p>
506
-
507
-<h3>3.13 Unknown Cards</h3>
571
+<h3>3.14 Unknown Cards</h3>
508572
509573
<p>If either the client or the server sees a card that is not
510574
described above, then it generates an error and aborts.</p>
511575
512576
<h2>4.0 Phantoms And Clusters</h2>
@@ -665,23 +729,28 @@
665729
<ul>
666730
<li> <b>login</b> <i>userid nonce signature</i>
667731
<li> <b>push</b> <i>servercode projectcode</i>
668732
<li> <b>pull</b> <i>servercode projectcode</i>
669733
<li> <b>clone</b>
734
+ <li> <b>clone_seqno</b> <i>sequence-number</i>
670735
<li> <b>file</b> <i>artifact-id size</i> <b>\n</b> <i>content</i>
671736
<li> <b>file</b> <i>artifact-id delta-artifact-id size</i> <b>\n</b> <i>content</i>
672
- <li> <b>igot</b> <i>artifact-id</i>
737
+ <li> <b>cfile</b> <i>artifact-id size</i> <b>\n</b> <i>content</i>
738
+ <li> <b>cfile</b> <i>artifact-id delta-artifact-id size</i> <b>\n</b> <i>content</i>
739
+ <li> <b>private</b>
740
+ <li> <b>igot</b> <i>artifact-id</i> ?<i>flag</i>?
673741
<li> <b>gimme</b> <i>artifact-id</i>
674742
<li> <b>cookie</b> <i>cookie-text</i>
675743
<li> <b>reqconfig</b> <i>parameter-name</i>
676744
<li> <b>config</b> <i>parameter-name size</i> <b>\n</b> <i>content</i>
677
- <li> <b>#</b> <i>arbitrary-text...</i>
745
+ <li> <b>pragma</b> <i>name</i> <i>value...</i>
678746
<li> <b>error</b> <i>error-message</i>
747
+ <li> <b>#</b> <i>arbitrary-text...</i>
679748
</ul>
680749
<li>Phantoms are artifacts that a repository knows exist but does not possess.
681750
<li>Clusters are artifacts that contain IDs of other artifacts.
682751
<li>Clusters are created automatically on the server during a pull.
683752
<li>Repositories keep track of all artifacts that are not named in any
684753
cluster and send igot messages for those artifacts.
685754
<li>Repositories keep track of all the phantoms they hold and send
686755
gimme messages for those artifacts.
687756
</ol>
688757
--- www/sync.wiki
+++ www/sync.wiki
@@ -1,20 +1,16 @@
1 <title>The Fossil Sync Protocol</title>
2
3 <p>Fossil supports commands <b>push</b>, <b>pull</b>, and <b>sync</b>
4 for transferring information from one repository to another. The
5 command is run on the client repository. A URL for the server repository
6 is specified as part of the command. This document describes what happens
7 behind the scenes in order to synchronize the information on the two
8 repositories.</p>
9
10 <h2>1.0 Overview</h2>
11
12 <p>The global state of a fossil repository consists of an unordered
13 collection of artifacts. Each artifact is identified by its SHA1 hash
14 expressed as a 40-character lower-case hexadecimal string.
15 Synchronization is simply the process of sharing artifacts between
16 servers so that all servers have copies of all artifacts. Because
17 artifacts are unordered, the order in which artifacts are received
18 at a server is inconsequential. It is assumed that the SHA1 hashes
19 of artifacts are unique - that every artifact has a different SHA1 hash.
20 To a first approximation, synchronization proceeds by sharing lists
@@ -26,15 +22,16 @@
26 shared to a few hundred.</p>
27
28 <p>Each repository also has local state. The local state determines
29 the web-page formatting preferences, authorized users, ticket formats,
30 and similar information that varies from one repository to another.
31 The local state is not transferred by the <b>push</b>, <b>pull</b>,
32 and <b>sync</b> command, though some local state is transferred during
33 a <b>clone</b> in order to initialize the local state of the new
34 repository. The <b>configuration push</b> and <b>configuration pull</b>
35 commands can be used to send or receive local state.</p>
 
36
37
38 <h2>2.0 Transport</h2>
39
40 <p>All communication between client and server is via HTTP requests.
@@ -43,20 +40,31 @@
43 request.</p>
44
45 <p>The server might be running as an independent server
46 using the <b>server</b> command, or it might be launched from
47 inetd or xinetd using the <b>http</b> command. Or the server might
48 be launched from CGI. The details of how the server is configured
49 to "listen" for incoming HTTP requests is immaterial. The important
50 point is that the server is listening for requests and the client
51 is the issuer of the requests.</p>
 
 
52
53 <p>A single push, pull, or sync might involve multiple HTTP requests.
54 The client maintains state between all requests. But on the server
55 side, each request is independent. The server does not preserve
56 any information about the client from one request to the next.</p>
57
 
 
 
 
 
 
 
 
 
58 <h3>2.1 Server Identification</h3>
59
60 <p>The server is identified by a URL argument that accompanies the
61 push, pull, or sync command on the client. (As a convenience to
62 users, the URL can be omitted on the client command and the same URL
@@ -233,10 +241,26 @@
233 delta artifact.</p>
234
235 <p>Unlike file cards, cfile cards are only sent in one direction during a
236 clone from server to client for clone protocol version "3" or greater.</p>
237
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238 <h3>3.4 Push and Pull Cards</h3>
239
240 <p>Among the first cards in a client-to-server message are
241 the push and pull cards. The push card tells the server that
242 the client is pushing content. The pull card tells the server
@@ -255,10 +279,12 @@
255 for the transaction to proceed.</p>
256
257 <p>The server will also send a push card back to the client
258 during a clone. This is how the client determines what project
259 code to put in the new repository it is constructing.</p>
 
 
260
261 <h3>3.5 Clone Cards</h3>
262
263 <p>A clone card works like a pull card in that it is sent from
264 client to server in order to tell the server that the client
@@ -320,19 +346,23 @@
320 <p>An igot card can be sent from either client to server or from
321 server to client in order to indicate that the sender holds a copy
322 of a particular artifact. The format is:</p>
323
324 <blockquote>
325 <b>igot</b> <i>artifact-id</i>
326 </blockquote>
327
328 <p>The argument of the igot card is the ID of the artifact that
329 the sender possesses.
330 The receiver of an igot card will typically check to see if
331 it also holds the same artifact and if not it will request the artifact
332 using a gimme card in either the reply or in the next message.</p>
333
 
 
 
 
334 <h3>3.7 Gimme Cards</h3>
335
336 <p>A gimme card is sent from either client to server or from server
337 to client. The gimme card asks the receiver to send a particular
338 artifact back to the sender. The format of a gimme card is this:</p>
@@ -477,11 +507,50 @@
477 it had sent a corresponding reqconfig card in its request.
478
479 <p>The content of the configuration item is used to overwrite the
480 corresponding configuration data in the receiver.
481
482 <h3>3.11 Error Cards</h3>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
483
484 <p>If the server discovers anything wrong with a request, it generates
485 an error card in its reply. When the client sees the error card,
486 it displays an error message to the user and aborts the sync
487 operation. An error card looks like this:</p>
@@ -497,16 +566,11 @@
497 (ASCII 0x5C) is represented as two backslashes "\\". Apart from
498 space and newline, no other whitespace characters nor any
499 unprintable characters are allowed in
500 the error message.</p>
501
502 <h3>3.12 Comment Cards</h3>
503
504 <p>Any card that begins with "#" (ASCII 0x23) is a comment card and
505 is silently ignored.</p>
506
507 <h3>3.13 Unknown Cards</h3>
508
509 <p>If either the client or the server sees a card that is not
510 described above, then it generates an error and aborts.</p>
511
512 <h2>4.0 Phantoms And Clusters</h2>
@@ -665,23 +729,28 @@
665 <ul>
666 <li> <b>login</b> <i>userid nonce signature</i>
667 <li> <b>push</b> <i>servercode projectcode</i>
668 <li> <b>pull</b> <i>servercode projectcode</i>
669 <li> <b>clone</b>
 
670 <li> <b>file</b> <i>artifact-id size</i> <b>\n</b> <i>content</i>
671 <li> <b>file</b> <i>artifact-id delta-artifact-id size</i> <b>\n</b> <i>content</i>
672 <li> <b>igot</b> <i>artifact-id</i>
 
 
 
673 <li> <b>gimme</b> <i>artifact-id</i>
674 <li> <b>cookie</b> <i>cookie-text</i>
675 <li> <b>reqconfig</b> <i>parameter-name</i>
676 <li> <b>config</b> <i>parameter-name size</i> <b>\n</b> <i>content</i>
677 <li> <b>#</b> <i>arbitrary-text...</i>
678 <li> <b>error</b> <i>error-message</i>
 
679 </ul>
680 <li>Phantoms are artifacts that a repository knows exist but does not possess.
681 <li>Clusters are artifacts that contain IDs of other artifacts.
682 <li>Clusters are created automatically on the server during a pull.
683 <li>Repositories keep track of all artifacts that are not named in any
684 cluster and send igot messages for those artifacts.
685 <li>Repositories keep track of all the phantoms they hold and send
686 gimme messages for those artifacts.
687 </ol>
688
--- www/sync.wiki
+++ www/sync.wiki
@@ -1,20 +1,16 @@
1 <title>The Fossil Sync Protocol</title>
2
3 <p>This document describes the wire protocol used to synchronize
4 content between two Fossil repositories.</p>
 
 
 
 
5
6 <h2>1.0 Overview</h2>
7
8 <p>The global state of a fossil repository consists of an unordered
9 collection of artifacts. Each artifact is identified by its SHA1 hash
10 expressed as a 40-character lower-case hexadecimal string.
11 Synchronization is the process of sharing artifacts between
12 servers so that all servers have copies of all artifacts. Because
13 artifacts are unordered, the order in which artifacts are received
14 at a server is inconsequential. It is assumed that the SHA1 hashes
15 of artifacts are unique - that every artifact has a different SHA1 hash.
16 To a first approximation, synchronization proceeds by sharing lists
@@ -26,15 +22,16 @@
22 shared to a few hundred.</p>
23
24 <p>Each repository also has local state. The local state determines
25 the web-page formatting preferences, authorized users, ticket formats,
26 and similar information that varies from one repository to another.
27 The local state is not using transferred during a sync. Except,
28 some local state is transferred during a [/help?cmd=clone|clone]
29 in order to initialize the local state of the new repository. And
30 the [/help?cmd=configuration|config push] and
31 [/help?cmd=configuration|config pull]
32 commands can be an administrator to sync local state.</p>
33
34
35 <h2>2.0 Transport</h2>
36
37 <p>All communication between client and server is via HTTP requests.
@@ -43,20 +40,31 @@
40 request.</p>
41
42 <p>The server might be running as an independent server
43 using the <b>server</b> command, or it might be launched from
44 inetd or xinetd using the <b>http</b> command. Or the server might
45 be launched from CGI.
46 (See "[./server.wiki|How To Configure A Fossil Server]" for details.)
47 The specifics of how the server listens
48 for incoming HTTP requests is immaterial to this protocol.
49 The important point is that the server is listening for requests and
50 the client is the issuer of the requests.</p>
51
52 <p>A single push, pull, or sync might involve multiple HTTP requests.
53 The client maintains state between all requests. But on the server
54 side, each request is independent. The server does not preserve
55 any information about the client from one request to the next.</p>
56
57 <h4>2.0.1 Encrypted Transport</h4>
58
59 <p>In the current implementation of Fossil, the server only
60 understands HTTP requests. The client can send either
61 clear-text HTTP requests or encrypted HTTPS requests. But when
62 HTTPS requests are sent, they first must be decrypted by a webserver
63 or proxy before being passed to the Fossil server. This limitation
64 may be relaxed in a future release.</p>
65
66 <h3>2.1 Server Identification</h3>
67
68 <p>The server is identified by a URL argument that accompanies the
69 push, pull, or sync command on the client. (As a convenience to
70 users, the URL can be omitted on the client command and the same URL
@@ -233,10 +241,26 @@
241 delta artifact.</p>
242
243 <p>Unlike file cards, cfile cards are only sent in one direction during a
244 clone from server to client for clone protocol version "3" or greater.</p>
245
246 <h4>3.3.3 Private artifacts</h4>
247
248 <p>"Private" content consist of artifacts that are not normally synced.
249 However, private content will be synced when the
250 the [/help?cmd=sync|fossil sync] command includes the "--private" option.
251 </p>
252
253 <p>Private content is marked by a "private" card:
254
255 <blockquote>
256 <b>private</b>
257 </blockquote>
258
259 <p>The private card has no arguments and must directly precede a
260 file card that contains the private content.</p>
261
262 <h3>3.4 Push and Pull Cards</h3>
263
264 <p>Among the first cards in a client-to-server message are
265 the push and pull cards. The push card tells the server that
266 the client is pushing content. The pull card tells the server
@@ -255,10 +279,12 @@
279 for the transaction to proceed.</p>
280
281 <p>The server will also send a push card back to the client
282 during a clone. This is how the client determines what project
283 code to put in the new repository it is constructing.</p>
284
285 <p>The <i>servercode</i> argument is currently unused.
286
287 <h3>3.5 Clone Cards</h3>
288
289 <p>A clone card works like a pull card in that it is sent from
290 client to server in order to tell the server that the client
@@ -320,19 +346,23 @@
346 <p>An igot card can be sent from either client to server or from
347 server to client in order to indicate that the sender holds a copy
348 of a particular artifact. The format is:</p>
349
350 <blockquote>
351 <b>igot</b> <i>artifact-id</i> ?<i>flag</i>?
352 </blockquote>
353
354 <p>The first argument of the igot card is the ID of the artifact that
355 the sender possesses.
356 The receiver of an igot card will typically check to see if
357 it also holds the same artifact and if not it will request the artifact
358 using a gimme card in either the reply or in the next message.</p>
359
360 <p>If the second argument exists and is "1", then the artifact
361 identified by the first argument is private on the sender and should
362 be ignored unless a "--private" [/help?cmd=sync|sync] is occurring.
363
364 <h3>3.7 Gimme Cards</h3>
365
366 <p>A gimme card is sent from either client to server or from server
367 to client. The gimme card asks the receiver to send a particular
368 artifact back to the sender. The format of a gimme card is this:</p>
@@ -477,11 +507,50 @@
507 it had sent a corresponding reqconfig card in its request.
508
509 <p>The content of the configuration item is used to overwrite the
510 corresponding configuration data in the receiver.
511
512 <h3>3.11 Pragma Cards</h3>
513
514 <p>The client may try to influence the behavior of the server by
515 issuing a pragma card:
516
517 <blockquote>
518 <b>pragma</i> <i>name value...</i>
519 </blockquote>
520
521 <p>The "pragma" card has at least one argument which is the pragma name.
522 The pragma name defines what the pragma does.
523 A pragma might have zero or more "value" arguments
524 depending on the pragma name.
525
526 <p>New pragma names may be added to the protocol from time to time
527 in order to enhance the capabilities of Fossil.
528 Unknown pragmas are silently ignored, for backwards compatibility.
529
530 <p>The following are the known pragma names as of 2016-08-03:
531
532 <ol>
533 <li><p><b>send-private</b>
534 <p>The send-private pragma instructs the server to send all of its
535 private artifacts to the client. The server will only obey this
536 request if the user has the "x" or "Private" privilege.
537
538 <li><p><b>send-catalog</b>
539 <p>The send-catalog pragma instructs the server to transmit igot
540 cards for every known artifact. This can help the client and server
541 to get back in synchronization after a prior protocol error. The
542 "--verily" option to the [/help?cmd=sync|fossil sync] command causes
543 the send-catalog pragma to be transmitted.</p>
544 </ol>
545
546 <h3>3.12 Comment Cards</h3>
547
548 <p>Any card that begins with "#" (ASCII 0x23) is a comment card and
549 is silently ignored.</p>
550
551 <h3>3.13 Error Cards</h3>
552
553 <p>If the server discovers anything wrong with a request, it generates
554 an error card in its reply. When the client sees the error card,
555 it displays an error message to the user and aborts the sync
556 operation. An error card looks like this:</p>
@@ -497,16 +566,11 @@
566 (ASCII 0x5C) is represented as two backslashes "\\". Apart from
567 space and newline, no other whitespace characters nor any
568 unprintable characters are allowed in
569 the error message.</p>
570
571 <h3>3.14 Unknown Cards</h3>
 
 
 
 
 
572
573 <p>If either the client or the server sees a card that is not
574 described above, then it generates an error and aborts.</p>
575
576 <h2>4.0 Phantoms And Clusters</h2>
@@ -665,23 +729,28 @@
729 <ul>
730 <li> <b>login</b> <i>userid nonce signature</i>
731 <li> <b>push</b> <i>servercode projectcode</i>
732 <li> <b>pull</b> <i>servercode projectcode</i>
733 <li> <b>clone</b>
734 <li> <b>clone_seqno</b> <i>sequence-number</i>
735 <li> <b>file</b> <i>artifact-id size</i> <b>\n</b> <i>content</i>
736 <li> <b>file</b> <i>artifact-id delta-artifact-id size</i> <b>\n</b> <i>content</i>
737 <li> <b>cfile</b> <i>artifact-id size</i> <b>\n</b> <i>content</i>
738 <li> <b>cfile</b> <i>artifact-id delta-artifact-id size</i> <b>\n</b> <i>content</i>
739 <li> <b>private</b>
740 <li> <b>igot</b> <i>artifact-id</i> ?<i>flag</i>?
741 <li> <b>gimme</b> <i>artifact-id</i>
742 <li> <b>cookie</b> <i>cookie-text</i>
743 <li> <b>reqconfig</b> <i>parameter-name</i>
744 <li> <b>config</b> <i>parameter-name size</i> <b>\n</b> <i>content</i>
745 <li> <b>pragma</b> <i>name</i> <i>value...</i>
746 <li> <b>error</b> <i>error-message</i>
747 <li> <b>#</b> <i>arbitrary-text...</i>
748 </ul>
749 <li>Phantoms are artifacts that a repository knows exist but does not possess.
750 <li>Clusters are artifacts that contain IDs of other artifacts.
751 <li>Clusters are created automatically on the server during a pull.
752 <li>Repositories keep track of all artifacts that are not named in any
753 cluster and send igot messages for those artifacts.
754 <li>Repositories keep track of all the phantoms they hold and send
755 gimme messages for those artifacts.
756 </ol>
757

Keyboard Shortcuts

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