Fossil SCM

Sync up with the trunk.

drh 2016-08-02 14:41 UTC purge merge
Commit 12f8633aa1cfe9be17c211869b6f0adac4f75247
+1 -1
--- src/attach.c
+++ src/attach.c
@@ -86,11 +86,11 @@
8686
const char *zFilename = db_column_text(&q, 3);
8787
const char *zComment = db_column_text(&q, 4);
8888
const char *zUser = db_column_text(&q, 5);
8989
const char *zUuid = db_column_text(&q, 6);
9090
int attachid = db_column_int(&q, 7);
91
- // type 0 is a wiki page, 1 is a ticket, 2 is a tech note
91
+ /* type 0 is a wiki page, 1 is a ticket, 2 is a tech note */
9292
int type = db_column_int(&q, 8);
9393
const char *zDispUser = zUser && zUser[0] ? zUser : "anonymous";
9494
int i;
9595
char *zUrlTail;
9696
for(i=0; zFilename[i]; i++){
9797
--- src/attach.c
+++ src/attach.c
@@ -86,11 +86,11 @@
86 const char *zFilename = db_column_text(&q, 3);
87 const char *zComment = db_column_text(&q, 4);
88 const char *zUser = db_column_text(&q, 5);
89 const char *zUuid = db_column_text(&q, 6);
90 int attachid = db_column_int(&q, 7);
91 // type 0 is a wiki page, 1 is a ticket, 2 is a tech note
92 int type = db_column_int(&q, 8);
93 const char *zDispUser = zUser && zUser[0] ? zUser : "anonymous";
94 int i;
95 char *zUrlTail;
96 for(i=0; zFilename[i]; i++){
97
--- src/attach.c
+++ src/attach.c
@@ -86,11 +86,11 @@
86 const char *zFilename = db_column_text(&q, 3);
87 const char *zComment = db_column_text(&q, 4);
88 const char *zUser = db_column_text(&q, 5);
89 const char *zUuid = db_column_text(&q, 6);
90 int attachid = db_column_int(&q, 7);
91 /* type 0 is a wiki page, 1 is a ticket, 2 is a tech note */
92 int type = db_column_int(&q, 8);
93 const char *zDispUser = zUser && zUser[0] ? zUser : "anonymous";
94 int i;
95 char *zUrlTail;
96 for(i=0; zFilename[i]; i++){
97
+86 -3
--- src/diff.tcl
+++ src/diff.tcl
@@ -227,16 +227,26 @@
227227
}
228228
229229
wm withdraw .
230230
wm title . $CFG(TITLE)
231231
wm iconname . $CFG(TITLE)
232
-bind . <q> exit
232
+# Keystroke bindings for on the top-level window for navigation and
233
+# control also fire when those same keystrokes are pressed in the
234
+# Search entry box. Disable them, to prevent the diff screen from
235
+# disappearing abruptly and unexpectedly when searching for "q".
236
+#
237
+# bind . <q> exit
238
+# bind . <p> {catch searchPrev; break}
239
+# bind . <n> {catch searchNext; break}
240
+# bind . <Escape><Escape> exit
233241
bind . <Destroy> {after 0 exit}
234242
bind . <Tab> {cycleDiffs; break}
235243
bind . <<PrevWindow>> {cycleDiffs 1; break}
244
+bind . <Control-f> {searchOnOff; break}
245
+bind . <Control-g> {catch searchNext; break}
236246
bind . <Return> {
237
- event generate .bb.files <1>
247
+ event generate bb.files <1>
238248
event generate .bb.files <ButtonRelease-1>
239249
break
240250
}
241251
foreach {key axis args} {
242252
Up y {scroll -5 units}
@@ -259,10 +269,14 @@
259269
bind . <Shift-$key> continue
260270
}
261271
262272
frame .bb
263273
::ttk::menubutton .bb.files -text "Files"
274
+if {[tk windowingsystem] eq "win32"} {
275
+ ::ttk::style theme use winnative
276
+ .bb.files configure -padding {20 1 10 2}
277
+}
264278
toplevel .wfiles
265279
wm withdraw .wfiles
266280
update idletasks
267281
wm transient .wfiles .
268282
wm overrideredirect .wfiles 1
@@ -358,31 +372,100 @@
358372
grid config .txtB -column 1
359373
.txtB tag config add -background $CFG(RM_BG)
360374
grid config .lnA -column 3
361375
grid config .txtA -column 4
362376
.txtA tag config rm -background $CFG(ADD_BG)
377
+ .bb.invert config -text Uninvert
363378
} else {
364379
grid config .lnA -column 0
365380
grid config .txtA -column 1
366381
.txtA tag config rm -background $CFG(RM_BG)
367382
grid config .lnB -column 3
368383
grid config .txtB -column 4
369384
.txtB tag config add -background $CFG(ADD_BG)
385
+ .bb.invert config -text Invert
370386
}
371387
.mkr config -state normal
372388
set clt [.mkr search -all < 1.0 end]
373389
set cgt [.mkr search -all > 1.0 end]
374390
foreach c $clt {.mkr replace $c "$c +1 chars" >}
375391
foreach c $cgt {.mkr replace $c "$c +1 chars" <}
376392
.mkr config -state disabled
393
+}
394
+proc searchOnOff {} {
395
+ if {[info exists ::search]} {
396
+ unset ::search
397
+ .txtA tag remove search 1.0 end
398
+ .txtB tag remove search 1.0 end
399
+ pack forget .bb.sframe
400
+ } else {
401
+ set ::search .txtA
402
+ if {![winfo exists .bb.sframe]} {
403
+ frame .bb.sframe
404
+ ::ttk::entry .bb.sframe.e -width 10
405
+ pack .bb.sframe.e -side left -fill y -expand 1
406
+ bind .bb.sframe.e <Return> {searchNext; break}
407
+ ::ttk::button .bb.sframe.nx -text \u2193 -width 1 -command searchNext
408
+ ::ttk::button .bb.sframe.pv -text \u2191 -width 1 -command searchPrev
409
+ tk_optionMenu .bb.sframe.typ ::search_type \
410
+ Exact {No Case} {RegExp} {Whole Word}
411
+ .bb.sframe.typ config -width 10
412
+ set ::search_type Exact
413
+ pack .bb.sframe.nx .bb.sframe.pv .bb.sframe.typ -side left
414
+ }
415
+ pack .bb.sframe -side left
416
+ after idle {focus .bb.sframe.e}
417
+ }
418
+}
419
+proc searchNext {} {searchStep -forwards +1 1.0 end}
420
+proc searchPrev {} {searchStep -backwards -1 end 1.0}
421
+proc searchStep {direction incr start stop} {
422
+ set pattern [.bb.sframe.e get]
423
+ if {$pattern==""} return
424
+ set count 0
425
+ set w $::search
426
+ if {"$w"==".txtA"} {set other .txtB} {set other .txtA}
427
+ if {[lsearch [$w mark names] search]<0} {
428
+ $w mark set search $start
429
+ }
430
+ switch $::search_type {
431
+ Exact {set st -exact}
432
+ {No Case} {set st -nocase}
433
+ {RegExp} {set st -regexp}
434
+ {Whole Word} {set st -regexp; set pattern \\y$pattern\\y}
435
+ }
436
+ set idx [$w search -count count $direction $st -- \
437
+ $pattern "search $incr chars" $stop]
438
+ if {"$idx"==""} {
439
+ set idx [$other search -count count $direction $st -- $pattern $start $stop]
440
+ if {"$idx"!=""} {
441
+ set this $w
442
+ set w $other
443
+ set other $this
444
+ } else {
445
+ set idx [$w search -count count $direction $st -- $pattern $start $stop]
446
+ }
447
+ }
448
+ $w tag remove search 1.0 end
449
+ $w mark unset search
450
+ $other tag remove search 1.0 end
451
+ $other mark unset search
452
+ if {"$idx"!=""} {
453
+ $w mark set search $idx
454
+ $w yview -pickplace $idx
455
+ $w tag add search search "$idx +$count chars"
456
+ $w tag config search -background {#fcc000}
457
+ }
458
+ set ::search $w
377459
}
378460
::ttk::button .bb.quit -text {Quit} -command exit
379461
::ttk::button .bb.invert -text {Invert} -command invertDiff
380462
::ttk::button .bb.save -text {Save As...} -command saveDiff
463
+::ttk::button .bb.search -text {Search} -command searchOnOff
381464
pack .bb.quit .bb.invert -side left
382465
if {$fossilcmd!=""} {pack .bb.save -side left}
383
-pack .bb.files -side left
466
+pack .bb.files .bb.search -side left
384467
grid rowconfigure . 1 -weight 1
385468
grid columnconfigure . 1 -weight 1
386469
grid columnconfigure . 4 -weight 1
387470
grid .bb -row 0 -columnspan 6
388471
eval grid [cols] -row 1 -sticky nsew
389472
--- src/diff.tcl
+++ src/diff.tcl
@@ -227,16 +227,26 @@
227 }
228
229 wm withdraw .
230 wm title . $CFG(TITLE)
231 wm iconname . $CFG(TITLE)
232 bind . <q> exit
 
 
 
 
 
 
 
 
233 bind . <Destroy> {after 0 exit}
234 bind . <Tab> {cycleDiffs; break}
235 bind . <<PrevWindow>> {cycleDiffs 1; break}
 
 
236 bind . <Return> {
237 event generate .bb.files <1>
238 event generate .bb.files <ButtonRelease-1>
239 break
240 }
241 foreach {key axis args} {
242 Up y {scroll -5 units}
@@ -259,10 +269,14 @@
259 bind . <Shift-$key> continue
260 }
261
262 frame .bb
263 ::ttk::menubutton .bb.files -text "Files"
 
 
 
 
264 toplevel .wfiles
265 wm withdraw .wfiles
266 update idletasks
267 wm transient .wfiles .
268 wm overrideredirect .wfiles 1
@@ -358,31 +372,100 @@
358 grid config .txtB -column 1
359 .txtB tag config add -background $CFG(RM_BG)
360 grid config .lnA -column 3
361 grid config .txtA -column 4
362 .txtA tag config rm -background $CFG(ADD_BG)
 
363 } else {
364 grid config .lnA -column 0
365 grid config .txtA -column 1
366 .txtA tag config rm -background $CFG(RM_BG)
367 grid config .lnB -column 3
368 grid config .txtB -column 4
369 .txtB tag config add -background $CFG(ADD_BG)
 
370 }
371 .mkr config -state normal
372 set clt [.mkr search -all < 1.0 end]
373 set cgt [.mkr search -all > 1.0 end]
374 foreach c $clt {.mkr replace $c "$c +1 chars" >}
375 foreach c $cgt {.mkr replace $c "$c +1 chars" <}
376 .mkr config -state disabled
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
377 }
378 ::ttk::button .bb.quit -text {Quit} -command exit
379 ::ttk::button .bb.invert -text {Invert} -command invertDiff
380 ::ttk::button .bb.save -text {Save As...} -command saveDiff
 
381 pack .bb.quit .bb.invert -side left
382 if {$fossilcmd!=""} {pack .bb.save -side left}
383 pack .bb.files -side left
384 grid rowconfigure . 1 -weight 1
385 grid columnconfigure . 1 -weight 1
386 grid columnconfigure . 4 -weight 1
387 grid .bb -row 0 -columnspan 6
388 eval grid [cols] -row 1 -sticky nsew
389
--- src/diff.tcl
+++ src/diff.tcl
@@ -227,16 +227,26 @@
227 }
228
229 wm withdraw .
230 wm title . $CFG(TITLE)
231 wm iconname . $CFG(TITLE)
232 # Keystroke bindings for on the top-level window for navigation and
233 # control also fire when those same keystrokes are pressed in the
234 # Search entry box. Disable them, to prevent the diff screen from
235 # disappearing abruptly and unexpectedly when searching for "q".
236 #
237 # bind . <q> exit
238 # bind . <p> {catch searchPrev; break}
239 # bind . <n> {catch searchNext; break}
240 # bind . <Escape><Escape> exit
241 bind . <Destroy> {after 0 exit}
242 bind . <Tab> {cycleDiffs; break}
243 bind . <<PrevWindow>> {cycleDiffs 1; break}
244 bind . <Control-f> {searchOnOff; break}
245 bind . <Control-g> {catch searchNext; break}
246 bind . <Return> {
247 event generate bb.files <1>
248 event generate .bb.files <ButtonRelease-1>
249 break
250 }
251 foreach {key axis args} {
252 Up y {scroll -5 units}
@@ -259,10 +269,14 @@
269 bind . <Shift-$key> continue
270 }
271
272 frame .bb
273 ::ttk::menubutton .bb.files -text "Files"
274 if {[tk windowingsystem] eq "win32"} {
275 ::ttk::style theme use winnative
276 .bb.files configure -padding {20 1 10 2}
277 }
278 toplevel .wfiles
279 wm withdraw .wfiles
280 update idletasks
281 wm transient .wfiles .
282 wm overrideredirect .wfiles 1
@@ -358,31 +372,100 @@
372 grid config .txtB -column 1
373 .txtB tag config add -background $CFG(RM_BG)
374 grid config .lnA -column 3
375 grid config .txtA -column 4
376 .txtA tag config rm -background $CFG(ADD_BG)
377 .bb.invert config -text Uninvert
378 } else {
379 grid config .lnA -column 0
380 grid config .txtA -column 1
381 .txtA tag config rm -background $CFG(RM_BG)
382 grid config .lnB -column 3
383 grid config .txtB -column 4
384 .txtB tag config add -background $CFG(ADD_BG)
385 .bb.invert config -text Invert
386 }
387 .mkr config -state normal
388 set clt [.mkr search -all < 1.0 end]
389 set cgt [.mkr search -all > 1.0 end]
390 foreach c $clt {.mkr replace $c "$c +1 chars" >}
391 foreach c $cgt {.mkr replace $c "$c +1 chars" <}
392 .mkr config -state disabled
393 }
394 proc searchOnOff {} {
395 if {[info exists ::search]} {
396 unset ::search
397 .txtA tag remove search 1.0 end
398 .txtB tag remove search 1.0 end
399 pack forget .bb.sframe
400 } else {
401 set ::search .txtA
402 if {![winfo exists .bb.sframe]} {
403 frame .bb.sframe
404 ::ttk::entry .bb.sframe.e -width 10
405 pack .bb.sframe.e -side left -fill y -expand 1
406 bind .bb.sframe.e <Return> {searchNext; break}
407 ::ttk::button .bb.sframe.nx -text \u2193 -width 1 -command searchNext
408 ::ttk::button .bb.sframe.pv -text \u2191 -width 1 -command searchPrev
409 tk_optionMenu .bb.sframe.typ ::search_type \
410 Exact {No Case} {RegExp} {Whole Word}
411 .bb.sframe.typ config -width 10
412 set ::search_type Exact
413 pack .bb.sframe.nx .bb.sframe.pv .bb.sframe.typ -side left
414 }
415 pack .bb.sframe -side left
416 after idle {focus .bb.sframe.e}
417 }
418 }
419 proc searchNext {} {searchStep -forwards +1 1.0 end}
420 proc searchPrev {} {searchStep -backwards -1 end 1.0}
421 proc searchStep {direction incr start stop} {
422 set pattern [.bb.sframe.e get]
423 if {$pattern==""} return
424 set count 0
425 set w $::search
426 if {"$w"==".txtA"} {set other .txtB} {set other .txtA}
427 if {[lsearch [$w mark names] search]<0} {
428 $w mark set search $start
429 }
430 switch $::search_type {
431 Exact {set st -exact}
432 {No Case} {set st -nocase}
433 {RegExp} {set st -regexp}
434 {Whole Word} {set st -regexp; set pattern \\y$pattern\\y}
435 }
436 set idx [$w search -count count $direction $st -- \
437 $pattern "search $incr chars" $stop]
438 if {"$idx"==""} {
439 set idx [$other search -count count $direction $st -- $pattern $start $stop]
440 if {"$idx"!=""} {
441 set this $w
442 set w $other
443 set other $this
444 } else {
445 set idx [$w search -count count $direction $st -- $pattern $start $stop]
446 }
447 }
448 $w tag remove search 1.0 end
449 $w mark unset search
450 $other tag remove search 1.0 end
451 $other mark unset search
452 if {"$idx"!=""} {
453 $w mark set search $idx
454 $w yview -pickplace $idx
455 $w tag add search search "$idx +$count chars"
456 $w tag config search -background {#fcc000}
457 }
458 set ::search $w
459 }
460 ::ttk::button .bb.quit -text {Quit} -command exit
461 ::ttk::button .bb.invert -text {Invert} -command invertDiff
462 ::ttk::button .bb.save -text {Save As...} -command saveDiff
463 ::ttk::button .bb.search -text {Search} -command searchOnOff
464 pack .bb.quit .bb.invert -side left
465 if {$fossilcmd!=""} {pack .bb.save -side left}
466 pack .bb.files .bb.search -side left
467 grid rowconfigure . 1 -weight 1
468 grid columnconfigure . 1 -weight 1
469 grid columnconfigure . 4 -weight 1
470 grid .bb -row 0 -columnspan 6
471 eval grid [cols] -row 1 -sticky nsew
472
--- src/fshell.c
+++ src/fshell.c
@@ -26,10 +26,15 @@
2626
** crypto phasephrase for each command.
2727
*/
2828
#include "config.h"
2929
#include "fshell.h"
3030
#include <ctype.h>
31
+
32
+#ifndef _WIN32
33
+#include <sys/types.h>
34
+#include <sys/wait.h>
35
+#endif
3136
3237
3338
/*
3439
** COMMAND: shell*
3540
**
3641
--- src/fshell.c
+++ src/fshell.c
@@ -26,10 +26,15 @@
26 ** crypto phasephrase for each command.
27 */
28 #include "config.h"
29 #include "fshell.h"
30 #include <ctype.h>
 
 
 
 
 
31
32
33 /*
34 ** COMMAND: shell*
35 **
36
--- src/fshell.c
+++ src/fshell.c
@@ -26,10 +26,15 @@
26 ** crypto phasephrase for each command.
27 */
28 #include "config.h"
29 #include "fshell.h"
30 #include <ctype.h>
31
32 #ifndef _WIN32
33 #include <sys/types.h>
34 #include <sys/wait.h>
35 #endif
36
37
38 /*
39 ** COMMAND: shell*
40 **
41
--- src/makeheaders.c
+++ src/makeheaders.c
@@ -1106,11 +1106,11 @@
11061106
**
11071107
** The number of errors encountered is returned. An error is an
11081108
** unterminated token.
11091109
*/
11101110
static int GetBigToken(InStream *pIn, Token *pToken, IdentTable *pTable){
1111
- const char *z, *zStart;
1111
+ const char *zStart;
11121112
int iStart;
11131113
int nBrace;
11141114
int c;
11151115
int nLine;
11161116
int nErr;
@@ -1135,11 +1135,10 @@
11351135
11361136
default:
11371137
return nErr;
11381138
}
11391139
1140
- z = pIn->z;
11411140
iStart = pIn->i;
11421141
zStart = pToken->zText;
11431142
nLine = pToken->nLine;
11441143
nBrace = 1;
11451144
while( nBrace ){
@@ -1681,18 +1680,16 @@
16811680
** This routine is called when we see a method for a class that begins
16821681
** with the PUBLIC, PRIVATE, or PROTECTED keywords. Such methods are
16831682
** added to their class definitions.
16841683
*/
16851684
static int ProcessMethodDef(Token *pFirst, Token *pLast, int flags){
1686
- Token *pCode;
16871685
Token *pClass;
16881686
char *zDecl;
16891687
Decl *pDecl;
16901688
String str;
16911689
int type;
16921690
1693
- pCode = pLast;
16941691
pLast = pLast->pPrev;
16951692
while( pFirst->zText[0]=='P' ){
16961693
int rc = 1;
16971694
switch( pFirst->nText ){
16981695
case 6: rc = strncmp(pFirst->zText,"PUBLIC",6); break;
16991696
--- src/makeheaders.c
+++ src/makeheaders.c
@@ -1106,11 +1106,11 @@
1106 **
1107 ** The number of errors encountered is returned. An error is an
1108 ** unterminated token.
1109 */
1110 static int GetBigToken(InStream *pIn, Token *pToken, IdentTable *pTable){
1111 const char *z, *zStart;
1112 int iStart;
1113 int nBrace;
1114 int c;
1115 int nLine;
1116 int nErr;
@@ -1135,11 +1135,10 @@
1135
1136 default:
1137 return nErr;
1138 }
1139
1140 z = pIn->z;
1141 iStart = pIn->i;
1142 zStart = pToken->zText;
1143 nLine = pToken->nLine;
1144 nBrace = 1;
1145 while( nBrace ){
@@ -1681,18 +1680,16 @@
1681 ** This routine is called when we see a method for a class that begins
1682 ** with the PUBLIC, PRIVATE, or PROTECTED keywords. Such methods are
1683 ** added to their class definitions.
1684 */
1685 static int ProcessMethodDef(Token *pFirst, Token *pLast, int flags){
1686 Token *pCode;
1687 Token *pClass;
1688 char *zDecl;
1689 Decl *pDecl;
1690 String str;
1691 int type;
1692
1693 pCode = pLast;
1694 pLast = pLast->pPrev;
1695 while( pFirst->zText[0]=='P' ){
1696 int rc = 1;
1697 switch( pFirst->nText ){
1698 case 6: rc = strncmp(pFirst->zText,"PUBLIC",6); break;
1699
--- src/makeheaders.c
+++ src/makeheaders.c
@@ -1106,11 +1106,11 @@
1106 **
1107 ** The number of errors encountered is returned. An error is an
1108 ** unterminated token.
1109 */
1110 static int GetBigToken(InStream *pIn, Token *pToken, IdentTable *pTable){
1111 const char *zStart;
1112 int iStart;
1113 int nBrace;
1114 int c;
1115 int nLine;
1116 int nErr;
@@ -1135,11 +1135,10 @@
1135
1136 default:
1137 return nErr;
1138 }
1139
 
1140 iStart = pIn->i;
1141 zStart = pToken->zText;
1142 nLine = pToken->nLine;
1143 nBrace = 1;
1144 while( nBrace ){
@@ -1681,18 +1680,16 @@
1680 ** This routine is called when we see a method for a class that begins
1681 ** with the PUBLIC, PRIVATE, or PROTECTED keywords. Such methods are
1682 ** added to their class definitions.
1683 */
1684 static int ProcessMethodDef(Token *pFirst, Token *pLast, int flags){
 
1685 Token *pClass;
1686 char *zDecl;
1687 Decl *pDecl;
1688 String str;
1689 int type;
1690
 
1691 pLast = pLast->pPrev;
1692 while( pFirst->zText[0]=='P' ){
1693 int rc = 1;
1694 switch( pFirst->nText ){
1695 case 6: rc = strncmp(pFirst->zText,"PUBLIC",6); break;
1696
--- src/shell.c
+++ src/shell.c
@@ -2548,10 +2548,12 @@
25482548
void *pArg,
25492549
void *pP,
25502550
void *pX
25512551
){
25522552
FILE *f = (FILE*)pArg;
2553
+ UNUSED_PARAMETER(mType);
2554
+ UNUSED_PARAMETER(pP);
25532555
if( f ){
25542556
const char *z = (const char*)pX;
25552557
int i = (int)strlen(z);
25562558
while( i>0 && z[i-1]==';' ){ i--; }
25572559
utf8_printf(f, "%.*s;\n", i, z);
25582560
--- src/shell.c
+++ src/shell.c
@@ -2548,10 +2548,12 @@
2548 void *pArg,
2549 void *pP,
2550 void *pX
2551 ){
2552 FILE *f = (FILE*)pArg;
 
 
2553 if( f ){
2554 const char *z = (const char*)pX;
2555 int i = (int)strlen(z);
2556 while( i>0 && z[i-1]==';' ){ i--; }
2557 utf8_printf(f, "%.*s;\n", i, z);
2558
--- src/shell.c
+++ src/shell.c
@@ -2548,10 +2548,12 @@
2548 void *pArg,
2549 void *pP,
2550 void *pX
2551 ){
2552 FILE *f = (FILE*)pArg;
2553 UNUSED_PARAMETER(mType);
2554 UNUSED_PARAMETER(pP);
2555 if( f ){
2556 const char *z = (const char*)pX;
2557 int i = (int)strlen(z);
2558 while( i>0 && z[i-1]==';' ){ i--; }
2559 utf8_printf(f, "%.*s;\n", i, z);
2560
+917 -784
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -65,10 +65,18 @@
6565
** In all cases, the special comment must be enclosed in the usual
6666
** slash-asterisk...asterisk-slash comment marks, with no spaces between the
6767
** asterisks and the comment text.
6868
*/
6969
70
+/*
71
+** Make sure the Tcl calling convention macro is defined. This macro is
72
+** only used by test code and Tcl integration code.
73
+*/
74
+#ifndef SQLITE_TCLAPI
75
+# define SQLITE_TCLAPI
76
+#endif
77
+
7078
/*
7179
** Make sure that rand_s() is available on Windows systems with MSVC 2005
7280
** or higher.
7381
*/
7482
#if defined(_MSC_VER) && _MSC_VER>=1400
@@ -304,12 +312,21 @@
304312
# define SQLITE_API
305313
#endif
306314
#ifndef SQLITE_CDECL
307315
# define SQLITE_CDECL
308316
#endif
317
+#ifndef SQLITE_APICALL
318
+# define SQLITE_APICALL
319
+#endif
309320
#ifndef SQLITE_STDCALL
310
-# define SQLITE_STDCALL
321
+# define SQLITE_STDCALL SQLITE_APICALL
322
+#endif
323
+#ifndef SQLITE_CALLBACK
324
+# define SQLITE_CALLBACK
325
+#endif
326
+#ifndef SQLITE_SYSAPI
327
+# define SQLITE_SYSAPI
311328
#endif
312329
313330
/*
314331
** These no-op macros are used in front of interfaces to mark those
315332
** interfaces as either deprecated or experimental. New applications
@@ -363,11 +380,11 @@
363380
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
364381
** [sqlite_version()] and [sqlite_source_id()].
365382
*/
366383
#define SQLITE_VERSION "3.14.0"
367384
#define SQLITE_VERSION_NUMBER 3014000
368
-#define SQLITE_SOURCE_ID "2016-07-25 12:10:25 d6f6c87c9c0acf609a9d5bea818bb7a5437109a1"
385
+#define SQLITE_SOURCE_ID "2016-08-02 08:45:26 7c38a79cdd42aaa45715aea330d10ca859098837"
369386
370387
/*
371388
** CAPI3REF: Run-Time Library Version Numbers
372389
** KEYWORDS: sqlite3_version, sqlite3_sourceid
373390
**
@@ -396,13 +413,13 @@
396413
** [SQLITE_SOURCE_ID] C preprocessor macro.
397414
**
398415
** See also: [sqlite_version()] and [sqlite_source_id()].
399416
*/
400417
SQLITE_API const char sqlite3_version[] = SQLITE_VERSION;
401
-SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void);
402
-SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void);
403
-SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void);
418
+SQLITE_API const char *SQLITE_APICALL sqlite3_libversion(void);
419
+SQLITE_API const char *SQLITE_APICALL sqlite3_sourceid(void);
420
+SQLITE_API int SQLITE_APICALL sqlite3_libversion_number(void);
404421
405422
/*
406423
** CAPI3REF: Run-Time Library Compilation Options Diagnostics
407424
**
408425
** ^The sqlite3_compileoption_used() function returns 0 or 1
@@ -423,12 +440,12 @@
423440
**
424441
** See also: SQL functions [sqlite_compileoption_used()] and
425442
** [sqlite_compileoption_get()] and the [compile_options pragma].
426443
*/
427444
#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
428
-SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName);
429
-SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N);
445
+SQLITE_API int SQLITE_APICALL sqlite3_compileoption_used(const char *zOptName);
446
+SQLITE_API const char *SQLITE_APICALL sqlite3_compileoption_get(int N);
430447
#endif
431448
432449
/*
433450
** CAPI3REF: Test To See If The Library Is Threadsafe
434451
**
@@ -463,11 +480,11 @@
463480
** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
464481
** is unchanged by calls to sqlite3_config().)^
465482
**
466483
** See the [threading mode] documentation for additional information.
467484
*/
468
-SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void);
485
+SQLITE_API int SQLITE_APICALL sqlite3_threadsafe(void);
469486
470487
/*
471488
** CAPI3REF: Database Connection Handle
472489
** KEYWORDS: {database connection} {database connections}
473490
**
@@ -560,19 +577,19 @@
560577
** from [sqlite3_open()], [sqlite3_open16()], or
561578
** [sqlite3_open_v2()], and not previously closed.
562579
** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
563580
** argument is a harmless no-op.
564581
*/
565
-SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3*);
566
-SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3*);
582
+SQLITE_API int SQLITE_APICALL sqlite3_close(sqlite3*);
583
+SQLITE_API int SQLITE_APICALL sqlite3_close_v2(sqlite3*);
567584
568585
/*
569586
** The type for a callback function.
570587
** This is legacy and deprecated. It is included for historical
571588
** compatibility and is not documented.
572589
*/
573
-typedef int (*sqlite3_callback)(void*,int,char**, char**);
590
+typedef int (SQLITE_CALLBACK *sqlite3_callback)(void*,int,char**, char**);
574591
575592
/*
576593
** CAPI3REF: One-Step Query Execution Interface
577594
** METHOD: sqlite3
578595
**
@@ -632,14 +649,14 @@
632649
** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
633650
** <li> The application must not modify the SQL statement text passed into
634651
** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
635652
** </ul>
636653
*/
637
-SQLITE_API int SQLITE_STDCALL sqlite3_exec(
654
+SQLITE_API int SQLITE_APICALL sqlite3_exec(
638655
sqlite3*, /* An open database */
639656
const char *sql, /* SQL to be evaluated */
640
- int (*callback)(void*,int,char**,char**), /* Callback function */
657
+ int (SQLITE_CALLBACK *callback)(void*,int,char**,char**), /* Callback function */
641658
void *, /* 1st argument to callback */
642659
char **errmsg /* Error msg written here */
643660
);
644661
645662
/*
@@ -983,30 +1000,30 @@
9831000
** database corruption.
9841001
*/
9851002
typedef struct sqlite3_io_methods sqlite3_io_methods;
9861003
struct sqlite3_io_methods {
9871004
int iVersion;
988
- int (*xClose)(sqlite3_file*);
989
- int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
990
- int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
991
- int (*xTruncate)(sqlite3_file*, sqlite3_int64 size);
992
- int (*xSync)(sqlite3_file*, int flags);
993
- int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
994
- int (*xLock)(sqlite3_file*, int);
995
- int (*xUnlock)(sqlite3_file*, int);
996
- int (*xCheckReservedLock)(sqlite3_file*, int *pResOut);
997
- int (*xFileControl)(sqlite3_file*, int op, void *pArg);
998
- int (*xSectorSize)(sqlite3_file*);
999
- int (*xDeviceCharacteristics)(sqlite3_file*);
1005
+ int (SQLITE_CALLBACK *xClose)(sqlite3_file*);
1006
+ int (SQLITE_CALLBACK *xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
1007
+ int (SQLITE_CALLBACK *xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
1008
+ int (SQLITE_CALLBACK *xTruncate)(sqlite3_file*, sqlite3_int64 size);
1009
+ int (SQLITE_CALLBACK *xSync)(sqlite3_file*, int flags);
1010
+ int (SQLITE_CALLBACK *xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
1011
+ int (SQLITE_CALLBACK *xLock)(sqlite3_file*, int);
1012
+ int (SQLITE_CALLBACK *xUnlock)(sqlite3_file*, int);
1013
+ int (SQLITE_CALLBACK *xCheckReservedLock)(sqlite3_file*, int *pResOut);
1014
+ int (SQLITE_CALLBACK *xFileControl)(sqlite3_file*, int op, void *pArg);
1015
+ int (SQLITE_CALLBACK *xSectorSize)(sqlite3_file*);
1016
+ int (SQLITE_CALLBACK *xDeviceCharacteristics)(sqlite3_file*);
10001017
/* Methods above are valid for version 1 */
1001
- int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
1002
- int (*xShmLock)(sqlite3_file*, int offset, int n, int flags);
1003
- void (*xShmBarrier)(sqlite3_file*);
1004
- int (*xShmUnmap)(sqlite3_file*, int deleteFlag);
1018
+ int (SQLITE_CALLBACK *xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
1019
+ int (SQLITE_CALLBACK *xShmLock)(sqlite3_file*, int offset, int n, int flags);
1020
+ void (SQLITE_CALLBACK *xShmBarrier)(sqlite3_file*);
1021
+ int (SQLITE_CALLBACK *xShmUnmap)(sqlite3_file*, int deleteFlag);
10051022
/* Methods above are valid for version 2 */
1006
- int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
1007
- int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p);
1023
+ int (SQLITE_CALLBACK *xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
1024
+ int (SQLITE_CALLBACK *xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p);
10081025
/* Methods above are valid for version 3 */
10091026
/* Additional methods may be added in future releases */
10101027
};
10111028
10121029
/*
@@ -1178,11 +1195,11 @@
11781195
** ^The [SQLITE_FCNTL_BUSYHANDLER]
11791196
** file-control may be invoked by SQLite on the database file handle
11801197
** shortly after it is opened in order to provide a custom VFS with access
11811198
** to the connections busy-handler callback. The argument is of type (void **)
11821199
** - an array of two (void *) values. The first (void *) actually points
1183
-** to a function of type (int (*)(void *)). In order to invoke the connections
1200
+** to a function of type (int (SQLITE_CALLBACK *)(void *)). In order to invoke the connections
11841201
** busy-handler, this function should be invoked with the second (void *) in
11851202
** the array as the only argument. If it returns non-zero, then the operation
11861203
** should be retried. If it returns zero, the custom VFS should abandon the
11871204
** current operation.
11881205
**
@@ -1286,10 +1303,20 @@
12861303
**
12871304
** Mutexes are created using [sqlite3_mutex_alloc()].
12881305
*/
12891306
typedef struct sqlite3_mutex sqlite3_mutex;
12901307
1308
+/*
1309
+** CAPI3REF: Loadable Extension Thunk
1310
+**
1311
+** A pointer to the opaque sqlite3_api_routines structure is passed as
1312
+** the third parameter to entry points of [loadable extensions]. This
1313
+** structure must be typedefed in order to work around compiler warnings
1314
+** on some platforms.
1315
+*/
1316
+typedef struct sqlite3_api_routines sqlite3_api_routines;
1317
+
12911318
/*
12921319
** CAPI3REF: OS Interface Object
12931320
**
12941321
** An instance of the sqlite3_vfs object defines the interface between
12951322
** the SQLite core and the underlying operating system. The "vfs"
@@ -1444,43 +1471,43 @@
14441471
** or all of these interfaces to be NULL or for their behavior to change
14451472
** from one release to the next. Applications must not attempt to access
14461473
** any of these methods if the iVersion of the VFS is less than 3.
14471474
*/
14481475
typedef struct sqlite3_vfs sqlite3_vfs;
1449
-typedef void (*sqlite3_syscall_ptr)(void);
1476
+typedef void (SQLITE_SYSAPI *sqlite3_syscall_ptr)(void);
14501477
struct sqlite3_vfs {
14511478
int iVersion; /* Structure version number (currently 3) */
14521479
int szOsFile; /* Size of subclassed sqlite3_file */
14531480
int mxPathname; /* Maximum file pathname length */
14541481
sqlite3_vfs *pNext; /* Next registered VFS */
14551482
const char *zName; /* Name of this virtual file system */
14561483
void *pAppData; /* Pointer to application-specific data */
1457
- int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
1484
+ int (SQLITE_CALLBACK *xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
14581485
int flags, int *pOutFlags);
1459
- int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
1460
- int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
1461
- int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
1462
- void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename);
1463
- void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
1464
- void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
1465
- void (*xDlClose)(sqlite3_vfs*, void*);
1466
- int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
1467
- int (*xSleep)(sqlite3_vfs*, int microseconds);
1468
- int (*xCurrentTime)(sqlite3_vfs*, double*);
1469
- int (*xGetLastError)(sqlite3_vfs*, int, char *);
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 *);
14701497
/*
14711498
** The methods above are in version 1 of the sqlite_vfs object
14721499
** definition. Those that follow are added in version 2 or later
14731500
*/
1474
- int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
1501
+ int (SQLITE_CALLBACK *xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
14751502
/*
14761503
** The methods above are in versions 1 and 2 of the sqlite_vfs object.
14771504
** Those below are for version 3 and greater.
14781505
*/
1479
- int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
1480
- sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName);
1481
- const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName);
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);
14821509
/*
14831510
** The methods above are in versions 1 through 3 of the sqlite_vfs object.
14841511
** New fields may be appended in future versions. The iVersion
14851512
** value will increment whenever this happens.
14861513
*/
@@ -1621,14 +1648,14 @@
16211648
** sqlite3_os_init() and sqlite3_os_end(). An application-supplied
16221649
** implementation of sqlite3_os_init() or sqlite3_os_end()
16231650
** must return [SQLITE_OK] on success and some other [error code] upon
16241651
** failure.
16251652
*/
1626
-SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void);
1627
-SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void);
1628
-SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void);
1629
-SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void);
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);
16301657
16311658
/*
16321659
** CAPI3REF: Configuring The SQLite Library
16331660
**
16341661
** The sqlite3_config() interface is used to make global configuration
@@ -1743,17 +1770,17 @@
17431770
** SQLite will never invoke xInit() more than once without an intervening
17441771
** call to xShutdown().
17451772
*/
17461773
typedef struct sqlite3_mem_methods sqlite3_mem_methods;
17471774
struct sqlite3_mem_methods {
1748
- void *(*xMalloc)(int); /* Memory allocation function */
1749
- void (*xFree)(void*); /* Free a prior allocation */
1750
- void *(*xRealloc)(void*,int); /* Resize an allocation */
1751
- int (*xSize)(void*); /* Return the size of an allocation */
1752
- int (*xRoundup)(int); /* Round up request size to allocation size */
1753
- int (*xInit)(void*); /* Initialize the memory allocator */
1754
- void (*xShutdown)(void*); /* Deinitialize the memory allocator */
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 */
17551782
void *pAppData; /* Argument to xInit() and xShutdown() */
17561783
};
17571784
17581785
/*
17591786
** CAPI3REF: Configuration Options
@@ -1966,11 +1993,11 @@
19661993
**
19671994
** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
19681995
** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
19691996
** global [error log].
19701997
** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a
1971
-** function with a call signature of void(*)(void*,int,const char*),
1998
+** function with a call signature of void(SQLITE_CALLBACK *)(void*,int,const char*),
19721999
** and a pointer to void. ^If the function pointer is not NULL, it is
19732000
** invoked by [sqlite3_log()] to process each logging event. ^If the
19742001
** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op.
19752002
** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is
19762003
** passed through as the first parameter to the application-defined logger
@@ -2019,11 +2046,11 @@
20192046
**
20202047
** [[SQLITE_CONFIG_SQLLOG]]
20212048
** <dt>SQLITE_CONFIG_SQLLOG
20222049
** <dd>This option is only available if sqlite is compiled with the
20232050
** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should
2024
-** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int).
2051
+** be a pointer to a function of type void(SQLITE_CALLBACK *)(void*,sqlite3*,const char*, int).
20252052
** The second should be of type (void*). The callback is invoked by the library
20262053
** in three separate circumstances, identified by the value passed as the
20272054
** fourth parameter. If the fourth parameter is 0, then the database connection
20282055
** passed as the second argument has just been opened. The third argument
20292056
** points to a buffer containing the name of the main database file. If the
@@ -2217,11 +2244,11 @@
22172244
**
22182245
** ^The sqlite3_extended_result_codes() routine enables or disables the
22192246
** [extended result codes] feature of SQLite. ^The extended result
22202247
** codes are disabled by default for historical compatibility.
22212248
*/
2222
-SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3*, int onoff);
2249
+SQLITE_API int SQLITE_APICALL sqlite3_extended_result_codes(sqlite3*, int onoff);
22232250
22242251
/*
22252252
** CAPI3REF: Last Insert Rowid
22262253
** METHOD: sqlite3
22272254
**
@@ -2269,11 +2296,11 @@
22692296
** function is running and thus changes the last insert [rowid],
22702297
** then the value returned by [sqlite3_last_insert_rowid()] is
22712298
** unpredictable and might not equal either the old or the new
22722299
** last insert [rowid].
22732300
*/
2274
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3*);
2301
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_last_insert_rowid(sqlite3*);
22752302
22762303
/*
22772304
** CAPI3REF: Count The Number Of Rows Modified
22782305
** METHOD: sqlite3
22792306
**
@@ -2322,11 +2349,11 @@
23222349
**
23232350
** If a separate thread makes changes on the same database connection
23242351
** while [sqlite3_changes()] is running then the value returned
23252352
** is unpredictable and not meaningful.
23262353
*/
2327
-SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3*);
2354
+SQLITE_API int SQLITE_APICALL sqlite3_changes(sqlite3*);
23282355
23292356
/*
23302357
** CAPI3REF: Total Number Of Rows Modified
23312358
** METHOD: sqlite3
23322359
**
@@ -2346,11 +2373,11 @@
23462373
**
23472374
** If a separate thread makes changes on the same database connection
23482375
** while [sqlite3_total_changes()] is running then the value
23492376
** returned is unpredictable and not meaningful.
23502377
*/
2351
-SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3*);
2378
+SQLITE_API int SQLITE_APICALL sqlite3_total_changes(sqlite3*);
23522379
23532380
/*
23542381
** CAPI3REF: Interrupt A Long-Running Query
23552382
** METHOD: sqlite3
23562383
**
@@ -2386,11 +2413,11 @@
23862413
** that are started after the sqlite3_interrupt() call returns.
23872414
**
23882415
** If the database connection closes while [sqlite3_interrupt()]
23892416
** is running then bad things will likely happen.
23902417
*/
2391
-SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3*);
2418
+SQLITE_API void SQLITE_APICALL sqlite3_interrupt(sqlite3*);
23922419
23932420
/*
23942421
** CAPI3REF: Determine If An SQL Statement Is Complete
23952422
**
23962423
** These routines are useful during command-line input to determine if the
@@ -2421,12 +2448,12 @@
24212448
** UTF-8 string.
24222449
**
24232450
** The input to [sqlite3_complete16()] must be a zero-terminated
24242451
** UTF-16 string in native byte order.
24252452
*/
2426
-SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *sql);
2427
-SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *sql);
2453
+SQLITE_API int SQLITE_APICALL sqlite3_complete(const char *sql);
2454
+SQLITE_API int SQLITE_APICALL sqlite3_complete16(const void *sql);
24282455
24292456
/*
24302457
** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
24312458
** KEYWORDS: {busy-handler callback} {busy handler}
24322459
** METHOD: sqlite3
@@ -2483,11 +2510,11 @@
24832510
** result in undefined behavior.
24842511
**
24852512
** A busy handler must not close the database connection
24862513
** or [prepared statement] that invoked the busy handler.
24872514
*/
2488
-SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*);
2515
+SQLITE_API int SQLITE_APICALL sqlite3_busy_handler(sqlite3*,int(SQLITE_CALLBACK *)(void*,int),void*);
24892516
24902517
/*
24912518
** CAPI3REF: Set A Busy Timeout
24922519
** METHOD: sqlite3
24932520
**
@@ -2506,11 +2533,11 @@
25062533
** was defined (using [sqlite3_busy_handler()]) prior to calling
25072534
** this routine, that other busy handler is cleared.)^
25082535
**
25092536
** See also: [PRAGMA busy_timeout]
25102537
*/
2511
-SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3*, int ms);
2538
+SQLITE_API int SQLITE_APICALL sqlite3_busy_timeout(sqlite3*, int ms);
25122539
25132540
/*
25142541
** CAPI3REF: Convenience Routines For Running Queries
25152542
** METHOD: sqlite3
25162543
**
@@ -2581,19 +2608,19 @@
25812608
** interface defined here. As a consequence, errors that occur in the
25822609
** wrapper layer outside of the internal [sqlite3_exec()] call are not
25832610
** reflected in subsequent calls to [sqlite3_errcode()] or
25842611
** [sqlite3_errmsg()].
25852612
*/
2586
-SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
2613
+SQLITE_API int SQLITE_APICALL sqlite3_get_table(
25872614
sqlite3 *db, /* An open database */
25882615
const char *zSql, /* SQL to be evaluated */
25892616
char ***pazResult, /* Results of the query */
25902617
int *pnRow, /* Number of result rows written here */
25912618
int *pnColumn, /* Number of result columns written here */
25922619
char **pzErrmsg /* Error msg written here */
25932620
);
2594
-SQLITE_API void SQLITE_STDCALL sqlite3_free_table(char **result);
2621
+SQLITE_API void SQLITE_APICALL sqlite3_free_table(char **result);
25952622
25962623
/*
25972624
** CAPI3REF: Formatted String Printing Functions
25982625
**
25992626
** These routines are work-alikes of the "printf()" family of functions
@@ -2696,13 +2723,13 @@
26962723
** ^(The "%z" formatting option works like "%s" but with the
26972724
** addition that after the string has been read and copied into
26982725
** the result, [sqlite3_free()] is called on the input string.)^
26992726
*/
27002727
SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...);
2701
-SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list);
2728
+SQLITE_API char *SQLITE_APICALL sqlite3_vmprintf(const char*, va_list);
27022729
SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...);
2703
-SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list);
2730
+SQLITE_API char *SQLITE_APICALL sqlite3_vsnprintf(int,char*,const char*, va_list);
27042731
27052732
/*
27062733
** CAPI3REF: Memory Allocation Subsystem
27072734
**
27082735
** The SQLite core uses these three routines for all of its own
@@ -2788,16 +2815,16 @@
27882815
**
27892816
** The application must not read or write any part of
27902817
** a block of memory after it has been released using
27912818
** [sqlite3_free()] or [sqlite3_realloc()].
27922819
*/
2793
-SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int);
2794
-SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64);
2795
-SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void*, int);
2796
-SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void*, sqlite3_uint64);
2797
-SQLITE_API void SQLITE_STDCALL sqlite3_free(void*);
2798
-SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void*);
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*);
27992826
28002827
/*
28012828
** CAPI3REF: Memory Allocator Statistics
28022829
**
28032830
** SQLite provides these two interfaces for reporting on the status
@@ -2818,12 +2845,12 @@
28182845
** [sqlite3_memory_used()] if and only if the parameter to
28192846
** [sqlite3_memory_highwater()] is true. ^The value returned
28202847
** by [sqlite3_memory_highwater(1)] is the high-water mark
28212848
** prior to the reset.
28222849
*/
2823
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void);
2824
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag);
2850
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_used(void);
2851
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_highwater(int resetFlag);
28252852
28262853
/*
28272854
** CAPI3REF: Pseudo-Random Number Generator
28282855
**
28292856
** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
@@ -2842,11 +2869,11 @@
28422869
** ^If the previous call to this routine had an N of 1 or more and a
28432870
** non-NULL P then the pseudo-randomness is generated
28442871
** internally and without recourse to the [sqlite3_vfs] xRandomness
28452872
** method.
28462873
*/
2847
-SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *P);
2874
+SQLITE_API void SQLITE_APICALL sqlite3_randomness(int N, void *P);
28482875
28492876
/*
28502877
** CAPI3REF: Compile-Time Authorization Callbacks
28512878
** METHOD: sqlite3
28522879
**
@@ -2925,13 +2952,13 @@
29252952
** [sqlite3_prepare()] or its variants. Authorization is not
29262953
** performed during statement evaluation in [sqlite3_step()], unless
29272954
** as stated in the previous paragraph, sqlite3_step() invokes
29282955
** sqlite3_prepare_v2() to reprepare a statement after a schema change.
29292956
*/
2930
-SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
2957
+SQLITE_API int SQLITE_APICALL sqlite3_set_authorizer(
29312958
sqlite3*,
2932
- int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
2959
+ int (SQLITE_CALLBACK *xAuth)(void*,int,const char*,const char*,const char*,const char*),
29332960
void *pUserData
29342961
);
29352962
29362963
/*
29372964
** CAPI3REF: Authorizer Return Codes
@@ -3033,14 +3060,14 @@
30333060
** digits in the time are meaningless. Future versions of SQLite
30343061
** might provide greater resolution on the profiler callback. The
30353062
** sqlite3_profile() function is considered experimental and is
30363063
** subject to change in future versions of SQLite.
30373064
*/
3038
-SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_trace(sqlite3*,
3039
- void(*xTrace)(void*,const char*), void*);
3040
-SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_profile(sqlite3*,
3041
- void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
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*);
30423069
30433070
/*
30443071
** CAPI3REF: SQL Trace Event Codes
30453072
** KEYWORDS: SQLITE_TRACE
30463073
**
@@ -3124,14 +3151,14 @@
31243151
**
31253152
** The sqlite3_trace_v2() interface is intended to replace the legacy
31263153
** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which
31273154
** are deprecated.
31283155
*/
3129
-SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2(
3156
+SQLITE_API int SQLITE_APICALL sqlite3_trace_v2(
31303157
sqlite3*,
31313158
unsigned uMask,
3132
- int(*xCallback)(unsigned,void*,void*,void*),
3159
+ int(SQLITE_CALLBACK *xCallback)(unsigned,void*,void*,void*),
31333160
void *pCtx
31343161
);
31353162
31363163
/*
31373164
** CAPI3REF: Query Progress Callbacks
@@ -3163,11 +3190,11 @@
31633190
** the database connection that invoked the progress handler.
31643191
** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
31653192
** database connections for the meaning of "modify" in this paragraph.
31663193
**
31673194
*/
3168
-SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
3195
+SQLITE_API void SQLITE_APICALL sqlite3_progress_handler(sqlite3*, int, int(SQLITE_CALLBACK *)(void*), void*);
31693196
31703197
/*
31713198
** CAPI3REF: Opening A New Database Connection
31723199
** CONSTRUCTOR: sqlite3
31733200
**
@@ -3392,19 +3419,19 @@
33923419
** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various
33933420
** features that require the use of temporary files may fail.
33943421
**
33953422
** See also: [sqlite3_temp_directory]
33963423
*/
3397
-SQLITE_API int SQLITE_STDCALL sqlite3_open(
3424
+SQLITE_API int SQLITE_APICALL sqlite3_open(
33983425
const char *filename, /* Database filename (UTF-8) */
33993426
sqlite3 **ppDb /* OUT: SQLite db handle */
34003427
);
3401
-SQLITE_API int SQLITE_STDCALL sqlite3_open16(
3428
+SQLITE_API int SQLITE_APICALL sqlite3_open16(
34023429
const void *filename, /* Database filename (UTF-16) */
34033430
sqlite3 **ppDb /* OUT: SQLite db handle */
34043431
);
3405
-SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
3432
+SQLITE_API int SQLITE_APICALL sqlite3_open_v2(
34063433
const char *filename, /* Database filename (UTF-8) */
34073434
sqlite3 **ppDb, /* OUT: SQLite db handle */
34083435
int flags, /* Flags */
34093436
const char *zVfs /* Name of VFS module to use */
34103437
);
@@ -3446,13 +3473,13 @@
34463473
** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and
34473474
** is not a database file pathname pointer that SQLite passed into the xOpen
34483475
** VFS method, then the behavior of this routine is undefined and probably
34493476
** undesirable.
34503477
*/
3451
-SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3452
-SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3453
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
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);
34543481
34553482
34563483
/*
34573484
** CAPI3REF: Error Codes And Messages
34583485
** METHOD: sqlite3
@@ -3492,15 +3519,15 @@
34923519
**
34933520
** If an interface fails with SQLITE_MISUSE, that means the interface
34943521
** was invoked incorrectly by the application. In that case, the
34953522
** error code and message may or may not be set.
34963523
*/
3497
-SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db);
3498
-SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db);
3499
-SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*);
3500
-SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*);
3501
-SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int);
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);
35023529
35033530
/*
35043531
** CAPI3REF: Prepared Statement Object
35053532
** KEYWORDS: {prepared statement} {prepared statements}
35063533
**
@@ -3564,11 +3591,11 @@
35643591
** created by an untrusted script can be contained using the
35653592
** [max_page_count] [PRAGMA].
35663593
**
35673594
** New run-time limit categories may be added in future releases.
35683595
*/
3569
-SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3*, int id, int newVal);
3596
+SQLITE_API int SQLITE_APICALL sqlite3_limit(sqlite3*, int id, int newVal);
35703597
35713598
/*
35723599
** CAPI3REF: Run-Time Limit Categories
35733600
** KEYWORDS: {limit category} {*limit categories}
35743601
**
@@ -3716,32 +3743,32 @@
37163743
** or [GLOB] operator or if the parameter is compared to an indexed column
37173744
** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
37183745
** </li>
37193746
** </ol>
37203747
*/
3721
-SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
3748
+SQLITE_API int SQLITE_APICALL sqlite3_prepare(
37223749
sqlite3 *db, /* Database handle */
37233750
const char *zSql, /* SQL statement, UTF-8 encoded */
37243751
int nByte, /* Maximum length of zSql in bytes. */
37253752
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
37263753
const char **pzTail /* OUT: Pointer to unused portion of zSql */
37273754
);
3728
-SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
3755
+SQLITE_API int SQLITE_APICALL sqlite3_prepare_v2(
37293756
sqlite3 *db, /* Database handle */
37303757
const char *zSql, /* SQL statement, UTF-8 encoded */
37313758
int nByte, /* Maximum length of zSql in bytes. */
37323759
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
37333760
const char **pzTail /* OUT: Pointer to unused portion of zSql */
37343761
);
3735
-SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
3762
+SQLITE_API int SQLITE_APICALL sqlite3_prepare16(
37363763
sqlite3 *db, /* Database handle */
37373764
const void *zSql, /* SQL statement, UTF-16 encoded */
37383765
int nByte, /* Maximum length of zSql in bytes. */
37393766
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
37403767
const void **pzTail /* OUT: Pointer to unused portion of zSql */
37413768
);
3742
-SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
3769
+SQLITE_API int SQLITE_APICALL sqlite3_prepare16_v2(
37433770
sqlite3 *db, /* Database handle */
37443771
const void *zSql, /* SQL statement, UTF-16 encoded */
37453772
int nByte, /* Maximum length of zSql in bytes. */
37463773
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
37473774
const void **pzTail /* OUT: Pointer to unused portion of zSql */
@@ -3776,12 +3803,12 @@
37763803
** automatically freed when the prepared statement is finalized.
37773804
** ^The string returned by sqlite3_expanded_sql(P), on the other hand,
37783805
** is obtained from [sqlite3_malloc()] and must be free by the application
37793806
** by passing it to [sqlite3_free()].
37803807
*/
3781
-SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt);
3782
-SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt);
3808
+SQLITE_API const char *SQLITE_APICALL sqlite3_sql(sqlite3_stmt *pStmt);
3809
+SQLITE_API char *SQLITE_APICALL sqlite3_expanded_sql(sqlite3_stmt *pStmt);
37833810
37843811
/*
37853812
** CAPI3REF: Determine If An SQL Statement Writes The Database
37863813
** METHOD: sqlite3_stmt
37873814
**
@@ -3809,11 +3836,11 @@
38093836
** database. ^The [ATTACH] and [DETACH] statements also cause
38103837
** sqlite3_stmt_readonly() to return true since, while those statements
38113838
** change the configuration of a database connection, they do not make
38123839
** changes to the content of the database files on disk.
38133840
*/
3814
-SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
3841
+SQLITE_API int SQLITE_APICALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
38153842
38163843
/*
38173844
** CAPI3REF: Determine If A Prepared Statement Has Been Reset
38183845
** METHOD: sqlite3_stmt
38193846
**
@@ -3830,11 +3857,11 @@
38303857
** to locate all prepared statements associated with a database
38313858
** connection that are in need of being reset. This can be used,
38323859
** for example, in diagnostic routines to search for prepared
38333860
** statements that are holding a transaction open.
38343861
*/
3835
-SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt*);
3862
+SQLITE_API int SQLITE_APICALL sqlite3_stmt_busy(sqlite3_stmt*);
38363863
38373864
/*
38383865
** CAPI3REF: Dynamically Typed Value Object
38393866
** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
38403867
**
@@ -3994,24 +4021,24 @@
39944021
** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails.
39954022
**
39964023
** See also: [sqlite3_bind_parameter_count()],
39974024
** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].
39984025
*/
3999
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
4000
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
4001
- void(*)(void*));
4002
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt*, int, double);
4003
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt*, int, int);
4004
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
4005
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt*, int);
4006
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
4007
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
4008
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
4009
- void(*)(void*), unsigned char encoding);
4010
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
4011
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
4012
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
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);
40134040
40144041
/*
40154042
** CAPI3REF: Number Of SQL Parameters
40164043
** METHOD: sqlite3_stmt
40174044
**
@@ -4028,11 +4055,11 @@
40284055
**
40294056
** See also: [sqlite3_bind_blob|sqlite3_bind()],
40304057
** [sqlite3_bind_parameter_name()], and
40314058
** [sqlite3_bind_parameter_index()].
40324059
*/
4033
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt*);
4060
+SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_count(sqlite3_stmt*);
40344061
40354062
/*
40364063
** CAPI3REF: Name Of A Host Parameter
40374064
** METHOD: sqlite3_stmt
40384065
**
@@ -4056,11 +4083,11 @@
40564083
**
40574084
** See also: [sqlite3_bind_blob|sqlite3_bind()],
40584085
** [sqlite3_bind_parameter_count()], and
40594086
** [sqlite3_bind_parameter_index()].
40604087
*/
4061
-SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
4088
+SQLITE_API const char *SQLITE_APICALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
40624089
40634090
/*
40644091
** CAPI3REF: Index Of A Parameter With A Given Name
40654092
** METHOD: sqlite3_stmt
40664093
**
@@ -4073,21 +4100,21 @@
40734100
**
40744101
** See also: [sqlite3_bind_blob|sqlite3_bind()],
40754102
** [sqlite3_bind_parameter_count()], and
40764103
** [sqlite3_bind_parameter_name()].
40774104
*/
4078
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
4105
+SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
40794106
40804107
/*
40814108
** CAPI3REF: Reset All Bindings On A Prepared Statement
40824109
** METHOD: sqlite3_stmt
40834110
**
40844111
** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset
40854112
** the [sqlite3_bind_blob | bindings] on a [prepared statement].
40864113
** ^Use this routine to reset all host parameters to NULL.
40874114
*/
4088
-SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt*);
4115
+SQLITE_API int SQLITE_APICALL sqlite3_clear_bindings(sqlite3_stmt*);
40894116
40904117
/*
40914118
** CAPI3REF: Number Of Columns In A Result Set
40924119
** METHOD: sqlite3_stmt
40934120
**
@@ -4095,11 +4122,11 @@
40954122
** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
40964123
** statement that does not return data (for example an [UPDATE]).
40974124
**
40984125
** See also: [sqlite3_data_count()]
40994126
*/
4100
-SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt);
4127
+SQLITE_API int SQLITE_APICALL sqlite3_column_count(sqlite3_stmt *pStmt);
41014128
41024129
/*
41034130
** CAPI3REF: Column Names In A Result Set
41044131
** METHOD: sqlite3_stmt
41054132
**
@@ -4124,12 +4151,12 @@
41244151
** ^The name of a result column is the value of the "AS" clause for
41254152
** that column, if there is an AS clause. If there is no AS clause
41264153
** then the name of the column is unspecified and may change from
41274154
** one release of SQLite to the next.
41284155
*/
4129
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt*, int N);
4130
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt*, int N);
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);
41314158
41324159
/*
41334160
** CAPI3REF: Source Of Data In A Query Result
41344161
** METHOD: sqlite3_stmt
41354162
**
@@ -4173,16 +4200,16 @@
41734200
** If two or more threads call one or more
41744201
** [sqlite3_column_database_name | column metadata interfaces]
41754202
** for the same [prepared statement] and result column
41764203
** at the same time then the results are undefined.
41774204
*/
4178
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int);
4179
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int);
4180
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int);
4181
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int);
4182
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int);
4183
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
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);
41844211
41854212
/*
41864213
** CAPI3REF: Declared Datatype Of A Query Result
41874214
** METHOD: sqlite3_stmt
41884215
**
@@ -4210,12 +4237,12 @@
42104237
** data stored in that column is of the declared type. SQLite is
42114238
** strongly typed, but the typing is dynamic not static. ^Type
42124239
** is associated with individual values, not with the containers
42134240
** used to hold those values.
42144241
*/
4215
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt*,int);
4216
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt*,int);
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);
42174244
42184245
/*
42194246
** CAPI3REF: Evaluate An SQL Statement
42204247
** METHOD: sqlite3_stmt
42214248
**
@@ -4291,11 +4318,11 @@
42914318
** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
42924319
** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,
42934320
** then the more specific [error codes] are returned directly
42944321
** by sqlite3_step(). The use of the "v2" interface is recommended.
42954322
*/
4296
-SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt*);
4323
+SQLITE_API int SQLITE_APICALL sqlite3_step(sqlite3_stmt*);
42974324
42984325
/*
42994326
** CAPI3REF: Number of columns in a result set
43004327
** METHOD: sqlite3_stmt
43014328
**
@@ -4312,11 +4339,11 @@
43124339
** where it always returns zero since each step of that multi-step
43134340
** pragma returns 0 columns of data.
43144341
**
43154342
** See also: [sqlite3_column_count()]
43164343
*/
4317
-SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt);
4344
+SQLITE_API int SQLITE_APICALL sqlite3_data_count(sqlite3_stmt *pStmt);
43184345
43194346
/*
43204347
** CAPI3REF: Fundamental Datatypes
43214348
** KEYWORDS: SQLITE_TEXT
43224349
**
@@ -4502,20 +4529,20 @@
45024529
** of these routines, a default value is returned. The default value
45034530
** is either the integer 0, the floating point number 0.0, or a NULL
45044531
** pointer. Subsequent calls to [sqlite3_errcode()] will return
45054532
** [SQLITE_NOMEM].)^
45064533
*/
4507
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt*, int iCol);
4508
-SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4509
-SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4510
-SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt*, int iCol);
4511
-SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt*, int iCol);
4512
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt*, int iCol);
4513
-SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt*, int iCol);
4514
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt*, int iCol);
4515
-SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt*, int iCol);
4516
-SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt*, int iCol);
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);
45174544
45184545
/*
45194546
** CAPI3REF: Destroy A Prepared Statement Object
45204547
** DESTRUCTOR: sqlite3_stmt
45214548
**
@@ -4539,11 +4566,11 @@
45394566
** resource leaks. It is a grievous error for the application to try to use
45404567
** a prepared statement after it has been finalized. Any use of a prepared
45414568
** statement after it has been finalized can result in undefined and
45424569
** undesirable behavior such as segfaults and heap corruption.
45434570
*/
4544
-SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt);
4571
+SQLITE_API int SQLITE_APICALL sqlite3_finalize(sqlite3_stmt *pStmt);
45454572
45464573
/*
45474574
** CAPI3REF: Reset A Prepared Statement Object
45484575
** METHOD: sqlite3_stmt
45494576
**
@@ -4566,11 +4593,11 @@
45664593
** [sqlite3_reset(S)] returns an appropriate [error code].
45674594
**
45684595
** ^The [sqlite3_reset(S)] interface does not change the values
45694596
** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
45704597
*/
4571
-SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt);
4598
+SQLITE_API int SQLITE_APICALL sqlite3_reset(sqlite3_stmt *pStmt);
45724599
45734600
/*
45744601
** CAPI3REF: Create Or Redefine SQL Functions
45754602
** KEYWORDS: {function creation routines}
45764603
** KEYWORDS: {application-defined SQL function}
@@ -4666,40 +4693,40 @@
46664693
** ^An application-defined function is permitted to call other
46674694
** SQLite interfaces. However, such calls must not
46684695
** close the database connection nor finalize or reset the prepared
46694696
** statement in which the function is running.
46704697
*/
4671
-SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
4698
+SQLITE_API int SQLITE_APICALL sqlite3_create_function(
46724699
sqlite3 *db,
46734700
const char *zFunctionName,
46744701
int nArg,
46754702
int eTextRep,
46764703
void *pApp,
4677
- void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4678
- void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4679
- void (*xFinal)(sqlite3_context*)
4704
+ void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**),
4705
+ void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**),
4706
+ void (SQLITE_CALLBACK *xFinal)(sqlite3_context*)
46804707
);
4681
-SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
4708
+SQLITE_API int SQLITE_APICALL sqlite3_create_function16(
46824709
sqlite3 *db,
46834710
const void *zFunctionName,
46844711
int nArg,
46854712
int eTextRep,
46864713
void *pApp,
4687
- void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4688
- void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4689
- void (*xFinal)(sqlite3_context*)
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*)
46904717
);
4691
-SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
4718
+SQLITE_API int SQLITE_APICALL sqlite3_create_function_v2(
46924719
sqlite3 *db,
46934720
const char *zFunctionName,
46944721
int nArg,
46954722
int eTextRep,
46964723
void *pApp,
4697
- void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4698
- void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4699
- void (*xFinal)(sqlite3_context*),
4700
- void(*xDestroy)(void*)
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*)
47014728
);
47024729
47034730
/*
47044731
** CAPI3REF: Text Encodings
47054732
**
@@ -4732,16 +4759,16 @@
47324759
** to be supported. However, new applications should avoid
47334760
** the use of these functions. To encourage programmers to avoid
47344761
** these functions, we will not explain what they do.
47354762
*/
47364763
#ifndef SQLITE_OMIT_DEPRECATED
4737
-SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context*);
4738
-SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt*);
4739
-SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4740
-SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_global_recover(void);
4741
-SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_thread_cleanup(void);
4742
-SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
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),
47434770
void*,sqlite3_int64);
47444771
#endif
47454772
47464773
/*
47474774
** CAPI3REF: Obtaining SQL Values
@@ -4787,22 +4814,22 @@
47874814
** or [sqlite3_value_text16()].
47884815
**
47894816
** These routines must be called from the same thread as
47904817
** the SQL function that supplied the [sqlite3_value*] parameters.
47914818
*/
4792
-SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value*);
4793
-SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value*);
4794
-SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value*);
4795
-SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value*);
4796
-SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value*);
4797
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value*);
4798
-SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value*);
4799
-SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value*);
4800
-SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value*);
4801
-SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*);
4802
-SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*);
4803
-SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*);
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*);
48044831
48054832
/*
48064833
** CAPI3REF: Finding The Subtype Of SQL Values
48074834
** METHOD: sqlite3_value
48084835
**
@@ -4814,11 +4841,11 @@
48144841
**
48154842
** SQLite makes no use of subtype itself. It merely passes the subtype
48164843
** from the result of one [application-defined SQL function] into the
48174844
** input of another.
48184845
*/
4819
-SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value*);
4846
+SQLITE_API unsigned int SQLITE_APICALL sqlite3_value_subtype(sqlite3_value*);
48204847
48214848
/*
48224849
** CAPI3REF: Copy And Free SQL Values
48234850
** METHOD: sqlite3_value
48244851
**
@@ -4830,12 +4857,12 @@
48304857
**
48314858
** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object
48324859
** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer
48334860
** then sqlite3_value_free(V) is a harmless no-op.
48344861
*/
4835
-SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value*);
4836
-SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value*);
4862
+SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_value_dup(const sqlite3_value*);
4863
+SQLITE_API void SQLITE_APICALL sqlite3_value_free(sqlite3_value*);
48374864
48384865
/*
48394866
** CAPI3REF: Obtain Aggregate Function Context
48404867
** METHOD: sqlite3_context
48414868
**
@@ -4876,11 +4903,11 @@
48764903
** function.
48774904
**
48784905
** This routine must be called from the same thread in which
48794906
** the aggregate SQL function is running.
48804907
*/
4881
-SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
4908
+SQLITE_API void *SQLITE_APICALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
48824909
48834910
/*
48844911
** CAPI3REF: User Data For Functions
48854912
** METHOD: sqlite3_context
48864913
**
@@ -4891,11 +4918,11 @@
48914918
** registered the application defined function.
48924919
**
48934920
** This routine must be called from the same thread in which
48944921
** the application-defined function is running.
48954922
*/
4896
-SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context*);
4923
+SQLITE_API void *SQLITE_APICALL sqlite3_user_data(sqlite3_context*);
48974924
48984925
/*
48994926
** CAPI3REF: Database Connection For Functions
49004927
** METHOD: sqlite3_context
49014928
**
@@ -4903,11 +4930,11 @@
49034930
** the pointer to the [database connection] (the 1st parameter)
49044931
** of the [sqlite3_create_function()]
49054932
** and [sqlite3_create_function16()] routines that originally
49064933
** registered the application defined function.
49074934
*/
4908
-SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context*);
4935
+SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_context_db_handle(sqlite3_context*);
49094936
49104937
/*
49114938
** CAPI3REF: Function Auxiliary Data
49124939
** METHOD: sqlite3_context
49134940
**
@@ -4956,12 +4983,12 @@
49564983
** values and [parameters] and expressions composed from the same.)^
49574984
**
49584985
** These routines must be called from the same thread in which
49594986
** the SQL function is running.
49604987
*/
4961
-SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context*, int N);
4962
-SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
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*));
49634990
49644991
49654992
/*
49664993
** CAPI3REF: Constants Defining Special Destructor Behavior
49674994
**
@@ -4974,11 +5001,11 @@
49745001
** the content before returning.
49755002
**
49765003
** The typedef is necessary to work around problems in certain
49775004
** C++ compilers.
49785005
*/
4979
-typedef void (*sqlite3_destructor_type)(void*);
5006
+typedef void (SQLITE_CALLBACK *sqlite3_destructor_type)(void*);
49805007
#define SQLITE_STATIC ((sqlite3_destructor_type)0)
49815008
#define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1)
49825009
49835010
/*
49845011
** CAPI3REF: Setting The Result Of An SQL Function
@@ -5093,31 +5120,31 @@
50935120
**
50945121
** If these routines are called from within the different thread
50955122
** than the one containing the application-defined function that received
50965123
** the [sqlite3_context] pointer, the results are undefined.
50975124
*/
5098
-SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
5099
-SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(sqlite3_context*,const void*,
5100
- sqlite3_uint64,void(*)(void*));
5101
-SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context*, double);
5102
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context*, const char*, int);
5103
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context*, const void*, int);
5104
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context*);
5105
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context*);
5106
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context*, int);
5107
-SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context*, int);
5108
-SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
5109
-SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context*);
5110
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
5111
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
5112
- void(*)(void*), unsigned char encoding);
5113
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
5114
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
5115
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
5116
-SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
5117
-SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n);
5118
-SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
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);
51195146
51205147
51215148
/*
51225149
** CAPI3REF: Setting The Subtype Of An SQL Function
51235150
** METHOD: sqlite3_context
@@ -5128,11 +5155,11 @@
51285155
** of the subtype T are preserved in current versions of SQLite;
51295156
** higher order bits are discarded.
51305157
** The number of subtype bytes preserved by SQLite might increase
51315158
** in future releases of SQLite.
51325159
*/
5133
-SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context*,unsigned int);
5160
+SQLITE_API void SQLITE_APICALL sqlite3_result_subtype(sqlite3_context*,unsigned int);
51345161
51355162
/*
51365163
** CAPI3REF: Define New Collating Sequences
51375164
** METHOD: sqlite3
51385165
**
@@ -5210,31 +5237,31 @@
52105237
** is unfortunate but cannot be changed without breaking backwards
52115238
** compatibility.
52125239
**
52135240
** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].
52145241
*/
5215
-SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
5242
+SQLITE_API int SQLITE_APICALL sqlite3_create_collation(
52165243
sqlite3*,
52175244
const char *zName,
52185245
int eTextRep,
52195246
void *pArg,
5220
- int(*xCompare)(void*,int,const void*,int,const void*)
5247
+ int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*)
52215248
);
5222
-SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
5249
+SQLITE_API int SQLITE_APICALL sqlite3_create_collation_v2(
52235250
sqlite3*,
52245251
const char *zName,
52255252
int eTextRep,
52265253
void *pArg,
5227
- int(*xCompare)(void*,int,const void*,int,const void*),
5228
- void(*xDestroy)(void*)
5254
+ int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*),
5255
+ void(SQLITE_CALLBACK *xDestroy)(void*)
52295256
);
5230
-SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
5257
+SQLITE_API int SQLITE_APICALL sqlite3_create_collation16(
52315258
sqlite3*,
52325259
const void *zName,
52335260
int eTextRep,
52345261
void *pArg,
5235
- int(*xCompare)(void*,int,const void*,int,const void*)
5262
+ int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*)
52365263
);
52375264
52385265
/*
52395266
** CAPI3REF: Collation Needed Callbacks
52405267
** METHOD: sqlite3
@@ -5260,19 +5287,19 @@
52605287
**
52615288
** The callback function should register the desired collation using
52625289
** [sqlite3_create_collation()], [sqlite3_create_collation16()], or
52635290
** [sqlite3_create_collation_v2()].
52645291
*/
5265
-SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
5292
+SQLITE_API int SQLITE_APICALL sqlite3_collation_needed(
52665293
sqlite3*,
52675294
void*,
5268
- void(*)(void*,sqlite3*,int eTextRep,const char*)
5295
+ void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const char*)
52695296
);
5270
-SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
5297
+SQLITE_API int SQLITE_APICALL sqlite3_collation_needed16(
52715298
sqlite3*,
52725299
void*,
5273
- void(*)(void*,sqlite3*,int eTextRep,const void*)
5300
+ void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const void*)
52745301
);
52755302
52765303
#ifdef SQLITE_HAS_CODEC
52775304
/*
52785305
** Specify the key for an encrypted database. This routine should be
@@ -5279,15 +5306,15 @@
52795306
** called right after sqlite3_open().
52805307
**
52815308
** The code to implement this API is not available in the public release
52825309
** of SQLite.
52835310
*/
5284
-SQLITE_API int SQLITE_STDCALL sqlite3_key(
5311
+SQLITE_API int SQLITE_APICALL sqlite3_key(
52855312
sqlite3 *db, /* Database to be rekeyed */
52865313
const void *pKey, int nKey /* The key */
52875314
);
5288
-SQLITE_API int SQLITE_STDCALL sqlite3_key_v2(
5315
+SQLITE_API int SQLITE_APICALL sqlite3_key_v2(
52895316
sqlite3 *db, /* Database to be rekeyed */
52905317
const char *zDbName, /* Name of the database */
52915318
const void *pKey, int nKey /* The key */
52925319
);
52935320
@@ -5297,35 +5324,35 @@
52975324
** database is decrypted.
52985325
**
52995326
** The code to implement this API is not available in the public release
53005327
** of SQLite.
53015328
*/
5302
-SQLITE_API int SQLITE_STDCALL sqlite3_rekey(
5329
+SQLITE_API int SQLITE_APICALL sqlite3_rekey(
53035330
sqlite3 *db, /* Database to be rekeyed */
53045331
const void *pKey, int nKey /* The new key */
53055332
);
5306
-SQLITE_API int SQLITE_STDCALL sqlite3_rekey_v2(
5333
+SQLITE_API int SQLITE_APICALL sqlite3_rekey_v2(
53075334
sqlite3 *db, /* Database to be rekeyed */
53085335
const char *zDbName, /* Name of the database */
53095336
const void *pKey, int nKey /* The new key */
53105337
);
53115338
53125339
/*
53135340
** Specify the activation key for a SEE database. Unless
53145341
** activated, none of the SEE routines will work.
53155342
*/
5316
-SQLITE_API void SQLITE_STDCALL sqlite3_activate_see(
5343
+SQLITE_API void SQLITE_APICALL sqlite3_activate_see(
53175344
const char *zPassPhrase /* Activation phrase */
53185345
);
53195346
#endif
53205347
53215348
#ifdef SQLITE_ENABLE_CEROD
53225349
/*
53235350
** Specify the activation key for a CEROD database. Unless
53245351
** activated, none of the CEROD routines will work.
53255352
*/
5326
-SQLITE_API void SQLITE_STDCALL sqlite3_activate_cerod(
5353
+SQLITE_API void SQLITE_APICALL sqlite3_activate_cerod(
53275354
const char *zPassPhrase /* Activation phrase */
53285355
);
53295356
#endif
53305357
53315358
/*
@@ -5343,11 +5370,11 @@
53435370
** method of the default [sqlite3_vfs] object. If the xSleep() method
53445371
** of the default VFS is not implemented correctly, or not implemented at
53455372
** all, then the behavior of sqlite3_sleep() may deviate from the description
53465373
** in the previous paragraphs.
53475374
*/
5348
-SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int);
5375
+SQLITE_API int SQLITE_APICALL sqlite3_sleep(int);
53495376
53505377
/*
53515378
** CAPI3REF: Name Of The Folder Holding Temporary Files
53525379
**
53535380
** ^(If this global variable is made to point to a string which is
@@ -5462,11 +5489,11 @@
54625489
**
54635490
** If another thread changes the autocommit status of the database
54645491
** connection while this routine is running, then the return value
54655492
** is undefined.
54665493
*/
5467
-SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3*);
5494
+SQLITE_API int SQLITE_APICALL sqlite3_get_autocommit(sqlite3*);
54685495
54695496
/*
54705497
** CAPI3REF: Find The Database Handle Of A Prepared Statement
54715498
** METHOD: sqlite3_stmt
54725499
**
@@ -5475,11 +5502,11 @@
54755502
** returned by sqlite3_db_handle is the same [database connection]
54765503
** that was the first argument
54775504
** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
54785505
** create the statement in the first place.
54795506
*/
5480
-SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt*);
5507
+SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_db_handle(sqlite3_stmt*);
54815508
54825509
/*
54835510
** CAPI3REF: Return The Filename For A Database Connection
54845511
** METHOD: sqlite3
54855512
**
@@ -5492,21 +5519,21 @@
54925519
** ^The filename returned by this function is the output of the
54935520
** xFullPathname method of the [VFS]. ^In other words, the filename
54945521
** will be an absolute pathname, even if the filename used
54955522
** to open the database originally was a URI or relative pathname.
54965523
*/
5497
-SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
5524
+SQLITE_API const char *SQLITE_APICALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
54985525
54995526
/*
55005527
** CAPI3REF: Determine if a database is read-only
55015528
** METHOD: sqlite3
55025529
**
55035530
** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N
55045531
** of connection D is read-only, 0 if it is read/write, or -1 if N is not
55055532
** the name of a database on connection D.
55065533
*/
5507
-SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
5534
+SQLITE_API int SQLITE_APICALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
55085535
55095536
/*
55105537
** CAPI3REF: Find the next prepared statement
55115538
** METHOD: sqlite3
55125539
**
@@ -5518,11 +5545,11 @@
55185545
**
55195546
** The [database connection] pointer D in a call to
55205547
** [sqlite3_next_stmt(D,S)] must refer to an open database
55215548
** connection and in particular must not be a NULL pointer.
55225549
*/
5523
-SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
5550
+SQLITE_API sqlite3_stmt *SQLITE_APICALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
55245551
55255552
/*
55265553
** CAPI3REF: Commit And Rollback Notification Callbacks
55275554
** METHOD: sqlite3
55285555
**
@@ -5567,12 +5594,12 @@
55675594
** ^The rollback callback is not invoked if a transaction is
55685595
** automatically rolled back because the database connection is closed.
55695596
**
55705597
** See also the [sqlite3_update_hook()] interface.
55715598
*/
5572
-SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
5573
-SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
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*);
55745601
55755602
/*
55765603
** CAPI3REF: Data Change Notification Callbacks
55775604
** METHOD: sqlite3
55785605
**
@@ -5619,13 +5646,13 @@
56195646
** the first call on D.
56205647
**
56215648
** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()],
56225649
** and [sqlite3_preupdate_hook()] interfaces.
56235650
*/
5624
-SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
5651
+SQLITE_API void *SQLITE_APICALL sqlite3_update_hook(
56255652
sqlite3*,
5626
- void(*)(void *,int ,char const *,char const *,sqlite3_int64),
5653
+ void(SQLITE_CALLBACK *)(void *,int ,char const *,char const *,sqlite3_int64),
56275654
void*
56285655
);
56295656
56305657
/*
56315658
** CAPI3REF: Enable Or Disable Shared Pager Cache
@@ -5659,11 +5686,11 @@
56595686
** This interface is threadsafe on processors where writing a
56605687
** 32-bit integer is atomic.
56615688
**
56625689
** See Also: [SQLite Shared-Cache Mode]
56635690
*/
5664
-SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int);
5691
+SQLITE_API int SQLITE_APICALL sqlite3_enable_shared_cache(int);
56655692
56665693
/*
56675694
** CAPI3REF: Attempt To Free Heap Memory
56685695
**
56695696
** ^The sqlite3_release_memory() interface attempts to free N bytes
@@ -5675,11 +5702,11 @@
56755702
** ^The sqlite3_release_memory() routine is a no-op returning zero
56765703
** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].
56775704
**
56785705
** See also: [sqlite3_db_release_memory()]
56795706
*/
5680
-SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int);
5707
+SQLITE_API int SQLITE_APICALL sqlite3_release_memory(int);
56815708
56825709
/*
56835710
** CAPI3REF: Free Memory Used By A Database Connection
56845711
** METHOD: sqlite3
56855712
**
@@ -5689,11 +5716,11 @@
56895716
** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
56905717
** omitted.
56915718
**
56925719
** See also: [sqlite3_release_memory()]
56935720
*/
5694
-SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3*);
5721
+SQLITE_API int SQLITE_APICALL sqlite3_db_release_memory(sqlite3*);
56955722
56965723
/*
56975724
** CAPI3REF: Impose A Limit On Heap Size
56985725
**
56995726
** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the
@@ -5741,11 +5768,11 @@
57415768
** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT].
57425769
**
57435770
** The circumstances under which SQLite will enforce the soft heap limit may
57445771
** changes in future releases of SQLite.
57455772
*/
5746
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
5773
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
57475774
57485775
/*
57495776
** CAPI3REF: Deprecated Soft Heap Limit Interface
57505777
** DEPRECATED
57515778
**
@@ -5752,11 +5779,11 @@
57525779
** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
57535780
** interface. This routine is provided for historical compatibility
57545781
** only. All new applications should use the
57555782
** [sqlite3_soft_heap_limit64()] interface rather than this one.
57565783
*/
5757
-SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_soft_heap_limit(int N);
5784
+SQLITE_API SQLITE_DEPRECATED void SQLITE_APICALL sqlite3_soft_heap_limit(int N);
57585785
57595786
57605787
/*
57615788
** CAPI3REF: Extract Metadata About A Column Of A Table
57625789
** METHOD: sqlite3
@@ -5822,11 +5849,11 @@
58225849
**
58235850
** ^This function causes all database schemas to be read from disk and
58245851
** parsed, if that has not already been done, and returns an error if
58255852
** any errors are encountered while loading the schema.
58265853
*/
5827
-SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
5854
+SQLITE_API int SQLITE_APICALL sqlite3_table_column_metadata(
58285855
sqlite3 *db, /* Connection handle */
58295856
const char *zDbName, /* Database name or NULL */
58305857
const char *zTableName, /* Table name */
58315858
const char *zColumnName, /* Column name */
58325859
char const **pzDataType, /* OUTPUT: Declared data type */
@@ -5878,11 +5905,11 @@
58785905
** disabled and prevent SQL injections from giving attackers
58795906
** access to extension loading capabilities.
58805907
**
58815908
** See also the [load_extension() SQL function].
58825909
*/
5883
-SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
5910
+SQLITE_API int SQLITE_APICALL sqlite3_load_extension(
58845911
sqlite3 *db, /* Load the extension into this database connection */
58855912
const char *zFile, /* Name of the shared library containing extension */
58865913
const char *zProc, /* Entry point. Derived from zFile if 0 */
58875914
char **pzErrMsg /* Put error message here if not 0 */
58885915
);
@@ -5910,11 +5937,11 @@
59105937
** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method
59115938
** rather than this interface, so the [load_extension()] SQL function
59125939
** remains disabled. This will prevent SQL injections from giving attackers
59135940
** access to extension loading capabilities.
59145941
*/
5915
-SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
5942
+SQLITE_API int SQLITE_APICALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
59165943
59175944
/*
59185945
** CAPI3REF: Automatically Load Statically Linked Extensions
59195946
**
59205947
** ^This interface causes the xEntryPoint() function to be invoked for
@@ -5922,11 +5949,11 @@
59225949
** xEntryPoint() is the entry point for a statically linked [SQLite extension]
59235950
** that is to be automatically loaded into all new database connections.
59245951
**
59255952
** ^(Even though the function prototype shows that xEntryPoint() takes
59265953
** no arguments and returns void, SQLite invokes xEntryPoint() with three
5927
-** arguments and expects and integer result as if the signature of the
5954
+** arguments and expects an integer result as if the signature of the
59285955
** entry point where as follows:
59295956
**
59305957
** <blockquote><pre>
59315958
** &nbsp; int xEntryPoint(
59325959
** &nbsp; sqlite3 *db,
@@ -5948,11 +5975,11 @@
59485975
** will be called more than once for each database connection that is opened.
59495976
**
59505977
** See also: [sqlite3_reset_auto_extension()]
59515978
** and [sqlite3_cancel_auto_extension()]
59525979
*/
5953
-SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void (*xEntryPoint)(void));
5980
+SQLITE_API int SQLITE_APICALL sqlite3_auto_extension(void(SQLITE_CALLBACK *xEntryPoint)(void));
59545981
59555982
/*
59565983
** CAPI3REF: Cancel Automatic Extension Loading
59575984
**
59585985
** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
@@ -5960,19 +5987,19 @@
59605987
** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)]
59615988
** routine returns 1 if initialization routine X was successfully
59625989
** unregistered and it returns 0 if X was not on the list of initialization
59635990
** routines.
59645991
*/
5965
-SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void (*xEntryPoint)(void));
5992
+SQLITE_API int SQLITE_APICALL sqlite3_cancel_auto_extension(void(SQLITE_CALLBACK *xEntryPoint)(void));
59665993
59675994
/*
59685995
** CAPI3REF: Reset Automatic Extension Loading
59695996
**
59705997
** ^This interface disables all automatic extensions previously
59715998
** registered using [sqlite3_auto_extension()].
59725999
*/
5973
-SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void);
6000
+SQLITE_API void SQLITE_APICALL sqlite3_reset_auto_extension(void);
59746001
59756002
/*
59766003
** The interface to the virtual-table mechanism is currently considered
59776004
** to be experimental. The interface might change in incompatible ways.
59786005
** If this is a problem for you, do not use the interface at this time.
@@ -6005,41 +6032,41 @@
60056032
** of this structure must not change while it is registered with
60066033
** any database connection.
60076034
*/
60086035
struct sqlite3_module {
60096036
int iVersion;
6010
- int (*xCreate)(sqlite3*, void *pAux,
6011
- int argc, const char *const*argv,
6012
- sqlite3_vtab **ppVTab, char**);
6013
- int (*xConnect)(sqlite3*, void *pAux,
6014
- int argc, const char *const*argv,
6015
- sqlite3_vtab **ppVTab, char**);
6016
- int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
6017
- int (*xDisconnect)(sqlite3_vtab *pVTab);
6018
- int (*xDestroy)(sqlite3_vtab *pVTab);
6019
- int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);
6020
- int (*xClose)(sqlite3_vtab_cursor*);
6021
- int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
6022
- int argc, sqlite3_value **argv);
6023
- int (*xNext)(sqlite3_vtab_cursor*);
6024
- int (*xEof)(sqlite3_vtab_cursor*);
6025
- int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int);
6026
- int (*xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid);
6027
- int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *);
6028
- int (*xBegin)(sqlite3_vtab *pVTab);
6029
- int (*xSync)(sqlite3_vtab *pVTab);
6030
- int (*xCommit)(sqlite3_vtab *pVTab);
6031
- int (*xRollback)(sqlite3_vtab *pVTab);
6032
- int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,
6033
- void (**pxFunc)(sqlite3_context*,int,sqlite3_value**),
6034
- void **ppArg);
6035
- int (*xRename)(sqlite3_vtab *pVtab, const char *zNew);
6036
- /* The methods above are in version 1 of the sqlite_module object. Those
6037
- ** below are for version 2 and greater. */
6038
- int (*xSavepoint)(sqlite3_vtab *pVTab, int);
6039
- int (*xRelease)(sqlite3_vtab *pVTab, int);
6040
- int (*xRollbackTo)(sqlite3_vtab *pVTab, int);
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);
60416068
};
60426069
60436070
/*
60446071
** CAPI3REF: Virtual Table Indexing Information
60456072
** KEYWORDS: sqlite3_index_info
@@ -6213,22 +6240,22 @@
62136240
** be invoked if the call to sqlite3_create_module_v2() fails.
62146241
** ^The sqlite3_create_module()
62156242
** interface is equivalent to sqlite3_create_module_v2() with a NULL
62166243
** destructor.
62176244
*/
6218
-SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
6245
+SQLITE_API int SQLITE_APICALL sqlite3_create_module(
62196246
sqlite3 *db, /* SQLite connection to register module with */
62206247
const char *zName, /* Name of the module */
62216248
const sqlite3_module *p, /* Methods for the module */
62226249
void *pClientData /* Client data for xCreate/xConnect */
62236250
);
6224
-SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
6251
+SQLITE_API int SQLITE_APICALL sqlite3_create_module_v2(
62256252
sqlite3 *db, /* SQLite connection to register module with */
62266253
const char *zName, /* Name of the module */
62276254
const sqlite3_module *p, /* Methods for the module */
62286255
void *pClientData, /* Client data for xCreate/xConnect */
6229
- void(*xDestroy)(void*) /* Module destructor function */
6256
+ void(SQLITE_CALLBACK *xDestroy)(void*) /* Module destructor function */
62306257
);
62316258
62326259
/*
62336260
** CAPI3REF: Virtual Table Instance Object
62346261
** KEYWORDS: sqlite3_vtab
@@ -6282,11 +6309,11 @@
62826309
** ^The [xCreate] and [xConnect] methods of a
62836310
** [virtual table module] call this interface
62846311
** to declare the format (the names and datatypes of the columns) of
62856312
** the virtual tables they implement.
62866313
*/
6287
-SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
6314
+SQLITE_API int SQLITE_APICALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
62886315
62896316
/*
62906317
** CAPI3REF: Overload A Function For A Virtual Table
62916318
** METHOD: sqlite3
62926319
**
@@ -6301,11 +6328,11 @@
63016328
** of the new function always causes an exception to be thrown. So
63026329
** the new function is not good for anything by itself. Its only
63036330
** purpose is to be a placeholder function that can be overloaded
63046331
** by a [virtual table].
63056332
*/
6306
-SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
6333
+SQLITE_API int SQLITE_APICALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
63076334
63086335
/*
63096336
** The interface to the virtual-table mechanism defined above (back up
63106337
** to a comment remarkably similar to this one) is currently considered
63116338
** to be experimental. The interface might change in incompatible ways.
@@ -6400,11 +6427,11 @@
64006427
** zero-filled blob to read or write using the incremental-blob interface.
64016428
**
64026429
** To avoid a resource leak, every open [BLOB handle] should eventually
64036430
** be released by a call to [sqlite3_blob_close()].
64046431
*/
6405
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
6432
+SQLITE_API int SQLITE_APICALL sqlite3_blob_open(
64066433
sqlite3*,
64076434
const char *zDb,
64086435
const char *zTable,
64096436
const char *zColumn,
64106437
sqlite3_int64 iRow,
@@ -6433,11 +6460,11 @@
64336460
** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
64346461
** always returns zero.
64356462
**
64366463
** ^This function sets the database handle error code and message.
64376464
*/
6438
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
6465
+SQLITE_API int SQLITE_APICALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
64396466
64406467
/*
64416468
** CAPI3REF: Close A BLOB Handle
64426469
** DESTRUCTOR: sqlite3_blob
64436470
**
@@ -6456,11 +6483,11 @@
64566483
** with a null pointer (such as would be returned by a failed call to
64576484
** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function
64586485
** is passed a valid open blob handle, the values returned by the
64596486
** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning.
64606487
*/
6461
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *);
6488
+SQLITE_API int SQLITE_APICALL sqlite3_blob_close(sqlite3_blob *);
64626489
64636490
/*
64646491
** CAPI3REF: Return The Size Of An Open BLOB
64656492
** METHOD: sqlite3_blob
64666493
**
@@ -6472,11 +6499,11 @@
64726499
** This routine only works on a [BLOB handle] which has been created
64736500
** by a prior successful call to [sqlite3_blob_open()] and which has not
64746501
** been closed by [sqlite3_blob_close()]. Passing any other pointer in
64756502
** to this routine results in undefined and probably undesirable behavior.
64766503
*/
6477
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *);
6504
+SQLITE_API int SQLITE_APICALL sqlite3_blob_bytes(sqlite3_blob *);
64786505
64796506
/*
64806507
** CAPI3REF: Read Data From A BLOB Incrementally
64816508
** METHOD: sqlite3_blob
64826509
**
@@ -6501,11 +6528,11 @@
65016528
** been closed by [sqlite3_blob_close()]. Passing any other pointer in
65026529
** to this routine results in undefined and probably undesirable behavior.
65036530
**
65046531
** See also: [sqlite3_blob_write()].
65056532
*/
6506
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
6533
+SQLITE_API int SQLITE_APICALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
65076534
65086535
/*
65096536
** CAPI3REF: Write Data Into A BLOB Incrementally
65106537
** METHOD: sqlite3_blob
65116538
**
@@ -6543,11 +6570,11 @@
65436570
** been closed by [sqlite3_blob_close()]. Passing any other pointer in
65446571
** to this routine results in undefined and probably undesirable behavior.
65456572
**
65466573
** See also: [sqlite3_blob_read()].
65476574
*/
6548
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
6575
+SQLITE_API int SQLITE_APICALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
65496576
65506577
/*
65516578
** CAPI3REF: Virtual File System Objects
65526579
**
65536580
** A virtual filesystem (VFS) is an [sqlite3_vfs] object
@@ -6574,13 +6601,13 @@
65746601
**
65756602
** ^Unregister a VFS with the sqlite3_vfs_unregister() interface.
65766603
** ^(If the default VFS is unregistered, another VFS is chosen as
65776604
** the default. The choice for the new VFS is arbitrary.)^
65786605
*/
6579
-SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfsName);
6580
-SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
6581
-SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs*);
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*);
65826609
65836610
/*
65846611
** CAPI3REF: Mutexes
65856612
**
65866613
** The SQLite core uses these routines for thread
@@ -6692,15 +6719,15 @@
66926719
** sqlite3_mutex_leave() is a NULL pointer, then all three routines
66936720
** behave as no-ops.
66946721
**
66956722
** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
66966723
*/
6697
-SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int);
6698
-SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*);
6699
-SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*);
6700
-SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*);
6701
-SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*);
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*);
67026729
67036730
/*
67046731
** CAPI3REF: Mutex Methods Object
67056732
**
67066733
** An instance of this structure defines the low-level routines
@@ -6765,19 +6792,19 @@
67656792
** If xMutexInit fails in any way, it is expected to clean up after itself
67666793
** prior to returning.
67676794
*/
67686795
typedef struct sqlite3_mutex_methods sqlite3_mutex_methods;
67696796
struct sqlite3_mutex_methods {
6770
- int (*xMutexInit)(void);
6771
- int (*xMutexEnd)(void);
6772
- sqlite3_mutex *(*xMutexAlloc)(int);
6773
- void (*xMutexFree)(sqlite3_mutex *);
6774
- void (*xMutexEnter)(sqlite3_mutex *);
6775
- int (*xMutexTry)(sqlite3_mutex *);
6776
- void (*xMutexLeave)(sqlite3_mutex *);
6777
- int (*xMutexHeld)(sqlite3_mutex *);
6778
- int (*xMutexNotheld)(sqlite3_mutex *);
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 *);
67796806
};
67806807
67816808
/*
67826809
** CAPI3REF: Mutex Verification Routines
67836810
**
@@ -6806,12 +6833,12 @@
68066833
** call to sqlite3_mutex_held() to fail, so a non-zero return is
68076834
** the appropriate thing to do. The sqlite3_mutex_notheld()
68086835
** interface should also return 1 when given a NULL pointer.
68096836
*/
68106837
#ifndef NDEBUG
6811
-SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex*);
6812
-SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex*);
6838
+SQLITE_API int SQLITE_APICALL sqlite3_mutex_held(sqlite3_mutex*);
6839
+SQLITE_API int SQLITE_APICALL sqlite3_mutex_notheld(sqlite3_mutex*);
68136840
#endif
68146841
68156842
/*
68166843
** CAPI3REF: Mutex Types
68176844
**
@@ -6847,11 +6874,11 @@
68476874
** serializes access to the [database connection] given in the argument
68486875
** when the [threading mode] is Serialized.
68496876
** ^If the [threading mode] is Single-thread or Multi-thread then this
68506877
** routine returns a NULL pointer.
68516878
*/
6852
-SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3*);
6879
+SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_db_mutex(sqlite3*);
68536880
68546881
/*
68556882
** CAPI3REF: Low-Level Control Of Database Files
68566883
** METHOD: sqlite3
68576884
**
@@ -6882,11 +6909,11 @@
68826909
** an incorrect zDbName and an SQLITE_ERROR return from the underlying
68836910
** xFileControl method.
68846911
**
68856912
** See also: [SQLITE_FCNTL_LOCKSTATE]
68866913
*/
6887
-SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
6914
+SQLITE_API int SQLITE_APICALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
68886915
68896916
/*
68906917
** CAPI3REF: Testing Interface
68916918
**
68926919
** ^The sqlite3_test_control() interface is used to read out internal
@@ -6964,12 +6991,12 @@
69646991
** be represented by a 32-bit integer, then the values returned by
69656992
** sqlite3_status() are undefined.
69666993
**
69676994
** See also: [sqlite3_db_status()]
69686995
*/
6969
-SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6970
-SQLITE_API int SQLITE_STDCALL sqlite3_status64(
6996
+SQLITE_API int SQLITE_APICALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6997
+SQLITE_API int SQLITE_APICALL sqlite3_status64(
69716998
int op,
69726999
sqlite3_int64 *pCurrent,
69737000
sqlite3_int64 *pHighwater,
69747001
int resetFlag
69757002
);
@@ -7090,11 +7117,11 @@
70907117
** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a
70917118
** non-zero [error code] on failure.
70927119
**
70937120
** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
70947121
*/
7095
-SQLITE_API int SQLITE_STDCALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
7122
+SQLITE_API int SQLITE_APICALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
70967123
70977124
/*
70987125
** CAPI3REF: Status Parameters for database connections
70997126
** KEYWORDS: {SQLITE_DBSTATUS options}
71007127
**
@@ -7233,11 +7260,11 @@
72337260
** ^If the resetFlg is true, then the counter is reset to zero after this
72347261
** interface call returns.
72357262
**
72367263
** See also: [sqlite3_status()] and [sqlite3_db_status()].
72377264
*/
7238
-SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
7265
+SQLITE_API int SQLITE_APICALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
72397266
72407267
/*
72417268
** CAPI3REF: Status Parameters for prepared statements
72427269
** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters}
72437270
**
@@ -7469,22 +7496,22 @@
74697496
*/
74707497
typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2;
74717498
struct sqlite3_pcache_methods2 {
74727499
int iVersion;
74737500
void *pArg;
7474
- int (*xInit)(void*);
7475
- void (*xShutdown)(void*);
7476
- sqlite3_pcache *(*xCreate)(int szPage, int szExtra, int bPurgeable);
7477
- void (*xCachesize)(sqlite3_pcache*, int nCachesize);
7478
- int (*xPagecount)(sqlite3_pcache*);
7479
- sqlite3_pcache_page *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7480
- void (*xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard);
7481
- void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*,
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*,
74827509
unsigned oldKey, unsigned newKey);
7483
- void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
7484
- void (*xDestroy)(sqlite3_pcache*);
7485
- void (*xShrink)(sqlite3_pcache*);
7510
+ void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit);
7511
+ void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*);
7512
+ void (SQLITE_CALLBACK *xShrink)(sqlite3_pcache*);
74867513
};
74877514
74887515
/*
74897516
** This is the obsolete pcache_methods object that has now been replaced
74907517
** by sqlite3_pcache_methods2. This object is not used by SQLite. It is
@@ -7491,20 +7518,20 @@
74917518
** retained in the header file for backwards compatibility only.
74927519
*/
74937520
typedef struct sqlite3_pcache_methods sqlite3_pcache_methods;
74947521
struct sqlite3_pcache_methods {
74957522
void *pArg;
7496
- int (*xInit)(void*);
7497
- void (*xShutdown)(void*);
7498
- sqlite3_pcache *(*xCreate)(int szPage, int bPurgeable);
7499
- void (*xCachesize)(sqlite3_pcache*, int nCachesize);
7500
- int (*xPagecount)(sqlite3_pcache*);
7501
- void *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7502
- void (*xUnpin)(sqlite3_pcache*, void*, int discard);
7503
- void (*xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey);
7504
- void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
7505
- void (*xDestroy)(sqlite3_pcache*);
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*);
75067533
};
75077534
75087535
75097536
/*
75107537
** CAPI3REF: Online Backup Object
@@ -7702,20 +7729,20 @@
77027729
** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()
77037730
** APIs are not strictly speaking threadsafe. If they are invoked at the
77047731
** same time as another thread is invoking sqlite3_backup_step() it is
77057732
** possible that they return invalid values.
77067733
*/
7707
-SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
7734
+SQLITE_API sqlite3_backup *SQLITE_APICALL sqlite3_backup_init(
77087735
sqlite3 *pDest, /* Destination database handle */
77097736
const char *zDestName, /* Destination database name */
77107737
sqlite3 *pSource, /* Source database handle */
77117738
const char *zSourceName /* Source database name */
77127739
);
7713
-SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage);
7714
-SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p);
7715
-SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p);
7716
-SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p);
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);
77177744
77187745
/*
77197746
** CAPI3REF: Unlock Notification
77207747
** METHOD: sqlite3
77217748
**
@@ -7828,13 +7855,13 @@
78287855
** by an sqlite3_step() call. ^(If there is a blocking connection, then the
78297856
** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in
78307857
** the special "DROP TABLE/INDEX" case, the extended error code is just
78317858
** SQLITE_LOCKED.)^
78327859
*/
7833
-SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
7860
+SQLITE_API int SQLITE_APICALL sqlite3_unlock_notify(
78347861
sqlite3 *pBlocked, /* Waiting connection */
7835
- void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */
7862
+ void (SQLITE_CALLBACK *xNotify)(void **apArg, int nArg), /* Callback function to invoke */
78367863
void *pNotifyArg /* Argument to pass to xNotify */
78377864
);
78387865
78397866
78407867
/*
@@ -7843,12 +7870,12 @@
78437870
** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications
78447871
** and extensions to compare the contents of two buffers containing UTF-8
78457872
** strings in a case-independent fashion, using the same definition of "case
78467873
** independence" that SQLite uses internally when comparing identifiers.
78477874
*/
7848
-SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *, const char *);
7849
-SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *, const char *, int);
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);
78507877
78517878
/*
78527879
** CAPI3REF: String Globbing
78537880
*
78547881
** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if
@@ -7861,11 +7888,11 @@
78617888
** Note that this routine returns zero on a match and non-zero if the strings
78627889
** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
78637890
**
78647891
** See also: [sqlite3_strlike()].
78657892
*/
7866
-SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlob, const char *zStr);
7893
+SQLITE_API int SQLITE_APICALL sqlite3_strglob(const char *zGlob, const char *zStr);
78677894
78687895
/*
78697896
** CAPI3REF: String LIKE Matching
78707897
*
78717898
** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if
@@ -7884,11 +7911,11 @@
78847911
** Note that this routine returns zero on a match and non-zero if the strings
78857912
** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
78867913
**
78877914
** See also: [sqlite3_strglob()].
78887915
*/
7889
-SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
7916
+SQLITE_API int SQLITE_APICALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
78907917
78917918
/*
78927919
** CAPI3REF: Error Logging Interface
78937920
**
78947921
** ^The [sqlite3_log()] interface writes a message into the [error log]
@@ -7943,13 +7970,13 @@
79437970
** previously registered write-ahead log callback. ^Note that the
79447971
** [sqlite3_wal_autocheckpoint()] interface and the
79457972
** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will
79467973
** overwrite any prior [sqlite3_wal_hook()] settings.
79477974
*/
7948
-SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
7975
+SQLITE_API void *SQLITE_APICALL sqlite3_wal_hook(
79497976
sqlite3*,
7950
- int(*)(void *,sqlite3*,const char*,int),
7977
+ int(SQLITE_CALLBACK *)(void *,sqlite3*,const char*,int),
79517978
void*
79527979
);
79537980
79547981
/*
79557982
** CAPI3REF: Configure an auto-checkpoint
@@ -7978,11 +8005,11 @@
79788005
** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]
79798006
** pages. The use of this interface
79808007
** is only necessary if the default setting is found to be suboptimal
79818008
** for a particular application.
79828009
*/
7983
-SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
8010
+SQLITE_API int SQLITE_APICALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
79848011
79858012
/*
79868013
** CAPI3REF: Checkpoint a database
79878014
** METHOD: sqlite3
79888015
**
@@ -8000,11 +8027,11 @@
80008027
** interface was added. This interface is retained for backwards
80018028
** compatibility and as a convenience for applications that need to manually
80028029
** start a callback but which do not need the full power (and corresponding
80038030
** complication) of [sqlite3_wal_checkpoint_v2()].
80048031
*/
8005
-SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
8032
+SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
80068033
80078034
/*
80088035
** CAPI3REF: Checkpoint a database
80098036
** METHOD: sqlite3
80108037
**
@@ -8094,11 +8121,11 @@
80948121
** [sqlite3_errcode()] and [sqlite3_errmsg()].
80958122
**
80968123
** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface
80978124
** from SQL.
80988125
*/
8099
-SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
8126
+SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint_v2(
81008127
sqlite3 *db, /* Database handle */
81018128
const char *zDb, /* Name of attached database (or NULL) */
81028129
int eMode, /* SQLITE_CHECKPOINT_* value */
81038130
int *pnLog, /* OUT: Size of WAL log in frames */
81048131
int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -8183,11 +8210,11 @@
81838210
** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL],
81848211
** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode
81858212
** of the SQL statement that triggered the call to the [xUpdate] method of the
81868213
** [virtual table].
81878214
*/
8188
-SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *);
8215
+SQLITE_API int SQLITE_APICALL sqlite3_vtab_on_conflict(sqlite3 *);
81898216
81908217
/*
81918218
** CAPI3REF: Conflict resolution modes
81928219
** KEYWORDS: {conflict resolution mode}
81938220
**
@@ -8288,11 +8315,11 @@
82888315
** as if the loop did not exist - it returns non-zero and leave the variable
82898316
** that pOut points to unchanged.
82908317
**
82918318
** See also: [sqlite3_stmt_scanstatus_reset()]
82928319
*/
8293
-SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus(
8320
+SQLITE_API int SQLITE_APICALL sqlite3_stmt_scanstatus(
82948321
sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
82958322
int idx, /* Index of loop to report on */
82968323
int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
82978324
void *pOut /* Result written here */
82988325
);
@@ -8304,11 +8331,11 @@
83048331
** ^Zero all [sqlite3_stmt_scanstatus()] related event counters.
83058332
**
83068333
** This API is only available if the library is built with pre-processor
83078334
** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined.
83088335
*/
8309
-SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
8336
+SQLITE_API void SQLITE_APICALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
83108337
83118338
/*
83128339
** CAPI3REF: Flush caches to disk mid-transaction
83138340
**
83148341
** ^If a write-transaction is open on [database connection] D when the
@@ -8336,11 +8363,11 @@
83368363
** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK.
83378364
**
83388365
** ^This function does not set the database handle error code or message
83398366
** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions.
83408367
*/
8341
-SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3*);
8368
+SQLITE_API int SQLITE_APICALL sqlite3_db_cacheflush(sqlite3*);
83428369
83438370
/*
83448371
** CAPI3REF: The pre-update hook.
83458372
**
83468373
** ^These interfaces are only available if SQLite is compiled using the
@@ -8416,13 +8443,13 @@
84168443
** triggers; or 2 for changes resulting from triggers called by top-level
84178444
** triggers; and so forth.
84188445
**
84198446
** See also: [sqlite3_update_hook()]
84208447
*/
8421
-SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_STDCALL sqlite3_preupdate_hook(
8448
+SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_APICALL sqlite3_preupdate_hook(
84228449
sqlite3 *db,
8423
- void(*xPreUpdate)(
8450
+ void(SQLITE_CALLBACK *xPreUpdate)(
84248451
void *pCtx, /* Copy of third arg to preupdate_hook() */
84258452
sqlite3 *db, /* Database handle */
84268453
int op, /* SQLITE_UPDATE, DELETE or INSERT */
84278454
char const *zDb, /* Database name */
84288455
char const *zName, /* Table name */
@@ -8429,14 +8456,14 @@
84298456
sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */
84308457
sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */
84318458
),
84328459
void*
84338460
);
8434
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **);
8435
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *);
8436
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *);
8437
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **);
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 **);
84388465
84398466
/*
84408467
** CAPI3REF: Low-level system error code
84418468
**
84428469
** ^Attempt to return the underlying operating system error code or error
@@ -8444,11 +8471,11 @@
84448471
** The return value is OS-dependent. For example, on unix systems, after
84458472
** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be
84468473
** called to get back the underlying "errno" that caused the problem, such
84478474
** as ENOSPC, EAUTH, EISDIR, and so forth.
84488475
*/
8449
-SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3*);
8476
+SQLITE_API int SQLITE_APICALL sqlite3_system_errno(sqlite3*);
84508477
84518478
/*
84528479
** CAPI3REF: Database Snapshot
84538480
** KEYWORDS: {snapshot}
84548481
** EXPERIMENTAL
@@ -8494,11 +8521,11 @@
84948521
** to avoid a memory leak.
84958522
**
84968523
** The [sqlite3_snapshot_get()] interface is only available when the
84978524
** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
84988525
*/
8499
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_get(
8526
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_get(
85008527
sqlite3 *db,
85018528
const char *zSchema,
85028529
sqlite3_snapshot **ppSnapshot
85038530
);
85048531
@@ -8532,11 +8559,11 @@
85328559
** database connection in order to make it ready to use snapshots.)
85338560
**
85348561
** The [sqlite3_snapshot_open()] interface is only available when the
85358562
** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
85368563
*/
8537
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_open(
8564
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_open(
85388565
sqlite3 *db,
85398566
const char *zSchema,
85408567
sqlite3_snapshot *pSnapshot
85418568
);
85428569
@@ -8549,11 +8576,11 @@
85498576
** using this routine to avoid a memory leak.
85508577
**
85518578
** The [sqlite3_snapshot_free()] interface is only available when the
85528579
** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
85538580
*/
8554
-SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot*);
8581
+SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_APICALL sqlite3_snapshot_free(sqlite3_snapshot*);
85558582
85568583
/*
85578584
** CAPI3REF: Compare the ages of two snapshot handles.
85588585
** EXPERIMENTAL
85598586
**
@@ -8573,11 +8600,11 @@
85738600
**
85748601
** Otherwise, this API returns a negative value if P1 refers to an older
85758602
** snapshot than P2, zero if the two handles refer to the same database
85768603
** snapshot, and a positive value if P1 is a newer snapshot than P2.
85778604
*/
8578
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_cmp(
8605
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_cmp(
85798606
sqlite3_snapshot *p1,
85808607
sqlite3_snapshot *p2
85818608
);
85828609
85838610
/*
@@ -8631,14 +8658,14 @@
86318658
** Register a geometry callback named zGeom that can be used as part of an
86328659
** R-Tree geometry query as follows:
86338660
**
86348661
** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
86358662
*/
8636
-SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
8663
+SQLITE_API int SQLITE_APICALL sqlite3_rtree_geometry_callback(
86378664
sqlite3 *db,
86388665
const char *zGeom,
8639
- int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
8666
+ int (SQLITE_CALLBACK *xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
86408667
void *pContext
86418668
);
86428669
86438670
86448671
/*
@@ -8648,25 +8675,25 @@
86488675
struct sqlite3_rtree_geometry {
86498676
void *pContext; /* Copy of pContext passed to s_r_g_c() */
86508677
int nParam; /* Size of array aParam[] */
86518678
sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */
86528679
void *pUser; /* Callback implementation user data */
8653
- void (*xDelUser)(void *); /* Called by SQLite to clean up pUser */
8680
+ void (SQLITE_CALLBACK *xDelUser)(void *); /* Called by SQLite to clean up pUser */
86548681
};
86558682
86568683
/*
86578684
** Register a 2nd-generation geometry callback named zScore that can be
86588685
** used as part of an R-Tree geometry query as follows:
86598686
**
86608687
** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...)
86618688
*/
8662
-SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
8689
+SQLITE_API int SQLITE_APICALL sqlite3_rtree_query_callback(
86638690
sqlite3 *db,
86648691
const char *zQueryFunc,
8665
- int (*xQueryFunc)(sqlite3_rtree_query_info*),
8692
+ int (SQLITE_CALLBACK *xQueryFunc)(sqlite3_rtree_query_info*),
86668693
void *pContext,
8667
- void (*xDestructor)(void*)
8694
+ void (SQLITE_CALLBACK *xDestructor)(void*)
86688695
);
86698696
86708697
86718698
/*
86728699
** A pointer to a structure of the following type is passed as the
@@ -8680,11 +8707,11 @@
86808707
struct sqlite3_rtree_query_info {
86818708
void *pContext; /* pContext from when function registered */
86828709
int nParam; /* Number of function parameters */
86838710
sqlite3_rtree_dbl *aParam; /* value of function parameters */
86848711
void *pUser; /* callback can use this, if desired */
8685
- void (*xDelUser)(void*); /* function to free pUser */
8712
+ void (SQLITE_CALLBACK *xDelUser)(void*); /* function to free pUser */
86868713
sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */
86878714
unsigned int *anQueue; /* Number of pending entries in the queue */
86888715
int nCoord; /* Number of coordinates */
86898716
int iLevel; /* Level of current node or entry */
86908717
int mxLevel; /* The largest iLevel value in the tree */
@@ -8876,11 +8903,11 @@
88768903
** If xFilter returns 0, changes is not tracked. Note that once a table is
88778904
** attached, xFilter will not be called again.
88788905
*/
88798906
void sqlite3session_table_filter(
88808907
sqlite3_session *pSession, /* Session object */
8881
- int(*xFilter)(
8908
+ int(SQLITE_CALLBACK *xFilter)(
88828909
void *pCtx, /* Copy of third arg to _filter_table() */
88838910
const char *zTab /* Table name */
88848911
),
88858912
void *pCtx /* First argument passed to xFilter */
88868913
);
@@ -9451,11 +9478,11 @@
94519478
** An sqlite3_changegroup object is used to combine two or more changesets
94529479
** (or patchsets) into a single changeset (or patchset). A single changegroup
94539480
** object may combine changesets or patchsets, but not both. The output is
94549481
** always in the same format as the input.
94559482
**
9456
-** If successful, this function returns SQLITE_OK and populates (*pp) with
9483
+** If successful, this function returns SQLITE_OK and populates (SQLITE_CALLBACK *pp) with
94579484
** a pointer to a new sqlite3_changegroup object before returning. The caller
94589485
** should eventually free the returned object using a call to
94599486
** sqlite3changegroup_delete(). If an error occurs, an SQLite error code
94609487
** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL.
94619488
**
@@ -9571,11 +9598,11 @@
95719598
** changes for tables that do not appear in the first changeset, they are
95729599
** appended onto the end of the output changeset, again in the order in
95739600
** which they are first encountered.
95749601
**
95759602
** If an error occurs, an SQLite error code is returned and the output
9576
-** variables (*pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK
9603
+** variables (SQLITE_CALLBACK *pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK
95779604
** is returned and the output variables are set to the size of and a
95789605
** pointer to the output buffer, respectively. In this case it is the
95799606
** responsibility of the caller to eventually free the buffer using a
95809607
** call to sqlite3_free().
95819608
*/
@@ -9728,15 +9755,15 @@
97289755
*/
97299756
int sqlite3changeset_apply(
97309757
sqlite3 *db, /* Apply change to "main" db of this handle */
97319758
int nChangeset, /* Size of changeset in bytes */
97329759
void *pChangeset, /* Changeset blob */
9733
- int(*xFilter)(
9760
+ int(SQLITE_CALLBACK *xFilter)(
97349761
void *pCtx, /* Copy of sixth arg to _apply() */
97359762
const char *zTab /* Table name */
97369763
),
9737
- int(*xConflict)(
9764
+ int(SQLITE_CALLBACK *xConflict)(
97389765
void *pCtx, /* Copy of sixth arg to _apply() */
97399766
int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
97409767
sqlite3_changeset_iter *p /* Handle describing change and conflict */
97419768
),
97429769
void *pCtx /* First argument passed to xConflict */
@@ -9873,20 +9900,20 @@
98739900
** </pre>
98749901
**
98759902
** Is replaced by:
98769903
**
98779904
** <pre>
9878
-** &nbsp; int (*xInput)(void *pIn, void *pData, int *pnData),
9905
+** &nbsp; int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
98799906
** &nbsp; void *pIn,
98809907
** </pre>
98819908
**
98829909
** Each time the xInput callback is invoked by the sessions module, the first
98839910
** argument passed is a copy of the supplied pIn context pointer. The second
9884
-** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no
9885
-** error occurs the xInput method should copy up to (*pnData) bytes of data
9886
-** into the buffer and set (*pnData) to the actual number of bytes copied
9887
-** before returning SQLITE_OK. If the input is completely exhausted, (*pnData)
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)
98889915
** should be set to zero to indicate this. Or, if an error occurs, an SQLite
98899916
** error code should be returned. In all cases, if an xInput callback returns
98909917
** an error, all processing is abandoned and the streaming API function
98919918
** returns a copy of the error code to the caller.
98929919
**
@@ -9907,11 +9934,11 @@
99079934
** </pre>
99089935
**
99099936
** Is replaced by:
99109937
**
99119938
** <pre>
9912
-** &nbsp; int (*xOutput)(void *pOut, const void *pData, int nData),
9939
+** &nbsp; int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
99139940
** &nbsp; void *pOut
99149941
** </pre>
99159942
**
99169943
** The xOutput callback is invoked zero or more times to return data to
99179944
** the application. The first parameter passed to each call is a copy of the
@@ -9927,58 +9954,58 @@
99279954
** parameter set to a value less than or equal to zero. Other than this,
99289955
** no guarantees are made as to the size of the chunks of data returned.
99299956
*/
99309957
int sqlite3changeset_apply_strm(
99319958
sqlite3 *db, /* Apply change to "main" db of this handle */
9932
- int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
9959
+ int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), /* Input function */
99339960
void *pIn, /* First arg for xInput */
9934
- int(*xFilter)(
9961
+ int(SQLITE_CALLBACK *xFilter)(
99359962
void *pCtx, /* Copy of sixth arg to _apply() */
99369963
const char *zTab /* Table name */
99379964
),
9938
- int(*xConflict)(
9965
+ int(SQLITE_CALLBACK *xConflict)(
99399966
void *pCtx, /* Copy of sixth arg to _apply() */
99409967
int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
99419968
sqlite3_changeset_iter *p /* Handle describing change and conflict */
99429969
),
99439970
void *pCtx /* First argument passed to xConflict */
99449971
);
99459972
int sqlite3changeset_concat_strm(
9946
- int (*xInputA)(void *pIn, void *pData, int *pnData),
9973
+ int (SQLITE_CALLBACK *xInputA)(void *pIn, void *pData, int *pnData),
99479974
void *pInA,
9948
- int (*xInputB)(void *pIn, void *pData, int *pnData),
9975
+ int (SQLITE_CALLBACK *xInputB)(void *pIn, void *pData, int *pnData),
99499976
void *pInB,
9950
- int (*xOutput)(void *pOut, const void *pData, int nData),
9977
+ int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
99519978
void *pOut
99529979
);
99539980
int sqlite3changeset_invert_strm(
9954
- int (*xInput)(void *pIn, void *pData, int *pnData),
9981
+ int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
99559982
void *pIn,
9956
- int (*xOutput)(void *pOut, const void *pData, int nData),
9983
+ int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
99579984
void *pOut
99589985
);
99599986
int sqlite3changeset_start_strm(
99609987
sqlite3_changeset_iter **pp,
9961
- int (*xInput)(void *pIn, void *pData, int *pnData),
9988
+ int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
99629989
void *pIn
99639990
);
99649991
int sqlite3session_changeset_strm(
99659992
sqlite3_session *pSession,
9966
- int (*xOutput)(void *pOut, const void *pData, int nData),
9993
+ int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
99679994
void *pOut
99689995
);
99699996
int sqlite3session_patchset_strm(
99709997
sqlite3_session *pSession,
9971
- int (*xOutput)(void *pOut, const void *pData, int nData),
9998
+ int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
99729999
void *pOut
997310000
);
997410001
int sqlite3changegroup_add_strm(sqlite3_changegroup*,
9975
- int (*xInput)(void *pIn, void *pData, int *pnData),
10002
+ int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
997610003
void *pIn
997710004
);
997810005
int sqlite3changegroup_output_strm(sqlite3_changegroup*,
9979
- int (*xOutput)(void *pOut, const void *pData, int nData),
10006
+ int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
998010007
void *pOut
998110008
);
998210009
998310010
998410011
/*
@@ -10029,11 +10056,11 @@
1002910056
1003010057
typedef struct Fts5ExtensionApi Fts5ExtensionApi;
1003110058
typedef struct Fts5Context Fts5Context;
1003210059
typedef struct Fts5PhraseIter Fts5PhraseIter;
1003310060
10034
-typedef void (*fts5_extension_function)(
10061
+typedef void (SQLITE_CALLBACK *fts5_extension_function)(
1003510062
const Fts5ExtensionApi *pApi, /* API offered by current FTS version */
1003610063
Fts5Context *pFts, /* First arg to pass to pApi functions */
1003710064
sqlite3_context *pCtx, /* Context for returning result/error */
1003810065
int nVal, /* Number of values in apVal[] array */
1003910066
sqlite3_value **apVal /* Array of trailing arguments */
@@ -10080,15 +10107,15 @@
1008010107
** This function may be quite inefficient if used with an FTS5 table
1008110108
** created with the "columnsize=0" option.
1008210109
**
1008310110
** xColumnText:
1008410111
** This function attempts to retrieve the text of column iCol of the
10085
-** current document. If successful, (*pz) is set to point to a buffer
10086
-** containing the text in utf-8 encoding, (*pn) is set to the size in bytes
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
1008710114
** (not characters) of the buffer and SQLITE_OK is returned. Otherwise,
1008810115
** if an error occurs, an SQLite error code is returned and the final values
10089
-** of (*pz) and (*pn) are undefined.
10116
+** of (SQLITE_CALLBACK *pz) and (*pn) are undefined.
1009010117
**
1009110118
** xPhraseCount:
1009210119
** Returns the number of phrases in the current query expression.
1009310120
**
1009410121
** xPhraseSize:
@@ -10193,11 +10220,11 @@
1019310220
** xRowCount(pFts5, pnRow)
1019410221
**
1019510222
** This function is used to retrieve the total number of rows in the table.
1019610223
** In other words, the same value that would be returned by:
1019710224
**
10198
-** SELECT count(*) FROM ftstable;
10225
+** SELECT count(SQLITE_CALLBACK *) FROM ftstable;
1019910226
**
1020010227
** xPhraseFirst()
1020110228
** This function is used, along with type Fts5PhraseIter and the xPhraseNext
1020210229
** method, to iterate through all instances of a single query phrase within
1020310230
** the current row. This is the same information as is accessible via the
@@ -10260,43 +10287,43 @@
1026010287
** See xPhraseFirstColumn above.
1026110288
*/
1026210289
struct Fts5ExtensionApi {
1026310290
int iVersion; /* Currently always set to 3 */
1026410291
10265
- void *(*xUserData)(Fts5Context*);
10292
+ void *(SQLITE_CALLBACK *xUserData)(Fts5Context*);
1026610293
10267
- int (*xColumnCount)(Fts5Context*);
10268
- int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow);
10269
- int (*xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken);
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);
1027010297
10271
- int (*xTokenize)(Fts5Context*,
10298
+ int (SQLITE_CALLBACK *xTokenize)(Fts5Context*,
1027210299
const char *pText, int nText, /* Text to tokenize */
1027310300
void *pCtx, /* Context passed to xToken() */
10274
- int (*xToken)(void*, int, const char*, int, int, int) /* Callback */
10275
- );
10276
-
10277
- int (*xPhraseCount)(Fts5Context*);
10278
- int (*xPhraseSize)(Fts5Context*, int iPhrase);
10279
-
10280
- int (*xInstCount)(Fts5Context*, int *pnInst);
10281
- int (*xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff);
10282
-
10283
- sqlite3_int64 (*xRowid)(Fts5Context*);
10284
- int (*xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn);
10285
- int (*xColumnSize)(Fts5Context*, int iCol, int *pnToken);
10286
-
10287
- int (*xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData,
10288
- int(*)(const Fts5ExtensionApi*,Fts5Context*,void*)
10289
- );
10290
- int (*xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*));
10291
- void *(*xGetAuxdata)(Fts5Context*, int bClear);
10292
-
10293
- int (*xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*);
10294
- void (*xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff);
10295
-
10296
- int (*xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*);
10297
- void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol);
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);
1029810325
};
1029910326
1030010327
/*
1030110328
** CUSTOM AUXILIARY FUNCTIONS
1030210329
*************************************************************************/
@@ -10320,11 +10347,11 @@
1032010347
** The second and third arguments are an array of nul-terminated strings
1032110348
** containing the tokenizer arguments, if any, specified following the
1032210349
** tokenizer name as part of the CREATE VIRTUAL TABLE statement used
1032310350
** to create the FTS5 table.
1032410351
**
10325
-** The final argument is an output variable. If successful, (*ppOut)
10352
+** The final argument is an output variable. If successful, (SQLITE_CALLBACK *ppOut)
1032610353
** should be set to point to the new tokenizer handle and SQLITE_OK
1032710354
** returned. If an error occurs, some value other than SQLITE_OK should
1032810355
** be returned. In this case, fts5 assumes that the final value of *ppOut
1032910356
** is undefined.
1033010357
**
@@ -10494,17 +10521,17 @@
1049410521
** inefficient.
1049510522
*/
1049610523
typedef struct Fts5Tokenizer Fts5Tokenizer;
1049710524
typedef struct fts5_tokenizer fts5_tokenizer;
1049810525
struct fts5_tokenizer {
10499
- int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
10500
- void (*xDelete)(Fts5Tokenizer*);
10501
- int (*xTokenize)(Fts5Tokenizer*,
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*,
1050210529
void *pCtx,
1050310530
int flags, /* Mask of FTS5_TOKENIZE_* flags */
1050410531
const char *pText, int nText,
10505
- int (*xToken)(
10532
+ int (SQLITE_CALLBACK *xToken)(
1050610533
void *pCtx, /* Copy of 2nd argument to xTokenize() */
1050710534
int tflags, /* Mask of FTS5_TOKEN_* flags */
1050810535
const char *pToken, /* Pointer to buffer containing token */
1050910536
int nToken, /* Size of token in bytes */
1051010537
int iStart, /* Byte offset of token within input text */
@@ -10533,33 +10560,33 @@
1053310560
typedef struct fts5_api fts5_api;
1053410561
struct fts5_api {
1053510562
int iVersion; /* Currently always set to 2 */
1053610563
1053710564
/* Create a new tokenizer */
10538
- int (*xCreateTokenizer)(
10565
+ int (SQLITE_CALLBACK *xCreateTokenizer)(
1053910566
fts5_api *pApi,
1054010567
const char *zName,
1054110568
void *pContext,
1054210569
fts5_tokenizer *pTokenizer,
10543
- void (*xDestroy)(void*)
10570
+ void (SQLITE_CALLBACK *xDestroy)(void*)
1054410571
);
1054510572
1054610573
/* Find an existing tokenizer */
10547
- int (*xFindTokenizer)(
10574
+ int (SQLITE_CALLBACK *xFindTokenizer)(
1054810575
fts5_api *pApi,
1054910576
const char *zName,
1055010577
void **ppContext,
1055110578
fts5_tokenizer *pTokenizer
1055210579
);
1055310580
1055410581
/* Create a new auxiliary function */
10555
- int (*xCreateFunction)(
10582
+ int (SQLITE_CALLBACK *xCreateFunction)(
1055610583
fts5_api *pApi,
1055710584
const char *zName,
1055810585
void *pContext,
1055910586
fts5_extension_function xFunction,
10560
- void (*xDestroy)(void*)
10587
+ void (SQLITE_CALLBACK *xDestroy)(void*)
1056110588
);
1056210589
};
1056310590
1056410591
/*
1056510592
** END OF REGISTRATION API
@@ -10867,11 +10894,11 @@
1086710894
** Make sure that the compiler intrinsics we desire are enabled when
1086810895
** compiling with an appropriate version of MSVC unless prevented by
1086910896
** the SQLITE_DISABLE_INTRINSIC define.
1087010897
*/
1087110898
#if !defined(SQLITE_DISABLE_INTRINSIC)
10872
-# if defined(_MSC_VER) && _MSC_VER>=1300
10899
+# if defined(_MSC_VER) && _MSC_VER>=1400
1087310900
# if !defined(_WIN32_WCE)
1087410901
# include <intrin.h>
1087510902
# pragma intrinsic(_byteswap_ushort)
1087610903
# pragma intrinsic(_byteswap_ulong)
1087710904
# pragma intrinsic(_ReadWriteBarrier)
@@ -11873,12 +11900,12 @@
1187311900
*/
1187411901
#ifdef SQLITE_OMIT_WSD
1187511902
#define SQLITE_WSD const
1187611903
#define GLOBAL(t,v) (*(t*)sqlite3_wsd_find((void*)&(v), sizeof(v)))
1187711904
#define sqlite3GlobalConfig GLOBAL(struct Sqlite3Config, sqlite3Config)
11878
-SQLITE_API int SQLITE_STDCALL sqlite3_wsd_init(int N, int J);
11879
-SQLITE_API void *SQLITE_STDCALL sqlite3_wsd_find(void *K, int L);
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);
1188011907
#else
1188111908
#define SQLITE_WSD
1188211909
#define GLOBAL(t,v) v
1188311910
#define sqlite3GlobalConfig sqlite3Config
1188411911
#endif
@@ -15834,10 +15861,11 @@
1583415861
int iCur; /* A cursor number */
1583515862
SrcList *pSrcList; /* FROM clause */
1583615863
struct SrcCount *pSrcCount; /* Counting column references */
1583715864
struct CCurHint *pCCurHint; /* Used by codeCursorHint() */
1583815865
int *aiCol; /* array of column indexes */
15866
+ struct IdxCover *pIdxCover; /* Check for index coverage */
1583915867
} u;
1584015868
};
1584115869
1584215870
/* Forward declarations */
1584315871
SQLITE_PRIVATE int sqlite3WalkExpr(Walker*, Expr*);
@@ -16277,10 +16305,11 @@
1627716305
SQLITE_PRIVATE int sqlite3ExprCompare(Expr*, Expr*, int);
1627816306
SQLITE_PRIVATE int sqlite3ExprListCompare(ExprList*, ExprList*, int);
1627916307
SQLITE_PRIVATE int sqlite3ExprImpliesExpr(Expr*, Expr*, int);
1628016308
SQLITE_PRIVATE void sqlite3ExprAnalyzeAggregates(NameContext*, Expr*);
1628116309
SQLITE_PRIVATE void sqlite3ExprAnalyzeAggList(NameContext*,ExprList*);
16310
+SQLITE_PRIVATE int sqlite3ExprCoveredByIndex(Expr*, int iCur, Index *pIdx);
1628216311
SQLITE_PRIVATE int sqlite3FunctionUsesThisSrc(Expr*, SrcList*);
1628316312
SQLITE_PRIVATE Vdbe *sqlite3GetVdbe(Parse*);
1628416313
#ifndef SQLITE_OMIT_BUILTIN_TEST
1628516314
SQLITE_PRIVATE void sqlite3PrngSaveState(void);
1628616315
SQLITE_PRIVATE void sqlite3PrngRestoreState(void);
@@ -17163,12 +17192,14 @@
1716317192
"CASE_SENSITIVE_LIKE",
1716417193
#endif
1716517194
#if SQLITE_CHECK_PAGES
1716617195
"CHECK_PAGES",
1716717196
#endif
17168
-#if defined(__clang__) && defined(__clang_version__)
17169
- "COMPILER=clang-" __clang_version__,
17197
+#if defined(__clang__) && defined(__clang_major__)
17198
+ "COMPILER=clang-" CTIMEOPT_VAL(__clang_major__) "."
17199
+ CTIMEOPT_VAL(__clang_minor__) "."
17200
+ CTIMEOPT_VAL(__clang_patchlevel__),
1717017201
#elif defined(_MSC_VER)
1717117202
"COMPILER=msvc-" CTIMEOPT_VAL(_MSC_VER),
1717217203
#elif defined(__GNUC__) && defined(__VERSION__)
1717317204
"COMPILER=gcc-" __VERSION__,
1717417205
#endif
@@ -17529,11 +17560,11 @@
1752917560
** was used and false if not.
1753017561
**
1753117562
** The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix
1753217563
** is not required for a match.
1753317564
*/
17534
-SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName){
17565
+SQLITE_API int SQLITE_APICALL sqlite3_compileoption_used(const char *zOptName){
1753517566
int i, n;
1753617567
1753717568
#if SQLITE_ENABLE_API_ARMOR
1753817569
if( zOptName==0 ){
1753917570
(void)SQLITE_MISUSE_BKPT;
@@ -17557,11 +17588,11 @@
1755717588
1755817589
/*
1755917590
** Return the N-th compile-time option string. If N is out of range,
1756017591
** return a NULL pointer.
1756117592
*/
17562
-SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N){
17593
+SQLITE_API const char *SQLITE_APICALL sqlite3_compileoption_get(int N){
1756317594
if( N>=0 && N<ArraySize(azCompileOpt) ){
1756417595
return azCompileOpt[N];
1756517596
}
1756617597
return 0;
1756717598
}
@@ -18267,11 +18298,11 @@
1826718298
}
1826818299
1826918300
/*
1827018301
** Query status information.
1827118302
*/
18272
-SQLITE_API int SQLITE_STDCALL sqlite3_status64(
18303
+SQLITE_API int SQLITE_APICALL sqlite3_status64(
1827318304
int op,
1827418305
sqlite3_int64 *pCurrent,
1827518306
sqlite3_int64 *pHighwater,
1827618307
int resetFlag
1827718308
){
@@ -18292,12 +18323,12 @@
1829218323
}
1829318324
sqlite3_mutex_leave(pMutex);
1829418325
(void)pMutex; /* Prevent warning when SQLITE_THREADSAFE=0 */
1829518326
return SQLITE_OK;
1829618327
}
18297
-SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){
18298
- sqlite3_int64 iCur, iHwtr;
18328
+SQLITE_API int SQLITE_APICALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){
18329
+ sqlite3_int64 iCur = 0, iHwtr = 0;
1829918330
int rc;
1830018331
#ifdef SQLITE_ENABLE_API_ARMOR
1830118332
if( pCurrent==0 || pHighwater==0 ) return SQLITE_MISUSE_BKPT;
1830218333
#endif
1830318334
rc = sqlite3_status64(op, &iCur, &iHwtr, resetFlag);
@@ -18309,11 +18340,11 @@
1830918340
}
1831018341
1831118342
/*
1831218343
** Query status information for a single database connection
1831318344
*/
18314
-SQLITE_API int SQLITE_STDCALL sqlite3_db_status(
18345
+SQLITE_API int SQLITE_APICALL sqlite3_db_status(
1831518346
sqlite3 *db, /* The database connection whose status is desired */
1831618347
int op, /* Status verb */
1831718348
int *pCurrent, /* Write current value here */
1831818349
int *pHighwater, /* Write high-water mark here */
1831918350
int resetFlag /* Reset high-water mark if true */
@@ -19987,11 +20018,11 @@
1998720018
1998820019
/*
1998920020
** Locate a VFS by name. If no name is given, simply return the
1999020021
** first VFS on the list.
1999120022
*/
19992
-SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfs){
20023
+SQLITE_API sqlite3_vfs *SQLITE_APICALL sqlite3_vfs_find(const char *zVfs){
1999320024
sqlite3_vfs *pVfs = 0;
1999420025
#if SQLITE_THREADSAFE
1999520026
sqlite3_mutex *mutex;
1999620027
#endif
1999720028
#ifndef SQLITE_OMIT_AUTOINIT
@@ -20033,11 +20064,11 @@
2003320064
/*
2003420065
** Register a VFS with the system. It is harmless to register the same
2003520066
** VFS multiple times. The new VFS becomes the default if makeDflt is
2003620067
** true.
2003720068
*/
20038
-SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){
20069
+SQLITE_API int SQLITE_APICALL sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){
2003920070
MUTEX_LOGIC(sqlite3_mutex *mutex;)
2004020071
#ifndef SQLITE_OMIT_AUTOINIT
2004120072
int rc = sqlite3_initialize();
2004220073
if( rc ) return rc;
2004320074
#endif
@@ -20061,11 +20092,11 @@
2006120092
}
2006220093
2006320094
/*
2006420095
** Unregister a VFS so that it is no longer accessible.
2006520096
*/
20066
-SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs *pVfs){
20097
+SQLITE_API int SQLITE_APICALL sqlite3_vfs_unregister(sqlite3_vfs *pVfs){
2006720098
#if SQLITE_THREADSAFE
2006820099
sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
2006920100
#endif
2007020101
sqlite3_mutex_enter(mutex);
2007120102
vfsUnlink(pVfs);
@@ -22412,11 +22443,11 @@
2241222443
}
2241322444
2241422445
/*
2241522446
** Retrieve a pointer to a static mutex or allocate a new dynamic one.
2241622447
*/
22417
-SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int id){
22448
+SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_mutex_alloc(int id){
2241822449
#ifndef SQLITE_OMIT_AUTOINIT
2241922450
if( id<=SQLITE_MUTEX_RECURSIVE && sqlite3_initialize() ) return 0;
2242022451
if( id>SQLITE_MUTEX_RECURSIVE && sqlite3MutexInit() ) return 0;
2242122452
#endif
2242222453
assert( sqlite3GlobalConfig.mutex.xMutexAlloc );
@@ -22433,11 +22464,11 @@
2243322464
}
2243422465
2243522466
/*
2243622467
** Free a dynamic mutex.
2243722468
*/
22438
-SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex *p){
22469
+SQLITE_API void SQLITE_APICALL sqlite3_mutex_free(sqlite3_mutex *p){
2243922470
if( p ){
2244022471
assert( sqlite3GlobalConfig.mutex.xMutexFree );
2244122472
sqlite3GlobalConfig.mutex.xMutexFree(p);
2244222473
}
2244322474
}
@@ -22444,11 +22475,11 @@
2244422475
2244522476
/*
2244622477
** Obtain the mutex p. If some other thread already has the mutex, block
2244722478
** until it can be obtained.
2244822479
*/
22449
-SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex *p){
22480
+SQLITE_API void SQLITE_APICALL sqlite3_mutex_enter(sqlite3_mutex *p){
2245022481
if( p ){
2245122482
assert( sqlite3GlobalConfig.mutex.xMutexEnter );
2245222483
sqlite3GlobalConfig.mutex.xMutexEnter(p);
2245322484
}
2245422485
}
@@ -22455,11 +22486,11 @@
2245522486
2245622487
/*
2245722488
** Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another
2245822489
** thread holds the mutex and it cannot be obtained, return SQLITE_BUSY.
2245922490
*/
22460
-SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex *p){
22491
+SQLITE_API int SQLITE_APICALL sqlite3_mutex_try(sqlite3_mutex *p){
2246122492
int rc = SQLITE_OK;
2246222493
if( p ){
2246322494
assert( sqlite3GlobalConfig.mutex.xMutexTry );
2246422495
return sqlite3GlobalConfig.mutex.xMutexTry(p);
2246522496
}
@@ -22470,11 +22501,11 @@
2247022501
** The sqlite3_mutex_leave() routine exits a mutex that was previously
2247122502
** entered by the same thread. The behavior is undefined if the mutex
2247222503
** is not currently entered. If a NULL pointer is passed as an argument
2247322504
** this function is a no-op.
2247422505
*/
22475
-SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex *p){
22506
+SQLITE_API void SQLITE_APICALL sqlite3_mutex_leave(sqlite3_mutex *p){
2247622507
if( p ){
2247722508
assert( sqlite3GlobalConfig.mutex.xMutexLeave );
2247822509
sqlite3GlobalConfig.mutex.xMutexLeave(p);
2247922510
}
2248022511
}
@@ -22482,15 +22513,15 @@
2248222513
#ifndef NDEBUG
2248322514
/*
2248422515
** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are
2248522516
** intended for use inside assert() statements.
2248622517
*/
22487
-SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex *p){
22518
+SQLITE_API int SQLITE_APICALL sqlite3_mutex_held(sqlite3_mutex *p){
2248822519
assert( p==0 || sqlite3GlobalConfig.mutex.xMutexHeld );
2248922520
return p==0 || sqlite3GlobalConfig.mutex.xMutexHeld(p);
2249022521
}
22491
-SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex *p){
22522
+SQLITE_API int SQLITE_APICALL sqlite3_mutex_notheld(sqlite3_mutex *p){
2249222523
assert( p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld );
2249322524
return p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld(p);
2249422525
}
2249522526
#endif
2249622527
@@ -23518,12 +23549,12 @@
2351823549
** of the sqlite3_initialize() and sqlite3_shutdown() processing, the
2351923550
** "interlocked" magic used here is probably not strictly necessary.
2352023551
*/
2352123552
static LONG SQLITE_WIN32_VOLATILE winMutex_lock = 0;
2352223553
23523
-SQLITE_API int SQLITE_STDCALL sqlite3_win32_is_nt(void); /* os_win.c */
23524
-SQLITE_API void SQLITE_STDCALL sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */
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 */
2352523556
2352623557
static int winMutexInit(void){
2352723558
/* The first to increment to 1 does actual initialization */
2352823559
if( InterlockedCompareExchange(&winMutex_lock, 1, 0)==0 ){
2352923560
int i;
@@ -23819,11 +23850,11 @@
2381923850
/*
2382023851
** Attempt to release up to n bytes of non-essential memory currently
2382123852
** held by SQLite. An example of non-essential memory is memory used to
2382223853
** cache database pages that are not currently in use.
2382323854
*/
23824
-SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int n){
23855
+SQLITE_API int SQLITE_APICALL sqlite3_release_memory(int n){
2382523856
#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
2382623857
return sqlite3PcacheReleaseMemory(n);
2382723858
#else
2382823859
/* IMPLEMENTATION-OF: R-34391-24921 The sqlite3_release_memory() routine
2382923860
** is a no-op returning zero if SQLite is not compiled with
@@ -23878,11 +23909,11 @@
2387823909
/*
2387923910
** Deprecated external interface. It used to set an alarm callback
2388023911
** that was invoked when memory usage grew too large. Now it is a
2388123912
** no-op.
2388223913
*/
23883
-SQLITE_API int SQLITE_STDCALL sqlite3_memory_alarm(
23914
+SQLITE_API int SQLITE_APICALL sqlite3_memory_alarm(
2388423915
void(*xCallback)(void *pArg, sqlite3_int64 used,int N),
2388523916
void *pArg,
2388623917
sqlite3_int64 iThreshold
2388723918
){
2388823919
(void)xCallback;
@@ -23894,11 +23925,11 @@
2389423925
2389523926
/*
2389623927
** Set the soft heap-size limit for the library. Passing a zero or
2389723928
** negative value indicates no limit.
2389823929
*/
23899
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 n){
23930
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_soft_heap_limit64(sqlite3_int64 n){
2390023931
sqlite3_int64 priorLimit;
2390123932
sqlite3_int64 excess;
2390223933
sqlite3_int64 nUsed;
2390323934
#ifndef SQLITE_OMIT_AUTOINIT
2390423935
int rc = sqlite3_initialize();
@@ -23916,11 +23947,11 @@
2391623947
sqlite3_mutex_leave(mem0.mutex);
2391723948
excess = sqlite3_memory_used() - n;
2391823949
if( excess>0 ) sqlite3_release_memory((int)(excess & 0x7fffffff));
2391923950
return priorLimit;
2392023951
}
23921
-SQLITE_API void SQLITE_STDCALL sqlite3_soft_heap_limit(int n){
23952
+SQLITE_API void SQLITE_APICALL sqlite3_soft_heap_limit(int n){
2392223953
if( n<0 ) n = 0;
2392323954
sqlite3_soft_heap_limit64(n);
2392423955
}
2392523956
2392623957
/*
@@ -23985,11 +24016,11 @@
2398524016
}
2398624017
2398724018
/*
2398824019
** Return the amount of memory currently checked out.
2398924020
*/
23990
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void){
24021
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_used(void){
2399124022
sqlite3_int64 res, mx;
2399224023
sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, 0);
2399324024
return res;
2399424025
}
2399524026
@@ -23996,11 +24027,11 @@
2399624027
/*
2399724028
** Return the maximum amount of memory that has ever been
2399824029
** checked out since either the beginning of this process
2399924030
** or since the most recent reset.
2400024031
*/
24001
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag){
24032
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_highwater(int resetFlag){
2400224033
sqlite3_int64 res, mx;
2400324034
sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, resetFlag);
2400424035
return mx;
2400524036
}
2400624037
@@ -24076,17 +24107,17 @@
2407624107
/*
2407724108
** This version of the memory allocation is for use by the application.
2407824109
** First make sure the memory subsystem is initialized, then do the
2407924110
** allocation.
2408024111
*/
24081
-SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int n){
24112
+SQLITE_API void *SQLITE_APICALL sqlite3_malloc(int n){
2408224113
#ifndef SQLITE_OMIT_AUTOINIT
2408324114
if( sqlite3_initialize() ) return 0;
2408424115
#endif
2408524116
return n<=0 ? 0 : sqlite3Malloc(n);
2408624117
}
24087
-SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64 n){
24118
+SQLITE_API void *SQLITE_APICALL sqlite3_malloc64(sqlite3_uint64 n){
2408824119
#ifndef SQLITE_OMIT_AUTOINIT
2408924120
if( sqlite3_initialize() ) return 0;
2409024121
#endif
2409124122
return sqlite3Malloc(n);
2409224123
}
@@ -24225,20 +24256,20 @@
2422524256
}else{
2422624257
assert( sqlite3_mutex_held(db->mutex) );
2422724258
return db->lookaside.sz;
2422824259
}
2422924260
}
24230
-SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void *p){
24261
+SQLITE_API sqlite3_uint64 SQLITE_APICALL sqlite3_msize(void *p){
2423124262
assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) );
2423224263
assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
2423324264
return p ? sqlite3GlobalConfig.m.xSize(p) : 0;
2423424265
}
2423524266
2423624267
/*
2423724268
** Free memory previously obtained from sqlite3Malloc().
2423824269
*/
24239
-SQLITE_API void SQLITE_STDCALL sqlite3_free(void *p){
24270
+SQLITE_API void SQLITE_APICALL sqlite3_free(void *p){
2424024271
if( p==0 ) return; /* IMP: R-49053-54554 */
2424124272
assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
2424224273
assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) );
2424324274
if( sqlite3GlobalConfig.bMemstat ){
2424424275
sqlite3_mutex_enter(mem0.mutex);
@@ -24343,18 +24374,18 @@
2434324374
2434424375
/*
2434524376
** The public interface to sqlite3Realloc. Make sure that the memory
2434624377
** subsystem is initialized prior to invoking sqliteRealloc.
2434724378
*/
24348
-SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void *pOld, int n){
24379
+SQLITE_API void *SQLITE_APICALL sqlite3_realloc(void *pOld, int n){
2434924380
#ifndef SQLITE_OMIT_AUTOINIT
2435024381
if( sqlite3_initialize() ) return 0;
2435124382
#endif
2435224383
if( n<0 ) n = 0; /* IMP: R-26507-47431 */
2435324384
return sqlite3Realloc(pOld, n);
2435424385
}
24355
-SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void *pOld, sqlite3_uint64 n){
24386
+SQLITE_API void *SQLITE_APICALL sqlite3_realloc64(void *pOld, sqlite3_uint64 n){
2435624387
#ifndef SQLITE_OMIT_AUTOINIT
2435724388
if( sqlite3_initialize() ) return 0;
2435824389
#endif
2435924390
return sqlite3Realloc(pOld, n);
2436024391
}
@@ -25577,11 +25608,11 @@
2557725608
2557825609
/*
2557925610
** Print into memory obtained from sqlite3_malloc(). Omit the internal
2558025611
** %-conversion extensions.
2558125612
*/
25582
-SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char *zFormat, va_list ap){
25613
+SQLITE_API char *SQLITE_APICALL sqlite3_vmprintf(const char *zFormat, va_list ap){
2558325614
char *z;
2558425615
char zBase[SQLITE_PRINT_BUF_SIZE];
2558525616
StrAccum acc;
2558625617
2558725618
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -25626,11 +25657,11 @@
2562625657
** this without breaking compatibility, so we just have to live with the
2562725658
** mistake.
2562825659
**
2562925660
** sqlite3_vsnprintf() is the varargs version.
2563025661
*/
25631
-SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int n, char *zBuf, const char *zFormat, va_list ap){
25662
+SQLITE_API char *SQLITE_APICALL sqlite3_vsnprintf(int n, char *zBuf, const char *zFormat, va_list ap){
2563225663
StrAccum acc;
2563325664
if( n<=0 ) return zBuf;
2563425665
#ifdef SQLITE_ENABLE_API_ARMOR
2563525666
if( zBuf==0 || zFormat==0 ) {
2563625667
(void)SQLITE_MISUSE_BKPT;
@@ -26253,11 +26284,11 @@
2625326284
} sqlite3Prng;
2625426285
2625526286
/*
2625626287
** Return N random bytes.
2625726288
*/
26258
-SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *pBuf){
26289
+SQLITE_API void SQLITE_APICALL sqlite3_randomness(int N, void *pBuf){
2625926290
unsigned char t;
2626026291
unsigned char *zBuf = pBuf;
2626126292
2626226293
/* The "wsdPrng" macro will resolve to the pseudo-random number generator
2626326294
** state vector. If writable static data is unsupported on the target,
@@ -27456,11 +27487,11 @@
2745627487
** sqlite3_strnicmp() APIs allow applications and extensions to compare
2745727488
** the contents of two buffers containing UTF-8 strings in a
2745827489
** case-independent fashion, using the same definition of "case
2745927490
** independence" that SQLite uses internally when comparing identifiers.
2746027491
*/
27461
-SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *zLeft, const char *zRight){
27492
+SQLITE_API int SQLITE_APICALL sqlite3_stricmp(const char *zLeft, const char *zRight){
2746227493
if( zLeft==0 ){
2746327494
return zRight ? -1 : 0;
2746427495
}else if( zRight==0 ){
2746527496
return 1;
2746627497
}
@@ -27477,11 +27508,11 @@
2747727508
a++;
2747827509
b++;
2747927510
}
2748027511
return c;
2748127512
}
27482
-SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){
27513
+SQLITE_API int SQLITE_APICALL sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){
2748327514
register unsigned char *a, *b;
2748427515
if( zLeft==0 ){
2748527516
return zRight ? -1 : 0;
2748627517
}else if( zRight==0 ){
2748727518
return 1;
@@ -36776,11 +36807,11 @@
3677636807
** This routine is called once during SQLite initialization and by a
3677736808
** single thread. The memory allocation and mutex subsystems have not
3677836809
** necessarily been initialized when this routine is called, and so they
3677936810
** should not be used.
3678036811
*/
36781
-SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void){
36812
+SQLITE_API int SQLITE_APICALL sqlite3_os_init(void){
3678236813
/*
3678336814
** The following macro defines an initializer for an sqlite3_vfs object.
3678436815
** The name of the VFS is NAME. The pAppData is a pointer to a pointer
3678536816
** to the "finder" function. (pAppData is a pointer to a pointer because
3678636817
** silly C90 rules prohibit a void* from being cast to a function pointer
@@ -36875,11 +36906,11 @@
3687536906
**
3687636907
** Some operating systems might need to do some cleanup in this routine,
3687736908
** to release dynamically allocated objects. But not on unix.
3687836909
** This routine is a no-op for unix.
3687936910
*/
36880
-SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void){
36911
+SQLITE_API int SQLITE_APICALL sqlite3_os_end(void){
3688136912
return SQLITE_OK;
3688236913
}
3688336914
3688436915
#endif /* SQLITE_OS_UNIX */
3688536916
@@ -38310,11 +38341,11 @@
3831038341
** compact it. Upon success, SQLITE_OK will be returned. Upon failure, one
3831138342
** of SQLITE_NOMEM, SQLITE_ERROR, or SQLITE_NOTFOUND will be returned. The
3831238343
** "pnLargest" argument, if non-zero, will be used to return the size of the
3831338344
** largest committed free block in the heap, in bytes.
3831438345
*/
38315
-SQLITE_API int SQLITE_STDCALL sqlite3_win32_compact_heap(LPUINT pnLargest){
38346
+SQLITE_API int SQLITE_APICALL sqlite3_win32_compact_heap(LPUINT pnLargest){
3831638347
int rc = SQLITE_OK;
3831738348
UINT nLargest = 0;
3831838349
HANDLE hHeap;
3831938350
3832038351
winMemAssertMagic();
@@ -38350,11 +38381,11 @@
3835038381
** If a Win32 native heap has been configured, this function will attempt to
3835138382
** destroy and recreate it. If the Win32 native heap is not isolated and/or
3835238383
** the sqlite3_memory_used() function does not return zero, SQLITE_BUSY will
3835338384
** be returned and no changes will be made to the Win32 native heap.
3835438385
*/
38355
-SQLITE_API int SQLITE_STDCALL sqlite3_win32_reset_heap(){
38386
+SQLITE_API int SQLITE_APICALL sqlite3_win32_reset_heap(){
3835638387
int rc;
3835738388
MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */
3835838389
MUTEX_LOGIC( sqlite3_mutex *pMem; ) /* The memsys static mutex */
3835938390
MUTEX_LOGIC( pMaster = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); )
3836038391
MUTEX_LOGIC( pMem = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM); )
@@ -38395,11 +38426,11 @@
3839538426
/*
3839638427
** This function outputs the specified (ANSI) string to the Win32 debugger
3839738428
** (if available).
3839838429
*/
3839938430
38400
-SQLITE_API void SQLITE_STDCALL sqlite3_win32_write_debug(const char *zBuf, int nBuf){
38431
+SQLITE_API void SQLITE_APICALL sqlite3_win32_write_debug(const char *zBuf, int nBuf){
3840138432
char zDbgBuf[SQLITE_WIN32_DBG_BUF_SIZE];
3840238433
int nMin = MIN(nBuf, (SQLITE_WIN32_DBG_BUF_SIZE - 1)); /* may be negative. */
3840338434
if( nMin<-1 ) nMin = -1; /* all negative values become -1. */
3840438435
assert( nMin==-1 || nMin==0 || nMin<SQLITE_WIN32_DBG_BUF_SIZE );
3840538436
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -38441,11 +38472,11 @@
3844138472
*/
3844238473
#if SQLITE_OS_WINRT
3844338474
static HANDLE sleepObj = NULL;
3844438475
#endif
3844538476
38446
-SQLITE_API void SQLITE_STDCALL sqlite3_win32_sleep(DWORD milliseconds){
38477
+SQLITE_API void SQLITE_APICALL sqlite3_win32_sleep(DWORD milliseconds){
3844738478
#if SQLITE_OS_WINRT
3844838479
if ( sleepObj==NULL ){
3844938480
sleepObj = osCreateEventExW(NULL, NULL, CREATE_EVENT_MANUAL_RESET,
3845038481
SYNCHRONIZE);
3845138482
}
@@ -38490,11 +38521,11 @@
3849038521
3849138522
/*
3849238523
** This function determines if the machine is running a version of Windows
3849338524
** based on the NT kernel.
3849438525
*/
38495
-SQLITE_API int SQLITE_STDCALL sqlite3_win32_is_nt(void){
38526
+SQLITE_API int SQLITE_APICALL sqlite3_win32_is_nt(void){
3849638527
#if SQLITE_OS_WINRT
3849738528
/*
3849838529
** NOTE: The WinRT sub-platform is always assumed to be based on the NT
3849938530
** kernel.
3850038531
*/
@@ -38878,11 +38909,11 @@
3887838909
}
3887938910
3888038911
/*
3888138912
** This is a public wrapper for the winUtf8ToUnicode() function.
3888238913
*/
38883
-SQLITE_API LPWSTR SQLITE_STDCALL sqlite3_win32_utf8_to_unicode(const char *zText){
38914
+SQLITE_API LPWSTR SQLITE_APICALL sqlite3_win32_utf8_to_unicode(const char *zText){
3888438915
#ifdef SQLITE_ENABLE_API_ARMOR
3888538916
if( !zText ){
3888638917
(void)SQLITE_MISUSE_BKPT;
3888738918
return 0;
3888838919
}
@@ -38894,11 +38925,11 @@
3889438925
}
3889538926
3889638927
/*
3889738928
** This is a public wrapper for the winUnicodeToUtf8() function.
3889838929
*/
38899
-SQLITE_API char *SQLITE_STDCALL sqlite3_win32_unicode_to_utf8(LPCWSTR zWideText){
38930
+SQLITE_API char *SQLITE_APICALL sqlite3_win32_unicode_to_utf8(LPCWSTR zWideText){
3890038931
#ifdef SQLITE_ENABLE_API_ARMOR
3890138932
if( !zWideText ){
3890238933
(void)SQLITE_MISUSE_BKPT;
3890338934
return 0;
3890438935
}
@@ -38910,11 +38941,11 @@
3891038941
}
3891138942
3891238943
/*
3891338944
** This is a public wrapper for the winMbcsToUtf8() function.
3891438945
*/
38915
-SQLITE_API char *SQLITE_STDCALL sqlite3_win32_mbcs_to_utf8(const char *zText){
38946
+SQLITE_API char *SQLITE_APICALL sqlite3_win32_mbcs_to_utf8(const char *zText){
3891638947
#ifdef SQLITE_ENABLE_API_ARMOR
3891738948
if( !zText ){
3891838949
(void)SQLITE_MISUSE_BKPT;
3891938950
return 0;
3892038951
}
@@ -38926,11 +38957,11 @@
3892638957
}
3892738958
3892838959
/*
3892938960
** This is a public wrapper for the winMbcsToUtf8() function.
3893038961
*/
38931
-SQLITE_API char *SQLITE_STDCALL sqlite3_win32_mbcs_to_utf8_v2(const char *zText, int useAnsi){
38962
+SQLITE_API char *SQLITE_APICALL sqlite3_win32_mbcs_to_utf8_v2(const char *zText, int useAnsi){
3893238963
#ifdef SQLITE_ENABLE_API_ARMOR
3893338964
if( !zText ){
3893438965
(void)SQLITE_MISUSE_BKPT;
3893538966
return 0;
3893638967
}
@@ -38942,11 +38973,11 @@
3894238973
}
3894338974
3894438975
/*
3894538976
** This is a public wrapper for the winUtf8ToMbcs() function.
3894638977
*/
38947
-SQLITE_API char *SQLITE_STDCALL sqlite3_win32_utf8_to_mbcs(const char *zText){
38978
+SQLITE_API char *SQLITE_APICALL sqlite3_win32_utf8_to_mbcs(const char *zText){
3894838979
#ifdef SQLITE_ENABLE_API_ARMOR
3894938980
if( !zText ){
3895038981
(void)SQLITE_MISUSE_BKPT;
3895138982
return 0;
3895238983
}
@@ -38958,11 +38989,11 @@
3895838989
}
3895938990
3896038991
/*
3896138992
** This is a public wrapper for the winUtf8ToMbcs() function.
3896238993
*/
38963
-SQLITE_API char *SQLITE_STDCALL sqlite3_win32_utf8_to_mbcs_v2(const char *zText, int useAnsi){
38994
+SQLITE_API char *SQLITE_APICALL sqlite3_win32_utf8_to_mbcs_v2(const char *zText, int useAnsi){
3896438995
#ifdef SQLITE_ENABLE_API_ARMOR
3896538996
if( !zText ){
3896638997
(void)SQLITE_MISUSE_BKPT;
3896738998
return 0;
3896838999
}
@@ -38978,11 +39009,11 @@
3897839009
** the provided arguments. The type argument must be 1 in order to set the
3897939010
** data directory or 2 in order to set the temporary directory. The zValue
3898039011
** argument is the name of the directory to use. The return value will be
3898139012
** SQLITE_OK if successful.
3898239013
*/
38983
-SQLITE_API int SQLITE_STDCALL sqlite3_win32_set_directory(DWORD type, LPCWSTR zValue){
39014
+SQLITE_API int SQLITE_APICALL sqlite3_win32_set_directory(DWORD type, LPCWSTR zValue){
3898439015
char **ppDirectory = 0;
3898539016
#ifndef SQLITE_OMIT_AUTOINIT
3898639017
int rc = sqlite3_initialize();
3898739018
if( rc ) return rc;
3898839019
#endif
@@ -42896,11 +42927,11 @@
4289642927
}
4289742928
4289842929
/*
4289942930
** Initialize and deinitialize the operating system interface.
4290042931
*/
42901
-SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void){
42932
+SQLITE_API int SQLITE_APICALL sqlite3_os_init(void){
4290242933
static sqlite3_vfs winVfs = {
4290342934
3, /* iVersion */
4290442935
sizeof(winFile), /* szOsFile */
4290542936
SQLITE_WIN32_MAX_PATH_BYTES, /* mxPathname */
4290642937
0, /* pNext */
@@ -43027,11 +43058,11 @@
4302743058
#endif
4302843059
4302943060
return SQLITE_OK;
4303043061
}
4303143062
43032
-SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void){
43063
+SQLITE_API int SQLITE_APICALL sqlite3_os_end(void){
4303343064
#if SQLITE_OS_WINRT
4303443065
if( sleepObj!=NULL ){
4303543066
osCloseHandle(sleepObj);
4303643067
sleepObj = NULL;
4303743068
}
@@ -57022,11 +57053,11 @@
5702257053
5702357054
/*
5702457055
** Return a +ve value if snapshot p1 is newer than p2. A -ve value if
5702557056
** p1 is older than p2 and zero if p1 and p2 are the same snapshot.
5702657057
*/
57027
-SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_cmp(sqlite3_snapshot *p1, sqlite3_snapshot *p2){
57058
+SQLITE_API int SQLITE_APICALL sqlite3_snapshot_cmp(sqlite3_snapshot *p1, sqlite3_snapshot *p2){
5702857059
WalIndexHdr *pHdr1 = (WalIndexHdr*)p1;
5702957060
WalIndexHdr *pHdr2 = (WalIndexHdr*)p2;
5703057061
5703157062
/* aSalt[0] is a copy of the value stored in the wal file header. It
5703257063
** is incremented each time the wal file is restarted. */
@@ -58159,11 +58190,11 @@
5815958190
**
5816058191
** This routine has no effect on existing database connections.
5816158192
** The shared cache setting effects only future calls to
5816258193
** sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2().
5816358194
*/
58164
-SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int enable){
58195
+SQLITE_API int SQLITE_APICALL sqlite3_enable_shared_cache(int enable){
5816558196
sqlite3GlobalConfig.sharedCacheEnabled = enable;
5816658197
return SQLITE_OK;
5816758198
}
5816858199
#endif
5816958200
@@ -67932,11 +67963,11 @@
6793267963
** a pointer to the new sqlite3_backup object.
6793367964
**
6793467965
** If an error occurs, NULL is returned and an error code and error message
6793567966
** stored in database handle pDestDb.
6793667967
*/
67937
-SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
67968
+SQLITE_API sqlite3_backup *SQLITE_APICALL sqlite3_backup_init(
6793867969
sqlite3* pDestDb, /* Database to write to */
6793967970
const char *zDestDb, /* Name of database within pDestDb */
6794067971
sqlite3* pSrcDb, /* Database connection to read from */
6794167972
const char *zSrcDb /* Name of database within pSrcDb */
6794267973
){
@@ -68140,11 +68171,11 @@
6814068171
}
6814168172
6814268173
/*
6814368174
** Copy nPage pages from the source b-tree to the destination.
6814468175
*/
68145
-SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage){
68176
+SQLITE_API int SQLITE_APICALL sqlite3_backup_step(sqlite3_backup *p, int nPage){
6814668177
int rc;
6814768178
int destMode; /* Destination journal mode */
6814868179
int pgszSrc = 0; /* Source page size */
6814968180
int pgszDest = 0; /* Destination page size */
6815068181
@@ -68384,11 +68415,11 @@
6838468415
}
6838568416
6838668417
/*
6838768418
** Release all resources associated with an sqlite3_backup* handle.
6838868419
*/
68389
-SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p){
68420
+SQLITE_API int SQLITE_APICALL sqlite3_backup_finish(sqlite3_backup *p){
6839068421
sqlite3_backup **pp; /* Ptr to head of pagers backup list */
6839168422
sqlite3 *pSrcDb; /* Source database connection */
6839268423
int rc; /* Value to return */
6839368424
6839468425
/* Enter the mutexes */
@@ -68436,11 +68467,11 @@
6843668467
6843768468
/*
6843868469
** Return the number of pages still to be backed up as of the most recent
6843968470
** call to sqlite3_backup_step().
6844068471
*/
68441
-SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p){
68472
+SQLITE_API int SQLITE_APICALL sqlite3_backup_remaining(sqlite3_backup *p){
6844268473
#ifdef SQLITE_ENABLE_API_ARMOR
6844368474
if( p==0 ){
6844468475
(void)SQLITE_MISUSE_BKPT;
6844568476
return 0;
6844668477
}
@@ -68450,11 +68481,11 @@
6845068481
6845168482
/*
6845268483
** Return the total number of pages in the source database as of the most
6845368484
** recent call to sqlite3_backup_step().
6845468485
*/
68455
-SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p){
68486
+SQLITE_API int SQLITE_APICALL sqlite3_backup_pagecount(sqlite3_backup *p){
6845668487
#ifdef SQLITE_ENABLE_API_ARMOR
6845768488
if( p==0 ){
6845868489
(void)SQLITE_MISUSE_BKPT;
6845968490
return 0;
6846068491
}
@@ -74904,11 +74935,11 @@
7490474935
** execution environment changes in a way that would alter the program
7490574936
** that sqlite3_prepare() generates. For example, if new functions or
7490674937
** collating sequences are registered or if an authorizer function is
7490774938
** added or changed.
7490874939
*/
74909
-SQLITE_API int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt *pStmt){
74940
+SQLITE_API int SQLITE_APICALL sqlite3_expired(sqlite3_stmt *pStmt){
7491074941
Vdbe *p = (Vdbe*)pStmt;
7491174942
return p==0 || p->expired;
7491274943
}
7491374944
#endif
7491474945
@@ -74973,11 +75004,11 @@
7497375004
** machine.
7497475005
**
7497575006
** This routine sets the error code and string returned by
7497675007
** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
7497775008
*/
74978
-SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt){
75009
+SQLITE_API int SQLITE_APICALL sqlite3_finalize(sqlite3_stmt *pStmt){
7497975010
int rc;
7498075011
if( pStmt==0 ){
7498175012
/* IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL
7498275013
** pointer is a harmless no-op. */
7498375014
rc = SQLITE_OK;
@@ -75000,11 +75031,11 @@
7500075031
** the prior execution is returned.
7500175032
**
7500275033
** This routine sets the error code and string returned by
7500375034
** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
7500475035
*/
75005
-SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt){
75036
+SQLITE_API int SQLITE_APICALL sqlite3_reset(sqlite3_stmt *pStmt){
7500675037
int rc;
7500775038
if( pStmt==0 ){
7500875039
rc = SQLITE_OK;
7500975040
}else{
7501075041
Vdbe *v = (Vdbe*)pStmt;
@@ -75021,11 +75052,11 @@
7502175052
}
7502275053
7502375054
/*
7502475055
** Set all the parameters in the compiled SQL statement to NULL.
7502575056
*/
75026
-SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt *pStmt){
75057
+SQLITE_API int SQLITE_APICALL sqlite3_clear_bindings(sqlite3_stmt *pStmt){
7502775058
int i;
7502875059
int rc = SQLITE_OK;
7502975060
Vdbe *p = (Vdbe*)pStmt;
7503075061
#if SQLITE_THREADSAFE
7503175062
sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex;
@@ -75045,11 +75076,11 @@
7504575076
7504675077
/**************************** sqlite3_value_ *******************************
7504775078
** The following routines extract information from a Mem or sqlite3_value
7504875079
** structure.
7504975080
*/
75050
-SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value *pVal){
75081
+SQLITE_API const void *SQLITE_APICALL sqlite3_value_blob(sqlite3_value *pVal){
7505175082
Mem *p = (Mem*)pVal;
7505275083
if( p->flags & (MEM_Blob|MEM_Str) ){
7505375084
if( sqlite3VdbeMemExpandBlob(p)!=SQLITE_OK ){
7505475085
assert( p->flags==MEM_Null && p->z==0 );
7505575086
return 0;
@@ -75058,48 +75089,48 @@
7505875089
return p->n ? p->z : 0;
7505975090
}else{
7506075091
return sqlite3_value_text(pVal);
7506175092
}
7506275093
}
75063
-SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value *pVal){
75094
+SQLITE_API int SQLITE_APICALL sqlite3_value_bytes(sqlite3_value *pVal){
7506475095
return sqlite3ValueBytes(pVal, SQLITE_UTF8);
7506575096
}
75066
-SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value *pVal){
75097
+SQLITE_API int SQLITE_APICALL sqlite3_value_bytes16(sqlite3_value *pVal){
7506775098
return sqlite3ValueBytes(pVal, SQLITE_UTF16NATIVE);
7506875099
}
75069
-SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value *pVal){
75100
+SQLITE_API double SQLITE_APICALL sqlite3_value_double(sqlite3_value *pVal){
7507075101
return sqlite3VdbeRealValue((Mem*)pVal);
7507175102
}
75072
-SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value *pVal){
75103
+SQLITE_API int SQLITE_APICALL sqlite3_value_int(sqlite3_value *pVal){
7507375104
return (int)sqlite3VdbeIntValue((Mem*)pVal);
7507475105
}
75075
-SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value *pVal){
75106
+SQLITE_API sqlite_int64 SQLITE_APICALL sqlite3_value_int64(sqlite3_value *pVal){
7507675107
return sqlite3VdbeIntValue((Mem*)pVal);
7507775108
}
75078
-SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value *pVal){
75109
+SQLITE_API unsigned int SQLITE_APICALL sqlite3_value_subtype(sqlite3_value *pVal){
7507975110
Mem *pMem = (Mem*)pVal;
7508075111
return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0);
7508175112
}
75082
-SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value *pVal){
75113
+SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_value_text(sqlite3_value *pVal){
7508375114
return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
7508475115
}
7508575116
#ifndef SQLITE_OMIT_UTF16
75086
-SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value* pVal){
75117
+SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16(sqlite3_value* pVal){
7508775118
return sqlite3ValueText(pVal, SQLITE_UTF16NATIVE);
7508875119
}
75089
-SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value *pVal){
75120
+SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16be(sqlite3_value *pVal){
7509075121
return sqlite3ValueText(pVal, SQLITE_UTF16BE);
7509175122
}
75092
-SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value *pVal){
75123
+SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16le(sqlite3_value *pVal){
7509375124
return sqlite3ValueText(pVal, SQLITE_UTF16LE);
7509475125
}
7509575126
#endif /* SQLITE_OMIT_UTF16 */
7509675127
/* EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five
7509775128
** fundamental datatypes: 64-bit signed integer 64-bit IEEE floating
7509875129
** point number string BLOB NULL
7509975130
*/
75100
-SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value* pVal){
75131
+SQLITE_API int SQLITE_APICALL sqlite3_value_type(sqlite3_value* pVal){
7510175132
static const u8 aType[] = {
7510275133
SQLITE_BLOB, /* 0x00 */
7510375134
SQLITE_NULL, /* 0x01 */
7510475135
SQLITE_TEXT, /* 0x02 */
7510575136
SQLITE_NULL, /* 0x03 */
@@ -75135,11 +75166,11 @@
7513575166
return aType[pVal->flags&MEM_AffMask];
7513675167
}
7513775168
7513875169
/* Make a copy of an sqlite3_value object
7513975170
*/
75140
-SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value *pOrig){
75171
+SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_value_dup(const sqlite3_value *pOrig){
7514175172
sqlite3_value *pNew;
7514275173
if( pOrig==0 ) return 0;
7514375174
pNew = sqlite3_malloc( sizeof(*pNew) );
7514475175
if( pNew==0 ) return 0;
7514575176
memset(pNew, 0, sizeof(*pNew));
@@ -75158,11 +75189,11 @@
7515875189
}
7515975190
7516075191
/* Destroy an sqlite3_value object previously obtained from
7516175192
** sqlite3_value_dup().
7516275193
*/
75163
-SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value *pOld){
75194
+SQLITE_API void SQLITE_APICALL sqlite3_value_free(sqlite3_value *pOld){
7516475195
sqlite3ValueFree(pOld);
7516575196
}
7516675197
7516775198
7516875199
/**************************** sqlite3_result_ *******************************
@@ -75201,21 +75232,21 @@
7520175232
xDel((void*)p);
7520275233
}
7520375234
if( pCtx ) sqlite3_result_error_toobig(pCtx);
7520475235
return SQLITE_TOOBIG;
7520575236
}
75206
-SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(
75237
+SQLITE_API void SQLITE_APICALL sqlite3_result_blob(
7520775238
sqlite3_context *pCtx,
7520875239
const void *z,
7520975240
int n,
7521075241
void (*xDel)(void *)
7521175242
){
7521275243
assert( n>=0 );
7521375244
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7521475245
setResultStrOrError(pCtx, z, n, 0, xDel);
7521575246
}
75216
-SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(
75247
+SQLITE_API void SQLITE_APICALL sqlite3_result_blob64(
7521775248
sqlite3_context *pCtx,
7521875249
const void *z,
7521975250
sqlite3_uint64 n,
7522075251
void (*xDel)(void *)
7522175252
){
@@ -75225,56 +75256,56 @@
7522575256
(void)invokeValueDestructor(z, xDel, pCtx);
7522675257
}else{
7522775258
setResultStrOrError(pCtx, z, (int)n, 0, xDel);
7522875259
}
7522975260
}
75230
-SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context *pCtx, double rVal){
75261
+SQLITE_API void SQLITE_APICALL sqlite3_result_double(sqlite3_context *pCtx, double rVal){
7523175262
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7523275263
sqlite3VdbeMemSetDouble(pCtx->pOut, rVal);
7523375264
}
75234
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
75265
+SQLITE_API void SQLITE_APICALL sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
7523575266
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7523675267
pCtx->isError = SQLITE_ERROR;
7523775268
pCtx->fErrorOrAux = 1;
7523875269
sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF8, SQLITE_TRANSIENT);
7523975270
}
7524075271
#ifndef SQLITE_OMIT_UTF16
75241
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){
75272
+SQLITE_API void SQLITE_APICALL sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){
7524275273
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7524375274
pCtx->isError = SQLITE_ERROR;
7524475275
pCtx->fErrorOrAux = 1;
7524575276
sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF16NATIVE, SQLITE_TRANSIENT);
7524675277
}
7524775278
#endif
75248
-SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context *pCtx, int iVal){
75279
+SQLITE_API void SQLITE_APICALL sqlite3_result_int(sqlite3_context *pCtx, int iVal){
7524975280
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7525075281
sqlite3VdbeMemSetInt64(pCtx->pOut, (i64)iVal);
7525175282
}
75252
-SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
75283
+SQLITE_API void SQLITE_APICALL sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
7525375284
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7525475285
sqlite3VdbeMemSetInt64(pCtx->pOut, iVal);
7525575286
}
75256
-SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context *pCtx){
75287
+SQLITE_API void SQLITE_APICALL sqlite3_result_null(sqlite3_context *pCtx){
7525775288
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7525875289
sqlite3VdbeMemSetNull(pCtx->pOut);
7525975290
}
75260
-SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){
75291
+SQLITE_API void SQLITE_APICALL sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){
7526175292
Mem *pOut = pCtx->pOut;
7526275293
assert( sqlite3_mutex_held(pOut->db->mutex) );
7526375294
pOut->eSubtype = eSubtype & 0xff;
7526475295
pOut->flags |= MEM_Subtype;
7526575296
}
75266
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text(
75297
+SQLITE_API void SQLITE_APICALL sqlite3_result_text(
7526775298
sqlite3_context *pCtx,
7526875299
const char *z,
7526975300
int n,
7527075301
void (*xDel)(void *)
7527175302
){
7527275303
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7527375304
setResultStrOrError(pCtx, z, n, SQLITE_UTF8, xDel);
7527475305
}
75275
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(
75306
+SQLITE_API void SQLITE_APICALL sqlite3_result_text64(
7527675307
sqlite3_context *pCtx,
7527775308
const char *z,
7527875309
sqlite3_uint64 n,
7527975310
void (*xDel)(void *),
7528075311
unsigned char enc
@@ -75287,56 +75318,56 @@
7528775318
}else{
7528875319
setResultStrOrError(pCtx, z, (int)n, enc, xDel);
7528975320
}
7529075321
}
7529175322
#ifndef SQLITE_OMIT_UTF16
75292
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(
75323
+SQLITE_API void SQLITE_APICALL sqlite3_result_text16(
7529375324
sqlite3_context *pCtx,
7529475325
const void *z,
7529575326
int n,
7529675327
void (*xDel)(void *)
7529775328
){
7529875329
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7529975330
setResultStrOrError(pCtx, z, n, SQLITE_UTF16NATIVE, xDel);
7530075331
}
75301
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(
75332
+SQLITE_API void SQLITE_APICALL sqlite3_result_text16be(
7530275333
sqlite3_context *pCtx,
7530375334
const void *z,
7530475335
int n,
7530575336
void (*xDel)(void *)
7530675337
){
7530775338
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7530875339
setResultStrOrError(pCtx, z, n, SQLITE_UTF16BE, xDel);
7530975340
}
75310
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(
75341
+SQLITE_API void SQLITE_APICALL sqlite3_result_text16le(
7531175342
sqlite3_context *pCtx,
7531275343
const void *z,
7531375344
int n,
7531475345
void (*xDel)(void *)
7531575346
){
7531675347
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7531775348
setResultStrOrError(pCtx, z, n, SQLITE_UTF16LE, xDel);
7531875349
}
7531975350
#endif /* SQLITE_OMIT_UTF16 */
75320
-SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){
75351
+SQLITE_API void SQLITE_APICALL sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){
7532175352
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7532275353
sqlite3VdbeMemCopy(pCtx->pOut, pValue);
7532375354
}
75324
-SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){
75355
+SQLITE_API void SQLITE_APICALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){
7532575356
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7532675357
sqlite3VdbeMemSetZeroBlob(pCtx->pOut, n);
7532775358
}
75328
-SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){
75359
+SQLITE_API int SQLITE_APICALL sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){
7532975360
Mem *pOut = pCtx->pOut;
7533075361
assert( sqlite3_mutex_held(pOut->db->mutex) );
7533175362
if( n>(u64)pOut->db->aLimit[SQLITE_LIMIT_LENGTH] ){
7533275363
return SQLITE_TOOBIG;
7533375364
}
7533475365
sqlite3VdbeMemSetZeroBlob(pCtx->pOut, (int)n);
7533575366
return SQLITE_OK;
7533675367
}
75337
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){
75368
+SQLITE_API void SQLITE_APICALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){
7533875369
pCtx->isError = errCode;
7533975370
pCtx->fErrorOrAux = 1;
7534075371
#ifdef SQLITE_DEBUG
7534175372
if( pCtx->pVdbe ) pCtx->pVdbe->rcApp = errCode;
7534275373
#endif
@@ -75345,20 +75376,20 @@
7534575376
SQLITE_UTF8, SQLITE_STATIC);
7534675377
}
7534775378
}
7534875379
7534975380
/* Force an SQLITE_TOOBIG error. */
75350
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context *pCtx){
75381
+SQLITE_API void SQLITE_APICALL sqlite3_result_error_toobig(sqlite3_context *pCtx){
7535175382
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7535275383
pCtx->isError = SQLITE_TOOBIG;
7535375384
pCtx->fErrorOrAux = 1;
7535475385
sqlite3VdbeMemSetStr(pCtx->pOut, "string or blob too big", -1,
7535575386
SQLITE_UTF8, SQLITE_STATIC);
7535675387
}
7535775388
7535875389
/* An SQLITE_NOMEM error. */
75359
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context *pCtx){
75390
+SQLITE_API void SQLITE_APICALL sqlite3_result_error_nomem(sqlite3_context *pCtx){
7536075391
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7536175392
sqlite3VdbeMemSetNull(pCtx->pOut);
7536275393
pCtx->isError = SQLITE_NOMEM_BKPT;
7536375394
pCtx->fErrorOrAux = 1;
7536475395
sqlite3OomFault(pCtx->pOut->db);
@@ -75526,11 +75557,11 @@
7552675557
/*
7552775558
** This is the top-level implementation of sqlite3_step(). Call
7552875559
** sqlite3Step() to do most of the work. If a schema error occurs,
7552975560
** call sqlite3Reprepare() and try again.
7553075561
*/
75531
-SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt *pStmt){
75562
+SQLITE_API int SQLITE_APICALL sqlite3_step(sqlite3_stmt *pStmt){
7553275563
int rc = SQLITE_OK; /* Result from sqlite3Step() */
7553375564
int rc2 = SQLITE_OK; /* Result from sqlite3Reprepare() */
7553475565
Vdbe *v = (Vdbe*)pStmt; /* the prepared statement */
7553575566
int cnt = 0; /* Counter to prevent infinite loop of reprepares */
7553675567
sqlite3 *db; /* The database connection */
@@ -75577,11 +75608,11 @@
7557775608
7557875609
/*
7557975610
** Extract the user data from a sqlite3_context structure and return a
7558075611
** pointer to it.
7558175612
*/
75582
-SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context *p){
75613
+SQLITE_API void *SQLITE_APICALL sqlite3_user_data(sqlite3_context *p){
7558375614
assert( p && p->pFunc );
7558475615
return p->pFunc->pUserData;
7558575616
}
7558675617
7558775618
/*
@@ -75592,11 +75623,11 @@
7559275623
** returns a copy of the pointer to the database connection (the 1st
7559375624
** parameter) of the sqlite3_create_function() and
7559475625
** sqlite3_create_function16() routines that originally registered the
7559575626
** application defined function.
7559675627
*/
75597
-SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context *p){
75628
+SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_context_db_handle(sqlite3_context *p){
7559875629
assert( p && p->pOut );
7559975630
return p->pOut->db;
7560075631
}
7560175632
7560275633
/*
@@ -75668,11 +75699,11 @@
7566875699
/*
7566975700
** Allocate or return the aggregate context for a user function. A new
7567075701
** context is allocated on the first call. Subsequent calls return the
7567175702
** same context that was returned on prior calls.
7567275703
*/
75673
-SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context *p, int nByte){
75704
+SQLITE_API void *SQLITE_APICALL sqlite3_aggregate_context(sqlite3_context *p, int nByte){
7567475705
assert( p && p->pFunc && p->pFunc->xFinalize );
7567575706
assert( sqlite3_mutex_held(p->pOut->db->mutex) );
7567675707
testcase( nByte<0 );
7567775708
if( (p->pMem->flags & MEM_Agg)==0 ){
7567875709
return createAggContext(p, nByte);
@@ -75683,11 +75714,11 @@
7568375714
7568475715
/*
7568575716
** Return the auxiliary data pointer, if any, for the iArg'th argument to
7568675717
** the user-function defined by pCtx.
7568775718
*/
75688
-SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
75719
+SQLITE_API void *SQLITE_APICALL sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
7568975720
AuxData *pAuxData;
7569075721
7569175722
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
7569275723
#if SQLITE_ENABLE_STAT3_OR_STAT4
7569375724
if( pCtx->pVdbe==0 ) return 0;
@@ -75704,11 +75735,11 @@
7570475735
/*
7570575736
** Set the auxiliary data pointer and delete function, for the iArg'th
7570675737
** argument to the user-function defined by pCtx. Any previous value is
7570775738
** deleted by calling the delete function specified when it was set.
7570875739
*/
75709
-SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(
75740
+SQLITE_API void SQLITE_APICALL sqlite3_set_auxdata(
7571075741
sqlite3_context *pCtx,
7571175742
int iArg,
7571275743
void *pAux,
7571375744
void (*xDelete)(void*)
7571475745
){
@@ -75759,29 +75790,29 @@
7575975790
** This function is deprecated. Do not use it for new code. It is
7576075791
** provide only to avoid breaking legacy code. New aggregate function
7576175792
** implementations should keep their own counts within their aggregate
7576275793
** context.
7576375794
*/
75764
-SQLITE_API int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context *p){
75795
+SQLITE_API int SQLITE_APICALL sqlite3_aggregate_count(sqlite3_context *p){
7576575796
assert( p && p->pMem && p->pFunc && p->pFunc->xFinalize );
7576675797
return p->pMem->n;
7576775798
}
7576875799
#endif
7576975800
7577075801
/*
7577175802
** Return the number of columns in the result set for the statement pStmt.
7577275803
*/
75773
-SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt){
75804
+SQLITE_API int SQLITE_APICALL sqlite3_column_count(sqlite3_stmt *pStmt){
7577475805
Vdbe *pVm = (Vdbe *)pStmt;
7577575806
return pVm ? pVm->nResColumn : 0;
7577675807
}
7577775808
7577875809
/*
7577975810
** Return the number of values available from the current row of the
7578075811
** currently executing statement pStmt.
7578175812
*/
75782
-SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt){
75813
+SQLITE_API int SQLITE_APICALL sqlite3_data_count(sqlite3_stmt *pStmt){
7578375814
Vdbe *pVm = (Vdbe *)pStmt;
7578475815
if( pVm==0 || pVm->pResultSet==0 ) return 0;
7578575816
return pVm->nResColumn;
7578675817
}
7578775818
@@ -75880,67 +75911,67 @@
7588075911
7588175912
/**************************** sqlite3_column_ *******************************
7588275913
** The following routines are used to access elements of the current row
7588375914
** in the result set.
7588475915
*/
75885
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt *pStmt, int i){
75916
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_blob(sqlite3_stmt *pStmt, int i){
7588675917
const void *val;
7588775918
val = sqlite3_value_blob( columnMem(pStmt,i) );
7588875919
/* Even though there is no encoding conversion, value_blob() might
7588975920
** need to call malloc() to expand the result of a zeroblob()
7589075921
** expression.
7589175922
*/
7589275923
columnMallocFailure(pStmt);
7589375924
return val;
7589475925
}
75895
-SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){
75926
+SQLITE_API int SQLITE_APICALL sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){
7589675927
int val = sqlite3_value_bytes( columnMem(pStmt,i) );
7589775928
columnMallocFailure(pStmt);
7589875929
return val;
7589975930
}
75900
-SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){
75931
+SQLITE_API int SQLITE_APICALL sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){
7590175932
int val = sqlite3_value_bytes16( columnMem(pStmt,i) );
7590275933
columnMallocFailure(pStmt);
7590375934
return val;
7590475935
}
75905
-SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt *pStmt, int i){
75936
+SQLITE_API double SQLITE_APICALL sqlite3_column_double(sqlite3_stmt *pStmt, int i){
7590675937
double val = sqlite3_value_double( columnMem(pStmt,i) );
7590775938
columnMallocFailure(pStmt);
7590875939
return val;
7590975940
}
75910
-SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt *pStmt, int i){
75941
+SQLITE_API int SQLITE_APICALL sqlite3_column_int(sqlite3_stmt *pStmt, int i){
7591175942
int val = sqlite3_value_int( columnMem(pStmt,i) );
7591275943
columnMallocFailure(pStmt);
7591375944
return val;
7591475945
}
75915
-SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt *pStmt, int i){
75946
+SQLITE_API sqlite_int64 SQLITE_APICALL sqlite3_column_int64(sqlite3_stmt *pStmt, int i){
7591675947
sqlite_int64 val = sqlite3_value_int64( columnMem(pStmt,i) );
7591775948
columnMallocFailure(pStmt);
7591875949
return val;
7591975950
}
75920
-SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt *pStmt, int i){
75951
+SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_column_text(sqlite3_stmt *pStmt, int i){
7592175952
const unsigned char *val = sqlite3_value_text( columnMem(pStmt,i) );
7592275953
columnMallocFailure(pStmt);
7592375954
return val;
7592475955
}
75925
-SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt *pStmt, int i){
75956
+SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_column_value(sqlite3_stmt *pStmt, int i){
7592675957
Mem *pOut = columnMem(pStmt, i);
7592775958
if( pOut->flags&MEM_Static ){
7592875959
pOut->flags &= ~MEM_Static;
7592975960
pOut->flags |= MEM_Ephem;
7593075961
}
7593175962
columnMallocFailure(pStmt);
7593275963
return (sqlite3_value *)pOut;
7593375964
}
7593475965
#ifndef SQLITE_OMIT_UTF16
75935
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt *pStmt, int i){
75966
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_text16(sqlite3_stmt *pStmt, int i){
7593675967
const void *val = sqlite3_value_text16( columnMem(pStmt,i) );
7593775968
columnMallocFailure(pStmt);
7593875969
return val;
7593975970
}
7594075971
#endif /* SQLITE_OMIT_UTF16 */
75941
-SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt *pStmt, int i){
75972
+SQLITE_API int SQLITE_APICALL sqlite3_column_type(sqlite3_stmt *pStmt, int i){
7594275973
int iType = sqlite3_value_type( columnMem(pStmt,i) );
7594375974
columnMallocFailure(pStmt);
7594475975
return iType;
7594575976
}
7594675977
@@ -76000,16 +76031,16 @@
7600076031
7600176032
/*
7600276033
** Return the name of the Nth column of the result set returned by SQL
7600376034
** statement pStmt.
7600476035
*/
76005
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt *pStmt, int N){
76036
+SQLITE_API const char *SQLITE_APICALL sqlite3_column_name(sqlite3_stmt *pStmt, int N){
7600676037
return columnName(
7600776038
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_NAME);
7600876039
}
7600976040
#ifndef SQLITE_OMIT_UTF16
76010
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt *pStmt, int N){
76041
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_name16(sqlite3_stmt *pStmt, int N){
7601176042
return columnName(
7601276043
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_NAME);
7601376044
}
7601476045
#endif
7601576046
@@ -76025,16 +76056,16 @@
7602576056
#ifndef SQLITE_OMIT_DECLTYPE
7602676057
/*
7602776058
** Return the column declaration type (if applicable) of the 'i'th column
7602876059
** of the result set of SQL statement pStmt.
7602976060
*/
76030
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){
76061
+SQLITE_API const char *SQLITE_APICALL sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){
7603176062
return columnName(
7603276063
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DECLTYPE);
7603376064
}
7603476065
#ifndef SQLITE_OMIT_UTF16
76035
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){
76066
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){
7603676067
return columnName(
7603776068
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DECLTYPE);
7603876069
}
7603976070
#endif /* SQLITE_OMIT_UTF16 */
7604076071
#endif /* SQLITE_OMIT_DECLTYPE */
@@ -76043,16 +76074,16 @@
7604376074
/*
7604476075
** Return the name of the database from which a result column derives.
7604576076
** NULL is returned if the result column is an expression or constant or
7604676077
** anything else which is not an unambiguous reference to a database column.
7604776078
*/
76048
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){
76079
+SQLITE_API const char *SQLITE_APICALL sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){
7604976080
return columnName(
7605076081
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DATABASE);
7605176082
}
7605276083
#ifndef SQLITE_OMIT_UTF16
76053
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){
76084
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){
7605476085
return columnName(
7605576086
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DATABASE);
7605676087
}
7605776088
#endif /* SQLITE_OMIT_UTF16 */
7605876089
@@ -76059,16 +76090,16 @@
7605976090
/*
7606076091
** Return the name of the table from which a result column derives.
7606176092
** NULL is returned if the result column is an expression or constant or
7606276093
** anything else which is not an unambiguous reference to a database column.
7606376094
*/
76064
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){
76095
+SQLITE_API const char *SQLITE_APICALL sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){
7606576096
return columnName(
7606676097
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_TABLE);
7606776098
}
7606876099
#ifndef SQLITE_OMIT_UTF16
76069
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){
76100
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){
7607076101
return columnName(
7607176102
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_TABLE);
7607276103
}
7607376104
#endif /* SQLITE_OMIT_UTF16 */
7607476105
@@ -76075,16 +76106,16 @@
7607576106
/*
7607676107
** Return the name of the table column from which a result column derives.
7607776108
** NULL is returned if the result column is an expression or constant or
7607876109
** anything else which is not an unambiguous reference to a database column.
7607976110
*/
76080
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){
76111
+SQLITE_API const char *SQLITE_APICALL sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){
7608176112
return columnName(
7608276113
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_COLUMN);
7608376114
}
7608476115
#ifndef SQLITE_OMIT_UTF16
76085
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){
76116
+SQLITE_API const void *SQLITE_APICALL sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){
7608676117
return columnName(
7608776118
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_COLUMN);
7608876119
}
7608976120
#endif /* SQLITE_OMIT_UTF16 */
7609076121
#endif /* SQLITE_ENABLE_COLUMN_METADATA */
@@ -76181,11 +76212,11 @@
7618176212
7618276213
7618376214
/*
7618476215
** Bind a blob value to an SQL statement variable.
7618576216
*/
76186
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(
76217
+SQLITE_API int SQLITE_APICALL sqlite3_bind_blob(
7618776218
sqlite3_stmt *pStmt,
7618876219
int i,
7618976220
const void *zData,
7619076221
int nData,
7619176222
void (*xDel)(void*)
@@ -76193,11 +76224,11 @@
7619376224
#ifdef SQLITE_ENABLE_API_ARMOR
7619476225
if( nData<0 ) return SQLITE_MISUSE_BKPT;
7619576226
#endif
7619676227
return bindText(pStmt, i, zData, nData, xDel, 0);
7619776228
}
76198
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(
76229
+SQLITE_API int SQLITE_APICALL sqlite3_bind_blob64(
7619976230
sqlite3_stmt *pStmt,
7620076231
int i,
7620176232
const void *zData,
7620276233
sqlite3_uint64 nData,
7620376234
void (*xDel)(void*)
@@ -76207,52 +76238,52 @@
7620776238
return invokeValueDestructor(zData, xDel, 0);
7620876239
}else{
7620976240
return bindText(pStmt, i, zData, (int)nData, xDel, 0);
7621076241
}
7621176242
}
76212
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
76243
+SQLITE_API int SQLITE_APICALL sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
7621376244
int rc;
7621476245
Vdbe *p = (Vdbe *)pStmt;
7621576246
rc = vdbeUnbind(p, i);
7621676247
if( rc==SQLITE_OK ){
7621776248
sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue);
7621876249
sqlite3_mutex_leave(p->db->mutex);
7621976250
}
7622076251
return rc;
7622176252
}
76222
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){
76253
+SQLITE_API int SQLITE_APICALL sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){
7622376254
return sqlite3_bind_int64(p, i, (i64)iValue);
7622476255
}
76225
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
76256
+SQLITE_API int SQLITE_APICALL sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
7622676257
int rc;
7622776258
Vdbe *p = (Vdbe *)pStmt;
7622876259
rc = vdbeUnbind(p, i);
7622976260
if( rc==SQLITE_OK ){
7623076261
sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue);
7623176262
sqlite3_mutex_leave(p->db->mutex);
7623276263
}
7623376264
return rc;
7623476265
}
76235
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
76266
+SQLITE_API int SQLITE_APICALL sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
7623676267
int rc;
7623776268
Vdbe *p = (Vdbe*)pStmt;
7623876269
rc = vdbeUnbind(p, i);
7623976270
if( rc==SQLITE_OK ){
7624076271
sqlite3_mutex_leave(p->db->mutex);
7624176272
}
7624276273
return rc;
7624376274
}
76244
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(
76275
+SQLITE_API int SQLITE_APICALL sqlite3_bind_text(
7624576276
sqlite3_stmt *pStmt,
7624676277
int i,
7624776278
const char *zData,
7624876279
int nData,
7624976280
void (*xDel)(void*)
7625076281
){
7625176282
return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8);
7625276283
}
76253
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(
76284
+SQLITE_API int SQLITE_APICALL sqlite3_bind_text64(
7625476285
sqlite3_stmt *pStmt,
7625576286
int i,
7625676287
const char *zData,
7625776288
sqlite3_uint64 nData,
7625876289
void (*xDel)(void*),
@@ -76265,21 +76296,21 @@
7626576296
if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE;
7626676297
return bindText(pStmt, i, zData, (int)nData, xDel, enc);
7626776298
}
7626876299
}
7626976300
#ifndef SQLITE_OMIT_UTF16
76270
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(
76301
+SQLITE_API int SQLITE_APICALL sqlite3_bind_text16(
7627176302
sqlite3_stmt *pStmt,
7627276303
int i,
7627376304
const void *zData,
7627476305
int nData,
7627576306
void (*xDel)(void*)
7627676307
){
7627776308
return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE);
7627876309
}
7627976310
#endif /* SQLITE_OMIT_UTF16 */
76280
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
76311
+SQLITE_API int SQLITE_APICALL sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
7628176312
int rc;
7628276313
switch( sqlite3_value_type((sqlite3_value*)pValue) ){
7628376314
case SQLITE_INTEGER: {
7628476315
rc = sqlite3_bind_int64(pStmt, i, pValue->u.i);
7628576316
break;
@@ -76306,21 +76337,21 @@
7630676337
break;
7630776338
}
7630876339
}
7630976340
return rc;
7631076341
}
76311
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
76342
+SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
7631276343
int rc;
7631376344
Vdbe *p = (Vdbe *)pStmt;
7631476345
rc = vdbeUnbind(p, i);
7631576346
if( rc==SQLITE_OK ){
7631676347
sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n);
7631776348
sqlite3_mutex_leave(p->db->mutex);
7631876349
}
7631976350
return rc;
7632076351
}
76321
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){
76352
+SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){
7632276353
int rc;
7632376354
Vdbe *p = (Vdbe *)pStmt;
7632476355
sqlite3_mutex_enter(p->db->mutex);
7632576356
if( n>(u64)p->db->aLimit[SQLITE_LIMIT_LENGTH] ){
7632676357
rc = SQLITE_TOOBIG;
@@ -76335,11 +76366,11 @@
7633576366
7633676367
/*
7633776368
** Return the number of wildcards that can be potentially bound to.
7633876369
** This routine is added to support DBD::SQLite.
7633976370
*/
76340
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
76371
+SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
7634176372
Vdbe *p = (Vdbe*)pStmt;
7634276373
return p ? p->nVar : 0;
7634376374
}
7634476375
7634576376
/*
@@ -76346,11 +76377,11 @@
7634676377
** Return the name of a wildcard parameter. Return NULL if the index
7634776378
** is out of range or if the wildcard is unnamed.
7634876379
**
7634976380
** The result is always UTF-8.
7635076381
*/
76351
-SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){
76382
+SQLITE_API const char *SQLITE_APICALL sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){
7635276383
Vdbe *p = (Vdbe*)pStmt;
7635376384
if( p==0 || i<1 || i>p->nzVar ){
7635476385
return 0;
7635576386
}
7635676387
return p->azVar[i-1];
@@ -76374,11 +76405,11 @@
7637476405
}
7637576406
}
7637676407
}
7637776408
return 0;
7637876409
}
76379
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
76410
+SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
7638076411
return sqlite3VdbeParameterIndex((Vdbe*)pStmt, zName, sqlite3Strlen30(zName));
7638176412
}
7638276413
7638376414
/*
7638476415
** Transfer all bindings from the first statement over to the second.
@@ -76408,11 +76439,11 @@
7640876439
**
7640976440
** If the two statements contain a different number of bindings, then
7641076441
** an SQLITE_ERROR is returned. Nothing else can go wrong, so otherwise
7641176442
** SQLITE_OK is returned.
7641276443
*/
76413
-SQLITE_API int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
76444
+SQLITE_API int SQLITE_APICALL sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
7641476445
Vdbe *pFrom = (Vdbe*)pFromStmt;
7641576446
Vdbe *pTo = (Vdbe*)pToStmt;
7641676447
if( pFrom->nVar!=pTo->nVar ){
7641776448
return SQLITE_ERROR;
7641876449
}
@@ -76430,26 +76461,26 @@
7643076461
** Return the sqlite3* database handle to which the prepared statement given
7643176462
** in the argument belongs. This is the same database handle that was
7643276463
** the first argument to the sqlite3_prepare() that was used to create
7643376464
** the statement in the first place.
7643476465
*/
76435
-SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt *pStmt){
76466
+SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_db_handle(sqlite3_stmt *pStmt){
7643676467
return pStmt ? ((Vdbe*)pStmt)->db : 0;
7643776468
}
7643876469
7643976470
/*
7644076471
** Return true if the prepared statement is guaranteed to not modify the
7644176472
** database.
7644276473
*/
76443
-SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt){
76474
+SQLITE_API int SQLITE_APICALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt){
7644476475
return pStmt ? ((Vdbe*)pStmt)->readOnly : 1;
7644576476
}
7644676477
7644776478
/*
7644876479
** Return true if the prepared statement is in need of being reset.
7644976480
*/
76450
-SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt *pStmt){
76481
+SQLITE_API int SQLITE_APICALL sqlite3_stmt_busy(sqlite3_stmt *pStmt){
7645176482
Vdbe *v = (Vdbe*)pStmt;
7645276483
return v!=0 && v->pc>=0 && v->magic==VDBE_MAGIC_RUN;
7645376484
}
7645476485
7645576486
/*
@@ -76456,11 +76487,11 @@
7645676487
** Return a pointer to the next prepared statement after pStmt associated
7645776488
** with database connection pDb. If pStmt is NULL, return the first
7645876489
** prepared statement for the database connection. Return NULL if there
7645976490
** are no more.
7646076491
*/
76461
-SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){
76492
+SQLITE_API sqlite3_stmt *SQLITE_APICALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){
7646276493
sqlite3_stmt *pNext;
7646376494
#ifdef SQLITE_ENABLE_API_ARMOR
7646476495
if( !sqlite3SafetyCheckOk(pDb) ){
7646576496
(void)SQLITE_MISUSE_BKPT;
7646676497
return 0;
@@ -76477,11 +76508,11 @@
7647776508
}
7647876509
7647976510
/*
7648076511
** Return the value of a status counter for a prepared statement
7648176512
*/
76482
-SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){
76513
+SQLITE_API int SQLITE_APICALL sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){
7648376514
Vdbe *pVdbe = (Vdbe*)pStmt;
7648476515
u32 v;
7648576516
#ifdef SQLITE_ENABLE_API_ARMOR
7648676517
if( !pStmt ){
7648776518
(void)SQLITE_MISUSE_BKPT;
@@ -76494,11 +76525,11 @@
7649476525
}
7649576526
7649676527
/*
7649776528
** Return the SQL associated with a prepared statement
7649876529
*/
76499
-SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt){
76530
+SQLITE_API const char *SQLITE_APICALL sqlite3_sql(sqlite3_stmt *pStmt){
7650076531
Vdbe *p = (Vdbe *)pStmt;
7650176532
return p ? p->zSql : 0;
7650276533
}
7650376534
7650476535
/*
@@ -76508,11 +76539,11 @@
7650876539
** freeing the returned string by passing it to sqlite3_free().
7650976540
**
7651076541
** The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of
7651176542
** expanded bound parameters.
7651276543
*/
76513
-SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt){
76544
+SQLITE_API char *SQLITE_APICALL sqlite3_expanded_sql(sqlite3_stmt *pStmt){
7651476545
#ifdef SQLITE_OMIT_TRACE
7651576546
return 0;
7651676547
#else
7651776548
char *z = 0;
7651876549
const char *zSql = sqlite3_sql(pStmt);
@@ -76550,11 +76581,11 @@
7655076581
7655176582
/*
7655276583
** This function is called from within a pre-update callback to retrieve
7655376584
** a field of the row currently being updated or deleted.
7655476585
*/
76555
-SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
76586
+SQLITE_API int SQLITE_APICALL sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
7655676587
PreUpdate *p = db->pPreUpdate;
7655776588
int rc = SQLITE_OK;
7655876589
7655976590
/* Test that this call is being made from within an SQLITE_DELETE or
7656076591
** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */
@@ -76605,11 +76636,11 @@
7660576636
#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
7660676637
/*
7660776638
** This function is called from within a pre-update callback to retrieve
7660876639
** the number of columns in the row being updated, deleted or inserted.
7660976640
*/
76610
-SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *db){
76641
+SQLITE_API int SQLITE_APICALL sqlite3_preupdate_count(sqlite3 *db){
7661176642
PreUpdate *p = db->pPreUpdate;
7661276643
return (p ? p->keyinfo.nField : 0);
7661376644
}
7661476645
#endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
7661576646
@@ -76623,11 +76654,11 @@
7662376654
** top-level trigger etc.).
7662476655
**
7662576656
** For the purposes of the previous paragraph, a foreign key CASCADE, SET NULL
7662676657
** or SET DEFAULT action is considered a trigger.
7662776658
*/
76628
-SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *db){
76659
+SQLITE_API int SQLITE_APICALL sqlite3_preupdate_depth(sqlite3 *db){
7662976660
PreUpdate *p = db->pPreUpdate;
7663076661
return (p ? p->v->nFrame : 0);
7663176662
}
7663276663
#endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
7663376664
@@ -76634,11 +76665,11 @@
7663476665
#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
7663576666
/*
7663676667
** This function is called from within a pre-update callback to retrieve
7663776668
** a field of the row currently being updated or inserted.
7663876669
*/
76639
-SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
76670
+SQLITE_API int SQLITE_APICALL sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
7664076671
PreUpdate *p = db->pPreUpdate;
7664176672
int rc = SQLITE_OK;
7664276673
Mem *pMem;
7664376674
7664476675
if( !p || p->op==SQLITE_DELETE ){
@@ -76708,11 +76739,11 @@
7670876739
7670976740
#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
7671076741
/*
7671176742
** Return status data for a single loop within query pStmt.
7671276743
*/
76713
-SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus(
76744
+SQLITE_API int SQLITE_APICALL sqlite3_stmt_scanstatus(
7671476745
sqlite3_stmt *pStmt, /* Prepared statement being queried */
7671576746
int idx, /* Index of loop to report on */
7671676747
int iScanStatusOp, /* Which metric to return */
7671776748
void *pOut /* OUT: Write the answer here */
7671876749
){
@@ -76767,11 +76798,11 @@
7676776798
}
7676876799
7676976800
/*
7677076801
** Zero all counters associated with the sqlite3_stmt_scanstatus() data.
7677176802
*/
76772
-SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){
76803
+SQLITE_API void SQLITE_APICALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){
7677376804
Vdbe *p = (Vdbe*)pStmt;
7677476805
memset(p->anExec, 0, p->nOp * sizeof(i64));
7677576806
}
7677676807
#endif /* SQLITE_ENABLE_STMT_SCANSTATUS */
7677776808
@@ -77294,11 +77325,11 @@
7729477325
** Try to convert the type of a function argument or a result column
7729577326
** into a numeric representation. Use either INTEGER or REAL whichever
7729677327
** is appropriate. But only do the conversion if it is possible without
7729777328
** loss of information and return the revised type of the argument.
7729877329
*/
77299
-SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value *pVal){
77330
+SQLITE_API int SQLITE_APICALL sqlite3_value_numeric_type(sqlite3_value *pVal){
7730077331
int eType = sqlite3_value_type(pVal);
7730177332
if( eType==SQLITE_TEXT ){
7730277333
Mem *pMem = (Mem*)pVal;
7730377334
applyNumericAffinity(pMem, 0);
7730477335
eType = sqlite3_value_type(pVal);
@@ -84146,11 +84177,11 @@
8414684177
}
8414784178
8414884179
/*
8414984180
** Open a blob handle.
8415084181
*/
84151
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
84182
+SQLITE_API int SQLITE_APICALL sqlite3_blob_open(
8415284183
sqlite3* db, /* The database connection */
8415384184
const char *zDb, /* The attached database containing the blob */
8415484185
const char *zTable, /* The table containing the blob */
8415584186
const char *zColumn, /* The column containing the blob */
8415684187
sqlite_int64 iRow, /* The row containing the glob */
@@ -84387,11 +84418,11 @@
8438784418
8438884419
/*
8438984420
** Close a blob handle that was previously created using
8439084421
** sqlite3_blob_open().
8439184422
*/
84392
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *pBlob){
84423
+SQLITE_API int SQLITE_APICALL sqlite3_blob_close(sqlite3_blob *pBlob){
8439384424
Incrblob *p = (Incrblob *)pBlob;
8439484425
int rc;
8439584426
sqlite3 *db;
8439684427
8439784428
if( p ){
@@ -84480,28 +84511,28 @@
8448084511
}
8448184512
8448284513
/*
8448384514
** Read data from a blob handle.
8448484515
*/
84485
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){
84516
+SQLITE_API int SQLITE_APICALL sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){
8448684517
return blobReadWrite(pBlob, z, n, iOffset, sqlite3BtreeData);
8448784518
}
8448884519
8448984520
/*
8449084521
** Write data to a blob handle.
8449184522
*/
84492
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){
84523
+SQLITE_API int SQLITE_APICALL sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){
8449384524
return blobReadWrite(pBlob, (void *)z, n, iOffset, sqlite3BtreePutData);
8449484525
}
8449584526
8449684527
/*
8449784528
** Query a blob handle for the size of the data.
8449884529
**
8449984530
** The Incrblob.nByte field is fixed for the lifetime of the Incrblob
8450084531
** so no mutex is required for access.
8450184532
*/
84502
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *pBlob){
84533
+SQLITE_API int SQLITE_APICALL sqlite3_blob_bytes(sqlite3_blob *pBlob){
8450384534
Incrblob *p = (Incrblob *)pBlob;
8450484535
return (p && p->pStmt) ? p->nByte : 0;
8450584536
}
8450684537
8450784538
/*
@@ -84512,11 +84543,11 @@
8451284543
** contain a blob or text value, then an error code is returned and the
8451384544
** database handle error code and message set. If this happens, then all
8451484545
** subsequent calls to sqlite3_blob_xxx() functions (except blob_close())
8451584546
** immediately return SQLITE_ABORT.
8451684547
*/
84517
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){
84548
+SQLITE_API int SQLITE_APICALL sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){
8451884549
int rc;
8451984550
Incrblob *p = (Incrblob *)pBlob;
8452084551
sqlite3 *db;
8452184552
8452284553
if( p==0 ) return SQLITE_MISUSE_BKPT;
@@ -93355,10 +93386,65 @@
9335593386
){
9335693387
return 1;
9335793388
}
9335893389
return 0;
9335993390
}
93391
+
93392
+/*
93393
+** An instance of the following structure is used by the tree walker
93394
+** to determine if an expression can be evaluated by reference to the
93395
+** index only, without having to do a search for the corresponding
93396
+** table entry. The IdxCover.pIdx field is the index. IdxCover.iCur
93397
+** is the cursor for the table.
93398
+*/
93399
+struct IdxCover {
93400
+ Index *pIdx; /* The index to be tested for coverage */
93401
+ int iCur; /* Cursor number for the table corresponding to the index */
93402
+};
93403
+
93404
+/*
93405
+** Check to see if there are references to columns in table
93406
+** pWalker->u.pIdxCover->iCur can be satisfied using the index
93407
+** pWalker->u.pIdxCover->pIdx.
93408
+*/
93409
+static int exprIdxCover(Walker *pWalker, Expr *pExpr){
93410
+ if( pExpr->op==TK_COLUMN
93411
+ && pExpr->iTable==pWalker->u.pIdxCover->iCur
93412
+ && sqlite3ColumnOfIndex(pWalker->u.pIdxCover->pIdx, pExpr->iColumn)<0
93413
+ ){
93414
+ pWalker->eCode = 1;
93415
+ return WRC_Abort;
93416
+ }
93417
+ return WRC_Continue;
93418
+}
93419
+
93420
+/*
93421
+** Determine if an index pIdx on table with cursor iCur contains will
93422
+** the expression pExpr. Return true if the index does cover the
93423
+** expression and false if the pExpr expression references table columns
93424
+** that are not found in the index pIdx.
93425
+**
93426
+** An index covering an expression means that the expression can be
93427
+** evaluated using only the index and without having to lookup the
93428
+** corresponding table entry.
93429
+*/
93430
+SQLITE_PRIVATE int sqlite3ExprCoveredByIndex(
93431
+ Expr *pExpr, /* The index to be tested */
93432
+ int iCur, /* The cursor number for the corresponding table */
93433
+ Index *pIdx /* The index that might be used for coverage */
93434
+){
93435
+ Walker w;
93436
+ struct IdxCover xcov;
93437
+ memset(&w, 0, sizeof(w));
93438
+ xcov.iCur = iCur;
93439
+ xcov.pIdx = pIdx;
93440
+ w.xExprCallback = exprIdxCover;
93441
+ w.u.pIdxCover = &xcov;
93442
+ sqlite3WalkExpr(&w, pExpr);
93443
+ return !w.eCode;
93444
+}
93445
+
9336093446
9336193447
/*
9336293448
** An instance of the following structure is used by the tree walker
9336393449
** to count references to table columns in the arguments of an
9336493450
** aggregate function, in order to implement the
@@ -97061,11 +97147,11 @@
9706197147
** and attempts to write the column will be ignored.
9706297148
**
9706397149
** Setting the auth function to NULL disables this hook. The default
9706497150
** setting of the auth function is NULL.
9706597151
*/
97066
-SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
97152
+SQLITE_API int SQLITE_APICALL sqlite3_set_authorizer(
9706797153
sqlite3 *db,
9706897154
int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
9706997155
void *pArg
9707097156
){
9707197157
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -97105,10 +97191,11 @@
9710597191
){
9710697192
sqlite3 *db = pParse->db; /* Database handle */
9710797193
char *zDb = db->aDb[iDb].zName; /* Name of attached database */
9710897194
int rc; /* Auth callback return code */
9710997195
97196
+ if( db->init.busy ) return SQLITE_OK;
9711097197
rc = db->xAuth(db->pAuthArg, SQLITE_READ, zTab,zCol,zDb,pParse->zAuthContext
9711197198
#ifdef SQLITE_USER_AUTHENTICATION
9711297199
,db->auth.zAuthUser
9711397200
#endif
9711497201
);
@@ -103823,18 +103910,18 @@
103823103910
}
103824103911
103825103912
/*
103826103913
** The sqlite3_strglob() interface.
103827103914
*/
103828
-SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlobPattern, const char *zString){
103915
+SQLITE_API int SQLITE_APICALL sqlite3_strglob(const char *zGlobPattern, const char *zString){
103829103916
return patternCompare((u8*)zGlobPattern, (u8*)zString, &globInfo, '[')==0;
103830103917
}
103831103918
103832103919
/*
103833103920
** The sqlite3_strlike() interface.
103834103921
*/
103835
-SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zPattern, const char *zStr, unsigned int esc){
103922
+SQLITE_API int SQLITE_APICALL sqlite3_strlike(const char *zPattern, const char *zStr, unsigned int esc){
103836103923
return patternCompare((u8*)zPattern, (u8*)zStr, &likeInfoNorm, esc)==0;
103837103924
}
103838103925
103839103926
/*
103840103927
** Count the number of times that the LIKE operator (or GLOB which is
@@ -108526,11 +108613,11 @@
108526108613
** If the SQL is a query, then for each row in the query result
108527108614
** the xCallback() function is called. pArg becomes the first
108528108615
** argument to xCallback(). If xCallback=NULL then no callback
108529108616
** is invoked, even for queries.
108530108617
*/
108531
-SQLITE_API int SQLITE_STDCALL sqlite3_exec(
108618
+SQLITE_API int SQLITE_APICALL sqlite3_exec(
108532108619
sqlite3 *db, /* The database on which the SQL executes */
108533108620
const char *zSql, /* The SQL to be executed */
108534108621
sqlite3_callback xCallback, /* Invoke this callback routine */
108535108622
void *pArg, /* First argument to xCallback() */
108536108623
char **pzErrMsg /* Write error messages here */
@@ -108685,12 +108772,10 @@
108685108772
*/
108686108773
#ifndef SQLITE3EXT_H
108687108774
#define SQLITE3EXT_H
108688108775
/* #include "sqlite3.h" */
108689108776
108690
-typedef struct sqlite3_api_routines sqlite3_api_routines;
108691
-
108692108777
/*
108693108778
** The following structure holds pointers to all of the SQLite API
108694108779
** routines.
108695108780
**
108696108781
** WARNING: In order to maintain backwards compatibility, add new
@@ -108951,10 +109036,20 @@
108951109036
int (*system_errno)(sqlite3*);
108952109037
/* Version 3.14.0 and later */
108953109038
int (*trace_v2)(sqlite3*,unsigned,int(*)(unsigned,void*,void*,void*),void*);
108954109039
char *(*expanded_sql)(sqlite3_stmt*);
108955109040
};
109041
+
109042
+/*
109043
+** This is the function signature used for all extension entry points. It
109044
+** is also defined in the file "loadext.c".
109045
+*/
109046
+typedef int (*sqlite3_loadext_entry)(
109047
+ sqlite3 *db, /* Handle to the database. */
109048
+ char **pzErrMsg, /* Used to set error string on failure. */
109049
+ const sqlite3_api_routines *pThunk /* Extension API function pointers. */
109050
+);
108956109051
108957109052
/*
108958109053
** The following macros redefine the API routines so that they are
108959109054
** redirected through the global sqlite3_api structure.
108960109055
**
@@ -109223,11 +109318,10 @@
109223109318
/************** Continuing where we left off in loadext.c ********************/
109224109319
/* #include "sqliteInt.h" */
109225109320
/* #include <string.h> */
109226109321
109227109322
#ifndef SQLITE_OMIT_LOAD_EXTENSION
109228
-
109229109323
/*
109230109324
** Some API routines are omitted when various features are
109231109325
** excluded from a build of SQLite. Substitute a NULL pointer
109232109326
** for any missing APIs.
109233109327
*/
@@ -109312,10 +109406,14 @@
109312109406
#define sqlite3_blob_open 0
109313109407
#define sqlite3_blob_read 0
109314109408
#define sqlite3_blob_write 0
109315109409
#define sqlite3_blob_reopen 0
109316109410
#endif
109411
+
109412
+#if defined(SQLITE_OMIT_TRACE)
109413
+# define sqlite3_trace_v2 0
109414
+#endif
109317109415
109318109416
/*
109319109417
** The following structure contains pointers to all SQLite API routines.
109320109418
** A pointer to this structure is passed into extensions when they are
109321109419
** loaded so that the extension can make calls back into the SQLite
@@ -109618,11 +109716,14 @@
109618109716
/* Version 3.10.0 and later */
109619109717
sqlite3_status64,
109620109718
sqlite3_strlike,
109621109719
sqlite3_db_cacheflush,
109622109720
/* Version 3.12.0 and later */
109623
- sqlite3_system_errno
109721
+ sqlite3_system_errno,
109722
+ /* Version 3.14.0 and later */
109723
+ sqlite3_trace_v2,
109724
+ sqlite3_expanded_sql
109624109725
};
109625109726
109626109727
/*
109627109728
** Attempt to load an SQLite extension library contained in the file
109628109729
** zFile. The entry point is zProc. zProc may be 0 in which case a
@@ -109641,11 +109742,11 @@
109641109742
const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */
109642109743
char **pzErrMsg /* Put error message here if not 0 */
109643109744
){
109644109745
sqlite3_vfs *pVfs = db->pVfs;
109645109746
void *handle;
109646
- int (*xInit)(sqlite3*,char**,const sqlite3_api_routines*);
109747
+ sqlite3_loadext_entry xInit;
109647109748
char *zErrmsg = 0;
109648109749
const char *zEntry;
109649109750
char *zAltEntry = 0;
109650109751
void **aHandle;
109651109752
u64 nMsg = 300 + sqlite3Strlen30(zFile);
@@ -109700,12 +109801,11 @@
109700109801
sqlite3OsDlError(pVfs, nMsg-1, zErrmsg);
109701109802
}
109702109803
}
109703109804
return SQLITE_ERROR;
109704109805
}
109705
- xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*))
109706
- sqlite3OsDlSym(pVfs, handle, zEntry);
109806
+ xInit = (sqlite3_loadext_entry)sqlite3OsDlSym(pVfs, handle, zEntry);
109707109807
109708109808
/* If no entry point was specified and the default legacy
109709109809
** entry point name "sqlite3_extension_init" was not found, then
109710109810
** construct an entry point name "sqlite3_X_init" where the X is
109711109811
** replaced by the lowercase value of every ASCII alphabetic
@@ -109733,12 +109833,11 @@
109733109833
zAltEntry[iEntry++] = (char)sqlite3UpperToLower[(unsigned)c];
109734109834
}
109735109835
}
109736109836
memcpy(zAltEntry+iEntry, "_init", 6);
109737109837
zEntry = zAltEntry;
109738
- xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*))
109739
- sqlite3OsDlSym(pVfs, handle, zEntry);
109838
+ xInit = (sqlite3_loadext_entry)sqlite3OsDlSym(pVfs, handle, zEntry);
109740109839
}
109741109840
if( xInit==0 ){
109742109841
if( pzErrMsg ){
109743109842
nMsg += sqlite3Strlen30(zEntry);
109744109843
*pzErrMsg = zErrmsg = sqlite3_malloc64(nMsg);
@@ -109776,11 +109875,11 @@
109776109875
db->aExtension = aHandle;
109777109876
109778109877
db->aExtension[db->nExtension++] = handle;
109779109878
return SQLITE_OK;
109780109879
}
109781
-SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
109880
+SQLITE_API int SQLITE_APICALL sqlite3_load_extension(
109782109881
sqlite3 *db, /* Load the extension into this database connection */
109783109882
const char *zFile, /* Name of the shared library containing extension */
109784109883
const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */
109785109884
char **pzErrMsg /* Put error message here if not 0 */
109786109885
){
@@ -109807,11 +109906,11 @@
109807109906
109808109907
/*
109809109908
** Enable or disable extension loading. Extension loading is disabled by
109810109909
** default so as not to open security holes in older applications.
109811109910
*/
109812
-SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff){
109911
+SQLITE_API int SQLITE_APICALL sqlite3_enable_load_extension(sqlite3 *db, int onoff){
109813109912
sqlite3_mutex_enter(db->mutex);
109814109913
if( onoff ){
109815109914
db->flags |= SQLITE_LoadExtension|SQLITE_LoadExtFunc;
109816109915
}else{
109817109916
db->flags &= ~(SQLITE_LoadExtension|SQLITE_LoadExtFunc);
@@ -109864,11 +109963,13 @@
109864109963
109865109964
/*
109866109965
** Register a statically linked extension that is automatically
109867109966
** loaded by every new database connection.
109868109967
*/
109869
-SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void (*xInit)(void)){
109968
+SQLITE_API int SQLITE_APICALL sqlite3_auto_extension(
109969
+ void (*xInit)(void)
109970
+){
109870109971
int rc = SQLITE_OK;
109871109972
#ifndef SQLITE_OMIT_AUTOINIT
109872109973
rc = sqlite3_initialize();
109873109974
if( rc ){
109874109975
return rc;
@@ -109909,11 +110010,13 @@
109909110010
** routine is a no-op.
109910110011
**
109911110012
** Return 1 if xInit was found on the list and removed. Return 0 if xInit
109912110013
** was not on the list.
109913110014
*/
109914
-SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void (*xInit)(void)){
110015
+SQLITE_API int SQLITE_APICALL sqlite3_cancel_auto_extension(
110016
+ void (*xInit)(void)
110017
+){
109915110018
#if SQLITE_THREADSAFE
109916110019
sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
109917110020
#endif
109918110021
int i;
109919110022
int n = 0;
@@ -109932,11 +110035,11 @@
109932110035
}
109933110036
109934110037
/*
109935110038
** Reset the automatic extension loading mechanism.
109936110039
*/
109937
-SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void){
110040
+SQLITE_API void SQLITE_APICALL sqlite3_reset_auto_extension(void){
109938110041
#ifndef SQLITE_OMIT_AUTOINIT
109939110042
if( sqlite3_initialize()==SQLITE_OK )
109940110043
#endif
109941110044
{
109942110045
#if SQLITE_THREADSAFE
@@ -109958,11 +110061,11 @@
109958110061
*/
109959110062
SQLITE_PRIVATE void sqlite3AutoLoadExtensions(sqlite3 *db){
109960110063
u32 i;
109961110064
int go = 1;
109962110065
int rc;
109963
- int (*xInit)(sqlite3*,char**,const sqlite3_api_routines*);
110066
+ sqlite3_loadext_entry xInit;
109964110067
109965110068
wsdAutoextInit;
109966110069
if( wsdAutoext.nExt==0 ){
109967110070
/* Common case: early out without every having to acquire a mutex */
109968110071
return;
@@ -109975,12 +110078,11 @@
109975110078
sqlite3_mutex_enter(mutex);
109976110079
if( i>=wsdAutoext.nExt ){
109977110080
xInit = 0;
109978110081
go = 0;
109979110082
}else{
109980
- xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*))
109981
- wsdAutoext.aExt[i];
110083
+ xInit = (sqlite3_loadext_entry)wsdAutoext.aExt[i];
109982110084
}
109983110085
sqlite3_mutex_leave(mutex);
109984110086
zErrmsg = 0;
109985110087
if( xInit && (rc = xInit(db, &zErrmsg, &sqlite3Apis))!=0 ){
109986110088
sqlite3ErrorWithMsg(db, rc,
@@ -113194,11 +113296,11 @@
113194113296
** and so if a schema change occurs, SQLITE_SCHEMA is returned by
113195113297
** sqlite3_step(). In the new version, the original SQL text is retained
113196113298
** and the statement is automatically recompiled if an schema change
113197113299
** occurs.
113198113300
*/
113199
-SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
113301
+SQLITE_API int SQLITE_APICALL sqlite3_prepare(
113200113302
sqlite3 *db, /* Database handle. */
113201113303
const char *zSql, /* UTF-8 encoded SQL statement. */
113202113304
int nBytes, /* Length of zSql in bytes. */
113203113305
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113204113306
const char **pzTail /* OUT: End of parsed string */
@@ -113206,11 +113308,11 @@
113206113308
int rc;
113207113309
rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,0,ppStmt,pzTail);
113208113310
assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
113209113311
return rc;
113210113312
}
113211
-SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
113313
+SQLITE_API int SQLITE_APICALL sqlite3_prepare_v2(
113212113314
sqlite3 *db, /* Database handle. */
113213113315
const char *zSql, /* UTF-8 encoded SQL statement. */
113214113316
int nBytes, /* Length of zSql in bytes. */
113215113317
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113216113318
const char **pzTail /* OUT: End of parsed string */
@@ -113282,11 +113384,11 @@
113282113384
** and so if a schema change occurs, SQLITE_SCHEMA is returned by
113283113385
** sqlite3_step(). In the new version, the original SQL text is retained
113284113386
** and the statement is automatically recompiled if an schema change
113285113387
** occurs.
113286113388
*/
113287
-SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
113389
+SQLITE_API int SQLITE_APICALL sqlite3_prepare16(
113288113390
sqlite3 *db, /* Database handle. */
113289113391
const void *zSql, /* UTF-16 encoded SQL statement. */
113290113392
int nBytes, /* Length of zSql in bytes. */
113291113393
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113292113394
const void **pzTail /* OUT: End of parsed string */
@@ -113294,11 +113396,11 @@
113294113396
int rc;
113295113397
rc = sqlite3Prepare16(db,zSql,nBytes,0,ppStmt,pzTail);
113296113398
assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
113297113399
return rc;
113298113400
}
113299
-SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
113401
+SQLITE_API int SQLITE_APICALL sqlite3_prepare16_v2(
113300113402
sqlite3 *db, /* Database handle. */
113301113403
const void *zSql, /* UTF-16 encoded SQL statement. */
113302113404
int nBytes, /* Length of zSql in bytes. */
113303113405
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113304113406
const void **pzTail /* OUT: End of parsed string */
@@ -119137,11 +119239,11 @@
119137119239
** The result that is written to ***pazResult is held in memory obtained
119138119240
** from malloc(). But the caller cannot free this memory directly.
119139119241
** Instead, the entire table should be passed to sqlite3_free_table() when
119140119242
** the calling procedure is finished using it.
119141119243
*/
119142
-SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
119244
+SQLITE_API int SQLITE_APICALL sqlite3_get_table(
119143119245
sqlite3 *db, /* The database on which the SQL executes */
119144119246
const char *zSql, /* The SQL to be executed */
119145119247
char ***pazResult, /* Write the result table here */
119146119248
int *pnRow, /* Write the number of rows in the result here */
119147119249
int *pnColumn, /* Write the number of columns of result here */
@@ -119206,11 +119308,11 @@
119206119308
}
119207119309
119208119310
/*
119209119311
** This routine frees the space the sqlite3_get_table() malloced.
119210119312
*/
119211
-SQLITE_API void SQLITE_STDCALL sqlite3_free_table(
119313
+SQLITE_API void SQLITE_APICALL sqlite3_free_table(
119212119314
char **azResult /* Result returned from sqlite3_get_table() */
119213119315
){
119214119316
if( azResult ){
119215119317
int i, n;
119216119318
azResult--;
@@ -121357,10 +121459,12 @@
121357121459
sqlite3CodecGetKey(db, 0, (void**)&zKey, &nKey);
121358121460
if( nKey ) db->nextPagesize = 0;
121359121461
}
121360121462
#endif
121361121463
121464
+ sqlite3BtreeSetCacheSize(pTemp, db->aDb[0].pSchema->cache_size);
121465
+ sqlite3BtreeSetSpillSize(pTemp, sqlite3BtreeSetSpillSize(pMain,0));
121362121466
rc = execSql(db, pzErrMsg, "PRAGMA vacuum_db.synchronous=OFF");
121363121467
if( rc!=SQLITE_OK ) goto end_of_vacuum;
121364121468
121365121469
/* Begin a transaction and take an exclusive lock on the main database
121366121470
** file. This is done before the sqlite3BtreeGetPageSize(pMain) call below,
@@ -121614,11 +121718,11 @@
121614121718
121615121719
121616121720
/*
121617121721
** External API function used to create a new virtual-table module.
121618121722
*/
121619
-SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
121723
+SQLITE_API int SQLITE_APICALL sqlite3_create_module(
121620121724
sqlite3 *db, /* Database in which module is registered */
121621121725
const char *zName, /* Name assigned to this module */
121622121726
const sqlite3_module *pModule, /* The definition of the module */
121623121727
void *pAux /* Context pointer for xCreate/xConnect */
121624121728
){
@@ -121629,11 +121733,11 @@
121629121733
}
121630121734
121631121735
/*
121632121736
** External API function used to create a new virtual-table module.
121633121737
*/
121634
-SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
121738
+SQLITE_API int SQLITE_APICALL sqlite3_create_module_v2(
121635121739
sqlite3 *db, /* Database in which module is registered */
121636121740
const char *zName, /* Name assigned to this module */
121637121741
const sqlite3_module *pModule, /* The definition of the module */
121638121742
void *pAux, /* Context pointer for xCreate/xConnect */
121639121743
void (*xDestroy)(void *) /* Module destructor function */
@@ -122253,11 +122357,11 @@
122253122357
/*
122254122358
** This function is used to set the schema of a virtual table. It is only
122255122359
** valid to call this function from within the xCreate() or xConnect() of a
122256122360
** virtual table module.
122257122361
*/
122258
-SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
122362
+SQLITE_API int SQLITE_APICALL sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
122259122363
VtabCtx *pCtx;
122260122364
Parse *pParse;
122261122365
int rc = SQLITE_OK;
122262122366
Table *pTab;
122263122367
char *zErr = 0;
@@ -122707,11 +122811,11 @@
122707122811
** table update operation currently in progress.
122708122812
**
122709122813
** The results of this routine are undefined unless it is called from
122710122814
** within an xUpdate method.
122711122815
*/
122712
-SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *db){
122816
+SQLITE_API int SQLITE_APICALL sqlite3_vtab_on_conflict(sqlite3 *db){
122713122817
static const unsigned char aMap[] = {
122714122818
SQLITE_ROLLBACK, SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_REPLACE
122715122819
};
122716122820
#ifdef SQLITE_ENABLE_API_ARMOR
122717122821
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -124633,10 +124737,11 @@
124633124737
zStartAff[nEq] = SQLITE_AFF_BLOB;
124634124738
}
124635124739
}
124636124740
nConstraint++;
124637124741
testcase( pRangeStart->wtFlags & TERM_VIRTUAL );
124742
+ bSeekPastNull = 0;
124638124743
}else if( bSeekPastNull ){
124639124744
sqlite3VdbeAddOp2(v, OP_Null, 0, regBase+nEq);
124640124745
nConstraint++;
124641124746
startEq = 0;
124642124747
start_constraints = 1;
@@ -129300,15 +129405,38 @@
129300129405
){
129301129406
pNew->iSortIdx = b ? iSortIdx : 0;
129302129407
129303129408
/* The cost of visiting the index rows is N*K, where K is
129304129409
** between 1.1 and 3.0, depending on the relative sizes of the
129305
- ** index and table rows. If this is a non-covering index scan,
129306
- ** also add the cost of visiting table rows (N*3.0). */
129410
+ ** index and table rows. */
129307129411
pNew->rRun = rSize + 1 + (15*pProbe->szIdxRow)/pTab->szTabRow;
129308129412
if( m!=0 ){
129309
- pNew->rRun = sqlite3LogEstAdd(pNew->rRun, rSize+16);
129413
+ /* If this is a non-covering index scan, add in the cost of
129414
+ ** doing table lookups. The cost will be 3x the number of
129415
+ ** lookups. Take into account WHERE clause terms that can be
129416
+ ** satisfied using just the index, and that do not require a
129417
+ ** table lookup. */
129418
+ LogEst nLookup = rSize + 16; /* Base cost: N*3 */
129419
+ int ii;
129420
+ int iCur = pSrc->iCursor;
129421
+ WhereClause *pWC2 = &pWInfo->sWC;
129422
+ for(ii=0; ii<pWC2->nTerm; ii++){
129423
+ WhereTerm *pTerm = &pWC2->a[ii];
129424
+ if( !sqlite3ExprCoveredByIndex(pTerm->pExpr, iCur, pProbe) ){
129425
+ break;
129426
+ }
129427
+ /* pTerm can be evaluated using just the index. So reduce
129428
+ ** the expected number of table lookups accordingly */
129429
+ if( pTerm->truthProb<=0 ){
129430
+ nLookup += pTerm->truthProb;
129431
+ }else{
129432
+ nLookup--;
129433
+ if( pTerm->eOperator & (WO_EQ|WO_IS) ) nLookup -= 19;
129434
+ }
129435
+ }
129436
+
129437
+ pNew->rRun = sqlite3LogEstAdd(pNew->rRun, nLookup);
129310129438
}
129311129439
ApplyCostMultiplier(pNew->rRun, pTab->costMult);
129312129440
whereLoopOutputAdjust(pWC, pNew, rSize);
129313129441
rc = whereLoopInsert(pBuilder, pNew);
129314129442
pNew->nOut = rSize;
@@ -130474,11 +130602,11 @@
130474130602
pWInfo->nOBSat = pFrom->isOrdered;
130475130603
pWInfo->revMask = pFrom->revLoop;
130476130604
if( pWInfo->nOBSat<=0 ){
130477130605
pWInfo->nOBSat = 0;
130478130606
if( nLoop>0 ){
130479
- Bitmask m;
130607
+ Bitmask m = 0;
130480130608
int rc = wherePathSatisfiesOrderBy(pWInfo, pWInfo->pOrderBy, pFrom,
130481130609
WHERE_ORDERBY_LIMIT, nLoop-1, pFrom->aLoop[nLoop-1], &m);
130482130610
if( rc==pWInfo->pOrderBy->nExpr ){
130483130611
pWInfo->bOrderedInnerLoop = 1;
130484130612
pWInfo->revMask = m;
@@ -136008,11 +136136,11 @@
136008136136
**
136009136137
** If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed
136010136138
** to recognize the end of a trigger can be omitted. All we have to do
136011136139
** is look for a semicolon that is not part of an string or comment.
136012136140
*/
136013
-SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *zSql){
136141
+SQLITE_API int SQLITE_APICALL sqlite3_complete(const char *zSql){
136014136142
u8 state = 0; /* Current state, using numbers defined in header comment */
136015136143
u8 token; /* Value of the next token */
136016136144
136017136145
#ifndef SQLITE_OMIT_TRIGGER
136018136146
/* A complex statement machine used to detect the end of a CREATE TRIGGER
@@ -136173,11 +136301,11 @@
136173136301
/*
136174136302
** This routine is the same as the sqlite3_complete() routine described
136175136303
** above, except that the parameter is required to be UTF-16 encoded, not
136176136304
** UTF-8.
136177136305
*/
136178
-SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *zSql){
136306
+SQLITE_API int SQLITE_APICALL sqlite3_complete16(const void *zSql){
136179136307
sqlite3_value *pVal;
136180136308
char const *zSql8;
136181136309
int rc;
136182136310
136183136311
#ifndef SQLITE_OMIT_AUTOINIT
@@ -136333,28 +136461,28 @@
136333136461
#endif
136334136462
136335136463
/* IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns
136336136464
** a pointer to the to the sqlite3_version[] string constant.
136337136465
*/
136338
-SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void){ return sqlite3_version; }
136466
+SQLITE_API const char *SQLITE_APICALL sqlite3_libversion(void){ return sqlite3_version; }
136339136467
136340136468
/* IMPLEMENTATION-OF: R-63124-39300 The sqlite3_sourceid() function returns a
136341136469
** pointer to a string constant whose value is the same as the
136342136470
** SQLITE_SOURCE_ID C preprocessor macro.
136343136471
*/
136344
-SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
136472
+SQLITE_API const char *SQLITE_APICALL sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
136345136473
136346136474
/* IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function
136347136475
** returns an integer equal to SQLITE_VERSION_NUMBER.
136348136476
*/
136349
-SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; }
136477
+SQLITE_API int SQLITE_APICALL sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; }
136350136478
136351136479
/* IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns
136352136480
** zero if and only if SQLite was compiled with mutexing code omitted due to
136353136481
** the SQLITE_THREADSAFE compile-time option being set to 0.
136354136482
*/
136355
-SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; }
136483
+SQLITE_API int SQLITE_APICALL sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; }
136356136484
136357136485
/*
136358136486
** When compiling the test fixture or with debugging enabled (on Win32),
136359136487
** this variable being set to non-zero will cause OSTRACE macros to emit
136360136488
** extra diagnostic information.
@@ -136423,11 +136551,11 @@
136423136551
** call by X completes.
136424136552
**
136425136553
** * Recursive calls to this routine from thread X return immediately
136426136554
** without blocking.
136427136555
*/
136428
-SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void){
136556
+SQLITE_API int SQLITE_APICALL sqlite3_initialize(void){
136429136557
MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */
136430136558
int rc; /* Result code */
136431136559
#ifdef SQLITE_EXTRA_INIT
136432136560
int bRunExtraInit = 0; /* Extra initialization needed */
136433136561
#endif
@@ -136589,11 +136717,11 @@
136589136717
** while any part of SQLite is otherwise in use in any thread. This
136590136718
** routine is not threadsafe. But it is safe to invoke this routine
136591136719
** on when SQLite is already shut down. If SQLite is already shut down
136592136720
** when this routine is invoked, then this routine is a harmless no-op.
136593136721
*/
136594
-SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void){
136722
+SQLITE_API int SQLITE_APICALL sqlite3_shutdown(void){
136595136723
#ifdef SQLITE_OMIT_WSD
136596136724
int rc = sqlite3_wsd_init(4096, 24);
136597136725
if( rc!=SQLITE_OK ){
136598136726
return rc;
136599136727
}
@@ -137008,11 +137136,11 @@
137008137136
}
137009137137
137010137138
/*
137011137139
** Return the mutex associated with a database connection.
137012137140
*/
137013
-SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3 *db){
137141
+SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_db_mutex(sqlite3 *db){
137014137142
#ifdef SQLITE_ENABLE_API_ARMOR
137015137143
if( !sqlite3SafetyCheckOk(db) ){
137016137144
(void)SQLITE_MISUSE_BKPT;
137017137145
return 0;
137018137146
}
@@ -137022,11 +137150,11 @@
137022137150
137023137151
/*
137024137152
** Free up as much memory as we can from the given database
137025137153
** connection.
137026137154
*/
137027
-SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3 *db){
137155
+SQLITE_API int SQLITE_APICALL sqlite3_db_release_memory(sqlite3 *db){
137028137156
int i;
137029137157
137030137158
#ifdef SQLITE_ENABLE_API_ARMOR
137031137159
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
137032137160
#endif
@@ -137046,11 +137174,11 @@
137046137174
137047137175
/*
137048137176
** Flush any dirty pages in the pager-cache for any attached database
137049137177
** to disk.
137050137178
*/
137051
-SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3 *db){
137179
+SQLITE_API int SQLITE_APICALL sqlite3_db_cacheflush(sqlite3 *db){
137052137180
int i;
137053137181
int rc = SQLITE_OK;
137054137182
int bSeenBusy = 0;
137055137183
137056137184
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -137196,11 +137324,11 @@
137196137324
}
137197137325
137198137326
/*
137199137327
** Return the ROWID of the most recent insert
137200137328
*/
137201
-SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3 *db){
137329
+SQLITE_API sqlite_int64 SQLITE_APICALL sqlite3_last_insert_rowid(sqlite3 *db){
137202137330
#ifdef SQLITE_ENABLE_API_ARMOR
137203137331
if( !sqlite3SafetyCheckOk(db) ){
137204137332
(void)SQLITE_MISUSE_BKPT;
137205137333
return 0;
137206137334
}
@@ -137209,11 +137337,11 @@
137209137337
}
137210137338
137211137339
/*
137212137340
** Return the number of changes in the most recent call to sqlite3_exec().
137213137341
*/
137214
-SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3 *db){
137342
+SQLITE_API int SQLITE_APICALL sqlite3_changes(sqlite3 *db){
137215137343
#ifdef SQLITE_ENABLE_API_ARMOR
137216137344
if( !sqlite3SafetyCheckOk(db) ){
137217137345
(void)SQLITE_MISUSE_BKPT;
137218137346
return 0;
137219137347
}
@@ -137222,11 +137350,11 @@
137222137350
}
137223137351
137224137352
/*
137225137353
** Return the number of changes since the database handle was opened.
137226137354
*/
137227
-SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3 *db){
137355
+SQLITE_API int SQLITE_APICALL sqlite3_total_changes(sqlite3 *db){
137228137356
#ifdef SQLITE_ENABLE_API_ARMOR
137229137357
if( !sqlite3SafetyCheckOk(db) ){
137230137358
(void)SQLITE_MISUSE_BKPT;
137231137359
return 0;
137232137360
}
@@ -137373,12 +137501,12 @@
137373137501
** statements or unfinished sqlite3_backups. The sqlite3_close_v2()
137374137502
** version forces the connection to become a zombie if there are
137375137503
** unclosed resources, and arranges for deallocation when the last
137376137504
** prepare statement or sqlite3_backup closes.
137377137505
*/
137378
-SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3 *db){ return sqlite3Close(db,0); }
137379
-SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3 *db){ return sqlite3Close(db,1); }
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); }
137380137508
137381137509
137382137510
/*
137383137511
** Close the mutex on database connection db.
137384137512
**
@@ -137781,11 +137909,11 @@
137781137909
137782137910
/*
137783137911
** This routine sets the busy callback for an Sqlite database to the
137784137912
** given callback function with the given argument.
137785137913
*/
137786
-SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(
137914
+SQLITE_API int SQLITE_APICALL sqlite3_busy_handler(
137787137915
sqlite3 *db,
137788137916
int (*xBusy)(void*,int),
137789137917
void *pArg
137790137918
){
137791137919
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -137804,11 +137932,11 @@
137804137932
/*
137805137933
** This routine sets the progress callback for an Sqlite database to the
137806137934
** given callback function with the given argument. The progress callback will
137807137935
** be invoked every nOps opcodes.
137808137936
*/
137809
-SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(
137937
+SQLITE_API void SQLITE_APICALL sqlite3_progress_handler(
137810137938
sqlite3 *db,
137811137939
int nOps,
137812137940
int (*xProgress)(void*),
137813137941
void *pArg
137814137942
){
@@ -137835,11 +137963,11 @@
137835137963
137836137964
/*
137837137965
** This routine installs a default busy handler that waits for the
137838137966
** specified number of milliseconds before returning 0.
137839137967
*/
137840
-SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3 *db, int ms){
137968
+SQLITE_API int SQLITE_APICALL sqlite3_busy_timeout(sqlite3 *db, int ms){
137841137969
#ifdef SQLITE_ENABLE_API_ARMOR
137842137970
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
137843137971
#endif
137844137972
if( ms>0 ){
137845137973
sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db);
@@ -137851,11 +137979,11 @@
137851137979
}
137852137980
137853137981
/*
137854137982
** Cause any pending operation to stop at its earliest opportunity.
137855137983
*/
137856
-SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3 *db){
137984
+SQLITE_API void SQLITE_APICALL sqlite3_interrupt(sqlite3 *db){
137857137985
#ifdef SQLITE_ENABLE_API_ARMOR
137858137986
if( !sqlite3SafetyCheckOk(db) ){
137859137987
(void)SQLITE_MISUSE_BKPT;
137860137988
return;
137861137989
}
@@ -137967,11 +138095,11 @@
137967138095
}
137968138096
137969138097
/*
137970138098
** Create new user functions.
137971138099
*/
137972
-SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
138100
+SQLITE_API int SQLITE_APICALL sqlite3_create_function(
137973138101
sqlite3 *db,
137974138102
const char *zFunc,
137975138103
int nArg,
137976138104
int enc,
137977138105
void *p,
@@ -137981,11 +138109,11 @@
137981138109
){
137982138110
return sqlite3_create_function_v2(db, zFunc, nArg, enc, p, xSFunc, xStep,
137983138111
xFinal, 0);
137984138112
}
137985138113
137986
-SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
138114
+SQLITE_API int SQLITE_APICALL sqlite3_create_function_v2(
137987138115
sqlite3 *db,
137988138116
const char *zFunc,
137989138117
int nArg,
137990138118
int enc,
137991138119
void *p,
@@ -138024,11 +138152,11 @@
138024138152
sqlite3_mutex_leave(db->mutex);
138025138153
return rc;
138026138154
}
138027138155
138028138156
#ifndef SQLITE_OMIT_UTF16
138029
-SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
138157
+SQLITE_API int SQLITE_APICALL sqlite3_create_function16(
138030138158
sqlite3 *db,
138031138159
const void *zFunctionName,
138032138160
int nArg,
138033138161
int eTextRep,
138034138162
void *p,
@@ -138064,11 +138192,11 @@
138064138192
** When virtual tables intend to provide an overloaded function, they
138065138193
** should call this routine to make sure the global function exists.
138066138194
** A global function must exist in order for name resolution to work
138067138195
** properly.
138068138196
*/
138069
-SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(
138197
+SQLITE_API int SQLITE_APICALL sqlite3_overload_function(
138070138198
sqlite3 *db,
138071138199
const char *zName,
138072138200
int nArg
138073138201
){
138074138202
int rc = SQLITE_OK;
@@ -138096,11 +138224,11 @@
138096138224
** A NULL trace function means that no tracing is executes. A non-NULL
138097138225
** trace is a pointer to a function that is invoked at the start of each
138098138226
** SQL statement.
138099138227
*/
138100138228
#ifndef SQLITE_OMIT_DEPRECATED
138101
-SQLITE_API void *SQLITE_STDCALL sqlite3_trace(sqlite3 *db, void(*xTrace)(void*,const char*), void *pArg){
138229
+SQLITE_API void *SQLITE_APICALL sqlite3_trace(sqlite3 *db, void(*xTrace)(void*,const char*), void *pArg){
138102138230
void *pOld;
138103138231
138104138232
#ifdef SQLITE_ENABLE_API_ARMOR
138105138233
if( !sqlite3SafetyCheckOk(db) ){
138106138234
(void)SQLITE_MISUSE_BKPT;
@@ -138117,11 +138245,11 @@
138117138245
}
138118138246
#endif /* SQLITE_OMIT_DEPRECATED */
138119138247
138120138248
/* Register a trace callback using the version-2 interface.
138121138249
*/
138122
-SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2(
138250
+SQLITE_API int SQLITE_APICALL sqlite3_trace_v2(
138123138251
sqlite3 *db, /* Trace this connection */
138124138252
unsigned mTrace, /* Mask of events to be traced */
138125138253
int(*xTrace)(unsigned,void*,void*,void*), /* Callback to invoke */
138126138254
void *pArg /* Context */
138127138255
){
@@ -138145,11 +138273,11 @@
138145138273
**
138146138274
** A NULL profile function means that no profiling is executes. A non-NULL
138147138275
** profile is a pointer to a function that is invoked at the conclusion of
138148138276
** each SQL statement that is run.
138149138277
*/
138150
-SQLITE_API void *SQLITE_STDCALL sqlite3_profile(
138278
+SQLITE_API void *SQLITE_APICALL sqlite3_profile(
138151138279
sqlite3 *db,
138152138280
void (*xProfile)(void*,const char*,sqlite_uint64),
138153138281
void *pArg
138154138282
){
138155138283
void *pOld;
@@ -138173,11 +138301,11 @@
138173138301
/*
138174138302
** Register a function to be invoked when a transaction commits.
138175138303
** If the invoked function returns non-zero, then the commit becomes a
138176138304
** rollback.
138177138305
*/
138178
-SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(
138306
+SQLITE_API void *SQLITE_APICALL sqlite3_commit_hook(
138179138307
sqlite3 *db, /* Attach the hook to this database */
138180138308
int (*xCallback)(void*), /* Function to invoke on each commit */
138181138309
void *pArg /* Argument to the function */
138182138310
){
138183138311
void *pOld;
@@ -138198,11 +138326,11 @@
138198138326
138199138327
/*
138200138328
** Register a callback to be invoked each time a row is updated,
138201138329
** inserted or deleted using this database connection.
138202138330
*/
138203
-SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
138331
+SQLITE_API void *SQLITE_APICALL sqlite3_update_hook(
138204138332
sqlite3 *db, /* Attach the hook to this database */
138205138333
void (*xCallback)(void*,int,char const *,char const *,sqlite_int64),
138206138334
void *pArg /* Argument to the function */
138207138335
){
138208138336
void *pRet;
@@ -138223,11 +138351,11 @@
138223138351
138224138352
/*
138225138353
** Register a callback to be invoked each time a transaction is rolled
138226138354
** back by this database connection.
138227138355
*/
138228
-SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(
138356
+SQLITE_API void *SQLITE_APICALL sqlite3_rollback_hook(
138229138357
sqlite3 *db, /* Attach the hook to this database */
138230138358
void (*xCallback)(void*), /* Callback function */
138231138359
void *pArg /* Argument to the function */
138232138360
){
138233138361
void *pRet;
@@ -138249,11 +138377,11 @@
138249138377
#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
138250138378
/*
138251138379
** Register a callback to be invoked each time a row is updated,
138252138380
** inserted or deleted using this database connection.
138253138381
*/
138254
-SQLITE_API void *SQLITE_STDCALL sqlite3_preupdate_hook(
138382
+SQLITE_API void *SQLITE_APICALL sqlite3_preupdate_hook(
138255138383
sqlite3 *db, /* Attach the hook to this database */
138256138384
void(*xCallback)( /* Callback function */
138257138385
void*,sqlite3*,int,char const*,char const*,sqlite3_int64,sqlite3_int64),
138258138386
void *pArg /* First callback argument */
138259138387
){
@@ -138298,11 +138426,11 @@
138298138426
** The callback registered by this function replaces any existing callback
138299138427
** registered using sqlite3_wal_hook(). Likewise, registering a callback
138300138428
** using sqlite3_wal_hook() disables the automatic checkpoint mechanism
138301138429
** configured by this function.
138302138430
*/
138303
-SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){
138431
+SQLITE_API int SQLITE_APICALL sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){
138304138432
#ifdef SQLITE_OMIT_WAL
138305138433
UNUSED_PARAMETER(db);
138306138434
UNUSED_PARAMETER(nFrame);
138307138435
#else
138308138436
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -138319,11 +138447,11 @@
138319138447
138320138448
/*
138321138449
** Register a callback to be invoked each time a transaction is written
138322138450
** into the write-ahead-log by this database connection.
138323138451
*/
138324
-SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
138452
+SQLITE_API void *SQLITE_APICALL sqlite3_wal_hook(
138325138453
sqlite3 *db, /* Attach the hook to this db handle */
138326138454
int(*xCallback)(void *, sqlite3*, const char*, int),
138327138455
void *pArg /* First argument passed to xCallback() */
138328138456
){
138329138457
#ifndef SQLITE_OMIT_WAL
@@ -138346,11 +138474,11 @@
138346138474
}
138347138475
138348138476
/*
138349138477
** Checkpoint database zDb.
138350138478
*/
138351
-SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
138479
+SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint_v2(
138352138480
sqlite3 *db, /* Database handle */
138353138481
const char *zDb, /* Name of attached database (or NULL) */
138354138482
int eMode, /* SQLITE_CHECKPOINT_* value */
138355138483
int *pnLog, /* OUT: Size of WAL log in frames */
138356138484
int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -138401,11 +138529,11 @@
138401138529
/*
138402138530
** Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points
138403138531
** to contains a zero-length string, all attached databases are
138404138532
** checkpointed.
138405138533
*/
138406
-SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){
138534
+SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){
138407138535
/* EVIDENCE-OF: R-41613-20553 The sqlite3_wal_checkpoint(D,X) is equivalent to
138408138536
** sqlite3_wal_checkpoint_v2(D,X,SQLITE_CHECKPOINT_PASSIVE,0,0). */
138409138537
return sqlite3_wal_checkpoint_v2(db,zDb,SQLITE_CHECKPOINT_PASSIVE,0,0);
138410138538
}
138411138539
@@ -138492,11 +138620,11 @@
138492138620
138493138621
/*
138494138622
** Return UTF-8 encoded English language explanation of the most recent
138495138623
** error.
138496138624
*/
138497
-SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3 *db){
138625
+SQLITE_API const char *SQLITE_APICALL sqlite3_errmsg(sqlite3 *db){
138498138626
const char *z;
138499138627
if( !db ){
138500138628
return sqlite3ErrStr(SQLITE_NOMEM_BKPT);
138501138629
}
138502138630
if( !sqlite3SafetyCheckSickOrOk(db) ){
@@ -138520,11 +138648,11 @@
138520138648
#ifndef SQLITE_OMIT_UTF16
138521138649
/*
138522138650
** Return UTF-16 encoded English language explanation of the most recent
138523138651
** error.
138524138652
*/
138525
-SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3 *db){
138653
+SQLITE_API const void *SQLITE_APICALL sqlite3_errmsg16(sqlite3 *db){
138526138654
static const u16 outOfMem[] = {
138527138655
'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0
138528138656
};
138529138657
static const u16 misuse[] = {
138530138658
'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ',
@@ -138565,38 +138693,38 @@
138565138693
138566138694
/*
138567138695
** Return the most recent error code generated by an SQLite routine. If NULL is
138568138696
** passed to this function, we assume a malloc() failed during sqlite3_open().
138569138697
*/
138570
-SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db){
138698
+SQLITE_API int SQLITE_APICALL sqlite3_errcode(sqlite3 *db){
138571138699
if( db && !sqlite3SafetyCheckSickOrOk(db) ){
138572138700
return SQLITE_MISUSE_BKPT;
138573138701
}
138574138702
if( !db || db->mallocFailed ){
138575138703
return SQLITE_NOMEM_BKPT;
138576138704
}
138577138705
return db->errCode & db->errMask;
138578138706
}
138579
-SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db){
138707
+SQLITE_API int SQLITE_APICALL sqlite3_extended_errcode(sqlite3 *db){
138580138708
if( db && !sqlite3SafetyCheckSickOrOk(db) ){
138581138709
return SQLITE_MISUSE_BKPT;
138582138710
}
138583138711
if( !db || db->mallocFailed ){
138584138712
return SQLITE_NOMEM_BKPT;
138585138713
}
138586138714
return db->errCode;
138587138715
}
138588
-SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3 *db){
138716
+SQLITE_API int SQLITE_APICALL sqlite3_system_errno(sqlite3 *db){
138589138717
return db ? db->iSysErrno : 0;
138590138718
}
138591138719
138592138720
/*
138593138721
** Return a string that describes the kind of error specified in the
138594138722
** argument. For now, this simply calls the internal sqlite3ErrStr()
138595138723
** function.
138596138724
*/
138597
-SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int rc){
138725
+SQLITE_API const char *SQLITE_APICALL sqlite3_errstr(int rc){
138598138726
return sqlite3ErrStr(rc);
138599138727
}
138600138728
138601138729
/*
138602138730
** Create a new collating function for database "db". The name is zName
@@ -138740,11 +138868,11 @@
138740138868
**
138741138869
** A new lower limit does not shrink existing constructs.
138742138870
** It merely prevents new constructs that exceed the limit
138743138871
** from forming.
138744138872
*/
138745
-SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3 *db, int limitId, int newLimit){
138873
+SQLITE_API int SQLITE_APICALL sqlite3_limit(sqlite3 *db, int limitId, int newLimit){
138746138874
int oldLimit;
138747138875
138748138876
#ifdef SQLITE_ENABLE_API_ARMOR
138749138877
if( !sqlite3SafetyCheckOk(db) ){
138750138878
(void)SQLITE_MISUSE_BKPT;
@@ -139364,18 +139492,18 @@
139364139492
}
139365139493
139366139494
/*
139367139495
** Open a new database handle.
139368139496
*/
139369
-SQLITE_API int SQLITE_STDCALL sqlite3_open(
139497
+SQLITE_API int SQLITE_APICALL sqlite3_open(
139370139498
const char *zFilename,
139371139499
sqlite3 **ppDb
139372139500
){
139373139501
return openDatabase(zFilename, ppDb,
139374139502
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0);
139375139503
}
139376
-SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
139504
+SQLITE_API int SQLITE_APICALL sqlite3_open_v2(
139377139505
const char *filename, /* Database filename (UTF-8) */
139378139506
sqlite3 **ppDb, /* OUT: SQLite db handle */
139379139507
int flags, /* Flags */
139380139508
const char *zVfs /* Name of VFS module to use */
139381139509
){
@@ -139384,11 +139512,11 @@
139384139512
139385139513
#ifndef SQLITE_OMIT_UTF16
139386139514
/*
139387139515
** Open a new database handle.
139388139516
*/
139389
-SQLITE_API int SQLITE_STDCALL sqlite3_open16(
139517
+SQLITE_API int SQLITE_APICALL sqlite3_open16(
139390139518
const void *zFilename,
139391139519
sqlite3 **ppDb
139392139520
){
139393139521
char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */
139394139522
sqlite3_value *pVal;
@@ -139423,11 +139551,11 @@
139423139551
#endif /* SQLITE_OMIT_UTF16 */
139424139552
139425139553
/*
139426139554
** Register a new collation sequence with the database handle db.
139427139555
*/
139428
-SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
139556
+SQLITE_API int SQLITE_APICALL sqlite3_create_collation(
139429139557
sqlite3* db,
139430139558
const char *zName,
139431139559
int enc,
139432139560
void* pCtx,
139433139561
int(*xCompare)(void*,int,const void*,int,const void*)
@@ -139436,11 +139564,11 @@
139436139564
}
139437139565
139438139566
/*
139439139567
** Register a new collation sequence with the database handle db.
139440139568
*/
139441
-SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
139569
+SQLITE_API int SQLITE_APICALL sqlite3_create_collation_v2(
139442139570
sqlite3* db,
139443139571
const char *zName,
139444139572
int enc,
139445139573
void* pCtx,
139446139574
int(*xCompare)(void*,int,const void*,int,const void*),
@@ -139461,11 +139589,11 @@
139461139589
139462139590
#ifndef SQLITE_OMIT_UTF16
139463139591
/*
139464139592
** Register a new collation sequence with the database handle db.
139465139593
*/
139466
-SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
139594
+SQLITE_API int SQLITE_APICALL sqlite3_create_collation16(
139467139595
sqlite3* db,
139468139596
const void *zName,
139469139597
int enc,
139470139598
void* pCtx,
139471139599
int(*xCompare)(void*,int,const void*,int,const void*)
@@ -139491,11 +139619,11 @@
139491139619
139492139620
/*
139493139621
** Register a collation sequence factory callback with the database handle
139494139622
** db. Replace any previously installed collation sequence factory.
139495139623
*/
139496
-SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
139624
+SQLITE_API int SQLITE_APICALL sqlite3_collation_needed(
139497139625
sqlite3 *db,
139498139626
void *pCollNeededArg,
139499139627
void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*)
139500139628
){
139501139629
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -139512,11 +139640,11 @@
139512139640
#ifndef SQLITE_OMIT_UTF16
139513139641
/*
139514139642
** Register a collation sequence factory callback with the database handle
139515139643
** db. Replace any previously installed collation sequence factory.
139516139644
*/
139517
-SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
139645
+SQLITE_API int SQLITE_APICALL sqlite3_collation_needed16(
139518139646
sqlite3 *db,
139519139647
void *pCollNeededArg,
139520139648
void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*)
139521139649
){
139522139650
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -139534,11 +139662,11 @@
139534139662
#ifndef SQLITE_OMIT_DEPRECATED
139535139663
/*
139536139664
** This function is now an anachronism. It used to be used to recover from a
139537139665
** malloc() failure, but SQLite now does this automatically.
139538139666
*/
139539
-SQLITE_API int SQLITE_STDCALL sqlite3_global_recover(void){
139667
+SQLITE_API int SQLITE_APICALL sqlite3_global_recover(void){
139540139668
return SQLITE_OK;
139541139669
}
139542139670
#endif
139543139671
139544139672
/*
@@ -139545,11 +139673,11 @@
139545139673
** Test to see whether or not the database connection is in autocommit
139546139674
** mode. Return TRUE if it is and FALSE if not. Autocommit mode is on
139547139675
** by default. Autocommit is disabled by a BEGIN statement and reenabled
139548139676
** by the next COMMIT or ROLLBACK.
139549139677
*/
139550
-SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3 *db){
139678
+SQLITE_API int SQLITE_APICALL sqlite3_get_autocommit(sqlite3 *db){
139551139679
#ifdef SQLITE_ENABLE_API_ARMOR
139552139680
if( !sqlite3SafetyCheckOk(db) ){
139553139681
(void)SQLITE_MISUSE_BKPT;
139554139682
return 0;
139555139683
}
@@ -139602,19 +139730,19 @@
139602139730
** data for this thread has been deallocated.
139603139731
**
139604139732
** SQLite no longer uses thread-specific data so this routine is now a
139605139733
** no-op. It is retained for historical compatibility.
139606139734
*/
139607
-SQLITE_API void SQLITE_STDCALL sqlite3_thread_cleanup(void){
139735
+SQLITE_API void SQLITE_APICALL sqlite3_thread_cleanup(void){
139608139736
}
139609139737
#endif
139610139738
139611139739
/*
139612139740
** Return meta information about a specific column of a database table.
139613139741
** See comment in sqlite3.h (sqlite.h.in) for details.
139614139742
*/
139615
-SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
139743
+SQLITE_API int SQLITE_APICALL sqlite3_table_column_metadata(
139616139744
sqlite3 *db, /* Connection handle */
139617139745
const char *zDbName, /* Database name or NULL */
139618139746
const char *zTableName, /* Table name */
139619139747
const char *zColumnName, /* Column name */
139620139748
char const **pzDataType, /* OUTPUT: Declared data type */
@@ -139728,11 +139856,11 @@
139728139856
}
139729139857
139730139858
/*
139731139859
** Sleep for a little while. Return the amount of time slept.
139732139860
*/
139733
-SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int ms){
139861
+SQLITE_API int SQLITE_APICALL sqlite3_sleep(int ms){
139734139862
sqlite3_vfs *pVfs;
139735139863
int rc;
139736139864
pVfs = sqlite3_vfs_find(0);
139737139865
if( pVfs==0 ) return 0;
139738139866
@@ -139744,11 +139872,11 @@
139744139872
}
139745139873
139746139874
/*
139747139875
** Enable or disable the extended result codes.
139748139876
*/
139749
-SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3 *db, int onoff){
139877
+SQLITE_API int SQLITE_APICALL sqlite3_extended_result_codes(sqlite3 *db, int onoff){
139750139878
#ifdef SQLITE_ENABLE_API_ARMOR
139751139879
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
139752139880
#endif
139753139881
sqlite3_mutex_enter(db->mutex);
139754139882
db->errMask = onoff ? 0xffffffff : 0xff;
@@ -139757,11 +139885,11 @@
139757139885
}
139758139886
139759139887
/*
139760139888
** Invoke the xFileControl method on a particular database.
139761139889
*/
139762
-SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
139890
+SQLITE_API int SQLITE_APICALL sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
139763139891
int rc = SQLITE_ERROR;
139764139892
Btree *pBtree;
139765139893
139766139894
#ifdef SQLITE_ENABLE_API_ARMOR
139767139895
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -140142,11 +140270,11 @@
140142140270
** method of a VFS implementation. The zParam argument is the name of the
140143140271
** query parameter we seek. This routine returns the value of the zParam
140144140272
** parameter if it exists. If the parameter does not exist, this routine
140145140273
** returns a NULL pointer.
140146140274
*/
140147
-SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam){
140275
+SQLITE_API const char *SQLITE_APICALL sqlite3_uri_parameter(const char *zFilename, const char *zParam){
140148140276
if( zFilename==0 || zParam==0 ) return 0;
140149140277
zFilename += sqlite3Strlen30(zFilename) + 1;
140150140278
while( zFilename[0] ){
140151140279
int x = strcmp(zFilename, zParam);
140152140280
zFilename += sqlite3Strlen30(zFilename) + 1;
@@ -140157,20 +140285,20 @@
140157140285
}
140158140286
140159140287
/*
140160140288
** Return a boolean value for a query parameter.
140161140289
*/
140162
-SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){
140290
+SQLITE_API int SQLITE_APICALL sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){
140163140291
const char *z = sqlite3_uri_parameter(zFilename, zParam);
140164140292
bDflt = bDflt!=0;
140165140293
return z ? sqlite3GetBoolean(z, bDflt) : bDflt;
140166140294
}
140167140295
140168140296
/*
140169140297
** Return a 64-bit integer value for a query parameter.
140170140298
*/
140171
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(
140299
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_uri_int64(
140172140300
const char *zFilename, /* Filename as passed to xOpen */
140173140301
const char *zParam, /* URI parameter sought */
140174140302
sqlite3_int64 bDflt /* return if parameter is missing */
140175140303
){
140176140304
const char *z = sqlite3_uri_parameter(zFilename, zParam);
@@ -140198,11 +140326,11 @@
140198140326
140199140327
/*
140200140328
** Return the filename of the database associated with a database
140201140329
** connection.
140202140330
*/
140203
-SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName){
140331
+SQLITE_API const char *SQLITE_APICALL sqlite3_db_filename(sqlite3 *db, const char *zDbName){
140204140332
Btree *pBt;
140205140333
#ifdef SQLITE_ENABLE_API_ARMOR
140206140334
if( !sqlite3SafetyCheckOk(db) ){
140207140335
(void)SQLITE_MISUSE_BKPT;
140208140336
return 0;
@@ -140214,11 +140342,11 @@
140214140342
140215140343
/*
140216140344
** Return 1 if database is read-only or 0 if read/write. Return -1 if
140217140345
** no such database exists.
140218140346
*/
140219
-SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName){
140347
+SQLITE_API int SQLITE_APICALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName){
140220140348
Btree *pBt;
140221140349
#ifdef SQLITE_ENABLE_API_ARMOR
140222140350
if( !sqlite3SafetyCheckOk(db) ){
140223140351
(void)SQLITE_MISUSE_BKPT;
140224140352
return -1;
@@ -140231,11 +140359,11 @@
140231140359
#ifdef SQLITE_ENABLE_SNAPSHOT
140232140360
/*
140233140361
** Obtain a snapshot handle for the snapshot of database zDb currently
140234140362
** being read by handle db.
140235140363
*/
140236
-SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_get(
140364
+SQLITE_API int SQLITE_APICALL sqlite3_snapshot_get(
140237140365
sqlite3 *db,
140238140366
const char *zDb,
140239140367
sqlite3_snapshot **ppSnapshot
140240140368
){
140241140369
int rc = SQLITE_ERROR;
@@ -140266,11 +140394,11 @@
140266140394
}
140267140395
140268140396
/*
140269140397
** Open a read-transaction on the snapshot idendified by pSnapshot.
140270140398
*/
140271
-SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_open(
140399
+SQLITE_API int SQLITE_APICALL sqlite3_snapshot_open(
140272140400
sqlite3 *db,
140273140401
const char *zDb,
140274140402
sqlite3_snapshot *pSnapshot
140275140403
){
140276140404
int rc = SQLITE_ERROR;
@@ -140303,11 +140431,11 @@
140303140431
}
140304140432
140305140433
/*
140306140434
** Free a snapshot handle obtained from sqlite3_snapshot_get().
140307140435
*/
140308
-SQLITE_API void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot *pSnapshot){
140436
+SQLITE_API void SQLITE_APICALL sqlite3_snapshot_free(sqlite3_snapshot *pSnapshot){
140309140437
sqlite3_free(pSnapshot);
140310140438
}
140311140439
#endif /* SQLITE_ENABLE_SNAPSHOT */
140312140440
140313140441
/************** End of main.c ************************************************/
@@ -140457,11 +140585,11 @@
140457140585
**
140458140586
** Each call to this routine overrides any prior callbacks registered
140459140587
** on the same "db". If xNotify==0 then any prior callbacks are immediately
140460140588
** cancelled.
140461140589
*/
140462
-SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
140590
+SQLITE_API int SQLITE_APICALL sqlite3_unlock_notify(
140463140591
sqlite3 *db,
140464140592
void (*xNotify)(void **, int),
140465140593
void *pArg
140466140594
){
140467140595
int rc = SQLITE_OK;
@@ -147460,11 +147588,11 @@
147460147588
** Initialize API pointer table, if required.
147461147589
*/
147462147590
#ifdef _WIN32
147463147591
__declspec(dllexport)
147464147592
#endif
147465
-SQLITE_API int SQLITE_STDCALL sqlite3_fts3_init(
147593
+SQLITE_API int SQLITE_APICALL sqlite3_fts3_init(
147466147594
sqlite3 *db,
147467147595
char **pzErrMsg,
147468147596
const sqlite3_api_routines *pApi
147469147597
){
147470147598
SQLITE_EXTENSION_INIT2(pApi)
@@ -150616,11 +150744,15 @@
150616150744
}
150617150745
150618150746
150619150747
#ifdef SQLITE_TEST
150620150748
150621
-#include <tcl.h>
150749
+#if defined(INCLUDE_SQLITE_TCL_H)
150750
+# include "sqlite_tcl.h"
150751
+#else
150752
+# include "tcl.h"
150753
+#endif
150622150754
/* #include <string.h> */
150623150755
150624150756
/*
150625150757
** Implementation of a special SQL scalar function for testing tokenizers
150626150758
** designed to be used in concert with the Tcl testing framework. This
@@ -163257,11 +163389,11 @@
163257163389
}
163258163390
163259163391
/*
163260163392
** Register a new geometry function for use with the r-tree MATCH operator.
163261163393
*/
163262
-SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
163394
+SQLITE_API int SQLITE_APICALL sqlite3_rtree_geometry_callback(
163263163395
sqlite3 *db, /* Register SQL function on this connection */
163264163396
const char *zGeom, /* Name of the new SQL function */
163265163397
int (*xGeom)(sqlite3_rtree_geometry*,int,RtreeDValue*,int*), /* Callback */
163266163398
void *pContext /* Extra data associated with the callback */
163267163399
){
@@ -163281,11 +163413,11 @@
163281163413
163282163414
/*
163283163415
** Register a new 2nd-generation geometry function for use with the
163284163416
** r-tree MATCH operator.
163285163417
*/
163286
-SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
163418
+SQLITE_API int SQLITE_APICALL sqlite3_rtree_query_callback(
163287163419
sqlite3 *db, /* Register SQL function on this connection */
163288163420
const char *zQueryFunc, /* Name of new SQL function */
163289163421
int (*xQueryFunc)(sqlite3_rtree_query_info*), /* Callback */
163290163422
void *pContext, /* Extra data passed into the callback */
163291163423
void (*xDestructor)(void*) /* Destructor for the extra data */
@@ -163306,11 +163438,11 @@
163306163438
163307163439
#if !SQLITE_CORE
163308163440
#ifdef _WIN32
163309163441
__declspec(dllexport)
163310163442
#endif
163311
-SQLITE_API int SQLITE_STDCALL sqlite3_rtree_init(
163443
+SQLITE_API int SQLITE_APICALL sqlite3_rtree_init(
163312163444
sqlite3 *db,
163313163445
char **pzErrMsg,
163314163446
const sqlite3_api_routines *pApi
163315163447
){
163316163448
SQLITE_EXTENSION_INIT2(pApi)
@@ -163857,11 +163989,11 @@
163857163989
163858163990
#if !SQLITE_CORE
163859163991
#ifdef _WIN32
163860163992
__declspec(dllexport)
163861163993
#endif
163862
-SQLITE_API int SQLITE_STDCALL sqlite3_icu_init(
163994
+SQLITE_API int SQLITE_APICALL sqlite3_icu_init(
163863163995
sqlite3 *db,
163864163996
char **pzErrMsg,
163865163997
const sqlite3_api_routines *pApi
163866163998
){
163867163999
SQLITE_EXTENSION_INIT2(pApi)
@@ -164537,11 +164669,11 @@
164537164669
** IMPORTANT NOTE FOR ZIPVFS USERS: The RBU extension works with all of
164538164670
** SQLite's built-in VFSs, including the multiplexor VFS. However it does
164539164671
** not work out of the box with zipvfs. Refer to the comment describing
164540164672
** the zipvfs_create_vfs() API below for details on using RBU with zipvfs.
164541164673
*/
164542
-SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_open(
164674
+SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_open(
164543164675
const char *zTarget,
164544164676
const char *zRbu,
164545164677
const char *zState
164546164678
);
164547164679
@@ -164570,11 +164702,11 @@
164570164702
** As with sqlite3rbu_open(), Zipvfs users should rever to the comment
164571164703
** describing the sqlite3rbu_create_vfs() API function below for
164572164704
** a description of the complications associated with using RBU with
164573164705
** zipvfs databases.
164574164706
*/
164575
-SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_vacuum(
164707
+SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_vacuum(
164576164708
const char *zTarget,
164577164709
const char *zState
164578164710
);
164579164711
164580164712
/*
@@ -164606,11 +164738,11 @@
164606164738
** when sqlite3rbu_close() is called.
164607164739
**
164608164740
** Database handles returned by this function remain valid until the next
164609164741
** call to any sqlite3rbu_xxx() function other than sqlite3rbu_db().
164610164742
*/
164611
-SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3rbu_db(sqlite3rbu*, int bRbu);
164743
+SQLITE_API sqlite3 *SQLITE_APICALL sqlite3rbu_db(sqlite3rbu*, int bRbu);
164612164744
164613164745
/*
164614164746
** Do some work towards applying the RBU update to the target db.
164615164747
**
164616164748
** Return SQLITE_DONE if the update has been completely applied, or
@@ -164620,11 +164752,11 @@
164620164752
**
164621164753
** Once a call to sqlite3rbu_step() has returned a value other than
164622164754
** SQLITE_OK, all subsequent calls on the same RBU handle are no-ops
164623164755
** that immediately return the same value.
164624164756
*/
164625
-SQLITE_API int SQLITE_STDCALL sqlite3rbu_step(sqlite3rbu *pRbu);
164757
+SQLITE_API int SQLITE_APICALL sqlite3rbu_step(sqlite3rbu *pRbu);
164626164758
164627164759
/*
164628164760
** Force RBU to save its state to disk.
164629164761
**
164630164762
** If a power failure or application crash occurs during an update, following
@@ -164632,11 +164764,11 @@
164632164764
** was last saved. In other words, from the most recent successful call to
164633164765
** sqlite3rbu_close() or this function.
164634164766
**
164635164767
** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
164636164768
*/
164637
-SQLITE_API int SQLITE_STDCALL sqlite3rbu_savestate(sqlite3rbu *pRbu);
164769
+SQLITE_API int SQLITE_APICALL sqlite3rbu_savestate(sqlite3rbu *pRbu);
164638164770
164639164771
/*
164640164772
** Close an RBU handle.
164641164773
**
164642164774
** If the RBU update has been completely applied, mark the RBU database
@@ -164652,18 +164784,18 @@
164652164784
**
164653164785
** Otherwise, if no error occurs, this function returns SQLITE_OK if the
164654164786
** update has been partially applied, or SQLITE_DONE if it has been
164655164787
** completely applied.
164656164788
*/
164657
-SQLITE_API int SQLITE_STDCALL sqlite3rbu_close(sqlite3rbu *pRbu, char **pzErrmsg);
164789
+SQLITE_API int SQLITE_APICALL sqlite3rbu_close(sqlite3rbu *pRbu, char **pzErrmsg);
164658164790
164659164791
/*
164660164792
** Return the total number of key-value operations (inserts, deletes or
164661164793
** updates) that have been performed on the target database since the
164662164794
** current RBU update was started.
164663164795
*/
164664
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3rbu_progress(sqlite3rbu *pRbu);
164796
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3rbu_progress(sqlite3rbu *pRbu);
164665164797
164666164798
/*
164667164799
** Obtain permyriadage (permyriadage is to 10000 as percentage is to 100)
164668164800
** progress indications for the two stages of an RBU update. This API may
164669164801
** be useful for driving GUI progress indicators and similar.
@@ -164701,11 +164833,11 @@
164701164833
** permyriadage progress of the same stage. If the rbu_count table does
164702164834
** not exist, then (*pnOne) is set to -1 during stage 1. If the rbu_count
164703164835
** table exists but is not correctly populated, the value of the *pnOne
164704164836
** output variable during stage 1 is undefined.
164705164837
*/
164706
-SQLITE_API void SQLITE_STDCALL sqlite3rbu_bp_progress(sqlite3rbu *pRbu, int *pnOne, int *pnTwo);
164838
+SQLITE_API void SQLITE_APICALL sqlite3rbu_bp_progress(sqlite3rbu *pRbu, int *pnOne, int *pnTwo);
164707164839
164708164840
/*
164709164841
** Obtain an indication as to the current stage of an RBU update or vacuum.
164710164842
** This function always returns one of the SQLITE_RBU_STATE_XXX constants
164711164843
** defined in this file. Return values should be interpreted as follows:
@@ -164739,11 +164871,11 @@
164739164871
#define SQLITE_RBU_STATE_MOVE 2
164740164872
#define SQLITE_RBU_STATE_CHECKPOINT 3
164741164873
#define SQLITE_RBU_STATE_DONE 4
164742164874
#define SQLITE_RBU_STATE_ERROR 5
164743164875
164744
-SQLITE_API int SQLITE_STDCALL sqlite3rbu_state(sqlite3rbu *pRbu);
164876
+SQLITE_API int SQLITE_APICALL sqlite3rbu_state(sqlite3rbu *pRbu);
164745164877
164746164878
/*
164747164879
** Create an RBU VFS named zName that accesses the underlying file-system
164748164880
** via existing VFS zParent. Or, if the zParent parameter is passed NULL,
164749164881
** then the new RBU VFS uses the default system VFS to access the file-system.
@@ -164783,21 +164915,21 @@
164783164915
** The overhead of adding the "rbu" VFS to the system is negligible for
164784164916
** non-RBU users. There is no harm in an application accessing the
164785164917
** file-system via "rbu" all the time, even if it only uses RBU functionality
164786164918
** occasionally.
164787164919
*/
164788
-SQLITE_API int SQLITE_STDCALL sqlite3rbu_create_vfs(const char *zName, const char *zParent);
164920
+SQLITE_API int SQLITE_APICALL sqlite3rbu_create_vfs(const char *zName, const char *zParent);
164789164921
164790164922
/*
164791164923
** Deregister and destroy an RBU vfs created by an earlier call to
164792164924
** sqlite3rbu_create_vfs().
164793164925
**
164794164926
** VFS objects are not reference counted. If a VFS object is destroyed
164795164927
** before all database handles that use it have been closed, the results
164796164928
** are undefined.
164797164929
*/
164798
-SQLITE_API void SQLITE_STDCALL sqlite3rbu_destroy_vfs(const char *zName);
164930
+SQLITE_API void SQLITE_APICALL sqlite3rbu_destroy_vfs(const char *zName);
164799164931
164800164932
#if 0
164801164933
} /* end of the 'extern "C"' block */
164802164934
#endif
164803164935
@@ -167887,11 +168019,11 @@
167887168019
}
167888168020
167889168021
/*
167890168022
** Step the RBU object.
167891168023
*/
167892
-SQLITE_API int SQLITE_STDCALL sqlite3rbu_step(sqlite3rbu *p){
168024
+SQLITE_API int SQLITE_APICALL sqlite3rbu_step(sqlite3rbu *p){
167893168025
if( p ){
167894168026
switch( p->eStage ){
167895168027
case RBU_STAGE_OAL: {
167896168028
RbuObjIter *pIter = &p->objiter;
167897168029
@@ -168329,11 +168461,11 @@
168329168461
}
168330168462
168331168463
/*
168332168464
** Open and return a new RBU handle.
168333168465
*/
168334
-SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_open(
168466
+SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_open(
168335168467
const char *zTarget,
168336168468
const char *zRbu,
168337168469
const char *zState
168338168470
){
168339168471
/* TODO: Check that zTarget and zRbu are non-NULL */
@@ -168341,11 +168473,11 @@
168341168473
}
168342168474
168343168475
/*
168344168476
** Open a handle to begin or resume an RBU VACUUM operation.
168345168477
*/
168346
-SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_vacuum(
168478
+SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_vacuum(
168347168479
const char *zTarget,
168348168480
const char *zState
168349168481
){
168350168482
/* TODO: Check that both arguments are non-NULL */
168351168483
return openRbuHandle(0, zTarget, zState);
@@ -168352,11 +168484,11 @@
168352168484
}
168353168485
168354168486
/*
168355168487
** Return the database handle used by pRbu.
168356168488
*/
168357
-SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3rbu_db(sqlite3rbu *pRbu, int bRbu){
168489
+SQLITE_API sqlite3 *SQLITE_APICALL sqlite3rbu_db(sqlite3rbu *pRbu, int bRbu){
168358168490
sqlite3 *db = 0;
168359168491
if( pRbu ){
168360168492
db = (bRbu ? pRbu->dbRbu : pRbu->dbMain);
168361168493
}
168362168494
return db;
@@ -168384,11 +168516,11 @@
168384168516
}
168385168517
168386168518
/*
168387168519
** Close the RBU handle.
168388168520
*/
168389
-SQLITE_API int SQLITE_STDCALL sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){
168521
+SQLITE_API int SQLITE_APICALL sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){
168390168522
int rc;
168391168523
if( p ){
168392168524
168393168525
/* Commit the transaction to the *-oal file. */
168394168526
if( p->rc==SQLITE_OK && p->eStage==RBU_STAGE_OAL ){
@@ -168435,19 +168567,19 @@
168435168567
/*
168436168568
** Return the total number of key-value operations (inserts, deletes or
168437168569
** updates) that have been performed on the target database since the
168438168570
** current RBU update was started.
168439168571
*/
168440
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3rbu_progress(sqlite3rbu *pRbu){
168572
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3rbu_progress(sqlite3rbu *pRbu){
168441168573
return pRbu->nProgress;
168442168574
}
168443168575
168444168576
/*
168445168577
** Return permyriadage progress indications for the two main stages of
168446168578
** an RBU update.
168447168579
*/
168448
-SQLITE_API void SQLITE_STDCALL sqlite3rbu_bp_progress(sqlite3rbu *p, int *pnOne, int *pnTwo){
168580
+SQLITE_API void SQLITE_APICALL sqlite3rbu_bp_progress(sqlite3rbu *p, int *pnOne, int *pnTwo){
168449168581
const int MAX_PROGRESS = 10000;
168450168582
switch( p->eStage ){
168451168583
case RBU_STAGE_OAL:
168452168584
if( p->nPhaseOneStep>0 ){
168453168585
*pnOne = (int)(MAX_PROGRESS * (i64)p->nProgress/(i64)p->nPhaseOneStep);
@@ -168478,11 +168610,11 @@
168478168610
}
168479168611
168480168612
/*
168481168613
** Return the current state of the RBU vacuum or update operation.
168482168614
*/
168483
-SQLITE_API int SQLITE_STDCALL sqlite3rbu_state(sqlite3rbu *p){
168615
+SQLITE_API int SQLITE_APICALL sqlite3rbu_state(sqlite3rbu *p){
168484168616
int aRes[] = {
168485168617
0, SQLITE_RBU_STATE_OAL, SQLITE_RBU_STATE_MOVE,
168486168618
0, SQLITE_RBU_STATE_CHECKPOINT, SQLITE_RBU_STATE_DONE
168487168619
};
168488168620
@@ -168506,11 +168638,11 @@
168506168638
);
168507168639
return aRes[p->eStage];
168508168640
}
168509168641
}
168510168642
168511
-SQLITE_API int SQLITE_STDCALL sqlite3rbu_savestate(sqlite3rbu *p){
168643
+SQLITE_API int SQLITE_APICALL sqlite3rbu_savestate(sqlite3rbu *p){
168512168644
int rc = p->rc;
168513168645
if( rc==SQLITE_DONE ) return SQLITE_OK;
168514168646
168515168647
assert( p->eStage>=RBU_STAGE_OAL && p->eStage<=RBU_STAGE_DONE );
168516168648
if( p->eStage==RBU_STAGE_OAL ){
@@ -169333,11 +169465,11 @@
169333169465
169334169466
/*
169335169467
** Deregister and destroy an RBU vfs created by an earlier call to
169336169468
** sqlite3rbu_create_vfs().
169337169469
*/
169338
-SQLITE_API void SQLITE_STDCALL sqlite3rbu_destroy_vfs(const char *zName){
169470
+SQLITE_API void SQLITE_APICALL sqlite3rbu_destroy_vfs(const char *zName){
169339169471
sqlite3_vfs *pVfs = sqlite3_vfs_find(zName);
169340169472
if( pVfs && pVfs->xOpen==rbuVfsOpen ){
169341169473
sqlite3_mutex_free(((rbu_vfs*)pVfs)->mutex);
169342169474
sqlite3_vfs_unregister(pVfs);
169343169475
sqlite3_free(pVfs);
@@ -169347,11 +169479,11 @@
169347169479
/*
169348169480
** Create an RBU VFS named zName that accesses the underlying file-system
169349169481
** via existing VFS zParent. The new object is registered as a non-default
169350169482
** VFS with SQLite before returning.
169351169483
*/
169352
-SQLITE_API int SQLITE_STDCALL sqlite3rbu_create_vfs(const char *zName, const char *zParent){
169484
+SQLITE_API int SQLITE_APICALL sqlite3rbu_create_vfs(const char *zName, const char *zParent){
169353169485
169354169486
/* Template for VFS */
169355169487
static sqlite3_vfs vfs_template = {
169356169488
1, /* iVersion */
169357169489
0, /* szOsFile */
@@ -171592,11 +171724,11 @@
171592171724
}
171593171725
171594171726
return rc;
171595171727
}
171596171728
171597
-SQLITE_API int SQLITE_STDCALL sqlite3session_diff(
171729
+SQLITE_API int SQLITE_APICALL sqlite3session_diff(
171598171730
sqlite3_session *pSession,
171599171731
const char *zFrom,
171600171732
const char *zTbl,
171601171733
char **pzErrMsg
171602171734
){
@@ -171686,11 +171818,11 @@
171686171818
171687171819
/*
171688171820
** Create a session object. This session object will record changes to
171689171821
** database zDb attached to connection db.
171690171822
*/
171691
-SQLITE_API int SQLITE_STDCALL sqlite3session_create(
171823
+SQLITE_API int SQLITE_APICALL sqlite3session_create(
171692171824
sqlite3 *db, /* Database handle */
171693171825
const char *zDb, /* Name of db (e.g. "main") */
171694171826
sqlite3_session **ppSession /* OUT: New session object */
171695171827
){
171696171828
sqlite3_session *pNew; /* Newly allocated session object */
@@ -171748,11 +171880,11 @@
171748171880
}
171749171881
171750171882
/*
171751171883
** Delete a session object previously allocated using sqlite3session_create().
171752171884
*/
171753
-SQLITE_API void SQLITE_STDCALL sqlite3session_delete(sqlite3_session *pSession){
171885
+SQLITE_API void SQLITE_APICALL sqlite3session_delete(sqlite3_session *pSession){
171754171886
sqlite3 *db = pSession->db;
171755171887
sqlite3_session *pHead;
171756171888
sqlite3_session **pp;
171757171889
171758171890
/* Unlink the session from the linked list of sessions attached to the
@@ -171777,11 +171909,11 @@
171777171909
}
171778171910
171779171911
/*
171780171912
** Set a table filter on a Session Object.
171781171913
*/
171782
-SQLITE_API void SQLITE_STDCALL sqlite3session_table_filter(
171914
+SQLITE_API void SQLITE_APICALL sqlite3session_table_filter(
171783171915
sqlite3_session *pSession,
171784171916
int(*xFilter)(void*, const char*),
171785171917
void *pCtx /* First argument passed to xFilter */
171786171918
){
171787171919
pSession->bAutoAttach = 1;
@@ -171795,11 +171927,11 @@
171795171927
**
171796171928
** Only tables that have a PRIMARY KEY defined may be attached. It does
171797171929
** not matter if the PRIMARY KEY is an "INTEGER PRIMARY KEY" (rowid alias)
171798171930
** or not.
171799171931
*/
171800
-SQLITE_API int SQLITE_STDCALL sqlite3session_attach(
171932
+SQLITE_API int SQLITE_APICALL sqlite3session_attach(
171801171933
sqlite3_session *pSession, /* Session object */
171802171934
const char *zName /* Table name */
171803171935
){
171804171936
int rc = SQLITE_OK;
171805171937
sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
@@ -172485,11 +172617,11 @@
172485172617
** session object passed as the first argument.
172486172618
**
172487172619
** It is the responsibility of the caller to eventually free the buffer
172488172620
** using sqlite3_free().
172489172621
*/
172490
-SQLITE_API int SQLITE_STDCALL sqlite3session_changeset(
172622
+SQLITE_API int SQLITE_APICALL sqlite3session_changeset(
172491172623
sqlite3_session *pSession, /* Session object */
172492172624
int *pnChangeset, /* OUT: Size of buffer at *ppChangeset */
172493172625
void **ppChangeset /* OUT: Buffer containing changeset */
172494172626
){
172495172627
return sessionGenerateChangeset(pSession, 0, 0, 0, pnChangeset, ppChangeset);
@@ -172496,11 +172628,11 @@
172496172628
}
172497172629
172498172630
/*
172499172631
** Streaming version of sqlite3session_changeset().
172500172632
*/
172501
-SQLITE_API int SQLITE_STDCALL sqlite3session_changeset_strm(
172633
+SQLITE_API int SQLITE_APICALL sqlite3session_changeset_strm(
172502172634
sqlite3_session *pSession,
172503172635
int (*xOutput)(void *pOut, const void *pData, int nData),
172504172636
void *pOut
172505172637
){
172506172638
return sessionGenerateChangeset(pSession, 0, xOutput, pOut, 0, 0);
@@ -172507,11 +172639,11 @@
172507172639
}
172508172640
172509172641
/*
172510172642
** Streaming version of sqlite3session_patchset().
172511172643
*/
172512
-SQLITE_API int SQLITE_STDCALL sqlite3session_patchset_strm(
172644
+SQLITE_API int SQLITE_APICALL sqlite3session_patchset_strm(
172513172645
sqlite3_session *pSession,
172514172646
int (*xOutput)(void *pOut, const void *pData, int nData),
172515172647
void *pOut
172516172648
){
172517172649
return sessionGenerateChangeset(pSession, 1, xOutput, pOut, 0, 0);
@@ -172522,11 +172654,11 @@
172522172654
** session object passed as the first argument.
172523172655
**
172524172656
** It is the responsibility of the caller to eventually free the buffer
172525172657
** using sqlite3_free().
172526172658
*/
172527
-SQLITE_API int SQLITE_STDCALL sqlite3session_patchset(
172659
+SQLITE_API int SQLITE_APICALL sqlite3session_patchset(
172528172660
sqlite3_session *pSession, /* Session object */
172529172661
int *pnPatchset, /* OUT: Size of buffer at *ppChangeset */
172530172662
void **ppPatchset /* OUT: Buffer containing changeset */
172531172663
){
172532172664
return sessionGenerateChangeset(pSession, 1, 0, 0, pnPatchset, ppPatchset);
@@ -172533,11 +172665,11 @@
172533172665
}
172534172666
172535172667
/*
172536172668
** Enable or disable the session object passed as the first argument.
172537172669
*/
172538
-SQLITE_API int SQLITE_STDCALL sqlite3session_enable(sqlite3_session *pSession, int bEnable){
172670
+SQLITE_API int SQLITE_APICALL sqlite3session_enable(sqlite3_session *pSession, int bEnable){
172539172671
int ret;
172540172672
sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172541172673
if( bEnable>=0 ){
172542172674
pSession->bEnable = bEnable;
172543172675
}
@@ -172547,11 +172679,11 @@
172547172679
}
172548172680
172549172681
/*
172550172682
** Enable or disable the session object passed as the first argument.
172551172683
*/
172552
-SQLITE_API int SQLITE_STDCALL sqlite3session_indirect(sqlite3_session *pSession, int bIndirect){
172684
+SQLITE_API int SQLITE_APICALL sqlite3session_indirect(sqlite3_session *pSession, int bIndirect){
172553172685
int ret;
172554172686
sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172555172687
if( bIndirect>=0 ){
172556172688
pSession->bIndirect = bIndirect;
172557172689
}
@@ -172562,11 +172694,11 @@
172562172694
172563172695
/*
172564172696
** Return true if there have been no changes to monitored tables recorded
172565172697
** by the session object passed as the only argument.
172566172698
*/
172567
-SQLITE_API int SQLITE_STDCALL sqlite3session_isempty(sqlite3_session *pSession){
172699
+SQLITE_API int SQLITE_APICALL sqlite3session_isempty(sqlite3_session *pSession){
172568172700
int ret = 0;
172569172701
SessionTable *pTab;
172570172702
172571172703
sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172572172704
for(pTab=pSession->pTable; pTab && ret==0; pTab=pTab->pNext){
@@ -172612,11 +172744,11 @@
172612172744
}
172613172745
172614172746
/*
172615172747
** Create an iterator used to iterate through the contents of a changeset.
172616172748
*/
172617
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_start(
172749
+SQLITE_API int SQLITE_APICALL sqlite3changeset_start(
172618172750
sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
172619172751
int nChangeset, /* Size of buffer pChangeset in bytes */
172620172752
void *pChangeset /* Pointer to buffer containing changeset */
172621172753
){
172622172754
return sessionChangesetStart(pp, 0, 0, nChangeset, pChangeset);
@@ -172623,11 +172755,11 @@
172623172755
}
172624172756
172625172757
/*
172626172758
** Streaming version of sqlite3changeset_start().
172627172759
*/
172628
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_start_strm(
172760
+SQLITE_API int SQLITE_APICALL sqlite3changeset_start_strm(
172629172761
sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
172630172762
int (*xInput)(void *pIn, void *pData, int *pnData),
172631172763
void *pIn
172632172764
){
172633172765
return sessionChangesetStart(pp, xInput, pIn, 0, 0);
@@ -173044,20 +173176,20 @@
173044173176
** or SQLITE_CORRUPT.
173045173177
**
173046173178
** This function may not be called on iterators passed to a conflict handler
173047173179
** callback by changeset_apply().
173048173180
*/
173049
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_next(sqlite3_changeset_iter *p){
173181
+SQLITE_API int SQLITE_APICALL sqlite3changeset_next(sqlite3_changeset_iter *p){
173050173182
return sessionChangesetNext(p, 0, 0);
173051173183
}
173052173184
173053173185
/*
173054173186
** The following function extracts information on the current change
173055173187
** from a changeset iterator. It may only be called after changeset_next()
173056173188
** has returned SQLITE_ROW.
173057173189
*/
173058
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_op(
173190
+SQLITE_API int SQLITE_APICALL sqlite3changeset_op(
173059173191
sqlite3_changeset_iter *pIter, /* Iterator handle */
173060173192
const char **pzTab, /* OUT: Pointer to table name */
173061173193
int *pnCol, /* OUT: Number of columns in table */
173062173194
int *pOp, /* OUT: SQLITE_INSERT, DELETE or UPDATE */
173063173195
int *pbIndirect /* OUT: True if change is indirect */
@@ -173073,11 +173205,11 @@
173073173205
** Return information regarding the PRIMARY KEY and number of columns in
173074173206
** the database table affected by the change that pIter currently points
173075173207
** to. This function may only be called after changeset_next() returns
173076173208
** SQLITE_ROW.
173077173209
*/
173078
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_pk(
173210
+SQLITE_API int SQLITE_APICALL sqlite3changeset_pk(
173079173211
sqlite3_changeset_iter *pIter, /* Iterator object */
173080173212
unsigned char **pabPK, /* OUT: Array of boolean - true for PK cols */
173081173213
int *pnCol /* OUT: Number of entries in output array */
173082173214
){
173083173215
*pabPK = pIter->abPK;
@@ -173096,11 +173228,11 @@
173096173228
** was not modified and is not a PK column), set *ppValue to NULL.
173097173229
**
173098173230
** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is
173099173231
** not modified. Otherwise, SQLITE_OK.
173100173232
*/
173101
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_old(
173233
+SQLITE_API int SQLITE_APICALL sqlite3changeset_old(
173102173234
sqlite3_changeset_iter *pIter, /* Changeset iterator */
173103173235
int iVal, /* Index of old.* value to retrieve */
173104173236
sqlite3_value **ppValue /* OUT: Old value (or NULL pointer) */
173105173237
){
173106173238
if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_DELETE ){
@@ -173124,11 +173256,11 @@
173124173256
** was not modified), set *ppValue to NULL.
173125173257
**
173126173258
** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is
173127173259
** not modified. Otherwise, SQLITE_OK.
173128173260
*/
173129
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_new(
173261
+SQLITE_API int SQLITE_APICALL sqlite3changeset_new(
173130173262
sqlite3_changeset_iter *pIter, /* Changeset iterator */
173131173263
int iVal, /* Index of new.* value to retrieve */
173132173264
sqlite3_value **ppValue /* OUT: New value (or NULL pointer) */
173133173265
){
173134173266
if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_INSERT ){
@@ -173158,11 +173290,11 @@
173158173290
** containing the iVal'th value of the conflicting record.
173159173291
**
173160173292
** If value iVal is out-of-range or some other error occurs, an SQLite error
173161173293
** code is returned. Otherwise, SQLITE_OK.
173162173294
*/
173163
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_conflict(
173295
+SQLITE_API int SQLITE_APICALL sqlite3changeset_conflict(
173164173296
sqlite3_changeset_iter *pIter, /* Changeset iterator */
173165173297
int iVal, /* Index of conflict record value to fetch */
173166173298
sqlite3_value **ppValue /* OUT: Value from conflicting row */
173167173299
){
173168173300
if( !pIter->pConflict ){
@@ -173181,11 +173313,11 @@
173181173313
** it sets the output variable to the total number of known foreign key
173182173314
** violations in the destination database and returns SQLITE_OK.
173183173315
**
173184173316
** In all other cases this function returns SQLITE_MISUSE.
173185173317
*/
173186
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_fk_conflicts(
173318
+SQLITE_API int SQLITE_APICALL sqlite3changeset_fk_conflicts(
173187173319
sqlite3_changeset_iter *pIter, /* Changeset iterator */
173188173320
int *pnOut /* OUT: Number of FK violations */
173189173321
){
173190173322
if( pIter->pConflict || pIter->apValue ){
173191173323
return SQLITE_MISUSE;
@@ -173199,11 +173331,11 @@
173199173331
** Finalize an iterator allocated with sqlite3changeset_start().
173200173332
**
173201173333
** This function may not be called on iterators passed to a conflict handler
173202173334
** callback by changeset_apply().
173203173335
*/
173204
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_finalize(sqlite3_changeset_iter *p){
173336
+SQLITE_API int SQLITE_APICALL sqlite3changeset_finalize(sqlite3_changeset_iter *p){
173205173337
int rc = SQLITE_OK;
173206173338
if( p ){
173207173339
int i; /* Used to iterate through p->apValue[] */
173208173340
rc = p->rc;
173209173341
if( p->apValue ){
@@ -173373,11 +173505,11 @@
173373173505
173374173506
173375173507
/*
173376173508
** Invert a changeset object.
173377173509
*/
173378
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_invert(
173510
+SQLITE_API int SQLITE_APICALL sqlite3changeset_invert(
173379173511
int nChangeset, /* Number of bytes in input */
173380173512
const void *pChangeset, /* Input changeset */
173381173513
int *pnInverted, /* OUT: Number of bytes in output changeset */
173382173514
void **ppInverted /* OUT: Inverse of pChangeset */
173383173515
){
@@ -173392,11 +173524,11 @@
173392173524
}
173393173525
173394173526
/*
173395173527
** Streaming version of sqlite3changeset_invert().
173396173528
*/
173397
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_invert_strm(
173529
+SQLITE_API int SQLITE_APICALL sqlite3changeset_invert_strm(
173398173530
int (*xInput)(void *pIn, void *pData, int *pnData),
173399173531
void *pIn,
173400173532
int (*xOutput)(void *pOut, const void *pData, int nData),
173401173533
void *pOut
173402173534
){
@@ -174272,11 +174404,11 @@
174272174404
/*
174273174405
** Apply the changeset passed via pChangeset/nChangeset to the main database
174274174406
** attached to handle "db". Invoke the supplied conflict handler callback
174275174407
** to resolve any conflicts encountered while applying the change.
174276174408
*/
174277
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_apply(
174409
+SQLITE_API int SQLITE_APICALL sqlite3changeset_apply(
174278174410
sqlite3 *db, /* Apply change to "main" db of this handle */
174279174411
int nChangeset, /* Size of changeset in bytes */
174280174412
void *pChangeset, /* Changeset blob */
174281174413
int(*xFilter)(
174282174414
void *pCtx, /* Copy of sixth arg to _apply() */
@@ -174300,11 +174432,11 @@
174300174432
/*
174301174433
** Apply the changeset passed via xInput/pIn to the main database
174302174434
** attached to handle "db". Invoke the supplied conflict handler callback
174303174435
** to resolve any conflicts encountered while applying the change.
174304174436
*/
174305
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_apply_strm(
174437
+SQLITE_API int SQLITE_APICALL sqlite3changeset_apply_strm(
174306174438
sqlite3 *db, /* Apply change to "main" db of this handle */
174307174439
int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
174308174440
void *pIn, /* First arg for xInput */
174309174441
int(*xFilter)(
174310174442
void *pCtx, /* Copy of sixth arg to _apply() */
@@ -174635,11 +174767,11 @@
174635174767
}
174636174768
174637174769
/*
174638174770
** Allocate a new, empty, sqlite3_changegroup.
174639174771
*/
174640
-SQLITE_API int SQLITE_STDCALL sqlite3changegroup_new(sqlite3_changegroup **pp){
174772
+SQLITE_API int SQLITE_APICALL sqlite3changegroup_new(sqlite3_changegroup **pp){
174641174773
int rc = SQLITE_OK; /* Return code */
174642174774
sqlite3_changegroup *p; /* New object */
174643174775
p = (sqlite3_changegroup*)sqlite3_malloc(sizeof(sqlite3_changegroup));
174644174776
if( p==0 ){
174645174777
rc = SQLITE_NOMEM;
@@ -174652,11 +174784,11 @@
174652174784
174653174785
/*
174654174786
** Add the changeset currently stored in buffer pData, size nData bytes,
174655174787
** to changeset-group p.
174656174788
*/
174657
-SQLITE_API int SQLITE_STDCALL sqlite3changegroup_add(sqlite3_changegroup *pGrp, int nData, void *pData){
174789
+SQLITE_API int SQLITE_APICALL sqlite3changegroup_add(sqlite3_changegroup *pGrp, int nData, void *pData){
174658174790
sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */
174659174791
int rc; /* Return code */
174660174792
174661174793
rc = sqlite3changeset_start(&pIter, nData, pData);
174662174794
if( rc==SQLITE_OK ){
@@ -174668,11 +174800,11 @@
174668174800
174669174801
/*
174670174802
** Obtain a buffer containing a changeset representing the concatenation
174671174803
** of all changesets added to the group so far.
174672174804
*/
174673
-SQLITE_API int SQLITE_STDCALL sqlite3changegroup_output(
174805
+SQLITE_API int SQLITE_APICALL sqlite3changegroup_output(
174674174806
sqlite3_changegroup *pGrp,
174675174807
int *pnData,
174676174808
void **ppData
174677174809
){
174678174810
return sessionChangegroupOutput(pGrp, 0, 0, pnData, ppData);
@@ -174679,11 +174811,11 @@
174679174811
}
174680174812
174681174813
/*
174682174814
** Streaming versions of changegroup_add().
174683174815
*/
174684
-SQLITE_API int SQLITE_STDCALL sqlite3changegroup_add_strm(
174816
+SQLITE_API int SQLITE_APICALL sqlite3changegroup_add_strm(
174685174817
sqlite3_changegroup *pGrp,
174686174818
int (*xInput)(void *pIn, void *pData, int *pnData),
174687174819
void *pIn
174688174820
){
174689174821
sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */
@@ -174698,11 +174830,11 @@
174698174830
}
174699174831
174700174832
/*
174701174833
** Streaming versions of changegroup_output().
174702174834
*/
174703
-SQLITE_API int SQLITE_STDCALL sqlite3changegroup_output_strm(
174835
+SQLITE_API int SQLITE_APICALL sqlite3changegroup_output_strm(
174704174836
sqlite3_changegroup *pGrp,
174705174837
int (*xOutput)(void *pOut, const void *pData, int nData),
174706174838
void *pOut
174707174839
){
174708174840
return sessionChangegroupOutput(pGrp, xOutput, pOut, 0, 0);
@@ -174709,21 +174841,21 @@
174709174841
}
174710174842
174711174843
/*
174712174844
** Delete a changegroup object.
174713174845
*/
174714
-SQLITE_API void SQLITE_STDCALL sqlite3changegroup_delete(sqlite3_changegroup *pGrp){
174846
+SQLITE_API void SQLITE_APICALL sqlite3changegroup_delete(sqlite3_changegroup *pGrp){
174715174847
if( pGrp ){
174716174848
sessionDeleteTable(pGrp->pList);
174717174849
sqlite3_free(pGrp);
174718174850
}
174719174851
}
174720174852
174721174853
/*
174722174854
** Combine two changesets together.
174723174855
*/
174724
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_concat(
174856
+SQLITE_API int SQLITE_APICALL sqlite3changeset_concat(
174725174857
int nLeft, /* Number of bytes in lhs input */
174726174858
void *pLeft, /* Lhs input changeset */
174727174859
int nRight /* Number of bytes in rhs input */,
174728174860
void *pRight, /* Rhs input changeset */
174729174861
int *pnOut, /* OUT: Number of bytes in output changeset */
@@ -174748,11 +174880,11 @@
174748174880
}
174749174881
174750174882
/*
174751174883
** Streaming version of sqlite3changeset_concat().
174752174884
*/
174753
-SQLITE_API int SQLITE_STDCALL sqlite3changeset_concat_strm(
174885
+SQLITE_API int SQLITE_APICALL sqlite3changeset_concat_strm(
174754174886
int (*xInputA)(void *pIn, void *pData, int *pnData),
174755174887
void *pInA,
174756174888
int (*xInputB)(void *pIn, void *pData, int *pnData),
174757174889
void *pInB,
174758174890
int (*xOutput)(void *pOut, const void *pData, int nData),
@@ -176003,10 +176135,11 @@
176003176135
sqlite3_context *ctx,
176004176136
int argc,
176005176137
sqlite3_value **argv
176006176138
){
176007176139
JsonString jx;
176140
+ UNUSED_PARAM(argc);
176008176141
176009176142
jsonInit(&jx, ctx);
176010176143
jsonAppendValue(&jx, argv[0]);
176011176144
jsonResult(&jx);
176012176145
sqlite3_result_subtype(ctx, JSON_SUBTYPE);
@@ -176979,11 +177112,11 @@
176979177112
176980177113
#ifndef SQLITE_CORE
176981177114
#ifdef _WIN32
176982177115
__declspec(dllexport)
176983177116
#endif
176984
-SQLITE_API int SQLITE_STDCALL sqlite3_json_init(
177117
+SQLITE_API int SQLITE_APICALL sqlite3_json_init(
176985177118
sqlite3 *db,
176986177119
char **pzErrMsg,
176987177120
const sqlite3_api_routines *pApi
176988177121
){
176989177122
SQLITE_EXTENSION_INIT2(pApi);
@@ -193812,11 +193945,11 @@
193812193945
int nArg, /* Number of args */
193813193946
sqlite3_value **apUnused /* Function arguments */
193814193947
){
193815193948
assert( nArg==0 );
193816193949
UNUSED_PARAM2(nArg, apUnused);
193817
- sqlite3_result_text(pCtx, "fts5: 2016-07-25 11:39:24 5f40e6ad599eea59a5adc3a11d6f7998872736b4", -1, SQLITE_TRANSIENT);
193950
+ sqlite3_result_text(pCtx, "fts5: 2016-08-01 21:17:53 d8ef9f58643f13dd3d16dcde0d829ae08324f04b", -1, SQLITE_TRANSIENT);
193818193951
}
193819193952
193820193953
static int fts5Init(sqlite3 *db){
193821193954
static const sqlite3_module fts5Mod = {
193822193955
/* iVersion */ 2,
@@ -193900,11 +194033,11 @@
193900194033
*/
193901194034
#ifndef SQLITE_CORE
193902194035
#ifdef _WIN32
193903194036
__declspec(dllexport)
193904194037
#endif
193905
-SQLITE_API int SQLITE_STDCALL sqlite3_fts_init(
194038
+SQLITE_API int SQLITE_APICALL sqlite3_fts_init(
193906194039
sqlite3 *db,
193907194040
char **pzErrMsg,
193908194041
const sqlite3_api_routines *pApi
193909194042
){
193910194043
SQLITE_EXTENSION_INIT2(pApi);
@@ -193913,11 +194046,11 @@
193913194046
}
193914194047
193915194048
#ifdef _WIN32
193916194049
__declspec(dllexport)
193917194050
#endif
193918
-SQLITE_API int SQLITE_STDCALL sqlite3_fts5_init(
194051
+SQLITE_API int SQLITE_APICALL sqlite3_fts5_init(
193919194052
sqlite3 *db,
193920194053
char **pzErrMsg,
193921194054
const sqlite3_api_routines *pApi
193922194055
){
193923194056
SQLITE_EXTENSION_INIT2(pApi);
193924194057
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -65,10 +65,18 @@
65 ** In all cases, the special comment must be enclosed in the usual
66 ** slash-asterisk...asterisk-slash comment marks, with no spaces between the
67 ** asterisks and the comment text.
68 */
69
 
 
 
 
 
 
 
 
70 /*
71 ** Make sure that rand_s() is available on Windows systems with MSVC 2005
72 ** or higher.
73 */
74 #if defined(_MSC_VER) && _MSC_VER>=1400
@@ -304,12 +312,21 @@
304 # define SQLITE_API
305 #endif
306 #ifndef SQLITE_CDECL
307 # define SQLITE_CDECL
308 #endif
 
 
 
309 #ifndef SQLITE_STDCALL
310 # define SQLITE_STDCALL
 
 
 
 
 
 
311 #endif
312
313 /*
314 ** These no-op macros are used in front of interfaces to mark those
315 ** interfaces as either deprecated or experimental. New applications
@@ -363,11 +380,11 @@
363 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
364 ** [sqlite_version()] and [sqlite_source_id()].
365 */
366 #define SQLITE_VERSION "3.14.0"
367 #define SQLITE_VERSION_NUMBER 3014000
368 #define SQLITE_SOURCE_ID "2016-07-25 12:10:25 d6f6c87c9c0acf609a9d5bea818bb7a5437109a1"
369
370 /*
371 ** CAPI3REF: Run-Time Library Version Numbers
372 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
373 **
@@ -396,13 +413,13 @@
396 ** [SQLITE_SOURCE_ID] C preprocessor macro.
397 **
398 ** See also: [sqlite_version()] and [sqlite_source_id()].
399 */
400 SQLITE_API const char sqlite3_version[] = SQLITE_VERSION;
401 SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void);
402 SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void);
403 SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void);
404
405 /*
406 ** CAPI3REF: Run-Time Library Compilation Options Diagnostics
407 **
408 ** ^The sqlite3_compileoption_used() function returns 0 or 1
@@ -423,12 +440,12 @@
423 **
424 ** See also: SQL functions [sqlite_compileoption_used()] and
425 ** [sqlite_compileoption_get()] and the [compile_options pragma].
426 */
427 #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
428 SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName);
429 SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N);
430 #endif
431
432 /*
433 ** CAPI3REF: Test To See If The Library Is Threadsafe
434 **
@@ -463,11 +480,11 @@
463 ** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
464 ** is unchanged by calls to sqlite3_config().)^
465 **
466 ** See the [threading mode] documentation for additional information.
467 */
468 SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void);
469
470 /*
471 ** CAPI3REF: Database Connection Handle
472 ** KEYWORDS: {database connection} {database connections}
473 **
@@ -560,19 +577,19 @@
560 ** from [sqlite3_open()], [sqlite3_open16()], or
561 ** [sqlite3_open_v2()], and not previously closed.
562 ** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
563 ** argument is a harmless no-op.
564 */
565 SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3*);
566 SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3*);
567
568 /*
569 ** The type for a callback function.
570 ** This is legacy and deprecated. It is included for historical
571 ** compatibility and is not documented.
572 */
573 typedef int (*sqlite3_callback)(void*,int,char**, char**);
574
575 /*
576 ** CAPI3REF: One-Step Query Execution Interface
577 ** METHOD: sqlite3
578 **
@@ -632,14 +649,14 @@
632 ** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
633 ** <li> The application must not modify the SQL statement text passed into
634 ** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
635 ** </ul>
636 */
637 SQLITE_API int SQLITE_STDCALL sqlite3_exec(
638 sqlite3*, /* An open database */
639 const char *sql, /* SQL to be evaluated */
640 int (*callback)(void*,int,char**,char**), /* Callback function */
641 void *, /* 1st argument to callback */
642 char **errmsg /* Error msg written here */
643 );
644
645 /*
@@ -983,30 +1000,30 @@
983 ** database corruption.
984 */
985 typedef struct sqlite3_io_methods sqlite3_io_methods;
986 struct sqlite3_io_methods {
987 int iVersion;
988 int (*xClose)(sqlite3_file*);
989 int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
990 int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
991 int (*xTruncate)(sqlite3_file*, sqlite3_int64 size);
992 int (*xSync)(sqlite3_file*, int flags);
993 int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
994 int (*xLock)(sqlite3_file*, int);
995 int (*xUnlock)(sqlite3_file*, int);
996 int (*xCheckReservedLock)(sqlite3_file*, int *pResOut);
997 int (*xFileControl)(sqlite3_file*, int op, void *pArg);
998 int (*xSectorSize)(sqlite3_file*);
999 int (*xDeviceCharacteristics)(sqlite3_file*);
1000 /* Methods above are valid for version 1 */
1001 int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
1002 int (*xShmLock)(sqlite3_file*, int offset, int n, int flags);
1003 void (*xShmBarrier)(sqlite3_file*);
1004 int (*xShmUnmap)(sqlite3_file*, int deleteFlag);
1005 /* Methods above are valid for version 2 */
1006 int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
1007 int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p);
1008 /* Methods above are valid for version 3 */
1009 /* Additional methods may be added in future releases */
1010 };
1011
1012 /*
@@ -1178,11 +1195,11 @@
1178 ** ^The [SQLITE_FCNTL_BUSYHANDLER]
1179 ** file-control may be invoked by SQLite on the database file handle
1180 ** shortly after it is opened in order to provide a custom VFS with access
1181 ** to the connections busy-handler callback. The argument is of type (void **)
1182 ** - an array of two (void *) values. The first (void *) actually points
1183 ** to a function of type (int (*)(void *)). In order to invoke the connections
1184 ** busy-handler, this function should be invoked with the second (void *) in
1185 ** the array as the only argument. If it returns non-zero, then the operation
1186 ** should be retried. If it returns zero, the custom VFS should abandon the
1187 ** current operation.
1188 **
@@ -1286,10 +1303,20 @@
1286 **
1287 ** Mutexes are created using [sqlite3_mutex_alloc()].
1288 */
1289 typedef struct sqlite3_mutex sqlite3_mutex;
1290
 
 
 
 
 
 
 
 
 
 
1291 /*
1292 ** CAPI3REF: OS Interface Object
1293 **
1294 ** An instance of the sqlite3_vfs object defines the interface between
1295 ** the SQLite core and the underlying operating system. The "vfs"
@@ -1444,43 +1471,43 @@
1444 ** or all of these interfaces to be NULL or for their behavior to change
1445 ** from one release to the next. Applications must not attempt to access
1446 ** any of these methods if the iVersion of the VFS is less than 3.
1447 */
1448 typedef struct sqlite3_vfs sqlite3_vfs;
1449 typedef void (*sqlite3_syscall_ptr)(void);
1450 struct sqlite3_vfs {
1451 int iVersion; /* Structure version number (currently 3) */
1452 int szOsFile; /* Size of subclassed sqlite3_file */
1453 int mxPathname; /* Maximum file pathname length */
1454 sqlite3_vfs *pNext; /* Next registered VFS */
1455 const char *zName; /* Name of this virtual file system */
1456 void *pAppData; /* Pointer to application-specific data */
1457 int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
1458 int flags, int *pOutFlags);
1459 int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
1460 int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
1461 int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
1462 void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename);
1463 void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
1464 void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
1465 void (*xDlClose)(sqlite3_vfs*, void*);
1466 int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
1467 int (*xSleep)(sqlite3_vfs*, int microseconds);
1468 int (*xCurrentTime)(sqlite3_vfs*, double*);
1469 int (*xGetLastError)(sqlite3_vfs*, int, char *);
1470 /*
1471 ** The methods above are in version 1 of the sqlite_vfs object
1472 ** definition. Those that follow are added in version 2 or later
1473 */
1474 int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
1475 /*
1476 ** The methods above are in versions 1 and 2 of the sqlite_vfs object.
1477 ** Those below are for version 3 and greater.
1478 */
1479 int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
1480 sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName);
1481 const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName);
1482 /*
1483 ** The methods above are in versions 1 through 3 of the sqlite_vfs object.
1484 ** New fields may be appended in future versions. The iVersion
1485 ** value will increment whenever this happens.
1486 */
@@ -1621,14 +1648,14 @@
1621 ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied
1622 ** implementation of sqlite3_os_init() or sqlite3_os_end()
1623 ** must return [SQLITE_OK] on success and some other [error code] upon
1624 ** failure.
1625 */
1626 SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void);
1627 SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void);
1628 SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void);
1629 SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void);
1630
1631 /*
1632 ** CAPI3REF: Configuring The SQLite Library
1633 **
1634 ** The sqlite3_config() interface is used to make global configuration
@@ -1743,17 +1770,17 @@
1743 ** SQLite will never invoke xInit() more than once without an intervening
1744 ** call to xShutdown().
1745 */
1746 typedef struct sqlite3_mem_methods sqlite3_mem_methods;
1747 struct sqlite3_mem_methods {
1748 void *(*xMalloc)(int); /* Memory allocation function */
1749 void (*xFree)(void*); /* Free a prior allocation */
1750 void *(*xRealloc)(void*,int); /* Resize an allocation */
1751 int (*xSize)(void*); /* Return the size of an allocation */
1752 int (*xRoundup)(int); /* Round up request size to allocation size */
1753 int (*xInit)(void*); /* Initialize the memory allocator */
1754 void (*xShutdown)(void*); /* Deinitialize the memory allocator */
1755 void *pAppData; /* Argument to xInit() and xShutdown() */
1756 };
1757
1758 /*
1759 ** CAPI3REF: Configuration Options
@@ -1966,11 +1993,11 @@
1966 **
1967 ** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
1968 ** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
1969 ** global [error log].
1970 ** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a
1971 ** function with a call signature of void(*)(void*,int,const char*),
1972 ** and a pointer to void. ^If the function pointer is not NULL, it is
1973 ** invoked by [sqlite3_log()] to process each logging event. ^If the
1974 ** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op.
1975 ** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is
1976 ** passed through as the first parameter to the application-defined logger
@@ -2019,11 +2046,11 @@
2019 **
2020 ** [[SQLITE_CONFIG_SQLLOG]]
2021 ** <dt>SQLITE_CONFIG_SQLLOG
2022 ** <dd>This option is only available if sqlite is compiled with the
2023 ** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should
2024 ** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int).
2025 ** The second should be of type (void*). The callback is invoked by the library
2026 ** in three separate circumstances, identified by the value passed as the
2027 ** fourth parameter. If the fourth parameter is 0, then the database connection
2028 ** passed as the second argument has just been opened. The third argument
2029 ** points to a buffer containing the name of the main database file. If the
@@ -2217,11 +2244,11 @@
2217 **
2218 ** ^The sqlite3_extended_result_codes() routine enables or disables the
2219 ** [extended result codes] feature of SQLite. ^The extended result
2220 ** codes are disabled by default for historical compatibility.
2221 */
2222 SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3*, int onoff);
2223
2224 /*
2225 ** CAPI3REF: Last Insert Rowid
2226 ** METHOD: sqlite3
2227 **
@@ -2269,11 +2296,11 @@
2269 ** function is running and thus changes the last insert [rowid],
2270 ** then the value returned by [sqlite3_last_insert_rowid()] is
2271 ** unpredictable and might not equal either the old or the new
2272 ** last insert [rowid].
2273 */
2274 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3*);
2275
2276 /*
2277 ** CAPI3REF: Count The Number Of Rows Modified
2278 ** METHOD: sqlite3
2279 **
@@ -2322,11 +2349,11 @@
2322 **
2323 ** If a separate thread makes changes on the same database connection
2324 ** while [sqlite3_changes()] is running then the value returned
2325 ** is unpredictable and not meaningful.
2326 */
2327 SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3*);
2328
2329 /*
2330 ** CAPI3REF: Total Number Of Rows Modified
2331 ** METHOD: sqlite3
2332 **
@@ -2346,11 +2373,11 @@
2346 **
2347 ** If a separate thread makes changes on the same database connection
2348 ** while [sqlite3_total_changes()] is running then the value
2349 ** returned is unpredictable and not meaningful.
2350 */
2351 SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3*);
2352
2353 /*
2354 ** CAPI3REF: Interrupt A Long-Running Query
2355 ** METHOD: sqlite3
2356 **
@@ -2386,11 +2413,11 @@
2386 ** that are started after the sqlite3_interrupt() call returns.
2387 **
2388 ** If the database connection closes while [sqlite3_interrupt()]
2389 ** is running then bad things will likely happen.
2390 */
2391 SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3*);
2392
2393 /*
2394 ** CAPI3REF: Determine If An SQL Statement Is Complete
2395 **
2396 ** These routines are useful during command-line input to determine if the
@@ -2421,12 +2448,12 @@
2421 ** UTF-8 string.
2422 **
2423 ** The input to [sqlite3_complete16()] must be a zero-terminated
2424 ** UTF-16 string in native byte order.
2425 */
2426 SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *sql);
2427 SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *sql);
2428
2429 /*
2430 ** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
2431 ** KEYWORDS: {busy-handler callback} {busy handler}
2432 ** METHOD: sqlite3
@@ -2483,11 +2510,11 @@
2483 ** result in undefined behavior.
2484 **
2485 ** A busy handler must not close the database connection
2486 ** or [prepared statement] that invoked the busy handler.
2487 */
2488 SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*);
2489
2490 /*
2491 ** CAPI3REF: Set A Busy Timeout
2492 ** METHOD: sqlite3
2493 **
@@ -2506,11 +2533,11 @@
2506 ** was defined (using [sqlite3_busy_handler()]) prior to calling
2507 ** this routine, that other busy handler is cleared.)^
2508 **
2509 ** See also: [PRAGMA busy_timeout]
2510 */
2511 SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3*, int ms);
2512
2513 /*
2514 ** CAPI3REF: Convenience Routines For Running Queries
2515 ** METHOD: sqlite3
2516 **
@@ -2581,19 +2608,19 @@
2581 ** interface defined here. As a consequence, errors that occur in the
2582 ** wrapper layer outside of the internal [sqlite3_exec()] call are not
2583 ** reflected in subsequent calls to [sqlite3_errcode()] or
2584 ** [sqlite3_errmsg()].
2585 */
2586 SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
2587 sqlite3 *db, /* An open database */
2588 const char *zSql, /* SQL to be evaluated */
2589 char ***pazResult, /* Results of the query */
2590 int *pnRow, /* Number of result rows written here */
2591 int *pnColumn, /* Number of result columns written here */
2592 char **pzErrmsg /* Error msg written here */
2593 );
2594 SQLITE_API void SQLITE_STDCALL sqlite3_free_table(char **result);
2595
2596 /*
2597 ** CAPI3REF: Formatted String Printing Functions
2598 **
2599 ** These routines are work-alikes of the "printf()" family of functions
@@ -2696,13 +2723,13 @@
2696 ** ^(The "%z" formatting option works like "%s" but with the
2697 ** addition that after the string has been read and copied into
2698 ** the result, [sqlite3_free()] is called on the input string.)^
2699 */
2700 SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...);
2701 SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list);
2702 SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...);
2703 SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list);
2704
2705 /*
2706 ** CAPI3REF: Memory Allocation Subsystem
2707 **
2708 ** The SQLite core uses these three routines for all of its own
@@ -2788,16 +2815,16 @@
2788 **
2789 ** The application must not read or write any part of
2790 ** a block of memory after it has been released using
2791 ** [sqlite3_free()] or [sqlite3_realloc()].
2792 */
2793 SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int);
2794 SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64);
2795 SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void*, int);
2796 SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void*, sqlite3_uint64);
2797 SQLITE_API void SQLITE_STDCALL sqlite3_free(void*);
2798 SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void*);
2799
2800 /*
2801 ** CAPI3REF: Memory Allocator Statistics
2802 **
2803 ** SQLite provides these two interfaces for reporting on the status
@@ -2818,12 +2845,12 @@
2818 ** [sqlite3_memory_used()] if and only if the parameter to
2819 ** [sqlite3_memory_highwater()] is true. ^The value returned
2820 ** by [sqlite3_memory_highwater(1)] is the high-water mark
2821 ** prior to the reset.
2822 */
2823 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void);
2824 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag);
2825
2826 /*
2827 ** CAPI3REF: Pseudo-Random Number Generator
2828 **
2829 ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
@@ -2842,11 +2869,11 @@
2842 ** ^If the previous call to this routine had an N of 1 or more and a
2843 ** non-NULL P then the pseudo-randomness is generated
2844 ** internally and without recourse to the [sqlite3_vfs] xRandomness
2845 ** method.
2846 */
2847 SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *P);
2848
2849 /*
2850 ** CAPI3REF: Compile-Time Authorization Callbacks
2851 ** METHOD: sqlite3
2852 **
@@ -2925,13 +2952,13 @@
2925 ** [sqlite3_prepare()] or its variants. Authorization is not
2926 ** performed during statement evaluation in [sqlite3_step()], unless
2927 ** as stated in the previous paragraph, sqlite3_step() invokes
2928 ** sqlite3_prepare_v2() to reprepare a statement after a schema change.
2929 */
2930 SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
2931 sqlite3*,
2932 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
2933 void *pUserData
2934 );
2935
2936 /*
2937 ** CAPI3REF: Authorizer Return Codes
@@ -3033,14 +3060,14 @@
3033 ** digits in the time are meaningless. Future versions of SQLite
3034 ** might provide greater resolution on the profiler callback. The
3035 ** sqlite3_profile() function is considered experimental and is
3036 ** subject to change in future versions of SQLite.
3037 */
3038 SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_trace(sqlite3*,
3039 void(*xTrace)(void*,const char*), void*);
3040 SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_profile(sqlite3*,
3041 void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
3042
3043 /*
3044 ** CAPI3REF: SQL Trace Event Codes
3045 ** KEYWORDS: SQLITE_TRACE
3046 **
@@ -3124,14 +3151,14 @@
3124 **
3125 ** The sqlite3_trace_v2() interface is intended to replace the legacy
3126 ** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which
3127 ** are deprecated.
3128 */
3129 SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2(
3130 sqlite3*,
3131 unsigned uMask,
3132 int(*xCallback)(unsigned,void*,void*,void*),
3133 void *pCtx
3134 );
3135
3136 /*
3137 ** CAPI3REF: Query Progress Callbacks
@@ -3163,11 +3190,11 @@
3163 ** the database connection that invoked the progress handler.
3164 ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
3165 ** database connections for the meaning of "modify" in this paragraph.
3166 **
3167 */
3168 SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
3169
3170 /*
3171 ** CAPI3REF: Opening A New Database Connection
3172 ** CONSTRUCTOR: sqlite3
3173 **
@@ -3392,19 +3419,19 @@
3392 ** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various
3393 ** features that require the use of temporary files may fail.
3394 **
3395 ** See also: [sqlite3_temp_directory]
3396 */
3397 SQLITE_API int SQLITE_STDCALL sqlite3_open(
3398 const char *filename, /* Database filename (UTF-8) */
3399 sqlite3 **ppDb /* OUT: SQLite db handle */
3400 );
3401 SQLITE_API int SQLITE_STDCALL sqlite3_open16(
3402 const void *filename, /* Database filename (UTF-16) */
3403 sqlite3 **ppDb /* OUT: SQLite db handle */
3404 );
3405 SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
3406 const char *filename, /* Database filename (UTF-8) */
3407 sqlite3 **ppDb, /* OUT: SQLite db handle */
3408 int flags, /* Flags */
3409 const char *zVfs /* Name of VFS module to use */
3410 );
@@ -3446,13 +3473,13 @@
3446 ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and
3447 ** is not a database file pathname pointer that SQLite passed into the xOpen
3448 ** VFS method, then the behavior of this routine is undefined and probably
3449 ** undesirable.
3450 */
3451 SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3452 SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3453 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
3454
3455
3456 /*
3457 ** CAPI3REF: Error Codes And Messages
3458 ** METHOD: sqlite3
@@ -3492,15 +3519,15 @@
3492 **
3493 ** If an interface fails with SQLITE_MISUSE, that means the interface
3494 ** was invoked incorrectly by the application. In that case, the
3495 ** error code and message may or may not be set.
3496 */
3497 SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db);
3498 SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db);
3499 SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*);
3500 SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*);
3501 SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int);
3502
3503 /*
3504 ** CAPI3REF: Prepared Statement Object
3505 ** KEYWORDS: {prepared statement} {prepared statements}
3506 **
@@ -3564,11 +3591,11 @@
3564 ** created by an untrusted script can be contained using the
3565 ** [max_page_count] [PRAGMA].
3566 **
3567 ** New run-time limit categories may be added in future releases.
3568 */
3569 SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3*, int id, int newVal);
3570
3571 /*
3572 ** CAPI3REF: Run-Time Limit Categories
3573 ** KEYWORDS: {limit category} {*limit categories}
3574 **
@@ -3716,32 +3743,32 @@
3716 ** or [GLOB] operator or if the parameter is compared to an indexed column
3717 ** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
3718 ** </li>
3719 ** </ol>
3720 */
3721 SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
3722 sqlite3 *db, /* Database handle */
3723 const char *zSql, /* SQL statement, UTF-8 encoded */
3724 int nByte, /* Maximum length of zSql in bytes. */
3725 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3726 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3727 );
3728 SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
3729 sqlite3 *db, /* Database handle */
3730 const char *zSql, /* SQL statement, UTF-8 encoded */
3731 int nByte, /* Maximum length of zSql in bytes. */
3732 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3733 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3734 );
3735 SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
3736 sqlite3 *db, /* Database handle */
3737 const void *zSql, /* SQL statement, UTF-16 encoded */
3738 int nByte, /* Maximum length of zSql in bytes. */
3739 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3740 const void **pzTail /* OUT: Pointer to unused portion of zSql */
3741 );
3742 SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
3743 sqlite3 *db, /* Database handle */
3744 const void *zSql, /* SQL statement, UTF-16 encoded */
3745 int nByte, /* Maximum length of zSql in bytes. */
3746 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3747 const void **pzTail /* OUT: Pointer to unused portion of zSql */
@@ -3776,12 +3803,12 @@
3776 ** automatically freed when the prepared statement is finalized.
3777 ** ^The string returned by sqlite3_expanded_sql(P), on the other hand,
3778 ** is obtained from [sqlite3_malloc()] and must be free by the application
3779 ** by passing it to [sqlite3_free()].
3780 */
3781 SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt);
3782 SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt);
3783
3784 /*
3785 ** CAPI3REF: Determine If An SQL Statement Writes The Database
3786 ** METHOD: sqlite3_stmt
3787 **
@@ -3809,11 +3836,11 @@
3809 ** database. ^The [ATTACH] and [DETACH] statements also cause
3810 ** sqlite3_stmt_readonly() to return true since, while those statements
3811 ** change the configuration of a database connection, they do not make
3812 ** changes to the content of the database files on disk.
3813 */
3814 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
3815
3816 /*
3817 ** CAPI3REF: Determine If A Prepared Statement Has Been Reset
3818 ** METHOD: sqlite3_stmt
3819 **
@@ -3830,11 +3857,11 @@
3830 ** to locate all prepared statements associated with a database
3831 ** connection that are in need of being reset. This can be used,
3832 ** for example, in diagnostic routines to search for prepared
3833 ** statements that are holding a transaction open.
3834 */
3835 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt*);
3836
3837 /*
3838 ** CAPI3REF: Dynamically Typed Value Object
3839 ** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
3840 **
@@ -3994,24 +4021,24 @@
3994 ** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails.
3995 **
3996 ** See also: [sqlite3_bind_parameter_count()],
3997 ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].
3998 */
3999 SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
4000 SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
4001 void(*)(void*));
4002 SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt*, int, double);
4003 SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt*, int, int);
4004 SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
4005 SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt*, int);
4006 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
4007 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
4008 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
4009 void(*)(void*), unsigned char encoding);
4010 SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
4011 SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
4012 SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
4013
4014 /*
4015 ** CAPI3REF: Number Of SQL Parameters
4016 ** METHOD: sqlite3_stmt
4017 **
@@ -4028,11 +4055,11 @@
4028 **
4029 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
4030 ** [sqlite3_bind_parameter_name()], and
4031 ** [sqlite3_bind_parameter_index()].
4032 */
4033 SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt*);
4034
4035 /*
4036 ** CAPI3REF: Name Of A Host Parameter
4037 ** METHOD: sqlite3_stmt
4038 **
@@ -4056,11 +4083,11 @@
4056 **
4057 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
4058 ** [sqlite3_bind_parameter_count()], and
4059 ** [sqlite3_bind_parameter_index()].
4060 */
4061 SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
4062
4063 /*
4064 ** CAPI3REF: Index Of A Parameter With A Given Name
4065 ** METHOD: sqlite3_stmt
4066 **
@@ -4073,21 +4100,21 @@
4073 **
4074 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
4075 ** [sqlite3_bind_parameter_count()], and
4076 ** [sqlite3_bind_parameter_name()].
4077 */
4078 SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
4079
4080 /*
4081 ** CAPI3REF: Reset All Bindings On A Prepared Statement
4082 ** METHOD: sqlite3_stmt
4083 **
4084 ** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset
4085 ** the [sqlite3_bind_blob | bindings] on a [prepared statement].
4086 ** ^Use this routine to reset all host parameters to NULL.
4087 */
4088 SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt*);
4089
4090 /*
4091 ** CAPI3REF: Number Of Columns In A Result Set
4092 ** METHOD: sqlite3_stmt
4093 **
@@ -4095,11 +4122,11 @@
4095 ** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
4096 ** statement that does not return data (for example an [UPDATE]).
4097 **
4098 ** See also: [sqlite3_data_count()]
4099 */
4100 SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt);
4101
4102 /*
4103 ** CAPI3REF: Column Names In A Result Set
4104 ** METHOD: sqlite3_stmt
4105 **
@@ -4124,12 +4151,12 @@
4124 ** ^The name of a result column is the value of the "AS" clause for
4125 ** that column, if there is an AS clause. If there is no AS clause
4126 ** then the name of the column is unspecified and may change from
4127 ** one release of SQLite to the next.
4128 */
4129 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt*, int N);
4130 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt*, int N);
4131
4132 /*
4133 ** CAPI3REF: Source Of Data In A Query Result
4134 ** METHOD: sqlite3_stmt
4135 **
@@ -4173,16 +4200,16 @@
4173 ** If two or more threads call one or more
4174 ** [sqlite3_column_database_name | column metadata interfaces]
4175 ** for the same [prepared statement] and result column
4176 ** at the same time then the results are undefined.
4177 */
4178 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int);
4179 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int);
4180 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int);
4181 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int);
4182 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int);
4183 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
4184
4185 /*
4186 ** CAPI3REF: Declared Datatype Of A Query Result
4187 ** METHOD: sqlite3_stmt
4188 **
@@ -4210,12 +4237,12 @@
4210 ** data stored in that column is of the declared type. SQLite is
4211 ** strongly typed, but the typing is dynamic not static. ^Type
4212 ** is associated with individual values, not with the containers
4213 ** used to hold those values.
4214 */
4215 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt*,int);
4216 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt*,int);
4217
4218 /*
4219 ** CAPI3REF: Evaluate An SQL Statement
4220 ** METHOD: sqlite3_stmt
4221 **
@@ -4291,11 +4318,11 @@
4291 ** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
4292 ** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,
4293 ** then the more specific [error codes] are returned directly
4294 ** by sqlite3_step(). The use of the "v2" interface is recommended.
4295 */
4296 SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt*);
4297
4298 /*
4299 ** CAPI3REF: Number of columns in a result set
4300 ** METHOD: sqlite3_stmt
4301 **
@@ -4312,11 +4339,11 @@
4312 ** where it always returns zero since each step of that multi-step
4313 ** pragma returns 0 columns of data.
4314 **
4315 ** See also: [sqlite3_column_count()]
4316 */
4317 SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt);
4318
4319 /*
4320 ** CAPI3REF: Fundamental Datatypes
4321 ** KEYWORDS: SQLITE_TEXT
4322 **
@@ -4502,20 +4529,20 @@
4502 ** of these routines, a default value is returned. The default value
4503 ** is either the integer 0, the floating point number 0.0, or a NULL
4504 ** pointer. Subsequent calls to [sqlite3_errcode()] will return
4505 ** [SQLITE_NOMEM].)^
4506 */
4507 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt*, int iCol);
4508 SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4509 SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4510 SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt*, int iCol);
4511 SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt*, int iCol);
4512 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt*, int iCol);
4513 SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt*, int iCol);
4514 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt*, int iCol);
4515 SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt*, int iCol);
4516 SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt*, int iCol);
4517
4518 /*
4519 ** CAPI3REF: Destroy A Prepared Statement Object
4520 ** DESTRUCTOR: sqlite3_stmt
4521 **
@@ -4539,11 +4566,11 @@
4539 ** resource leaks. It is a grievous error for the application to try to use
4540 ** a prepared statement after it has been finalized. Any use of a prepared
4541 ** statement after it has been finalized can result in undefined and
4542 ** undesirable behavior such as segfaults and heap corruption.
4543 */
4544 SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt);
4545
4546 /*
4547 ** CAPI3REF: Reset A Prepared Statement Object
4548 ** METHOD: sqlite3_stmt
4549 **
@@ -4566,11 +4593,11 @@
4566 ** [sqlite3_reset(S)] returns an appropriate [error code].
4567 **
4568 ** ^The [sqlite3_reset(S)] interface does not change the values
4569 ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
4570 */
4571 SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt);
4572
4573 /*
4574 ** CAPI3REF: Create Or Redefine SQL Functions
4575 ** KEYWORDS: {function creation routines}
4576 ** KEYWORDS: {application-defined SQL function}
@@ -4666,40 +4693,40 @@
4666 ** ^An application-defined function is permitted to call other
4667 ** SQLite interfaces. However, such calls must not
4668 ** close the database connection nor finalize or reset the prepared
4669 ** statement in which the function is running.
4670 */
4671 SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
4672 sqlite3 *db,
4673 const char *zFunctionName,
4674 int nArg,
4675 int eTextRep,
4676 void *pApp,
4677 void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4678 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4679 void (*xFinal)(sqlite3_context*)
4680 );
4681 SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
4682 sqlite3 *db,
4683 const void *zFunctionName,
4684 int nArg,
4685 int eTextRep,
4686 void *pApp,
4687 void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4688 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4689 void (*xFinal)(sqlite3_context*)
4690 );
4691 SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
4692 sqlite3 *db,
4693 const char *zFunctionName,
4694 int nArg,
4695 int eTextRep,
4696 void *pApp,
4697 void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4698 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4699 void (*xFinal)(sqlite3_context*),
4700 void(*xDestroy)(void*)
4701 );
4702
4703 /*
4704 ** CAPI3REF: Text Encodings
4705 **
@@ -4732,16 +4759,16 @@
4732 ** to be supported. However, new applications should avoid
4733 ** the use of these functions. To encourage programmers to avoid
4734 ** these functions, we will not explain what they do.
4735 */
4736 #ifndef SQLITE_OMIT_DEPRECATED
4737 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context*);
4738 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt*);
4739 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4740 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_global_recover(void);
4741 SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_thread_cleanup(void);
4742 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
4743 void*,sqlite3_int64);
4744 #endif
4745
4746 /*
4747 ** CAPI3REF: Obtaining SQL Values
@@ -4787,22 +4814,22 @@
4787 ** or [sqlite3_value_text16()].
4788 **
4789 ** These routines must be called from the same thread as
4790 ** the SQL function that supplied the [sqlite3_value*] parameters.
4791 */
4792 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value*);
4793 SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value*);
4794 SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value*);
4795 SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value*);
4796 SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value*);
4797 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value*);
4798 SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value*);
4799 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value*);
4800 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value*);
4801 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*);
4802 SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*);
4803 SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*);
4804
4805 /*
4806 ** CAPI3REF: Finding The Subtype Of SQL Values
4807 ** METHOD: sqlite3_value
4808 **
@@ -4814,11 +4841,11 @@
4814 **
4815 ** SQLite makes no use of subtype itself. It merely passes the subtype
4816 ** from the result of one [application-defined SQL function] into the
4817 ** input of another.
4818 */
4819 SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value*);
4820
4821 /*
4822 ** CAPI3REF: Copy And Free SQL Values
4823 ** METHOD: sqlite3_value
4824 **
@@ -4830,12 +4857,12 @@
4830 **
4831 ** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object
4832 ** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer
4833 ** then sqlite3_value_free(V) is a harmless no-op.
4834 */
4835 SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value*);
4836 SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value*);
4837
4838 /*
4839 ** CAPI3REF: Obtain Aggregate Function Context
4840 ** METHOD: sqlite3_context
4841 **
@@ -4876,11 +4903,11 @@
4876 ** function.
4877 **
4878 ** This routine must be called from the same thread in which
4879 ** the aggregate SQL function is running.
4880 */
4881 SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
4882
4883 /*
4884 ** CAPI3REF: User Data For Functions
4885 ** METHOD: sqlite3_context
4886 **
@@ -4891,11 +4918,11 @@
4891 ** registered the application defined function.
4892 **
4893 ** This routine must be called from the same thread in which
4894 ** the application-defined function is running.
4895 */
4896 SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context*);
4897
4898 /*
4899 ** CAPI3REF: Database Connection For Functions
4900 ** METHOD: sqlite3_context
4901 **
@@ -4903,11 +4930,11 @@
4903 ** the pointer to the [database connection] (the 1st parameter)
4904 ** of the [sqlite3_create_function()]
4905 ** and [sqlite3_create_function16()] routines that originally
4906 ** registered the application defined function.
4907 */
4908 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context*);
4909
4910 /*
4911 ** CAPI3REF: Function Auxiliary Data
4912 ** METHOD: sqlite3_context
4913 **
@@ -4956,12 +4983,12 @@
4956 ** values and [parameters] and expressions composed from the same.)^
4957 **
4958 ** These routines must be called from the same thread in which
4959 ** the SQL function is running.
4960 */
4961 SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context*, int N);
4962 SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
4963
4964
4965 /*
4966 ** CAPI3REF: Constants Defining Special Destructor Behavior
4967 **
@@ -4974,11 +5001,11 @@
4974 ** the content before returning.
4975 **
4976 ** The typedef is necessary to work around problems in certain
4977 ** C++ compilers.
4978 */
4979 typedef void (*sqlite3_destructor_type)(void*);
4980 #define SQLITE_STATIC ((sqlite3_destructor_type)0)
4981 #define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1)
4982
4983 /*
4984 ** CAPI3REF: Setting The Result Of An SQL Function
@@ -5093,31 +5120,31 @@
5093 **
5094 ** If these routines are called from within the different thread
5095 ** than the one containing the application-defined function that received
5096 ** the [sqlite3_context] pointer, the results are undefined.
5097 */
5098 SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
5099 SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(sqlite3_context*,const void*,
5100 sqlite3_uint64,void(*)(void*));
5101 SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context*, double);
5102 SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context*, const char*, int);
5103 SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context*, const void*, int);
5104 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context*);
5105 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context*);
5106 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context*, int);
5107 SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context*, int);
5108 SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
5109 SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context*);
5110 SQLITE_API void SQLITE_STDCALL sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
5111 SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
5112 void(*)(void*), unsigned char encoding);
5113 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
5114 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
5115 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
5116 SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
5117 SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n);
5118 SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
5119
5120
5121 /*
5122 ** CAPI3REF: Setting The Subtype Of An SQL Function
5123 ** METHOD: sqlite3_context
@@ -5128,11 +5155,11 @@
5128 ** of the subtype T are preserved in current versions of SQLite;
5129 ** higher order bits are discarded.
5130 ** The number of subtype bytes preserved by SQLite might increase
5131 ** in future releases of SQLite.
5132 */
5133 SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context*,unsigned int);
5134
5135 /*
5136 ** CAPI3REF: Define New Collating Sequences
5137 ** METHOD: sqlite3
5138 **
@@ -5210,31 +5237,31 @@
5210 ** is unfortunate but cannot be changed without breaking backwards
5211 ** compatibility.
5212 **
5213 ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].
5214 */
5215 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
5216 sqlite3*,
5217 const char *zName,
5218 int eTextRep,
5219 void *pArg,
5220 int(*xCompare)(void*,int,const void*,int,const void*)
5221 );
5222 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
5223 sqlite3*,
5224 const char *zName,
5225 int eTextRep,
5226 void *pArg,
5227 int(*xCompare)(void*,int,const void*,int,const void*),
5228 void(*xDestroy)(void*)
5229 );
5230 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
5231 sqlite3*,
5232 const void *zName,
5233 int eTextRep,
5234 void *pArg,
5235 int(*xCompare)(void*,int,const void*,int,const void*)
5236 );
5237
5238 /*
5239 ** CAPI3REF: Collation Needed Callbacks
5240 ** METHOD: sqlite3
@@ -5260,19 +5287,19 @@
5260 **
5261 ** The callback function should register the desired collation using
5262 ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or
5263 ** [sqlite3_create_collation_v2()].
5264 */
5265 SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
5266 sqlite3*,
5267 void*,
5268 void(*)(void*,sqlite3*,int eTextRep,const char*)
5269 );
5270 SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
5271 sqlite3*,
5272 void*,
5273 void(*)(void*,sqlite3*,int eTextRep,const void*)
5274 );
5275
5276 #ifdef SQLITE_HAS_CODEC
5277 /*
5278 ** Specify the key for an encrypted database. This routine should be
@@ -5279,15 +5306,15 @@
5279 ** called right after sqlite3_open().
5280 **
5281 ** The code to implement this API is not available in the public release
5282 ** of SQLite.
5283 */
5284 SQLITE_API int SQLITE_STDCALL sqlite3_key(
5285 sqlite3 *db, /* Database to be rekeyed */
5286 const void *pKey, int nKey /* The key */
5287 );
5288 SQLITE_API int SQLITE_STDCALL sqlite3_key_v2(
5289 sqlite3 *db, /* Database to be rekeyed */
5290 const char *zDbName, /* Name of the database */
5291 const void *pKey, int nKey /* The key */
5292 );
5293
@@ -5297,35 +5324,35 @@
5297 ** database is decrypted.
5298 **
5299 ** The code to implement this API is not available in the public release
5300 ** of SQLite.
5301 */
5302 SQLITE_API int SQLITE_STDCALL sqlite3_rekey(
5303 sqlite3 *db, /* Database to be rekeyed */
5304 const void *pKey, int nKey /* The new key */
5305 );
5306 SQLITE_API int SQLITE_STDCALL sqlite3_rekey_v2(
5307 sqlite3 *db, /* Database to be rekeyed */
5308 const char *zDbName, /* Name of the database */
5309 const void *pKey, int nKey /* The new key */
5310 );
5311
5312 /*
5313 ** Specify the activation key for a SEE database. Unless
5314 ** activated, none of the SEE routines will work.
5315 */
5316 SQLITE_API void SQLITE_STDCALL sqlite3_activate_see(
5317 const char *zPassPhrase /* Activation phrase */
5318 );
5319 #endif
5320
5321 #ifdef SQLITE_ENABLE_CEROD
5322 /*
5323 ** Specify the activation key for a CEROD database. Unless
5324 ** activated, none of the CEROD routines will work.
5325 */
5326 SQLITE_API void SQLITE_STDCALL sqlite3_activate_cerod(
5327 const char *zPassPhrase /* Activation phrase */
5328 );
5329 #endif
5330
5331 /*
@@ -5343,11 +5370,11 @@
5343 ** method of the default [sqlite3_vfs] object. If the xSleep() method
5344 ** of the default VFS is not implemented correctly, or not implemented at
5345 ** all, then the behavior of sqlite3_sleep() may deviate from the description
5346 ** in the previous paragraphs.
5347 */
5348 SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int);
5349
5350 /*
5351 ** CAPI3REF: Name Of The Folder Holding Temporary Files
5352 **
5353 ** ^(If this global variable is made to point to a string which is
@@ -5462,11 +5489,11 @@
5462 **
5463 ** If another thread changes the autocommit status of the database
5464 ** connection while this routine is running, then the return value
5465 ** is undefined.
5466 */
5467 SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3*);
5468
5469 /*
5470 ** CAPI3REF: Find The Database Handle Of A Prepared Statement
5471 ** METHOD: sqlite3_stmt
5472 **
@@ -5475,11 +5502,11 @@
5475 ** returned by sqlite3_db_handle is the same [database connection]
5476 ** that was the first argument
5477 ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
5478 ** create the statement in the first place.
5479 */
5480 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt*);
5481
5482 /*
5483 ** CAPI3REF: Return The Filename For A Database Connection
5484 ** METHOD: sqlite3
5485 **
@@ -5492,21 +5519,21 @@
5492 ** ^The filename returned by this function is the output of the
5493 ** xFullPathname method of the [VFS]. ^In other words, the filename
5494 ** will be an absolute pathname, even if the filename used
5495 ** to open the database originally was a URI or relative pathname.
5496 */
5497 SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
5498
5499 /*
5500 ** CAPI3REF: Determine if a database is read-only
5501 ** METHOD: sqlite3
5502 **
5503 ** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N
5504 ** of connection D is read-only, 0 if it is read/write, or -1 if N is not
5505 ** the name of a database on connection D.
5506 */
5507 SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
5508
5509 /*
5510 ** CAPI3REF: Find the next prepared statement
5511 ** METHOD: sqlite3
5512 **
@@ -5518,11 +5545,11 @@
5518 **
5519 ** The [database connection] pointer D in a call to
5520 ** [sqlite3_next_stmt(D,S)] must refer to an open database
5521 ** connection and in particular must not be a NULL pointer.
5522 */
5523 SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
5524
5525 /*
5526 ** CAPI3REF: Commit And Rollback Notification Callbacks
5527 ** METHOD: sqlite3
5528 **
@@ -5567,12 +5594,12 @@
5567 ** ^The rollback callback is not invoked if a transaction is
5568 ** automatically rolled back because the database connection is closed.
5569 **
5570 ** See also the [sqlite3_update_hook()] interface.
5571 */
5572 SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
5573 SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
5574
5575 /*
5576 ** CAPI3REF: Data Change Notification Callbacks
5577 ** METHOD: sqlite3
5578 **
@@ -5619,13 +5646,13 @@
5619 ** the first call on D.
5620 **
5621 ** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()],
5622 ** and [sqlite3_preupdate_hook()] interfaces.
5623 */
5624 SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
5625 sqlite3*,
5626 void(*)(void *,int ,char const *,char const *,sqlite3_int64),
5627 void*
5628 );
5629
5630 /*
5631 ** CAPI3REF: Enable Or Disable Shared Pager Cache
@@ -5659,11 +5686,11 @@
5659 ** This interface is threadsafe on processors where writing a
5660 ** 32-bit integer is atomic.
5661 **
5662 ** See Also: [SQLite Shared-Cache Mode]
5663 */
5664 SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int);
5665
5666 /*
5667 ** CAPI3REF: Attempt To Free Heap Memory
5668 **
5669 ** ^The sqlite3_release_memory() interface attempts to free N bytes
@@ -5675,11 +5702,11 @@
5675 ** ^The sqlite3_release_memory() routine is a no-op returning zero
5676 ** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5677 **
5678 ** See also: [sqlite3_db_release_memory()]
5679 */
5680 SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int);
5681
5682 /*
5683 ** CAPI3REF: Free Memory Used By A Database Connection
5684 ** METHOD: sqlite3
5685 **
@@ -5689,11 +5716,11 @@
5689 ** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
5690 ** omitted.
5691 **
5692 ** See also: [sqlite3_release_memory()]
5693 */
5694 SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3*);
5695
5696 /*
5697 ** CAPI3REF: Impose A Limit On Heap Size
5698 **
5699 ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the
@@ -5741,11 +5768,11 @@
5741 ** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5742 **
5743 ** The circumstances under which SQLite will enforce the soft heap limit may
5744 ** changes in future releases of SQLite.
5745 */
5746 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
5747
5748 /*
5749 ** CAPI3REF: Deprecated Soft Heap Limit Interface
5750 ** DEPRECATED
5751 **
@@ -5752,11 +5779,11 @@
5752 ** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
5753 ** interface. This routine is provided for historical compatibility
5754 ** only. All new applications should use the
5755 ** [sqlite3_soft_heap_limit64()] interface rather than this one.
5756 */
5757 SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_soft_heap_limit(int N);
5758
5759
5760 /*
5761 ** CAPI3REF: Extract Metadata About A Column Of A Table
5762 ** METHOD: sqlite3
@@ -5822,11 +5849,11 @@
5822 **
5823 ** ^This function causes all database schemas to be read from disk and
5824 ** parsed, if that has not already been done, and returns an error if
5825 ** any errors are encountered while loading the schema.
5826 */
5827 SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
5828 sqlite3 *db, /* Connection handle */
5829 const char *zDbName, /* Database name or NULL */
5830 const char *zTableName, /* Table name */
5831 const char *zColumnName, /* Column name */
5832 char const **pzDataType, /* OUTPUT: Declared data type */
@@ -5878,11 +5905,11 @@
5878 ** disabled and prevent SQL injections from giving attackers
5879 ** access to extension loading capabilities.
5880 **
5881 ** See also the [load_extension() SQL function].
5882 */
5883 SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
5884 sqlite3 *db, /* Load the extension into this database connection */
5885 const char *zFile, /* Name of the shared library containing extension */
5886 const char *zProc, /* Entry point. Derived from zFile if 0 */
5887 char **pzErrMsg /* Put error message here if not 0 */
5888 );
@@ -5910,11 +5937,11 @@
5910 ** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method
5911 ** rather than this interface, so the [load_extension()] SQL function
5912 ** remains disabled. This will prevent SQL injections from giving attackers
5913 ** access to extension loading capabilities.
5914 */
5915 SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
5916
5917 /*
5918 ** CAPI3REF: Automatically Load Statically Linked Extensions
5919 **
5920 ** ^This interface causes the xEntryPoint() function to be invoked for
@@ -5922,11 +5949,11 @@
5922 ** xEntryPoint() is the entry point for a statically linked [SQLite extension]
5923 ** that is to be automatically loaded into all new database connections.
5924 **
5925 ** ^(Even though the function prototype shows that xEntryPoint() takes
5926 ** no arguments and returns void, SQLite invokes xEntryPoint() with three
5927 ** arguments and expects and integer result as if the signature of the
5928 ** entry point where as follows:
5929 **
5930 ** <blockquote><pre>
5931 ** &nbsp; int xEntryPoint(
5932 ** &nbsp; sqlite3 *db,
@@ -5948,11 +5975,11 @@
5948 ** will be called more than once for each database connection that is opened.
5949 **
5950 ** See also: [sqlite3_reset_auto_extension()]
5951 ** and [sqlite3_cancel_auto_extension()]
5952 */
5953 SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void (*xEntryPoint)(void));
5954
5955 /*
5956 ** CAPI3REF: Cancel Automatic Extension Loading
5957 **
5958 ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
@@ -5960,19 +5987,19 @@
5960 ** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)]
5961 ** routine returns 1 if initialization routine X was successfully
5962 ** unregistered and it returns 0 if X was not on the list of initialization
5963 ** routines.
5964 */
5965 SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void (*xEntryPoint)(void));
5966
5967 /*
5968 ** CAPI3REF: Reset Automatic Extension Loading
5969 **
5970 ** ^This interface disables all automatic extensions previously
5971 ** registered using [sqlite3_auto_extension()].
5972 */
5973 SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void);
5974
5975 /*
5976 ** The interface to the virtual-table mechanism is currently considered
5977 ** to be experimental. The interface might change in incompatible ways.
5978 ** If this is a problem for you, do not use the interface at this time.
@@ -6005,41 +6032,41 @@
6005 ** of this structure must not change while it is registered with
6006 ** any database connection.
6007 */
6008 struct sqlite3_module {
6009 int iVersion;
6010 int (*xCreate)(sqlite3*, void *pAux,
6011 int argc, const char *const*argv,
6012 sqlite3_vtab **ppVTab, char**);
6013 int (*xConnect)(sqlite3*, void *pAux,
6014 int argc, const char *const*argv,
6015 sqlite3_vtab **ppVTab, char**);
6016 int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
6017 int (*xDisconnect)(sqlite3_vtab *pVTab);
6018 int (*xDestroy)(sqlite3_vtab *pVTab);
6019 int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);
6020 int (*xClose)(sqlite3_vtab_cursor*);
6021 int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
6022 int argc, sqlite3_value **argv);
6023 int (*xNext)(sqlite3_vtab_cursor*);
6024 int (*xEof)(sqlite3_vtab_cursor*);
6025 int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int);
6026 int (*xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid);
6027 int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *);
6028 int (*xBegin)(sqlite3_vtab *pVTab);
6029 int (*xSync)(sqlite3_vtab *pVTab);
6030 int (*xCommit)(sqlite3_vtab *pVTab);
6031 int (*xRollback)(sqlite3_vtab *pVTab);
6032 int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,
6033 void (**pxFunc)(sqlite3_context*,int,sqlite3_value**),
6034 void **ppArg);
6035 int (*xRename)(sqlite3_vtab *pVtab, const char *zNew);
6036 /* The methods above are in version 1 of the sqlite_module object. Those
6037 ** below are for version 2 and greater. */
6038 int (*xSavepoint)(sqlite3_vtab *pVTab, int);
6039 int (*xRelease)(sqlite3_vtab *pVTab, int);
6040 int (*xRollbackTo)(sqlite3_vtab *pVTab, int);
6041 };
6042
6043 /*
6044 ** CAPI3REF: Virtual Table Indexing Information
6045 ** KEYWORDS: sqlite3_index_info
@@ -6213,22 +6240,22 @@
6213 ** be invoked if the call to sqlite3_create_module_v2() fails.
6214 ** ^The sqlite3_create_module()
6215 ** interface is equivalent to sqlite3_create_module_v2() with a NULL
6216 ** destructor.
6217 */
6218 SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
6219 sqlite3 *db, /* SQLite connection to register module with */
6220 const char *zName, /* Name of the module */
6221 const sqlite3_module *p, /* Methods for the module */
6222 void *pClientData /* Client data for xCreate/xConnect */
6223 );
6224 SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
6225 sqlite3 *db, /* SQLite connection to register module with */
6226 const char *zName, /* Name of the module */
6227 const sqlite3_module *p, /* Methods for the module */
6228 void *pClientData, /* Client data for xCreate/xConnect */
6229 void(*xDestroy)(void*) /* Module destructor function */
6230 );
6231
6232 /*
6233 ** CAPI3REF: Virtual Table Instance Object
6234 ** KEYWORDS: sqlite3_vtab
@@ -6282,11 +6309,11 @@
6282 ** ^The [xCreate] and [xConnect] methods of a
6283 ** [virtual table module] call this interface
6284 ** to declare the format (the names and datatypes of the columns) of
6285 ** the virtual tables they implement.
6286 */
6287 SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
6288
6289 /*
6290 ** CAPI3REF: Overload A Function For A Virtual Table
6291 ** METHOD: sqlite3
6292 **
@@ -6301,11 +6328,11 @@
6301 ** of the new function always causes an exception to be thrown. So
6302 ** the new function is not good for anything by itself. Its only
6303 ** purpose is to be a placeholder function that can be overloaded
6304 ** by a [virtual table].
6305 */
6306 SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
6307
6308 /*
6309 ** The interface to the virtual-table mechanism defined above (back up
6310 ** to a comment remarkably similar to this one) is currently considered
6311 ** to be experimental. The interface might change in incompatible ways.
@@ -6400,11 +6427,11 @@
6400 ** zero-filled blob to read or write using the incremental-blob interface.
6401 **
6402 ** To avoid a resource leak, every open [BLOB handle] should eventually
6403 ** be released by a call to [sqlite3_blob_close()].
6404 */
6405 SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
6406 sqlite3*,
6407 const char *zDb,
6408 const char *zTable,
6409 const char *zColumn,
6410 sqlite3_int64 iRow,
@@ -6433,11 +6460,11 @@
6433 ** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
6434 ** always returns zero.
6435 **
6436 ** ^This function sets the database handle error code and message.
6437 */
6438 SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
6439
6440 /*
6441 ** CAPI3REF: Close A BLOB Handle
6442 ** DESTRUCTOR: sqlite3_blob
6443 **
@@ -6456,11 +6483,11 @@
6456 ** with a null pointer (such as would be returned by a failed call to
6457 ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function
6458 ** is passed a valid open blob handle, the values returned by the
6459 ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning.
6460 */
6461 SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *);
6462
6463 /*
6464 ** CAPI3REF: Return The Size Of An Open BLOB
6465 ** METHOD: sqlite3_blob
6466 **
@@ -6472,11 +6499,11 @@
6472 ** This routine only works on a [BLOB handle] which has been created
6473 ** by a prior successful call to [sqlite3_blob_open()] and which has not
6474 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6475 ** to this routine results in undefined and probably undesirable behavior.
6476 */
6477 SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *);
6478
6479 /*
6480 ** CAPI3REF: Read Data From A BLOB Incrementally
6481 ** METHOD: sqlite3_blob
6482 **
@@ -6501,11 +6528,11 @@
6501 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6502 ** to this routine results in undefined and probably undesirable behavior.
6503 **
6504 ** See also: [sqlite3_blob_write()].
6505 */
6506 SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
6507
6508 /*
6509 ** CAPI3REF: Write Data Into A BLOB Incrementally
6510 ** METHOD: sqlite3_blob
6511 **
@@ -6543,11 +6570,11 @@
6543 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6544 ** to this routine results in undefined and probably undesirable behavior.
6545 **
6546 ** See also: [sqlite3_blob_read()].
6547 */
6548 SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
6549
6550 /*
6551 ** CAPI3REF: Virtual File System Objects
6552 **
6553 ** A virtual filesystem (VFS) is an [sqlite3_vfs] object
@@ -6574,13 +6601,13 @@
6574 **
6575 ** ^Unregister a VFS with the sqlite3_vfs_unregister() interface.
6576 ** ^(If the default VFS is unregistered, another VFS is chosen as
6577 ** the default. The choice for the new VFS is arbitrary.)^
6578 */
6579 SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfsName);
6580 SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
6581 SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs*);
6582
6583 /*
6584 ** CAPI3REF: Mutexes
6585 **
6586 ** The SQLite core uses these routines for thread
@@ -6692,15 +6719,15 @@
6692 ** sqlite3_mutex_leave() is a NULL pointer, then all three routines
6693 ** behave as no-ops.
6694 **
6695 ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
6696 */
6697 SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int);
6698 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*);
6699 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*);
6700 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*);
6701 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*);
6702
6703 /*
6704 ** CAPI3REF: Mutex Methods Object
6705 **
6706 ** An instance of this structure defines the low-level routines
@@ -6765,19 +6792,19 @@
6765 ** If xMutexInit fails in any way, it is expected to clean up after itself
6766 ** prior to returning.
6767 */
6768 typedef struct sqlite3_mutex_methods sqlite3_mutex_methods;
6769 struct sqlite3_mutex_methods {
6770 int (*xMutexInit)(void);
6771 int (*xMutexEnd)(void);
6772 sqlite3_mutex *(*xMutexAlloc)(int);
6773 void (*xMutexFree)(sqlite3_mutex *);
6774 void (*xMutexEnter)(sqlite3_mutex *);
6775 int (*xMutexTry)(sqlite3_mutex *);
6776 void (*xMutexLeave)(sqlite3_mutex *);
6777 int (*xMutexHeld)(sqlite3_mutex *);
6778 int (*xMutexNotheld)(sqlite3_mutex *);
6779 };
6780
6781 /*
6782 ** CAPI3REF: Mutex Verification Routines
6783 **
@@ -6806,12 +6833,12 @@
6806 ** call to sqlite3_mutex_held() to fail, so a non-zero return is
6807 ** the appropriate thing to do. The sqlite3_mutex_notheld()
6808 ** interface should also return 1 when given a NULL pointer.
6809 */
6810 #ifndef NDEBUG
6811 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex*);
6812 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex*);
6813 #endif
6814
6815 /*
6816 ** CAPI3REF: Mutex Types
6817 **
@@ -6847,11 +6874,11 @@
6847 ** serializes access to the [database connection] given in the argument
6848 ** when the [threading mode] is Serialized.
6849 ** ^If the [threading mode] is Single-thread or Multi-thread then this
6850 ** routine returns a NULL pointer.
6851 */
6852 SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3*);
6853
6854 /*
6855 ** CAPI3REF: Low-Level Control Of Database Files
6856 ** METHOD: sqlite3
6857 **
@@ -6882,11 +6909,11 @@
6882 ** an incorrect zDbName and an SQLITE_ERROR return from the underlying
6883 ** xFileControl method.
6884 **
6885 ** See also: [SQLITE_FCNTL_LOCKSTATE]
6886 */
6887 SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
6888
6889 /*
6890 ** CAPI3REF: Testing Interface
6891 **
6892 ** ^The sqlite3_test_control() interface is used to read out internal
@@ -6964,12 +6991,12 @@
6964 ** be represented by a 32-bit integer, then the values returned by
6965 ** sqlite3_status() are undefined.
6966 **
6967 ** See also: [sqlite3_db_status()]
6968 */
6969 SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6970 SQLITE_API int SQLITE_STDCALL sqlite3_status64(
6971 int op,
6972 sqlite3_int64 *pCurrent,
6973 sqlite3_int64 *pHighwater,
6974 int resetFlag
6975 );
@@ -7090,11 +7117,11 @@
7090 ** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a
7091 ** non-zero [error code] on failure.
7092 **
7093 ** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
7094 */
7095 SQLITE_API int SQLITE_STDCALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
7096
7097 /*
7098 ** CAPI3REF: Status Parameters for database connections
7099 ** KEYWORDS: {SQLITE_DBSTATUS options}
7100 **
@@ -7233,11 +7260,11 @@
7233 ** ^If the resetFlg is true, then the counter is reset to zero after this
7234 ** interface call returns.
7235 **
7236 ** See also: [sqlite3_status()] and [sqlite3_db_status()].
7237 */
7238 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
7239
7240 /*
7241 ** CAPI3REF: Status Parameters for prepared statements
7242 ** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters}
7243 **
@@ -7469,22 +7496,22 @@
7469 */
7470 typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2;
7471 struct sqlite3_pcache_methods2 {
7472 int iVersion;
7473 void *pArg;
7474 int (*xInit)(void*);
7475 void (*xShutdown)(void*);
7476 sqlite3_pcache *(*xCreate)(int szPage, int szExtra, int bPurgeable);
7477 void (*xCachesize)(sqlite3_pcache*, int nCachesize);
7478 int (*xPagecount)(sqlite3_pcache*);
7479 sqlite3_pcache_page *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7480 void (*xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard);
7481 void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*,
7482 unsigned oldKey, unsigned newKey);
7483 void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
7484 void (*xDestroy)(sqlite3_pcache*);
7485 void (*xShrink)(sqlite3_pcache*);
7486 };
7487
7488 /*
7489 ** This is the obsolete pcache_methods object that has now been replaced
7490 ** by sqlite3_pcache_methods2. This object is not used by SQLite. It is
@@ -7491,20 +7518,20 @@
7491 ** retained in the header file for backwards compatibility only.
7492 */
7493 typedef struct sqlite3_pcache_methods sqlite3_pcache_methods;
7494 struct sqlite3_pcache_methods {
7495 void *pArg;
7496 int (*xInit)(void*);
7497 void (*xShutdown)(void*);
7498 sqlite3_pcache *(*xCreate)(int szPage, int bPurgeable);
7499 void (*xCachesize)(sqlite3_pcache*, int nCachesize);
7500 int (*xPagecount)(sqlite3_pcache*);
7501 void *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7502 void (*xUnpin)(sqlite3_pcache*, void*, int discard);
7503 void (*xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey);
7504 void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
7505 void (*xDestroy)(sqlite3_pcache*);
7506 };
7507
7508
7509 /*
7510 ** CAPI3REF: Online Backup Object
@@ -7702,20 +7729,20 @@
7702 ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()
7703 ** APIs are not strictly speaking threadsafe. If they are invoked at the
7704 ** same time as another thread is invoking sqlite3_backup_step() it is
7705 ** possible that they return invalid values.
7706 */
7707 SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
7708 sqlite3 *pDest, /* Destination database handle */
7709 const char *zDestName, /* Destination database name */
7710 sqlite3 *pSource, /* Source database handle */
7711 const char *zSourceName /* Source database name */
7712 );
7713 SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage);
7714 SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p);
7715 SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p);
7716 SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p);
7717
7718 /*
7719 ** CAPI3REF: Unlock Notification
7720 ** METHOD: sqlite3
7721 **
@@ -7828,13 +7855,13 @@
7828 ** by an sqlite3_step() call. ^(If there is a blocking connection, then the
7829 ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in
7830 ** the special "DROP TABLE/INDEX" case, the extended error code is just
7831 ** SQLITE_LOCKED.)^
7832 */
7833 SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
7834 sqlite3 *pBlocked, /* Waiting connection */
7835 void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */
7836 void *pNotifyArg /* Argument to pass to xNotify */
7837 );
7838
7839
7840 /*
@@ -7843,12 +7870,12 @@
7843 ** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications
7844 ** and extensions to compare the contents of two buffers containing UTF-8
7845 ** strings in a case-independent fashion, using the same definition of "case
7846 ** independence" that SQLite uses internally when comparing identifiers.
7847 */
7848 SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *, const char *);
7849 SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *, const char *, int);
7850
7851 /*
7852 ** CAPI3REF: String Globbing
7853 *
7854 ** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if
@@ -7861,11 +7888,11 @@
7861 ** Note that this routine returns zero on a match and non-zero if the strings
7862 ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
7863 **
7864 ** See also: [sqlite3_strlike()].
7865 */
7866 SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlob, const char *zStr);
7867
7868 /*
7869 ** CAPI3REF: String LIKE Matching
7870 *
7871 ** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if
@@ -7884,11 +7911,11 @@
7884 ** Note that this routine returns zero on a match and non-zero if the strings
7885 ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
7886 **
7887 ** See also: [sqlite3_strglob()].
7888 */
7889 SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
7890
7891 /*
7892 ** CAPI3REF: Error Logging Interface
7893 **
7894 ** ^The [sqlite3_log()] interface writes a message into the [error log]
@@ -7943,13 +7970,13 @@
7943 ** previously registered write-ahead log callback. ^Note that the
7944 ** [sqlite3_wal_autocheckpoint()] interface and the
7945 ** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will
7946 ** overwrite any prior [sqlite3_wal_hook()] settings.
7947 */
7948 SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
7949 sqlite3*,
7950 int(*)(void *,sqlite3*,const char*,int),
7951 void*
7952 );
7953
7954 /*
7955 ** CAPI3REF: Configure an auto-checkpoint
@@ -7978,11 +8005,11 @@
7978 ** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]
7979 ** pages. The use of this interface
7980 ** is only necessary if the default setting is found to be suboptimal
7981 ** for a particular application.
7982 */
7983 SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
7984
7985 /*
7986 ** CAPI3REF: Checkpoint a database
7987 ** METHOD: sqlite3
7988 **
@@ -8000,11 +8027,11 @@
8000 ** interface was added. This interface is retained for backwards
8001 ** compatibility and as a convenience for applications that need to manually
8002 ** start a callback but which do not need the full power (and corresponding
8003 ** complication) of [sqlite3_wal_checkpoint_v2()].
8004 */
8005 SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
8006
8007 /*
8008 ** CAPI3REF: Checkpoint a database
8009 ** METHOD: sqlite3
8010 **
@@ -8094,11 +8121,11 @@
8094 ** [sqlite3_errcode()] and [sqlite3_errmsg()].
8095 **
8096 ** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface
8097 ** from SQL.
8098 */
8099 SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
8100 sqlite3 *db, /* Database handle */
8101 const char *zDb, /* Name of attached database (or NULL) */
8102 int eMode, /* SQLITE_CHECKPOINT_* value */
8103 int *pnLog, /* OUT: Size of WAL log in frames */
8104 int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -8183,11 +8210,11 @@
8183 ** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL],
8184 ** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode
8185 ** of the SQL statement that triggered the call to the [xUpdate] method of the
8186 ** [virtual table].
8187 */
8188 SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *);
8189
8190 /*
8191 ** CAPI3REF: Conflict resolution modes
8192 ** KEYWORDS: {conflict resolution mode}
8193 **
@@ -8288,11 +8315,11 @@
8288 ** as if the loop did not exist - it returns non-zero and leave the variable
8289 ** that pOut points to unchanged.
8290 **
8291 ** See also: [sqlite3_stmt_scanstatus_reset()]
8292 */
8293 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus(
8294 sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
8295 int idx, /* Index of loop to report on */
8296 int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
8297 void *pOut /* Result written here */
8298 );
@@ -8304,11 +8331,11 @@
8304 ** ^Zero all [sqlite3_stmt_scanstatus()] related event counters.
8305 **
8306 ** This API is only available if the library is built with pre-processor
8307 ** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined.
8308 */
8309 SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
8310
8311 /*
8312 ** CAPI3REF: Flush caches to disk mid-transaction
8313 **
8314 ** ^If a write-transaction is open on [database connection] D when the
@@ -8336,11 +8363,11 @@
8336 ** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK.
8337 **
8338 ** ^This function does not set the database handle error code or message
8339 ** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions.
8340 */
8341 SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3*);
8342
8343 /*
8344 ** CAPI3REF: The pre-update hook.
8345 **
8346 ** ^These interfaces are only available if SQLite is compiled using the
@@ -8416,13 +8443,13 @@
8416 ** triggers; or 2 for changes resulting from triggers called by top-level
8417 ** triggers; and so forth.
8418 **
8419 ** See also: [sqlite3_update_hook()]
8420 */
8421 SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_STDCALL sqlite3_preupdate_hook(
8422 sqlite3 *db,
8423 void(*xPreUpdate)(
8424 void *pCtx, /* Copy of third arg to preupdate_hook() */
8425 sqlite3 *db, /* Database handle */
8426 int op, /* SQLITE_UPDATE, DELETE or INSERT */
8427 char const *zDb, /* Database name */
8428 char const *zName, /* Table name */
@@ -8429,14 +8456,14 @@
8429 sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */
8430 sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */
8431 ),
8432 void*
8433 );
8434 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **);
8435 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *);
8436 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *);
8437 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **);
8438
8439 /*
8440 ** CAPI3REF: Low-level system error code
8441 **
8442 ** ^Attempt to return the underlying operating system error code or error
@@ -8444,11 +8471,11 @@
8444 ** The return value is OS-dependent. For example, on unix systems, after
8445 ** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be
8446 ** called to get back the underlying "errno" that caused the problem, such
8447 ** as ENOSPC, EAUTH, EISDIR, and so forth.
8448 */
8449 SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3*);
8450
8451 /*
8452 ** CAPI3REF: Database Snapshot
8453 ** KEYWORDS: {snapshot}
8454 ** EXPERIMENTAL
@@ -8494,11 +8521,11 @@
8494 ** to avoid a memory leak.
8495 **
8496 ** The [sqlite3_snapshot_get()] interface is only available when the
8497 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8498 */
8499 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_get(
8500 sqlite3 *db,
8501 const char *zSchema,
8502 sqlite3_snapshot **ppSnapshot
8503 );
8504
@@ -8532,11 +8559,11 @@
8532 ** database connection in order to make it ready to use snapshots.)
8533 **
8534 ** The [sqlite3_snapshot_open()] interface is only available when the
8535 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8536 */
8537 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_open(
8538 sqlite3 *db,
8539 const char *zSchema,
8540 sqlite3_snapshot *pSnapshot
8541 );
8542
@@ -8549,11 +8576,11 @@
8549 ** using this routine to avoid a memory leak.
8550 **
8551 ** The [sqlite3_snapshot_free()] interface is only available when the
8552 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8553 */
8554 SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot*);
8555
8556 /*
8557 ** CAPI3REF: Compare the ages of two snapshot handles.
8558 ** EXPERIMENTAL
8559 **
@@ -8573,11 +8600,11 @@
8573 **
8574 ** Otherwise, this API returns a negative value if P1 refers to an older
8575 ** snapshot than P2, zero if the two handles refer to the same database
8576 ** snapshot, and a positive value if P1 is a newer snapshot than P2.
8577 */
8578 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_cmp(
8579 sqlite3_snapshot *p1,
8580 sqlite3_snapshot *p2
8581 );
8582
8583 /*
@@ -8631,14 +8658,14 @@
8631 ** Register a geometry callback named zGeom that can be used as part of an
8632 ** R-Tree geometry query as follows:
8633 **
8634 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
8635 */
8636 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
8637 sqlite3 *db,
8638 const char *zGeom,
8639 int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
8640 void *pContext
8641 );
8642
8643
8644 /*
@@ -8648,25 +8675,25 @@
8648 struct sqlite3_rtree_geometry {
8649 void *pContext; /* Copy of pContext passed to s_r_g_c() */
8650 int nParam; /* Size of array aParam[] */
8651 sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */
8652 void *pUser; /* Callback implementation user data */
8653 void (*xDelUser)(void *); /* Called by SQLite to clean up pUser */
8654 };
8655
8656 /*
8657 ** Register a 2nd-generation geometry callback named zScore that can be
8658 ** used as part of an R-Tree geometry query as follows:
8659 **
8660 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...)
8661 */
8662 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
8663 sqlite3 *db,
8664 const char *zQueryFunc,
8665 int (*xQueryFunc)(sqlite3_rtree_query_info*),
8666 void *pContext,
8667 void (*xDestructor)(void*)
8668 );
8669
8670
8671 /*
8672 ** A pointer to a structure of the following type is passed as the
@@ -8680,11 +8707,11 @@
8680 struct sqlite3_rtree_query_info {
8681 void *pContext; /* pContext from when function registered */
8682 int nParam; /* Number of function parameters */
8683 sqlite3_rtree_dbl *aParam; /* value of function parameters */
8684 void *pUser; /* callback can use this, if desired */
8685 void (*xDelUser)(void*); /* function to free pUser */
8686 sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */
8687 unsigned int *anQueue; /* Number of pending entries in the queue */
8688 int nCoord; /* Number of coordinates */
8689 int iLevel; /* Level of current node or entry */
8690 int mxLevel; /* The largest iLevel value in the tree */
@@ -8876,11 +8903,11 @@
8876 ** If xFilter returns 0, changes is not tracked. Note that once a table is
8877 ** attached, xFilter will not be called again.
8878 */
8879 void sqlite3session_table_filter(
8880 sqlite3_session *pSession, /* Session object */
8881 int(*xFilter)(
8882 void *pCtx, /* Copy of third arg to _filter_table() */
8883 const char *zTab /* Table name */
8884 ),
8885 void *pCtx /* First argument passed to xFilter */
8886 );
@@ -9451,11 +9478,11 @@
9451 ** An sqlite3_changegroup object is used to combine two or more changesets
9452 ** (or patchsets) into a single changeset (or patchset). A single changegroup
9453 ** object may combine changesets or patchsets, but not both. The output is
9454 ** always in the same format as the input.
9455 **
9456 ** If successful, this function returns SQLITE_OK and populates (*pp) with
9457 ** a pointer to a new sqlite3_changegroup object before returning. The caller
9458 ** should eventually free the returned object using a call to
9459 ** sqlite3changegroup_delete(). If an error occurs, an SQLite error code
9460 ** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL.
9461 **
@@ -9571,11 +9598,11 @@
9571 ** changes for tables that do not appear in the first changeset, they are
9572 ** appended onto the end of the output changeset, again in the order in
9573 ** which they are first encountered.
9574 **
9575 ** If an error occurs, an SQLite error code is returned and the output
9576 ** variables (*pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK
9577 ** is returned and the output variables are set to the size of and a
9578 ** pointer to the output buffer, respectively. In this case it is the
9579 ** responsibility of the caller to eventually free the buffer using a
9580 ** call to sqlite3_free().
9581 */
@@ -9728,15 +9755,15 @@
9728 */
9729 int sqlite3changeset_apply(
9730 sqlite3 *db, /* Apply change to "main" db of this handle */
9731 int nChangeset, /* Size of changeset in bytes */
9732 void *pChangeset, /* Changeset blob */
9733 int(*xFilter)(
9734 void *pCtx, /* Copy of sixth arg to _apply() */
9735 const char *zTab /* Table name */
9736 ),
9737 int(*xConflict)(
9738 void *pCtx, /* Copy of sixth arg to _apply() */
9739 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
9740 sqlite3_changeset_iter *p /* Handle describing change and conflict */
9741 ),
9742 void *pCtx /* First argument passed to xConflict */
@@ -9873,20 +9900,20 @@
9873 ** </pre>
9874 **
9875 ** Is replaced by:
9876 **
9877 ** <pre>
9878 ** &nbsp; int (*xInput)(void *pIn, void *pData, int *pnData),
9879 ** &nbsp; void *pIn,
9880 ** </pre>
9881 **
9882 ** Each time the xInput callback is invoked by the sessions module, the first
9883 ** argument passed is a copy of the supplied pIn context pointer. The second
9884 ** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no
9885 ** error occurs the xInput method should copy up to (*pnData) bytes of data
9886 ** into the buffer and set (*pnData) to the actual number of bytes copied
9887 ** before returning SQLITE_OK. If the input is completely exhausted, (*pnData)
9888 ** should be set to zero to indicate this. Or, if an error occurs, an SQLite
9889 ** error code should be returned. In all cases, if an xInput callback returns
9890 ** an error, all processing is abandoned and the streaming API function
9891 ** returns a copy of the error code to the caller.
9892 **
@@ -9907,11 +9934,11 @@
9907 ** </pre>
9908 **
9909 ** Is replaced by:
9910 **
9911 ** <pre>
9912 ** &nbsp; int (*xOutput)(void *pOut, const void *pData, int nData),
9913 ** &nbsp; void *pOut
9914 ** </pre>
9915 **
9916 ** The xOutput callback is invoked zero or more times to return data to
9917 ** the application. The first parameter passed to each call is a copy of the
@@ -9927,58 +9954,58 @@
9927 ** parameter set to a value less than or equal to zero. Other than this,
9928 ** no guarantees are made as to the size of the chunks of data returned.
9929 */
9930 int sqlite3changeset_apply_strm(
9931 sqlite3 *db, /* Apply change to "main" db of this handle */
9932 int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
9933 void *pIn, /* First arg for xInput */
9934 int(*xFilter)(
9935 void *pCtx, /* Copy of sixth arg to _apply() */
9936 const char *zTab /* Table name */
9937 ),
9938 int(*xConflict)(
9939 void *pCtx, /* Copy of sixth arg to _apply() */
9940 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
9941 sqlite3_changeset_iter *p /* Handle describing change and conflict */
9942 ),
9943 void *pCtx /* First argument passed to xConflict */
9944 );
9945 int sqlite3changeset_concat_strm(
9946 int (*xInputA)(void *pIn, void *pData, int *pnData),
9947 void *pInA,
9948 int (*xInputB)(void *pIn, void *pData, int *pnData),
9949 void *pInB,
9950 int (*xOutput)(void *pOut, const void *pData, int nData),
9951 void *pOut
9952 );
9953 int sqlite3changeset_invert_strm(
9954 int (*xInput)(void *pIn, void *pData, int *pnData),
9955 void *pIn,
9956 int (*xOutput)(void *pOut, const void *pData, int nData),
9957 void *pOut
9958 );
9959 int sqlite3changeset_start_strm(
9960 sqlite3_changeset_iter **pp,
9961 int (*xInput)(void *pIn, void *pData, int *pnData),
9962 void *pIn
9963 );
9964 int sqlite3session_changeset_strm(
9965 sqlite3_session *pSession,
9966 int (*xOutput)(void *pOut, const void *pData, int nData),
9967 void *pOut
9968 );
9969 int sqlite3session_patchset_strm(
9970 sqlite3_session *pSession,
9971 int (*xOutput)(void *pOut, const void *pData, int nData),
9972 void *pOut
9973 );
9974 int sqlite3changegroup_add_strm(sqlite3_changegroup*,
9975 int (*xInput)(void *pIn, void *pData, int *pnData),
9976 void *pIn
9977 );
9978 int sqlite3changegroup_output_strm(sqlite3_changegroup*,
9979 int (*xOutput)(void *pOut, const void *pData, int nData),
9980 void *pOut
9981 );
9982
9983
9984 /*
@@ -10029,11 +10056,11 @@
10029
10030 typedef struct Fts5ExtensionApi Fts5ExtensionApi;
10031 typedef struct Fts5Context Fts5Context;
10032 typedef struct Fts5PhraseIter Fts5PhraseIter;
10033
10034 typedef void (*fts5_extension_function)(
10035 const Fts5ExtensionApi *pApi, /* API offered by current FTS version */
10036 Fts5Context *pFts, /* First arg to pass to pApi functions */
10037 sqlite3_context *pCtx, /* Context for returning result/error */
10038 int nVal, /* Number of values in apVal[] array */
10039 sqlite3_value **apVal /* Array of trailing arguments */
@@ -10080,15 +10107,15 @@
10080 ** This function may be quite inefficient if used with an FTS5 table
10081 ** created with the "columnsize=0" option.
10082 **
10083 ** xColumnText:
10084 ** This function attempts to retrieve the text of column iCol of the
10085 ** current document. If successful, (*pz) is set to point to a buffer
10086 ** containing the text in utf-8 encoding, (*pn) is set to the size in bytes
10087 ** (not characters) of the buffer and SQLITE_OK is returned. Otherwise,
10088 ** if an error occurs, an SQLite error code is returned and the final values
10089 ** of (*pz) and (*pn) are undefined.
10090 **
10091 ** xPhraseCount:
10092 ** Returns the number of phrases in the current query expression.
10093 **
10094 ** xPhraseSize:
@@ -10193,11 +10220,11 @@
10193 ** xRowCount(pFts5, pnRow)
10194 **
10195 ** This function is used to retrieve the total number of rows in the table.
10196 ** In other words, the same value that would be returned by:
10197 **
10198 ** SELECT count(*) FROM ftstable;
10199 **
10200 ** xPhraseFirst()
10201 ** This function is used, along with type Fts5PhraseIter and the xPhraseNext
10202 ** method, to iterate through all instances of a single query phrase within
10203 ** the current row. This is the same information as is accessible via the
@@ -10260,43 +10287,43 @@
10260 ** See xPhraseFirstColumn above.
10261 */
10262 struct Fts5ExtensionApi {
10263 int iVersion; /* Currently always set to 3 */
10264
10265 void *(*xUserData)(Fts5Context*);
10266
10267 int (*xColumnCount)(Fts5Context*);
10268 int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow);
10269 int (*xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken);
10270
10271 int (*xTokenize)(Fts5Context*,
10272 const char *pText, int nText, /* Text to tokenize */
10273 void *pCtx, /* Context passed to xToken() */
10274 int (*xToken)(void*, int, const char*, int, int, int) /* Callback */
10275 );
10276
10277 int (*xPhraseCount)(Fts5Context*);
10278 int (*xPhraseSize)(Fts5Context*, int iPhrase);
10279
10280 int (*xInstCount)(Fts5Context*, int *pnInst);
10281 int (*xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff);
10282
10283 sqlite3_int64 (*xRowid)(Fts5Context*);
10284 int (*xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn);
10285 int (*xColumnSize)(Fts5Context*, int iCol, int *pnToken);
10286
10287 int (*xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData,
10288 int(*)(const Fts5ExtensionApi*,Fts5Context*,void*)
10289 );
10290 int (*xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*));
10291 void *(*xGetAuxdata)(Fts5Context*, int bClear);
10292
10293 int (*xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*);
10294 void (*xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff);
10295
10296 int (*xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*);
10297 void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol);
10298 };
10299
10300 /*
10301 ** CUSTOM AUXILIARY FUNCTIONS
10302 *************************************************************************/
@@ -10320,11 +10347,11 @@
10320 ** The second and third arguments are an array of nul-terminated strings
10321 ** containing the tokenizer arguments, if any, specified following the
10322 ** tokenizer name as part of the CREATE VIRTUAL TABLE statement used
10323 ** to create the FTS5 table.
10324 **
10325 ** The final argument is an output variable. If successful, (*ppOut)
10326 ** should be set to point to the new tokenizer handle and SQLITE_OK
10327 ** returned. If an error occurs, some value other than SQLITE_OK should
10328 ** be returned. In this case, fts5 assumes that the final value of *ppOut
10329 ** is undefined.
10330 **
@@ -10494,17 +10521,17 @@
10494 ** inefficient.
10495 */
10496 typedef struct Fts5Tokenizer Fts5Tokenizer;
10497 typedef struct fts5_tokenizer fts5_tokenizer;
10498 struct fts5_tokenizer {
10499 int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
10500 void (*xDelete)(Fts5Tokenizer*);
10501 int (*xTokenize)(Fts5Tokenizer*,
10502 void *pCtx,
10503 int flags, /* Mask of FTS5_TOKENIZE_* flags */
10504 const char *pText, int nText,
10505 int (*xToken)(
10506 void *pCtx, /* Copy of 2nd argument to xTokenize() */
10507 int tflags, /* Mask of FTS5_TOKEN_* flags */
10508 const char *pToken, /* Pointer to buffer containing token */
10509 int nToken, /* Size of token in bytes */
10510 int iStart, /* Byte offset of token within input text */
@@ -10533,33 +10560,33 @@
10533 typedef struct fts5_api fts5_api;
10534 struct fts5_api {
10535 int iVersion; /* Currently always set to 2 */
10536
10537 /* Create a new tokenizer */
10538 int (*xCreateTokenizer)(
10539 fts5_api *pApi,
10540 const char *zName,
10541 void *pContext,
10542 fts5_tokenizer *pTokenizer,
10543 void (*xDestroy)(void*)
10544 );
10545
10546 /* Find an existing tokenizer */
10547 int (*xFindTokenizer)(
10548 fts5_api *pApi,
10549 const char *zName,
10550 void **ppContext,
10551 fts5_tokenizer *pTokenizer
10552 );
10553
10554 /* Create a new auxiliary function */
10555 int (*xCreateFunction)(
10556 fts5_api *pApi,
10557 const char *zName,
10558 void *pContext,
10559 fts5_extension_function xFunction,
10560 void (*xDestroy)(void*)
10561 );
10562 };
10563
10564 /*
10565 ** END OF REGISTRATION API
@@ -10867,11 +10894,11 @@
10867 ** Make sure that the compiler intrinsics we desire are enabled when
10868 ** compiling with an appropriate version of MSVC unless prevented by
10869 ** the SQLITE_DISABLE_INTRINSIC define.
10870 */
10871 #if !defined(SQLITE_DISABLE_INTRINSIC)
10872 # if defined(_MSC_VER) && _MSC_VER>=1300
10873 # if !defined(_WIN32_WCE)
10874 # include <intrin.h>
10875 # pragma intrinsic(_byteswap_ushort)
10876 # pragma intrinsic(_byteswap_ulong)
10877 # pragma intrinsic(_ReadWriteBarrier)
@@ -11873,12 +11900,12 @@
11873 */
11874 #ifdef SQLITE_OMIT_WSD
11875 #define SQLITE_WSD const
11876 #define GLOBAL(t,v) (*(t*)sqlite3_wsd_find((void*)&(v), sizeof(v)))
11877 #define sqlite3GlobalConfig GLOBAL(struct Sqlite3Config, sqlite3Config)
11878 SQLITE_API int SQLITE_STDCALL sqlite3_wsd_init(int N, int J);
11879 SQLITE_API void *SQLITE_STDCALL sqlite3_wsd_find(void *K, int L);
11880 #else
11881 #define SQLITE_WSD
11882 #define GLOBAL(t,v) v
11883 #define sqlite3GlobalConfig sqlite3Config
11884 #endif
@@ -15834,10 +15861,11 @@
15834 int iCur; /* A cursor number */
15835 SrcList *pSrcList; /* FROM clause */
15836 struct SrcCount *pSrcCount; /* Counting column references */
15837 struct CCurHint *pCCurHint; /* Used by codeCursorHint() */
15838 int *aiCol; /* array of column indexes */
 
15839 } u;
15840 };
15841
15842 /* Forward declarations */
15843 SQLITE_PRIVATE int sqlite3WalkExpr(Walker*, Expr*);
@@ -16277,10 +16305,11 @@
16277 SQLITE_PRIVATE int sqlite3ExprCompare(Expr*, Expr*, int);
16278 SQLITE_PRIVATE int sqlite3ExprListCompare(ExprList*, ExprList*, int);
16279 SQLITE_PRIVATE int sqlite3ExprImpliesExpr(Expr*, Expr*, int);
16280 SQLITE_PRIVATE void sqlite3ExprAnalyzeAggregates(NameContext*, Expr*);
16281 SQLITE_PRIVATE void sqlite3ExprAnalyzeAggList(NameContext*,ExprList*);
 
16282 SQLITE_PRIVATE int sqlite3FunctionUsesThisSrc(Expr*, SrcList*);
16283 SQLITE_PRIVATE Vdbe *sqlite3GetVdbe(Parse*);
16284 #ifndef SQLITE_OMIT_BUILTIN_TEST
16285 SQLITE_PRIVATE void sqlite3PrngSaveState(void);
16286 SQLITE_PRIVATE void sqlite3PrngRestoreState(void);
@@ -17163,12 +17192,14 @@
17163 "CASE_SENSITIVE_LIKE",
17164 #endif
17165 #if SQLITE_CHECK_PAGES
17166 "CHECK_PAGES",
17167 #endif
17168 #if defined(__clang__) && defined(__clang_version__)
17169 "COMPILER=clang-" __clang_version__,
 
 
17170 #elif defined(_MSC_VER)
17171 "COMPILER=msvc-" CTIMEOPT_VAL(_MSC_VER),
17172 #elif defined(__GNUC__) && defined(__VERSION__)
17173 "COMPILER=gcc-" __VERSION__,
17174 #endif
@@ -17529,11 +17560,11 @@
17529 ** was used and false if not.
17530 **
17531 ** The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix
17532 ** is not required for a match.
17533 */
17534 SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName){
17535 int i, n;
17536
17537 #if SQLITE_ENABLE_API_ARMOR
17538 if( zOptName==0 ){
17539 (void)SQLITE_MISUSE_BKPT;
@@ -17557,11 +17588,11 @@
17557
17558 /*
17559 ** Return the N-th compile-time option string. If N is out of range,
17560 ** return a NULL pointer.
17561 */
17562 SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N){
17563 if( N>=0 && N<ArraySize(azCompileOpt) ){
17564 return azCompileOpt[N];
17565 }
17566 return 0;
17567 }
@@ -18267,11 +18298,11 @@
18267 }
18268
18269 /*
18270 ** Query status information.
18271 */
18272 SQLITE_API int SQLITE_STDCALL sqlite3_status64(
18273 int op,
18274 sqlite3_int64 *pCurrent,
18275 sqlite3_int64 *pHighwater,
18276 int resetFlag
18277 ){
@@ -18292,12 +18323,12 @@
18292 }
18293 sqlite3_mutex_leave(pMutex);
18294 (void)pMutex; /* Prevent warning when SQLITE_THREADSAFE=0 */
18295 return SQLITE_OK;
18296 }
18297 SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){
18298 sqlite3_int64 iCur, iHwtr;
18299 int rc;
18300 #ifdef SQLITE_ENABLE_API_ARMOR
18301 if( pCurrent==0 || pHighwater==0 ) return SQLITE_MISUSE_BKPT;
18302 #endif
18303 rc = sqlite3_status64(op, &iCur, &iHwtr, resetFlag);
@@ -18309,11 +18340,11 @@
18309 }
18310
18311 /*
18312 ** Query status information for a single database connection
18313 */
18314 SQLITE_API int SQLITE_STDCALL sqlite3_db_status(
18315 sqlite3 *db, /* The database connection whose status is desired */
18316 int op, /* Status verb */
18317 int *pCurrent, /* Write current value here */
18318 int *pHighwater, /* Write high-water mark here */
18319 int resetFlag /* Reset high-water mark if true */
@@ -19987,11 +20018,11 @@
19987
19988 /*
19989 ** Locate a VFS by name. If no name is given, simply return the
19990 ** first VFS on the list.
19991 */
19992 SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfs){
19993 sqlite3_vfs *pVfs = 0;
19994 #if SQLITE_THREADSAFE
19995 sqlite3_mutex *mutex;
19996 #endif
19997 #ifndef SQLITE_OMIT_AUTOINIT
@@ -20033,11 +20064,11 @@
20033 /*
20034 ** Register a VFS with the system. It is harmless to register the same
20035 ** VFS multiple times. The new VFS becomes the default if makeDflt is
20036 ** true.
20037 */
20038 SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){
20039 MUTEX_LOGIC(sqlite3_mutex *mutex;)
20040 #ifndef SQLITE_OMIT_AUTOINIT
20041 int rc = sqlite3_initialize();
20042 if( rc ) return rc;
20043 #endif
@@ -20061,11 +20092,11 @@
20061 }
20062
20063 /*
20064 ** Unregister a VFS so that it is no longer accessible.
20065 */
20066 SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs *pVfs){
20067 #if SQLITE_THREADSAFE
20068 sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
20069 #endif
20070 sqlite3_mutex_enter(mutex);
20071 vfsUnlink(pVfs);
@@ -22412,11 +22443,11 @@
22412 }
22413
22414 /*
22415 ** Retrieve a pointer to a static mutex or allocate a new dynamic one.
22416 */
22417 SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int id){
22418 #ifndef SQLITE_OMIT_AUTOINIT
22419 if( id<=SQLITE_MUTEX_RECURSIVE && sqlite3_initialize() ) return 0;
22420 if( id>SQLITE_MUTEX_RECURSIVE && sqlite3MutexInit() ) return 0;
22421 #endif
22422 assert( sqlite3GlobalConfig.mutex.xMutexAlloc );
@@ -22433,11 +22464,11 @@
22433 }
22434
22435 /*
22436 ** Free a dynamic mutex.
22437 */
22438 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex *p){
22439 if( p ){
22440 assert( sqlite3GlobalConfig.mutex.xMutexFree );
22441 sqlite3GlobalConfig.mutex.xMutexFree(p);
22442 }
22443 }
@@ -22444,11 +22475,11 @@
22444
22445 /*
22446 ** Obtain the mutex p. If some other thread already has the mutex, block
22447 ** until it can be obtained.
22448 */
22449 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex *p){
22450 if( p ){
22451 assert( sqlite3GlobalConfig.mutex.xMutexEnter );
22452 sqlite3GlobalConfig.mutex.xMutexEnter(p);
22453 }
22454 }
@@ -22455,11 +22486,11 @@
22455
22456 /*
22457 ** Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another
22458 ** thread holds the mutex and it cannot be obtained, return SQLITE_BUSY.
22459 */
22460 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex *p){
22461 int rc = SQLITE_OK;
22462 if( p ){
22463 assert( sqlite3GlobalConfig.mutex.xMutexTry );
22464 return sqlite3GlobalConfig.mutex.xMutexTry(p);
22465 }
@@ -22470,11 +22501,11 @@
22470 ** The sqlite3_mutex_leave() routine exits a mutex that was previously
22471 ** entered by the same thread. The behavior is undefined if the mutex
22472 ** is not currently entered. If a NULL pointer is passed as an argument
22473 ** this function is a no-op.
22474 */
22475 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex *p){
22476 if( p ){
22477 assert( sqlite3GlobalConfig.mutex.xMutexLeave );
22478 sqlite3GlobalConfig.mutex.xMutexLeave(p);
22479 }
22480 }
@@ -22482,15 +22513,15 @@
22482 #ifndef NDEBUG
22483 /*
22484 ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are
22485 ** intended for use inside assert() statements.
22486 */
22487 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex *p){
22488 assert( p==0 || sqlite3GlobalConfig.mutex.xMutexHeld );
22489 return p==0 || sqlite3GlobalConfig.mutex.xMutexHeld(p);
22490 }
22491 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex *p){
22492 assert( p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld );
22493 return p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld(p);
22494 }
22495 #endif
22496
@@ -23518,12 +23549,12 @@
23518 ** of the sqlite3_initialize() and sqlite3_shutdown() processing, the
23519 ** "interlocked" magic used here is probably not strictly necessary.
23520 */
23521 static LONG SQLITE_WIN32_VOLATILE winMutex_lock = 0;
23522
23523 SQLITE_API int SQLITE_STDCALL sqlite3_win32_is_nt(void); /* os_win.c */
23524 SQLITE_API void SQLITE_STDCALL sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */
23525
23526 static int winMutexInit(void){
23527 /* The first to increment to 1 does actual initialization */
23528 if( InterlockedCompareExchange(&winMutex_lock, 1, 0)==0 ){
23529 int i;
@@ -23819,11 +23850,11 @@
23819 /*
23820 ** Attempt to release up to n bytes of non-essential memory currently
23821 ** held by SQLite. An example of non-essential memory is memory used to
23822 ** cache database pages that are not currently in use.
23823 */
23824 SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int n){
23825 #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
23826 return sqlite3PcacheReleaseMemory(n);
23827 #else
23828 /* IMPLEMENTATION-OF: R-34391-24921 The sqlite3_release_memory() routine
23829 ** is a no-op returning zero if SQLite is not compiled with
@@ -23878,11 +23909,11 @@
23878 /*
23879 ** Deprecated external interface. It used to set an alarm callback
23880 ** that was invoked when memory usage grew too large. Now it is a
23881 ** no-op.
23882 */
23883 SQLITE_API int SQLITE_STDCALL sqlite3_memory_alarm(
23884 void(*xCallback)(void *pArg, sqlite3_int64 used,int N),
23885 void *pArg,
23886 sqlite3_int64 iThreshold
23887 ){
23888 (void)xCallback;
@@ -23894,11 +23925,11 @@
23894
23895 /*
23896 ** Set the soft heap-size limit for the library. Passing a zero or
23897 ** negative value indicates no limit.
23898 */
23899 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 n){
23900 sqlite3_int64 priorLimit;
23901 sqlite3_int64 excess;
23902 sqlite3_int64 nUsed;
23903 #ifndef SQLITE_OMIT_AUTOINIT
23904 int rc = sqlite3_initialize();
@@ -23916,11 +23947,11 @@
23916 sqlite3_mutex_leave(mem0.mutex);
23917 excess = sqlite3_memory_used() - n;
23918 if( excess>0 ) sqlite3_release_memory((int)(excess & 0x7fffffff));
23919 return priorLimit;
23920 }
23921 SQLITE_API void SQLITE_STDCALL sqlite3_soft_heap_limit(int n){
23922 if( n<0 ) n = 0;
23923 sqlite3_soft_heap_limit64(n);
23924 }
23925
23926 /*
@@ -23985,11 +24016,11 @@
23985 }
23986
23987 /*
23988 ** Return the amount of memory currently checked out.
23989 */
23990 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void){
23991 sqlite3_int64 res, mx;
23992 sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, 0);
23993 return res;
23994 }
23995
@@ -23996,11 +24027,11 @@
23996 /*
23997 ** Return the maximum amount of memory that has ever been
23998 ** checked out since either the beginning of this process
23999 ** or since the most recent reset.
24000 */
24001 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag){
24002 sqlite3_int64 res, mx;
24003 sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, resetFlag);
24004 return mx;
24005 }
24006
@@ -24076,17 +24107,17 @@
24076 /*
24077 ** This version of the memory allocation is for use by the application.
24078 ** First make sure the memory subsystem is initialized, then do the
24079 ** allocation.
24080 */
24081 SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int n){
24082 #ifndef SQLITE_OMIT_AUTOINIT
24083 if( sqlite3_initialize() ) return 0;
24084 #endif
24085 return n<=0 ? 0 : sqlite3Malloc(n);
24086 }
24087 SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64 n){
24088 #ifndef SQLITE_OMIT_AUTOINIT
24089 if( sqlite3_initialize() ) return 0;
24090 #endif
24091 return sqlite3Malloc(n);
24092 }
@@ -24225,20 +24256,20 @@
24225 }else{
24226 assert( sqlite3_mutex_held(db->mutex) );
24227 return db->lookaside.sz;
24228 }
24229 }
24230 SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void *p){
24231 assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) );
24232 assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
24233 return p ? sqlite3GlobalConfig.m.xSize(p) : 0;
24234 }
24235
24236 /*
24237 ** Free memory previously obtained from sqlite3Malloc().
24238 */
24239 SQLITE_API void SQLITE_STDCALL sqlite3_free(void *p){
24240 if( p==0 ) return; /* IMP: R-49053-54554 */
24241 assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
24242 assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) );
24243 if( sqlite3GlobalConfig.bMemstat ){
24244 sqlite3_mutex_enter(mem0.mutex);
@@ -24343,18 +24374,18 @@
24343
24344 /*
24345 ** The public interface to sqlite3Realloc. Make sure that the memory
24346 ** subsystem is initialized prior to invoking sqliteRealloc.
24347 */
24348 SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void *pOld, int n){
24349 #ifndef SQLITE_OMIT_AUTOINIT
24350 if( sqlite3_initialize() ) return 0;
24351 #endif
24352 if( n<0 ) n = 0; /* IMP: R-26507-47431 */
24353 return sqlite3Realloc(pOld, n);
24354 }
24355 SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void *pOld, sqlite3_uint64 n){
24356 #ifndef SQLITE_OMIT_AUTOINIT
24357 if( sqlite3_initialize() ) return 0;
24358 #endif
24359 return sqlite3Realloc(pOld, n);
24360 }
@@ -25577,11 +25608,11 @@
25577
25578 /*
25579 ** Print into memory obtained from sqlite3_malloc(). Omit the internal
25580 ** %-conversion extensions.
25581 */
25582 SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char *zFormat, va_list ap){
25583 char *z;
25584 char zBase[SQLITE_PRINT_BUF_SIZE];
25585 StrAccum acc;
25586
25587 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -25626,11 +25657,11 @@
25626 ** this without breaking compatibility, so we just have to live with the
25627 ** mistake.
25628 **
25629 ** sqlite3_vsnprintf() is the varargs version.
25630 */
25631 SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int n, char *zBuf, const char *zFormat, va_list ap){
25632 StrAccum acc;
25633 if( n<=0 ) return zBuf;
25634 #ifdef SQLITE_ENABLE_API_ARMOR
25635 if( zBuf==0 || zFormat==0 ) {
25636 (void)SQLITE_MISUSE_BKPT;
@@ -26253,11 +26284,11 @@
26253 } sqlite3Prng;
26254
26255 /*
26256 ** Return N random bytes.
26257 */
26258 SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *pBuf){
26259 unsigned char t;
26260 unsigned char *zBuf = pBuf;
26261
26262 /* The "wsdPrng" macro will resolve to the pseudo-random number generator
26263 ** state vector. If writable static data is unsupported on the target,
@@ -27456,11 +27487,11 @@
27456 ** sqlite3_strnicmp() APIs allow applications and extensions to compare
27457 ** the contents of two buffers containing UTF-8 strings in a
27458 ** case-independent fashion, using the same definition of "case
27459 ** independence" that SQLite uses internally when comparing identifiers.
27460 */
27461 SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *zLeft, const char *zRight){
27462 if( zLeft==0 ){
27463 return zRight ? -1 : 0;
27464 }else if( zRight==0 ){
27465 return 1;
27466 }
@@ -27477,11 +27508,11 @@
27477 a++;
27478 b++;
27479 }
27480 return c;
27481 }
27482 SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){
27483 register unsigned char *a, *b;
27484 if( zLeft==0 ){
27485 return zRight ? -1 : 0;
27486 }else if( zRight==0 ){
27487 return 1;
@@ -36776,11 +36807,11 @@
36776 ** This routine is called once during SQLite initialization and by a
36777 ** single thread. The memory allocation and mutex subsystems have not
36778 ** necessarily been initialized when this routine is called, and so they
36779 ** should not be used.
36780 */
36781 SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void){
36782 /*
36783 ** The following macro defines an initializer for an sqlite3_vfs object.
36784 ** The name of the VFS is NAME. The pAppData is a pointer to a pointer
36785 ** to the "finder" function. (pAppData is a pointer to a pointer because
36786 ** silly C90 rules prohibit a void* from being cast to a function pointer
@@ -36875,11 +36906,11 @@
36875 **
36876 ** Some operating systems might need to do some cleanup in this routine,
36877 ** to release dynamically allocated objects. But not on unix.
36878 ** This routine is a no-op for unix.
36879 */
36880 SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void){
36881 return SQLITE_OK;
36882 }
36883
36884 #endif /* SQLITE_OS_UNIX */
36885
@@ -38310,11 +38341,11 @@
38310 ** compact it. Upon success, SQLITE_OK will be returned. Upon failure, one
38311 ** of SQLITE_NOMEM, SQLITE_ERROR, or SQLITE_NOTFOUND will be returned. The
38312 ** "pnLargest" argument, if non-zero, will be used to return the size of the
38313 ** largest committed free block in the heap, in bytes.
38314 */
38315 SQLITE_API int SQLITE_STDCALL sqlite3_win32_compact_heap(LPUINT pnLargest){
38316 int rc = SQLITE_OK;
38317 UINT nLargest = 0;
38318 HANDLE hHeap;
38319
38320 winMemAssertMagic();
@@ -38350,11 +38381,11 @@
38350 ** If a Win32 native heap has been configured, this function will attempt to
38351 ** destroy and recreate it. If the Win32 native heap is not isolated and/or
38352 ** the sqlite3_memory_used() function does not return zero, SQLITE_BUSY will
38353 ** be returned and no changes will be made to the Win32 native heap.
38354 */
38355 SQLITE_API int SQLITE_STDCALL sqlite3_win32_reset_heap(){
38356 int rc;
38357 MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */
38358 MUTEX_LOGIC( sqlite3_mutex *pMem; ) /* The memsys static mutex */
38359 MUTEX_LOGIC( pMaster = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); )
38360 MUTEX_LOGIC( pMem = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM); )
@@ -38395,11 +38426,11 @@
38395 /*
38396 ** This function outputs the specified (ANSI) string to the Win32 debugger
38397 ** (if available).
38398 */
38399
38400 SQLITE_API void SQLITE_STDCALL sqlite3_win32_write_debug(const char *zBuf, int nBuf){
38401 char zDbgBuf[SQLITE_WIN32_DBG_BUF_SIZE];
38402 int nMin = MIN(nBuf, (SQLITE_WIN32_DBG_BUF_SIZE - 1)); /* may be negative. */
38403 if( nMin<-1 ) nMin = -1; /* all negative values become -1. */
38404 assert( nMin==-1 || nMin==0 || nMin<SQLITE_WIN32_DBG_BUF_SIZE );
38405 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -38441,11 +38472,11 @@
38441 */
38442 #if SQLITE_OS_WINRT
38443 static HANDLE sleepObj = NULL;
38444 #endif
38445
38446 SQLITE_API void SQLITE_STDCALL sqlite3_win32_sleep(DWORD milliseconds){
38447 #if SQLITE_OS_WINRT
38448 if ( sleepObj==NULL ){
38449 sleepObj = osCreateEventExW(NULL, NULL, CREATE_EVENT_MANUAL_RESET,
38450 SYNCHRONIZE);
38451 }
@@ -38490,11 +38521,11 @@
38490
38491 /*
38492 ** This function determines if the machine is running a version of Windows
38493 ** based on the NT kernel.
38494 */
38495 SQLITE_API int SQLITE_STDCALL sqlite3_win32_is_nt(void){
38496 #if SQLITE_OS_WINRT
38497 /*
38498 ** NOTE: The WinRT sub-platform is always assumed to be based on the NT
38499 ** kernel.
38500 */
@@ -38878,11 +38909,11 @@
38878 }
38879
38880 /*
38881 ** This is a public wrapper for the winUtf8ToUnicode() function.
38882 */
38883 SQLITE_API LPWSTR SQLITE_STDCALL sqlite3_win32_utf8_to_unicode(const char *zText){
38884 #ifdef SQLITE_ENABLE_API_ARMOR
38885 if( !zText ){
38886 (void)SQLITE_MISUSE_BKPT;
38887 return 0;
38888 }
@@ -38894,11 +38925,11 @@
38894 }
38895
38896 /*
38897 ** This is a public wrapper for the winUnicodeToUtf8() function.
38898 */
38899 SQLITE_API char *SQLITE_STDCALL sqlite3_win32_unicode_to_utf8(LPCWSTR zWideText){
38900 #ifdef SQLITE_ENABLE_API_ARMOR
38901 if( !zWideText ){
38902 (void)SQLITE_MISUSE_BKPT;
38903 return 0;
38904 }
@@ -38910,11 +38941,11 @@
38910 }
38911
38912 /*
38913 ** This is a public wrapper for the winMbcsToUtf8() function.
38914 */
38915 SQLITE_API char *SQLITE_STDCALL sqlite3_win32_mbcs_to_utf8(const char *zText){
38916 #ifdef SQLITE_ENABLE_API_ARMOR
38917 if( !zText ){
38918 (void)SQLITE_MISUSE_BKPT;
38919 return 0;
38920 }
@@ -38926,11 +38957,11 @@
38926 }
38927
38928 /*
38929 ** This is a public wrapper for the winMbcsToUtf8() function.
38930 */
38931 SQLITE_API char *SQLITE_STDCALL sqlite3_win32_mbcs_to_utf8_v2(const char *zText, int useAnsi){
38932 #ifdef SQLITE_ENABLE_API_ARMOR
38933 if( !zText ){
38934 (void)SQLITE_MISUSE_BKPT;
38935 return 0;
38936 }
@@ -38942,11 +38973,11 @@
38942 }
38943
38944 /*
38945 ** This is a public wrapper for the winUtf8ToMbcs() function.
38946 */
38947 SQLITE_API char *SQLITE_STDCALL sqlite3_win32_utf8_to_mbcs(const char *zText){
38948 #ifdef SQLITE_ENABLE_API_ARMOR
38949 if( !zText ){
38950 (void)SQLITE_MISUSE_BKPT;
38951 return 0;
38952 }
@@ -38958,11 +38989,11 @@
38958 }
38959
38960 /*
38961 ** This is a public wrapper for the winUtf8ToMbcs() function.
38962 */
38963 SQLITE_API char *SQLITE_STDCALL sqlite3_win32_utf8_to_mbcs_v2(const char *zText, int useAnsi){
38964 #ifdef SQLITE_ENABLE_API_ARMOR
38965 if( !zText ){
38966 (void)SQLITE_MISUSE_BKPT;
38967 return 0;
38968 }
@@ -38978,11 +39009,11 @@
38978 ** the provided arguments. The type argument must be 1 in order to set the
38979 ** data directory or 2 in order to set the temporary directory. The zValue
38980 ** argument is the name of the directory to use. The return value will be
38981 ** SQLITE_OK if successful.
38982 */
38983 SQLITE_API int SQLITE_STDCALL sqlite3_win32_set_directory(DWORD type, LPCWSTR zValue){
38984 char **ppDirectory = 0;
38985 #ifndef SQLITE_OMIT_AUTOINIT
38986 int rc = sqlite3_initialize();
38987 if( rc ) return rc;
38988 #endif
@@ -42896,11 +42927,11 @@
42896 }
42897
42898 /*
42899 ** Initialize and deinitialize the operating system interface.
42900 */
42901 SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void){
42902 static sqlite3_vfs winVfs = {
42903 3, /* iVersion */
42904 sizeof(winFile), /* szOsFile */
42905 SQLITE_WIN32_MAX_PATH_BYTES, /* mxPathname */
42906 0, /* pNext */
@@ -43027,11 +43058,11 @@
43027 #endif
43028
43029 return SQLITE_OK;
43030 }
43031
43032 SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void){
43033 #if SQLITE_OS_WINRT
43034 if( sleepObj!=NULL ){
43035 osCloseHandle(sleepObj);
43036 sleepObj = NULL;
43037 }
@@ -57022,11 +57053,11 @@
57022
57023 /*
57024 ** Return a +ve value if snapshot p1 is newer than p2. A -ve value if
57025 ** p1 is older than p2 and zero if p1 and p2 are the same snapshot.
57026 */
57027 SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_cmp(sqlite3_snapshot *p1, sqlite3_snapshot *p2){
57028 WalIndexHdr *pHdr1 = (WalIndexHdr*)p1;
57029 WalIndexHdr *pHdr2 = (WalIndexHdr*)p2;
57030
57031 /* aSalt[0] is a copy of the value stored in the wal file header. It
57032 ** is incremented each time the wal file is restarted. */
@@ -58159,11 +58190,11 @@
58159 **
58160 ** This routine has no effect on existing database connections.
58161 ** The shared cache setting effects only future calls to
58162 ** sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2().
58163 */
58164 SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int enable){
58165 sqlite3GlobalConfig.sharedCacheEnabled = enable;
58166 return SQLITE_OK;
58167 }
58168 #endif
58169
@@ -67932,11 +67963,11 @@
67932 ** a pointer to the new sqlite3_backup object.
67933 **
67934 ** If an error occurs, NULL is returned and an error code and error message
67935 ** stored in database handle pDestDb.
67936 */
67937 SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
67938 sqlite3* pDestDb, /* Database to write to */
67939 const char *zDestDb, /* Name of database within pDestDb */
67940 sqlite3* pSrcDb, /* Database connection to read from */
67941 const char *zSrcDb /* Name of database within pSrcDb */
67942 ){
@@ -68140,11 +68171,11 @@
68140 }
68141
68142 /*
68143 ** Copy nPage pages from the source b-tree to the destination.
68144 */
68145 SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage){
68146 int rc;
68147 int destMode; /* Destination journal mode */
68148 int pgszSrc = 0; /* Source page size */
68149 int pgszDest = 0; /* Destination page size */
68150
@@ -68384,11 +68415,11 @@
68384 }
68385
68386 /*
68387 ** Release all resources associated with an sqlite3_backup* handle.
68388 */
68389 SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p){
68390 sqlite3_backup **pp; /* Ptr to head of pagers backup list */
68391 sqlite3 *pSrcDb; /* Source database connection */
68392 int rc; /* Value to return */
68393
68394 /* Enter the mutexes */
@@ -68436,11 +68467,11 @@
68436
68437 /*
68438 ** Return the number of pages still to be backed up as of the most recent
68439 ** call to sqlite3_backup_step().
68440 */
68441 SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p){
68442 #ifdef SQLITE_ENABLE_API_ARMOR
68443 if( p==0 ){
68444 (void)SQLITE_MISUSE_BKPT;
68445 return 0;
68446 }
@@ -68450,11 +68481,11 @@
68450
68451 /*
68452 ** Return the total number of pages in the source database as of the most
68453 ** recent call to sqlite3_backup_step().
68454 */
68455 SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p){
68456 #ifdef SQLITE_ENABLE_API_ARMOR
68457 if( p==0 ){
68458 (void)SQLITE_MISUSE_BKPT;
68459 return 0;
68460 }
@@ -74904,11 +74935,11 @@
74904 ** execution environment changes in a way that would alter the program
74905 ** that sqlite3_prepare() generates. For example, if new functions or
74906 ** collating sequences are registered or if an authorizer function is
74907 ** added or changed.
74908 */
74909 SQLITE_API int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt *pStmt){
74910 Vdbe *p = (Vdbe*)pStmt;
74911 return p==0 || p->expired;
74912 }
74913 #endif
74914
@@ -74973,11 +75004,11 @@
74973 ** machine.
74974 **
74975 ** This routine sets the error code and string returned by
74976 ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
74977 */
74978 SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt){
74979 int rc;
74980 if( pStmt==0 ){
74981 /* IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL
74982 ** pointer is a harmless no-op. */
74983 rc = SQLITE_OK;
@@ -75000,11 +75031,11 @@
75000 ** the prior execution is returned.
75001 **
75002 ** This routine sets the error code and string returned by
75003 ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
75004 */
75005 SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt){
75006 int rc;
75007 if( pStmt==0 ){
75008 rc = SQLITE_OK;
75009 }else{
75010 Vdbe *v = (Vdbe*)pStmt;
@@ -75021,11 +75052,11 @@
75021 }
75022
75023 /*
75024 ** Set all the parameters in the compiled SQL statement to NULL.
75025 */
75026 SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt *pStmt){
75027 int i;
75028 int rc = SQLITE_OK;
75029 Vdbe *p = (Vdbe*)pStmt;
75030 #if SQLITE_THREADSAFE
75031 sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex;
@@ -75045,11 +75076,11 @@
75045
75046 /**************************** sqlite3_value_ *******************************
75047 ** The following routines extract information from a Mem or sqlite3_value
75048 ** structure.
75049 */
75050 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value *pVal){
75051 Mem *p = (Mem*)pVal;
75052 if( p->flags & (MEM_Blob|MEM_Str) ){
75053 if( sqlite3VdbeMemExpandBlob(p)!=SQLITE_OK ){
75054 assert( p->flags==MEM_Null && p->z==0 );
75055 return 0;
@@ -75058,48 +75089,48 @@
75058 return p->n ? p->z : 0;
75059 }else{
75060 return sqlite3_value_text(pVal);
75061 }
75062 }
75063 SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value *pVal){
75064 return sqlite3ValueBytes(pVal, SQLITE_UTF8);
75065 }
75066 SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value *pVal){
75067 return sqlite3ValueBytes(pVal, SQLITE_UTF16NATIVE);
75068 }
75069 SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value *pVal){
75070 return sqlite3VdbeRealValue((Mem*)pVal);
75071 }
75072 SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value *pVal){
75073 return (int)sqlite3VdbeIntValue((Mem*)pVal);
75074 }
75075 SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value *pVal){
75076 return sqlite3VdbeIntValue((Mem*)pVal);
75077 }
75078 SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value *pVal){
75079 Mem *pMem = (Mem*)pVal;
75080 return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0);
75081 }
75082 SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value *pVal){
75083 return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
75084 }
75085 #ifndef SQLITE_OMIT_UTF16
75086 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value* pVal){
75087 return sqlite3ValueText(pVal, SQLITE_UTF16NATIVE);
75088 }
75089 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value *pVal){
75090 return sqlite3ValueText(pVal, SQLITE_UTF16BE);
75091 }
75092 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value *pVal){
75093 return sqlite3ValueText(pVal, SQLITE_UTF16LE);
75094 }
75095 #endif /* SQLITE_OMIT_UTF16 */
75096 /* EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five
75097 ** fundamental datatypes: 64-bit signed integer 64-bit IEEE floating
75098 ** point number string BLOB NULL
75099 */
75100 SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value* pVal){
75101 static const u8 aType[] = {
75102 SQLITE_BLOB, /* 0x00 */
75103 SQLITE_NULL, /* 0x01 */
75104 SQLITE_TEXT, /* 0x02 */
75105 SQLITE_NULL, /* 0x03 */
@@ -75135,11 +75166,11 @@
75135 return aType[pVal->flags&MEM_AffMask];
75136 }
75137
75138 /* Make a copy of an sqlite3_value object
75139 */
75140 SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value *pOrig){
75141 sqlite3_value *pNew;
75142 if( pOrig==0 ) return 0;
75143 pNew = sqlite3_malloc( sizeof(*pNew) );
75144 if( pNew==0 ) return 0;
75145 memset(pNew, 0, sizeof(*pNew));
@@ -75158,11 +75189,11 @@
75158 }
75159
75160 /* Destroy an sqlite3_value object previously obtained from
75161 ** sqlite3_value_dup().
75162 */
75163 SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value *pOld){
75164 sqlite3ValueFree(pOld);
75165 }
75166
75167
75168 /**************************** sqlite3_result_ *******************************
@@ -75201,21 +75232,21 @@
75201 xDel((void*)p);
75202 }
75203 if( pCtx ) sqlite3_result_error_toobig(pCtx);
75204 return SQLITE_TOOBIG;
75205 }
75206 SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(
75207 sqlite3_context *pCtx,
75208 const void *z,
75209 int n,
75210 void (*xDel)(void *)
75211 ){
75212 assert( n>=0 );
75213 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75214 setResultStrOrError(pCtx, z, n, 0, xDel);
75215 }
75216 SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(
75217 sqlite3_context *pCtx,
75218 const void *z,
75219 sqlite3_uint64 n,
75220 void (*xDel)(void *)
75221 ){
@@ -75225,56 +75256,56 @@
75225 (void)invokeValueDestructor(z, xDel, pCtx);
75226 }else{
75227 setResultStrOrError(pCtx, z, (int)n, 0, xDel);
75228 }
75229 }
75230 SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context *pCtx, double rVal){
75231 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75232 sqlite3VdbeMemSetDouble(pCtx->pOut, rVal);
75233 }
75234 SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
75235 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75236 pCtx->isError = SQLITE_ERROR;
75237 pCtx->fErrorOrAux = 1;
75238 sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF8, SQLITE_TRANSIENT);
75239 }
75240 #ifndef SQLITE_OMIT_UTF16
75241 SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){
75242 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75243 pCtx->isError = SQLITE_ERROR;
75244 pCtx->fErrorOrAux = 1;
75245 sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF16NATIVE, SQLITE_TRANSIENT);
75246 }
75247 #endif
75248 SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context *pCtx, int iVal){
75249 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75250 sqlite3VdbeMemSetInt64(pCtx->pOut, (i64)iVal);
75251 }
75252 SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
75253 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75254 sqlite3VdbeMemSetInt64(pCtx->pOut, iVal);
75255 }
75256 SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context *pCtx){
75257 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75258 sqlite3VdbeMemSetNull(pCtx->pOut);
75259 }
75260 SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){
75261 Mem *pOut = pCtx->pOut;
75262 assert( sqlite3_mutex_held(pOut->db->mutex) );
75263 pOut->eSubtype = eSubtype & 0xff;
75264 pOut->flags |= MEM_Subtype;
75265 }
75266 SQLITE_API void SQLITE_STDCALL sqlite3_result_text(
75267 sqlite3_context *pCtx,
75268 const char *z,
75269 int n,
75270 void (*xDel)(void *)
75271 ){
75272 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75273 setResultStrOrError(pCtx, z, n, SQLITE_UTF8, xDel);
75274 }
75275 SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(
75276 sqlite3_context *pCtx,
75277 const char *z,
75278 sqlite3_uint64 n,
75279 void (*xDel)(void *),
75280 unsigned char enc
@@ -75287,56 +75318,56 @@
75287 }else{
75288 setResultStrOrError(pCtx, z, (int)n, enc, xDel);
75289 }
75290 }
75291 #ifndef SQLITE_OMIT_UTF16
75292 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(
75293 sqlite3_context *pCtx,
75294 const void *z,
75295 int n,
75296 void (*xDel)(void *)
75297 ){
75298 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75299 setResultStrOrError(pCtx, z, n, SQLITE_UTF16NATIVE, xDel);
75300 }
75301 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(
75302 sqlite3_context *pCtx,
75303 const void *z,
75304 int n,
75305 void (*xDel)(void *)
75306 ){
75307 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75308 setResultStrOrError(pCtx, z, n, SQLITE_UTF16BE, xDel);
75309 }
75310 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(
75311 sqlite3_context *pCtx,
75312 const void *z,
75313 int n,
75314 void (*xDel)(void *)
75315 ){
75316 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75317 setResultStrOrError(pCtx, z, n, SQLITE_UTF16LE, xDel);
75318 }
75319 #endif /* SQLITE_OMIT_UTF16 */
75320 SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){
75321 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75322 sqlite3VdbeMemCopy(pCtx->pOut, pValue);
75323 }
75324 SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){
75325 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75326 sqlite3VdbeMemSetZeroBlob(pCtx->pOut, n);
75327 }
75328 SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){
75329 Mem *pOut = pCtx->pOut;
75330 assert( sqlite3_mutex_held(pOut->db->mutex) );
75331 if( n>(u64)pOut->db->aLimit[SQLITE_LIMIT_LENGTH] ){
75332 return SQLITE_TOOBIG;
75333 }
75334 sqlite3VdbeMemSetZeroBlob(pCtx->pOut, (int)n);
75335 return SQLITE_OK;
75336 }
75337 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){
75338 pCtx->isError = errCode;
75339 pCtx->fErrorOrAux = 1;
75340 #ifdef SQLITE_DEBUG
75341 if( pCtx->pVdbe ) pCtx->pVdbe->rcApp = errCode;
75342 #endif
@@ -75345,20 +75376,20 @@
75345 SQLITE_UTF8, SQLITE_STATIC);
75346 }
75347 }
75348
75349 /* Force an SQLITE_TOOBIG error. */
75350 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context *pCtx){
75351 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75352 pCtx->isError = SQLITE_TOOBIG;
75353 pCtx->fErrorOrAux = 1;
75354 sqlite3VdbeMemSetStr(pCtx->pOut, "string or blob too big", -1,
75355 SQLITE_UTF8, SQLITE_STATIC);
75356 }
75357
75358 /* An SQLITE_NOMEM error. */
75359 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context *pCtx){
75360 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75361 sqlite3VdbeMemSetNull(pCtx->pOut);
75362 pCtx->isError = SQLITE_NOMEM_BKPT;
75363 pCtx->fErrorOrAux = 1;
75364 sqlite3OomFault(pCtx->pOut->db);
@@ -75526,11 +75557,11 @@
75526 /*
75527 ** This is the top-level implementation of sqlite3_step(). Call
75528 ** sqlite3Step() to do most of the work. If a schema error occurs,
75529 ** call sqlite3Reprepare() and try again.
75530 */
75531 SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt *pStmt){
75532 int rc = SQLITE_OK; /* Result from sqlite3Step() */
75533 int rc2 = SQLITE_OK; /* Result from sqlite3Reprepare() */
75534 Vdbe *v = (Vdbe*)pStmt; /* the prepared statement */
75535 int cnt = 0; /* Counter to prevent infinite loop of reprepares */
75536 sqlite3 *db; /* The database connection */
@@ -75577,11 +75608,11 @@
75577
75578 /*
75579 ** Extract the user data from a sqlite3_context structure and return a
75580 ** pointer to it.
75581 */
75582 SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context *p){
75583 assert( p && p->pFunc );
75584 return p->pFunc->pUserData;
75585 }
75586
75587 /*
@@ -75592,11 +75623,11 @@
75592 ** returns a copy of the pointer to the database connection (the 1st
75593 ** parameter) of the sqlite3_create_function() and
75594 ** sqlite3_create_function16() routines that originally registered the
75595 ** application defined function.
75596 */
75597 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context *p){
75598 assert( p && p->pOut );
75599 return p->pOut->db;
75600 }
75601
75602 /*
@@ -75668,11 +75699,11 @@
75668 /*
75669 ** Allocate or return the aggregate context for a user function. A new
75670 ** context is allocated on the first call. Subsequent calls return the
75671 ** same context that was returned on prior calls.
75672 */
75673 SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context *p, int nByte){
75674 assert( p && p->pFunc && p->pFunc->xFinalize );
75675 assert( sqlite3_mutex_held(p->pOut->db->mutex) );
75676 testcase( nByte<0 );
75677 if( (p->pMem->flags & MEM_Agg)==0 ){
75678 return createAggContext(p, nByte);
@@ -75683,11 +75714,11 @@
75683
75684 /*
75685 ** Return the auxiliary data pointer, if any, for the iArg'th argument to
75686 ** the user-function defined by pCtx.
75687 */
75688 SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
75689 AuxData *pAuxData;
75690
75691 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75692 #if SQLITE_ENABLE_STAT3_OR_STAT4
75693 if( pCtx->pVdbe==0 ) return 0;
@@ -75704,11 +75735,11 @@
75704 /*
75705 ** Set the auxiliary data pointer and delete function, for the iArg'th
75706 ** argument to the user-function defined by pCtx. Any previous value is
75707 ** deleted by calling the delete function specified when it was set.
75708 */
75709 SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(
75710 sqlite3_context *pCtx,
75711 int iArg,
75712 void *pAux,
75713 void (*xDelete)(void*)
75714 ){
@@ -75759,29 +75790,29 @@
75759 ** This function is deprecated. Do not use it for new code. It is
75760 ** provide only to avoid breaking legacy code. New aggregate function
75761 ** implementations should keep their own counts within their aggregate
75762 ** context.
75763 */
75764 SQLITE_API int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context *p){
75765 assert( p && p->pMem && p->pFunc && p->pFunc->xFinalize );
75766 return p->pMem->n;
75767 }
75768 #endif
75769
75770 /*
75771 ** Return the number of columns in the result set for the statement pStmt.
75772 */
75773 SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt){
75774 Vdbe *pVm = (Vdbe *)pStmt;
75775 return pVm ? pVm->nResColumn : 0;
75776 }
75777
75778 /*
75779 ** Return the number of values available from the current row of the
75780 ** currently executing statement pStmt.
75781 */
75782 SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt){
75783 Vdbe *pVm = (Vdbe *)pStmt;
75784 if( pVm==0 || pVm->pResultSet==0 ) return 0;
75785 return pVm->nResColumn;
75786 }
75787
@@ -75880,67 +75911,67 @@
75880
75881 /**************************** sqlite3_column_ *******************************
75882 ** The following routines are used to access elements of the current row
75883 ** in the result set.
75884 */
75885 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt *pStmt, int i){
75886 const void *val;
75887 val = sqlite3_value_blob( columnMem(pStmt,i) );
75888 /* Even though there is no encoding conversion, value_blob() might
75889 ** need to call malloc() to expand the result of a zeroblob()
75890 ** expression.
75891 */
75892 columnMallocFailure(pStmt);
75893 return val;
75894 }
75895 SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){
75896 int val = sqlite3_value_bytes( columnMem(pStmt,i) );
75897 columnMallocFailure(pStmt);
75898 return val;
75899 }
75900 SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){
75901 int val = sqlite3_value_bytes16( columnMem(pStmt,i) );
75902 columnMallocFailure(pStmt);
75903 return val;
75904 }
75905 SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt *pStmt, int i){
75906 double val = sqlite3_value_double( columnMem(pStmt,i) );
75907 columnMallocFailure(pStmt);
75908 return val;
75909 }
75910 SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt *pStmt, int i){
75911 int val = sqlite3_value_int( columnMem(pStmt,i) );
75912 columnMallocFailure(pStmt);
75913 return val;
75914 }
75915 SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt *pStmt, int i){
75916 sqlite_int64 val = sqlite3_value_int64( columnMem(pStmt,i) );
75917 columnMallocFailure(pStmt);
75918 return val;
75919 }
75920 SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt *pStmt, int i){
75921 const unsigned char *val = sqlite3_value_text( columnMem(pStmt,i) );
75922 columnMallocFailure(pStmt);
75923 return val;
75924 }
75925 SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt *pStmt, int i){
75926 Mem *pOut = columnMem(pStmt, i);
75927 if( pOut->flags&MEM_Static ){
75928 pOut->flags &= ~MEM_Static;
75929 pOut->flags |= MEM_Ephem;
75930 }
75931 columnMallocFailure(pStmt);
75932 return (sqlite3_value *)pOut;
75933 }
75934 #ifndef SQLITE_OMIT_UTF16
75935 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt *pStmt, int i){
75936 const void *val = sqlite3_value_text16( columnMem(pStmt,i) );
75937 columnMallocFailure(pStmt);
75938 return val;
75939 }
75940 #endif /* SQLITE_OMIT_UTF16 */
75941 SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt *pStmt, int i){
75942 int iType = sqlite3_value_type( columnMem(pStmt,i) );
75943 columnMallocFailure(pStmt);
75944 return iType;
75945 }
75946
@@ -76000,16 +76031,16 @@
76000
76001 /*
76002 ** Return the name of the Nth column of the result set returned by SQL
76003 ** statement pStmt.
76004 */
76005 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt *pStmt, int N){
76006 return columnName(
76007 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_NAME);
76008 }
76009 #ifndef SQLITE_OMIT_UTF16
76010 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt *pStmt, int N){
76011 return columnName(
76012 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_NAME);
76013 }
76014 #endif
76015
@@ -76025,16 +76056,16 @@
76025 #ifndef SQLITE_OMIT_DECLTYPE
76026 /*
76027 ** Return the column declaration type (if applicable) of the 'i'th column
76028 ** of the result set of SQL statement pStmt.
76029 */
76030 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){
76031 return columnName(
76032 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DECLTYPE);
76033 }
76034 #ifndef SQLITE_OMIT_UTF16
76035 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){
76036 return columnName(
76037 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DECLTYPE);
76038 }
76039 #endif /* SQLITE_OMIT_UTF16 */
76040 #endif /* SQLITE_OMIT_DECLTYPE */
@@ -76043,16 +76074,16 @@
76043 /*
76044 ** Return the name of the database from which a result column derives.
76045 ** NULL is returned if the result column is an expression or constant or
76046 ** anything else which is not an unambiguous reference to a database column.
76047 */
76048 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){
76049 return columnName(
76050 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DATABASE);
76051 }
76052 #ifndef SQLITE_OMIT_UTF16
76053 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){
76054 return columnName(
76055 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DATABASE);
76056 }
76057 #endif /* SQLITE_OMIT_UTF16 */
76058
@@ -76059,16 +76090,16 @@
76059 /*
76060 ** Return the name of the table from which a result column derives.
76061 ** NULL is returned if the result column is an expression or constant or
76062 ** anything else which is not an unambiguous reference to a database column.
76063 */
76064 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){
76065 return columnName(
76066 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_TABLE);
76067 }
76068 #ifndef SQLITE_OMIT_UTF16
76069 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){
76070 return columnName(
76071 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_TABLE);
76072 }
76073 #endif /* SQLITE_OMIT_UTF16 */
76074
@@ -76075,16 +76106,16 @@
76075 /*
76076 ** Return the name of the table column from which a result column derives.
76077 ** NULL is returned if the result column is an expression or constant or
76078 ** anything else which is not an unambiguous reference to a database column.
76079 */
76080 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){
76081 return columnName(
76082 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_COLUMN);
76083 }
76084 #ifndef SQLITE_OMIT_UTF16
76085 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){
76086 return columnName(
76087 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_COLUMN);
76088 }
76089 #endif /* SQLITE_OMIT_UTF16 */
76090 #endif /* SQLITE_ENABLE_COLUMN_METADATA */
@@ -76181,11 +76212,11 @@
76181
76182
76183 /*
76184 ** Bind a blob value to an SQL statement variable.
76185 */
76186 SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(
76187 sqlite3_stmt *pStmt,
76188 int i,
76189 const void *zData,
76190 int nData,
76191 void (*xDel)(void*)
@@ -76193,11 +76224,11 @@
76193 #ifdef SQLITE_ENABLE_API_ARMOR
76194 if( nData<0 ) return SQLITE_MISUSE_BKPT;
76195 #endif
76196 return bindText(pStmt, i, zData, nData, xDel, 0);
76197 }
76198 SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(
76199 sqlite3_stmt *pStmt,
76200 int i,
76201 const void *zData,
76202 sqlite3_uint64 nData,
76203 void (*xDel)(void*)
@@ -76207,52 +76238,52 @@
76207 return invokeValueDestructor(zData, xDel, 0);
76208 }else{
76209 return bindText(pStmt, i, zData, (int)nData, xDel, 0);
76210 }
76211 }
76212 SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
76213 int rc;
76214 Vdbe *p = (Vdbe *)pStmt;
76215 rc = vdbeUnbind(p, i);
76216 if( rc==SQLITE_OK ){
76217 sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue);
76218 sqlite3_mutex_leave(p->db->mutex);
76219 }
76220 return rc;
76221 }
76222 SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){
76223 return sqlite3_bind_int64(p, i, (i64)iValue);
76224 }
76225 SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
76226 int rc;
76227 Vdbe *p = (Vdbe *)pStmt;
76228 rc = vdbeUnbind(p, i);
76229 if( rc==SQLITE_OK ){
76230 sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue);
76231 sqlite3_mutex_leave(p->db->mutex);
76232 }
76233 return rc;
76234 }
76235 SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
76236 int rc;
76237 Vdbe *p = (Vdbe*)pStmt;
76238 rc = vdbeUnbind(p, i);
76239 if( rc==SQLITE_OK ){
76240 sqlite3_mutex_leave(p->db->mutex);
76241 }
76242 return rc;
76243 }
76244 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(
76245 sqlite3_stmt *pStmt,
76246 int i,
76247 const char *zData,
76248 int nData,
76249 void (*xDel)(void*)
76250 ){
76251 return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8);
76252 }
76253 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(
76254 sqlite3_stmt *pStmt,
76255 int i,
76256 const char *zData,
76257 sqlite3_uint64 nData,
76258 void (*xDel)(void*),
@@ -76265,21 +76296,21 @@
76265 if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE;
76266 return bindText(pStmt, i, zData, (int)nData, xDel, enc);
76267 }
76268 }
76269 #ifndef SQLITE_OMIT_UTF16
76270 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(
76271 sqlite3_stmt *pStmt,
76272 int i,
76273 const void *zData,
76274 int nData,
76275 void (*xDel)(void*)
76276 ){
76277 return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE);
76278 }
76279 #endif /* SQLITE_OMIT_UTF16 */
76280 SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
76281 int rc;
76282 switch( sqlite3_value_type((sqlite3_value*)pValue) ){
76283 case SQLITE_INTEGER: {
76284 rc = sqlite3_bind_int64(pStmt, i, pValue->u.i);
76285 break;
@@ -76306,21 +76337,21 @@
76306 break;
76307 }
76308 }
76309 return rc;
76310 }
76311 SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
76312 int rc;
76313 Vdbe *p = (Vdbe *)pStmt;
76314 rc = vdbeUnbind(p, i);
76315 if( rc==SQLITE_OK ){
76316 sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n);
76317 sqlite3_mutex_leave(p->db->mutex);
76318 }
76319 return rc;
76320 }
76321 SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){
76322 int rc;
76323 Vdbe *p = (Vdbe *)pStmt;
76324 sqlite3_mutex_enter(p->db->mutex);
76325 if( n>(u64)p->db->aLimit[SQLITE_LIMIT_LENGTH] ){
76326 rc = SQLITE_TOOBIG;
@@ -76335,11 +76366,11 @@
76335
76336 /*
76337 ** Return the number of wildcards that can be potentially bound to.
76338 ** This routine is added to support DBD::SQLite.
76339 */
76340 SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
76341 Vdbe *p = (Vdbe*)pStmt;
76342 return p ? p->nVar : 0;
76343 }
76344
76345 /*
@@ -76346,11 +76377,11 @@
76346 ** Return the name of a wildcard parameter. Return NULL if the index
76347 ** is out of range or if the wildcard is unnamed.
76348 **
76349 ** The result is always UTF-8.
76350 */
76351 SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){
76352 Vdbe *p = (Vdbe*)pStmt;
76353 if( p==0 || i<1 || i>p->nzVar ){
76354 return 0;
76355 }
76356 return p->azVar[i-1];
@@ -76374,11 +76405,11 @@
76374 }
76375 }
76376 }
76377 return 0;
76378 }
76379 SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
76380 return sqlite3VdbeParameterIndex((Vdbe*)pStmt, zName, sqlite3Strlen30(zName));
76381 }
76382
76383 /*
76384 ** Transfer all bindings from the first statement over to the second.
@@ -76408,11 +76439,11 @@
76408 **
76409 ** If the two statements contain a different number of bindings, then
76410 ** an SQLITE_ERROR is returned. Nothing else can go wrong, so otherwise
76411 ** SQLITE_OK is returned.
76412 */
76413 SQLITE_API int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
76414 Vdbe *pFrom = (Vdbe*)pFromStmt;
76415 Vdbe *pTo = (Vdbe*)pToStmt;
76416 if( pFrom->nVar!=pTo->nVar ){
76417 return SQLITE_ERROR;
76418 }
@@ -76430,26 +76461,26 @@
76430 ** Return the sqlite3* database handle to which the prepared statement given
76431 ** in the argument belongs. This is the same database handle that was
76432 ** the first argument to the sqlite3_prepare() that was used to create
76433 ** the statement in the first place.
76434 */
76435 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt *pStmt){
76436 return pStmt ? ((Vdbe*)pStmt)->db : 0;
76437 }
76438
76439 /*
76440 ** Return true if the prepared statement is guaranteed to not modify the
76441 ** database.
76442 */
76443 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt){
76444 return pStmt ? ((Vdbe*)pStmt)->readOnly : 1;
76445 }
76446
76447 /*
76448 ** Return true if the prepared statement is in need of being reset.
76449 */
76450 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt *pStmt){
76451 Vdbe *v = (Vdbe*)pStmt;
76452 return v!=0 && v->pc>=0 && v->magic==VDBE_MAGIC_RUN;
76453 }
76454
76455 /*
@@ -76456,11 +76487,11 @@
76456 ** Return a pointer to the next prepared statement after pStmt associated
76457 ** with database connection pDb. If pStmt is NULL, return the first
76458 ** prepared statement for the database connection. Return NULL if there
76459 ** are no more.
76460 */
76461 SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){
76462 sqlite3_stmt *pNext;
76463 #ifdef SQLITE_ENABLE_API_ARMOR
76464 if( !sqlite3SafetyCheckOk(pDb) ){
76465 (void)SQLITE_MISUSE_BKPT;
76466 return 0;
@@ -76477,11 +76508,11 @@
76477 }
76478
76479 /*
76480 ** Return the value of a status counter for a prepared statement
76481 */
76482 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){
76483 Vdbe *pVdbe = (Vdbe*)pStmt;
76484 u32 v;
76485 #ifdef SQLITE_ENABLE_API_ARMOR
76486 if( !pStmt ){
76487 (void)SQLITE_MISUSE_BKPT;
@@ -76494,11 +76525,11 @@
76494 }
76495
76496 /*
76497 ** Return the SQL associated with a prepared statement
76498 */
76499 SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt){
76500 Vdbe *p = (Vdbe *)pStmt;
76501 return p ? p->zSql : 0;
76502 }
76503
76504 /*
@@ -76508,11 +76539,11 @@
76508 ** freeing the returned string by passing it to sqlite3_free().
76509 **
76510 ** The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of
76511 ** expanded bound parameters.
76512 */
76513 SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt){
76514 #ifdef SQLITE_OMIT_TRACE
76515 return 0;
76516 #else
76517 char *z = 0;
76518 const char *zSql = sqlite3_sql(pStmt);
@@ -76550,11 +76581,11 @@
76550
76551 /*
76552 ** This function is called from within a pre-update callback to retrieve
76553 ** a field of the row currently being updated or deleted.
76554 */
76555 SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
76556 PreUpdate *p = db->pPreUpdate;
76557 int rc = SQLITE_OK;
76558
76559 /* Test that this call is being made from within an SQLITE_DELETE or
76560 ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */
@@ -76605,11 +76636,11 @@
76605 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
76606 /*
76607 ** This function is called from within a pre-update callback to retrieve
76608 ** the number of columns in the row being updated, deleted or inserted.
76609 */
76610 SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *db){
76611 PreUpdate *p = db->pPreUpdate;
76612 return (p ? p->keyinfo.nField : 0);
76613 }
76614 #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
76615
@@ -76623,11 +76654,11 @@
76623 ** top-level trigger etc.).
76624 **
76625 ** For the purposes of the previous paragraph, a foreign key CASCADE, SET NULL
76626 ** or SET DEFAULT action is considered a trigger.
76627 */
76628 SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *db){
76629 PreUpdate *p = db->pPreUpdate;
76630 return (p ? p->v->nFrame : 0);
76631 }
76632 #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
76633
@@ -76634,11 +76665,11 @@
76634 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
76635 /*
76636 ** This function is called from within a pre-update callback to retrieve
76637 ** a field of the row currently being updated or inserted.
76638 */
76639 SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
76640 PreUpdate *p = db->pPreUpdate;
76641 int rc = SQLITE_OK;
76642 Mem *pMem;
76643
76644 if( !p || p->op==SQLITE_DELETE ){
@@ -76708,11 +76739,11 @@
76708
76709 #ifdef SQLITE_ENABLE_STMT_SCANSTATUS
76710 /*
76711 ** Return status data for a single loop within query pStmt.
76712 */
76713 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus(
76714 sqlite3_stmt *pStmt, /* Prepared statement being queried */
76715 int idx, /* Index of loop to report on */
76716 int iScanStatusOp, /* Which metric to return */
76717 void *pOut /* OUT: Write the answer here */
76718 ){
@@ -76767,11 +76798,11 @@
76767 }
76768
76769 /*
76770 ** Zero all counters associated with the sqlite3_stmt_scanstatus() data.
76771 */
76772 SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){
76773 Vdbe *p = (Vdbe*)pStmt;
76774 memset(p->anExec, 0, p->nOp * sizeof(i64));
76775 }
76776 #endif /* SQLITE_ENABLE_STMT_SCANSTATUS */
76777
@@ -77294,11 +77325,11 @@
77294 ** Try to convert the type of a function argument or a result column
77295 ** into a numeric representation. Use either INTEGER or REAL whichever
77296 ** is appropriate. But only do the conversion if it is possible without
77297 ** loss of information and return the revised type of the argument.
77298 */
77299 SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value *pVal){
77300 int eType = sqlite3_value_type(pVal);
77301 if( eType==SQLITE_TEXT ){
77302 Mem *pMem = (Mem*)pVal;
77303 applyNumericAffinity(pMem, 0);
77304 eType = sqlite3_value_type(pVal);
@@ -84146,11 +84177,11 @@
84146 }
84147
84148 /*
84149 ** Open a blob handle.
84150 */
84151 SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
84152 sqlite3* db, /* The database connection */
84153 const char *zDb, /* The attached database containing the blob */
84154 const char *zTable, /* The table containing the blob */
84155 const char *zColumn, /* The column containing the blob */
84156 sqlite_int64 iRow, /* The row containing the glob */
@@ -84387,11 +84418,11 @@
84387
84388 /*
84389 ** Close a blob handle that was previously created using
84390 ** sqlite3_blob_open().
84391 */
84392 SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *pBlob){
84393 Incrblob *p = (Incrblob *)pBlob;
84394 int rc;
84395 sqlite3 *db;
84396
84397 if( p ){
@@ -84480,28 +84511,28 @@
84480 }
84481
84482 /*
84483 ** Read data from a blob handle.
84484 */
84485 SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){
84486 return blobReadWrite(pBlob, z, n, iOffset, sqlite3BtreeData);
84487 }
84488
84489 /*
84490 ** Write data to a blob handle.
84491 */
84492 SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){
84493 return blobReadWrite(pBlob, (void *)z, n, iOffset, sqlite3BtreePutData);
84494 }
84495
84496 /*
84497 ** Query a blob handle for the size of the data.
84498 **
84499 ** The Incrblob.nByte field is fixed for the lifetime of the Incrblob
84500 ** so no mutex is required for access.
84501 */
84502 SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *pBlob){
84503 Incrblob *p = (Incrblob *)pBlob;
84504 return (p && p->pStmt) ? p->nByte : 0;
84505 }
84506
84507 /*
@@ -84512,11 +84543,11 @@
84512 ** contain a blob or text value, then an error code is returned and the
84513 ** database handle error code and message set. If this happens, then all
84514 ** subsequent calls to sqlite3_blob_xxx() functions (except blob_close())
84515 ** immediately return SQLITE_ABORT.
84516 */
84517 SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){
84518 int rc;
84519 Incrblob *p = (Incrblob *)pBlob;
84520 sqlite3 *db;
84521
84522 if( p==0 ) return SQLITE_MISUSE_BKPT;
@@ -93355,10 +93386,65 @@
93355 ){
93356 return 1;
93357 }
93358 return 0;
93359 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93360
93361 /*
93362 ** An instance of the following structure is used by the tree walker
93363 ** to count references to table columns in the arguments of an
93364 ** aggregate function, in order to implement the
@@ -97061,11 +97147,11 @@
97061 ** and attempts to write the column will be ignored.
97062 **
97063 ** Setting the auth function to NULL disables this hook. The default
97064 ** setting of the auth function is NULL.
97065 */
97066 SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
97067 sqlite3 *db,
97068 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
97069 void *pArg
97070 ){
97071 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -97105,10 +97191,11 @@
97105 ){
97106 sqlite3 *db = pParse->db; /* Database handle */
97107 char *zDb = db->aDb[iDb].zName; /* Name of attached database */
97108 int rc; /* Auth callback return code */
97109
 
97110 rc = db->xAuth(db->pAuthArg, SQLITE_READ, zTab,zCol,zDb,pParse->zAuthContext
97111 #ifdef SQLITE_USER_AUTHENTICATION
97112 ,db->auth.zAuthUser
97113 #endif
97114 );
@@ -103823,18 +103910,18 @@
103823 }
103824
103825 /*
103826 ** The sqlite3_strglob() interface.
103827 */
103828 SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlobPattern, const char *zString){
103829 return patternCompare((u8*)zGlobPattern, (u8*)zString, &globInfo, '[')==0;
103830 }
103831
103832 /*
103833 ** The sqlite3_strlike() interface.
103834 */
103835 SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zPattern, const char *zStr, unsigned int esc){
103836 return patternCompare((u8*)zPattern, (u8*)zStr, &likeInfoNorm, esc)==0;
103837 }
103838
103839 /*
103840 ** Count the number of times that the LIKE operator (or GLOB which is
@@ -108526,11 +108613,11 @@
108526 ** If the SQL is a query, then for each row in the query result
108527 ** the xCallback() function is called. pArg becomes the first
108528 ** argument to xCallback(). If xCallback=NULL then no callback
108529 ** is invoked, even for queries.
108530 */
108531 SQLITE_API int SQLITE_STDCALL sqlite3_exec(
108532 sqlite3 *db, /* The database on which the SQL executes */
108533 const char *zSql, /* The SQL to be executed */
108534 sqlite3_callback xCallback, /* Invoke this callback routine */
108535 void *pArg, /* First argument to xCallback() */
108536 char **pzErrMsg /* Write error messages here */
@@ -108685,12 +108772,10 @@
108685 */
108686 #ifndef SQLITE3EXT_H
108687 #define SQLITE3EXT_H
108688 /* #include "sqlite3.h" */
108689
108690 typedef struct sqlite3_api_routines sqlite3_api_routines;
108691
108692 /*
108693 ** The following structure holds pointers to all of the SQLite API
108694 ** routines.
108695 **
108696 ** WARNING: In order to maintain backwards compatibility, add new
@@ -108951,10 +109036,20 @@
108951 int (*system_errno)(sqlite3*);
108952 /* Version 3.14.0 and later */
108953 int (*trace_v2)(sqlite3*,unsigned,int(*)(unsigned,void*,void*,void*),void*);
108954 char *(*expanded_sql)(sqlite3_stmt*);
108955 };
 
 
 
 
 
 
 
 
 
 
108956
108957 /*
108958 ** The following macros redefine the API routines so that they are
108959 ** redirected through the global sqlite3_api structure.
108960 **
@@ -109223,11 +109318,10 @@
109223 /************** Continuing where we left off in loadext.c ********************/
109224 /* #include "sqliteInt.h" */
109225 /* #include <string.h> */
109226
109227 #ifndef SQLITE_OMIT_LOAD_EXTENSION
109228
109229 /*
109230 ** Some API routines are omitted when various features are
109231 ** excluded from a build of SQLite. Substitute a NULL pointer
109232 ** for any missing APIs.
109233 */
@@ -109312,10 +109406,14 @@
109312 #define sqlite3_blob_open 0
109313 #define sqlite3_blob_read 0
109314 #define sqlite3_blob_write 0
109315 #define sqlite3_blob_reopen 0
109316 #endif
 
 
 
 
109317
109318 /*
109319 ** The following structure contains pointers to all SQLite API routines.
109320 ** A pointer to this structure is passed into extensions when they are
109321 ** loaded so that the extension can make calls back into the SQLite
@@ -109618,11 +109716,14 @@
109618 /* Version 3.10.0 and later */
109619 sqlite3_status64,
109620 sqlite3_strlike,
109621 sqlite3_db_cacheflush,
109622 /* Version 3.12.0 and later */
109623 sqlite3_system_errno
 
 
 
109624 };
109625
109626 /*
109627 ** Attempt to load an SQLite extension library contained in the file
109628 ** zFile. The entry point is zProc. zProc may be 0 in which case a
@@ -109641,11 +109742,11 @@
109641 const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */
109642 char **pzErrMsg /* Put error message here if not 0 */
109643 ){
109644 sqlite3_vfs *pVfs = db->pVfs;
109645 void *handle;
109646 int (*xInit)(sqlite3*,char**,const sqlite3_api_routines*);
109647 char *zErrmsg = 0;
109648 const char *zEntry;
109649 char *zAltEntry = 0;
109650 void **aHandle;
109651 u64 nMsg = 300 + sqlite3Strlen30(zFile);
@@ -109700,12 +109801,11 @@
109700 sqlite3OsDlError(pVfs, nMsg-1, zErrmsg);
109701 }
109702 }
109703 return SQLITE_ERROR;
109704 }
109705 xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*))
109706 sqlite3OsDlSym(pVfs, handle, zEntry);
109707
109708 /* If no entry point was specified and the default legacy
109709 ** entry point name "sqlite3_extension_init" was not found, then
109710 ** construct an entry point name "sqlite3_X_init" where the X is
109711 ** replaced by the lowercase value of every ASCII alphabetic
@@ -109733,12 +109833,11 @@
109733 zAltEntry[iEntry++] = (char)sqlite3UpperToLower[(unsigned)c];
109734 }
109735 }
109736 memcpy(zAltEntry+iEntry, "_init", 6);
109737 zEntry = zAltEntry;
109738 xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*))
109739 sqlite3OsDlSym(pVfs, handle, zEntry);
109740 }
109741 if( xInit==0 ){
109742 if( pzErrMsg ){
109743 nMsg += sqlite3Strlen30(zEntry);
109744 *pzErrMsg = zErrmsg = sqlite3_malloc64(nMsg);
@@ -109776,11 +109875,11 @@
109776 db->aExtension = aHandle;
109777
109778 db->aExtension[db->nExtension++] = handle;
109779 return SQLITE_OK;
109780 }
109781 SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
109782 sqlite3 *db, /* Load the extension into this database connection */
109783 const char *zFile, /* Name of the shared library containing extension */
109784 const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */
109785 char **pzErrMsg /* Put error message here if not 0 */
109786 ){
@@ -109807,11 +109906,11 @@
109807
109808 /*
109809 ** Enable or disable extension loading. Extension loading is disabled by
109810 ** default so as not to open security holes in older applications.
109811 */
109812 SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff){
109813 sqlite3_mutex_enter(db->mutex);
109814 if( onoff ){
109815 db->flags |= SQLITE_LoadExtension|SQLITE_LoadExtFunc;
109816 }else{
109817 db->flags &= ~(SQLITE_LoadExtension|SQLITE_LoadExtFunc);
@@ -109864,11 +109963,13 @@
109864
109865 /*
109866 ** Register a statically linked extension that is automatically
109867 ** loaded by every new database connection.
109868 */
109869 SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void (*xInit)(void)){
 
 
109870 int rc = SQLITE_OK;
109871 #ifndef SQLITE_OMIT_AUTOINIT
109872 rc = sqlite3_initialize();
109873 if( rc ){
109874 return rc;
@@ -109909,11 +110010,13 @@
109909 ** routine is a no-op.
109910 **
109911 ** Return 1 if xInit was found on the list and removed. Return 0 if xInit
109912 ** was not on the list.
109913 */
109914 SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void (*xInit)(void)){
 
 
109915 #if SQLITE_THREADSAFE
109916 sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
109917 #endif
109918 int i;
109919 int n = 0;
@@ -109932,11 +110035,11 @@
109932 }
109933
109934 /*
109935 ** Reset the automatic extension loading mechanism.
109936 */
109937 SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void){
109938 #ifndef SQLITE_OMIT_AUTOINIT
109939 if( sqlite3_initialize()==SQLITE_OK )
109940 #endif
109941 {
109942 #if SQLITE_THREADSAFE
@@ -109958,11 +110061,11 @@
109958 */
109959 SQLITE_PRIVATE void sqlite3AutoLoadExtensions(sqlite3 *db){
109960 u32 i;
109961 int go = 1;
109962 int rc;
109963 int (*xInit)(sqlite3*,char**,const sqlite3_api_routines*);
109964
109965 wsdAutoextInit;
109966 if( wsdAutoext.nExt==0 ){
109967 /* Common case: early out without every having to acquire a mutex */
109968 return;
@@ -109975,12 +110078,11 @@
109975 sqlite3_mutex_enter(mutex);
109976 if( i>=wsdAutoext.nExt ){
109977 xInit = 0;
109978 go = 0;
109979 }else{
109980 xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*))
109981 wsdAutoext.aExt[i];
109982 }
109983 sqlite3_mutex_leave(mutex);
109984 zErrmsg = 0;
109985 if( xInit && (rc = xInit(db, &zErrmsg, &sqlite3Apis))!=0 ){
109986 sqlite3ErrorWithMsg(db, rc,
@@ -113194,11 +113296,11 @@
113194 ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
113195 ** sqlite3_step(). In the new version, the original SQL text is retained
113196 ** and the statement is automatically recompiled if an schema change
113197 ** occurs.
113198 */
113199 SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
113200 sqlite3 *db, /* Database handle. */
113201 const char *zSql, /* UTF-8 encoded SQL statement. */
113202 int nBytes, /* Length of zSql in bytes. */
113203 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113204 const char **pzTail /* OUT: End of parsed string */
@@ -113206,11 +113308,11 @@
113206 int rc;
113207 rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,0,ppStmt,pzTail);
113208 assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
113209 return rc;
113210 }
113211 SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
113212 sqlite3 *db, /* Database handle. */
113213 const char *zSql, /* UTF-8 encoded SQL statement. */
113214 int nBytes, /* Length of zSql in bytes. */
113215 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113216 const char **pzTail /* OUT: End of parsed string */
@@ -113282,11 +113384,11 @@
113282 ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
113283 ** sqlite3_step(). In the new version, the original SQL text is retained
113284 ** and the statement is automatically recompiled if an schema change
113285 ** occurs.
113286 */
113287 SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
113288 sqlite3 *db, /* Database handle. */
113289 const void *zSql, /* UTF-16 encoded SQL statement. */
113290 int nBytes, /* Length of zSql in bytes. */
113291 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113292 const void **pzTail /* OUT: End of parsed string */
@@ -113294,11 +113396,11 @@
113294 int rc;
113295 rc = sqlite3Prepare16(db,zSql,nBytes,0,ppStmt,pzTail);
113296 assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
113297 return rc;
113298 }
113299 SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
113300 sqlite3 *db, /* Database handle. */
113301 const void *zSql, /* UTF-16 encoded SQL statement. */
113302 int nBytes, /* Length of zSql in bytes. */
113303 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
113304 const void **pzTail /* OUT: End of parsed string */
@@ -119137,11 +119239,11 @@
119137 ** The result that is written to ***pazResult is held in memory obtained
119138 ** from malloc(). But the caller cannot free this memory directly.
119139 ** Instead, the entire table should be passed to sqlite3_free_table() when
119140 ** the calling procedure is finished using it.
119141 */
119142 SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
119143 sqlite3 *db, /* The database on which the SQL executes */
119144 const char *zSql, /* The SQL to be executed */
119145 char ***pazResult, /* Write the result table here */
119146 int *pnRow, /* Write the number of rows in the result here */
119147 int *pnColumn, /* Write the number of columns of result here */
@@ -119206,11 +119308,11 @@
119206 }
119207
119208 /*
119209 ** This routine frees the space the sqlite3_get_table() malloced.
119210 */
119211 SQLITE_API void SQLITE_STDCALL sqlite3_free_table(
119212 char **azResult /* Result returned from sqlite3_get_table() */
119213 ){
119214 if( azResult ){
119215 int i, n;
119216 azResult--;
@@ -121357,10 +121459,12 @@
121357 sqlite3CodecGetKey(db, 0, (void**)&zKey, &nKey);
121358 if( nKey ) db->nextPagesize = 0;
121359 }
121360 #endif
121361
 
 
121362 rc = execSql(db, pzErrMsg, "PRAGMA vacuum_db.synchronous=OFF");
121363 if( rc!=SQLITE_OK ) goto end_of_vacuum;
121364
121365 /* Begin a transaction and take an exclusive lock on the main database
121366 ** file. This is done before the sqlite3BtreeGetPageSize(pMain) call below,
@@ -121614,11 +121718,11 @@
121614
121615
121616 /*
121617 ** External API function used to create a new virtual-table module.
121618 */
121619 SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
121620 sqlite3 *db, /* Database in which module is registered */
121621 const char *zName, /* Name assigned to this module */
121622 const sqlite3_module *pModule, /* The definition of the module */
121623 void *pAux /* Context pointer for xCreate/xConnect */
121624 ){
@@ -121629,11 +121733,11 @@
121629 }
121630
121631 /*
121632 ** External API function used to create a new virtual-table module.
121633 */
121634 SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
121635 sqlite3 *db, /* Database in which module is registered */
121636 const char *zName, /* Name assigned to this module */
121637 const sqlite3_module *pModule, /* The definition of the module */
121638 void *pAux, /* Context pointer for xCreate/xConnect */
121639 void (*xDestroy)(void *) /* Module destructor function */
@@ -122253,11 +122357,11 @@
122253 /*
122254 ** This function is used to set the schema of a virtual table. It is only
122255 ** valid to call this function from within the xCreate() or xConnect() of a
122256 ** virtual table module.
122257 */
122258 SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
122259 VtabCtx *pCtx;
122260 Parse *pParse;
122261 int rc = SQLITE_OK;
122262 Table *pTab;
122263 char *zErr = 0;
@@ -122707,11 +122811,11 @@
122707 ** table update operation currently in progress.
122708 **
122709 ** The results of this routine are undefined unless it is called from
122710 ** within an xUpdate method.
122711 */
122712 SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *db){
122713 static const unsigned char aMap[] = {
122714 SQLITE_ROLLBACK, SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_REPLACE
122715 };
122716 #ifdef SQLITE_ENABLE_API_ARMOR
122717 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -124633,10 +124737,11 @@
124633 zStartAff[nEq] = SQLITE_AFF_BLOB;
124634 }
124635 }
124636 nConstraint++;
124637 testcase( pRangeStart->wtFlags & TERM_VIRTUAL );
 
124638 }else if( bSeekPastNull ){
124639 sqlite3VdbeAddOp2(v, OP_Null, 0, regBase+nEq);
124640 nConstraint++;
124641 startEq = 0;
124642 start_constraints = 1;
@@ -129300,15 +129405,38 @@
129300 ){
129301 pNew->iSortIdx = b ? iSortIdx : 0;
129302
129303 /* The cost of visiting the index rows is N*K, where K is
129304 ** between 1.1 and 3.0, depending on the relative sizes of the
129305 ** index and table rows. If this is a non-covering index scan,
129306 ** also add the cost of visiting table rows (N*3.0). */
129307 pNew->rRun = rSize + 1 + (15*pProbe->szIdxRow)/pTab->szTabRow;
129308 if( m!=0 ){
129309 pNew->rRun = sqlite3LogEstAdd(pNew->rRun, rSize+16);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129310 }
129311 ApplyCostMultiplier(pNew->rRun, pTab->costMult);
129312 whereLoopOutputAdjust(pWC, pNew, rSize);
129313 rc = whereLoopInsert(pBuilder, pNew);
129314 pNew->nOut = rSize;
@@ -130474,11 +130602,11 @@
130474 pWInfo->nOBSat = pFrom->isOrdered;
130475 pWInfo->revMask = pFrom->revLoop;
130476 if( pWInfo->nOBSat<=0 ){
130477 pWInfo->nOBSat = 0;
130478 if( nLoop>0 ){
130479 Bitmask m;
130480 int rc = wherePathSatisfiesOrderBy(pWInfo, pWInfo->pOrderBy, pFrom,
130481 WHERE_ORDERBY_LIMIT, nLoop-1, pFrom->aLoop[nLoop-1], &m);
130482 if( rc==pWInfo->pOrderBy->nExpr ){
130483 pWInfo->bOrderedInnerLoop = 1;
130484 pWInfo->revMask = m;
@@ -136008,11 +136136,11 @@
136008 **
136009 ** If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed
136010 ** to recognize the end of a trigger can be omitted. All we have to do
136011 ** is look for a semicolon that is not part of an string or comment.
136012 */
136013 SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *zSql){
136014 u8 state = 0; /* Current state, using numbers defined in header comment */
136015 u8 token; /* Value of the next token */
136016
136017 #ifndef SQLITE_OMIT_TRIGGER
136018 /* A complex statement machine used to detect the end of a CREATE TRIGGER
@@ -136173,11 +136301,11 @@
136173 /*
136174 ** This routine is the same as the sqlite3_complete() routine described
136175 ** above, except that the parameter is required to be UTF-16 encoded, not
136176 ** UTF-8.
136177 */
136178 SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *zSql){
136179 sqlite3_value *pVal;
136180 char const *zSql8;
136181 int rc;
136182
136183 #ifndef SQLITE_OMIT_AUTOINIT
@@ -136333,28 +136461,28 @@
136333 #endif
136334
136335 /* IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns
136336 ** a pointer to the to the sqlite3_version[] string constant.
136337 */
136338 SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void){ return sqlite3_version; }
136339
136340 /* IMPLEMENTATION-OF: R-63124-39300 The sqlite3_sourceid() function returns a
136341 ** pointer to a string constant whose value is the same as the
136342 ** SQLITE_SOURCE_ID C preprocessor macro.
136343 */
136344 SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
136345
136346 /* IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function
136347 ** returns an integer equal to SQLITE_VERSION_NUMBER.
136348 */
136349 SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; }
136350
136351 /* IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns
136352 ** zero if and only if SQLite was compiled with mutexing code omitted due to
136353 ** the SQLITE_THREADSAFE compile-time option being set to 0.
136354 */
136355 SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; }
136356
136357 /*
136358 ** When compiling the test fixture or with debugging enabled (on Win32),
136359 ** this variable being set to non-zero will cause OSTRACE macros to emit
136360 ** extra diagnostic information.
@@ -136423,11 +136551,11 @@
136423 ** call by X completes.
136424 **
136425 ** * Recursive calls to this routine from thread X return immediately
136426 ** without blocking.
136427 */
136428 SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void){
136429 MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */
136430 int rc; /* Result code */
136431 #ifdef SQLITE_EXTRA_INIT
136432 int bRunExtraInit = 0; /* Extra initialization needed */
136433 #endif
@@ -136589,11 +136717,11 @@
136589 ** while any part of SQLite is otherwise in use in any thread. This
136590 ** routine is not threadsafe. But it is safe to invoke this routine
136591 ** on when SQLite is already shut down. If SQLite is already shut down
136592 ** when this routine is invoked, then this routine is a harmless no-op.
136593 */
136594 SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void){
136595 #ifdef SQLITE_OMIT_WSD
136596 int rc = sqlite3_wsd_init(4096, 24);
136597 if( rc!=SQLITE_OK ){
136598 return rc;
136599 }
@@ -137008,11 +137136,11 @@
137008 }
137009
137010 /*
137011 ** Return the mutex associated with a database connection.
137012 */
137013 SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3 *db){
137014 #ifdef SQLITE_ENABLE_API_ARMOR
137015 if( !sqlite3SafetyCheckOk(db) ){
137016 (void)SQLITE_MISUSE_BKPT;
137017 return 0;
137018 }
@@ -137022,11 +137150,11 @@
137022
137023 /*
137024 ** Free up as much memory as we can from the given database
137025 ** connection.
137026 */
137027 SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3 *db){
137028 int i;
137029
137030 #ifdef SQLITE_ENABLE_API_ARMOR
137031 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
137032 #endif
@@ -137046,11 +137174,11 @@
137046
137047 /*
137048 ** Flush any dirty pages in the pager-cache for any attached database
137049 ** to disk.
137050 */
137051 SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3 *db){
137052 int i;
137053 int rc = SQLITE_OK;
137054 int bSeenBusy = 0;
137055
137056 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -137196,11 +137324,11 @@
137196 }
137197
137198 /*
137199 ** Return the ROWID of the most recent insert
137200 */
137201 SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3 *db){
137202 #ifdef SQLITE_ENABLE_API_ARMOR
137203 if( !sqlite3SafetyCheckOk(db) ){
137204 (void)SQLITE_MISUSE_BKPT;
137205 return 0;
137206 }
@@ -137209,11 +137337,11 @@
137209 }
137210
137211 /*
137212 ** Return the number of changes in the most recent call to sqlite3_exec().
137213 */
137214 SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3 *db){
137215 #ifdef SQLITE_ENABLE_API_ARMOR
137216 if( !sqlite3SafetyCheckOk(db) ){
137217 (void)SQLITE_MISUSE_BKPT;
137218 return 0;
137219 }
@@ -137222,11 +137350,11 @@
137222 }
137223
137224 /*
137225 ** Return the number of changes since the database handle was opened.
137226 */
137227 SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3 *db){
137228 #ifdef SQLITE_ENABLE_API_ARMOR
137229 if( !sqlite3SafetyCheckOk(db) ){
137230 (void)SQLITE_MISUSE_BKPT;
137231 return 0;
137232 }
@@ -137373,12 +137501,12 @@
137373 ** statements or unfinished sqlite3_backups. The sqlite3_close_v2()
137374 ** version forces the connection to become a zombie if there are
137375 ** unclosed resources, and arranges for deallocation when the last
137376 ** prepare statement or sqlite3_backup closes.
137377 */
137378 SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3 *db){ return sqlite3Close(db,0); }
137379 SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3 *db){ return sqlite3Close(db,1); }
137380
137381
137382 /*
137383 ** Close the mutex on database connection db.
137384 **
@@ -137781,11 +137909,11 @@
137781
137782 /*
137783 ** This routine sets the busy callback for an Sqlite database to the
137784 ** given callback function with the given argument.
137785 */
137786 SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(
137787 sqlite3 *db,
137788 int (*xBusy)(void*,int),
137789 void *pArg
137790 ){
137791 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -137804,11 +137932,11 @@
137804 /*
137805 ** This routine sets the progress callback for an Sqlite database to the
137806 ** given callback function with the given argument. The progress callback will
137807 ** be invoked every nOps opcodes.
137808 */
137809 SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(
137810 sqlite3 *db,
137811 int nOps,
137812 int (*xProgress)(void*),
137813 void *pArg
137814 ){
@@ -137835,11 +137963,11 @@
137835
137836 /*
137837 ** This routine installs a default busy handler that waits for the
137838 ** specified number of milliseconds before returning 0.
137839 */
137840 SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3 *db, int ms){
137841 #ifdef SQLITE_ENABLE_API_ARMOR
137842 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
137843 #endif
137844 if( ms>0 ){
137845 sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db);
@@ -137851,11 +137979,11 @@
137851 }
137852
137853 /*
137854 ** Cause any pending operation to stop at its earliest opportunity.
137855 */
137856 SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3 *db){
137857 #ifdef SQLITE_ENABLE_API_ARMOR
137858 if( !sqlite3SafetyCheckOk(db) ){
137859 (void)SQLITE_MISUSE_BKPT;
137860 return;
137861 }
@@ -137967,11 +138095,11 @@
137967 }
137968
137969 /*
137970 ** Create new user functions.
137971 */
137972 SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
137973 sqlite3 *db,
137974 const char *zFunc,
137975 int nArg,
137976 int enc,
137977 void *p,
@@ -137981,11 +138109,11 @@
137981 ){
137982 return sqlite3_create_function_v2(db, zFunc, nArg, enc, p, xSFunc, xStep,
137983 xFinal, 0);
137984 }
137985
137986 SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
137987 sqlite3 *db,
137988 const char *zFunc,
137989 int nArg,
137990 int enc,
137991 void *p,
@@ -138024,11 +138152,11 @@
138024 sqlite3_mutex_leave(db->mutex);
138025 return rc;
138026 }
138027
138028 #ifndef SQLITE_OMIT_UTF16
138029 SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
138030 sqlite3 *db,
138031 const void *zFunctionName,
138032 int nArg,
138033 int eTextRep,
138034 void *p,
@@ -138064,11 +138192,11 @@
138064 ** When virtual tables intend to provide an overloaded function, they
138065 ** should call this routine to make sure the global function exists.
138066 ** A global function must exist in order for name resolution to work
138067 ** properly.
138068 */
138069 SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(
138070 sqlite3 *db,
138071 const char *zName,
138072 int nArg
138073 ){
138074 int rc = SQLITE_OK;
@@ -138096,11 +138224,11 @@
138096 ** A NULL trace function means that no tracing is executes. A non-NULL
138097 ** trace is a pointer to a function that is invoked at the start of each
138098 ** SQL statement.
138099 */
138100 #ifndef SQLITE_OMIT_DEPRECATED
138101 SQLITE_API void *SQLITE_STDCALL sqlite3_trace(sqlite3 *db, void(*xTrace)(void*,const char*), void *pArg){
138102 void *pOld;
138103
138104 #ifdef SQLITE_ENABLE_API_ARMOR
138105 if( !sqlite3SafetyCheckOk(db) ){
138106 (void)SQLITE_MISUSE_BKPT;
@@ -138117,11 +138245,11 @@
138117 }
138118 #endif /* SQLITE_OMIT_DEPRECATED */
138119
138120 /* Register a trace callback using the version-2 interface.
138121 */
138122 SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2(
138123 sqlite3 *db, /* Trace this connection */
138124 unsigned mTrace, /* Mask of events to be traced */
138125 int(*xTrace)(unsigned,void*,void*,void*), /* Callback to invoke */
138126 void *pArg /* Context */
138127 ){
@@ -138145,11 +138273,11 @@
138145 **
138146 ** A NULL profile function means that no profiling is executes. A non-NULL
138147 ** profile is a pointer to a function that is invoked at the conclusion of
138148 ** each SQL statement that is run.
138149 */
138150 SQLITE_API void *SQLITE_STDCALL sqlite3_profile(
138151 sqlite3 *db,
138152 void (*xProfile)(void*,const char*,sqlite_uint64),
138153 void *pArg
138154 ){
138155 void *pOld;
@@ -138173,11 +138301,11 @@
138173 /*
138174 ** Register a function to be invoked when a transaction commits.
138175 ** If the invoked function returns non-zero, then the commit becomes a
138176 ** rollback.
138177 */
138178 SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(
138179 sqlite3 *db, /* Attach the hook to this database */
138180 int (*xCallback)(void*), /* Function to invoke on each commit */
138181 void *pArg /* Argument to the function */
138182 ){
138183 void *pOld;
@@ -138198,11 +138326,11 @@
138198
138199 /*
138200 ** Register a callback to be invoked each time a row is updated,
138201 ** inserted or deleted using this database connection.
138202 */
138203 SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
138204 sqlite3 *db, /* Attach the hook to this database */
138205 void (*xCallback)(void*,int,char const *,char const *,sqlite_int64),
138206 void *pArg /* Argument to the function */
138207 ){
138208 void *pRet;
@@ -138223,11 +138351,11 @@
138223
138224 /*
138225 ** Register a callback to be invoked each time a transaction is rolled
138226 ** back by this database connection.
138227 */
138228 SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(
138229 sqlite3 *db, /* Attach the hook to this database */
138230 void (*xCallback)(void*), /* Callback function */
138231 void *pArg /* Argument to the function */
138232 ){
138233 void *pRet;
@@ -138249,11 +138377,11 @@
138249 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
138250 /*
138251 ** Register a callback to be invoked each time a row is updated,
138252 ** inserted or deleted using this database connection.
138253 */
138254 SQLITE_API void *SQLITE_STDCALL sqlite3_preupdate_hook(
138255 sqlite3 *db, /* Attach the hook to this database */
138256 void(*xCallback)( /* Callback function */
138257 void*,sqlite3*,int,char const*,char const*,sqlite3_int64,sqlite3_int64),
138258 void *pArg /* First callback argument */
138259 ){
@@ -138298,11 +138426,11 @@
138298 ** The callback registered by this function replaces any existing callback
138299 ** registered using sqlite3_wal_hook(). Likewise, registering a callback
138300 ** using sqlite3_wal_hook() disables the automatic checkpoint mechanism
138301 ** configured by this function.
138302 */
138303 SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){
138304 #ifdef SQLITE_OMIT_WAL
138305 UNUSED_PARAMETER(db);
138306 UNUSED_PARAMETER(nFrame);
138307 #else
138308 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -138319,11 +138447,11 @@
138319
138320 /*
138321 ** Register a callback to be invoked each time a transaction is written
138322 ** into the write-ahead-log by this database connection.
138323 */
138324 SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
138325 sqlite3 *db, /* Attach the hook to this db handle */
138326 int(*xCallback)(void *, sqlite3*, const char*, int),
138327 void *pArg /* First argument passed to xCallback() */
138328 ){
138329 #ifndef SQLITE_OMIT_WAL
@@ -138346,11 +138474,11 @@
138346 }
138347
138348 /*
138349 ** Checkpoint database zDb.
138350 */
138351 SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
138352 sqlite3 *db, /* Database handle */
138353 const char *zDb, /* Name of attached database (or NULL) */
138354 int eMode, /* SQLITE_CHECKPOINT_* value */
138355 int *pnLog, /* OUT: Size of WAL log in frames */
138356 int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -138401,11 +138529,11 @@
138401 /*
138402 ** Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points
138403 ** to contains a zero-length string, all attached databases are
138404 ** checkpointed.
138405 */
138406 SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){
138407 /* EVIDENCE-OF: R-41613-20553 The sqlite3_wal_checkpoint(D,X) is equivalent to
138408 ** sqlite3_wal_checkpoint_v2(D,X,SQLITE_CHECKPOINT_PASSIVE,0,0). */
138409 return sqlite3_wal_checkpoint_v2(db,zDb,SQLITE_CHECKPOINT_PASSIVE,0,0);
138410 }
138411
@@ -138492,11 +138620,11 @@
138492
138493 /*
138494 ** Return UTF-8 encoded English language explanation of the most recent
138495 ** error.
138496 */
138497 SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3 *db){
138498 const char *z;
138499 if( !db ){
138500 return sqlite3ErrStr(SQLITE_NOMEM_BKPT);
138501 }
138502 if( !sqlite3SafetyCheckSickOrOk(db) ){
@@ -138520,11 +138648,11 @@
138520 #ifndef SQLITE_OMIT_UTF16
138521 /*
138522 ** Return UTF-16 encoded English language explanation of the most recent
138523 ** error.
138524 */
138525 SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3 *db){
138526 static const u16 outOfMem[] = {
138527 'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0
138528 };
138529 static const u16 misuse[] = {
138530 'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ',
@@ -138565,38 +138693,38 @@
138565
138566 /*
138567 ** Return the most recent error code generated by an SQLite routine. If NULL is
138568 ** passed to this function, we assume a malloc() failed during sqlite3_open().
138569 */
138570 SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db){
138571 if( db && !sqlite3SafetyCheckSickOrOk(db) ){
138572 return SQLITE_MISUSE_BKPT;
138573 }
138574 if( !db || db->mallocFailed ){
138575 return SQLITE_NOMEM_BKPT;
138576 }
138577 return db->errCode & db->errMask;
138578 }
138579 SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db){
138580 if( db && !sqlite3SafetyCheckSickOrOk(db) ){
138581 return SQLITE_MISUSE_BKPT;
138582 }
138583 if( !db || db->mallocFailed ){
138584 return SQLITE_NOMEM_BKPT;
138585 }
138586 return db->errCode;
138587 }
138588 SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3 *db){
138589 return db ? db->iSysErrno : 0;
138590 }
138591
138592 /*
138593 ** Return a string that describes the kind of error specified in the
138594 ** argument. For now, this simply calls the internal sqlite3ErrStr()
138595 ** function.
138596 */
138597 SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int rc){
138598 return sqlite3ErrStr(rc);
138599 }
138600
138601 /*
138602 ** Create a new collating function for database "db". The name is zName
@@ -138740,11 +138868,11 @@
138740 **
138741 ** A new lower limit does not shrink existing constructs.
138742 ** It merely prevents new constructs that exceed the limit
138743 ** from forming.
138744 */
138745 SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3 *db, int limitId, int newLimit){
138746 int oldLimit;
138747
138748 #ifdef SQLITE_ENABLE_API_ARMOR
138749 if( !sqlite3SafetyCheckOk(db) ){
138750 (void)SQLITE_MISUSE_BKPT;
@@ -139364,18 +139492,18 @@
139364 }
139365
139366 /*
139367 ** Open a new database handle.
139368 */
139369 SQLITE_API int SQLITE_STDCALL sqlite3_open(
139370 const char *zFilename,
139371 sqlite3 **ppDb
139372 ){
139373 return openDatabase(zFilename, ppDb,
139374 SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0);
139375 }
139376 SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
139377 const char *filename, /* Database filename (UTF-8) */
139378 sqlite3 **ppDb, /* OUT: SQLite db handle */
139379 int flags, /* Flags */
139380 const char *zVfs /* Name of VFS module to use */
139381 ){
@@ -139384,11 +139512,11 @@
139384
139385 #ifndef SQLITE_OMIT_UTF16
139386 /*
139387 ** Open a new database handle.
139388 */
139389 SQLITE_API int SQLITE_STDCALL sqlite3_open16(
139390 const void *zFilename,
139391 sqlite3 **ppDb
139392 ){
139393 char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */
139394 sqlite3_value *pVal;
@@ -139423,11 +139551,11 @@
139423 #endif /* SQLITE_OMIT_UTF16 */
139424
139425 /*
139426 ** Register a new collation sequence with the database handle db.
139427 */
139428 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
139429 sqlite3* db,
139430 const char *zName,
139431 int enc,
139432 void* pCtx,
139433 int(*xCompare)(void*,int,const void*,int,const void*)
@@ -139436,11 +139564,11 @@
139436 }
139437
139438 /*
139439 ** Register a new collation sequence with the database handle db.
139440 */
139441 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
139442 sqlite3* db,
139443 const char *zName,
139444 int enc,
139445 void* pCtx,
139446 int(*xCompare)(void*,int,const void*,int,const void*),
@@ -139461,11 +139589,11 @@
139461
139462 #ifndef SQLITE_OMIT_UTF16
139463 /*
139464 ** Register a new collation sequence with the database handle db.
139465 */
139466 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
139467 sqlite3* db,
139468 const void *zName,
139469 int enc,
139470 void* pCtx,
139471 int(*xCompare)(void*,int,const void*,int,const void*)
@@ -139491,11 +139619,11 @@
139491
139492 /*
139493 ** Register a collation sequence factory callback with the database handle
139494 ** db. Replace any previously installed collation sequence factory.
139495 */
139496 SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
139497 sqlite3 *db,
139498 void *pCollNeededArg,
139499 void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*)
139500 ){
139501 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -139512,11 +139640,11 @@
139512 #ifndef SQLITE_OMIT_UTF16
139513 /*
139514 ** Register a collation sequence factory callback with the database handle
139515 ** db. Replace any previously installed collation sequence factory.
139516 */
139517 SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
139518 sqlite3 *db,
139519 void *pCollNeededArg,
139520 void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*)
139521 ){
139522 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -139534,11 +139662,11 @@
139534 #ifndef SQLITE_OMIT_DEPRECATED
139535 /*
139536 ** This function is now an anachronism. It used to be used to recover from a
139537 ** malloc() failure, but SQLite now does this automatically.
139538 */
139539 SQLITE_API int SQLITE_STDCALL sqlite3_global_recover(void){
139540 return SQLITE_OK;
139541 }
139542 #endif
139543
139544 /*
@@ -139545,11 +139673,11 @@
139545 ** Test to see whether or not the database connection is in autocommit
139546 ** mode. Return TRUE if it is and FALSE if not. Autocommit mode is on
139547 ** by default. Autocommit is disabled by a BEGIN statement and reenabled
139548 ** by the next COMMIT or ROLLBACK.
139549 */
139550 SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3 *db){
139551 #ifdef SQLITE_ENABLE_API_ARMOR
139552 if( !sqlite3SafetyCheckOk(db) ){
139553 (void)SQLITE_MISUSE_BKPT;
139554 return 0;
139555 }
@@ -139602,19 +139730,19 @@
139602 ** data for this thread has been deallocated.
139603 **
139604 ** SQLite no longer uses thread-specific data so this routine is now a
139605 ** no-op. It is retained for historical compatibility.
139606 */
139607 SQLITE_API void SQLITE_STDCALL sqlite3_thread_cleanup(void){
139608 }
139609 #endif
139610
139611 /*
139612 ** Return meta information about a specific column of a database table.
139613 ** See comment in sqlite3.h (sqlite.h.in) for details.
139614 */
139615 SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
139616 sqlite3 *db, /* Connection handle */
139617 const char *zDbName, /* Database name or NULL */
139618 const char *zTableName, /* Table name */
139619 const char *zColumnName, /* Column name */
139620 char const **pzDataType, /* OUTPUT: Declared data type */
@@ -139728,11 +139856,11 @@
139728 }
139729
139730 /*
139731 ** Sleep for a little while. Return the amount of time slept.
139732 */
139733 SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int ms){
139734 sqlite3_vfs *pVfs;
139735 int rc;
139736 pVfs = sqlite3_vfs_find(0);
139737 if( pVfs==0 ) return 0;
139738
@@ -139744,11 +139872,11 @@
139744 }
139745
139746 /*
139747 ** Enable or disable the extended result codes.
139748 */
139749 SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3 *db, int onoff){
139750 #ifdef SQLITE_ENABLE_API_ARMOR
139751 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
139752 #endif
139753 sqlite3_mutex_enter(db->mutex);
139754 db->errMask = onoff ? 0xffffffff : 0xff;
@@ -139757,11 +139885,11 @@
139757 }
139758
139759 /*
139760 ** Invoke the xFileControl method on a particular database.
139761 */
139762 SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
139763 int rc = SQLITE_ERROR;
139764 Btree *pBtree;
139765
139766 #ifdef SQLITE_ENABLE_API_ARMOR
139767 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -140142,11 +140270,11 @@
140142 ** method of a VFS implementation. The zParam argument is the name of the
140143 ** query parameter we seek. This routine returns the value of the zParam
140144 ** parameter if it exists. If the parameter does not exist, this routine
140145 ** returns a NULL pointer.
140146 */
140147 SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam){
140148 if( zFilename==0 || zParam==0 ) return 0;
140149 zFilename += sqlite3Strlen30(zFilename) + 1;
140150 while( zFilename[0] ){
140151 int x = strcmp(zFilename, zParam);
140152 zFilename += sqlite3Strlen30(zFilename) + 1;
@@ -140157,20 +140285,20 @@
140157 }
140158
140159 /*
140160 ** Return a boolean value for a query parameter.
140161 */
140162 SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){
140163 const char *z = sqlite3_uri_parameter(zFilename, zParam);
140164 bDflt = bDflt!=0;
140165 return z ? sqlite3GetBoolean(z, bDflt) : bDflt;
140166 }
140167
140168 /*
140169 ** Return a 64-bit integer value for a query parameter.
140170 */
140171 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(
140172 const char *zFilename, /* Filename as passed to xOpen */
140173 const char *zParam, /* URI parameter sought */
140174 sqlite3_int64 bDflt /* return if parameter is missing */
140175 ){
140176 const char *z = sqlite3_uri_parameter(zFilename, zParam);
@@ -140198,11 +140326,11 @@
140198
140199 /*
140200 ** Return the filename of the database associated with a database
140201 ** connection.
140202 */
140203 SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName){
140204 Btree *pBt;
140205 #ifdef SQLITE_ENABLE_API_ARMOR
140206 if( !sqlite3SafetyCheckOk(db) ){
140207 (void)SQLITE_MISUSE_BKPT;
140208 return 0;
@@ -140214,11 +140342,11 @@
140214
140215 /*
140216 ** Return 1 if database is read-only or 0 if read/write. Return -1 if
140217 ** no such database exists.
140218 */
140219 SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName){
140220 Btree *pBt;
140221 #ifdef SQLITE_ENABLE_API_ARMOR
140222 if( !sqlite3SafetyCheckOk(db) ){
140223 (void)SQLITE_MISUSE_BKPT;
140224 return -1;
@@ -140231,11 +140359,11 @@
140231 #ifdef SQLITE_ENABLE_SNAPSHOT
140232 /*
140233 ** Obtain a snapshot handle for the snapshot of database zDb currently
140234 ** being read by handle db.
140235 */
140236 SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_get(
140237 sqlite3 *db,
140238 const char *zDb,
140239 sqlite3_snapshot **ppSnapshot
140240 ){
140241 int rc = SQLITE_ERROR;
@@ -140266,11 +140394,11 @@
140266 }
140267
140268 /*
140269 ** Open a read-transaction on the snapshot idendified by pSnapshot.
140270 */
140271 SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_open(
140272 sqlite3 *db,
140273 const char *zDb,
140274 sqlite3_snapshot *pSnapshot
140275 ){
140276 int rc = SQLITE_ERROR;
@@ -140303,11 +140431,11 @@
140303 }
140304
140305 /*
140306 ** Free a snapshot handle obtained from sqlite3_snapshot_get().
140307 */
140308 SQLITE_API void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot *pSnapshot){
140309 sqlite3_free(pSnapshot);
140310 }
140311 #endif /* SQLITE_ENABLE_SNAPSHOT */
140312
140313 /************** End of main.c ************************************************/
@@ -140457,11 +140585,11 @@
140457 **
140458 ** Each call to this routine overrides any prior callbacks registered
140459 ** on the same "db". If xNotify==0 then any prior callbacks are immediately
140460 ** cancelled.
140461 */
140462 SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
140463 sqlite3 *db,
140464 void (*xNotify)(void **, int),
140465 void *pArg
140466 ){
140467 int rc = SQLITE_OK;
@@ -147460,11 +147588,11 @@
147460 ** Initialize API pointer table, if required.
147461 */
147462 #ifdef _WIN32
147463 __declspec(dllexport)
147464 #endif
147465 SQLITE_API int SQLITE_STDCALL sqlite3_fts3_init(
147466 sqlite3 *db,
147467 char **pzErrMsg,
147468 const sqlite3_api_routines *pApi
147469 ){
147470 SQLITE_EXTENSION_INIT2(pApi)
@@ -150616,11 +150744,15 @@
150616 }
150617
150618
150619 #ifdef SQLITE_TEST
150620
150621 #include <tcl.h>
 
 
 
 
150622 /* #include <string.h> */
150623
150624 /*
150625 ** Implementation of a special SQL scalar function for testing tokenizers
150626 ** designed to be used in concert with the Tcl testing framework. This
@@ -163257,11 +163389,11 @@
163257 }
163258
163259 /*
163260 ** Register a new geometry function for use with the r-tree MATCH operator.
163261 */
163262 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
163263 sqlite3 *db, /* Register SQL function on this connection */
163264 const char *zGeom, /* Name of the new SQL function */
163265 int (*xGeom)(sqlite3_rtree_geometry*,int,RtreeDValue*,int*), /* Callback */
163266 void *pContext /* Extra data associated with the callback */
163267 ){
@@ -163281,11 +163413,11 @@
163281
163282 /*
163283 ** Register a new 2nd-generation geometry function for use with the
163284 ** r-tree MATCH operator.
163285 */
163286 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
163287 sqlite3 *db, /* Register SQL function on this connection */
163288 const char *zQueryFunc, /* Name of new SQL function */
163289 int (*xQueryFunc)(sqlite3_rtree_query_info*), /* Callback */
163290 void *pContext, /* Extra data passed into the callback */
163291 void (*xDestructor)(void*) /* Destructor for the extra data */
@@ -163306,11 +163438,11 @@
163306
163307 #if !SQLITE_CORE
163308 #ifdef _WIN32
163309 __declspec(dllexport)
163310 #endif
163311 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_init(
163312 sqlite3 *db,
163313 char **pzErrMsg,
163314 const sqlite3_api_routines *pApi
163315 ){
163316 SQLITE_EXTENSION_INIT2(pApi)
@@ -163857,11 +163989,11 @@
163857
163858 #if !SQLITE_CORE
163859 #ifdef _WIN32
163860 __declspec(dllexport)
163861 #endif
163862 SQLITE_API int SQLITE_STDCALL sqlite3_icu_init(
163863 sqlite3 *db,
163864 char **pzErrMsg,
163865 const sqlite3_api_routines *pApi
163866 ){
163867 SQLITE_EXTENSION_INIT2(pApi)
@@ -164537,11 +164669,11 @@
164537 ** IMPORTANT NOTE FOR ZIPVFS USERS: The RBU extension works with all of
164538 ** SQLite's built-in VFSs, including the multiplexor VFS. However it does
164539 ** not work out of the box with zipvfs. Refer to the comment describing
164540 ** the zipvfs_create_vfs() API below for details on using RBU with zipvfs.
164541 */
164542 SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_open(
164543 const char *zTarget,
164544 const char *zRbu,
164545 const char *zState
164546 );
164547
@@ -164570,11 +164702,11 @@
164570 ** As with sqlite3rbu_open(), Zipvfs users should rever to the comment
164571 ** describing the sqlite3rbu_create_vfs() API function below for
164572 ** a description of the complications associated with using RBU with
164573 ** zipvfs databases.
164574 */
164575 SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_vacuum(
164576 const char *zTarget,
164577 const char *zState
164578 );
164579
164580 /*
@@ -164606,11 +164738,11 @@
164606 ** when sqlite3rbu_close() is called.
164607 **
164608 ** Database handles returned by this function remain valid until the next
164609 ** call to any sqlite3rbu_xxx() function other than sqlite3rbu_db().
164610 */
164611 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3rbu_db(sqlite3rbu*, int bRbu);
164612
164613 /*
164614 ** Do some work towards applying the RBU update to the target db.
164615 **
164616 ** Return SQLITE_DONE if the update has been completely applied, or
@@ -164620,11 +164752,11 @@
164620 **
164621 ** Once a call to sqlite3rbu_step() has returned a value other than
164622 ** SQLITE_OK, all subsequent calls on the same RBU handle are no-ops
164623 ** that immediately return the same value.
164624 */
164625 SQLITE_API int SQLITE_STDCALL sqlite3rbu_step(sqlite3rbu *pRbu);
164626
164627 /*
164628 ** Force RBU to save its state to disk.
164629 **
164630 ** If a power failure or application crash occurs during an update, following
@@ -164632,11 +164764,11 @@
164632 ** was last saved. In other words, from the most recent successful call to
164633 ** sqlite3rbu_close() or this function.
164634 **
164635 ** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
164636 */
164637 SQLITE_API int SQLITE_STDCALL sqlite3rbu_savestate(sqlite3rbu *pRbu);
164638
164639 /*
164640 ** Close an RBU handle.
164641 **
164642 ** If the RBU update has been completely applied, mark the RBU database
@@ -164652,18 +164784,18 @@
164652 **
164653 ** Otherwise, if no error occurs, this function returns SQLITE_OK if the
164654 ** update has been partially applied, or SQLITE_DONE if it has been
164655 ** completely applied.
164656 */
164657 SQLITE_API int SQLITE_STDCALL sqlite3rbu_close(sqlite3rbu *pRbu, char **pzErrmsg);
164658
164659 /*
164660 ** Return the total number of key-value operations (inserts, deletes or
164661 ** updates) that have been performed on the target database since the
164662 ** current RBU update was started.
164663 */
164664 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3rbu_progress(sqlite3rbu *pRbu);
164665
164666 /*
164667 ** Obtain permyriadage (permyriadage is to 10000 as percentage is to 100)
164668 ** progress indications for the two stages of an RBU update. This API may
164669 ** be useful for driving GUI progress indicators and similar.
@@ -164701,11 +164833,11 @@
164701 ** permyriadage progress of the same stage. If the rbu_count table does
164702 ** not exist, then (*pnOne) is set to -1 during stage 1. If the rbu_count
164703 ** table exists but is not correctly populated, the value of the *pnOne
164704 ** output variable during stage 1 is undefined.
164705 */
164706 SQLITE_API void SQLITE_STDCALL sqlite3rbu_bp_progress(sqlite3rbu *pRbu, int *pnOne, int *pnTwo);
164707
164708 /*
164709 ** Obtain an indication as to the current stage of an RBU update or vacuum.
164710 ** This function always returns one of the SQLITE_RBU_STATE_XXX constants
164711 ** defined in this file. Return values should be interpreted as follows:
@@ -164739,11 +164871,11 @@
164739 #define SQLITE_RBU_STATE_MOVE 2
164740 #define SQLITE_RBU_STATE_CHECKPOINT 3
164741 #define SQLITE_RBU_STATE_DONE 4
164742 #define SQLITE_RBU_STATE_ERROR 5
164743
164744 SQLITE_API int SQLITE_STDCALL sqlite3rbu_state(sqlite3rbu *pRbu);
164745
164746 /*
164747 ** Create an RBU VFS named zName that accesses the underlying file-system
164748 ** via existing VFS zParent. Or, if the zParent parameter is passed NULL,
164749 ** then the new RBU VFS uses the default system VFS to access the file-system.
@@ -164783,21 +164915,21 @@
164783 ** The overhead of adding the "rbu" VFS to the system is negligible for
164784 ** non-RBU users. There is no harm in an application accessing the
164785 ** file-system via "rbu" all the time, even if it only uses RBU functionality
164786 ** occasionally.
164787 */
164788 SQLITE_API int SQLITE_STDCALL sqlite3rbu_create_vfs(const char *zName, const char *zParent);
164789
164790 /*
164791 ** Deregister and destroy an RBU vfs created by an earlier call to
164792 ** sqlite3rbu_create_vfs().
164793 **
164794 ** VFS objects are not reference counted. If a VFS object is destroyed
164795 ** before all database handles that use it have been closed, the results
164796 ** are undefined.
164797 */
164798 SQLITE_API void SQLITE_STDCALL sqlite3rbu_destroy_vfs(const char *zName);
164799
164800 #if 0
164801 } /* end of the 'extern "C"' block */
164802 #endif
164803
@@ -167887,11 +168019,11 @@
167887 }
167888
167889 /*
167890 ** Step the RBU object.
167891 */
167892 SQLITE_API int SQLITE_STDCALL sqlite3rbu_step(sqlite3rbu *p){
167893 if( p ){
167894 switch( p->eStage ){
167895 case RBU_STAGE_OAL: {
167896 RbuObjIter *pIter = &p->objiter;
167897
@@ -168329,11 +168461,11 @@
168329 }
168330
168331 /*
168332 ** Open and return a new RBU handle.
168333 */
168334 SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_open(
168335 const char *zTarget,
168336 const char *zRbu,
168337 const char *zState
168338 ){
168339 /* TODO: Check that zTarget and zRbu are non-NULL */
@@ -168341,11 +168473,11 @@
168341 }
168342
168343 /*
168344 ** Open a handle to begin or resume an RBU VACUUM operation.
168345 */
168346 SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_vacuum(
168347 const char *zTarget,
168348 const char *zState
168349 ){
168350 /* TODO: Check that both arguments are non-NULL */
168351 return openRbuHandle(0, zTarget, zState);
@@ -168352,11 +168484,11 @@
168352 }
168353
168354 /*
168355 ** Return the database handle used by pRbu.
168356 */
168357 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3rbu_db(sqlite3rbu *pRbu, int bRbu){
168358 sqlite3 *db = 0;
168359 if( pRbu ){
168360 db = (bRbu ? pRbu->dbRbu : pRbu->dbMain);
168361 }
168362 return db;
@@ -168384,11 +168516,11 @@
168384 }
168385
168386 /*
168387 ** Close the RBU handle.
168388 */
168389 SQLITE_API int SQLITE_STDCALL sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){
168390 int rc;
168391 if( p ){
168392
168393 /* Commit the transaction to the *-oal file. */
168394 if( p->rc==SQLITE_OK && p->eStage==RBU_STAGE_OAL ){
@@ -168435,19 +168567,19 @@
168435 /*
168436 ** Return the total number of key-value operations (inserts, deletes or
168437 ** updates) that have been performed on the target database since the
168438 ** current RBU update was started.
168439 */
168440 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3rbu_progress(sqlite3rbu *pRbu){
168441 return pRbu->nProgress;
168442 }
168443
168444 /*
168445 ** Return permyriadage progress indications for the two main stages of
168446 ** an RBU update.
168447 */
168448 SQLITE_API void SQLITE_STDCALL sqlite3rbu_bp_progress(sqlite3rbu *p, int *pnOne, int *pnTwo){
168449 const int MAX_PROGRESS = 10000;
168450 switch( p->eStage ){
168451 case RBU_STAGE_OAL:
168452 if( p->nPhaseOneStep>0 ){
168453 *pnOne = (int)(MAX_PROGRESS * (i64)p->nProgress/(i64)p->nPhaseOneStep);
@@ -168478,11 +168610,11 @@
168478 }
168479
168480 /*
168481 ** Return the current state of the RBU vacuum or update operation.
168482 */
168483 SQLITE_API int SQLITE_STDCALL sqlite3rbu_state(sqlite3rbu *p){
168484 int aRes[] = {
168485 0, SQLITE_RBU_STATE_OAL, SQLITE_RBU_STATE_MOVE,
168486 0, SQLITE_RBU_STATE_CHECKPOINT, SQLITE_RBU_STATE_DONE
168487 };
168488
@@ -168506,11 +168638,11 @@
168506 );
168507 return aRes[p->eStage];
168508 }
168509 }
168510
168511 SQLITE_API int SQLITE_STDCALL sqlite3rbu_savestate(sqlite3rbu *p){
168512 int rc = p->rc;
168513 if( rc==SQLITE_DONE ) return SQLITE_OK;
168514
168515 assert( p->eStage>=RBU_STAGE_OAL && p->eStage<=RBU_STAGE_DONE );
168516 if( p->eStage==RBU_STAGE_OAL ){
@@ -169333,11 +169465,11 @@
169333
169334 /*
169335 ** Deregister and destroy an RBU vfs created by an earlier call to
169336 ** sqlite3rbu_create_vfs().
169337 */
169338 SQLITE_API void SQLITE_STDCALL sqlite3rbu_destroy_vfs(const char *zName){
169339 sqlite3_vfs *pVfs = sqlite3_vfs_find(zName);
169340 if( pVfs && pVfs->xOpen==rbuVfsOpen ){
169341 sqlite3_mutex_free(((rbu_vfs*)pVfs)->mutex);
169342 sqlite3_vfs_unregister(pVfs);
169343 sqlite3_free(pVfs);
@@ -169347,11 +169479,11 @@
169347 /*
169348 ** Create an RBU VFS named zName that accesses the underlying file-system
169349 ** via existing VFS zParent. The new object is registered as a non-default
169350 ** VFS with SQLite before returning.
169351 */
169352 SQLITE_API int SQLITE_STDCALL sqlite3rbu_create_vfs(const char *zName, const char *zParent){
169353
169354 /* Template for VFS */
169355 static sqlite3_vfs vfs_template = {
169356 1, /* iVersion */
169357 0, /* szOsFile */
@@ -171592,11 +171724,11 @@
171592 }
171593
171594 return rc;
171595 }
171596
171597 SQLITE_API int SQLITE_STDCALL sqlite3session_diff(
171598 sqlite3_session *pSession,
171599 const char *zFrom,
171600 const char *zTbl,
171601 char **pzErrMsg
171602 ){
@@ -171686,11 +171818,11 @@
171686
171687 /*
171688 ** Create a session object. This session object will record changes to
171689 ** database zDb attached to connection db.
171690 */
171691 SQLITE_API int SQLITE_STDCALL sqlite3session_create(
171692 sqlite3 *db, /* Database handle */
171693 const char *zDb, /* Name of db (e.g. "main") */
171694 sqlite3_session **ppSession /* OUT: New session object */
171695 ){
171696 sqlite3_session *pNew; /* Newly allocated session object */
@@ -171748,11 +171880,11 @@
171748 }
171749
171750 /*
171751 ** Delete a session object previously allocated using sqlite3session_create().
171752 */
171753 SQLITE_API void SQLITE_STDCALL sqlite3session_delete(sqlite3_session *pSession){
171754 sqlite3 *db = pSession->db;
171755 sqlite3_session *pHead;
171756 sqlite3_session **pp;
171757
171758 /* Unlink the session from the linked list of sessions attached to the
@@ -171777,11 +171909,11 @@
171777 }
171778
171779 /*
171780 ** Set a table filter on a Session Object.
171781 */
171782 SQLITE_API void SQLITE_STDCALL sqlite3session_table_filter(
171783 sqlite3_session *pSession,
171784 int(*xFilter)(void*, const char*),
171785 void *pCtx /* First argument passed to xFilter */
171786 ){
171787 pSession->bAutoAttach = 1;
@@ -171795,11 +171927,11 @@
171795 **
171796 ** Only tables that have a PRIMARY KEY defined may be attached. It does
171797 ** not matter if the PRIMARY KEY is an "INTEGER PRIMARY KEY" (rowid alias)
171798 ** or not.
171799 */
171800 SQLITE_API int SQLITE_STDCALL sqlite3session_attach(
171801 sqlite3_session *pSession, /* Session object */
171802 const char *zName /* Table name */
171803 ){
171804 int rc = SQLITE_OK;
171805 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
@@ -172485,11 +172617,11 @@
172485 ** session object passed as the first argument.
172486 **
172487 ** It is the responsibility of the caller to eventually free the buffer
172488 ** using sqlite3_free().
172489 */
172490 SQLITE_API int SQLITE_STDCALL sqlite3session_changeset(
172491 sqlite3_session *pSession, /* Session object */
172492 int *pnChangeset, /* OUT: Size of buffer at *ppChangeset */
172493 void **ppChangeset /* OUT: Buffer containing changeset */
172494 ){
172495 return sessionGenerateChangeset(pSession, 0, 0, 0, pnChangeset, ppChangeset);
@@ -172496,11 +172628,11 @@
172496 }
172497
172498 /*
172499 ** Streaming version of sqlite3session_changeset().
172500 */
172501 SQLITE_API int SQLITE_STDCALL sqlite3session_changeset_strm(
172502 sqlite3_session *pSession,
172503 int (*xOutput)(void *pOut, const void *pData, int nData),
172504 void *pOut
172505 ){
172506 return sessionGenerateChangeset(pSession, 0, xOutput, pOut, 0, 0);
@@ -172507,11 +172639,11 @@
172507 }
172508
172509 /*
172510 ** Streaming version of sqlite3session_patchset().
172511 */
172512 SQLITE_API int SQLITE_STDCALL sqlite3session_patchset_strm(
172513 sqlite3_session *pSession,
172514 int (*xOutput)(void *pOut, const void *pData, int nData),
172515 void *pOut
172516 ){
172517 return sessionGenerateChangeset(pSession, 1, xOutput, pOut, 0, 0);
@@ -172522,11 +172654,11 @@
172522 ** session object passed as the first argument.
172523 **
172524 ** It is the responsibility of the caller to eventually free the buffer
172525 ** using sqlite3_free().
172526 */
172527 SQLITE_API int SQLITE_STDCALL sqlite3session_patchset(
172528 sqlite3_session *pSession, /* Session object */
172529 int *pnPatchset, /* OUT: Size of buffer at *ppChangeset */
172530 void **ppPatchset /* OUT: Buffer containing changeset */
172531 ){
172532 return sessionGenerateChangeset(pSession, 1, 0, 0, pnPatchset, ppPatchset);
@@ -172533,11 +172665,11 @@
172533 }
172534
172535 /*
172536 ** Enable or disable the session object passed as the first argument.
172537 */
172538 SQLITE_API int SQLITE_STDCALL sqlite3session_enable(sqlite3_session *pSession, int bEnable){
172539 int ret;
172540 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172541 if( bEnable>=0 ){
172542 pSession->bEnable = bEnable;
172543 }
@@ -172547,11 +172679,11 @@
172547 }
172548
172549 /*
172550 ** Enable or disable the session object passed as the first argument.
172551 */
172552 SQLITE_API int SQLITE_STDCALL sqlite3session_indirect(sqlite3_session *pSession, int bIndirect){
172553 int ret;
172554 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172555 if( bIndirect>=0 ){
172556 pSession->bIndirect = bIndirect;
172557 }
@@ -172562,11 +172694,11 @@
172562
172563 /*
172564 ** Return true if there have been no changes to monitored tables recorded
172565 ** by the session object passed as the only argument.
172566 */
172567 SQLITE_API int SQLITE_STDCALL sqlite3session_isempty(sqlite3_session *pSession){
172568 int ret = 0;
172569 SessionTable *pTab;
172570
172571 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
172572 for(pTab=pSession->pTable; pTab && ret==0; pTab=pTab->pNext){
@@ -172612,11 +172744,11 @@
172612 }
172613
172614 /*
172615 ** Create an iterator used to iterate through the contents of a changeset.
172616 */
172617 SQLITE_API int SQLITE_STDCALL sqlite3changeset_start(
172618 sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
172619 int nChangeset, /* Size of buffer pChangeset in bytes */
172620 void *pChangeset /* Pointer to buffer containing changeset */
172621 ){
172622 return sessionChangesetStart(pp, 0, 0, nChangeset, pChangeset);
@@ -172623,11 +172755,11 @@
172623 }
172624
172625 /*
172626 ** Streaming version of sqlite3changeset_start().
172627 */
172628 SQLITE_API int SQLITE_STDCALL sqlite3changeset_start_strm(
172629 sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
172630 int (*xInput)(void *pIn, void *pData, int *pnData),
172631 void *pIn
172632 ){
172633 return sessionChangesetStart(pp, xInput, pIn, 0, 0);
@@ -173044,20 +173176,20 @@
173044 ** or SQLITE_CORRUPT.
173045 **
173046 ** This function may not be called on iterators passed to a conflict handler
173047 ** callback by changeset_apply().
173048 */
173049 SQLITE_API int SQLITE_STDCALL sqlite3changeset_next(sqlite3_changeset_iter *p){
173050 return sessionChangesetNext(p, 0, 0);
173051 }
173052
173053 /*
173054 ** The following function extracts information on the current change
173055 ** from a changeset iterator. It may only be called after changeset_next()
173056 ** has returned SQLITE_ROW.
173057 */
173058 SQLITE_API int SQLITE_STDCALL sqlite3changeset_op(
173059 sqlite3_changeset_iter *pIter, /* Iterator handle */
173060 const char **pzTab, /* OUT: Pointer to table name */
173061 int *pnCol, /* OUT: Number of columns in table */
173062 int *pOp, /* OUT: SQLITE_INSERT, DELETE or UPDATE */
173063 int *pbIndirect /* OUT: True if change is indirect */
@@ -173073,11 +173205,11 @@
173073 ** Return information regarding the PRIMARY KEY and number of columns in
173074 ** the database table affected by the change that pIter currently points
173075 ** to. This function may only be called after changeset_next() returns
173076 ** SQLITE_ROW.
173077 */
173078 SQLITE_API int SQLITE_STDCALL sqlite3changeset_pk(
173079 sqlite3_changeset_iter *pIter, /* Iterator object */
173080 unsigned char **pabPK, /* OUT: Array of boolean - true for PK cols */
173081 int *pnCol /* OUT: Number of entries in output array */
173082 ){
173083 *pabPK = pIter->abPK;
@@ -173096,11 +173228,11 @@
173096 ** was not modified and is not a PK column), set *ppValue to NULL.
173097 **
173098 ** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is
173099 ** not modified. Otherwise, SQLITE_OK.
173100 */
173101 SQLITE_API int SQLITE_STDCALL sqlite3changeset_old(
173102 sqlite3_changeset_iter *pIter, /* Changeset iterator */
173103 int iVal, /* Index of old.* value to retrieve */
173104 sqlite3_value **ppValue /* OUT: Old value (or NULL pointer) */
173105 ){
173106 if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_DELETE ){
@@ -173124,11 +173256,11 @@
173124 ** was not modified), set *ppValue to NULL.
173125 **
173126 ** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is
173127 ** not modified. Otherwise, SQLITE_OK.
173128 */
173129 SQLITE_API int SQLITE_STDCALL sqlite3changeset_new(
173130 sqlite3_changeset_iter *pIter, /* Changeset iterator */
173131 int iVal, /* Index of new.* value to retrieve */
173132 sqlite3_value **ppValue /* OUT: New value (or NULL pointer) */
173133 ){
173134 if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_INSERT ){
@@ -173158,11 +173290,11 @@
173158 ** containing the iVal'th value of the conflicting record.
173159 **
173160 ** If value iVal is out-of-range or some other error occurs, an SQLite error
173161 ** code is returned. Otherwise, SQLITE_OK.
173162 */
173163 SQLITE_API int SQLITE_STDCALL sqlite3changeset_conflict(
173164 sqlite3_changeset_iter *pIter, /* Changeset iterator */
173165 int iVal, /* Index of conflict record value to fetch */
173166 sqlite3_value **ppValue /* OUT: Value from conflicting row */
173167 ){
173168 if( !pIter->pConflict ){
@@ -173181,11 +173313,11 @@
173181 ** it sets the output variable to the total number of known foreign key
173182 ** violations in the destination database and returns SQLITE_OK.
173183 **
173184 ** In all other cases this function returns SQLITE_MISUSE.
173185 */
173186 SQLITE_API int SQLITE_STDCALL sqlite3changeset_fk_conflicts(
173187 sqlite3_changeset_iter *pIter, /* Changeset iterator */
173188 int *pnOut /* OUT: Number of FK violations */
173189 ){
173190 if( pIter->pConflict || pIter->apValue ){
173191 return SQLITE_MISUSE;
@@ -173199,11 +173331,11 @@
173199 ** Finalize an iterator allocated with sqlite3changeset_start().
173200 **
173201 ** This function may not be called on iterators passed to a conflict handler
173202 ** callback by changeset_apply().
173203 */
173204 SQLITE_API int SQLITE_STDCALL sqlite3changeset_finalize(sqlite3_changeset_iter *p){
173205 int rc = SQLITE_OK;
173206 if( p ){
173207 int i; /* Used to iterate through p->apValue[] */
173208 rc = p->rc;
173209 if( p->apValue ){
@@ -173373,11 +173505,11 @@
173373
173374
173375 /*
173376 ** Invert a changeset object.
173377 */
173378 SQLITE_API int SQLITE_STDCALL sqlite3changeset_invert(
173379 int nChangeset, /* Number of bytes in input */
173380 const void *pChangeset, /* Input changeset */
173381 int *pnInverted, /* OUT: Number of bytes in output changeset */
173382 void **ppInverted /* OUT: Inverse of pChangeset */
173383 ){
@@ -173392,11 +173524,11 @@
173392 }
173393
173394 /*
173395 ** Streaming version of sqlite3changeset_invert().
173396 */
173397 SQLITE_API int SQLITE_STDCALL sqlite3changeset_invert_strm(
173398 int (*xInput)(void *pIn, void *pData, int *pnData),
173399 void *pIn,
173400 int (*xOutput)(void *pOut, const void *pData, int nData),
173401 void *pOut
173402 ){
@@ -174272,11 +174404,11 @@
174272 /*
174273 ** Apply the changeset passed via pChangeset/nChangeset to the main database
174274 ** attached to handle "db". Invoke the supplied conflict handler callback
174275 ** to resolve any conflicts encountered while applying the change.
174276 */
174277 SQLITE_API int SQLITE_STDCALL sqlite3changeset_apply(
174278 sqlite3 *db, /* Apply change to "main" db of this handle */
174279 int nChangeset, /* Size of changeset in bytes */
174280 void *pChangeset, /* Changeset blob */
174281 int(*xFilter)(
174282 void *pCtx, /* Copy of sixth arg to _apply() */
@@ -174300,11 +174432,11 @@
174300 /*
174301 ** Apply the changeset passed via xInput/pIn to the main database
174302 ** attached to handle "db". Invoke the supplied conflict handler callback
174303 ** to resolve any conflicts encountered while applying the change.
174304 */
174305 SQLITE_API int SQLITE_STDCALL sqlite3changeset_apply_strm(
174306 sqlite3 *db, /* Apply change to "main" db of this handle */
174307 int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
174308 void *pIn, /* First arg for xInput */
174309 int(*xFilter)(
174310 void *pCtx, /* Copy of sixth arg to _apply() */
@@ -174635,11 +174767,11 @@
174635 }
174636
174637 /*
174638 ** Allocate a new, empty, sqlite3_changegroup.
174639 */
174640 SQLITE_API int SQLITE_STDCALL sqlite3changegroup_new(sqlite3_changegroup **pp){
174641 int rc = SQLITE_OK; /* Return code */
174642 sqlite3_changegroup *p; /* New object */
174643 p = (sqlite3_changegroup*)sqlite3_malloc(sizeof(sqlite3_changegroup));
174644 if( p==0 ){
174645 rc = SQLITE_NOMEM;
@@ -174652,11 +174784,11 @@
174652
174653 /*
174654 ** Add the changeset currently stored in buffer pData, size nData bytes,
174655 ** to changeset-group p.
174656 */
174657 SQLITE_API int SQLITE_STDCALL sqlite3changegroup_add(sqlite3_changegroup *pGrp, int nData, void *pData){
174658 sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */
174659 int rc; /* Return code */
174660
174661 rc = sqlite3changeset_start(&pIter, nData, pData);
174662 if( rc==SQLITE_OK ){
@@ -174668,11 +174800,11 @@
174668
174669 /*
174670 ** Obtain a buffer containing a changeset representing the concatenation
174671 ** of all changesets added to the group so far.
174672 */
174673 SQLITE_API int SQLITE_STDCALL sqlite3changegroup_output(
174674 sqlite3_changegroup *pGrp,
174675 int *pnData,
174676 void **ppData
174677 ){
174678 return sessionChangegroupOutput(pGrp, 0, 0, pnData, ppData);
@@ -174679,11 +174811,11 @@
174679 }
174680
174681 /*
174682 ** Streaming versions of changegroup_add().
174683 */
174684 SQLITE_API int SQLITE_STDCALL sqlite3changegroup_add_strm(
174685 sqlite3_changegroup *pGrp,
174686 int (*xInput)(void *pIn, void *pData, int *pnData),
174687 void *pIn
174688 ){
174689 sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */
@@ -174698,11 +174830,11 @@
174698 }
174699
174700 /*
174701 ** Streaming versions of changegroup_output().
174702 */
174703 SQLITE_API int SQLITE_STDCALL sqlite3changegroup_output_strm(
174704 sqlite3_changegroup *pGrp,
174705 int (*xOutput)(void *pOut, const void *pData, int nData),
174706 void *pOut
174707 ){
174708 return sessionChangegroupOutput(pGrp, xOutput, pOut, 0, 0);
@@ -174709,21 +174841,21 @@
174709 }
174710
174711 /*
174712 ** Delete a changegroup object.
174713 */
174714 SQLITE_API void SQLITE_STDCALL sqlite3changegroup_delete(sqlite3_changegroup *pGrp){
174715 if( pGrp ){
174716 sessionDeleteTable(pGrp->pList);
174717 sqlite3_free(pGrp);
174718 }
174719 }
174720
174721 /*
174722 ** Combine two changesets together.
174723 */
174724 SQLITE_API int SQLITE_STDCALL sqlite3changeset_concat(
174725 int nLeft, /* Number of bytes in lhs input */
174726 void *pLeft, /* Lhs input changeset */
174727 int nRight /* Number of bytes in rhs input */,
174728 void *pRight, /* Rhs input changeset */
174729 int *pnOut, /* OUT: Number of bytes in output changeset */
@@ -174748,11 +174880,11 @@
174748 }
174749
174750 /*
174751 ** Streaming version of sqlite3changeset_concat().
174752 */
174753 SQLITE_API int SQLITE_STDCALL sqlite3changeset_concat_strm(
174754 int (*xInputA)(void *pIn, void *pData, int *pnData),
174755 void *pInA,
174756 int (*xInputB)(void *pIn, void *pData, int *pnData),
174757 void *pInB,
174758 int (*xOutput)(void *pOut, const void *pData, int nData),
@@ -176003,10 +176135,11 @@
176003 sqlite3_context *ctx,
176004 int argc,
176005 sqlite3_value **argv
176006 ){
176007 JsonString jx;
 
176008
176009 jsonInit(&jx, ctx);
176010 jsonAppendValue(&jx, argv[0]);
176011 jsonResult(&jx);
176012 sqlite3_result_subtype(ctx, JSON_SUBTYPE);
@@ -176979,11 +177112,11 @@
176979
176980 #ifndef SQLITE_CORE
176981 #ifdef _WIN32
176982 __declspec(dllexport)
176983 #endif
176984 SQLITE_API int SQLITE_STDCALL sqlite3_json_init(
176985 sqlite3 *db,
176986 char **pzErrMsg,
176987 const sqlite3_api_routines *pApi
176988 ){
176989 SQLITE_EXTENSION_INIT2(pApi);
@@ -193812,11 +193945,11 @@
193812 int nArg, /* Number of args */
193813 sqlite3_value **apUnused /* Function arguments */
193814 ){
193815 assert( nArg==0 );
193816 UNUSED_PARAM2(nArg, apUnused);
193817 sqlite3_result_text(pCtx, "fts5: 2016-07-25 11:39:24 5f40e6ad599eea59a5adc3a11d6f7998872736b4", -1, SQLITE_TRANSIENT);
193818 }
193819
193820 static int fts5Init(sqlite3 *db){
193821 static const sqlite3_module fts5Mod = {
193822 /* iVersion */ 2,
@@ -193900,11 +194033,11 @@
193900 */
193901 #ifndef SQLITE_CORE
193902 #ifdef _WIN32
193903 __declspec(dllexport)
193904 #endif
193905 SQLITE_API int SQLITE_STDCALL sqlite3_fts_init(
193906 sqlite3 *db,
193907 char **pzErrMsg,
193908 const sqlite3_api_routines *pApi
193909 ){
193910 SQLITE_EXTENSION_INIT2(pApi);
@@ -193913,11 +194046,11 @@
193913 }
193914
193915 #ifdef _WIN32
193916 __declspec(dllexport)
193917 #endif
193918 SQLITE_API int SQLITE_STDCALL sqlite3_fts5_init(
193919 sqlite3 *db,
193920 char **pzErrMsg,
193921 const sqlite3_api_routines *pApi
193922 ){
193923 SQLITE_EXTENSION_INIT2(pApi);
193924
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -65,10 +65,18 @@
65 ** In all cases, the special comment must be enclosed in the usual
66 ** slash-asterisk...asterisk-slash comment marks, with no spaces between the
67 ** asterisks and the comment text.
68 */
69
70 /*
71 ** Make sure the Tcl calling convention macro is defined. This macro is
72 ** only used by test code and Tcl integration code.
73 */
74 #ifndef SQLITE_TCLAPI
75 # define SQLITE_TCLAPI
76 #endif
77
78 /*
79 ** Make sure that rand_s() is available on Windows systems with MSVC 2005
80 ** or higher.
81 */
82 #if defined(_MSC_VER) && _MSC_VER>=1400
@@ -304,12 +312,21 @@
312 # define SQLITE_API
313 #endif
314 #ifndef SQLITE_CDECL
315 # define SQLITE_CDECL
316 #endif
317 #ifndef SQLITE_APICALL
318 # define SQLITE_APICALL
319 #endif
320 #ifndef SQLITE_STDCALL
321 # define SQLITE_STDCALL SQLITE_APICALL
322 #endif
323 #ifndef SQLITE_CALLBACK
324 # define SQLITE_CALLBACK
325 #endif
326 #ifndef SQLITE_SYSAPI
327 # define SQLITE_SYSAPI
328 #endif
329
330 /*
331 ** These no-op macros are used in front of interfaces to mark those
332 ** interfaces as either deprecated or experimental. New applications
@@ -363,11 +380,11 @@
380 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
381 ** [sqlite_version()] and [sqlite_source_id()].
382 */
383 #define SQLITE_VERSION "3.14.0"
384 #define SQLITE_VERSION_NUMBER 3014000
385 #define SQLITE_SOURCE_ID "2016-08-02 08:45:26 7c38a79cdd42aaa45715aea330d10ca859098837"
386
387 /*
388 ** CAPI3REF: Run-Time Library Version Numbers
389 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
390 **
@@ -396,13 +413,13 @@
413 ** [SQLITE_SOURCE_ID] C preprocessor macro.
414 **
415 ** See also: [sqlite_version()] and [sqlite_source_id()].
416 */
417 SQLITE_API const char sqlite3_version[] = SQLITE_VERSION;
418 SQLITE_API const char *SQLITE_APICALL sqlite3_libversion(void);
419 SQLITE_API const char *SQLITE_APICALL sqlite3_sourceid(void);
420 SQLITE_API int SQLITE_APICALL sqlite3_libversion_number(void);
421
422 /*
423 ** CAPI3REF: Run-Time Library Compilation Options Diagnostics
424 **
425 ** ^The sqlite3_compileoption_used() function returns 0 or 1
@@ -423,12 +440,12 @@
440 **
441 ** See also: SQL functions [sqlite_compileoption_used()] and
442 ** [sqlite_compileoption_get()] and the [compile_options pragma].
443 */
444 #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
445 SQLITE_API int SQLITE_APICALL sqlite3_compileoption_used(const char *zOptName);
446 SQLITE_API const char *SQLITE_APICALL sqlite3_compileoption_get(int N);
447 #endif
448
449 /*
450 ** CAPI3REF: Test To See If The Library Is Threadsafe
451 **
@@ -463,11 +480,11 @@
480 ** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
481 ** is unchanged by calls to sqlite3_config().)^
482 **
483 ** See the [threading mode] documentation for additional information.
484 */
485 SQLITE_API int SQLITE_APICALL sqlite3_threadsafe(void);
486
487 /*
488 ** CAPI3REF: Database Connection Handle
489 ** KEYWORDS: {database connection} {database connections}
490 **
@@ -560,19 +577,19 @@
577 ** from [sqlite3_open()], [sqlite3_open16()], or
578 ** [sqlite3_open_v2()], and not previously closed.
579 ** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
580 ** argument is a harmless no-op.
581 */
582 SQLITE_API int SQLITE_APICALL sqlite3_close(sqlite3*);
583 SQLITE_API int SQLITE_APICALL sqlite3_close_v2(sqlite3*);
584
585 /*
586 ** The type for a callback function.
587 ** This is legacy and deprecated. It is included for historical
588 ** compatibility and is not documented.
589 */
590 typedef int (SQLITE_CALLBACK *sqlite3_callback)(void*,int,char**, char**);
591
592 /*
593 ** CAPI3REF: One-Step Query Execution Interface
594 ** METHOD: sqlite3
595 **
@@ -632,14 +649,14 @@
649 ** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
650 ** <li> The application must not modify the SQL statement text passed into
651 ** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
652 ** </ul>
653 */
654 SQLITE_API int SQLITE_APICALL sqlite3_exec(
655 sqlite3*, /* An open database */
656 const char *sql, /* SQL to be evaluated */
657 int (SQLITE_CALLBACK *callback)(void*,int,char**,char**), /* Callback function */
658 void *, /* 1st argument to callback */
659 char **errmsg /* Error msg written here */
660 );
661
662 /*
@@ -983,30 +1000,30 @@
1000 ** database corruption.
1001 */
1002 typedef struct sqlite3_io_methods sqlite3_io_methods;
1003 struct sqlite3_io_methods {
1004 int iVersion;
1005 int (SQLITE_CALLBACK *xClose)(sqlite3_file*);
1006 int (SQLITE_CALLBACK *xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
1007 int (SQLITE_CALLBACK *xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
1008 int (SQLITE_CALLBACK *xTruncate)(sqlite3_file*, sqlite3_int64 size);
1009 int (SQLITE_CALLBACK *xSync)(sqlite3_file*, int flags);
1010 int (SQLITE_CALLBACK *xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
1011 int (SQLITE_CALLBACK *xLock)(sqlite3_file*, int);
1012 int (SQLITE_CALLBACK *xUnlock)(sqlite3_file*, int);
1013 int (SQLITE_CALLBACK *xCheckReservedLock)(sqlite3_file*, int *pResOut);
1014 int (SQLITE_CALLBACK *xFileControl)(sqlite3_file*, int op, void *pArg);
1015 int (SQLITE_CALLBACK *xSectorSize)(sqlite3_file*);
1016 int (SQLITE_CALLBACK *xDeviceCharacteristics)(sqlite3_file*);
1017 /* Methods above are valid for version 1 */
1018 int (SQLITE_CALLBACK *xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
1019 int (SQLITE_CALLBACK *xShmLock)(sqlite3_file*, int offset, int n, int flags);
1020 void (SQLITE_CALLBACK *xShmBarrier)(sqlite3_file*);
1021 int (SQLITE_CALLBACK *xShmUnmap)(sqlite3_file*, int deleteFlag);
1022 /* Methods above are valid for version 2 */
1023 int (SQLITE_CALLBACK *xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
1024 int (SQLITE_CALLBACK *xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p);
1025 /* Methods above are valid for version 3 */
1026 /* Additional methods may be added in future releases */
1027 };
1028
1029 /*
@@ -1178,11 +1195,11 @@
1195 ** ^The [SQLITE_FCNTL_BUSYHANDLER]
1196 ** file-control may be invoked by SQLite on the database file handle
1197 ** shortly after it is opened in order to provide a custom VFS with access
1198 ** to the connections busy-handler callback. The argument is of type (void **)
1199 ** - an array of two (void *) values. The first (void *) actually points
1200 ** to a function of type (int (SQLITE_CALLBACK *)(void *)). In order to invoke the connections
1201 ** busy-handler, this function should be invoked with the second (void *) in
1202 ** the array as the only argument. If it returns non-zero, then the operation
1203 ** should be retried. If it returns zero, the custom VFS should abandon the
1204 ** current operation.
1205 **
@@ -1286,10 +1303,20 @@
1303 **
1304 ** Mutexes are created using [sqlite3_mutex_alloc()].
1305 */
1306 typedef struct sqlite3_mutex sqlite3_mutex;
1307
1308 /*
1309 ** CAPI3REF: Loadable Extension Thunk
1310 **
1311 ** A pointer to the opaque sqlite3_api_routines structure is passed as
1312 ** the third parameter to entry points of [loadable extensions]. This
1313 ** structure must be typedefed in order to work around compiler warnings
1314 ** on some platforms.
1315 */
1316 typedef struct sqlite3_api_routines sqlite3_api_routines;
1317
1318 /*
1319 ** CAPI3REF: OS Interface Object
1320 **
1321 ** An instance of the sqlite3_vfs object defines the interface between
1322 ** the SQLite core and the underlying operating system. The "vfs"
@@ -1444,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 */
@@ -1621,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
@@ -1743,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
@@ -1966,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
@@ -2019,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 +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 **
@@ -2269,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 **
@@ -2322,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 **
@@ -2346,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 **
@@ -2386,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
@@ -2421,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
@@ -2483,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 **
@@ -2506,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 **
@@ -2581,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
@@ -2696,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
@@ -2788,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
@@ -2818,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
@@ -2842,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 **
@@ -2925,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
@@ -3033,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 **
@@ -3124,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
@@ -3163,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 **
@@ -3392,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 );
@@ -3446,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
@@ -3492,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 **
@@ -3564,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 **
@@ -3716,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 */
@@ -3776,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 **
@@ -3809,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 **
@@ -3830,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 **
@@ -3994,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 **
@@ -4028,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 **
@@ -4056,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 **
@@ -4073,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 **
@@ -4095,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 **
@@ -4124,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 **
@@ -4173,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 **
@@ -4210,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 **
@@ -4291,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 **
@@ -4312,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 **
@@ -4502,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 **
@@ -4539,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 **
@@ -4566,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}
@@ -4666,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 **
@@ -4732,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
@@ -4787,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 **
@@ -4814,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 **
@@ -4830,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 **
@@ -4876,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 **
@@ -4891,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 **
@@ -4903,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 **
@@ -4956,12 +4983,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 **
@@ -4974,11 +5001,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
@@ -5093,31 +5120,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
@@ -5128,11 +5155,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 **
@@ -5210,31 +5237,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
@@ -5260,19 +5287,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
@@ -5279,15 +5306,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
@@ -5297,35 +5324,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 /*
@@ -5343,11 +5370,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
@@ -5462,11 +5489,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 **
@@ -5475,11 +5502,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 **
@@ -5492,21 +5519,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 **
@@ -5518,11 +5545,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 **
@@ -5567,12 +5594,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 **
@@ -5619,13 +5646,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
@@ -5659,11 +5686,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
@@ -5675,11 +5702,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 **
@@ -5689,11 +5716,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
@@ -5741,11 +5768,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 **
@@ -5752,11 +5779,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
@@ -5822,11 +5849,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 */
@@ -5878,11 +5905,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 );
@@ -5910,11 +5937,11 @@
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
@@ -5922,11 +5949,11 @@
5949 ** xEntryPoint() is the entry point for a statically linked [SQLite extension]
5950 ** that is to be automatically loaded into all new database connections.
5951 **
5952 ** ^(Even though the function prototype shows that xEntryPoint() takes
5953 ** no arguments and returns void, SQLite invokes xEntryPoint() with three
5954 ** arguments and expects an integer result as if the signature of the
5955 ** entry point where as follows:
5956 **
5957 ** <blockquote><pre>
5958 ** &nbsp; int xEntryPoint(
5959 ** &nbsp; sqlite3 *db,
@@ -5948,11 +5975,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
@@ -5960,19 +5987,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.
@@ -6005,41 +6032,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
@@ -6213,22 +6240,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
@@ -6282,11 +6309,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 **
@@ -6301,11 +6328,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.
@@ -6400,11 +6427,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,
@@ -6433,11 +6460,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 **
@@ -6456,11 +6483,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 **
@@ -6472,11 +6499,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 **
@@ -6501,11 +6528,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 **
@@ -6543,11 +6570,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
@@ -6574,13 +6601,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
@@ -6692,15 +6719,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
@@ -6765,19 +6792,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 **
@@ -6806,12 +6833,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 **
@@ -6847,11 +6874,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 **
@@ -6882,11 +6909,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
@@ -6964,12 +6991,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 );
@@ -7090,11 +7117,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 **
@@ -7233,11 +7260,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 **
@@ -7469,22 +7496,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
@@ -7491,20 +7518,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
@@ -7702,20 +7729,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 **
@@ -7828,13 +7855,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 /*
@@ -7843,12 +7870,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
@@ -7861,11 +7888,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
@@ -7884,11 +7911,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]
@@ -7943,13 +7970,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
@@ -7978,11 +8005,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 **
@@ -8000,11 +8027,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 **
@@ -8094,11 +8121,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 */
@@ -8183,11 +8210,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 **
@@ -8288,11 +8315,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 );
@@ -8304,11 +8331,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
@@ -8336,11 +8363,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
@@ -8416,13 +8443,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 */
@@ -8429,14 +8456,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
@@ -8444,11 +8471,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
@@ -8494,11 +8521,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
@@ -8532,11 +8559,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
@@ -8549,11 +8576,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 **
@@ -8573,11 +8600,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 /*
@@ -8631,14 +8658,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 /*
@@ -8648,25 +8675,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
@@ -8680,11 +8707,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 */
@@ -8876,11 +8903,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 );
@@ -9451,11 +9478,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 **
@@ -9571,11 +9598,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 */
@@ -9728,15 +9755,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 */
@@ -9873,20 +9900,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 **
@@ -9907,11 +9934,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
@@ -9927,58 +9954,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 /*
@@ -10029,11 +10056,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 */
@@ -10080,15 +10107,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:
@@ -10193,11 +10220,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
@@ -10260,43 +10287,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 *************************************************************************/
@@ -10320,11 +10347,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 **
@@ -10494,17 +10521,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 */
@@ -10533,33 +10560,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
@@ -10867,11 +10894,11 @@
10894 ** Make sure that the compiler intrinsics we desire are enabled when
10895 ** compiling with an appropriate version of MSVC unless prevented by
10896 ** the SQLITE_DISABLE_INTRINSIC define.
10897 */
10898 #if !defined(SQLITE_DISABLE_INTRINSIC)
10899 # if defined(_MSC_VER) && _MSC_VER>=1400
10900 # if !defined(_WIN32_WCE)
10901 # include <intrin.h>
10902 # pragma intrinsic(_byteswap_ushort)
10903 # pragma intrinsic(_byteswap_ulong)
10904 # pragma intrinsic(_ReadWriteBarrier)
@@ -11873,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
@@ -15834,10 +15861,11 @@
15861 int iCur; /* A cursor number */
15862 SrcList *pSrcList; /* FROM clause */
15863 struct SrcCount *pSrcCount; /* Counting column references */
15864 struct CCurHint *pCCurHint; /* Used by codeCursorHint() */
15865 int *aiCol; /* array of column indexes */
15866 struct IdxCover *pIdxCover; /* Check for index coverage */
15867 } u;
15868 };
15869
15870 /* Forward declarations */
15871 SQLITE_PRIVATE int sqlite3WalkExpr(Walker*, Expr*);
@@ -16277,10 +16305,11 @@
16305 SQLITE_PRIVATE int sqlite3ExprCompare(Expr*, Expr*, int);
16306 SQLITE_PRIVATE int sqlite3ExprListCompare(ExprList*, ExprList*, int);
16307 SQLITE_PRIVATE int sqlite3ExprImpliesExpr(Expr*, Expr*, int);
16308 SQLITE_PRIVATE void sqlite3ExprAnalyzeAggregates(NameContext*, Expr*);
16309 SQLITE_PRIVATE void sqlite3ExprAnalyzeAggList(NameContext*,ExprList*);
16310 SQLITE_PRIVATE int sqlite3ExprCoveredByIndex(Expr*, int iCur, Index *pIdx);
16311 SQLITE_PRIVATE int sqlite3FunctionUsesThisSrc(Expr*, SrcList*);
16312 SQLITE_PRIVATE Vdbe *sqlite3GetVdbe(Parse*);
16313 #ifndef SQLITE_OMIT_BUILTIN_TEST
16314 SQLITE_PRIVATE void sqlite3PrngSaveState(void);
16315 SQLITE_PRIVATE void sqlite3PrngRestoreState(void);
@@ -17163,12 +17192,14 @@
17192 "CASE_SENSITIVE_LIKE",
17193 #endif
17194 #if SQLITE_CHECK_PAGES
17195 "CHECK_PAGES",
17196 #endif
17197 #if defined(__clang__) && defined(__clang_major__)
17198 "COMPILER=clang-" CTIMEOPT_VAL(__clang_major__) "."
17199 CTIMEOPT_VAL(__clang_minor__) "."
17200 CTIMEOPT_VAL(__clang_patchlevel__),
17201 #elif defined(_MSC_VER)
17202 "COMPILER=msvc-" CTIMEOPT_VAL(_MSC_VER),
17203 #elif defined(__GNUC__) && defined(__VERSION__)
17204 "COMPILER=gcc-" __VERSION__,
17205 #endif
@@ -17529,11 +17560,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;
@@ -17557,11 +17588,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 }
@@ -18267,11 +18298,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 ){
@@ -18292,12 +18323,12 @@
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
18334 rc = sqlite3_status64(op, &iCur, &iHwtr, resetFlag);
@@ -18309,11 +18340,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 */
@@ -19987,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
@@ -20033,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
@@ -20061,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);
@@ -22412,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 );
@@ -22433,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 }
@@ -22444,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 }
@@ -22455,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 }
@@ -22470,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 }
@@ -22482,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
@@ -23518,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;
@@ -23819,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
@@ -23878,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;
@@ -23894,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();
@@ -23916,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 /*
@@ -23985,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
@@ -23996,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
@@ -24076,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 }
@@ -24225,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);
@@ -24343,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 }
@@ -25577,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
@@ -25626,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;
@@ -26253,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,
@@ -27456,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 }
@@ -27477,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;
@@ -36776,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
@@ -36875,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
@@ -38310,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();
@@ -38350,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); )
@@ -38395,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
@@ -38441,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 }
@@ -38490,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 */
@@ -38878,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 }
@@ -38894,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 }
@@ -38910,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 }
@@ -38926,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 }
@@ -38942,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 }
@@ -38958,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 }
@@ -38978,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
@@ -42896,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 */
@@ -43027,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 }
@@ -57022,11 +57053,11 @@
57053
57054 /*
57055 ** Return a +ve value if snapshot p1 is newer than p2. A -ve value if
57056 ** p1 is older than p2 and zero if p1 and p2 are the same snapshot.
57057 */
57058 SQLITE_API int SQLITE_APICALL sqlite3_snapshot_cmp(sqlite3_snapshot *p1, sqlite3_snapshot *p2){
57059 WalIndexHdr *pHdr1 = (WalIndexHdr*)p1;
57060 WalIndexHdr *pHdr2 = (WalIndexHdr*)p2;
57061
57062 /* aSalt[0] is a copy of the value stored in the wal file header. It
57063 ** is incremented each time the wal file is restarted. */
@@ -58159,11 +58190,11 @@
58190 **
58191 ** This routine has no effect on existing database connections.
58192 ** The shared cache setting effects only future calls to
58193 ** sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2().
58194 */
58195 SQLITE_API int SQLITE_APICALL sqlite3_enable_shared_cache(int enable){
58196 sqlite3GlobalConfig.sharedCacheEnabled = enable;
58197 return SQLITE_OK;
58198 }
58199 #endif
58200
@@ -67932,11 +67963,11 @@
67963 ** a pointer to the new sqlite3_backup object.
67964 **
67965 ** If an error occurs, NULL is returned and an error code and error message
67966 ** stored in database handle pDestDb.
67967 */
67968 SQLITE_API sqlite3_backup *SQLITE_APICALL sqlite3_backup_init(
67969 sqlite3* pDestDb, /* Database to write to */
67970 const char *zDestDb, /* Name of database within pDestDb */
67971 sqlite3* pSrcDb, /* Database connection to read from */
67972 const char *zSrcDb /* Name of database within pSrcDb */
67973 ){
@@ -68140,11 +68171,11 @@
68171 }
68172
68173 /*
68174 ** Copy nPage pages from the source b-tree to the destination.
68175 */
68176 SQLITE_API int SQLITE_APICALL sqlite3_backup_step(sqlite3_backup *p, int nPage){
68177 int rc;
68178 int destMode; /* Destination journal mode */
68179 int pgszSrc = 0; /* Source page size */
68180 int pgszDest = 0; /* Destination page size */
68181
@@ -68384,11 +68415,11 @@
68415 }
68416
68417 /*
68418 ** Release all resources associated with an sqlite3_backup* handle.
68419 */
68420 SQLITE_API int SQLITE_APICALL sqlite3_backup_finish(sqlite3_backup *p){
68421 sqlite3_backup **pp; /* Ptr to head of pagers backup list */
68422 sqlite3 *pSrcDb; /* Source database connection */
68423 int rc; /* Value to return */
68424
68425 /* Enter the mutexes */
@@ -68436,11 +68467,11 @@
68467
68468 /*
68469 ** Return the number of pages still to be backed up as of the most recent
68470 ** call to sqlite3_backup_step().
68471 */
68472 SQLITE_API int SQLITE_APICALL sqlite3_backup_remaining(sqlite3_backup *p){
68473 #ifdef SQLITE_ENABLE_API_ARMOR
68474 if( p==0 ){
68475 (void)SQLITE_MISUSE_BKPT;
68476 return 0;
68477 }
@@ -68450,11 +68481,11 @@
68481
68482 /*
68483 ** Return the total number of pages in the source database as of the most
68484 ** recent call to sqlite3_backup_step().
68485 */
68486 SQLITE_API int SQLITE_APICALL sqlite3_backup_pagecount(sqlite3_backup *p){
68487 #ifdef SQLITE_ENABLE_API_ARMOR
68488 if( p==0 ){
68489 (void)SQLITE_MISUSE_BKPT;
68490 return 0;
68491 }
@@ -74904,11 +74935,11 @@
74935 ** execution environment changes in a way that would alter the program
74936 ** that sqlite3_prepare() generates. For example, if new functions or
74937 ** collating sequences are registered or if an authorizer function is
74938 ** added or changed.
74939 */
74940 SQLITE_API int SQLITE_APICALL sqlite3_expired(sqlite3_stmt *pStmt){
74941 Vdbe *p = (Vdbe*)pStmt;
74942 return p==0 || p->expired;
74943 }
74944 #endif
74945
@@ -74973,11 +75004,11 @@
75004 ** machine.
75005 **
75006 ** This routine sets the error code and string returned by
75007 ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
75008 */
75009 SQLITE_API int SQLITE_APICALL sqlite3_finalize(sqlite3_stmt *pStmt){
75010 int rc;
75011 if( pStmt==0 ){
75012 /* IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL
75013 ** pointer is a harmless no-op. */
75014 rc = SQLITE_OK;
@@ -75000,11 +75031,11 @@
75031 ** the prior execution is returned.
75032 **
75033 ** This routine sets the error code and string returned by
75034 ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
75035 */
75036 SQLITE_API int SQLITE_APICALL sqlite3_reset(sqlite3_stmt *pStmt){
75037 int rc;
75038 if( pStmt==0 ){
75039 rc = SQLITE_OK;
75040 }else{
75041 Vdbe *v = (Vdbe*)pStmt;
@@ -75021,11 +75052,11 @@
75052 }
75053
75054 /*
75055 ** Set all the parameters in the compiled SQL statement to NULL.
75056 */
75057 SQLITE_API int SQLITE_APICALL sqlite3_clear_bindings(sqlite3_stmt *pStmt){
75058 int i;
75059 int rc = SQLITE_OK;
75060 Vdbe *p = (Vdbe*)pStmt;
75061 #if SQLITE_THREADSAFE
75062 sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex;
@@ -75045,11 +75076,11 @@
75076
75077 /**************************** sqlite3_value_ *******************************
75078 ** The following routines extract information from a Mem or sqlite3_value
75079 ** structure.
75080 */
75081 SQLITE_API const void *SQLITE_APICALL sqlite3_value_blob(sqlite3_value *pVal){
75082 Mem *p = (Mem*)pVal;
75083 if( p->flags & (MEM_Blob|MEM_Str) ){
75084 if( sqlite3VdbeMemExpandBlob(p)!=SQLITE_OK ){
75085 assert( p->flags==MEM_Null && p->z==0 );
75086 return 0;
@@ -75058,48 +75089,48 @@
75089 return p->n ? p->z : 0;
75090 }else{
75091 return sqlite3_value_text(pVal);
75092 }
75093 }
75094 SQLITE_API int SQLITE_APICALL sqlite3_value_bytes(sqlite3_value *pVal){
75095 return sqlite3ValueBytes(pVal, SQLITE_UTF8);
75096 }
75097 SQLITE_API int SQLITE_APICALL sqlite3_value_bytes16(sqlite3_value *pVal){
75098 return sqlite3ValueBytes(pVal, SQLITE_UTF16NATIVE);
75099 }
75100 SQLITE_API double SQLITE_APICALL sqlite3_value_double(sqlite3_value *pVal){
75101 return sqlite3VdbeRealValue((Mem*)pVal);
75102 }
75103 SQLITE_API int SQLITE_APICALL sqlite3_value_int(sqlite3_value *pVal){
75104 return (int)sqlite3VdbeIntValue((Mem*)pVal);
75105 }
75106 SQLITE_API sqlite_int64 SQLITE_APICALL sqlite3_value_int64(sqlite3_value *pVal){
75107 return sqlite3VdbeIntValue((Mem*)pVal);
75108 }
75109 SQLITE_API unsigned int SQLITE_APICALL sqlite3_value_subtype(sqlite3_value *pVal){
75110 Mem *pMem = (Mem*)pVal;
75111 return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0);
75112 }
75113 SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_value_text(sqlite3_value *pVal){
75114 return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
75115 }
75116 #ifndef SQLITE_OMIT_UTF16
75117 SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16(sqlite3_value* pVal){
75118 return sqlite3ValueText(pVal, SQLITE_UTF16NATIVE);
75119 }
75120 SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16be(sqlite3_value *pVal){
75121 return sqlite3ValueText(pVal, SQLITE_UTF16BE);
75122 }
75123 SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16le(sqlite3_value *pVal){
75124 return sqlite3ValueText(pVal, SQLITE_UTF16LE);
75125 }
75126 #endif /* SQLITE_OMIT_UTF16 */
75127 /* EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five
75128 ** fundamental datatypes: 64-bit signed integer 64-bit IEEE floating
75129 ** point number string BLOB NULL
75130 */
75131 SQLITE_API int SQLITE_APICALL sqlite3_value_type(sqlite3_value* pVal){
75132 static const u8 aType[] = {
75133 SQLITE_BLOB, /* 0x00 */
75134 SQLITE_NULL, /* 0x01 */
75135 SQLITE_TEXT, /* 0x02 */
75136 SQLITE_NULL, /* 0x03 */
@@ -75135,11 +75166,11 @@
75166 return aType[pVal->flags&MEM_AffMask];
75167 }
75168
75169 /* Make a copy of an sqlite3_value object
75170 */
75171 SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_value_dup(const sqlite3_value *pOrig){
75172 sqlite3_value *pNew;
75173 if( pOrig==0 ) return 0;
75174 pNew = sqlite3_malloc( sizeof(*pNew) );
75175 if( pNew==0 ) return 0;
75176 memset(pNew, 0, sizeof(*pNew));
@@ -75158,11 +75189,11 @@
75189 }
75190
75191 /* Destroy an sqlite3_value object previously obtained from
75192 ** sqlite3_value_dup().
75193 */
75194 SQLITE_API void SQLITE_APICALL sqlite3_value_free(sqlite3_value *pOld){
75195 sqlite3ValueFree(pOld);
75196 }
75197
75198
75199 /**************************** sqlite3_result_ *******************************
@@ -75201,21 +75232,21 @@
75232 xDel((void*)p);
75233 }
75234 if( pCtx ) sqlite3_result_error_toobig(pCtx);
75235 return SQLITE_TOOBIG;
75236 }
75237 SQLITE_API void SQLITE_APICALL sqlite3_result_blob(
75238 sqlite3_context *pCtx,
75239 const void *z,
75240 int n,
75241 void (*xDel)(void *)
75242 ){
75243 assert( n>=0 );
75244 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75245 setResultStrOrError(pCtx, z, n, 0, xDel);
75246 }
75247 SQLITE_API void SQLITE_APICALL sqlite3_result_blob64(
75248 sqlite3_context *pCtx,
75249 const void *z,
75250 sqlite3_uint64 n,
75251 void (*xDel)(void *)
75252 ){
@@ -75225,56 +75256,56 @@
75256 (void)invokeValueDestructor(z, xDel, pCtx);
75257 }else{
75258 setResultStrOrError(pCtx, z, (int)n, 0, xDel);
75259 }
75260 }
75261 SQLITE_API void SQLITE_APICALL sqlite3_result_double(sqlite3_context *pCtx, double rVal){
75262 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75263 sqlite3VdbeMemSetDouble(pCtx->pOut, rVal);
75264 }
75265 SQLITE_API void SQLITE_APICALL sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
75266 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75267 pCtx->isError = SQLITE_ERROR;
75268 pCtx->fErrorOrAux = 1;
75269 sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF8, SQLITE_TRANSIENT);
75270 }
75271 #ifndef SQLITE_OMIT_UTF16
75272 SQLITE_API void SQLITE_APICALL sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){
75273 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75274 pCtx->isError = SQLITE_ERROR;
75275 pCtx->fErrorOrAux = 1;
75276 sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF16NATIVE, SQLITE_TRANSIENT);
75277 }
75278 #endif
75279 SQLITE_API void SQLITE_APICALL sqlite3_result_int(sqlite3_context *pCtx, int iVal){
75280 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75281 sqlite3VdbeMemSetInt64(pCtx->pOut, (i64)iVal);
75282 }
75283 SQLITE_API void SQLITE_APICALL sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
75284 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75285 sqlite3VdbeMemSetInt64(pCtx->pOut, iVal);
75286 }
75287 SQLITE_API void SQLITE_APICALL sqlite3_result_null(sqlite3_context *pCtx){
75288 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75289 sqlite3VdbeMemSetNull(pCtx->pOut);
75290 }
75291 SQLITE_API void SQLITE_APICALL sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){
75292 Mem *pOut = pCtx->pOut;
75293 assert( sqlite3_mutex_held(pOut->db->mutex) );
75294 pOut->eSubtype = eSubtype & 0xff;
75295 pOut->flags |= MEM_Subtype;
75296 }
75297 SQLITE_API void SQLITE_APICALL sqlite3_result_text(
75298 sqlite3_context *pCtx,
75299 const char *z,
75300 int n,
75301 void (*xDel)(void *)
75302 ){
75303 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75304 setResultStrOrError(pCtx, z, n, SQLITE_UTF8, xDel);
75305 }
75306 SQLITE_API void SQLITE_APICALL sqlite3_result_text64(
75307 sqlite3_context *pCtx,
75308 const char *z,
75309 sqlite3_uint64 n,
75310 void (*xDel)(void *),
75311 unsigned char enc
@@ -75287,56 +75318,56 @@
75318 }else{
75319 setResultStrOrError(pCtx, z, (int)n, enc, xDel);
75320 }
75321 }
75322 #ifndef SQLITE_OMIT_UTF16
75323 SQLITE_API void SQLITE_APICALL sqlite3_result_text16(
75324 sqlite3_context *pCtx,
75325 const void *z,
75326 int n,
75327 void (*xDel)(void *)
75328 ){
75329 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75330 setResultStrOrError(pCtx, z, n, SQLITE_UTF16NATIVE, xDel);
75331 }
75332 SQLITE_API void SQLITE_APICALL sqlite3_result_text16be(
75333 sqlite3_context *pCtx,
75334 const void *z,
75335 int n,
75336 void (*xDel)(void *)
75337 ){
75338 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75339 setResultStrOrError(pCtx, z, n, SQLITE_UTF16BE, xDel);
75340 }
75341 SQLITE_API void SQLITE_APICALL sqlite3_result_text16le(
75342 sqlite3_context *pCtx,
75343 const void *z,
75344 int n,
75345 void (*xDel)(void *)
75346 ){
75347 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75348 setResultStrOrError(pCtx, z, n, SQLITE_UTF16LE, xDel);
75349 }
75350 #endif /* SQLITE_OMIT_UTF16 */
75351 SQLITE_API void SQLITE_APICALL sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){
75352 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75353 sqlite3VdbeMemCopy(pCtx->pOut, pValue);
75354 }
75355 SQLITE_API void SQLITE_APICALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){
75356 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75357 sqlite3VdbeMemSetZeroBlob(pCtx->pOut, n);
75358 }
75359 SQLITE_API int SQLITE_APICALL sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){
75360 Mem *pOut = pCtx->pOut;
75361 assert( sqlite3_mutex_held(pOut->db->mutex) );
75362 if( n>(u64)pOut->db->aLimit[SQLITE_LIMIT_LENGTH] ){
75363 return SQLITE_TOOBIG;
75364 }
75365 sqlite3VdbeMemSetZeroBlob(pCtx->pOut, (int)n);
75366 return SQLITE_OK;
75367 }
75368 SQLITE_API void SQLITE_APICALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){
75369 pCtx->isError = errCode;
75370 pCtx->fErrorOrAux = 1;
75371 #ifdef SQLITE_DEBUG
75372 if( pCtx->pVdbe ) pCtx->pVdbe->rcApp = errCode;
75373 #endif
@@ -75345,20 +75376,20 @@
75376 SQLITE_UTF8, SQLITE_STATIC);
75377 }
75378 }
75379
75380 /* Force an SQLITE_TOOBIG error. */
75381 SQLITE_API void SQLITE_APICALL sqlite3_result_error_toobig(sqlite3_context *pCtx){
75382 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75383 pCtx->isError = SQLITE_TOOBIG;
75384 pCtx->fErrorOrAux = 1;
75385 sqlite3VdbeMemSetStr(pCtx->pOut, "string or blob too big", -1,
75386 SQLITE_UTF8, SQLITE_STATIC);
75387 }
75388
75389 /* An SQLITE_NOMEM error. */
75390 SQLITE_API void SQLITE_APICALL sqlite3_result_error_nomem(sqlite3_context *pCtx){
75391 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75392 sqlite3VdbeMemSetNull(pCtx->pOut);
75393 pCtx->isError = SQLITE_NOMEM_BKPT;
75394 pCtx->fErrorOrAux = 1;
75395 sqlite3OomFault(pCtx->pOut->db);
@@ -75526,11 +75557,11 @@
75557 /*
75558 ** This is the top-level implementation of sqlite3_step(). Call
75559 ** sqlite3Step() to do most of the work. If a schema error occurs,
75560 ** call sqlite3Reprepare() and try again.
75561 */
75562 SQLITE_API int SQLITE_APICALL sqlite3_step(sqlite3_stmt *pStmt){
75563 int rc = SQLITE_OK; /* Result from sqlite3Step() */
75564 int rc2 = SQLITE_OK; /* Result from sqlite3Reprepare() */
75565 Vdbe *v = (Vdbe*)pStmt; /* the prepared statement */
75566 int cnt = 0; /* Counter to prevent infinite loop of reprepares */
75567 sqlite3 *db; /* The database connection */
@@ -75577,11 +75608,11 @@
75608
75609 /*
75610 ** Extract the user data from a sqlite3_context structure and return a
75611 ** pointer to it.
75612 */
75613 SQLITE_API void *SQLITE_APICALL sqlite3_user_data(sqlite3_context *p){
75614 assert( p && p->pFunc );
75615 return p->pFunc->pUserData;
75616 }
75617
75618 /*
@@ -75592,11 +75623,11 @@
75623 ** returns a copy of the pointer to the database connection (the 1st
75624 ** parameter) of the sqlite3_create_function() and
75625 ** sqlite3_create_function16() routines that originally registered the
75626 ** application defined function.
75627 */
75628 SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_context_db_handle(sqlite3_context *p){
75629 assert( p && p->pOut );
75630 return p->pOut->db;
75631 }
75632
75633 /*
@@ -75668,11 +75699,11 @@
75699 /*
75700 ** Allocate or return the aggregate context for a user function. A new
75701 ** context is allocated on the first call. Subsequent calls return the
75702 ** same context that was returned on prior calls.
75703 */
75704 SQLITE_API void *SQLITE_APICALL sqlite3_aggregate_context(sqlite3_context *p, int nByte){
75705 assert( p && p->pFunc && p->pFunc->xFinalize );
75706 assert( sqlite3_mutex_held(p->pOut->db->mutex) );
75707 testcase( nByte<0 );
75708 if( (p->pMem->flags & MEM_Agg)==0 ){
75709 return createAggContext(p, nByte);
@@ -75683,11 +75714,11 @@
75714
75715 /*
75716 ** Return the auxiliary data pointer, if any, for the iArg'th argument to
75717 ** the user-function defined by pCtx.
75718 */
75719 SQLITE_API void *SQLITE_APICALL sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
75720 AuxData *pAuxData;
75721
75722 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
75723 #if SQLITE_ENABLE_STAT3_OR_STAT4
75724 if( pCtx->pVdbe==0 ) return 0;
@@ -75704,11 +75735,11 @@
75735 /*
75736 ** Set the auxiliary data pointer and delete function, for the iArg'th
75737 ** argument to the user-function defined by pCtx. Any previous value is
75738 ** deleted by calling the delete function specified when it was set.
75739 */
75740 SQLITE_API void SQLITE_APICALL sqlite3_set_auxdata(
75741 sqlite3_context *pCtx,
75742 int iArg,
75743 void *pAux,
75744 void (*xDelete)(void*)
75745 ){
@@ -75759,29 +75790,29 @@
75790 ** This function is deprecated. Do not use it for new code. It is
75791 ** provide only to avoid breaking legacy code. New aggregate function
75792 ** implementations should keep their own counts within their aggregate
75793 ** context.
75794 */
75795 SQLITE_API int SQLITE_APICALL sqlite3_aggregate_count(sqlite3_context *p){
75796 assert( p && p->pMem && p->pFunc && p->pFunc->xFinalize );
75797 return p->pMem->n;
75798 }
75799 #endif
75800
75801 /*
75802 ** Return the number of columns in the result set for the statement pStmt.
75803 */
75804 SQLITE_API int SQLITE_APICALL sqlite3_column_count(sqlite3_stmt *pStmt){
75805 Vdbe *pVm = (Vdbe *)pStmt;
75806 return pVm ? pVm->nResColumn : 0;
75807 }
75808
75809 /*
75810 ** Return the number of values available from the current row of the
75811 ** currently executing statement pStmt.
75812 */
75813 SQLITE_API int SQLITE_APICALL sqlite3_data_count(sqlite3_stmt *pStmt){
75814 Vdbe *pVm = (Vdbe *)pStmt;
75815 if( pVm==0 || pVm->pResultSet==0 ) return 0;
75816 return pVm->nResColumn;
75817 }
75818
@@ -75880,67 +75911,67 @@
75911
75912 /**************************** sqlite3_column_ *******************************
75913 ** The following routines are used to access elements of the current row
75914 ** in the result set.
75915 */
75916 SQLITE_API const void *SQLITE_APICALL sqlite3_column_blob(sqlite3_stmt *pStmt, int i){
75917 const void *val;
75918 val = sqlite3_value_blob( columnMem(pStmt,i) );
75919 /* Even though there is no encoding conversion, value_blob() might
75920 ** need to call malloc() to expand the result of a zeroblob()
75921 ** expression.
75922 */
75923 columnMallocFailure(pStmt);
75924 return val;
75925 }
75926 SQLITE_API int SQLITE_APICALL sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){
75927 int val = sqlite3_value_bytes( columnMem(pStmt,i) );
75928 columnMallocFailure(pStmt);
75929 return val;
75930 }
75931 SQLITE_API int SQLITE_APICALL sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){
75932 int val = sqlite3_value_bytes16( columnMem(pStmt,i) );
75933 columnMallocFailure(pStmt);
75934 return val;
75935 }
75936 SQLITE_API double SQLITE_APICALL sqlite3_column_double(sqlite3_stmt *pStmt, int i){
75937 double val = sqlite3_value_double( columnMem(pStmt,i) );
75938 columnMallocFailure(pStmt);
75939 return val;
75940 }
75941 SQLITE_API int SQLITE_APICALL sqlite3_column_int(sqlite3_stmt *pStmt, int i){
75942 int val = sqlite3_value_int( columnMem(pStmt,i) );
75943 columnMallocFailure(pStmt);
75944 return val;
75945 }
75946 SQLITE_API sqlite_int64 SQLITE_APICALL sqlite3_column_int64(sqlite3_stmt *pStmt, int i){
75947 sqlite_int64 val = sqlite3_value_int64( columnMem(pStmt,i) );
75948 columnMallocFailure(pStmt);
75949 return val;
75950 }
75951 SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_column_text(sqlite3_stmt *pStmt, int i){
75952 const unsigned char *val = sqlite3_value_text( columnMem(pStmt,i) );
75953 columnMallocFailure(pStmt);
75954 return val;
75955 }
75956 SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_column_value(sqlite3_stmt *pStmt, int i){
75957 Mem *pOut = columnMem(pStmt, i);
75958 if( pOut->flags&MEM_Static ){
75959 pOut->flags &= ~MEM_Static;
75960 pOut->flags |= MEM_Ephem;
75961 }
75962 columnMallocFailure(pStmt);
75963 return (sqlite3_value *)pOut;
75964 }
75965 #ifndef SQLITE_OMIT_UTF16
75966 SQLITE_API const void *SQLITE_APICALL sqlite3_column_text16(sqlite3_stmt *pStmt, int i){
75967 const void *val = sqlite3_value_text16( columnMem(pStmt,i) );
75968 columnMallocFailure(pStmt);
75969 return val;
75970 }
75971 #endif /* SQLITE_OMIT_UTF16 */
75972 SQLITE_API int SQLITE_APICALL sqlite3_column_type(sqlite3_stmt *pStmt, int i){
75973 int iType = sqlite3_value_type( columnMem(pStmt,i) );
75974 columnMallocFailure(pStmt);
75975 return iType;
75976 }
75977
@@ -76000,16 +76031,16 @@
76031
76032 /*
76033 ** Return the name of the Nth column of the result set returned by SQL
76034 ** statement pStmt.
76035 */
76036 SQLITE_API const char *SQLITE_APICALL sqlite3_column_name(sqlite3_stmt *pStmt, int N){
76037 return columnName(
76038 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_NAME);
76039 }
76040 #ifndef SQLITE_OMIT_UTF16
76041 SQLITE_API const void *SQLITE_APICALL sqlite3_column_name16(sqlite3_stmt *pStmt, int N){
76042 return columnName(
76043 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_NAME);
76044 }
76045 #endif
76046
@@ -76025,16 +76056,16 @@
76056 #ifndef SQLITE_OMIT_DECLTYPE
76057 /*
76058 ** Return the column declaration type (if applicable) of the 'i'th column
76059 ** of the result set of SQL statement pStmt.
76060 */
76061 SQLITE_API const char *SQLITE_APICALL sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){
76062 return columnName(
76063 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DECLTYPE);
76064 }
76065 #ifndef SQLITE_OMIT_UTF16
76066 SQLITE_API const void *SQLITE_APICALL sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){
76067 return columnName(
76068 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DECLTYPE);
76069 }
76070 #endif /* SQLITE_OMIT_UTF16 */
76071 #endif /* SQLITE_OMIT_DECLTYPE */
@@ -76043,16 +76074,16 @@
76074 /*
76075 ** Return the name of the database from which a result column derives.
76076 ** NULL is returned if the result column is an expression or constant or
76077 ** anything else which is not an unambiguous reference to a database column.
76078 */
76079 SQLITE_API const char *SQLITE_APICALL sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){
76080 return columnName(
76081 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DATABASE);
76082 }
76083 #ifndef SQLITE_OMIT_UTF16
76084 SQLITE_API const void *SQLITE_APICALL sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){
76085 return columnName(
76086 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DATABASE);
76087 }
76088 #endif /* SQLITE_OMIT_UTF16 */
76089
@@ -76059,16 +76090,16 @@
76090 /*
76091 ** Return the name of the table from which a result column derives.
76092 ** NULL is returned if the result column is an expression or constant or
76093 ** anything else which is not an unambiguous reference to a database column.
76094 */
76095 SQLITE_API const char *SQLITE_APICALL sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){
76096 return columnName(
76097 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_TABLE);
76098 }
76099 #ifndef SQLITE_OMIT_UTF16
76100 SQLITE_API const void *SQLITE_APICALL sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){
76101 return columnName(
76102 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_TABLE);
76103 }
76104 #endif /* SQLITE_OMIT_UTF16 */
76105
@@ -76075,16 +76106,16 @@
76106 /*
76107 ** Return the name of the table column from which a result column derives.
76108 ** NULL is returned if the result column is an expression or constant or
76109 ** anything else which is not an unambiguous reference to a database column.
76110 */
76111 SQLITE_API const char *SQLITE_APICALL sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){
76112 return columnName(
76113 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_COLUMN);
76114 }
76115 #ifndef SQLITE_OMIT_UTF16
76116 SQLITE_API const void *SQLITE_APICALL sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){
76117 return columnName(
76118 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_COLUMN);
76119 }
76120 #endif /* SQLITE_OMIT_UTF16 */
76121 #endif /* SQLITE_ENABLE_COLUMN_METADATA */
@@ -76181,11 +76212,11 @@
76212
76213
76214 /*
76215 ** Bind a blob value to an SQL statement variable.
76216 */
76217 SQLITE_API int SQLITE_APICALL sqlite3_bind_blob(
76218 sqlite3_stmt *pStmt,
76219 int i,
76220 const void *zData,
76221 int nData,
76222 void (*xDel)(void*)
@@ -76193,11 +76224,11 @@
76224 #ifdef SQLITE_ENABLE_API_ARMOR
76225 if( nData<0 ) return SQLITE_MISUSE_BKPT;
76226 #endif
76227 return bindText(pStmt, i, zData, nData, xDel, 0);
76228 }
76229 SQLITE_API int SQLITE_APICALL sqlite3_bind_blob64(
76230 sqlite3_stmt *pStmt,
76231 int i,
76232 const void *zData,
76233 sqlite3_uint64 nData,
76234 void (*xDel)(void*)
@@ -76207,52 +76238,52 @@
76238 return invokeValueDestructor(zData, xDel, 0);
76239 }else{
76240 return bindText(pStmt, i, zData, (int)nData, xDel, 0);
76241 }
76242 }
76243 SQLITE_API int SQLITE_APICALL sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
76244 int rc;
76245 Vdbe *p = (Vdbe *)pStmt;
76246 rc = vdbeUnbind(p, i);
76247 if( rc==SQLITE_OK ){
76248 sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue);
76249 sqlite3_mutex_leave(p->db->mutex);
76250 }
76251 return rc;
76252 }
76253 SQLITE_API int SQLITE_APICALL sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){
76254 return sqlite3_bind_int64(p, i, (i64)iValue);
76255 }
76256 SQLITE_API int SQLITE_APICALL sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
76257 int rc;
76258 Vdbe *p = (Vdbe *)pStmt;
76259 rc = vdbeUnbind(p, i);
76260 if( rc==SQLITE_OK ){
76261 sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue);
76262 sqlite3_mutex_leave(p->db->mutex);
76263 }
76264 return rc;
76265 }
76266 SQLITE_API int SQLITE_APICALL sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
76267 int rc;
76268 Vdbe *p = (Vdbe*)pStmt;
76269 rc = vdbeUnbind(p, i);
76270 if( rc==SQLITE_OK ){
76271 sqlite3_mutex_leave(p->db->mutex);
76272 }
76273 return rc;
76274 }
76275 SQLITE_API int SQLITE_APICALL sqlite3_bind_text(
76276 sqlite3_stmt *pStmt,
76277 int i,
76278 const char *zData,
76279 int nData,
76280 void (*xDel)(void*)
76281 ){
76282 return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8);
76283 }
76284 SQLITE_API int SQLITE_APICALL sqlite3_bind_text64(
76285 sqlite3_stmt *pStmt,
76286 int i,
76287 const char *zData,
76288 sqlite3_uint64 nData,
76289 void (*xDel)(void*),
@@ -76265,21 +76296,21 @@
76296 if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE;
76297 return bindText(pStmt, i, zData, (int)nData, xDel, enc);
76298 }
76299 }
76300 #ifndef SQLITE_OMIT_UTF16
76301 SQLITE_API int SQLITE_APICALL sqlite3_bind_text16(
76302 sqlite3_stmt *pStmt,
76303 int i,
76304 const void *zData,
76305 int nData,
76306 void (*xDel)(void*)
76307 ){
76308 return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE);
76309 }
76310 #endif /* SQLITE_OMIT_UTF16 */
76311 SQLITE_API int SQLITE_APICALL sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
76312 int rc;
76313 switch( sqlite3_value_type((sqlite3_value*)pValue) ){
76314 case SQLITE_INTEGER: {
76315 rc = sqlite3_bind_int64(pStmt, i, pValue->u.i);
76316 break;
@@ -76306,21 +76337,21 @@
76337 break;
76338 }
76339 }
76340 return rc;
76341 }
76342 SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
76343 int rc;
76344 Vdbe *p = (Vdbe *)pStmt;
76345 rc = vdbeUnbind(p, i);
76346 if( rc==SQLITE_OK ){
76347 sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n);
76348 sqlite3_mutex_leave(p->db->mutex);
76349 }
76350 return rc;
76351 }
76352 SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){
76353 int rc;
76354 Vdbe *p = (Vdbe *)pStmt;
76355 sqlite3_mutex_enter(p->db->mutex);
76356 if( n>(u64)p->db->aLimit[SQLITE_LIMIT_LENGTH] ){
76357 rc = SQLITE_TOOBIG;
@@ -76335,11 +76366,11 @@
76366
76367 /*
76368 ** Return the number of wildcards that can be potentially bound to.
76369 ** This routine is added to support DBD::SQLite.
76370 */
76371 SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
76372 Vdbe *p = (Vdbe*)pStmt;
76373 return p ? p->nVar : 0;
76374 }
76375
76376 /*
@@ -76346,11 +76377,11 @@
76377 ** Return the name of a wildcard parameter. Return NULL if the index
76378 ** is out of range or if the wildcard is unnamed.
76379 **
76380 ** The result is always UTF-8.
76381 */
76382 SQLITE_API const char *SQLITE_APICALL sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){
76383 Vdbe *p = (Vdbe*)pStmt;
76384 if( p==0 || i<1 || i>p->nzVar ){
76385 return 0;
76386 }
76387 return p->azVar[i-1];
@@ -76374,11 +76405,11 @@
76405 }
76406 }
76407 }
76408 return 0;
76409 }
76410 SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
76411 return sqlite3VdbeParameterIndex((Vdbe*)pStmt, zName, sqlite3Strlen30(zName));
76412 }
76413
76414 /*
76415 ** Transfer all bindings from the first statement over to the second.
@@ -76408,11 +76439,11 @@
76439 **
76440 ** If the two statements contain a different number of bindings, then
76441 ** an SQLITE_ERROR is returned. Nothing else can go wrong, so otherwise
76442 ** SQLITE_OK is returned.
76443 */
76444 SQLITE_API int SQLITE_APICALL sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
76445 Vdbe *pFrom = (Vdbe*)pFromStmt;
76446 Vdbe *pTo = (Vdbe*)pToStmt;
76447 if( pFrom->nVar!=pTo->nVar ){
76448 return SQLITE_ERROR;
76449 }
@@ -76430,26 +76461,26 @@
76461 ** Return the sqlite3* database handle to which the prepared statement given
76462 ** in the argument belongs. This is the same database handle that was
76463 ** the first argument to the sqlite3_prepare() that was used to create
76464 ** the statement in the first place.
76465 */
76466 SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_db_handle(sqlite3_stmt *pStmt){
76467 return pStmt ? ((Vdbe*)pStmt)->db : 0;
76468 }
76469
76470 /*
76471 ** Return true if the prepared statement is guaranteed to not modify the
76472 ** database.
76473 */
76474 SQLITE_API int SQLITE_APICALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt){
76475 return pStmt ? ((Vdbe*)pStmt)->readOnly : 1;
76476 }
76477
76478 /*
76479 ** Return true if the prepared statement is in need of being reset.
76480 */
76481 SQLITE_API int SQLITE_APICALL sqlite3_stmt_busy(sqlite3_stmt *pStmt){
76482 Vdbe *v = (Vdbe*)pStmt;
76483 return v!=0 && v->pc>=0 && v->magic==VDBE_MAGIC_RUN;
76484 }
76485
76486 /*
@@ -76456,11 +76487,11 @@
76487 ** Return a pointer to the next prepared statement after pStmt associated
76488 ** with database connection pDb. If pStmt is NULL, return the first
76489 ** prepared statement for the database connection. Return NULL if there
76490 ** are no more.
76491 */
76492 SQLITE_API sqlite3_stmt *SQLITE_APICALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){
76493 sqlite3_stmt *pNext;
76494 #ifdef SQLITE_ENABLE_API_ARMOR
76495 if( !sqlite3SafetyCheckOk(pDb) ){
76496 (void)SQLITE_MISUSE_BKPT;
76497 return 0;
@@ -76477,11 +76508,11 @@
76508 }
76509
76510 /*
76511 ** Return the value of a status counter for a prepared statement
76512 */
76513 SQLITE_API int SQLITE_APICALL sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){
76514 Vdbe *pVdbe = (Vdbe*)pStmt;
76515 u32 v;
76516 #ifdef SQLITE_ENABLE_API_ARMOR
76517 if( !pStmt ){
76518 (void)SQLITE_MISUSE_BKPT;
@@ -76494,11 +76525,11 @@
76525 }
76526
76527 /*
76528 ** Return the SQL associated with a prepared statement
76529 */
76530 SQLITE_API const char *SQLITE_APICALL sqlite3_sql(sqlite3_stmt *pStmt){
76531 Vdbe *p = (Vdbe *)pStmt;
76532 return p ? p->zSql : 0;
76533 }
76534
76535 /*
@@ -76508,11 +76539,11 @@
76539 ** freeing the returned string by passing it to sqlite3_free().
76540 **
76541 ** The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of
76542 ** expanded bound parameters.
76543 */
76544 SQLITE_API char *SQLITE_APICALL sqlite3_expanded_sql(sqlite3_stmt *pStmt){
76545 #ifdef SQLITE_OMIT_TRACE
76546 return 0;
76547 #else
76548 char *z = 0;
76549 const char *zSql = sqlite3_sql(pStmt);
@@ -76550,11 +76581,11 @@
76581
76582 /*
76583 ** This function is called from within a pre-update callback to retrieve
76584 ** a field of the row currently being updated or deleted.
76585 */
76586 SQLITE_API int SQLITE_APICALL sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
76587 PreUpdate *p = db->pPreUpdate;
76588 int rc = SQLITE_OK;
76589
76590 /* Test that this call is being made from within an SQLITE_DELETE or
76591 ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */
@@ -76605,11 +76636,11 @@
76636 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
76637 /*
76638 ** This function is called from within a pre-update callback to retrieve
76639 ** the number of columns in the row being updated, deleted or inserted.
76640 */
76641 SQLITE_API int SQLITE_APICALL sqlite3_preupdate_count(sqlite3 *db){
76642 PreUpdate *p = db->pPreUpdate;
76643 return (p ? p->keyinfo.nField : 0);
76644 }
76645 #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
76646
@@ -76623,11 +76654,11 @@
76654 ** top-level trigger etc.).
76655 **
76656 ** For the purposes of the previous paragraph, a foreign key CASCADE, SET NULL
76657 ** or SET DEFAULT action is considered a trigger.
76658 */
76659 SQLITE_API int SQLITE_APICALL sqlite3_preupdate_depth(sqlite3 *db){
76660 PreUpdate *p = db->pPreUpdate;
76661 return (p ? p->v->nFrame : 0);
76662 }
76663 #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
76664
@@ -76634,11 +76665,11 @@
76665 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
76666 /*
76667 ** This function is called from within a pre-update callback to retrieve
76668 ** a field of the row currently being updated or inserted.
76669 */
76670 SQLITE_API int SQLITE_APICALL sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
76671 PreUpdate *p = db->pPreUpdate;
76672 int rc = SQLITE_OK;
76673 Mem *pMem;
76674
76675 if( !p || p->op==SQLITE_DELETE ){
@@ -76708,11 +76739,11 @@
76739
76740 #ifdef SQLITE_ENABLE_STMT_SCANSTATUS
76741 /*
76742 ** Return status data for a single loop within query pStmt.
76743 */
76744 SQLITE_API int SQLITE_APICALL sqlite3_stmt_scanstatus(
76745 sqlite3_stmt *pStmt, /* Prepared statement being queried */
76746 int idx, /* Index of loop to report on */
76747 int iScanStatusOp, /* Which metric to return */
76748 void *pOut /* OUT: Write the answer here */
76749 ){
@@ -76767,11 +76798,11 @@
76798 }
76799
76800 /*
76801 ** Zero all counters associated with the sqlite3_stmt_scanstatus() data.
76802 */
76803 SQLITE_API void SQLITE_APICALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){
76804 Vdbe *p = (Vdbe*)pStmt;
76805 memset(p->anExec, 0, p->nOp * sizeof(i64));
76806 }
76807 #endif /* SQLITE_ENABLE_STMT_SCANSTATUS */
76808
@@ -77294,11 +77325,11 @@
77325 ** Try to convert the type of a function argument or a result column
77326 ** into a numeric representation. Use either INTEGER or REAL whichever
77327 ** is appropriate. But only do the conversion if it is possible without
77328 ** loss of information and return the revised type of the argument.
77329 */
77330 SQLITE_API int SQLITE_APICALL sqlite3_value_numeric_type(sqlite3_value *pVal){
77331 int eType = sqlite3_value_type(pVal);
77332 if( eType==SQLITE_TEXT ){
77333 Mem *pMem = (Mem*)pVal;
77334 applyNumericAffinity(pMem, 0);
77335 eType = sqlite3_value_type(pVal);
@@ -84146,11 +84177,11 @@
84177 }
84178
84179 /*
84180 ** Open a blob handle.
84181 */
84182 SQLITE_API int SQLITE_APICALL sqlite3_blob_open(
84183 sqlite3* db, /* The database connection */
84184 const char *zDb, /* The attached database containing the blob */
84185 const char *zTable, /* The table containing the blob */
84186 const char *zColumn, /* The column containing the blob */
84187 sqlite_int64 iRow, /* The row containing the glob */
@@ -84387,11 +84418,11 @@
84418
84419 /*
84420 ** Close a blob handle that was previously created using
84421 ** sqlite3_blob_open().
84422 */
84423 SQLITE_API int SQLITE_APICALL sqlite3_blob_close(sqlite3_blob *pBlob){
84424 Incrblob *p = (Incrblob *)pBlob;
84425 int rc;
84426 sqlite3 *db;
84427
84428 if( p ){
@@ -84480,28 +84511,28 @@
84511 }
84512
84513 /*
84514 ** Read data from a blob handle.
84515 */
84516 SQLITE_API int SQLITE_APICALL sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){
84517 return blobReadWrite(pBlob, z, n, iOffset, sqlite3BtreeData);
84518 }
84519
84520 /*
84521 ** Write data to a blob handle.
84522 */
84523 SQLITE_API int SQLITE_APICALL sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){
84524 return blobReadWrite(pBlob, (void *)z, n, iOffset, sqlite3BtreePutData);
84525 }
84526
84527 /*
84528 ** Query a blob handle for the size of the data.
84529 **
84530 ** The Incrblob.nByte field is fixed for the lifetime of the Incrblob
84531 ** so no mutex is required for access.
84532 */
84533 SQLITE_API int SQLITE_APICALL sqlite3_blob_bytes(sqlite3_blob *pBlob){
84534 Incrblob *p = (Incrblob *)pBlob;
84535 return (p && p->pStmt) ? p->nByte : 0;
84536 }
84537
84538 /*
@@ -84512,11 +84543,11 @@
84543 ** contain a blob or text value, then an error code is returned and the
84544 ** database handle error code and message set. If this happens, then all
84545 ** subsequent calls to sqlite3_blob_xxx() functions (except blob_close())
84546 ** immediately return SQLITE_ABORT.
84547 */
84548 SQLITE_API int SQLITE_APICALL sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){
84549 int rc;
84550 Incrblob *p = (Incrblob *)pBlob;
84551 sqlite3 *db;
84552
84553 if( p==0 ) return SQLITE_MISUSE_BKPT;
@@ -93355,10 +93386,65 @@
93386 ){
93387 return 1;
93388 }
93389 return 0;
93390 }
93391
93392 /*
93393 ** An instance of the following structure is used by the tree walker
93394 ** to determine if an expression can be evaluated by reference to the
93395 ** index only, without having to do a search for the corresponding
93396 ** table entry. The IdxCover.pIdx field is the index. IdxCover.iCur
93397 ** is the cursor for the table.
93398 */
93399 struct IdxCover {
93400 Index *pIdx; /* The index to be tested for coverage */
93401 int iCur; /* Cursor number for the table corresponding to the index */
93402 };
93403
93404 /*
93405 ** Check to see if there are references to columns in table
93406 ** pWalker->u.pIdxCover->iCur can be satisfied using the index
93407 ** pWalker->u.pIdxCover->pIdx.
93408 */
93409 static int exprIdxCover(Walker *pWalker, Expr *pExpr){
93410 if( pExpr->op==TK_COLUMN
93411 && pExpr->iTable==pWalker->u.pIdxCover->iCur
93412 && sqlite3ColumnOfIndex(pWalker->u.pIdxCover->pIdx, pExpr->iColumn)<0
93413 ){
93414 pWalker->eCode = 1;
93415 return WRC_Abort;
93416 }
93417 return WRC_Continue;
93418 }
93419
93420 /*
93421 ** Determine if an index pIdx on table with cursor iCur contains will
93422 ** the expression pExpr. Return true if the index does cover the
93423 ** expression and false if the pExpr expression references table columns
93424 ** that are not found in the index pIdx.
93425 **
93426 ** An index covering an expression means that the expression can be
93427 ** evaluated using only the index and without having to lookup the
93428 ** corresponding table entry.
93429 */
93430 SQLITE_PRIVATE int sqlite3ExprCoveredByIndex(
93431 Expr *pExpr, /* The index to be tested */
93432 int iCur, /* The cursor number for the corresponding table */
93433 Index *pIdx /* The index that might be used for coverage */
93434 ){
93435 Walker w;
93436 struct IdxCover xcov;
93437 memset(&w, 0, sizeof(w));
93438 xcov.iCur = iCur;
93439 xcov.pIdx = pIdx;
93440 w.xExprCallback = exprIdxCover;
93441 w.u.pIdxCover = &xcov;
93442 sqlite3WalkExpr(&w, pExpr);
93443 return !w.eCode;
93444 }
93445
93446
93447 /*
93448 ** An instance of the following structure is used by the tree walker
93449 ** to count references to table columns in the arguments of an
93450 ** aggregate function, in order to implement the
@@ -97061,11 +97147,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
@@ -97105,10 +97191,11 @@
97191 ){
97192 sqlite3 *db = pParse->db; /* Database handle */
97193 char *zDb = db->aDb[iDb].zName; /* Name of attached database */
97194 int rc; /* Auth callback return code */
97195
97196 if( db->init.busy ) return SQLITE_OK;
97197 rc = db->xAuth(db->pAuthArg, SQLITE_READ, zTab,zCol,zDb,pParse->zAuthContext
97198 #ifdef SQLITE_USER_AUTHENTICATION
97199 ,db->auth.zAuthUser
97200 #endif
97201 );
@@ -103823,18 +103910,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
@@ -108526,11 +108613,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 */
@@ -108685,12 +108772,10 @@
108772 */
108773 #ifndef SQLITE3EXT_H
108774 #define SQLITE3EXT_H
108775 /* #include "sqlite3.h" */
108776
 
 
108777 /*
108778 ** The following structure holds pointers to all of the SQLite API
108779 ** routines.
108780 **
108781 ** WARNING: In order to maintain backwards compatibility, add new
@@ -108951,10 +109036,20 @@
109036 int (*system_errno)(sqlite3*);
109037 /* Version 3.14.0 and later */
109038 int (*trace_v2)(sqlite3*,unsigned,int(*)(unsigned,void*,void*,void*),void*);
109039 char *(*expanded_sql)(sqlite3_stmt*);
109040 };
109041
109042 /*
109043 ** This is the function signature used for all extension entry points. It
109044 ** is also defined in the file "loadext.c".
109045 */
109046 typedef int (*sqlite3_loadext_entry)(
109047 sqlite3 *db, /* Handle to the database. */
109048 char **pzErrMsg, /* Used to set error string on failure. */
109049 const sqlite3_api_routines *pThunk /* Extension API function pointers. */
109050 );
109051
109052 /*
109053 ** The following macros redefine the API routines so that they are
109054 ** redirected through the global sqlite3_api structure.
109055 **
@@ -109223,11 +109318,10 @@
109318 /************** Continuing where we left off in loadext.c ********************/
109319 /* #include "sqliteInt.h" */
109320 /* #include <string.h> */
109321
109322 #ifndef SQLITE_OMIT_LOAD_EXTENSION
 
109323 /*
109324 ** Some API routines are omitted when various features are
109325 ** excluded from a build of SQLite. Substitute a NULL pointer
109326 ** for any missing APIs.
109327 */
@@ -109312,10 +109406,14 @@
109406 #define sqlite3_blob_open 0
109407 #define sqlite3_blob_read 0
109408 #define sqlite3_blob_write 0
109409 #define sqlite3_blob_reopen 0
109410 #endif
109411
109412 #if defined(SQLITE_OMIT_TRACE)
109413 # define sqlite3_trace_v2 0
109414 #endif
109415
109416 /*
109417 ** The following structure contains pointers to all SQLite API routines.
109418 ** A pointer to this structure is passed into extensions when they are
109419 ** loaded so that the extension can make calls back into the SQLite
@@ -109618,11 +109716,14 @@
109716 /* Version 3.10.0 and later */
109717 sqlite3_status64,
109718 sqlite3_strlike,
109719 sqlite3_db_cacheflush,
109720 /* Version 3.12.0 and later */
109721 sqlite3_system_errno,
109722 /* Version 3.14.0 and later */
109723 sqlite3_trace_v2,
109724 sqlite3_expanded_sql
109725 };
109726
109727 /*
109728 ** Attempt to load an SQLite extension library contained in the file
109729 ** zFile. The entry point is zProc. zProc may be 0 in which case a
@@ -109641,11 +109742,11 @@
109742 const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */
109743 char **pzErrMsg /* Put error message here if not 0 */
109744 ){
109745 sqlite3_vfs *pVfs = db->pVfs;
109746 void *handle;
109747 sqlite3_loadext_entry xInit;
109748 char *zErrmsg = 0;
109749 const char *zEntry;
109750 char *zAltEntry = 0;
109751 void **aHandle;
109752 u64 nMsg = 300 + sqlite3Strlen30(zFile);
@@ -109700,12 +109801,11 @@
109801 sqlite3OsDlError(pVfs, nMsg-1, zErrmsg);
109802 }
109803 }
109804 return SQLITE_ERROR;
109805 }
109806 xInit = (sqlite3_loadext_entry)sqlite3OsDlSym(pVfs, handle, zEntry);
 
109807
109808 /* If no entry point was specified and the default legacy
109809 ** entry point name "sqlite3_extension_init" was not found, then
109810 ** construct an entry point name "sqlite3_X_init" where the X is
109811 ** replaced by the lowercase value of every ASCII alphabetic
@@ -109733,12 +109833,11 @@
109833 zAltEntry[iEntry++] = (char)sqlite3UpperToLower[(unsigned)c];
109834 }
109835 }
109836 memcpy(zAltEntry+iEntry, "_init", 6);
109837 zEntry = zAltEntry;
109838 xInit = (sqlite3_loadext_entry)sqlite3OsDlSym(pVfs, handle, zEntry);
 
109839 }
109840 if( xInit==0 ){
109841 if( pzErrMsg ){
109842 nMsg += sqlite3Strlen30(zEntry);
109843 *pzErrMsg = zErrmsg = sqlite3_malloc64(nMsg);
@@ -109776,11 +109875,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 ){
@@ -109807,11 +109906,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);
@@ -109864,11 +109963,13 @@
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();
109974 if( rc ){
109975 return rc;
@@ -109909,11 +110010,13 @@
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
110021 int i;
110022 int n = 0;
@@ -109932,11 +110035,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
@@ -109958,11 +110061,11 @@
110061 */
110062 SQLITE_PRIVATE void sqlite3AutoLoadExtensions(sqlite3 *db){
110063 u32 i;
110064 int go = 1;
110065 int rc;
110066 sqlite3_loadext_entry xInit;
110067
110068 wsdAutoextInit;
110069 if( wsdAutoext.nExt==0 ){
110070 /* Common case: early out without every having to acquire a mutex */
110071 return;
@@ -109975,12 +110078,11 @@
110078 sqlite3_mutex_enter(mutex);
110079 if( i>=wsdAutoext.nExt ){
110080 xInit = 0;
110081 go = 0;
110082 }else{
110083 xInit = (sqlite3_loadext_entry)wsdAutoext.aExt[i];
 
110084 }
110085 sqlite3_mutex_leave(mutex);
110086 zErrmsg = 0;
110087 if( xInit && (rc = xInit(db, &zErrmsg, &sqlite3Apis))!=0 ){
110088 sqlite3ErrorWithMsg(db, rc,
@@ -113194,11 +113296,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 */
@@ -113206,11 +113308,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 */
@@ -113282,11 +113384,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 */
@@ -113294,11 +113396,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 */
@@ -119137,11 +119239,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 */
@@ -119206,11 +119308,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--;
@@ -121357,10 +121459,12 @@
121459 sqlite3CodecGetKey(db, 0, (void**)&zKey, &nKey);
121460 if( nKey ) db->nextPagesize = 0;
121461 }
121462 #endif
121463
121464 sqlite3BtreeSetCacheSize(pTemp, db->aDb[0].pSchema->cache_size);
121465 sqlite3BtreeSetSpillSize(pTemp, sqlite3BtreeSetSpillSize(pMain,0));
121466 rc = execSql(db, pzErrMsg, "PRAGMA vacuum_db.synchronous=OFF");
121467 if( rc!=SQLITE_OK ) goto end_of_vacuum;
121468
121469 /* Begin a transaction and take an exclusive lock on the main database
121470 ** file. This is done before the sqlite3BtreeGetPageSize(pMain) call below,
@@ -121614,11 +121718,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 ){
@@ -121629,11 +121733,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 */
@@ -122253,11 +122357,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;
@@ -122707,11 +122811,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;
@@ -124633,10 +124737,11 @@
124737 zStartAff[nEq] = SQLITE_AFF_BLOB;
124738 }
124739 }
124740 nConstraint++;
124741 testcase( pRangeStart->wtFlags & TERM_VIRTUAL );
124742 bSeekPastNull = 0;
124743 }else if( bSeekPastNull ){
124744 sqlite3VdbeAddOp2(v, OP_Null, 0, regBase+nEq);
124745 nConstraint++;
124746 startEq = 0;
124747 start_constraints = 1;
@@ -129300,15 +129405,38 @@
129405 ){
129406 pNew->iSortIdx = b ? iSortIdx : 0;
129407
129408 /* The cost of visiting the index rows is N*K, where K is
129409 ** between 1.1 and 3.0, depending on the relative sizes of the
129410 ** index and table rows. */
 
129411 pNew->rRun = rSize + 1 + (15*pProbe->szIdxRow)/pTab->szTabRow;
129412 if( m!=0 ){
129413 /* If this is a non-covering index scan, add in the cost of
129414 ** doing table lookups. The cost will be 3x the number of
129415 ** lookups. Take into account WHERE clause terms that can be
129416 ** satisfied using just the index, and that do not require a
129417 ** table lookup. */
129418 LogEst nLookup = rSize + 16; /* Base cost: N*3 */
129419 int ii;
129420 int iCur = pSrc->iCursor;
129421 WhereClause *pWC2 = &pWInfo->sWC;
129422 for(ii=0; ii<pWC2->nTerm; ii++){
129423 WhereTerm *pTerm = &pWC2->a[ii];
129424 if( !sqlite3ExprCoveredByIndex(pTerm->pExpr, iCur, pProbe) ){
129425 break;
129426 }
129427 /* pTerm can be evaluated using just the index. So reduce
129428 ** the expected number of table lookups accordingly */
129429 if( pTerm->truthProb<=0 ){
129430 nLookup += pTerm->truthProb;
129431 }else{
129432 nLookup--;
129433 if( pTerm->eOperator & (WO_EQ|WO_IS) ) nLookup -= 19;
129434 }
129435 }
129436
129437 pNew->rRun = sqlite3LogEstAdd(pNew->rRun, nLookup);
129438 }
129439 ApplyCostMultiplier(pNew->rRun, pTab->costMult);
129440 whereLoopOutputAdjust(pWC, pNew, rSize);
129441 rc = whereLoopInsert(pBuilder, pNew);
129442 pNew->nOut = rSize;
@@ -130474,11 +130602,11 @@
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;
130612 pWInfo->revMask = m;
@@ -136008,11 +136136,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
@@ -136173,11 +136301,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
@@ -136333,28 +136461,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.
@@ -136423,11 +136551,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
@@ -136589,11 +136717,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 }
@@ -137008,11 +137136,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 }
@@ -137022,11 +137150,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
@@ -137046,11 +137174,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
@@ -137196,11 +137324,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 }
@@ -137209,11 +137337,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 }
@@ -137222,11 +137350,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 }
@@ -137373,12 +137501,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 **
@@ -137781,11 +137909,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
@@ -137804,11 +137932,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 ){
@@ -137835,11 +137963,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);
@@ -137851,11 +137979,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 }
@@ -137967,11 +138095,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,
@@ -137981,11 +138109,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,
@@ -138024,11 +138152,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,
@@ -138064,11 +138192,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;
@@ -138096,11 +138224,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;
@@ -138117,11 +138245,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 ){
@@ -138145,11 +138273,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;
@@ -138173,11 +138301,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;
@@ -138198,11 +138326,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;
@@ -138223,11 +138351,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;
@@ -138249,11 +138377,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 ){
@@ -138298,11 +138426,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
@@ -138319,11 +138447,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
@@ -138346,11 +138474,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 */
@@ -138401,11 +138529,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
@@ -138492,11 +138620,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) ){
@@ -138520,11 +138648,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', ' ',
@@ -138565,38 +138693,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
@@ -138740,11 +138868,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;
@@ -139364,18 +139492,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 ){
@@ -139384,11 +139512,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;
@@ -139423,11 +139551,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*)
@@ -139436,11 +139564,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*),
@@ -139461,11 +139589,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*)
@@ -139491,11 +139619,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
@@ -139512,11 +139640,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
@@ -139534,11 +139662,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 /*
@@ -139545,11 +139673,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 }
@@ -139602,19 +139730,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 */
@@ -139728,11 +139856,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
@@ -139744,11 +139872,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;
@@ -139757,11 +139885,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;
@@ -140142,11 +140270,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;
@@ -140157,20 +140285,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);
@@ -140198,11 +140326,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;
@@ -140214,11 +140342,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;
@@ -140231,11 +140359,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;
@@ -140266,11 +140394,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;
@@ -140303,11 +140431,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 ************************************************/
@@ -140457,11 +140585,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;
@@ -147460,11 +147588,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)
@@ -150616,11 +150744,15 @@
150744 }
150745
150746
150747 #ifdef SQLITE_TEST
150748
150749 #if defined(INCLUDE_SQLITE_TCL_H)
150750 # include "sqlite_tcl.h"
150751 #else
150752 # include "tcl.h"
150753 #endif
150754 /* #include <string.h> */
150755
150756 /*
150757 ** Implementation of a special SQL scalar function for testing tokenizers
150758 ** designed to be used in concert with the Tcl testing framework. This
@@ -163257,11 +163389,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 ){
@@ -163281,11 +163413,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 */
@@ -163306,11 +163438,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)
@@ -163857,11 +163989,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)
@@ -164537,11 +164669,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
@@ -164570,11 +164702,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 /*
@@ -164606,11 +164738,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
@@ -164620,11 +164752,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
@@ -164632,11 +164764,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
@@ -164652,18 +164784,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.
@@ -164701,11 +164833,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:
@@ -164739,11 +164871,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.
@@ -164783,21 +164915,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
@@ -167887,11 +168019,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
@@ -168329,11 +168461,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 */
@@ -168341,11 +168473,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);
@@ -168352,11 +168484,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;
@@ -168384,11 +168516,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 ){
@@ -168435,19 +168567,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);
@@ -168478,11 +168610,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
@@ -168506,11 +168638,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 ){
@@ -169333,11 +169465,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);
@@ -169347,11 +169479,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 */
@@ -171592,11 +171724,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 ){
@@ -171686,11 +171818,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 */
@@ -171748,11 +171880,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
@@ -171777,11 +171909,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;
@@ -171795,11 +171927,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));
@@ -172485,11 +172617,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);
@@ -172496,11 +172628,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);
@@ -172507,11 +172639,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);
@@ -172522,11 +172654,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);
@@ -172533,11 +172665,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 }
@@ -172547,11 +172679,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 }
@@ -172562,11 +172694,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){
@@ -172612,11 +172744,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);
@@ -172623,11 +172755,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);
@@ -173044,20 +173176,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 */
@@ -173073,11 +173205,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;
@@ -173096,11 +173228,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 ){
@@ -173124,11 +173256,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 ){
@@ -173158,11 +173290,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 ){
@@ -173181,11 +173313,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;
@@ -173199,11 +173331,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 ){
@@ -173373,11 +173505,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 ){
@@ -173392,11 +173524,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 ){
@@ -174272,11 +174404,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() */
@@ -174300,11 +174432,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() */
@@ -174635,11 +174767,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;
@@ -174652,11 +174784,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 ){
@@ -174668,11 +174800,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);
@@ -174679,11 +174811,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 */
@@ -174698,11 +174830,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);
@@ -174709,21 +174841,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 */
@@ -174748,11 +174880,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),
@@ -176003,10 +176135,11 @@
176135 sqlite3_context *ctx,
176136 int argc,
176137 sqlite3_value **argv
176138 ){
176139 JsonString jx;
176140 UNUSED_PARAM(argc);
176141
176142 jsonInit(&jx, ctx);
176143 jsonAppendValue(&jx, argv[0]);
176144 jsonResult(&jx);
176145 sqlite3_result_subtype(ctx, JSON_SUBTYPE);
@@ -176979,11 +177112,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);
@@ -193812,11 +193945,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,
@@ -193900,11 +194033,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);
@@ -193913,11 +194046,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
+470 -451
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -52,12 +52,21 @@
5252
# define SQLITE_API
5353
#endif
5454
#ifndef SQLITE_CDECL
5555
# define SQLITE_CDECL
5656
#endif
57
+#ifndef SQLITE_APICALL
58
+# define SQLITE_APICALL
59
+#endif
5760
#ifndef SQLITE_STDCALL
58
-# define SQLITE_STDCALL
61
+# define SQLITE_STDCALL SQLITE_APICALL
62
+#endif
63
+#ifndef SQLITE_CALLBACK
64
+# define SQLITE_CALLBACK
65
+#endif
66
+#ifndef SQLITE_SYSAPI
67
+# define SQLITE_SYSAPI
5968
#endif
6069
6170
/*
6271
** These no-op macros are used in front of interfaces to mark those
6372
** interfaces as either deprecated or experimental. New applications
@@ -111,11 +120,11 @@
111120
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
112121
** [sqlite_version()] and [sqlite_source_id()].
113122
*/
114123
#define SQLITE_VERSION "3.14.0"
115124
#define SQLITE_VERSION_NUMBER 3014000
116
-#define SQLITE_SOURCE_ID "2016-07-25 12:10:25 d6f6c87c9c0acf609a9d5bea818bb7a5437109a1"
125
+#define SQLITE_SOURCE_ID "2016-08-02 08:45:26 7c38a79cdd42aaa45715aea330d10ca859098837"
117126
118127
/*
119128
** CAPI3REF: Run-Time Library Version Numbers
120129
** KEYWORDS: sqlite3_version, sqlite3_sourceid
121130
**
@@ -144,13 +153,13 @@
144153
** [SQLITE_SOURCE_ID] C preprocessor macro.
145154
**
146155
** See also: [sqlite_version()] and [sqlite_source_id()].
147156
*/
148157
SQLITE_API SQLITE_EXTERN const char sqlite3_version[];
149
-SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void);
150
-SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void);
151
-SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void);
158
+SQLITE_API const char *SQLITE_APICALL sqlite3_libversion(void);
159
+SQLITE_API const char *SQLITE_APICALL sqlite3_sourceid(void);
160
+SQLITE_API int SQLITE_APICALL sqlite3_libversion_number(void);
152161
153162
/*
154163
** CAPI3REF: Run-Time Library Compilation Options Diagnostics
155164
**
156165
** ^The sqlite3_compileoption_used() function returns 0 or 1
@@ -171,12 +180,12 @@
171180
**
172181
** See also: SQL functions [sqlite_compileoption_used()] and
173182
** [sqlite_compileoption_get()] and the [compile_options pragma].
174183
*/
175184
#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
176
-SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName);
177
-SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N);
185
+SQLITE_API int SQLITE_APICALL sqlite3_compileoption_used(const char *zOptName);
186
+SQLITE_API const char *SQLITE_APICALL sqlite3_compileoption_get(int N);
178187
#endif
179188
180189
/*
181190
** CAPI3REF: Test To See If The Library Is Threadsafe
182191
**
@@ -211,11 +220,11 @@
211220
** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
212221
** is unchanged by calls to sqlite3_config().)^
213222
**
214223
** See the [threading mode] documentation for additional information.
215224
*/
216
-SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void);
225
+SQLITE_API int SQLITE_APICALL sqlite3_threadsafe(void);
217226
218227
/*
219228
** CAPI3REF: Database Connection Handle
220229
** KEYWORDS: {database connection} {database connections}
221230
**
@@ -308,19 +317,19 @@
308317
** from [sqlite3_open()], [sqlite3_open16()], or
309318
** [sqlite3_open_v2()], and not previously closed.
310319
** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
311320
** argument is a harmless no-op.
312321
*/
313
-SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3*);
314
-SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3*);
322
+SQLITE_API int SQLITE_APICALL sqlite3_close(sqlite3*);
323
+SQLITE_API int SQLITE_APICALL sqlite3_close_v2(sqlite3*);
315324
316325
/*
317326
** The type for a callback function.
318327
** This is legacy and deprecated. It is included for historical
319328
** compatibility and is not documented.
320329
*/
321
-typedef int (*sqlite3_callback)(void*,int,char**, char**);
330
+typedef int (SQLITE_CALLBACK *sqlite3_callback)(void*,int,char**, char**);
322331
323332
/*
324333
** CAPI3REF: One-Step Query Execution Interface
325334
** METHOD: sqlite3
326335
**
@@ -380,14 +389,14 @@
380389
** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
381390
** <li> The application must not modify the SQL statement text passed into
382391
** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
383392
** </ul>
384393
*/
385
-SQLITE_API int SQLITE_STDCALL sqlite3_exec(
394
+SQLITE_API int SQLITE_APICALL sqlite3_exec(
386395
sqlite3*, /* An open database */
387396
const char *sql, /* SQL to be evaluated */
388
- int (*callback)(void*,int,char**,char**), /* Callback function */
397
+ int (SQLITE_CALLBACK *callback)(void*,int,char**,char**), /* Callback function */
389398
void *, /* 1st argument to callback */
390399
char **errmsg /* Error msg written here */
391400
);
392401
393402
/*
@@ -731,30 +740,30 @@
731740
** database corruption.
732741
*/
733742
typedef struct sqlite3_io_methods sqlite3_io_methods;
734743
struct sqlite3_io_methods {
735744
int iVersion;
736
- int (*xClose)(sqlite3_file*);
737
- int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
738
- int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
739
- int (*xTruncate)(sqlite3_file*, sqlite3_int64 size);
740
- int (*xSync)(sqlite3_file*, int flags);
741
- int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
742
- int (*xLock)(sqlite3_file*, int);
743
- int (*xUnlock)(sqlite3_file*, int);
744
- int (*xCheckReservedLock)(sqlite3_file*, int *pResOut);
745
- int (*xFileControl)(sqlite3_file*, int op, void *pArg);
746
- int (*xSectorSize)(sqlite3_file*);
747
- int (*xDeviceCharacteristics)(sqlite3_file*);
745
+ int (SQLITE_CALLBACK *xClose)(sqlite3_file*);
746
+ int (SQLITE_CALLBACK *xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
747
+ int (SQLITE_CALLBACK *xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
748
+ int (SQLITE_CALLBACK *xTruncate)(sqlite3_file*, sqlite3_int64 size);
749
+ int (SQLITE_CALLBACK *xSync)(sqlite3_file*, int flags);
750
+ int (SQLITE_CALLBACK *xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
751
+ int (SQLITE_CALLBACK *xLock)(sqlite3_file*, int);
752
+ int (SQLITE_CALLBACK *xUnlock)(sqlite3_file*, int);
753
+ int (SQLITE_CALLBACK *xCheckReservedLock)(sqlite3_file*, int *pResOut);
754
+ int (SQLITE_CALLBACK *xFileControl)(sqlite3_file*, int op, void *pArg);
755
+ int (SQLITE_CALLBACK *xSectorSize)(sqlite3_file*);
756
+ int (SQLITE_CALLBACK *xDeviceCharacteristics)(sqlite3_file*);
748757
/* Methods above are valid for version 1 */
749
- int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
750
- int (*xShmLock)(sqlite3_file*, int offset, int n, int flags);
751
- void (*xShmBarrier)(sqlite3_file*);
752
- int (*xShmUnmap)(sqlite3_file*, int deleteFlag);
758
+ int (SQLITE_CALLBACK *xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
759
+ int (SQLITE_CALLBACK *xShmLock)(sqlite3_file*, int offset, int n, int flags);
760
+ void (SQLITE_CALLBACK *xShmBarrier)(sqlite3_file*);
761
+ int (SQLITE_CALLBACK *xShmUnmap)(sqlite3_file*, int deleteFlag);
753762
/* Methods above are valid for version 2 */
754
- int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
755
- int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p);
763
+ int (SQLITE_CALLBACK *xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
764
+ int (SQLITE_CALLBACK *xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p);
756765
/* Methods above are valid for version 3 */
757766
/* Additional methods may be added in future releases */
758767
};
759768
760769
/*
@@ -926,11 +935,11 @@
926935
** ^The [SQLITE_FCNTL_BUSYHANDLER]
927936
** file-control may be invoked by SQLite on the database file handle
928937
** shortly after it is opened in order to provide a custom VFS with access
929938
** to the connections busy-handler callback. The argument is of type (void **)
930939
** - an array of two (void *) values. The first (void *) actually points
931
-** to a function of type (int (*)(void *)). In order to invoke the connections
940
+** to a function of type (int (SQLITE_CALLBACK *)(void *)). In order to invoke the connections
932941
** busy-handler, this function should be invoked with the second (void *) in
933942
** the array as the only argument. If it returns non-zero, then the operation
934943
** should be retried. If it returns zero, the custom VFS should abandon the
935944
** current operation.
936945
**
@@ -1034,10 +1043,20 @@
10341043
**
10351044
** Mutexes are created using [sqlite3_mutex_alloc()].
10361045
*/
10371046
typedef struct sqlite3_mutex sqlite3_mutex;
10381047
1048
+/*
1049
+** CAPI3REF: Loadable Extension Thunk
1050
+**
1051
+** A pointer to the opaque sqlite3_api_routines structure is passed as
1052
+** the third parameter to entry points of [loadable extensions]. This
1053
+** structure must be typedefed in order to work around compiler warnings
1054
+** on some platforms.
1055
+*/
1056
+typedef struct sqlite3_api_routines sqlite3_api_routines;
1057
+
10391058
/*
10401059
** CAPI3REF: OS Interface Object
10411060
**
10421061
** An instance of the sqlite3_vfs object defines the interface between
10431062
** the SQLite core and the underlying operating system. The "vfs"
@@ -1192,43 +1211,43 @@
11921211
** or all of these interfaces to be NULL or for their behavior to change
11931212
** from one release to the next. Applications must not attempt to access
11941213
** any of these methods if the iVersion of the VFS is less than 3.
11951214
*/
11961215
typedef struct sqlite3_vfs sqlite3_vfs;
1197
-typedef void (*sqlite3_syscall_ptr)(void);
1216
+typedef void (SQLITE_SYSAPI *sqlite3_syscall_ptr)(void);
11981217
struct sqlite3_vfs {
11991218
int iVersion; /* Structure version number (currently 3) */
12001219
int szOsFile; /* Size of subclassed sqlite3_file */
12011220
int mxPathname; /* Maximum file pathname length */
12021221
sqlite3_vfs *pNext; /* Next registered VFS */
12031222
const char *zName; /* Name of this virtual file system */
12041223
void *pAppData; /* Pointer to application-specific data */
1205
- int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
1224
+ int (SQLITE_CALLBACK *xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
12061225
int flags, int *pOutFlags);
1207
- int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
1208
- int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
1209
- int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
1210
- void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename);
1211
- void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
1212
- void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
1213
- void (*xDlClose)(sqlite3_vfs*, void*);
1214
- int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
1215
- int (*xSleep)(sqlite3_vfs*, int microseconds);
1216
- int (*xCurrentTime)(sqlite3_vfs*, double*);
1217
- int (*xGetLastError)(sqlite3_vfs*, int, char *);
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 *);
12181237
/*
12191238
** The methods above are in version 1 of the sqlite_vfs object
12201239
** definition. Those that follow are added in version 2 or later
12211240
*/
1222
- int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
1241
+ int (SQLITE_CALLBACK *xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
12231242
/*
12241243
** The methods above are in versions 1 and 2 of the sqlite_vfs object.
12251244
** Those below are for version 3 and greater.
12261245
*/
1227
- int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
1228
- sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName);
1229
- const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName);
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);
12301249
/*
12311250
** The methods above are in versions 1 through 3 of the sqlite_vfs object.
12321251
** New fields may be appended in future versions. The iVersion
12331252
** value will increment whenever this happens.
12341253
*/
@@ -1369,14 +1388,14 @@
13691388
** sqlite3_os_init() and sqlite3_os_end(). An application-supplied
13701389
** implementation of sqlite3_os_init() or sqlite3_os_end()
13711390
** must return [SQLITE_OK] on success and some other [error code] upon
13721391
** failure.
13731392
*/
1374
-SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void);
1375
-SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void);
1376
-SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void);
1377
-SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void);
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);
13781397
13791398
/*
13801399
** CAPI3REF: Configuring The SQLite Library
13811400
**
13821401
** The sqlite3_config() interface is used to make global configuration
@@ -1491,17 +1510,17 @@
14911510
** SQLite will never invoke xInit() more than once without an intervening
14921511
** call to xShutdown().
14931512
*/
14941513
typedef struct sqlite3_mem_methods sqlite3_mem_methods;
14951514
struct sqlite3_mem_methods {
1496
- void *(*xMalloc)(int); /* Memory allocation function */
1497
- void (*xFree)(void*); /* Free a prior allocation */
1498
- void *(*xRealloc)(void*,int); /* Resize an allocation */
1499
- int (*xSize)(void*); /* Return the size of an allocation */
1500
- int (*xRoundup)(int); /* Round up request size to allocation size */
1501
- int (*xInit)(void*); /* Initialize the memory allocator */
1502
- void (*xShutdown)(void*); /* Deinitialize the memory allocator */
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 */
15031522
void *pAppData; /* Argument to xInit() and xShutdown() */
15041523
};
15051524
15061525
/*
15071526
** CAPI3REF: Configuration Options
@@ -1714,11 +1733,11 @@
17141733
**
17151734
** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
17161735
** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
17171736
** global [error log].
17181737
** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a
1719
-** function with a call signature of void(*)(void*,int,const char*),
1738
+** function with a call signature of void(SQLITE_CALLBACK *)(void*,int,const char*),
17201739
** and a pointer to void. ^If the function pointer is not NULL, it is
17211740
** invoked by [sqlite3_log()] to process each logging event. ^If the
17221741
** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op.
17231742
** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is
17241743
** passed through as the first parameter to the application-defined logger
@@ -1767,11 +1786,11 @@
17671786
**
17681787
** [[SQLITE_CONFIG_SQLLOG]]
17691788
** <dt>SQLITE_CONFIG_SQLLOG
17701789
** <dd>This option is only available if sqlite is compiled with the
17711790
** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should
1772
-** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int).
1791
+** be a pointer to a function of type void(SQLITE_CALLBACK *)(void*,sqlite3*,const char*, int).
17731792
** The second should be of type (void*). The callback is invoked by the library
17741793
** in three separate circumstances, identified by the value passed as the
17751794
** fourth parameter. If the fourth parameter is 0, then the database connection
17761795
** passed as the second argument has just been opened. The third argument
17771796
** points to a buffer containing the name of the main database file. If the
@@ -1965,11 +1984,11 @@
19651984
**
19661985
** ^The sqlite3_extended_result_codes() routine enables or disables the
19671986
** [extended result codes] feature of SQLite. ^The extended result
19681987
** codes are disabled by default for historical compatibility.
19691988
*/
1970
-SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3*, int onoff);
1989
+SQLITE_API int SQLITE_APICALL sqlite3_extended_result_codes(sqlite3*, int onoff);
19711990
19721991
/*
19731992
** CAPI3REF: Last Insert Rowid
19741993
** METHOD: sqlite3
19751994
**
@@ -2017,11 +2036,11 @@
20172036
** function is running and thus changes the last insert [rowid],
20182037
** then the value returned by [sqlite3_last_insert_rowid()] is
20192038
** unpredictable and might not equal either the old or the new
20202039
** last insert [rowid].
20212040
*/
2022
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3*);
2041
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_last_insert_rowid(sqlite3*);
20232042
20242043
/*
20252044
** CAPI3REF: Count The Number Of Rows Modified
20262045
** METHOD: sqlite3
20272046
**
@@ -2070,11 +2089,11 @@
20702089
**
20712090
** If a separate thread makes changes on the same database connection
20722091
** while [sqlite3_changes()] is running then the value returned
20732092
** is unpredictable and not meaningful.
20742093
*/
2075
-SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3*);
2094
+SQLITE_API int SQLITE_APICALL sqlite3_changes(sqlite3*);
20762095
20772096
/*
20782097
** CAPI3REF: Total Number Of Rows Modified
20792098
** METHOD: sqlite3
20802099
**
@@ -2094,11 +2113,11 @@
20942113
**
20952114
** If a separate thread makes changes on the same database connection
20962115
** while [sqlite3_total_changes()] is running then the value
20972116
** returned is unpredictable and not meaningful.
20982117
*/
2099
-SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3*);
2118
+SQLITE_API int SQLITE_APICALL sqlite3_total_changes(sqlite3*);
21002119
21012120
/*
21022121
** CAPI3REF: Interrupt A Long-Running Query
21032122
** METHOD: sqlite3
21042123
**
@@ -2134,11 +2153,11 @@
21342153
** that are started after the sqlite3_interrupt() call returns.
21352154
**
21362155
** If the database connection closes while [sqlite3_interrupt()]
21372156
** is running then bad things will likely happen.
21382157
*/
2139
-SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3*);
2158
+SQLITE_API void SQLITE_APICALL sqlite3_interrupt(sqlite3*);
21402159
21412160
/*
21422161
** CAPI3REF: Determine If An SQL Statement Is Complete
21432162
**
21442163
** These routines are useful during command-line input to determine if the
@@ -2169,12 +2188,12 @@
21692188
** UTF-8 string.
21702189
**
21712190
** The input to [sqlite3_complete16()] must be a zero-terminated
21722191
** UTF-16 string in native byte order.
21732192
*/
2174
-SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *sql);
2175
-SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *sql);
2193
+SQLITE_API int SQLITE_APICALL sqlite3_complete(const char *sql);
2194
+SQLITE_API int SQLITE_APICALL sqlite3_complete16(const void *sql);
21762195
21772196
/*
21782197
** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
21792198
** KEYWORDS: {busy-handler callback} {busy handler}
21802199
** METHOD: sqlite3
@@ -2231,11 +2250,11 @@
22312250
** result in undefined behavior.
22322251
**
22332252
** A busy handler must not close the database connection
22342253
** or [prepared statement] that invoked the busy handler.
22352254
*/
2236
-SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*);
2255
+SQLITE_API int SQLITE_APICALL sqlite3_busy_handler(sqlite3*,int(SQLITE_CALLBACK *)(void*,int),void*);
22372256
22382257
/*
22392258
** CAPI3REF: Set A Busy Timeout
22402259
** METHOD: sqlite3
22412260
**
@@ -2254,11 +2273,11 @@
22542273
** was defined (using [sqlite3_busy_handler()]) prior to calling
22552274
** this routine, that other busy handler is cleared.)^
22562275
**
22572276
** See also: [PRAGMA busy_timeout]
22582277
*/
2259
-SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3*, int ms);
2278
+SQLITE_API int SQLITE_APICALL sqlite3_busy_timeout(sqlite3*, int ms);
22602279
22612280
/*
22622281
** CAPI3REF: Convenience Routines For Running Queries
22632282
** METHOD: sqlite3
22642283
**
@@ -2329,19 +2348,19 @@
23292348
** interface defined here. As a consequence, errors that occur in the
23302349
** wrapper layer outside of the internal [sqlite3_exec()] call are not
23312350
** reflected in subsequent calls to [sqlite3_errcode()] or
23322351
** [sqlite3_errmsg()].
23332352
*/
2334
-SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
2353
+SQLITE_API int SQLITE_APICALL sqlite3_get_table(
23352354
sqlite3 *db, /* An open database */
23362355
const char *zSql, /* SQL to be evaluated */
23372356
char ***pazResult, /* Results of the query */
23382357
int *pnRow, /* Number of result rows written here */
23392358
int *pnColumn, /* Number of result columns written here */
23402359
char **pzErrmsg /* Error msg written here */
23412360
);
2342
-SQLITE_API void SQLITE_STDCALL sqlite3_free_table(char **result);
2361
+SQLITE_API void SQLITE_APICALL sqlite3_free_table(char **result);
23432362
23442363
/*
23452364
** CAPI3REF: Formatted String Printing Functions
23462365
**
23472366
** These routines are work-alikes of the "printf()" family of functions
@@ -2444,13 +2463,13 @@
24442463
** ^(The "%z" formatting option works like "%s" but with the
24452464
** addition that after the string has been read and copied into
24462465
** the result, [sqlite3_free()] is called on the input string.)^
24472466
*/
24482467
SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...);
2449
-SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list);
2468
+SQLITE_API char *SQLITE_APICALL sqlite3_vmprintf(const char*, va_list);
24502469
SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...);
2451
-SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list);
2470
+SQLITE_API char *SQLITE_APICALL sqlite3_vsnprintf(int,char*,const char*, va_list);
24522471
24532472
/*
24542473
** CAPI3REF: Memory Allocation Subsystem
24552474
**
24562475
** The SQLite core uses these three routines for all of its own
@@ -2536,16 +2555,16 @@
25362555
**
25372556
** The application must not read or write any part of
25382557
** a block of memory after it has been released using
25392558
** [sqlite3_free()] or [sqlite3_realloc()].
25402559
*/
2541
-SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int);
2542
-SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64);
2543
-SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void*, int);
2544
-SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void*, sqlite3_uint64);
2545
-SQLITE_API void SQLITE_STDCALL sqlite3_free(void*);
2546
-SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void*);
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*);
25472566
25482567
/*
25492568
** CAPI3REF: Memory Allocator Statistics
25502569
**
25512570
** SQLite provides these two interfaces for reporting on the status
@@ -2566,12 +2585,12 @@
25662585
** [sqlite3_memory_used()] if and only if the parameter to
25672586
** [sqlite3_memory_highwater()] is true. ^The value returned
25682587
** by [sqlite3_memory_highwater(1)] is the high-water mark
25692588
** prior to the reset.
25702589
*/
2571
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void);
2572
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag);
2590
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_used(void);
2591
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_highwater(int resetFlag);
25732592
25742593
/*
25752594
** CAPI3REF: Pseudo-Random Number Generator
25762595
**
25772596
** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
@@ -2590,11 +2609,11 @@
25902609
** ^If the previous call to this routine had an N of 1 or more and a
25912610
** non-NULL P then the pseudo-randomness is generated
25922611
** internally and without recourse to the [sqlite3_vfs] xRandomness
25932612
** method.
25942613
*/
2595
-SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *P);
2614
+SQLITE_API void SQLITE_APICALL sqlite3_randomness(int N, void *P);
25962615
25972616
/*
25982617
** CAPI3REF: Compile-Time Authorization Callbacks
25992618
** METHOD: sqlite3
26002619
**
@@ -2673,13 +2692,13 @@
26732692
** [sqlite3_prepare()] or its variants. Authorization is not
26742693
** performed during statement evaluation in [sqlite3_step()], unless
26752694
** as stated in the previous paragraph, sqlite3_step() invokes
26762695
** sqlite3_prepare_v2() to reprepare a statement after a schema change.
26772696
*/
2678
-SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
2697
+SQLITE_API int SQLITE_APICALL sqlite3_set_authorizer(
26792698
sqlite3*,
2680
- int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
2699
+ int (SQLITE_CALLBACK *xAuth)(void*,int,const char*,const char*,const char*,const char*),
26812700
void *pUserData
26822701
);
26832702
26842703
/*
26852704
** CAPI3REF: Authorizer Return Codes
@@ -2781,14 +2800,14 @@
27812800
** digits in the time are meaningless. Future versions of SQLite
27822801
** might provide greater resolution on the profiler callback. The
27832802
** sqlite3_profile() function is considered experimental and is
27842803
** subject to change in future versions of SQLite.
27852804
*/
2786
-SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_trace(sqlite3*,
2787
- void(*xTrace)(void*,const char*), void*);
2788
-SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_profile(sqlite3*,
2789
- void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
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*);
27902809
27912810
/*
27922811
** CAPI3REF: SQL Trace Event Codes
27932812
** KEYWORDS: SQLITE_TRACE
27942813
**
@@ -2872,14 +2891,14 @@
28722891
**
28732892
** The sqlite3_trace_v2() interface is intended to replace the legacy
28742893
** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which
28752894
** are deprecated.
28762895
*/
2877
-SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2(
2896
+SQLITE_API int SQLITE_APICALL sqlite3_trace_v2(
28782897
sqlite3*,
28792898
unsigned uMask,
2880
- int(*xCallback)(unsigned,void*,void*,void*),
2899
+ int(SQLITE_CALLBACK *xCallback)(unsigned,void*,void*,void*),
28812900
void *pCtx
28822901
);
28832902
28842903
/*
28852904
** CAPI3REF: Query Progress Callbacks
@@ -2911,11 +2930,11 @@
29112930
** the database connection that invoked the progress handler.
29122931
** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
29132932
** database connections for the meaning of "modify" in this paragraph.
29142933
**
29152934
*/
2916
-SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
2935
+SQLITE_API void SQLITE_APICALL sqlite3_progress_handler(sqlite3*, int, int(SQLITE_CALLBACK *)(void*), void*);
29172936
29182937
/*
29192938
** CAPI3REF: Opening A New Database Connection
29202939
** CONSTRUCTOR: sqlite3
29212940
**
@@ -3140,19 +3159,19 @@
31403159
** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various
31413160
** features that require the use of temporary files may fail.
31423161
**
31433162
** See also: [sqlite3_temp_directory]
31443163
*/
3145
-SQLITE_API int SQLITE_STDCALL sqlite3_open(
3164
+SQLITE_API int SQLITE_APICALL sqlite3_open(
31463165
const char *filename, /* Database filename (UTF-8) */
31473166
sqlite3 **ppDb /* OUT: SQLite db handle */
31483167
);
3149
-SQLITE_API int SQLITE_STDCALL sqlite3_open16(
3168
+SQLITE_API int SQLITE_APICALL sqlite3_open16(
31503169
const void *filename, /* Database filename (UTF-16) */
31513170
sqlite3 **ppDb /* OUT: SQLite db handle */
31523171
);
3153
-SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
3172
+SQLITE_API int SQLITE_APICALL sqlite3_open_v2(
31543173
const char *filename, /* Database filename (UTF-8) */
31553174
sqlite3 **ppDb, /* OUT: SQLite db handle */
31563175
int flags, /* Flags */
31573176
const char *zVfs /* Name of VFS module to use */
31583177
);
@@ -3194,13 +3213,13 @@
31943213
** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and
31953214
** is not a database file pathname pointer that SQLite passed into the xOpen
31963215
** VFS method, then the behavior of this routine is undefined and probably
31973216
** undesirable.
31983217
*/
3199
-SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3200
-SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3201
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
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);
32023221
32033222
32043223
/*
32053224
** CAPI3REF: Error Codes And Messages
32063225
** METHOD: sqlite3
@@ -3240,15 +3259,15 @@
32403259
**
32413260
** If an interface fails with SQLITE_MISUSE, that means the interface
32423261
** was invoked incorrectly by the application. In that case, the
32433262
** error code and message may or may not be set.
32443263
*/
3245
-SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db);
3246
-SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db);
3247
-SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*);
3248
-SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*);
3249
-SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int);
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);
32503269
32513270
/*
32523271
** CAPI3REF: Prepared Statement Object
32533272
** KEYWORDS: {prepared statement} {prepared statements}
32543273
**
@@ -3312,11 +3331,11 @@
33123331
** created by an untrusted script can be contained using the
33133332
** [max_page_count] [PRAGMA].
33143333
**
33153334
** New run-time limit categories may be added in future releases.
33163335
*/
3317
-SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3*, int id, int newVal);
3336
+SQLITE_API int SQLITE_APICALL sqlite3_limit(sqlite3*, int id, int newVal);
33183337
33193338
/*
33203339
** CAPI3REF: Run-Time Limit Categories
33213340
** KEYWORDS: {limit category} {*limit categories}
33223341
**
@@ -3464,32 +3483,32 @@
34643483
** or [GLOB] operator or if the parameter is compared to an indexed column
34653484
** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
34663485
** </li>
34673486
** </ol>
34683487
*/
3469
-SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
3488
+SQLITE_API int SQLITE_APICALL sqlite3_prepare(
34703489
sqlite3 *db, /* Database handle */
34713490
const char *zSql, /* SQL statement, UTF-8 encoded */
34723491
int nByte, /* Maximum length of zSql in bytes. */
34733492
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
34743493
const char **pzTail /* OUT: Pointer to unused portion of zSql */
34753494
);
3476
-SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
3495
+SQLITE_API int SQLITE_APICALL sqlite3_prepare_v2(
34773496
sqlite3 *db, /* Database handle */
34783497
const char *zSql, /* SQL statement, UTF-8 encoded */
34793498
int nByte, /* Maximum length of zSql in bytes. */
34803499
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
34813500
const char **pzTail /* OUT: Pointer to unused portion of zSql */
34823501
);
3483
-SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
3502
+SQLITE_API int SQLITE_APICALL sqlite3_prepare16(
34843503
sqlite3 *db, /* Database handle */
34853504
const void *zSql, /* SQL statement, UTF-16 encoded */
34863505
int nByte, /* Maximum length of zSql in bytes. */
34873506
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
34883507
const void **pzTail /* OUT: Pointer to unused portion of zSql */
34893508
);
3490
-SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
3509
+SQLITE_API int SQLITE_APICALL sqlite3_prepare16_v2(
34913510
sqlite3 *db, /* Database handle */
34923511
const void *zSql, /* SQL statement, UTF-16 encoded */
34933512
int nByte, /* Maximum length of zSql in bytes. */
34943513
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
34953514
const void **pzTail /* OUT: Pointer to unused portion of zSql */
@@ -3524,12 +3543,12 @@
35243543
** automatically freed when the prepared statement is finalized.
35253544
** ^The string returned by sqlite3_expanded_sql(P), on the other hand,
35263545
** is obtained from [sqlite3_malloc()] and must be free by the application
35273546
** by passing it to [sqlite3_free()].
35283547
*/
3529
-SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt);
3530
-SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt);
3548
+SQLITE_API const char *SQLITE_APICALL sqlite3_sql(sqlite3_stmt *pStmt);
3549
+SQLITE_API char *SQLITE_APICALL sqlite3_expanded_sql(sqlite3_stmt *pStmt);
35313550
35323551
/*
35333552
** CAPI3REF: Determine If An SQL Statement Writes The Database
35343553
** METHOD: sqlite3_stmt
35353554
**
@@ -3557,11 +3576,11 @@
35573576
** database. ^The [ATTACH] and [DETACH] statements also cause
35583577
** sqlite3_stmt_readonly() to return true since, while those statements
35593578
** change the configuration of a database connection, they do not make
35603579
** changes to the content of the database files on disk.
35613580
*/
3562
-SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
3581
+SQLITE_API int SQLITE_APICALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
35633582
35643583
/*
35653584
** CAPI3REF: Determine If A Prepared Statement Has Been Reset
35663585
** METHOD: sqlite3_stmt
35673586
**
@@ -3578,11 +3597,11 @@
35783597
** to locate all prepared statements associated with a database
35793598
** connection that are in need of being reset. This can be used,
35803599
** for example, in diagnostic routines to search for prepared
35813600
** statements that are holding a transaction open.
35823601
*/
3583
-SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt*);
3602
+SQLITE_API int SQLITE_APICALL sqlite3_stmt_busy(sqlite3_stmt*);
35843603
35853604
/*
35863605
** CAPI3REF: Dynamically Typed Value Object
35873606
** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
35883607
**
@@ -3742,24 +3761,24 @@
37423761
** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails.
37433762
**
37443763
** See also: [sqlite3_bind_parameter_count()],
37453764
** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].
37463765
*/
3747
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
3748
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
3749
- void(*)(void*));
3750
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt*, int, double);
3751
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt*, int, int);
3752
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
3753
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt*, int);
3754
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
3755
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
3756
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
3757
- void(*)(void*), unsigned char encoding);
3758
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
3759
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
3760
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
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);
37613780
37623781
/*
37633782
** CAPI3REF: Number Of SQL Parameters
37643783
** METHOD: sqlite3_stmt
37653784
**
@@ -3776,11 +3795,11 @@
37763795
**
37773796
** See also: [sqlite3_bind_blob|sqlite3_bind()],
37783797
** [sqlite3_bind_parameter_name()], and
37793798
** [sqlite3_bind_parameter_index()].
37803799
*/
3781
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt*);
3800
+SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_count(sqlite3_stmt*);
37823801
37833802
/*
37843803
** CAPI3REF: Name Of A Host Parameter
37853804
** METHOD: sqlite3_stmt
37863805
**
@@ -3804,11 +3823,11 @@
38043823
**
38053824
** See also: [sqlite3_bind_blob|sqlite3_bind()],
38063825
** [sqlite3_bind_parameter_count()], and
38073826
** [sqlite3_bind_parameter_index()].
38083827
*/
3809
-SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
3828
+SQLITE_API const char *SQLITE_APICALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
38103829
38113830
/*
38123831
** CAPI3REF: Index Of A Parameter With A Given Name
38133832
** METHOD: sqlite3_stmt
38143833
**
@@ -3821,21 +3840,21 @@
38213840
**
38223841
** See also: [sqlite3_bind_blob|sqlite3_bind()],
38233842
** [sqlite3_bind_parameter_count()], and
38243843
** [sqlite3_bind_parameter_name()].
38253844
*/
3826
-SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
3845
+SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
38273846
38283847
/*
38293848
** CAPI3REF: Reset All Bindings On A Prepared Statement
38303849
** METHOD: sqlite3_stmt
38313850
**
38323851
** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset
38333852
** the [sqlite3_bind_blob | bindings] on a [prepared statement].
38343853
** ^Use this routine to reset all host parameters to NULL.
38353854
*/
3836
-SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt*);
3855
+SQLITE_API int SQLITE_APICALL sqlite3_clear_bindings(sqlite3_stmt*);
38373856
38383857
/*
38393858
** CAPI3REF: Number Of Columns In A Result Set
38403859
** METHOD: sqlite3_stmt
38413860
**
@@ -3843,11 +3862,11 @@
38433862
** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
38443863
** statement that does not return data (for example an [UPDATE]).
38453864
**
38463865
** See also: [sqlite3_data_count()]
38473866
*/
3848
-SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt);
3867
+SQLITE_API int SQLITE_APICALL sqlite3_column_count(sqlite3_stmt *pStmt);
38493868
38503869
/*
38513870
** CAPI3REF: Column Names In A Result Set
38523871
** METHOD: sqlite3_stmt
38533872
**
@@ -3872,12 +3891,12 @@
38723891
** ^The name of a result column is the value of the "AS" clause for
38733892
** that column, if there is an AS clause. If there is no AS clause
38743893
** then the name of the column is unspecified and may change from
38753894
** one release of SQLite to the next.
38763895
*/
3877
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt*, int N);
3878
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt*, int N);
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);
38793898
38803899
/*
38813900
** CAPI3REF: Source Of Data In A Query Result
38823901
** METHOD: sqlite3_stmt
38833902
**
@@ -3921,16 +3940,16 @@
39213940
** If two or more threads call one or more
39223941
** [sqlite3_column_database_name | column metadata interfaces]
39233942
** for the same [prepared statement] and result column
39243943
** at the same time then the results are undefined.
39253944
*/
3926
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int);
3927
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int);
3928
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int);
3929
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int);
3930
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int);
3931
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
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);
39323951
39333952
/*
39343953
** CAPI3REF: Declared Datatype Of A Query Result
39353954
** METHOD: sqlite3_stmt
39363955
**
@@ -3958,12 +3977,12 @@
39583977
** data stored in that column is of the declared type. SQLite is
39593978
** strongly typed, but the typing is dynamic not static. ^Type
39603979
** is associated with individual values, not with the containers
39613980
** used to hold those values.
39623981
*/
3963
-SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt*,int);
3964
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt*,int);
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);
39653984
39663985
/*
39673986
** CAPI3REF: Evaluate An SQL Statement
39683987
** METHOD: sqlite3_stmt
39693988
**
@@ -4039,11 +4058,11 @@
40394058
** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
40404059
** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,
40414060
** then the more specific [error codes] are returned directly
40424061
** by sqlite3_step(). The use of the "v2" interface is recommended.
40434062
*/
4044
-SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt*);
4063
+SQLITE_API int SQLITE_APICALL sqlite3_step(sqlite3_stmt*);
40454064
40464065
/*
40474066
** CAPI3REF: Number of columns in a result set
40484067
** METHOD: sqlite3_stmt
40494068
**
@@ -4060,11 +4079,11 @@
40604079
** where it always returns zero since each step of that multi-step
40614080
** pragma returns 0 columns of data.
40624081
**
40634082
** See also: [sqlite3_column_count()]
40644083
*/
4065
-SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt);
4084
+SQLITE_API int SQLITE_APICALL sqlite3_data_count(sqlite3_stmt *pStmt);
40664085
40674086
/*
40684087
** CAPI3REF: Fundamental Datatypes
40694088
** KEYWORDS: SQLITE_TEXT
40704089
**
@@ -4250,20 +4269,20 @@
42504269
** of these routines, a default value is returned. The default value
42514270
** is either the integer 0, the floating point number 0.0, or a NULL
42524271
** pointer. Subsequent calls to [sqlite3_errcode()] will return
42534272
** [SQLITE_NOMEM].)^
42544273
*/
4255
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt*, int iCol);
4256
-SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4257
-SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4258
-SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt*, int iCol);
4259
-SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt*, int iCol);
4260
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt*, int iCol);
4261
-SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt*, int iCol);
4262
-SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt*, int iCol);
4263
-SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt*, int iCol);
4264
-SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt*, int iCol);
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);
42654284
42664285
/*
42674286
** CAPI3REF: Destroy A Prepared Statement Object
42684287
** DESTRUCTOR: sqlite3_stmt
42694288
**
@@ -4287,11 +4306,11 @@
42874306
** resource leaks. It is a grievous error for the application to try to use
42884307
** a prepared statement after it has been finalized. Any use of a prepared
42894308
** statement after it has been finalized can result in undefined and
42904309
** undesirable behavior such as segfaults and heap corruption.
42914310
*/
4292
-SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt);
4311
+SQLITE_API int SQLITE_APICALL sqlite3_finalize(sqlite3_stmt *pStmt);
42934312
42944313
/*
42954314
** CAPI3REF: Reset A Prepared Statement Object
42964315
** METHOD: sqlite3_stmt
42974316
**
@@ -4314,11 +4333,11 @@
43144333
** [sqlite3_reset(S)] returns an appropriate [error code].
43154334
**
43164335
** ^The [sqlite3_reset(S)] interface does not change the values
43174336
** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
43184337
*/
4319
-SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt);
4338
+SQLITE_API int SQLITE_APICALL sqlite3_reset(sqlite3_stmt *pStmt);
43204339
43214340
/*
43224341
** CAPI3REF: Create Or Redefine SQL Functions
43234342
** KEYWORDS: {function creation routines}
43244343
** KEYWORDS: {application-defined SQL function}
@@ -4414,40 +4433,40 @@
44144433
** ^An application-defined function is permitted to call other
44154434
** SQLite interfaces. However, such calls must not
44164435
** close the database connection nor finalize or reset the prepared
44174436
** statement in which the function is running.
44184437
*/
4419
-SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
4438
+SQLITE_API int SQLITE_APICALL sqlite3_create_function(
44204439
sqlite3 *db,
44214440
const char *zFunctionName,
44224441
int nArg,
44234442
int eTextRep,
44244443
void *pApp,
4425
- void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4426
- void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4427
- void (*xFinal)(sqlite3_context*)
4444
+ void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**),
4445
+ void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**),
4446
+ void (SQLITE_CALLBACK *xFinal)(sqlite3_context*)
44284447
);
4429
-SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
4448
+SQLITE_API int SQLITE_APICALL sqlite3_create_function16(
44304449
sqlite3 *db,
44314450
const void *zFunctionName,
44324451
int nArg,
44334452
int eTextRep,
44344453
void *pApp,
4435
- void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4436
- void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4437
- void (*xFinal)(sqlite3_context*)
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*)
44384457
);
4439
-SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
4458
+SQLITE_API int SQLITE_APICALL sqlite3_create_function_v2(
44404459
sqlite3 *db,
44414460
const char *zFunctionName,
44424461
int nArg,
44434462
int eTextRep,
44444463
void *pApp,
4445
- void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4446
- void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4447
- void (*xFinal)(sqlite3_context*),
4448
- void(*xDestroy)(void*)
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*)
44494468
);
44504469
44514470
/*
44524471
** CAPI3REF: Text Encodings
44534472
**
@@ -4480,16 +4499,16 @@
44804499
** to be supported. However, new applications should avoid
44814500
** the use of these functions. To encourage programmers to avoid
44824501
** these functions, we will not explain what they do.
44834502
*/
44844503
#ifndef SQLITE_OMIT_DEPRECATED
4485
-SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context*);
4486
-SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt*);
4487
-SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4488
-SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_global_recover(void);
4489
-SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_thread_cleanup(void);
4490
-SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
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),
44914510
void*,sqlite3_int64);
44924511
#endif
44934512
44944513
/*
44954514
** CAPI3REF: Obtaining SQL Values
@@ -4535,22 +4554,22 @@
45354554
** or [sqlite3_value_text16()].
45364555
**
45374556
** These routines must be called from the same thread as
45384557
** the SQL function that supplied the [sqlite3_value*] parameters.
45394558
*/
4540
-SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value*);
4541
-SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value*);
4542
-SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value*);
4543
-SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value*);
4544
-SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value*);
4545
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value*);
4546
-SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value*);
4547
-SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value*);
4548
-SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value*);
4549
-SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*);
4550
-SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*);
4551
-SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*);
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*);
45524571
45534572
/*
45544573
** CAPI3REF: Finding The Subtype Of SQL Values
45554574
** METHOD: sqlite3_value
45564575
**
@@ -4562,11 +4581,11 @@
45624581
**
45634582
** SQLite makes no use of subtype itself. It merely passes the subtype
45644583
** from the result of one [application-defined SQL function] into the
45654584
** input of another.
45664585
*/
4567
-SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value*);
4586
+SQLITE_API unsigned int SQLITE_APICALL sqlite3_value_subtype(sqlite3_value*);
45684587
45694588
/*
45704589
** CAPI3REF: Copy And Free SQL Values
45714590
** METHOD: sqlite3_value
45724591
**
@@ -4578,12 +4597,12 @@
45784597
**
45794598
** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object
45804599
** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer
45814600
** then sqlite3_value_free(V) is a harmless no-op.
45824601
*/
4583
-SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value*);
4584
-SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value*);
4602
+SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_value_dup(const sqlite3_value*);
4603
+SQLITE_API void SQLITE_APICALL sqlite3_value_free(sqlite3_value*);
45854604
45864605
/*
45874606
** CAPI3REF: Obtain Aggregate Function Context
45884607
** METHOD: sqlite3_context
45894608
**
@@ -4624,11 +4643,11 @@
46244643
** function.
46254644
**
46264645
** This routine must be called from the same thread in which
46274646
** the aggregate SQL function is running.
46284647
*/
4629
-SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
4648
+SQLITE_API void *SQLITE_APICALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
46304649
46314650
/*
46324651
** CAPI3REF: User Data For Functions
46334652
** METHOD: sqlite3_context
46344653
**
@@ -4639,11 +4658,11 @@
46394658
** registered the application defined function.
46404659
**
46414660
** This routine must be called from the same thread in which
46424661
** the application-defined function is running.
46434662
*/
4644
-SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context*);
4663
+SQLITE_API void *SQLITE_APICALL sqlite3_user_data(sqlite3_context*);
46454664
46464665
/*
46474666
** CAPI3REF: Database Connection For Functions
46484667
** METHOD: sqlite3_context
46494668
**
@@ -4651,11 +4670,11 @@
46514670
** the pointer to the [database connection] (the 1st parameter)
46524671
** of the [sqlite3_create_function()]
46534672
** and [sqlite3_create_function16()] routines that originally
46544673
** registered the application defined function.
46554674
*/
4656
-SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context*);
4675
+SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_context_db_handle(sqlite3_context*);
46574676
46584677
/*
46594678
** CAPI3REF: Function Auxiliary Data
46604679
** METHOD: sqlite3_context
46614680
**
@@ -4704,12 +4723,12 @@
47044723
** values and [parameters] and expressions composed from the same.)^
47054724
**
47064725
** These routines must be called from the same thread in which
47074726
** the SQL function is running.
47084727
*/
4709
-SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context*, int N);
4710
-SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
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*));
47114730
47124731
47134732
/*
47144733
** CAPI3REF: Constants Defining Special Destructor Behavior
47154734
**
@@ -4722,11 +4741,11 @@
47224741
** the content before returning.
47234742
**
47244743
** The typedef is necessary to work around problems in certain
47254744
** C++ compilers.
47264745
*/
4727
-typedef void (*sqlite3_destructor_type)(void*);
4746
+typedef void (SQLITE_CALLBACK *sqlite3_destructor_type)(void*);
47284747
#define SQLITE_STATIC ((sqlite3_destructor_type)0)
47294748
#define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1)
47304749
47314750
/*
47324751
** CAPI3REF: Setting The Result Of An SQL Function
@@ -4841,31 +4860,31 @@
48414860
**
48424861
** If these routines are called from within the different thread
48434862
** than the one containing the application-defined function that received
48444863
** the [sqlite3_context] pointer, the results are undefined.
48454864
*/
4846
-SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
4847
-SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(sqlite3_context*,const void*,
4848
- sqlite3_uint64,void(*)(void*));
4849
-SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context*, double);
4850
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context*, const char*, int);
4851
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context*, const void*, int);
4852
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context*);
4853
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context*);
4854
-SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context*, int);
4855
-SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context*, int);
4856
-SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
4857
-SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context*);
4858
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
4859
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
4860
- void(*)(void*), unsigned char encoding);
4861
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
4862
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
4863
-SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
4864
-SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
4865
-SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n);
4866
-SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
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);
48674886
48684887
48694888
/*
48704889
** CAPI3REF: Setting The Subtype Of An SQL Function
48714890
** METHOD: sqlite3_context
@@ -4876,11 +4895,11 @@
48764895
** of the subtype T are preserved in current versions of SQLite;
48774896
** higher order bits are discarded.
48784897
** The number of subtype bytes preserved by SQLite might increase
48794898
** in future releases of SQLite.
48804899
*/
4881
-SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context*,unsigned int);
4900
+SQLITE_API void SQLITE_APICALL sqlite3_result_subtype(sqlite3_context*,unsigned int);
48824901
48834902
/*
48844903
** CAPI3REF: Define New Collating Sequences
48854904
** METHOD: sqlite3
48864905
**
@@ -4958,31 +4977,31 @@
49584977
** is unfortunate but cannot be changed without breaking backwards
49594978
** compatibility.
49604979
**
49614980
** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].
49624981
*/
4963
-SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
4982
+SQLITE_API int SQLITE_APICALL sqlite3_create_collation(
49644983
sqlite3*,
49654984
const char *zName,
49664985
int eTextRep,
49674986
void *pArg,
4968
- int(*xCompare)(void*,int,const void*,int,const void*)
4987
+ int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*)
49694988
);
4970
-SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
4989
+SQLITE_API int SQLITE_APICALL sqlite3_create_collation_v2(
49714990
sqlite3*,
49724991
const char *zName,
49734992
int eTextRep,
49744993
void *pArg,
4975
- int(*xCompare)(void*,int,const void*,int,const void*),
4976
- void(*xDestroy)(void*)
4994
+ int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*),
4995
+ void(SQLITE_CALLBACK *xDestroy)(void*)
49774996
);
4978
-SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
4997
+SQLITE_API int SQLITE_APICALL sqlite3_create_collation16(
49794998
sqlite3*,
49804999
const void *zName,
49815000
int eTextRep,
49825001
void *pArg,
4983
- int(*xCompare)(void*,int,const void*,int,const void*)
5002
+ int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*)
49845003
);
49855004
49865005
/*
49875006
** CAPI3REF: Collation Needed Callbacks
49885007
** METHOD: sqlite3
@@ -5008,19 +5027,19 @@
50085027
**
50095028
** The callback function should register the desired collation using
50105029
** [sqlite3_create_collation()], [sqlite3_create_collation16()], or
50115030
** [sqlite3_create_collation_v2()].
50125031
*/
5013
-SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
5032
+SQLITE_API int SQLITE_APICALL sqlite3_collation_needed(
50145033
sqlite3*,
50155034
void*,
5016
- void(*)(void*,sqlite3*,int eTextRep,const char*)
5035
+ void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const char*)
50175036
);
5018
-SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
5037
+SQLITE_API int SQLITE_APICALL sqlite3_collation_needed16(
50195038
sqlite3*,
50205039
void*,
5021
- void(*)(void*,sqlite3*,int eTextRep,const void*)
5040
+ void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const void*)
50225041
);
50235042
50245043
#ifdef SQLITE_HAS_CODEC
50255044
/*
50265045
** Specify the key for an encrypted database. This routine should be
@@ -5027,15 +5046,15 @@
50275046
** called right after sqlite3_open().
50285047
**
50295048
** The code to implement this API is not available in the public release
50305049
** of SQLite.
50315050
*/
5032
-SQLITE_API int SQLITE_STDCALL sqlite3_key(
5051
+SQLITE_API int SQLITE_APICALL sqlite3_key(
50335052
sqlite3 *db, /* Database to be rekeyed */
50345053
const void *pKey, int nKey /* The key */
50355054
);
5036
-SQLITE_API int SQLITE_STDCALL sqlite3_key_v2(
5055
+SQLITE_API int SQLITE_APICALL sqlite3_key_v2(
50375056
sqlite3 *db, /* Database to be rekeyed */
50385057
const char *zDbName, /* Name of the database */
50395058
const void *pKey, int nKey /* The key */
50405059
);
50415060
@@ -5045,35 +5064,35 @@
50455064
** database is decrypted.
50465065
**
50475066
** The code to implement this API is not available in the public release
50485067
** of SQLite.
50495068
*/
5050
-SQLITE_API int SQLITE_STDCALL sqlite3_rekey(
5069
+SQLITE_API int SQLITE_APICALL sqlite3_rekey(
50515070
sqlite3 *db, /* Database to be rekeyed */
50525071
const void *pKey, int nKey /* The new key */
50535072
);
5054
-SQLITE_API int SQLITE_STDCALL sqlite3_rekey_v2(
5073
+SQLITE_API int SQLITE_APICALL sqlite3_rekey_v2(
50555074
sqlite3 *db, /* Database to be rekeyed */
50565075
const char *zDbName, /* Name of the database */
50575076
const void *pKey, int nKey /* The new key */
50585077
);
50595078
50605079
/*
50615080
** Specify the activation key for a SEE database. Unless
50625081
** activated, none of the SEE routines will work.
50635082
*/
5064
-SQLITE_API void SQLITE_STDCALL sqlite3_activate_see(
5083
+SQLITE_API void SQLITE_APICALL sqlite3_activate_see(
50655084
const char *zPassPhrase /* Activation phrase */
50665085
);
50675086
#endif
50685087
50695088
#ifdef SQLITE_ENABLE_CEROD
50705089
/*
50715090
** Specify the activation key for a CEROD database. Unless
50725091
** activated, none of the CEROD routines will work.
50735092
*/
5074
-SQLITE_API void SQLITE_STDCALL sqlite3_activate_cerod(
5093
+SQLITE_API void SQLITE_APICALL sqlite3_activate_cerod(
50755094
const char *zPassPhrase /* Activation phrase */
50765095
);
50775096
#endif
50785097
50795098
/*
@@ -5091,11 +5110,11 @@
50915110
** method of the default [sqlite3_vfs] object. If the xSleep() method
50925111
** of the default VFS is not implemented correctly, or not implemented at
50935112
** all, then the behavior of sqlite3_sleep() may deviate from the description
50945113
** in the previous paragraphs.
50955114
*/
5096
-SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int);
5115
+SQLITE_API int SQLITE_APICALL sqlite3_sleep(int);
50975116
50985117
/*
50995118
** CAPI3REF: Name Of The Folder Holding Temporary Files
51005119
**
51015120
** ^(If this global variable is made to point to a string which is
@@ -5210,11 +5229,11 @@
52105229
**
52115230
** If another thread changes the autocommit status of the database
52125231
** connection while this routine is running, then the return value
52135232
** is undefined.
52145233
*/
5215
-SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3*);
5234
+SQLITE_API int SQLITE_APICALL sqlite3_get_autocommit(sqlite3*);
52165235
52175236
/*
52185237
** CAPI3REF: Find The Database Handle Of A Prepared Statement
52195238
** METHOD: sqlite3_stmt
52205239
**
@@ -5223,11 +5242,11 @@
52235242
** returned by sqlite3_db_handle is the same [database connection]
52245243
** that was the first argument
52255244
** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
52265245
** create the statement in the first place.
52275246
*/
5228
-SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt*);
5247
+SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_db_handle(sqlite3_stmt*);
52295248
52305249
/*
52315250
** CAPI3REF: Return The Filename For A Database Connection
52325251
** METHOD: sqlite3
52335252
**
@@ -5240,21 +5259,21 @@
52405259
** ^The filename returned by this function is the output of the
52415260
** xFullPathname method of the [VFS]. ^In other words, the filename
52425261
** will be an absolute pathname, even if the filename used
52435262
** to open the database originally was a URI or relative pathname.
52445263
*/
5245
-SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
5264
+SQLITE_API const char *SQLITE_APICALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
52465265
52475266
/*
52485267
** CAPI3REF: Determine if a database is read-only
52495268
** METHOD: sqlite3
52505269
**
52515270
** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N
52525271
** of connection D is read-only, 0 if it is read/write, or -1 if N is not
52535272
** the name of a database on connection D.
52545273
*/
5255
-SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
5274
+SQLITE_API int SQLITE_APICALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
52565275
52575276
/*
52585277
** CAPI3REF: Find the next prepared statement
52595278
** METHOD: sqlite3
52605279
**
@@ -5266,11 +5285,11 @@
52665285
**
52675286
** The [database connection] pointer D in a call to
52685287
** [sqlite3_next_stmt(D,S)] must refer to an open database
52695288
** connection and in particular must not be a NULL pointer.
52705289
*/
5271
-SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
5290
+SQLITE_API sqlite3_stmt *SQLITE_APICALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
52725291
52735292
/*
52745293
** CAPI3REF: Commit And Rollback Notification Callbacks
52755294
** METHOD: sqlite3
52765295
**
@@ -5315,12 +5334,12 @@
53155334
** ^The rollback callback is not invoked if a transaction is
53165335
** automatically rolled back because the database connection is closed.
53175336
**
53185337
** See also the [sqlite3_update_hook()] interface.
53195338
*/
5320
-SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
5321
-SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
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*);
53225341
53235342
/*
53245343
** CAPI3REF: Data Change Notification Callbacks
53255344
** METHOD: sqlite3
53265345
**
@@ -5367,13 +5386,13 @@
53675386
** the first call on D.
53685387
**
53695388
** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()],
53705389
** and [sqlite3_preupdate_hook()] interfaces.
53715390
*/
5372
-SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
5391
+SQLITE_API void *SQLITE_APICALL sqlite3_update_hook(
53735392
sqlite3*,
5374
- void(*)(void *,int ,char const *,char const *,sqlite3_int64),
5393
+ void(SQLITE_CALLBACK *)(void *,int ,char const *,char const *,sqlite3_int64),
53755394
void*
53765395
);
53775396
53785397
/*
53795398
** CAPI3REF: Enable Or Disable Shared Pager Cache
@@ -5407,11 +5426,11 @@
54075426
** This interface is threadsafe on processors where writing a
54085427
** 32-bit integer is atomic.
54095428
**
54105429
** See Also: [SQLite Shared-Cache Mode]
54115430
*/
5412
-SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int);
5431
+SQLITE_API int SQLITE_APICALL sqlite3_enable_shared_cache(int);
54135432
54145433
/*
54155434
** CAPI3REF: Attempt To Free Heap Memory
54165435
**
54175436
** ^The sqlite3_release_memory() interface attempts to free N bytes
@@ -5423,11 +5442,11 @@
54235442
** ^The sqlite3_release_memory() routine is a no-op returning zero
54245443
** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].
54255444
**
54265445
** See also: [sqlite3_db_release_memory()]
54275446
*/
5428
-SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int);
5447
+SQLITE_API int SQLITE_APICALL sqlite3_release_memory(int);
54295448
54305449
/*
54315450
** CAPI3REF: Free Memory Used By A Database Connection
54325451
** METHOD: sqlite3
54335452
**
@@ -5437,11 +5456,11 @@
54375456
** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
54385457
** omitted.
54395458
**
54405459
** See also: [sqlite3_release_memory()]
54415460
*/
5442
-SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3*);
5461
+SQLITE_API int SQLITE_APICALL sqlite3_db_release_memory(sqlite3*);
54435462
54445463
/*
54455464
** CAPI3REF: Impose A Limit On Heap Size
54465465
**
54475466
** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the
@@ -5489,11 +5508,11 @@
54895508
** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT].
54905509
**
54915510
** The circumstances under which SQLite will enforce the soft heap limit may
54925511
** changes in future releases of SQLite.
54935512
*/
5494
-SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
5513
+SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
54955514
54965515
/*
54975516
** CAPI3REF: Deprecated Soft Heap Limit Interface
54985517
** DEPRECATED
54995518
**
@@ -5500,11 +5519,11 @@
55005519
** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
55015520
** interface. This routine is provided for historical compatibility
55025521
** only. All new applications should use the
55035522
** [sqlite3_soft_heap_limit64()] interface rather than this one.
55045523
*/
5505
-SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_soft_heap_limit(int N);
5524
+SQLITE_API SQLITE_DEPRECATED void SQLITE_APICALL sqlite3_soft_heap_limit(int N);
55065525
55075526
55085527
/*
55095528
** CAPI3REF: Extract Metadata About A Column Of A Table
55105529
** METHOD: sqlite3
@@ -5570,11 +5589,11 @@
55705589
**
55715590
** ^This function causes all database schemas to be read from disk and
55725591
** parsed, if that has not already been done, and returns an error if
55735592
** any errors are encountered while loading the schema.
55745593
*/
5575
-SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
5594
+SQLITE_API int SQLITE_APICALL sqlite3_table_column_metadata(
55765595
sqlite3 *db, /* Connection handle */
55775596
const char *zDbName, /* Database name or NULL */
55785597
const char *zTableName, /* Table name */
55795598
const char *zColumnName, /* Column name */
55805599
char const **pzDataType, /* OUTPUT: Declared data type */
@@ -5626,11 +5645,11 @@
56265645
** disabled and prevent SQL injections from giving attackers
56275646
** access to extension loading capabilities.
56285647
**
56295648
** See also the [load_extension() SQL function].
56305649
*/
5631
-SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
5650
+SQLITE_API int SQLITE_APICALL sqlite3_load_extension(
56325651
sqlite3 *db, /* Load the extension into this database connection */
56335652
const char *zFile, /* Name of the shared library containing extension */
56345653
const char *zProc, /* Entry point. Derived from zFile if 0 */
56355654
char **pzErrMsg /* Put error message here if not 0 */
56365655
);
@@ -5658,11 +5677,11 @@
56585677
** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method
56595678
** rather than this interface, so the [load_extension()] SQL function
56605679
** remains disabled. This will prevent SQL injections from giving attackers
56615680
** access to extension loading capabilities.
56625681
*/
5663
-SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
5682
+SQLITE_API int SQLITE_APICALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
56645683
56655684
/*
56665685
** CAPI3REF: Automatically Load Statically Linked Extensions
56675686
**
56685687
** ^This interface causes the xEntryPoint() function to be invoked for
@@ -5670,11 +5689,11 @@
56705689
** xEntryPoint() is the entry point for a statically linked [SQLite extension]
56715690
** that is to be automatically loaded into all new database connections.
56725691
**
56735692
** ^(Even though the function prototype shows that xEntryPoint() takes
56745693
** no arguments and returns void, SQLite invokes xEntryPoint() with three
5675
-** arguments and expects and integer result as if the signature of the
5694
+** arguments and expects an integer result as if the signature of the
56765695
** entry point where as follows:
56775696
**
56785697
** <blockquote><pre>
56795698
** &nbsp; int xEntryPoint(
56805699
** &nbsp; sqlite3 *db,
@@ -5696,11 +5715,11 @@
56965715
** will be called more than once for each database connection that is opened.
56975716
**
56985717
** See also: [sqlite3_reset_auto_extension()]
56995718
** and [sqlite3_cancel_auto_extension()]
57005719
*/
5701
-SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void (*xEntryPoint)(void));
5720
+SQLITE_API int SQLITE_APICALL sqlite3_auto_extension(void(SQLITE_CALLBACK *xEntryPoint)(void));
57025721
57035722
/*
57045723
** CAPI3REF: Cancel Automatic Extension Loading
57055724
**
57065725
** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
@@ -5708,19 +5727,19 @@
57085727
** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)]
57095728
** routine returns 1 if initialization routine X was successfully
57105729
** unregistered and it returns 0 if X was not on the list of initialization
57115730
** routines.
57125731
*/
5713
-SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void (*xEntryPoint)(void));
5732
+SQLITE_API int SQLITE_APICALL sqlite3_cancel_auto_extension(void(SQLITE_CALLBACK *xEntryPoint)(void));
57145733
57155734
/*
57165735
** CAPI3REF: Reset Automatic Extension Loading
57175736
**
57185737
** ^This interface disables all automatic extensions previously
57195738
** registered using [sqlite3_auto_extension()].
57205739
*/
5721
-SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void);
5740
+SQLITE_API void SQLITE_APICALL sqlite3_reset_auto_extension(void);
57225741
57235742
/*
57245743
** The interface to the virtual-table mechanism is currently considered
57255744
** to be experimental. The interface might change in incompatible ways.
57265745
** If this is a problem for you, do not use the interface at this time.
@@ -5753,41 +5772,41 @@
57535772
** of this structure must not change while it is registered with
57545773
** any database connection.
57555774
*/
57565775
struct sqlite3_module {
57575776
int iVersion;
5758
- int (*xCreate)(sqlite3*, void *pAux,
5759
- int argc, const char *const*argv,
5760
- sqlite3_vtab **ppVTab, char**);
5761
- int (*xConnect)(sqlite3*, void *pAux,
5762
- int argc, const char *const*argv,
5763
- sqlite3_vtab **ppVTab, char**);
5764
- int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
5765
- int (*xDisconnect)(sqlite3_vtab *pVTab);
5766
- int (*xDestroy)(sqlite3_vtab *pVTab);
5767
- int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);
5768
- int (*xClose)(sqlite3_vtab_cursor*);
5769
- int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
5770
- int argc, sqlite3_value **argv);
5771
- int (*xNext)(sqlite3_vtab_cursor*);
5772
- int (*xEof)(sqlite3_vtab_cursor*);
5773
- int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int);
5774
- int (*xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid);
5775
- int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *);
5776
- int (*xBegin)(sqlite3_vtab *pVTab);
5777
- int (*xSync)(sqlite3_vtab *pVTab);
5778
- int (*xCommit)(sqlite3_vtab *pVTab);
5779
- int (*xRollback)(sqlite3_vtab *pVTab);
5780
- int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,
5781
- void (**pxFunc)(sqlite3_context*,int,sqlite3_value**),
5782
- void **ppArg);
5783
- int (*xRename)(sqlite3_vtab *pVtab, const char *zNew);
5784
- /* The methods above are in version 1 of the sqlite_module object. Those
5785
- ** below are for version 2 and greater. */
5786
- int (*xSavepoint)(sqlite3_vtab *pVTab, int);
5787
- int (*xRelease)(sqlite3_vtab *pVTab, int);
5788
- int (*xRollbackTo)(sqlite3_vtab *pVTab, int);
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);
57895808
};
57905809
57915810
/*
57925811
** CAPI3REF: Virtual Table Indexing Information
57935812
** KEYWORDS: sqlite3_index_info
@@ -5961,22 +5980,22 @@
59615980
** be invoked if the call to sqlite3_create_module_v2() fails.
59625981
** ^The sqlite3_create_module()
59635982
** interface is equivalent to sqlite3_create_module_v2() with a NULL
59645983
** destructor.
59655984
*/
5966
-SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
5985
+SQLITE_API int SQLITE_APICALL sqlite3_create_module(
59675986
sqlite3 *db, /* SQLite connection to register module with */
59685987
const char *zName, /* Name of the module */
59695988
const sqlite3_module *p, /* Methods for the module */
59705989
void *pClientData /* Client data for xCreate/xConnect */
59715990
);
5972
-SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
5991
+SQLITE_API int SQLITE_APICALL sqlite3_create_module_v2(
59735992
sqlite3 *db, /* SQLite connection to register module with */
59745993
const char *zName, /* Name of the module */
59755994
const sqlite3_module *p, /* Methods for the module */
59765995
void *pClientData, /* Client data for xCreate/xConnect */
5977
- void(*xDestroy)(void*) /* Module destructor function */
5996
+ void(SQLITE_CALLBACK *xDestroy)(void*) /* Module destructor function */
59785997
);
59795998
59805999
/*
59816000
** CAPI3REF: Virtual Table Instance Object
59826001
** KEYWORDS: sqlite3_vtab
@@ -6030,11 +6049,11 @@
60306049
** ^The [xCreate] and [xConnect] methods of a
60316050
** [virtual table module] call this interface
60326051
** to declare the format (the names and datatypes of the columns) of
60336052
** the virtual tables they implement.
60346053
*/
6035
-SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
6054
+SQLITE_API int SQLITE_APICALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
60366055
60376056
/*
60386057
** CAPI3REF: Overload A Function For A Virtual Table
60396058
** METHOD: sqlite3
60406059
**
@@ -6049,11 +6068,11 @@
60496068
** of the new function always causes an exception to be thrown. So
60506069
** the new function is not good for anything by itself. Its only
60516070
** purpose is to be a placeholder function that can be overloaded
60526071
** by a [virtual table].
60536072
*/
6054
-SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
6073
+SQLITE_API int SQLITE_APICALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
60556074
60566075
/*
60576076
** The interface to the virtual-table mechanism defined above (back up
60586077
** to a comment remarkably similar to this one) is currently considered
60596078
** to be experimental. The interface might change in incompatible ways.
@@ -6148,11 +6167,11 @@
61486167
** zero-filled blob to read or write using the incremental-blob interface.
61496168
**
61506169
** To avoid a resource leak, every open [BLOB handle] should eventually
61516170
** be released by a call to [sqlite3_blob_close()].
61526171
*/
6153
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
6172
+SQLITE_API int SQLITE_APICALL sqlite3_blob_open(
61546173
sqlite3*,
61556174
const char *zDb,
61566175
const char *zTable,
61576176
const char *zColumn,
61586177
sqlite3_int64 iRow,
@@ -6181,11 +6200,11 @@
61816200
** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
61826201
** always returns zero.
61836202
**
61846203
** ^This function sets the database handle error code and message.
61856204
*/
6186
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
6205
+SQLITE_API int SQLITE_APICALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
61876206
61886207
/*
61896208
** CAPI3REF: Close A BLOB Handle
61906209
** DESTRUCTOR: sqlite3_blob
61916210
**
@@ -6204,11 +6223,11 @@
62046223
** with a null pointer (such as would be returned by a failed call to
62056224
** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function
62066225
** is passed a valid open blob handle, the values returned by the
62076226
** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning.
62086227
*/
6209
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *);
6228
+SQLITE_API int SQLITE_APICALL sqlite3_blob_close(sqlite3_blob *);
62106229
62116230
/*
62126231
** CAPI3REF: Return The Size Of An Open BLOB
62136232
** METHOD: sqlite3_blob
62146233
**
@@ -6220,11 +6239,11 @@
62206239
** This routine only works on a [BLOB handle] which has been created
62216240
** by a prior successful call to [sqlite3_blob_open()] and which has not
62226241
** been closed by [sqlite3_blob_close()]. Passing any other pointer in
62236242
** to this routine results in undefined and probably undesirable behavior.
62246243
*/
6225
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *);
6244
+SQLITE_API int SQLITE_APICALL sqlite3_blob_bytes(sqlite3_blob *);
62266245
62276246
/*
62286247
** CAPI3REF: Read Data From A BLOB Incrementally
62296248
** METHOD: sqlite3_blob
62306249
**
@@ -6249,11 +6268,11 @@
62496268
** been closed by [sqlite3_blob_close()]. Passing any other pointer in
62506269
** to this routine results in undefined and probably undesirable behavior.
62516270
**
62526271
** See also: [sqlite3_blob_write()].
62536272
*/
6254
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
6273
+SQLITE_API int SQLITE_APICALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
62556274
62566275
/*
62576276
** CAPI3REF: Write Data Into A BLOB Incrementally
62586277
** METHOD: sqlite3_blob
62596278
**
@@ -6291,11 +6310,11 @@
62916310
** been closed by [sqlite3_blob_close()]. Passing any other pointer in
62926311
** to this routine results in undefined and probably undesirable behavior.
62936312
**
62946313
** See also: [sqlite3_blob_read()].
62956314
*/
6296
-SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
6315
+SQLITE_API int SQLITE_APICALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
62976316
62986317
/*
62996318
** CAPI3REF: Virtual File System Objects
63006319
**
63016320
** A virtual filesystem (VFS) is an [sqlite3_vfs] object
@@ -6322,13 +6341,13 @@
63226341
**
63236342
** ^Unregister a VFS with the sqlite3_vfs_unregister() interface.
63246343
** ^(If the default VFS is unregistered, another VFS is chosen as
63256344
** the default. The choice for the new VFS is arbitrary.)^
63266345
*/
6327
-SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfsName);
6328
-SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
6329
-SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs*);
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*);
63306349
63316350
/*
63326351
** CAPI3REF: Mutexes
63336352
**
63346353
** The SQLite core uses these routines for thread
@@ -6440,15 +6459,15 @@
64406459
** sqlite3_mutex_leave() is a NULL pointer, then all three routines
64416460
** behave as no-ops.
64426461
**
64436462
** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
64446463
*/
6445
-SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int);
6446
-SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*);
6447
-SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*);
6448
-SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*);
6449
-SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*);
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*);
64506469
64516470
/*
64526471
** CAPI3REF: Mutex Methods Object
64536472
**
64546473
** An instance of this structure defines the low-level routines
@@ -6513,19 +6532,19 @@
65136532
** If xMutexInit fails in any way, it is expected to clean up after itself
65146533
** prior to returning.
65156534
*/
65166535
typedef struct sqlite3_mutex_methods sqlite3_mutex_methods;
65176536
struct sqlite3_mutex_methods {
6518
- int (*xMutexInit)(void);
6519
- int (*xMutexEnd)(void);
6520
- sqlite3_mutex *(*xMutexAlloc)(int);
6521
- void (*xMutexFree)(sqlite3_mutex *);
6522
- void (*xMutexEnter)(sqlite3_mutex *);
6523
- int (*xMutexTry)(sqlite3_mutex *);
6524
- void (*xMutexLeave)(sqlite3_mutex *);
6525
- int (*xMutexHeld)(sqlite3_mutex *);
6526
- int (*xMutexNotheld)(sqlite3_mutex *);
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 *);
65276546
};
65286547
65296548
/*
65306549
** CAPI3REF: Mutex Verification Routines
65316550
**
@@ -6554,12 +6573,12 @@
65546573
** call to sqlite3_mutex_held() to fail, so a non-zero return is
65556574
** the appropriate thing to do. The sqlite3_mutex_notheld()
65566575
** interface should also return 1 when given a NULL pointer.
65576576
*/
65586577
#ifndef NDEBUG
6559
-SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex*);
6560
-SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex*);
6578
+SQLITE_API int SQLITE_APICALL sqlite3_mutex_held(sqlite3_mutex*);
6579
+SQLITE_API int SQLITE_APICALL sqlite3_mutex_notheld(sqlite3_mutex*);
65616580
#endif
65626581
65636582
/*
65646583
** CAPI3REF: Mutex Types
65656584
**
@@ -6595,11 +6614,11 @@
65956614
** serializes access to the [database connection] given in the argument
65966615
** when the [threading mode] is Serialized.
65976616
** ^If the [threading mode] is Single-thread or Multi-thread then this
65986617
** routine returns a NULL pointer.
65996618
*/
6600
-SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3*);
6619
+SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_db_mutex(sqlite3*);
66016620
66026621
/*
66036622
** CAPI3REF: Low-Level Control Of Database Files
66046623
** METHOD: sqlite3
66056624
**
@@ -6630,11 +6649,11 @@
66306649
** an incorrect zDbName and an SQLITE_ERROR return from the underlying
66316650
** xFileControl method.
66326651
**
66336652
** See also: [SQLITE_FCNTL_LOCKSTATE]
66346653
*/
6635
-SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
6654
+SQLITE_API int SQLITE_APICALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
66366655
66376656
/*
66386657
** CAPI3REF: Testing Interface
66396658
**
66406659
** ^The sqlite3_test_control() interface is used to read out internal
@@ -6712,12 +6731,12 @@
67126731
** be represented by a 32-bit integer, then the values returned by
67136732
** sqlite3_status() are undefined.
67146733
**
67156734
** See also: [sqlite3_db_status()]
67166735
*/
6717
-SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6718
-SQLITE_API int SQLITE_STDCALL sqlite3_status64(
6736
+SQLITE_API int SQLITE_APICALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6737
+SQLITE_API int SQLITE_APICALL sqlite3_status64(
67196738
int op,
67206739
sqlite3_int64 *pCurrent,
67216740
sqlite3_int64 *pHighwater,
67226741
int resetFlag
67236742
);
@@ -6838,11 +6857,11 @@
68386857
** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a
68396858
** non-zero [error code] on failure.
68406859
**
68416860
** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
68426861
*/
6843
-SQLITE_API int SQLITE_STDCALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
6862
+SQLITE_API int SQLITE_APICALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
68446863
68456864
/*
68466865
** CAPI3REF: Status Parameters for database connections
68476866
** KEYWORDS: {SQLITE_DBSTATUS options}
68486867
**
@@ -6981,11 +7000,11 @@
69817000
** ^If the resetFlg is true, then the counter is reset to zero after this
69827001
** interface call returns.
69837002
**
69847003
** See also: [sqlite3_status()] and [sqlite3_db_status()].
69857004
*/
6986
-SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
7005
+SQLITE_API int SQLITE_APICALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
69877006
69887007
/*
69897008
** CAPI3REF: Status Parameters for prepared statements
69907009
** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters}
69917010
**
@@ -7217,22 +7236,22 @@
72177236
*/
72187237
typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2;
72197238
struct sqlite3_pcache_methods2 {
72207239
int iVersion;
72217240
void *pArg;
7222
- int (*xInit)(void*);
7223
- void (*xShutdown)(void*);
7224
- sqlite3_pcache *(*xCreate)(int szPage, int szExtra, int bPurgeable);
7225
- void (*xCachesize)(sqlite3_pcache*, int nCachesize);
7226
- int (*xPagecount)(sqlite3_pcache*);
7227
- sqlite3_pcache_page *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7228
- void (*xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard);
7229
- void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*,
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*,
72307249
unsigned oldKey, unsigned newKey);
7231
- void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
7232
- void (*xDestroy)(sqlite3_pcache*);
7233
- void (*xShrink)(sqlite3_pcache*);
7250
+ void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit);
7251
+ void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*);
7252
+ void (SQLITE_CALLBACK *xShrink)(sqlite3_pcache*);
72347253
};
72357254
72367255
/*
72377256
** This is the obsolete pcache_methods object that has now been replaced
72387257
** by sqlite3_pcache_methods2. This object is not used by SQLite. It is
@@ -7239,20 +7258,20 @@
72397258
** retained in the header file for backwards compatibility only.
72407259
*/
72417260
typedef struct sqlite3_pcache_methods sqlite3_pcache_methods;
72427261
struct sqlite3_pcache_methods {
72437262
void *pArg;
7244
- int (*xInit)(void*);
7245
- void (*xShutdown)(void*);
7246
- sqlite3_pcache *(*xCreate)(int szPage, int bPurgeable);
7247
- void (*xCachesize)(sqlite3_pcache*, int nCachesize);
7248
- int (*xPagecount)(sqlite3_pcache*);
7249
- void *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7250
- void (*xUnpin)(sqlite3_pcache*, void*, int discard);
7251
- void (*xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey);
7252
- void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
7253
- void (*xDestroy)(sqlite3_pcache*);
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*);
72547273
};
72557274
72567275
72577276
/*
72587277
** CAPI3REF: Online Backup Object
@@ -7450,20 +7469,20 @@
74507469
** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()
74517470
** APIs are not strictly speaking threadsafe. If they are invoked at the
74527471
** same time as another thread is invoking sqlite3_backup_step() it is
74537472
** possible that they return invalid values.
74547473
*/
7455
-SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
7474
+SQLITE_API sqlite3_backup *SQLITE_APICALL sqlite3_backup_init(
74567475
sqlite3 *pDest, /* Destination database handle */
74577476
const char *zDestName, /* Destination database name */
74587477
sqlite3 *pSource, /* Source database handle */
74597478
const char *zSourceName /* Source database name */
74607479
);
7461
-SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage);
7462
-SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p);
7463
-SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p);
7464
-SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p);
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);
74657484
74667485
/*
74677486
** CAPI3REF: Unlock Notification
74687487
** METHOD: sqlite3
74697488
**
@@ -7576,13 +7595,13 @@
75767595
** by an sqlite3_step() call. ^(If there is a blocking connection, then the
75777596
** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in
75787597
** the special "DROP TABLE/INDEX" case, the extended error code is just
75797598
** SQLITE_LOCKED.)^
75807599
*/
7581
-SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
7600
+SQLITE_API int SQLITE_APICALL sqlite3_unlock_notify(
75827601
sqlite3 *pBlocked, /* Waiting connection */
7583
- void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */
7602
+ void (SQLITE_CALLBACK *xNotify)(void **apArg, int nArg), /* Callback function to invoke */
75847603
void *pNotifyArg /* Argument to pass to xNotify */
75857604
);
75867605
75877606
75887607
/*
@@ -7591,12 +7610,12 @@
75917610
** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications
75927611
** and extensions to compare the contents of two buffers containing UTF-8
75937612
** strings in a case-independent fashion, using the same definition of "case
75947613
** independence" that SQLite uses internally when comparing identifiers.
75957614
*/
7596
-SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *, const char *);
7597
-SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *, const char *, int);
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);
75987617
75997618
/*
76007619
** CAPI3REF: String Globbing
76017620
*
76027621
** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if
@@ -7609,11 +7628,11 @@
76097628
** Note that this routine returns zero on a match and non-zero if the strings
76107629
** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
76117630
**
76127631
** See also: [sqlite3_strlike()].
76137632
*/
7614
-SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlob, const char *zStr);
7633
+SQLITE_API int SQLITE_APICALL sqlite3_strglob(const char *zGlob, const char *zStr);
76157634
76167635
/*
76177636
** CAPI3REF: String LIKE Matching
76187637
*
76197638
** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if
@@ -7632,11 +7651,11 @@
76327651
** Note that this routine returns zero on a match and non-zero if the strings
76337652
** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
76347653
**
76357654
** See also: [sqlite3_strglob()].
76367655
*/
7637
-SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
7656
+SQLITE_API int SQLITE_APICALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
76387657
76397658
/*
76407659
** CAPI3REF: Error Logging Interface
76417660
**
76427661
** ^The [sqlite3_log()] interface writes a message into the [error log]
@@ -7691,13 +7710,13 @@
76917710
** previously registered write-ahead log callback. ^Note that the
76927711
** [sqlite3_wal_autocheckpoint()] interface and the
76937712
** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will
76947713
** overwrite any prior [sqlite3_wal_hook()] settings.
76957714
*/
7696
-SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
7715
+SQLITE_API void *SQLITE_APICALL sqlite3_wal_hook(
76977716
sqlite3*,
7698
- int(*)(void *,sqlite3*,const char*,int),
7717
+ int(SQLITE_CALLBACK *)(void *,sqlite3*,const char*,int),
76997718
void*
77007719
);
77017720
77027721
/*
77037722
** CAPI3REF: Configure an auto-checkpoint
@@ -7726,11 +7745,11 @@
77267745
** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]
77277746
** pages. The use of this interface
77287747
** is only necessary if the default setting is found to be suboptimal
77297748
** for a particular application.
77307749
*/
7731
-SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
7750
+SQLITE_API int SQLITE_APICALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
77327751
77337752
/*
77347753
** CAPI3REF: Checkpoint a database
77357754
** METHOD: sqlite3
77367755
**
@@ -7748,11 +7767,11 @@
77487767
** interface was added. This interface is retained for backwards
77497768
** compatibility and as a convenience for applications that need to manually
77507769
** start a callback but which do not need the full power (and corresponding
77517770
** complication) of [sqlite3_wal_checkpoint_v2()].
77527771
*/
7753
-SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
7772
+SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
77547773
77557774
/*
77567775
** CAPI3REF: Checkpoint a database
77577776
** METHOD: sqlite3
77587777
**
@@ -7842,11 +7861,11 @@
78427861
** [sqlite3_errcode()] and [sqlite3_errmsg()].
78437862
**
78447863
** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface
78457864
** from SQL.
78467865
*/
7847
-SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
7866
+SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint_v2(
78487867
sqlite3 *db, /* Database handle */
78497868
const char *zDb, /* Name of attached database (or NULL) */
78507869
int eMode, /* SQLITE_CHECKPOINT_* value */
78517870
int *pnLog, /* OUT: Size of WAL log in frames */
78527871
int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -7931,11 +7950,11 @@
79317950
** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL],
79327951
** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode
79337952
** of the SQL statement that triggered the call to the [xUpdate] method of the
79347953
** [virtual table].
79357954
*/
7936
-SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *);
7955
+SQLITE_API int SQLITE_APICALL sqlite3_vtab_on_conflict(sqlite3 *);
79377956
79387957
/*
79397958
** CAPI3REF: Conflict resolution modes
79407959
** KEYWORDS: {conflict resolution mode}
79417960
**
@@ -8036,11 +8055,11 @@
80368055
** as if the loop did not exist - it returns non-zero and leave the variable
80378056
** that pOut points to unchanged.
80388057
**
80398058
** See also: [sqlite3_stmt_scanstatus_reset()]
80408059
*/
8041
-SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus(
8060
+SQLITE_API int SQLITE_APICALL sqlite3_stmt_scanstatus(
80428061
sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
80438062
int idx, /* Index of loop to report on */
80448063
int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
80458064
void *pOut /* Result written here */
80468065
);
@@ -8052,11 +8071,11 @@
80528071
** ^Zero all [sqlite3_stmt_scanstatus()] related event counters.
80538072
**
80548073
** This API is only available if the library is built with pre-processor
80558074
** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined.
80568075
*/
8057
-SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
8076
+SQLITE_API void SQLITE_APICALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
80588077
80598078
/*
80608079
** CAPI3REF: Flush caches to disk mid-transaction
80618080
**
80628081
** ^If a write-transaction is open on [database connection] D when the
@@ -8084,11 +8103,11 @@
80848103
** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK.
80858104
**
80868105
** ^This function does not set the database handle error code or message
80878106
** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions.
80888107
*/
8089
-SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3*);
8108
+SQLITE_API int SQLITE_APICALL sqlite3_db_cacheflush(sqlite3*);
80908109
80918110
/*
80928111
** CAPI3REF: The pre-update hook.
80938112
**
80948113
** ^These interfaces are only available if SQLite is compiled using the
@@ -8164,13 +8183,13 @@
81648183
** triggers; or 2 for changes resulting from triggers called by top-level
81658184
** triggers; and so forth.
81668185
**
81678186
** See also: [sqlite3_update_hook()]
81688187
*/
8169
-SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_STDCALL sqlite3_preupdate_hook(
8188
+SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_APICALL sqlite3_preupdate_hook(
81708189
sqlite3 *db,
8171
- void(*xPreUpdate)(
8190
+ void(SQLITE_CALLBACK *xPreUpdate)(
81728191
void *pCtx, /* Copy of third arg to preupdate_hook() */
81738192
sqlite3 *db, /* Database handle */
81748193
int op, /* SQLITE_UPDATE, DELETE or INSERT */
81758194
char const *zDb, /* Database name */
81768195
char const *zName, /* Table name */
@@ -8177,14 +8196,14 @@
81778196
sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */
81788197
sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */
81798198
),
81808199
void*
81818200
);
8182
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **);
8183
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *);
8184
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *);
8185
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **);
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 **);
81868205
81878206
/*
81888207
** CAPI3REF: Low-level system error code
81898208
**
81908209
** ^Attempt to return the underlying operating system error code or error
@@ -8192,11 +8211,11 @@
81928211
** The return value is OS-dependent. For example, on unix systems, after
81938212
** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be
81948213
** called to get back the underlying "errno" that caused the problem, such
81958214
** as ENOSPC, EAUTH, EISDIR, and so forth.
81968215
*/
8197
-SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3*);
8216
+SQLITE_API int SQLITE_APICALL sqlite3_system_errno(sqlite3*);
81988217
81998218
/*
82008219
** CAPI3REF: Database Snapshot
82018220
** KEYWORDS: {snapshot}
82028221
** EXPERIMENTAL
@@ -8242,11 +8261,11 @@
82428261
** to avoid a memory leak.
82438262
**
82448263
** The [sqlite3_snapshot_get()] interface is only available when the
82458264
** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
82468265
*/
8247
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_get(
8266
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_get(
82488267
sqlite3 *db,
82498268
const char *zSchema,
82508269
sqlite3_snapshot **ppSnapshot
82518270
);
82528271
@@ -8280,11 +8299,11 @@
82808299
** database connection in order to make it ready to use snapshots.)
82818300
**
82828301
** The [sqlite3_snapshot_open()] interface is only available when the
82838302
** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
82848303
*/
8285
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_open(
8304
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_open(
82868305
sqlite3 *db,
82878306
const char *zSchema,
82888307
sqlite3_snapshot *pSnapshot
82898308
);
82908309
@@ -8297,11 +8316,11 @@
82978316
** using this routine to avoid a memory leak.
82988317
**
82998318
** The [sqlite3_snapshot_free()] interface is only available when the
83008319
** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
83018320
*/
8302
-SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot*);
8321
+SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_APICALL sqlite3_snapshot_free(sqlite3_snapshot*);
83038322
83048323
/*
83058324
** CAPI3REF: Compare the ages of two snapshot handles.
83068325
** EXPERIMENTAL
83078326
**
@@ -8321,11 +8340,11 @@
83218340
**
83228341
** Otherwise, this API returns a negative value if P1 refers to an older
83238342
** snapshot than P2, zero if the two handles refer to the same database
83248343
** snapshot, and a positive value if P1 is a newer snapshot than P2.
83258344
*/
8326
-SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_cmp(
8345
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_cmp(
83278346
sqlite3_snapshot *p1,
83288347
sqlite3_snapshot *p2
83298348
);
83308349
83318350
/*
@@ -8379,14 +8398,14 @@
83798398
** Register a geometry callback named zGeom that can be used as part of an
83808399
** R-Tree geometry query as follows:
83818400
**
83828401
** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
83838402
*/
8384
-SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
8403
+SQLITE_API int SQLITE_APICALL sqlite3_rtree_geometry_callback(
83858404
sqlite3 *db,
83868405
const char *zGeom,
8387
- int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
8406
+ int (SQLITE_CALLBACK *xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
83888407
void *pContext
83898408
);
83908409
83918410
83928411
/*
@@ -8396,25 +8415,25 @@
83968415
struct sqlite3_rtree_geometry {
83978416
void *pContext; /* Copy of pContext passed to s_r_g_c() */
83988417
int nParam; /* Size of array aParam[] */
83998418
sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */
84008419
void *pUser; /* Callback implementation user data */
8401
- void (*xDelUser)(void *); /* Called by SQLite to clean up pUser */
8420
+ void (SQLITE_CALLBACK *xDelUser)(void *); /* Called by SQLite to clean up pUser */
84028421
};
84038422
84048423
/*
84058424
** Register a 2nd-generation geometry callback named zScore that can be
84068425
** used as part of an R-Tree geometry query as follows:
84078426
**
84088427
** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...)
84098428
*/
8410
-SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
8429
+SQLITE_API int SQLITE_APICALL sqlite3_rtree_query_callback(
84118430
sqlite3 *db,
84128431
const char *zQueryFunc,
8413
- int (*xQueryFunc)(sqlite3_rtree_query_info*),
8432
+ int (SQLITE_CALLBACK *xQueryFunc)(sqlite3_rtree_query_info*),
84148433
void *pContext,
8415
- void (*xDestructor)(void*)
8434
+ void (SQLITE_CALLBACK *xDestructor)(void*)
84168435
);
84178436
84188437
84198438
/*
84208439
** A pointer to a structure of the following type is passed as the
@@ -8428,11 +8447,11 @@
84288447
struct sqlite3_rtree_query_info {
84298448
void *pContext; /* pContext from when function registered */
84308449
int nParam; /* Number of function parameters */
84318450
sqlite3_rtree_dbl *aParam; /* value of function parameters */
84328451
void *pUser; /* callback can use this, if desired */
8433
- void (*xDelUser)(void*); /* function to free pUser */
8452
+ void (SQLITE_CALLBACK *xDelUser)(void*); /* function to free pUser */
84348453
sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */
84358454
unsigned int *anQueue; /* Number of pending entries in the queue */
84368455
int nCoord; /* Number of coordinates */
84378456
int iLevel; /* Level of current node or entry */
84388457
int mxLevel; /* The largest iLevel value in the tree */
@@ -8624,11 +8643,11 @@
86248643
** If xFilter returns 0, changes is not tracked. Note that once a table is
86258644
** attached, xFilter will not be called again.
86268645
*/
86278646
void sqlite3session_table_filter(
86288647
sqlite3_session *pSession, /* Session object */
8629
- int(*xFilter)(
8648
+ int(SQLITE_CALLBACK *xFilter)(
86308649
void *pCtx, /* Copy of third arg to _filter_table() */
86318650
const char *zTab /* Table name */
86328651
),
86338652
void *pCtx /* First argument passed to xFilter */
86348653
);
@@ -9199,11 +9218,11 @@
91999218
** An sqlite3_changegroup object is used to combine two or more changesets
92009219
** (or patchsets) into a single changeset (or patchset). A single changegroup
92019220
** object may combine changesets or patchsets, but not both. The output is
92029221
** always in the same format as the input.
92039222
**
9204
-** If successful, this function returns SQLITE_OK and populates (*pp) with
9223
+** If successful, this function returns SQLITE_OK and populates (SQLITE_CALLBACK *pp) with
92059224
** a pointer to a new sqlite3_changegroup object before returning. The caller
92069225
** should eventually free the returned object using a call to
92079226
** sqlite3changegroup_delete(). If an error occurs, an SQLite error code
92089227
** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL.
92099228
**
@@ -9319,11 +9338,11 @@
93199338
** changes for tables that do not appear in the first changeset, they are
93209339
** appended onto the end of the output changeset, again in the order in
93219340
** which they are first encountered.
93229341
**
93239342
** If an error occurs, an SQLite error code is returned and the output
9324
-** variables (*pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK
9343
+** variables (SQLITE_CALLBACK *pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK
93259344
** is returned and the output variables are set to the size of and a
93269345
** pointer to the output buffer, respectively. In this case it is the
93279346
** responsibility of the caller to eventually free the buffer using a
93289347
** call to sqlite3_free().
93299348
*/
@@ -9476,15 +9495,15 @@
94769495
*/
94779496
int sqlite3changeset_apply(
94789497
sqlite3 *db, /* Apply change to "main" db of this handle */
94799498
int nChangeset, /* Size of changeset in bytes */
94809499
void *pChangeset, /* Changeset blob */
9481
- int(*xFilter)(
9500
+ int(SQLITE_CALLBACK *xFilter)(
94829501
void *pCtx, /* Copy of sixth arg to _apply() */
94839502
const char *zTab /* Table name */
94849503
),
9485
- int(*xConflict)(
9504
+ int(SQLITE_CALLBACK *xConflict)(
94869505
void *pCtx, /* Copy of sixth arg to _apply() */
94879506
int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
94889507
sqlite3_changeset_iter *p /* Handle describing change and conflict */
94899508
),
94909509
void *pCtx /* First argument passed to xConflict */
@@ -9621,20 +9640,20 @@
96219640
** </pre>
96229641
**
96239642
** Is replaced by:
96249643
**
96259644
** <pre>
9626
-** &nbsp; int (*xInput)(void *pIn, void *pData, int *pnData),
9645
+** &nbsp; int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
96279646
** &nbsp; void *pIn,
96289647
** </pre>
96299648
**
96309649
** Each time the xInput callback is invoked by the sessions module, the first
96319650
** argument passed is a copy of the supplied pIn context pointer. The second
9632
-** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no
9633
-** error occurs the xInput method should copy up to (*pnData) bytes of data
9634
-** into the buffer and set (*pnData) to the actual number of bytes copied
9635
-** before returning SQLITE_OK. If the input is completely exhausted, (*pnData)
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)
96369655
** should be set to zero to indicate this. Or, if an error occurs, an SQLite
96379656
** error code should be returned. In all cases, if an xInput callback returns
96389657
** an error, all processing is abandoned and the streaming API function
96399658
** returns a copy of the error code to the caller.
96409659
**
@@ -9655,11 +9674,11 @@
96559674
** </pre>
96569675
**
96579676
** Is replaced by:
96589677
**
96599678
** <pre>
9660
-** &nbsp; int (*xOutput)(void *pOut, const void *pData, int nData),
9679
+** &nbsp; int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
96619680
** &nbsp; void *pOut
96629681
** </pre>
96639682
**
96649683
** The xOutput callback is invoked zero or more times to return data to
96659684
** the application. The first parameter passed to each call is a copy of the
@@ -9675,58 +9694,58 @@
96759694
** parameter set to a value less than or equal to zero. Other than this,
96769695
** no guarantees are made as to the size of the chunks of data returned.
96779696
*/
96789697
int sqlite3changeset_apply_strm(
96799698
sqlite3 *db, /* Apply change to "main" db of this handle */
9680
- int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
9699
+ int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), /* Input function */
96819700
void *pIn, /* First arg for xInput */
9682
- int(*xFilter)(
9701
+ int(SQLITE_CALLBACK *xFilter)(
96839702
void *pCtx, /* Copy of sixth arg to _apply() */
96849703
const char *zTab /* Table name */
96859704
),
9686
- int(*xConflict)(
9705
+ int(SQLITE_CALLBACK *xConflict)(
96879706
void *pCtx, /* Copy of sixth arg to _apply() */
96889707
int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
96899708
sqlite3_changeset_iter *p /* Handle describing change and conflict */
96909709
),
96919710
void *pCtx /* First argument passed to xConflict */
96929711
);
96939712
int sqlite3changeset_concat_strm(
9694
- int (*xInputA)(void *pIn, void *pData, int *pnData),
9713
+ int (SQLITE_CALLBACK *xInputA)(void *pIn, void *pData, int *pnData),
96959714
void *pInA,
9696
- int (*xInputB)(void *pIn, void *pData, int *pnData),
9715
+ int (SQLITE_CALLBACK *xInputB)(void *pIn, void *pData, int *pnData),
96979716
void *pInB,
9698
- int (*xOutput)(void *pOut, const void *pData, int nData),
9717
+ int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
96999718
void *pOut
97009719
);
97019720
int sqlite3changeset_invert_strm(
9702
- int (*xInput)(void *pIn, void *pData, int *pnData),
9721
+ int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
97039722
void *pIn,
9704
- int (*xOutput)(void *pOut, const void *pData, int nData),
9723
+ int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
97059724
void *pOut
97069725
);
97079726
int sqlite3changeset_start_strm(
97089727
sqlite3_changeset_iter **pp,
9709
- int (*xInput)(void *pIn, void *pData, int *pnData),
9728
+ int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
97109729
void *pIn
97119730
);
97129731
int sqlite3session_changeset_strm(
97139732
sqlite3_session *pSession,
9714
- int (*xOutput)(void *pOut, const void *pData, int nData),
9733
+ int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
97159734
void *pOut
97169735
);
97179736
int sqlite3session_patchset_strm(
97189737
sqlite3_session *pSession,
9719
- int (*xOutput)(void *pOut, const void *pData, int nData),
9738
+ int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
97209739
void *pOut
97219740
);
97229741
int sqlite3changegroup_add_strm(sqlite3_changegroup*,
9723
- int (*xInput)(void *pIn, void *pData, int *pnData),
9742
+ int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData),
97249743
void *pIn
97259744
);
97269745
int sqlite3changegroup_output_strm(sqlite3_changegroup*,
9727
- int (*xOutput)(void *pOut, const void *pData, int nData),
9746
+ int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData),
97289747
void *pOut
97299748
);
97309749
97319750
97329751
/*
@@ -9777,11 +9796,11 @@
97779796
97789797
typedef struct Fts5ExtensionApi Fts5ExtensionApi;
97799798
typedef struct Fts5Context Fts5Context;
97809799
typedef struct Fts5PhraseIter Fts5PhraseIter;
97819800
9782
-typedef void (*fts5_extension_function)(
9801
+typedef void (SQLITE_CALLBACK *fts5_extension_function)(
97839802
const Fts5ExtensionApi *pApi, /* API offered by current FTS version */
97849803
Fts5Context *pFts, /* First arg to pass to pApi functions */
97859804
sqlite3_context *pCtx, /* Context for returning result/error */
97869805
int nVal, /* Number of values in apVal[] array */
97879806
sqlite3_value **apVal /* Array of trailing arguments */
@@ -9828,15 +9847,15 @@
98289847
** This function may be quite inefficient if used with an FTS5 table
98299848
** created with the "columnsize=0" option.
98309849
**
98319850
** xColumnText:
98329851
** This function attempts to retrieve the text of column iCol of the
9833
-** current document. If successful, (*pz) is set to point to a buffer
9834
-** containing the text in utf-8 encoding, (*pn) is set to the size in bytes
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
98359854
** (not characters) of the buffer and SQLITE_OK is returned. Otherwise,
98369855
** if an error occurs, an SQLite error code is returned and the final values
9837
-** of (*pz) and (*pn) are undefined.
9856
+** of (SQLITE_CALLBACK *pz) and (*pn) are undefined.
98389857
**
98399858
** xPhraseCount:
98409859
** Returns the number of phrases in the current query expression.
98419860
**
98429861
** xPhraseSize:
@@ -9941,11 +9960,11 @@
99419960
** xRowCount(pFts5, pnRow)
99429961
**
99439962
** This function is used to retrieve the total number of rows in the table.
99449963
** In other words, the same value that would be returned by:
99459964
**
9946
-** SELECT count(*) FROM ftstable;
9965
+** SELECT count(SQLITE_CALLBACK *) FROM ftstable;
99479966
**
99489967
** xPhraseFirst()
99499968
** This function is used, along with type Fts5PhraseIter and the xPhraseNext
99509969
** method, to iterate through all instances of a single query phrase within
99519970
** the current row. This is the same information as is accessible via the
@@ -10008,43 +10027,43 @@
1000810027
** See xPhraseFirstColumn above.
1000910028
*/
1001010029
struct Fts5ExtensionApi {
1001110030
int iVersion; /* Currently always set to 3 */
1001210031
10013
- void *(*xUserData)(Fts5Context*);
10032
+ void *(SQLITE_CALLBACK *xUserData)(Fts5Context*);
1001410033
10015
- int (*xColumnCount)(Fts5Context*);
10016
- int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow);
10017
- int (*xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken);
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);
1001810037
10019
- int (*xTokenize)(Fts5Context*,
10038
+ int (SQLITE_CALLBACK *xTokenize)(Fts5Context*,
1002010039
const char *pText, int nText, /* Text to tokenize */
1002110040
void *pCtx, /* Context passed to xToken() */
10022
- int (*xToken)(void*, int, const char*, int, int, int) /* Callback */
10023
- );
10024
-
10025
- int (*xPhraseCount)(Fts5Context*);
10026
- int (*xPhraseSize)(Fts5Context*, int iPhrase);
10027
-
10028
- int (*xInstCount)(Fts5Context*, int *pnInst);
10029
- int (*xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff);
10030
-
10031
- sqlite3_int64 (*xRowid)(Fts5Context*);
10032
- int (*xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn);
10033
- int (*xColumnSize)(Fts5Context*, int iCol, int *pnToken);
10034
-
10035
- int (*xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData,
10036
- int(*)(const Fts5ExtensionApi*,Fts5Context*,void*)
10037
- );
10038
- int (*xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*));
10039
- void *(*xGetAuxdata)(Fts5Context*, int bClear);
10040
-
10041
- int (*xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*);
10042
- void (*xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff);
10043
-
10044
- int (*xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*);
10045
- void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol);
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);
1004610065
};
1004710066
1004810067
/*
1004910068
** CUSTOM AUXILIARY FUNCTIONS
1005010069
*************************************************************************/
@@ -10068,11 +10087,11 @@
1006810087
** The second and third arguments are an array of nul-terminated strings
1006910088
** containing the tokenizer arguments, if any, specified following the
1007010089
** tokenizer name as part of the CREATE VIRTUAL TABLE statement used
1007110090
** to create the FTS5 table.
1007210091
**
10073
-** The final argument is an output variable. If successful, (*ppOut)
10092
+** The final argument is an output variable. If successful, (SQLITE_CALLBACK *ppOut)
1007410093
** should be set to point to the new tokenizer handle and SQLITE_OK
1007510094
** returned. If an error occurs, some value other than SQLITE_OK should
1007610095
** be returned. In this case, fts5 assumes that the final value of *ppOut
1007710096
** is undefined.
1007810097
**
@@ -10242,17 +10261,17 @@
1024210261
** inefficient.
1024310262
*/
1024410263
typedef struct Fts5Tokenizer Fts5Tokenizer;
1024510264
typedef struct fts5_tokenizer fts5_tokenizer;
1024610265
struct fts5_tokenizer {
10247
- int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
10248
- void (*xDelete)(Fts5Tokenizer*);
10249
- int (*xTokenize)(Fts5Tokenizer*,
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*,
1025010269
void *pCtx,
1025110270
int flags, /* Mask of FTS5_TOKENIZE_* flags */
1025210271
const char *pText, int nText,
10253
- int (*xToken)(
10272
+ int (SQLITE_CALLBACK *xToken)(
1025410273
void *pCtx, /* Copy of 2nd argument to xTokenize() */
1025510274
int tflags, /* Mask of FTS5_TOKEN_* flags */
1025610275
const char *pToken, /* Pointer to buffer containing token */
1025710276
int nToken, /* Size of token in bytes */
1025810277
int iStart, /* Byte offset of token within input text */
@@ -10281,33 +10300,33 @@
1028110300
typedef struct fts5_api fts5_api;
1028210301
struct fts5_api {
1028310302
int iVersion; /* Currently always set to 2 */
1028410303
1028510304
/* Create a new tokenizer */
10286
- int (*xCreateTokenizer)(
10305
+ int (SQLITE_CALLBACK *xCreateTokenizer)(
1028710306
fts5_api *pApi,
1028810307
const char *zName,
1028910308
void *pContext,
1029010309
fts5_tokenizer *pTokenizer,
10291
- void (*xDestroy)(void*)
10310
+ void (SQLITE_CALLBACK *xDestroy)(void*)
1029210311
);
1029310312
1029410313
/* Find an existing tokenizer */
10295
- int (*xFindTokenizer)(
10314
+ int (SQLITE_CALLBACK *xFindTokenizer)(
1029610315
fts5_api *pApi,
1029710316
const char *zName,
1029810317
void **ppContext,
1029910318
fts5_tokenizer *pTokenizer
1030010319
);
1030110320
1030210321
/* Create a new auxiliary function */
10303
- int (*xCreateFunction)(
10322
+ int (SQLITE_CALLBACK *xCreateFunction)(
1030410323
fts5_api *pApi,
1030510324
const char *zName,
1030610325
void *pContext,
1030710326
fts5_extension_function xFunction,
10308
- void (*xDestroy)(void*)
10327
+ void (SQLITE_CALLBACK *xDestroy)(void*)
1030910328
);
1031010329
};
1031110330
1031210331
/*
1031310332
** END OF REGISTRATION API
1031410333
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -52,12 +52,21 @@
52 # define SQLITE_API
53 #endif
54 #ifndef SQLITE_CDECL
55 # define SQLITE_CDECL
56 #endif
 
 
 
57 #ifndef SQLITE_STDCALL
58 # define SQLITE_STDCALL
 
 
 
 
 
 
59 #endif
60
61 /*
62 ** These no-op macros are used in front of interfaces to mark those
63 ** interfaces as either deprecated or experimental. New applications
@@ -111,11 +120,11 @@
111 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
112 ** [sqlite_version()] and [sqlite_source_id()].
113 */
114 #define SQLITE_VERSION "3.14.0"
115 #define SQLITE_VERSION_NUMBER 3014000
116 #define SQLITE_SOURCE_ID "2016-07-25 12:10:25 d6f6c87c9c0acf609a9d5bea818bb7a5437109a1"
117
118 /*
119 ** CAPI3REF: Run-Time Library Version Numbers
120 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
121 **
@@ -144,13 +153,13 @@
144 ** [SQLITE_SOURCE_ID] C preprocessor macro.
145 **
146 ** See also: [sqlite_version()] and [sqlite_source_id()].
147 */
148 SQLITE_API SQLITE_EXTERN const char sqlite3_version[];
149 SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void);
150 SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void);
151 SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void);
152
153 /*
154 ** CAPI3REF: Run-Time Library Compilation Options Diagnostics
155 **
156 ** ^The sqlite3_compileoption_used() function returns 0 or 1
@@ -171,12 +180,12 @@
171 **
172 ** See also: SQL functions [sqlite_compileoption_used()] and
173 ** [sqlite_compileoption_get()] and the [compile_options pragma].
174 */
175 #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
176 SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName);
177 SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N);
178 #endif
179
180 /*
181 ** CAPI3REF: Test To See If The Library Is Threadsafe
182 **
@@ -211,11 +220,11 @@
211 ** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
212 ** is unchanged by calls to sqlite3_config().)^
213 **
214 ** See the [threading mode] documentation for additional information.
215 */
216 SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void);
217
218 /*
219 ** CAPI3REF: Database Connection Handle
220 ** KEYWORDS: {database connection} {database connections}
221 **
@@ -308,19 +317,19 @@
308 ** from [sqlite3_open()], [sqlite3_open16()], or
309 ** [sqlite3_open_v2()], and not previously closed.
310 ** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
311 ** argument is a harmless no-op.
312 */
313 SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3*);
314 SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3*);
315
316 /*
317 ** The type for a callback function.
318 ** This is legacy and deprecated. It is included for historical
319 ** compatibility and is not documented.
320 */
321 typedef int (*sqlite3_callback)(void*,int,char**, char**);
322
323 /*
324 ** CAPI3REF: One-Step Query Execution Interface
325 ** METHOD: sqlite3
326 **
@@ -380,14 +389,14 @@
380 ** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
381 ** <li> The application must not modify the SQL statement text passed into
382 ** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
383 ** </ul>
384 */
385 SQLITE_API int SQLITE_STDCALL sqlite3_exec(
386 sqlite3*, /* An open database */
387 const char *sql, /* SQL to be evaluated */
388 int (*callback)(void*,int,char**,char**), /* Callback function */
389 void *, /* 1st argument to callback */
390 char **errmsg /* Error msg written here */
391 );
392
393 /*
@@ -731,30 +740,30 @@
731 ** database corruption.
732 */
733 typedef struct sqlite3_io_methods sqlite3_io_methods;
734 struct sqlite3_io_methods {
735 int iVersion;
736 int (*xClose)(sqlite3_file*);
737 int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
738 int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
739 int (*xTruncate)(sqlite3_file*, sqlite3_int64 size);
740 int (*xSync)(sqlite3_file*, int flags);
741 int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
742 int (*xLock)(sqlite3_file*, int);
743 int (*xUnlock)(sqlite3_file*, int);
744 int (*xCheckReservedLock)(sqlite3_file*, int *pResOut);
745 int (*xFileControl)(sqlite3_file*, int op, void *pArg);
746 int (*xSectorSize)(sqlite3_file*);
747 int (*xDeviceCharacteristics)(sqlite3_file*);
748 /* Methods above are valid for version 1 */
749 int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
750 int (*xShmLock)(sqlite3_file*, int offset, int n, int flags);
751 void (*xShmBarrier)(sqlite3_file*);
752 int (*xShmUnmap)(sqlite3_file*, int deleteFlag);
753 /* Methods above are valid for version 2 */
754 int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
755 int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p);
756 /* Methods above are valid for version 3 */
757 /* Additional methods may be added in future releases */
758 };
759
760 /*
@@ -926,11 +935,11 @@
926 ** ^The [SQLITE_FCNTL_BUSYHANDLER]
927 ** file-control may be invoked by SQLite on the database file handle
928 ** shortly after it is opened in order to provide a custom VFS with access
929 ** to the connections busy-handler callback. The argument is of type (void **)
930 ** - an array of two (void *) values. The first (void *) actually points
931 ** to a function of type (int (*)(void *)). In order to invoke the connections
932 ** busy-handler, this function should be invoked with the second (void *) in
933 ** the array as the only argument. If it returns non-zero, then the operation
934 ** should be retried. If it returns zero, the custom VFS should abandon the
935 ** current operation.
936 **
@@ -1034,10 +1043,20 @@
1034 **
1035 ** Mutexes are created using [sqlite3_mutex_alloc()].
1036 */
1037 typedef struct sqlite3_mutex sqlite3_mutex;
1038
 
 
 
 
 
 
 
 
 
 
1039 /*
1040 ** CAPI3REF: OS Interface Object
1041 **
1042 ** An instance of the sqlite3_vfs object defines the interface between
1043 ** the SQLite core and the underlying operating system. The "vfs"
@@ -1192,43 +1211,43 @@
1192 ** or all of these interfaces to be NULL or for their behavior to change
1193 ** from one release to the next. Applications must not attempt to access
1194 ** any of these methods if the iVersion of the VFS is less than 3.
1195 */
1196 typedef struct sqlite3_vfs sqlite3_vfs;
1197 typedef void (*sqlite3_syscall_ptr)(void);
1198 struct sqlite3_vfs {
1199 int iVersion; /* Structure version number (currently 3) */
1200 int szOsFile; /* Size of subclassed sqlite3_file */
1201 int mxPathname; /* Maximum file pathname length */
1202 sqlite3_vfs *pNext; /* Next registered VFS */
1203 const char *zName; /* Name of this virtual file system */
1204 void *pAppData; /* Pointer to application-specific data */
1205 int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
1206 int flags, int *pOutFlags);
1207 int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
1208 int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
1209 int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
1210 void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename);
1211 void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
1212 void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
1213 void (*xDlClose)(sqlite3_vfs*, void*);
1214 int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
1215 int (*xSleep)(sqlite3_vfs*, int microseconds);
1216 int (*xCurrentTime)(sqlite3_vfs*, double*);
1217 int (*xGetLastError)(sqlite3_vfs*, int, char *);
1218 /*
1219 ** The methods above are in version 1 of the sqlite_vfs object
1220 ** definition. Those that follow are added in version 2 or later
1221 */
1222 int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
1223 /*
1224 ** The methods above are in versions 1 and 2 of the sqlite_vfs object.
1225 ** Those below are for version 3 and greater.
1226 */
1227 int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
1228 sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName);
1229 const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName);
1230 /*
1231 ** The methods above are in versions 1 through 3 of the sqlite_vfs object.
1232 ** New fields may be appended in future versions. The iVersion
1233 ** value will increment whenever this happens.
1234 */
@@ -1369,14 +1388,14 @@
1369 ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied
1370 ** implementation of sqlite3_os_init() or sqlite3_os_end()
1371 ** must return [SQLITE_OK] on success and some other [error code] upon
1372 ** failure.
1373 */
1374 SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void);
1375 SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void);
1376 SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void);
1377 SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void);
1378
1379 /*
1380 ** CAPI3REF: Configuring The SQLite Library
1381 **
1382 ** The sqlite3_config() interface is used to make global configuration
@@ -1491,17 +1510,17 @@
1491 ** SQLite will never invoke xInit() more than once without an intervening
1492 ** call to xShutdown().
1493 */
1494 typedef struct sqlite3_mem_methods sqlite3_mem_methods;
1495 struct sqlite3_mem_methods {
1496 void *(*xMalloc)(int); /* Memory allocation function */
1497 void (*xFree)(void*); /* Free a prior allocation */
1498 void *(*xRealloc)(void*,int); /* Resize an allocation */
1499 int (*xSize)(void*); /* Return the size of an allocation */
1500 int (*xRoundup)(int); /* Round up request size to allocation size */
1501 int (*xInit)(void*); /* Initialize the memory allocator */
1502 void (*xShutdown)(void*); /* Deinitialize the memory allocator */
1503 void *pAppData; /* Argument to xInit() and xShutdown() */
1504 };
1505
1506 /*
1507 ** CAPI3REF: Configuration Options
@@ -1714,11 +1733,11 @@
1714 **
1715 ** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
1716 ** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
1717 ** global [error log].
1718 ** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a
1719 ** function with a call signature of void(*)(void*,int,const char*),
1720 ** and a pointer to void. ^If the function pointer is not NULL, it is
1721 ** invoked by [sqlite3_log()] to process each logging event. ^If the
1722 ** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op.
1723 ** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is
1724 ** passed through as the first parameter to the application-defined logger
@@ -1767,11 +1786,11 @@
1767 **
1768 ** [[SQLITE_CONFIG_SQLLOG]]
1769 ** <dt>SQLITE_CONFIG_SQLLOG
1770 ** <dd>This option is only available if sqlite is compiled with the
1771 ** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should
1772 ** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int).
1773 ** The second should be of type (void*). The callback is invoked by the library
1774 ** in three separate circumstances, identified by the value passed as the
1775 ** fourth parameter. If the fourth parameter is 0, then the database connection
1776 ** passed as the second argument has just been opened. The third argument
1777 ** points to a buffer containing the name of the main database file. If the
@@ -1965,11 +1984,11 @@
1965 **
1966 ** ^The sqlite3_extended_result_codes() routine enables or disables the
1967 ** [extended result codes] feature of SQLite. ^The extended result
1968 ** codes are disabled by default for historical compatibility.
1969 */
1970 SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3*, int onoff);
1971
1972 /*
1973 ** CAPI3REF: Last Insert Rowid
1974 ** METHOD: sqlite3
1975 **
@@ -2017,11 +2036,11 @@
2017 ** function is running and thus changes the last insert [rowid],
2018 ** then the value returned by [sqlite3_last_insert_rowid()] is
2019 ** unpredictable and might not equal either the old or the new
2020 ** last insert [rowid].
2021 */
2022 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3*);
2023
2024 /*
2025 ** CAPI3REF: Count The Number Of Rows Modified
2026 ** METHOD: sqlite3
2027 **
@@ -2070,11 +2089,11 @@
2070 **
2071 ** If a separate thread makes changes on the same database connection
2072 ** while [sqlite3_changes()] is running then the value returned
2073 ** is unpredictable and not meaningful.
2074 */
2075 SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3*);
2076
2077 /*
2078 ** CAPI3REF: Total Number Of Rows Modified
2079 ** METHOD: sqlite3
2080 **
@@ -2094,11 +2113,11 @@
2094 **
2095 ** If a separate thread makes changes on the same database connection
2096 ** while [sqlite3_total_changes()] is running then the value
2097 ** returned is unpredictable and not meaningful.
2098 */
2099 SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3*);
2100
2101 /*
2102 ** CAPI3REF: Interrupt A Long-Running Query
2103 ** METHOD: sqlite3
2104 **
@@ -2134,11 +2153,11 @@
2134 ** that are started after the sqlite3_interrupt() call returns.
2135 **
2136 ** If the database connection closes while [sqlite3_interrupt()]
2137 ** is running then bad things will likely happen.
2138 */
2139 SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3*);
2140
2141 /*
2142 ** CAPI3REF: Determine If An SQL Statement Is Complete
2143 **
2144 ** These routines are useful during command-line input to determine if the
@@ -2169,12 +2188,12 @@
2169 ** UTF-8 string.
2170 **
2171 ** The input to [sqlite3_complete16()] must be a zero-terminated
2172 ** UTF-16 string in native byte order.
2173 */
2174 SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *sql);
2175 SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *sql);
2176
2177 /*
2178 ** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
2179 ** KEYWORDS: {busy-handler callback} {busy handler}
2180 ** METHOD: sqlite3
@@ -2231,11 +2250,11 @@
2231 ** result in undefined behavior.
2232 **
2233 ** A busy handler must not close the database connection
2234 ** or [prepared statement] that invoked the busy handler.
2235 */
2236 SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*);
2237
2238 /*
2239 ** CAPI3REF: Set A Busy Timeout
2240 ** METHOD: sqlite3
2241 **
@@ -2254,11 +2273,11 @@
2254 ** was defined (using [sqlite3_busy_handler()]) prior to calling
2255 ** this routine, that other busy handler is cleared.)^
2256 **
2257 ** See also: [PRAGMA busy_timeout]
2258 */
2259 SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3*, int ms);
2260
2261 /*
2262 ** CAPI3REF: Convenience Routines For Running Queries
2263 ** METHOD: sqlite3
2264 **
@@ -2329,19 +2348,19 @@
2329 ** interface defined here. As a consequence, errors that occur in the
2330 ** wrapper layer outside of the internal [sqlite3_exec()] call are not
2331 ** reflected in subsequent calls to [sqlite3_errcode()] or
2332 ** [sqlite3_errmsg()].
2333 */
2334 SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
2335 sqlite3 *db, /* An open database */
2336 const char *zSql, /* SQL to be evaluated */
2337 char ***pazResult, /* Results of the query */
2338 int *pnRow, /* Number of result rows written here */
2339 int *pnColumn, /* Number of result columns written here */
2340 char **pzErrmsg /* Error msg written here */
2341 );
2342 SQLITE_API void SQLITE_STDCALL sqlite3_free_table(char **result);
2343
2344 /*
2345 ** CAPI3REF: Formatted String Printing Functions
2346 **
2347 ** These routines are work-alikes of the "printf()" family of functions
@@ -2444,13 +2463,13 @@
2444 ** ^(The "%z" formatting option works like "%s" but with the
2445 ** addition that after the string has been read and copied into
2446 ** the result, [sqlite3_free()] is called on the input string.)^
2447 */
2448 SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...);
2449 SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list);
2450 SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...);
2451 SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list);
2452
2453 /*
2454 ** CAPI3REF: Memory Allocation Subsystem
2455 **
2456 ** The SQLite core uses these three routines for all of its own
@@ -2536,16 +2555,16 @@
2536 **
2537 ** The application must not read or write any part of
2538 ** a block of memory after it has been released using
2539 ** [sqlite3_free()] or [sqlite3_realloc()].
2540 */
2541 SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int);
2542 SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64);
2543 SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void*, int);
2544 SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void*, sqlite3_uint64);
2545 SQLITE_API void SQLITE_STDCALL sqlite3_free(void*);
2546 SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void*);
2547
2548 /*
2549 ** CAPI3REF: Memory Allocator Statistics
2550 **
2551 ** SQLite provides these two interfaces for reporting on the status
@@ -2566,12 +2585,12 @@
2566 ** [sqlite3_memory_used()] if and only if the parameter to
2567 ** [sqlite3_memory_highwater()] is true. ^The value returned
2568 ** by [sqlite3_memory_highwater(1)] is the high-water mark
2569 ** prior to the reset.
2570 */
2571 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void);
2572 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag);
2573
2574 /*
2575 ** CAPI3REF: Pseudo-Random Number Generator
2576 **
2577 ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
@@ -2590,11 +2609,11 @@
2590 ** ^If the previous call to this routine had an N of 1 or more and a
2591 ** non-NULL P then the pseudo-randomness is generated
2592 ** internally and without recourse to the [sqlite3_vfs] xRandomness
2593 ** method.
2594 */
2595 SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *P);
2596
2597 /*
2598 ** CAPI3REF: Compile-Time Authorization Callbacks
2599 ** METHOD: sqlite3
2600 **
@@ -2673,13 +2692,13 @@
2673 ** [sqlite3_prepare()] or its variants. Authorization is not
2674 ** performed during statement evaluation in [sqlite3_step()], unless
2675 ** as stated in the previous paragraph, sqlite3_step() invokes
2676 ** sqlite3_prepare_v2() to reprepare a statement after a schema change.
2677 */
2678 SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
2679 sqlite3*,
2680 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
2681 void *pUserData
2682 );
2683
2684 /*
2685 ** CAPI3REF: Authorizer Return Codes
@@ -2781,14 +2800,14 @@
2781 ** digits in the time are meaningless. Future versions of SQLite
2782 ** might provide greater resolution on the profiler callback. The
2783 ** sqlite3_profile() function is considered experimental and is
2784 ** subject to change in future versions of SQLite.
2785 */
2786 SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_trace(sqlite3*,
2787 void(*xTrace)(void*,const char*), void*);
2788 SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_profile(sqlite3*,
2789 void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
2790
2791 /*
2792 ** CAPI3REF: SQL Trace Event Codes
2793 ** KEYWORDS: SQLITE_TRACE
2794 **
@@ -2872,14 +2891,14 @@
2872 **
2873 ** The sqlite3_trace_v2() interface is intended to replace the legacy
2874 ** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which
2875 ** are deprecated.
2876 */
2877 SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2(
2878 sqlite3*,
2879 unsigned uMask,
2880 int(*xCallback)(unsigned,void*,void*,void*),
2881 void *pCtx
2882 );
2883
2884 /*
2885 ** CAPI3REF: Query Progress Callbacks
@@ -2911,11 +2930,11 @@
2911 ** the database connection that invoked the progress handler.
2912 ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
2913 ** database connections for the meaning of "modify" in this paragraph.
2914 **
2915 */
2916 SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
2917
2918 /*
2919 ** CAPI3REF: Opening A New Database Connection
2920 ** CONSTRUCTOR: sqlite3
2921 **
@@ -3140,19 +3159,19 @@
3140 ** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various
3141 ** features that require the use of temporary files may fail.
3142 **
3143 ** See also: [sqlite3_temp_directory]
3144 */
3145 SQLITE_API int SQLITE_STDCALL sqlite3_open(
3146 const char *filename, /* Database filename (UTF-8) */
3147 sqlite3 **ppDb /* OUT: SQLite db handle */
3148 );
3149 SQLITE_API int SQLITE_STDCALL sqlite3_open16(
3150 const void *filename, /* Database filename (UTF-16) */
3151 sqlite3 **ppDb /* OUT: SQLite db handle */
3152 );
3153 SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
3154 const char *filename, /* Database filename (UTF-8) */
3155 sqlite3 **ppDb, /* OUT: SQLite db handle */
3156 int flags, /* Flags */
3157 const char *zVfs /* Name of VFS module to use */
3158 );
@@ -3194,13 +3213,13 @@
3194 ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and
3195 ** is not a database file pathname pointer that SQLite passed into the xOpen
3196 ** VFS method, then the behavior of this routine is undefined and probably
3197 ** undesirable.
3198 */
3199 SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3200 SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3201 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
3202
3203
3204 /*
3205 ** CAPI3REF: Error Codes And Messages
3206 ** METHOD: sqlite3
@@ -3240,15 +3259,15 @@
3240 **
3241 ** If an interface fails with SQLITE_MISUSE, that means the interface
3242 ** was invoked incorrectly by the application. In that case, the
3243 ** error code and message may or may not be set.
3244 */
3245 SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db);
3246 SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db);
3247 SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*);
3248 SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*);
3249 SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int);
3250
3251 /*
3252 ** CAPI3REF: Prepared Statement Object
3253 ** KEYWORDS: {prepared statement} {prepared statements}
3254 **
@@ -3312,11 +3331,11 @@
3312 ** created by an untrusted script can be contained using the
3313 ** [max_page_count] [PRAGMA].
3314 **
3315 ** New run-time limit categories may be added in future releases.
3316 */
3317 SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3*, int id, int newVal);
3318
3319 /*
3320 ** CAPI3REF: Run-Time Limit Categories
3321 ** KEYWORDS: {limit category} {*limit categories}
3322 **
@@ -3464,32 +3483,32 @@
3464 ** or [GLOB] operator or if the parameter is compared to an indexed column
3465 ** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
3466 ** </li>
3467 ** </ol>
3468 */
3469 SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
3470 sqlite3 *db, /* Database handle */
3471 const char *zSql, /* SQL statement, UTF-8 encoded */
3472 int nByte, /* Maximum length of zSql in bytes. */
3473 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3474 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3475 );
3476 SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
3477 sqlite3 *db, /* Database handle */
3478 const char *zSql, /* SQL statement, UTF-8 encoded */
3479 int nByte, /* Maximum length of zSql in bytes. */
3480 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3481 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3482 );
3483 SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
3484 sqlite3 *db, /* Database handle */
3485 const void *zSql, /* SQL statement, UTF-16 encoded */
3486 int nByte, /* Maximum length of zSql in bytes. */
3487 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3488 const void **pzTail /* OUT: Pointer to unused portion of zSql */
3489 );
3490 SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
3491 sqlite3 *db, /* Database handle */
3492 const void *zSql, /* SQL statement, UTF-16 encoded */
3493 int nByte, /* Maximum length of zSql in bytes. */
3494 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3495 const void **pzTail /* OUT: Pointer to unused portion of zSql */
@@ -3524,12 +3543,12 @@
3524 ** automatically freed when the prepared statement is finalized.
3525 ** ^The string returned by sqlite3_expanded_sql(P), on the other hand,
3526 ** is obtained from [sqlite3_malloc()] and must be free by the application
3527 ** by passing it to [sqlite3_free()].
3528 */
3529 SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt);
3530 SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt);
3531
3532 /*
3533 ** CAPI3REF: Determine If An SQL Statement Writes The Database
3534 ** METHOD: sqlite3_stmt
3535 **
@@ -3557,11 +3576,11 @@
3557 ** database. ^The [ATTACH] and [DETACH] statements also cause
3558 ** sqlite3_stmt_readonly() to return true since, while those statements
3559 ** change the configuration of a database connection, they do not make
3560 ** changes to the content of the database files on disk.
3561 */
3562 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
3563
3564 /*
3565 ** CAPI3REF: Determine If A Prepared Statement Has Been Reset
3566 ** METHOD: sqlite3_stmt
3567 **
@@ -3578,11 +3597,11 @@
3578 ** to locate all prepared statements associated with a database
3579 ** connection that are in need of being reset. This can be used,
3580 ** for example, in diagnostic routines to search for prepared
3581 ** statements that are holding a transaction open.
3582 */
3583 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt*);
3584
3585 /*
3586 ** CAPI3REF: Dynamically Typed Value Object
3587 ** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
3588 **
@@ -3742,24 +3761,24 @@
3742 ** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails.
3743 **
3744 ** See also: [sqlite3_bind_parameter_count()],
3745 ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].
3746 */
3747 SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
3748 SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
3749 void(*)(void*));
3750 SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt*, int, double);
3751 SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt*, int, int);
3752 SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
3753 SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt*, int);
3754 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
3755 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
3756 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
3757 void(*)(void*), unsigned char encoding);
3758 SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
3759 SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
3760 SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
3761
3762 /*
3763 ** CAPI3REF: Number Of SQL Parameters
3764 ** METHOD: sqlite3_stmt
3765 **
@@ -3776,11 +3795,11 @@
3776 **
3777 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3778 ** [sqlite3_bind_parameter_name()], and
3779 ** [sqlite3_bind_parameter_index()].
3780 */
3781 SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt*);
3782
3783 /*
3784 ** CAPI3REF: Name Of A Host Parameter
3785 ** METHOD: sqlite3_stmt
3786 **
@@ -3804,11 +3823,11 @@
3804 **
3805 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3806 ** [sqlite3_bind_parameter_count()], and
3807 ** [sqlite3_bind_parameter_index()].
3808 */
3809 SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
3810
3811 /*
3812 ** CAPI3REF: Index Of A Parameter With A Given Name
3813 ** METHOD: sqlite3_stmt
3814 **
@@ -3821,21 +3840,21 @@
3821 **
3822 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3823 ** [sqlite3_bind_parameter_count()], and
3824 ** [sqlite3_bind_parameter_name()].
3825 */
3826 SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
3827
3828 /*
3829 ** CAPI3REF: Reset All Bindings On A Prepared Statement
3830 ** METHOD: sqlite3_stmt
3831 **
3832 ** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset
3833 ** the [sqlite3_bind_blob | bindings] on a [prepared statement].
3834 ** ^Use this routine to reset all host parameters to NULL.
3835 */
3836 SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt*);
3837
3838 /*
3839 ** CAPI3REF: Number Of Columns In A Result Set
3840 ** METHOD: sqlite3_stmt
3841 **
@@ -3843,11 +3862,11 @@
3843 ** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
3844 ** statement that does not return data (for example an [UPDATE]).
3845 **
3846 ** See also: [sqlite3_data_count()]
3847 */
3848 SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt);
3849
3850 /*
3851 ** CAPI3REF: Column Names In A Result Set
3852 ** METHOD: sqlite3_stmt
3853 **
@@ -3872,12 +3891,12 @@
3872 ** ^The name of a result column is the value of the "AS" clause for
3873 ** that column, if there is an AS clause. If there is no AS clause
3874 ** then the name of the column is unspecified and may change from
3875 ** one release of SQLite to the next.
3876 */
3877 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt*, int N);
3878 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt*, int N);
3879
3880 /*
3881 ** CAPI3REF: Source Of Data In A Query Result
3882 ** METHOD: sqlite3_stmt
3883 **
@@ -3921,16 +3940,16 @@
3921 ** If two or more threads call one or more
3922 ** [sqlite3_column_database_name | column metadata interfaces]
3923 ** for the same [prepared statement] and result column
3924 ** at the same time then the results are undefined.
3925 */
3926 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int);
3927 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int);
3928 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int);
3929 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int);
3930 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int);
3931 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
3932
3933 /*
3934 ** CAPI3REF: Declared Datatype Of A Query Result
3935 ** METHOD: sqlite3_stmt
3936 **
@@ -3958,12 +3977,12 @@
3958 ** data stored in that column is of the declared type. SQLite is
3959 ** strongly typed, but the typing is dynamic not static. ^Type
3960 ** is associated with individual values, not with the containers
3961 ** used to hold those values.
3962 */
3963 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt*,int);
3964 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt*,int);
3965
3966 /*
3967 ** CAPI3REF: Evaluate An SQL Statement
3968 ** METHOD: sqlite3_stmt
3969 **
@@ -4039,11 +4058,11 @@
4039 ** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
4040 ** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,
4041 ** then the more specific [error codes] are returned directly
4042 ** by sqlite3_step(). The use of the "v2" interface is recommended.
4043 */
4044 SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt*);
4045
4046 /*
4047 ** CAPI3REF: Number of columns in a result set
4048 ** METHOD: sqlite3_stmt
4049 **
@@ -4060,11 +4079,11 @@
4060 ** where it always returns zero since each step of that multi-step
4061 ** pragma returns 0 columns of data.
4062 **
4063 ** See also: [sqlite3_column_count()]
4064 */
4065 SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt);
4066
4067 /*
4068 ** CAPI3REF: Fundamental Datatypes
4069 ** KEYWORDS: SQLITE_TEXT
4070 **
@@ -4250,20 +4269,20 @@
4250 ** of these routines, a default value is returned. The default value
4251 ** is either the integer 0, the floating point number 0.0, or a NULL
4252 ** pointer. Subsequent calls to [sqlite3_errcode()] will return
4253 ** [SQLITE_NOMEM].)^
4254 */
4255 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt*, int iCol);
4256 SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4257 SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4258 SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt*, int iCol);
4259 SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt*, int iCol);
4260 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt*, int iCol);
4261 SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt*, int iCol);
4262 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt*, int iCol);
4263 SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt*, int iCol);
4264 SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt*, int iCol);
4265
4266 /*
4267 ** CAPI3REF: Destroy A Prepared Statement Object
4268 ** DESTRUCTOR: sqlite3_stmt
4269 **
@@ -4287,11 +4306,11 @@
4287 ** resource leaks. It is a grievous error for the application to try to use
4288 ** a prepared statement after it has been finalized. Any use of a prepared
4289 ** statement after it has been finalized can result in undefined and
4290 ** undesirable behavior such as segfaults and heap corruption.
4291 */
4292 SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt);
4293
4294 /*
4295 ** CAPI3REF: Reset A Prepared Statement Object
4296 ** METHOD: sqlite3_stmt
4297 **
@@ -4314,11 +4333,11 @@
4314 ** [sqlite3_reset(S)] returns an appropriate [error code].
4315 **
4316 ** ^The [sqlite3_reset(S)] interface does not change the values
4317 ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
4318 */
4319 SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt);
4320
4321 /*
4322 ** CAPI3REF: Create Or Redefine SQL Functions
4323 ** KEYWORDS: {function creation routines}
4324 ** KEYWORDS: {application-defined SQL function}
@@ -4414,40 +4433,40 @@
4414 ** ^An application-defined function is permitted to call other
4415 ** SQLite interfaces. However, such calls must not
4416 ** close the database connection nor finalize or reset the prepared
4417 ** statement in which the function is running.
4418 */
4419 SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
4420 sqlite3 *db,
4421 const char *zFunctionName,
4422 int nArg,
4423 int eTextRep,
4424 void *pApp,
4425 void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4426 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4427 void (*xFinal)(sqlite3_context*)
4428 );
4429 SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
4430 sqlite3 *db,
4431 const void *zFunctionName,
4432 int nArg,
4433 int eTextRep,
4434 void *pApp,
4435 void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4436 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4437 void (*xFinal)(sqlite3_context*)
4438 );
4439 SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
4440 sqlite3 *db,
4441 const char *zFunctionName,
4442 int nArg,
4443 int eTextRep,
4444 void *pApp,
4445 void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4446 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4447 void (*xFinal)(sqlite3_context*),
4448 void(*xDestroy)(void*)
4449 );
4450
4451 /*
4452 ** CAPI3REF: Text Encodings
4453 **
@@ -4480,16 +4499,16 @@
4480 ** to be supported. However, new applications should avoid
4481 ** the use of these functions. To encourage programmers to avoid
4482 ** these functions, we will not explain what they do.
4483 */
4484 #ifndef SQLITE_OMIT_DEPRECATED
4485 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context*);
4486 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt*);
4487 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4488 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_global_recover(void);
4489 SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_thread_cleanup(void);
4490 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
4491 void*,sqlite3_int64);
4492 #endif
4493
4494 /*
4495 ** CAPI3REF: Obtaining SQL Values
@@ -4535,22 +4554,22 @@
4535 ** or [sqlite3_value_text16()].
4536 **
4537 ** These routines must be called from the same thread as
4538 ** the SQL function that supplied the [sqlite3_value*] parameters.
4539 */
4540 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value*);
4541 SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value*);
4542 SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value*);
4543 SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value*);
4544 SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value*);
4545 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value*);
4546 SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value*);
4547 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value*);
4548 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value*);
4549 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*);
4550 SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*);
4551 SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*);
4552
4553 /*
4554 ** CAPI3REF: Finding The Subtype Of SQL Values
4555 ** METHOD: sqlite3_value
4556 **
@@ -4562,11 +4581,11 @@
4562 **
4563 ** SQLite makes no use of subtype itself. It merely passes the subtype
4564 ** from the result of one [application-defined SQL function] into the
4565 ** input of another.
4566 */
4567 SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value*);
4568
4569 /*
4570 ** CAPI3REF: Copy And Free SQL Values
4571 ** METHOD: sqlite3_value
4572 **
@@ -4578,12 +4597,12 @@
4578 **
4579 ** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object
4580 ** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer
4581 ** then sqlite3_value_free(V) is a harmless no-op.
4582 */
4583 SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value*);
4584 SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value*);
4585
4586 /*
4587 ** CAPI3REF: Obtain Aggregate Function Context
4588 ** METHOD: sqlite3_context
4589 **
@@ -4624,11 +4643,11 @@
4624 ** function.
4625 **
4626 ** This routine must be called from the same thread in which
4627 ** the aggregate SQL function is running.
4628 */
4629 SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
4630
4631 /*
4632 ** CAPI3REF: User Data For Functions
4633 ** METHOD: sqlite3_context
4634 **
@@ -4639,11 +4658,11 @@
4639 ** registered the application defined function.
4640 **
4641 ** This routine must be called from the same thread in which
4642 ** the application-defined function is running.
4643 */
4644 SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context*);
4645
4646 /*
4647 ** CAPI3REF: Database Connection For Functions
4648 ** METHOD: sqlite3_context
4649 **
@@ -4651,11 +4670,11 @@
4651 ** the pointer to the [database connection] (the 1st parameter)
4652 ** of the [sqlite3_create_function()]
4653 ** and [sqlite3_create_function16()] routines that originally
4654 ** registered the application defined function.
4655 */
4656 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context*);
4657
4658 /*
4659 ** CAPI3REF: Function Auxiliary Data
4660 ** METHOD: sqlite3_context
4661 **
@@ -4704,12 +4723,12 @@
4704 ** values and [parameters] and expressions composed from the same.)^
4705 **
4706 ** These routines must be called from the same thread in which
4707 ** the SQL function is running.
4708 */
4709 SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context*, int N);
4710 SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
4711
4712
4713 /*
4714 ** CAPI3REF: Constants Defining Special Destructor Behavior
4715 **
@@ -4722,11 +4741,11 @@
4722 ** the content before returning.
4723 **
4724 ** The typedef is necessary to work around problems in certain
4725 ** C++ compilers.
4726 */
4727 typedef void (*sqlite3_destructor_type)(void*);
4728 #define SQLITE_STATIC ((sqlite3_destructor_type)0)
4729 #define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1)
4730
4731 /*
4732 ** CAPI3REF: Setting The Result Of An SQL Function
@@ -4841,31 +4860,31 @@
4841 **
4842 ** If these routines are called from within the different thread
4843 ** than the one containing the application-defined function that received
4844 ** the [sqlite3_context] pointer, the results are undefined.
4845 */
4846 SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
4847 SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(sqlite3_context*,const void*,
4848 sqlite3_uint64,void(*)(void*));
4849 SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context*, double);
4850 SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context*, const char*, int);
4851 SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context*, const void*, int);
4852 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context*);
4853 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context*);
4854 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context*, int);
4855 SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context*, int);
4856 SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
4857 SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context*);
4858 SQLITE_API void SQLITE_STDCALL sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
4859 SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
4860 void(*)(void*), unsigned char encoding);
4861 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
4862 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
4863 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
4864 SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
4865 SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n);
4866 SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
4867
4868
4869 /*
4870 ** CAPI3REF: Setting The Subtype Of An SQL Function
4871 ** METHOD: sqlite3_context
@@ -4876,11 +4895,11 @@
4876 ** of the subtype T are preserved in current versions of SQLite;
4877 ** higher order bits are discarded.
4878 ** The number of subtype bytes preserved by SQLite might increase
4879 ** in future releases of SQLite.
4880 */
4881 SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context*,unsigned int);
4882
4883 /*
4884 ** CAPI3REF: Define New Collating Sequences
4885 ** METHOD: sqlite3
4886 **
@@ -4958,31 +4977,31 @@
4958 ** is unfortunate but cannot be changed without breaking backwards
4959 ** compatibility.
4960 **
4961 ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].
4962 */
4963 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
4964 sqlite3*,
4965 const char *zName,
4966 int eTextRep,
4967 void *pArg,
4968 int(*xCompare)(void*,int,const void*,int,const void*)
4969 );
4970 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
4971 sqlite3*,
4972 const char *zName,
4973 int eTextRep,
4974 void *pArg,
4975 int(*xCompare)(void*,int,const void*,int,const void*),
4976 void(*xDestroy)(void*)
4977 );
4978 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
4979 sqlite3*,
4980 const void *zName,
4981 int eTextRep,
4982 void *pArg,
4983 int(*xCompare)(void*,int,const void*,int,const void*)
4984 );
4985
4986 /*
4987 ** CAPI3REF: Collation Needed Callbacks
4988 ** METHOD: sqlite3
@@ -5008,19 +5027,19 @@
5008 **
5009 ** The callback function should register the desired collation using
5010 ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or
5011 ** [sqlite3_create_collation_v2()].
5012 */
5013 SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
5014 sqlite3*,
5015 void*,
5016 void(*)(void*,sqlite3*,int eTextRep,const char*)
5017 );
5018 SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
5019 sqlite3*,
5020 void*,
5021 void(*)(void*,sqlite3*,int eTextRep,const void*)
5022 );
5023
5024 #ifdef SQLITE_HAS_CODEC
5025 /*
5026 ** Specify the key for an encrypted database. This routine should be
@@ -5027,15 +5046,15 @@
5027 ** called right after sqlite3_open().
5028 **
5029 ** The code to implement this API is not available in the public release
5030 ** of SQLite.
5031 */
5032 SQLITE_API int SQLITE_STDCALL sqlite3_key(
5033 sqlite3 *db, /* Database to be rekeyed */
5034 const void *pKey, int nKey /* The key */
5035 );
5036 SQLITE_API int SQLITE_STDCALL sqlite3_key_v2(
5037 sqlite3 *db, /* Database to be rekeyed */
5038 const char *zDbName, /* Name of the database */
5039 const void *pKey, int nKey /* The key */
5040 );
5041
@@ -5045,35 +5064,35 @@
5045 ** database is decrypted.
5046 **
5047 ** The code to implement this API is not available in the public release
5048 ** of SQLite.
5049 */
5050 SQLITE_API int SQLITE_STDCALL sqlite3_rekey(
5051 sqlite3 *db, /* Database to be rekeyed */
5052 const void *pKey, int nKey /* The new key */
5053 );
5054 SQLITE_API int SQLITE_STDCALL sqlite3_rekey_v2(
5055 sqlite3 *db, /* Database to be rekeyed */
5056 const char *zDbName, /* Name of the database */
5057 const void *pKey, int nKey /* The new key */
5058 );
5059
5060 /*
5061 ** Specify the activation key for a SEE database. Unless
5062 ** activated, none of the SEE routines will work.
5063 */
5064 SQLITE_API void SQLITE_STDCALL sqlite3_activate_see(
5065 const char *zPassPhrase /* Activation phrase */
5066 );
5067 #endif
5068
5069 #ifdef SQLITE_ENABLE_CEROD
5070 /*
5071 ** Specify the activation key for a CEROD database. Unless
5072 ** activated, none of the CEROD routines will work.
5073 */
5074 SQLITE_API void SQLITE_STDCALL sqlite3_activate_cerod(
5075 const char *zPassPhrase /* Activation phrase */
5076 );
5077 #endif
5078
5079 /*
@@ -5091,11 +5110,11 @@
5091 ** method of the default [sqlite3_vfs] object. If the xSleep() method
5092 ** of the default VFS is not implemented correctly, or not implemented at
5093 ** all, then the behavior of sqlite3_sleep() may deviate from the description
5094 ** in the previous paragraphs.
5095 */
5096 SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int);
5097
5098 /*
5099 ** CAPI3REF: Name Of The Folder Holding Temporary Files
5100 **
5101 ** ^(If this global variable is made to point to a string which is
@@ -5210,11 +5229,11 @@
5210 **
5211 ** If another thread changes the autocommit status of the database
5212 ** connection while this routine is running, then the return value
5213 ** is undefined.
5214 */
5215 SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3*);
5216
5217 /*
5218 ** CAPI3REF: Find The Database Handle Of A Prepared Statement
5219 ** METHOD: sqlite3_stmt
5220 **
@@ -5223,11 +5242,11 @@
5223 ** returned by sqlite3_db_handle is the same [database connection]
5224 ** that was the first argument
5225 ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
5226 ** create the statement in the first place.
5227 */
5228 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt*);
5229
5230 /*
5231 ** CAPI3REF: Return The Filename For A Database Connection
5232 ** METHOD: sqlite3
5233 **
@@ -5240,21 +5259,21 @@
5240 ** ^The filename returned by this function is the output of the
5241 ** xFullPathname method of the [VFS]. ^In other words, the filename
5242 ** will be an absolute pathname, even if the filename used
5243 ** to open the database originally was a URI or relative pathname.
5244 */
5245 SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
5246
5247 /*
5248 ** CAPI3REF: Determine if a database is read-only
5249 ** METHOD: sqlite3
5250 **
5251 ** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N
5252 ** of connection D is read-only, 0 if it is read/write, or -1 if N is not
5253 ** the name of a database on connection D.
5254 */
5255 SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
5256
5257 /*
5258 ** CAPI3REF: Find the next prepared statement
5259 ** METHOD: sqlite3
5260 **
@@ -5266,11 +5285,11 @@
5266 **
5267 ** The [database connection] pointer D in a call to
5268 ** [sqlite3_next_stmt(D,S)] must refer to an open database
5269 ** connection and in particular must not be a NULL pointer.
5270 */
5271 SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
5272
5273 /*
5274 ** CAPI3REF: Commit And Rollback Notification Callbacks
5275 ** METHOD: sqlite3
5276 **
@@ -5315,12 +5334,12 @@
5315 ** ^The rollback callback is not invoked if a transaction is
5316 ** automatically rolled back because the database connection is closed.
5317 **
5318 ** See also the [sqlite3_update_hook()] interface.
5319 */
5320 SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
5321 SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
5322
5323 /*
5324 ** CAPI3REF: Data Change Notification Callbacks
5325 ** METHOD: sqlite3
5326 **
@@ -5367,13 +5386,13 @@
5367 ** the first call on D.
5368 **
5369 ** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()],
5370 ** and [sqlite3_preupdate_hook()] interfaces.
5371 */
5372 SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
5373 sqlite3*,
5374 void(*)(void *,int ,char const *,char const *,sqlite3_int64),
5375 void*
5376 );
5377
5378 /*
5379 ** CAPI3REF: Enable Or Disable Shared Pager Cache
@@ -5407,11 +5426,11 @@
5407 ** This interface is threadsafe on processors where writing a
5408 ** 32-bit integer is atomic.
5409 **
5410 ** See Also: [SQLite Shared-Cache Mode]
5411 */
5412 SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int);
5413
5414 /*
5415 ** CAPI3REF: Attempt To Free Heap Memory
5416 **
5417 ** ^The sqlite3_release_memory() interface attempts to free N bytes
@@ -5423,11 +5442,11 @@
5423 ** ^The sqlite3_release_memory() routine is a no-op returning zero
5424 ** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5425 **
5426 ** See also: [sqlite3_db_release_memory()]
5427 */
5428 SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int);
5429
5430 /*
5431 ** CAPI3REF: Free Memory Used By A Database Connection
5432 ** METHOD: sqlite3
5433 **
@@ -5437,11 +5456,11 @@
5437 ** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
5438 ** omitted.
5439 **
5440 ** See also: [sqlite3_release_memory()]
5441 */
5442 SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3*);
5443
5444 /*
5445 ** CAPI3REF: Impose A Limit On Heap Size
5446 **
5447 ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the
@@ -5489,11 +5508,11 @@
5489 ** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5490 **
5491 ** The circumstances under which SQLite will enforce the soft heap limit may
5492 ** changes in future releases of SQLite.
5493 */
5494 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
5495
5496 /*
5497 ** CAPI3REF: Deprecated Soft Heap Limit Interface
5498 ** DEPRECATED
5499 **
@@ -5500,11 +5519,11 @@
5500 ** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
5501 ** interface. This routine is provided for historical compatibility
5502 ** only. All new applications should use the
5503 ** [sqlite3_soft_heap_limit64()] interface rather than this one.
5504 */
5505 SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_soft_heap_limit(int N);
5506
5507
5508 /*
5509 ** CAPI3REF: Extract Metadata About A Column Of A Table
5510 ** METHOD: sqlite3
@@ -5570,11 +5589,11 @@
5570 **
5571 ** ^This function causes all database schemas to be read from disk and
5572 ** parsed, if that has not already been done, and returns an error if
5573 ** any errors are encountered while loading the schema.
5574 */
5575 SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
5576 sqlite3 *db, /* Connection handle */
5577 const char *zDbName, /* Database name or NULL */
5578 const char *zTableName, /* Table name */
5579 const char *zColumnName, /* Column name */
5580 char const **pzDataType, /* OUTPUT: Declared data type */
@@ -5626,11 +5645,11 @@
5626 ** disabled and prevent SQL injections from giving attackers
5627 ** access to extension loading capabilities.
5628 **
5629 ** See also the [load_extension() SQL function].
5630 */
5631 SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
5632 sqlite3 *db, /* Load the extension into this database connection */
5633 const char *zFile, /* Name of the shared library containing extension */
5634 const char *zProc, /* Entry point. Derived from zFile if 0 */
5635 char **pzErrMsg /* Put error message here if not 0 */
5636 );
@@ -5658,11 +5677,11 @@
5658 ** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method
5659 ** rather than this interface, so the [load_extension()] SQL function
5660 ** remains disabled. This will prevent SQL injections from giving attackers
5661 ** access to extension loading capabilities.
5662 */
5663 SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
5664
5665 /*
5666 ** CAPI3REF: Automatically Load Statically Linked Extensions
5667 **
5668 ** ^This interface causes the xEntryPoint() function to be invoked for
@@ -5670,11 +5689,11 @@
5670 ** xEntryPoint() is the entry point for a statically linked [SQLite extension]
5671 ** that is to be automatically loaded into all new database connections.
5672 **
5673 ** ^(Even though the function prototype shows that xEntryPoint() takes
5674 ** no arguments and returns void, SQLite invokes xEntryPoint() with three
5675 ** arguments and expects and integer result as if the signature of the
5676 ** entry point where as follows:
5677 **
5678 ** <blockquote><pre>
5679 ** &nbsp; int xEntryPoint(
5680 ** &nbsp; sqlite3 *db,
@@ -5696,11 +5715,11 @@
5696 ** will be called more than once for each database connection that is opened.
5697 **
5698 ** See also: [sqlite3_reset_auto_extension()]
5699 ** and [sqlite3_cancel_auto_extension()]
5700 */
5701 SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void (*xEntryPoint)(void));
5702
5703 /*
5704 ** CAPI3REF: Cancel Automatic Extension Loading
5705 **
5706 ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
@@ -5708,19 +5727,19 @@
5708 ** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)]
5709 ** routine returns 1 if initialization routine X was successfully
5710 ** unregistered and it returns 0 if X was not on the list of initialization
5711 ** routines.
5712 */
5713 SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void (*xEntryPoint)(void));
5714
5715 /*
5716 ** CAPI3REF: Reset Automatic Extension Loading
5717 **
5718 ** ^This interface disables all automatic extensions previously
5719 ** registered using [sqlite3_auto_extension()].
5720 */
5721 SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void);
5722
5723 /*
5724 ** The interface to the virtual-table mechanism is currently considered
5725 ** to be experimental. The interface might change in incompatible ways.
5726 ** If this is a problem for you, do not use the interface at this time.
@@ -5753,41 +5772,41 @@
5753 ** of this structure must not change while it is registered with
5754 ** any database connection.
5755 */
5756 struct sqlite3_module {
5757 int iVersion;
5758 int (*xCreate)(sqlite3*, void *pAux,
5759 int argc, const char *const*argv,
5760 sqlite3_vtab **ppVTab, char**);
5761 int (*xConnect)(sqlite3*, void *pAux,
5762 int argc, const char *const*argv,
5763 sqlite3_vtab **ppVTab, char**);
5764 int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
5765 int (*xDisconnect)(sqlite3_vtab *pVTab);
5766 int (*xDestroy)(sqlite3_vtab *pVTab);
5767 int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);
5768 int (*xClose)(sqlite3_vtab_cursor*);
5769 int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
5770 int argc, sqlite3_value **argv);
5771 int (*xNext)(sqlite3_vtab_cursor*);
5772 int (*xEof)(sqlite3_vtab_cursor*);
5773 int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int);
5774 int (*xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid);
5775 int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *);
5776 int (*xBegin)(sqlite3_vtab *pVTab);
5777 int (*xSync)(sqlite3_vtab *pVTab);
5778 int (*xCommit)(sqlite3_vtab *pVTab);
5779 int (*xRollback)(sqlite3_vtab *pVTab);
5780 int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,
5781 void (**pxFunc)(sqlite3_context*,int,sqlite3_value**),
5782 void **ppArg);
5783 int (*xRename)(sqlite3_vtab *pVtab, const char *zNew);
5784 /* The methods above are in version 1 of the sqlite_module object. Those
5785 ** below are for version 2 and greater. */
5786 int (*xSavepoint)(sqlite3_vtab *pVTab, int);
5787 int (*xRelease)(sqlite3_vtab *pVTab, int);
5788 int (*xRollbackTo)(sqlite3_vtab *pVTab, int);
5789 };
5790
5791 /*
5792 ** CAPI3REF: Virtual Table Indexing Information
5793 ** KEYWORDS: sqlite3_index_info
@@ -5961,22 +5980,22 @@
5961 ** be invoked if the call to sqlite3_create_module_v2() fails.
5962 ** ^The sqlite3_create_module()
5963 ** interface is equivalent to sqlite3_create_module_v2() with a NULL
5964 ** destructor.
5965 */
5966 SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
5967 sqlite3 *db, /* SQLite connection to register module with */
5968 const char *zName, /* Name of the module */
5969 const sqlite3_module *p, /* Methods for the module */
5970 void *pClientData /* Client data for xCreate/xConnect */
5971 );
5972 SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
5973 sqlite3 *db, /* SQLite connection to register module with */
5974 const char *zName, /* Name of the module */
5975 const sqlite3_module *p, /* Methods for the module */
5976 void *pClientData, /* Client data for xCreate/xConnect */
5977 void(*xDestroy)(void*) /* Module destructor function */
5978 );
5979
5980 /*
5981 ** CAPI3REF: Virtual Table Instance Object
5982 ** KEYWORDS: sqlite3_vtab
@@ -6030,11 +6049,11 @@
6030 ** ^The [xCreate] and [xConnect] methods of a
6031 ** [virtual table module] call this interface
6032 ** to declare the format (the names and datatypes of the columns) of
6033 ** the virtual tables they implement.
6034 */
6035 SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
6036
6037 /*
6038 ** CAPI3REF: Overload A Function For A Virtual Table
6039 ** METHOD: sqlite3
6040 **
@@ -6049,11 +6068,11 @@
6049 ** of the new function always causes an exception to be thrown. So
6050 ** the new function is not good for anything by itself. Its only
6051 ** purpose is to be a placeholder function that can be overloaded
6052 ** by a [virtual table].
6053 */
6054 SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
6055
6056 /*
6057 ** The interface to the virtual-table mechanism defined above (back up
6058 ** to a comment remarkably similar to this one) is currently considered
6059 ** to be experimental. The interface might change in incompatible ways.
@@ -6148,11 +6167,11 @@
6148 ** zero-filled blob to read or write using the incremental-blob interface.
6149 **
6150 ** To avoid a resource leak, every open [BLOB handle] should eventually
6151 ** be released by a call to [sqlite3_blob_close()].
6152 */
6153 SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
6154 sqlite3*,
6155 const char *zDb,
6156 const char *zTable,
6157 const char *zColumn,
6158 sqlite3_int64 iRow,
@@ -6181,11 +6200,11 @@
6181 ** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
6182 ** always returns zero.
6183 **
6184 ** ^This function sets the database handle error code and message.
6185 */
6186 SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
6187
6188 /*
6189 ** CAPI3REF: Close A BLOB Handle
6190 ** DESTRUCTOR: sqlite3_blob
6191 **
@@ -6204,11 +6223,11 @@
6204 ** with a null pointer (such as would be returned by a failed call to
6205 ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function
6206 ** is passed a valid open blob handle, the values returned by the
6207 ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning.
6208 */
6209 SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *);
6210
6211 /*
6212 ** CAPI3REF: Return The Size Of An Open BLOB
6213 ** METHOD: sqlite3_blob
6214 **
@@ -6220,11 +6239,11 @@
6220 ** This routine only works on a [BLOB handle] which has been created
6221 ** by a prior successful call to [sqlite3_blob_open()] and which has not
6222 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6223 ** to this routine results in undefined and probably undesirable behavior.
6224 */
6225 SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *);
6226
6227 /*
6228 ** CAPI3REF: Read Data From A BLOB Incrementally
6229 ** METHOD: sqlite3_blob
6230 **
@@ -6249,11 +6268,11 @@
6249 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6250 ** to this routine results in undefined and probably undesirable behavior.
6251 **
6252 ** See also: [sqlite3_blob_write()].
6253 */
6254 SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
6255
6256 /*
6257 ** CAPI3REF: Write Data Into A BLOB Incrementally
6258 ** METHOD: sqlite3_blob
6259 **
@@ -6291,11 +6310,11 @@
6291 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6292 ** to this routine results in undefined and probably undesirable behavior.
6293 **
6294 ** See also: [sqlite3_blob_read()].
6295 */
6296 SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
6297
6298 /*
6299 ** CAPI3REF: Virtual File System Objects
6300 **
6301 ** A virtual filesystem (VFS) is an [sqlite3_vfs] object
@@ -6322,13 +6341,13 @@
6322 **
6323 ** ^Unregister a VFS with the sqlite3_vfs_unregister() interface.
6324 ** ^(If the default VFS is unregistered, another VFS is chosen as
6325 ** the default. The choice for the new VFS is arbitrary.)^
6326 */
6327 SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfsName);
6328 SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
6329 SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs*);
6330
6331 /*
6332 ** CAPI3REF: Mutexes
6333 **
6334 ** The SQLite core uses these routines for thread
@@ -6440,15 +6459,15 @@
6440 ** sqlite3_mutex_leave() is a NULL pointer, then all three routines
6441 ** behave as no-ops.
6442 **
6443 ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
6444 */
6445 SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int);
6446 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*);
6447 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*);
6448 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*);
6449 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*);
6450
6451 /*
6452 ** CAPI3REF: Mutex Methods Object
6453 **
6454 ** An instance of this structure defines the low-level routines
@@ -6513,19 +6532,19 @@
6513 ** If xMutexInit fails in any way, it is expected to clean up after itself
6514 ** prior to returning.
6515 */
6516 typedef struct sqlite3_mutex_methods sqlite3_mutex_methods;
6517 struct sqlite3_mutex_methods {
6518 int (*xMutexInit)(void);
6519 int (*xMutexEnd)(void);
6520 sqlite3_mutex *(*xMutexAlloc)(int);
6521 void (*xMutexFree)(sqlite3_mutex *);
6522 void (*xMutexEnter)(sqlite3_mutex *);
6523 int (*xMutexTry)(sqlite3_mutex *);
6524 void (*xMutexLeave)(sqlite3_mutex *);
6525 int (*xMutexHeld)(sqlite3_mutex *);
6526 int (*xMutexNotheld)(sqlite3_mutex *);
6527 };
6528
6529 /*
6530 ** CAPI3REF: Mutex Verification Routines
6531 **
@@ -6554,12 +6573,12 @@
6554 ** call to sqlite3_mutex_held() to fail, so a non-zero return is
6555 ** the appropriate thing to do. The sqlite3_mutex_notheld()
6556 ** interface should also return 1 when given a NULL pointer.
6557 */
6558 #ifndef NDEBUG
6559 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex*);
6560 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex*);
6561 #endif
6562
6563 /*
6564 ** CAPI3REF: Mutex Types
6565 **
@@ -6595,11 +6614,11 @@
6595 ** serializes access to the [database connection] given in the argument
6596 ** when the [threading mode] is Serialized.
6597 ** ^If the [threading mode] is Single-thread or Multi-thread then this
6598 ** routine returns a NULL pointer.
6599 */
6600 SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3*);
6601
6602 /*
6603 ** CAPI3REF: Low-Level Control Of Database Files
6604 ** METHOD: sqlite3
6605 **
@@ -6630,11 +6649,11 @@
6630 ** an incorrect zDbName and an SQLITE_ERROR return from the underlying
6631 ** xFileControl method.
6632 **
6633 ** See also: [SQLITE_FCNTL_LOCKSTATE]
6634 */
6635 SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
6636
6637 /*
6638 ** CAPI3REF: Testing Interface
6639 **
6640 ** ^The sqlite3_test_control() interface is used to read out internal
@@ -6712,12 +6731,12 @@
6712 ** be represented by a 32-bit integer, then the values returned by
6713 ** sqlite3_status() are undefined.
6714 **
6715 ** See also: [sqlite3_db_status()]
6716 */
6717 SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6718 SQLITE_API int SQLITE_STDCALL sqlite3_status64(
6719 int op,
6720 sqlite3_int64 *pCurrent,
6721 sqlite3_int64 *pHighwater,
6722 int resetFlag
6723 );
@@ -6838,11 +6857,11 @@
6838 ** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a
6839 ** non-zero [error code] on failure.
6840 **
6841 ** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
6842 */
6843 SQLITE_API int SQLITE_STDCALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
6844
6845 /*
6846 ** CAPI3REF: Status Parameters for database connections
6847 ** KEYWORDS: {SQLITE_DBSTATUS options}
6848 **
@@ -6981,11 +7000,11 @@
6981 ** ^If the resetFlg is true, then the counter is reset to zero after this
6982 ** interface call returns.
6983 **
6984 ** See also: [sqlite3_status()] and [sqlite3_db_status()].
6985 */
6986 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
6987
6988 /*
6989 ** CAPI3REF: Status Parameters for prepared statements
6990 ** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters}
6991 **
@@ -7217,22 +7236,22 @@
7217 */
7218 typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2;
7219 struct sqlite3_pcache_methods2 {
7220 int iVersion;
7221 void *pArg;
7222 int (*xInit)(void*);
7223 void (*xShutdown)(void*);
7224 sqlite3_pcache *(*xCreate)(int szPage, int szExtra, int bPurgeable);
7225 void (*xCachesize)(sqlite3_pcache*, int nCachesize);
7226 int (*xPagecount)(sqlite3_pcache*);
7227 sqlite3_pcache_page *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7228 void (*xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard);
7229 void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*,
7230 unsigned oldKey, unsigned newKey);
7231 void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
7232 void (*xDestroy)(sqlite3_pcache*);
7233 void (*xShrink)(sqlite3_pcache*);
7234 };
7235
7236 /*
7237 ** This is the obsolete pcache_methods object that has now been replaced
7238 ** by sqlite3_pcache_methods2. This object is not used by SQLite. It is
@@ -7239,20 +7258,20 @@
7239 ** retained in the header file for backwards compatibility only.
7240 */
7241 typedef struct sqlite3_pcache_methods sqlite3_pcache_methods;
7242 struct sqlite3_pcache_methods {
7243 void *pArg;
7244 int (*xInit)(void*);
7245 void (*xShutdown)(void*);
7246 sqlite3_pcache *(*xCreate)(int szPage, int bPurgeable);
7247 void (*xCachesize)(sqlite3_pcache*, int nCachesize);
7248 int (*xPagecount)(sqlite3_pcache*);
7249 void *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7250 void (*xUnpin)(sqlite3_pcache*, void*, int discard);
7251 void (*xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey);
7252 void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
7253 void (*xDestroy)(sqlite3_pcache*);
7254 };
7255
7256
7257 /*
7258 ** CAPI3REF: Online Backup Object
@@ -7450,20 +7469,20 @@
7450 ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()
7451 ** APIs are not strictly speaking threadsafe. If they are invoked at the
7452 ** same time as another thread is invoking sqlite3_backup_step() it is
7453 ** possible that they return invalid values.
7454 */
7455 SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
7456 sqlite3 *pDest, /* Destination database handle */
7457 const char *zDestName, /* Destination database name */
7458 sqlite3 *pSource, /* Source database handle */
7459 const char *zSourceName /* Source database name */
7460 );
7461 SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage);
7462 SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p);
7463 SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p);
7464 SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p);
7465
7466 /*
7467 ** CAPI3REF: Unlock Notification
7468 ** METHOD: sqlite3
7469 **
@@ -7576,13 +7595,13 @@
7576 ** by an sqlite3_step() call. ^(If there is a blocking connection, then the
7577 ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in
7578 ** the special "DROP TABLE/INDEX" case, the extended error code is just
7579 ** SQLITE_LOCKED.)^
7580 */
7581 SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
7582 sqlite3 *pBlocked, /* Waiting connection */
7583 void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */
7584 void *pNotifyArg /* Argument to pass to xNotify */
7585 );
7586
7587
7588 /*
@@ -7591,12 +7610,12 @@
7591 ** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications
7592 ** and extensions to compare the contents of two buffers containing UTF-8
7593 ** strings in a case-independent fashion, using the same definition of "case
7594 ** independence" that SQLite uses internally when comparing identifiers.
7595 */
7596 SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *, const char *);
7597 SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *, const char *, int);
7598
7599 /*
7600 ** CAPI3REF: String Globbing
7601 *
7602 ** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if
@@ -7609,11 +7628,11 @@
7609 ** Note that this routine returns zero on a match and non-zero if the strings
7610 ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
7611 **
7612 ** See also: [sqlite3_strlike()].
7613 */
7614 SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlob, const char *zStr);
7615
7616 /*
7617 ** CAPI3REF: String LIKE Matching
7618 *
7619 ** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if
@@ -7632,11 +7651,11 @@
7632 ** Note that this routine returns zero on a match and non-zero if the strings
7633 ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
7634 **
7635 ** See also: [sqlite3_strglob()].
7636 */
7637 SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
7638
7639 /*
7640 ** CAPI3REF: Error Logging Interface
7641 **
7642 ** ^The [sqlite3_log()] interface writes a message into the [error log]
@@ -7691,13 +7710,13 @@
7691 ** previously registered write-ahead log callback. ^Note that the
7692 ** [sqlite3_wal_autocheckpoint()] interface and the
7693 ** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will
7694 ** overwrite any prior [sqlite3_wal_hook()] settings.
7695 */
7696 SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
7697 sqlite3*,
7698 int(*)(void *,sqlite3*,const char*,int),
7699 void*
7700 );
7701
7702 /*
7703 ** CAPI3REF: Configure an auto-checkpoint
@@ -7726,11 +7745,11 @@
7726 ** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]
7727 ** pages. The use of this interface
7728 ** is only necessary if the default setting is found to be suboptimal
7729 ** for a particular application.
7730 */
7731 SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
7732
7733 /*
7734 ** CAPI3REF: Checkpoint a database
7735 ** METHOD: sqlite3
7736 **
@@ -7748,11 +7767,11 @@
7748 ** interface was added. This interface is retained for backwards
7749 ** compatibility and as a convenience for applications that need to manually
7750 ** start a callback but which do not need the full power (and corresponding
7751 ** complication) of [sqlite3_wal_checkpoint_v2()].
7752 */
7753 SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
7754
7755 /*
7756 ** CAPI3REF: Checkpoint a database
7757 ** METHOD: sqlite3
7758 **
@@ -7842,11 +7861,11 @@
7842 ** [sqlite3_errcode()] and [sqlite3_errmsg()].
7843 **
7844 ** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface
7845 ** from SQL.
7846 */
7847 SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
7848 sqlite3 *db, /* Database handle */
7849 const char *zDb, /* Name of attached database (or NULL) */
7850 int eMode, /* SQLITE_CHECKPOINT_* value */
7851 int *pnLog, /* OUT: Size of WAL log in frames */
7852 int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -7931,11 +7950,11 @@
7931 ** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL],
7932 ** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode
7933 ** of the SQL statement that triggered the call to the [xUpdate] method of the
7934 ** [virtual table].
7935 */
7936 SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *);
7937
7938 /*
7939 ** CAPI3REF: Conflict resolution modes
7940 ** KEYWORDS: {conflict resolution mode}
7941 **
@@ -8036,11 +8055,11 @@
8036 ** as if the loop did not exist - it returns non-zero and leave the variable
8037 ** that pOut points to unchanged.
8038 **
8039 ** See also: [sqlite3_stmt_scanstatus_reset()]
8040 */
8041 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus(
8042 sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
8043 int idx, /* Index of loop to report on */
8044 int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
8045 void *pOut /* Result written here */
8046 );
@@ -8052,11 +8071,11 @@
8052 ** ^Zero all [sqlite3_stmt_scanstatus()] related event counters.
8053 **
8054 ** This API is only available if the library is built with pre-processor
8055 ** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined.
8056 */
8057 SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
8058
8059 /*
8060 ** CAPI3REF: Flush caches to disk mid-transaction
8061 **
8062 ** ^If a write-transaction is open on [database connection] D when the
@@ -8084,11 +8103,11 @@
8084 ** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK.
8085 **
8086 ** ^This function does not set the database handle error code or message
8087 ** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions.
8088 */
8089 SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3*);
8090
8091 /*
8092 ** CAPI3REF: The pre-update hook.
8093 **
8094 ** ^These interfaces are only available if SQLite is compiled using the
@@ -8164,13 +8183,13 @@
8164 ** triggers; or 2 for changes resulting from triggers called by top-level
8165 ** triggers; and so forth.
8166 **
8167 ** See also: [sqlite3_update_hook()]
8168 */
8169 SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_STDCALL sqlite3_preupdate_hook(
8170 sqlite3 *db,
8171 void(*xPreUpdate)(
8172 void *pCtx, /* Copy of third arg to preupdate_hook() */
8173 sqlite3 *db, /* Database handle */
8174 int op, /* SQLITE_UPDATE, DELETE or INSERT */
8175 char const *zDb, /* Database name */
8176 char const *zName, /* Table name */
@@ -8177,14 +8196,14 @@
8177 sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */
8178 sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */
8179 ),
8180 void*
8181 );
8182 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **);
8183 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *);
8184 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *);
8185 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **);
8186
8187 /*
8188 ** CAPI3REF: Low-level system error code
8189 **
8190 ** ^Attempt to return the underlying operating system error code or error
@@ -8192,11 +8211,11 @@
8192 ** The return value is OS-dependent. For example, on unix systems, after
8193 ** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be
8194 ** called to get back the underlying "errno" that caused the problem, such
8195 ** as ENOSPC, EAUTH, EISDIR, and so forth.
8196 */
8197 SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3*);
8198
8199 /*
8200 ** CAPI3REF: Database Snapshot
8201 ** KEYWORDS: {snapshot}
8202 ** EXPERIMENTAL
@@ -8242,11 +8261,11 @@
8242 ** to avoid a memory leak.
8243 **
8244 ** The [sqlite3_snapshot_get()] interface is only available when the
8245 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8246 */
8247 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_get(
8248 sqlite3 *db,
8249 const char *zSchema,
8250 sqlite3_snapshot **ppSnapshot
8251 );
8252
@@ -8280,11 +8299,11 @@
8280 ** database connection in order to make it ready to use snapshots.)
8281 **
8282 ** The [sqlite3_snapshot_open()] interface is only available when the
8283 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8284 */
8285 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_open(
8286 sqlite3 *db,
8287 const char *zSchema,
8288 sqlite3_snapshot *pSnapshot
8289 );
8290
@@ -8297,11 +8316,11 @@
8297 ** using this routine to avoid a memory leak.
8298 **
8299 ** The [sqlite3_snapshot_free()] interface is only available when the
8300 ** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
8301 */
8302 SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot*);
8303
8304 /*
8305 ** CAPI3REF: Compare the ages of two snapshot handles.
8306 ** EXPERIMENTAL
8307 **
@@ -8321,11 +8340,11 @@
8321 **
8322 ** Otherwise, this API returns a negative value if P1 refers to an older
8323 ** snapshot than P2, zero if the two handles refer to the same database
8324 ** snapshot, and a positive value if P1 is a newer snapshot than P2.
8325 */
8326 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_cmp(
8327 sqlite3_snapshot *p1,
8328 sqlite3_snapshot *p2
8329 );
8330
8331 /*
@@ -8379,14 +8398,14 @@
8379 ** Register a geometry callback named zGeom that can be used as part of an
8380 ** R-Tree geometry query as follows:
8381 **
8382 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
8383 */
8384 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
8385 sqlite3 *db,
8386 const char *zGeom,
8387 int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
8388 void *pContext
8389 );
8390
8391
8392 /*
@@ -8396,25 +8415,25 @@
8396 struct sqlite3_rtree_geometry {
8397 void *pContext; /* Copy of pContext passed to s_r_g_c() */
8398 int nParam; /* Size of array aParam[] */
8399 sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */
8400 void *pUser; /* Callback implementation user data */
8401 void (*xDelUser)(void *); /* Called by SQLite to clean up pUser */
8402 };
8403
8404 /*
8405 ** Register a 2nd-generation geometry callback named zScore that can be
8406 ** used as part of an R-Tree geometry query as follows:
8407 **
8408 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...)
8409 */
8410 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
8411 sqlite3 *db,
8412 const char *zQueryFunc,
8413 int (*xQueryFunc)(sqlite3_rtree_query_info*),
8414 void *pContext,
8415 void (*xDestructor)(void*)
8416 );
8417
8418
8419 /*
8420 ** A pointer to a structure of the following type is passed as the
@@ -8428,11 +8447,11 @@
8428 struct sqlite3_rtree_query_info {
8429 void *pContext; /* pContext from when function registered */
8430 int nParam; /* Number of function parameters */
8431 sqlite3_rtree_dbl *aParam; /* value of function parameters */
8432 void *pUser; /* callback can use this, if desired */
8433 void (*xDelUser)(void*); /* function to free pUser */
8434 sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */
8435 unsigned int *anQueue; /* Number of pending entries in the queue */
8436 int nCoord; /* Number of coordinates */
8437 int iLevel; /* Level of current node or entry */
8438 int mxLevel; /* The largest iLevel value in the tree */
@@ -8624,11 +8643,11 @@
8624 ** If xFilter returns 0, changes is not tracked. Note that once a table is
8625 ** attached, xFilter will not be called again.
8626 */
8627 void sqlite3session_table_filter(
8628 sqlite3_session *pSession, /* Session object */
8629 int(*xFilter)(
8630 void *pCtx, /* Copy of third arg to _filter_table() */
8631 const char *zTab /* Table name */
8632 ),
8633 void *pCtx /* First argument passed to xFilter */
8634 );
@@ -9199,11 +9218,11 @@
9199 ** An sqlite3_changegroup object is used to combine two or more changesets
9200 ** (or patchsets) into a single changeset (or patchset). A single changegroup
9201 ** object may combine changesets or patchsets, but not both. The output is
9202 ** always in the same format as the input.
9203 **
9204 ** If successful, this function returns SQLITE_OK and populates (*pp) with
9205 ** a pointer to a new sqlite3_changegroup object before returning. The caller
9206 ** should eventually free the returned object using a call to
9207 ** sqlite3changegroup_delete(). If an error occurs, an SQLite error code
9208 ** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL.
9209 **
@@ -9319,11 +9338,11 @@
9319 ** changes for tables that do not appear in the first changeset, they are
9320 ** appended onto the end of the output changeset, again in the order in
9321 ** which they are first encountered.
9322 **
9323 ** If an error occurs, an SQLite error code is returned and the output
9324 ** variables (*pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK
9325 ** is returned and the output variables are set to the size of and a
9326 ** pointer to the output buffer, respectively. In this case it is the
9327 ** responsibility of the caller to eventually free the buffer using a
9328 ** call to sqlite3_free().
9329 */
@@ -9476,15 +9495,15 @@
9476 */
9477 int sqlite3changeset_apply(
9478 sqlite3 *db, /* Apply change to "main" db of this handle */
9479 int nChangeset, /* Size of changeset in bytes */
9480 void *pChangeset, /* Changeset blob */
9481 int(*xFilter)(
9482 void *pCtx, /* Copy of sixth arg to _apply() */
9483 const char *zTab /* Table name */
9484 ),
9485 int(*xConflict)(
9486 void *pCtx, /* Copy of sixth arg to _apply() */
9487 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
9488 sqlite3_changeset_iter *p /* Handle describing change and conflict */
9489 ),
9490 void *pCtx /* First argument passed to xConflict */
@@ -9621,20 +9640,20 @@
9621 ** </pre>
9622 **
9623 ** Is replaced by:
9624 **
9625 ** <pre>
9626 ** &nbsp; int (*xInput)(void *pIn, void *pData, int *pnData),
9627 ** &nbsp; void *pIn,
9628 ** </pre>
9629 **
9630 ** Each time the xInput callback is invoked by the sessions module, the first
9631 ** argument passed is a copy of the supplied pIn context pointer. The second
9632 ** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no
9633 ** error occurs the xInput method should copy up to (*pnData) bytes of data
9634 ** into the buffer and set (*pnData) to the actual number of bytes copied
9635 ** before returning SQLITE_OK. If the input is completely exhausted, (*pnData)
9636 ** should be set to zero to indicate this. Or, if an error occurs, an SQLite
9637 ** error code should be returned. In all cases, if an xInput callback returns
9638 ** an error, all processing is abandoned and the streaming API function
9639 ** returns a copy of the error code to the caller.
9640 **
@@ -9655,11 +9674,11 @@
9655 ** </pre>
9656 **
9657 ** Is replaced by:
9658 **
9659 ** <pre>
9660 ** &nbsp; int (*xOutput)(void *pOut, const void *pData, int nData),
9661 ** &nbsp; void *pOut
9662 ** </pre>
9663 **
9664 ** The xOutput callback is invoked zero or more times to return data to
9665 ** the application. The first parameter passed to each call is a copy of the
@@ -9675,58 +9694,58 @@
9675 ** parameter set to a value less than or equal to zero. Other than this,
9676 ** no guarantees are made as to the size of the chunks of data returned.
9677 */
9678 int sqlite3changeset_apply_strm(
9679 sqlite3 *db, /* Apply change to "main" db of this handle */
9680 int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
9681 void *pIn, /* First arg for xInput */
9682 int(*xFilter)(
9683 void *pCtx, /* Copy of sixth arg to _apply() */
9684 const char *zTab /* Table name */
9685 ),
9686 int(*xConflict)(
9687 void *pCtx, /* Copy of sixth arg to _apply() */
9688 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
9689 sqlite3_changeset_iter *p /* Handle describing change and conflict */
9690 ),
9691 void *pCtx /* First argument passed to xConflict */
9692 );
9693 int sqlite3changeset_concat_strm(
9694 int (*xInputA)(void *pIn, void *pData, int *pnData),
9695 void *pInA,
9696 int (*xInputB)(void *pIn, void *pData, int *pnData),
9697 void *pInB,
9698 int (*xOutput)(void *pOut, const void *pData, int nData),
9699 void *pOut
9700 );
9701 int sqlite3changeset_invert_strm(
9702 int (*xInput)(void *pIn, void *pData, int *pnData),
9703 void *pIn,
9704 int (*xOutput)(void *pOut, const void *pData, int nData),
9705 void *pOut
9706 );
9707 int sqlite3changeset_start_strm(
9708 sqlite3_changeset_iter **pp,
9709 int (*xInput)(void *pIn, void *pData, int *pnData),
9710 void *pIn
9711 );
9712 int sqlite3session_changeset_strm(
9713 sqlite3_session *pSession,
9714 int (*xOutput)(void *pOut, const void *pData, int nData),
9715 void *pOut
9716 );
9717 int sqlite3session_patchset_strm(
9718 sqlite3_session *pSession,
9719 int (*xOutput)(void *pOut, const void *pData, int nData),
9720 void *pOut
9721 );
9722 int sqlite3changegroup_add_strm(sqlite3_changegroup*,
9723 int (*xInput)(void *pIn, void *pData, int *pnData),
9724 void *pIn
9725 );
9726 int sqlite3changegroup_output_strm(sqlite3_changegroup*,
9727 int (*xOutput)(void *pOut, const void *pData, int nData),
9728 void *pOut
9729 );
9730
9731
9732 /*
@@ -9777,11 +9796,11 @@
9777
9778 typedef struct Fts5ExtensionApi Fts5ExtensionApi;
9779 typedef struct Fts5Context Fts5Context;
9780 typedef struct Fts5PhraseIter Fts5PhraseIter;
9781
9782 typedef void (*fts5_extension_function)(
9783 const Fts5ExtensionApi *pApi, /* API offered by current FTS version */
9784 Fts5Context *pFts, /* First arg to pass to pApi functions */
9785 sqlite3_context *pCtx, /* Context for returning result/error */
9786 int nVal, /* Number of values in apVal[] array */
9787 sqlite3_value **apVal /* Array of trailing arguments */
@@ -9828,15 +9847,15 @@
9828 ** This function may be quite inefficient if used with an FTS5 table
9829 ** created with the "columnsize=0" option.
9830 **
9831 ** xColumnText:
9832 ** This function attempts to retrieve the text of column iCol of the
9833 ** current document. If successful, (*pz) is set to point to a buffer
9834 ** containing the text in utf-8 encoding, (*pn) is set to the size in bytes
9835 ** (not characters) of the buffer and SQLITE_OK is returned. Otherwise,
9836 ** if an error occurs, an SQLite error code is returned and the final values
9837 ** of (*pz) and (*pn) are undefined.
9838 **
9839 ** xPhraseCount:
9840 ** Returns the number of phrases in the current query expression.
9841 **
9842 ** xPhraseSize:
@@ -9941,11 +9960,11 @@
9941 ** xRowCount(pFts5, pnRow)
9942 **
9943 ** This function is used to retrieve the total number of rows in the table.
9944 ** In other words, the same value that would be returned by:
9945 **
9946 ** SELECT count(*) FROM ftstable;
9947 **
9948 ** xPhraseFirst()
9949 ** This function is used, along with type Fts5PhraseIter and the xPhraseNext
9950 ** method, to iterate through all instances of a single query phrase within
9951 ** the current row. This is the same information as is accessible via the
@@ -10008,43 +10027,43 @@
10008 ** See xPhraseFirstColumn above.
10009 */
10010 struct Fts5ExtensionApi {
10011 int iVersion; /* Currently always set to 3 */
10012
10013 void *(*xUserData)(Fts5Context*);
10014
10015 int (*xColumnCount)(Fts5Context*);
10016 int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow);
10017 int (*xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken);
10018
10019 int (*xTokenize)(Fts5Context*,
10020 const char *pText, int nText, /* Text to tokenize */
10021 void *pCtx, /* Context passed to xToken() */
10022 int (*xToken)(void*, int, const char*, int, int, int) /* Callback */
10023 );
10024
10025 int (*xPhraseCount)(Fts5Context*);
10026 int (*xPhraseSize)(Fts5Context*, int iPhrase);
10027
10028 int (*xInstCount)(Fts5Context*, int *pnInst);
10029 int (*xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff);
10030
10031 sqlite3_int64 (*xRowid)(Fts5Context*);
10032 int (*xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn);
10033 int (*xColumnSize)(Fts5Context*, int iCol, int *pnToken);
10034
10035 int (*xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData,
10036 int(*)(const Fts5ExtensionApi*,Fts5Context*,void*)
10037 );
10038 int (*xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*));
10039 void *(*xGetAuxdata)(Fts5Context*, int bClear);
10040
10041 int (*xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*);
10042 void (*xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff);
10043
10044 int (*xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*);
10045 void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol);
10046 };
10047
10048 /*
10049 ** CUSTOM AUXILIARY FUNCTIONS
10050 *************************************************************************/
@@ -10068,11 +10087,11 @@
10068 ** The second and third arguments are an array of nul-terminated strings
10069 ** containing the tokenizer arguments, if any, specified following the
10070 ** tokenizer name as part of the CREATE VIRTUAL TABLE statement used
10071 ** to create the FTS5 table.
10072 **
10073 ** The final argument is an output variable. If successful, (*ppOut)
10074 ** should be set to point to the new tokenizer handle and SQLITE_OK
10075 ** returned. If an error occurs, some value other than SQLITE_OK should
10076 ** be returned. In this case, fts5 assumes that the final value of *ppOut
10077 ** is undefined.
10078 **
@@ -10242,17 +10261,17 @@
10242 ** inefficient.
10243 */
10244 typedef struct Fts5Tokenizer Fts5Tokenizer;
10245 typedef struct fts5_tokenizer fts5_tokenizer;
10246 struct fts5_tokenizer {
10247 int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
10248 void (*xDelete)(Fts5Tokenizer*);
10249 int (*xTokenize)(Fts5Tokenizer*,
10250 void *pCtx,
10251 int flags, /* Mask of FTS5_TOKENIZE_* flags */
10252 const char *pText, int nText,
10253 int (*xToken)(
10254 void *pCtx, /* Copy of 2nd argument to xTokenize() */
10255 int tflags, /* Mask of FTS5_TOKEN_* flags */
10256 const char *pToken, /* Pointer to buffer containing token */
10257 int nToken, /* Size of token in bytes */
10258 int iStart, /* Byte offset of token within input text */
@@ -10281,33 +10300,33 @@
10281 typedef struct fts5_api fts5_api;
10282 struct fts5_api {
10283 int iVersion; /* Currently always set to 2 */
10284
10285 /* Create a new tokenizer */
10286 int (*xCreateTokenizer)(
10287 fts5_api *pApi,
10288 const char *zName,
10289 void *pContext,
10290 fts5_tokenizer *pTokenizer,
10291 void (*xDestroy)(void*)
10292 );
10293
10294 /* Find an existing tokenizer */
10295 int (*xFindTokenizer)(
10296 fts5_api *pApi,
10297 const char *zName,
10298 void **ppContext,
10299 fts5_tokenizer *pTokenizer
10300 );
10301
10302 /* Create a new auxiliary function */
10303 int (*xCreateFunction)(
10304 fts5_api *pApi,
10305 const char *zName,
10306 void *pContext,
10307 fts5_extension_function xFunction,
10308 void (*xDestroy)(void*)
10309 );
10310 };
10311
10312 /*
10313 ** END OF REGISTRATION API
10314
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -52,12 +52,21 @@
52 # define SQLITE_API
53 #endif
54 #ifndef SQLITE_CDECL
55 # define SQLITE_CDECL
56 #endif
57 #ifndef SQLITE_APICALL
58 # define SQLITE_APICALL
59 #endif
60 #ifndef SQLITE_STDCALL
61 # define SQLITE_STDCALL SQLITE_APICALL
62 #endif
63 #ifndef SQLITE_CALLBACK
64 # define SQLITE_CALLBACK
65 #endif
66 #ifndef SQLITE_SYSAPI
67 # define SQLITE_SYSAPI
68 #endif
69
70 /*
71 ** These no-op macros are used in front of interfaces to mark those
72 ** interfaces as either deprecated or experimental. New applications
@@ -111,11 +120,11 @@
120 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
121 ** [sqlite_version()] and [sqlite_source_id()].
122 */
123 #define SQLITE_VERSION "3.14.0"
124 #define SQLITE_VERSION_NUMBER 3014000
125 #define SQLITE_SOURCE_ID "2016-08-02 08:45:26 7c38a79cdd42aaa45715aea330d10ca859098837"
126
127 /*
128 ** CAPI3REF: Run-Time Library Version Numbers
129 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
130 **
@@ -144,13 +153,13 @@
153 ** [SQLITE_SOURCE_ID] C preprocessor macro.
154 **
155 ** See also: [sqlite_version()] and [sqlite_source_id()].
156 */
157 SQLITE_API SQLITE_EXTERN const char sqlite3_version[];
158 SQLITE_API const char *SQLITE_APICALL sqlite3_libversion(void);
159 SQLITE_API const char *SQLITE_APICALL sqlite3_sourceid(void);
160 SQLITE_API int SQLITE_APICALL sqlite3_libversion_number(void);
161
162 /*
163 ** CAPI3REF: Run-Time Library Compilation Options Diagnostics
164 **
165 ** ^The sqlite3_compileoption_used() function returns 0 or 1
@@ -171,12 +180,12 @@
180 **
181 ** See also: SQL functions [sqlite_compileoption_used()] and
182 ** [sqlite_compileoption_get()] and the [compile_options pragma].
183 */
184 #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
185 SQLITE_API int SQLITE_APICALL sqlite3_compileoption_used(const char *zOptName);
186 SQLITE_API const char *SQLITE_APICALL sqlite3_compileoption_get(int N);
187 #endif
188
189 /*
190 ** CAPI3REF: Test To See If The Library Is Threadsafe
191 **
@@ -211,11 +220,11 @@
220 ** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
221 ** is unchanged by calls to sqlite3_config().)^
222 **
223 ** See the [threading mode] documentation for additional information.
224 */
225 SQLITE_API int SQLITE_APICALL sqlite3_threadsafe(void);
226
227 /*
228 ** CAPI3REF: Database Connection Handle
229 ** KEYWORDS: {database connection} {database connections}
230 **
@@ -308,19 +317,19 @@
317 ** from [sqlite3_open()], [sqlite3_open16()], or
318 ** [sqlite3_open_v2()], and not previously closed.
319 ** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
320 ** argument is a harmless no-op.
321 */
322 SQLITE_API int SQLITE_APICALL sqlite3_close(sqlite3*);
323 SQLITE_API int SQLITE_APICALL sqlite3_close_v2(sqlite3*);
324
325 /*
326 ** The type for a callback function.
327 ** This is legacy and deprecated. It is included for historical
328 ** compatibility and is not documented.
329 */
330 typedef int (SQLITE_CALLBACK *sqlite3_callback)(void*,int,char**, char**);
331
332 /*
333 ** CAPI3REF: One-Step Query Execution Interface
334 ** METHOD: sqlite3
335 **
@@ -380,14 +389,14 @@
389 ** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
390 ** <li> The application must not modify the SQL statement text passed into
391 ** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
392 ** </ul>
393 */
394 SQLITE_API int SQLITE_APICALL sqlite3_exec(
395 sqlite3*, /* An open database */
396 const char *sql, /* SQL to be evaluated */
397 int (SQLITE_CALLBACK *callback)(void*,int,char**,char**), /* Callback function */
398 void *, /* 1st argument to callback */
399 char **errmsg /* Error msg written here */
400 );
401
402 /*
@@ -731,30 +740,30 @@
740 ** database corruption.
741 */
742 typedef struct sqlite3_io_methods sqlite3_io_methods;
743 struct sqlite3_io_methods {
744 int iVersion;
745 int (SQLITE_CALLBACK *xClose)(sqlite3_file*);
746 int (SQLITE_CALLBACK *xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
747 int (SQLITE_CALLBACK *xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
748 int (SQLITE_CALLBACK *xTruncate)(sqlite3_file*, sqlite3_int64 size);
749 int (SQLITE_CALLBACK *xSync)(sqlite3_file*, int flags);
750 int (SQLITE_CALLBACK *xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
751 int (SQLITE_CALLBACK *xLock)(sqlite3_file*, int);
752 int (SQLITE_CALLBACK *xUnlock)(sqlite3_file*, int);
753 int (SQLITE_CALLBACK *xCheckReservedLock)(sqlite3_file*, int *pResOut);
754 int (SQLITE_CALLBACK *xFileControl)(sqlite3_file*, int op, void *pArg);
755 int (SQLITE_CALLBACK *xSectorSize)(sqlite3_file*);
756 int (SQLITE_CALLBACK *xDeviceCharacteristics)(sqlite3_file*);
757 /* Methods above are valid for version 1 */
758 int (SQLITE_CALLBACK *xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
759 int (SQLITE_CALLBACK *xShmLock)(sqlite3_file*, int offset, int n, int flags);
760 void (SQLITE_CALLBACK *xShmBarrier)(sqlite3_file*);
761 int (SQLITE_CALLBACK *xShmUnmap)(sqlite3_file*, int deleteFlag);
762 /* Methods above are valid for version 2 */
763 int (SQLITE_CALLBACK *xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
764 int (SQLITE_CALLBACK *xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p);
765 /* Methods above are valid for version 3 */
766 /* Additional methods may be added in future releases */
767 };
768
769 /*
@@ -926,11 +935,11 @@
935 ** ^The [SQLITE_FCNTL_BUSYHANDLER]
936 ** file-control may be invoked by SQLite on the database file handle
937 ** shortly after it is opened in order to provide a custom VFS with access
938 ** to the connections busy-handler callback. The argument is of type (void **)
939 ** - an array of two (void *) values. The first (void *) actually points
940 ** to a function of type (int (SQLITE_CALLBACK *)(void *)). In order to invoke the connections
941 ** busy-handler, this function should be invoked with the second (void *) in
942 ** the array as the only argument. If it returns non-zero, then the operation
943 ** should be retried. If it returns zero, the custom VFS should abandon the
944 ** current operation.
945 **
@@ -1034,10 +1043,20 @@
1043 **
1044 ** Mutexes are created using [sqlite3_mutex_alloc()].
1045 */
1046 typedef struct sqlite3_mutex sqlite3_mutex;
1047
1048 /*
1049 ** CAPI3REF: Loadable Extension Thunk
1050 **
1051 ** A pointer to the opaque sqlite3_api_routines structure is passed as
1052 ** the third parameter to entry points of [loadable extensions]. This
1053 ** structure must be typedefed in order to work around compiler warnings
1054 ** on some platforms.
1055 */
1056 typedef struct sqlite3_api_routines sqlite3_api_routines;
1057
1058 /*
1059 ** CAPI3REF: OS Interface Object
1060 **
1061 ** An instance of the sqlite3_vfs object defines the interface between
1062 ** the SQLite core and the underlying operating system. The "vfs"
@@ -1192,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 */
@@ -1369,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
@@ -1491,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
@@ -1714,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
@@ -1767,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
@@ -1965,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 **
@@ -2017,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 **
@@ -2070,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 **
@@ -2094,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 **
@@ -2134,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
@@ -2169,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
@@ -2231,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 **
@@ -2254,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 **
@@ -2329,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
@@ -2444,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
@@ -2536,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
@@ -2566,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
@@ -2590,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 **
@@ -2673,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
@@ -2781,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 **
@@ -2872,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
@@ -2911,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 **
@@ -3140,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 );
@@ -3194,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
@@ -3240,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 **
@@ -3312,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 **
@@ -3464,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 */
@@ -3524,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 **
@@ -3557,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 **
@@ -3578,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 **
@@ -3742,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 **
@@ -3776,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 **
@@ -3804,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 **
@@ -3821,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 **
@@ -3843,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 **
@@ -3872,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 **
@@ -3921,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 **
@@ -3958,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 **
@@ -4039,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 **
@@ -4060,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 **
@@ -4250,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 **
@@ -4287,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 **
@@ -4314,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}
@@ -4414,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 **
@@ -4480,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
@@ -4535,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 **
@@ -4562,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 **
@@ -4578,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 **
@@ -4624,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 **
@@ -4639,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 **
@@ -4651,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 **
@@ -4704,12 +4723,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 **
@@ -4722,11 +4741,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
@@ -4841,31 +4860,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
@@ -4876,11 +4895,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 **
@@ -4958,31 +4977,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
@@ -5008,19 +5027,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
@@ -5027,15 +5046,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
@@ -5045,35 +5064,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 /*
@@ -5091,11 +5110,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
@@ -5210,11 +5229,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 **
@@ -5223,11 +5242,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 **
@@ -5240,21 +5259,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 **
@@ -5266,11 +5285,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 **
@@ -5315,12 +5334,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 **
@@ -5367,13 +5386,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
@@ -5407,11 +5426,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
@@ -5423,11 +5442,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 **
@@ -5437,11 +5456,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
@@ -5489,11 +5508,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 **
@@ -5500,11 +5519,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
@@ -5570,11 +5589,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 */
@@ -5626,11 +5645,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 );
@@ -5658,11 +5677,11 @@
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
@@ -5670,11 +5689,11 @@
5689 ** xEntryPoint() is the entry point for a statically linked [SQLite extension]
5690 ** that is to be automatically loaded into all new database connections.
5691 **
5692 ** ^(Even though the function prototype shows that xEntryPoint() takes
5693 ** no arguments and returns void, SQLite invokes xEntryPoint() with three
5694 ** arguments and expects an integer result as if the signature of the
5695 ** entry point where as follows:
5696 **
5697 ** <blockquote><pre>
5698 ** &nbsp; int xEntryPoint(
5699 ** &nbsp; sqlite3 *db,
@@ -5696,11 +5715,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
@@ -5708,19 +5727,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.
@@ -5753,41 +5772,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
@@ -5961,22 +5980,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
@@ -6030,11 +6049,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 **
@@ -6049,11 +6068,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.
@@ -6148,11 +6167,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,
@@ -6181,11 +6200,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 **
@@ -6204,11 +6223,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 **
@@ -6220,11 +6239,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 **
@@ -6249,11 +6268,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 **
@@ -6291,11 +6310,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
@@ -6322,13 +6341,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
@@ -6440,15 +6459,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
@@ -6513,19 +6532,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 **
@@ -6554,12 +6573,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 **
@@ -6595,11 +6614,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 **
@@ -6630,11 +6649,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
@@ -6712,12 +6731,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 );
@@ -6838,11 +6857,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 **
@@ -6981,11 +7000,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 **
@@ -7217,22 +7236,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
@@ -7239,20 +7258,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
@@ -7450,20 +7469,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 **
@@ -7576,13 +7595,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 /*
@@ -7591,12 +7610,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
@@ -7609,11 +7628,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
@@ -7632,11 +7651,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]
@@ -7691,13 +7710,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
@@ -7726,11 +7745,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 **
@@ -7748,11 +7767,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 **
@@ -7842,11 +7861,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 */
@@ -7931,11 +7950,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 **
@@ -8036,11 +8055,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 );
@@ -8052,11 +8071,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
@@ -8084,11 +8103,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
@@ -8164,13 +8183,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 */
@@ -8177,14 +8196,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
@@ -8192,11 +8211,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
@@ -8242,11 +8261,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
@@ -8280,11 +8299,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
@@ -8297,11 +8316,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 **
@@ -8321,11 +8340,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 /*
@@ -8379,14 +8398,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 /*
@@ -8396,25 +8415,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
@@ -8428,11 +8447,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 */
@@ -8624,11 +8643,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 );
@@ -9199,11 +9218,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 **
@@ -9319,11 +9338,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 */
@@ -9476,15 +9495,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 */
@@ -9621,20 +9640,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 **
@@ -9655,11 +9674,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
@@ -9675,58 +9694,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 /*
@@ -9777,11 +9796,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 */
@@ -9828,15 +9847,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:
@@ -9941,11 +9960,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
@@ -10008,43 +10027,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 *************************************************************************/
@@ -10068,11 +10087,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 **
@@ -10242,17 +10261,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 */
@@ -10281,33 +10300,33 @@
10300 typedef struct fts5_api fts5_api;
10301 struct fts5_api {
10302 int iVersion; /* Currently always set to 2 */
10303
10304 /* Create a new tokenizer */
10305 int (SQLITE_CALLBACK *xCreateTokenizer)(
10306 fts5_api *pApi,
10307 const char *zName,
10308 void *pContext,
10309 fts5_tokenizer *pTokenizer,
10310 void (SQLITE_CALLBACK *xDestroy)(void*)
10311 );
10312
10313 /* Find an existing tokenizer */
10314 int (SQLITE_CALLBACK *xFindTokenizer)(
10315 fts5_api *pApi,
10316 const char *zName,
10317 void **ppContext,
10318 fts5_tokenizer *pTokenizer
10319 );
10320
10321 /* Create a new auxiliary function */
10322 int (SQLITE_CALLBACK *xCreateFunction)(
10323 fts5_api *pApi,
10324 const char *zName,
10325 void *pContext,
10326 fts5_extension_function xFunction,
10327 void (SQLITE_CALLBACK *xDestroy)(void*)
10328 );
10329 };
10330
10331 /*
10332 ** END OF REGISTRATION API
10333
+15 -11
--- src/user.c
+++ src/user.c
@@ -170,27 +170,29 @@
170170
171171
172172
/*
173173
** Do a single prompt for a passphrase. Store the results in the blob.
174174
**
175
-** If the FOSSIL_PWREADER environment variable is set, then it will
176
-** be the name of a program that prompts the user for their password/
177
-** passphrase in a secure manner. The program should take one or more
178
-** arguments which are the prompts and should output the acquired
179
-** passphrase as a single line on stdout. This function will read the
180
-** output using popen().
181
-**
182
-** If FOSSIL_PWREADER is not set, or if it is not the name of an
183
-** executable, then use the C-library getpass() routine.
184175
**
185176
** The return value is a pointer to a static buffer that is overwritten
186177
** on subsequent calls to this same routine.
187178
*/
188179
static void prompt_for_passphrase(const char *zPrompt, Blob *pPassphrase){
189180
char *z;
181
+#if 0
182
+ */
183
+ ** If the FOSSIL_PWREADER environment variable is set, then it will
184
+ ** be the name of a program that prompts the user for their password/
185
+ ** passphrase in a secure manner. The program should take one or more
186
+ ** arguments which are the prompts and should output the acquired
187
+ ** passphrase as a single line on stdout. This function will read the
188
+ ** output using popen().
189
+ **
190
+ ** If FOSSIL_PWREADER is not set, or if it is not the name of an
191
+ ** executable, then use the C-library getpass() routine.
192
+ */
190193
const char *zProg = fossil_getenv("FOSSIL_PWREADER");
191
- const char *zSecure;
192194
if( zProg && zProg[0] ){
193195
static char zPass[100];
194196
Blob cmd;
195197
FILE *in;
196198
blob_zero(&cmd);
@@ -199,11 +201,13 @@
199201
in = popen(blob_str(&cmd), "r");
200202
fgets(zPass, sizeof(zPass), in);
201203
pclose(in);
202204
blob_reset(&cmd);
203205
z = zPass;
204
- }else if( fossil_security_level()>=2 ){
206
+ }else
207
+#endif
208
+ if( fossil_security_level()>=2 ){
205209
userGenerateScrambleCode();
206210
z = getpass(zPrompt);
207211
if( z ) userDescramble(z);
208212
printf("\033[3A\033[J"); /* Erase previous three lines */
209213
fflush(stdout);
210214
--- src/user.c
+++ src/user.c
@@ -170,27 +170,29 @@
170
171
172 /*
173 ** Do a single prompt for a passphrase. Store the results in the blob.
174 **
175 ** If the FOSSIL_PWREADER environment variable is set, then it will
176 ** be the name of a program that prompts the user for their password/
177 ** passphrase in a secure manner. The program should take one or more
178 ** arguments which are the prompts and should output the acquired
179 ** passphrase as a single line on stdout. This function will read the
180 ** output using popen().
181 **
182 ** If FOSSIL_PWREADER is not set, or if it is not the name of an
183 ** executable, then use the C-library getpass() routine.
184 **
185 ** The return value is a pointer to a static buffer that is overwritten
186 ** on subsequent calls to this same routine.
187 */
188 static void prompt_for_passphrase(const char *zPrompt, Blob *pPassphrase){
189 char *z;
 
 
 
 
 
 
 
 
 
 
 
 
190 const char *zProg = fossil_getenv("FOSSIL_PWREADER");
191 const char *zSecure;
192 if( zProg && zProg[0] ){
193 static char zPass[100];
194 Blob cmd;
195 FILE *in;
196 blob_zero(&cmd);
@@ -199,11 +201,13 @@
199 in = popen(blob_str(&cmd), "r");
200 fgets(zPass, sizeof(zPass), in);
201 pclose(in);
202 blob_reset(&cmd);
203 z = zPass;
204 }else if( fossil_security_level()>=2 ){
 
 
205 userGenerateScrambleCode();
206 z = getpass(zPrompt);
207 if( z ) userDescramble(z);
208 printf("\033[3A\033[J"); /* Erase previous three lines */
209 fflush(stdout);
210
--- src/user.c
+++ src/user.c
@@ -170,27 +170,29 @@
170
171
172 /*
173 ** Do a single prompt for a passphrase. Store the results in the blob.
174 **
 
 
 
 
 
 
 
 
 
175 **
176 ** The return value is a pointer to a static buffer that is overwritten
177 ** on subsequent calls to this same routine.
178 */
179 static void prompt_for_passphrase(const char *zPrompt, Blob *pPassphrase){
180 char *z;
181 #if 0
182 */
183 ** If the FOSSIL_PWREADER environment variable is set, then it will
184 ** be the name of a program that prompts the user for their password/
185 ** passphrase in a secure manner. The program should take one or more
186 ** arguments which are the prompts and should output the acquired
187 ** passphrase as a single line on stdout. This function will read the
188 ** output using popen().
189 **
190 ** If FOSSIL_PWREADER is not set, or if it is not the name of an
191 ** executable, then use the C-library getpass() routine.
192 */
193 const char *zProg = fossil_getenv("FOSSIL_PWREADER");
 
194 if( zProg && zProg[0] ){
195 static char zPass[100];
196 Blob cmd;
197 FILE *in;
198 blob_zero(&cmd);
@@ -199,11 +201,13 @@
201 in = popen(blob_str(&cmd), "r");
202 fgets(zPass, sizeof(zPass), in);
203 pclose(in);
204 blob_reset(&cmd);
205 z = zPass;
206 }else
207 #endif
208 if( fossil_security_level()>=2 ){
209 userGenerateScrambleCode();
210 z = getpass(zPrompt);
211 if( z ) userDescramble(z);
212 printf("\033[3A\033[J"); /* Erase previous three lines */
213 fflush(stdout);
214
+4 -3
--- www/server.wiki
+++ www/server.wiki
@@ -346,15 +346,16 @@
346346
Note also that Linux implements "getloadavg()" by accessing the "/proc/loadavg"
347347
file in the "proc" virtual filesystem. If you are running a Fossil instance
348348
inside a chroot() jail on Linux, you will need to make the "/proc" file
349349
system available inside that jail in order for this feature to work. On
350350
the self-hosting Fossil repository, this was accomplished by adding a line
351
-to the "/etc/mtab" or "/etc/fstab" file that looks like:
351
+to the "/etc/fstab" file that looks like:
352352
<blockquote><pre>
353
-chroot_jail_proc /home/www/proc proc r 0 0
353
+chroot_jail_proc /home/www/proc proc ro 0 0
354354
</pre></blockquote>
355
-Pathnames should be adjusted for individual systems, of course.
355
+The /home/www/proc pathname should be adjusted so that the "/proc" component is
356
+in the root of the chroot jail, of course.
356357
<p>
357358
To see if the load-average limiter is functional, visit the [/test_env] page
358359
of the server to view the current load average. If the value for the load
359360
average is greater than zero, that means that it is possible to activate
360361
the load-average limiter on that repository. If the load average shows
361362
--- www/server.wiki
+++ www/server.wiki
@@ -346,15 +346,16 @@
346 Note also that Linux implements "getloadavg()" by accessing the "/proc/loadavg"
347 file in the "proc" virtual filesystem. If you are running a Fossil instance
348 inside a chroot() jail on Linux, you will need to make the "/proc" file
349 system available inside that jail in order for this feature to work. On
350 the self-hosting Fossil repository, this was accomplished by adding a line
351 to the "/etc/mtab" or "/etc/fstab" file that looks like:
352 <blockquote><pre>
353 chroot_jail_proc /home/www/proc proc r 0 0
354 </pre></blockquote>
355 Pathnames should be adjusted for individual systems, of course.
 
356 <p>
357 To see if the load-average limiter is functional, visit the [/test_env] page
358 of the server to view the current load average. If the value for the load
359 average is greater than zero, that means that it is possible to activate
360 the load-average limiter on that repository. If the load average shows
361
--- www/server.wiki
+++ www/server.wiki
@@ -346,15 +346,16 @@
346 Note also that Linux implements "getloadavg()" by accessing the "/proc/loadavg"
347 file in the "proc" virtual filesystem. If you are running a Fossil instance
348 inside a chroot() jail on Linux, you will need to make the "/proc" file
349 system available inside that jail in order for this feature to work. On
350 the self-hosting Fossil repository, this was accomplished by adding a line
351 to the "/etc/fstab" file that looks like:
352 <blockquote><pre>
353 chroot_jail_proc /home/www/proc proc ro 0 0
354 </pre></blockquote>
355 The /home/www/proc pathname should be adjusted so that the "/proc" component is
356 in the root of the chroot jail, of course.
357 <p>
358 To see if the load-average limiter is functional, visit the [/test_env] page
359 of the server to view the current load average. If the value for the load
360 average is greater than zero, that means that it is possible to activate
361 the load-average limiter on that repository. If the load average shows
362

Keyboard Shortcuts

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