Fossil SCM

Update to the latest SQLite 3.8.9 alpha code.

drh 2015-03-31 00:15 trunk
Commit ec44ff010f0c112c7503d1f8133b7afc75399019
3 files changed +4 -4 +542 -519 +229 -232
+4 -4
--- src/shell.c
+++ src/shell.c
@@ -368,11 +368,11 @@
368368
** format string and subsequent arguments are values to be substituted
369369
** in place of % fields. The result of formatting this string
370370
** is written to iotrace.
371371
*/
372372
#ifdef SQLITE_ENABLE_IOTRACE
373
-static void iotracePrintf(const char *zFormat, ...){
373
+static void SQLITE_CDECL iotracePrintf(const char *zFormat, ...){
374374
va_list ap;
375375
char *z;
376376
if( iotrace==0 ) return;
377377
va_start(ap, zFormat);
378378
z = sqlite3_vmprintf(zFormat, ap);
@@ -3142,11 +3142,11 @@
31423142
}
31433143
}else
31443144
31453145
#ifdef SQLITE_ENABLE_IOTRACE
31463146
if( c=='i' && strncmp(azArg[0], "iotrace", n)==0 ){
3147
- extern void (*sqlite3IoTrace)(const char*, ...);
3147
+ SQLITE_API extern void (SQLITE_CDECL *sqlite3IoTrace)(const char*, ...);
31483148
if( iotrace && iotrace!=stdout ) fclose(iotrace);
31493149
iotrace = 0;
31503150
if( nArg<2 ){
31513151
sqlite3IoTrace = 0;
31523152
}else if( strcmp(azArg[1], "-")==0 ){
@@ -3801,13 +3801,13 @@
38013801
if( nArg==5 ){
38023802
rc = sqlite3_test_control(testctrl, p->db,
38033803
azArg[2],
38043804
integerValue(azArg[3]),
38053805
integerValue(azArg[4]));
3806
+ fprintf(p->out, "%d (0x%08x)\n", rc, rc);
38063807
}else{
3807
- fprintf(stderr,"Usage: .testctrl initmode dbName onoff tnum\n");
3808
- rc = 1;
3808
+ fprintf(stderr,"Usage: .testctrl imposter dbName onoff tnum\n");
38093809
}
38103810
break;
38113811
38123812
case SQLITE_TESTCTRL_BITVEC_TEST:
38133813
case SQLITE_TESTCTRL_FAULT_INSTALL:
38143814
--- src/shell.c
+++ src/shell.c
@@ -368,11 +368,11 @@
368 ** format string and subsequent arguments are values to be substituted
369 ** in place of % fields. The result of formatting this string
370 ** is written to iotrace.
371 */
372 #ifdef SQLITE_ENABLE_IOTRACE
373 static void iotracePrintf(const char *zFormat, ...){
374 va_list ap;
375 char *z;
376 if( iotrace==0 ) return;
377 va_start(ap, zFormat);
378 z = sqlite3_vmprintf(zFormat, ap);
@@ -3142,11 +3142,11 @@
3142 }
3143 }else
3144
3145 #ifdef SQLITE_ENABLE_IOTRACE
3146 if( c=='i' && strncmp(azArg[0], "iotrace", n)==0 ){
3147 extern void (*sqlite3IoTrace)(const char*, ...);
3148 if( iotrace && iotrace!=stdout ) fclose(iotrace);
3149 iotrace = 0;
3150 if( nArg<2 ){
3151 sqlite3IoTrace = 0;
3152 }else if( strcmp(azArg[1], "-")==0 ){
@@ -3801,13 +3801,13 @@
3801 if( nArg==5 ){
3802 rc = sqlite3_test_control(testctrl, p->db,
3803 azArg[2],
3804 integerValue(azArg[3]),
3805 integerValue(azArg[4]));
 
3806 }else{
3807 fprintf(stderr,"Usage: .testctrl initmode dbName onoff tnum\n");
3808 rc = 1;
3809 }
3810 break;
3811
3812 case SQLITE_TESTCTRL_BITVEC_TEST:
3813 case SQLITE_TESTCTRL_FAULT_INSTALL:
3814
--- src/shell.c
+++ src/shell.c
@@ -368,11 +368,11 @@
368 ** format string and subsequent arguments are values to be substituted
369 ** in place of % fields. The result of formatting this string
370 ** is written to iotrace.
371 */
372 #ifdef SQLITE_ENABLE_IOTRACE
373 static void SQLITE_CDECL iotracePrintf(const char *zFormat, ...){
374 va_list ap;
375 char *z;
376 if( iotrace==0 ) return;
377 va_start(ap, zFormat);
378 z = sqlite3_vmprintf(zFormat, ap);
@@ -3142,11 +3142,11 @@
3142 }
3143 }else
3144
3145 #ifdef SQLITE_ENABLE_IOTRACE
3146 if( c=='i' && strncmp(azArg[0], "iotrace", n)==0 ){
3147 SQLITE_API extern void (SQLITE_CDECL *sqlite3IoTrace)(const char*, ...);
3148 if( iotrace && iotrace!=stdout ) fclose(iotrace);
3149 iotrace = 0;
3150 if( nArg<2 ){
3151 sqlite3IoTrace = 0;
3152 }else if( strcmp(azArg[1], "-")==0 ){
@@ -3801,13 +3801,13 @@
3801 if( nArg==5 ){
3802 rc = sqlite3_test_control(testctrl, p->db,
3803 azArg[2],
3804 integerValue(azArg[3]),
3805 integerValue(azArg[4]));
3806 fprintf(p->out, "%d (0x%08x)\n", rc, rc);
3807 }else{
3808 fprintf(stderr,"Usage: .testctrl imposter dbName onoff tnum\n");
 
3809 }
3810 break;
3811
3812 case SQLITE_TESTCTRL_BITVEC_TEST:
3813 case SQLITE_TESTCTRL_FAULT_INSTALL:
3814
+542 -519
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -20,13 +20,10 @@
2020
#define SQLITE_CORE 1
2121
#define SQLITE_AMALGAMATION 1
2222
#ifndef SQLITE_PRIVATE
2323
# define SQLITE_PRIVATE static
2424
#endif
25
-#ifndef SQLITE_API
26
-# define SQLITE_API
27
-#endif
2825
/************** Begin file sqliteInt.h ***************************************/
2926
/*
3027
** 2001 September 15
3128
**
3229
** The author disclaims copyright to this source code. In place of
@@ -250,27 +247,24 @@
250247
extern "C" {
251248
#endif
252249
253250
254251
/*
255
-** Add the ability to override 'extern'
252
+** Provide the ability to override linkage features of the interface.
256253
*/
257254
#ifndef SQLITE_EXTERN
258255
# define SQLITE_EXTERN extern
259256
#endif
260
-
261257
#ifndef SQLITE_API
262258
# define SQLITE_API
263259
#endif
264
-
265
-
266
-/*
267
-** Add the ability to override 'cdecl'
268
-*/
269260
#ifndef SQLITE_CDECL
270261
# define SQLITE_CDECL
271262
#endif
263
+#ifndef SQLITE_STDCALL
264
+# define SQLITE_STDCALL
265
+#endif
272266
273267
/*
274268
** These no-op macros are used in front of interfaces to mark those
275269
** interfaces as either deprecated or experimental. New applications
276270
** should not use deprecated interfaces - they are supported for backwards
@@ -323,11 +317,11 @@
323317
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
324318
** [sqlite_version()] and [sqlite_source_id()].
325319
*/
326320
#define SQLITE_VERSION "3.8.9"
327321
#define SQLITE_VERSION_NUMBER 3008009
328
-#define SQLITE_SOURCE_ID "2015-03-24 18:19:39 436314b5728c9413f9ac2d837e1c19364f31be72"
322
+#define SQLITE_SOURCE_ID "2015-03-30 23:43:56 395bb3e677a6551b06ba96fc58c393132b93d1e8"
329323
330324
/*
331325
** CAPI3REF: Run-Time Library Version Numbers
332326
** KEYWORDS: sqlite3_version, sqlite3_sourceid
333327
**
@@ -356,13 +350,13 @@
356350
** [SQLITE_SOURCE_ID] C preprocessor macro.
357351
**
358352
** See also: [sqlite_version()] and [sqlite_source_id()].
359353
*/
360354
SQLITE_API const char sqlite3_version[] = SQLITE_VERSION;
361
-SQLITE_API const char *sqlite3_libversion(void);
362
-SQLITE_API const char *sqlite3_sourceid(void);
363
-SQLITE_API int sqlite3_libversion_number(void);
355
+SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void);
356
+SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void);
357
+SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void);
364358
365359
/*
366360
** CAPI3REF: Run-Time Library Compilation Options Diagnostics
367361
**
368362
** ^The sqlite3_compileoption_used() function returns 0 or 1
@@ -383,12 +377,12 @@
383377
**
384378
** See also: SQL functions [sqlite_compileoption_used()] and
385379
** [sqlite_compileoption_get()] and the [compile_options pragma].
386380
*/
387381
#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
388
-SQLITE_API int sqlite3_compileoption_used(const char *zOptName);
389
-SQLITE_API const char *sqlite3_compileoption_get(int N);
382
+SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName);
383
+SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N);
390384
#endif
391385
392386
/*
393387
** CAPI3REF: Test To See If The Library Is Threadsafe
394388
**
@@ -423,11 +417,11 @@
423417
** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
424418
** is unchanged by calls to sqlite3_config().)^
425419
**
426420
** See the [threading mode] documentation for additional information.
427421
*/
428
-SQLITE_API int sqlite3_threadsafe(void);
422
+SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void);
429423
430424
/*
431425
** CAPI3REF: Database Connection Handle
432426
** KEYWORDS: {database connection} {database connections}
433427
**
@@ -519,12 +513,12 @@
519513
** from [sqlite3_open()], [sqlite3_open16()], or
520514
** [sqlite3_open_v2()], and not previously closed.
521515
** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
522516
** argument is a harmless no-op.
523517
*/
524
-SQLITE_API int sqlite3_close(sqlite3*);
525
-SQLITE_API int sqlite3_close_v2(sqlite3*);
518
+SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3*);
519
+SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3*);
526520
527521
/*
528522
** The type for a callback function.
529523
** This is legacy and deprecated. It is included for historical
530524
** compatibility and is not documented.
@@ -590,11 +584,11 @@
590584
** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
591585
** <li> The application must not modify the SQL statement text passed into
592586
** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
593587
** </ul>
594588
*/
595
-SQLITE_API int sqlite3_exec(
589
+SQLITE_API int SQLITE_STDCALL sqlite3_exec(
596590
sqlite3*, /* An open database */
597591
const char *sql, /* SQL to be evaluated */
598592
int (*callback)(void*,int,char**,char**), /* Callback function */
599593
void *, /* 1st argument to callback */
600594
char **errmsg /* Error msg written here */
@@ -1550,14 +1544,14 @@
15501544
** sqlite3_os_init() and sqlite3_os_end(). An application-supplied
15511545
** implementation of sqlite3_os_init() or sqlite3_os_end()
15521546
** must return [SQLITE_OK] on success and some other [error code] upon
15531547
** failure.
15541548
*/
1555
-SQLITE_API int sqlite3_initialize(void);
1556
-SQLITE_API int sqlite3_shutdown(void);
1557
-SQLITE_API int sqlite3_os_init(void);
1558
-SQLITE_API int sqlite3_os_end(void);
1549
+SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void);
1550
+SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void);
1551
+SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void);
1552
+SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void);
15591553
15601554
/*
15611555
** CAPI3REF: Configuring The SQLite Library
15621556
**
15631557
** The sqlite3_config() interface is used to make global configuration
@@ -1584,11 +1578,11 @@
15841578
**
15851579
** ^When a configuration option is set, sqlite3_config() returns [SQLITE_OK].
15861580
** ^If the option is unknown or SQLite is unable to set the option
15871581
** then this routine returns a non-zero [error code].
15881582
*/
1589
-SQLITE_API int sqlite3_config(int, ...);
1583
+SQLITE_API int SQLITE_CDECL sqlite3_config(int, ...);
15901584
15911585
/*
15921586
** CAPI3REF: Configure database connections
15931587
**
15941588
** The sqlite3_db_config() interface is used to make configuration
@@ -1602,11 +1596,11 @@
16021596
** Subsequent arguments vary depending on the configuration verb.
16031597
**
16041598
** ^Calls to sqlite3_db_config() return SQLITE_OK if and only if
16051599
** the call is considered successful.
16061600
*/
1607
-SQLITE_API int sqlite3_db_config(sqlite3*, int op, ...);
1601
+SQLITE_API int SQLITE_CDECL sqlite3_db_config(sqlite3*, int op, ...);
16081602
16091603
/*
16101604
** CAPI3REF: Memory Allocation Routines
16111605
**
16121606
** An instance of this object defines the interface between SQLite
@@ -2090,11 +2084,11 @@
20902084
**
20912085
** ^The sqlite3_extended_result_codes() routine enables or disables the
20922086
** [extended result codes] feature of SQLite. ^The extended result
20932087
** codes are disabled by default for historical compatibility.
20942088
*/
2095
-SQLITE_API int sqlite3_extended_result_codes(sqlite3*, int onoff);
2089
+SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3*, int onoff);
20962090
20972091
/*
20982092
** CAPI3REF: Last Insert Rowid
20992093
**
21002094
** ^Each entry in most SQLite tables (except for [WITHOUT ROWID] tables)
@@ -2141,11 +2135,11 @@
21412135
** function is running and thus changes the last insert [rowid],
21422136
** then the value returned by [sqlite3_last_insert_rowid()] is
21432137
** unpredictable and might not equal either the old or the new
21442138
** last insert [rowid].
21452139
*/
2146
-SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*);
2140
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3*);
21472141
21482142
/*
21492143
** CAPI3REF: Count The Number Of Rows Modified
21502144
**
21512145
** ^This function returns the number of rows modified, inserted or
@@ -2193,11 +2187,11 @@
21932187
**
21942188
** If a separate thread makes changes on the same database connection
21952189
** while [sqlite3_changes()] is running then the value returned
21962190
** is unpredictable and not meaningful.
21972191
*/
2198
-SQLITE_API int sqlite3_changes(sqlite3*);
2192
+SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3*);
21992193
22002194
/*
22012195
** CAPI3REF: Total Number Of Rows Modified
22022196
**
22032197
** ^This function returns the total number of rows inserted, modified or
@@ -2216,11 +2210,11 @@
22162210
**
22172211
** If a separate thread makes changes on the same database connection
22182212
** while [sqlite3_total_changes()] is running then the value
22192213
** returned is unpredictable and not meaningful.
22202214
*/
2221
-SQLITE_API int sqlite3_total_changes(sqlite3*);
2215
+SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3*);
22222216
22232217
/*
22242218
** CAPI3REF: Interrupt A Long-Running Query
22252219
**
22262220
** ^This function causes any pending database operation to abort and
@@ -2255,11 +2249,11 @@
22552249
** that are started after the sqlite3_interrupt() call returns.
22562250
**
22572251
** If the database connection closes while [sqlite3_interrupt()]
22582252
** is running then bad things will likely happen.
22592253
*/
2260
-SQLITE_API void sqlite3_interrupt(sqlite3*);
2254
+SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3*);
22612255
22622256
/*
22632257
** CAPI3REF: Determine If An SQL Statement Is Complete
22642258
**
22652259
** These routines are useful during command-line input to determine if the
@@ -2290,12 +2284,12 @@
22902284
** UTF-8 string.
22912285
**
22922286
** The input to [sqlite3_complete16()] must be a zero-terminated
22932287
** UTF-16 string in native byte order.
22942288
*/
2295
-SQLITE_API int sqlite3_complete(const char *sql);
2296
-SQLITE_API int sqlite3_complete16(const void *sql);
2289
+SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *sql);
2290
+SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *sql);
22972291
22982292
/*
22992293
** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
23002294
** KEYWORDS: {busy-handler callback} {busy handler}
23012295
**
@@ -2351,11 +2345,11 @@
23512345
** result in undefined behavior.
23522346
**
23532347
** A busy handler must not close the database connection
23542348
** or [prepared statement] that invoked the busy handler.
23552349
*/
2356
-SQLITE_API int sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*);
2350
+SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*);
23572351
23582352
/*
23592353
** CAPI3REF: Set A Busy Timeout
23602354
**
23612355
** ^This routine sets a [sqlite3_busy_handler | busy handler] that sleeps
@@ -2373,11 +2367,11 @@
23732367
** was defined (using [sqlite3_busy_handler()]) prior to calling
23742368
** this routine, that other busy handler is cleared.)^
23752369
**
23762370
** See also: [PRAGMA busy_timeout]
23772371
*/
2378
-SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms);
2372
+SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3*, int ms);
23792373
23802374
/*
23812375
** CAPI3REF: Convenience Routines For Running Queries
23822376
**
23832377
** This is a legacy interface that is preserved for backwards compatibility.
@@ -2447,19 +2441,19 @@
24472441
** interface defined here. As a consequence, errors that occur in the
24482442
** wrapper layer outside of the internal [sqlite3_exec()] call are not
24492443
** reflected in subsequent calls to [sqlite3_errcode()] or
24502444
** [sqlite3_errmsg()].
24512445
*/
2452
-SQLITE_API int sqlite3_get_table(
2446
+SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
24532447
sqlite3 *db, /* An open database */
24542448
const char *zSql, /* SQL to be evaluated */
24552449
char ***pazResult, /* Results of the query */
24562450
int *pnRow, /* Number of result rows written here */
24572451
int *pnColumn, /* Number of result columns written here */
24582452
char **pzErrmsg /* Error msg written here */
24592453
);
2460
-SQLITE_API void sqlite3_free_table(char **result);
2454
+SQLITE_API void SQLITE_STDCALL sqlite3_free_table(char **result);
24612455
24622456
/*
24632457
** CAPI3REF: Formatted String Printing Functions
24642458
**
24652459
** These routines are work-alikes of the "printf()" family of functions
@@ -2561,14 +2555,14 @@
25612555
**
25622556
** ^(The "%z" formatting option works like "%s" but with the
25632557
** addition that after the string has been read and copied into
25642558
** the result, [sqlite3_free()] is called on the input string.)^
25652559
*/
2566
-SQLITE_API char *sqlite3_mprintf(const char*,...);
2567
-SQLITE_API char *sqlite3_vmprintf(const char*, va_list);
2568
-SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...);
2569
-SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);
2560
+SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...);
2561
+SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list);
2562
+SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...);
2563
+SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list);
25702564
25712565
/*
25722566
** CAPI3REF: Memory Allocation Subsystem
25732567
**
25742568
** The SQLite core uses these three routines for all of its own
@@ -2654,16 +2648,16 @@
26542648
**
26552649
** The application must not read or write any part of
26562650
** a block of memory after it has been released using
26572651
** [sqlite3_free()] or [sqlite3_realloc()].
26582652
*/
2659
-SQLITE_API void *sqlite3_malloc(int);
2660
-SQLITE_API void *sqlite3_malloc64(sqlite3_uint64);
2661
-SQLITE_API void *sqlite3_realloc(void*, int);
2662
-SQLITE_API void *sqlite3_realloc64(void*, sqlite3_uint64);
2663
-SQLITE_API void sqlite3_free(void*);
2664
-SQLITE_API sqlite3_uint64 sqlite3_msize(void*);
2653
+SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int);
2654
+SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64);
2655
+SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void*, int);
2656
+SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void*, sqlite3_uint64);
2657
+SQLITE_API void SQLITE_STDCALL sqlite3_free(void*);
2658
+SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void*);
26652659
26662660
/*
26672661
** CAPI3REF: Memory Allocator Statistics
26682662
**
26692663
** SQLite provides these two interfaces for reporting on the status
@@ -2684,12 +2678,12 @@
26842678
** [sqlite3_memory_used()] if and only if the parameter to
26852679
** [sqlite3_memory_highwater()] is true. ^The value returned
26862680
** by [sqlite3_memory_highwater(1)] is the high-water mark
26872681
** prior to the reset.
26882682
*/
2689
-SQLITE_API sqlite3_int64 sqlite3_memory_used(void);
2690
-SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int resetFlag);
2683
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void);
2684
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag);
26912685
26922686
/*
26932687
** CAPI3REF: Pseudo-Random Number Generator
26942688
**
26952689
** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
@@ -2708,11 +2702,11 @@
27082702
** ^If the previous call to this routine had an N of 1 or more and a
27092703
** non-NULL P then the pseudo-randomness is generated
27102704
** internally and without recourse to the [sqlite3_vfs] xRandomness
27112705
** method.
27122706
*/
2713
-SQLITE_API void sqlite3_randomness(int N, void *P);
2707
+SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *P);
27142708
27152709
/*
27162710
** CAPI3REF: Compile-Time Authorization Callbacks
27172711
**
27182712
** ^This routine registers an authorizer callback with a particular
@@ -2790,11 +2784,11 @@
27902784
** [sqlite3_prepare()] or its variants. Authorization is not
27912785
** performed during statement evaluation in [sqlite3_step()], unless
27922786
** as stated in the previous paragraph, sqlite3_step() invokes
27932787
** sqlite3_prepare_v2() to reprepare a statement after a schema change.
27942788
*/
2795
-SQLITE_API int sqlite3_set_authorizer(
2789
+SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
27962790
sqlite3*,
27972791
int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
27982792
void *pUserData
27992793
);
28002794
@@ -2894,12 +2888,12 @@
28942888
** digits in the time are meaningless. Future versions of SQLite
28952889
** might provide greater resolution on the profiler callback. The
28962890
** sqlite3_profile() function is considered experimental and is
28972891
** subject to change in future versions of SQLite.
28982892
*/
2899
-SQLITE_API void *sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*);
2900
-SQLITE_API SQLITE_EXPERIMENTAL void *sqlite3_profile(sqlite3*,
2893
+SQLITE_API void *SQLITE_STDCALL sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*);
2894
+SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_STDCALL sqlite3_profile(sqlite3*,
29012895
void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
29022896
29032897
/*
29042898
** CAPI3REF: Query Progress Callbacks
29052899
**
@@ -2929,11 +2923,11 @@
29292923
** the database connection that invoked the progress handler.
29302924
** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
29312925
** database connections for the meaning of "modify" in this paragraph.
29322926
**
29332927
*/
2934
-SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
2928
+SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
29352929
29362930
/*
29372931
** CAPI3REF: Opening A New Database Connection
29382932
**
29392933
** ^These routines open an SQLite database file as specified by the
@@ -3157,19 +3151,19 @@
31573151
** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various
31583152
** features that require the use of temporary files may fail.
31593153
**
31603154
** See also: [sqlite3_temp_directory]
31613155
*/
3162
-SQLITE_API int sqlite3_open(
3156
+SQLITE_API int SQLITE_STDCALL sqlite3_open(
31633157
const char *filename, /* Database filename (UTF-8) */
31643158
sqlite3 **ppDb /* OUT: SQLite db handle */
31653159
);
3166
-SQLITE_API int sqlite3_open16(
3160
+SQLITE_API int SQLITE_STDCALL sqlite3_open16(
31673161
const void *filename, /* Database filename (UTF-16) */
31683162
sqlite3 **ppDb /* OUT: SQLite db handle */
31693163
);
3170
-SQLITE_API int sqlite3_open_v2(
3164
+SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
31713165
const char *filename, /* Database filename (UTF-8) */
31723166
sqlite3 **ppDb, /* OUT: SQLite db handle */
31733167
int flags, /* Flags */
31743168
const char *zVfs /* Name of VFS module to use */
31753169
);
@@ -3211,13 +3205,13 @@
32113205
** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and
32123206
** is not a database file pathname pointer that SQLite passed into the xOpen
32133207
** VFS method, then the behavior of this routine is undefined and probably
32143208
** undesirable.
32153209
*/
3216
-SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3217
-SQLITE_API int sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3218
-SQLITE_API sqlite3_int64 sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
3210
+SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3211
+SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3212
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
32193213
32203214
32213215
/*
32223216
** CAPI3REF: Error Codes And Messages
32233217
**
@@ -3256,15 +3250,15 @@
32563250
**
32573251
** If an interface fails with SQLITE_MISUSE, that means the interface
32583252
** was invoked incorrectly by the application. In that case, the
32593253
** error code and message may or may not be set.
32603254
*/
3261
-SQLITE_API int sqlite3_errcode(sqlite3 *db);
3262
-SQLITE_API int sqlite3_extended_errcode(sqlite3 *db);
3263
-SQLITE_API const char *sqlite3_errmsg(sqlite3*);
3264
-SQLITE_API const void *sqlite3_errmsg16(sqlite3*);
3265
-SQLITE_API const char *sqlite3_errstr(int);
3255
+SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db);
3256
+SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db);
3257
+SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*);
3258
+SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*);
3259
+SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int);
32663260
32673261
/*
32683262
** CAPI3REF: SQL Statement Object
32693263
** KEYWORDS: {prepared statement} {prepared statements}
32703264
**
@@ -3327,11 +3321,11 @@
33273321
** created by an untrusted script can be contained using the
33283322
** [max_page_count] [PRAGMA].
33293323
**
33303324
** New run-time limit categories may be added in future releases.
33313325
*/
3332
-SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal);
3326
+SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3*, int id, int newVal);
33333327
33343328
/*
33353329
** CAPI3REF: Run-Time Limit Categories
33363330
** KEYWORDS: {limit category} {*limit categories}
33373331
**
@@ -3477,32 +3471,32 @@
34773471
** or [GLOB] operator or if the parameter is compared to an indexed column
34783472
** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
34793473
** </li>
34803474
** </ol>
34813475
*/
3482
-SQLITE_API int sqlite3_prepare(
3476
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
34833477
sqlite3 *db, /* Database handle */
34843478
const char *zSql, /* SQL statement, UTF-8 encoded */
34853479
int nByte, /* Maximum length of zSql in bytes. */
34863480
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
34873481
const char **pzTail /* OUT: Pointer to unused portion of zSql */
34883482
);
3489
-SQLITE_API int sqlite3_prepare_v2(
3483
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
34903484
sqlite3 *db, /* Database handle */
34913485
const char *zSql, /* SQL statement, UTF-8 encoded */
34923486
int nByte, /* Maximum length of zSql in bytes. */
34933487
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
34943488
const char **pzTail /* OUT: Pointer to unused portion of zSql */
34953489
);
3496
-SQLITE_API int sqlite3_prepare16(
3490
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
34973491
sqlite3 *db, /* Database handle */
34983492
const void *zSql, /* SQL statement, UTF-16 encoded */
34993493
int nByte, /* Maximum length of zSql in bytes. */
35003494
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
35013495
const void **pzTail /* OUT: Pointer to unused portion of zSql */
35023496
);
3503
-SQLITE_API int sqlite3_prepare16_v2(
3497
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
35043498
sqlite3 *db, /* Database handle */
35053499
const void *zSql, /* SQL statement, UTF-16 encoded */
35063500
int nByte, /* Maximum length of zSql in bytes. */
35073501
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
35083502
const void **pzTail /* OUT: Pointer to unused portion of zSql */
@@ -3513,11 +3507,11 @@
35133507
**
35143508
** ^This interface can be used to retrieve a saved copy of the original
35153509
** SQL text used to create a [prepared statement] if that statement was
35163510
** compiled using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()].
35173511
*/
3518
-SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt);
3512
+SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt);
35193513
35203514
/*
35213515
** CAPI3REF: Determine If An SQL Statement Writes The Database
35223516
**
35233517
** ^The sqlite3_stmt_readonly(X) interface returns true (non-zero) if
@@ -3544,11 +3538,11 @@
35443538
** database. ^The [ATTACH] and [DETACH] statements also cause
35453539
** sqlite3_stmt_readonly() to return true since, while those statements
35463540
** change the configuration of a database connection, they do not make
35473541
** changes to the content of the database files on disk.
35483542
*/
3549
-SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
3543
+SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
35503544
35513545
/*
35523546
** CAPI3REF: Determine If A Prepared Statement Has Been Reset
35533547
**
35543548
** ^The sqlite3_stmt_busy(S) interface returns true (non-zero) if the
@@ -3563,11 +3557,11 @@
35633557
** to locate all prepared statements associated with a database
35643558
** connection that are in need of being reset. This can be used,
35653559
** for example, in diagnostic routines to search for prepared
35663560
** statements that are holding a transaction open.
35673561
*/
3568
-SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt*);
3562
+SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt*);
35693563
35703564
/*
35713565
** CAPI3REF: Dynamically Typed Value Object
35723566
** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
35733567
**
@@ -3724,23 +3718,23 @@
37243718
** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails.
37253719
**
37263720
** See also: [sqlite3_bind_parameter_count()],
37273721
** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].
37283722
*/
3729
-SQLITE_API int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
3730
-SQLITE_API int sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
3723
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
3724
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
37313725
void(*)(void*));
3732
-SQLITE_API int sqlite3_bind_double(sqlite3_stmt*, int, double);
3733
-SQLITE_API int sqlite3_bind_int(sqlite3_stmt*, int, int);
3734
-SQLITE_API int sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
3735
-SQLITE_API int sqlite3_bind_null(sqlite3_stmt*, int);
3736
-SQLITE_API int sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
3737
-SQLITE_API int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
3738
-SQLITE_API int sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
3726
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt*, int, double);
3727
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt*, int, int);
3728
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
3729
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt*, int);
3730
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
3731
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
3732
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
37393733
void(*)(void*), unsigned char encoding);
3740
-SQLITE_API int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
3741
-SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
3734
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
3735
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
37423736
37433737
/*
37443738
** CAPI3REF: Number Of SQL Parameters
37453739
**
37463740
** ^This routine can be used to find the number of [SQL parameters]
@@ -3756,11 +3750,11 @@
37563750
**
37573751
** See also: [sqlite3_bind_blob|sqlite3_bind()],
37583752
** [sqlite3_bind_parameter_name()], and
37593753
** [sqlite3_bind_parameter_index()].
37603754
*/
3761
-SQLITE_API int sqlite3_bind_parameter_count(sqlite3_stmt*);
3755
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt*);
37623756
37633757
/*
37643758
** CAPI3REF: Name Of A Host Parameter
37653759
**
37663760
** ^The sqlite3_bind_parameter_name(P,N) interface returns
@@ -3783,11 +3777,11 @@
37833777
**
37843778
** See also: [sqlite3_bind_blob|sqlite3_bind()],
37853779
** [sqlite3_bind_parameter_count()], and
37863780
** [sqlite3_bind_parameter_index()].
37873781
*/
3788
-SQLITE_API const char *sqlite3_bind_parameter_name(sqlite3_stmt*, int);
3782
+SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
37893783
37903784
/*
37913785
** CAPI3REF: Index Of A Parameter With A Given Name
37923786
**
37933787
** ^Return the index of an SQL parameter given its name. ^The
@@ -3799,20 +3793,20 @@
37993793
**
38003794
** See also: [sqlite3_bind_blob|sqlite3_bind()],
38013795
** [sqlite3_bind_parameter_count()], and
38023796
** [sqlite3_bind_parameter_index()].
38033797
*/
3804
-SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
3798
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
38053799
38063800
/*
38073801
** CAPI3REF: Reset All Bindings On A Prepared Statement
38083802
**
38093803
** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset
38103804
** the [sqlite3_bind_blob | bindings] on a [prepared statement].
38113805
** ^Use this routine to reset all host parameters to NULL.
38123806
*/
3813
-SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt*);
3807
+SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt*);
38143808
38153809
/*
38163810
** CAPI3REF: Number Of Columns In A Result Set
38173811
**
38183812
** ^Return the number of columns in the result set returned by the
@@ -3819,11 +3813,11 @@
38193813
** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
38203814
** statement that does not return data (for example an [UPDATE]).
38213815
**
38223816
** See also: [sqlite3_data_count()]
38233817
*/
3824
-SQLITE_API int sqlite3_column_count(sqlite3_stmt *pStmt);
3818
+SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt);
38253819
38263820
/*
38273821
** CAPI3REF: Column Names In A Result Set
38283822
**
38293823
** ^These routines return the name assigned to a particular column
@@ -3847,12 +3841,12 @@
38473841
** ^The name of a result column is the value of the "AS" clause for
38483842
** that column, if there is an AS clause. If there is no AS clause
38493843
** then the name of the column is unspecified and may change from
38503844
** one release of SQLite to the next.
38513845
*/
3852
-SQLITE_API const char *sqlite3_column_name(sqlite3_stmt*, int N);
3853
-SQLITE_API const void *sqlite3_column_name16(sqlite3_stmt*, int N);
3846
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt*, int N);
3847
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt*, int N);
38543848
38553849
/*
38563850
** CAPI3REF: Source Of Data In A Query Result
38573851
**
38583852
** ^These routines provide a means to determine the database, table, and
@@ -3895,16 +3889,16 @@
38953889
** If two or more threads call one or more
38963890
** [sqlite3_column_database_name | column metadata interfaces]
38973891
** for the same [prepared statement] and result column
38983892
** at the same time then the results are undefined.
38993893
*/
3900
-SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int);
3901
-SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int);
3902
-SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int);
3903
-SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int);
3904
-SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int);
3905
-SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);
3894
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int);
3895
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int);
3896
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int);
3897
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int);
3898
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int);
3899
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
39063900
39073901
/*
39083902
** CAPI3REF: Declared Datatype Of A Query Result
39093903
**
39103904
** ^(The first parameter is a [prepared statement].
@@ -3931,12 +3925,12 @@
39313925
** data stored in that column is of the declared type. SQLite is
39323926
** strongly typed, but the typing is dynamic not static. ^Type
39333927
** is associated with individual values, not with the containers
39343928
** used to hold those values.
39353929
*/
3936
-SQLITE_API const char *sqlite3_column_decltype(sqlite3_stmt*,int);
3937
-SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int);
3930
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt*,int);
3931
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt*,int);
39383932
39393933
/*
39403934
** CAPI3REF: Evaluate An SQL Statement
39413935
**
39423936
** After a [prepared statement] has been prepared using either
@@ -4011,11 +4005,11 @@
40114005
** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
40124006
** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,
40134007
** then the more specific [error codes] are returned directly
40144008
** by sqlite3_step(). The use of the "v2" interface is recommended.
40154009
*/
4016
-SQLITE_API int sqlite3_step(sqlite3_stmt*);
4010
+SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt*);
40174011
40184012
/*
40194013
** CAPI3REF: Number of columns in a result set
40204014
**
40214015
** ^The sqlite3_data_count(P) interface returns the number of columns in the
@@ -4031,11 +4025,11 @@
40314025
** where it always returns zero since each step of that multi-step
40324026
** pragma returns 0 columns of data.
40334027
**
40344028
** See also: [sqlite3_column_count()]
40354029
*/
4036
-SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt);
4030
+SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt);
40374031
40384032
/*
40394033
** CAPI3REF: Fundamental Datatypes
40404034
** KEYWORDS: SQLITE_TEXT
40414035
**
@@ -4227,20 +4221,20 @@
42274221
** of these routines, a default value is returned. The default value
42284222
** is either the integer 0, the floating point number 0.0, or a NULL
42294223
** pointer. Subsequent calls to [sqlite3_errcode()] will return
42304224
** [SQLITE_NOMEM].)^
42314225
*/
4232
-SQLITE_API const void *sqlite3_column_blob(sqlite3_stmt*, int iCol);
4233
-SQLITE_API int sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4234
-SQLITE_API int sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4235
-SQLITE_API double sqlite3_column_double(sqlite3_stmt*, int iCol);
4236
-SQLITE_API int sqlite3_column_int(sqlite3_stmt*, int iCol);
4237
-SQLITE_API sqlite3_int64 sqlite3_column_int64(sqlite3_stmt*, int iCol);
4238
-SQLITE_API const unsigned char *sqlite3_column_text(sqlite3_stmt*, int iCol);
4239
-SQLITE_API const void *sqlite3_column_text16(sqlite3_stmt*, int iCol);
4240
-SQLITE_API int sqlite3_column_type(sqlite3_stmt*, int iCol);
4241
-SQLITE_API sqlite3_value *sqlite3_column_value(sqlite3_stmt*, int iCol);
4226
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt*, int iCol);
4227
+SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4228
+SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4229
+SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt*, int iCol);
4230
+SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt*, int iCol);
4231
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt*, int iCol);
4232
+SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt*, int iCol);
4233
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt*, int iCol);
4234
+SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt*, int iCol);
4235
+SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt*, int iCol);
42424236
42434237
/*
42444238
** CAPI3REF: Destroy A Prepared Statement Object
42454239
**
42464240
** ^The sqlite3_finalize() function is called to delete a [prepared statement].
@@ -4263,11 +4257,11 @@
42634257
** resource leaks. It is a grievous error for the application to try to use
42644258
** a prepared statement after it has been finalized. Any use of a prepared
42654259
** statement after it has been finalized can result in undefined and
42664260
** undesirable behavior such as segfaults and heap corruption.
42674261
*/
4268
-SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt);
4262
+SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt);
42694263
42704264
/*
42714265
** CAPI3REF: Reset A Prepared Statement Object
42724266
**
42734267
** The sqlite3_reset() function is called to reset a [prepared statement]
@@ -4289,11 +4283,11 @@
42894283
** [sqlite3_reset(S)] returns an appropriate [error code].
42904284
**
42914285
** ^The [sqlite3_reset(S)] interface does not change the values
42924286
** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
42934287
*/
4294
-SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt);
4288
+SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt);
42954289
42964290
/*
42974291
** CAPI3REF: Create Or Redefine SQL Functions
42984292
** KEYWORDS: {function creation routines}
42994293
** KEYWORDS: {application-defined SQL function}
@@ -4388,31 +4382,31 @@
43884382
** ^An application-defined function is permitted to call other
43894383
** SQLite interfaces. However, such calls must not
43904384
** close the database connection nor finalize or reset the prepared
43914385
** statement in which the function is running.
43924386
*/
4393
-SQLITE_API int sqlite3_create_function(
4387
+SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
43944388
sqlite3 *db,
43954389
const char *zFunctionName,
43964390
int nArg,
43974391
int eTextRep,
43984392
void *pApp,
43994393
void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
44004394
void (*xStep)(sqlite3_context*,int,sqlite3_value**),
44014395
void (*xFinal)(sqlite3_context*)
44024396
);
4403
-SQLITE_API int sqlite3_create_function16(
4397
+SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
44044398
sqlite3 *db,
44054399
const void *zFunctionName,
44064400
int nArg,
44074401
int eTextRep,
44084402
void *pApp,
44094403
void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
44104404
void (*xStep)(sqlite3_context*,int,sqlite3_value**),
44114405
void (*xFinal)(sqlite3_context*)
44124406
);
4413
-SQLITE_API int sqlite3_create_function_v2(
4407
+SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
44144408
sqlite3 *db,
44154409
const char *zFunctionName,
44164410
int nArg,
44174411
int eTextRep,
44184412
void *pApp,
@@ -4454,16 +4448,16 @@
44544448
** to be supported. However, new applications should avoid
44554449
** the use of these functions. To encourage programmers to avoid
44564450
** these functions, we will not explain what they do.
44574451
*/
44584452
#ifndef SQLITE_OMIT_DEPRECATED
4459
-SQLITE_API SQLITE_DEPRECATED int sqlite3_aggregate_count(sqlite3_context*);
4460
-SQLITE_API SQLITE_DEPRECATED int sqlite3_expired(sqlite3_stmt*);
4461
-SQLITE_API SQLITE_DEPRECATED int sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4462
-SQLITE_API SQLITE_DEPRECATED int sqlite3_global_recover(void);
4463
-SQLITE_API SQLITE_DEPRECATED void sqlite3_thread_cleanup(void);
4464
-SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
4453
+SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context*);
4454
+SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt*);
4455
+SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4456
+SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_global_recover(void);
4457
+SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_thread_cleanup(void);
4458
+SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
44654459
void*,sqlite3_int64);
44664460
#endif
44674461
44684462
/*
44694463
** CAPI3REF: Obtaining SQL Function Parameter Values
@@ -4508,22 +4502,22 @@
45084502
** or [sqlite3_value_text16()].
45094503
**
45104504
** These routines must be called from the same thread as
45114505
** the SQL function that supplied the [sqlite3_value*] parameters.
45124506
*/
4513
-SQLITE_API const void *sqlite3_value_blob(sqlite3_value*);
4514
-SQLITE_API int sqlite3_value_bytes(sqlite3_value*);
4515
-SQLITE_API int sqlite3_value_bytes16(sqlite3_value*);
4516
-SQLITE_API double sqlite3_value_double(sqlite3_value*);
4517
-SQLITE_API int sqlite3_value_int(sqlite3_value*);
4518
-SQLITE_API sqlite3_int64 sqlite3_value_int64(sqlite3_value*);
4519
-SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value*);
4520
-SQLITE_API const void *sqlite3_value_text16(sqlite3_value*);
4521
-SQLITE_API const void *sqlite3_value_text16le(sqlite3_value*);
4522
-SQLITE_API const void *sqlite3_value_text16be(sqlite3_value*);
4523
-SQLITE_API int sqlite3_value_type(sqlite3_value*);
4524
-SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*);
4507
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value*);
4508
+SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value*);
4509
+SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value*);
4510
+SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value*);
4511
+SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value*);
4512
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value*);
4513
+SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value*);
4514
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value*);
4515
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value*);
4516
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*);
4517
+SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*);
4518
+SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*);
45254519
45264520
/*
45274521
** CAPI3REF: Obtain Aggregate Function Context
45284522
**
45294523
** Implementations of aggregate SQL functions use this
@@ -4563,11 +4557,11 @@
45634557
** function.
45644558
**
45654559
** This routine must be called from the same thread in which
45664560
** the aggregate SQL function is running.
45674561
*/
4568
-SQLITE_API void *sqlite3_aggregate_context(sqlite3_context*, int nBytes);
4562
+SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
45694563
45704564
/*
45714565
** CAPI3REF: User Data For Functions
45724566
**
45734567
** ^The sqlite3_user_data() interface returns a copy of
@@ -4577,11 +4571,11 @@
45774571
** registered the application defined function.
45784572
**
45794573
** This routine must be called from the same thread in which
45804574
** the application-defined function is running.
45814575
*/
4582
-SQLITE_API void *sqlite3_user_data(sqlite3_context*);
4576
+SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context*);
45834577
45844578
/*
45854579
** CAPI3REF: Database Connection For Functions
45864580
**
45874581
** ^The sqlite3_context_db_handle() interface returns a copy of
@@ -4588,11 +4582,11 @@
45884582
** the pointer to the [database connection] (the 1st parameter)
45894583
** of the [sqlite3_create_function()]
45904584
** and [sqlite3_create_function16()] routines that originally
45914585
** registered the application defined function.
45924586
*/
4593
-SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*);
4587
+SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context*);
45944588
45954589
/*
45964590
** CAPI3REF: Function Auxiliary Data
45974591
**
45984592
** These functions may be used by (non-aggregate) SQL functions to
@@ -4640,12 +4634,12 @@
46404634
** values and [parameters] and expressions composed from the same.)^
46414635
**
46424636
** These routines must be called from the same thread in which
46434637
** the SQL function is running.
46444638
*/
4645
-SQLITE_API void *sqlite3_get_auxdata(sqlite3_context*, int N);
4646
-SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
4639
+SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context*, int N);
4640
+SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
46474641
46484642
46494643
/*
46504644
** CAPI3REF: Constants Defining Special Destructor Behavior
46514645
**
@@ -4776,30 +4770,30 @@
47764770
**
47774771
** If these routines are called from within the different thread
47784772
** than the one containing the application-defined function that received
47794773
** the [sqlite3_context] pointer, the results are undefined.
47804774
*/
4781
-SQLITE_API void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
4782
-SQLITE_API void sqlite3_result_blob64(sqlite3_context*,const void*,
4775
+SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
4776
+SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(sqlite3_context*,const void*,
47834777
sqlite3_uint64,void(*)(void*));
4784
-SQLITE_API void sqlite3_result_double(sqlite3_context*, double);
4785
-SQLITE_API void sqlite3_result_error(sqlite3_context*, const char*, int);
4786
-SQLITE_API void sqlite3_result_error16(sqlite3_context*, const void*, int);
4787
-SQLITE_API void sqlite3_result_error_toobig(sqlite3_context*);
4788
-SQLITE_API void sqlite3_result_error_nomem(sqlite3_context*);
4789
-SQLITE_API void sqlite3_result_error_code(sqlite3_context*, int);
4790
-SQLITE_API void sqlite3_result_int(sqlite3_context*, int);
4791
-SQLITE_API void sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
4792
-SQLITE_API void sqlite3_result_null(sqlite3_context*);
4793
-SQLITE_API void sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
4794
-SQLITE_API void sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
4778
+SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context*, double);
4779
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context*, const char*, int);
4780
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context*, const void*, int);
4781
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context*);
4782
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context*);
4783
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context*, int);
4784
+SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context*, int);
4785
+SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
4786
+SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context*);
4787
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
4788
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
47954789
void(*)(void*), unsigned char encoding);
4796
-SQLITE_API void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
4797
-SQLITE_API void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
4798
-SQLITE_API void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
4799
-SQLITE_API void sqlite3_result_value(sqlite3_context*, sqlite3_value*);
4800
-SQLITE_API void sqlite3_result_zeroblob(sqlite3_context*, int n);
4790
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
4791
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
4792
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
4793
+SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
4794
+SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n);
48014795
48024796
/*
48034797
** CAPI3REF: Define New Collating Sequences
48044798
**
48054799
** ^These functions add, remove, or modify a [collation] associated
@@ -4876,26 +4870,26 @@
48764870
** is unfortunate but cannot be changed without breaking backwards
48774871
** compatibility.
48784872
**
48794873
** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].
48804874
*/
4881
-SQLITE_API int sqlite3_create_collation(
4875
+SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
48824876
sqlite3*,
48834877
const char *zName,
48844878
int eTextRep,
48854879
void *pArg,
48864880
int(*xCompare)(void*,int,const void*,int,const void*)
48874881
);
4888
-SQLITE_API int sqlite3_create_collation_v2(
4882
+SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
48894883
sqlite3*,
48904884
const char *zName,
48914885
int eTextRep,
48924886
void *pArg,
48934887
int(*xCompare)(void*,int,const void*,int,const void*),
48944888
void(*xDestroy)(void*)
48954889
);
4896
-SQLITE_API int sqlite3_create_collation16(
4890
+SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
48974891
sqlite3*,
48984892
const void *zName,
48994893
int eTextRep,
49004894
void *pArg,
49014895
int(*xCompare)(void*,int,const void*,int,const void*)
@@ -4925,16 +4919,16 @@
49254919
**
49264920
** The callback function should register the desired collation using
49274921
** [sqlite3_create_collation()], [sqlite3_create_collation16()], or
49284922
** [sqlite3_create_collation_v2()].
49294923
*/
4930
-SQLITE_API int sqlite3_collation_needed(
4924
+SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
49314925
sqlite3*,
49324926
void*,
49334927
void(*)(void*,sqlite3*,int eTextRep,const char*)
49344928
);
4935
-SQLITE_API int sqlite3_collation_needed16(
4929
+SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
49364930
sqlite3*,
49374931
void*,
49384932
void(*)(void*,sqlite3*,int eTextRep,const void*)
49394933
);
49404934
@@ -4944,15 +4938,15 @@
49444938
** called right after sqlite3_open().
49454939
**
49464940
** The code to implement this API is not available in the public release
49474941
** of SQLite.
49484942
*/
4949
-SQLITE_API int sqlite3_key(
4943
+SQLITE_API int SQLITE_STDCALL sqlite3_key(
49504944
sqlite3 *db, /* Database to be rekeyed */
49514945
const void *pKey, int nKey /* The key */
49524946
);
4953
-SQLITE_API int sqlite3_key_v2(
4947
+SQLITE_API int SQLITE_STDCALL sqlite3_key_v2(
49544948
sqlite3 *db, /* Database to be rekeyed */
49554949
const char *zDbName, /* Name of the database */
49564950
const void *pKey, int nKey /* The key */
49574951
);
49584952
@@ -4962,35 +4956,35 @@
49624956
** database is decrypted.
49634957
**
49644958
** The code to implement this API is not available in the public release
49654959
** of SQLite.
49664960
*/
4967
-SQLITE_API int sqlite3_rekey(
4961
+SQLITE_API int SQLITE_STDCALL sqlite3_rekey(
49684962
sqlite3 *db, /* Database to be rekeyed */
49694963
const void *pKey, int nKey /* The new key */
49704964
);
4971
-SQLITE_API int sqlite3_rekey_v2(
4965
+SQLITE_API int SQLITE_STDCALL sqlite3_rekey_v2(
49724966
sqlite3 *db, /* Database to be rekeyed */
49734967
const char *zDbName, /* Name of the database */
49744968
const void *pKey, int nKey /* The new key */
49754969
);
49764970
49774971
/*
49784972
** Specify the activation key for a SEE database. Unless
49794973
** activated, none of the SEE routines will work.
49804974
*/
4981
-SQLITE_API void sqlite3_activate_see(
4975
+SQLITE_API void SQLITE_STDCALL sqlite3_activate_see(
49824976
const char *zPassPhrase /* Activation phrase */
49834977
);
49844978
#endif
49854979
49864980
#ifdef SQLITE_ENABLE_CEROD
49874981
/*
49884982
** Specify the activation key for a CEROD database. Unless
49894983
** activated, none of the CEROD routines will work.
49904984
*/
4991
-SQLITE_API void sqlite3_activate_cerod(
4985
+SQLITE_API void SQLITE_STDCALL sqlite3_activate_cerod(
49924986
const char *zPassPhrase /* Activation phrase */
49934987
);
49944988
#endif
49954989
49964990
/*
@@ -5008,11 +5002,11 @@
50085002
** method of the default [sqlite3_vfs] object. If the xSleep() method
50095003
** of the default VFS is not implemented correctly, or not implemented at
50105004
** all, then the behavior of sqlite3_sleep() may deviate from the description
50115005
** in the previous paragraphs.
50125006
*/
5013
-SQLITE_API int sqlite3_sleep(int);
5007
+SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int);
50145008
50155009
/*
50165010
** CAPI3REF: Name Of The Folder Holding Temporary Files
50175011
**
50185012
** ^(If this global variable is made to point to a string which is
@@ -5126,11 +5120,11 @@
51265120
**
51275121
** If another thread changes the autocommit status of the database
51285122
** connection while this routine is running, then the return value
51295123
** is undefined.
51305124
*/
5131
-SQLITE_API int sqlite3_get_autocommit(sqlite3*);
5125
+SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3*);
51325126
51335127
/*
51345128
** CAPI3REF: Find The Database Handle Of A Prepared Statement
51355129
**
51365130
** ^The sqlite3_db_handle interface returns the [database connection] handle
@@ -5138,11 +5132,11 @@
51385132
** returned by sqlite3_db_handle is the same [database connection]
51395133
** that was the first argument
51405134
** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
51415135
** create the statement in the first place.
51425136
*/
5143
-SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*);
5137
+SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt*);
51445138
51455139
/*
51465140
** CAPI3REF: Return The Filename For A Database Connection
51475141
**
51485142
** ^The sqlite3_db_filename(D,N) interface returns a pointer to a filename
@@ -5154,20 +5148,20 @@
51545148
** ^The filename returned by this function is the output of the
51555149
** xFullPathname method of the [VFS]. ^In other words, the filename
51565150
** will be an absolute pathname, even if the filename used
51575151
** to open the database originally was a URI or relative pathname.
51585152
*/
5159
-SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName);
5153
+SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
51605154
51615155
/*
51625156
** CAPI3REF: Determine if a database is read-only
51635157
**
51645158
** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N
51655159
** of connection D is read-only, 0 if it is read/write, or -1 if N is not
51665160
** the name of a database on connection D.
51675161
*/
5168
-SQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
5162
+SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
51695163
51705164
/*
51715165
** CAPI3REF: Find the next prepared statement
51725166
**
51735167
** ^This interface returns a pointer to the next [prepared statement] after
@@ -5178,11 +5172,11 @@
51785172
**
51795173
** The [database connection] pointer D in a call to
51805174
** [sqlite3_next_stmt(D,S)] must refer to an open database
51815175
** connection and in particular must not be a NULL pointer.
51825176
*/
5183
-SQLITE_API sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
5177
+SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
51845178
51855179
/*
51865180
** CAPI3REF: Commit And Rollback Notification Callbacks
51875181
**
51885182
** ^The sqlite3_commit_hook() interface registers a callback
@@ -5226,12 +5220,12 @@
52265220
** ^The rollback callback is not invoked if a transaction is
52275221
** automatically rolled back because the database connection is closed.
52285222
**
52295223
** See also the [sqlite3_update_hook()] interface.
52305224
*/
5231
-SQLITE_API void *sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
5232
-SQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
5225
+SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
5226
+SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
52335227
52345228
/*
52355229
** CAPI3REF: Data Change Notification Callbacks
52365230
**
52375231
** ^The sqlite3_update_hook() interface registers a callback function
@@ -5277,11 +5271,11 @@
52775271
** the first call on D.
52785272
**
52795273
** See also the [sqlite3_commit_hook()] and [sqlite3_rollback_hook()]
52805274
** interfaces.
52815275
*/
5282
-SQLITE_API void *sqlite3_update_hook(
5276
+SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
52835277
sqlite3*,
52845278
void(*)(void *,int ,char const *,char const *,sqlite3_int64),
52855279
void*
52865280
);
52875281
@@ -5317,11 +5311,11 @@
53175311
** This interface is threadsafe on processors where writing a
53185312
** 32-bit integer is atomic.
53195313
**
53205314
** See Also: [SQLite Shared-Cache Mode]
53215315
*/
5322
-SQLITE_API int sqlite3_enable_shared_cache(int);
5316
+SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int);
53235317
53245318
/*
53255319
** CAPI3REF: Attempt To Free Heap Memory
53265320
**
53275321
** ^The sqlite3_release_memory() interface attempts to free N bytes
@@ -5333,11 +5327,11 @@
53335327
** ^The sqlite3_release_memory() routine is a no-op returning zero
53345328
** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].
53355329
**
53365330
** See also: [sqlite3_db_release_memory()]
53375331
*/
5338
-SQLITE_API int sqlite3_release_memory(int);
5332
+SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int);
53395333
53405334
/*
53415335
** CAPI3REF: Free Memory Used By A Database Connection
53425336
**
53435337
** ^The sqlite3_db_release_memory(D) interface attempts to free as much heap
@@ -5346,11 +5340,11 @@
53465340
** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
53475341
** omitted.
53485342
**
53495343
** See also: [sqlite3_release_memory()]
53505344
*/
5351
-SQLITE_API int sqlite3_db_release_memory(sqlite3*);
5345
+SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3*);
53525346
53535347
/*
53545348
** CAPI3REF: Impose A Limit On Heap Size
53555349
**
53565350
** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the
@@ -5398,11 +5392,11 @@
53985392
** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT].
53995393
**
54005394
** The circumstances under which SQLite will enforce the soft heap limit may
54015395
** changes in future releases of SQLite.
54025396
*/
5403
-SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 N);
5397
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
54045398
54055399
/*
54065400
** CAPI3REF: Deprecated Soft Heap Limit Interface
54075401
** DEPRECATED
54085402
**
@@ -5409,11 +5403,11 @@
54095403
** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
54105404
** interface. This routine is provided for historical compatibility
54115405
** only. All new applications should use the
54125406
** [sqlite3_soft_heap_limit64()] interface rather than this one.
54135407
*/
5414
-SQLITE_API SQLITE_DEPRECATED void sqlite3_soft_heap_limit(int N);
5408
+SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_soft_heap_limit(int N);
54155409
54165410
54175411
/*
54185412
** CAPI3REF: Extract Metadata About A Column Of A Table
54195413
**
@@ -5478,11 +5472,11 @@
54785472
**
54795473
** ^This function causes all database schemas to be read from disk and
54805474
** parsed, if that has not already been done, and returns an error if
54815475
** any errors are encountered while loading the schema.
54825476
*/
5483
-SQLITE_API int sqlite3_table_column_metadata(
5477
+SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
54845478
sqlite3 *db, /* Connection handle */
54855479
const char *zDbName, /* Database name or NULL */
54865480
const char *zTableName, /* Table name */
54875481
const char *zColumnName, /* Column name */
54885482
char const **pzDataType, /* OUTPUT: Declared data type */
@@ -5524,11 +5518,11 @@
55245518
** [sqlite3_enable_load_extension()] prior to calling this API,
55255519
** otherwise an error will be returned.
55265520
**
55275521
** See also the [load_extension() SQL function].
55285522
*/
5529
-SQLITE_API int sqlite3_load_extension(
5523
+SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
55305524
sqlite3 *db, /* Load the extension into this database connection */
55315525
const char *zFile, /* Name of the shared library containing extension */
55325526
const char *zProc, /* Entry point. Derived from zFile if 0 */
55335527
char **pzErrMsg /* Put error message here if not 0 */
55345528
);
@@ -5544,11 +5538,11 @@
55445538
** ^Extension loading is off by default.
55455539
** ^Call the sqlite3_enable_load_extension() routine with onoff==1
55465540
** to turn extension loading on and call it with onoff==0 to turn
55475541
** it back off again.
55485542
*/
5549
-SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
5543
+SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
55505544
55515545
/*
55525546
** CAPI3REF: Automatically Load Statically Linked Extensions
55535547
**
55545548
** ^This interface causes the xEntryPoint() function to be invoked for
@@ -5582,11 +5576,11 @@
55825576
** will be called more than once for each database connection that is opened.
55835577
**
55845578
** See also: [sqlite3_reset_auto_extension()]
55855579
** and [sqlite3_cancel_auto_extension()]
55865580
*/
5587
-SQLITE_API int sqlite3_auto_extension(void (*xEntryPoint)(void));
5581
+SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void (*xEntryPoint)(void));
55885582
55895583
/*
55905584
** CAPI3REF: Cancel Automatic Extension Loading
55915585
**
55925586
** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
@@ -5594,19 +5588,19 @@
55945588
** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)]
55955589
** routine returns 1 if initialization routine X was successfully
55965590
** unregistered and it returns 0 if X was not on the list of initialization
55975591
** routines.
55985592
*/
5599
-SQLITE_API int sqlite3_cancel_auto_extension(void (*xEntryPoint)(void));
5593
+SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void (*xEntryPoint)(void));
56005594
56015595
/*
56025596
** CAPI3REF: Reset Automatic Extension Loading
56035597
**
56045598
** ^This interface disables all automatic extensions previously
56055599
** registered using [sqlite3_auto_extension()].
56065600
*/
5607
-SQLITE_API void sqlite3_reset_auto_extension(void);
5601
+SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void);
56085602
56095603
/*
56105604
** The interface to the virtual-table mechanism is currently considered
56115605
** to be experimental. The interface might change in incompatible ways.
56125606
** If this is a problem for you, do not use the interface at this time.
@@ -5805,17 +5799,17 @@
58055799
** be invoked if the call to sqlite3_create_module_v2() fails.
58065800
** ^The sqlite3_create_module()
58075801
** interface is equivalent to sqlite3_create_module_v2() with a NULL
58085802
** destructor.
58095803
*/
5810
-SQLITE_API int sqlite3_create_module(
5804
+SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
58115805
sqlite3 *db, /* SQLite connection to register module with */
58125806
const char *zName, /* Name of the module */
58135807
const sqlite3_module *p, /* Methods for the module */
58145808
void *pClientData /* Client data for xCreate/xConnect */
58155809
);
5816
-SQLITE_API int sqlite3_create_module_v2(
5810
+SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
58175811
sqlite3 *db, /* SQLite connection to register module with */
58185812
const char *zName, /* Name of the module */
58195813
const sqlite3_module *p, /* Methods for the module */
58205814
void *pClientData, /* Client data for xCreate/xConnect */
58215815
void(*xDestroy)(void*) /* Module destructor function */
@@ -5874,11 +5868,11 @@
58745868
** ^The [xCreate] and [xConnect] methods of a
58755869
** [virtual table module] call this interface
58765870
** to declare the format (the names and datatypes of the columns) of
58775871
** the virtual tables they implement.
58785872
*/
5879
-SQLITE_API int sqlite3_declare_vtab(sqlite3*, const char *zSQL);
5873
+SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
58805874
58815875
/*
58825876
** CAPI3REF: Overload A Function For A Virtual Table
58835877
**
58845878
** ^(Virtual tables can provide alternative implementations of functions
@@ -5892,11 +5886,11 @@
58925886
** of the new function always causes an exception to be thrown. So
58935887
** the new function is not good for anything by itself. Its only
58945888
** purpose is to be a placeholder function that can be overloaded
58955889
** by a [virtual table].
58965890
*/
5897
-SQLITE_API int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
5891
+SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
58985892
58995893
/*
59005894
** The interface to the virtual-table mechanism defined above (back up
59015895
** to a comment remarkably similar to this one) is currently considered
59025896
** to be experimental. The interface might change in incompatible ways.
@@ -5989,11 +5983,11 @@
59895983
** zero-filled blob to read or write using the incremental-blob interface.
59905984
**
59915985
** To avoid a resource leak, every open [BLOB handle] should eventually
59925986
** be released by a call to [sqlite3_blob_close()].
59935987
*/
5994
-SQLITE_API int sqlite3_blob_open(
5988
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
59955989
sqlite3*,
59965990
const char *zDb,
59975991
const char *zTable,
59985992
const char *zColumn,
59995993
sqlite3_int64 iRow,
@@ -6021,11 +6015,11 @@
60216015
** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
60226016
** always returns zero.
60236017
**
60246018
** ^This function sets the database handle error code and message.
60256019
*/
6026
-SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
6020
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
60276021
60286022
/*
60296023
** CAPI3REF: Close A BLOB Handle
60306024
**
60316025
** ^This function closes an open [BLOB handle]. ^(The BLOB handle is closed
@@ -6043,11 +6037,11 @@
60436037
** with a null pointer (such as would be returned by a failed call to
60446038
** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function
60456039
** is passed a valid open blob handle, the values returned by the
60466040
** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning.
60476041
*/
6048
-SQLITE_API int sqlite3_blob_close(sqlite3_blob *);
6042
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *);
60496043
60506044
/*
60516045
** CAPI3REF: Return The Size Of An Open BLOB
60526046
**
60536047
** ^Returns the size in bytes of the BLOB accessible via the
@@ -6058,11 +6052,11 @@
60586052
** This routine only works on a [BLOB handle] which has been created
60596053
** by a prior successful call to [sqlite3_blob_open()] and which has not
60606054
** been closed by [sqlite3_blob_close()]. Passing any other pointer in
60616055
** to this routine results in undefined and probably undesirable behavior.
60626056
*/
6063
-SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *);
6057
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *);
60646058
60656059
/*
60666060
** CAPI3REF: Read Data From A BLOB Incrementally
60676061
**
60686062
** ^(This function is used to read data from an open [BLOB handle] into a
@@ -6086,11 +6080,11 @@
60866080
** been closed by [sqlite3_blob_close()]. Passing any other pointer in
60876081
** to this routine results in undefined and probably undesirable behavior.
60886082
**
60896083
** See also: [sqlite3_blob_write()].
60906084
*/
6091
-SQLITE_API int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
6085
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
60926086
60936087
/*
60946088
** CAPI3REF: Write Data Into A BLOB Incrementally
60956089
**
60966090
** ^(This function is used to write data into an open [BLOB handle] from a
@@ -6127,11 +6121,11 @@
61276121
** been closed by [sqlite3_blob_close()]. Passing any other pointer in
61286122
** to this routine results in undefined and probably undesirable behavior.
61296123
**
61306124
** See also: [sqlite3_blob_read()].
61316125
*/
6132
-SQLITE_API int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
6126
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
61336127
61346128
/*
61356129
** CAPI3REF: Virtual File System Objects
61366130
**
61376131
** A virtual filesystem (VFS) is an [sqlite3_vfs] object
@@ -6158,13 +6152,13 @@
61586152
**
61596153
** ^Unregister a VFS with the sqlite3_vfs_unregister() interface.
61606154
** ^(If the default VFS is unregistered, another VFS is chosen as
61616155
** the default. The choice for the new VFS is arbitrary.)^
61626156
*/
6163
-SQLITE_API sqlite3_vfs *sqlite3_vfs_find(const char *zVfsName);
6164
-SQLITE_API int sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
6165
-SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*);
6157
+SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfsName);
6158
+SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
6159
+SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs*);
61666160
61676161
/*
61686162
** CAPI3REF: Mutexes
61696163
**
61706164
** The SQLite core uses these routines for thread
@@ -6273,15 +6267,15 @@
62736267
** sqlite3_mutex_leave() is a NULL pointer, then all three routines
62746268
** behave as no-ops.
62756269
**
62766270
** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
62776271
*/
6278
-SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int);
6279
-SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*);
6280
-SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*);
6281
-SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*);
6282
-SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*);
6272
+SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int);
6273
+SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*);
6274
+SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*);
6275
+SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*);
6276
+SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*);
62836277
62846278
/*
62856279
** CAPI3REF: Mutex Methods Object
62866280
**
62876281
** An instance of this structure defines the low-level routines
@@ -6387,12 +6381,12 @@
63876381
** call to sqlite3_mutex_held() to fail, so a non-zero return is
63886382
** the appropriate thing to do. The sqlite3_mutex_notheld()
63896383
** interface should also return 1 when given a NULL pointer.
63906384
*/
63916385
#ifndef NDEBUG
6392
-SQLITE_API int sqlite3_mutex_held(sqlite3_mutex*);
6393
-SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex*);
6386
+SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex*);
6387
+SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex*);
63946388
#endif
63956389
63966390
/*
63976391
** CAPI3REF: Mutex Types
63986392
**
@@ -6424,11 +6418,11 @@
64246418
** serializes access to the [database connection] given in the argument
64256419
** when the [threading mode] is Serialized.
64266420
** ^If the [threading mode] is Single-thread or Multi-thread then this
64276421
** routine returns a NULL pointer.
64286422
*/
6429
-SQLITE_API sqlite3_mutex *sqlite3_db_mutex(sqlite3*);
6423
+SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3*);
64306424
64316425
/*
64326426
** CAPI3REF: Low-Level Control Of Database Files
64336427
**
64346428
** ^The [sqlite3_file_control()] interface makes a direct call to the
@@ -6458,11 +6452,11 @@
64586452
** an incorrect zDbName and an SQLITE_ERROR return from the underlying
64596453
** xFileControl method.
64606454
**
64616455
** See also: [SQLITE_FCNTL_LOCKSTATE]
64626456
*/
6463
-SQLITE_API int sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
6457
+SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
64646458
64656459
/*
64666460
** CAPI3REF: Testing Interface
64676461
**
64686462
** ^The sqlite3_test_control() interface is used to read out internal
@@ -6477,11 +6471,11 @@
64776471
** The details of the operation codes, their meanings, the parameters
64786472
** they take, and what they do are all subject to change without notice.
64796473
** Unlike most of the SQLite API, this function is not guaranteed to
64806474
** operate consistently from one release to the next.
64816475
*/
6482
-SQLITE_API int sqlite3_test_control(int op, ...);
6476
+SQLITE_API int SQLITE_CDECL sqlite3_test_control(int op, ...);
64836477
64846478
/*
64856479
** CAPI3REF: Testing Interface Operation Codes
64866480
**
64876481
** These constants are the valid operation code parameters used
@@ -6540,12 +6534,12 @@
65406534
** be represented by a 32-bit integer, then the values returned by
65416535
** sqlite3_status() are undefined.
65426536
**
65436537
** See also: [sqlite3_db_status()]
65446538
*/
6545
-SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6546
-SQLITE_API int sqlite3_status64(
6539
+SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6540
+SQLITE_API int SQLITE_STDCALL sqlite3_status64(
65476541
int op,
65486542
sqlite3_int64 *pCurrent,
65496543
sqlite3_int64 *pHighwater,
65506544
int resetFlag
65516545
);
@@ -6664,11 +6658,11 @@
66646658
** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a
66656659
** non-zero [error code] on failure.
66666660
**
66676661
** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
66686662
*/
6669
-SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
6663
+SQLITE_API int SQLITE_STDCALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
66706664
66716665
/*
66726666
** CAPI3REF: Status Parameters for database connections
66736667
** KEYWORDS: {SQLITE_DBSTATUS options}
66746668
**
@@ -6793,11 +6787,11 @@
67936787
** ^If the resetFlg is true, then the counter is reset to zero after this
67946788
** interface call returns.
67956789
**
67966790
** See also: [sqlite3_status()] and [sqlite3_db_status()].
67976791
*/
6798
-SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
6792
+SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
67996793
68006794
/*
68016795
** CAPI3REF: Status Parameters for prepared statements
68026796
** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters}
68036797
**
@@ -7262,20 +7256,20 @@
72627256
** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()
72637257
** APIs are not strictly speaking threadsafe. If they are invoked at the
72647258
** same time as another thread is invoking sqlite3_backup_step() it is
72657259
** possible that they return invalid values.
72667260
*/
7267
-SQLITE_API sqlite3_backup *sqlite3_backup_init(
7261
+SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
72687262
sqlite3 *pDest, /* Destination database handle */
72697263
const char *zDestName, /* Destination database name */
72707264
sqlite3 *pSource, /* Source database handle */
72717265
const char *zSourceName /* Source database name */
72727266
);
7273
-SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage);
7274
-SQLITE_API int sqlite3_backup_finish(sqlite3_backup *p);
7275
-SQLITE_API int sqlite3_backup_remaining(sqlite3_backup *p);
7276
-SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p);
7267
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage);
7268
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p);
7269
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p);
7270
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p);
72777271
72787272
/*
72797273
** CAPI3REF: Unlock Notification
72807274
**
72817275
** ^When running in shared-cache mode, a database operation may fail with
@@ -7387,11 +7381,11 @@
73877381
** by an sqlite3_step() call. ^(If there is a blocking connection, then the
73887382
** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in
73897383
** the special "DROP TABLE/INDEX" case, the extended error code is just
73907384
** SQLITE_LOCKED.)^
73917385
*/
7392
-SQLITE_API int sqlite3_unlock_notify(
7386
+SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
73937387
sqlite3 *pBlocked, /* Waiting connection */
73947388
void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */
73957389
void *pNotifyArg /* Argument to pass to xNotify */
73967390
);
73977391
@@ -7402,12 +7396,12 @@
74027396
** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications
74037397
** and extensions to compare the contents of two buffers containing UTF-8
74047398
** strings in a case-independent fashion, using the same definition of "case
74057399
** independence" that SQLite uses internally when comparing identifiers.
74067400
*/
7407
-SQLITE_API int sqlite3_stricmp(const char *, const char *);
7408
-SQLITE_API int sqlite3_strnicmp(const char *, const char *, int);
7401
+SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *, const char *);
7402
+SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *, const char *, int);
74097403
74107404
/*
74117405
** CAPI3REF: String Globbing
74127406
*
74137407
** ^The [sqlite3_strglob(P,X)] interface returns zero if string X matches
@@ -7418,11 +7412,11 @@
74187412
** sensitive.
74197413
**
74207414
** Note that this routine returns zero on a match and non-zero if the strings
74217415
** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
74227416
*/
7423
-SQLITE_API int sqlite3_strglob(const char *zGlob, const char *zStr);
7417
+SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlob, const char *zStr);
74247418
74257419
/*
74267420
** CAPI3REF: Error Logging Interface
74277421
**
74287422
** ^The [sqlite3_log()] interface writes a message into the [error log]
@@ -7441,11 +7435,11 @@
74417435
** will not use dynamically allocated memory. The log message is stored in
74427436
** a fixed-length buffer on the stack. If the log message is longer than
74437437
** a few hundred characters, it will be truncated to the length of the
74447438
** buffer.
74457439
*/
7446
-SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...);
7440
+SQLITE_API void SQLITE_CDECL sqlite3_log(int iErrCode, const char *zFormat, ...);
74477441
74487442
/*
74497443
** CAPI3REF: Write-Ahead Log Commit Hook
74507444
**
74517445
** ^The [sqlite3_wal_hook()] function is used to register a callback that
@@ -7476,11 +7470,11 @@
74767470
** previously registered write-ahead log callback. ^Note that the
74777471
** [sqlite3_wal_autocheckpoint()] interface and the
74787472
** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will
74797473
** those overwrite any prior [sqlite3_wal_hook()] settings.
74807474
*/
7481
-SQLITE_API void *sqlite3_wal_hook(
7475
+SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
74827476
sqlite3*,
74837477
int(*)(void *,sqlite3*,const char*,int),
74847478
void*
74857479
);
74867480
@@ -7510,11 +7504,11 @@
75107504
** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]
75117505
** pages. The use of this interface
75127506
** is only necessary if the default setting is found to be suboptimal
75137507
** for a particular application.
75147508
*/
7515
-SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
7509
+SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
75167510
75177511
/*
75187512
** CAPI3REF: Checkpoint a database
75197513
**
75207514
** ^(The sqlite3_wal_checkpoint(D,X) is equivalent to
@@ -7531,11 +7525,11 @@
75317525
** interface was added. This interface is retained for backwards
75327526
** compatibility and as a convenience for applications that need to manually
75337527
** start a callback but which do not need the full power (and corresponding
75347528
** complication) of [sqlite3_wal_checkpoint_v2()].
75357529
*/
7536
-SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
7530
+SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
75377531
75387532
/*
75397533
** CAPI3REF: Checkpoint a database
75407534
**
75417535
** ^(The sqlite3_wal_checkpoint_v2(D,X,M,L,C) interface runs a checkpoint
@@ -7624,11 +7618,11 @@
76247618
** [sqlite3_errcode()] and [sqlite3_errmsg()].
76257619
**
76267620
** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface
76277621
** from SQL.
76287622
*/
7629
-SQLITE_API int sqlite3_wal_checkpoint_v2(
7623
+SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
76307624
sqlite3 *db, /* Database handle */
76317625
const char *zDb, /* Name of attached database (or NULL) */
76327626
int eMode, /* SQLITE_CHECKPOINT_* value */
76337627
int *pnLog, /* OUT: Size of WAL log in frames */
76347628
int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -7660,11 +7654,11 @@
76607654
**
76617655
** At present, there is only one option that may be configured using
76627656
** this function. (See [SQLITE_VTAB_CONSTRAINT_SUPPORT].) Further options
76637657
** may be added in the future.
76647658
*/
7665
-SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...);
7659
+SQLITE_API int SQLITE_CDECL sqlite3_vtab_config(sqlite3*, int op, ...);
76667660
76677661
/*
76687662
** CAPI3REF: Virtual Table Configuration Options
76697663
**
76707664
** These macros define the various options to the
@@ -7713,11 +7707,11 @@
77137707
** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL],
77147708
** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode
77157709
** of the SQL statement that triggered the call to the [xUpdate] method of the
77167710
** [virtual table].
77177711
*/
7718
-SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *);
7712
+SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *);
77197713
77207714
/*
77217715
** CAPI3REF: Conflict resolution modes
77227716
** KEYWORDS: {conflict resolution mode}
77237717
**
@@ -7817,11 +7811,11 @@
78177811
** as if the loop did not exist - it returns non-zero and leave the variable
78187812
** that pOut points to unchanged.
78197813
**
78207814
** See also: [sqlite3_stmt_scanstatus_reset()]
78217815
*/
7822
-SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_stmt_scanstatus(
7816
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_stmt_scanstatus(
78237817
sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
78247818
int idx, /* Index of loop to report on */
78257819
int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
78267820
void *pOut /* Result written here */
78277821
);
@@ -7832,11 +7826,11 @@
78327826
** ^Zero all [sqlite3_stmt_scanstatus()] related event counters.
78337827
**
78347828
** This API is only available if the library is built with pre-processor
78357829
** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined.
78367830
*/
7837
-SQLITE_API SQLITE_EXPERIMENTAL void sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
7831
+SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
78387832
78397833
78407834
/*
78417835
** Undo the hack that converts floating point types to integer for
78427836
** builds on processors without floating point support.
@@ -7887,11 +7881,11 @@
78877881
** Register a geometry callback named zGeom that can be used as part of an
78887882
** R-Tree geometry query as follows:
78897883
**
78907884
** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
78917885
*/
7892
-SQLITE_API int sqlite3_rtree_geometry_callback(
7886
+SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
78937887
sqlite3 *db,
78947888
const char *zGeom,
78957889
int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
78967890
void *pContext
78977891
);
@@ -7913,11 +7907,11 @@
79137907
** Register a 2nd-generation geometry callback named zScore that can be
79147908
** used as part of an R-Tree geometry query as follows:
79157909
**
79167910
** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...)
79177911
*/
7918
-SQLITE_API int sqlite3_rtree_query_callback(
7912
+SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
79197913
sqlite3 *db,
79207914
const char *zQueryFunc,
79217915
int (*xQueryFunc)(sqlite3_rtree_query_info*),
79227916
void *pContext,
79237917
void (*xDestructor)(void*)
@@ -9157,12 +9151,12 @@
91579151
*/
91589152
#ifdef SQLITE_OMIT_WSD
91599153
#define SQLITE_WSD const
91609154
#define GLOBAL(t,v) (*(t*)sqlite3_wsd_find((void*)&(v), sizeof(v)))
91619155
#define sqlite3GlobalConfig GLOBAL(struct Sqlite3Config, sqlite3Config)
9162
-SQLITE_API int sqlite3_wsd_init(int N, int J);
9163
-SQLITE_API void *sqlite3_wsd_find(void *K, int L);
9156
+SQLITE_API int SQLITE_STDCALL sqlite3_wsd_init(int N, int J);
9157
+SQLITE_API void *SQLITE_STDCALL sqlite3_wsd_find(void *K, int L);
91649158
#else
91659159
#define SQLITE_WSD
91669160
#define GLOBAL(t,v) v
91679161
#define sqlite3GlobalConfig sqlite3Config
91689162
#endif
@@ -13646,11 +13640,11 @@
1364613640
** print I/O tracing messages.
1364713641
*/
1364813642
#ifdef SQLITE_ENABLE_IOTRACE
1364913643
# define IOTRACE(A) if( sqlite3IoTrace ){ sqlite3IoTrace A; }
1365013644
SQLITE_PRIVATE void sqlite3VdbeIOTraceSql(Vdbe*);
13651
-void (*sqlite3IoTrace)(const char*,...);
13645
+SQLITE_API SQLITE_EXTERN void (SQLITE_CDECL *sqlite3IoTrace)(const char*,...);
1365213646
#else
1365313647
# define IOTRACE(A)
1365413648
# define sqlite3VdbeIOTraceSql(X)
1365513649
#endif
1365613650
@@ -14359,11 +14353,11 @@
1435914353
** was used and false if not.
1436014354
**
1436114355
** The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix
1436214356
** is not required for a match.
1436314357
*/
14364
-SQLITE_API int sqlite3_compileoption_used(const char *zOptName){
14358
+SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName){
1436514359
int i, n;
1436614360
1436714361
#if SQLITE_ENABLE_API_ARMOR
1436814362
if( zOptName==0 ){
1436914363
(void)SQLITE_MISUSE_BKPT;
@@ -14387,11 +14381,11 @@
1438714381
1438814382
/*
1438914383
** Return the N-th compile-time option string. If N is out of range,
1439014384
** return a NULL pointer.
1439114385
*/
14392
-SQLITE_API const char *sqlite3_compileoption_get(int N){
14386
+SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N){
1439314387
if( N>=0 && N<ArraySize(azCompileOpt) ){
1439414388
return azCompileOpt[N];
1439514389
}
1439614390
return 0;
1439714391
}
@@ -15024,11 +15018,11 @@
1502415018
}
1502515019
1502615020
/*
1502715021
** Query status information.
1502815022
*/
15029
-SQLITE_API int sqlite3_status64(
15023
+SQLITE_API int SQLITE_STDCALL sqlite3_status64(
1503015024
int op,
1503115025
sqlite3_int64 *pCurrent,
1503215026
sqlite3_int64 *pHighwater,
1503315027
int resetFlag
1503415028
){
@@ -15049,11 +15043,11 @@
1504915043
}
1505015044
sqlite3_mutex_leave(pMutex);
1505115045
(void)pMutex; /* Prevent warning when SQLITE_THREADSAFE=0 */
1505215046
return SQLITE_OK;
1505315047
}
15054
-SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){
15048
+SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){
1505515049
sqlite3_int64 iCur, iHwtr;
1505615050
int rc;
1505715051
#ifdef SQLITE_ENABLE_API_ARMOR
1505815052
if( pCurrent==0 || pHighwater==0 ) return SQLITE_MISUSE_BKPT;
1505915053
#endif
@@ -15066,11 +15060,11 @@
1506615060
}
1506715061
1506815062
/*
1506915063
** Query status information for a single database connection
1507015064
*/
15071
-SQLITE_API int sqlite3_db_status(
15065
+SQLITE_API int SQLITE_STDCALL sqlite3_db_status(
1507215066
sqlite3 *db, /* The database connection whose status is desired */
1507315067
int op, /* Status verb */
1507415068
int *pCurrent, /* Write current value here */
1507515069
int *pHighwater, /* Write high-water mark here */
1507615070
int resetFlag /* Reset high-water mark if true */
@@ -16690,11 +16684,11 @@
1669016684
1669116685
/*
1669216686
** Locate a VFS by name. If no name is given, simply return the
1669316687
** first VFS on the list.
1669416688
*/
16695
-SQLITE_API sqlite3_vfs *sqlite3_vfs_find(const char *zVfs){
16689
+SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfs){
1669616690
sqlite3_vfs *pVfs = 0;
1669716691
#if SQLITE_THREADSAFE
1669816692
sqlite3_mutex *mutex;
1669916693
#endif
1670016694
#ifndef SQLITE_OMIT_AUTOINIT
@@ -16736,11 +16730,11 @@
1673616730
/*
1673716731
** Register a VFS with the system. It is harmless to register the same
1673816732
** VFS multiple times. The new VFS becomes the default if makeDflt is
1673916733
** true.
1674016734
*/
16741
-SQLITE_API int sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){
16735
+SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){
1674216736
MUTEX_LOGIC(sqlite3_mutex *mutex;)
1674316737
#ifndef SQLITE_OMIT_AUTOINIT
1674416738
int rc = sqlite3_initialize();
1674516739
if( rc ) return rc;
1674616740
#endif
@@ -16764,11 +16758,11 @@
1676416758
}
1676516759
1676616760
/*
1676716761
** Unregister a VFS so that it is no longer accessible.
1676816762
*/
16769
-SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs *pVfs){
16763
+SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs *pVfs){
1677016764
#if SQLITE_THREADSAFE
1677116765
sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
1677216766
#endif
1677316767
sqlite3_mutex_enter(mutex);
1677416768
vfsUnlink(pVfs);
@@ -19100,11 +19094,11 @@
1910019094
}
1910119095
1910219096
/*
1910319097
** Retrieve a pointer to a static mutex or allocate a new dynamic one.
1910419098
*/
19105
-SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int id){
19099
+SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int id){
1910619100
#ifndef SQLITE_OMIT_AUTOINIT
1910719101
if( id<=SQLITE_MUTEX_RECURSIVE && sqlite3_initialize() ) return 0;
1910819102
if( id>SQLITE_MUTEX_RECURSIVE && sqlite3MutexInit() ) return 0;
1910919103
#endif
1911019104
return sqlite3GlobalConfig.mutex.xMutexAlloc(id);
@@ -19119,31 +19113,31 @@
1911919113
}
1912019114
1912119115
/*
1912219116
** Free a dynamic mutex.
1912319117
*/
19124
-SQLITE_API void sqlite3_mutex_free(sqlite3_mutex *p){
19118
+SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex *p){
1912519119
if( p ){
1912619120
sqlite3GlobalConfig.mutex.xMutexFree(p);
1912719121
}
1912819122
}
1912919123
1913019124
/*
1913119125
** Obtain the mutex p. If some other thread already has the mutex, block
1913219126
** until it can be obtained.
1913319127
*/
19134
-SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex *p){
19128
+SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex *p){
1913519129
if( p ){
1913619130
sqlite3GlobalConfig.mutex.xMutexEnter(p);
1913719131
}
1913819132
}
1913919133
1914019134
/*
1914119135
** Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another
1914219136
** thread holds the mutex and it cannot be obtained, return SQLITE_BUSY.
1914319137
*/
19144
-SQLITE_API int sqlite3_mutex_try(sqlite3_mutex *p){
19138
+SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex *p){
1914519139
int rc = SQLITE_OK;
1914619140
if( p ){
1914719141
return sqlite3GlobalConfig.mutex.xMutexTry(p);
1914819142
}
1914919143
return rc;
@@ -19153,11 +19147,11 @@
1915319147
** The sqlite3_mutex_leave() routine exits a mutex that was previously
1915419148
** entered by the same thread. The behavior is undefined if the mutex
1915519149
** is not currently entered. If a NULL pointer is passed as an argument
1915619150
** this function is a no-op.
1915719151
*/
19158
-SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex *p){
19152
+SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex *p){
1915919153
if( p ){
1916019154
sqlite3GlobalConfig.mutex.xMutexLeave(p);
1916119155
}
1916219156
}
1916319157
@@ -19164,14 +19158,14 @@
1916419158
#ifndef NDEBUG
1916519159
/*
1916619160
** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are
1916719161
** intended for use inside assert() statements.
1916819162
*/
19169
-SQLITE_API int sqlite3_mutex_held(sqlite3_mutex *p){
19163
+SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex *p){
1917019164
return p==0 || sqlite3GlobalConfig.mutex.xMutexHeld(p);
1917119165
}
19172
-SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex *p){
19166
+SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex *p){
1917319167
return p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld(p);
1917419168
}
1917519169
#endif
1917619170
1917719171
#endif /* !defined(SQLITE_MUTEX_OMIT) */
@@ -20163,12 +20157,12 @@
2016320157
** of the sqlite3_initialize() and sqlite3_shutdown() processing, the
2016420158
** "interlocked" magic used here is probably not strictly necessary.
2016520159
*/
2016620160
static LONG SQLITE_WIN32_VOLATILE winMutex_lock = 0;
2016720161
20168
-SQLITE_API int sqlite3_win32_is_nt(void); /* os_win.c */
20169
-SQLITE_API void sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */
20162
+SQLITE_API int SQLITE_STDCALL sqlite3_win32_is_nt(void); /* os_win.c */
20163
+SQLITE_API void SQLITE_STDCALL sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */
2017020164
2017120165
static int winMutexInit(void){
2017220166
/* The first to increment to 1 does actual initialization */
2017320167
if( InterlockedCompareExchange(&winMutex_lock, 1, 0)==0 ){
2017420168
int i;
@@ -20460,11 +20454,11 @@
2046020454
/*
2046120455
** Attempt to release up to n bytes of non-essential memory currently
2046220456
** held by SQLite. An example of non-essential memory is memory used to
2046320457
** cache database pages that are not currently in use.
2046420458
*/
20465
-SQLITE_API int sqlite3_release_memory(int n){
20459
+SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int n){
2046620460
#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
2046720461
return sqlite3PcacheReleaseMemory(n);
2046820462
#else
2046920463
/* IMPLEMENTATION-OF: R-34391-24921 The sqlite3_release_memory() routine
2047020464
** is a no-op returning zero if SQLite is not compiled with
@@ -20560,11 +20554,11 @@
2056020554
#ifndef SQLITE_OMIT_DEPRECATED
2056120555
/*
2056220556
** Deprecated external interface. Internal/core SQLite code
2056320557
** should call sqlite3MemoryAlarm.
2056420558
*/
20565
-SQLITE_API int sqlite3_memory_alarm(
20559
+SQLITE_API int SQLITE_STDCALL sqlite3_memory_alarm(
2056620560
void(*xCallback)(void *pArg, sqlite3_int64 used,int N),
2056720561
void *pArg,
2056820562
sqlite3_int64 iThreshold
2056920563
){
2057020564
return sqlite3MemoryAlarm(xCallback, pArg, iThreshold);
@@ -20573,11 +20567,11 @@
2057320567
2057420568
/*
2057520569
** Set the soft heap-size limit for the library. Passing a zero or
2057620570
** negative value indicates no limit.
2057720571
*/
20578
-SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 n){
20572
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 n){
2057920573
sqlite3_int64 priorLimit;
2058020574
sqlite3_int64 excess;
2058120575
#ifndef SQLITE_OMIT_AUTOINIT
2058220576
int rc = sqlite3_initialize();
2058320577
if( rc ) return -1;
@@ -20593,19 +20587,20 @@
2059320587
}
2059420588
excess = sqlite3_memory_used() - n;
2059520589
if( excess>0 ) sqlite3_release_memory((int)(excess & 0x7fffffff));
2059620590
return priorLimit;
2059720591
}
20598
-SQLITE_API void sqlite3_soft_heap_limit(int n){
20592
+SQLITE_API void SQLITE_STDCALL sqlite3_soft_heap_limit(int n){
2059920593
if( n<0 ) n = 0;
2060020594
sqlite3_soft_heap_limit64(n);
2060120595
}
2060220596
2060320597
/*
2060420598
** Initialize the memory allocation subsystem.
2060520599
*/
2060620600
SQLITE_PRIVATE int sqlite3MallocInit(void){
20601
+ int rc;
2060720602
if( sqlite3GlobalConfig.m.xMalloc==0 ){
2060820603
sqlite3MemSetDefault();
2060920604
}
2061020605
memset(&mem0, 0, sizeof(mem0));
2061120606
if( sqlite3GlobalConfig.bCoreMutex ){
@@ -20637,11 +20632,13 @@
2063720632
|| sqlite3GlobalConfig.nPage<1 ){
2063820633
sqlite3GlobalConfig.pPage = 0;
2063920634
sqlite3GlobalConfig.szPage = 0;
2064020635
sqlite3GlobalConfig.nPage = 0;
2064120636
}
20642
- return sqlite3GlobalConfig.m.xInit(sqlite3GlobalConfig.m.pAppData);
20637
+ rc = sqlite3GlobalConfig.m.xInit(sqlite3GlobalConfig.m.pAppData);
20638
+ if( rc!=SQLITE_OK ) memset(&mem0, 0, sizeof(mem0));
20639
+ return rc;
2064320640
}
2064420641
2064520642
/*
2064620643
** Return true if the heap is currently under memory pressure - in other
2064720644
** words if the amount of heap used is close to the limit set by
@@ -20662,11 +20659,11 @@
2066220659
}
2066320660
2066420661
/*
2066520662
** Return the amount of memory currently checked out.
2066620663
*/
20667
-SQLITE_API sqlite3_int64 sqlite3_memory_used(void){
20664
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void){
2066820665
int n, mx;
2066920666
sqlite3_int64 res;
2067020667
sqlite3_status(SQLITE_STATUS_MEMORY_USED, &n, &mx, 0);
2067120668
res = (sqlite3_int64)n; /* Work around bug in Borland C. Ticket #3216 */
2067220669
return res;
@@ -20675,11 +20672,11 @@
2067520672
/*
2067620673
** Return the maximum amount of memory that has ever been
2067720674
** checked out since either the beginning of this process
2067820675
** or since the most recent reset.
2067920676
*/
20680
-SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int resetFlag){
20677
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag){
2068120678
int n, mx;
2068220679
sqlite3_int64 res;
2068320680
sqlite3_status(SQLITE_STATUS_MEMORY_USED, &n, &mx, resetFlag);
2068420681
res = (sqlite3_int64)mx; /* Work around bug in Borland C. Ticket #3216 */
2068520682
return res;
@@ -20766,17 +20763,17 @@
2076620763
/*
2076720764
** This version of the memory allocation is for use by the application.
2076820765
** First make sure the memory subsystem is initialized, then do the
2076920766
** allocation.
2077020767
*/
20771
-SQLITE_API void *sqlite3_malloc(int n){
20768
+SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int n){
2077220769
#ifndef SQLITE_OMIT_AUTOINIT
2077320770
if( sqlite3_initialize() ) return 0;
2077420771
#endif
2077520772
return n<=0 ? 0 : sqlite3Malloc(n);
2077620773
}
20777
-SQLITE_API void *sqlite3_malloc64(sqlite3_uint64 n){
20774
+SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64 n){
2077820775
#ifndef SQLITE_OMIT_AUTOINIT
2077920776
if( sqlite3_initialize() ) return 0;
2078020777
#endif
2078120778
return sqlite3Malloc(n);
2078220779
}
@@ -20913,20 +20910,20 @@
2091320910
assert( sqlite3MemdebugNoType(p, (u8)~(MEMTYPE_LOOKASIDE|MEMTYPE_HEAP)) );
2091420911
return sqlite3GlobalConfig.m.xSize(p);
2091520912
}
2091620913
}
2091720914
}
20918
-SQLITE_API sqlite3_uint64 sqlite3_msize(void *p){
20915
+SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void *p){
2091920916
assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) );
2092020917
assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
2092120918
return (sqlite3_uint64)sqlite3GlobalConfig.m.xSize(p);
2092220919
}
2092320920
2092420921
/*
2092520922
** Free memory previously obtained from sqlite3Malloc().
2092620923
*/
20927
-SQLITE_API void sqlite3_free(void *p){
20924
+SQLITE_API void SQLITE_STDCALL sqlite3_free(void *p){
2092820925
if( p==0 ) return; /* IMP: R-49053-54554 */
2092920926
assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
2093020927
assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) );
2093120928
if( sqlite3GlobalConfig.bMemstat ){
2093220929
sqlite3_mutex_enter(mem0.mutex);
@@ -21031,18 +21028,18 @@
2103121028
2103221029
/*
2103321030
** The public interface to sqlite3Realloc. Make sure that the memory
2103421031
** subsystem is initialized prior to invoking sqliteRealloc.
2103521032
*/
21036
-SQLITE_API void *sqlite3_realloc(void *pOld, int n){
21033
+SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void *pOld, int n){
2103721034
#ifndef SQLITE_OMIT_AUTOINIT
2103821035
if( sqlite3_initialize() ) return 0;
2103921036
#endif
2104021037
if( n<0 ) n = 0; /* IMP: R-26507-47431 */
2104121038
return sqlite3Realloc(pOld, n);
2104221039
}
21043
-SQLITE_API void *sqlite3_realloc64(void *pOld, sqlite3_uint64 n){
21040
+SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void *pOld, sqlite3_uint64 n){
2104421041
#ifndef SQLITE_OMIT_AUTOINIT
2104521042
if( sqlite3_initialize() ) return 0;
2104621043
#endif
2104721044
return sqlite3Realloc(pOld, n);
2104821045
}
@@ -22204,11 +22201,11 @@
2220422201
2220522202
/*
2220622203
** Print into memory obtained from sqlite3_malloc(). Omit the internal
2220722204
** %-conversion extensions.
2220822205
*/
22209
-SQLITE_API char *sqlite3_vmprintf(const char *zFormat, va_list ap){
22206
+SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char *zFormat, va_list ap){
2221022207
char *z;
2221122208
char zBase[SQLITE_PRINT_BUF_SIZE];
2221222209
StrAccum acc;
2221322210
2221422211
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -22229,11 +22226,11 @@
2222922226
2223022227
/*
2223122228
** Print into memory obtained from sqlite3_malloc()(). Omit the internal
2223222229
** %-conversion extensions.
2223322230
*/
22234
-SQLITE_API char *sqlite3_mprintf(const char *zFormat, ...){
22231
+SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char *zFormat, ...){
2223522232
va_list ap;
2223622233
char *z;
2223722234
#ifndef SQLITE_OMIT_AUTOINIT
2223822235
if( sqlite3_initialize() ) return 0;
2223922236
#endif
@@ -22254,11 +22251,11 @@
2225422251
** this without breaking compatibility, so we just have to live with the
2225522252
** mistake.
2225622253
**
2225722254
** sqlite3_vsnprintf() is the varargs version.
2225822255
*/
22259
-SQLITE_API char *sqlite3_vsnprintf(int n, char *zBuf, const char *zFormat, va_list ap){
22256
+SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int n, char *zBuf, const char *zFormat, va_list ap){
2226022257
StrAccum acc;
2226122258
if( n<=0 ) return zBuf;
2226222259
#ifdef SQLITE_ENABLE_API_ARMOR
2226322260
if( zBuf==0 || zFormat==0 ) {
2226422261
(void)SQLITE_MISUSE_BKPT;
@@ -22269,11 +22266,11 @@
2226922266
sqlite3StrAccumInit(&acc, zBuf, n, 0);
2227022267
acc.useMalloc = 0;
2227122268
sqlite3VXPrintf(&acc, 0, zFormat, ap);
2227222269
return sqlite3StrAccumFinish(&acc);
2227322270
}
22274
-SQLITE_API char *sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){
22271
+SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){
2227522272
char *z;
2227622273
va_list ap;
2227722274
va_start(ap,zFormat);
2227822275
z = sqlite3_vsnprintf(n, zBuf, zFormat, ap);
2227922276
va_end(ap);
@@ -22301,11 +22298,11 @@
2230122298
}
2230222299
2230322300
/*
2230422301
** Format and write a message to the log if logging is enabled.
2230522302
*/
22306
-SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...){
22303
+SQLITE_API void SQLITE_CDECL sqlite3_log(int iErrCode, const char *zFormat, ...){
2230722304
va_list ap; /* Vararg list */
2230822305
if( sqlite3GlobalConfig.xLog ){
2230922306
va_start(ap, zFormat);
2231022307
renderLogMsg(iErrCode, zFormat, ap);
2231122308
va_end(ap);
@@ -22437,11 +22434,11 @@
2243722434
} sqlite3Prng;
2243822435
2243922436
/*
2244022437
** Return N random bytes.
2244122438
*/
22442
-SQLITE_API void sqlite3_randomness(int N, void *pBuf){
22439
+SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *pBuf){
2244322440
unsigned char t;
2244422441
unsigned char *zBuf = pBuf;
2244522442
2244622443
/* The "wsdPrng" macro will resolve to the pseudo-random number generator
2244722444
** state vector. If writable static data is unsupported on the target,
@@ -23589,11 +23586,11 @@
2358923586
** sqlite3_strnicmp() APIs allow applications and extensions to compare
2359023587
** the contents of two buffers containing UTF-8 strings in a
2359123588
** case-independent fashion, using the same definition of "case
2359223589
** independence" that SQLite uses internally when comparing identifiers.
2359323590
*/
23594
-SQLITE_API int sqlite3_stricmp(const char *zLeft, const char *zRight){
23591
+SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *zLeft, const char *zRight){
2359523592
register unsigned char *a, *b;
2359623593
if( zLeft==0 ){
2359723594
return zRight ? -1 : 0;
2359823595
}else if( zRight==0 ){
2359923596
return 1;
@@ -23601,11 +23598,11 @@
2360123598
a = (unsigned char *)zLeft;
2360223599
b = (unsigned char *)zRight;
2360323600
while( *a!=0 && UpperToLower[*a]==UpperToLower[*b]){ a++; b++; }
2360423601
return UpperToLower[*a] - UpperToLower[*b];
2360523602
}
23606
-SQLITE_API int sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){
23603
+SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){
2360723604
register unsigned char *a, *b;
2360823605
if( zLeft==0 ){
2360923606
return zRight ? -1 : 0;
2361023607
}else if( zRight==0 ){
2361123608
return 1;
@@ -32814,11 +32811,11 @@
3281432811
** This routine is called once during SQLite initialization and by a
3281532812
** single thread. The memory allocation and mutex subsystems have not
3281632813
** necessarily been initialized when this routine is called, and so they
3281732814
** should not be used.
3281832815
*/
32819
-SQLITE_API int sqlite3_os_init(void){
32816
+SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void){
3282032817
/*
3282132818
** The following macro defines an initializer for an sqlite3_vfs object.
3282232819
** The name of the VFS is NAME. The pAppData is a pointer to a pointer
3282332820
** to the "finder" function. (pAppData is a pointer to a pointer because
3282432821
** silly C90 rules prohibit a void* from being cast to a function pointer
@@ -32913,11 +32910,11 @@
3291332910
**
3291432911
** Some operating systems might need to do some cleanup in this routine,
3291532912
** to release dynamically allocated objects. But not on unix.
3291632913
** This routine is a no-op for unix.
3291732914
*/
32918
-SQLITE_API int sqlite3_os_end(void){
32915
+SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void){
3291932916
return SQLITE_OK;
3292032917
}
3292132918
3292232919
#endif /* SQLITE_OS_UNIX */
3292332920
@@ -34305,11 +34302,11 @@
3430534302
** compact it. Upon success, SQLITE_OK will be returned. Upon failure, one
3430634303
** of SQLITE_NOMEM, SQLITE_ERROR, or SQLITE_NOTFOUND will be returned. The
3430734304
** "pnLargest" argument, if non-zero, will be used to return the size of the
3430834305
** largest committed free block in the heap, in bytes.
3430934306
*/
34310
-SQLITE_API int sqlite3_win32_compact_heap(LPUINT pnLargest){
34307
+SQLITE_API int SQLITE_STDCALL sqlite3_win32_compact_heap(LPUINT pnLargest){
3431134308
int rc = SQLITE_OK;
3431234309
UINT nLargest = 0;
3431334310
HANDLE hHeap;
3431434311
3431534312
winMemAssertMagic();
@@ -34345,11 +34342,11 @@
3434534342
** If a Win32 native heap has been configured, this function will attempt to
3434634343
** destroy and recreate it. If the Win32 native heap is not isolated and/or
3434734344
** the sqlite3_memory_used() function does not return zero, SQLITE_BUSY will
3434834345
** be returned and no changes will be made to the Win32 native heap.
3434934346
*/
34350
-SQLITE_API int sqlite3_win32_reset_heap(){
34347
+SQLITE_API int SQLITE_STDCALL sqlite3_win32_reset_heap(){
3435134348
int rc;
3435234349
MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */
3435334350
MUTEX_LOGIC( sqlite3_mutex *pMem; ) /* The memsys static mutex */
3435434351
MUTEX_LOGIC( pMaster = sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_MASTER); )
3435534352
MUTEX_LOGIC( pMem = sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_MEM); )
@@ -34390,11 +34387,11 @@
3439034387
/*
3439134388
** This function outputs the specified (ANSI) string to the Win32 debugger
3439234389
** (if available).
3439334390
*/
3439434391
34395
-SQLITE_API void sqlite3_win32_write_debug(const char *zBuf, int nBuf){
34392
+SQLITE_API void SQLITE_STDCALL sqlite3_win32_write_debug(const char *zBuf, int nBuf){
3439634393
char zDbgBuf[SQLITE_WIN32_DBG_BUF_SIZE];
3439734394
int nMin = MIN(nBuf, (SQLITE_WIN32_DBG_BUF_SIZE - 1)); /* may be negative. */
3439834395
if( nMin<-1 ) nMin = -1; /* all negative values become -1. */
3439934396
assert( nMin==-1 || nMin==0 || nMin<SQLITE_WIN32_DBG_BUF_SIZE );
3440034397
#if defined(SQLITE_WIN32_HAS_ANSI)
@@ -34430,11 +34427,11 @@
3443034427
*/
3443134428
#if SQLITE_OS_WINRT
3443234429
static HANDLE sleepObj = NULL;
3443334430
#endif
3443434431
34435
-SQLITE_API void sqlite3_win32_sleep(DWORD milliseconds){
34432
+SQLITE_API void SQLITE_STDCALL sqlite3_win32_sleep(DWORD milliseconds){
3443634433
#if SQLITE_OS_WINRT
3443734434
if ( sleepObj==NULL ){
3443834435
sleepObj = osCreateEventExW(NULL, NULL, CREATE_EVENT_MANUAL_RESET,
3443934436
SYNCHRONIZE);
3444034437
}
@@ -34479,11 +34476,11 @@
3447934476
3448034477
/*
3448134478
** This function determines if the machine is running a version of Windows
3448234479
** based on the NT kernel.
3448334480
*/
34484
-SQLITE_API int sqlite3_win32_is_nt(void){
34481
+SQLITE_API int SQLITE_STDCALL sqlite3_win32_is_nt(void){
3448534482
#if SQLITE_OS_WINRT
3448634483
/*
3448734484
** NOTE: The WinRT sub-platform is always assumed to be based on the NT
3448834485
** kernel.
3448934486
*/
@@ -34833,11 +34830,11 @@
3483334830
3483434831
/*
3483534832
** Convert multibyte character string to UTF-8. Space to hold the
3483634833
** returned string is obtained from sqlite3_malloc().
3483734834
*/
34838
-SQLITE_API char *sqlite3_win32_mbcs_to_utf8(const char *zFilename){
34835
+SQLITE_API char *SQLITE_STDCALL sqlite3_win32_mbcs_to_utf8(const char *zFilename){
3483934836
char *zFilenameUtf8;
3484034837
LPWSTR zTmpWide;
3484134838
3484234839
zTmpWide = winMbcsToUnicode(zFilename);
3484334840
if( zTmpWide==0 ){
@@ -34850,11 +34847,11 @@
3485034847
3485134848
/*
3485234849
** Convert UTF-8 to multibyte character string. Space to hold the
3485334850
** returned string is obtained from sqlite3_malloc().
3485434851
*/
34855
-SQLITE_API char *sqlite3_win32_utf8_to_mbcs(const char *zFilename){
34852
+SQLITE_API char *SQLITE_STDCALL sqlite3_win32_utf8_to_mbcs(const char *zFilename){
3485634853
char *zFilenameMbcs;
3485734854
LPWSTR zTmpWide;
3485834855
3485934856
zTmpWide = winUtf8ToUnicode(zFilename);
3486034857
if( zTmpWide==0 ){
@@ -34870,11 +34867,11 @@
3487034867
** the provided arguments. The type argument must be 1 in order to set the
3487134868
** data directory or 2 in order to set the temporary directory. The zValue
3487234869
** argument is the name of the directory to use. The return value will be
3487334870
** SQLITE_OK if successful.
3487434871
*/
34875
-SQLITE_API int sqlite3_win32_set_directory(DWORD type, LPCWSTR zValue){
34872
+SQLITE_API int SQLITE_STDCALL sqlite3_win32_set_directory(DWORD type, LPCWSTR zValue){
3487634873
char **ppDirectory = 0;
3487734874
#ifndef SQLITE_OMIT_AUTOINIT
3487834875
int rc = sqlite3_initialize();
3487934876
if( rc ) return rc;
3488034877
#endif
@@ -35095,15 +35092,15 @@
3509535092
}
3509635093
3509735094
/*
3509835095
** Log a I/O error retry episode.
3509935096
*/
35100
-static void winLogIoerr(int nRetry){
35097
+static void winLogIoerr(int nRetry, int lineno){
3510135098
if( nRetry ){
3510235099
sqlite3_log(SQLITE_IOERR,
35103
- "delayed %dms for lock/sharing conflict",
35104
- winIoerrRetryDelay*nRetry*(nRetry+1)/2
35100
+ "delayed %dms for lock/sharing conflict at line %d",
35101
+ winIoerrRetryDelay*nRetry*(nRetry+1)/2, lineno
3510535102
);
3510635103
}
3510735104
}
3510835105
3510935106
#if SQLITE_OS_WINCE
@@ -35579,11 +35576,12 @@
3557935576
assert( id!=0 );
3558035577
#ifndef SQLITE_OMIT_WAL
3558135578
assert( pFile->pShm==0 );
3558235579
#endif
3558335580
assert( pFile->h!=NULL && pFile->h!=INVALID_HANDLE_VALUE );
35584
- OSTRACE(("CLOSE file=%p\n", pFile->h));
35581
+ OSTRACE(("CLOSE pid=%lu, pFile=%p, file=%p\n",
35582
+ osGetCurrentProcessId(), pFile, pFile->h));
3558535583
3558635584
#if SQLITE_MAX_MMAP_SIZE>0
3558735585
winUnmapfile(pFile);
3558835586
#endif
3558935587
@@ -35608,11 +35606,12 @@
3560835606
#endif
3560935607
if( rc ){
3561035608
pFile->h = NULL;
3561135609
}
3561235610
OpenCounter(-1);
35613
- OSTRACE(("CLOSE file=%p, rc=%s\n", pFile->h, rc ? "ok" : "failed"));
35611
+ OSTRACE(("CLOSE pid=%lu, pFile=%p, file=%p, rc=%s\n",
35612
+ osGetCurrentProcessId(), pFile, pFile->h, rc ? "ok" : "failed"));
3561435613
return rc ? SQLITE_OK
3561535614
: winLogError(SQLITE_IOERR_CLOSE, osGetLastError(),
3561635615
"winClose", pFile->zPath);
3561735616
}
3561835617
@@ -35636,20 +35635,22 @@
3563635635
3563735636
assert( id!=0 );
3563835637
assert( amt>0 );
3563935638
assert( offset>=0 );
3564035639
SimulateIOError(return SQLITE_IOERR_READ);
35641
- OSTRACE(("READ file=%p, buffer=%p, amount=%d, offset=%lld, lock=%d\n",
35640
+ OSTRACE(("READ pid=%lu, pFile=%p, file=%p, buffer=%p, amount=%d, "
35641
+ "offset=%lld, lock=%d\n", osGetCurrentProcessId(), pFile,
3564235642
pFile->h, pBuf, amt, offset, pFile->locktype));
3564335643
3564435644
#if SQLITE_MAX_MMAP_SIZE>0
3564535645
/* Deal with as much of this read request as possible by transfering
3564635646
** data from the memory mapping using memcpy(). */
3564735647
if( offset<pFile->mmapSize ){
3564835648
if( offset+amt <= pFile->mmapSize ){
3564935649
memcpy(pBuf, &((u8 *)(pFile->pMapRegion))[offset], amt);
35650
- OSTRACE(("READ-MMAP file=%p, rc=SQLITE_OK\n", pFile->h));
35650
+ OSTRACE(("READ-MMAP pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n",
35651
+ osGetCurrentProcessId(), pFile, pFile->h));
3565135652
return SQLITE_OK;
3565235653
}else{
3565335654
int nCopy = (int)(pFile->mmapSize - offset);
3565435655
memcpy(pBuf, &((u8 *)(pFile->pMapRegion))[offset], nCopy);
3565535656
pBuf = &((u8 *)pBuf)[nCopy];
@@ -35659,11 +35660,12 @@
3565935660
}
3566035661
#endif
3566135662
3566235663
#if SQLITE_OS_WINCE || defined(SQLITE_WIN32_NO_OVERLAPPED)
3566335664
if( winSeekFile(pFile, offset) ){
35664
- OSTRACE(("READ file=%p, rc=SQLITE_FULL\n", pFile->h));
35665
+ OSTRACE(("READ pid=%lu, pFile=%p, file=%p, rc=SQLITE_FULL\n",
35666
+ osGetCurrentProcessId(), pFile, pFile->h));
3566535667
return SQLITE_FULL;
3566635668
}
3566735669
while( !osReadFile(pFile->h, pBuf, amt, &nRead, 0) ){
3566835670
#else
3566935671
memset(&overlapped, 0, sizeof(OVERLAPPED));
@@ -35673,23 +35675,26 @@
3567335675
osGetLastError()!=ERROR_HANDLE_EOF ){
3567435676
#endif
3567535677
DWORD lastErrno;
3567635678
if( winRetryIoerr(&nRetry, &lastErrno) ) continue;
3567735679
pFile->lastErrno = lastErrno;
35678
- OSTRACE(("READ file=%p, rc=SQLITE_IOERR_READ\n", pFile->h));
35680
+ OSTRACE(("READ pid=%lu, pFile=%p, file=%p, rc=SQLITE_IOERR_READ\n",
35681
+ osGetCurrentProcessId(), pFile, pFile->h));
3567935682
return winLogError(SQLITE_IOERR_READ, pFile->lastErrno,
3568035683
"winRead", pFile->zPath);
3568135684
}
35682
- winLogIoerr(nRetry);
35685
+ winLogIoerr(nRetry, __LINE__);
3568335686
if( nRead<(DWORD)amt ){
3568435687
/* Unread parts of the buffer must be zero-filled */
3568535688
memset(&((char*)pBuf)[nRead], 0, amt-nRead);
35686
- OSTRACE(("READ file=%p, rc=SQLITE_IOERR_SHORT_READ\n", pFile->h));
35689
+ OSTRACE(("READ pid=%lu, pFile=%p, file=%p, rc=SQLITE_IOERR_SHORT_READ\n",
35690
+ osGetCurrentProcessId(), pFile, pFile->h));
3568735691
return SQLITE_IOERR_SHORT_READ;
3568835692
}
3568935693
35690
- OSTRACE(("READ file=%p, rc=SQLITE_OK\n", pFile->h));
35694
+ OSTRACE(("READ pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n",
35695
+ osGetCurrentProcessId(), pFile, pFile->h));
3569135696
return SQLITE_OK;
3569235697
}
3569335698
3569435699
/*
3569535700
** Write data from a buffer into a file. Return SQLITE_OK on success
@@ -35708,20 +35713,22 @@
3570835713
assert( amt>0 );
3570935714
assert( pFile );
3571035715
SimulateIOError(return SQLITE_IOERR_WRITE);
3571135716
SimulateDiskfullError(return SQLITE_FULL);
3571235717
35713
- OSTRACE(("WRITE file=%p, buffer=%p, amount=%d, offset=%lld, lock=%d\n",
35718
+ OSTRACE(("WRITE pid=%lu, pFile=%p, file=%p, buffer=%p, amount=%d, "
35719
+ "offset=%lld, lock=%d\n", osGetCurrentProcessId(), pFile,
3571435720
pFile->h, pBuf, amt, offset, pFile->locktype));
3571535721
3571635722
#if SQLITE_MAX_MMAP_SIZE>0
3571735723
/* Deal with as much of this write request as possible by transfering
3571835724
** data from the memory mapping using memcpy(). */
3571935725
if( offset<pFile->mmapSize ){
3572035726
if( offset+amt <= pFile->mmapSize ){
3572135727
memcpy(&((u8 *)(pFile->pMapRegion))[offset], pBuf, amt);
35722
- OSTRACE(("WRITE-MMAP file=%p, rc=SQLITE_OK\n", pFile->h));
35728
+ OSTRACE(("WRITE-MMAP pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n",
35729
+ osGetCurrentProcessId(), pFile, pFile->h));
3572335730
return SQLITE_OK;
3572435731
}else{
3572535732
int nCopy = (int)(pFile->mmapSize - offset);
3572635733
memcpy(&((u8 *)(pFile->pMapRegion))[offset], pBuf, nCopy);
3572735734
pBuf = &((u8 *)pBuf)[nCopy];
@@ -35780,21 +35787,24 @@
3578035787
}
3578135788
3578235789
if( rc ){
3578335790
if( ( pFile->lastErrno==ERROR_HANDLE_DISK_FULL )
3578435791
|| ( pFile->lastErrno==ERROR_DISK_FULL )){
35785
- OSTRACE(("WRITE file=%p, rc=SQLITE_FULL\n", pFile->h));
35792
+ OSTRACE(("WRITE pid=%lu, pFile=%p, file=%p, rc=SQLITE_FULL\n",
35793
+ osGetCurrentProcessId(), pFile, pFile->h));
3578635794
return winLogError(SQLITE_FULL, pFile->lastErrno,
3578735795
"winWrite1", pFile->zPath);
3578835796
}
35789
- OSTRACE(("WRITE file=%p, rc=SQLITE_IOERR_WRITE\n", pFile->h));
35797
+ OSTRACE(("WRITE pid=%lu, pFile=%p, file=%p, rc=SQLITE_IOERR_WRITE\n",
35798
+ osGetCurrentProcessId(), pFile, pFile->h));
3579035799
return winLogError(SQLITE_IOERR_WRITE, pFile->lastErrno,
3579135800
"winWrite2", pFile->zPath);
3579235801
}else{
35793
- winLogIoerr(nRetry);
35802
+ winLogIoerr(nRetry, __LINE__);
3579435803
}
35795
- OSTRACE(("WRITE file=%p, rc=SQLITE_OK\n", pFile->h));
35804
+ OSTRACE(("WRITE pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n",
35805
+ osGetCurrentProcessId(), pFile, pFile->h));
3579635806
return SQLITE_OK;
3579735807
}
3579835808
3579935809
/*
3580035810
** Truncate an open file to a specified size
@@ -35804,12 +35814,12 @@
3580435814
int rc = SQLITE_OK; /* Return code for this function */
3580535815
DWORD lastErrno;
3580635816
3580735817
assert( pFile );
3580835818
SimulateIOError(return SQLITE_IOERR_TRUNCATE);
35809
- OSTRACE(("TRUNCATE file=%p, size=%lld, lock=%d\n",
35810
- pFile->h, nByte, pFile->locktype));
35819
+ OSTRACE(("TRUNCATE pid=%lu, pFile=%p, file=%p, size=%lld, lock=%d\n",
35820
+ osGetCurrentProcessId(), pFile, pFile->h, nByte, pFile->locktype));
3581135821
3581235822
/* If the user has configured a chunk-size for this file, truncate the
3581335823
** file so that it consists of an integer number of chunks (i.e. the
3581435824
** actual file size after the operation may be larger than the requested
3581535825
** size).
@@ -35837,11 +35847,12 @@
3583735847
if( pFile->pMapRegion && nByte<pFile->mmapSize ){
3583835848
pFile->mmapSize = nByte;
3583935849
}
3584035850
#endif
3584135851
35842
- OSTRACE(("TRUNCATE file=%p, rc=%s\n", pFile->h, sqlite3ErrName(rc)));
35852
+ OSTRACE(("TRUNCATE pid=%lu, pFile=%p, file=%p, rc=%s\n",
35853
+ osGetCurrentProcessId(), pFile, pFile->h, sqlite3ErrName(rc)));
3584335854
return rc;
3584435855
}
3584535856
3584635857
#ifdef SQLITE_TEST
3584735858
/*
@@ -35882,12 +35893,13 @@
3588235893
/* Unix cannot, but some systems may return SQLITE_FULL from here. This
3588335894
** line is to test that doing so does not cause any problems.
3588435895
*/
3588535896
SimulateDiskfullError( return SQLITE_FULL );
3588635897
35887
- OSTRACE(("SYNC file=%p, flags=%x, lock=%d\n",
35888
- pFile->h, flags, pFile->locktype));
35898
+ OSTRACE(("SYNC pid=%lu, pFile=%p, file=%p, flags=%x, lock=%d\n",
35899
+ osGetCurrentProcessId(), pFile, pFile->h, flags,
35900
+ pFile->locktype));
3588935901
3589035902
#ifndef SQLITE_TEST
3589135903
UNUSED_PARAMETER(flags);
3589235904
#else
3589335905
if( (flags&0x0F)==SQLITE_SYNC_FULL ){
@@ -35898,21 +35910,24 @@
3589835910
3589935911
/* If we compiled with the SQLITE_NO_SYNC flag, then syncing is a
3590035912
** no-op
3590135913
*/
3590235914
#ifdef SQLITE_NO_SYNC
35903
- OSTRACE(("SYNC-NOP file=%p, rc=SQLITE_OK\n", pFile->h));
35915
+ OSTRACE(("SYNC-NOP pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n",
35916
+ osGetCurrentProcessId(), pFile, pFile->h));
3590435917
return SQLITE_OK;
3590535918
#else
3590635919
rc = osFlushFileBuffers(pFile->h);
3590735920
SimulateIOError( rc=FALSE );
3590835921
if( rc ){
35909
- OSTRACE(("SYNC file=%p, rc=SQLITE_OK\n", pFile->h));
35922
+ OSTRACE(("SYNC pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n",
35923
+ osGetCurrentProcessId(), pFile, pFile->h));
3591035924
return SQLITE_OK;
3591135925
}else{
3591235926
pFile->lastErrno = osGetLastError();
35913
- OSTRACE(("SYNC file=%p, rc=SQLITE_IOERR_FSYNC\n", pFile->h));
35927
+ OSTRACE(("SYNC pid=%lu, pFile=%p, file=%p, rc=SQLITE_IOERR_FSYNC\n",
35928
+ osGetCurrentProcessId(), pFile, pFile->h));
3591435929
return winLogError(SQLITE_IOERR_FSYNC, pFile->lastErrno,
3591535930
"winSync", pFile->zPath);
3591635931
}
3591735932
#endif
3591835933
}
@@ -37881,11 +37896,11 @@
3788137896
winRetryIoerr(&cnt, &lastErrno) ){
3788237897
/* Noop */
3788337898
}
3788437899
}
3788537900
#endif
37886
- winLogIoerr(cnt);
37901
+ winLogIoerr(cnt, __LINE__);
3788737902
3788837903
OSTRACE(("OPEN file=%p, name=%s, access=%lx, rc=%s\n", h, zUtf8Name,
3788937904
dwDesiredAccess, (h==INVALID_HANDLE_VALUE) ? "failed" : "ok"));
3789037905
3789137906
if( h==INVALID_HANDLE_VALUE ){
@@ -38065,11 +38080,11 @@
3806538080
}
3806638081
#endif
3806738082
if( rc && rc!=SQLITE_IOERR_DELETE_NOENT ){
3806838083
rc = winLogError(SQLITE_IOERR_DELETE, lastErrno, "winDelete", zFilename);
3806938084
}else{
38070
- winLogIoerr(cnt);
38085
+ winLogIoerr(cnt, __LINE__);
3807138086
}
3807238087
sqlite3_free(zConverted);
3807338088
OSTRACE(("DELETE name=%s, rc=%s\n", zFilename, sqlite3ErrName(rc)));
3807438089
return rc;
3807538090
}
@@ -38115,11 +38130,11 @@
3811538130
attr = INVALID_FILE_ATTRIBUTES;
3811638131
}else{
3811738132
attr = sAttrData.dwFileAttributes;
3811838133
}
3811938134
}else{
38120
- winLogIoerr(cnt);
38135
+ winLogIoerr(cnt, __LINE__);
3812138136
if( lastErrno!=ERROR_FILE_NOT_FOUND && lastErrno!=ERROR_PATH_NOT_FOUND ){
3812238137
sqlite3_free(zConverted);
3812338138
return winLogError(SQLITE_IOERR_ACCESS, lastErrno, "winAccess",
3812438139
zFilename);
3812538140
}else{
@@ -38630,11 +38645,11 @@
3863038645
}
3863138646
3863238647
/*
3863338648
** Initialize and deinitialize the operating system interface.
3863438649
*/
38635
-SQLITE_API int sqlite3_os_init(void){
38650
+SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void){
3863638651
static sqlite3_vfs winVfs = {
3863738652
3, /* iVersion */
3863838653
sizeof(winFile), /* szOsFile */
3863938654
SQLITE_WIN32_MAX_PATH_BYTES, /* mxPathname */
3864038655
0, /* pNext */
@@ -38705,11 +38720,11 @@
3870538720
#endif
3870638721
3870738722
return SQLITE_OK;
3870838723
}
3870938724
38710
-SQLITE_API int sqlite3_os_end(void){
38725
+SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void){
3871138726
#if SQLITE_OS_WINRT
3871238727
if( sleepObj!=NULL ){
3871338728
osCloseHandle(sleepObj);
3871438729
sleepObj = NULL;
3871538730
}
@@ -53006,11 +53021,11 @@
5300653021
**
5300753022
** This routine has no effect on existing database connections.
5300853023
** The shared cache setting effects only future calls to
5300953024
** sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2().
5301053025
*/
53011
-SQLITE_API int sqlite3_enable_shared_cache(int enable){
53026
+SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int enable){
5301253027
sqlite3GlobalConfig.sharedCacheEnabled = enable;
5301353028
return SQLITE_OK;
5301453029
}
5301553030
#endif
5301653031
@@ -53520,14 +53535,19 @@
5352053535
** prior to calling this routine.
5352153536
*/
5352253537
static int saveCursorPosition(BtCursor *pCur){
5352353538
int rc;
5352453539
53525
- assert( CURSOR_VALID==pCur->eState );
53540
+ assert( CURSOR_VALID==pCur->eState || CURSOR_SKIPNEXT==pCur->eState );
5352653541
assert( 0==pCur->pKey );
5352753542
assert( cursorHoldsMutex(pCur) );
5352853543
53544
+ if( pCur->eState==CURSOR_SKIPNEXT ){
53545
+ pCur->eState = CURSOR_VALID;
53546
+ }else{
53547
+ pCur->skipNext = 0;
53548
+ }
5352953549
rc = sqlite3BtreeKeySize(pCur, &pCur->nKey);
5353053550
assert( rc==SQLITE_OK ); /* KeySize() cannot fail */
5353153551
5353253552
/* If this is an intKey table, then the above call to BtreeKeySize()
5353353553
** stores the integer key in pCur->nKey. In this case this value is
@@ -53594,11 +53614,11 @@
5359453614
Pgno iRoot, /* Only save cursor with this iRoot. Save all if zero */
5359553615
BtCursor *pExcept /* Do not save this cursor */
5359653616
){
5359753617
do{
5359853618
if( p!=pExcept && (0==iRoot || p->pgnoRoot==iRoot) ){
53599
- if( p->eState==CURSOR_VALID ){
53619
+ if( p->eState==CURSOR_VALID || p->eState==CURSOR_SKIPNEXT ){
5360053620
int rc = saveCursorPosition(p);
5360153621
if( SQLITE_OK!=rc ){
5360253622
return rc;
5360353623
}
5360453624
}else{
@@ -53666,21 +53686,23 @@
5366653686
** at most one effective restoreCursorPosition() call after each
5366753687
** saveCursorPosition().
5366853688
*/
5366953689
static int btreeRestoreCursorPosition(BtCursor *pCur){
5367053690
int rc;
53691
+ int skipNext;
5367153692
assert( cursorHoldsMutex(pCur) );
5367253693
assert( pCur->eState>=CURSOR_REQUIRESEEK );
5367353694
if( pCur->eState==CURSOR_FAULT ){
5367453695
return pCur->skipNext;
5367553696
}
5367653697
pCur->eState = CURSOR_INVALID;
53677
- rc = btreeMoveto(pCur, pCur->pKey, pCur->nKey, 0, &pCur->skipNext);
53698
+ rc = btreeMoveto(pCur, pCur->pKey, pCur->nKey, 0, &skipNext);
5367853699
if( rc==SQLITE_OK ){
5367953700
sqlite3_free(pCur->pKey);
5368053701
pCur->pKey = 0;
5368153702
assert( pCur->eState==CURSOR_VALID || pCur->eState==CURSOR_INVALID );
53703
+ pCur->skipNext |= skipNext;
5368253704
if( pCur->skipNext && pCur->eState==CURSOR_VALID ){
5368353705
pCur->eState = CURSOR_SKIPNEXT;
5368453706
}
5368553707
}
5368653708
return rc;
@@ -53728,13 +53750,14 @@
5372853750
rc = restoreCursorPosition(pCur);
5372953751
if( rc ){
5373053752
*pDifferentRow = 1;
5373153753
return rc;
5373253754
}
53733
- if( pCur->eState!=CURSOR_VALID || NEVER(pCur->skipNext!=0) ){
53755
+ if( pCur->eState!=CURSOR_VALID ){
5373453756
*pDifferentRow = 1;
5373553757
}else{
53758
+ assert( pCur->skipNext==0 );
5373653759
*pDifferentRow = 0;
5373753760
}
5373853761
return SQLITE_OK;
5373953762
}
5374053763
@@ -56545,11 +56568,11 @@
5654556568
if( pBtree ){
5654656569
sqlite3BtreeEnter(pBtree);
5654756570
for(p=pBtree->pBt->pCursor; p; p=p->pNext){
5654856571
int i;
5654956572
if( writeOnly && (p->curFlags & BTCF_WriteFlag)==0 ){
56550
- if( p->eState==CURSOR_VALID ){
56573
+ if( p->eState==CURSOR_VALID || p->eState==CURSOR_SKIPNEXT ){
5655156574
rc = saveCursorPosition(p);
5655256575
if( rc!=SQLITE_OK ){
5655356576
(void)sqlite3BtreeTripAllCursors(pBtree, rc, 0);
5655456577
break;
5655556578
}
@@ -56951,10 +56974,12 @@
5695156974
** to return an integer result code for historical reasons.
5695256975
*/
5695356976
SQLITE_PRIVATE int sqlite3BtreeDataSize(BtCursor *pCur, u32 *pSize){
5695456977
assert( cursorHoldsMutex(pCur) );
5695556978
assert( pCur->eState==CURSOR_VALID );
56979
+ assert( pCur->iPage>=0 );
56980
+ assert( pCur->iPage<BTCURSOR_MAX_DEPTH );
5695656981
assert( pCur->apPage[pCur->iPage]->intKeyLeaf==1 );
5695756982
getCellInfo(pCur);
5695856983
*pSize = pCur->info.nPayload;
5695956984
return SQLITE_OK;
5696056985
}
@@ -57429,19 +57454,21 @@
5742957454
return SQLITE_CORRUPT_BKPT;
5743057455
}
5743157456
return SQLITE_OK;
5743257457
}
5743357458
57434
-#if 0
57459
+#if SQLITE_DEBUG
5743557460
/*
5743657461
** Page pParent is an internal (non-leaf) tree page. This function
5743757462
** asserts that page number iChild is the left-child if the iIdx'th
5743857463
** cell in page pParent. Or, if iIdx is equal to the total number of
5743957464
** cells in pParent, that page number iChild is the right-child of
5744057465
** the page.
5744157466
*/
5744257467
static void assertParentIndex(MemPage *pParent, int iIdx, Pgno iChild){
57468
+ if( CORRUPT_DB ) return; /* The conditions tested below might not be true
57469
+ ** in a corrupt database */
5744357470
assert( iIdx<=pParent->nCell );
5744457471
if( iIdx==pParent->nCell ){
5744557472
assert( get4byte(&pParent->aData[pParent->hdrOffset+8])==iChild );
5744657473
}else{
5744757474
assert( get4byte(findCell(pParent, iIdx))==iChild );
@@ -57462,23 +57489,15 @@
5746257489
static void moveToParent(BtCursor *pCur){
5746357490
assert( cursorHoldsMutex(pCur) );
5746457491
assert( pCur->eState==CURSOR_VALID );
5746557492
assert( pCur->iPage>0 );
5746657493
assert( pCur->apPage[pCur->iPage] );
57467
-
57468
- /* UPDATE: It is actually possible for the condition tested by the assert
57469
- ** below to be untrue if the database file is corrupt. This can occur if
57470
- ** one cursor has modified page pParent while a reference to it is held
57471
- ** by a second cursor. Which can only happen if a single page is linked
57472
- ** into more than one b-tree structure in a corrupt database. */
57473
-#if 0
5747457494
assertParentIndex(
5747557495
pCur->apPage[pCur->iPage-1],
5747657496
pCur->aiIdx[pCur->iPage-1],
5747757497
pCur->apPage[pCur->iPage]->pgno
5747857498
);
57479
-#endif
5748057499
testcase( pCur->aiIdx[pCur->iPage-1] > pCur->apPage[pCur->iPage-1]->nCell );
5748157500
5748257501
releasePage(pCur->apPage[pCur->iPage]);
5748357502
pCur->iPage--;
5748457503
pCur->info.nSize = 0;
@@ -60422,10 +60441,11 @@
6042260441
pPage->nOverflow = 0;
6042360442
6042460443
/* The next iteration of the do-loop balances the parent page. */
6042560444
releasePage(pPage);
6042660445
pCur->iPage--;
60446
+ assert( pCur->iPage>=0 );
6042760447
}
6042860448
}while( rc==SQLITE_OK );
6042960449
6043060450
if( pFree ){
6043160451
sqlite3PageFree(pFree);
@@ -60893,29 +60913,32 @@
6089360913
int rc;
6089460914
unsigned char *pCell;
6089560915
int i;
6089660916
int hdr;
6089760917
u16 szCell;
60918
+ u8 hasChildren;
6089860919
6089960920
assert( sqlite3_mutex_held(pBt->mutex) );
6090060921
if( pgno>btreePagecount(pBt) ){
6090160922
return SQLITE_CORRUPT_BKPT;
6090260923
}
6090360924
6090460925
rc = getAndInitPage(pBt, pgno, &pPage, 0);
6090560926
if( rc ) return rc;
60927
+ hasChildren = !pPage->leaf;
60928
+ pPage->leaf = 1; /* Block looping if the database is corrupt */
6090660929
hdr = pPage->hdrOffset;
6090760930
for(i=0; i<pPage->nCell; i++){
6090860931
pCell = findCell(pPage, i);
60909
- if( !pPage->leaf ){
60932
+ if( hasChildren ){
6091060933
rc = clearDatabasePage(pBt, get4byte(pCell), 1, pnChange);
6091160934
if( rc ) goto cleardatabasepage_out;
6091260935
}
6091360936
rc = clearCell(pPage, pCell, &szCell);
6091460937
if( rc ) goto cleardatabasepage_out;
6091560938
}
60916
- if( !pPage->leaf ){
60939
+ if( hasChildren ){
6091760940
rc = clearDatabasePage(pBt, get4byte(&pPage->aData[hdr+8]), 1, pnChange);
6091860941
if( rc ) goto cleardatabasepage_out;
6091960942
}else if( pnChange ){
6092060943
assert( pPage->intKey );
6092160944
*pnChange += pPage->nCell;
@@ -62239,11 +62262,11 @@
6223962262
** a pointer to the new sqlite3_backup object.
6224062263
**
6224162264
** If an error occurs, NULL is returned and an error code and error message
6224262265
** stored in database handle pDestDb.
6224362266
*/
62244
-SQLITE_API sqlite3_backup *sqlite3_backup_init(
62267
+SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
6224562268
sqlite3* pDestDb, /* Database to write to */
6224662269
const char *zDestDb, /* Name of database within pDestDb */
6224762270
sqlite3* pSrcDb, /* Database connection to read from */
6224862271
const char *zSrcDb /* Name of database within pSrcDb */
6224962272
){
@@ -62447,11 +62470,11 @@
6244762470
}
6244862471
6244962472
/*
6245062473
** Copy nPage pages from the source b-tree to the destination.
6245162474
*/
62452
-SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){
62475
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage){
6245362476
int rc;
6245462477
int destMode; /* Destination journal mode */
6245562478
int pgszSrc = 0; /* Source page size */
6245662479
int pgszDest = 0; /* Destination page size */
6245762480
@@ -62692,11 +62715,11 @@
6269262715
}
6269362716
6269462717
/*
6269562718
** Release all resources associated with an sqlite3_backup* handle.
6269662719
*/
62697
-SQLITE_API int sqlite3_backup_finish(sqlite3_backup *p){
62720
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p){
6269862721
sqlite3_backup **pp; /* Ptr to head of pagers backup list */
6269962722
sqlite3 *pSrcDb; /* Source database connection */
6270062723
int rc; /* Value to return */
6270162724
6270262725
/* Enter the mutexes */
@@ -62744,11 +62767,11 @@
6274462767
6274562768
/*
6274662769
** Return the number of pages still to be backed up as of the most recent
6274762770
** call to sqlite3_backup_step().
6274862771
*/
62749
-SQLITE_API int sqlite3_backup_remaining(sqlite3_backup *p){
62772
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p){
6275062773
#ifdef SQLITE_ENABLE_API_ARMOR
6275162774
if( p==0 ){
6275262775
(void)SQLITE_MISUSE_BKPT;
6275362776
return 0;
6275462777
}
@@ -62758,11 +62781,11 @@
6275862781
6275962782
/*
6276062783
** Return the total number of pages in the source database as of the most
6276162784
** recent call to sqlite3_backup_step().
6276262785
*/
62763
-SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p){
62786
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p){
6276462787
#ifdef SQLITE_ENABLE_API_ARMOR
6276562788
if( p==0 ){
6276662789
(void)SQLITE_MISUSE_BKPT;
6276762790
return 0;
6276862791
}
@@ -64633,11 +64656,11 @@
6463364656
}
6463464657
6463564658
/*
6463664659
** Return the SQL associated with a prepared statement
6463764660
*/
64638
-SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt){
64661
+SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt){
6463964662
Vdbe *p = (Vdbe *)pStmt;
6464064663
return (p && p->isPrepareV2) ? p->zSql : 0;
6464164664
}
6464264665
6464364666
/*
@@ -68789,11 +68812,11 @@
6878968812
** execution environment changes in a way that would alter the program
6879068813
** that sqlite3_prepare() generates. For example, if new functions or
6879168814
** collating sequences are registered or if an authorizer function is
6879268815
** added or changed.
6879368816
*/
68794
-SQLITE_API int sqlite3_expired(sqlite3_stmt *pStmt){
68817
+SQLITE_API int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt *pStmt){
6879568818
Vdbe *p = (Vdbe*)pStmt;
6879668819
return p==0 || p->expired;
6879768820
}
6879868821
#endif
6879968822
@@ -68826,11 +68849,11 @@
6882668849
** machine.
6882768850
**
6882868851
** This routine sets the error code and string returned by
6882968852
** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
6883068853
*/
68831
-SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt){
68854
+SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt){
6883268855
int rc;
6883368856
if( pStmt==0 ){
6883468857
/* IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL
6883568858
** pointer is a harmless no-op. */
6883668859
rc = SQLITE_OK;
@@ -68852,11 +68875,11 @@
6885268875
** the prior execution is returned.
6885368876
**
6885468877
** This routine sets the error code and string returned by
6885568878
** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
6885668879
*/
68857
-SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt){
68880
+SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt){
6885868881
int rc;
6885968882
if( pStmt==0 ){
6886068883
rc = SQLITE_OK;
6886168884
}else{
6886268885
Vdbe *v = (Vdbe*)pStmt;
@@ -68871,11 +68894,11 @@
6887168894
}
6887268895
6887368896
/*
6887468897
** Set all the parameters in the compiled SQL statement to NULL.
6887568898
*/
68876
-SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt *pStmt){
68899
+SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt *pStmt){
6887768900
int i;
6887868901
int rc = SQLITE_OK;
6887968902
Vdbe *p = (Vdbe*)pStmt;
6888068903
#if SQLITE_THREADSAFE
6888168904
sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex;
@@ -68895,54 +68918,54 @@
6889568918
6889668919
/**************************** sqlite3_value_ *******************************
6889768920
** The following routines extract information from a Mem or sqlite3_value
6889868921
** structure.
6889968922
*/
68900
-SQLITE_API const void *sqlite3_value_blob(sqlite3_value *pVal){
68923
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value *pVal){
6890168924
Mem *p = (Mem*)pVal;
6890268925
if( p->flags & (MEM_Blob|MEM_Str) ){
6890368926
sqlite3VdbeMemExpandBlob(p);
6890468927
p->flags |= MEM_Blob;
6890568928
return p->n ? p->z : 0;
6890668929
}else{
6890768930
return sqlite3_value_text(pVal);
6890868931
}
6890968932
}
68910
-SQLITE_API int sqlite3_value_bytes(sqlite3_value *pVal){
68933
+SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value *pVal){
6891168934
return sqlite3ValueBytes(pVal, SQLITE_UTF8);
6891268935
}
68913
-SQLITE_API int sqlite3_value_bytes16(sqlite3_value *pVal){
68936
+SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value *pVal){
6891468937
return sqlite3ValueBytes(pVal, SQLITE_UTF16NATIVE);
6891568938
}
68916
-SQLITE_API double sqlite3_value_double(sqlite3_value *pVal){
68939
+SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value *pVal){
6891768940
return sqlite3VdbeRealValue((Mem*)pVal);
6891868941
}
68919
-SQLITE_API int sqlite3_value_int(sqlite3_value *pVal){
68942
+SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value *pVal){
6892068943
return (int)sqlite3VdbeIntValue((Mem*)pVal);
6892168944
}
68922
-SQLITE_API sqlite_int64 sqlite3_value_int64(sqlite3_value *pVal){
68945
+SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value *pVal){
6892368946
return sqlite3VdbeIntValue((Mem*)pVal);
6892468947
}
68925
-SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value *pVal){
68948
+SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value *pVal){
6892668949
return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
6892768950
}
6892868951
#ifndef SQLITE_OMIT_UTF16
68929
-SQLITE_API const void *sqlite3_value_text16(sqlite3_value* pVal){
68952
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value* pVal){
6893068953
return sqlite3ValueText(pVal, SQLITE_UTF16NATIVE);
6893168954
}
68932
-SQLITE_API const void *sqlite3_value_text16be(sqlite3_value *pVal){
68955
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value *pVal){
6893368956
return sqlite3ValueText(pVal, SQLITE_UTF16BE);
6893468957
}
68935
-SQLITE_API const void *sqlite3_value_text16le(sqlite3_value *pVal){
68958
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value *pVal){
6893668959
return sqlite3ValueText(pVal, SQLITE_UTF16LE);
6893768960
}
6893868961
#endif /* SQLITE_OMIT_UTF16 */
6893968962
/* EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five
6894068963
** fundamental datatypes: 64-bit signed integer 64-bit IEEE floating
6894168964
** point number string BLOB NULL
6894268965
*/
68943
-SQLITE_API int sqlite3_value_type(sqlite3_value* pVal){
68966
+SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value* pVal){
6894468967
static const u8 aType[] = {
6894568968
SQLITE_BLOB, /* 0x00 */
6894668969
SQLITE_NULL, /* 0x01 */
6894768970
SQLITE_TEXT, /* 0x02 */
6894868971
SQLITE_NULL, /* 0x03 */
@@ -69014,21 +69037,21 @@
6901469037
xDel((void*)p);
6901569038
}
6901669039
if( pCtx ) sqlite3_result_error_toobig(pCtx);
6901769040
return SQLITE_TOOBIG;
6901869041
}
69019
-SQLITE_API void sqlite3_result_blob(
69042
+SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(
6902069043
sqlite3_context *pCtx,
6902169044
const void *z,
6902269045
int n,
6902369046
void (*xDel)(void *)
6902469047
){
6902569048
assert( n>=0 );
6902669049
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
6902769050
setResultStrOrError(pCtx, z, n, 0, xDel);
6902869051
}
69029
-SQLITE_API void sqlite3_result_blob64(
69052
+SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(
6903069053
sqlite3_context *pCtx,
6903169054
const void *z,
6903269055
sqlite3_uint64 n,
6903369056
void (*xDel)(void *)
6903469057
){
@@ -69038,50 +69061,50 @@
6903869061
(void)invokeValueDestructor(z, xDel, pCtx);
6903969062
}else{
6904069063
setResultStrOrError(pCtx, z, (int)n, 0, xDel);
6904169064
}
6904269065
}
69043
-SQLITE_API void sqlite3_result_double(sqlite3_context *pCtx, double rVal){
69066
+SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context *pCtx, double rVal){
6904469067
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
6904569068
sqlite3VdbeMemSetDouble(pCtx->pOut, rVal);
6904669069
}
69047
-SQLITE_API void sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
69070
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
6904869071
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
6904969072
pCtx->isError = SQLITE_ERROR;
6905069073
pCtx->fErrorOrAux = 1;
6905169074
sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF8, SQLITE_TRANSIENT);
6905269075
}
6905369076
#ifndef SQLITE_OMIT_UTF16
69054
-SQLITE_API void sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){
69077
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){
6905569078
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
6905669079
pCtx->isError = SQLITE_ERROR;
6905769080
pCtx->fErrorOrAux = 1;
6905869081
sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF16NATIVE, SQLITE_TRANSIENT);
6905969082
}
6906069083
#endif
69061
-SQLITE_API void sqlite3_result_int(sqlite3_context *pCtx, int iVal){
69084
+SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context *pCtx, int iVal){
6906269085
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
6906369086
sqlite3VdbeMemSetInt64(pCtx->pOut, (i64)iVal);
6906469087
}
69065
-SQLITE_API void sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
69088
+SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
6906669089
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
6906769090
sqlite3VdbeMemSetInt64(pCtx->pOut, iVal);
6906869091
}
69069
-SQLITE_API void sqlite3_result_null(sqlite3_context *pCtx){
69092
+SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context *pCtx){
6907069093
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
6907169094
sqlite3VdbeMemSetNull(pCtx->pOut);
6907269095
}
69073
-SQLITE_API void sqlite3_result_text(
69096
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text(
6907469097
sqlite3_context *pCtx,
6907569098
const char *z,
6907669099
int n,
6907769100
void (*xDel)(void *)
6907869101
){
6907969102
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
6908069103
setResultStrOrError(pCtx, z, n, SQLITE_UTF8, xDel);
6908169104
}
69082
-SQLITE_API void sqlite3_result_text64(
69105
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(
6908369106
sqlite3_context *pCtx,
6908469107
const char *z,
6908569108
sqlite3_uint64 n,
6908669109
void (*xDel)(void *),
6908769110
unsigned char enc
@@ -69094,47 +69117,47 @@
6909469117
}else{
6909569118
setResultStrOrError(pCtx, z, (int)n, enc, xDel);
6909669119
}
6909769120
}
6909869121
#ifndef SQLITE_OMIT_UTF16
69099
-SQLITE_API void sqlite3_result_text16(
69122
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(
6910069123
sqlite3_context *pCtx,
6910169124
const void *z,
6910269125
int n,
6910369126
void (*xDel)(void *)
6910469127
){
6910569128
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
6910669129
setResultStrOrError(pCtx, z, n, SQLITE_UTF16NATIVE, xDel);
6910769130
}
69108
-SQLITE_API void sqlite3_result_text16be(
69131
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(
6910969132
sqlite3_context *pCtx,
6911069133
const void *z,
6911169134
int n,
6911269135
void (*xDel)(void *)
6911369136
){
6911469137
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
6911569138
setResultStrOrError(pCtx, z, n, SQLITE_UTF16BE, xDel);
6911669139
}
69117
-SQLITE_API void sqlite3_result_text16le(
69140
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(
6911869141
sqlite3_context *pCtx,
6911969142
const void *z,
6912069143
int n,
6912169144
void (*xDel)(void *)
6912269145
){
6912369146
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
6912469147
setResultStrOrError(pCtx, z, n, SQLITE_UTF16LE, xDel);
6912569148
}
6912669149
#endif /* SQLITE_OMIT_UTF16 */
69127
-SQLITE_API void sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){
69150
+SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){
6912869151
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
6912969152
sqlite3VdbeMemCopy(pCtx->pOut, pValue);
6913069153
}
69131
-SQLITE_API void sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){
69154
+SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){
6913269155
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
6913369156
sqlite3VdbeMemSetZeroBlob(pCtx->pOut, n);
6913469157
}
69135
-SQLITE_API void sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){
69158
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){
6913669159
pCtx->isError = errCode;
6913769160
pCtx->fErrorOrAux = 1;
6913869161
#ifdef SQLITE_DEBUG
6913969162
if( pCtx->pVdbe ) pCtx->pVdbe->rcApp = errCode;
6914069163
#endif
@@ -69143,20 +69166,20 @@
6914369166
SQLITE_UTF8, SQLITE_STATIC);
6914469167
}
6914569168
}
6914669169
6914769170
/* Force an SQLITE_TOOBIG error. */
69148
-SQLITE_API void sqlite3_result_error_toobig(sqlite3_context *pCtx){
69171
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context *pCtx){
6914969172
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
6915069173
pCtx->isError = SQLITE_TOOBIG;
6915169174
pCtx->fErrorOrAux = 1;
6915269175
sqlite3VdbeMemSetStr(pCtx->pOut, "string or blob too big", -1,
6915369176
SQLITE_UTF8, SQLITE_STATIC);
6915469177
}
6915569178
6915669179
/* An SQLITE_NOMEM error. */
69157
-SQLITE_API void sqlite3_result_error_nomem(sqlite3_context *pCtx){
69180
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context *pCtx){
6915869181
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
6915969182
sqlite3VdbeMemSetNull(pCtx->pOut);
6916069183
pCtx->isError = SQLITE_NOMEM;
6916169184
pCtx->fErrorOrAux = 1;
6916269185
pCtx->pOut->db->mallocFailed = 1;
@@ -69325,11 +69348,11 @@
6932569348
/*
6932669349
** This is the top-level implementation of sqlite3_step(). Call
6932769350
** sqlite3Step() to do most of the work. If a schema error occurs,
6932869351
** call sqlite3Reprepare() and try again.
6932969352
*/
69330
-SQLITE_API int sqlite3_step(sqlite3_stmt *pStmt){
69353
+SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt *pStmt){
6933169354
int rc = SQLITE_OK; /* Result from sqlite3Step() */
6933269355
int rc2 = SQLITE_OK; /* Result from sqlite3Reprepare() */
6933369356
Vdbe *v = (Vdbe*)pStmt; /* the prepared statement */
6933469357
int cnt = 0; /* Counter to prevent infinite loop of reprepares */
6933569358
sqlite3 *db; /* The database connection */
@@ -69376,11 +69399,11 @@
6937669399
6937769400
/*
6937869401
** Extract the user data from a sqlite3_context structure and return a
6937969402
** pointer to it.
6938069403
*/
69381
-SQLITE_API void *sqlite3_user_data(sqlite3_context *p){
69404
+SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context *p){
6938269405
assert( p && p->pFunc );
6938369406
return p->pFunc->pUserData;
6938469407
}
6938569408
6938669409
/*
@@ -69391,11 +69414,11 @@
6939169414
** returns a copy of the pointer to the database connection (the 1st
6939269415
** parameter) of the sqlite3_create_function() and
6939369416
** sqlite3_create_function16() routines that originally registered the
6939469417
** application defined function.
6939569418
*/
69396
-SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context *p){
69419
+SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context *p){
6939769420
assert( p && p->pFunc );
6939869421
return p->pOut->db;
6939969422
}
6940069423
6940169424
/*
@@ -69467,11 +69490,11 @@
6946769490
/*
6946869491
** Allocate or return the aggregate context for a user function. A new
6946969492
** context is allocated on the first call. Subsequent calls return the
6947069493
** same context that was returned on prior calls.
6947169494
*/
69472
-SQLITE_API void *sqlite3_aggregate_context(sqlite3_context *p, int nByte){
69495
+SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context *p, int nByte){
6947369496
assert( p && p->pFunc && p->pFunc->xStep );
6947469497
assert( sqlite3_mutex_held(p->pOut->db->mutex) );
6947569498
testcase( nByte<0 );
6947669499
if( (p->pMem->flags & MEM_Agg)==0 ){
6947769500
return createAggContext(p, nByte);
@@ -69482,11 +69505,11 @@
6948269505
6948369506
/*
6948469507
** Return the auxiliary data pointer, if any, for the iArg'th argument to
6948569508
** the user-function defined by pCtx.
6948669509
*/
69487
-SQLITE_API void *sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
69510
+SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
6948869511
AuxData *pAuxData;
6948969512
6949069513
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
6949169514
#if SQLITE_ENABLE_STAT3_OR_STAT4
6949269515
if( pCtx->pVdbe==0 ) return 0;
@@ -69503,11 +69526,11 @@
6950369526
/*
6950469527
** Set the auxiliary data pointer and delete function, for the iArg'th
6950569528
** argument to the user-function defined by pCtx. Any previous value is
6950669529
** deleted by calling the delete function specified when it was set.
6950769530
*/
69508
-SQLITE_API void sqlite3_set_auxdata(
69531
+SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(
6950969532
sqlite3_context *pCtx,
6951069533
int iArg,
6951169534
void *pAux,
6951269535
void (*xDelete)(void*)
6951369536
){
@@ -69558,29 +69581,29 @@
6955869581
** This function is deprecated. Do not use it for new code. It is
6955969582
** provide only to avoid breaking legacy code. New aggregate function
6956069583
** implementations should keep their own counts within their aggregate
6956169584
** context.
6956269585
*/
69563
-SQLITE_API int sqlite3_aggregate_count(sqlite3_context *p){
69586
+SQLITE_API int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context *p){
6956469587
assert( p && p->pMem && p->pFunc && p->pFunc->xStep );
6956569588
return p->pMem->n;
6956669589
}
6956769590
#endif
6956869591
6956969592
/*
6957069593
** Return the number of columns in the result set for the statement pStmt.
6957169594
*/
69572
-SQLITE_API int sqlite3_column_count(sqlite3_stmt *pStmt){
69595
+SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt){
6957369596
Vdbe *pVm = (Vdbe *)pStmt;
6957469597
return pVm ? pVm->nResColumn : 0;
6957569598
}
6957669599
6957769600
/*
6957869601
** Return the number of values available from the current row of the
6957969602
** currently executing statement pStmt.
6958069603
*/
69581
-SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt){
69604
+SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt){
6958269605
Vdbe *pVm = (Vdbe *)pStmt;
6958369606
if( pVm==0 || pVm->pResultSet==0 ) return 0;
6958469607
return pVm->nResColumn;
6958569608
}
6958669609
@@ -69678,67 +69701,67 @@
6967869701
6967969702
/**************************** sqlite3_column_ *******************************
6968069703
** The following routines are used to access elements of the current row
6968169704
** in the result set.
6968269705
*/
69683
-SQLITE_API const void *sqlite3_column_blob(sqlite3_stmt *pStmt, int i){
69706
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt *pStmt, int i){
6968469707
const void *val;
6968569708
val = sqlite3_value_blob( columnMem(pStmt,i) );
6968669709
/* Even though there is no encoding conversion, value_blob() might
6968769710
** need to call malloc() to expand the result of a zeroblob()
6968869711
** expression.
6968969712
*/
6969069713
columnMallocFailure(pStmt);
6969169714
return val;
6969269715
}
69693
-SQLITE_API int sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){
69716
+SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){
6969469717
int val = sqlite3_value_bytes( columnMem(pStmt,i) );
6969569718
columnMallocFailure(pStmt);
6969669719
return val;
6969769720
}
69698
-SQLITE_API int sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){
69721
+SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){
6969969722
int val = sqlite3_value_bytes16( columnMem(pStmt,i) );
6970069723
columnMallocFailure(pStmt);
6970169724
return val;
6970269725
}
69703
-SQLITE_API double sqlite3_column_double(sqlite3_stmt *pStmt, int i){
69726
+SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt *pStmt, int i){
6970469727
double val = sqlite3_value_double( columnMem(pStmt,i) );
6970569728
columnMallocFailure(pStmt);
6970669729
return val;
6970769730
}
69708
-SQLITE_API int sqlite3_column_int(sqlite3_stmt *pStmt, int i){
69731
+SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt *pStmt, int i){
6970969732
int val = sqlite3_value_int( columnMem(pStmt,i) );
6971069733
columnMallocFailure(pStmt);
6971169734
return val;
6971269735
}
69713
-SQLITE_API sqlite_int64 sqlite3_column_int64(sqlite3_stmt *pStmt, int i){
69736
+SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt *pStmt, int i){
6971469737
sqlite_int64 val = sqlite3_value_int64( columnMem(pStmt,i) );
6971569738
columnMallocFailure(pStmt);
6971669739
return val;
6971769740
}
69718
-SQLITE_API const unsigned char *sqlite3_column_text(sqlite3_stmt *pStmt, int i){
69741
+SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt *pStmt, int i){
6971969742
const unsigned char *val = sqlite3_value_text( columnMem(pStmt,i) );
6972069743
columnMallocFailure(pStmt);
6972169744
return val;
6972269745
}
69723
-SQLITE_API sqlite3_value *sqlite3_column_value(sqlite3_stmt *pStmt, int i){
69746
+SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt *pStmt, int i){
6972469747
Mem *pOut = columnMem(pStmt, i);
6972569748
if( pOut->flags&MEM_Static ){
6972669749
pOut->flags &= ~MEM_Static;
6972769750
pOut->flags |= MEM_Ephem;
6972869751
}
6972969752
columnMallocFailure(pStmt);
6973069753
return (sqlite3_value *)pOut;
6973169754
}
6973269755
#ifndef SQLITE_OMIT_UTF16
69733
-SQLITE_API const void *sqlite3_column_text16(sqlite3_stmt *pStmt, int i){
69756
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt *pStmt, int i){
6973469757
const void *val = sqlite3_value_text16( columnMem(pStmt,i) );
6973569758
columnMallocFailure(pStmt);
6973669759
return val;
6973769760
}
6973869761
#endif /* SQLITE_OMIT_UTF16 */
69739
-SQLITE_API int sqlite3_column_type(sqlite3_stmt *pStmt, int i){
69762
+SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt *pStmt, int i){
6974069763
int iType = sqlite3_value_type( columnMem(pStmt,i) );
6974169764
columnMallocFailure(pStmt);
6974269765
return iType;
6974369766
}
6974469767
@@ -69798,16 +69821,16 @@
6979869821
6979969822
/*
6980069823
** Return the name of the Nth column of the result set returned by SQL
6980169824
** statement pStmt.
6980269825
*/
69803
-SQLITE_API const char *sqlite3_column_name(sqlite3_stmt *pStmt, int N){
69826
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt *pStmt, int N){
6980469827
return columnName(
6980569828
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_NAME);
6980669829
}
6980769830
#ifndef SQLITE_OMIT_UTF16
69808
-SQLITE_API const void *sqlite3_column_name16(sqlite3_stmt *pStmt, int N){
69831
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt *pStmt, int N){
6980969832
return columnName(
6981069833
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_NAME);
6981169834
}
6981269835
#endif
6981369836
@@ -69823,16 +69846,16 @@
6982369846
#ifndef SQLITE_OMIT_DECLTYPE
6982469847
/*
6982569848
** Return the column declaration type (if applicable) of the 'i'th column
6982669849
** of the result set of SQL statement pStmt.
6982769850
*/
69828
-SQLITE_API const char *sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){
69851
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){
6982969852
return columnName(
6983069853
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DECLTYPE);
6983169854
}
6983269855
#ifndef SQLITE_OMIT_UTF16
69833
-SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){
69856
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){
6983469857
return columnName(
6983569858
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DECLTYPE);
6983669859
}
6983769860
#endif /* SQLITE_OMIT_UTF16 */
6983869861
#endif /* SQLITE_OMIT_DECLTYPE */
@@ -69841,16 +69864,16 @@
6984169864
/*
6984269865
** Return the name of the database from which a result column derives.
6984369866
** NULL is returned if the result column is an expression or constant or
6984469867
** anything else which is not an unambiguous reference to a database column.
6984569868
*/
69846
-SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){
69869
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){
6984769870
return columnName(
6984869871
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DATABASE);
6984969872
}
6985069873
#ifndef SQLITE_OMIT_UTF16
69851
-SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){
69874
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){
6985269875
return columnName(
6985369876
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DATABASE);
6985469877
}
6985569878
#endif /* SQLITE_OMIT_UTF16 */
6985669879
@@ -69857,16 +69880,16 @@
6985769880
/*
6985869881
** Return the name of the table from which a result column derives.
6985969882
** NULL is returned if the result column is an expression or constant or
6986069883
** anything else which is not an unambiguous reference to a database column.
6986169884
*/
69862
-SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){
69885
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){
6986369886
return columnName(
6986469887
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_TABLE);
6986569888
}
6986669889
#ifndef SQLITE_OMIT_UTF16
69867
-SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){
69890
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){
6986869891
return columnName(
6986969892
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_TABLE);
6987069893
}
6987169894
#endif /* SQLITE_OMIT_UTF16 */
6987269895
@@ -69873,16 +69896,16 @@
6987369896
/*
6987469897
** Return the name of the table column from which a result column derives.
6987569898
** NULL is returned if the result column is an expression or constant or
6987669899
** anything else which is not an unambiguous reference to a database column.
6987769900
*/
69878
-SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){
69901
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){
6987969902
return columnName(
6988069903
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_COLUMN);
6988169904
}
6988269905
#ifndef SQLITE_OMIT_UTF16
69883
-SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){
69906
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){
6988469907
return columnName(
6988569908
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_COLUMN);
6988669909
}
6988769910
#endif /* SQLITE_OMIT_UTF16 */
6988869911
#endif /* SQLITE_ENABLE_COLUMN_METADATA */
@@ -69979,20 +70002,20 @@
6997970002
6998070003
6998170004
/*
6998270005
** Bind a blob value to an SQL statement variable.
6998370006
*/
69984
-SQLITE_API int sqlite3_bind_blob(
70007
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(
6998570008
sqlite3_stmt *pStmt,
6998670009
int i,
6998770010
const void *zData,
6998870011
int nData,
6998970012
void (*xDel)(void*)
6999070013
){
6999170014
return bindText(pStmt, i, zData, nData, xDel, 0);
6999270015
}
69993
-SQLITE_API int sqlite3_bind_blob64(
70016
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(
6999470017
sqlite3_stmt *pStmt,
6999570018
int i,
6999670019
const void *zData,
6999770020
sqlite3_uint64 nData,
6999870021
void (*xDel)(void*)
@@ -70002,52 +70025,52 @@
7000270025
return invokeValueDestructor(zData, xDel, 0);
7000370026
}else{
7000470027
return bindText(pStmt, i, zData, (int)nData, xDel, 0);
7000570028
}
7000670029
}
70007
-SQLITE_API int sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
70030
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
7000870031
int rc;
7000970032
Vdbe *p = (Vdbe *)pStmt;
7001070033
rc = vdbeUnbind(p, i);
7001170034
if( rc==SQLITE_OK ){
7001270035
sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue);
7001370036
sqlite3_mutex_leave(p->db->mutex);
7001470037
}
7001570038
return rc;
7001670039
}
70017
-SQLITE_API int sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){
70040
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){
7001870041
return sqlite3_bind_int64(p, i, (i64)iValue);
7001970042
}
70020
-SQLITE_API int sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
70043
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
7002170044
int rc;
7002270045
Vdbe *p = (Vdbe *)pStmt;
7002370046
rc = vdbeUnbind(p, i);
7002470047
if( rc==SQLITE_OK ){
7002570048
sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue);
7002670049
sqlite3_mutex_leave(p->db->mutex);
7002770050
}
7002870051
return rc;
7002970052
}
70030
-SQLITE_API int sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
70053
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
7003170054
int rc;
7003270055
Vdbe *p = (Vdbe*)pStmt;
7003370056
rc = vdbeUnbind(p, i);
7003470057
if( rc==SQLITE_OK ){
7003570058
sqlite3_mutex_leave(p->db->mutex);
7003670059
}
7003770060
return rc;
7003870061
}
70039
-SQLITE_API int sqlite3_bind_text(
70062
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(
7004070063
sqlite3_stmt *pStmt,
7004170064
int i,
7004270065
const char *zData,
7004370066
int nData,
7004470067
void (*xDel)(void*)
7004570068
){
7004670069
return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8);
7004770070
}
70048
-SQLITE_API int sqlite3_bind_text64(
70071
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(
7004970072
sqlite3_stmt *pStmt,
7005070073
int i,
7005170074
const char *zData,
7005270075
sqlite3_uint64 nData,
7005370076
void (*xDel)(void*),
@@ -70060,21 +70083,21 @@
7006070083
if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE;
7006170084
return bindText(pStmt, i, zData, (int)nData, xDel, enc);
7006270085
}
7006370086
}
7006470087
#ifndef SQLITE_OMIT_UTF16
70065
-SQLITE_API int sqlite3_bind_text16(
70088
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(
7006670089
sqlite3_stmt *pStmt,
7006770090
int i,
7006870091
const void *zData,
7006970092
int nData,
7007070093
void (*xDel)(void*)
7007170094
){
7007270095
return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE);
7007370096
}
7007470097
#endif /* SQLITE_OMIT_UTF16 */
70075
-SQLITE_API int sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
70098
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
7007670099
int rc;
7007770100
switch( sqlite3_value_type((sqlite3_value*)pValue) ){
7007870101
case SQLITE_INTEGER: {
7007970102
rc = sqlite3_bind_int64(pStmt, i, pValue->u.i);
7008070103
break;
@@ -70101,11 +70124,11 @@
7010170124
break;
7010270125
}
7010370126
}
7010470127
return rc;
7010570128
}
70106
-SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
70129
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
7010770130
int rc;
7010870131
Vdbe *p = (Vdbe *)pStmt;
7010970132
rc = vdbeUnbind(p, i);
7011070133
if( rc==SQLITE_OK ){
7011170134
sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n);
@@ -70116,11 +70139,11 @@
7011670139
7011770140
/*
7011870141
** Return the number of wildcards that can be potentially bound to.
7011970142
** This routine is added to support DBD::SQLite.
7012070143
*/
70121
-SQLITE_API int sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
70144
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
7012270145
Vdbe *p = (Vdbe*)pStmt;
7012370146
return p ? p->nVar : 0;
7012470147
}
7012570148
7012670149
/*
@@ -70127,11 +70150,11 @@
7012770150
** Return the name of a wildcard parameter. Return NULL if the index
7012870151
** is out of range or if the wildcard is unnamed.
7012970152
**
7013070153
** The result is always UTF-8.
7013170154
*/
70132
-SQLITE_API const char *sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){
70155
+SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){
7013370156
Vdbe *p = (Vdbe*)pStmt;
7013470157
if( p==0 || i<1 || i>p->nzVar ){
7013570158
return 0;
7013670159
}
7013770160
return p->azVar[i-1];
@@ -70155,11 +70178,11 @@
7015570178
}
7015670179
}
7015770180
}
7015870181
return 0;
7015970182
}
70160
-SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
70183
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
7016170184
return sqlite3VdbeParameterIndex((Vdbe*)pStmt, zName, sqlite3Strlen30(zName));
7016270185
}
7016370186
7016470187
/*
7016570188
** Transfer all bindings from the first statement over to the second.
@@ -70189,11 +70212,11 @@
7018970212
**
7019070213
** If the two statements contain a different number of bindings, then
7019170214
** an SQLITE_ERROR is returned. Nothing else can go wrong, so otherwise
7019270215
** SQLITE_OK is returned.
7019370216
*/
70194
-SQLITE_API int sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
70217
+SQLITE_API int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
7019570218
Vdbe *pFrom = (Vdbe*)pFromStmt;
7019670219
Vdbe *pTo = (Vdbe*)pToStmt;
7019770220
if( pFrom->nVar!=pTo->nVar ){
7019870221
return SQLITE_ERROR;
7019970222
}
@@ -70211,26 +70234,26 @@
7021170234
** Return the sqlite3* database handle to which the prepared statement given
7021270235
** in the argument belongs. This is the same database handle that was
7021370236
** the first argument to the sqlite3_prepare() that was used to create
7021470237
** the statement in the first place.
7021570238
*/
70216
-SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt *pStmt){
70239
+SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt *pStmt){
7021770240
return pStmt ? ((Vdbe*)pStmt)->db : 0;
7021870241
}
7021970242
7022070243
/*
7022170244
** Return true if the prepared statement is guaranteed to not modify the
7022270245
** database.
7022370246
*/
70224
-SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt){
70247
+SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt){
7022570248
return pStmt ? ((Vdbe*)pStmt)->readOnly : 1;
7022670249
}
7022770250
7022870251
/*
7022970252
** Return true if the prepared statement is in need of being reset.
7023070253
*/
70231
-SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt *pStmt){
70254
+SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt *pStmt){
7023270255
Vdbe *v = (Vdbe*)pStmt;
7023370256
return v!=0 && v->pc>=0 && v->magic==VDBE_MAGIC_RUN;
7023470257
}
7023570258
7023670259
/*
@@ -70237,11 +70260,11 @@
7023770260
** Return a pointer to the next prepared statement after pStmt associated
7023870261
** with database connection pDb. If pStmt is NULL, return the first
7023970262
** prepared statement for the database connection. Return NULL if there
7024070263
** are no more.
7024170264
*/
70242
-SQLITE_API sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){
70265
+SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){
7024370266
sqlite3_stmt *pNext;
7024470267
#ifdef SQLITE_ENABLE_API_ARMOR
7024570268
if( !sqlite3SafetyCheckOk(pDb) ){
7024670269
(void)SQLITE_MISUSE_BKPT;
7024770270
return 0;
@@ -70258,11 +70281,11 @@
7025870281
}
7025970282
7026070283
/*
7026170284
** Return the value of a status counter for a prepared statement
7026270285
*/
70263
-SQLITE_API int sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){
70286
+SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){
7026470287
Vdbe *pVdbe = (Vdbe*)pStmt;
7026570288
u32 v;
7026670289
#ifdef SQLITE_ENABLE_API_ARMOR
7026770290
if( !pStmt ){
7026870291
(void)SQLITE_MISUSE_BKPT;
@@ -70276,11 +70299,11 @@
7027670299
7027770300
#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
7027870301
/*
7027970302
** Return status data for a single loop within query pStmt.
7028070303
*/
70281
-SQLITE_API int sqlite3_stmt_scanstatus(
70304
+SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus(
7028270305
sqlite3_stmt *pStmt, /* Prepared statement being queried */
7028370306
int idx, /* Index of loop to report on */
7028470307
int iScanStatusOp, /* Which metric to return */
7028570308
void *pOut /* OUT: Write the answer here */
7028670309
){
@@ -70335,11 +70358,11 @@
7033570358
}
7033670359
7033770360
/*
7033870361
** Zero all counters associated with the sqlite3_stmt_scanstatus() data.
7033970362
*/
70340
-SQLITE_API void sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){
70363
+SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){
7034170364
Vdbe *p = (Vdbe*)pStmt;
7034270365
memset(p->anExec, 0, p->nOp * sizeof(i64));
7034370366
}
7034470367
#endif /* SQLITE_ENABLE_STMT_SCANSTATUS */
7034570368
@@ -70834,11 +70857,11 @@
7083470857
** Try to convert the type of a function argument or a result column
7083570858
** into a numeric representation. Use either INTEGER or REAL whichever
7083670859
** is appropriate. But only do the conversion if it is possible without
7083770860
** loss of information and return the revised type of the argument.
7083870861
*/
70839
-SQLITE_API int sqlite3_value_numeric_type(sqlite3_value *pVal){
70862
+SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value *pVal){
7084070863
int eType = sqlite3_value_type(pVal);
7084170864
if( eType==SQLITE_TEXT ){
7084270865
Mem *pMem = (Mem*)pVal;
7084370866
applyNumericAffinity(pMem, 0);
7084470867
eType = sqlite3_value_type(pVal);
@@ -77296,11 +77319,11 @@
7729677319
}
7729777320
7729877321
/*
7729977322
** Open a blob handle.
7730077323
*/
77301
-SQLITE_API int sqlite3_blob_open(
77324
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
7730277325
sqlite3* db, /* The database connection */
7730377326
const char *zDb, /* The attached database containing the blob */
7730477327
const char *zTable, /* The table containing the blob */
7730577328
const char *zColumn, /* The column containing the blob */
7730677329
sqlite_int64 iRow, /* The row containing the glob */
@@ -77533,11 +77556,11 @@
7753377556
7753477557
/*
7753577558
** Close a blob handle that was previously created using
7753677559
** sqlite3_blob_open().
7753777560
*/
77538
-SQLITE_API int sqlite3_blob_close(sqlite3_blob *pBlob){
77561
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *pBlob){
7753977562
Incrblob *p = (Incrblob *)pBlob;
7754077563
int rc;
7754177564
sqlite3 *db;
7754277565
7754377566
if( p ){
@@ -77602,28 +77625,28 @@
7760277625
}
7760377626
7760477627
/*
7760577628
** Read data from a blob handle.
7760677629
*/
77607
-SQLITE_API int sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){
77630
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){
7760877631
return blobReadWrite(pBlob, z, n, iOffset, sqlite3BtreeData);
7760977632
}
7761077633
7761177634
/*
7761277635
** Write data to a blob handle.
7761377636
*/
77614
-SQLITE_API int sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){
77637
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){
7761577638
return blobReadWrite(pBlob, (void *)z, n, iOffset, sqlite3BtreePutData);
7761677639
}
7761777640
7761877641
/*
7761977642
** Query a blob handle for the size of the data.
7762077643
**
7762177644
** The Incrblob.nByte field is fixed for the lifetime of the Incrblob
7762277645
** so no mutex is required for access.
7762377646
*/
77624
-SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *pBlob){
77647
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *pBlob){
7762577648
Incrblob *p = (Incrblob *)pBlob;
7762677649
return (p && p->pStmt) ? p->nByte : 0;
7762777650
}
7762877651
7762977652
/*
@@ -77634,11 +77657,11 @@
7763477657
** contain a blob or text value, then an error code is returned and the
7763577658
** database handle error code and message set. If this happens, then all
7763677659
** subsequent calls to sqlite3_blob_xxx() functions (except blob_close())
7763777660
** immediately return SQLITE_ABORT.
7763877661
*/
77639
-SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){
77662
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){
7764077663
int rc;
7764177664
Incrblob *p = (Incrblob *)pBlob;
7764277665
sqlite3 *db;
7764377666
7764477667
if( p==0 ) return SQLITE_MISUSE_BKPT;
@@ -90142,11 +90165,11 @@
9014290165
** and attempts to write the column will be ignored.
9014390166
**
9014490167
** Setting the auth function to NULL disables this hook. The default
9014590168
** setting of the auth function is NULL.
9014690169
*/
90147
-SQLITE_API int sqlite3_set_authorizer(
90170
+SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
9014890171
sqlite3 *db,
9014990172
int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
9015090173
void *pArg
9015190174
){
9015290175
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -96720,11 +96743,11 @@
9672096743
}
9672196744
9672296745
/*
9672396746
** The sqlite3_strglob() interface.
9672496747
*/
96725
-SQLITE_API int sqlite3_strglob(const char *zGlobPattern, const char *zString){
96748
+SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlobPattern, const char *zString){
9672696749
return patternCompare((u8*)zGlobPattern, (u8*)zString, &globInfo, 0)==0;
9672796750
}
9672896751
9672996752
/*
9673096753
** Count the number of times that the LIKE operator (or GLOB which is
@@ -101215,11 +101238,11 @@
101215101238
** If the SQL is a query, then for each row in the query result
101216101239
** the xCallback() function is called. pArg becomes the first
101217101240
** argument to xCallback(). If xCallback=NULL then no callback
101218101241
** is invoked, even for queries.
101219101242
*/
101220
-SQLITE_API int sqlite3_exec(
101243
+SQLITE_API int SQLITE_STDCALL sqlite3_exec(
101221101244
sqlite3 *db, /* The database on which the SQL executes */
101222101245
const char *zSql, /* The SQL to be executed */
101223101246
sqlite3_callback xCallback, /* Invoke this callback routine */
101224101247
void *pArg, /* First argument to xCallback() */
101225101248
char **pzErrMsg /* Write error messages here */
@@ -102410,11 +102433,11 @@
102410102433
db->aExtension = aHandle;
102411102434
102412102435
db->aExtension[db->nExtension++] = handle;
102413102436
return SQLITE_OK;
102414102437
}
102415
-SQLITE_API int sqlite3_load_extension(
102438
+SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
102416102439
sqlite3 *db, /* Load the extension into this database connection */
102417102440
const char *zFile, /* Name of the shared library containing extension */
102418102441
const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */
102419102442
char **pzErrMsg /* Put error message here if not 0 */
102420102443
){
@@ -102441,11 +102464,11 @@
102441102464
102442102465
/*
102443102466
** Enable or disable extension loading. Extension loading is disabled by
102444102467
** default so as not to open security holes in older applications.
102445102468
*/
102446
-SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff){
102469
+SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff){
102447102470
sqlite3_mutex_enter(db->mutex);
102448102471
if( onoff ){
102449102472
db->flags |= SQLITE_LoadExtension;
102450102473
}else{
102451102474
db->flags &= ~SQLITE_LoadExtension;
@@ -102498,11 +102521,11 @@
102498102521
102499102522
/*
102500102523
** Register a statically linked extension that is automatically
102501102524
** loaded by every new database connection.
102502102525
*/
102503
-SQLITE_API int sqlite3_auto_extension(void (*xInit)(void)){
102526
+SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void (*xInit)(void)){
102504102527
int rc = SQLITE_OK;
102505102528
#ifndef SQLITE_OMIT_AUTOINIT
102506102529
rc = sqlite3_initialize();
102507102530
if( rc ){
102508102531
return rc;
@@ -102543,11 +102566,11 @@
102543102566
** routine is a no-op.
102544102567
**
102545102568
** Return 1 if xInit was found on the list and removed. Return 0 if xInit
102546102569
** was not on the list.
102547102570
*/
102548
-SQLITE_API int sqlite3_cancel_auto_extension(void (*xInit)(void)){
102571
+SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void (*xInit)(void)){
102549102572
#if SQLITE_THREADSAFE
102550102573
sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
102551102574
#endif
102552102575
int i;
102553102576
int n = 0;
@@ -102566,11 +102589,11 @@
102566102589
}
102567102590
102568102591
/*
102569102592
** Reset the automatic extension loading mechanism.
102570102593
*/
102571
-SQLITE_API void sqlite3_reset_auto_extension(void){
102594
+SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void){
102572102595
#ifndef SQLITE_OMIT_AUTOINIT
102573102596
if( sqlite3_initialize()==SQLITE_OK )
102574102597
#endif
102575102598
{
102576102599
#if SQLITE_THREADSAFE
@@ -105846,11 +105869,11 @@
105846105869
** and so if a schema change occurs, SQLITE_SCHEMA is returned by
105847105870
** sqlite3_step(). In the new version, the original SQL text is retained
105848105871
** and the statement is automatically recompiled if an schema change
105849105872
** occurs.
105850105873
*/
105851
-SQLITE_API int sqlite3_prepare(
105874
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
105852105875
sqlite3 *db, /* Database handle. */
105853105876
const char *zSql, /* UTF-8 encoded SQL statement. */
105854105877
int nBytes, /* Length of zSql in bytes. */
105855105878
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
105856105879
const char **pzTail /* OUT: End of parsed string */
@@ -105858,11 +105881,11 @@
105858105881
int rc;
105859105882
rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,0,ppStmt,pzTail);
105860105883
assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
105861105884
return rc;
105862105885
}
105863
-SQLITE_API int sqlite3_prepare_v2(
105886
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
105864105887
sqlite3 *db, /* Database handle. */
105865105888
const char *zSql, /* UTF-8 encoded SQL statement. */
105866105889
int nBytes, /* Length of zSql in bytes. */
105867105890
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
105868105891
const char **pzTail /* OUT: End of parsed string */
@@ -105934,11 +105957,11 @@
105934105957
** and so if a schema change occurs, SQLITE_SCHEMA is returned by
105935105958
** sqlite3_step(). In the new version, the original SQL text is retained
105936105959
** and the statement is automatically recompiled if an schema change
105937105960
** occurs.
105938105961
*/
105939
-SQLITE_API int sqlite3_prepare16(
105962
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
105940105963
sqlite3 *db, /* Database handle. */
105941105964
const void *zSql, /* UTF-16 encoded SQL statement. */
105942105965
int nBytes, /* Length of zSql in bytes. */
105943105966
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
105944105967
const void **pzTail /* OUT: End of parsed string */
@@ -105946,11 +105969,11 @@
105946105969
int rc;
105947105970
rc = sqlite3Prepare16(db,zSql,nBytes,0,ppStmt,pzTail);
105948105971
assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
105949105972
return rc;
105950105973
}
105951
-SQLITE_API int sqlite3_prepare16_v2(
105974
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
105952105975
sqlite3 *db, /* Database handle. */
105953105976
const void *zSql, /* UTF-16 encoded SQL statement. */
105954105977
int nBytes, /* Length of zSql in bytes. */
105955105978
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
105956105979
const void **pzTail /* OUT: End of parsed string */
@@ -111682,11 +111705,11 @@
111682111705
** The result that is written to ***pazResult is held in memory obtained
111683111706
** from malloc(). But the caller cannot free this memory directly.
111684111707
** Instead, the entire table should be passed to sqlite3_free_table() when
111685111708
** the calling procedure is finished using it.
111686111709
*/
111687
-SQLITE_API int sqlite3_get_table(
111710
+SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
111688111711
sqlite3 *db, /* The database on which the SQL executes */
111689111712
const char *zSql, /* The SQL to be executed */
111690111713
char ***pazResult, /* Write the result table here */
111691111714
int *pnRow, /* Write the number of rows in the result here */
111692111715
int *pnColumn, /* Write the number of columns of result here */
@@ -111751,11 +111774,11 @@
111751111774
}
111752111775
111753111776
/*
111754111777
** This routine frees the space the sqlite3_get_table() malloced.
111755111778
*/
111756
-SQLITE_API void sqlite3_free_table(
111779
+SQLITE_API void SQLITE_STDCALL sqlite3_free_table(
111757111780
char **azResult /* Result returned from sqlite3_get_table() */
111758111781
){
111759111782
if( azResult ){
111760111783
int i, n;
111761111784
azResult--;
@@ -114111,11 +114134,11 @@
114111114134
114112114135
114113114136
/*
114114114137
** External API function used to create a new virtual-table module.
114115114138
*/
114116
-SQLITE_API int sqlite3_create_module(
114139
+SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
114117114140
sqlite3 *db, /* Database in which module is registered */
114118114141
const char *zName, /* Name assigned to this module */
114119114142
const sqlite3_module *pModule, /* The definition of the module */
114120114143
void *pAux /* Context pointer for xCreate/xConnect */
114121114144
){
@@ -114126,11 +114149,11 @@
114126114149
}
114127114150
114128114151
/*
114129114152
** External API function used to create a new virtual-table module.
114130114153
*/
114131
-SQLITE_API int sqlite3_create_module_v2(
114154
+SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
114132114155
sqlite3 *db, /* Database in which module is registered */
114133114156
const char *zName, /* Name assigned to this module */
114134114157
const sqlite3_module *pModule, /* The definition of the module */
114135114158
void *pAux, /* Context pointer for xCreate/xConnect */
114136114159
void (*xDestroy)(void *) /* Module destructor function */
@@ -114741,11 +114764,11 @@
114741114764
/*
114742114765
** This function is used to set the schema of a virtual table. It is only
114743114766
** valid to call this function from within the xCreate() or xConnect() of a
114744114767
** virtual table module.
114745114768
*/
114746
-SQLITE_API int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
114769
+SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
114747114770
Parse *pParse;
114748114771
114749114772
int rc = SQLITE_OK;
114750114773
Table *pTab;
114751114774
char *zErr = 0;
@@ -115109,11 +115132,11 @@
115109115132
** table update operation currently in progress.
115110115133
**
115111115134
** The results of this routine are undefined unless it is called from
115112115135
** within an xUpdate method.
115113115136
*/
115114
-SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *db){
115137
+SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *db){
115115115138
static const unsigned char aMap[] = {
115116115139
SQLITE_ROLLBACK, SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_REPLACE
115117115140
};
115118115141
#ifdef SQLITE_ENABLE_API_ARMOR
115119115142
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -115127,11 +115150,11 @@
115127115150
/*
115128115151
** Call from within the xCreate() or xConnect() methods to provide
115129115152
** the SQLite core with additional information about the behavior
115130115153
** of the virtual table being implemented.
115131115154
*/
115132
-SQLITE_API int sqlite3_vtab_config(sqlite3 *db, int op, ...){
115155
+SQLITE_API int SQLITE_CDECL sqlite3_vtab_config(sqlite3 *db, int op, ...){
115133115156
va_list ap;
115134115157
int rc = SQLITE_OK;
115135115158
115136115159
#ifdef SQLITE_ENABLE_API_ARMOR
115137115160
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -127161,11 +127184,11 @@
127161127184
**
127162127185
** If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed
127163127186
** to recognize the end of a trigger can be omitted. All we have to do
127164127187
** is look for a semicolon that is not part of an string or comment.
127165127188
*/
127166
-SQLITE_API int sqlite3_complete(const char *zSql){
127189
+SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *zSql){
127167127190
u8 state = 0; /* Current state, using numbers defined in header comment */
127168127191
u8 token; /* Value of the next token */
127169127192
127170127193
#ifndef SQLITE_OMIT_TRIGGER
127171127194
/* A complex statement machine used to detect the end of a CREATE TRIGGER
@@ -127326,11 +127349,11 @@
127326127349
/*
127327127350
** This routine is the same as the sqlite3_complete() routine described
127328127351
** above, except that the parameter is required to be UTF-16 encoded, not
127329127352
** UTF-8.
127330127353
*/
127331
-SQLITE_API int sqlite3_complete16(const void *zSql){
127354
+SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *zSql){
127332127355
sqlite3_value *pVal;
127333127356
char const *zSql8;
127334127357
int rc = SQLITE_NOMEM;
127335127358
127336127359
#ifndef SQLITE_OMIT_AUTOINIT
@@ -127476,37 +127499,37 @@
127476127499
#endif
127477127500
127478127501
/* IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns
127479127502
** a pointer to the to the sqlite3_version[] string constant.
127480127503
*/
127481
-SQLITE_API const char *sqlite3_libversion(void){ return sqlite3_version; }
127504
+SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void){ return sqlite3_version; }
127482127505
127483127506
/* IMPLEMENTATION-OF: R-63124-39300 The sqlite3_sourceid() function returns a
127484127507
** pointer to a string constant whose value is the same as the
127485127508
** SQLITE_SOURCE_ID C preprocessor macro.
127486127509
*/
127487
-SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
127510
+SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
127488127511
127489127512
/* IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function
127490127513
** returns an integer equal to SQLITE_VERSION_NUMBER.
127491127514
*/
127492
-SQLITE_API int sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; }
127515
+SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; }
127493127516
127494127517
/* IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns
127495127518
** zero if and only if SQLite was compiled with mutexing code omitted due to
127496127519
** the SQLITE_THREADSAFE compile-time option being set to 0.
127497127520
*/
127498
-SQLITE_API int sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; }
127521
+SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; }
127499127522
127500127523
#if !defined(SQLITE_OMIT_TRACE) && defined(SQLITE_ENABLE_IOTRACE)
127501127524
/*
127502127525
** If the following function pointer is not NULL and if
127503127526
** SQLITE_ENABLE_IOTRACE is enabled, then messages describing
127504127527
** I/O active are written using this function. These messages
127505127528
** are intended for debugging activity only.
127506127529
*/
127507
-/* not-private */ void (*sqlite3IoTrace)(const char*, ...) = 0;
127530
+SQLITE_API void (SQLITE_CDECL *sqlite3IoTrace)(const char*, ...) = 0;
127508127531
#endif
127509127532
127510127533
/*
127511127534
** If the following global variable points to a string which is the
127512127535
** name of a directory, then that directory will be used to store
@@ -127554,11 +127577,11 @@
127554127577
** call by X completes.
127555127578
**
127556127579
** * Recursive calls to this routine from thread X return immediately
127557127580
** without blocking.
127558127581
*/
127559
-SQLITE_API int sqlite3_initialize(void){
127582
+SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void){
127560127583
MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */
127561127584
int rc; /* Result code */
127562127585
#ifdef SQLITE_EXTRA_INIT
127563127586
int bRunExtraInit = 0; /* Extra initialization needed */
127564127587
#endif
@@ -127715,11 +127738,11 @@
127715127738
** while any part of SQLite is otherwise in use in any thread. This
127716127739
** routine is not threadsafe. But it is safe to invoke this routine
127717127740
** on when SQLite is already shut down. If SQLite is already shut down
127718127741
** when this routine is invoked, then this routine is a harmless no-op.
127719127742
*/
127720
-SQLITE_API int sqlite3_shutdown(void){
127743
+SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void){
127721127744
#ifdef SQLITE_OMIT_WSD
127722127745
int rc = sqlite3_wsd_init(4096, 24);
127723127746
if( rc!=SQLITE_OK ){
127724127747
return rc;
127725127748
}
@@ -127769,11 +127792,11 @@
127769127792
** This routine should only be called when there are no outstanding
127770127793
** database connections or memory allocations. This routine is not
127771127794
** threadsafe. Failure to heed these warnings can lead to unpredictable
127772127795
** behavior.
127773127796
*/
127774
-SQLITE_API int sqlite3_config(int op, ...){
127797
+SQLITE_API int SQLITE_CDECL sqlite3_config(int op, ...){
127775127798
va_list ap;
127776127799
int rc = SQLITE_OK;
127777127800
127778127801
/* sqlite3_config() shall return SQLITE_MISUSE if it is invoked while
127779127802
** the SQLite library is in use. */
@@ -128126,11 +128149,11 @@
128126128149
}
128127128150
128128128151
/*
128129128152
** Return the mutex associated with a database connection.
128130128153
*/
128131
-SQLITE_API sqlite3_mutex *sqlite3_db_mutex(sqlite3 *db){
128154
+SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3 *db){
128132128155
#ifdef SQLITE_ENABLE_API_ARMOR
128133128156
if( !sqlite3SafetyCheckOk(db) ){
128134128157
(void)SQLITE_MISUSE_BKPT;
128135128158
return 0;
128136128159
}
@@ -128140,11 +128163,11 @@
128140128163
128141128164
/*
128142128165
** Free up as much memory as we can from the given database
128143128166
** connection.
128144128167
*/
128145
-SQLITE_API int sqlite3_db_release_memory(sqlite3 *db){
128168
+SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3 *db){
128146128169
int i;
128147128170
128148128171
#ifdef SQLITE_ENABLE_API_ARMOR
128149128172
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
128150128173
#endif
@@ -128163,11 +128186,11 @@
128163128186
}
128164128187
128165128188
/*
128166128189
** Configuration settings for an individual database connection
128167128190
*/
128168
-SQLITE_API int sqlite3_db_config(sqlite3 *db, int op, ...){
128191
+SQLITE_API int SQLITE_CDECL sqlite3_db_config(sqlite3 *db, int op, ...){
128169128192
va_list ap;
128170128193
int rc;
128171128194
va_start(ap, op);
128172128195
switch( op ){
128173128196
case SQLITE_DBCONFIG_LOOKASIDE: {
@@ -128282,11 +128305,11 @@
128282128305
}
128283128306
128284128307
/*
128285128308
** Return the ROWID of the most recent insert
128286128309
*/
128287
-SQLITE_API sqlite_int64 sqlite3_last_insert_rowid(sqlite3 *db){
128310
+SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3 *db){
128288128311
#ifdef SQLITE_ENABLE_API_ARMOR
128289128312
if( !sqlite3SafetyCheckOk(db) ){
128290128313
(void)SQLITE_MISUSE_BKPT;
128291128314
return 0;
128292128315
}
@@ -128295,11 +128318,11 @@
128295128318
}
128296128319
128297128320
/*
128298128321
** Return the number of changes in the most recent call to sqlite3_exec().
128299128322
*/
128300
-SQLITE_API int sqlite3_changes(sqlite3 *db){
128323
+SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3 *db){
128301128324
#ifdef SQLITE_ENABLE_API_ARMOR
128302128325
if( !sqlite3SafetyCheckOk(db) ){
128303128326
(void)SQLITE_MISUSE_BKPT;
128304128327
return 0;
128305128328
}
@@ -128308,11 +128331,11 @@
128308128331
}
128309128332
128310128333
/*
128311128334
** Return the number of changes since the database handle was opened.
128312128335
*/
128313
-SQLITE_API int sqlite3_total_changes(sqlite3 *db){
128336
+SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3 *db){
128314128337
#ifdef SQLITE_ENABLE_API_ARMOR
128315128338
if( !sqlite3SafetyCheckOk(db) ){
128316128339
(void)SQLITE_MISUSE_BKPT;
128317128340
return 0;
128318128341
}
@@ -128450,12 +128473,12 @@
128450128473
** statements or unfinished sqlite3_backups. The sqlite3_close_v2()
128451128474
** version forces the connection to become a zombie if there are
128452128475
** unclosed resources, and arranges for deallocation when the last
128453128476
** prepare statement or sqlite3_backup closes.
128454128477
*/
128455
-SQLITE_API int sqlite3_close(sqlite3 *db){ return sqlite3Close(db,0); }
128456
-SQLITE_API int sqlite3_close_v2(sqlite3 *db){ return sqlite3Close(db,1); }
128478
+SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3 *db){ return sqlite3Close(db,0); }
128479
+SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3 *db){ return sqlite3Close(db,1); }
128457128480
128458128481
128459128482
/*
128460128483
** Close the mutex on database connection db.
128461128484
**
@@ -128858,11 +128881,11 @@
128858128881
128859128882
/*
128860128883
** This routine sets the busy callback for an Sqlite database to the
128861128884
** given callback function with the given argument.
128862128885
*/
128863
-SQLITE_API int sqlite3_busy_handler(
128886
+SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(
128864128887
sqlite3 *db,
128865128888
int (*xBusy)(void*,int),
128866128889
void *pArg
128867128890
){
128868128891
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -128881,11 +128904,11 @@
128881128904
/*
128882128905
** This routine sets the progress callback for an Sqlite database to the
128883128906
** given callback function with the given argument. The progress callback will
128884128907
** be invoked every nOps opcodes.
128885128908
*/
128886
-SQLITE_API void sqlite3_progress_handler(
128909
+SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(
128887128910
sqlite3 *db,
128888128911
int nOps,
128889128912
int (*xProgress)(void*),
128890128913
void *pArg
128891128914
){
@@ -128912,11 +128935,11 @@
128912128935
128913128936
/*
128914128937
** This routine installs a default busy handler that waits for the
128915128938
** specified number of milliseconds before returning 0.
128916128939
*/
128917
-SQLITE_API int sqlite3_busy_timeout(sqlite3 *db, int ms){
128940
+SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3 *db, int ms){
128918128941
#ifdef SQLITE_ENABLE_API_ARMOR
128919128942
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
128920128943
#endif
128921128944
if( ms>0 ){
128922128945
sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db);
@@ -128928,11 +128951,11 @@
128928128951
}
128929128952
128930128953
/*
128931128954
** Cause any pending operation to stop at its earliest opportunity.
128932128955
*/
128933
-SQLITE_API void sqlite3_interrupt(sqlite3 *db){
128956
+SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3 *db){
128934128957
#ifdef SQLITE_ENABLE_API_ARMOR
128935128958
if( !sqlite3SafetyCheckOk(db) ){
128936128959
(void)SQLITE_MISUSE_BKPT;
128937128960
return;
128938128961
}
@@ -129045,11 +129068,11 @@
129045129068
}
129046129069
129047129070
/*
129048129071
** Create new user functions.
129049129072
*/
129050
-SQLITE_API int sqlite3_create_function(
129073
+SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
129051129074
sqlite3 *db,
129052129075
const char *zFunc,
129053129076
int nArg,
129054129077
int enc,
129055129078
void *p,
@@ -129059,11 +129082,11 @@
129059129082
){
129060129083
return sqlite3_create_function_v2(db, zFunc, nArg, enc, p, xFunc, xStep,
129061129084
xFinal, 0);
129062129085
}
129063129086
129064
-SQLITE_API int sqlite3_create_function_v2(
129087
+SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
129065129088
sqlite3 *db,
129066129089
const char *zFunc,
129067129090
int nArg,
129068129091
int enc,
129069129092
void *p,
@@ -129102,11 +129125,11 @@
129102129125
sqlite3_mutex_leave(db->mutex);
129103129126
return rc;
129104129127
}
129105129128
129106129129
#ifndef SQLITE_OMIT_UTF16
129107
-SQLITE_API int sqlite3_create_function16(
129130
+SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
129108129131
sqlite3 *db,
129109129132
const void *zFunctionName,
129110129133
int nArg,
129111129134
int eTextRep,
129112129135
void *p,
@@ -129142,11 +129165,11 @@
129142129165
** When virtual tables intend to provide an overloaded function, they
129143129166
** should call this routine to make sure the global function exists.
129144129167
** A global function must exist in order for name resolution to work
129145129168
** properly.
129146129169
*/
129147
-SQLITE_API int sqlite3_overload_function(
129170
+SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(
129148129171
sqlite3 *db,
129149129172
const char *zName,
129150129173
int nArg
129151129174
){
129152129175
int nName = sqlite3Strlen30(zName);
@@ -129174,11 +129197,11 @@
129174129197
**
129175129198
** A NULL trace function means that no tracing is executes. A non-NULL
129176129199
** trace is a pointer to a function that is invoked at the start of each
129177129200
** SQL statement.
129178129201
*/
129179
-SQLITE_API void *sqlite3_trace(sqlite3 *db, void (*xTrace)(void*,const char*), void *pArg){
129202
+SQLITE_API void *SQLITE_STDCALL sqlite3_trace(sqlite3 *db, void (*xTrace)(void*,const char*), void *pArg){
129180129203
void *pOld;
129181129204
129182129205
#ifdef SQLITE_ENABLE_API_ARMOR
129183129206
if( !sqlite3SafetyCheckOk(db) ){
129184129207
(void)SQLITE_MISUSE_BKPT;
@@ -129198,11 +129221,11 @@
129198129221
**
129199129222
** A NULL profile function means that no profiling is executes. A non-NULL
129200129223
** profile is a pointer to a function that is invoked at the conclusion of
129201129224
** each SQL statement that is run.
129202129225
*/
129203
-SQLITE_API void *sqlite3_profile(
129226
+SQLITE_API void *SQLITE_STDCALL sqlite3_profile(
129204129227
sqlite3 *db,
129205129228
void (*xProfile)(void*,const char*,sqlite_uint64),
129206129229
void *pArg
129207129230
){
129208129231
void *pOld;
@@ -129225,11 +129248,11 @@
129225129248
/*
129226129249
** Register a function to be invoked when a transaction commits.
129227129250
** If the invoked function returns non-zero, then the commit becomes a
129228129251
** rollback.
129229129252
*/
129230
-SQLITE_API void *sqlite3_commit_hook(
129253
+SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(
129231129254
sqlite3 *db, /* Attach the hook to this database */
129232129255
int (*xCallback)(void*), /* Function to invoke on each commit */
129233129256
void *pArg /* Argument to the function */
129234129257
){
129235129258
void *pOld;
@@ -129250,11 +129273,11 @@
129250129273
129251129274
/*
129252129275
** Register a callback to be invoked each time a row is updated,
129253129276
** inserted or deleted using this database connection.
129254129277
*/
129255
-SQLITE_API void *sqlite3_update_hook(
129278
+SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
129256129279
sqlite3 *db, /* Attach the hook to this database */
129257129280
void (*xCallback)(void*,int,char const *,char const *,sqlite_int64),
129258129281
void *pArg /* Argument to the function */
129259129282
){
129260129283
void *pRet;
@@ -129275,11 +129298,11 @@
129275129298
129276129299
/*
129277129300
** Register a callback to be invoked each time a transaction is rolled
129278129301
** back by this database connection.
129279129302
*/
129280
-SQLITE_API void *sqlite3_rollback_hook(
129303
+SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(
129281129304
sqlite3 *db, /* Attach the hook to this database */
129282129305
void (*xCallback)(void*), /* Callback function */
129283129306
void *pArg /* Argument to the function */
129284129307
){
129285129308
void *pRet;
@@ -129329,11 +129352,11 @@
129329129352
** The callback registered by this function replaces any existing callback
129330129353
** registered using sqlite3_wal_hook(). Likewise, registering a callback
129331129354
** using sqlite3_wal_hook() disables the automatic checkpoint mechanism
129332129355
** configured by this function.
129333129356
*/
129334
-SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){
129357
+SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){
129335129358
#ifdef SQLITE_OMIT_WAL
129336129359
UNUSED_PARAMETER(db);
129337129360
UNUSED_PARAMETER(nFrame);
129338129361
#else
129339129362
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -129350,11 +129373,11 @@
129350129373
129351129374
/*
129352129375
** Register a callback to be invoked each time a transaction is written
129353129376
** into the write-ahead-log by this database connection.
129354129377
*/
129355
-SQLITE_API void *sqlite3_wal_hook(
129378
+SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
129356129379
sqlite3 *db, /* Attach the hook to this db handle */
129357129380
int(*xCallback)(void *, sqlite3*, const char*, int),
129358129381
void *pArg /* First argument passed to xCallback() */
129359129382
){
129360129383
#ifndef SQLITE_OMIT_WAL
@@ -129377,11 +129400,11 @@
129377129400
}
129378129401
129379129402
/*
129380129403
** Checkpoint database zDb.
129381129404
*/
129382
-SQLITE_API int sqlite3_wal_checkpoint_v2(
129405
+SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
129383129406
sqlite3 *db, /* Database handle */
129384129407
const char *zDb, /* Name of attached database (or NULL) */
129385129408
int eMode, /* SQLITE_CHECKPOINT_* value */
129386129409
int *pnLog, /* OUT: Size of WAL log in frames */
129387129410
int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -129432,11 +129455,11 @@
129432129455
/*
129433129456
** Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points
129434129457
** to contains a zero-length string, all attached databases are
129435129458
** checkpointed.
129436129459
*/
129437
-SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){
129460
+SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){
129438129461
/* EVIDENCE-OF: R-41613-20553 The sqlite3_wal_checkpoint(D,X) is equivalent to
129439129462
** sqlite3_wal_checkpoint_v2(D,X,SQLITE_CHECKPOINT_PASSIVE,0,0). */
129440129463
return sqlite3_wal_checkpoint_v2(db,zDb,SQLITE_CHECKPOINT_PASSIVE,0,0);
129441129464
}
129442129465
@@ -129521,11 +129544,11 @@
129521129544
129522129545
/*
129523129546
** Return UTF-8 encoded English language explanation of the most recent
129524129547
** error.
129525129548
*/
129526
-SQLITE_API const char *sqlite3_errmsg(sqlite3 *db){
129549
+SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3 *db){
129527129550
const char *z;
129528129551
if( !db ){
129529129552
return sqlite3ErrStr(SQLITE_NOMEM);
129530129553
}
129531129554
if( !sqlite3SafetyCheckSickOrOk(db) ){
@@ -129549,11 +129572,11 @@
129549129572
#ifndef SQLITE_OMIT_UTF16
129550129573
/*
129551129574
** Return UTF-16 encoded English language explanation of the most recent
129552129575
** error.
129553129576
*/
129554
-SQLITE_API const void *sqlite3_errmsg16(sqlite3 *db){
129577
+SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3 *db){
129555129578
static const u16 outOfMem[] = {
129556129579
'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0
129557129580
};
129558129581
static const u16 misuse[] = {
129559129582
'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ',
@@ -129594,20 +129617,20 @@
129594129617
129595129618
/*
129596129619
** Return the most recent error code generated by an SQLite routine. If NULL is
129597129620
** passed to this function, we assume a malloc() failed during sqlite3_open().
129598129621
*/
129599
-SQLITE_API int sqlite3_errcode(sqlite3 *db){
129622
+SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db){
129600129623
if( db && !sqlite3SafetyCheckSickOrOk(db) ){
129601129624
return SQLITE_MISUSE_BKPT;
129602129625
}
129603129626
if( !db || db->mallocFailed ){
129604129627
return SQLITE_NOMEM;
129605129628
}
129606129629
return db->errCode & db->errMask;
129607129630
}
129608
-SQLITE_API int sqlite3_extended_errcode(sqlite3 *db){
129631
+SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db){
129609129632
if( db && !sqlite3SafetyCheckSickOrOk(db) ){
129610129633
return SQLITE_MISUSE_BKPT;
129611129634
}
129612129635
if( !db || db->mallocFailed ){
129613129636
return SQLITE_NOMEM;
@@ -129618,11 +129641,11 @@
129618129641
/*
129619129642
** Return a string that describes the kind of error specified in the
129620129643
** argument. For now, this simply calls the internal sqlite3ErrStr()
129621129644
** function.
129622129645
*/
129623
-SQLITE_API const char *sqlite3_errstr(int rc){
129646
+SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int rc){
129624129647
return sqlite3ErrStr(rc);
129625129648
}
129626129649
129627129650
/*
129628129651
** Create a new collating function for database "db". The name is zName
@@ -129766,11 +129789,11 @@
129766129789
**
129767129790
** A new lower limit does not shrink existing constructs.
129768129791
** It merely prevents new constructs that exceed the limit
129769129792
** from forming.
129770129793
*/
129771
-SQLITE_API int sqlite3_limit(sqlite3 *db, int limitId, int newLimit){
129794
+SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3 *db, int limitId, int newLimit){
129772129795
int oldLimit;
129773129796
129774129797
#ifdef SQLITE_ENABLE_API_ARMOR
129775129798
if( !sqlite3SafetyCheckOk(db) ){
129776129799
(void)SQLITE_MISUSE_BKPT;
@@ -130351,18 +130374,18 @@
130351130374
}
130352130375
130353130376
/*
130354130377
** Open a new database handle.
130355130378
*/
130356
-SQLITE_API int sqlite3_open(
130379
+SQLITE_API int SQLITE_STDCALL sqlite3_open(
130357130380
const char *zFilename,
130358130381
sqlite3 **ppDb
130359130382
){
130360130383
return openDatabase(zFilename, ppDb,
130361130384
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0);
130362130385
}
130363
-SQLITE_API int sqlite3_open_v2(
130386
+SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
130364130387
const char *filename, /* Database filename (UTF-8) */
130365130388
sqlite3 **ppDb, /* OUT: SQLite db handle */
130366130389
int flags, /* Flags */
130367130390
const char *zVfs /* Name of VFS module to use */
130368130391
){
@@ -130371,11 +130394,11 @@
130371130394
130372130395
#ifndef SQLITE_OMIT_UTF16
130373130396
/*
130374130397
** Open a new database handle.
130375130398
*/
130376
-SQLITE_API int sqlite3_open16(
130399
+SQLITE_API int SQLITE_STDCALL sqlite3_open16(
130377130400
const void *zFilename,
130378130401
sqlite3 **ppDb
130379130402
){
130380130403
char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */
130381130404
sqlite3_value *pVal;
@@ -130410,11 +130433,11 @@
130410130433
#endif /* SQLITE_OMIT_UTF16 */
130411130434
130412130435
/*
130413130436
** Register a new collation sequence with the database handle db.
130414130437
*/
130415
-SQLITE_API int sqlite3_create_collation(
130438
+SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
130416130439
sqlite3* db,
130417130440
const char *zName,
130418130441
int enc,
130419130442
void* pCtx,
130420130443
int(*xCompare)(void*,int,const void*,int,const void*)
@@ -130423,11 +130446,11 @@
130423130446
}
130424130447
130425130448
/*
130426130449
** Register a new collation sequence with the database handle db.
130427130450
*/
130428
-SQLITE_API int sqlite3_create_collation_v2(
130451
+SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
130429130452
sqlite3* db,
130430130453
const char *zName,
130431130454
int enc,
130432130455
void* pCtx,
130433130456
int(*xCompare)(void*,int,const void*,int,const void*),
@@ -130448,11 +130471,11 @@
130448130471
130449130472
#ifndef SQLITE_OMIT_UTF16
130450130473
/*
130451130474
** Register a new collation sequence with the database handle db.
130452130475
*/
130453
-SQLITE_API int sqlite3_create_collation16(
130476
+SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
130454130477
sqlite3* db,
130455130478
const void *zName,
130456130479
int enc,
130457130480
void* pCtx,
130458130481
int(*xCompare)(void*,int,const void*,int,const void*)
@@ -130478,11 +130501,11 @@
130478130501
130479130502
/*
130480130503
** Register a collation sequence factory callback with the database handle
130481130504
** db. Replace any previously installed collation sequence factory.
130482130505
*/
130483
-SQLITE_API int sqlite3_collation_needed(
130506
+SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
130484130507
sqlite3 *db,
130485130508
void *pCollNeededArg,
130486130509
void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*)
130487130510
){
130488130511
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -130499,11 +130522,11 @@
130499130522
#ifndef SQLITE_OMIT_UTF16
130500130523
/*
130501130524
** Register a collation sequence factory callback with the database handle
130502130525
** db. Replace any previously installed collation sequence factory.
130503130526
*/
130504
-SQLITE_API int sqlite3_collation_needed16(
130527
+SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
130505130528
sqlite3 *db,
130506130529
void *pCollNeededArg,
130507130530
void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*)
130508130531
){
130509130532
#ifdef SQLITE_ENABLE_API_ARMOR
@@ -130521,11 +130544,11 @@
130521130544
#ifndef SQLITE_OMIT_DEPRECATED
130522130545
/*
130523130546
** This function is now an anachronism. It used to be used to recover from a
130524130547
** malloc() failure, but SQLite now does this automatically.
130525130548
*/
130526
-SQLITE_API int sqlite3_global_recover(void){
130549
+SQLITE_API int SQLITE_STDCALL sqlite3_global_recover(void){
130527130550
return SQLITE_OK;
130528130551
}
130529130552
#endif
130530130553
130531130554
/*
@@ -130532,11 +130555,11 @@
130532130555
** Test to see whether or not the database connection is in autocommit
130533130556
** mode. Return TRUE if it is and FALSE if not. Autocommit mode is on
130534130557
** by default. Autocommit is disabled by a BEGIN statement and reenabled
130535130558
** by the next COMMIT or ROLLBACK.
130536130559
*/
130537
-SQLITE_API int sqlite3_get_autocommit(sqlite3 *db){
130560
+SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3 *db){
130538130561
#ifdef SQLITE_ENABLE_API_ARMOR
130539130562
if( !sqlite3SafetyCheckOk(db) ){
130540130563
(void)SQLITE_MISUSE_BKPT;
130541130564
return 0;
130542130565
}
@@ -130584,19 +130607,19 @@
130584130607
** data for this thread has been deallocated.
130585130608
**
130586130609
** SQLite no longer uses thread-specific data so this routine is now a
130587130610
** no-op. It is retained for historical compatibility.
130588130611
*/
130589
-SQLITE_API void sqlite3_thread_cleanup(void){
130612
+SQLITE_API void SQLITE_STDCALL sqlite3_thread_cleanup(void){
130590130613
}
130591130614
#endif
130592130615
130593130616
/*
130594130617
** Return meta information about a specific column of a database table.
130595130618
** See comment in sqlite3.h (sqlite.h.in) for details.
130596130619
*/
130597
-SQLITE_API int sqlite3_table_column_metadata(
130620
+SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
130598130621
sqlite3 *db, /* Connection handle */
130599130622
const char *zDbName, /* Database name or NULL */
130600130623
const char *zTableName, /* Table name */
130601130624
const char *zColumnName, /* Column name */
130602130625
char const **pzDataType, /* OUTPUT: Declared data type */
@@ -130710,11 +130733,11 @@
130710130733
}
130711130734
130712130735
/*
130713130736
** Sleep for a little while. Return the amount of time slept.
130714130737
*/
130715
-SQLITE_API int sqlite3_sleep(int ms){
130738
+SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int ms){
130716130739
sqlite3_vfs *pVfs;
130717130740
int rc;
130718130741
pVfs = sqlite3_vfs_find(0);
130719130742
if( pVfs==0 ) return 0;
130720130743
@@ -130726,11 +130749,11 @@
130726130749
}
130727130750
130728130751
/*
130729130752
** Enable or disable the extended result codes.
130730130753
*/
130731
-SQLITE_API int sqlite3_extended_result_codes(sqlite3 *db, int onoff){
130754
+SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3 *db, int onoff){
130732130755
#ifdef SQLITE_ENABLE_API_ARMOR
130733130756
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
130734130757
#endif
130735130758
sqlite3_mutex_enter(db->mutex);
130736130759
db->errMask = onoff ? 0xffffffff : 0xff;
@@ -130739,11 +130762,11 @@
130739130762
}
130740130763
130741130764
/*
130742130765
** Invoke the xFileControl method on a particular database.
130743130766
*/
130744
-SQLITE_API int sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
130767
+SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
130745130768
int rc = SQLITE_ERROR;
130746130769
Btree *pBtree;
130747130770
130748130771
#ifdef SQLITE_ENABLE_API_ARMOR
130749130772
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -130773,11 +130796,11 @@
130773130796
}
130774130797
130775130798
/*
130776130799
** Interface to the testing logic.
130777130800
*/
130778
-SQLITE_API int sqlite3_test_control(int op, ...){
130801
+SQLITE_API int SQLITE_CDECL sqlite3_test_control(int op, ...){
130779130802
int rc = 0;
130780130803
#ifndef SQLITE_OMIT_BUILTIN_TEST
130781130804
va_list ap;
130782130805
va_start(ap, op);
130783130806
switch( op ){
@@ -131116,11 +131139,11 @@
131116131139
** method of a VFS implementation. The zParam argument is the name of the
131117131140
** query parameter we seek. This routine returns the value of the zParam
131118131141
** parameter if it exists. If the parameter does not exist, this routine
131119131142
** returns a NULL pointer.
131120131143
*/
131121
-SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam){
131144
+SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam){
131122131145
if( zFilename==0 || zParam==0 ) return 0;
131123131146
zFilename += sqlite3Strlen30(zFilename) + 1;
131124131147
while( zFilename[0] ){
131125131148
int x = strcmp(zFilename, zParam);
131126131149
zFilename += sqlite3Strlen30(zFilename) + 1;
@@ -131131,20 +131154,20 @@
131131131154
}
131132131155
131133131156
/*
131134131157
** Return a boolean value for a query parameter.
131135131158
*/
131136
-SQLITE_API int sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){
131159
+SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){
131137131160
const char *z = sqlite3_uri_parameter(zFilename, zParam);
131138131161
bDflt = bDflt!=0;
131139131162
return z ? sqlite3GetBoolean(z, bDflt) : bDflt;
131140131163
}
131141131164
131142131165
/*
131143131166
** Return a 64-bit integer value for a query parameter.
131144131167
*/
131145
-SQLITE_API sqlite3_int64 sqlite3_uri_int64(
131168
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(
131146131169
const char *zFilename, /* Filename as passed to xOpen */
131147131170
const char *zParam, /* URI parameter sought */
131148131171
sqlite3_int64 bDflt /* return if parameter is missing */
131149131172
){
131150131173
const char *z = sqlite3_uri_parameter(zFilename, zParam);
@@ -131172,11 +131195,11 @@
131172131195
131173131196
/*
131174131197
** Return the filename of the database associated with a database
131175131198
** connection.
131176131199
*/
131177
-SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName){
131200
+SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName){
131178131201
Btree *pBt;
131179131202
#ifdef SQLITE_ENABLE_API_ARMOR
131180131203
if( !sqlite3SafetyCheckOk(db) ){
131181131204
(void)SQLITE_MISUSE_BKPT;
131182131205
return 0;
@@ -131188,11 +131211,11 @@
131188131211
131189131212
/*
131190131213
** Return 1 if database is read-only or 0 if read/write. Return -1 if
131191131214
** no such database exists.
131192131215
*/
131193
-SQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName){
131216
+SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName){
131194131217
Btree *pBt;
131195131218
#ifdef SQLITE_ENABLE_API_ARMOR
131196131219
if( !sqlite3SafetyCheckOk(db) ){
131197131220
(void)SQLITE_MISUSE_BKPT;
131198131221
return -1;
@@ -131347,11 +131370,11 @@
131347131370
**
131348131371
** Each call to this routine overrides any prior callbacks registered
131349131372
** on the same "db". If xNotify==0 then any prior callbacks are immediately
131350131373
** cancelled.
131351131374
*/
131352
-SQLITE_API int sqlite3_unlock_notify(
131375
+SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
131353131376
sqlite3 *db,
131354131377
void (*xNotify)(void **, int),
131355131378
void *pArg
131356131379
){
131357131380
int rc = SQLITE_OK;
@@ -133525,11 +133548,11 @@
133525133548
int nName; /* Bytes required to hold table name */
133526133549
int isFts4 = (argv[0][3]=='4'); /* True for FTS4, false for FTS3 */
133527133550
const char **aCol; /* Array of column names */
133528133551
sqlite3_tokenizer *pTokenizer = 0; /* Tokenizer for this table */
133529133552
133530
- int nIndex; /* Size of aIndex[] array */
133553
+ int nIndex = 0; /* Size of aIndex[] array */
133531133554
struct Fts3Index *aIndex = 0; /* Array of indexes for this table */
133532133555
133533133556
/* The results of parsing supported FTS4 key=value options: */
133534133557
int bNoDocsize = 0; /* True to omit %_docsize table */
133535133558
int bDescIdx = 0; /* True to store descending indexes */
@@ -138213,11 +138236,11 @@
138213138236
** Initialize API pointer table, if required.
138214138237
*/
138215138238
#ifdef _WIN32
138216138239
__declspec(dllexport)
138217138240
#endif
138218
-SQLITE_API int sqlite3_fts3_init(
138241
+SQLITE_API int SQLITE_STDCALL sqlite3_fts3_init(
138219138242
sqlite3 *db,
138220138243
char **pzErrMsg,
138221138244
const sqlite3_api_routines *pApi
138222138245
){
138223138246
SQLITE_EXTENSION_INIT2(pApi)
@@ -153660,11 +153683,11 @@
153660153683
}
153661153684
153662153685
/*
153663153686
** Register a new geometry function for use with the r-tree MATCH operator.
153664153687
*/
153665
-SQLITE_API int sqlite3_rtree_geometry_callback(
153688
+SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
153666153689
sqlite3 *db, /* Register SQL function on this connection */
153667153690
const char *zGeom, /* Name of the new SQL function */
153668153691
int (*xGeom)(sqlite3_rtree_geometry*,int,RtreeDValue*,int*), /* Callback */
153669153692
void *pContext /* Extra data associated with the callback */
153670153693
){
@@ -153684,11 +153707,11 @@
153684153707
153685153708
/*
153686153709
** Register a new 2nd-generation geometry function for use with the
153687153710
** r-tree MATCH operator.
153688153711
*/
153689
-SQLITE_API int sqlite3_rtree_query_callback(
153712
+SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
153690153713
sqlite3 *db, /* Register SQL function on this connection */
153691153714
const char *zQueryFunc, /* Name of new SQL function */
153692153715
int (*xQueryFunc)(sqlite3_rtree_query_info*), /* Callback */
153693153716
void *pContext, /* Extra data passed into the callback */
153694153717
void (*xDestructor)(void*) /* Destructor for the extra data */
@@ -153709,11 +153732,11 @@
153709153732
153710153733
#if !SQLITE_CORE
153711153734
#ifdef _WIN32
153712153735
__declspec(dllexport)
153713153736
#endif
153714
-SQLITE_API int sqlite3_rtree_init(
153737
+SQLITE_API int SQLITE_STDCALL sqlite3_rtree_init(
153715153738
sqlite3 *db,
153716153739
char **pzErrMsg,
153717153740
const sqlite3_api_routines *pApi
153718153741
){
153719153742
SQLITE_EXTENSION_INIT2(pApi)
@@ -154214,11 +154237,11 @@
154214154237
154215154238
#if !SQLITE_CORE
154216154239
#ifdef _WIN32
154217154240
__declspec(dllexport)
154218154241
#endif
154219
-SQLITE_API int sqlite3_icu_init(
154242
+SQLITE_API int SQLITE_STDCALL sqlite3_icu_init(
154220154243
sqlite3 *db,
154221154244
char **pzErrMsg,
154222154245
const sqlite3_api_routines *pApi
154223154246
){
154224154247
SQLITE_EXTENSION_INIT2(pApi)
154225154248
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -20,13 +20,10 @@
20 #define SQLITE_CORE 1
21 #define SQLITE_AMALGAMATION 1
22 #ifndef SQLITE_PRIVATE
23 # define SQLITE_PRIVATE static
24 #endif
25 #ifndef SQLITE_API
26 # define SQLITE_API
27 #endif
28 /************** Begin file sqliteInt.h ***************************************/
29 /*
30 ** 2001 September 15
31 **
32 ** The author disclaims copyright to this source code. In place of
@@ -250,27 +247,24 @@
250 extern "C" {
251 #endif
252
253
254 /*
255 ** Add the ability to override 'extern'
256 */
257 #ifndef SQLITE_EXTERN
258 # define SQLITE_EXTERN extern
259 #endif
260
261 #ifndef SQLITE_API
262 # define SQLITE_API
263 #endif
264
265
266 /*
267 ** Add the ability to override 'cdecl'
268 */
269 #ifndef SQLITE_CDECL
270 # define SQLITE_CDECL
271 #endif
 
 
 
272
273 /*
274 ** These no-op macros are used in front of interfaces to mark those
275 ** interfaces as either deprecated or experimental. New applications
276 ** should not use deprecated interfaces - they are supported for backwards
@@ -323,11 +317,11 @@
323 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
324 ** [sqlite_version()] and [sqlite_source_id()].
325 */
326 #define SQLITE_VERSION "3.8.9"
327 #define SQLITE_VERSION_NUMBER 3008009
328 #define SQLITE_SOURCE_ID "2015-03-24 18:19:39 436314b5728c9413f9ac2d837e1c19364f31be72"
329
330 /*
331 ** CAPI3REF: Run-Time Library Version Numbers
332 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
333 **
@@ -356,13 +350,13 @@
356 ** [SQLITE_SOURCE_ID] C preprocessor macro.
357 **
358 ** See also: [sqlite_version()] and [sqlite_source_id()].
359 */
360 SQLITE_API const char sqlite3_version[] = SQLITE_VERSION;
361 SQLITE_API const char *sqlite3_libversion(void);
362 SQLITE_API const char *sqlite3_sourceid(void);
363 SQLITE_API int sqlite3_libversion_number(void);
364
365 /*
366 ** CAPI3REF: Run-Time Library Compilation Options Diagnostics
367 **
368 ** ^The sqlite3_compileoption_used() function returns 0 or 1
@@ -383,12 +377,12 @@
383 **
384 ** See also: SQL functions [sqlite_compileoption_used()] and
385 ** [sqlite_compileoption_get()] and the [compile_options pragma].
386 */
387 #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
388 SQLITE_API int sqlite3_compileoption_used(const char *zOptName);
389 SQLITE_API const char *sqlite3_compileoption_get(int N);
390 #endif
391
392 /*
393 ** CAPI3REF: Test To See If The Library Is Threadsafe
394 **
@@ -423,11 +417,11 @@
423 ** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
424 ** is unchanged by calls to sqlite3_config().)^
425 **
426 ** See the [threading mode] documentation for additional information.
427 */
428 SQLITE_API int sqlite3_threadsafe(void);
429
430 /*
431 ** CAPI3REF: Database Connection Handle
432 ** KEYWORDS: {database connection} {database connections}
433 **
@@ -519,12 +513,12 @@
519 ** from [sqlite3_open()], [sqlite3_open16()], or
520 ** [sqlite3_open_v2()], and not previously closed.
521 ** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
522 ** argument is a harmless no-op.
523 */
524 SQLITE_API int sqlite3_close(sqlite3*);
525 SQLITE_API int sqlite3_close_v2(sqlite3*);
526
527 /*
528 ** The type for a callback function.
529 ** This is legacy and deprecated. It is included for historical
530 ** compatibility and is not documented.
@@ -590,11 +584,11 @@
590 ** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
591 ** <li> The application must not modify the SQL statement text passed into
592 ** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
593 ** </ul>
594 */
595 SQLITE_API int sqlite3_exec(
596 sqlite3*, /* An open database */
597 const char *sql, /* SQL to be evaluated */
598 int (*callback)(void*,int,char**,char**), /* Callback function */
599 void *, /* 1st argument to callback */
600 char **errmsg /* Error msg written here */
@@ -1550,14 +1544,14 @@
1550 ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied
1551 ** implementation of sqlite3_os_init() or sqlite3_os_end()
1552 ** must return [SQLITE_OK] on success and some other [error code] upon
1553 ** failure.
1554 */
1555 SQLITE_API int sqlite3_initialize(void);
1556 SQLITE_API int sqlite3_shutdown(void);
1557 SQLITE_API int sqlite3_os_init(void);
1558 SQLITE_API int sqlite3_os_end(void);
1559
1560 /*
1561 ** CAPI3REF: Configuring The SQLite Library
1562 **
1563 ** The sqlite3_config() interface is used to make global configuration
@@ -1584,11 +1578,11 @@
1584 **
1585 ** ^When a configuration option is set, sqlite3_config() returns [SQLITE_OK].
1586 ** ^If the option is unknown or SQLite is unable to set the option
1587 ** then this routine returns a non-zero [error code].
1588 */
1589 SQLITE_API int sqlite3_config(int, ...);
1590
1591 /*
1592 ** CAPI3REF: Configure database connections
1593 **
1594 ** The sqlite3_db_config() interface is used to make configuration
@@ -1602,11 +1596,11 @@
1602 ** Subsequent arguments vary depending on the configuration verb.
1603 **
1604 ** ^Calls to sqlite3_db_config() return SQLITE_OK if and only if
1605 ** the call is considered successful.
1606 */
1607 SQLITE_API int sqlite3_db_config(sqlite3*, int op, ...);
1608
1609 /*
1610 ** CAPI3REF: Memory Allocation Routines
1611 **
1612 ** An instance of this object defines the interface between SQLite
@@ -2090,11 +2084,11 @@
2090 **
2091 ** ^The sqlite3_extended_result_codes() routine enables or disables the
2092 ** [extended result codes] feature of SQLite. ^The extended result
2093 ** codes are disabled by default for historical compatibility.
2094 */
2095 SQLITE_API int sqlite3_extended_result_codes(sqlite3*, int onoff);
2096
2097 /*
2098 ** CAPI3REF: Last Insert Rowid
2099 **
2100 ** ^Each entry in most SQLite tables (except for [WITHOUT ROWID] tables)
@@ -2141,11 +2135,11 @@
2141 ** function is running and thus changes the last insert [rowid],
2142 ** then the value returned by [sqlite3_last_insert_rowid()] is
2143 ** unpredictable and might not equal either the old or the new
2144 ** last insert [rowid].
2145 */
2146 SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*);
2147
2148 /*
2149 ** CAPI3REF: Count The Number Of Rows Modified
2150 **
2151 ** ^This function returns the number of rows modified, inserted or
@@ -2193,11 +2187,11 @@
2193 **
2194 ** If a separate thread makes changes on the same database connection
2195 ** while [sqlite3_changes()] is running then the value returned
2196 ** is unpredictable and not meaningful.
2197 */
2198 SQLITE_API int sqlite3_changes(sqlite3*);
2199
2200 /*
2201 ** CAPI3REF: Total Number Of Rows Modified
2202 **
2203 ** ^This function returns the total number of rows inserted, modified or
@@ -2216,11 +2210,11 @@
2216 **
2217 ** If a separate thread makes changes on the same database connection
2218 ** while [sqlite3_total_changes()] is running then the value
2219 ** returned is unpredictable and not meaningful.
2220 */
2221 SQLITE_API int sqlite3_total_changes(sqlite3*);
2222
2223 /*
2224 ** CAPI3REF: Interrupt A Long-Running Query
2225 **
2226 ** ^This function causes any pending database operation to abort and
@@ -2255,11 +2249,11 @@
2255 ** that are started after the sqlite3_interrupt() call returns.
2256 **
2257 ** If the database connection closes while [sqlite3_interrupt()]
2258 ** is running then bad things will likely happen.
2259 */
2260 SQLITE_API void sqlite3_interrupt(sqlite3*);
2261
2262 /*
2263 ** CAPI3REF: Determine If An SQL Statement Is Complete
2264 **
2265 ** These routines are useful during command-line input to determine if the
@@ -2290,12 +2284,12 @@
2290 ** UTF-8 string.
2291 **
2292 ** The input to [sqlite3_complete16()] must be a zero-terminated
2293 ** UTF-16 string in native byte order.
2294 */
2295 SQLITE_API int sqlite3_complete(const char *sql);
2296 SQLITE_API int sqlite3_complete16(const void *sql);
2297
2298 /*
2299 ** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
2300 ** KEYWORDS: {busy-handler callback} {busy handler}
2301 **
@@ -2351,11 +2345,11 @@
2351 ** result in undefined behavior.
2352 **
2353 ** A busy handler must not close the database connection
2354 ** or [prepared statement] that invoked the busy handler.
2355 */
2356 SQLITE_API int sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*);
2357
2358 /*
2359 ** CAPI3REF: Set A Busy Timeout
2360 **
2361 ** ^This routine sets a [sqlite3_busy_handler | busy handler] that sleeps
@@ -2373,11 +2367,11 @@
2373 ** was defined (using [sqlite3_busy_handler()]) prior to calling
2374 ** this routine, that other busy handler is cleared.)^
2375 **
2376 ** See also: [PRAGMA busy_timeout]
2377 */
2378 SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms);
2379
2380 /*
2381 ** CAPI3REF: Convenience Routines For Running Queries
2382 **
2383 ** This is a legacy interface that is preserved for backwards compatibility.
@@ -2447,19 +2441,19 @@
2447 ** interface defined here. As a consequence, errors that occur in the
2448 ** wrapper layer outside of the internal [sqlite3_exec()] call are not
2449 ** reflected in subsequent calls to [sqlite3_errcode()] or
2450 ** [sqlite3_errmsg()].
2451 */
2452 SQLITE_API int sqlite3_get_table(
2453 sqlite3 *db, /* An open database */
2454 const char *zSql, /* SQL to be evaluated */
2455 char ***pazResult, /* Results of the query */
2456 int *pnRow, /* Number of result rows written here */
2457 int *pnColumn, /* Number of result columns written here */
2458 char **pzErrmsg /* Error msg written here */
2459 );
2460 SQLITE_API void sqlite3_free_table(char **result);
2461
2462 /*
2463 ** CAPI3REF: Formatted String Printing Functions
2464 **
2465 ** These routines are work-alikes of the "printf()" family of functions
@@ -2561,14 +2555,14 @@
2561 **
2562 ** ^(The "%z" formatting option works like "%s" but with the
2563 ** addition that after the string has been read and copied into
2564 ** the result, [sqlite3_free()] is called on the input string.)^
2565 */
2566 SQLITE_API char *sqlite3_mprintf(const char*,...);
2567 SQLITE_API char *sqlite3_vmprintf(const char*, va_list);
2568 SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...);
2569 SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);
2570
2571 /*
2572 ** CAPI3REF: Memory Allocation Subsystem
2573 **
2574 ** The SQLite core uses these three routines for all of its own
@@ -2654,16 +2648,16 @@
2654 **
2655 ** The application must not read or write any part of
2656 ** a block of memory after it has been released using
2657 ** [sqlite3_free()] or [sqlite3_realloc()].
2658 */
2659 SQLITE_API void *sqlite3_malloc(int);
2660 SQLITE_API void *sqlite3_malloc64(sqlite3_uint64);
2661 SQLITE_API void *sqlite3_realloc(void*, int);
2662 SQLITE_API void *sqlite3_realloc64(void*, sqlite3_uint64);
2663 SQLITE_API void sqlite3_free(void*);
2664 SQLITE_API sqlite3_uint64 sqlite3_msize(void*);
2665
2666 /*
2667 ** CAPI3REF: Memory Allocator Statistics
2668 **
2669 ** SQLite provides these two interfaces for reporting on the status
@@ -2684,12 +2678,12 @@
2684 ** [sqlite3_memory_used()] if and only if the parameter to
2685 ** [sqlite3_memory_highwater()] is true. ^The value returned
2686 ** by [sqlite3_memory_highwater(1)] is the high-water mark
2687 ** prior to the reset.
2688 */
2689 SQLITE_API sqlite3_int64 sqlite3_memory_used(void);
2690 SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int resetFlag);
2691
2692 /*
2693 ** CAPI3REF: Pseudo-Random Number Generator
2694 **
2695 ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
@@ -2708,11 +2702,11 @@
2708 ** ^If the previous call to this routine had an N of 1 or more and a
2709 ** non-NULL P then the pseudo-randomness is generated
2710 ** internally and without recourse to the [sqlite3_vfs] xRandomness
2711 ** method.
2712 */
2713 SQLITE_API void sqlite3_randomness(int N, void *P);
2714
2715 /*
2716 ** CAPI3REF: Compile-Time Authorization Callbacks
2717 **
2718 ** ^This routine registers an authorizer callback with a particular
@@ -2790,11 +2784,11 @@
2790 ** [sqlite3_prepare()] or its variants. Authorization is not
2791 ** performed during statement evaluation in [sqlite3_step()], unless
2792 ** as stated in the previous paragraph, sqlite3_step() invokes
2793 ** sqlite3_prepare_v2() to reprepare a statement after a schema change.
2794 */
2795 SQLITE_API int sqlite3_set_authorizer(
2796 sqlite3*,
2797 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
2798 void *pUserData
2799 );
2800
@@ -2894,12 +2888,12 @@
2894 ** digits in the time are meaningless. Future versions of SQLite
2895 ** might provide greater resolution on the profiler callback. The
2896 ** sqlite3_profile() function is considered experimental and is
2897 ** subject to change in future versions of SQLite.
2898 */
2899 SQLITE_API void *sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*);
2900 SQLITE_API SQLITE_EXPERIMENTAL void *sqlite3_profile(sqlite3*,
2901 void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
2902
2903 /*
2904 ** CAPI3REF: Query Progress Callbacks
2905 **
@@ -2929,11 +2923,11 @@
2929 ** the database connection that invoked the progress handler.
2930 ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
2931 ** database connections for the meaning of "modify" in this paragraph.
2932 **
2933 */
2934 SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
2935
2936 /*
2937 ** CAPI3REF: Opening A New Database Connection
2938 **
2939 ** ^These routines open an SQLite database file as specified by the
@@ -3157,19 +3151,19 @@
3157 ** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various
3158 ** features that require the use of temporary files may fail.
3159 **
3160 ** See also: [sqlite3_temp_directory]
3161 */
3162 SQLITE_API int sqlite3_open(
3163 const char *filename, /* Database filename (UTF-8) */
3164 sqlite3 **ppDb /* OUT: SQLite db handle */
3165 );
3166 SQLITE_API int sqlite3_open16(
3167 const void *filename, /* Database filename (UTF-16) */
3168 sqlite3 **ppDb /* OUT: SQLite db handle */
3169 );
3170 SQLITE_API int sqlite3_open_v2(
3171 const char *filename, /* Database filename (UTF-8) */
3172 sqlite3 **ppDb, /* OUT: SQLite db handle */
3173 int flags, /* Flags */
3174 const char *zVfs /* Name of VFS module to use */
3175 );
@@ -3211,13 +3205,13 @@
3211 ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and
3212 ** is not a database file pathname pointer that SQLite passed into the xOpen
3213 ** VFS method, then the behavior of this routine is undefined and probably
3214 ** undesirable.
3215 */
3216 SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3217 SQLITE_API int sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3218 SQLITE_API sqlite3_int64 sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
3219
3220
3221 /*
3222 ** CAPI3REF: Error Codes And Messages
3223 **
@@ -3256,15 +3250,15 @@
3256 **
3257 ** If an interface fails with SQLITE_MISUSE, that means the interface
3258 ** was invoked incorrectly by the application. In that case, the
3259 ** error code and message may or may not be set.
3260 */
3261 SQLITE_API int sqlite3_errcode(sqlite3 *db);
3262 SQLITE_API int sqlite3_extended_errcode(sqlite3 *db);
3263 SQLITE_API const char *sqlite3_errmsg(sqlite3*);
3264 SQLITE_API const void *sqlite3_errmsg16(sqlite3*);
3265 SQLITE_API const char *sqlite3_errstr(int);
3266
3267 /*
3268 ** CAPI3REF: SQL Statement Object
3269 ** KEYWORDS: {prepared statement} {prepared statements}
3270 **
@@ -3327,11 +3321,11 @@
3327 ** created by an untrusted script can be contained using the
3328 ** [max_page_count] [PRAGMA].
3329 **
3330 ** New run-time limit categories may be added in future releases.
3331 */
3332 SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal);
3333
3334 /*
3335 ** CAPI3REF: Run-Time Limit Categories
3336 ** KEYWORDS: {limit category} {*limit categories}
3337 **
@@ -3477,32 +3471,32 @@
3477 ** or [GLOB] operator or if the parameter is compared to an indexed column
3478 ** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
3479 ** </li>
3480 ** </ol>
3481 */
3482 SQLITE_API int sqlite3_prepare(
3483 sqlite3 *db, /* Database handle */
3484 const char *zSql, /* SQL statement, UTF-8 encoded */
3485 int nByte, /* Maximum length of zSql in bytes. */
3486 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3487 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3488 );
3489 SQLITE_API int sqlite3_prepare_v2(
3490 sqlite3 *db, /* Database handle */
3491 const char *zSql, /* SQL statement, UTF-8 encoded */
3492 int nByte, /* Maximum length of zSql in bytes. */
3493 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3494 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3495 );
3496 SQLITE_API int sqlite3_prepare16(
3497 sqlite3 *db, /* Database handle */
3498 const void *zSql, /* SQL statement, UTF-16 encoded */
3499 int nByte, /* Maximum length of zSql in bytes. */
3500 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3501 const void **pzTail /* OUT: Pointer to unused portion of zSql */
3502 );
3503 SQLITE_API int sqlite3_prepare16_v2(
3504 sqlite3 *db, /* Database handle */
3505 const void *zSql, /* SQL statement, UTF-16 encoded */
3506 int nByte, /* Maximum length of zSql in bytes. */
3507 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3508 const void **pzTail /* OUT: Pointer to unused portion of zSql */
@@ -3513,11 +3507,11 @@
3513 **
3514 ** ^This interface can be used to retrieve a saved copy of the original
3515 ** SQL text used to create a [prepared statement] if that statement was
3516 ** compiled using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()].
3517 */
3518 SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt);
3519
3520 /*
3521 ** CAPI3REF: Determine If An SQL Statement Writes The Database
3522 **
3523 ** ^The sqlite3_stmt_readonly(X) interface returns true (non-zero) if
@@ -3544,11 +3538,11 @@
3544 ** database. ^The [ATTACH] and [DETACH] statements also cause
3545 ** sqlite3_stmt_readonly() to return true since, while those statements
3546 ** change the configuration of a database connection, they do not make
3547 ** changes to the content of the database files on disk.
3548 */
3549 SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
3550
3551 /*
3552 ** CAPI3REF: Determine If A Prepared Statement Has Been Reset
3553 **
3554 ** ^The sqlite3_stmt_busy(S) interface returns true (non-zero) if the
@@ -3563,11 +3557,11 @@
3563 ** to locate all prepared statements associated with a database
3564 ** connection that are in need of being reset. This can be used,
3565 ** for example, in diagnostic routines to search for prepared
3566 ** statements that are holding a transaction open.
3567 */
3568 SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt*);
3569
3570 /*
3571 ** CAPI3REF: Dynamically Typed Value Object
3572 ** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
3573 **
@@ -3724,23 +3718,23 @@
3724 ** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails.
3725 **
3726 ** See also: [sqlite3_bind_parameter_count()],
3727 ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].
3728 */
3729 SQLITE_API int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
3730 SQLITE_API int sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
3731 void(*)(void*));
3732 SQLITE_API int sqlite3_bind_double(sqlite3_stmt*, int, double);
3733 SQLITE_API int sqlite3_bind_int(sqlite3_stmt*, int, int);
3734 SQLITE_API int sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
3735 SQLITE_API int sqlite3_bind_null(sqlite3_stmt*, int);
3736 SQLITE_API int sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
3737 SQLITE_API int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
3738 SQLITE_API int sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
3739 void(*)(void*), unsigned char encoding);
3740 SQLITE_API int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
3741 SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
3742
3743 /*
3744 ** CAPI3REF: Number Of SQL Parameters
3745 **
3746 ** ^This routine can be used to find the number of [SQL parameters]
@@ -3756,11 +3750,11 @@
3756 **
3757 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3758 ** [sqlite3_bind_parameter_name()], and
3759 ** [sqlite3_bind_parameter_index()].
3760 */
3761 SQLITE_API int sqlite3_bind_parameter_count(sqlite3_stmt*);
3762
3763 /*
3764 ** CAPI3REF: Name Of A Host Parameter
3765 **
3766 ** ^The sqlite3_bind_parameter_name(P,N) interface returns
@@ -3783,11 +3777,11 @@
3783 **
3784 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3785 ** [sqlite3_bind_parameter_count()], and
3786 ** [sqlite3_bind_parameter_index()].
3787 */
3788 SQLITE_API const char *sqlite3_bind_parameter_name(sqlite3_stmt*, int);
3789
3790 /*
3791 ** CAPI3REF: Index Of A Parameter With A Given Name
3792 **
3793 ** ^Return the index of an SQL parameter given its name. ^The
@@ -3799,20 +3793,20 @@
3799 **
3800 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3801 ** [sqlite3_bind_parameter_count()], and
3802 ** [sqlite3_bind_parameter_index()].
3803 */
3804 SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
3805
3806 /*
3807 ** CAPI3REF: Reset All Bindings On A Prepared Statement
3808 **
3809 ** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset
3810 ** the [sqlite3_bind_blob | bindings] on a [prepared statement].
3811 ** ^Use this routine to reset all host parameters to NULL.
3812 */
3813 SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt*);
3814
3815 /*
3816 ** CAPI3REF: Number Of Columns In A Result Set
3817 **
3818 ** ^Return the number of columns in the result set returned by the
@@ -3819,11 +3813,11 @@
3819 ** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
3820 ** statement that does not return data (for example an [UPDATE]).
3821 **
3822 ** See also: [sqlite3_data_count()]
3823 */
3824 SQLITE_API int sqlite3_column_count(sqlite3_stmt *pStmt);
3825
3826 /*
3827 ** CAPI3REF: Column Names In A Result Set
3828 **
3829 ** ^These routines return the name assigned to a particular column
@@ -3847,12 +3841,12 @@
3847 ** ^The name of a result column is the value of the "AS" clause for
3848 ** that column, if there is an AS clause. If there is no AS clause
3849 ** then the name of the column is unspecified and may change from
3850 ** one release of SQLite to the next.
3851 */
3852 SQLITE_API const char *sqlite3_column_name(sqlite3_stmt*, int N);
3853 SQLITE_API const void *sqlite3_column_name16(sqlite3_stmt*, int N);
3854
3855 /*
3856 ** CAPI3REF: Source Of Data In A Query Result
3857 **
3858 ** ^These routines provide a means to determine the database, table, and
@@ -3895,16 +3889,16 @@
3895 ** If two or more threads call one or more
3896 ** [sqlite3_column_database_name | column metadata interfaces]
3897 ** for the same [prepared statement] and result column
3898 ** at the same time then the results are undefined.
3899 */
3900 SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int);
3901 SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int);
3902 SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int);
3903 SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int);
3904 SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int);
3905 SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);
3906
3907 /*
3908 ** CAPI3REF: Declared Datatype Of A Query Result
3909 **
3910 ** ^(The first parameter is a [prepared statement].
@@ -3931,12 +3925,12 @@
3931 ** data stored in that column is of the declared type. SQLite is
3932 ** strongly typed, but the typing is dynamic not static. ^Type
3933 ** is associated with individual values, not with the containers
3934 ** used to hold those values.
3935 */
3936 SQLITE_API const char *sqlite3_column_decltype(sqlite3_stmt*,int);
3937 SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int);
3938
3939 /*
3940 ** CAPI3REF: Evaluate An SQL Statement
3941 **
3942 ** After a [prepared statement] has been prepared using either
@@ -4011,11 +4005,11 @@
4011 ** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
4012 ** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,
4013 ** then the more specific [error codes] are returned directly
4014 ** by sqlite3_step(). The use of the "v2" interface is recommended.
4015 */
4016 SQLITE_API int sqlite3_step(sqlite3_stmt*);
4017
4018 /*
4019 ** CAPI3REF: Number of columns in a result set
4020 **
4021 ** ^The sqlite3_data_count(P) interface returns the number of columns in the
@@ -4031,11 +4025,11 @@
4031 ** where it always returns zero since each step of that multi-step
4032 ** pragma returns 0 columns of data.
4033 **
4034 ** See also: [sqlite3_column_count()]
4035 */
4036 SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt);
4037
4038 /*
4039 ** CAPI3REF: Fundamental Datatypes
4040 ** KEYWORDS: SQLITE_TEXT
4041 **
@@ -4227,20 +4221,20 @@
4227 ** of these routines, a default value is returned. The default value
4228 ** is either the integer 0, the floating point number 0.0, or a NULL
4229 ** pointer. Subsequent calls to [sqlite3_errcode()] will return
4230 ** [SQLITE_NOMEM].)^
4231 */
4232 SQLITE_API const void *sqlite3_column_blob(sqlite3_stmt*, int iCol);
4233 SQLITE_API int sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4234 SQLITE_API int sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4235 SQLITE_API double sqlite3_column_double(sqlite3_stmt*, int iCol);
4236 SQLITE_API int sqlite3_column_int(sqlite3_stmt*, int iCol);
4237 SQLITE_API sqlite3_int64 sqlite3_column_int64(sqlite3_stmt*, int iCol);
4238 SQLITE_API const unsigned char *sqlite3_column_text(sqlite3_stmt*, int iCol);
4239 SQLITE_API const void *sqlite3_column_text16(sqlite3_stmt*, int iCol);
4240 SQLITE_API int sqlite3_column_type(sqlite3_stmt*, int iCol);
4241 SQLITE_API sqlite3_value *sqlite3_column_value(sqlite3_stmt*, int iCol);
4242
4243 /*
4244 ** CAPI3REF: Destroy A Prepared Statement Object
4245 **
4246 ** ^The sqlite3_finalize() function is called to delete a [prepared statement].
@@ -4263,11 +4257,11 @@
4263 ** resource leaks. It is a grievous error for the application to try to use
4264 ** a prepared statement after it has been finalized. Any use of a prepared
4265 ** statement after it has been finalized can result in undefined and
4266 ** undesirable behavior such as segfaults and heap corruption.
4267 */
4268 SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt);
4269
4270 /*
4271 ** CAPI3REF: Reset A Prepared Statement Object
4272 **
4273 ** The sqlite3_reset() function is called to reset a [prepared statement]
@@ -4289,11 +4283,11 @@
4289 ** [sqlite3_reset(S)] returns an appropriate [error code].
4290 **
4291 ** ^The [sqlite3_reset(S)] interface does not change the values
4292 ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
4293 */
4294 SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt);
4295
4296 /*
4297 ** CAPI3REF: Create Or Redefine SQL Functions
4298 ** KEYWORDS: {function creation routines}
4299 ** KEYWORDS: {application-defined SQL function}
@@ -4388,31 +4382,31 @@
4388 ** ^An application-defined function is permitted to call other
4389 ** SQLite interfaces. However, such calls must not
4390 ** close the database connection nor finalize or reset the prepared
4391 ** statement in which the function is running.
4392 */
4393 SQLITE_API int sqlite3_create_function(
4394 sqlite3 *db,
4395 const char *zFunctionName,
4396 int nArg,
4397 int eTextRep,
4398 void *pApp,
4399 void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4400 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4401 void (*xFinal)(sqlite3_context*)
4402 );
4403 SQLITE_API int sqlite3_create_function16(
4404 sqlite3 *db,
4405 const void *zFunctionName,
4406 int nArg,
4407 int eTextRep,
4408 void *pApp,
4409 void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4410 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4411 void (*xFinal)(sqlite3_context*)
4412 );
4413 SQLITE_API int sqlite3_create_function_v2(
4414 sqlite3 *db,
4415 const char *zFunctionName,
4416 int nArg,
4417 int eTextRep,
4418 void *pApp,
@@ -4454,16 +4448,16 @@
4454 ** to be supported. However, new applications should avoid
4455 ** the use of these functions. To encourage programmers to avoid
4456 ** these functions, we will not explain what they do.
4457 */
4458 #ifndef SQLITE_OMIT_DEPRECATED
4459 SQLITE_API SQLITE_DEPRECATED int sqlite3_aggregate_count(sqlite3_context*);
4460 SQLITE_API SQLITE_DEPRECATED int sqlite3_expired(sqlite3_stmt*);
4461 SQLITE_API SQLITE_DEPRECATED int sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4462 SQLITE_API SQLITE_DEPRECATED int sqlite3_global_recover(void);
4463 SQLITE_API SQLITE_DEPRECATED void sqlite3_thread_cleanup(void);
4464 SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
4465 void*,sqlite3_int64);
4466 #endif
4467
4468 /*
4469 ** CAPI3REF: Obtaining SQL Function Parameter Values
@@ -4508,22 +4502,22 @@
4508 ** or [sqlite3_value_text16()].
4509 **
4510 ** These routines must be called from the same thread as
4511 ** the SQL function that supplied the [sqlite3_value*] parameters.
4512 */
4513 SQLITE_API const void *sqlite3_value_blob(sqlite3_value*);
4514 SQLITE_API int sqlite3_value_bytes(sqlite3_value*);
4515 SQLITE_API int sqlite3_value_bytes16(sqlite3_value*);
4516 SQLITE_API double sqlite3_value_double(sqlite3_value*);
4517 SQLITE_API int sqlite3_value_int(sqlite3_value*);
4518 SQLITE_API sqlite3_int64 sqlite3_value_int64(sqlite3_value*);
4519 SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value*);
4520 SQLITE_API const void *sqlite3_value_text16(sqlite3_value*);
4521 SQLITE_API const void *sqlite3_value_text16le(sqlite3_value*);
4522 SQLITE_API const void *sqlite3_value_text16be(sqlite3_value*);
4523 SQLITE_API int sqlite3_value_type(sqlite3_value*);
4524 SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*);
4525
4526 /*
4527 ** CAPI3REF: Obtain Aggregate Function Context
4528 **
4529 ** Implementations of aggregate SQL functions use this
@@ -4563,11 +4557,11 @@
4563 ** function.
4564 **
4565 ** This routine must be called from the same thread in which
4566 ** the aggregate SQL function is running.
4567 */
4568 SQLITE_API void *sqlite3_aggregate_context(sqlite3_context*, int nBytes);
4569
4570 /*
4571 ** CAPI3REF: User Data For Functions
4572 **
4573 ** ^The sqlite3_user_data() interface returns a copy of
@@ -4577,11 +4571,11 @@
4577 ** registered the application defined function.
4578 **
4579 ** This routine must be called from the same thread in which
4580 ** the application-defined function is running.
4581 */
4582 SQLITE_API void *sqlite3_user_data(sqlite3_context*);
4583
4584 /*
4585 ** CAPI3REF: Database Connection For Functions
4586 **
4587 ** ^The sqlite3_context_db_handle() interface returns a copy of
@@ -4588,11 +4582,11 @@
4588 ** the pointer to the [database connection] (the 1st parameter)
4589 ** of the [sqlite3_create_function()]
4590 ** and [sqlite3_create_function16()] routines that originally
4591 ** registered the application defined function.
4592 */
4593 SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*);
4594
4595 /*
4596 ** CAPI3REF: Function Auxiliary Data
4597 **
4598 ** These functions may be used by (non-aggregate) SQL functions to
@@ -4640,12 +4634,12 @@
4640 ** values and [parameters] and expressions composed from the same.)^
4641 **
4642 ** These routines must be called from the same thread in which
4643 ** the SQL function is running.
4644 */
4645 SQLITE_API void *sqlite3_get_auxdata(sqlite3_context*, int N);
4646 SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
4647
4648
4649 /*
4650 ** CAPI3REF: Constants Defining Special Destructor Behavior
4651 **
@@ -4776,30 +4770,30 @@
4776 **
4777 ** If these routines are called from within the different thread
4778 ** than the one containing the application-defined function that received
4779 ** the [sqlite3_context] pointer, the results are undefined.
4780 */
4781 SQLITE_API void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
4782 SQLITE_API void sqlite3_result_blob64(sqlite3_context*,const void*,
4783 sqlite3_uint64,void(*)(void*));
4784 SQLITE_API void sqlite3_result_double(sqlite3_context*, double);
4785 SQLITE_API void sqlite3_result_error(sqlite3_context*, const char*, int);
4786 SQLITE_API void sqlite3_result_error16(sqlite3_context*, const void*, int);
4787 SQLITE_API void sqlite3_result_error_toobig(sqlite3_context*);
4788 SQLITE_API void sqlite3_result_error_nomem(sqlite3_context*);
4789 SQLITE_API void sqlite3_result_error_code(sqlite3_context*, int);
4790 SQLITE_API void sqlite3_result_int(sqlite3_context*, int);
4791 SQLITE_API void sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
4792 SQLITE_API void sqlite3_result_null(sqlite3_context*);
4793 SQLITE_API void sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
4794 SQLITE_API void sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
4795 void(*)(void*), unsigned char encoding);
4796 SQLITE_API void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
4797 SQLITE_API void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
4798 SQLITE_API void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
4799 SQLITE_API void sqlite3_result_value(sqlite3_context*, sqlite3_value*);
4800 SQLITE_API void sqlite3_result_zeroblob(sqlite3_context*, int n);
4801
4802 /*
4803 ** CAPI3REF: Define New Collating Sequences
4804 **
4805 ** ^These functions add, remove, or modify a [collation] associated
@@ -4876,26 +4870,26 @@
4876 ** is unfortunate but cannot be changed without breaking backwards
4877 ** compatibility.
4878 **
4879 ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].
4880 */
4881 SQLITE_API int sqlite3_create_collation(
4882 sqlite3*,
4883 const char *zName,
4884 int eTextRep,
4885 void *pArg,
4886 int(*xCompare)(void*,int,const void*,int,const void*)
4887 );
4888 SQLITE_API int sqlite3_create_collation_v2(
4889 sqlite3*,
4890 const char *zName,
4891 int eTextRep,
4892 void *pArg,
4893 int(*xCompare)(void*,int,const void*,int,const void*),
4894 void(*xDestroy)(void*)
4895 );
4896 SQLITE_API int sqlite3_create_collation16(
4897 sqlite3*,
4898 const void *zName,
4899 int eTextRep,
4900 void *pArg,
4901 int(*xCompare)(void*,int,const void*,int,const void*)
@@ -4925,16 +4919,16 @@
4925 **
4926 ** The callback function should register the desired collation using
4927 ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or
4928 ** [sqlite3_create_collation_v2()].
4929 */
4930 SQLITE_API int sqlite3_collation_needed(
4931 sqlite3*,
4932 void*,
4933 void(*)(void*,sqlite3*,int eTextRep,const char*)
4934 );
4935 SQLITE_API int sqlite3_collation_needed16(
4936 sqlite3*,
4937 void*,
4938 void(*)(void*,sqlite3*,int eTextRep,const void*)
4939 );
4940
@@ -4944,15 +4938,15 @@
4944 ** called right after sqlite3_open().
4945 **
4946 ** The code to implement this API is not available in the public release
4947 ** of SQLite.
4948 */
4949 SQLITE_API int sqlite3_key(
4950 sqlite3 *db, /* Database to be rekeyed */
4951 const void *pKey, int nKey /* The key */
4952 );
4953 SQLITE_API int sqlite3_key_v2(
4954 sqlite3 *db, /* Database to be rekeyed */
4955 const char *zDbName, /* Name of the database */
4956 const void *pKey, int nKey /* The key */
4957 );
4958
@@ -4962,35 +4956,35 @@
4962 ** database is decrypted.
4963 **
4964 ** The code to implement this API is not available in the public release
4965 ** of SQLite.
4966 */
4967 SQLITE_API int sqlite3_rekey(
4968 sqlite3 *db, /* Database to be rekeyed */
4969 const void *pKey, int nKey /* The new key */
4970 );
4971 SQLITE_API int sqlite3_rekey_v2(
4972 sqlite3 *db, /* Database to be rekeyed */
4973 const char *zDbName, /* Name of the database */
4974 const void *pKey, int nKey /* The new key */
4975 );
4976
4977 /*
4978 ** Specify the activation key for a SEE database. Unless
4979 ** activated, none of the SEE routines will work.
4980 */
4981 SQLITE_API void sqlite3_activate_see(
4982 const char *zPassPhrase /* Activation phrase */
4983 );
4984 #endif
4985
4986 #ifdef SQLITE_ENABLE_CEROD
4987 /*
4988 ** Specify the activation key for a CEROD database. Unless
4989 ** activated, none of the CEROD routines will work.
4990 */
4991 SQLITE_API void sqlite3_activate_cerod(
4992 const char *zPassPhrase /* Activation phrase */
4993 );
4994 #endif
4995
4996 /*
@@ -5008,11 +5002,11 @@
5008 ** method of the default [sqlite3_vfs] object. If the xSleep() method
5009 ** of the default VFS is not implemented correctly, or not implemented at
5010 ** all, then the behavior of sqlite3_sleep() may deviate from the description
5011 ** in the previous paragraphs.
5012 */
5013 SQLITE_API int sqlite3_sleep(int);
5014
5015 /*
5016 ** CAPI3REF: Name Of The Folder Holding Temporary Files
5017 **
5018 ** ^(If this global variable is made to point to a string which is
@@ -5126,11 +5120,11 @@
5126 **
5127 ** If another thread changes the autocommit status of the database
5128 ** connection while this routine is running, then the return value
5129 ** is undefined.
5130 */
5131 SQLITE_API int sqlite3_get_autocommit(sqlite3*);
5132
5133 /*
5134 ** CAPI3REF: Find The Database Handle Of A Prepared Statement
5135 **
5136 ** ^The sqlite3_db_handle interface returns the [database connection] handle
@@ -5138,11 +5132,11 @@
5138 ** returned by sqlite3_db_handle is the same [database connection]
5139 ** that was the first argument
5140 ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
5141 ** create the statement in the first place.
5142 */
5143 SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*);
5144
5145 /*
5146 ** CAPI3REF: Return The Filename For A Database Connection
5147 **
5148 ** ^The sqlite3_db_filename(D,N) interface returns a pointer to a filename
@@ -5154,20 +5148,20 @@
5154 ** ^The filename returned by this function is the output of the
5155 ** xFullPathname method of the [VFS]. ^In other words, the filename
5156 ** will be an absolute pathname, even if the filename used
5157 ** to open the database originally was a URI or relative pathname.
5158 */
5159 SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName);
5160
5161 /*
5162 ** CAPI3REF: Determine if a database is read-only
5163 **
5164 ** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N
5165 ** of connection D is read-only, 0 if it is read/write, or -1 if N is not
5166 ** the name of a database on connection D.
5167 */
5168 SQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
5169
5170 /*
5171 ** CAPI3REF: Find the next prepared statement
5172 **
5173 ** ^This interface returns a pointer to the next [prepared statement] after
@@ -5178,11 +5172,11 @@
5178 **
5179 ** The [database connection] pointer D in a call to
5180 ** [sqlite3_next_stmt(D,S)] must refer to an open database
5181 ** connection and in particular must not be a NULL pointer.
5182 */
5183 SQLITE_API sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
5184
5185 /*
5186 ** CAPI3REF: Commit And Rollback Notification Callbacks
5187 **
5188 ** ^The sqlite3_commit_hook() interface registers a callback
@@ -5226,12 +5220,12 @@
5226 ** ^The rollback callback is not invoked if a transaction is
5227 ** automatically rolled back because the database connection is closed.
5228 **
5229 ** See also the [sqlite3_update_hook()] interface.
5230 */
5231 SQLITE_API void *sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
5232 SQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
5233
5234 /*
5235 ** CAPI3REF: Data Change Notification Callbacks
5236 **
5237 ** ^The sqlite3_update_hook() interface registers a callback function
@@ -5277,11 +5271,11 @@
5277 ** the first call on D.
5278 **
5279 ** See also the [sqlite3_commit_hook()] and [sqlite3_rollback_hook()]
5280 ** interfaces.
5281 */
5282 SQLITE_API void *sqlite3_update_hook(
5283 sqlite3*,
5284 void(*)(void *,int ,char const *,char const *,sqlite3_int64),
5285 void*
5286 );
5287
@@ -5317,11 +5311,11 @@
5317 ** This interface is threadsafe on processors where writing a
5318 ** 32-bit integer is atomic.
5319 **
5320 ** See Also: [SQLite Shared-Cache Mode]
5321 */
5322 SQLITE_API int sqlite3_enable_shared_cache(int);
5323
5324 /*
5325 ** CAPI3REF: Attempt To Free Heap Memory
5326 **
5327 ** ^The sqlite3_release_memory() interface attempts to free N bytes
@@ -5333,11 +5327,11 @@
5333 ** ^The sqlite3_release_memory() routine is a no-op returning zero
5334 ** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5335 **
5336 ** See also: [sqlite3_db_release_memory()]
5337 */
5338 SQLITE_API int sqlite3_release_memory(int);
5339
5340 /*
5341 ** CAPI3REF: Free Memory Used By A Database Connection
5342 **
5343 ** ^The sqlite3_db_release_memory(D) interface attempts to free as much heap
@@ -5346,11 +5340,11 @@
5346 ** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
5347 ** omitted.
5348 **
5349 ** See also: [sqlite3_release_memory()]
5350 */
5351 SQLITE_API int sqlite3_db_release_memory(sqlite3*);
5352
5353 /*
5354 ** CAPI3REF: Impose A Limit On Heap Size
5355 **
5356 ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the
@@ -5398,11 +5392,11 @@
5398 ** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5399 **
5400 ** The circumstances under which SQLite will enforce the soft heap limit may
5401 ** changes in future releases of SQLite.
5402 */
5403 SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 N);
5404
5405 /*
5406 ** CAPI3REF: Deprecated Soft Heap Limit Interface
5407 ** DEPRECATED
5408 **
@@ -5409,11 +5403,11 @@
5409 ** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
5410 ** interface. This routine is provided for historical compatibility
5411 ** only. All new applications should use the
5412 ** [sqlite3_soft_heap_limit64()] interface rather than this one.
5413 */
5414 SQLITE_API SQLITE_DEPRECATED void sqlite3_soft_heap_limit(int N);
5415
5416
5417 /*
5418 ** CAPI3REF: Extract Metadata About A Column Of A Table
5419 **
@@ -5478,11 +5472,11 @@
5478 **
5479 ** ^This function causes all database schemas to be read from disk and
5480 ** parsed, if that has not already been done, and returns an error if
5481 ** any errors are encountered while loading the schema.
5482 */
5483 SQLITE_API int sqlite3_table_column_metadata(
5484 sqlite3 *db, /* Connection handle */
5485 const char *zDbName, /* Database name or NULL */
5486 const char *zTableName, /* Table name */
5487 const char *zColumnName, /* Column name */
5488 char const **pzDataType, /* OUTPUT: Declared data type */
@@ -5524,11 +5518,11 @@
5524 ** [sqlite3_enable_load_extension()] prior to calling this API,
5525 ** otherwise an error will be returned.
5526 **
5527 ** See also the [load_extension() SQL function].
5528 */
5529 SQLITE_API int sqlite3_load_extension(
5530 sqlite3 *db, /* Load the extension into this database connection */
5531 const char *zFile, /* Name of the shared library containing extension */
5532 const char *zProc, /* Entry point. Derived from zFile if 0 */
5533 char **pzErrMsg /* Put error message here if not 0 */
5534 );
@@ -5544,11 +5538,11 @@
5544 ** ^Extension loading is off by default.
5545 ** ^Call the sqlite3_enable_load_extension() routine with onoff==1
5546 ** to turn extension loading on and call it with onoff==0 to turn
5547 ** it back off again.
5548 */
5549 SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
5550
5551 /*
5552 ** CAPI3REF: Automatically Load Statically Linked Extensions
5553 **
5554 ** ^This interface causes the xEntryPoint() function to be invoked for
@@ -5582,11 +5576,11 @@
5582 ** will be called more than once for each database connection that is opened.
5583 **
5584 ** See also: [sqlite3_reset_auto_extension()]
5585 ** and [sqlite3_cancel_auto_extension()]
5586 */
5587 SQLITE_API int sqlite3_auto_extension(void (*xEntryPoint)(void));
5588
5589 /*
5590 ** CAPI3REF: Cancel Automatic Extension Loading
5591 **
5592 ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
@@ -5594,19 +5588,19 @@
5594 ** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)]
5595 ** routine returns 1 if initialization routine X was successfully
5596 ** unregistered and it returns 0 if X was not on the list of initialization
5597 ** routines.
5598 */
5599 SQLITE_API int sqlite3_cancel_auto_extension(void (*xEntryPoint)(void));
5600
5601 /*
5602 ** CAPI3REF: Reset Automatic Extension Loading
5603 **
5604 ** ^This interface disables all automatic extensions previously
5605 ** registered using [sqlite3_auto_extension()].
5606 */
5607 SQLITE_API void sqlite3_reset_auto_extension(void);
5608
5609 /*
5610 ** The interface to the virtual-table mechanism is currently considered
5611 ** to be experimental. The interface might change in incompatible ways.
5612 ** If this is a problem for you, do not use the interface at this time.
@@ -5805,17 +5799,17 @@
5805 ** be invoked if the call to sqlite3_create_module_v2() fails.
5806 ** ^The sqlite3_create_module()
5807 ** interface is equivalent to sqlite3_create_module_v2() with a NULL
5808 ** destructor.
5809 */
5810 SQLITE_API int sqlite3_create_module(
5811 sqlite3 *db, /* SQLite connection to register module with */
5812 const char *zName, /* Name of the module */
5813 const sqlite3_module *p, /* Methods for the module */
5814 void *pClientData /* Client data for xCreate/xConnect */
5815 );
5816 SQLITE_API int sqlite3_create_module_v2(
5817 sqlite3 *db, /* SQLite connection to register module with */
5818 const char *zName, /* Name of the module */
5819 const sqlite3_module *p, /* Methods for the module */
5820 void *pClientData, /* Client data for xCreate/xConnect */
5821 void(*xDestroy)(void*) /* Module destructor function */
@@ -5874,11 +5868,11 @@
5874 ** ^The [xCreate] and [xConnect] methods of a
5875 ** [virtual table module] call this interface
5876 ** to declare the format (the names and datatypes of the columns) of
5877 ** the virtual tables they implement.
5878 */
5879 SQLITE_API int sqlite3_declare_vtab(sqlite3*, const char *zSQL);
5880
5881 /*
5882 ** CAPI3REF: Overload A Function For A Virtual Table
5883 **
5884 ** ^(Virtual tables can provide alternative implementations of functions
@@ -5892,11 +5886,11 @@
5892 ** of the new function always causes an exception to be thrown. So
5893 ** the new function is not good for anything by itself. Its only
5894 ** purpose is to be a placeholder function that can be overloaded
5895 ** by a [virtual table].
5896 */
5897 SQLITE_API int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
5898
5899 /*
5900 ** The interface to the virtual-table mechanism defined above (back up
5901 ** to a comment remarkably similar to this one) is currently considered
5902 ** to be experimental. The interface might change in incompatible ways.
@@ -5989,11 +5983,11 @@
5989 ** zero-filled blob to read or write using the incremental-blob interface.
5990 **
5991 ** To avoid a resource leak, every open [BLOB handle] should eventually
5992 ** be released by a call to [sqlite3_blob_close()].
5993 */
5994 SQLITE_API int sqlite3_blob_open(
5995 sqlite3*,
5996 const char *zDb,
5997 const char *zTable,
5998 const char *zColumn,
5999 sqlite3_int64 iRow,
@@ -6021,11 +6015,11 @@
6021 ** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
6022 ** always returns zero.
6023 **
6024 ** ^This function sets the database handle error code and message.
6025 */
6026 SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
6027
6028 /*
6029 ** CAPI3REF: Close A BLOB Handle
6030 **
6031 ** ^This function closes an open [BLOB handle]. ^(The BLOB handle is closed
@@ -6043,11 +6037,11 @@
6043 ** with a null pointer (such as would be returned by a failed call to
6044 ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function
6045 ** is passed a valid open blob handle, the values returned by the
6046 ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning.
6047 */
6048 SQLITE_API int sqlite3_blob_close(sqlite3_blob *);
6049
6050 /*
6051 ** CAPI3REF: Return The Size Of An Open BLOB
6052 **
6053 ** ^Returns the size in bytes of the BLOB accessible via the
@@ -6058,11 +6052,11 @@
6058 ** This routine only works on a [BLOB handle] which has been created
6059 ** by a prior successful call to [sqlite3_blob_open()] and which has not
6060 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6061 ** to this routine results in undefined and probably undesirable behavior.
6062 */
6063 SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *);
6064
6065 /*
6066 ** CAPI3REF: Read Data From A BLOB Incrementally
6067 **
6068 ** ^(This function is used to read data from an open [BLOB handle] into a
@@ -6086,11 +6080,11 @@
6086 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6087 ** to this routine results in undefined and probably undesirable behavior.
6088 **
6089 ** See also: [sqlite3_blob_write()].
6090 */
6091 SQLITE_API int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
6092
6093 /*
6094 ** CAPI3REF: Write Data Into A BLOB Incrementally
6095 **
6096 ** ^(This function is used to write data into an open [BLOB handle] from a
@@ -6127,11 +6121,11 @@
6127 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6128 ** to this routine results in undefined and probably undesirable behavior.
6129 **
6130 ** See also: [sqlite3_blob_read()].
6131 */
6132 SQLITE_API int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
6133
6134 /*
6135 ** CAPI3REF: Virtual File System Objects
6136 **
6137 ** A virtual filesystem (VFS) is an [sqlite3_vfs] object
@@ -6158,13 +6152,13 @@
6158 **
6159 ** ^Unregister a VFS with the sqlite3_vfs_unregister() interface.
6160 ** ^(If the default VFS is unregistered, another VFS is chosen as
6161 ** the default. The choice for the new VFS is arbitrary.)^
6162 */
6163 SQLITE_API sqlite3_vfs *sqlite3_vfs_find(const char *zVfsName);
6164 SQLITE_API int sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
6165 SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*);
6166
6167 /*
6168 ** CAPI3REF: Mutexes
6169 **
6170 ** The SQLite core uses these routines for thread
@@ -6273,15 +6267,15 @@
6273 ** sqlite3_mutex_leave() is a NULL pointer, then all three routines
6274 ** behave as no-ops.
6275 **
6276 ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
6277 */
6278 SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int);
6279 SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*);
6280 SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*);
6281 SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*);
6282 SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*);
6283
6284 /*
6285 ** CAPI3REF: Mutex Methods Object
6286 **
6287 ** An instance of this structure defines the low-level routines
@@ -6387,12 +6381,12 @@
6387 ** call to sqlite3_mutex_held() to fail, so a non-zero return is
6388 ** the appropriate thing to do. The sqlite3_mutex_notheld()
6389 ** interface should also return 1 when given a NULL pointer.
6390 */
6391 #ifndef NDEBUG
6392 SQLITE_API int sqlite3_mutex_held(sqlite3_mutex*);
6393 SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex*);
6394 #endif
6395
6396 /*
6397 ** CAPI3REF: Mutex Types
6398 **
@@ -6424,11 +6418,11 @@
6424 ** serializes access to the [database connection] given in the argument
6425 ** when the [threading mode] is Serialized.
6426 ** ^If the [threading mode] is Single-thread or Multi-thread then this
6427 ** routine returns a NULL pointer.
6428 */
6429 SQLITE_API sqlite3_mutex *sqlite3_db_mutex(sqlite3*);
6430
6431 /*
6432 ** CAPI3REF: Low-Level Control Of Database Files
6433 **
6434 ** ^The [sqlite3_file_control()] interface makes a direct call to the
@@ -6458,11 +6452,11 @@
6458 ** an incorrect zDbName and an SQLITE_ERROR return from the underlying
6459 ** xFileControl method.
6460 **
6461 ** See also: [SQLITE_FCNTL_LOCKSTATE]
6462 */
6463 SQLITE_API int sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
6464
6465 /*
6466 ** CAPI3REF: Testing Interface
6467 **
6468 ** ^The sqlite3_test_control() interface is used to read out internal
@@ -6477,11 +6471,11 @@
6477 ** The details of the operation codes, their meanings, the parameters
6478 ** they take, and what they do are all subject to change without notice.
6479 ** Unlike most of the SQLite API, this function is not guaranteed to
6480 ** operate consistently from one release to the next.
6481 */
6482 SQLITE_API int sqlite3_test_control(int op, ...);
6483
6484 /*
6485 ** CAPI3REF: Testing Interface Operation Codes
6486 **
6487 ** These constants are the valid operation code parameters used
@@ -6540,12 +6534,12 @@
6540 ** be represented by a 32-bit integer, then the values returned by
6541 ** sqlite3_status() are undefined.
6542 **
6543 ** See also: [sqlite3_db_status()]
6544 */
6545 SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6546 SQLITE_API int sqlite3_status64(
6547 int op,
6548 sqlite3_int64 *pCurrent,
6549 sqlite3_int64 *pHighwater,
6550 int resetFlag
6551 );
@@ -6664,11 +6658,11 @@
6664 ** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a
6665 ** non-zero [error code] on failure.
6666 **
6667 ** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
6668 */
6669 SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
6670
6671 /*
6672 ** CAPI3REF: Status Parameters for database connections
6673 ** KEYWORDS: {SQLITE_DBSTATUS options}
6674 **
@@ -6793,11 +6787,11 @@
6793 ** ^If the resetFlg is true, then the counter is reset to zero after this
6794 ** interface call returns.
6795 **
6796 ** See also: [sqlite3_status()] and [sqlite3_db_status()].
6797 */
6798 SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
6799
6800 /*
6801 ** CAPI3REF: Status Parameters for prepared statements
6802 ** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters}
6803 **
@@ -7262,20 +7256,20 @@
7262 ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()
7263 ** APIs are not strictly speaking threadsafe. If they are invoked at the
7264 ** same time as another thread is invoking sqlite3_backup_step() it is
7265 ** possible that they return invalid values.
7266 */
7267 SQLITE_API sqlite3_backup *sqlite3_backup_init(
7268 sqlite3 *pDest, /* Destination database handle */
7269 const char *zDestName, /* Destination database name */
7270 sqlite3 *pSource, /* Source database handle */
7271 const char *zSourceName /* Source database name */
7272 );
7273 SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage);
7274 SQLITE_API int sqlite3_backup_finish(sqlite3_backup *p);
7275 SQLITE_API int sqlite3_backup_remaining(sqlite3_backup *p);
7276 SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p);
7277
7278 /*
7279 ** CAPI3REF: Unlock Notification
7280 **
7281 ** ^When running in shared-cache mode, a database operation may fail with
@@ -7387,11 +7381,11 @@
7387 ** by an sqlite3_step() call. ^(If there is a blocking connection, then the
7388 ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in
7389 ** the special "DROP TABLE/INDEX" case, the extended error code is just
7390 ** SQLITE_LOCKED.)^
7391 */
7392 SQLITE_API int sqlite3_unlock_notify(
7393 sqlite3 *pBlocked, /* Waiting connection */
7394 void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */
7395 void *pNotifyArg /* Argument to pass to xNotify */
7396 );
7397
@@ -7402,12 +7396,12 @@
7402 ** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications
7403 ** and extensions to compare the contents of two buffers containing UTF-8
7404 ** strings in a case-independent fashion, using the same definition of "case
7405 ** independence" that SQLite uses internally when comparing identifiers.
7406 */
7407 SQLITE_API int sqlite3_stricmp(const char *, const char *);
7408 SQLITE_API int sqlite3_strnicmp(const char *, const char *, int);
7409
7410 /*
7411 ** CAPI3REF: String Globbing
7412 *
7413 ** ^The [sqlite3_strglob(P,X)] interface returns zero if string X matches
@@ -7418,11 +7412,11 @@
7418 ** sensitive.
7419 **
7420 ** Note that this routine returns zero on a match and non-zero if the strings
7421 ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
7422 */
7423 SQLITE_API int sqlite3_strglob(const char *zGlob, const char *zStr);
7424
7425 /*
7426 ** CAPI3REF: Error Logging Interface
7427 **
7428 ** ^The [sqlite3_log()] interface writes a message into the [error log]
@@ -7441,11 +7435,11 @@
7441 ** will not use dynamically allocated memory. The log message is stored in
7442 ** a fixed-length buffer on the stack. If the log message is longer than
7443 ** a few hundred characters, it will be truncated to the length of the
7444 ** buffer.
7445 */
7446 SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...);
7447
7448 /*
7449 ** CAPI3REF: Write-Ahead Log Commit Hook
7450 **
7451 ** ^The [sqlite3_wal_hook()] function is used to register a callback that
@@ -7476,11 +7470,11 @@
7476 ** previously registered write-ahead log callback. ^Note that the
7477 ** [sqlite3_wal_autocheckpoint()] interface and the
7478 ** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will
7479 ** those overwrite any prior [sqlite3_wal_hook()] settings.
7480 */
7481 SQLITE_API void *sqlite3_wal_hook(
7482 sqlite3*,
7483 int(*)(void *,sqlite3*,const char*,int),
7484 void*
7485 );
7486
@@ -7510,11 +7504,11 @@
7510 ** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]
7511 ** pages. The use of this interface
7512 ** is only necessary if the default setting is found to be suboptimal
7513 ** for a particular application.
7514 */
7515 SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
7516
7517 /*
7518 ** CAPI3REF: Checkpoint a database
7519 **
7520 ** ^(The sqlite3_wal_checkpoint(D,X) is equivalent to
@@ -7531,11 +7525,11 @@
7531 ** interface was added. This interface is retained for backwards
7532 ** compatibility and as a convenience for applications that need to manually
7533 ** start a callback but which do not need the full power (and corresponding
7534 ** complication) of [sqlite3_wal_checkpoint_v2()].
7535 */
7536 SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
7537
7538 /*
7539 ** CAPI3REF: Checkpoint a database
7540 **
7541 ** ^(The sqlite3_wal_checkpoint_v2(D,X,M,L,C) interface runs a checkpoint
@@ -7624,11 +7618,11 @@
7624 ** [sqlite3_errcode()] and [sqlite3_errmsg()].
7625 **
7626 ** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface
7627 ** from SQL.
7628 */
7629 SQLITE_API int sqlite3_wal_checkpoint_v2(
7630 sqlite3 *db, /* Database handle */
7631 const char *zDb, /* Name of attached database (or NULL) */
7632 int eMode, /* SQLITE_CHECKPOINT_* value */
7633 int *pnLog, /* OUT: Size of WAL log in frames */
7634 int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -7660,11 +7654,11 @@
7660 **
7661 ** At present, there is only one option that may be configured using
7662 ** this function. (See [SQLITE_VTAB_CONSTRAINT_SUPPORT].) Further options
7663 ** may be added in the future.
7664 */
7665 SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...);
7666
7667 /*
7668 ** CAPI3REF: Virtual Table Configuration Options
7669 **
7670 ** These macros define the various options to the
@@ -7713,11 +7707,11 @@
7713 ** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL],
7714 ** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode
7715 ** of the SQL statement that triggered the call to the [xUpdate] method of the
7716 ** [virtual table].
7717 */
7718 SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *);
7719
7720 /*
7721 ** CAPI3REF: Conflict resolution modes
7722 ** KEYWORDS: {conflict resolution mode}
7723 **
@@ -7817,11 +7811,11 @@
7817 ** as if the loop did not exist - it returns non-zero and leave the variable
7818 ** that pOut points to unchanged.
7819 **
7820 ** See also: [sqlite3_stmt_scanstatus_reset()]
7821 */
7822 SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_stmt_scanstatus(
7823 sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
7824 int idx, /* Index of loop to report on */
7825 int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
7826 void *pOut /* Result written here */
7827 );
@@ -7832,11 +7826,11 @@
7832 ** ^Zero all [sqlite3_stmt_scanstatus()] related event counters.
7833 **
7834 ** This API is only available if the library is built with pre-processor
7835 ** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined.
7836 */
7837 SQLITE_API SQLITE_EXPERIMENTAL void sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
7838
7839
7840 /*
7841 ** Undo the hack that converts floating point types to integer for
7842 ** builds on processors without floating point support.
@@ -7887,11 +7881,11 @@
7887 ** Register a geometry callback named zGeom that can be used as part of an
7888 ** R-Tree geometry query as follows:
7889 **
7890 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
7891 */
7892 SQLITE_API int sqlite3_rtree_geometry_callback(
7893 sqlite3 *db,
7894 const char *zGeom,
7895 int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
7896 void *pContext
7897 );
@@ -7913,11 +7907,11 @@
7913 ** Register a 2nd-generation geometry callback named zScore that can be
7914 ** used as part of an R-Tree geometry query as follows:
7915 **
7916 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...)
7917 */
7918 SQLITE_API int sqlite3_rtree_query_callback(
7919 sqlite3 *db,
7920 const char *zQueryFunc,
7921 int (*xQueryFunc)(sqlite3_rtree_query_info*),
7922 void *pContext,
7923 void (*xDestructor)(void*)
@@ -9157,12 +9151,12 @@
9157 */
9158 #ifdef SQLITE_OMIT_WSD
9159 #define SQLITE_WSD const
9160 #define GLOBAL(t,v) (*(t*)sqlite3_wsd_find((void*)&(v), sizeof(v)))
9161 #define sqlite3GlobalConfig GLOBAL(struct Sqlite3Config, sqlite3Config)
9162 SQLITE_API int sqlite3_wsd_init(int N, int J);
9163 SQLITE_API void *sqlite3_wsd_find(void *K, int L);
9164 #else
9165 #define SQLITE_WSD
9166 #define GLOBAL(t,v) v
9167 #define sqlite3GlobalConfig sqlite3Config
9168 #endif
@@ -13646,11 +13640,11 @@
13646 ** print I/O tracing messages.
13647 */
13648 #ifdef SQLITE_ENABLE_IOTRACE
13649 # define IOTRACE(A) if( sqlite3IoTrace ){ sqlite3IoTrace A; }
13650 SQLITE_PRIVATE void sqlite3VdbeIOTraceSql(Vdbe*);
13651 void (*sqlite3IoTrace)(const char*,...);
13652 #else
13653 # define IOTRACE(A)
13654 # define sqlite3VdbeIOTraceSql(X)
13655 #endif
13656
@@ -14359,11 +14353,11 @@
14359 ** was used and false if not.
14360 **
14361 ** The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix
14362 ** is not required for a match.
14363 */
14364 SQLITE_API int sqlite3_compileoption_used(const char *zOptName){
14365 int i, n;
14366
14367 #if SQLITE_ENABLE_API_ARMOR
14368 if( zOptName==0 ){
14369 (void)SQLITE_MISUSE_BKPT;
@@ -14387,11 +14381,11 @@
14387
14388 /*
14389 ** Return the N-th compile-time option string. If N is out of range,
14390 ** return a NULL pointer.
14391 */
14392 SQLITE_API const char *sqlite3_compileoption_get(int N){
14393 if( N>=0 && N<ArraySize(azCompileOpt) ){
14394 return azCompileOpt[N];
14395 }
14396 return 0;
14397 }
@@ -15024,11 +15018,11 @@
15024 }
15025
15026 /*
15027 ** Query status information.
15028 */
15029 SQLITE_API int sqlite3_status64(
15030 int op,
15031 sqlite3_int64 *pCurrent,
15032 sqlite3_int64 *pHighwater,
15033 int resetFlag
15034 ){
@@ -15049,11 +15043,11 @@
15049 }
15050 sqlite3_mutex_leave(pMutex);
15051 (void)pMutex; /* Prevent warning when SQLITE_THREADSAFE=0 */
15052 return SQLITE_OK;
15053 }
15054 SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){
15055 sqlite3_int64 iCur, iHwtr;
15056 int rc;
15057 #ifdef SQLITE_ENABLE_API_ARMOR
15058 if( pCurrent==0 || pHighwater==0 ) return SQLITE_MISUSE_BKPT;
15059 #endif
@@ -15066,11 +15060,11 @@
15066 }
15067
15068 /*
15069 ** Query status information for a single database connection
15070 */
15071 SQLITE_API int sqlite3_db_status(
15072 sqlite3 *db, /* The database connection whose status is desired */
15073 int op, /* Status verb */
15074 int *pCurrent, /* Write current value here */
15075 int *pHighwater, /* Write high-water mark here */
15076 int resetFlag /* Reset high-water mark if true */
@@ -16690,11 +16684,11 @@
16690
16691 /*
16692 ** Locate a VFS by name. If no name is given, simply return the
16693 ** first VFS on the list.
16694 */
16695 SQLITE_API sqlite3_vfs *sqlite3_vfs_find(const char *zVfs){
16696 sqlite3_vfs *pVfs = 0;
16697 #if SQLITE_THREADSAFE
16698 sqlite3_mutex *mutex;
16699 #endif
16700 #ifndef SQLITE_OMIT_AUTOINIT
@@ -16736,11 +16730,11 @@
16736 /*
16737 ** Register a VFS with the system. It is harmless to register the same
16738 ** VFS multiple times. The new VFS becomes the default if makeDflt is
16739 ** true.
16740 */
16741 SQLITE_API int sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){
16742 MUTEX_LOGIC(sqlite3_mutex *mutex;)
16743 #ifndef SQLITE_OMIT_AUTOINIT
16744 int rc = sqlite3_initialize();
16745 if( rc ) return rc;
16746 #endif
@@ -16764,11 +16758,11 @@
16764 }
16765
16766 /*
16767 ** Unregister a VFS so that it is no longer accessible.
16768 */
16769 SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs *pVfs){
16770 #if SQLITE_THREADSAFE
16771 sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
16772 #endif
16773 sqlite3_mutex_enter(mutex);
16774 vfsUnlink(pVfs);
@@ -19100,11 +19094,11 @@
19100 }
19101
19102 /*
19103 ** Retrieve a pointer to a static mutex or allocate a new dynamic one.
19104 */
19105 SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int id){
19106 #ifndef SQLITE_OMIT_AUTOINIT
19107 if( id<=SQLITE_MUTEX_RECURSIVE && sqlite3_initialize() ) return 0;
19108 if( id>SQLITE_MUTEX_RECURSIVE && sqlite3MutexInit() ) return 0;
19109 #endif
19110 return sqlite3GlobalConfig.mutex.xMutexAlloc(id);
@@ -19119,31 +19113,31 @@
19119 }
19120
19121 /*
19122 ** Free a dynamic mutex.
19123 */
19124 SQLITE_API void sqlite3_mutex_free(sqlite3_mutex *p){
19125 if( p ){
19126 sqlite3GlobalConfig.mutex.xMutexFree(p);
19127 }
19128 }
19129
19130 /*
19131 ** Obtain the mutex p. If some other thread already has the mutex, block
19132 ** until it can be obtained.
19133 */
19134 SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex *p){
19135 if( p ){
19136 sqlite3GlobalConfig.mutex.xMutexEnter(p);
19137 }
19138 }
19139
19140 /*
19141 ** Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another
19142 ** thread holds the mutex and it cannot be obtained, return SQLITE_BUSY.
19143 */
19144 SQLITE_API int sqlite3_mutex_try(sqlite3_mutex *p){
19145 int rc = SQLITE_OK;
19146 if( p ){
19147 return sqlite3GlobalConfig.mutex.xMutexTry(p);
19148 }
19149 return rc;
@@ -19153,11 +19147,11 @@
19153 ** The sqlite3_mutex_leave() routine exits a mutex that was previously
19154 ** entered by the same thread. The behavior is undefined if the mutex
19155 ** is not currently entered. If a NULL pointer is passed as an argument
19156 ** this function is a no-op.
19157 */
19158 SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex *p){
19159 if( p ){
19160 sqlite3GlobalConfig.mutex.xMutexLeave(p);
19161 }
19162 }
19163
@@ -19164,14 +19158,14 @@
19164 #ifndef NDEBUG
19165 /*
19166 ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are
19167 ** intended for use inside assert() statements.
19168 */
19169 SQLITE_API int sqlite3_mutex_held(sqlite3_mutex *p){
19170 return p==0 || sqlite3GlobalConfig.mutex.xMutexHeld(p);
19171 }
19172 SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex *p){
19173 return p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld(p);
19174 }
19175 #endif
19176
19177 #endif /* !defined(SQLITE_MUTEX_OMIT) */
@@ -20163,12 +20157,12 @@
20163 ** of the sqlite3_initialize() and sqlite3_shutdown() processing, the
20164 ** "interlocked" magic used here is probably not strictly necessary.
20165 */
20166 static LONG SQLITE_WIN32_VOLATILE winMutex_lock = 0;
20167
20168 SQLITE_API int sqlite3_win32_is_nt(void); /* os_win.c */
20169 SQLITE_API void sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */
20170
20171 static int winMutexInit(void){
20172 /* The first to increment to 1 does actual initialization */
20173 if( InterlockedCompareExchange(&winMutex_lock, 1, 0)==0 ){
20174 int i;
@@ -20460,11 +20454,11 @@
20460 /*
20461 ** Attempt to release up to n bytes of non-essential memory currently
20462 ** held by SQLite. An example of non-essential memory is memory used to
20463 ** cache database pages that are not currently in use.
20464 */
20465 SQLITE_API int sqlite3_release_memory(int n){
20466 #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
20467 return sqlite3PcacheReleaseMemory(n);
20468 #else
20469 /* IMPLEMENTATION-OF: R-34391-24921 The sqlite3_release_memory() routine
20470 ** is a no-op returning zero if SQLite is not compiled with
@@ -20560,11 +20554,11 @@
20560 #ifndef SQLITE_OMIT_DEPRECATED
20561 /*
20562 ** Deprecated external interface. Internal/core SQLite code
20563 ** should call sqlite3MemoryAlarm.
20564 */
20565 SQLITE_API int sqlite3_memory_alarm(
20566 void(*xCallback)(void *pArg, sqlite3_int64 used,int N),
20567 void *pArg,
20568 sqlite3_int64 iThreshold
20569 ){
20570 return sqlite3MemoryAlarm(xCallback, pArg, iThreshold);
@@ -20573,11 +20567,11 @@
20573
20574 /*
20575 ** Set the soft heap-size limit for the library. Passing a zero or
20576 ** negative value indicates no limit.
20577 */
20578 SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 n){
20579 sqlite3_int64 priorLimit;
20580 sqlite3_int64 excess;
20581 #ifndef SQLITE_OMIT_AUTOINIT
20582 int rc = sqlite3_initialize();
20583 if( rc ) return -1;
@@ -20593,19 +20587,20 @@
20593 }
20594 excess = sqlite3_memory_used() - n;
20595 if( excess>0 ) sqlite3_release_memory((int)(excess & 0x7fffffff));
20596 return priorLimit;
20597 }
20598 SQLITE_API void sqlite3_soft_heap_limit(int n){
20599 if( n<0 ) n = 0;
20600 sqlite3_soft_heap_limit64(n);
20601 }
20602
20603 /*
20604 ** Initialize the memory allocation subsystem.
20605 */
20606 SQLITE_PRIVATE int sqlite3MallocInit(void){
 
20607 if( sqlite3GlobalConfig.m.xMalloc==0 ){
20608 sqlite3MemSetDefault();
20609 }
20610 memset(&mem0, 0, sizeof(mem0));
20611 if( sqlite3GlobalConfig.bCoreMutex ){
@@ -20637,11 +20632,13 @@
20637 || sqlite3GlobalConfig.nPage<1 ){
20638 sqlite3GlobalConfig.pPage = 0;
20639 sqlite3GlobalConfig.szPage = 0;
20640 sqlite3GlobalConfig.nPage = 0;
20641 }
20642 return sqlite3GlobalConfig.m.xInit(sqlite3GlobalConfig.m.pAppData);
 
 
20643 }
20644
20645 /*
20646 ** Return true if the heap is currently under memory pressure - in other
20647 ** words if the amount of heap used is close to the limit set by
@@ -20662,11 +20659,11 @@
20662 }
20663
20664 /*
20665 ** Return the amount of memory currently checked out.
20666 */
20667 SQLITE_API sqlite3_int64 sqlite3_memory_used(void){
20668 int n, mx;
20669 sqlite3_int64 res;
20670 sqlite3_status(SQLITE_STATUS_MEMORY_USED, &n, &mx, 0);
20671 res = (sqlite3_int64)n; /* Work around bug in Borland C. Ticket #3216 */
20672 return res;
@@ -20675,11 +20672,11 @@
20675 /*
20676 ** Return the maximum amount of memory that has ever been
20677 ** checked out since either the beginning of this process
20678 ** or since the most recent reset.
20679 */
20680 SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int resetFlag){
20681 int n, mx;
20682 sqlite3_int64 res;
20683 sqlite3_status(SQLITE_STATUS_MEMORY_USED, &n, &mx, resetFlag);
20684 res = (sqlite3_int64)mx; /* Work around bug in Borland C. Ticket #3216 */
20685 return res;
@@ -20766,17 +20763,17 @@
20766 /*
20767 ** This version of the memory allocation is for use by the application.
20768 ** First make sure the memory subsystem is initialized, then do the
20769 ** allocation.
20770 */
20771 SQLITE_API void *sqlite3_malloc(int n){
20772 #ifndef SQLITE_OMIT_AUTOINIT
20773 if( sqlite3_initialize() ) return 0;
20774 #endif
20775 return n<=0 ? 0 : sqlite3Malloc(n);
20776 }
20777 SQLITE_API void *sqlite3_malloc64(sqlite3_uint64 n){
20778 #ifndef SQLITE_OMIT_AUTOINIT
20779 if( sqlite3_initialize() ) return 0;
20780 #endif
20781 return sqlite3Malloc(n);
20782 }
@@ -20913,20 +20910,20 @@
20913 assert( sqlite3MemdebugNoType(p, (u8)~(MEMTYPE_LOOKASIDE|MEMTYPE_HEAP)) );
20914 return sqlite3GlobalConfig.m.xSize(p);
20915 }
20916 }
20917 }
20918 SQLITE_API sqlite3_uint64 sqlite3_msize(void *p){
20919 assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) );
20920 assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
20921 return (sqlite3_uint64)sqlite3GlobalConfig.m.xSize(p);
20922 }
20923
20924 /*
20925 ** Free memory previously obtained from sqlite3Malloc().
20926 */
20927 SQLITE_API void sqlite3_free(void *p){
20928 if( p==0 ) return; /* IMP: R-49053-54554 */
20929 assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
20930 assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) );
20931 if( sqlite3GlobalConfig.bMemstat ){
20932 sqlite3_mutex_enter(mem0.mutex);
@@ -21031,18 +21028,18 @@
21031
21032 /*
21033 ** The public interface to sqlite3Realloc. Make sure that the memory
21034 ** subsystem is initialized prior to invoking sqliteRealloc.
21035 */
21036 SQLITE_API void *sqlite3_realloc(void *pOld, int n){
21037 #ifndef SQLITE_OMIT_AUTOINIT
21038 if( sqlite3_initialize() ) return 0;
21039 #endif
21040 if( n<0 ) n = 0; /* IMP: R-26507-47431 */
21041 return sqlite3Realloc(pOld, n);
21042 }
21043 SQLITE_API void *sqlite3_realloc64(void *pOld, sqlite3_uint64 n){
21044 #ifndef SQLITE_OMIT_AUTOINIT
21045 if( sqlite3_initialize() ) return 0;
21046 #endif
21047 return sqlite3Realloc(pOld, n);
21048 }
@@ -22204,11 +22201,11 @@
22204
22205 /*
22206 ** Print into memory obtained from sqlite3_malloc(). Omit the internal
22207 ** %-conversion extensions.
22208 */
22209 SQLITE_API char *sqlite3_vmprintf(const char *zFormat, va_list ap){
22210 char *z;
22211 char zBase[SQLITE_PRINT_BUF_SIZE];
22212 StrAccum acc;
22213
22214 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -22229,11 +22226,11 @@
22229
22230 /*
22231 ** Print into memory obtained from sqlite3_malloc()(). Omit the internal
22232 ** %-conversion extensions.
22233 */
22234 SQLITE_API char *sqlite3_mprintf(const char *zFormat, ...){
22235 va_list ap;
22236 char *z;
22237 #ifndef SQLITE_OMIT_AUTOINIT
22238 if( sqlite3_initialize() ) return 0;
22239 #endif
@@ -22254,11 +22251,11 @@
22254 ** this without breaking compatibility, so we just have to live with the
22255 ** mistake.
22256 **
22257 ** sqlite3_vsnprintf() is the varargs version.
22258 */
22259 SQLITE_API char *sqlite3_vsnprintf(int n, char *zBuf, const char *zFormat, va_list ap){
22260 StrAccum acc;
22261 if( n<=0 ) return zBuf;
22262 #ifdef SQLITE_ENABLE_API_ARMOR
22263 if( zBuf==0 || zFormat==0 ) {
22264 (void)SQLITE_MISUSE_BKPT;
@@ -22269,11 +22266,11 @@
22269 sqlite3StrAccumInit(&acc, zBuf, n, 0);
22270 acc.useMalloc = 0;
22271 sqlite3VXPrintf(&acc, 0, zFormat, ap);
22272 return sqlite3StrAccumFinish(&acc);
22273 }
22274 SQLITE_API char *sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){
22275 char *z;
22276 va_list ap;
22277 va_start(ap,zFormat);
22278 z = sqlite3_vsnprintf(n, zBuf, zFormat, ap);
22279 va_end(ap);
@@ -22301,11 +22298,11 @@
22301 }
22302
22303 /*
22304 ** Format and write a message to the log if logging is enabled.
22305 */
22306 SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...){
22307 va_list ap; /* Vararg list */
22308 if( sqlite3GlobalConfig.xLog ){
22309 va_start(ap, zFormat);
22310 renderLogMsg(iErrCode, zFormat, ap);
22311 va_end(ap);
@@ -22437,11 +22434,11 @@
22437 } sqlite3Prng;
22438
22439 /*
22440 ** Return N random bytes.
22441 */
22442 SQLITE_API void sqlite3_randomness(int N, void *pBuf){
22443 unsigned char t;
22444 unsigned char *zBuf = pBuf;
22445
22446 /* The "wsdPrng" macro will resolve to the pseudo-random number generator
22447 ** state vector. If writable static data is unsupported on the target,
@@ -23589,11 +23586,11 @@
23589 ** sqlite3_strnicmp() APIs allow applications and extensions to compare
23590 ** the contents of two buffers containing UTF-8 strings in a
23591 ** case-independent fashion, using the same definition of "case
23592 ** independence" that SQLite uses internally when comparing identifiers.
23593 */
23594 SQLITE_API int sqlite3_stricmp(const char *zLeft, const char *zRight){
23595 register unsigned char *a, *b;
23596 if( zLeft==0 ){
23597 return zRight ? -1 : 0;
23598 }else if( zRight==0 ){
23599 return 1;
@@ -23601,11 +23598,11 @@
23601 a = (unsigned char *)zLeft;
23602 b = (unsigned char *)zRight;
23603 while( *a!=0 && UpperToLower[*a]==UpperToLower[*b]){ a++; b++; }
23604 return UpperToLower[*a] - UpperToLower[*b];
23605 }
23606 SQLITE_API int sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){
23607 register unsigned char *a, *b;
23608 if( zLeft==0 ){
23609 return zRight ? -1 : 0;
23610 }else if( zRight==0 ){
23611 return 1;
@@ -32814,11 +32811,11 @@
32814 ** This routine is called once during SQLite initialization and by a
32815 ** single thread. The memory allocation and mutex subsystems have not
32816 ** necessarily been initialized when this routine is called, and so they
32817 ** should not be used.
32818 */
32819 SQLITE_API int sqlite3_os_init(void){
32820 /*
32821 ** The following macro defines an initializer for an sqlite3_vfs object.
32822 ** The name of the VFS is NAME. The pAppData is a pointer to a pointer
32823 ** to the "finder" function. (pAppData is a pointer to a pointer because
32824 ** silly C90 rules prohibit a void* from being cast to a function pointer
@@ -32913,11 +32910,11 @@
32913 **
32914 ** Some operating systems might need to do some cleanup in this routine,
32915 ** to release dynamically allocated objects. But not on unix.
32916 ** This routine is a no-op for unix.
32917 */
32918 SQLITE_API int sqlite3_os_end(void){
32919 return SQLITE_OK;
32920 }
32921
32922 #endif /* SQLITE_OS_UNIX */
32923
@@ -34305,11 +34302,11 @@
34305 ** compact it. Upon success, SQLITE_OK will be returned. Upon failure, one
34306 ** of SQLITE_NOMEM, SQLITE_ERROR, or SQLITE_NOTFOUND will be returned. The
34307 ** "pnLargest" argument, if non-zero, will be used to return the size of the
34308 ** largest committed free block in the heap, in bytes.
34309 */
34310 SQLITE_API int sqlite3_win32_compact_heap(LPUINT pnLargest){
34311 int rc = SQLITE_OK;
34312 UINT nLargest = 0;
34313 HANDLE hHeap;
34314
34315 winMemAssertMagic();
@@ -34345,11 +34342,11 @@
34345 ** If a Win32 native heap has been configured, this function will attempt to
34346 ** destroy and recreate it. If the Win32 native heap is not isolated and/or
34347 ** the sqlite3_memory_used() function does not return zero, SQLITE_BUSY will
34348 ** be returned and no changes will be made to the Win32 native heap.
34349 */
34350 SQLITE_API int sqlite3_win32_reset_heap(){
34351 int rc;
34352 MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */
34353 MUTEX_LOGIC( sqlite3_mutex *pMem; ) /* The memsys static mutex */
34354 MUTEX_LOGIC( pMaster = sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_MASTER); )
34355 MUTEX_LOGIC( pMem = sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_MEM); )
@@ -34390,11 +34387,11 @@
34390 /*
34391 ** This function outputs the specified (ANSI) string to the Win32 debugger
34392 ** (if available).
34393 */
34394
34395 SQLITE_API void sqlite3_win32_write_debug(const char *zBuf, int nBuf){
34396 char zDbgBuf[SQLITE_WIN32_DBG_BUF_SIZE];
34397 int nMin = MIN(nBuf, (SQLITE_WIN32_DBG_BUF_SIZE - 1)); /* may be negative. */
34398 if( nMin<-1 ) nMin = -1; /* all negative values become -1. */
34399 assert( nMin==-1 || nMin==0 || nMin<SQLITE_WIN32_DBG_BUF_SIZE );
34400 #if defined(SQLITE_WIN32_HAS_ANSI)
@@ -34430,11 +34427,11 @@
34430 */
34431 #if SQLITE_OS_WINRT
34432 static HANDLE sleepObj = NULL;
34433 #endif
34434
34435 SQLITE_API void sqlite3_win32_sleep(DWORD milliseconds){
34436 #if SQLITE_OS_WINRT
34437 if ( sleepObj==NULL ){
34438 sleepObj = osCreateEventExW(NULL, NULL, CREATE_EVENT_MANUAL_RESET,
34439 SYNCHRONIZE);
34440 }
@@ -34479,11 +34476,11 @@
34479
34480 /*
34481 ** This function determines if the machine is running a version of Windows
34482 ** based on the NT kernel.
34483 */
34484 SQLITE_API int sqlite3_win32_is_nt(void){
34485 #if SQLITE_OS_WINRT
34486 /*
34487 ** NOTE: The WinRT sub-platform is always assumed to be based on the NT
34488 ** kernel.
34489 */
@@ -34833,11 +34830,11 @@
34833
34834 /*
34835 ** Convert multibyte character string to UTF-8. Space to hold the
34836 ** returned string is obtained from sqlite3_malloc().
34837 */
34838 SQLITE_API char *sqlite3_win32_mbcs_to_utf8(const char *zFilename){
34839 char *zFilenameUtf8;
34840 LPWSTR zTmpWide;
34841
34842 zTmpWide = winMbcsToUnicode(zFilename);
34843 if( zTmpWide==0 ){
@@ -34850,11 +34847,11 @@
34850
34851 /*
34852 ** Convert UTF-8 to multibyte character string. Space to hold the
34853 ** returned string is obtained from sqlite3_malloc().
34854 */
34855 SQLITE_API char *sqlite3_win32_utf8_to_mbcs(const char *zFilename){
34856 char *zFilenameMbcs;
34857 LPWSTR zTmpWide;
34858
34859 zTmpWide = winUtf8ToUnicode(zFilename);
34860 if( zTmpWide==0 ){
@@ -34870,11 +34867,11 @@
34870 ** the provided arguments. The type argument must be 1 in order to set the
34871 ** data directory or 2 in order to set the temporary directory. The zValue
34872 ** argument is the name of the directory to use. The return value will be
34873 ** SQLITE_OK if successful.
34874 */
34875 SQLITE_API int sqlite3_win32_set_directory(DWORD type, LPCWSTR zValue){
34876 char **ppDirectory = 0;
34877 #ifndef SQLITE_OMIT_AUTOINIT
34878 int rc = sqlite3_initialize();
34879 if( rc ) return rc;
34880 #endif
@@ -35095,15 +35092,15 @@
35095 }
35096
35097 /*
35098 ** Log a I/O error retry episode.
35099 */
35100 static void winLogIoerr(int nRetry){
35101 if( nRetry ){
35102 sqlite3_log(SQLITE_IOERR,
35103 "delayed %dms for lock/sharing conflict",
35104 winIoerrRetryDelay*nRetry*(nRetry+1)/2
35105 );
35106 }
35107 }
35108
35109 #if SQLITE_OS_WINCE
@@ -35579,11 +35576,12 @@
35579 assert( id!=0 );
35580 #ifndef SQLITE_OMIT_WAL
35581 assert( pFile->pShm==0 );
35582 #endif
35583 assert( pFile->h!=NULL && pFile->h!=INVALID_HANDLE_VALUE );
35584 OSTRACE(("CLOSE file=%p\n", pFile->h));
 
35585
35586 #if SQLITE_MAX_MMAP_SIZE>0
35587 winUnmapfile(pFile);
35588 #endif
35589
@@ -35608,11 +35606,12 @@
35608 #endif
35609 if( rc ){
35610 pFile->h = NULL;
35611 }
35612 OpenCounter(-1);
35613 OSTRACE(("CLOSE file=%p, rc=%s\n", pFile->h, rc ? "ok" : "failed"));
 
35614 return rc ? SQLITE_OK
35615 : winLogError(SQLITE_IOERR_CLOSE, osGetLastError(),
35616 "winClose", pFile->zPath);
35617 }
35618
@@ -35636,20 +35635,22 @@
35636
35637 assert( id!=0 );
35638 assert( amt>0 );
35639 assert( offset>=0 );
35640 SimulateIOError(return SQLITE_IOERR_READ);
35641 OSTRACE(("READ file=%p, buffer=%p, amount=%d, offset=%lld, lock=%d\n",
 
35642 pFile->h, pBuf, amt, offset, pFile->locktype));
35643
35644 #if SQLITE_MAX_MMAP_SIZE>0
35645 /* Deal with as much of this read request as possible by transfering
35646 ** data from the memory mapping using memcpy(). */
35647 if( offset<pFile->mmapSize ){
35648 if( offset+amt <= pFile->mmapSize ){
35649 memcpy(pBuf, &((u8 *)(pFile->pMapRegion))[offset], amt);
35650 OSTRACE(("READ-MMAP file=%p, rc=SQLITE_OK\n", pFile->h));
 
35651 return SQLITE_OK;
35652 }else{
35653 int nCopy = (int)(pFile->mmapSize - offset);
35654 memcpy(pBuf, &((u8 *)(pFile->pMapRegion))[offset], nCopy);
35655 pBuf = &((u8 *)pBuf)[nCopy];
@@ -35659,11 +35660,12 @@
35659 }
35660 #endif
35661
35662 #if SQLITE_OS_WINCE || defined(SQLITE_WIN32_NO_OVERLAPPED)
35663 if( winSeekFile(pFile, offset) ){
35664 OSTRACE(("READ file=%p, rc=SQLITE_FULL\n", pFile->h));
 
35665 return SQLITE_FULL;
35666 }
35667 while( !osReadFile(pFile->h, pBuf, amt, &nRead, 0) ){
35668 #else
35669 memset(&overlapped, 0, sizeof(OVERLAPPED));
@@ -35673,23 +35675,26 @@
35673 osGetLastError()!=ERROR_HANDLE_EOF ){
35674 #endif
35675 DWORD lastErrno;
35676 if( winRetryIoerr(&nRetry, &lastErrno) ) continue;
35677 pFile->lastErrno = lastErrno;
35678 OSTRACE(("READ file=%p, rc=SQLITE_IOERR_READ\n", pFile->h));
 
35679 return winLogError(SQLITE_IOERR_READ, pFile->lastErrno,
35680 "winRead", pFile->zPath);
35681 }
35682 winLogIoerr(nRetry);
35683 if( nRead<(DWORD)amt ){
35684 /* Unread parts of the buffer must be zero-filled */
35685 memset(&((char*)pBuf)[nRead], 0, amt-nRead);
35686 OSTRACE(("READ file=%p, rc=SQLITE_IOERR_SHORT_READ\n", pFile->h));
 
35687 return SQLITE_IOERR_SHORT_READ;
35688 }
35689
35690 OSTRACE(("READ file=%p, rc=SQLITE_OK\n", pFile->h));
 
35691 return SQLITE_OK;
35692 }
35693
35694 /*
35695 ** Write data from a buffer into a file. Return SQLITE_OK on success
@@ -35708,20 +35713,22 @@
35708 assert( amt>0 );
35709 assert( pFile );
35710 SimulateIOError(return SQLITE_IOERR_WRITE);
35711 SimulateDiskfullError(return SQLITE_FULL);
35712
35713 OSTRACE(("WRITE file=%p, buffer=%p, amount=%d, offset=%lld, lock=%d\n",
 
35714 pFile->h, pBuf, amt, offset, pFile->locktype));
35715
35716 #if SQLITE_MAX_MMAP_SIZE>0
35717 /* Deal with as much of this write request as possible by transfering
35718 ** data from the memory mapping using memcpy(). */
35719 if( offset<pFile->mmapSize ){
35720 if( offset+amt <= pFile->mmapSize ){
35721 memcpy(&((u8 *)(pFile->pMapRegion))[offset], pBuf, amt);
35722 OSTRACE(("WRITE-MMAP file=%p, rc=SQLITE_OK\n", pFile->h));
 
35723 return SQLITE_OK;
35724 }else{
35725 int nCopy = (int)(pFile->mmapSize - offset);
35726 memcpy(&((u8 *)(pFile->pMapRegion))[offset], pBuf, nCopy);
35727 pBuf = &((u8 *)pBuf)[nCopy];
@@ -35780,21 +35787,24 @@
35780 }
35781
35782 if( rc ){
35783 if( ( pFile->lastErrno==ERROR_HANDLE_DISK_FULL )
35784 || ( pFile->lastErrno==ERROR_DISK_FULL )){
35785 OSTRACE(("WRITE file=%p, rc=SQLITE_FULL\n", pFile->h));
 
35786 return winLogError(SQLITE_FULL, pFile->lastErrno,
35787 "winWrite1", pFile->zPath);
35788 }
35789 OSTRACE(("WRITE file=%p, rc=SQLITE_IOERR_WRITE\n", pFile->h));
 
35790 return winLogError(SQLITE_IOERR_WRITE, pFile->lastErrno,
35791 "winWrite2", pFile->zPath);
35792 }else{
35793 winLogIoerr(nRetry);
35794 }
35795 OSTRACE(("WRITE file=%p, rc=SQLITE_OK\n", pFile->h));
 
35796 return SQLITE_OK;
35797 }
35798
35799 /*
35800 ** Truncate an open file to a specified size
@@ -35804,12 +35814,12 @@
35804 int rc = SQLITE_OK; /* Return code for this function */
35805 DWORD lastErrno;
35806
35807 assert( pFile );
35808 SimulateIOError(return SQLITE_IOERR_TRUNCATE);
35809 OSTRACE(("TRUNCATE file=%p, size=%lld, lock=%d\n",
35810 pFile->h, nByte, pFile->locktype));
35811
35812 /* If the user has configured a chunk-size for this file, truncate the
35813 ** file so that it consists of an integer number of chunks (i.e. the
35814 ** actual file size after the operation may be larger than the requested
35815 ** size).
@@ -35837,11 +35847,12 @@
35837 if( pFile->pMapRegion && nByte<pFile->mmapSize ){
35838 pFile->mmapSize = nByte;
35839 }
35840 #endif
35841
35842 OSTRACE(("TRUNCATE file=%p, rc=%s\n", pFile->h, sqlite3ErrName(rc)));
 
35843 return rc;
35844 }
35845
35846 #ifdef SQLITE_TEST
35847 /*
@@ -35882,12 +35893,13 @@
35882 /* Unix cannot, but some systems may return SQLITE_FULL from here. This
35883 ** line is to test that doing so does not cause any problems.
35884 */
35885 SimulateDiskfullError( return SQLITE_FULL );
35886
35887 OSTRACE(("SYNC file=%p, flags=%x, lock=%d\n",
35888 pFile->h, flags, pFile->locktype));
 
35889
35890 #ifndef SQLITE_TEST
35891 UNUSED_PARAMETER(flags);
35892 #else
35893 if( (flags&0x0F)==SQLITE_SYNC_FULL ){
@@ -35898,21 +35910,24 @@
35898
35899 /* If we compiled with the SQLITE_NO_SYNC flag, then syncing is a
35900 ** no-op
35901 */
35902 #ifdef SQLITE_NO_SYNC
35903 OSTRACE(("SYNC-NOP file=%p, rc=SQLITE_OK\n", pFile->h));
 
35904 return SQLITE_OK;
35905 #else
35906 rc = osFlushFileBuffers(pFile->h);
35907 SimulateIOError( rc=FALSE );
35908 if( rc ){
35909 OSTRACE(("SYNC file=%p, rc=SQLITE_OK\n", pFile->h));
 
35910 return SQLITE_OK;
35911 }else{
35912 pFile->lastErrno = osGetLastError();
35913 OSTRACE(("SYNC file=%p, rc=SQLITE_IOERR_FSYNC\n", pFile->h));
 
35914 return winLogError(SQLITE_IOERR_FSYNC, pFile->lastErrno,
35915 "winSync", pFile->zPath);
35916 }
35917 #endif
35918 }
@@ -37881,11 +37896,11 @@
37881 winRetryIoerr(&cnt, &lastErrno) ){
37882 /* Noop */
37883 }
37884 }
37885 #endif
37886 winLogIoerr(cnt);
37887
37888 OSTRACE(("OPEN file=%p, name=%s, access=%lx, rc=%s\n", h, zUtf8Name,
37889 dwDesiredAccess, (h==INVALID_HANDLE_VALUE) ? "failed" : "ok"));
37890
37891 if( h==INVALID_HANDLE_VALUE ){
@@ -38065,11 +38080,11 @@
38065 }
38066 #endif
38067 if( rc && rc!=SQLITE_IOERR_DELETE_NOENT ){
38068 rc = winLogError(SQLITE_IOERR_DELETE, lastErrno, "winDelete", zFilename);
38069 }else{
38070 winLogIoerr(cnt);
38071 }
38072 sqlite3_free(zConverted);
38073 OSTRACE(("DELETE name=%s, rc=%s\n", zFilename, sqlite3ErrName(rc)));
38074 return rc;
38075 }
@@ -38115,11 +38130,11 @@
38115 attr = INVALID_FILE_ATTRIBUTES;
38116 }else{
38117 attr = sAttrData.dwFileAttributes;
38118 }
38119 }else{
38120 winLogIoerr(cnt);
38121 if( lastErrno!=ERROR_FILE_NOT_FOUND && lastErrno!=ERROR_PATH_NOT_FOUND ){
38122 sqlite3_free(zConverted);
38123 return winLogError(SQLITE_IOERR_ACCESS, lastErrno, "winAccess",
38124 zFilename);
38125 }else{
@@ -38630,11 +38645,11 @@
38630 }
38631
38632 /*
38633 ** Initialize and deinitialize the operating system interface.
38634 */
38635 SQLITE_API int sqlite3_os_init(void){
38636 static sqlite3_vfs winVfs = {
38637 3, /* iVersion */
38638 sizeof(winFile), /* szOsFile */
38639 SQLITE_WIN32_MAX_PATH_BYTES, /* mxPathname */
38640 0, /* pNext */
@@ -38705,11 +38720,11 @@
38705 #endif
38706
38707 return SQLITE_OK;
38708 }
38709
38710 SQLITE_API int sqlite3_os_end(void){
38711 #if SQLITE_OS_WINRT
38712 if( sleepObj!=NULL ){
38713 osCloseHandle(sleepObj);
38714 sleepObj = NULL;
38715 }
@@ -53006,11 +53021,11 @@
53006 **
53007 ** This routine has no effect on existing database connections.
53008 ** The shared cache setting effects only future calls to
53009 ** sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2().
53010 */
53011 SQLITE_API int sqlite3_enable_shared_cache(int enable){
53012 sqlite3GlobalConfig.sharedCacheEnabled = enable;
53013 return SQLITE_OK;
53014 }
53015 #endif
53016
@@ -53520,14 +53535,19 @@
53520 ** prior to calling this routine.
53521 */
53522 static int saveCursorPosition(BtCursor *pCur){
53523 int rc;
53524
53525 assert( CURSOR_VALID==pCur->eState );
53526 assert( 0==pCur->pKey );
53527 assert( cursorHoldsMutex(pCur) );
53528
 
 
 
 
 
53529 rc = sqlite3BtreeKeySize(pCur, &pCur->nKey);
53530 assert( rc==SQLITE_OK ); /* KeySize() cannot fail */
53531
53532 /* If this is an intKey table, then the above call to BtreeKeySize()
53533 ** stores the integer key in pCur->nKey. In this case this value is
@@ -53594,11 +53614,11 @@
53594 Pgno iRoot, /* Only save cursor with this iRoot. Save all if zero */
53595 BtCursor *pExcept /* Do not save this cursor */
53596 ){
53597 do{
53598 if( p!=pExcept && (0==iRoot || p->pgnoRoot==iRoot) ){
53599 if( p->eState==CURSOR_VALID ){
53600 int rc = saveCursorPosition(p);
53601 if( SQLITE_OK!=rc ){
53602 return rc;
53603 }
53604 }else{
@@ -53666,21 +53686,23 @@
53666 ** at most one effective restoreCursorPosition() call after each
53667 ** saveCursorPosition().
53668 */
53669 static int btreeRestoreCursorPosition(BtCursor *pCur){
53670 int rc;
 
53671 assert( cursorHoldsMutex(pCur) );
53672 assert( pCur->eState>=CURSOR_REQUIRESEEK );
53673 if( pCur->eState==CURSOR_FAULT ){
53674 return pCur->skipNext;
53675 }
53676 pCur->eState = CURSOR_INVALID;
53677 rc = btreeMoveto(pCur, pCur->pKey, pCur->nKey, 0, &pCur->skipNext);
53678 if( rc==SQLITE_OK ){
53679 sqlite3_free(pCur->pKey);
53680 pCur->pKey = 0;
53681 assert( pCur->eState==CURSOR_VALID || pCur->eState==CURSOR_INVALID );
 
53682 if( pCur->skipNext && pCur->eState==CURSOR_VALID ){
53683 pCur->eState = CURSOR_SKIPNEXT;
53684 }
53685 }
53686 return rc;
@@ -53728,13 +53750,14 @@
53728 rc = restoreCursorPosition(pCur);
53729 if( rc ){
53730 *pDifferentRow = 1;
53731 return rc;
53732 }
53733 if( pCur->eState!=CURSOR_VALID || NEVER(pCur->skipNext!=0) ){
53734 *pDifferentRow = 1;
53735 }else{
 
53736 *pDifferentRow = 0;
53737 }
53738 return SQLITE_OK;
53739 }
53740
@@ -56545,11 +56568,11 @@
56545 if( pBtree ){
56546 sqlite3BtreeEnter(pBtree);
56547 for(p=pBtree->pBt->pCursor; p; p=p->pNext){
56548 int i;
56549 if( writeOnly && (p->curFlags & BTCF_WriteFlag)==0 ){
56550 if( p->eState==CURSOR_VALID ){
56551 rc = saveCursorPosition(p);
56552 if( rc!=SQLITE_OK ){
56553 (void)sqlite3BtreeTripAllCursors(pBtree, rc, 0);
56554 break;
56555 }
@@ -56951,10 +56974,12 @@
56951 ** to return an integer result code for historical reasons.
56952 */
56953 SQLITE_PRIVATE int sqlite3BtreeDataSize(BtCursor *pCur, u32 *pSize){
56954 assert( cursorHoldsMutex(pCur) );
56955 assert( pCur->eState==CURSOR_VALID );
 
 
56956 assert( pCur->apPage[pCur->iPage]->intKeyLeaf==1 );
56957 getCellInfo(pCur);
56958 *pSize = pCur->info.nPayload;
56959 return SQLITE_OK;
56960 }
@@ -57429,19 +57454,21 @@
57429 return SQLITE_CORRUPT_BKPT;
57430 }
57431 return SQLITE_OK;
57432 }
57433
57434 #if 0
57435 /*
57436 ** Page pParent is an internal (non-leaf) tree page. This function
57437 ** asserts that page number iChild is the left-child if the iIdx'th
57438 ** cell in page pParent. Or, if iIdx is equal to the total number of
57439 ** cells in pParent, that page number iChild is the right-child of
57440 ** the page.
57441 */
57442 static void assertParentIndex(MemPage *pParent, int iIdx, Pgno iChild){
 
 
57443 assert( iIdx<=pParent->nCell );
57444 if( iIdx==pParent->nCell ){
57445 assert( get4byte(&pParent->aData[pParent->hdrOffset+8])==iChild );
57446 }else{
57447 assert( get4byte(findCell(pParent, iIdx))==iChild );
@@ -57462,23 +57489,15 @@
57462 static void moveToParent(BtCursor *pCur){
57463 assert( cursorHoldsMutex(pCur) );
57464 assert( pCur->eState==CURSOR_VALID );
57465 assert( pCur->iPage>0 );
57466 assert( pCur->apPage[pCur->iPage] );
57467
57468 /* UPDATE: It is actually possible for the condition tested by the assert
57469 ** below to be untrue if the database file is corrupt. This can occur if
57470 ** one cursor has modified page pParent while a reference to it is held
57471 ** by a second cursor. Which can only happen if a single page is linked
57472 ** into more than one b-tree structure in a corrupt database. */
57473 #if 0
57474 assertParentIndex(
57475 pCur->apPage[pCur->iPage-1],
57476 pCur->aiIdx[pCur->iPage-1],
57477 pCur->apPage[pCur->iPage]->pgno
57478 );
57479 #endif
57480 testcase( pCur->aiIdx[pCur->iPage-1] > pCur->apPage[pCur->iPage-1]->nCell );
57481
57482 releasePage(pCur->apPage[pCur->iPage]);
57483 pCur->iPage--;
57484 pCur->info.nSize = 0;
@@ -60422,10 +60441,11 @@
60422 pPage->nOverflow = 0;
60423
60424 /* The next iteration of the do-loop balances the parent page. */
60425 releasePage(pPage);
60426 pCur->iPage--;
 
60427 }
60428 }while( rc==SQLITE_OK );
60429
60430 if( pFree ){
60431 sqlite3PageFree(pFree);
@@ -60893,29 +60913,32 @@
60893 int rc;
60894 unsigned char *pCell;
60895 int i;
60896 int hdr;
60897 u16 szCell;
 
60898
60899 assert( sqlite3_mutex_held(pBt->mutex) );
60900 if( pgno>btreePagecount(pBt) ){
60901 return SQLITE_CORRUPT_BKPT;
60902 }
60903
60904 rc = getAndInitPage(pBt, pgno, &pPage, 0);
60905 if( rc ) return rc;
 
 
60906 hdr = pPage->hdrOffset;
60907 for(i=0; i<pPage->nCell; i++){
60908 pCell = findCell(pPage, i);
60909 if( !pPage->leaf ){
60910 rc = clearDatabasePage(pBt, get4byte(pCell), 1, pnChange);
60911 if( rc ) goto cleardatabasepage_out;
60912 }
60913 rc = clearCell(pPage, pCell, &szCell);
60914 if( rc ) goto cleardatabasepage_out;
60915 }
60916 if( !pPage->leaf ){
60917 rc = clearDatabasePage(pBt, get4byte(&pPage->aData[hdr+8]), 1, pnChange);
60918 if( rc ) goto cleardatabasepage_out;
60919 }else if( pnChange ){
60920 assert( pPage->intKey );
60921 *pnChange += pPage->nCell;
@@ -62239,11 +62262,11 @@
62239 ** a pointer to the new sqlite3_backup object.
62240 **
62241 ** If an error occurs, NULL is returned and an error code and error message
62242 ** stored in database handle pDestDb.
62243 */
62244 SQLITE_API sqlite3_backup *sqlite3_backup_init(
62245 sqlite3* pDestDb, /* Database to write to */
62246 const char *zDestDb, /* Name of database within pDestDb */
62247 sqlite3* pSrcDb, /* Database connection to read from */
62248 const char *zSrcDb /* Name of database within pSrcDb */
62249 ){
@@ -62447,11 +62470,11 @@
62447 }
62448
62449 /*
62450 ** Copy nPage pages from the source b-tree to the destination.
62451 */
62452 SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){
62453 int rc;
62454 int destMode; /* Destination journal mode */
62455 int pgszSrc = 0; /* Source page size */
62456 int pgszDest = 0; /* Destination page size */
62457
@@ -62692,11 +62715,11 @@
62692 }
62693
62694 /*
62695 ** Release all resources associated with an sqlite3_backup* handle.
62696 */
62697 SQLITE_API int sqlite3_backup_finish(sqlite3_backup *p){
62698 sqlite3_backup **pp; /* Ptr to head of pagers backup list */
62699 sqlite3 *pSrcDb; /* Source database connection */
62700 int rc; /* Value to return */
62701
62702 /* Enter the mutexes */
@@ -62744,11 +62767,11 @@
62744
62745 /*
62746 ** Return the number of pages still to be backed up as of the most recent
62747 ** call to sqlite3_backup_step().
62748 */
62749 SQLITE_API int sqlite3_backup_remaining(sqlite3_backup *p){
62750 #ifdef SQLITE_ENABLE_API_ARMOR
62751 if( p==0 ){
62752 (void)SQLITE_MISUSE_BKPT;
62753 return 0;
62754 }
@@ -62758,11 +62781,11 @@
62758
62759 /*
62760 ** Return the total number of pages in the source database as of the most
62761 ** recent call to sqlite3_backup_step().
62762 */
62763 SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p){
62764 #ifdef SQLITE_ENABLE_API_ARMOR
62765 if( p==0 ){
62766 (void)SQLITE_MISUSE_BKPT;
62767 return 0;
62768 }
@@ -64633,11 +64656,11 @@
64633 }
64634
64635 /*
64636 ** Return the SQL associated with a prepared statement
64637 */
64638 SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt){
64639 Vdbe *p = (Vdbe *)pStmt;
64640 return (p && p->isPrepareV2) ? p->zSql : 0;
64641 }
64642
64643 /*
@@ -68789,11 +68812,11 @@
68789 ** execution environment changes in a way that would alter the program
68790 ** that sqlite3_prepare() generates. For example, if new functions or
68791 ** collating sequences are registered or if an authorizer function is
68792 ** added or changed.
68793 */
68794 SQLITE_API int sqlite3_expired(sqlite3_stmt *pStmt){
68795 Vdbe *p = (Vdbe*)pStmt;
68796 return p==0 || p->expired;
68797 }
68798 #endif
68799
@@ -68826,11 +68849,11 @@
68826 ** machine.
68827 **
68828 ** This routine sets the error code and string returned by
68829 ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
68830 */
68831 SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt){
68832 int rc;
68833 if( pStmt==0 ){
68834 /* IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL
68835 ** pointer is a harmless no-op. */
68836 rc = SQLITE_OK;
@@ -68852,11 +68875,11 @@
68852 ** the prior execution is returned.
68853 **
68854 ** This routine sets the error code and string returned by
68855 ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
68856 */
68857 SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt){
68858 int rc;
68859 if( pStmt==0 ){
68860 rc = SQLITE_OK;
68861 }else{
68862 Vdbe *v = (Vdbe*)pStmt;
@@ -68871,11 +68894,11 @@
68871 }
68872
68873 /*
68874 ** Set all the parameters in the compiled SQL statement to NULL.
68875 */
68876 SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt *pStmt){
68877 int i;
68878 int rc = SQLITE_OK;
68879 Vdbe *p = (Vdbe*)pStmt;
68880 #if SQLITE_THREADSAFE
68881 sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex;
@@ -68895,54 +68918,54 @@
68895
68896 /**************************** sqlite3_value_ *******************************
68897 ** The following routines extract information from a Mem or sqlite3_value
68898 ** structure.
68899 */
68900 SQLITE_API const void *sqlite3_value_blob(sqlite3_value *pVal){
68901 Mem *p = (Mem*)pVal;
68902 if( p->flags & (MEM_Blob|MEM_Str) ){
68903 sqlite3VdbeMemExpandBlob(p);
68904 p->flags |= MEM_Blob;
68905 return p->n ? p->z : 0;
68906 }else{
68907 return sqlite3_value_text(pVal);
68908 }
68909 }
68910 SQLITE_API int sqlite3_value_bytes(sqlite3_value *pVal){
68911 return sqlite3ValueBytes(pVal, SQLITE_UTF8);
68912 }
68913 SQLITE_API int sqlite3_value_bytes16(sqlite3_value *pVal){
68914 return sqlite3ValueBytes(pVal, SQLITE_UTF16NATIVE);
68915 }
68916 SQLITE_API double sqlite3_value_double(sqlite3_value *pVal){
68917 return sqlite3VdbeRealValue((Mem*)pVal);
68918 }
68919 SQLITE_API int sqlite3_value_int(sqlite3_value *pVal){
68920 return (int)sqlite3VdbeIntValue((Mem*)pVal);
68921 }
68922 SQLITE_API sqlite_int64 sqlite3_value_int64(sqlite3_value *pVal){
68923 return sqlite3VdbeIntValue((Mem*)pVal);
68924 }
68925 SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value *pVal){
68926 return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
68927 }
68928 #ifndef SQLITE_OMIT_UTF16
68929 SQLITE_API const void *sqlite3_value_text16(sqlite3_value* pVal){
68930 return sqlite3ValueText(pVal, SQLITE_UTF16NATIVE);
68931 }
68932 SQLITE_API const void *sqlite3_value_text16be(sqlite3_value *pVal){
68933 return sqlite3ValueText(pVal, SQLITE_UTF16BE);
68934 }
68935 SQLITE_API const void *sqlite3_value_text16le(sqlite3_value *pVal){
68936 return sqlite3ValueText(pVal, SQLITE_UTF16LE);
68937 }
68938 #endif /* SQLITE_OMIT_UTF16 */
68939 /* EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five
68940 ** fundamental datatypes: 64-bit signed integer 64-bit IEEE floating
68941 ** point number string BLOB NULL
68942 */
68943 SQLITE_API int sqlite3_value_type(sqlite3_value* pVal){
68944 static const u8 aType[] = {
68945 SQLITE_BLOB, /* 0x00 */
68946 SQLITE_NULL, /* 0x01 */
68947 SQLITE_TEXT, /* 0x02 */
68948 SQLITE_NULL, /* 0x03 */
@@ -69014,21 +69037,21 @@
69014 xDel((void*)p);
69015 }
69016 if( pCtx ) sqlite3_result_error_toobig(pCtx);
69017 return SQLITE_TOOBIG;
69018 }
69019 SQLITE_API void sqlite3_result_blob(
69020 sqlite3_context *pCtx,
69021 const void *z,
69022 int n,
69023 void (*xDel)(void *)
69024 ){
69025 assert( n>=0 );
69026 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69027 setResultStrOrError(pCtx, z, n, 0, xDel);
69028 }
69029 SQLITE_API void sqlite3_result_blob64(
69030 sqlite3_context *pCtx,
69031 const void *z,
69032 sqlite3_uint64 n,
69033 void (*xDel)(void *)
69034 ){
@@ -69038,50 +69061,50 @@
69038 (void)invokeValueDestructor(z, xDel, pCtx);
69039 }else{
69040 setResultStrOrError(pCtx, z, (int)n, 0, xDel);
69041 }
69042 }
69043 SQLITE_API void sqlite3_result_double(sqlite3_context *pCtx, double rVal){
69044 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69045 sqlite3VdbeMemSetDouble(pCtx->pOut, rVal);
69046 }
69047 SQLITE_API void sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
69048 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69049 pCtx->isError = SQLITE_ERROR;
69050 pCtx->fErrorOrAux = 1;
69051 sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF8, SQLITE_TRANSIENT);
69052 }
69053 #ifndef SQLITE_OMIT_UTF16
69054 SQLITE_API void sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){
69055 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69056 pCtx->isError = SQLITE_ERROR;
69057 pCtx->fErrorOrAux = 1;
69058 sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF16NATIVE, SQLITE_TRANSIENT);
69059 }
69060 #endif
69061 SQLITE_API void sqlite3_result_int(sqlite3_context *pCtx, int iVal){
69062 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69063 sqlite3VdbeMemSetInt64(pCtx->pOut, (i64)iVal);
69064 }
69065 SQLITE_API void sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
69066 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69067 sqlite3VdbeMemSetInt64(pCtx->pOut, iVal);
69068 }
69069 SQLITE_API void sqlite3_result_null(sqlite3_context *pCtx){
69070 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69071 sqlite3VdbeMemSetNull(pCtx->pOut);
69072 }
69073 SQLITE_API void sqlite3_result_text(
69074 sqlite3_context *pCtx,
69075 const char *z,
69076 int n,
69077 void (*xDel)(void *)
69078 ){
69079 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69080 setResultStrOrError(pCtx, z, n, SQLITE_UTF8, xDel);
69081 }
69082 SQLITE_API void sqlite3_result_text64(
69083 sqlite3_context *pCtx,
69084 const char *z,
69085 sqlite3_uint64 n,
69086 void (*xDel)(void *),
69087 unsigned char enc
@@ -69094,47 +69117,47 @@
69094 }else{
69095 setResultStrOrError(pCtx, z, (int)n, enc, xDel);
69096 }
69097 }
69098 #ifndef SQLITE_OMIT_UTF16
69099 SQLITE_API void sqlite3_result_text16(
69100 sqlite3_context *pCtx,
69101 const void *z,
69102 int n,
69103 void (*xDel)(void *)
69104 ){
69105 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69106 setResultStrOrError(pCtx, z, n, SQLITE_UTF16NATIVE, xDel);
69107 }
69108 SQLITE_API void sqlite3_result_text16be(
69109 sqlite3_context *pCtx,
69110 const void *z,
69111 int n,
69112 void (*xDel)(void *)
69113 ){
69114 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69115 setResultStrOrError(pCtx, z, n, SQLITE_UTF16BE, xDel);
69116 }
69117 SQLITE_API void sqlite3_result_text16le(
69118 sqlite3_context *pCtx,
69119 const void *z,
69120 int n,
69121 void (*xDel)(void *)
69122 ){
69123 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69124 setResultStrOrError(pCtx, z, n, SQLITE_UTF16LE, xDel);
69125 }
69126 #endif /* SQLITE_OMIT_UTF16 */
69127 SQLITE_API void sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){
69128 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69129 sqlite3VdbeMemCopy(pCtx->pOut, pValue);
69130 }
69131 SQLITE_API void sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){
69132 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69133 sqlite3VdbeMemSetZeroBlob(pCtx->pOut, n);
69134 }
69135 SQLITE_API void sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){
69136 pCtx->isError = errCode;
69137 pCtx->fErrorOrAux = 1;
69138 #ifdef SQLITE_DEBUG
69139 if( pCtx->pVdbe ) pCtx->pVdbe->rcApp = errCode;
69140 #endif
@@ -69143,20 +69166,20 @@
69143 SQLITE_UTF8, SQLITE_STATIC);
69144 }
69145 }
69146
69147 /* Force an SQLITE_TOOBIG error. */
69148 SQLITE_API void sqlite3_result_error_toobig(sqlite3_context *pCtx){
69149 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69150 pCtx->isError = SQLITE_TOOBIG;
69151 pCtx->fErrorOrAux = 1;
69152 sqlite3VdbeMemSetStr(pCtx->pOut, "string or blob too big", -1,
69153 SQLITE_UTF8, SQLITE_STATIC);
69154 }
69155
69156 /* An SQLITE_NOMEM error. */
69157 SQLITE_API void sqlite3_result_error_nomem(sqlite3_context *pCtx){
69158 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69159 sqlite3VdbeMemSetNull(pCtx->pOut);
69160 pCtx->isError = SQLITE_NOMEM;
69161 pCtx->fErrorOrAux = 1;
69162 pCtx->pOut->db->mallocFailed = 1;
@@ -69325,11 +69348,11 @@
69325 /*
69326 ** This is the top-level implementation of sqlite3_step(). Call
69327 ** sqlite3Step() to do most of the work. If a schema error occurs,
69328 ** call sqlite3Reprepare() and try again.
69329 */
69330 SQLITE_API int sqlite3_step(sqlite3_stmt *pStmt){
69331 int rc = SQLITE_OK; /* Result from sqlite3Step() */
69332 int rc2 = SQLITE_OK; /* Result from sqlite3Reprepare() */
69333 Vdbe *v = (Vdbe*)pStmt; /* the prepared statement */
69334 int cnt = 0; /* Counter to prevent infinite loop of reprepares */
69335 sqlite3 *db; /* The database connection */
@@ -69376,11 +69399,11 @@
69376
69377 /*
69378 ** Extract the user data from a sqlite3_context structure and return a
69379 ** pointer to it.
69380 */
69381 SQLITE_API void *sqlite3_user_data(sqlite3_context *p){
69382 assert( p && p->pFunc );
69383 return p->pFunc->pUserData;
69384 }
69385
69386 /*
@@ -69391,11 +69414,11 @@
69391 ** returns a copy of the pointer to the database connection (the 1st
69392 ** parameter) of the sqlite3_create_function() and
69393 ** sqlite3_create_function16() routines that originally registered the
69394 ** application defined function.
69395 */
69396 SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context *p){
69397 assert( p && p->pFunc );
69398 return p->pOut->db;
69399 }
69400
69401 /*
@@ -69467,11 +69490,11 @@
69467 /*
69468 ** Allocate or return the aggregate context for a user function. A new
69469 ** context is allocated on the first call. Subsequent calls return the
69470 ** same context that was returned on prior calls.
69471 */
69472 SQLITE_API void *sqlite3_aggregate_context(sqlite3_context *p, int nByte){
69473 assert( p && p->pFunc && p->pFunc->xStep );
69474 assert( sqlite3_mutex_held(p->pOut->db->mutex) );
69475 testcase( nByte<0 );
69476 if( (p->pMem->flags & MEM_Agg)==0 ){
69477 return createAggContext(p, nByte);
@@ -69482,11 +69505,11 @@
69482
69483 /*
69484 ** Return the auxiliary data pointer, if any, for the iArg'th argument to
69485 ** the user-function defined by pCtx.
69486 */
69487 SQLITE_API void *sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
69488 AuxData *pAuxData;
69489
69490 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69491 #if SQLITE_ENABLE_STAT3_OR_STAT4
69492 if( pCtx->pVdbe==0 ) return 0;
@@ -69503,11 +69526,11 @@
69503 /*
69504 ** Set the auxiliary data pointer and delete function, for the iArg'th
69505 ** argument to the user-function defined by pCtx. Any previous value is
69506 ** deleted by calling the delete function specified when it was set.
69507 */
69508 SQLITE_API void sqlite3_set_auxdata(
69509 sqlite3_context *pCtx,
69510 int iArg,
69511 void *pAux,
69512 void (*xDelete)(void*)
69513 ){
@@ -69558,29 +69581,29 @@
69558 ** This function is deprecated. Do not use it for new code. It is
69559 ** provide only to avoid breaking legacy code. New aggregate function
69560 ** implementations should keep their own counts within their aggregate
69561 ** context.
69562 */
69563 SQLITE_API int sqlite3_aggregate_count(sqlite3_context *p){
69564 assert( p && p->pMem && p->pFunc && p->pFunc->xStep );
69565 return p->pMem->n;
69566 }
69567 #endif
69568
69569 /*
69570 ** Return the number of columns in the result set for the statement pStmt.
69571 */
69572 SQLITE_API int sqlite3_column_count(sqlite3_stmt *pStmt){
69573 Vdbe *pVm = (Vdbe *)pStmt;
69574 return pVm ? pVm->nResColumn : 0;
69575 }
69576
69577 /*
69578 ** Return the number of values available from the current row of the
69579 ** currently executing statement pStmt.
69580 */
69581 SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt){
69582 Vdbe *pVm = (Vdbe *)pStmt;
69583 if( pVm==0 || pVm->pResultSet==0 ) return 0;
69584 return pVm->nResColumn;
69585 }
69586
@@ -69678,67 +69701,67 @@
69678
69679 /**************************** sqlite3_column_ *******************************
69680 ** The following routines are used to access elements of the current row
69681 ** in the result set.
69682 */
69683 SQLITE_API const void *sqlite3_column_blob(sqlite3_stmt *pStmt, int i){
69684 const void *val;
69685 val = sqlite3_value_blob( columnMem(pStmt,i) );
69686 /* Even though there is no encoding conversion, value_blob() might
69687 ** need to call malloc() to expand the result of a zeroblob()
69688 ** expression.
69689 */
69690 columnMallocFailure(pStmt);
69691 return val;
69692 }
69693 SQLITE_API int sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){
69694 int val = sqlite3_value_bytes( columnMem(pStmt,i) );
69695 columnMallocFailure(pStmt);
69696 return val;
69697 }
69698 SQLITE_API int sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){
69699 int val = sqlite3_value_bytes16( columnMem(pStmt,i) );
69700 columnMallocFailure(pStmt);
69701 return val;
69702 }
69703 SQLITE_API double sqlite3_column_double(sqlite3_stmt *pStmt, int i){
69704 double val = sqlite3_value_double( columnMem(pStmt,i) );
69705 columnMallocFailure(pStmt);
69706 return val;
69707 }
69708 SQLITE_API int sqlite3_column_int(sqlite3_stmt *pStmt, int i){
69709 int val = sqlite3_value_int( columnMem(pStmt,i) );
69710 columnMallocFailure(pStmt);
69711 return val;
69712 }
69713 SQLITE_API sqlite_int64 sqlite3_column_int64(sqlite3_stmt *pStmt, int i){
69714 sqlite_int64 val = sqlite3_value_int64( columnMem(pStmt,i) );
69715 columnMallocFailure(pStmt);
69716 return val;
69717 }
69718 SQLITE_API const unsigned char *sqlite3_column_text(sqlite3_stmt *pStmt, int i){
69719 const unsigned char *val = sqlite3_value_text( columnMem(pStmt,i) );
69720 columnMallocFailure(pStmt);
69721 return val;
69722 }
69723 SQLITE_API sqlite3_value *sqlite3_column_value(sqlite3_stmt *pStmt, int i){
69724 Mem *pOut = columnMem(pStmt, i);
69725 if( pOut->flags&MEM_Static ){
69726 pOut->flags &= ~MEM_Static;
69727 pOut->flags |= MEM_Ephem;
69728 }
69729 columnMallocFailure(pStmt);
69730 return (sqlite3_value *)pOut;
69731 }
69732 #ifndef SQLITE_OMIT_UTF16
69733 SQLITE_API const void *sqlite3_column_text16(sqlite3_stmt *pStmt, int i){
69734 const void *val = sqlite3_value_text16( columnMem(pStmt,i) );
69735 columnMallocFailure(pStmt);
69736 return val;
69737 }
69738 #endif /* SQLITE_OMIT_UTF16 */
69739 SQLITE_API int sqlite3_column_type(sqlite3_stmt *pStmt, int i){
69740 int iType = sqlite3_value_type( columnMem(pStmt,i) );
69741 columnMallocFailure(pStmt);
69742 return iType;
69743 }
69744
@@ -69798,16 +69821,16 @@
69798
69799 /*
69800 ** Return the name of the Nth column of the result set returned by SQL
69801 ** statement pStmt.
69802 */
69803 SQLITE_API const char *sqlite3_column_name(sqlite3_stmt *pStmt, int N){
69804 return columnName(
69805 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_NAME);
69806 }
69807 #ifndef SQLITE_OMIT_UTF16
69808 SQLITE_API const void *sqlite3_column_name16(sqlite3_stmt *pStmt, int N){
69809 return columnName(
69810 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_NAME);
69811 }
69812 #endif
69813
@@ -69823,16 +69846,16 @@
69823 #ifndef SQLITE_OMIT_DECLTYPE
69824 /*
69825 ** Return the column declaration type (if applicable) of the 'i'th column
69826 ** of the result set of SQL statement pStmt.
69827 */
69828 SQLITE_API const char *sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){
69829 return columnName(
69830 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DECLTYPE);
69831 }
69832 #ifndef SQLITE_OMIT_UTF16
69833 SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){
69834 return columnName(
69835 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DECLTYPE);
69836 }
69837 #endif /* SQLITE_OMIT_UTF16 */
69838 #endif /* SQLITE_OMIT_DECLTYPE */
@@ -69841,16 +69864,16 @@
69841 /*
69842 ** Return the name of the database from which a result column derives.
69843 ** NULL is returned if the result column is an expression or constant or
69844 ** anything else which is not an unambiguous reference to a database column.
69845 */
69846 SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){
69847 return columnName(
69848 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DATABASE);
69849 }
69850 #ifndef SQLITE_OMIT_UTF16
69851 SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){
69852 return columnName(
69853 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DATABASE);
69854 }
69855 #endif /* SQLITE_OMIT_UTF16 */
69856
@@ -69857,16 +69880,16 @@
69857 /*
69858 ** Return the name of the table from which a result column derives.
69859 ** NULL is returned if the result column is an expression or constant or
69860 ** anything else which is not an unambiguous reference to a database column.
69861 */
69862 SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){
69863 return columnName(
69864 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_TABLE);
69865 }
69866 #ifndef SQLITE_OMIT_UTF16
69867 SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){
69868 return columnName(
69869 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_TABLE);
69870 }
69871 #endif /* SQLITE_OMIT_UTF16 */
69872
@@ -69873,16 +69896,16 @@
69873 /*
69874 ** Return the name of the table column from which a result column derives.
69875 ** NULL is returned if the result column is an expression or constant or
69876 ** anything else which is not an unambiguous reference to a database column.
69877 */
69878 SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){
69879 return columnName(
69880 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_COLUMN);
69881 }
69882 #ifndef SQLITE_OMIT_UTF16
69883 SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){
69884 return columnName(
69885 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_COLUMN);
69886 }
69887 #endif /* SQLITE_OMIT_UTF16 */
69888 #endif /* SQLITE_ENABLE_COLUMN_METADATA */
@@ -69979,20 +70002,20 @@
69979
69980
69981 /*
69982 ** Bind a blob value to an SQL statement variable.
69983 */
69984 SQLITE_API int sqlite3_bind_blob(
69985 sqlite3_stmt *pStmt,
69986 int i,
69987 const void *zData,
69988 int nData,
69989 void (*xDel)(void*)
69990 ){
69991 return bindText(pStmt, i, zData, nData, xDel, 0);
69992 }
69993 SQLITE_API int sqlite3_bind_blob64(
69994 sqlite3_stmt *pStmt,
69995 int i,
69996 const void *zData,
69997 sqlite3_uint64 nData,
69998 void (*xDel)(void*)
@@ -70002,52 +70025,52 @@
70002 return invokeValueDestructor(zData, xDel, 0);
70003 }else{
70004 return bindText(pStmt, i, zData, (int)nData, xDel, 0);
70005 }
70006 }
70007 SQLITE_API int sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
70008 int rc;
70009 Vdbe *p = (Vdbe *)pStmt;
70010 rc = vdbeUnbind(p, i);
70011 if( rc==SQLITE_OK ){
70012 sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue);
70013 sqlite3_mutex_leave(p->db->mutex);
70014 }
70015 return rc;
70016 }
70017 SQLITE_API int sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){
70018 return sqlite3_bind_int64(p, i, (i64)iValue);
70019 }
70020 SQLITE_API int sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
70021 int rc;
70022 Vdbe *p = (Vdbe *)pStmt;
70023 rc = vdbeUnbind(p, i);
70024 if( rc==SQLITE_OK ){
70025 sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue);
70026 sqlite3_mutex_leave(p->db->mutex);
70027 }
70028 return rc;
70029 }
70030 SQLITE_API int sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
70031 int rc;
70032 Vdbe *p = (Vdbe*)pStmt;
70033 rc = vdbeUnbind(p, i);
70034 if( rc==SQLITE_OK ){
70035 sqlite3_mutex_leave(p->db->mutex);
70036 }
70037 return rc;
70038 }
70039 SQLITE_API int sqlite3_bind_text(
70040 sqlite3_stmt *pStmt,
70041 int i,
70042 const char *zData,
70043 int nData,
70044 void (*xDel)(void*)
70045 ){
70046 return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8);
70047 }
70048 SQLITE_API int sqlite3_bind_text64(
70049 sqlite3_stmt *pStmt,
70050 int i,
70051 const char *zData,
70052 sqlite3_uint64 nData,
70053 void (*xDel)(void*),
@@ -70060,21 +70083,21 @@
70060 if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE;
70061 return bindText(pStmt, i, zData, (int)nData, xDel, enc);
70062 }
70063 }
70064 #ifndef SQLITE_OMIT_UTF16
70065 SQLITE_API int sqlite3_bind_text16(
70066 sqlite3_stmt *pStmt,
70067 int i,
70068 const void *zData,
70069 int nData,
70070 void (*xDel)(void*)
70071 ){
70072 return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE);
70073 }
70074 #endif /* SQLITE_OMIT_UTF16 */
70075 SQLITE_API int sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
70076 int rc;
70077 switch( sqlite3_value_type((sqlite3_value*)pValue) ){
70078 case SQLITE_INTEGER: {
70079 rc = sqlite3_bind_int64(pStmt, i, pValue->u.i);
70080 break;
@@ -70101,11 +70124,11 @@
70101 break;
70102 }
70103 }
70104 return rc;
70105 }
70106 SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
70107 int rc;
70108 Vdbe *p = (Vdbe *)pStmt;
70109 rc = vdbeUnbind(p, i);
70110 if( rc==SQLITE_OK ){
70111 sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n);
@@ -70116,11 +70139,11 @@
70116
70117 /*
70118 ** Return the number of wildcards that can be potentially bound to.
70119 ** This routine is added to support DBD::SQLite.
70120 */
70121 SQLITE_API int sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
70122 Vdbe *p = (Vdbe*)pStmt;
70123 return p ? p->nVar : 0;
70124 }
70125
70126 /*
@@ -70127,11 +70150,11 @@
70127 ** Return the name of a wildcard parameter. Return NULL if the index
70128 ** is out of range or if the wildcard is unnamed.
70129 **
70130 ** The result is always UTF-8.
70131 */
70132 SQLITE_API const char *sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){
70133 Vdbe *p = (Vdbe*)pStmt;
70134 if( p==0 || i<1 || i>p->nzVar ){
70135 return 0;
70136 }
70137 return p->azVar[i-1];
@@ -70155,11 +70178,11 @@
70155 }
70156 }
70157 }
70158 return 0;
70159 }
70160 SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
70161 return sqlite3VdbeParameterIndex((Vdbe*)pStmt, zName, sqlite3Strlen30(zName));
70162 }
70163
70164 /*
70165 ** Transfer all bindings from the first statement over to the second.
@@ -70189,11 +70212,11 @@
70189 **
70190 ** If the two statements contain a different number of bindings, then
70191 ** an SQLITE_ERROR is returned. Nothing else can go wrong, so otherwise
70192 ** SQLITE_OK is returned.
70193 */
70194 SQLITE_API int sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
70195 Vdbe *pFrom = (Vdbe*)pFromStmt;
70196 Vdbe *pTo = (Vdbe*)pToStmt;
70197 if( pFrom->nVar!=pTo->nVar ){
70198 return SQLITE_ERROR;
70199 }
@@ -70211,26 +70234,26 @@
70211 ** Return the sqlite3* database handle to which the prepared statement given
70212 ** in the argument belongs. This is the same database handle that was
70213 ** the first argument to the sqlite3_prepare() that was used to create
70214 ** the statement in the first place.
70215 */
70216 SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt *pStmt){
70217 return pStmt ? ((Vdbe*)pStmt)->db : 0;
70218 }
70219
70220 /*
70221 ** Return true if the prepared statement is guaranteed to not modify the
70222 ** database.
70223 */
70224 SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt){
70225 return pStmt ? ((Vdbe*)pStmt)->readOnly : 1;
70226 }
70227
70228 /*
70229 ** Return true if the prepared statement is in need of being reset.
70230 */
70231 SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt *pStmt){
70232 Vdbe *v = (Vdbe*)pStmt;
70233 return v!=0 && v->pc>=0 && v->magic==VDBE_MAGIC_RUN;
70234 }
70235
70236 /*
@@ -70237,11 +70260,11 @@
70237 ** Return a pointer to the next prepared statement after pStmt associated
70238 ** with database connection pDb. If pStmt is NULL, return the first
70239 ** prepared statement for the database connection. Return NULL if there
70240 ** are no more.
70241 */
70242 SQLITE_API sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){
70243 sqlite3_stmt *pNext;
70244 #ifdef SQLITE_ENABLE_API_ARMOR
70245 if( !sqlite3SafetyCheckOk(pDb) ){
70246 (void)SQLITE_MISUSE_BKPT;
70247 return 0;
@@ -70258,11 +70281,11 @@
70258 }
70259
70260 /*
70261 ** Return the value of a status counter for a prepared statement
70262 */
70263 SQLITE_API int sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){
70264 Vdbe *pVdbe = (Vdbe*)pStmt;
70265 u32 v;
70266 #ifdef SQLITE_ENABLE_API_ARMOR
70267 if( !pStmt ){
70268 (void)SQLITE_MISUSE_BKPT;
@@ -70276,11 +70299,11 @@
70276
70277 #ifdef SQLITE_ENABLE_STMT_SCANSTATUS
70278 /*
70279 ** Return status data for a single loop within query pStmt.
70280 */
70281 SQLITE_API int sqlite3_stmt_scanstatus(
70282 sqlite3_stmt *pStmt, /* Prepared statement being queried */
70283 int idx, /* Index of loop to report on */
70284 int iScanStatusOp, /* Which metric to return */
70285 void *pOut /* OUT: Write the answer here */
70286 ){
@@ -70335,11 +70358,11 @@
70335 }
70336
70337 /*
70338 ** Zero all counters associated with the sqlite3_stmt_scanstatus() data.
70339 */
70340 SQLITE_API void sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){
70341 Vdbe *p = (Vdbe*)pStmt;
70342 memset(p->anExec, 0, p->nOp * sizeof(i64));
70343 }
70344 #endif /* SQLITE_ENABLE_STMT_SCANSTATUS */
70345
@@ -70834,11 +70857,11 @@
70834 ** Try to convert the type of a function argument or a result column
70835 ** into a numeric representation. Use either INTEGER or REAL whichever
70836 ** is appropriate. But only do the conversion if it is possible without
70837 ** loss of information and return the revised type of the argument.
70838 */
70839 SQLITE_API int sqlite3_value_numeric_type(sqlite3_value *pVal){
70840 int eType = sqlite3_value_type(pVal);
70841 if( eType==SQLITE_TEXT ){
70842 Mem *pMem = (Mem*)pVal;
70843 applyNumericAffinity(pMem, 0);
70844 eType = sqlite3_value_type(pVal);
@@ -77296,11 +77319,11 @@
77296 }
77297
77298 /*
77299 ** Open a blob handle.
77300 */
77301 SQLITE_API int sqlite3_blob_open(
77302 sqlite3* db, /* The database connection */
77303 const char *zDb, /* The attached database containing the blob */
77304 const char *zTable, /* The table containing the blob */
77305 const char *zColumn, /* The column containing the blob */
77306 sqlite_int64 iRow, /* The row containing the glob */
@@ -77533,11 +77556,11 @@
77533
77534 /*
77535 ** Close a blob handle that was previously created using
77536 ** sqlite3_blob_open().
77537 */
77538 SQLITE_API int sqlite3_blob_close(sqlite3_blob *pBlob){
77539 Incrblob *p = (Incrblob *)pBlob;
77540 int rc;
77541 sqlite3 *db;
77542
77543 if( p ){
@@ -77602,28 +77625,28 @@
77602 }
77603
77604 /*
77605 ** Read data from a blob handle.
77606 */
77607 SQLITE_API int sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){
77608 return blobReadWrite(pBlob, z, n, iOffset, sqlite3BtreeData);
77609 }
77610
77611 /*
77612 ** Write data to a blob handle.
77613 */
77614 SQLITE_API int sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){
77615 return blobReadWrite(pBlob, (void *)z, n, iOffset, sqlite3BtreePutData);
77616 }
77617
77618 /*
77619 ** Query a blob handle for the size of the data.
77620 **
77621 ** The Incrblob.nByte field is fixed for the lifetime of the Incrblob
77622 ** so no mutex is required for access.
77623 */
77624 SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *pBlob){
77625 Incrblob *p = (Incrblob *)pBlob;
77626 return (p && p->pStmt) ? p->nByte : 0;
77627 }
77628
77629 /*
@@ -77634,11 +77657,11 @@
77634 ** contain a blob or text value, then an error code is returned and the
77635 ** database handle error code and message set. If this happens, then all
77636 ** subsequent calls to sqlite3_blob_xxx() functions (except blob_close())
77637 ** immediately return SQLITE_ABORT.
77638 */
77639 SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){
77640 int rc;
77641 Incrblob *p = (Incrblob *)pBlob;
77642 sqlite3 *db;
77643
77644 if( p==0 ) return SQLITE_MISUSE_BKPT;
@@ -90142,11 +90165,11 @@
90142 ** and attempts to write the column will be ignored.
90143 **
90144 ** Setting the auth function to NULL disables this hook. The default
90145 ** setting of the auth function is NULL.
90146 */
90147 SQLITE_API int sqlite3_set_authorizer(
90148 sqlite3 *db,
90149 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
90150 void *pArg
90151 ){
90152 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -96720,11 +96743,11 @@
96720 }
96721
96722 /*
96723 ** The sqlite3_strglob() interface.
96724 */
96725 SQLITE_API int sqlite3_strglob(const char *zGlobPattern, const char *zString){
96726 return patternCompare((u8*)zGlobPattern, (u8*)zString, &globInfo, 0)==0;
96727 }
96728
96729 /*
96730 ** Count the number of times that the LIKE operator (or GLOB which is
@@ -101215,11 +101238,11 @@
101215 ** If the SQL is a query, then for each row in the query result
101216 ** the xCallback() function is called. pArg becomes the first
101217 ** argument to xCallback(). If xCallback=NULL then no callback
101218 ** is invoked, even for queries.
101219 */
101220 SQLITE_API int sqlite3_exec(
101221 sqlite3 *db, /* The database on which the SQL executes */
101222 const char *zSql, /* The SQL to be executed */
101223 sqlite3_callback xCallback, /* Invoke this callback routine */
101224 void *pArg, /* First argument to xCallback() */
101225 char **pzErrMsg /* Write error messages here */
@@ -102410,11 +102433,11 @@
102410 db->aExtension = aHandle;
102411
102412 db->aExtension[db->nExtension++] = handle;
102413 return SQLITE_OK;
102414 }
102415 SQLITE_API int sqlite3_load_extension(
102416 sqlite3 *db, /* Load the extension into this database connection */
102417 const char *zFile, /* Name of the shared library containing extension */
102418 const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */
102419 char **pzErrMsg /* Put error message here if not 0 */
102420 ){
@@ -102441,11 +102464,11 @@
102441
102442 /*
102443 ** Enable or disable extension loading. Extension loading is disabled by
102444 ** default so as not to open security holes in older applications.
102445 */
102446 SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff){
102447 sqlite3_mutex_enter(db->mutex);
102448 if( onoff ){
102449 db->flags |= SQLITE_LoadExtension;
102450 }else{
102451 db->flags &= ~SQLITE_LoadExtension;
@@ -102498,11 +102521,11 @@
102498
102499 /*
102500 ** Register a statically linked extension that is automatically
102501 ** loaded by every new database connection.
102502 */
102503 SQLITE_API int sqlite3_auto_extension(void (*xInit)(void)){
102504 int rc = SQLITE_OK;
102505 #ifndef SQLITE_OMIT_AUTOINIT
102506 rc = sqlite3_initialize();
102507 if( rc ){
102508 return rc;
@@ -102543,11 +102566,11 @@
102543 ** routine is a no-op.
102544 **
102545 ** Return 1 if xInit was found on the list and removed. Return 0 if xInit
102546 ** was not on the list.
102547 */
102548 SQLITE_API int sqlite3_cancel_auto_extension(void (*xInit)(void)){
102549 #if SQLITE_THREADSAFE
102550 sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
102551 #endif
102552 int i;
102553 int n = 0;
@@ -102566,11 +102589,11 @@
102566 }
102567
102568 /*
102569 ** Reset the automatic extension loading mechanism.
102570 */
102571 SQLITE_API void sqlite3_reset_auto_extension(void){
102572 #ifndef SQLITE_OMIT_AUTOINIT
102573 if( sqlite3_initialize()==SQLITE_OK )
102574 #endif
102575 {
102576 #if SQLITE_THREADSAFE
@@ -105846,11 +105869,11 @@
105846 ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
105847 ** sqlite3_step(). In the new version, the original SQL text is retained
105848 ** and the statement is automatically recompiled if an schema change
105849 ** occurs.
105850 */
105851 SQLITE_API int sqlite3_prepare(
105852 sqlite3 *db, /* Database handle. */
105853 const char *zSql, /* UTF-8 encoded SQL statement. */
105854 int nBytes, /* Length of zSql in bytes. */
105855 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
105856 const char **pzTail /* OUT: End of parsed string */
@@ -105858,11 +105881,11 @@
105858 int rc;
105859 rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,0,ppStmt,pzTail);
105860 assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
105861 return rc;
105862 }
105863 SQLITE_API int sqlite3_prepare_v2(
105864 sqlite3 *db, /* Database handle. */
105865 const char *zSql, /* UTF-8 encoded SQL statement. */
105866 int nBytes, /* Length of zSql in bytes. */
105867 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
105868 const char **pzTail /* OUT: End of parsed string */
@@ -105934,11 +105957,11 @@
105934 ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
105935 ** sqlite3_step(). In the new version, the original SQL text is retained
105936 ** and the statement is automatically recompiled if an schema change
105937 ** occurs.
105938 */
105939 SQLITE_API int sqlite3_prepare16(
105940 sqlite3 *db, /* Database handle. */
105941 const void *zSql, /* UTF-16 encoded SQL statement. */
105942 int nBytes, /* Length of zSql in bytes. */
105943 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
105944 const void **pzTail /* OUT: End of parsed string */
@@ -105946,11 +105969,11 @@
105946 int rc;
105947 rc = sqlite3Prepare16(db,zSql,nBytes,0,ppStmt,pzTail);
105948 assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
105949 return rc;
105950 }
105951 SQLITE_API int sqlite3_prepare16_v2(
105952 sqlite3 *db, /* Database handle. */
105953 const void *zSql, /* UTF-16 encoded SQL statement. */
105954 int nBytes, /* Length of zSql in bytes. */
105955 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
105956 const void **pzTail /* OUT: End of parsed string */
@@ -111682,11 +111705,11 @@
111682 ** The result that is written to ***pazResult is held in memory obtained
111683 ** from malloc(). But the caller cannot free this memory directly.
111684 ** Instead, the entire table should be passed to sqlite3_free_table() when
111685 ** the calling procedure is finished using it.
111686 */
111687 SQLITE_API int sqlite3_get_table(
111688 sqlite3 *db, /* The database on which the SQL executes */
111689 const char *zSql, /* The SQL to be executed */
111690 char ***pazResult, /* Write the result table here */
111691 int *pnRow, /* Write the number of rows in the result here */
111692 int *pnColumn, /* Write the number of columns of result here */
@@ -111751,11 +111774,11 @@
111751 }
111752
111753 /*
111754 ** This routine frees the space the sqlite3_get_table() malloced.
111755 */
111756 SQLITE_API void sqlite3_free_table(
111757 char **azResult /* Result returned from sqlite3_get_table() */
111758 ){
111759 if( azResult ){
111760 int i, n;
111761 azResult--;
@@ -114111,11 +114134,11 @@
114111
114112
114113 /*
114114 ** External API function used to create a new virtual-table module.
114115 */
114116 SQLITE_API int sqlite3_create_module(
114117 sqlite3 *db, /* Database in which module is registered */
114118 const char *zName, /* Name assigned to this module */
114119 const sqlite3_module *pModule, /* The definition of the module */
114120 void *pAux /* Context pointer for xCreate/xConnect */
114121 ){
@@ -114126,11 +114149,11 @@
114126 }
114127
114128 /*
114129 ** External API function used to create a new virtual-table module.
114130 */
114131 SQLITE_API int sqlite3_create_module_v2(
114132 sqlite3 *db, /* Database in which module is registered */
114133 const char *zName, /* Name assigned to this module */
114134 const sqlite3_module *pModule, /* The definition of the module */
114135 void *pAux, /* Context pointer for xCreate/xConnect */
114136 void (*xDestroy)(void *) /* Module destructor function */
@@ -114741,11 +114764,11 @@
114741 /*
114742 ** This function is used to set the schema of a virtual table. It is only
114743 ** valid to call this function from within the xCreate() or xConnect() of a
114744 ** virtual table module.
114745 */
114746 SQLITE_API int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
114747 Parse *pParse;
114748
114749 int rc = SQLITE_OK;
114750 Table *pTab;
114751 char *zErr = 0;
@@ -115109,11 +115132,11 @@
115109 ** table update operation currently in progress.
115110 **
115111 ** The results of this routine are undefined unless it is called from
115112 ** within an xUpdate method.
115113 */
115114 SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *db){
115115 static const unsigned char aMap[] = {
115116 SQLITE_ROLLBACK, SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_REPLACE
115117 };
115118 #ifdef SQLITE_ENABLE_API_ARMOR
115119 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -115127,11 +115150,11 @@
115127 /*
115128 ** Call from within the xCreate() or xConnect() methods to provide
115129 ** the SQLite core with additional information about the behavior
115130 ** of the virtual table being implemented.
115131 */
115132 SQLITE_API int sqlite3_vtab_config(sqlite3 *db, int op, ...){
115133 va_list ap;
115134 int rc = SQLITE_OK;
115135
115136 #ifdef SQLITE_ENABLE_API_ARMOR
115137 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -127161,11 +127184,11 @@
127161 **
127162 ** If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed
127163 ** to recognize the end of a trigger can be omitted. All we have to do
127164 ** is look for a semicolon that is not part of an string or comment.
127165 */
127166 SQLITE_API int sqlite3_complete(const char *zSql){
127167 u8 state = 0; /* Current state, using numbers defined in header comment */
127168 u8 token; /* Value of the next token */
127169
127170 #ifndef SQLITE_OMIT_TRIGGER
127171 /* A complex statement machine used to detect the end of a CREATE TRIGGER
@@ -127326,11 +127349,11 @@
127326 /*
127327 ** This routine is the same as the sqlite3_complete() routine described
127328 ** above, except that the parameter is required to be UTF-16 encoded, not
127329 ** UTF-8.
127330 */
127331 SQLITE_API int sqlite3_complete16(const void *zSql){
127332 sqlite3_value *pVal;
127333 char const *zSql8;
127334 int rc = SQLITE_NOMEM;
127335
127336 #ifndef SQLITE_OMIT_AUTOINIT
@@ -127476,37 +127499,37 @@
127476 #endif
127477
127478 /* IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns
127479 ** a pointer to the to the sqlite3_version[] string constant.
127480 */
127481 SQLITE_API const char *sqlite3_libversion(void){ return sqlite3_version; }
127482
127483 /* IMPLEMENTATION-OF: R-63124-39300 The sqlite3_sourceid() function returns a
127484 ** pointer to a string constant whose value is the same as the
127485 ** SQLITE_SOURCE_ID C preprocessor macro.
127486 */
127487 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
127488
127489 /* IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function
127490 ** returns an integer equal to SQLITE_VERSION_NUMBER.
127491 */
127492 SQLITE_API int sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; }
127493
127494 /* IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns
127495 ** zero if and only if SQLite was compiled with mutexing code omitted due to
127496 ** the SQLITE_THREADSAFE compile-time option being set to 0.
127497 */
127498 SQLITE_API int sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; }
127499
127500 #if !defined(SQLITE_OMIT_TRACE) && defined(SQLITE_ENABLE_IOTRACE)
127501 /*
127502 ** If the following function pointer is not NULL and if
127503 ** SQLITE_ENABLE_IOTRACE is enabled, then messages describing
127504 ** I/O active are written using this function. These messages
127505 ** are intended for debugging activity only.
127506 */
127507 /* not-private */ void (*sqlite3IoTrace)(const char*, ...) = 0;
127508 #endif
127509
127510 /*
127511 ** If the following global variable points to a string which is the
127512 ** name of a directory, then that directory will be used to store
@@ -127554,11 +127577,11 @@
127554 ** call by X completes.
127555 **
127556 ** * Recursive calls to this routine from thread X return immediately
127557 ** without blocking.
127558 */
127559 SQLITE_API int sqlite3_initialize(void){
127560 MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */
127561 int rc; /* Result code */
127562 #ifdef SQLITE_EXTRA_INIT
127563 int bRunExtraInit = 0; /* Extra initialization needed */
127564 #endif
@@ -127715,11 +127738,11 @@
127715 ** while any part of SQLite is otherwise in use in any thread. This
127716 ** routine is not threadsafe. But it is safe to invoke this routine
127717 ** on when SQLite is already shut down. If SQLite is already shut down
127718 ** when this routine is invoked, then this routine is a harmless no-op.
127719 */
127720 SQLITE_API int sqlite3_shutdown(void){
127721 #ifdef SQLITE_OMIT_WSD
127722 int rc = sqlite3_wsd_init(4096, 24);
127723 if( rc!=SQLITE_OK ){
127724 return rc;
127725 }
@@ -127769,11 +127792,11 @@
127769 ** This routine should only be called when there are no outstanding
127770 ** database connections or memory allocations. This routine is not
127771 ** threadsafe. Failure to heed these warnings can lead to unpredictable
127772 ** behavior.
127773 */
127774 SQLITE_API int sqlite3_config(int op, ...){
127775 va_list ap;
127776 int rc = SQLITE_OK;
127777
127778 /* sqlite3_config() shall return SQLITE_MISUSE if it is invoked while
127779 ** the SQLite library is in use. */
@@ -128126,11 +128149,11 @@
128126 }
128127
128128 /*
128129 ** Return the mutex associated with a database connection.
128130 */
128131 SQLITE_API sqlite3_mutex *sqlite3_db_mutex(sqlite3 *db){
128132 #ifdef SQLITE_ENABLE_API_ARMOR
128133 if( !sqlite3SafetyCheckOk(db) ){
128134 (void)SQLITE_MISUSE_BKPT;
128135 return 0;
128136 }
@@ -128140,11 +128163,11 @@
128140
128141 /*
128142 ** Free up as much memory as we can from the given database
128143 ** connection.
128144 */
128145 SQLITE_API int sqlite3_db_release_memory(sqlite3 *db){
128146 int i;
128147
128148 #ifdef SQLITE_ENABLE_API_ARMOR
128149 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
128150 #endif
@@ -128163,11 +128186,11 @@
128163 }
128164
128165 /*
128166 ** Configuration settings for an individual database connection
128167 */
128168 SQLITE_API int sqlite3_db_config(sqlite3 *db, int op, ...){
128169 va_list ap;
128170 int rc;
128171 va_start(ap, op);
128172 switch( op ){
128173 case SQLITE_DBCONFIG_LOOKASIDE: {
@@ -128282,11 +128305,11 @@
128282 }
128283
128284 /*
128285 ** Return the ROWID of the most recent insert
128286 */
128287 SQLITE_API sqlite_int64 sqlite3_last_insert_rowid(sqlite3 *db){
128288 #ifdef SQLITE_ENABLE_API_ARMOR
128289 if( !sqlite3SafetyCheckOk(db) ){
128290 (void)SQLITE_MISUSE_BKPT;
128291 return 0;
128292 }
@@ -128295,11 +128318,11 @@
128295 }
128296
128297 /*
128298 ** Return the number of changes in the most recent call to sqlite3_exec().
128299 */
128300 SQLITE_API int sqlite3_changes(sqlite3 *db){
128301 #ifdef SQLITE_ENABLE_API_ARMOR
128302 if( !sqlite3SafetyCheckOk(db) ){
128303 (void)SQLITE_MISUSE_BKPT;
128304 return 0;
128305 }
@@ -128308,11 +128331,11 @@
128308 }
128309
128310 /*
128311 ** Return the number of changes since the database handle was opened.
128312 */
128313 SQLITE_API int sqlite3_total_changes(sqlite3 *db){
128314 #ifdef SQLITE_ENABLE_API_ARMOR
128315 if( !sqlite3SafetyCheckOk(db) ){
128316 (void)SQLITE_MISUSE_BKPT;
128317 return 0;
128318 }
@@ -128450,12 +128473,12 @@
128450 ** statements or unfinished sqlite3_backups. The sqlite3_close_v2()
128451 ** version forces the connection to become a zombie if there are
128452 ** unclosed resources, and arranges for deallocation when the last
128453 ** prepare statement or sqlite3_backup closes.
128454 */
128455 SQLITE_API int sqlite3_close(sqlite3 *db){ return sqlite3Close(db,0); }
128456 SQLITE_API int sqlite3_close_v2(sqlite3 *db){ return sqlite3Close(db,1); }
128457
128458
128459 /*
128460 ** Close the mutex on database connection db.
128461 **
@@ -128858,11 +128881,11 @@
128858
128859 /*
128860 ** This routine sets the busy callback for an Sqlite database to the
128861 ** given callback function with the given argument.
128862 */
128863 SQLITE_API int sqlite3_busy_handler(
128864 sqlite3 *db,
128865 int (*xBusy)(void*,int),
128866 void *pArg
128867 ){
128868 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -128881,11 +128904,11 @@
128881 /*
128882 ** This routine sets the progress callback for an Sqlite database to the
128883 ** given callback function with the given argument. The progress callback will
128884 ** be invoked every nOps opcodes.
128885 */
128886 SQLITE_API void sqlite3_progress_handler(
128887 sqlite3 *db,
128888 int nOps,
128889 int (*xProgress)(void*),
128890 void *pArg
128891 ){
@@ -128912,11 +128935,11 @@
128912
128913 /*
128914 ** This routine installs a default busy handler that waits for the
128915 ** specified number of milliseconds before returning 0.
128916 */
128917 SQLITE_API int sqlite3_busy_timeout(sqlite3 *db, int ms){
128918 #ifdef SQLITE_ENABLE_API_ARMOR
128919 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
128920 #endif
128921 if( ms>0 ){
128922 sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db);
@@ -128928,11 +128951,11 @@
128928 }
128929
128930 /*
128931 ** Cause any pending operation to stop at its earliest opportunity.
128932 */
128933 SQLITE_API void sqlite3_interrupt(sqlite3 *db){
128934 #ifdef SQLITE_ENABLE_API_ARMOR
128935 if( !sqlite3SafetyCheckOk(db) ){
128936 (void)SQLITE_MISUSE_BKPT;
128937 return;
128938 }
@@ -129045,11 +129068,11 @@
129045 }
129046
129047 /*
129048 ** Create new user functions.
129049 */
129050 SQLITE_API int sqlite3_create_function(
129051 sqlite3 *db,
129052 const char *zFunc,
129053 int nArg,
129054 int enc,
129055 void *p,
@@ -129059,11 +129082,11 @@
129059 ){
129060 return sqlite3_create_function_v2(db, zFunc, nArg, enc, p, xFunc, xStep,
129061 xFinal, 0);
129062 }
129063
129064 SQLITE_API int sqlite3_create_function_v2(
129065 sqlite3 *db,
129066 const char *zFunc,
129067 int nArg,
129068 int enc,
129069 void *p,
@@ -129102,11 +129125,11 @@
129102 sqlite3_mutex_leave(db->mutex);
129103 return rc;
129104 }
129105
129106 #ifndef SQLITE_OMIT_UTF16
129107 SQLITE_API int sqlite3_create_function16(
129108 sqlite3 *db,
129109 const void *zFunctionName,
129110 int nArg,
129111 int eTextRep,
129112 void *p,
@@ -129142,11 +129165,11 @@
129142 ** When virtual tables intend to provide an overloaded function, they
129143 ** should call this routine to make sure the global function exists.
129144 ** A global function must exist in order for name resolution to work
129145 ** properly.
129146 */
129147 SQLITE_API int sqlite3_overload_function(
129148 sqlite3 *db,
129149 const char *zName,
129150 int nArg
129151 ){
129152 int nName = sqlite3Strlen30(zName);
@@ -129174,11 +129197,11 @@
129174 **
129175 ** A NULL trace function means that no tracing is executes. A non-NULL
129176 ** trace is a pointer to a function that is invoked at the start of each
129177 ** SQL statement.
129178 */
129179 SQLITE_API void *sqlite3_trace(sqlite3 *db, void (*xTrace)(void*,const char*), void *pArg){
129180 void *pOld;
129181
129182 #ifdef SQLITE_ENABLE_API_ARMOR
129183 if( !sqlite3SafetyCheckOk(db) ){
129184 (void)SQLITE_MISUSE_BKPT;
@@ -129198,11 +129221,11 @@
129198 **
129199 ** A NULL profile function means that no profiling is executes. A non-NULL
129200 ** profile is a pointer to a function that is invoked at the conclusion of
129201 ** each SQL statement that is run.
129202 */
129203 SQLITE_API void *sqlite3_profile(
129204 sqlite3 *db,
129205 void (*xProfile)(void*,const char*,sqlite_uint64),
129206 void *pArg
129207 ){
129208 void *pOld;
@@ -129225,11 +129248,11 @@
129225 /*
129226 ** Register a function to be invoked when a transaction commits.
129227 ** If the invoked function returns non-zero, then the commit becomes a
129228 ** rollback.
129229 */
129230 SQLITE_API void *sqlite3_commit_hook(
129231 sqlite3 *db, /* Attach the hook to this database */
129232 int (*xCallback)(void*), /* Function to invoke on each commit */
129233 void *pArg /* Argument to the function */
129234 ){
129235 void *pOld;
@@ -129250,11 +129273,11 @@
129250
129251 /*
129252 ** Register a callback to be invoked each time a row is updated,
129253 ** inserted or deleted using this database connection.
129254 */
129255 SQLITE_API void *sqlite3_update_hook(
129256 sqlite3 *db, /* Attach the hook to this database */
129257 void (*xCallback)(void*,int,char const *,char const *,sqlite_int64),
129258 void *pArg /* Argument to the function */
129259 ){
129260 void *pRet;
@@ -129275,11 +129298,11 @@
129275
129276 /*
129277 ** Register a callback to be invoked each time a transaction is rolled
129278 ** back by this database connection.
129279 */
129280 SQLITE_API void *sqlite3_rollback_hook(
129281 sqlite3 *db, /* Attach the hook to this database */
129282 void (*xCallback)(void*), /* Callback function */
129283 void *pArg /* Argument to the function */
129284 ){
129285 void *pRet;
@@ -129329,11 +129352,11 @@
129329 ** The callback registered by this function replaces any existing callback
129330 ** registered using sqlite3_wal_hook(). Likewise, registering a callback
129331 ** using sqlite3_wal_hook() disables the automatic checkpoint mechanism
129332 ** configured by this function.
129333 */
129334 SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){
129335 #ifdef SQLITE_OMIT_WAL
129336 UNUSED_PARAMETER(db);
129337 UNUSED_PARAMETER(nFrame);
129338 #else
129339 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -129350,11 +129373,11 @@
129350
129351 /*
129352 ** Register a callback to be invoked each time a transaction is written
129353 ** into the write-ahead-log by this database connection.
129354 */
129355 SQLITE_API void *sqlite3_wal_hook(
129356 sqlite3 *db, /* Attach the hook to this db handle */
129357 int(*xCallback)(void *, sqlite3*, const char*, int),
129358 void *pArg /* First argument passed to xCallback() */
129359 ){
129360 #ifndef SQLITE_OMIT_WAL
@@ -129377,11 +129400,11 @@
129377 }
129378
129379 /*
129380 ** Checkpoint database zDb.
129381 */
129382 SQLITE_API int sqlite3_wal_checkpoint_v2(
129383 sqlite3 *db, /* Database handle */
129384 const char *zDb, /* Name of attached database (or NULL) */
129385 int eMode, /* SQLITE_CHECKPOINT_* value */
129386 int *pnLog, /* OUT: Size of WAL log in frames */
129387 int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -129432,11 +129455,11 @@
129432 /*
129433 ** Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points
129434 ** to contains a zero-length string, all attached databases are
129435 ** checkpointed.
129436 */
129437 SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){
129438 /* EVIDENCE-OF: R-41613-20553 The sqlite3_wal_checkpoint(D,X) is equivalent to
129439 ** sqlite3_wal_checkpoint_v2(D,X,SQLITE_CHECKPOINT_PASSIVE,0,0). */
129440 return sqlite3_wal_checkpoint_v2(db,zDb,SQLITE_CHECKPOINT_PASSIVE,0,0);
129441 }
129442
@@ -129521,11 +129544,11 @@
129521
129522 /*
129523 ** Return UTF-8 encoded English language explanation of the most recent
129524 ** error.
129525 */
129526 SQLITE_API const char *sqlite3_errmsg(sqlite3 *db){
129527 const char *z;
129528 if( !db ){
129529 return sqlite3ErrStr(SQLITE_NOMEM);
129530 }
129531 if( !sqlite3SafetyCheckSickOrOk(db) ){
@@ -129549,11 +129572,11 @@
129549 #ifndef SQLITE_OMIT_UTF16
129550 /*
129551 ** Return UTF-16 encoded English language explanation of the most recent
129552 ** error.
129553 */
129554 SQLITE_API const void *sqlite3_errmsg16(sqlite3 *db){
129555 static const u16 outOfMem[] = {
129556 'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0
129557 };
129558 static const u16 misuse[] = {
129559 'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ',
@@ -129594,20 +129617,20 @@
129594
129595 /*
129596 ** Return the most recent error code generated by an SQLite routine. If NULL is
129597 ** passed to this function, we assume a malloc() failed during sqlite3_open().
129598 */
129599 SQLITE_API int sqlite3_errcode(sqlite3 *db){
129600 if( db && !sqlite3SafetyCheckSickOrOk(db) ){
129601 return SQLITE_MISUSE_BKPT;
129602 }
129603 if( !db || db->mallocFailed ){
129604 return SQLITE_NOMEM;
129605 }
129606 return db->errCode & db->errMask;
129607 }
129608 SQLITE_API int sqlite3_extended_errcode(sqlite3 *db){
129609 if( db && !sqlite3SafetyCheckSickOrOk(db) ){
129610 return SQLITE_MISUSE_BKPT;
129611 }
129612 if( !db || db->mallocFailed ){
129613 return SQLITE_NOMEM;
@@ -129618,11 +129641,11 @@
129618 /*
129619 ** Return a string that describes the kind of error specified in the
129620 ** argument. For now, this simply calls the internal sqlite3ErrStr()
129621 ** function.
129622 */
129623 SQLITE_API const char *sqlite3_errstr(int rc){
129624 return sqlite3ErrStr(rc);
129625 }
129626
129627 /*
129628 ** Create a new collating function for database "db". The name is zName
@@ -129766,11 +129789,11 @@
129766 **
129767 ** A new lower limit does not shrink existing constructs.
129768 ** It merely prevents new constructs that exceed the limit
129769 ** from forming.
129770 */
129771 SQLITE_API int sqlite3_limit(sqlite3 *db, int limitId, int newLimit){
129772 int oldLimit;
129773
129774 #ifdef SQLITE_ENABLE_API_ARMOR
129775 if( !sqlite3SafetyCheckOk(db) ){
129776 (void)SQLITE_MISUSE_BKPT;
@@ -130351,18 +130374,18 @@
130351 }
130352
130353 /*
130354 ** Open a new database handle.
130355 */
130356 SQLITE_API int sqlite3_open(
130357 const char *zFilename,
130358 sqlite3 **ppDb
130359 ){
130360 return openDatabase(zFilename, ppDb,
130361 SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0);
130362 }
130363 SQLITE_API int sqlite3_open_v2(
130364 const char *filename, /* Database filename (UTF-8) */
130365 sqlite3 **ppDb, /* OUT: SQLite db handle */
130366 int flags, /* Flags */
130367 const char *zVfs /* Name of VFS module to use */
130368 ){
@@ -130371,11 +130394,11 @@
130371
130372 #ifndef SQLITE_OMIT_UTF16
130373 /*
130374 ** Open a new database handle.
130375 */
130376 SQLITE_API int sqlite3_open16(
130377 const void *zFilename,
130378 sqlite3 **ppDb
130379 ){
130380 char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */
130381 sqlite3_value *pVal;
@@ -130410,11 +130433,11 @@
130410 #endif /* SQLITE_OMIT_UTF16 */
130411
130412 /*
130413 ** Register a new collation sequence with the database handle db.
130414 */
130415 SQLITE_API int sqlite3_create_collation(
130416 sqlite3* db,
130417 const char *zName,
130418 int enc,
130419 void* pCtx,
130420 int(*xCompare)(void*,int,const void*,int,const void*)
@@ -130423,11 +130446,11 @@
130423 }
130424
130425 /*
130426 ** Register a new collation sequence with the database handle db.
130427 */
130428 SQLITE_API int sqlite3_create_collation_v2(
130429 sqlite3* db,
130430 const char *zName,
130431 int enc,
130432 void* pCtx,
130433 int(*xCompare)(void*,int,const void*,int,const void*),
@@ -130448,11 +130471,11 @@
130448
130449 #ifndef SQLITE_OMIT_UTF16
130450 /*
130451 ** Register a new collation sequence with the database handle db.
130452 */
130453 SQLITE_API int sqlite3_create_collation16(
130454 sqlite3* db,
130455 const void *zName,
130456 int enc,
130457 void* pCtx,
130458 int(*xCompare)(void*,int,const void*,int,const void*)
@@ -130478,11 +130501,11 @@
130478
130479 /*
130480 ** Register a collation sequence factory callback with the database handle
130481 ** db. Replace any previously installed collation sequence factory.
130482 */
130483 SQLITE_API int sqlite3_collation_needed(
130484 sqlite3 *db,
130485 void *pCollNeededArg,
130486 void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*)
130487 ){
130488 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -130499,11 +130522,11 @@
130499 #ifndef SQLITE_OMIT_UTF16
130500 /*
130501 ** Register a collation sequence factory callback with the database handle
130502 ** db. Replace any previously installed collation sequence factory.
130503 */
130504 SQLITE_API int sqlite3_collation_needed16(
130505 sqlite3 *db,
130506 void *pCollNeededArg,
130507 void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*)
130508 ){
130509 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -130521,11 +130544,11 @@
130521 #ifndef SQLITE_OMIT_DEPRECATED
130522 /*
130523 ** This function is now an anachronism. It used to be used to recover from a
130524 ** malloc() failure, but SQLite now does this automatically.
130525 */
130526 SQLITE_API int sqlite3_global_recover(void){
130527 return SQLITE_OK;
130528 }
130529 #endif
130530
130531 /*
@@ -130532,11 +130555,11 @@
130532 ** Test to see whether or not the database connection is in autocommit
130533 ** mode. Return TRUE if it is and FALSE if not. Autocommit mode is on
130534 ** by default. Autocommit is disabled by a BEGIN statement and reenabled
130535 ** by the next COMMIT or ROLLBACK.
130536 */
130537 SQLITE_API int sqlite3_get_autocommit(sqlite3 *db){
130538 #ifdef SQLITE_ENABLE_API_ARMOR
130539 if( !sqlite3SafetyCheckOk(db) ){
130540 (void)SQLITE_MISUSE_BKPT;
130541 return 0;
130542 }
@@ -130584,19 +130607,19 @@
130584 ** data for this thread has been deallocated.
130585 **
130586 ** SQLite no longer uses thread-specific data so this routine is now a
130587 ** no-op. It is retained for historical compatibility.
130588 */
130589 SQLITE_API void sqlite3_thread_cleanup(void){
130590 }
130591 #endif
130592
130593 /*
130594 ** Return meta information about a specific column of a database table.
130595 ** See comment in sqlite3.h (sqlite.h.in) for details.
130596 */
130597 SQLITE_API int sqlite3_table_column_metadata(
130598 sqlite3 *db, /* Connection handle */
130599 const char *zDbName, /* Database name or NULL */
130600 const char *zTableName, /* Table name */
130601 const char *zColumnName, /* Column name */
130602 char const **pzDataType, /* OUTPUT: Declared data type */
@@ -130710,11 +130733,11 @@
130710 }
130711
130712 /*
130713 ** Sleep for a little while. Return the amount of time slept.
130714 */
130715 SQLITE_API int sqlite3_sleep(int ms){
130716 sqlite3_vfs *pVfs;
130717 int rc;
130718 pVfs = sqlite3_vfs_find(0);
130719 if( pVfs==0 ) return 0;
130720
@@ -130726,11 +130749,11 @@
130726 }
130727
130728 /*
130729 ** Enable or disable the extended result codes.
130730 */
130731 SQLITE_API int sqlite3_extended_result_codes(sqlite3 *db, int onoff){
130732 #ifdef SQLITE_ENABLE_API_ARMOR
130733 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
130734 #endif
130735 sqlite3_mutex_enter(db->mutex);
130736 db->errMask = onoff ? 0xffffffff : 0xff;
@@ -130739,11 +130762,11 @@
130739 }
130740
130741 /*
130742 ** Invoke the xFileControl method on a particular database.
130743 */
130744 SQLITE_API int sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
130745 int rc = SQLITE_ERROR;
130746 Btree *pBtree;
130747
130748 #ifdef SQLITE_ENABLE_API_ARMOR
130749 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -130773,11 +130796,11 @@
130773 }
130774
130775 /*
130776 ** Interface to the testing logic.
130777 */
130778 SQLITE_API int sqlite3_test_control(int op, ...){
130779 int rc = 0;
130780 #ifndef SQLITE_OMIT_BUILTIN_TEST
130781 va_list ap;
130782 va_start(ap, op);
130783 switch( op ){
@@ -131116,11 +131139,11 @@
131116 ** method of a VFS implementation. The zParam argument is the name of the
131117 ** query parameter we seek. This routine returns the value of the zParam
131118 ** parameter if it exists. If the parameter does not exist, this routine
131119 ** returns a NULL pointer.
131120 */
131121 SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam){
131122 if( zFilename==0 || zParam==0 ) return 0;
131123 zFilename += sqlite3Strlen30(zFilename) + 1;
131124 while( zFilename[0] ){
131125 int x = strcmp(zFilename, zParam);
131126 zFilename += sqlite3Strlen30(zFilename) + 1;
@@ -131131,20 +131154,20 @@
131131 }
131132
131133 /*
131134 ** Return a boolean value for a query parameter.
131135 */
131136 SQLITE_API int sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){
131137 const char *z = sqlite3_uri_parameter(zFilename, zParam);
131138 bDflt = bDflt!=0;
131139 return z ? sqlite3GetBoolean(z, bDflt) : bDflt;
131140 }
131141
131142 /*
131143 ** Return a 64-bit integer value for a query parameter.
131144 */
131145 SQLITE_API sqlite3_int64 sqlite3_uri_int64(
131146 const char *zFilename, /* Filename as passed to xOpen */
131147 const char *zParam, /* URI parameter sought */
131148 sqlite3_int64 bDflt /* return if parameter is missing */
131149 ){
131150 const char *z = sqlite3_uri_parameter(zFilename, zParam);
@@ -131172,11 +131195,11 @@
131172
131173 /*
131174 ** Return the filename of the database associated with a database
131175 ** connection.
131176 */
131177 SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName){
131178 Btree *pBt;
131179 #ifdef SQLITE_ENABLE_API_ARMOR
131180 if( !sqlite3SafetyCheckOk(db) ){
131181 (void)SQLITE_MISUSE_BKPT;
131182 return 0;
@@ -131188,11 +131211,11 @@
131188
131189 /*
131190 ** Return 1 if database is read-only or 0 if read/write. Return -1 if
131191 ** no such database exists.
131192 */
131193 SQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName){
131194 Btree *pBt;
131195 #ifdef SQLITE_ENABLE_API_ARMOR
131196 if( !sqlite3SafetyCheckOk(db) ){
131197 (void)SQLITE_MISUSE_BKPT;
131198 return -1;
@@ -131347,11 +131370,11 @@
131347 **
131348 ** Each call to this routine overrides any prior callbacks registered
131349 ** on the same "db". If xNotify==0 then any prior callbacks are immediately
131350 ** cancelled.
131351 */
131352 SQLITE_API int sqlite3_unlock_notify(
131353 sqlite3 *db,
131354 void (*xNotify)(void **, int),
131355 void *pArg
131356 ){
131357 int rc = SQLITE_OK;
@@ -133525,11 +133548,11 @@
133525 int nName; /* Bytes required to hold table name */
133526 int isFts4 = (argv[0][3]=='4'); /* True for FTS4, false for FTS3 */
133527 const char **aCol; /* Array of column names */
133528 sqlite3_tokenizer *pTokenizer = 0; /* Tokenizer for this table */
133529
133530 int nIndex; /* Size of aIndex[] array */
133531 struct Fts3Index *aIndex = 0; /* Array of indexes for this table */
133532
133533 /* The results of parsing supported FTS4 key=value options: */
133534 int bNoDocsize = 0; /* True to omit %_docsize table */
133535 int bDescIdx = 0; /* True to store descending indexes */
@@ -138213,11 +138236,11 @@
138213 ** Initialize API pointer table, if required.
138214 */
138215 #ifdef _WIN32
138216 __declspec(dllexport)
138217 #endif
138218 SQLITE_API int sqlite3_fts3_init(
138219 sqlite3 *db,
138220 char **pzErrMsg,
138221 const sqlite3_api_routines *pApi
138222 ){
138223 SQLITE_EXTENSION_INIT2(pApi)
@@ -153660,11 +153683,11 @@
153660 }
153661
153662 /*
153663 ** Register a new geometry function for use with the r-tree MATCH operator.
153664 */
153665 SQLITE_API int sqlite3_rtree_geometry_callback(
153666 sqlite3 *db, /* Register SQL function on this connection */
153667 const char *zGeom, /* Name of the new SQL function */
153668 int (*xGeom)(sqlite3_rtree_geometry*,int,RtreeDValue*,int*), /* Callback */
153669 void *pContext /* Extra data associated with the callback */
153670 ){
@@ -153684,11 +153707,11 @@
153684
153685 /*
153686 ** Register a new 2nd-generation geometry function for use with the
153687 ** r-tree MATCH operator.
153688 */
153689 SQLITE_API int sqlite3_rtree_query_callback(
153690 sqlite3 *db, /* Register SQL function on this connection */
153691 const char *zQueryFunc, /* Name of new SQL function */
153692 int (*xQueryFunc)(sqlite3_rtree_query_info*), /* Callback */
153693 void *pContext, /* Extra data passed into the callback */
153694 void (*xDestructor)(void*) /* Destructor for the extra data */
@@ -153709,11 +153732,11 @@
153709
153710 #if !SQLITE_CORE
153711 #ifdef _WIN32
153712 __declspec(dllexport)
153713 #endif
153714 SQLITE_API int sqlite3_rtree_init(
153715 sqlite3 *db,
153716 char **pzErrMsg,
153717 const sqlite3_api_routines *pApi
153718 ){
153719 SQLITE_EXTENSION_INIT2(pApi)
@@ -154214,11 +154237,11 @@
154214
154215 #if !SQLITE_CORE
154216 #ifdef _WIN32
154217 __declspec(dllexport)
154218 #endif
154219 SQLITE_API int sqlite3_icu_init(
154220 sqlite3 *db,
154221 char **pzErrMsg,
154222 const sqlite3_api_routines *pApi
154223 ){
154224 SQLITE_EXTENSION_INIT2(pApi)
154225
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -20,13 +20,10 @@
20 #define SQLITE_CORE 1
21 #define SQLITE_AMALGAMATION 1
22 #ifndef SQLITE_PRIVATE
23 # define SQLITE_PRIVATE static
24 #endif
 
 
 
25 /************** Begin file sqliteInt.h ***************************************/
26 /*
27 ** 2001 September 15
28 **
29 ** The author disclaims copyright to this source code. In place of
@@ -250,27 +247,24 @@
247 extern "C" {
248 #endif
249
250
251 /*
252 ** Provide the ability to override linkage features of the interface.
253 */
254 #ifndef SQLITE_EXTERN
255 # define SQLITE_EXTERN extern
256 #endif
 
257 #ifndef SQLITE_API
258 # define SQLITE_API
259 #endif
 
 
 
 
 
260 #ifndef SQLITE_CDECL
261 # define SQLITE_CDECL
262 #endif
263 #ifndef SQLITE_STDCALL
264 # define SQLITE_STDCALL
265 #endif
266
267 /*
268 ** These no-op macros are used in front of interfaces to mark those
269 ** interfaces as either deprecated or experimental. New applications
270 ** should not use deprecated interfaces - they are supported for backwards
@@ -323,11 +317,11 @@
317 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
318 ** [sqlite_version()] and [sqlite_source_id()].
319 */
320 #define SQLITE_VERSION "3.8.9"
321 #define SQLITE_VERSION_NUMBER 3008009
322 #define SQLITE_SOURCE_ID "2015-03-30 23:43:56 395bb3e677a6551b06ba96fc58c393132b93d1e8"
323
324 /*
325 ** CAPI3REF: Run-Time Library Version Numbers
326 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
327 **
@@ -356,13 +350,13 @@
350 ** [SQLITE_SOURCE_ID] C preprocessor macro.
351 **
352 ** See also: [sqlite_version()] and [sqlite_source_id()].
353 */
354 SQLITE_API const char sqlite3_version[] = SQLITE_VERSION;
355 SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void);
356 SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void);
357 SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void);
358
359 /*
360 ** CAPI3REF: Run-Time Library Compilation Options Diagnostics
361 **
362 ** ^The sqlite3_compileoption_used() function returns 0 or 1
@@ -383,12 +377,12 @@
377 **
378 ** See also: SQL functions [sqlite_compileoption_used()] and
379 ** [sqlite_compileoption_get()] and the [compile_options pragma].
380 */
381 #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
382 SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName);
383 SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N);
384 #endif
385
386 /*
387 ** CAPI3REF: Test To See If The Library Is Threadsafe
388 **
@@ -423,11 +417,11 @@
417 ** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
418 ** is unchanged by calls to sqlite3_config().)^
419 **
420 ** See the [threading mode] documentation for additional information.
421 */
422 SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void);
423
424 /*
425 ** CAPI3REF: Database Connection Handle
426 ** KEYWORDS: {database connection} {database connections}
427 **
@@ -519,12 +513,12 @@
513 ** from [sqlite3_open()], [sqlite3_open16()], or
514 ** [sqlite3_open_v2()], and not previously closed.
515 ** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
516 ** argument is a harmless no-op.
517 */
518 SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3*);
519 SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3*);
520
521 /*
522 ** The type for a callback function.
523 ** This is legacy and deprecated. It is included for historical
524 ** compatibility and is not documented.
@@ -590,11 +584,11 @@
584 ** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
585 ** <li> The application must not modify the SQL statement text passed into
586 ** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
587 ** </ul>
588 */
589 SQLITE_API int SQLITE_STDCALL sqlite3_exec(
590 sqlite3*, /* An open database */
591 const char *sql, /* SQL to be evaluated */
592 int (*callback)(void*,int,char**,char**), /* Callback function */
593 void *, /* 1st argument to callback */
594 char **errmsg /* Error msg written here */
@@ -1550,14 +1544,14 @@
1544 ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied
1545 ** implementation of sqlite3_os_init() or sqlite3_os_end()
1546 ** must return [SQLITE_OK] on success and some other [error code] upon
1547 ** failure.
1548 */
1549 SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void);
1550 SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void);
1551 SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void);
1552 SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void);
1553
1554 /*
1555 ** CAPI3REF: Configuring The SQLite Library
1556 **
1557 ** The sqlite3_config() interface is used to make global configuration
@@ -1584,11 +1578,11 @@
1578 **
1579 ** ^When a configuration option is set, sqlite3_config() returns [SQLITE_OK].
1580 ** ^If the option is unknown or SQLite is unable to set the option
1581 ** then this routine returns a non-zero [error code].
1582 */
1583 SQLITE_API int SQLITE_CDECL sqlite3_config(int, ...);
1584
1585 /*
1586 ** CAPI3REF: Configure database connections
1587 **
1588 ** The sqlite3_db_config() interface is used to make configuration
@@ -1602,11 +1596,11 @@
1596 ** Subsequent arguments vary depending on the configuration verb.
1597 **
1598 ** ^Calls to sqlite3_db_config() return SQLITE_OK if and only if
1599 ** the call is considered successful.
1600 */
1601 SQLITE_API int SQLITE_CDECL sqlite3_db_config(sqlite3*, int op, ...);
1602
1603 /*
1604 ** CAPI3REF: Memory Allocation Routines
1605 **
1606 ** An instance of this object defines the interface between SQLite
@@ -2090,11 +2084,11 @@
2084 **
2085 ** ^The sqlite3_extended_result_codes() routine enables or disables the
2086 ** [extended result codes] feature of SQLite. ^The extended result
2087 ** codes are disabled by default for historical compatibility.
2088 */
2089 SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3*, int onoff);
2090
2091 /*
2092 ** CAPI3REF: Last Insert Rowid
2093 **
2094 ** ^Each entry in most SQLite tables (except for [WITHOUT ROWID] tables)
@@ -2141,11 +2135,11 @@
2135 ** function is running and thus changes the last insert [rowid],
2136 ** then the value returned by [sqlite3_last_insert_rowid()] is
2137 ** unpredictable and might not equal either the old or the new
2138 ** last insert [rowid].
2139 */
2140 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3*);
2141
2142 /*
2143 ** CAPI3REF: Count The Number Of Rows Modified
2144 **
2145 ** ^This function returns the number of rows modified, inserted or
@@ -2193,11 +2187,11 @@
2187 **
2188 ** If a separate thread makes changes on the same database connection
2189 ** while [sqlite3_changes()] is running then the value returned
2190 ** is unpredictable and not meaningful.
2191 */
2192 SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3*);
2193
2194 /*
2195 ** CAPI3REF: Total Number Of Rows Modified
2196 **
2197 ** ^This function returns the total number of rows inserted, modified or
@@ -2216,11 +2210,11 @@
2210 **
2211 ** If a separate thread makes changes on the same database connection
2212 ** while [sqlite3_total_changes()] is running then the value
2213 ** returned is unpredictable and not meaningful.
2214 */
2215 SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3*);
2216
2217 /*
2218 ** CAPI3REF: Interrupt A Long-Running Query
2219 **
2220 ** ^This function causes any pending database operation to abort and
@@ -2255,11 +2249,11 @@
2249 ** that are started after the sqlite3_interrupt() call returns.
2250 **
2251 ** If the database connection closes while [sqlite3_interrupt()]
2252 ** is running then bad things will likely happen.
2253 */
2254 SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3*);
2255
2256 /*
2257 ** CAPI3REF: Determine If An SQL Statement Is Complete
2258 **
2259 ** These routines are useful during command-line input to determine if the
@@ -2290,12 +2284,12 @@
2284 ** UTF-8 string.
2285 **
2286 ** The input to [sqlite3_complete16()] must be a zero-terminated
2287 ** UTF-16 string in native byte order.
2288 */
2289 SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *sql);
2290 SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *sql);
2291
2292 /*
2293 ** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
2294 ** KEYWORDS: {busy-handler callback} {busy handler}
2295 **
@@ -2351,11 +2345,11 @@
2345 ** result in undefined behavior.
2346 **
2347 ** A busy handler must not close the database connection
2348 ** or [prepared statement] that invoked the busy handler.
2349 */
2350 SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*);
2351
2352 /*
2353 ** CAPI3REF: Set A Busy Timeout
2354 **
2355 ** ^This routine sets a [sqlite3_busy_handler | busy handler] that sleeps
@@ -2373,11 +2367,11 @@
2367 ** was defined (using [sqlite3_busy_handler()]) prior to calling
2368 ** this routine, that other busy handler is cleared.)^
2369 **
2370 ** See also: [PRAGMA busy_timeout]
2371 */
2372 SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3*, int ms);
2373
2374 /*
2375 ** CAPI3REF: Convenience Routines For Running Queries
2376 **
2377 ** This is a legacy interface that is preserved for backwards compatibility.
@@ -2447,19 +2441,19 @@
2441 ** interface defined here. As a consequence, errors that occur in the
2442 ** wrapper layer outside of the internal [sqlite3_exec()] call are not
2443 ** reflected in subsequent calls to [sqlite3_errcode()] or
2444 ** [sqlite3_errmsg()].
2445 */
2446 SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
2447 sqlite3 *db, /* An open database */
2448 const char *zSql, /* SQL to be evaluated */
2449 char ***pazResult, /* Results of the query */
2450 int *pnRow, /* Number of result rows written here */
2451 int *pnColumn, /* Number of result columns written here */
2452 char **pzErrmsg /* Error msg written here */
2453 );
2454 SQLITE_API void SQLITE_STDCALL sqlite3_free_table(char **result);
2455
2456 /*
2457 ** CAPI3REF: Formatted String Printing Functions
2458 **
2459 ** These routines are work-alikes of the "printf()" family of functions
@@ -2561,14 +2555,14 @@
2555 **
2556 ** ^(The "%z" formatting option works like "%s" but with the
2557 ** addition that after the string has been read and copied into
2558 ** the result, [sqlite3_free()] is called on the input string.)^
2559 */
2560 SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...);
2561 SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list);
2562 SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...);
2563 SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list);
2564
2565 /*
2566 ** CAPI3REF: Memory Allocation Subsystem
2567 **
2568 ** The SQLite core uses these three routines for all of its own
@@ -2654,16 +2648,16 @@
2648 **
2649 ** The application must not read or write any part of
2650 ** a block of memory after it has been released using
2651 ** [sqlite3_free()] or [sqlite3_realloc()].
2652 */
2653 SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int);
2654 SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64);
2655 SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void*, int);
2656 SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void*, sqlite3_uint64);
2657 SQLITE_API void SQLITE_STDCALL sqlite3_free(void*);
2658 SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void*);
2659
2660 /*
2661 ** CAPI3REF: Memory Allocator Statistics
2662 **
2663 ** SQLite provides these two interfaces for reporting on the status
@@ -2684,12 +2678,12 @@
2678 ** [sqlite3_memory_used()] if and only if the parameter to
2679 ** [sqlite3_memory_highwater()] is true. ^The value returned
2680 ** by [sqlite3_memory_highwater(1)] is the high-water mark
2681 ** prior to the reset.
2682 */
2683 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void);
2684 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag);
2685
2686 /*
2687 ** CAPI3REF: Pseudo-Random Number Generator
2688 **
2689 ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
@@ -2708,11 +2702,11 @@
2702 ** ^If the previous call to this routine had an N of 1 or more and a
2703 ** non-NULL P then the pseudo-randomness is generated
2704 ** internally and without recourse to the [sqlite3_vfs] xRandomness
2705 ** method.
2706 */
2707 SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *P);
2708
2709 /*
2710 ** CAPI3REF: Compile-Time Authorization Callbacks
2711 **
2712 ** ^This routine registers an authorizer callback with a particular
@@ -2790,11 +2784,11 @@
2784 ** [sqlite3_prepare()] or its variants. Authorization is not
2785 ** performed during statement evaluation in [sqlite3_step()], unless
2786 ** as stated in the previous paragraph, sqlite3_step() invokes
2787 ** sqlite3_prepare_v2() to reprepare a statement after a schema change.
2788 */
2789 SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
2790 sqlite3*,
2791 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
2792 void *pUserData
2793 );
2794
@@ -2894,12 +2888,12 @@
2888 ** digits in the time are meaningless. Future versions of SQLite
2889 ** might provide greater resolution on the profiler callback. The
2890 ** sqlite3_profile() function is considered experimental and is
2891 ** subject to change in future versions of SQLite.
2892 */
2893 SQLITE_API void *SQLITE_STDCALL sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*);
2894 SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_STDCALL sqlite3_profile(sqlite3*,
2895 void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
2896
2897 /*
2898 ** CAPI3REF: Query Progress Callbacks
2899 **
@@ -2929,11 +2923,11 @@
2923 ** the database connection that invoked the progress handler.
2924 ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
2925 ** database connections for the meaning of "modify" in this paragraph.
2926 **
2927 */
2928 SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
2929
2930 /*
2931 ** CAPI3REF: Opening A New Database Connection
2932 **
2933 ** ^These routines open an SQLite database file as specified by the
@@ -3157,19 +3151,19 @@
3151 ** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various
3152 ** features that require the use of temporary files may fail.
3153 **
3154 ** See also: [sqlite3_temp_directory]
3155 */
3156 SQLITE_API int SQLITE_STDCALL sqlite3_open(
3157 const char *filename, /* Database filename (UTF-8) */
3158 sqlite3 **ppDb /* OUT: SQLite db handle */
3159 );
3160 SQLITE_API int SQLITE_STDCALL sqlite3_open16(
3161 const void *filename, /* Database filename (UTF-16) */
3162 sqlite3 **ppDb /* OUT: SQLite db handle */
3163 );
3164 SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
3165 const char *filename, /* Database filename (UTF-8) */
3166 sqlite3 **ppDb, /* OUT: SQLite db handle */
3167 int flags, /* Flags */
3168 const char *zVfs /* Name of VFS module to use */
3169 );
@@ -3211,13 +3205,13 @@
3205 ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and
3206 ** is not a database file pathname pointer that SQLite passed into the xOpen
3207 ** VFS method, then the behavior of this routine is undefined and probably
3208 ** undesirable.
3209 */
3210 SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3211 SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3212 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
3213
3214
3215 /*
3216 ** CAPI3REF: Error Codes And Messages
3217 **
@@ -3256,15 +3250,15 @@
3250 **
3251 ** If an interface fails with SQLITE_MISUSE, that means the interface
3252 ** was invoked incorrectly by the application. In that case, the
3253 ** error code and message may or may not be set.
3254 */
3255 SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db);
3256 SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db);
3257 SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*);
3258 SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*);
3259 SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int);
3260
3261 /*
3262 ** CAPI3REF: SQL Statement Object
3263 ** KEYWORDS: {prepared statement} {prepared statements}
3264 **
@@ -3327,11 +3321,11 @@
3321 ** created by an untrusted script can be contained using the
3322 ** [max_page_count] [PRAGMA].
3323 **
3324 ** New run-time limit categories may be added in future releases.
3325 */
3326 SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3*, int id, int newVal);
3327
3328 /*
3329 ** CAPI3REF: Run-Time Limit Categories
3330 ** KEYWORDS: {limit category} {*limit categories}
3331 **
@@ -3477,32 +3471,32 @@
3471 ** or [GLOB] operator or if the parameter is compared to an indexed column
3472 ** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
3473 ** </li>
3474 ** </ol>
3475 */
3476 SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
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_prepare_v2(
3484 sqlite3 *db, /* Database handle */
3485 const char *zSql, /* SQL statement, UTF-8 encoded */
3486 int nByte, /* Maximum length of zSql in bytes. */
3487 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3488 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3489 );
3490 SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
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 */
3496 );
3497 SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
3498 sqlite3 *db, /* Database handle */
3499 const void *zSql, /* SQL statement, UTF-16 encoded */
3500 int nByte, /* Maximum length of zSql in bytes. */
3501 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3502 const void **pzTail /* OUT: Pointer to unused portion of zSql */
@@ -3513,11 +3507,11 @@
3507 **
3508 ** ^This interface can be used to retrieve a saved copy of the original
3509 ** SQL text used to create a [prepared statement] if that statement was
3510 ** compiled using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()].
3511 */
3512 SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt);
3513
3514 /*
3515 ** CAPI3REF: Determine If An SQL Statement Writes The Database
3516 **
3517 ** ^The sqlite3_stmt_readonly(X) interface returns true (non-zero) if
@@ -3544,11 +3538,11 @@
3538 ** database. ^The [ATTACH] and [DETACH] statements also cause
3539 ** sqlite3_stmt_readonly() to return true since, while those statements
3540 ** change the configuration of a database connection, they do not make
3541 ** changes to the content of the database files on disk.
3542 */
3543 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
3544
3545 /*
3546 ** CAPI3REF: Determine If A Prepared Statement Has Been Reset
3547 **
3548 ** ^The sqlite3_stmt_busy(S) interface returns true (non-zero) if the
@@ -3563,11 +3557,11 @@
3557 ** to locate all prepared statements associated with a database
3558 ** connection that are in need of being reset. This can be used,
3559 ** for example, in diagnostic routines to search for prepared
3560 ** statements that are holding a transaction open.
3561 */
3562 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt*);
3563
3564 /*
3565 ** CAPI3REF: Dynamically Typed Value Object
3566 ** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
3567 **
@@ -3724,23 +3718,23 @@
3718 ** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails.
3719 **
3720 ** See also: [sqlite3_bind_parameter_count()],
3721 ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].
3722 */
3723 SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
3724 SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
3725 void(*)(void*));
3726 SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt*, int, double);
3727 SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt*, int, int);
3728 SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
3729 SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt*, int);
3730 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
3731 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
3732 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
3733 void(*)(void*), unsigned char encoding);
3734 SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
3735 SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
3736
3737 /*
3738 ** CAPI3REF: Number Of SQL Parameters
3739 **
3740 ** ^This routine can be used to find the number of [SQL parameters]
@@ -3756,11 +3750,11 @@
3750 **
3751 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3752 ** [sqlite3_bind_parameter_name()], and
3753 ** [sqlite3_bind_parameter_index()].
3754 */
3755 SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt*);
3756
3757 /*
3758 ** CAPI3REF: Name Of A Host Parameter
3759 **
3760 ** ^The sqlite3_bind_parameter_name(P,N) interface returns
@@ -3783,11 +3777,11 @@
3777 **
3778 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3779 ** [sqlite3_bind_parameter_count()], and
3780 ** [sqlite3_bind_parameter_index()].
3781 */
3782 SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
3783
3784 /*
3785 ** CAPI3REF: Index Of A Parameter With A Given Name
3786 **
3787 ** ^Return the index of an SQL parameter given its name. ^The
@@ -3799,20 +3793,20 @@
3793 **
3794 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3795 ** [sqlite3_bind_parameter_count()], and
3796 ** [sqlite3_bind_parameter_index()].
3797 */
3798 SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
3799
3800 /*
3801 ** CAPI3REF: Reset All Bindings On A Prepared Statement
3802 **
3803 ** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset
3804 ** the [sqlite3_bind_blob | bindings] on a [prepared statement].
3805 ** ^Use this routine to reset all host parameters to NULL.
3806 */
3807 SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt*);
3808
3809 /*
3810 ** CAPI3REF: Number Of Columns In A Result Set
3811 **
3812 ** ^Return the number of columns in the result set returned by the
@@ -3819,11 +3813,11 @@
3813 ** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
3814 ** statement that does not return data (for example an [UPDATE]).
3815 **
3816 ** See also: [sqlite3_data_count()]
3817 */
3818 SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt);
3819
3820 /*
3821 ** CAPI3REF: Column Names In A Result Set
3822 **
3823 ** ^These routines return the name assigned to a particular column
@@ -3847,12 +3841,12 @@
3841 ** ^The name of a result column is the value of the "AS" clause for
3842 ** that column, if there is an AS clause. If there is no AS clause
3843 ** then the name of the column is unspecified and may change from
3844 ** one release of SQLite to the next.
3845 */
3846 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt*, int N);
3847 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt*, int N);
3848
3849 /*
3850 ** CAPI3REF: Source Of Data In A Query Result
3851 **
3852 ** ^These routines provide a means to determine the database, table, and
@@ -3895,16 +3889,16 @@
3889 ** If two or more threads call one or more
3890 ** [sqlite3_column_database_name | column metadata interfaces]
3891 ** for the same [prepared statement] and result column
3892 ** at the same time then the results are undefined.
3893 */
3894 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int);
3895 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int);
3896 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int);
3897 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int);
3898 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int);
3899 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
3900
3901 /*
3902 ** CAPI3REF: Declared Datatype Of A Query Result
3903 **
3904 ** ^(The first parameter is a [prepared statement].
@@ -3931,12 +3925,12 @@
3925 ** data stored in that column is of the declared type. SQLite is
3926 ** strongly typed, but the typing is dynamic not static. ^Type
3927 ** is associated with individual values, not with the containers
3928 ** used to hold those values.
3929 */
3930 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt*,int);
3931 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt*,int);
3932
3933 /*
3934 ** CAPI3REF: Evaluate An SQL Statement
3935 **
3936 ** After a [prepared statement] has been prepared using either
@@ -4011,11 +4005,11 @@
4005 ** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
4006 ** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,
4007 ** then the more specific [error codes] are returned directly
4008 ** by sqlite3_step(). The use of the "v2" interface is recommended.
4009 */
4010 SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt*);
4011
4012 /*
4013 ** CAPI3REF: Number of columns in a result set
4014 **
4015 ** ^The sqlite3_data_count(P) interface returns the number of columns in the
@@ -4031,11 +4025,11 @@
4025 ** where it always returns zero since each step of that multi-step
4026 ** pragma returns 0 columns of data.
4027 **
4028 ** See also: [sqlite3_column_count()]
4029 */
4030 SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt);
4031
4032 /*
4033 ** CAPI3REF: Fundamental Datatypes
4034 ** KEYWORDS: SQLITE_TEXT
4035 **
@@ -4227,20 +4221,20 @@
4221 ** of these routines, a default value is returned. The default value
4222 ** is either the integer 0, the floating point number 0.0, or a NULL
4223 ** pointer. Subsequent calls to [sqlite3_errcode()] will return
4224 ** [SQLITE_NOMEM].)^
4225 */
4226 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt*, int iCol);
4227 SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4228 SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4229 SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt*, int iCol);
4230 SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt*, int iCol);
4231 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt*, int iCol);
4232 SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt*, int iCol);
4233 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt*, int iCol);
4234 SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt*, int iCol);
4235 SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt*, int iCol);
4236
4237 /*
4238 ** CAPI3REF: Destroy A Prepared Statement Object
4239 **
4240 ** ^The sqlite3_finalize() function is called to delete a [prepared statement].
@@ -4263,11 +4257,11 @@
4257 ** resource leaks. It is a grievous error for the application to try to use
4258 ** a prepared statement after it has been finalized. Any use of a prepared
4259 ** statement after it has been finalized can result in undefined and
4260 ** undesirable behavior such as segfaults and heap corruption.
4261 */
4262 SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt);
4263
4264 /*
4265 ** CAPI3REF: Reset A Prepared Statement Object
4266 **
4267 ** The sqlite3_reset() function is called to reset a [prepared statement]
@@ -4289,11 +4283,11 @@
4283 ** [sqlite3_reset(S)] returns an appropriate [error code].
4284 **
4285 ** ^The [sqlite3_reset(S)] interface does not change the values
4286 ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
4287 */
4288 SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt);
4289
4290 /*
4291 ** CAPI3REF: Create Or Redefine SQL Functions
4292 ** KEYWORDS: {function creation routines}
4293 ** KEYWORDS: {application-defined SQL function}
@@ -4388,31 +4382,31 @@
4382 ** ^An application-defined function is permitted to call other
4383 ** SQLite interfaces. However, such calls must not
4384 ** close the database connection nor finalize or reset the prepared
4385 ** statement in which the function is running.
4386 */
4387 SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
4388 sqlite3 *db,
4389 const char *zFunctionName,
4390 int nArg,
4391 int eTextRep,
4392 void *pApp,
4393 void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4394 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4395 void (*xFinal)(sqlite3_context*)
4396 );
4397 SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
4398 sqlite3 *db,
4399 const void *zFunctionName,
4400 int nArg,
4401 int eTextRep,
4402 void *pApp,
4403 void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4404 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4405 void (*xFinal)(sqlite3_context*)
4406 );
4407 SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
4408 sqlite3 *db,
4409 const char *zFunctionName,
4410 int nArg,
4411 int eTextRep,
4412 void *pApp,
@@ -4454,16 +4448,16 @@
4448 ** to be supported. However, new applications should avoid
4449 ** the use of these functions. To encourage programmers to avoid
4450 ** these functions, we will not explain what they do.
4451 */
4452 #ifndef SQLITE_OMIT_DEPRECATED
4453 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context*);
4454 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt*);
4455 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4456 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_global_recover(void);
4457 SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_thread_cleanup(void);
4458 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
4459 void*,sqlite3_int64);
4460 #endif
4461
4462 /*
4463 ** CAPI3REF: Obtaining SQL Function Parameter Values
@@ -4508,22 +4502,22 @@
4502 ** or [sqlite3_value_text16()].
4503 **
4504 ** These routines must be called from the same thread as
4505 ** the SQL function that supplied the [sqlite3_value*] parameters.
4506 */
4507 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value*);
4508 SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value*);
4509 SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value*);
4510 SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value*);
4511 SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value*);
4512 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value*);
4513 SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value*);
4514 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value*);
4515 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value*);
4516 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*);
4517 SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*);
4518 SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*);
4519
4520 /*
4521 ** CAPI3REF: Obtain Aggregate Function Context
4522 **
4523 ** Implementations of aggregate SQL functions use this
@@ -4563,11 +4557,11 @@
4557 ** function.
4558 **
4559 ** This routine must be called from the same thread in which
4560 ** the aggregate SQL function is running.
4561 */
4562 SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
4563
4564 /*
4565 ** CAPI3REF: User Data For Functions
4566 **
4567 ** ^The sqlite3_user_data() interface returns a copy of
@@ -4577,11 +4571,11 @@
4571 ** registered the application defined function.
4572 **
4573 ** This routine must be called from the same thread in which
4574 ** the application-defined function is running.
4575 */
4576 SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context*);
4577
4578 /*
4579 ** CAPI3REF: Database Connection For Functions
4580 **
4581 ** ^The sqlite3_context_db_handle() interface returns a copy of
@@ -4588,11 +4582,11 @@
4582 ** the pointer to the [database connection] (the 1st parameter)
4583 ** of the [sqlite3_create_function()]
4584 ** and [sqlite3_create_function16()] routines that originally
4585 ** registered the application defined function.
4586 */
4587 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context*);
4588
4589 /*
4590 ** CAPI3REF: Function Auxiliary Data
4591 **
4592 ** These functions may be used by (non-aggregate) SQL functions to
@@ -4640,12 +4634,12 @@
4634 ** values and [parameters] and expressions composed from the same.)^
4635 **
4636 ** These routines must be called from the same thread in which
4637 ** the SQL function is running.
4638 */
4639 SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context*, int N);
4640 SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
4641
4642
4643 /*
4644 ** CAPI3REF: Constants Defining Special Destructor Behavior
4645 **
@@ -4776,30 +4770,30 @@
4770 **
4771 ** If these routines are called from within the different thread
4772 ** than the one containing the application-defined function that received
4773 ** the [sqlite3_context] pointer, the results are undefined.
4774 */
4775 SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
4776 SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(sqlite3_context*,const void*,
4777 sqlite3_uint64,void(*)(void*));
4778 SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context*, double);
4779 SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context*, const char*, int);
4780 SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context*, const void*, int);
4781 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context*);
4782 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context*);
4783 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context*, int);
4784 SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context*, int);
4785 SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
4786 SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context*);
4787 SQLITE_API void SQLITE_STDCALL sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
4788 SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
4789 void(*)(void*), unsigned char encoding);
4790 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
4791 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
4792 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
4793 SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
4794 SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n);
4795
4796 /*
4797 ** CAPI3REF: Define New Collating Sequences
4798 **
4799 ** ^These functions add, remove, or modify a [collation] associated
@@ -4876,26 +4870,26 @@
4870 ** is unfortunate but cannot be changed without breaking backwards
4871 ** compatibility.
4872 **
4873 ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].
4874 */
4875 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
4876 sqlite3*,
4877 const char *zName,
4878 int eTextRep,
4879 void *pArg,
4880 int(*xCompare)(void*,int,const void*,int,const void*)
4881 );
4882 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
4883 sqlite3*,
4884 const char *zName,
4885 int eTextRep,
4886 void *pArg,
4887 int(*xCompare)(void*,int,const void*,int,const void*),
4888 void(*xDestroy)(void*)
4889 );
4890 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
4891 sqlite3*,
4892 const void *zName,
4893 int eTextRep,
4894 void *pArg,
4895 int(*xCompare)(void*,int,const void*,int,const void*)
@@ -4925,16 +4919,16 @@
4919 **
4920 ** The callback function should register the desired collation using
4921 ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or
4922 ** [sqlite3_create_collation_v2()].
4923 */
4924 SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
4925 sqlite3*,
4926 void*,
4927 void(*)(void*,sqlite3*,int eTextRep,const char*)
4928 );
4929 SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
4930 sqlite3*,
4931 void*,
4932 void(*)(void*,sqlite3*,int eTextRep,const void*)
4933 );
4934
@@ -4944,15 +4938,15 @@
4938 ** called right after sqlite3_open().
4939 **
4940 ** The code to implement this API is not available in the public release
4941 ** of SQLite.
4942 */
4943 SQLITE_API int SQLITE_STDCALL sqlite3_key(
4944 sqlite3 *db, /* Database to be rekeyed */
4945 const void *pKey, int nKey /* The key */
4946 );
4947 SQLITE_API int SQLITE_STDCALL sqlite3_key_v2(
4948 sqlite3 *db, /* Database to be rekeyed */
4949 const char *zDbName, /* Name of the database */
4950 const void *pKey, int nKey /* The key */
4951 );
4952
@@ -4962,35 +4956,35 @@
4956 ** database is decrypted.
4957 **
4958 ** The code to implement this API is not available in the public release
4959 ** of SQLite.
4960 */
4961 SQLITE_API int SQLITE_STDCALL sqlite3_rekey(
4962 sqlite3 *db, /* Database to be rekeyed */
4963 const void *pKey, int nKey /* The new key */
4964 );
4965 SQLITE_API int SQLITE_STDCALL sqlite3_rekey_v2(
4966 sqlite3 *db, /* Database to be rekeyed */
4967 const char *zDbName, /* Name of the database */
4968 const void *pKey, int nKey /* The new key */
4969 );
4970
4971 /*
4972 ** Specify the activation key for a SEE database. Unless
4973 ** activated, none of the SEE routines will work.
4974 */
4975 SQLITE_API void SQLITE_STDCALL sqlite3_activate_see(
4976 const char *zPassPhrase /* Activation phrase */
4977 );
4978 #endif
4979
4980 #ifdef SQLITE_ENABLE_CEROD
4981 /*
4982 ** Specify the activation key for a CEROD database. Unless
4983 ** activated, none of the CEROD routines will work.
4984 */
4985 SQLITE_API void SQLITE_STDCALL sqlite3_activate_cerod(
4986 const char *zPassPhrase /* Activation phrase */
4987 );
4988 #endif
4989
4990 /*
@@ -5008,11 +5002,11 @@
5002 ** method of the default [sqlite3_vfs] object. If the xSleep() method
5003 ** of the default VFS is not implemented correctly, or not implemented at
5004 ** all, then the behavior of sqlite3_sleep() may deviate from the description
5005 ** in the previous paragraphs.
5006 */
5007 SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int);
5008
5009 /*
5010 ** CAPI3REF: Name Of The Folder Holding Temporary Files
5011 **
5012 ** ^(If this global variable is made to point to a string which is
@@ -5126,11 +5120,11 @@
5120 **
5121 ** If another thread changes the autocommit status of the database
5122 ** connection while this routine is running, then the return value
5123 ** is undefined.
5124 */
5125 SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3*);
5126
5127 /*
5128 ** CAPI3REF: Find The Database Handle Of A Prepared Statement
5129 **
5130 ** ^The sqlite3_db_handle interface returns the [database connection] handle
@@ -5138,11 +5132,11 @@
5132 ** returned by sqlite3_db_handle is the same [database connection]
5133 ** that was the first argument
5134 ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
5135 ** create the statement in the first place.
5136 */
5137 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt*);
5138
5139 /*
5140 ** CAPI3REF: Return The Filename For A Database Connection
5141 **
5142 ** ^The sqlite3_db_filename(D,N) interface returns a pointer to a filename
@@ -5154,20 +5148,20 @@
5148 ** ^The filename returned by this function is the output of the
5149 ** xFullPathname method of the [VFS]. ^In other words, the filename
5150 ** will be an absolute pathname, even if the filename used
5151 ** to open the database originally was a URI or relative pathname.
5152 */
5153 SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
5154
5155 /*
5156 ** CAPI3REF: Determine if a database is read-only
5157 **
5158 ** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N
5159 ** of connection D is read-only, 0 if it is read/write, or -1 if N is not
5160 ** the name of a database on connection D.
5161 */
5162 SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
5163
5164 /*
5165 ** CAPI3REF: Find the next prepared statement
5166 **
5167 ** ^This interface returns a pointer to the next [prepared statement] after
@@ -5178,11 +5172,11 @@
5172 **
5173 ** The [database connection] pointer D in a call to
5174 ** [sqlite3_next_stmt(D,S)] must refer to an open database
5175 ** connection and in particular must not be a NULL pointer.
5176 */
5177 SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
5178
5179 /*
5180 ** CAPI3REF: Commit And Rollback Notification Callbacks
5181 **
5182 ** ^The sqlite3_commit_hook() interface registers a callback
@@ -5226,12 +5220,12 @@
5220 ** ^The rollback callback is not invoked if a transaction is
5221 ** automatically rolled back because the database connection is closed.
5222 **
5223 ** See also the [sqlite3_update_hook()] interface.
5224 */
5225 SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
5226 SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
5227
5228 /*
5229 ** CAPI3REF: Data Change Notification Callbacks
5230 **
5231 ** ^The sqlite3_update_hook() interface registers a callback function
@@ -5277,11 +5271,11 @@
5271 ** the first call on D.
5272 **
5273 ** See also the [sqlite3_commit_hook()] and [sqlite3_rollback_hook()]
5274 ** interfaces.
5275 */
5276 SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
5277 sqlite3*,
5278 void(*)(void *,int ,char const *,char const *,sqlite3_int64),
5279 void*
5280 );
5281
@@ -5317,11 +5311,11 @@
5311 ** This interface is threadsafe on processors where writing a
5312 ** 32-bit integer is atomic.
5313 **
5314 ** See Also: [SQLite Shared-Cache Mode]
5315 */
5316 SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int);
5317
5318 /*
5319 ** CAPI3REF: Attempt To Free Heap Memory
5320 **
5321 ** ^The sqlite3_release_memory() interface attempts to free N bytes
@@ -5333,11 +5327,11 @@
5327 ** ^The sqlite3_release_memory() routine is a no-op returning zero
5328 ** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5329 **
5330 ** See also: [sqlite3_db_release_memory()]
5331 */
5332 SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int);
5333
5334 /*
5335 ** CAPI3REF: Free Memory Used By A Database Connection
5336 **
5337 ** ^The sqlite3_db_release_memory(D) interface attempts to free as much heap
@@ -5346,11 +5340,11 @@
5340 ** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
5341 ** omitted.
5342 **
5343 ** See also: [sqlite3_release_memory()]
5344 */
5345 SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3*);
5346
5347 /*
5348 ** CAPI3REF: Impose A Limit On Heap Size
5349 **
5350 ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the
@@ -5398,11 +5392,11 @@
5392 ** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5393 **
5394 ** The circumstances under which SQLite will enforce the soft heap limit may
5395 ** changes in future releases of SQLite.
5396 */
5397 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
5398
5399 /*
5400 ** CAPI3REF: Deprecated Soft Heap Limit Interface
5401 ** DEPRECATED
5402 **
@@ -5409,11 +5403,11 @@
5403 ** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
5404 ** interface. This routine is provided for historical compatibility
5405 ** only. All new applications should use the
5406 ** [sqlite3_soft_heap_limit64()] interface rather than this one.
5407 */
5408 SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_soft_heap_limit(int N);
5409
5410
5411 /*
5412 ** CAPI3REF: Extract Metadata About A Column Of A Table
5413 **
@@ -5478,11 +5472,11 @@
5472 **
5473 ** ^This function causes all database schemas to be read from disk and
5474 ** parsed, if that has not already been done, and returns an error if
5475 ** any errors are encountered while loading the schema.
5476 */
5477 SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
5478 sqlite3 *db, /* Connection handle */
5479 const char *zDbName, /* Database name or NULL */
5480 const char *zTableName, /* Table name */
5481 const char *zColumnName, /* Column name */
5482 char const **pzDataType, /* OUTPUT: Declared data type */
@@ -5524,11 +5518,11 @@
5518 ** [sqlite3_enable_load_extension()] prior to calling this API,
5519 ** otherwise an error will be returned.
5520 **
5521 ** See also the [load_extension() SQL function].
5522 */
5523 SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
5524 sqlite3 *db, /* Load the extension into this database connection */
5525 const char *zFile, /* Name of the shared library containing extension */
5526 const char *zProc, /* Entry point. Derived from zFile if 0 */
5527 char **pzErrMsg /* Put error message here if not 0 */
5528 );
@@ -5544,11 +5538,11 @@
5538 ** ^Extension loading is off by default.
5539 ** ^Call the sqlite3_enable_load_extension() routine with onoff==1
5540 ** to turn extension loading on and call it with onoff==0 to turn
5541 ** it back off again.
5542 */
5543 SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
5544
5545 /*
5546 ** CAPI3REF: Automatically Load Statically Linked Extensions
5547 **
5548 ** ^This interface causes the xEntryPoint() function to be invoked for
@@ -5582,11 +5576,11 @@
5576 ** will be called more than once for each database connection that is opened.
5577 **
5578 ** See also: [sqlite3_reset_auto_extension()]
5579 ** and [sqlite3_cancel_auto_extension()]
5580 */
5581 SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void (*xEntryPoint)(void));
5582
5583 /*
5584 ** CAPI3REF: Cancel Automatic Extension Loading
5585 **
5586 ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
@@ -5594,19 +5588,19 @@
5588 ** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)]
5589 ** routine returns 1 if initialization routine X was successfully
5590 ** unregistered and it returns 0 if X was not on the list of initialization
5591 ** routines.
5592 */
5593 SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void (*xEntryPoint)(void));
5594
5595 /*
5596 ** CAPI3REF: Reset Automatic Extension Loading
5597 **
5598 ** ^This interface disables all automatic extensions previously
5599 ** registered using [sqlite3_auto_extension()].
5600 */
5601 SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void);
5602
5603 /*
5604 ** The interface to the virtual-table mechanism is currently considered
5605 ** to be experimental. The interface might change in incompatible ways.
5606 ** If this is a problem for you, do not use the interface at this time.
@@ -5805,17 +5799,17 @@
5799 ** be invoked if the call to sqlite3_create_module_v2() fails.
5800 ** ^The sqlite3_create_module()
5801 ** interface is equivalent to sqlite3_create_module_v2() with a NULL
5802 ** destructor.
5803 */
5804 SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
5805 sqlite3 *db, /* SQLite connection to register module with */
5806 const char *zName, /* Name of the module */
5807 const sqlite3_module *p, /* Methods for the module */
5808 void *pClientData /* Client data for xCreate/xConnect */
5809 );
5810 SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
5811 sqlite3 *db, /* SQLite connection to register module with */
5812 const char *zName, /* Name of the module */
5813 const sqlite3_module *p, /* Methods for the module */
5814 void *pClientData, /* Client data for xCreate/xConnect */
5815 void(*xDestroy)(void*) /* Module destructor function */
@@ -5874,11 +5868,11 @@
5868 ** ^The [xCreate] and [xConnect] methods of a
5869 ** [virtual table module] call this interface
5870 ** to declare the format (the names and datatypes of the columns) of
5871 ** the virtual tables they implement.
5872 */
5873 SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
5874
5875 /*
5876 ** CAPI3REF: Overload A Function For A Virtual Table
5877 **
5878 ** ^(Virtual tables can provide alternative implementations of functions
@@ -5892,11 +5886,11 @@
5886 ** of the new function always causes an exception to be thrown. So
5887 ** the new function is not good for anything by itself. Its only
5888 ** purpose is to be a placeholder function that can be overloaded
5889 ** by a [virtual table].
5890 */
5891 SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
5892
5893 /*
5894 ** The interface to the virtual-table mechanism defined above (back up
5895 ** to a comment remarkably similar to this one) is currently considered
5896 ** to be experimental. The interface might change in incompatible ways.
@@ -5989,11 +5983,11 @@
5983 ** zero-filled blob to read or write using the incremental-blob interface.
5984 **
5985 ** To avoid a resource leak, every open [BLOB handle] should eventually
5986 ** be released by a call to [sqlite3_blob_close()].
5987 */
5988 SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
5989 sqlite3*,
5990 const char *zDb,
5991 const char *zTable,
5992 const char *zColumn,
5993 sqlite3_int64 iRow,
@@ -6021,11 +6015,11 @@
6015 ** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
6016 ** always returns zero.
6017 **
6018 ** ^This function sets the database handle error code and message.
6019 */
6020 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
6021
6022 /*
6023 ** CAPI3REF: Close A BLOB Handle
6024 **
6025 ** ^This function closes an open [BLOB handle]. ^(The BLOB handle is closed
@@ -6043,11 +6037,11 @@
6037 ** with a null pointer (such as would be returned by a failed call to
6038 ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function
6039 ** is passed a valid open blob handle, the values returned by the
6040 ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning.
6041 */
6042 SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *);
6043
6044 /*
6045 ** CAPI3REF: Return The Size Of An Open BLOB
6046 **
6047 ** ^Returns the size in bytes of the BLOB accessible via the
@@ -6058,11 +6052,11 @@
6052 ** This routine only works on a [BLOB handle] which has been created
6053 ** by a prior successful call to [sqlite3_blob_open()] and which has not
6054 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6055 ** to this routine results in undefined and probably undesirable behavior.
6056 */
6057 SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *);
6058
6059 /*
6060 ** CAPI3REF: Read Data From A BLOB Incrementally
6061 **
6062 ** ^(This function is used to read data from an open [BLOB handle] into a
@@ -6086,11 +6080,11 @@
6080 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6081 ** to this routine results in undefined and probably undesirable behavior.
6082 **
6083 ** See also: [sqlite3_blob_write()].
6084 */
6085 SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
6086
6087 /*
6088 ** CAPI3REF: Write Data Into A BLOB Incrementally
6089 **
6090 ** ^(This function is used to write data into an open [BLOB handle] from a
@@ -6127,11 +6121,11 @@
6121 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
6122 ** to this routine results in undefined and probably undesirable behavior.
6123 **
6124 ** See also: [sqlite3_blob_read()].
6125 */
6126 SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
6127
6128 /*
6129 ** CAPI3REF: Virtual File System Objects
6130 **
6131 ** A virtual filesystem (VFS) is an [sqlite3_vfs] object
@@ -6158,13 +6152,13 @@
6152 **
6153 ** ^Unregister a VFS with the sqlite3_vfs_unregister() interface.
6154 ** ^(If the default VFS is unregistered, another VFS is chosen as
6155 ** the default. The choice for the new VFS is arbitrary.)^
6156 */
6157 SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfsName);
6158 SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
6159 SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs*);
6160
6161 /*
6162 ** CAPI3REF: Mutexes
6163 **
6164 ** The SQLite core uses these routines for thread
@@ -6273,15 +6267,15 @@
6267 ** sqlite3_mutex_leave() is a NULL pointer, then all three routines
6268 ** behave as no-ops.
6269 **
6270 ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
6271 */
6272 SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int);
6273 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*);
6274 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*);
6275 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*);
6276 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*);
6277
6278 /*
6279 ** CAPI3REF: Mutex Methods Object
6280 **
6281 ** An instance of this structure defines the low-level routines
@@ -6387,12 +6381,12 @@
6381 ** call to sqlite3_mutex_held() to fail, so a non-zero return is
6382 ** the appropriate thing to do. The sqlite3_mutex_notheld()
6383 ** interface should also return 1 when given a NULL pointer.
6384 */
6385 #ifndef NDEBUG
6386 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex*);
6387 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex*);
6388 #endif
6389
6390 /*
6391 ** CAPI3REF: Mutex Types
6392 **
@@ -6424,11 +6418,11 @@
6418 ** serializes access to the [database connection] given in the argument
6419 ** when the [threading mode] is Serialized.
6420 ** ^If the [threading mode] is Single-thread or Multi-thread then this
6421 ** routine returns a NULL pointer.
6422 */
6423 SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3*);
6424
6425 /*
6426 ** CAPI3REF: Low-Level Control Of Database Files
6427 **
6428 ** ^The [sqlite3_file_control()] interface makes a direct call to the
@@ -6458,11 +6452,11 @@
6452 ** an incorrect zDbName and an SQLITE_ERROR return from the underlying
6453 ** xFileControl method.
6454 **
6455 ** See also: [SQLITE_FCNTL_LOCKSTATE]
6456 */
6457 SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
6458
6459 /*
6460 ** CAPI3REF: Testing Interface
6461 **
6462 ** ^The sqlite3_test_control() interface is used to read out internal
@@ -6477,11 +6471,11 @@
6471 ** The details of the operation codes, their meanings, the parameters
6472 ** they take, and what they do are all subject to change without notice.
6473 ** Unlike most of the SQLite API, this function is not guaranteed to
6474 ** operate consistently from one release to the next.
6475 */
6476 SQLITE_API int SQLITE_CDECL sqlite3_test_control(int op, ...);
6477
6478 /*
6479 ** CAPI3REF: Testing Interface Operation Codes
6480 **
6481 ** These constants are the valid operation code parameters used
@@ -6540,12 +6534,12 @@
6534 ** be represented by a 32-bit integer, then the values returned by
6535 ** sqlite3_status() are undefined.
6536 **
6537 ** See also: [sqlite3_db_status()]
6538 */
6539 SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6540 SQLITE_API int SQLITE_STDCALL sqlite3_status64(
6541 int op,
6542 sqlite3_int64 *pCurrent,
6543 sqlite3_int64 *pHighwater,
6544 int resetFlag
6545 );
@@ -6664,11 +6658,11 @@
6658 ** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a
6659 ** non-zero [error code] on failure.
6660 **
6661 ** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
6662 */
6663 SQLITE_API int SQLITE_STDCALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
6664
6665 /*
6666 ** CAPI3REF: Status Parameters for database connections
6667 ** KEYWORDS: {SQLITE_DBSTATUS options}
6668 **
@@ -6793,11 +6787,11 @@
6787 ** ^If the resetFlg is true, then the counter is reset to zero after this
6788 ** interface call returns.
6789 **
6790 ** See also: [sqlite3_status()] and [sqlite3_db_status()].
6791 */
6792 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
6793
6794 /*
6795 ** CAPI3REF: Status Parameters for prepared statements
6796 ** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters}
6797 **
@@ -7262,20 +7256,20 @@
7256 ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()
7257 ** APIs are not strictly speaking threadsafe. If they are invoked at the
7258 ** same time as another thread is invoking sqlite3_backup_step() it is
7259 ** possible that they return invalid values.
7260 */
7261 SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
7262 sqlite3 *pDest, /* Destination database handle */
7263 const char *zDestName, /* Destination database name */
7264 sqlite3 *pSource, /* Source database handle */
7265 const char *zSourceName /* Source database name */
7266 );
7267 SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage);
7268 SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p);
7269 SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p);
7270 SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p);
7271
7272 /*
7273 ** CAPI3REF: Unlock Notification
7274 **
7275 ** ^When running in shared-cache mode, a database operation may fail with
@@ -7387,11 +7381,11 @@
7381 ** by an sqlite3_step() call. ^(If there is a blocking connection, then the
7382 ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in
7383 ** the special "DROP TABLE/INDEX" case, the extended error code is just
7384 ** SQLITE_LOCKED.)^
7385 */
7386 SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
7387 sqlite3 *pBlocked, /* Waiting connection */
7388 void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */
7389 void *pNotifyArg /* Argument to pass to xNotify */
7390 );
7391
@@ -7402,12 +7396,12 @@
7396 ** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications
7397 ** and extensions to compare the contents of two buffers containing UTF-8
7398 ** strings in a case-independent fashion, using the same definition of "case
7399 ** independence" that SQLite uses internally when comparing identifiers.
7400 */
7401 SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *, const char *);
7402 SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *, const char *, int);
7403
7404 /*
7405 ** CAPI3REF: String Globbing
7406 *
7407 ** ^The [sqlite3_strglob(P,X)] interface returns zero if string X matches
@@ -7418,11 +7412,11 @@
7412 ** sensitive.
7413 **
7414 ** Note that this routine returns zero on a match and non-zero if the strings
7415 ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
7416 */
7417 SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlob, const char *zStr);
7418
7419 /*
7420 ** CAPI3REF: Error Logging Interface
7421 **
7422 ** ^The [sqlite3_log()] interface writes a message into the [error log]
@@ -7441,11 +7435,11 @@
7435 ** will not use dynamically allocated memory. The log message is stored in
7436 ** a fixed-length buffer on the stack. If the log message is longer than
7437 ** a few hundred characters, it will be truncated to the length of the
7438 ** buffer.
7439 */
7440 SQLITE_API void SQLITE_CDECL sqlite3_log(int iErrCode, const char *zFormat, ...);
7441
7442 /*
7443 ** CAPI3REF: Write-Ahead Log Commit Hook
7444 **
7445 ** ^The [sqlite3_wal_hook()] function is used to register a callback that
@@ -7476,11 +7470,11 @@
7470 ** previously registered write-ahead log callback. ^Note that the
7471 ** [sqlite3_wal_autocheckpoint()] interface and the
7472 ** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will
7473 ** those overwrite any prior [sqlite3_wal_hook()] settings.
7474 */
7475 SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
7476 sqlite3*,
7477 int(*)(void *,sqlite3*,const char*,int),
7478 void*
7479 );
7480
@@ -7510,11 +7504,11 @@
7504 ** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]
7505 ** pages. The use of this interface
7506 ** is only necessary if the default setting is found to be suboptimal
7507 ** for a particular application.
7508 */
7509 SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
7510
7511 /*
7512 ** CAPI3REF: Checkpoint a database
7513 **
7514 ** ^(The sqlite3_wal_checkpoint(D,X) is equivalent to
@@ -7531,11 +7525,11 @@
7525 ** interface was added. This interface is retained for backwards
7526 ** compatibility and as a convenience for applications that need to manually
7527 ** start a callback but which do not need the full power (and corresponding
7528 ** complication) of [sqlite3_wal_checkpoint_v2()].
7529 */
7530 SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
7531
7532 /*
7533 ** CAPI3REF: Checkpoint a database
7534 **
7535 ** ^(The sqlite3_wal_checkpoint_v2(D,X,M,L,C) interface runs a checkpoint
@@ -7624,11 +7618,11 @@
7618 ** [sqlite3_errcode()] and [sqlite3_errmsg()].
7619 **
7620 ** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface
7621 ** from SQL.
7622 */
7623 SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
7624 sqlite3 *db, /* Database handle */
7625 const char *zDb, /* Name of attached database (or NULL) */
7626 int eMode, /* SQLITE_CHECKPOINT_* value */
7627 int *pnLog, /* OUT: Size of WAL log in frames */
7628 int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -7660,11 +7654,11 @@
7654 **
7655 ** At present, there is only one option that may be configured using
7656 ** this function. (See [SQLITE_VTAB_CONSTRAINT_SUPPORT].) Further options
7657 ** may be added in the future.
7658 */
7659 SQLITE_API int SQLITE_CDECL sqlite3_vtab_config(sqlite3*, int op, ...);
7660
7661 /*
7662 ** CAPI3REF: Virtual Table Configuration Options
7663 **
7664 ** These macros define the various options to the
@@ -7713,11 +7707,11 @@
7707 ** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL],
7708 ** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode
7709 ** of the SQL statement that triggered the call to the [xUpdate] method of the
7710 ** [virtual table].
7711 */
7712 SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *);
7713
7714 /*
7715 ** CAPI3REF: Conflict resolution modes
7716 ** KEYWORDS: {conflict resolution mode}
7717 **
@@ -7817,11 +7811,11 @@
7811 ** as if the loop did not exist - it returns non-zero and leave the variable
7812 ** that pOut points to unchanged.
7813 **
7814 ** See also: [sqlite3_stmt_scanstatus_reset()]
7815 */
7816 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_stmt_scanstatus(
7817 sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
7818 int idx, /* Index of loop to report on */
7819 int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
7820 void *pOut /* Result written here */
7821 );
@@ -7832,11 +7826,11 @@
7826 ** ^Zero all [sqlite3_stmt_scanstatus()] related event counters.
7827 **
7828 ** This API is only available if the library is built with pre-processor
7829 ** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined.
7830 */
7831 SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
7832
7833
7834 /*
7835 ** Undo the hack that converts floating point types to integer for
7836 ** builds on processors without floating point support.
@@ -7887,11 +7881,11 @@
7881 ** Register a geometry callback named zGeom that can be used as part of an
7882 ** R-Tree geometry query as follows:
7883 **
7884 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
7885 */
7886 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
7887 sqlite3 *db,
7888 const char *zGeom,
7889 int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
7890 void *pContext
7891 );
@@ -7913,11 +7907,11 @@
7907 ** Register a 2nd-generation geometry callback named zScore that can be
7908 ** used as part of an R-Tree geometry query as follows:
7909 **
7910 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...)
7911 */
7912 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
7913 sqlite3 *db,
7914 const char *zQueryFunc,
7915 int (*xQueryFunc)(sqlite3_rtree_query_info*),
7916 void *pContext,
7917 void (*xDestructor)(void*)
@@ -9157,12 +9151,12 @@
9151 */
9152 #ifdef SQLITE_OMIT_WSD
9153 #define SQLITE_WSD const
9154 #define GLOBAL(t,v) (*(t*)sqlite3_wsd_find((void*)&(v), sizeof(v)))
9155 #define sqlite3GlobalConfig GLOBAL(struct Sqlite3Config, sqlite3Config)
9156 SQLITE_API int SQLITE_STDCALL sqlite3_wsd_init(int N, int J);
9157 SQLITE_API void *SQLITE_STDCALL sqlite3_wsd_find(void *K, int L);
9158 #else
9159 #define SQLITE_WSD
9160 #define GLOBAL(t,v) v
9161 #define sqlite3GlobalConfig sqlite3Config
9162 #endif
@@ -13646,11 +13640,11 @@
13640 ** print I/O tracing messages.
13641 */
13642 #ifdef SQLITE_ENABLE_IOTRACE
13643 # define IOTRACE(A) if( sqlite3IoTrace ){ sqlite3IoTrace A; }
13644 SQLITE_PRIVATE void sqlite3VdbeIOTraceSql(Vdbe*);
13645 SQLITE_API SQLITE_EXTERN void (SQLITE_CDECL *sqlite3IoTrace)(const char*,...);
13646 #else
13647 # define IOTRACE(A)
13648 # define sqlite3VdbeIOTraceSql(X)
13649 #endif
13650
@@ -14359,11 +14353,11 @@
14353 ** was used and false if not.
14354 **
14355 ** The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix
14356 ** is not required for a match.
14357 */
14358 SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName){
14359 int i, n;
14360
14361 #if SQLITE_ENABLE_API_ARMOR
14362 if( zOptName==0 ){
14363 (void)SQLITE_MISUSE_BKPT;
@@ -14387,11 +14381,11 @@
14381
14382 /*
14383 ** Return the N-th compile-time option string. If N is out of range,
14384 ** return a NULL pointer.
14385 */
14386 SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N){
14387 if( N>=0 && N<ArraySize(azCompileOpt) ){
14388 return azCompileOpt[N];
14389 }
14390 return 0;
14391 }
@@ -15024,11 +15018,11 @@
15018 }
15019
15020 /*
15021 ** Query status information.
15022 */
15023 SQLITE_API int SQLITE_STDCALL sqlite3_status64(
15024 int op,
15025 sqlite3_int64 *pCurrent,
15026 sqlite3_int64 *pHighwater,
15027 int resetFlag
15028 ){
@@ -15049,11 +15043,11 @@
15043 }
15044 sqlite3_mutex_leave(pMutex);
15045 (void)pMutex; /* Prevent warning when SQLITE_THREADSAFE=0 */
15046 return SQLITE_OK;
15047 }
15048 SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){
15049 sqlite3_int64 iCur, iHwtr;
15050 int rc;
15051 #ifdef SQLITE_ENABLE_API_ARMOR
15052 if( pCurrent==0 || pHighwater==0 ) return SQLITE_MISUSE_BKPT;
15053 #endif
@@ -15066,11 +15060,11 @@
15060 }
15061
15062 /*
15063 ** Query status information for a single database connection
15064 */
15065 SQLITE_API int SQLITE_STDCALL sqlite3_db_status(
15066 sqlite3 *db, /* The database connection whose status is desired */
15067 int op, /* Status verb */
15068 int *pCurrent, /* Write current value here */
15069 int *pHighwater, /* Write high-water mark here */
15070 int resetFlag /* Reset high-water mark if true */
@@ -16690,11 +16684,11 @@
16684
16685 /*
16686 ** Locate a VFS by name. If no name is given, simply return the
16687 ** first VFS on the list.
16688 */
16689 SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfs){
16690 sqlite3_vfs *pVfs = 0;
16691 #if SQLITE_THREADSAFE
16692 sqlite3_mutex *mutex;
16693 #endif
16694 #ifndef SQLITE_OMIT_AUTOINIT
@@ -16736,11 +16730,11 @@
16730 /*
16731 ** Register a VFS with the system. It is harmless to register the same
16732 ** VFS multiple times. The new VFS becomes the default if makeDflt is
16733 ** true.
16734 */
16735 SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){
16736 MUTEX_LOGIC(sqlite3_mutex *mutex;)
16737 #ifndef SQLITE_OMIT_AUTOINIT
16738 int rc = sqlite3_initialize();
16739 if( rc ) return rc;
16740 #endif
@@ -16764,11 +16758,11 @@
16758 }
16759
16760 /*
16761 ** Unregister a VFS so that it is no longer accessible.
16762 */
16763 SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs *pVfs){
16764 #if SQLITE_THREADSAFE
16765 sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
16766 #endif
16767 sqlite3_mutex_enter(mutex);
16768 vfsUnlink(pVfs);
@@ -19100,11 +19094,11 @@
19094 }
19095
19096 /*
19097 ** Retrieve a pointer to a static mutex or allocate a new dynamic one.
19098 */
19099 SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int id){
19100 #ifndef SQLITE_OMIT_AUTOINIT
19101 if( id<=SQLITE_MUTEX_RECURSIVE && sqlite3_initialize() ) return 0;
19102 if( id>SQLITE_MUTEX_RECURSIVE && sqlite3MutexInit() ) return 0;
19103 #endif
19104 return sqlite3GlobalConfig.mutex.xMutexAlloc(id);
@@ -19119,31 +19113,31 @@
19113 }
19114
19115 /*
19116 ** Free a dynamic mutex.
19117 */
19118 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex *p){
19119 if( p ){
19120 sqlite3GlobalConfig.mutex.xMutexFree(p);
19121 }
19122 }
19123
19124 /*
19125 ** Obtain the mutex p. If some other thread already has the mutex, block
19126 ** until it can be obtained.
19127 */
19128 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex *p){
19129 if( p ){
19130 sqlite3GlobalConfig.mutex.xMutexEnter(p);
19131 }
19132 }
19133
19134 /*
19135 ** Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another
19136 ** thread holds the mutex and it cannot be obtained, return SQLITE_BUSY.
19137 */
19138 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex *p){
19139 int rc = SQLITE_OK;
19140 if( p ){
19141 return sqlite3GlobalConfig.mutex.xMutexTry(p);
19142 }
19143 return rc;
@@ -19153,11 +19147,11 @@
19147 ** The sqlite3_mutex_leave() routine exits a mutex that was previously
19148 ** entered by the same thread. The behavior is undefined if the mutex
19149 ** is not currently entered. If a NULL pointer is passed as an argument
19150 ** this function is a no-op.
19151 */
19152 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex *p){
19153 if( p ){
19154 sqlite3GlobalConfig.mutex.xMutexLeave(p);
19155 }
19156 }
19157
@@ -19164,14 +19158,14 @@
19158 #ifndef NDEBUG
19159 /*
19160 ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are
19161 ** intended for use inside assert() statements.
19162 */
19163 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex *p){
19164 return p==0 || sqlite3GlobalConfig.mutex.xMutexHeld(p);
19165 }
19166 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex *p){
19167 return p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld(p);
19168 }
19169 #endif
19170
19171 #endif /* !defined(SQLITE_MUTEX_OMIT) */
@@ -20163,12 +20157,12 @@
20157 ** of the sqlite3_initialize() and sqlite3_shutdown() processing, the
20158 ** "interlocked" magic used here is probably not strictly necessary.
20159 */
20160 static LONG SQLITE_WIN32_VOLATILE winMutex_lock = 0;
20161
20162 SQLITE_API int SQLITE_STDCALL sqlite3_win32_is_nt(void); /* os_win.c */
20163 SQLITE_API void SQLITE_STDCALL sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */
20164
20165 static int winMutexInit(void){
20166 /* The first to increment to 1 does actual initialization */
20167 if( InterlockedCompareExchange(&winMutex_lock, 1, 0)==0 ){
20168 int i;
@@ -20460,11 +20454,11 @@
20454 /*
20455 ** Attempt to release up to n bytes of non-essential memory currently
20456 ** held by SQLite. An example of non-essential memory is memory used to
20457 ** cache database pages that are not currently in use.
20458 */
20459 SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int n){
20460 #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
20461 return sqlite3PcacheReleaseMemory(n);
20462 #else
20463 /* IMPLEMENTATION-OF: R-34391-24921 The sqlite3_release_memory() routine
20464 ** is a no-op returning zero if SQLite is not compiled with
@@ -20560,11 +20554,11 @@
20554 #ifndef SQLITE_OMIT_DEPRECATED
20555 /*
20556 ** Deprecated external interface. Internal/core SQLite code
20557 ** should call sqlite3MemoryAlarm.
20558 */
20559 SQLITE_API int SQLITE_STDCALL sqlite3_memory_alarm(
20560 void(*xCallback)(void *pArg, sqlite3_int64 used,int N),
20561 void *pArg,
20562 sqlite3_int64 iThreshold
20563 ){
20564 return sqlite3MemoryAlarm(xCallback, pArg, iThreshold);
@@ -20573,11 +20567,11 @@
20567
20568 /*
20569 ** Set the soft heap-size limit for the library. Passing a zero or
20570 ** negative value indicates no limit.
20571 */
20572 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 n){
20573 sqlite3_int64 priorLimit;
20574 sqlite3_int64 excess;
20575 #ifndef SQLITE_OMIT_AUTOINIT
20576 int rc = sqlite3_initialize();
20577 if( rc ) return -1;
@@ -20593,19 +20587,20 @@
20587 }
20588 excess = sqlite3_memory_used() - n;
20589 if( excess>0 ) sqlite3_release_memory((int)(excess & 0x7fffffff));
20590 return priorLimit;
20591 }
20592 SQLITE_API void SQLITE_STDCALL sqlite3_soft_heap_limit(int n){
20593 if( n<0 ) n = 0;
20594 sqlite3_soft_heap_limit64(n);
20595 }
20596
20597 /*
20598 ** Initialize the memory allocation subsystem.
20599 */
20600 SQLITE_PRIVATE int sqlite3MallocInit(void){
20601 int rc;
20602 if( sqlite3GlobalConfig.m.xMalloc==0 ){
20603 sqlite3MemSetDefault();
20604 }
20605 memset(&mem0, 0, sizeof(mem0));
20606 if( sqlite3GlobalConfig.bCoreMutex ){
@@ -20637,11 +20632,13 @@
20632 || sqlite3GlobalConfig.nPage<1 ){
20633 sqlite3GlobalConfig.pPage = 0;
20634 sqlite3GlobalConfig.szPage = 0;
20635 sqlite3GlobalConfig.nPage = 0;
20636 }
20637 rc = sqlite3GlobalConfig.m.xInit(sqlite3GlobalConfig.m.pAppData);
20638 if( rc!=SQLITE_OK ) memset(&mem0, 0, sizeof(mem0));
20639 return rc;
20640 }
20641
20642 /*
20643 ** Return true if the heap is currently under memory pressure - in other
20644 ** words if the amount of heap used is close to the limit set by
@@ -20662,11 +20659,11 @@
20659 }
20660
20661 /*
20662 ** Return the amount of memory currently checked out.
20663 */
20664 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void){
20665 int n, mx;
20666 sqlite3_int64 res;
20667 sqlite3_status(SQLITE_STATUS_MEMORY_USED, &n, &mx, 0);
20668 res = (sqlite3_int64)n; /* Work around bug in Borland C. Ticket #3216 */
20669 return res;
@@ -20675,11 +20672,11 @@
20672 /*
20673 ** Return the maximum amount of memory that has ever been
20674 ** checked out since either the beginning of this process
20675 ** or since the most recent reset.
20676 */
20677 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag){
20678 int n, mx;
20679 sqlite3_int64 res;
20680 sqlite3_status(SQLITE_STATUS_MEMORY_USED, &n, &mx, resetFlag);
20681 res = (sqlite3_int64)mx; /* Work around bug in Borland C. Ticket #3216 */
20682 return res;
@@ -20766,17 +20763,17 @@
20763 /*
20764 ** This version of the memory allocation is for use by the application.
20765 ** First make sure the memory subsystem is initialized, then do the
20766 ** allocation.
20767 */
20768 SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int n){
20769 #ifndef SQLITE_OMIT_AUTOINIT
20770 if( sqlite3_initialize() ) return 0;
20771 #endif
20772 return n<=0 ? 0 : sqlite3Malloc(n);
20773 }
20774 SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64 n){
20775 #ifndef SQLITE_OMIT_AUTOINIT
20776 if( sqlite3_initialize() ) return 0;
20777 #endif
20778 return sqlite3Malloc(n);
20779 }
@@ -20913,20 +20910,20 @@
20910 assert( sqlite3MemdebugNoType(p, (u8)~(MEMTYPE_LOOKASIDE|MEMTYPE_HEAP)) );
20911 return sqlite3GlobalConfig.m.xSize(p);
20912 }
20913 }
20914 }
20915 SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void *p){
20916 assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) );
20917 assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
20918 return (sqlite3_uint64)sqlite3GlobalConfig.m.xSize(p);
20919 }
20920
20921 /*
20922 ** Free memory previously obtained from sqlite3Malloc().
20923 */
20924 SQLITE_API void SQLITE_STDCALL sqlite3_free(void *p){
20925 if( p==0 ) return; /* IMP: R-49053-54554 */
20926 assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
20927 assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) );
20928 if( sqlite3GlobalConfig.bMemstat ){
20929 sqlite3_mutex_enter(mem0.mutex);
@@ -21031,18 +21028,18 @@
21028
21029 /*
21030 ** The public interface to sqlite3Realloc. Make sure that the memory
21031 ** subsystem is initialized prior to invoking sqliteRealloc.
21032 */
21033 SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void *pOld, int n){
21034 #ifndef SQLITE_OMIT_AUTOINIT
21035 if( sqlite3_initialize() ) return 0;
21036 #endif
21037 if( n<0 ) n = 0; /* IMP: R-26507-47431 */
21038 return sqlite3Realloc(pOld, n);
21039 }
21040 SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void *pOld, sqlite3_uint64 n){
21041 #ifndef SQLITE_OMIT_AUTOINIT
21042 if( sqlite3_initialize() ) return 0;
21043 #endif
21044 return sqlite3Realloc(pOld, n);
21045 }
@@ -22204,11 +22201,11 @@
22201
22202 /*
22203 ** Print into memory obtained from sqlite3_malloc(). Omit the internal
22204 ** %-conversion extensions.
22205 */
22206 SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char *zFormat, va_list ap){
22207 char *z;
22208 char zBase[SQLITE_PRINT_BUF_SIZE];
22209 StrAccum acc;
22210
22211 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -22229,11 +22226,11 @@
22226
22227 /*
22228 ** Print into memory obtained from sqlite3_malloc()(). Omit the internal
22229 ** %-conversion extensions.
22230 */
22231 SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char *zFormat, ...){
22232 va_list ap;
22233 char *z;
22234 #ifndef SQLITE_OMIT_AUTOINIT
22235 if( sqlite3_initialize() ) return 0;
22236 #endif
@@ -22254,11 +22251,11 @@
22251 ** this without breaking compatibility, so we just have to live with the
22252 ** mistake.
22253 **
22254 ** sqlite3_vsnprintf() is the varargs version.
22255 */
22256 SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int n, char *zBuf, const char *zFormat, va_list ap){
22257 StrAccum acc;
22258 if( n<=0 ) return zBuf;
22259 #ifdef SQLITE_ENABLE_API_ARMOR
22260 if( zBuf==0 || zFormat==0 ) {
22261 (void)SQLITE_MISUSE_BKPT;
@@ -22269,11 +22266,11 @@
22266 sqlite3StrAccumInit(&acc, zBuf, n, 0);
22267 acc.useMalloc = 0;
22268 sqlite3VXPrintf(&acc, 0, zFormat, ap);
22269 return sqlite3StrAccumFinish(&acc);
22270 }
22271 SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){
22272 char *z;
22273 va_list ap;
22274 va_start(ap,zFormat);
22275 z = sqlite3_vsnprintf(n, zBuf, zFormat, ap);
22276 va_end(ap);
@@ -22301,11 +22298,11 @@
22298 }
22299
22300 /*
22301 ** Format and write a message to the log if logging is enabled.
22302 */
22303 SQLITE_API void SQLITE_CDECL sqlite3_log(int iErrCode, const char *zFormat, ...){
22304 va_list ap; /* Vararg list */
22305 if( sqlite3GlobalConfig.xLog ){
22306 va_start(ap, zFormat);
22307 renderLogMsg(iErrCode, zFormat, ap);
22308 va_end(ap);
@@ -22437,11 +22434,11 @@
22434 } sqlite3Prng;
22435
22436 /*
22437 ** Return N random bytes.
22438 */
22439 SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *pBuf){
22440 unsigned char t;
22441 unsigned char *zBuf = pBuf;
22442
22443 /* The "wsdPrng" macro will resolve to the pseudo-random number generator
22444 ** state vector. If writable static data is unsupported on the target,
@@ -23589,11 +23586,11 @@
23586 ** sqlite3_strnicmp() APIs allow applications and extensions to compare
23587 ** the contents of two buffers containing UTF-8 strings in a
23588 ** case-independent fashion, using the same definition of "case
23589 ** independence" that SQLite uses internally when comparing identifiers.
23590 */
23591 SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *zLeft, const char *zRight){
23592 register unsigned char *a, *b;
23593 if( zLeft==0 ){
23594 return zRight ? -1 : 0;
23595 }else if( zRight==0 ){
23596 return 1;
@@ -23601,11 +23598,11 @@
23598 a = (unsigned char *)zLeft;
23599 b = (unsigned char *)zRight;
23600 while( *a!=0 && UpperToLower[*a]==UpperToLower[*b]){ a++; b++; }
23601 return UpperToLower[*a] - UpperToLower[*b];
23602 }
23603 SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){
23604 register unsigned char *a, *b;
23605 if( zLeft==0 ){
23606 return zRight ? -1 : 0;
23607 }else if( zRight==0 ){
23608 return 1;
@@ -32814,11 +32811,11 @@
32811 ** This routine is called once during SQLite initialization and by a
32812 ** single thread. The memory allocation and mutex subsystems have not
32813 ** necessarily been initialized when this routine is called, and so they
32814 ** should not be used.
32815 */
32816 SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void){
32817 /*
32818 ** The following macro defines an initializer for an sqlite3_vfs object.
32819 ** The name of the VFS is NAME. The pAppData is a pointer to a pointer
32820 ** to the "finder" function. (pAppData is a pointer to a pointer because
32821 ** silly C90 rules prohibit a void* from being cast to a function pointer
@@ -32913,11 +32910,11 @@
32910 **
32911 ** Some operating systems might need to do some cleanup in this routine,
32912 ** to release dynamically allocated objects. But not on unix.
32913 ** This routine is a no-op for unix.
32914 */
32915 SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void){
32916 return SQLITE_OK;
32917 }
32918
32919 #endif /* SQLITE_OS_UNIX */
32920
@@ -34305,11 +34302,11 @@
34302 ** compact it. Upon success, SQLITE_OK will be returned. Upon failure, one
34303 ** of SQLITE_NOMEM, SQLITE_ERROR, or SQLITE_NOTFOUND will be returned. The
34304 ** "pnLargest" argument, if non-zero, will be used to return the size of the
34305 ** largest committed free block in the heap, in bytes.
34306 */
34307 SQLITE_API int SQLITE_STDCALL sqlite3_win32_compact_heap(LPUINT pnLargest){
34308 int rc = SQLITE_OK;
34309 UINT nLargest = 0;
34310 HANDLE hHeap;
34311
34312 winMemAssertMagic();
@@ -34345,11 +34342,11 @@
34342 ** If a Win32 native heap has been configured, this function will attempt to
34343 ** destroy and recreate it. If the Win32 native heap is not isolated and/or
34344 ** the sqlite3_memory_used() function does not return zero, SQLITE_BUSY will
34345 ** be returned and no changes will be made to the Win32 native heap.
34346 */
34347 SQLITE_API int SQLITE_STDCALL sqlite3_win32_reset_heap(){
34348 int rc;
34349 MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */
34350 MUTEX_LOGIC( sqlite3_mutex *pMem; ) /* The memsys static mutex */
34351 MUTEX_LOGIC( pMaster = sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_MASTER); )
34352 MUTEX_LOGIC( pMem = sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_MEM); )
@@ -34390,11 +34387,11 @@
34387 /*
34388 ** This function outputs the specified (ANSI) string to the Win32 debugger
34389 ** (if available).
34390 */
34391
34392 SQLITE_API void SQLITE_STDCALL sqlite3_win32_write_debug(const char *zBuf, int nBuf){
34393 char zDbgBuf[SQLITE_WIN32_DBG_BUF_SIZE];
34394 int nMin = MIN(nBuf, (SQLITE_WIN32_DBG_BUF_SIZE - 1)); /* may be negative. */
34395 if( nMin<-1 ) nMin = -1; /* all negative values become -1. */
34396 assert( nMin==-1 || nMin==0 || nMin<SQLITE_WIN32_DBG_BUF_SIZE );
34397 #if defined(SQLITE_WIN32_HAS_ANSI)
@@ -34430,11 +34427,11 @@
34427 */
34428 #if SQLITE_OS_WINRT
34429 static HANDLE sleepObj = NULL;
34430 #endif
34431
34432 SQLITE_API void SQLITE_STDCALL sqlite3_win32_sleep(DWORD milliseconds){
34433 #if SQLITE_OS_WINRT
34434 if ( sleepObj==NULL ){
34435 sleepObj = osCreateEventExW(NULL, NULL, CREATE_EVENT_MANUAL_RESET,
34436 SYNCHRONIZE);
34437 }
@@ -34479,11 +34476,11 @@
34476
34477 /*
34478 ** This function determines if the machine is running a version of Windows
34479 ** based on the NT kernel.
34480 */
34481 SQLITE_API int SQLITE_STDCALL sqlite3_win32_is_nt(void){
34482 #if SQLITE_OS_WINRT
34483 /*
34484 ** NOTE: The WinRT sub-platform is always assumed to be based on the NT
34485 ** kernel.
34486 */
@@ -34833,11 +34830,11 @@
34830
34831 /*
34832 ** Convert multibyte character string to UTF-8. Space to hold the
34833 ** returned string is obtained from sqlite3_malloc().
34834 */
34835 SQLITE_API char *SQLITE_STDCALL sqlite3_win32_mbcs_to_utf8(const char *zFilename){
34836 char *zFilenameUtf8;
34837 LPWSTR zTmpWide;
34838
34839 zTmpWide = winMbcsToUnicode(zFilename);
34840 if( zTmpWide==0 ){
@@ -34850,11 +34847,11 @@
34847
34848 /*
34849 ** Convert UTF-8 to multibyte character string. Space to hold the
34850 ** returned string is obtained from sqlite3_malloc().
34851 */
34852 SQLITE_API char *SQLITE_STDCALL sqlite3_win32_utf8_to_mbcs(const char *zFilename){
34853 char *zFilenameMbcs;
34854 LPWSTR zTmpWide;
34855
34856 zTmpWide = winUtf8ToUnicode(zFilename);
34857 if( zTmpWide==0 ){
@@ -34870,11 +34867,11 @@
34867 ** the provided arguments. The type argument must be 1 in order to set the
34868 ** data directory or 2 in order to set the temporary directory. The zValue
34869 ** argument is the name of the directory to use. The return value will be
34870 ** SQLITE_OK if successful.
34871 */
34872 SQLITE_API int SQLITE_STDCALL sqlite3_win32_set_directory(DWORD type, LPCWSTR zValue){
34873 char **ppDirectory = 0;
34874 #ifndef SQLITE_OMIT_AUTOINIT
34875 int rc = sqlite3_initialize();
34876 if( rc ) return rc;
34877 #endif
@@ -35095,15 +35092,15 @@
35092 }
35093
35094 /*
35095 ** Log a I/O error retry episode.
35096 */
35097 static void winLogIoerr(int nRetry, int lineno){
35098 if( nRetry ){
35099 sqlite3_log(SQLITE_IOERR,
35100 "delayed %dms for lock/sharing conflict at line %d",
35101 winIoerrRetryDelay*nRetry*(nRetry+1)/2, lineno
35102 );
35103 }
35104 }
35105
35106 #if SQLITE_OS_WINCE
@@ -35579,11 +35576,12 @@
35576 assert( id!=0 );
35577 #ifndef SQLITE_OMIT_WAL
35578 assert( pFile->pShm==0 );
35579 #endif
35580 assert( pFile->h!=NULL && pFile->h!=INVALID_HANDLE_VALUE );
35581 OSTRACE(("CLOSE pid=%lu, pFile=%p, file=%p\n",
35582 osGetCurrentProcessId(), pFile, pFile->h));
35583
35584 #if SQLITE_MAX_MMAP_SIZE>0
35585 winUnmapfile(pFile);
35586 #endif
35587
@@ -35608,11 +35606,12 @@
35606 #endif
35607 if( rc ){
35608 pFile->h = NULL;
35609 }
35610 OpenCounter(-1);
35611 OSTRACE(("CLOSE pid=%lu, pFile=%p, file=%p, rc=%s\n",
35612 osGetCurrentProcessId(), pFile, pFile->h, rc ? "ok" : "failed"));
35613 return rc ? SQLITE_OK
35614 : winLogError(SQLITE_IOERR_CLOSE, osGetLastError(),
35615 "winClose", pFile->zPath);
35616 }
35617
@@ -35636,20 +35635,22 @@
35635
35636 assert( id!=0 );
35637 assert( amt>0 );
35638 assert( offset>=0 );
35639 SimulateIOError(return SQLITE_IOERR_READ);
35640 OSTRACE(("READ pid=%lu, pFile=%p, file=%p, buffer=%p, amount=%d, "
35641 "offset=%lld, lock=%d\n", osGetCurrentProcessId(), pFile,
35642 pFile->h, pBuf, amt, offset, pFile->locktype));
35643
35644 #if SQLITE_MAX_MMAP_SIZE>0
35645 /* Deal with as much of this read request as possible by transfering
35646 ** data from the memory mapping using memcpy(). */
35647 if( offset<pFile->mmapSize ){
35648 if( offset+amt <= pFile->mmapSize ){
35649 memcpy(pBuf, &((u8 *)(pFile->pMapRegion))[offset], amt);
35650 OSTRACE(("READ-MMAP pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n",
35651 osGetCurrentProcessId(), pFile, pFile->h));
35652 return SQLITE_OK;
35653 }else{
35654 int nCopy = (int)(pFile->mmapSize - offset);
35655 memcpy(pBuf, &((u8 *)(pFile->pMapRegion))[offset], nCopy);
35656 pBuf = &((u8 *)pBuf)[nCopy];
@@ -35659,11 +35660,12 @@
35660 }
35661 #endif
35662
35663 #if SQLITE_OS_WINCE || defined(SQLITE_WIN32_NO_OVERLAPPED)
35664 if( winSeekFile(pFile, offset) ){
35665 OSTRACE(("READ pid=%lu, pFile=%p, file=%p, rc=SQLITE_FULL\n",
35666 osGetCurrentProcessId(), pFile, pFile->h));
35667 return SQLITE_FULL;
35668 }
35669 while( !osReadFile(pFile->h, pBuf, amt, &nRead, 0) ){
35670 #else
35671 memset(&overlapped, 0, sizeof(OVERLAPPED));
@@ -35673,23 +35675,26 @@
35675 osGetLastError()!=ERROR_HANDLE_EOF ){
35676 #endif
35677 DWORD lastErrno;
35678 if( winRetryIoerr(&nRetry, &lastErrno) ) continue;
35679 pFile->lastErrno = lastErrno;
35680 OSTRACE(("READ pid=%lu, pFile=%p, file=%p, rc=SQLITE_IOERR_READ\n",
35681 osGetCurrentProcessId(), pFile, pFile->h));
35682 return winLogError(SQLITE_IOERR_READ, pFile->lastErrno,
35683 "winRead", pFile->zPath);
35684 }
35685 winLogIoerr(nRetry, __LINE__);
35686 if( nRead<(DWORD)amt ){
35687 /* Unread parts of the buffer must be zero-filled */
35688 memset(&((char*)pBuf)[nRead], 0, amt-nRead);
35689 OSTRACE(("READ pid=%lu, pFile=%p, file=%p, rc=SQLITE_IOERR_SHORT_READ\n",
35690 osGetCurrentProcessId(), pFile, pFile->h));
35691 return SQLITE_IOERR_SHORT_READ;
35692 }
35693
35694 OSTRACE(("READ pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n",
35695 osGetCurrentProcessId(), pFile, pFile->h));
35696 return SQLITE_OK;
35697 }
35698
35699 /*
35700 ** Write data from a buffer into a file. Return SQLITE_OK on success
@@ -35708,20 +35713,22 @@
35713 assert( amt>0 );
35714 assert( pFile );
35715 SimulateIOError(return SQLITE_IOERR_WRITE);
35716 SimulateDiskfullError(return SQLITE_FULL);
35717
35718 OSTRACE(("WRITE pid=%lu, pFile=%p, file=%p, buffer=%p, amount=%d, "
35719 "offset=%lld, lock=%d\n", osGetCurrentProcessId(), pFile,
35720 pFile->h, pBuf, amt, offset, pFile->locktype));
35721
35722 #if SQLITE_MAX_MMAP_SIZE>0
35723 /* Deal with as much of this write request as possible by transfering
35724 ** data from the memory mapping using memcpy(). */
35725 if( offset<pFile->mmapSize ){
35726 if( offset+amt <= pFile->mmapSize ){
35727 memcpy(&((u8 *)(pFile->pMapRegion))[offset], pBuf, amt);
35728 OSTRACE(("WRITE-MMAP pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n",
35729 osGetCurrentProcessId(), pFile, pFile->h));
35730 return SQLITE_OK;
35731 }else{
35732 int nCopy = (int)(pFile->mmapSize - offset);
35733 memcpy(&((u8 *)(pFile->pMapRegion))[offset], pBuf, nCopy);
35734 pBuf = &((u8 *)pBuf)[nCopy];
@@ -35780,21 +35787,24 @@
35787 }
35788
35789 if( rc ){
35790 if( ( pFile->lastErrno==ERROR_HANDLE_DISK_FULL )
35791 || ( pFile->lastErrno==ERROR_DISK_FULL )){
35792 OSTRACE(("WRITE pid=%lu, pFile=%p, file=%p, rc=SQLITE_FULL\n",
35793 osGetCurrentProcessId(), pFile, pFile->h));
35794 return winLogError(SQLITE_FULL, pFile->lastErrno,
35795 "winWrite1", pFile->zPath);
35796 }
35797 OSTRACE(("WRITE pid=%lu, pFile=%p, file=%p, rc=SQLITE_IOERR_WRITE\n",
35798 osGetCurrentProcessId(), pFile, pFile->h));
35799 return winLogError(SQLITE_IOERR_WRITE, pFile->lastErrno,
35800 "winWrite2", pFile->zPath);
35801 }else{
35802 winLogIoerr(nRetry, __LINE__);
35803 }
35804 OSTRACE(("WRITE pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n",
35805 osGetCurrentProcessId(), pFile, pFile->h));
35806 return SQLITE_OK;
35807 }
35808
35809 /*
35810 ** Truncate an open file to a specified size
@@ -35804,12 +35814,12 @@
35814 int rc = SQLITE_OK; /* Return code for this function */
35815 DWORD lastErrno;
35816
35817 assert( pFile );
35818 SimulateIOError(return SQLITE_IOERR_TRUNCATE);
35819 OSTRACE(("TRUNCATE pid=%lu, pFile=%p, file=%p, size=%lld, lock=%d\n",
35820 osGetCurrentProcessId(), pFile, pFile->h, nByte, pFile->locktype));
35821
35822 /* If the user has configured a chunk-size for this file, truncate the
35823 ** file so that it consists of an integer number of chunks (i.e. the
35824 ** actual file size after the operation may be larger than the requested
35825 ** size).
@@ -35837,11 +35847,12 @@
35847 if( pFile->pMapRegion && nByte<pFile->mmapSize ){
35848 pFile->mmapSize = nByte;
35849 }
35850 #endif
35851
35852 OSTRACE(("TRUNCATE pid=%lu, pFile=%p, file=%p, rc=%s\n",
35853 osGetCurrentProcessId(), pFile, pFile->h, sqlite3ErrName(rc)));
35854 return rc;
35855 }
35856
35857 #ifdef SQLITE_TEST
35858 /*
@@ -35882,12 +35893,13 @@
35893 /* Unix cannot, but some systems may return SQLITE_FULL from here. This
35894 ** line is to test that doing so does not cause any problems.
35895 */
35896 SimulateDiskfullError( return SQLITE_FULL );
35897
35898 OSTRACE(("SYNC pid=%lu, pFile=%p, file=%p, flags=%x, lock=%d\n",
35899 osGetCurrentProcessId(), pFile, pFile->h, flags,
35900 pFile->locktype));
35901
35902 #ifndef SQLITE_TEST
35903 UNUSED_PARAMETER(flags);
35904 #else
35905 if( (flags&0x0F)==SQLITE_SYNC_FULL ){
@@ -35898,21 +35910,24 @@
35910
35911 /* If we compiled with the SQLITE_NO_SYNC flag, then syncing is a
35912 ** no-op
35913 */
35914 #ifdef SQLITE_NO_SYNC
35915 OSTRACE(("SYNC-NOP pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n",
35916 osGetCurrentProcessId(), pFile, pFile->h));
35917 return SQLITE_OK;
35918 #else
35919 rc = osFlushFileBuffers(pFile->h);
35920 SimulateIOError( rc=FALSE );
35921 if( rc ){
35922 OSTRACE(("SYNC pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n",
35923 osGetCurrentProcessId(), pFile, pFile->h));
35924 return SQLITE_OK;
35925 }else{
35926 pFile->lastErrno = osGetLastError();
35927 OSTRACE(("SYNC pid=%lu, pFile=%p, file=%p, rc=SQLITE_IOERR_FSYNC\n",
35928 osGetCurrentProcessId(), pFile, pFile->h));
35929 return winLogError(SQLITE_IOERR_FSYNC, pFile->lastErrno,
35930 "winSync", pFile->zPath);
35931 }
35932 #endif
35933 }
@@ -37881,11 +37896,11 @@
37896 winRetryIoerr(&cnt, &lastErrno) ){
37897 /* Noop */
37898 }
37899 }
37900 #endif
37901 winLogIoerr(cnt, __LINE__);
37902
37903 OSTRACE(("OPEN file=%p, name=%s, access=%lx, rc=%s\n", h, zUtf8Name,
37904 dwDesiredAccess, (h==INVALID_HANDLE_VALUE) ? "failed" : "ok"));
37905
37906 if( h==INVALID_HANDLE_VALUE ){
@@ -38065,11 +38080,11 @@
38080 }
38081 #endif
38082 if( rc && rc!=SQLITE_IOERR_DELETE_NOENT ){
38083 rc = winLogError(SQLITE_IOERR_DELETE, lastErrno, "winDelete", zFilename);
38084 }else{
38085 winLogIoerr(cnt, __LINE__);
38086 }
38087 sqlite3_free(zConverted);
38088 OSTRACE(("DELETE name=%s, rc=%s\n", zFilename, sqlite3ErrName(rc)));
38089 return rc;
38090 }
@@ -38115,11 +38130,11 @@
38130 attr = INVALID_FILE_ATTRIBUTES;
38131 }else{
38132 attr = sAttrData.dwFileAttributes;
38133 }
38134 }else{
38135 winLogIoerr(cnt, __LINE__);
38136 if( lastErrno!=ERROR_FILE_NOT_FOUND && lastErrno!=ERROR_PATH_NOT_FOUND ){
38137 sqlite3_free(zConverted);
38138 return winLogError(SQLITE_IOERR_ACCESS, lastErrno, "winAccess",
38139 zFilename);
38140 }else{
@@ -38630,11 +38645,11 @@
38645 }
38646
38647 /*
38648 ** Initialize and deinitialize the operating system interface.
38649 */
38650 SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void){
38651 static sqlite3_vfs winVfs = {
38652 3, /* iVersion */
38653 sizeof(winFile), /* szOsFile */
38654 SQLITE_WIN32_MAX_PATH_BYTES, /* mxPathname */
38655 0, /* pNext */
@@ -38705,11 +38720,11 @@
38720 #endif
38721
38722 return SQLITE_OK;
38723 }
38724
38725 SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void){
38726 #if SQLITE_OS_WINRT
38727 if( sleepObj!=NULL ){
38728 osCloseHandle(sleepObj);
38729 sleepObj = NULL;
38730 }
@@ -53006,11 +53021,11 @@
53021 **
53022 ** This routine has no effect on existing database connections.
53023 ** The shared cache setting effects only future calls to
53024 ** sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2().
53025 */
53026 SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int enable){
53027 sqlite3GlobalConfig.sharedCacheEnabled = enable;
53028 return SQLITE_OK;
53029 }
53030 #endif
53031
@@ -53520,14 +53535,19 @@
53535 ** prior to calling this routine.
53536 */
53537 static int saveCursorPosition(BtCursor *pCur){
53538 int rc;
53539
53540 assert( CURSOR_VALID==pCur->eState || CURSOR_SKIPNEXT==pCur->eState );
53541 assert( 0==pCur->pKey );
53542 assert( cursorHoldsMutex(pCur) );
53543
53544 if( pCur->eState==CURSOR_SKIPNEXT ){
53545 pCur->eState = CURSOR_VALID;
53546 }else{
53547 pCur->skipNext = 0;
53548 }
53549 rc = sqlite3BtreeKeySize(pCur, &pCur->nKey);
53550 assert( rc==SQLITE_OK ); /* KeySize() cannot fail */
53551
53552 /* If this is an intKey table, then the above call to BtreeKeySize()
53553 ** stores the integer key in pCur->nKey. In this case this value is
@@ -53594,11 +53614,11 @@
53614 Pgno iRoot, /* Only save cursor with this iRoot. Save all if zero */
53615 BtCursor *pExcept /* Do not save this cursor */
53616 ){
53617 do{
53618 if( p!=pExcept && (0==iRoot || p->pgnoRoot==iRoot) ){
53619 if( p->eState==CURSOR_VALID || p->eState==CURSOR_SKIPNEXT ){
53620 int rc = saveCursorPosition(p);
53621 if( SQLITE_OK!=rc ){
53622 return rc;
53623 }
53624 }else{
@@ -53666,21 +53686,23 @@
53686 ** at most one effective restoreCursorPosition() call after each
53687 ** saveCursorPosition().
53688 */
53689 static int btreeRestoreCursorPosition(BtCursor *pCur){
53690 int rc;
53691 int skipNext;
53692 assert( cursorHoldsMutex(pCur) );
53693 assert( pCur->eState>=CURSOR_REQUIRESEEK );
53694 if( pCur->eState==CURSOR_FAULT ){
53695 return pCur->skipNext;
53696 }
53697 pCur->eState = CURSOR_INVALID;
53698 rc = btreeMoveto(pCur, pCur->pKey, pCur->nKey, 0, &skipNext);
53699 if( rc==SQLITE_OK ){
53700 sqlite3_free(pCur->pKey);
53701 pCur->pKey = 0;
53702 assert( pCur->eState==CURSOR_VALID || pCur->eState==CURSOR_INVALID );
53703 pCur->skipNext |= skipNext;
53704 if( pCur->skipNext && pCur->eState==CURSOR_VALID ){
53705 pCur->eState = CURSOR_SKIPNEXT;
53706 }
53707 }
53708 return rc;
@@ -53728,13 +53750,14 @@
53750 rc = restoreCursorPosition(pCur);
53751 if( rc ){
53752 *pDifferentRow = 1;
53753 return rc;
53754 }
53755 if( pCur->eState!=CURSOR_VALID ){
53756 *pDifferentRow = 1;
53757 }else{
53758 assert( pCur->skipNext==0 );
53759 *pDifferentRow = 0;
53760 }
53761 return SQLITE_OK;
53762 }
53763
@@ -56545,11 +56568,11 @@
56568 if( pBtree ){
56569 sqlite3BtreeEnter(pBtree);
56570 for(p=pBtree->pBt->pCursor; p; p=p->pNext){
56571 int i;
56572 if( writeOnly && (p->curFlags & BTCF_WriteFlag)==0 ){
56573 if( p->eState==CURSOR_VALID || p->eState==CURSOR_SKIPNEXT ){
56574 rc = saveCursorPosition(p);
56575 if( rc!=SQLITE_OK ){
56576 (void)sqlite3BtreeTripAllCursors(pBtree, rc, 0);
56577 break;
56578 }
@@ -56951,10 +56974,12 @@
56974 ** to return an integer result code for historical reasons.
56975 */
56976 SQLITE_PRIVATE int sqlite3BtreeDataSize(BtCursor *pCur, u32 *pSize){
56977 assert( cursorHoldsMutex(pCur) );
56978 assert( pCur->eState==CURSOR_VALID );
56979 assert( pCur->iPage>=0 );
56980 assert( pCur->iPage<BTCURSOR_MAX_DEPTH );
56981 assert( pCur->apPage[pCur->iPage]->intKeyLeaf==1 );
56982 getCellInfo(pCur);
56983 *pSize = pCur->info.nPayload;
56984 return SQLITE_OK;
56985 }
@@ -57429,19 +57454,21 @@
57454 return SQLITE_CORRUPT_BKPT;
57455 }
57456 return SQLITE_OK;
57457 }
57458
57459 #if SQLITE_DEBUG
57460 /*
57461 ** Page pParent is an internal (non-leaf) tree page. This function
57462 ** asserts that page number iChild is the left-child if the iIdx'th
57463 ** cell in page pParent. Or, if iIdx is equal to the total number of
57464 ** cells in pParent, that page number iChild is the right-child of
57465 ** the page.
57466 */
57467 static void assertParentIndex(MemPage *pParent, int iIdx, Pgno iChild){
57468 if( CORRUPT_DB ) return; /* The conditions tested below might not be true
57469 ** in a corrupt database */
57470 assert( iIdx<=pParent->nCell );
57471 if( iIdx==pParent->nCell ){
57472 assert( get4byte(&pParent->aData[pParent->hdrOffset+8])==iChild );
57473 }else{
57474 assert( get4byte(findCell(pParent, iIdx))==iChild );
@@ -57462,23 +57489,15 @@
57489 static void moveToParent(BtCursor *pCur){
57490 assert( cursorHoldsMutex(pCur) );
57491 assert( pCur->eState==CURSOR_VALID );
57492 assert( pCur->iPage>0 );
57493 assert( pCur->apPage[pCur->iPage] );
 
 
 
 
 
 
 
57494 assertParentIndex(
57495 pCur->apPage[pCur->iPage-1],
57496 pCur->aiIdx[pCur->iPage-1],
57497 pCur->apPage[pCur->iPage]->pgno
57498 );
 
57499 testcase( pCur->aiIdx[pCur->iPage-1] > pCur->apPage[pCur->iPage-1]->nCell );
57500
57501 releasePage(pCur->apPage[pCur->iPage]);
57502 pCur->iPage--;
57503 pCur->info.nSize = 0;
@@ -60422,10 +60441,11 @@
60441 pPage->nOverflow = 0;
60442
60443 /* The next iteration of the do-loop balances the parent page. */
60444 releasePage(pPage);
60445 pCur->iPage--;
60446 assert( pCur->iPage>=0 );
60447 }
60448 }while( rc==SQLITE_OK );
60449
60450 if( pFree ){
60451 sqlite3PageFree(pFree);
@@ -60893,29 +60913,32 @@
60913 int rc;
60914 unsigned char *pCell;
60915 int i;
60916 int hdr;
60917 u16 szCell;
60918 u8 hasChildren;
60919
60920 assert( sqlite3_mutex_held(pBt->mutex) );
60921 if( pgno>btreePagecount(pBt) ){
60922 return SQLITE_CORRUPT_BKPT;
60923 }
60924
60925 rc = getAndInitPage(pBt, pgno, &pPage, 0);
60926 if( rc ) return rc;
60927 hasChildren = !pPage->leaf;
60928 pPage->leaf = 1; /* Block looping if the database is corrupt */
60929 hdr = pPage->hdrOffset;
60930 for(i=0; i<pPage->nCell; i++){
60931 pCell = findCell(pPage, i);
60932 if( hasChildren ){
60933 rc = clearDatabasePage(pBt, get4byte(pCell), 1, pnChange);
60934 if( rc ) goto cleardatabasepage_out;
60935 }
60936 rc = clearCell(pPage, pCell, &szCell);
60937 if( rc ) goto cleardatabasepage_out;
60938 }
60939 if( hasChildren ){
60940 rc = clearDatabasePage(pBt, get4byte(&pPage->aData[hdr+8]), 1, pnChange);
60941 if( rc ) goto cleardatabasepage_out;
60942 }else if( pnChange ){
60943 assert( pPage->intKey );
60944 *pnChange += pPage->nCell;
@@ -62239,11 +62262,11 @@
62262 ** a pointer to the new sqlite3_backup object.
62263 **
62264 ** If an error occurs, NULL is returned and an error code and error message
62265 ** stored in database handle pDestDb.
62266 */
62267 SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
62268 sqlite3* pDestDb, /* Database to write to */
62269 const char *zDestDb, /* Name of database within pDestDb */
62270 sqlite3* pSrcDb, /* Database connection to read from */
62271 const char *zSrcDb /* Name of database within pSrcDb */
62272 ){
@@ -62447,11 +62470,11 @@
62470 }
62471
62472 /*
62473 ** Copy nPage pages from the source b-tree to the destination.
62474 */
62475 SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage){
62476 int rc;
62477 int destMode; /* Destination journal mode */
62478 int pgszSrc = 0; /* Source page size */
62479 int pgszDest = 0; /* Destination page size */
62480
@@ -62692,11 +62715,11 @@
62715 }
62716
62717 /*
62718 ** Release all resources associated with an sqlite3_backup* handle.
62719 */
62720 SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p){
62721 sqlite3_backup **pp; /* Ptr to head of pagers backup list */
62722 sqlite3 *pSrcDb; /* Source database connection */
62723 int rc; /* Value to return */
62724
62725 /* Enter the mutexes */
@@ -62744,11 +62767,11 @@
62767
62768 /*
62769 ** Return the number of pages still to be backed up as of the most recent
62770 ** call to sqlite3_backup_step().
62771 */
62772 SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p){
62773 #ifdef SQLITE_ENABLE_API_ARMOR
62774 if( p==0 ){
62775 (void)SQLITE_MISUSE_BKPT;
62776 return 0;
62777 }
@@ -62758,11 +62781,11 @@
62781
62782 /*
62783 ** Return the total number of pages in the source database as of the most
62784 ** recent call to sqlite3_backup_step().
62785 */
62786 SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p){
62787 #ifdef SQLITE_ENABLE_API_ARMOR
62788 if( p==0 ){
62789 (void)SQLITE_MISUSE_BKPT;
62790 return 0;
62791 }
@@ -64633,11 +64656,11 @@
64656 }
64657
64658 /*
64659 ** Return the SQL associated with a prepared statement
64660 */
64661 SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt){
64662 Vdbe *p = (Vdbe *)pStmt;
64663 return (p && p->isPrepareV2) ? p->zSql : 0;
64664 }
64665
64666 /*
@@ -68789,11 +68812,11 @@
68812 ** execution environment changes in a way that would alter the program
68813 ** that sqlite3_prepare() generates. For example, if new functions or
68814 ** collating sequences are registered or if an authorizer function is
68815 ** added or changed.
68816 */
68817 SQLITE_API int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt *pStmt){
68818 Vdbe *p = (Vdbe*)pStmt;
68819 return p==0 || p->expired;
68820 }
68821 #endif
68822
@@ -68826,11 +68849,11 @@
68849 ** machine.
68850 **
68851 ** This routine sets the error code and string returned by
68852 ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
68853 */
68854 SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt){
68855 int rc;
68856 if( pStmt==0 ){
68857 /* IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL
68858 ** pointer is a harmless no-op. */
68859 rc = SQLITE_OK;
@@ -68852,11 +68875,11 @@
68875 ** the prior execution is returned.
68876 **
68877 ** This routine sets the error code and string returned by
68878 ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
68879 */
68880 SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt){
68881 int rc;
68882 if( pStmt==0 ){
68883 rc = SQLITE_OK;
68884 }else{
68885 Vdbe *v = (Vdbe*)pStmt;
@@ -68871,11 +68894,11 @@
68894 }
68895
68896 /*
68897 ** Set all the parameters in the compiled SQL statement to NULL.
68898 */
68899 SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt *pStmt){
68900 int i;
68901 int rc = SQLITE_OK;
68902 Vdbe *p = (Vdbe*)pStmt;
68903 #if SQLITE_THREADSAFE
68904 sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex;
@@ -68895,54 +68918,54 @@
68918
68919 /**************************** sqlite3_value_ *******************************
68920 ** The following routines extract information from a Mem or sqlite3_value
68921 ** structure.
68922 */
68923 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value *pVal){
68924 Mem *p = (Mem*)pVal;
68925 if( p->flags & (MEM_Blob|MEM_Str) ){
68926 sqlite3VdbeMemExpandBlob(p);
68927 p->flags |= MEM_Blob;
68928 return p->n ? p->z : 0;
68929 }else{
68930 return sqlite3_value_text(pVal);
68931 }
68932 }
68933 SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value *pVal){
68934 return sqlite3ValueBytes(pVal, SQLITE_UTF8);
68935 }
68936 SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value *pVal){
68937 return sqlite3ValueBytes(pVal, SQLITE_UTF16NATIVE);
68938 }
68939 SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value *pVal){
68940 return sqlite3VdbeRealValue((Mem*)pVal);
68941 }
68942 SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value *pVal){
68943 return (int)sqlite3VdbeIntValue((Mem*)pVal);
68944 }
68945 SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value *pVal){
68946 return sqlite3VdbeIntValue((Mem*)pVal);
68947 }
68948 SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value *pVal){
68949 return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
68950 }
68951 #ifndef SQLITE_OMIT_UTF16
68952 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value* pVal){
68953 return sqlite3ValueText(pVal, SQLITE_UTF16NATIVE);
68954 }
68955 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value *pVal){
68956 return sqlite3ValueText(pVal, SQLITE_UTF16BE);
68957 }
68958 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value *pVal){
68959 return sqlite3ValueText(pVal, SQLITE_UTF16LE);
68960 }
68961 #endif /* SQLITE_OMIT_UTF16 */
68962 /* EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five
68963 ** fundamental datatypes: 64-bit signed integer 64-bit IEEE floating
68964 ** point number string BLOB NULL
68965 */
68966 SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value* pVal){
68967 static const u8 aType[] = {
68968 SQLITE_BLOB, /* 0x00 */
68969 SQLITE_NULL, /* 0x01 */
68970 SQLITE_TEXT, /* 0x02 */
68971 SQLITE_NULL, /* 0x03 */
@@ -69014,21 +69037,21 @@
69037 xDel((void*)p);
69038 }
69039 if( pCtx ) sqlite3_result_error_toobig(pCtx);
69040 return SQLITE_TOOBIG;
69041 }
69042 SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(
69043 sqlite3_context *pCtx,
69044 const void *z,
69045 int n,
69046 void (*xDel)(void *)
69047 ){
69048 assert( n>=0 );
69049 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69050 setResultStrOrError(pCtx, z, n, 0, xDel);
69051 }
69052 SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(
69053 sqlite3_context *pCtx,
69054 const void *z,
69055 sqlite3_uint64 n,
69056 void (*xDel)(void *)
69057 ){
@@ -69038,50 +69061,50 @@
69061 (void)invokeValueDestructor(z, xDel, pCtx);
69062 }else{
69063 setResultStrOrError(pCtx, z, (int)n, 0, xDel);
69064 }
69065 }
69066 SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context *pCtx, double rVal){
69067 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69068 sqlite3VdbeMemSetDouble(pCtx->pOut, rVal);
69069 }
69070 SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
69071 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69072 pCtx->isError = SQLITE_ERROR;
69073 pCtx->fErrorOrAux = 1;
69074 sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF8, SQLITE_TRANSIENT);
69075 }
69076 #ifndef SQLITE_OMIT_UTF16
69077 SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){
69078 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69079 pCtx->isError = SQLITE_ERROR;
69080 pCtx->fErrorOrAux = 1;
69081 sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF16NATIVE, SQLITE_TRANSIENT);
69082 }
69083 #endif
69084 SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context *pCtx, int iVal){
69085 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69086 sqlite3VdbeMemSetInt64(pCtx->pOut, (i64)iVal);
69087 }
69088 SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
69089 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69090 sqlite3VdbeMemSetInt64(pCtx->pOut, iVal);
69091 }
69092 SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context *pCtx){
69093 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69094 sqlite3VdbeMemSetNull(pCtx->pOut);
69095 }
69096 SQLITE_API void SQLITE_STDCALL sqlite3_result_text(
69097 sqlite3_context *pCtx,
69098 const char *z,
69099 int n,
69100 void (*xDel)(void *)
69101 ){
69102 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69103 setResultStrOrError(pCtx, z, n, SQLITE_UTF8, xDel);
69104 }
69105 SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(
69106 sqlite3_context *pCtx,
69107 const char *z,
69108 sqlite3_uint64 n,
69109 void (*xDel)(void *),
69110 unsigned char enc
@@ -69094,47 +69117,47 @@
69117 }else{
69118 setResultStrOrError(pCtx, z, (int)n, enc, xDel);
69119 }
69120 }
69121 #ifndef SQLITE_OMIT_UTF16
69122 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(
69123 sqlite3_context *pCtx,
69124 const void *z,
69125 int n,
69126 void (*xDel)(void *)
69127 ){
69128 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69129 setResultStrOrError(pCtx, z, n, SQLITE_UTF16NATIVE, xDel);
69130 }
69131 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(
69132 sqlite3_context *pCtx,
69133 const void *z,
69134 int n,
69135 void (*xDel)(void *)
69136 ){
69137 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69138 setResultStrOrError(pCtx, z, n, SQLITE_UTF16BE, xDel);
69139 }
69140 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(
69141 sqlite3_context *pCtx,
69142 const void *z,
69143 int n,
69144 void (*xDel)(void *)
69145 ){
69146 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69147 setResultStrOrError(pCtx, z, n, SQLITE_UTF16LE, xDel);
69148 }
69149 #endif /* SQLITE_OMIT_UTF16 */
69150 SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){
69151 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69152 sqlite3VdbeMemCopy(pCtx->pOut, pValue);
69153 }
69154 SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){
69155 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69156 sqlite3VdbeMemSetZeroBlob(pCtx->pOut, n);
69157 }
69158 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){
69159 pCtx->isError = errCode;
69160 pCtx->fErrorOrAux = 1;
69161 #ifdef SQLITE_DEBUG
69162 if( pCtx->pVdbe ) pCtx->pVdbe->rcApp = errCode;
69163 #endif
@@ -69143,20 +69166,20 @@
69166 SQLITE_UTF8, SQLITE_STATIC);
69167 }
69168 }
69169
69170 /* Force an SQLITE_TOOBIG error. */
69171 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context *pCtx){
69172 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69173 pCtx->isError = SQLITE_TOOBIG;
69174 pCtx->fErrorOrAux = 1;
69175 sqlite3VdbeMemSetStr(pCtx->pOut, "string or blob too big", -1,
69176 SQLITE_UTF8, SQLITE_STATIC);
69177 }
69178
69179 /* An SQLITE_NOMEM error. */
69180 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context *pCtx){
69181 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69182 sqlite3VdbeMemSetNull(pCtx->pOut);
69183 pCtx->isError = SQLITE_NOMEM;
69184 pCtx->fErrorOrAux = 1;
69185 pCtx->pOut->db->mallocFailed = 1;
@@ -69325,11 +69348,11 @@
69348 /*
69349 ** This is the top-level implementation of sqlite3_step(). Call
69350 ** sqlite3Step() to do most of the work. If a schema error occurs,
69351 ** call sqlite3Reprepare() and try again.
69352 */
69353 SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt *pStmt){
69354 int rc = SQLITE_OK; /* Result from sqlite3Step() */
69355 int rc2 = SQLITE_OK; /* Result from sqlite3Reprepare() */
69356 Vdbe *v = (Vdbe*)pStmt; /* the prepared statement */
69357 int cnt = 0; /* Counter to prevent infinite loop of reprepares */
69358 sqlite3 *db; /* The database connection */
@@ -69376,11 +69399,11 @@
69399
69400 /*
69401 ** Extract the user data from a sqlite3_context structure and return a
69402 ** pointer to it.
69403 */
69404 SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context *p){
69405 assert( p && p->pFunc );
69406 return p->pFunc->pUserData;
69407 }
69408
69409 /*
@@ -69391,11 +69414,11 @@
69414 ** returns a copy of the pointer to the database connection (the 1st
69415 ** parameter) of the sqlite3_create_function() and
69416 ** sqlite3_create_function16() routines that originally registered the
69417 ** application defined function.
69418 */
69419 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context *p){
69420 assert( p && p->pFunc );
69421 return p->pOut->db;
69422 }
69423
69424 /*
@@ -69467,11 +69490,11 @@
69490 /*
69491 ** Allocate or return the aggregate context for a user function. A new
69492 ** context is allocated on the first call. Subsequent calls return the
69493 ** same context that was returned on prior calls.
69494 */
69495 SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context *p, int nByte){
69496 assert( p && p->pFunc && p->pFunc->xStep );
69497 assert( sqlite3_mutex_held(p->pOut->db->mutex) );
69498 testcase( nByte<0 );
69499 if( (p->pMem->flags & MEM_Agg)==0 ){
69500 return createAggContext(p, nByte);
@@ -69482,11 +69505,11 @@
69505
69506 /*
69507 ** Return the auxiliary data pointer, if any, for the iArg'th argument to
69508 ** the user-function defined by pCtx.
69509 */
69510 SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
69511 AuxData *pAuxData;
69512
69513 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
69514 #if SQLITE_ENABLE_STAT3_OR_STAT4
69515 if( pCtx->pVdbe==0 ) return 0;
@@ -69503,11 +69526,11 @@
69526 /*
69527 ** Set the auxiliary data pointer and delete function, for the iArg'th
69528 ** argument to the user-function defined by pCtx. Any previous value is
69529 ** deleted by calling the delete function specified when it was set.
69530 */
69531 SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(
69532 sqlite3_context *pCtx,
69533 int iArg,
69534 void *pAux,
69535 void (*xDelete)(void*)
69536 ){
@@ -69558,29 +69581,29 @@
69581 ** This function is deprecated. Do not use it for new code. It is
69582 ** provide only to avoid breaking legacy code. New aggregate function
69583 ** implementations should keep their own counts within their aggregate
69584 ** context.
69585 */
69586 SQLITE_API int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context *p){
69587 assert( p && p->pMem && p->pFunc && p->pFunc->xStep );
69588 return p->pMem->n;
69589 }
69590 #endif
69591
69592 /*
69593 ** Return the number of columns in the result set for the statement pStmt.
69594 */
69595 SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt){
69596 Vdbe *pVm = (Vdbe *)pStmt;
69597 return pVm ? pVm->nResColumn : 0;
69598 }
69599
69600 /*
69601 ** Return the number of values available from the current row of the
69602 ** currently executing statement pStmt.
69603 */
69604 SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt){
69605 Vdbe *pVm = (Vdbe *)pStmt;
69606 if( pVm==0 || pVm->pResultSet==0 ) return 0;
69607 return pVm->nResColumn;
69608 }
69609
@@ -69678,67 +69701,67 @@
69701
69702 /**************************** sqlite3_column_ *******************************
69703 ** The following routines are used to access elements of the current row
69704 ** in the result set.
69705 */
69706 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt *pStmt, int i){
69707 const void *val;
69708 val = sqlite3_value_blob( columnMem(pStmt,i) );
69709 /* Even though there is no encoding conversion, value_blob() might
69710 ** need to call malloc() to expand the result of a zeroblob()
69711 ** expression.
69712 */
69713 columnMallocFailure(pStmt);
69714 return val;
69715 }
69716 SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){
69717 int val = sqlite3_value_bytes( columnMem(pStmt,i) );
69718 columnMallocFailure(pStmt);
69719 return val;
69720 }
69721 SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){
69722 int val = sqlite3_value_bytes16( columnMem(pStmt,i) );
69723 columnMallocFailure(pStmt);
69724 return val;
69725 }
69726 SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt *pStmt, int i){
69727 double val = sqlite3_value_double( columnMem(pStmt,i) );
69728 columnMallocFailure(pStmt);
69729 return val;
69730 }
69731 SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt *pStmt, int i){
69732 int val = sqlite3_value_int( columnMem(pStmt,i) );
69733 columnMallocFailure(pStmt);
69734 return val;
69735 }
69736 SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt *pStmt, int i){
69737 sqlite_int64 val = sqlite3_value_int64( columnMem(pStmt,i) );
69738 columnMallocFailure(pStmt);
69739 return val;
69740 }
69741 SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt *pStmt, int i){
69742 const unsigned char *val = sqlite3_value_text( columnMem(pStmt,i) );
69743 columnMallocFailure(pStmt);
69744 return val;
69745 }
69746 SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt *pStmt, int i){
69747 Mem *pOut = columnMem(pStmt, i);
69748 if( pOut->flags&MEM_Static ){
69749 pOut->flags &= ~MEM_Static;
69750 pOut->flags |= MEM_Ephem;
69751 }
69752 columnMallocFailure(pStmt);
69753 return (sqlite3_value *)pOut;
69754 }
69755 #ifndef SQLITE_OMIT_UTF16
69756 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt *pStmt, int i){
69757 const void *val = sqlite3_value_text16( columnMem(pStmt,i) );
69758 columnMallocFailure(pStmt);
69759 return val;
69760 }
69761 #endif /* SQLITE_OMIT_UTF16 */
69762 SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt *pStmt, int i){
69763 int iType = sqlite3_value_type( columnMem(pStmt,i) );
69764 columnMallocFailure(pStmt);
69765 return iType;
69766 }
69767
@@ -69798,16 +69821,16 @@
69821
69822 /*
69823 ** Return the name of the Nth column of the result set returned by SQL
69824 ** statement pStmt.
69825 */
69826 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt *pStmt, int N){
69827 return columnName(
69828 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_NAME);
69829 }
69830 #ifndef SQLITE_OMIT_UTF16
69831 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt *pStmt, int N){
69832 return columnName(
69833 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_NAME);
69834 }
69835 #endif
69836
@@ -69823,16 +69846,16 @@
69846 #ifndef SQLITE_OMIT_DECLTYPE
69847 /*
69848 ** Return the column declaration type (if applicable) of the 'i'th column
69849 ** of the result set of SQL statement pStmt.
69850 */
69851 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){
69852 return columnName(
69853 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DECLTYPE);
69854 }
69855 #ifndef SQLITE_OMIT_UTF16
69856 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){
69857 return columnName(
69858 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DECLTYPE);
69859 }
69860 #endif /* SQLITE_OMIT_UTF16 */
69861 #endif /* SQLITE_OMIT_DECLTYPE */
@@ -69841,16 +69864,16 @@
69864 /*
69865 ** Return the name of the database from which a result column derives.
69866 ** NULL is returned if the result column is an expression or constant or
69867 ** anything else which is not an unambiguous reference to a database column.
69868 */
69869 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){
69870 return columnName(
69871 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DATABASE);
69872 }
69873 #ifndef SQLITE_OMIT_UTF16
69874 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){
69875 return columnName(
69876 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DATABASE);
69877 }
69878 #endif /* SQLITE_OMIT_UTF16 */
69879
@@ -69857,16 +69880,16 @@
69880 /*
69881 ** Return the name of the table from which a result column derives.
69882 ** NULL is returned if the result column is an expression or constant or
69883 ** anything else which is not an unambiguous reference to a database column.
69884 */
69885 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){
69886 return columnName(
69887 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_TABLE);
69888 }
69889 #ifndef SQLITE_OMIT_UTF16
69890 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){
69891 return columnName(
69892 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_TABLE);
69893 }
69894 #endif /* SQLITE_OMIT_UTF16 */
69895
@@ -69873,16 +69896,16 @@
69896 /*
69897 ** Return the name of the table column from which a result column derives.
69898 ** NULL is returned if the result column is an expression or constant or
69899 ** anything else which is not an unambiguous reference to a database column.
69900 */
69901 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){
69902 return columnName(
69903 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_COLUMN);
69904 }
69905 #ifndef SQLITE_OMIT_UTF16
69906 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){
69907 return columnName(
69908 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_COLUMN);
69909 }
69910 #endif /* SQLITE_OMIT_UTF16 */
69911 #endif /* SQLITE_ENABLE_COLUMN_METADATA */
@@ -69979,20 +70002,20 @@
70002
70003
70004 /*
70005 ** Bind a blob value to an SQL statement variable.
70006 */
70007 SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(
70008 sqlite3_stmt *pStmt,
70009 int i,
70010 const void *zData,
70011 int nData,
70012 void (*xDel)(void*)
70013 ){
70014 return bindText(pStmt, i, zData, nData, xDel, 0);
70015 }
70016 SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(
70017 sqlite3_stmt *pStmt,
70018 int i,
70019 const void *zData,
70020 sqlite3_uint64 nData,
70021 void (*xDel)(void*)
@@ -70002,52 +70025,52 @@
70025 return invokeValueDestructor(zData, xDel, 0);
70026 }else{
70027 return bindText(pStmt, i, zData, (int)nData, xDel, 0);
70028 }
70029 }
70030 SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
70031 int rc;
70032 Vdbe *p = (Vdbe *)pStmt;
70033 rc = vdbeUnbind(p, i);
70034 if( rc==SQLITE_OK ){
70035 sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue);
70036 sqlite3_mutex_leave(p->db->mutex);
70037 }
70038 return rc;
70039 }
70040 SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){
70041 return sqlite3_bind_int64(p, i, (i64)iValue);
70042 }
70043 SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
70044 int rc;
70045 Vdbe *p = (Vdbe *)pStmt;
70046 rc = vdbeUnbind(p, i);
70047 if( rc==SQLITE_OK ){
70048 sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue);
70049 sqlite3_mutex_leave(p->db->mutex);
70050 }
70051 return rc;
70052 }
70053 SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
70054 int rc;
70055 Vdbe *p = (Vdbe*)pStmt;
70056 rc = vdbeUnbind(p, i);
70057 if( rc==SQLITE_OK ){
70058 sqlite3_mutex_leave(p->db->mutex);
70059 }
70060 return rc;
70061 }
70062 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(
70063 sqlite3_stmt *pStmt,
70064 int i,
70065 const char *zData,
70066 int nData,
70067 void (*xDel)(void*)
70068 ){
70069 return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8);
70070 }
70071 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(
70072 sqlite3_stmt *pStmt,
70073 int i,
70074 const char *zData,
70075 sqlite3_uint64 nData,
70076 void (*xDel)(void*),
@@ -70060,21 +70083,21 @@
70083 if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE;
70084 return bindText(pStmt, i, zData, (int)nData, xDel, enc);
70085 }
70086 }
70087 #ifndef SQLITE_OMIT_UTF16
70088 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(
70089 sqlite3_stmt *pStmt,
70090 int i,
70091 const void *zData,
70092 int nData,
70093 void (*xDel)(void*)
70094 ){
70095 return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE);
70096 }
70097 #endif /* SQLITE_OMIT_UTF16 */
70098 SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
70099 int rc;
70100 switch( sqlite3_value_type((sqlite3_value*)pValue) ){
70101 case SQLITE_INTEGER: {
70102 rc = sqlite3_bind_int64(pStmt, i, pValue->u.i);
70103 break;
@@ -70101,11 +70124,11 @@
70124 break;
70125 }
70126 }
70127 return rc;
70128 }
70129 SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
70130 int rc;
70131 Vdbe *p = (Vdbe *)pStmt;
70132 rc = vdbeUnbind(p, i);
70133 if( rc==SQLITE_OK ){
70134 sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n);
@@ -70116,11 +70139,11 @@
70139
70140 /*
70141 ** Return the number of wildcards that can be potentially bound to.
70142 ** This routine is added to support DBD::SQLite.
70143 */
70144 SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
70145 Vdbe *p = (Vdbe*)pStmt;
70146 return p ? p->nVar : 0;
70147 }
70148
70149 /*
@@ -70127,11 +70150,11 @@
70150 ** Return the name of a wildcard parameter. Return NULL if the index
70151 ** is out of range or if the wildcard is unnamed.
70152 **
70153 ** The result is always UTF-8.
70154 */
70155 SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){
70156 Vdbe *p = (Vdbe*)pStmt;
70157 if( p==0 || i<1 || i>p->nzVar ){
70158 return 0;
70159 }
70160 return p->azVar[i-1];
@@ -70155,11 +70178,11 @@
70178 }
70179 }
70180 }
70181 return 0;
70182 }
70183 SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
70184 return sqlite3VdbeParameterIndex((Vdbe*)pStmt, zName, sqlite3Strlen30(zName));
70185 }
70186
70187 /*
70188 ** Transfer all bindings from the first statement over to the second.
@@ -70189,11 +70212,11 @@
70212 **
70213 ** If the two statements contain a different number of bindings, then
70214 ** an SQLITE_ERROR is returned. Nothing else can go wrong, so otherwise
70215 ** SQLITE_OK is returned.
70216 */
70217 SQLITE_API int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
70218 Vdbe *pFrom = (Vdbe*)pFromStmt;
70219 Vdbe *pTo = (Vdbe*)pToStmt;
70220 if( pFrom->nVar!=pTo->nVar ){
70221 return SQLITE_ERROR;
70222 }
@@ -70211,26 +70234,26 @@
70234 ** Return the sqlite3* database handle to which the prepared statement given
70235 ** in the argument belongs. This is the same database handle that was
70236 ** the first argument to the sqlite3_prepare() that was used to create
70237 ** the statement in the first place.
70238 */
70239 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt *pStmt){
70240 return pStmt ? ((Vdbe*)pStmt)->db : 0;
70241 }
70242
70243 /*
70244 ** Return true if the prepared statement is guaranteed to not modify the
70245 ** database.
70246 */
70247 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt){
70248 return pStmt ? ((Vdbe*)pStmt)->readOnly : 1;
70249 }
70250
70251 /*
70252 ** Return true if the prepared statement is in need of being reset.
70253 */
70254 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt *pStmt){
70255 Vdbe *v = (Vdbe*)pStmt;
70256 return v!=0 && v->pc>=0 && v->magic==VDBE_MAGIC_RUN;
70257 }
70258
70259 /*
@@ -70237,11 +70260,11 @@
70260 ** Return a pointer to the next prepared statement after pStmt associated
70261 ** with database connection pDb. If pStmt is NULL, return the first
70262 ** prepared statement for the database connection. Return NULL if there
70263 ** are no more.
70264 */
70265 SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){
70266 sqlite3_stmt *pNext;
70267 #ifdef SQLITE_ENABLE_API_ARMOR
70268 if( !sqlite3SafetyCheckOk(pDb) ){
70269 (void)SQLITE_MISUSE_BKPT;
70270 return 0;
@@ -70258,11 +70281,11 @@
70281 }
70282
70283 /*
70284 ** Return the value of a status counter for a prepared statement
70285 */
70286 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){
70287 Vdbe *pVdbe = (Vdbe*)pStmt;
70288 u32 v;
70289 #ifdef SQLITE_ENABLE_API_ARMOR
70290 if( !pStmt ){
70291 (void)SQLITE_MISUSE_BKPT;
@@ -70276,11 +70299,11 @@
70299
70300 #ifdef SQLITE_ENABLE_STMT_SCANSTATUS
70301 /*
70302 ** Return status data for a single loop within query pStmt.
70303 */
70304 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus(
70305 sqlite3_stmt *pStmt, /* Prepared statement being queried */
70306 int idx, /* Index of loop to report on */
70307 int iScanStatusOp, /* Which metric to return */
70308 void *pOut /* OUT: Write the answer here */
70309 ){
@@ -70335,11 +70358,11 @@
70358 }
70359
70360 /*
70361 ** Zero all counters associated with the sqlite3_stmt_scanstatus() data.
70362 */
70363 SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){
70364 Vdbe *p = (Vdbe*)pStmt;
70365 memset(p->anExec, 0, p->nOp * sizeof(i64));
70366 }
70367 #endif /* SQLITE_ENABLE_STMT_SCANSTATUS */
70368
@@ -70834,11 +70857,11 @@
70857 ** Try to convert the type of a function argument or a result column
70858 ** into a numeric representation. Use either INTEGER or REAL whichever
70859 ** is appropriate. But only do the conversion if it is possible without
70860 ** loss of information and return the revised type of the argument.
70861 */
70862 SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value *pVal){
70863 int eType = sqlite3_value_type(pVal);
70864 if( eType==SQLITE_TEXT ){
70865 Mem *pMem = (Mem*)pVal;
70866 applyNumericAffinity(pMem, 0);
70867 eType = sqlite3_value_type(pVal);
@@ -77296,11 +77319,11 @@
77319 }
77320
77321 /*
77322 ** Open a blob handle.
77323 */
77324 SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
77325 sqlite3* db, /* The database connection */
77326 const char *zDb, /* The attached database containing the blob */
77327 const char *zTable, /* The table containing the blob */
77328 const char *zColumn, /* The column containing the blob */
77329 sqlite_int64 iRow, /* The row containing the glob */
@@ -77533,11 +77556,11 @@
77556
77557 /*
77558 ** Close a blob handle that was previously created using
77559 ** sqlite3_blob_open().
77560 */
77561 SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *pBlob){
77562 Incrblob *p = (Incrblob *)pBlob;
77563 int rc;
77564 sqlite3 *db;
77565
77566 if( p ){
@@ -77602,28 +77625,28 @@
77625 }
77626
77627 /*
77628 ** Read data from a blob handle.
77629 */
77630 SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){
77631 return blobReadWrite(pBlob, z, n, iOffset, sqlite3BtreeData);
77632 }
77633
77634 /*
77635 ** Write data to a blob handle.
77636 */
77637 SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){
77638 return blobReadWrite(pBlob, (void *)z, n, iOffset, sqlite3BtreePutData);
77639 }
77640
77641 /*
77642 ** Query a blob handle for the size of the data.
77643 **
77644 ** The Incrblob.nByte field is fixed for the lifetime of the Incrblob
77645 ** so no mutex is required for access.
77646 */
77647 SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *pBlob){
77648 Incrblob *p = (Incrblob *)pBlob;
77649 return (p && p->pStmt) ? p->nByte : 0;
77650 }
77651
77652 /*
@@ -77634,11 +77657,11 @@
77657 ** contain a blob or text value, then an error code is returned and the
77658 ** database handle error code and message set. If this happens, then all
77659 ** subsequent calls to sqlite3_blob_xxx() functions (except blob_close())
77660 ** immediately return SQLITE_ABORT.
77661 */
77662 SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){
77663 int rc;
77664 Incrblob *p = (Incrblob *)pBlob;
77665 sqlite3 *db;
77666
77667 if( p==0 ) return SQLITE_MISUSE_BKPT;
@@ -90142,11 +90165,11 @@
90165 ** and attempts to write the column will be ignored.
90166 **
90167 ** Setting the auth function to NULL disables this hook. The default
90168 ** setting of the auth function is NULL.
90169 */
90170 SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
90171 sqlite3 *db,
90172 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
90173 void *pArg
90174 ){
90175 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -96720,11 +96743,11 @@
96743 }
96744
96745 /*
96746 ** The sqlite3_strglob() interface.
96747 */
96748 SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlobPattern, const char *zString){
96749 return patternCompare((u8*)zGlobPattern, (u8*)zString, &globInfo, 0)==0;
96750 }
96751
96752 /*
96753 ** Count the number of times that the LIKE operator (or GLOB which is
@@ -101215,11 +101238,11 @@
101238 ** If the SQL is a query, then for each row in the query result
101239 ** the xCallback() function is called. pArg becomes the first
101240 ** argument to xCallback(). If xCallback=NULL then no callback
101241 ** is invoked, even for queries.
101242 */
101243 SQLITE_API int SQLITE_STDCALL sqlite3_exec(
101244 sqlite3 *db, /* The database on which the SQL executes */
101245 const char *zSql, /* The SQL to be executed */
101246 sqlite3_callback xCallback, /* Invoke this callback routine */
101247 void *pArg, /* First argument to xCallback() */
101248 char **pzErrMsg /* Write error messages here */
@@ -102410,11 +102433,11 @@
102433 db->aExtension = aHandle;
102434
102435 db->aExtension[db->nExtension++] = handle;
102436 return SQLITE_OK;
102437 }
102438 SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
102439 sqlite3 *db, /* Load the extension into this database connection */
102440 const char *zFile, /* Name of the shared library containing extension */
102441 const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */
102442 char **pzErrMsg /* Put error message here if not 0 */
102443 ){
@@ -102441,11 +102464,11 @@
102464
102465 /*
102466 ** Enable or disable extension loading. Extension loading is disabled by
102467 ** default so as not to open security holes in older applications.
102468 */
102469 SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff){
102470 sqlite3_mutex_enter(db->mutex);
102471 if( onoff ){
102472 db->flags |= SQLITE_LoadExtension;
102473 }else{
102474 db->flags &= ~SQLITE_LoadExtension;
@@ -102498,11 +102521,11 @@
102521
102522 /*
102523 ** Register a statically linked extension that is automatically
102524 ** loaded by every new database connection.
102525 */
102526 SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void (*xInit)(void)){
102527 int rc = SQLITE_OK;
102528 #ifndef SQLITE_OMIT_AUTOINIT
102529 rc = sqlite3_initialize();
102530 if( rc ){
102531 return rc;
@@ -102543,11 +102566,11 @@
102566 ** routine is a no-op.
102567 **
102568 ** Return 1 if xInit was found on the list and removed. Return 0 if xInit
102569 ** was not on the list.
102570 */
102571 SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void (*xInit)(void)){
102572 #if SQLITE_THREADSAFE
102573 sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
102574 #endif
102575 int i;
102576 int n = 0;
@@ -102566,11 +102589,11 @@
102589 }
102590
102591 /*
102592 ** Reset the automatic extension loading mechanism.
102593 */
102594 SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void){
102595 #ifndef SQLITE_OMIT_AUTOINIT
102596 if( sqlite3_initialize()==SQLITE_OK )
102597 #endif
102598 {
102599 #if SQLITE_THREADSAFE
@@ -105846,11 +105869,11 @@
105869 ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
105870 ** sqlite3_step(). In the new version, the original SQL text is retained
105871 ** and the statement is automatically recompiled if an schema change
105872 ** occurs.
105873 */
105874 SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
105875 sqlite3 *db, /* Database handle. */
105876 const char *zSql, /* UTF-8 encoded SQL statement. */
105877 int nBytes, /* Length of zSql in bytes. */
105878 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
105879 const char **pzTail /* OUT: End of parsed string */
@@ -105858,11 +105881,11 @@
105881 int rc;
105882 rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,0,ppStmt,pzTail);
105883 assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
105884 return rc;
105885 }
105886 SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
105887 sqlite3 *db, /* Database handle. */
105888 const char *zSql, /* UTF-8 encoded SQL statement. */
105889 int nBytes, /* Length of zSql in bytes. */
105890 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
105891 const char **pzTail /* OUT: End of parsed string */
@@ -105934,11 +105957,11 @@
105957 ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
105958 ** sqlite3_step(). In the new version, the original SQL text is retained
105959 ** and the statement is automatically recompiled if an schema change
105960 ** occurs.
105961 */
105962 SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
105963 sqlite3 *db, /* Database handle. */
105964 const void *zSql, /* UTF-16 encoded SQL statement. */
105965 int nBytes, /* Length of zSql in bytes. */
105966 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
105967 const void **pzTail /* OUT: End of parsed string */
@@ -105946,11 +105969,11 @@
105969 int rc;
105970 rc = sqlite3Prepare16(db,zSql,nBytes,0,ppStmt,pzTail);
105971 assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
105972 return rc;
105973 }
105974 SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
105975 sqlite3 *db, /* Database handle. */
105976 const void *zSql, /* UTF-16 encoded SQL statement. */
105977 int nBytes, /* Length of zSql in bytes. */
105978 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
105979 const void **pzTail /* OUT: End of parsed string */
@@ -111682,11 +111705,11 @@
111705 ** The result that is written to ***pazResult is held in memory obtained
111706 ** from malloc(). But the caller cannot free this memory directly.
111707 ** Instead, the entire table should be passed to sqlite3_free_table() when
111708 ** the calling procedure is finished using it.
111709 */
111710 SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
111711 sqlite3 *db, /* The database on which the SQL executes */
111712 const char *zSql, /* The SQL to be executed */
111713 char ***pazResult, /* Write the result table here */
111714 int *pnRow, /* Write the number of rows in the result here */
111715 int *pnColumn, /* Write the number of columns of result here */
@@ -111751,11 +111774,11 @@
111774 }
111775
111776 /*
111777 ** This routine frees the space the sqlite3_get_table() malloced.
111778 */
111779 SQLITE_API void SQLITE_STDCALL sqlite3_free_table(
111780 char **azResult /* Result returned from sqlite3_get_table() */
111781 ){
111782 if( azResult ){
111783 int i, n;
111784 azResult--;
@@ -114111,11 +114134,11 @@
114134
114135
114136 /*
114137 ** External API function used to create a new virtual-table module.
114138 */
114139 SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
114140 sqlite3 *db, /* Database in which module is registered */
114141 const char *zName, /* Name assigned to this module */
114142 const sqlite3_module *pModule, /* The definition of the module */
114143 void *pAux /* Context pointer for xCreate/xConnect */
114144 ){
@@ -114126,11 +114149,11 @@
114149 }
114150
114151 /*
114152 ** External API function used to create a new virtual-table module.
114153 */
114154 SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
114155 sqlite3 *db, /* Database in which module is registered */
114156 const char *zName, /* Name assigned to this module */
114157 const sqlite3_module *pModule, /* The definition of the module */
114158 void *pAux, /* Context pointer for xCreate/xConnect */
114159 void (*xDestroy)(void *) /* Module destructor function */
@@ -114741,11 +114764,11 @@
114764 /*
114765 ** This function is used to set the schema of a virtual table. It is only
114766 ** valid to call this function from within the xCreate() or xConnect() of a
114767 ** virtual table module.
114768 */
114769 SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
114770 Parse *pParse;
114771
114772 int rc = SQLITE_OK;
114773 Table *pTab;
114774 char *zErr = 0;
@@ -115109,11 +115132,11 @@
115132 ** table update operation currently in progress.
115133 **
115134 ** The results of this routine are undefined unless it is called from
115135 ** within an xUpdate method.
115136 */
115137 SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *db){
115138 static const unsigned char aMap[] = {
115139 SQLITE_ROLLBACK, SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_REPLACE
115140 };
115141 #ifdef SQLITE_ENABLE_API_ARMOR
115142 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -115127,11 +115150,11 @@
115150 /*
115151 ** Call from within the xCreate() or xConnect() methods to provide
115152 ** the SQLite core with additional information about the behavior
115153 ** of the virtual table being implemented.
115154 */
115155 SQLITE_API int SQLITE_CDECL sqlite3_vtab_config(sqlite3 *db, int op, ...){
115156 va_list ap;
115157 int rc = SQLITE_OK;
115158
115159 #ifdef SQLITE_ENABLE_API_ARMOR
115160 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -127161,11 +127184,11 @@
127184 **
127185 ** If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed
127186 ** to recognize the end of a trigger can be omitted. All we have to do
127187 ** is look for a semicolon that is not part of an string or comment.
127188 */
127189 SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *zSql){
127190 u8 state = 0; /* Current state, using numbers defined in header comment */
127191 u8 token; /* Value of the next token */
127192
127193 #ifndef SQLITE_OMIT_TRIGGER
127194 /* A complex statement machine used to detect the end of a CREATE TRIGGER
@@ -127326,11 +127349,11 @@
127349 /*
127350 ** This routine is the same as the sqlite3_complete() routine described
127351 ** above, except that the parameter is required to be UTF-16 encoded, not
127352 ** UTF-8.
127353 */
127354 SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *zSql){
127355 sqlite3_value *pVal;
127356 char const *zSql8;
127357 int rc = SQLITE_NOMEM;
127358
127359 #ifndef SQLITE_OMIT_AUTOINIT
@@ -127476,37 +127499,37 @@
127499 #endif
127500
127501 /* IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns
127502 ** a pointer to the to the sqlite3_version[] string constant.
127503 */
127504 SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void){ return sqlite3_version; }
127505
127506 /* IMPLEMENTATION-OF: R-63124-39300 The sqlite3_sourceid() function returns a
127507 ** pointer to a string constant whose value is the same as the
127508 ** SQLITE_SOURCE_ID C preprocessor macro.
127509 */
127510 SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
127511
127512 /* IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function
127513 ** returns an integer equal to SQLITE_VERSION_NUMBER.
127514 */
127515 SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; }
127516
127517 /* IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns
127518 ** zero if and only if SQLite was compiled with mutexing code omitted due to
127519 ** the SQLITE_THREADSAFE compile-time option being set to 0.
127520 */
127521 SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; }
127522
127523 #if !defined(SQLITE_OMIT_TRACE) && defined(SQLITE_ENABLE_IOTRACE)
127524 /*
127525 ** If the following function pointer is not NULL and if
127526 ** SQLITE_ENABLE_IOTRACE is enabled, then messages describing
127527 ** I/O active are written using this function. These messages
127528 ** are intended for debugging activity only.
127529 */
127530 SQLITE_API void (SQLITE_CDECL *sqlite3IoTrace)(const char*, ...) = 0;
127531 #endif
127532
127533 /*
127534 ** If the following global variable points to a string which is the
127535 ** name of a directory, then that directory will be used to store
@@ -127554,11 +127577,11 @@
127577 ** call by X completes.
127578 **
127579 ** * Recursive calls to this routine from thread X return immediately
127580 ** without blocking.
127581 */
127582 SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void){
127583 MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */
127584 int rc; /* Result code */
127585 #ifdef SQLITE_EXTRA_INIT
127586 int bRunExtraInit = 0; /* Extra initialization needed */
127587 #endif
@@ -127715,11 +127738,11 @@
127738 ** while any part of SQLite is otherwise in use in any thread. This
127739 ** routine is not threadsafe. But it is safe to invoke this routine
127740 ** on when SQLite is already shut down. If SQLite is already shut down
127741 ** when this routine is invoked, then this routine is a harmless no-op.
127742 */
127743 SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void){
127744 #ifdef SQLITE_OMIT_WSD
127745 int rc = sqlite3_wsd_init(4096, 24);
127746 if( rc!=SQLITE_OK ){
127747 return rc;
127748 }
@@ -127769,11 +127792,11 @@
127792 ** This routine should only be called when there are no outstanding
127793 ** database connections or memory allocations. This routine is not
127794 ** threadsafe. Failure to heed these warnings can lead to unpredictable
127795 ** behavior.
127796 */
127797 SQLITE_API int SQLITE_CDECL sqlite3_config(int op, ...){
127798 va_list ap;
127799 int rc = SQLITE_OK;
127800
127801 /* sqlite3_config() shall return SQLITE_MISUSE if it is invoked while
127802 ** the SQLite library is in use. */
@@ -128126,11 +128149,11 @@
128149 }
128150
128151 /*
128152 ** Return the mutex associated with a database connection.
128153 */
128154 SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3 *db){
128155 #ifdef SQLITE_ENABLE_API_ARMOR
128156 if( !sqlite3SafetyCheckOk(db) ){
128157 (void)SQLITE_MISUSE_BKPT;
128158 return 0;
128159 }
@@ -128140,11 +128163,11 @@
128163
128164 /*
128165 ** Free up as much memory as we can from the given database
128166 ** connection.
128167 */
128168 SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3 *db){
128169 int i;
128170
128171 #ifdef SQLITE_ENABLE_API_ARMOR
128172 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
128173 #endif
@@ -128163,11 +128186,11 @@
128186 }
128187
128188 /*
128189 ** Configuration settings for an individual database connection
128190 */
128191 SQLITE_API int SQLITE_CDECL sqlite3_db_config(sqlite3 *db, int op, ...){
128192 va_list ap;
128193 int rc;
128194 va_start(ap, op);
128195 switch( op ){
128196 case SQLITE_DBCONFIG_LOOKASIDE: {
@@ -128282,11 +128305,11 @@
128305 }
128306
128307 /*
128308 ** Return the ROWID of the most recent insert
128309 */
128310 SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3 *db){
128311 #ifdef SQLITE_ENABLE_API_ARMOR
128312 if( !sqlite3SafetyCheckOk(db) ){
128313 (void)SQLITE_MISUSE_BKPT;
128314 return 0;
128315 }
@@ -128295,11 +128318,11 @@
128318 }
128319
128320 /*
128321 ** Return the number of changes in the most recent call to sqlite3_exec().
128322 */
128323 SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3 *db){
128324 #ifdef SQLITE_ENABLE_API_ARMOR
128325 if( !sqlite3SafetyCheckOk(db) ){
128326 (void)SQLITE_MISUSE_BKPT;
128327 return 0;
128328 }
@@ -128308,11 +128331,11 @@
128331 }
128332
128333 /*
128334 ** Return the number of changes since the database handle was opened.
128335 */
128336 SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3 *db){
128337 #ifdef SQLITE_ENABLE_API_ARMOR
128338 if( !sqlite3SafetyCheckOk(db) ){
128339 (void)SQLITE_MISUSE_BKPT;
128340 return 0;
128341 }
@@ -128450,12 +128473,12 @@
128473 ** statements or unfinished sqlite3_backups. The sqlite3_close_v2()
128474 ** version forces the connection to become a zombie if there are
128475 ** unclosed resources, and arranges for deallocation when the last
128476 ** prepare statement or sqlite3_backup closes.
128477 */
128478 SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3 *db){ return sqlite3Close(db,0); }
128479 SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3 *db){ return sqlite3Close(db,1); }
128480
128481
128482 /*
128483 ** Close the mutex on database connection db.
128484 **
@@ -128858,11 +128881,11 @@
128881
128882 /*
128883 ** This routine sets the busy callback for an Sqlite database to the
128884 ** given callback function with the given argument.
128885 */
128886 SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(
128887 sqlite3 *db,
128888 int (*xBusy)(void*,int),
128889 void *pArg
128890 ){
128891 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -128881,11 +128904,11 @@
128904 /*
128905 ** This routine sets the progress callback for an Sqlite database to the
128906 ** given callback function with the given argument. The progress callback will
128907 ** be invoked every nOps opcodes.
128908 */
128909 SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(
128910 sqlite3 *db,
128911 int nOps,
128912 int (*xProgress)(void*),
128913 void *pArg
128914 ){
@@ -128912,11 +128935,11 @@
128935
128936 /*
128937 ** This routine installs a default busy handler that waits for the
128938 ** specified number of milliseconds before returning 0.
128939 */
128940 SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3 *db, int ms){
128941 #ifdef SQLITE_ENABLE_API_ARMOR
128942 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
128943 #endif
128944 if( ms>0 ){
128945 sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db);
@@ -128928,11 +128951,11 @@
128951 }
128952
128953 /*
128954 ** Cause any pending operation to stop at its earliest opportunity.
128955 */
128956 SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3 *db){
128957 #ifdef SQLITE_ENABLE_API_ARMOR
128958 if( !sqlite3SafetyCheckOk(db) ){
128959 (void)SQLITE_MISUSE_BKPT;
128960 return;
128961 }
@@ -129045,11 +129068,11 @@
129068 }
129069
129070 /*
129071 ** Create new user functions.
129072 */
129073 SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
129074 sqlite3 *db,
129075 const char *zFunc,
129076 int nArg,
129077 int enc,
129078 void *p,
@@ -129059,11 +129082,11 @@
129082 ){
129083 return sqlite3_create_function_v2(db, zFunc, nArg, enc, p, xFunc, xStep,
129084 xFinal, 0);
129085 }
129086
129087 SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
129088 sqlite3 *db,
129089 const char *zFunc,
129090 int nArg,
129091 int enc,
129092 void *p,
@@ -129102,11 +129125,11 @@
129125 sqlite3_mutex_leave(db->mutex);
129126 return rc;
129127 }
129128
129129 #ifndef SQLITE_OMIT_UTF16
129130 SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
129131 sqlite3 *db,
129132 const void *zFunctionName,
129133 int nArg,
129134 int eTextRep,
129135 void *p,
@@ -129142,11 +129165,11 @@
129165 ** When virtual tables intend to provide an overloaded function, they
129166 ** should call this routine to make sure the global function exists.
129167 ** A global function must exist in order for name resolution to work
129168 ** properly.
129169 */
129170 SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(
129171 sqlite3 *db,
129172 const char *zName,
129173 int nArg
129174 ){
129175 int nName = sqlite3Strlen30(zName);
@@ -129174,11 +129197,11 @@
129197 **
129198 ** A NULL trace function means that no tracing is executes. A non-NULL
129199 ** trace is a pointer to a function that is invoked at the start of each
129200 ** SQL statement.
129201 */
129202 SQLITE_API void *SQLITE_STDCALL sqlite3_trace(sqlite3 *db, void (*xTrace)(void*,const char*), void *pArg){
129203 void *pOld;
129204
129205 #ifdef SQLITE_ENABLE_API_ARMOR
129206 if( !sqlite3SafetyCheckOk(db) ){
129207 (void)SQLITE_MISUSE_BKPT;
@@ -129198,11 +129221,11 @@
129221 **
129222 ** A NULL profile function means that no profiling is executes. A non-NULL
129223 ** profile is a pointer to a function that is invoked at the conclusion of
129224 ** each SQL statement that is run.
129225 */
129226 SQLITE_API void *SQLITE_STDCALL sqlite3_profile(
129227 sqlite3 *db,
129228 void (*xProfile)(void*,const char*,sqlite_uint64),
129229 void *pArg
129230 ){
129231 void *pOld;
@@ -129225,11 +129248,11 @@
129248 /*
129249 ** Register a function to be invoked when a transaction commits.
129250 ** If the invoked function returns non-zero, then the commit becomes a
129251 ** rollback.
129252 */
129253 SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(
129254 sqlite3 *db, /* Attach the hook to this database */
129255 int (*xCallback)(void*), /* Function to invoke on each commit */
129256 void *pArg /* Argument to the function */
129257 ){
129258 void *pOld;
@@ -129250,11 +129273,11 @@
129273
129274 /*
129275 ** Register a callback to be invoked each time a row is updated,
129276 ** inserted or deleted using this database connection.
129277 */
129278 SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
129279 sqlite3 *db, /* Attach the hook to this database */
129280 void (*xCallback)(void*,int,char const *,char const *,sqlite_int64),
129281 void *pArg /* Argument to the function */
129282 ){
129283 void *pRet;
@@ -129275,11 +129298,11 @@
129298
129299 /*
129300 ** Register a callback to be invoked each time a transaction is rolled
129301 ** back by this database connection.
129302 */
129303 SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(
129304 sqlite3 *db, /* Attach the hook to this database */
129305 void (*xCallback)(void*), /* Callback function */
129306 void *pArg /* Argument to the function */
129307 ){
129308 void *pRet;
@@ -129329,11 +129352,11 @@
129352 ** The callback registered by this function replaces any existing callback
129353 ** registered using sqlite3_wal_hook(). Likewise, registering a callback
129354 ** using sqlite3_wal_hook() disables the automatic checkpoint mechanism
129355 ** configured by this function.
129356 */
129357 SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){
129358 #ifdef SQLITE_OMIT_WAL
129359 UNUSED_PARAMETER(db);
129360 UNUSED_PARAMETER(nFrame);
129361 #else
129362 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -129350,11 +129373,11 @@
129373
129374 /*
129375 ** Register a callback to be invoked each time a transaction is written
129376 ** into the write-ahead-log by this database connection.
129377 */
129378 SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
129379 sqlite3 *db, /* Attach the hook to this db handle */
129380 int(*xCallback)(void *, sqlite3*, const char*, int),
129381 void *pArg /* First argument passed to xCallback() */
129382 ){
129383 #ifndef SQLITE_OMIT_WAL
@@ -129377,11 +129400,11 @@
129400 }
129401
129402 /*
129403 ** Checkpoint database zDb.
129404 */
129405 SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
129406 sqlite3 *db, /* Database handle */
129407 const char *zDb, /* Name of attached database (or NULL) */
129408 int eMode, /* SQLITE_CHECKPOINT_* value */
129409 int *pnLog, /* OUT: Size of WAL log in frames */
129410 int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -129432,11 +129455,11 @@
129455 /*
129456 ** Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points
129457 ** to contains a zero-length string, all attached databases are
129458 ** checkpointed.
129459 */
129460 SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){
129461 /* EVIDENCE-OF: R-41613-20553 The sqlite3_wal_checkpoint(D,X) is equivalent to
129462 ** sqlite3_wal_checkpoint_v2(D,X,SQLITE_CHECKPOINT_PASSIVE,0,0). */
129463 return sqlite3_wal_checkpoint_v2(db,zDb,SQLITE_CHECKPOINT_PASSIVE,0,0);
129464 }
129465
@@ -129521,11 +129544,11 @@
129544
129545 /*
129546 ** Return UTF-8 encoded English language explanation of the most recent
129547 ** error.
129548 */
129549 SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3 *db){
129550 const char *z;
129551 if( !db ){
129552 return sqlite3ErrStr(SQLITE_NOMEM);
129553 }
129554 if( !sqlite3SafetyCheckSickOrOk(db) ){
@@ -129549,11 +129572,11 @@
129572 #ifndef SQLITE_OMIT_UTF16
129573 /*
129574 ** Return UTF-16 encoded English language explanation of the most recent
129575 ** error.
129576 */
129577 SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3 *db){
129578 static const u16 outOfMem[] = {
129579 'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0
129580 };
129581 static const u16 misuse[] = {
129582 'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ',
@@ -129594,20 +129617,20 @@
129617
129618 /*
129619 ** Return the most recent error code generated by an SQLite routine. If NULL is
129620 ** passed to this function, we assume a malloc() failed during sqlite3_open().
129621 */
129622 SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db){
129623 if( db && !sqlite3SafetyCheckSickOrOk(db) ){
129624 return SQLITE_MISUSE_BKPT;
129625 }
129626 if( !db || db->mallocFailed ){
129627 return SQLITE_NOMEM;
129628 }
129629 return db->errCode & db->errMask;
129630 }
129631 SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db){
129632 if( db && !sqlite3SafetyCheckSickOrOk(db) ){
129633 return SQLITE_MISUSE_BKPT;
129634 }
129635 if( !db || db->mallocFailed ){
129636 return SQLITE_NOMEM;
@@ -129618,11 +129641,11 @@
129641 /*
129642 ** Return a string that describes the kind of error specified in the
129643 ** argument. For now, this simply calls the internal sqlite3ErrStr()
129644 ** function.
129645 */
129646 SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int rc){
129647 return sqlite3ErrStr(rc);
129648 }
129649
129650 /*
129651 ** Create a new collating function for database "db". The name is zName
@@ -129766,11 +129789,11 @@
129789 **
129790 ** A new lower limit does not shrink existing constructs.
129791 ** It merely prevents new constructs that exceed the limit
129792 ** from forming.
129793 */
129794 SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3 *db, int limitId, int newLimit){
129795 int oldLimit;
129796
129797 #ifdef SQLITE_ENABLE_API_ARMOR
129798 if( !sqlite3SafetyCheckOk(db) ){
129799 (void)SQLITE_MISUSE_BKPT;
@@ -130351,18 +130374,18 @@
130374 }
130375
130376 /*
130377 ** Open a new database handle.
130378 */
130379 SQLITE_API int SQLITE_STDCALL sqlite3_open(
130380 const char *zFilename,
130381 sqlite3 **ppDb
130382 ){
130383 return openDatabase(zFilename, ppDb,
130384 SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0);
130385 }
130386 SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
130387 const char *filename, /* Database filename (UTF-8) */
130388 sqlite3 **ppDb, /* OUT: SQLite db handle */
130389 int flags, /* Flags */
130390 const char *zVfs /* Name of VFS module to use */
130391 ){
@@ -130371,11 +130394,11 @@
130394
130395 #ifndef SQLITE_OMIT_UTF16
130396 /*
130397 ** Open a new database handle.
130398 */
130399 SQLITE_API int SQLITE_STDCALL sqlite3_open16(
130400 const void *zFilename,
130401 sqlite3 **ppDb
130402 ){
130403 char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */
130404 sqlite3_value *pVal;
@@ -130410,11 +130433,11 @@
130433 #endif /* SQLITE_OMIT_UTF16 */
130434
130435 /*
130436 ** Register a new collation sequence with the database handle db.
130437 */
130438 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
130439 sqlite3* db,
130440 const char *zName,
130441 int enc,
130442 void* pCtx,
130443 int(*xCompare)(void*,int,const void*,int,const void*)
@@ -130423,11 +130446,11 @@
130446 }
130447
130448 /*
130449 ** Register a new collation sequence with the database handle db.
130450 */
130451 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
130452 sqlite3* db,
130453 const char *zName,
130454 int enc,
130455 void* pCtx,
130456 int(*xCompare)(void*,int,const void*,int,const void*),
@@ -130448,11 +130471,11 @@
130471
130472 #ifndef SQLITE_OMIT_UTF16
130473 /*
130474 ** Register a new collation sequence with the database handle db.
130475 */
130476 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
130477 sqlite3* db,
130478 const void *zName,
130479 int enc,
130480 void* pCtx,
130481 int(*xCompare)(void*,int,const void*,int,const void*)
@@ -130478,11 +130501,11 @@
130501
130502 /*
130503 ** Register a collation sequence factory callback with the database handle
130504 ** db. Replace any previously installed collation sequence factory.
130505 */
130506 SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
130507 sqlite3 *db,
130508 void *pCollNeededArg,
130509 void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*)
130510 ){
130511 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -130499,11 +130522,11 @@
130522 #ifndef SQLITE_OMIT_UTF16
130523 /*
130524 ** Register a collation sequence factory callback with the database handle
130525 ** db. Replace any previously installed collation sequence factory.
130526 */
130527 SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
130528 sqlite3 *db,
130529 void *pCollNeededArg,
130530 void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*)
130531 ){
130532 #ifdef SQLITE_ENABLE_API_ARMOR
@@ -130521,11 +130544,11 @@
130544 #ifndef SQLITE_OMIT_DEPRECATED
130545 /*
130546 ** This function is now an anachronism. It used to be used to recover from a
130547 ** malloc() failure, but SQLite now does this automatically.
130548 */
130549 SQLITE_API int SQLITE_STDCALL sqlite3_global_recover(void){
130550 return SQLITE_OK;
130551 }
130552 #endif
130553
130554 /*
@@ -130532,11 +130555,11 @@
130555 ** Test to see whether or not the database connection is in autocommit
130556 ** mode. Return TRUE if it is and FALSE if not. Autocommit mode is on
130557 ** by default. Autocommit is disabled by a BEGIN statement and reenabled
130558 ** by the next COMMIT or ROLLBACK.
130559 */
130560 SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3 *db){
130561 #ifdef SQLITE_ENABLE_API_ARMOR
130562 if( !sqlite3SafetyCheckOk(db) ){
130563 (void)SQLITE_MISUSE_BKPT;
130564 return 0;
130565 }
@@ -130584,19 +130607,19 @@
130607 ** data for this thread has been deallocated.
130608 **
130609 ** SQLite no longer uses thread-specific data so this routine is now a
130610 ** no-op. It is retained for historical compatibility.
130611 */
130612 SQLITE_API void SQLITE_STDCALL sqlite3_thread_cleanup(void){
130613 }
130614 #endif
130615
130616 /*
130617 ** Return meta information about a specific column of a database table.
130618 ** See comment in sqlite3.h (sqlite.h.in) for details.
130619 */
130620 SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
130621 sqlite3 *db, /* Connection handle */
130622 const char *zDbName, /* Database name or NULL */
130623 const char *zTableName, /* Table name */
130624 const char *zColumnName, /* Column name */
130625 char const **pzDataType, /* OUTPUT: Declared data type */
@@ -130710,11 +130733,11 @@
130733 }
130734
130735 /*
130736 ** Sleep for a little while. Return the amount of time slept.
130737 */
130738 SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int ms){
130739 sqlite3_vfs *pVfs;
130740 int rc;
130741 pVfs = sqlite3_vfs_find(0);
130742 if( pVfs==0 ) return 0;
130743
@@ -130726,11 +130749,11 @@
130749 }
130750
130751 /*
130752 ** Enable or disable the extended result codes.
130753 */
130754 SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3 *db, int onoff){
130755 #ifdef SQLITE_ENABLE_API_ARMOR
130756 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
130757 #endif
130758 sqlite3_mutex_enter(db->mutex);
130759 db->errMask = onoff ? 0xffffffff : 0xff;
@@ -130739,11 +130762,11 @@
130762 }
130763
130764 /*
130765 ** Invoke the xFileControl method on a particular database.
130766 */
130767 SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
130768 int rc = SQLITE_ERROR;
130769 Btree *pBtree;
130770
130771 #ifdef SQLITE_ENABLE_API_ARMOR
130772 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -130773,11 +130796,11 @@
130796 }
130797
130798 /*
130799 ** Interface to the testing logic.
130800 */
130801 SQLITE_API int SQLITE_CDECL sqlite3_test_control(int op, ...){
130802 int rc = 0;
130803 #ifndef SQLITE_OMIT_BUILTIN_TEST
130804 va_list ap;
130805 va_start(ap, op);
130806 switch( op ){
@@ -131116,11 +131139,11 @@
131139 ** method of a VFS implementation. The zParam argument is the name of the
131140 ** query parameter we seek. This routine returns the value of the zParam
131141 ** parameter if it exists. If the parameter does not exist, this routine
131142 ** returns a NULL pointer.
131143 */
131144 SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam){
131145 if( zFilename==0 || zParam==0 ) return 0;
131146 zFilename += sqlite3Strlen30(zFilename) + 1;
131147 while( zFilename[0] ){
131148 int x = strcmp(zFilename, zParam);
131149 zFilename += sqlite3Strlen30(zFilename) + 1;
@@ -131131,20 +131154,20 @@
131154 }
131155
131156 /*
131157 ** Return a boolean value for a query parameter.
131158 */
131159 SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){
131160 const char *z = sqlite3_uri_parameter(zFilename, zParam);
131161 bDflt = bDflt!=0;
131162 return z ? sqlite3GetBoolean(z, bDflt) : bDflt;
131163 }
131164
131165 /*
131166 ** Return a 64-bit integer value for a query parameter.
131167 */
131168 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(
131169 const char *zFilename, /* Filename as passed to xOpen */
131170 const char *zParam, /* URI parameter sought */
131171 sqlite3_int64 bDflt /* return if parameter is missing */
131172 ){
131173 const char *z = sqlite3_uri_parameter(zFilename, zParam);
@@ -131172,11 +131195,11 @@
131195
131196 /*
131197 ** Return the filename of the database associated with a database
131198 ** connection.
131199 */
131200 SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName){
131201 Btree *pBt;
131202 #ifdef SQLITE_ENABLE_API_ARMOR
131203 if( !sqlite3SafetyCheckOk(db) ){
131204 (void)SQLITE_MISUSE_BKPT;
131205 return 0;
@@ -131188,11 +131211,11 @@
131211
131212 /*
131213 ** Return 1 if database is read-only or 0 if read/write. Return -1 if
131214 ** no such database exists.
131215 */
131216 SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName){
131217 Btree *pBt;
131218 #ifdef SQLITE_ENABLE_API_ARMOR
131219 if( !sqlite3SafetyCheckOk(db) ){
131220 (void)SQLITE_MISUSE_BKPT;
131221 return -1;
@@ -131347,11 +131370,11 @@
131370 **
131371 ** Each call to this routine overrides any prior callbacks registered
131372 ** on the same "db". If xNotify==0 then any prior callbacks are immediately
131373 ** cancelled.
131374 */
131375 SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
131376 sqlite3 *db,
131377 void (*xNotify)(void **, int),
131378 void *pArg
131379 ){
131380 int rc = SQLITE_OK;
@@ -133525,11 +133548,11 @@
133548 int nName; /* Bytes required to hold table name */
133549 int isFts4 = (argv[0][3]=='4'); /* True for FTS4, false for FTS3 */
133550 const char **aCol; /* Array of column names */
133551 sqlite3_tokenizer *pTokenizer = 0; /* Tokenizer for this table */
133552
133553 int nIndex = 0; /* Size of aIndex[] array */
133554 struct Fts3Index *aIndex = 0; /* Array of indexes for this table */
133555
133556 /* The results of parsing supported FTS4 key=value options: */
133557 int bNoDocsize = 0; /* True to omit %_docsize table */
133558 int bDescIdx = 0; /* True to store descending indexes */
@@ -138213,11 +138236,11 @@
138236 ** Initialize API pointer table, if required.
138237 */
138238 #ifdef _WIN32
138239 __declspec(dllexport)
138240 #endif
138241 SQLITE_API int SQLITE_STDCALL sqlite3_fts3_init(
138242 sqlite3 *db,
138243 char **pzErrMsg,
138244 const sqlite3_api_routines *pApi
138245 ){
138246 SQLITE_EXTENSION_INIT2(pApi)
@@ -153660,11 +153683,11 @@
153683 }
153684
153685 /*
153686 ** Register a new geometry function for use with the r-tree MATCH operator.
153687 */
153688 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
153689 sqlite3 *db, /* Register SQL function on this connection */
153690 const char *zGeom, /* Name of the new SQL function */
153691 int (*xGeom)(sqlite3_rtree_geometry*,int,RtreeDValue*,int*), /* Callback */
153692 void *pContext /* Extra data associated with the callback */
153693 ){
@@ -153684,11 +153707,11 @@
153707
153708 /*
153709 ** Register a new 2nd-generation geometry function for use with the
153710 ** r-tree MATCH operator.
153711 */
153712 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
153713 sqlite3 *db, /* Register SQL function on this connection */
153714 const char *zQueryFunc, /* Name of new SQL function */
153715 int (*xQueryFunc)(sqlite3_rtree_query_info*), /* Callback */
153716 void *pContext, /* Extra data passed into the callback */
153717 void (*xDestructor)(void*) /* Destructor for the extra data */
@@ -153709,11 +153732,11 @@
153732
153733 #if !SQLITE_CORE
153734 #ifdef _WIN32
153735 __declspec(dllexport)
153736 #endif
153737 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_init(
153738 sqlite3 *db,
153739 char **pzErrMsg,
153740 const sqlite3_api_routines *pApi
153741 ){
153742 SQLITE_EXTENSION_INIT2(pApi)
@@ -154214,11 +154237,11 @@
154237
154238 #if !SQLITE_CORE
154239 #ifdef _WIN32
154240 __declspec(dllexport)
154241 #endif
154242 SQLITE_API int SQLITE_STDCALL sqlite3_icu_init(
154243 sqlite3 *db,
154244 char **pzErrMsg,
154245 const sqlite3_api_routines *pApi
154246 ){
154247 SQLITE_EXTENSION_INIT2(pApi)
154248
+229 -232
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -41,27 +41,24 @@
4141
extern "C" {
4242
#endif
4343
4444
4545
/*
46
-** Add the ability to override 'extern'
46
+** Provide the ability to override linkage features of the interface.
4747
*/
4848
#ifndef SQLITE_EXTERN
4949
# define SQLITE_EXTERN extern
5050
#endif
51
-
5251
#ifndef SQLITE_API
5352
# define SQLITE_API
5453
#endif
55
-
56
-
57
-/*
58
-** Add the ability to override 'cdecl'
59
-*/
6054
#ifndef SQLITE_CDECL
6155
# define SQLITE_CDECL
6256
#endif
57
+#ifndef SQLITE_STDCALL
58
+# define SQLITE_STDCALL
59
+#endif
6360
6461
/*
6562
** These no-op macros are used in front of interfaces to mark those
6663
** interfaces as either deprecated or experimental. New applications
6764
** should not use deprecated interfaces - they are supported for backwards
@@ -114,11 +111,11 @@
114111
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
115112
** [sqlite_version()] and [sqlite_source_id()].
116113
*/
117114
#define SQLITE_VERSION "3.8.9"
118115
#define SQLITE_VERSION_NUMBER 3008009
119
-#define SQLITE_SOURCE_ID "2015-03-24 18:19:39 436314b5728c9413f9ac2d837e1c19364f31be72"
116
+#define SQLITE_SOURCE_ID "2015-03-30 23:43:56 395bb3e677a6551b06ba96fc58c393132b93d1e8"
120117
121118
/*
122119
** CAPI3REF: Run-Time Library Version Numbers
123120
** KEYWORDS: sqlite3_version, sqlite3_sourceid
124121
**
@@ -147,13 +144,13 @@
147144
** [SQLITE_SOURCE_ID] C preprocessor macro.
148145
**
149146
** See also: [sqlite_version()] and [sqlite_source_id()].
150147
*/
151148
SQLITE_API SQLITE_EXTERN const char sqlite3_version[];
152
-SQLITE_API const char *sqlite3_libversion(void);
153
-SQLITE_API const char *sqlite3_sourceid(void);
154
-SQLITE_API int sqlite3_libversion_number(void);
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);
155152
156153
/*
157154
** CAPI3REF: Run-Time Library Compilation Options Diagnostics
158155
**
159156
** ^The sqlite3_compileoption_used() function returns 0 or 1
@@ -174,12 +171,12 @@
174171
**
175172
** See also: SQL functions [sqlite_compileoption_used()] and
176173
** [sqlite_compileoption_get()] and the [compile_options pragma].
177174
*/
178175
#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
179
-SQLITE_API int sqlite3_compileoption_used(const char *zOptName);
180
-SQLITE_API const char *sqlite3_compileoption_get(int N);
176
+SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName);
177
+SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N);
181178
#endif
182179
183180
/*
184181
** CAPI3REF: Test To See If The Library Is Threadsafe
185182
**
@@ -214,11 +211,11 @@
214211
** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
215212
** is unchanged by calls to sqlite3_config().)^
216213
**
217214
** See the [threading mode] documentation for additional information.
218215
*/
219
-SQLITE_API int sqlite3_threadsafe(void);
216
+SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void);
220217
221218
/*
222219
** CAPI3REF: Database Connection Handle
223220
** KEYWORDS: {database connection} {database connections}
224221
**
@@ -310,12 +307,12 @@
310307
** from [sqlite3_open()], [sqlite3_open16()], or
311308
** [sqlite3_open_v2()], and not previously closed.
312309
** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
313310
** argument is a harmless no-op.
314311
*/
315
-SQLITE_API int sqlite3_close(sqlite3*);
316
-SQLITE_API int sqlite3_close_v2(sqlite3*);
312
+SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3*);
313
+SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3*);
317314
318315
/*
319316
** The type for a callback function.
320317
** This is legacy and deprecated. It is included for historical
321318
** compatibility and is not documented.
@@ -381,11 +378,11 @@
381378
** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
382379
** <li> The application must not modify the SQL statement text passed into
383380
** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
384381
** </ul>
385382
*/
386
-SQLITE_API int sqlite3_exec(
383
+SQLITE_API int SQLITE_STDCALL sqlite3_exec(
387384
sqlite3*, /* An open database */
388385
const char *sql, /* SQL to be evaluated */
389386
int (*callback)(void*,int,char**,char**), /* Callback function */
390387
void *, /* 1st argument to callback */
391388
char **errmsg /* Error msg written here */
@@ -1341,14 +1338,14 @@
13411338
** sqlite3_os_init() and sqlite3_os_end(). An application-supplied
13421339
** implementation of sqlite3_os_init() or sqlite3_os_end()
13431340
** must return [SQLITE_OK] on success and some other [error code] upon
13441341
** failure.
13451342
*/
1346
-SQLITE_API int sqlite3_initialize(void);
1347
-SQLITE_API int sqlite3_shutdown(void);
1348
-SQLITE_API int sqlite3_os_init(void);
1349
-SQLITE_API int sqlite3_os_end(void);
1343
+SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void);
1344
+SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void);
1345
+SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void);
1346
+SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void);
13501347
13511348
/*
13521349
** CAPI3REF: Configuring The SQLite Library
13531350
**
13541351
** The sqlite3_config() interface is used to make global configuration
@@ -1375,11 +1372,11 @@
13751372
**
13761373
** ^When a configuration option is set, sqlite3_config() returns [SQLITE_OK].
13771374
** ^If the option is unknown or SQLite is unable to set the option
13781375
** then this routine returns a non-zero [error code].
13791376
*/
1380
-SQLITE_API int sqlite3_config(int, ...);
1377
+SQLITE_API int SQLITE_CDECL sqlite3_config(int, ...);
13811378
13821379
/*
13831380
** CAPI3REF: Configure database connections
13841381
**
13851382
** The sqlite3_db_config() interface is used to make configuration
@@ -1393,11 +1390,11 @@
13931390
** Subsequent arguments vary depending on the configuration verb.
13941391
**
13951392
** ^Calls to sqlite3_db_config() return SQLITE_OK if and only if
13961393
** the call is considered successful.
13971394
*/
1398
-SQLITE_API int sqlite3_db_config(sqlite3*, int op, ...);
1395
+SQLITE_API int SQLITE_CDECL sqlite3_db_config(sqlite3*, int op, ...);
13991396
14001397
/*
14011398
** CAPI3REF: Memory Allocation Routines
14021399
**
14031400
** An instance of this object defines the interface between SQLite
@@ -1881,11 +1878,11 @@
18811878
**
18821879
** ^The sqlite3_extended_result_codes() routine enables or disables the
18831880
** [extended result codes] feature of SQLite. ^The extended result
18841881
** codes are disabled by default for historical compatibility.
18851882
*/
1886
-SQLITE_API int sqlite3_extended_result_codes(sqlite3*, int onoff);
1883
+SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3*, int onoff);
18871884
18881885
/*
18891886
** CAPI3REF: Last Insert Rowid
18901887
**
18911888
** ^Each entry in most SQLite tables (except for [WITHOUT ROWID] tables)
@@ -1932,11 +1929,11 @@
19321929
** function is running and thus changes the last insert [rowid],
19331930
** then the value returned by [sqlite3_last_insert_rowid()] is
19341931
** unpredictable and might not equal either the old or the new
19351932
** last insert [rowid].
19361933
*/
1937
-SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*);
1934
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3*);
19381935
19391936
/*
19401937
** CAPI3REF: Count The Number Of Rows Modified
19411938
**
19421939
** ^This function returns the number of rows modified, inserted or
@@ -1984,11 +1981,11 @@
19841981
**
19851982
** If a separate thread makes changes on the same database connection
19861983
** while [sqlite3_changes()] is running then the value returned
19871984
** is unpredictable and not meaningful.
19881985
*/
1989
-SQLITE_API int sqlite3_changes(sqlite3*);
1986
+SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3*);
19901987
19911988
/*
19921989
** CAPI3REF: Total Number Of Rows Modified
19931990
**
19941991
** ^This function returns the total number of rows inserted, modified or
@@ -2007,11 +2004,11 @@
20072004
**
20082005
** If a separate thread makes changes on the same database connection
20092006
** while [sqlite3_total_changes()] is running then the value
20102007
** returned is unpredictable and not meaningful.
20112008
*/
2012
-SQLITE_API int sqlite3_total_changes(sqlite3*);
2009
+SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3*);
20132010
20142011
/*
20152012
** CAPI3REF: Interrupt A Long-Running Query
20162013
**
20172014
** ^This function causes any pending database operation to abort and
@@ -2046,11 +2043,11 @@
20462043
** that are started after the sqlite3_interrupt() call returns.
20472044
**
20482045
** If the database connection closes while [sqlite3_interrupt()]
20492046
** is running then bad things will likely happen.
20502047
*/
2051
-SQLITE_API void sqlite3_interrupt(sqlite3*);
2048
+SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3*);
20522049
20532050
/*
20542051
** CAPI3REF: Determine If An SQL Statement Is Complete
20552052
**
20562053
** These routines are useful during command-line input to determine if the
@@ -2081,12 +2078,12 @@
20812078
** UTF-8 string.
20822079
**
20832080
** The input to [sqlite3_complete16()] must be a zero-terminated
20842081
** UTF-16 string in native byte order.
20852082
*/
2086
-SQLITE_API int sqlite3_complete(const char *sql);
2087
-SQLITE_API int sqlite3_complete16(const void *sql);
2083
+SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *sql);
2084
+SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *sql);
20882085
20892086
/*
20902087
** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
20912088
** KEYWORDS: {busy-handler callback} {busy handler}
20922089
**
@@ -2142,11 +2139,11 @@
21422139
** result in undefined behavior.
21432140
**
21442141
** A busy handler must not close the database connection
21452142
** or [prepared statement] that invoked the busy handler.
21462143
*/
2147
-SQLITE_API int sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*);
2144
+SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*);
21482145
21492146
/*
21502147
** CAPI3REF: Set A Busy Timeout
21512148
**
21522149
** ^This routine sets a [sqlite3_busy_handler | busy handler] that sleeps
@@ -2164,11 +2161,11 @@
21642161
** was defined (using [sqlite3_busy_handler()]) prior to calling
21652162
** this routine, that other busy handler is cleared.)^
21662163
**
21672164
** See also: [PRAGMA busy_timeout]
21682165
*/
2169
-SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms);
2166
+SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3*, int ms);
21702167
21712168
/*
21722169
** CAPI3REF: Convenience Routines For Running Queries
21732170
**
21742171
** This is a legacy interface that is preserved for backwards compatibility.
@@ -2238,19 +2235,19 @@
22382235
** interface defined here. As a consequence, errors that occur in the
22392236
** wrapper layer outside of the internal [sqlite3_exec()] call are not
22402237
** reflected in subsequent calls to [sqlite3_errcode()] or
22412238
** [sqlite3_errmsg()].
22422239
*/
2243
-SQLITE_API int sqlite3_get_table(
2240
+SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
22442241
sqlite3 *db, /* An open database */
22452242
const char *zSql, /* SQL to be evaluated */
22462243
char ***pazResult, /* Results of the query */
22472244
int *pnRow, /* Number of result rows written here */
22482245
int *pnColumn, /* Number of result columns written here */
22492246
char **pzErrmsg /* Error msg written here */
22502247
);
2251
-SQLITE_API void sqlite3_free_table(char **result);
2248
+SQLITE_API void SQLITE_STDCALL sqlite3_free_table(char **result);
22522249
22532250
/*
22542251
** CAPI3REF: Formatted String Printing Functions
22552252
**
22562253
** These routines are work-alikes of the "printf()" family of functions
@@ -2352,14 +2349,14 @@
23522349
**
23532350
** ^(The "%z" formatting option works like "%s" but with the
23542351
** addition that after the string has been read and copied into
23552352
** the result, [sqlite3_free()] is called on the input string.)^
23562353
*/
2357
-SQLITE_API char *sqlite3_mprintf(const char*,...);
2358
-SQLITE_API char *sqlite3_vmprintf(const char*, va_list);
2359
-SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...);
2360
-SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);
2354
+SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...);
2355
+SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list);
2356
+SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...);
2357
+SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list);
23612358
23622359
/*
23632360
** CAPI3REF: Memory Allocation Subsystem
23642361
**
23652362
** The SQLite core uses these three routines for all of its own
@@ -2445,16 +2442,16 @@
24452442
**
24462443
** The application must not read or write any part of
24472444
** a block of memory after it has been released using
24482445
** [sqlite3_free()] or [sqlite3_realloc()].
24492446
*/
2450
-SQLITE_API void *sqlite3_malloc(int);
2451
-SQLITE_API void *sqlite3_malloc64(sqlite3_uint64);
2452
-SQLITE_API void *sqlite3_realloc(void*, int);
2453
-SQLITE_API void *sqlite3_realloc64(void*, sqlite3_uint64);
2454
-SQLITE_API void sqlite3_free(void*);
2455
-SQLITE_API sqlite3_uint64 sqlite3_msize(void*);
2447
+SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int);
2448
+SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64);
2449
+SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void*, int);
2450
+SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void*, sqlite3_uint64);
2451
+SQLITE_API void SQLITE_STDCALL sqlite3_free(void*);
2452
+SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void*);
24562453
24572454
/*
24582455
** CAPI3REF: Memory Allocator Statistics
24592456
**
24602457
** SQLite provides these two interfaces for reporting on the status
@@ -2475,12 +2472,12 @@
24752472
** [sqlite3_memory_used()] if and only if the parameter to
24762473
** [sqlite3_memory_highwater()] is true. ^The value returned
24772474
** by [sqlite3_memory_highwater(1)] is the high-water mark
24782475
** prior to the reset.
24792476
*/
2480
-SQLITE_API sqlite3_int64 sqlite3_memory_used(void);
2481
-SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int resetFlag);
2477
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void);
2478
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag);
24822479
24832480
/*
24842481
** CAPI3REF: Pseudo-Random Number Generator
24852482
**
24862483
** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
@@ -2499,11 +2496,11 @@
24992496
** ^If the previous call to this routine had an N of 1 or more and a
25002497
** non-NULL P then the pseudo-randomness is generated
25012498
** internally and without recourse to the [sqlite3_vfs] xRandomness
25022499
** method.
25032500
*/
2504
-SQLITE_API void sqlite3_randomness(int N, void *P);
2501
+SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *P);
25052502
25062503
/*
25072504
** CAPI3REF: Compile-Time Authorization Callbacks
25082505
**
25092506
** ^This routine registers an authorizer callback with a particular
@@ -2581,11 +2578,11 @@
25812578
** [sqlite3_prepare()] or its variants. Authorization is not
25822579
** performed during statement evaluation in [sqlite3_step()], unless
25832580
** as stated in the previous paragraph, sqlite3_step() invokes
25842581
** sqlite3_prepare_v2() to reprepare a statement after a schema change.
25852582
*/
2586
-SQLITE_API int sqlite3_set_authorizer(
2583
+SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
25872584
sqlite3*,
25882585
int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
25892586
void *pUserData
25902587
);
25912588
@@ -2685,12 +2682,12 @@
26852682
** digits in the time are meaningless. Future versions of SQLite
26862683
** might provide greater resolution on the profiler callback. The
26872684
** sqlite3_profile() function is considered experimental and is
26882685
** subject to change in future versions of SQLite.
26892686
*/
2690
-SQLITE_API void *sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*);
2691
-SQLITE_API SQLITE_EXPERIMENTAL void *sqlite3_profile(sqlite3*,
2687
+SQLITE_API void *SQLITE_STDCALL sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*);
2688
+SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_STDCALL sqlite3_profile(sqlite3*,
26922689
void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
26932690
26942691
/*
26952692
** CAPI3REF: Query Progress Callbacks
26962693
**
@@ -2720,11 +2717,11 @@
27202717
** the database connection that invoked the progress handler.
27212718
** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
27222719
** database connections for the meaning of "modify" in this paragraph.
27232720
**
27242721
*/
2725
-SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
2722
+SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
27262723
27272724
/*
27282725
** CAPI3REF: Opening A New Database Connection
27292726
**
27302727
** ^These routines open an SQLite database file as specified by the
@@ -2948,19 +2945,19 @@
29482945
** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various
29492946
** features that require the use of temporary files may fail.
29502947
**
29512948
** See also: [sqlite3_temp_directory]
29522949
*/
2953
-SQLITE_API int sqlite3_open(
2950
+SQLITE_API int SQLITE_STDCALL sqlite3_open(
29542951
const char *filename, /* Database filename (UTF-8) */
29552952
sqlite3 **ppDb /* OUT: SQLite db handle */
29562953
);
2957
-SQLITE_API int sqlite3_open16(
2954
+SQLITE_API int SQLITE_STDCALL sqlite3_open16(
29582955
const void *filename, /* Database filename (UTF-16) */
29592956
sqlite3 **ppDb /* OUT: SQLite db handle */
29602957
);
2961
-SQLITE_API int sqlite3_open_v2(
2958
+SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
29622959
const char *filename, /* Database filename (UTF-8) */
29632960
sqlite3 **ppDb, /* OUT: SQLite db handle */
29642961
int flags, /* Flags */
29652962
const char *zVfs /* Name of VFS module to use */
29662963
);
@@ -3002,13 +2999,13 @@
30022999
** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and
30033000
** is not a database file pathname pointer that SQLite passed into the xOpen
30043001
** VFS method, then the behavior of this routine is undefined and probably
30053002
** undesirable.
30063003
*/
3007
-SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3008
-SQLITE_API int sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3009
-SQLITE_API sqlite3_int64 sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
3004
+SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3005
+SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3006
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
30103007
30113008
30123009
/*
30133010
** CAPI3REF: Error Codes And Messages
30143011
**
@@ -3047,15 +3044,15 @@
30473044
**
30483045
** If an interface fails with SQLITE_MISUSE, that means the interface
30493046
** was invoked incorrectly by the application. In that case, the
30503047
** error code and message may or may not be set.
30513048
*/
3052
-SQLITE_API int sqlite3_errcode(sqlite3 *db);
3053
-SQLITE_API int sqlite3_extended_errcode(sqlite3 *db);
3054
-SQLITE_API const char *sqlite3_errmsg(sqlite3*);
3055
-SQLITE_API const void *sqlite3_errmsg16(sqlite3*);
3056
-SQLITE_API const char *sqlite3_errstr(int);
3049
+SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db);
3050
+SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db);
3051
+SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*);
3052
+SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*);
3053
+SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int);
30573054
30583055
/*
30593056
** CAPI3REF: SQL Statement Object
30603057
** KEYWORDS: {prepared statement} {prepared statements}
30613058
**
@@ -3118,11 +3115,11 @@
31183115
** created by an untrusted script can be contained using the
31193116
** [max_page_count] [PRAGMA].
31203117
**
31213118
** New run-time limit categories may be added in future releases.
31223119
*/
3123
-SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal);
3120
+SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3*, int id, int newVal);
31243121
31253122
/*
31263123
** CAPI3REF: Run-Time Limit Categories
31273124
** KEYWORDS: {limit category} {*limit categories}
31283125
**
@@ -3268,32 +3265,32 @@
32683265
** or [GLOB] operator or if the parameter is compared to an indexed column
32693266
** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
32703267
** </li>
32713268
** </ol>
32723269
*/
3273
-SQLITE_API int sqlite3_prepare(
3270
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
32743271
sqlite3 *db, /* Database handle */
32753272
const char *zSql, /* SQL statement, UTF-8 encoded */
32763273
int nByte, /* Maximum length of zSql in bytes. */
32773274
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
32783275
const char **pzTail /* OUT: Pointer to unused portion of zSql */
32793276
);
3280
-SQLITE_API int sqlite3_prepare_v2(
3277
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
32813278
sqlite3 *db, /* Database handle */
32823279
const char *zSql, /* SQL statement, UTF-8 encoded */
32833280
int nByte, /* Maximum length of zSql in bytes. */
32843281
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
32853282
const char **pzTail /* OUT: Pointer to unused portion of zSql */
32863283
);
3287
-SQLITE_API int sqlite3_prepare16(
3284
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
32883285
sqlite3 *db, /* Database handle */
32893286
const void *zSql, /* SQL statement, UTF-16 encoded */
32903287
int nByte, /* Maximum length of zSql in bytes. */
32913288
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
32923289
const void **pzTail /* OUT: Pointer to unused portion of zSql */
32933290
);
3294
-SQLITE_API int sqlite3_prepare16_v2(
3291
+SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
32953292
sqlite3 *db, /* Database handle */
32963293
const void *zSql, /* SQL statement, UTF-16 encoded */
32973294
int nByte, /* Maximum length of zSql in bytes. */
32983295
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
32993296
const void **pzTail /* OUT: Pointer to unused portion of zSql */
@@ -3304,11 +3301,11 @@
33043301
**
33053302
** ^This interface can be used to retrieve a saved copy of the original
33063303
** SQL text used to create a [prepared statement] if that statement was
33073304
** compiled using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()].
33083305
*/
3309
-SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt);
3306
+SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt);
33103307
33113308
/*
33123309
** CAPI3REF: Determine If An SQL Statement Writes The Database
33133310
**
33143311
** ^The sqlite3_stmt_readonly(X) interface returns true (non-zero) if
@@ -3335,11 +3332,11 @@
33353332
** database. ^The [ATTACH] and [DETACH] statements also cause
33363333
** sqlite3_stmt_readonly() to return true since, while those statements
33373334
** change the configuration of a database connection, they do not make
33383335
** changes to the content of the database files on disk.
33393336
*/
3340
-SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
3337
+SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
33413338
33423339
/*
33433340
** CAPI3REF: Determine If A Prepared Statement Has Been Reset
33443341
**
33453342
** ^The sqlite3_stmt_busy(S) interface returns true (non-zero) if the
@@ -3354,11 +3351,11 @@
33543351
** to locate all prepared statements associated with a database
33553352
** connection that are in need of being reset. This can be used,
33563353
** for example, in diagnostic routines to search for prepared
33573354
** statements that are holding a transaction open.
33583355
*/
3359
-SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt*);
3356
+SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt*);
33603357
33613358
/*
33623359
** CAPI3REF: Dynamically Typed Value Object
33633360
** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
33643361
**
@@ -3515,23 +3512,23 @@
35153512
** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails.
35163513
**
35173514
** See also: [sqlite3_bind_parameter_count()],
35183515
** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].
35193516
*/
3520
-SQLITE_API int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
3521
-SQLITE_API int sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
3517
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
3518
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
35223519
void(*)(void*));
3523
-SQLITE_API int sqlite3_bind_double(sqlite3_stmt*, int, double);
3524
-SQLITE_API int sqlite3_bind_int(sqlite3_stmt*, int, int);
3525
-SQLITE_API int sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
3526
-SQLITE_API int sqlite3_bind_null(sqlite3_stmt*, int);
3527
-SQLITE_API int sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
3528
-SQLITE_API int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
3529
-SQLITE_API int sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
3520
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt*, int, double);
3521
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt*, int, int);
3522
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
3523
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt*, int);
3524
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
3525
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
3526
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
35303527
void(*)(void*), unsigned char encoding);
3531
-SQLITE_API int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
3532
-SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
3528
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
3529
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
35333530
35343531
/*
35353532
** CAPI3REF: Number Of SQL Parameters
35363533
**
35373534
** ^This routine can be used to find the number of [SQL parameters]
@@ -3547,11 +3544,11 @@
35473544
**
35483545
** See also: [sqlite3_bind_blob|sqlite3_bind()],
35493546
** [sqlite3_bind_parameter_name()], and
35503547
** [sqlite3_bind_parameter_index()].
35513548
*/
3552
-SQLITE_API int sqlite3_bind_parameter_count(sqlite3_stmt*);
3549
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt*);
35533550
35543551
/*
35553552
** CAPI3REF: Name Of A Host Parameter
35563553
**
35573554
** ^The sqlite3_bind_parameter_name(P,N) interface returns
@@ -3574,11 +3571,11 @@
35743571
**
35753572
** See also: [sqlite3_bind_blob|sqlite3_bind()],
35763573
** [sqlite3_bind_parameter_count()], and
35773574
** [sqlite3_bind_parameter_index()].
35783575
*/
3579
-SQLITE_API const char *sqlite3_bind_parameter_name(sqlite3_stmt*, int);
3576
+SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
35803577
35813578
/*
35823579
** CAPI3REF: Index Of A Parameter With A Given Name
35833580
**
35843581
** ^Return the index of an SQL parameter given its name. ^The
@@ -3590,20 +3587,20 @@
35903587
**
35913588
** See also: [sqlite3_bind_blob|sqlite3_bind()],
35923589
** [sqlite3_bind_parameter_count()], and
35933590
** [sqlite3_bind_parameter_index()].
35943591
*/
3595
-SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
3592
+SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
35963593
35973594
/*
35983595
** CAPI3REF: Reset All Bindings On A Prepared Statement
35993596
**
36003597
** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset
36013598
** the [sqlite3_bind_blob | bindings] on a [prepared statement].
36023599
** ^Use this routine to reset all host parameters to NULL.
36033600
*/
3604
-SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt*);
3601
+SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt*);
36053602
36063603
/*
36073604
** CAPI3REF: Number Of Columns In A Result Set
36083605
**
36093606
** ^Return the number of columns in the result set returned by the
@@ -3610,11 +3607,11 @@
36103607
** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
36113608
** statement that does not return data (for example an [UPDATE]).
36123609
**
36133610
** See also: [sqlite3_data_count()]
36143611
*/
3615
-SQLITE_API int sqlite3_column_count(sqlite3_stmt *pStmt);
3612
+SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt);
36163613
36173614
/*
36183615
** CAPI3REF: Column Names In A Result Set
36193616
**
36203617
** ^These routines return the name assigned to a particular column
@@ -3638,12 +3635,12 @@
36383635
** ^The name of a result column is the value of the "AS" clause for
36393636
** that column, if there is an AS clause. If there is no AS clause
36403637
** then the name of the column is unspecified and may change from
36413638
** one release of SQLite to the next.
36423639
*/
3643
-SQLITE_API const char *sqlite3_column_name(sqlite3_stmt*, int N);
3644
-SQLITE_API const void *sqlite3_column_name16(sqlite3_stmt*, int N);
3640
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt*, int N);
3641
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt*, int N);
36453642
36463643
/*
36473644
** CAPI3REF: Source Of Data In A Query Result
36483645
**
36493646
** ^These routines provide a means to determine the database, table, and
@@ -3686,16 +3683,16 @@
36863683
** If two or more threads call one or more
36873684
** [sqlite3_column_database_name | column metadata interfaces]
36883685
** for the same [prepared statement] and result column
36893686
** at the same time then the results are undefined.
36903687
*/
3691
-SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int);
3692
-SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int);
3693
-SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int);
3694
-SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int);
3695
-SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int);
3696
-SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);
3688
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int);
3689
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int);
3690
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int);
3691
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int);
3692
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int);
3693
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
36973694
36983695
/*
36993696
** CAPI3REF: Declared Datatype Of A Query Result
37003697
**
37013698
** ^(The first parameter is a [prepared statement].
@@ -3722,12 +3719,12 @@
37223719
** data stored in that column is of the declared type. SQLite is
37233720
** strongly typed, but the typing is dynamic not static. ^Type
37243721
** is associated with individual values, not with the containers
37253722
** used to hold those values.
37263723
*/
3727
-SQLITE_API const char *sqlite3_column_decltype(sqlite3_stmt*,int);
3728
-SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int);
3724
+SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt*,int);
3725
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt*,int);
37293726
37303727
/*
37313728
** CAPI3REF: Evaluate An SQL Statement
37323729
**
37333730
** After a [prepared statement] has been prepared using either
@@ -3802,11 +3799,11 @@
38023799
** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
38033800
** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,
38043801
** then the more specific [error codes] are returned directly
38053802
** by sqlite3_step(). The use of the "v2" interface is recommended.
38063803
*/
3807
-SQLITE_API int sqlite3_step(sqlite3_stmt*);
3804
+SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt*);
38083805
38093806
/*
38103807
** CAPI3REF: Number of columns in a result set
38113808
**
38123809
** ^The sqlite3_data_count(P) interface returns the number of columns in the
@@ -3822,11 +3819,11 @@
38223819
** where it always returns zero since each step of that multi-step
38233820
** pragma returns 0 columns of data.
38243821
**
38253822
** See also: [sqlite3_column_count()]
38263823
*/
3827
-SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt);
3824
+SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt);
38283825
38293826
/*
38303827
** CAPI3REF: Fundamental Datatypes
38313828
** KEYWORDS: SQLITE_TEXT
38323829
**
@@ -4018,20 +4015,20 @@
40184015
** of these routines, a default value is returned. The default value
40194016
** is either the integer 0, the floating point number 0.0, or a NULL
40204017
** pointer. Subsequent calls to [sqlite3_errcode()] will return
40214018
** [SQLITE_NOMEM].)^
40224019
*/
4023
-SQLITE_API const void *sqlite3_column_blob(sqlite3_stmt*, int iCol);
4024
-SQLITE_API int sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4025
-SQLITE_API int sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4026
-SQLITE_API double sqlite3_column_double(sqlite3_stmt*, int iCol);
4027
-SQLITE_API int sqlite3_column_int(sqlite3_stmt*, int iCol);
4028
-SQLITE_API sqlite3_int64 sqlite3_column_int64(sqlite3_stmt*, int iCol);
4029
-SQLITE_API const unsigned char *sqlite3_column_text(sqlite3_stmt*, int iCol);
4030
-SQLITE_API const void *sqlite3_column_text16(sqlite3_stmt*, int iCol);
4031
-SQLITE_API int sqlite3_column_type(sqlite3_stmt*, int iCol);
4032
-SQLITE_API sqlite3_value *sqlite3_column_value(sqlite3_stmt*, int iCol);
4020
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt*, int iCol);
4021
+SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4022
+SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4023
+SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt*, int iCol);
4024
+SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt*, int iCol);
4025
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt*, int iCol);
4026
+SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt*, int iCol);
4027
+SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt*, int iCol);
4028
+SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt*, int iCol);
4029
+SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt*, int iCol);
40334030
40344031
/*
40354032
** CAPI3REF: Destroy A Prepared Statement Object
40364033
**
40374034
** ^The sqlite3_finalize() function is called to delete a [prepared statement].
@@ -4054,11 +4051,11 @@
40544051
** resource leaks. It is a grievous error for the application to try to use
40554052
** a prepared statement after it has been finalized. Any use of a prepared
40564053
** statement after it has been finalized can result in undefined and
40574054
** undesirable behavior such as segfaults and heap corruption.
40584055
*/
4059
-SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt);
4056
+SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt);
40604057
40614058
/*
40624059
** CAPI3REF: Reset A Prepared Statement Object
40634060
**
40644061
** The sqlite3_reset() function is called to reset a [prepared statement]
@@ -4080,11 +4077,11 @@
40804077
** [sqlite3_reset(S)] returns an appropriate [error code].
40814078
**
40824079
** ^The [sqlite3_reset(S)] interface does not change the values
40834080
** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
40844081
*/
4085
-SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt);
4082
+SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt);
40864083
40874084
/*
40884085
** CAPI3REF: Create Or Redefine SQL Functions
40894086
** KEYWORDS: {function creation routines}
40904087
** KEYWORDS: {application-defined SQL function}
@@ -4179,31 +4176,31 @@
41794176
** ^An application-defined function is permitted to call other
41804177
** SQLite interfaces. However, such calls must not
41814178
** close the database connection nor finalize or reset the prepared
41824179
** statement in which the function is running.
41834180
*/
4184
-SQLITE_API int sqlite3_create_function(
4181
+SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
41854182
sqlite3 *db,
41864183
const char *zFunctionName,
41874184
int nArg,
41884185
int eTextRep,
41894186
void *pApp,
41904187
void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
41914188
void (*xStep)(sqlite3_context*,int,sqlite3_value**),
41924189
void (*xFinal)(sqlite3_context*)
41934190
);
4194
-SQLITE_API int sqlite3_create_function16(
4191
+SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
41954192
sqlite3 *db,
41964193
const void *zFunctionName,
41974194
int nArg,
41984195
int eTextRep,
41994196
void *pApp,
42004197
void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
42014198
void (*xStep)(sqlite3_context*,int,sqlite3_value**),
42024199
void (*xFinal)(sqlite3_context*)
42034200
);
4204
-SQLITE_API int sqlite3_create_function_v2(
4201
+SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
42054202
sqlite3 *db,
42064203
const char *zFunctionName,
42074204
int nArg,
42084205
int eTextRep,
42094206
void *pApp,
@@ -4245,16 +4242,16 @@
42454242
** to be supported. However, new applications should avoid
42464243
** the use of these functions. To encourage programmers to avoid
42474244
** these functions, we will not explain what they do.
42484245
*/
42494246
#ifndef SQLITE_OMIT_DEPRECATED
4250
-SQLITE_API SQLITE_DEPRECATED int sqlite3_aggregate_count(sqlite3_context*);
4251
-SQLITE_API SQLITE_DEPRECATED int sqlite3_expired(sqlite3_stmt*);
4252
-SQLITE_API SQLITE_DEPRECATED int sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4253
-SQLITE_API SQLITE_DEPRECATED int sqlite3_global_recover(void);
4254
-SQLITE_API SQLITE_DEPRECATED void sqlite3_thread_cleanup(void);
4255
-SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
4247
+SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context*);
4248
+SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt*);
4249
+SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4250
+SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_global_recover(void);
4251
+SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_thread_cleanup(void);
4252
+SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
42564253
void*,sqlite3_int64);
42574254
#endif
42584255
42594256
/*
42604257
** CAPI3REF: Obtaining SQL Function Parameter Values
@@ -4299,22 +4296,22 @@
42994296
** or [sqlite3_value_text16()].
43004297
**
43014298
** These routines must be called from the same thread as
43024299
** the SQL function that supplied the [sqlite3_value*] parameters.
43034300
*/
4304
-SQLITE_API const void *sqlite3_value_blob(sqlite3_value*);
4305
-SQLITE_API int sqlite3_value_bytes(sqlite3_value*);
4306
-SQLITE_API int sqlite3_value_bytes16(sqlite3_value*);
4307
-SQLITE_API double sqlite3_value_double(sqlite3_value*);
4308
-SQLITE_API int sqlite3_value_int(sqlite3_value*);
4309
-SQLITE_API sqlite3_int64 sqlite3_value_int64(sqlite3_value*);
4310
-SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value*);
4311
-SQLITE_API const void *sqlite3_value_text16(sqlite3_value*);
4312
-SQLITE_API const void *sqlite3_value_text16le(sqlite3_value*);
4313
-SQLITE_API const void *sqlite3_value_text16be(sqlite3_value*);
4314
-SQLITE_API int sqlite3_value_type(sqlite3_value*);
4315
-SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*);
4301
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value*);
4302
+SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value*);
4303
+SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value*);
4304
+SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value*);
4305
+SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value*);
4306
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value*);
4307
+SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value*);
4308
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value*);
4309
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value*);
4310
+SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*);
4311
+SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*);
4312
+SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*);
43164313
43174314
/*
43184315
** CAPI3REF: Obtain Aggregate Function Context
43194316
**
43204317
** Implementations of aggregate SQL functions use this
@@ -4354,11 +4351,11 @@
43544351
** function.
43554352
**
43564353
** This routine must be called from the same thread in which
43574354
** the aggregate SQL function is running.
43584355
*/
4359
-SQLITE_API void *sqlite3_aggregate_context(sqlite3_context*, int nBytes);
4356
+SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
43604357
43614358
/*
43624359
** CAPI3REF: User Data For Functions
43634360
**
43644361
** ^The sqlite3_user_data() interface returns a copy of
@@ -4368,11 +4365,11 @@
43684365
** registered the application defined function.
43694366
**
43704367
** This routine must be called from the same thread in which
43714368
** the application-defined function is running.
43724369
*/
4373
-SQLITE_API void *sqlite3_user_data(sqlite3_context*);
4370
+SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context*);
43744371
43754372
/*
43764373
** CAPI3REF: Database Connection For Functions
43774374
**
43784375
** ^The sqlite3_context_db_handle() interface returns a copy of
@@ -4379,11 +4376,11 @@
43794376
** the pointer to the [database connection] (the 1st parameter)
43804377
** of the [sqlite3_create_function()]
43814378
** and [sqlite3_create_function16()] routines that originally
43824379
** registered the application defined function.
43834380
*/
4384
-SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*);
4381
+SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context*);
43854382
43864383
/*
43874384
** CAPI3REF: Function Auxiliary Data
43884385
**
43894386
** These functions may be used by (non-aggregate) SQL functions to
@@ -4431,12 +4428,12 @@
44314428
** values and [parameters] and expressions composed from the same.)^
44324429
**
44334430
** These routines must be called from the same thread in which
44344431
** the SQL function is running.
44354432
*/
4436
-SQLITE_API void *sqlite3_get_auxdata(sqlite3_context*, int N);
4437
-SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
4433
+SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context*, int N);
4434
+SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
44384435
44394436
44404437
/*
44414438
** CAPI3REF: Constants Defining Special Destructor Behavior
44424439
**
@@ -4567,30 +4564,30 @@
45674564
**
45684565
** If these routines are called from within the different thread
45694566
** than the one containing the application-defined function that received
45704567
** the [sqlite3_context] pointer, the results are undefined.
45714568
*/
4572
-SQLITE_API void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
4573
-SQLITE_API void sqlite3_result_blob64(sqlite3_context*,const void*,
4569
+SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
4570
+SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(sqlite3_context*,const void*,
45744571
sqlite3_uint64,void(*)(void*));
4575
-SQLITE_API void sqlite3_result_double(sqlite3_context*, double);
4576
-SQLITE_API void sqlite3_result_error(sqlite3_context*, const char*, int);
4577
-SQLITE_API void sqlite3_result_error16(sqlite3_context*, const void*, int);
4578
-SQLITE_API void sqlite3_result_error_toobig(sqlite3_context*);
4579
-SQLITE_API void sqlite3_result_error_nomem(sqlite3_context*);
4580
-SQLITE_API void sqlite3_result_error_code(sqlite3_context*, int);
4581
-SQLITE_API void sqlite3_result_int(sqlite3_context*, int);
4582
-SQLITE_API void sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
4583
-SQLITE_API void sqlite3_result_null(sqlite3_context*);
4584
-SQLITE_API void sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
4585
-SQLITE_API void sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
4572
+SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context*, double);
4573
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context*, const char*, int);
4574
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context*, const void*, int);
4575
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context*);
4576
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context*);
4577
+SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context*, int);
4578
+SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context*, int);
4579
+SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
4580
+SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context*);
4581
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
4582
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
45864583
void(*)(void*), unsigned char encoding);
4587
-SQLITE_API void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
4588
-SQLITE_API void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
4589
-SQLITE_API void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
4590
-SQLITE_API void sqlite3_result_value(sqlite3_context*, sqlite3_value*);
4591
-SQLITE_API void sqlite3_result_zeroblob(sqlite3_context*, int n);
4584
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
4585
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
4586
+SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
4587
+SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
4588
+SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n);
45924589
45934590
/*
45944591
** CAPI3REF: Define New Collating Sequences
45954592
**
45964593
** ^These functions add, remove, or modify a [collation] associated
@@ -4667,26 +4664,26 @@
46674664
** is unfortunate but cannot be changed without breaking backwards
46684665
** compatibility.
46694666
**
46704667
** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].
46714668
*/
4672
-SQLITE_API int sqlite3_create_collation(
4669
+SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
46734670
sqlite3*,
46744671
const char *zName,
46754672
int eTextRep,
46764673
void *pArg,
46774674
int(*xCompare)(void*,int,const void*,int,const void*)
46784675
);
4679
-SQLITE_API int sqlite3_create_collation_v2(
4676
+SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
46804677
sqlite3*,
46814678
const char *zName,
46824679
int eTextRep,
46834680
void *pArg,
46844681
int(*xCompare)(void*,int,const void*,int,const void*),
46854682
void(*xDestroy)(void*)
46864683
);
4687
-SQLITE_API int sqlite3_create_collation16(
4684
+SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
46884685
sqlite3*,
46894686
const void *zName,
46904687
int eTextRep,
46914688
void *pArg,
46924689
int(*xCompare)(void*,int,const void*,int,const void*)
@@ -4716,16 +4713,16 @@
47164713
**
47174714
** The callback function should register the desired collation using
47184715
** [sqlite3_create_collation()], [sqlite3_create_collation16()], or
47194716
** [sqlite3_create_collation_v2()].
47204717
*/
4721
-SQLITE_API int sqlite3_collation_needed(
4718
+SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
47224719
sqlite3*,
47234720
void*,
47244721
void(*)(void*,sqlite3*,int eTextRep,const char*)
47254722
);
4726
-SQLITE_API int sqlite3_collation_needed16(
4723
+SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
47274724
sqlite3*,
47284725
void*,
47294726
void(*)(void*,sqlite3*,int eTextRep,const void*)
47304727
);
47314728
@@ -4735,15 +4732,15 @@
47354732
** called right after sqlite3_open().
47364733
**
47374734
** The code to implement this API is not available in the public release
47384735
** of SQLite.
47394736
*/
4740
-SQLITE_API int sqlite3_key(
4737
+SQLITE_API int SQLITE_STDCALL sqlite3_key(
47414738
sqlite3 *db, /* Database to be rekeyed */
47424739
const void *pKey, int nKey /* The key */
47434740
);
4744
-SQLITE_API int sqlite3_key_v2(
4741
+SQLITE_API int SQLITE_STDCALL sqlite3_key_v2(
47454742
sqlite3 *db, /* Database to be rekeyed */
47464743
const char *zDbName, /* Name of the database */
47474744
const void *pKey, int nKey /* The key */
47484745
);
47494746
@@ -4753,35 +4750,35 @@
47534750
** database is decrypted.
47544751
**
47554752
** The code to implement this API is not available in the public release
47564753
** of SQLite.
47574754
*/
4758
-SQLITE_API int sqlite3_rekey(
4755
+SQLITE_API int SQLITE_STDCALL sqlite3_rekey(
47594756
sqlite3 *db, /* Database to be rekeyed */
47604757
const void *pKey, int nKey /* The new key */
47614758
);
4762
-SQLITE_API int sqlite3_rekey_v2(
4759
+SQLITE_API int SQLITE_STDCALL sqlite3_rekey_v2(
47634760
sqlite3 *db, /* Database to be rekeyed */
47644761
const char *zDbName, /* Name of the database */
47654762
const void *pKey, int nKey /* The new key */
47664763
);
47674764
47684765
/*
47694766
** Specify the activation key for a SEE database. Unless
47704767
** activated, none of the SEE routines will work.
47714768
*/
4772
-SQLITE_API void sqlite3_activate_see(
4769
+SQLITE_API void SQLITE_STDCALL sqlite3_activate_see(
47734770
const char *zPassPhrase /* Activation phrase */
47744771
);
47754772
#endif
47764773
47774774
#ifdef SQLITE_ENABLE_CEROD
47784775
/*
47794776
** Specify the activation key for a CEROD database. Unless
47804777
** activated, none of the CEROD routines will work.
47814778
*/
4782
-SQLITE_API void sqlite3_activate_cerod(
4779
+SQLITE_API void SQLITE_STDCALL sqlite3_activate_cerod(
47834780
const char *zPassPhrase /* Activation phrase */
47844781
);
47854782
#endif
47864783
47874784
/*
@@ -4799,11 +4796,11 @@
47994796
** method of the default [sqlite3_vfs] object. If the xSleep() method
48004797
** of the default VFS is not implemented correctly, or not implemented at
48014798
** all, then the behavior of sqlite3_sleep() may deviate from the description
48024799
** in the previous paragraphs.
48034800
*/
4804
-SQLITE_API int sqlite3_sleep(int);
4801
+SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int);
48054802
48064803
/*
48074804
** CAPI3REF: Name Of The Folder Holding Temporary Files
48084805
**
48094806
** ^(If this global variable is made to point to a string which is
@@ -4917,11 +4914,11 @@
49174914
**
49184915
** If another thread changes the autocommit status of the database
49194916
** connection while this routine is running, then the return value
49204917
** is undefined.
49214918
*/
4922
-SQLITE_API int sqlite3_get_autocommit(sqlite3*);
4919
+SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3*);
49234920
49244921
/*
49254922
** CAPI3REF: Find The Database Handle Of A Prepared Statement
49264923
**
49274924
** ^The sqlite3_db_handle interface returns the [database connection] handle
@@ -4929,11 +4926,11 @@
49294926
** returned by sqlite3_db_handle is the same [database connection]
49304927
** that was the first argument
49314928
** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
49324929
** create the statement in the first place.
49334930
*/
4934
-SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*);
4931
+SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt*);
49354932
49364933
/*
49374934
** CAPI3REF: Return The Filename For A Database Connection
49384935
**
49394936
** ^The sqlite3_db_filename(D,N) interface returns a pointer to a filename
@@ -4945,20 +4942,20 @@
49454942
** ^The filename returned by this function is the output of the
49464943
** xFullPathname method of the [VFS]. ^In other words, the filename
49474944
** will be an absolute pathname, even if the filename used
49484945
** to open the database originally was a URI or relative pathname.
49494946
*/
4950
-SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName);
4947
+SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
49514948
49524949
/*
49534950
** CAPI3REF: Determine if a database is read-only
49544951
**
49554952
** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N
49564953
** of connection D is read-only, 0 if it is read/write, or -1 if N is not
49574954
** the name of a database on connection D.
49584955
*/
4959
-SQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
4956
+SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
49604957
49614958
/*
49624959
** CAPI3REF: Find the next prepared statement
49634960
**
49644961
** ^This interface returns a pointer to the next [prepared statement] after
@@ -4969,11 +4966,11 @@
49694966
**
49704967
** The [database connection] pointer D in a call to
49714968
** [sqlite3_next_stmt(D,S)] must refer to an open database
49724969
** connection and in particular must not be a NULL pointer.
49734970
*/
4974
-SQLITE_API sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
4971
+SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
49754972
49764973
/*
49774974
** CAPI3REF: Commit And Rollback Notification Callbacks
49784975
**
49794976
** ^The sqlite3_commit_hook() interface registers a callback
@@ -5017,12 +5014,12 @@
50175014
** ^The rollback callback is not invoked if a transaction is
50185015
** automatically rolled back because the database connection is closed.
50195016
**
50205017
** See also the [sqlite3_update_hook()] interface.
50215018
*/
5022
-SQLITE_API void *sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
5023
-SQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
5019
+SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
5020
+SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
50245021
50255022
/*
50265023
** CAPI3REF: Data Change Notification Callbacks
50275024
**
50285025
** ^The sqlite3_update_hook() interface registers a callback function
@@ -5068,11 +5065,11 @@
50685065
** the first call on D.
50695066
**
50705067
** See also the [sqlite3_commit_hook()] and [sqlite3_rollback_hook()]
50715068
** interfaces.
50725069
*/
5073
-SQLITE_API void *sqlite3_update_hook(
5070
+SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
50745071
sqlite3*,
50755072
void(*)(void *,int ,char const *,char const *,sqlite3_int64),
50765073
void*
50775074
);
50785075
@@ -5108,11 +5105,11 @@
51085105
** This interface is threadsafe on processors where writing a
51095106
** 32-bit integer is atomic.
51105107
**
51115108
** See Also: [SQLite Shared-Cache Mode]
51125109
*/
5113
-SQLITE_API int sqlite3_enable_shared_cache(int);
5110
+SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int);
51145111
51155112
/*
51165113
** CAPI3REF: Attempt To Free Heap Memory
51175114
**
51185115
** ^The sqlite3_release_memory() interface attempts to free N bytes
@@ -5124,11 +5121,11 @@
51245121
** ^The sqlite3_release_memory() routine is a no-op returning zero
51255122
** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].
51265123
**
51275124
** See also: [sqlite3_db_release_memory()]
51285125
*/
5129
-SQLITE_API int sqlite3_release_memory(int);
5126
+SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int);
51305127
51315128
/*
51325129
** CAPI3REF: Free Memory Used By A Database Connection
51335130
**
51345131
** ^The sqlite3_db_release_memory(D) interface attempts to free as much heap
@@ -5137,11 +5134,11 @@
51375134
** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
51385135
** omitted.
51395136
**
51405137
** See also: [sqlite3_release_memory()]
51415138
*/
5142
-SQLITE_API int sqlite3_db_release_memory(sqlite3*);
5139
+SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3*);
51435140
51445141
/*
51455142
** CAPI3REF: Impose A Limit On Heap Size
51465143
**
51475144
** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the
@@ -5189,11 +5186,11 @@
51895186
** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT].
51905187
**
51915188
** The circumstances under which SQLite will enforce the soft heap limit may
51925189
** changes in future releases of SQLite.
51935190
*/
5194
-SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 N);
5191
+SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
51955192
51965193
/*
51975194
** CAPI3REF: Deprecated Soft Heap Limit Interface
51985195
** DEPRECATED
51995196
**
@@ -5200,11 +5197,11 @@
52005197
** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
52015198
** interface. This routine is provided for historical compatibility
52025199
** only. All new applications should use the
52035200
** [sqlite3_soft_heap_limit64()] interface rather than this one.
52045201
*/
5205
-SQLITE_API SQLITE_DEPRECATED void sqlite3_soft_heap_limit(int N);
5202
+SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_soft_heap_limit(int N);
52065203
52075204
52085205
/*
52095206
** CAPI3REF: Extract Metadata About A Column Of A Table
52105207
**
@@ -5269,11 +5266,11 @@
52695266
**
52705267
** ^This function causes all database schemas to be read from disk and
52715268
** parsed, if that has not already been done, and returns an error if
52725269
** any errors are encountered while loading the schema.
52735270
*/
5274
-SQLITE_API int sqlite3_table_column_metadata(
5271
+SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
52755272
sqlite3 *db, /* Connection handle */
52765273
const char *zDbName, /* Database name or NULL */
52775274
const char *zTableName, /* Table name */
52785275
const char *zColumnName, /* Column name */
52795276
char const **pzDataType, /* OUTPUT: Declared data type */
@@ -5315,11 +5312,11 @@
53155312
** [sqlite3_enable_load_extension()] prior to calling this API,
53165313
** otherwise an error will be returned.
53175314
**
53185315
** See also the [load_extension() SQL function].
53195316
*/
5320
-SQLITE_API int sqlite3_load_extension(
5317
+SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
53215318
sqlite3 *db, /* Load the extension into this database connection */
53225319
const char *zFile, /* Name of the shared library containing extension */
53235320
const char *zProc, /* Entry point. Derived from zFile if 0 */
53245321
char **pzErrMsg /* Put error message here if not 0 */
53255322
);
@@ -5335,11 +5332,11 @@
53355332
** ^Extension loading is off by default.
53365333
** ^Call the sqlite3_enable_load_extension() routine with onoff==1
53375334
** to turn extension loading on and call it with onoff==0 to turn
53385335
** it back off again.
53395336
*/
5340
-SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
5337
+SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
53415338
53425339
/*
53435340
** CAPI3REF: Automatically Load Statically Linked Extensions
53445341
**
53455342
** ^This interface causes the xEntryPoint() function to be invoked for
@@ -5373,11 +5370,11 @@
53735370
** will be called more than once for each database connection that is opened.
53745371
**
53755372
** See also: [sqlite3_reset_auto_extension()]
53765373
** and [sqlite3_cancel_auto_extension()]
53775374
*/
5378
-SQLITE_API int sqlite3_auto_extension(void (*xEntryPoint)(void));
5375
+SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void (*xEntryPoint)(void));
53795376
53805377
/*
53815378
** CAPI3REF: Cancel Automatic Extension Loading
53825379
**
53835380
** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
@@ -5385,19 +5382,19 @@
53855382
** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)]
53865383
** routine returns 1 if initialization routine X was successfully
53875384
** unregistered and it returns 0 if X was not on the list of initialization
53885385
** routines.
53895386
*/
5390
-SQLITE_API int sqlite3_cancel_auto_extension(void (*xEntryPoint)(void));
5387
+SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void (*xEntryPoint)(void));
53915388
53925389
/*
53935390
** CAPI3REF: Reset Automatic Extension Loading
53945391
**
53955392
** ^This interface disables all automatic extensions previously
53965393
** registered using [sqlite3_auto_extension()].
53975394
*/
5398
-SQLITE_API void sqlite3_reset_auto_extension(void);
5395
+SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void);
53995396
54005397
/*
54015398
** The interface to the virtual-table mechanism is currently considered
54025399
** to be experimental. The interface might change in incompatible ways.
54035400
** If this is a problem for you, do not use the interface at this time.
@@ -5596,17 +5593,17 @@
55965593
** be invoked if the call to sqlite3_create_module_v2() fails.
55975594
** ^The sqlite3_create_module()
55985595
** interface is equivalent to sqlite3_create_module_v2() with a NULL
55995596
** destructor.
56005597
*/
5601
-SQLITE_API int sqlite3_create_module(
5598
+SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
56025599
sqlite3 *db, /* SQLite connection to register module with */
56035600
const char *zName, /* Name of the module */
56045601
const sqlite3_module *p, /* Methods for the module */
56055602
void *pClientData /* Client data for xCreate/xConnect */
56065603
);
5607
-SQLITE_API int sqlite3_create_module_v2(
5604
+SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
56085605
sqlite3 *db, /* SQLite connection to register module with */
56095606
const char *zName, /* Name of the module */
56105607
const sqlite3_module *p, /* Methods for the module */
56115608
void *pClientData, /* Client data for xCreate/xConnect */
56125609
void(*xDestroy)(void*) /* Module destructor function */
@@ -5665,11 +5662,11 @@
56655662
** ^The [xCreate] and [xConnect] methods of a
56665663
** [virtual table module] call this interface
56675664
** to declare the format (the names and datatypes of the columns) of
56685665
** the virtual tables they implement.
56695666
*/
5670
-SQLITE_API int sqlite3_declare_vtab(sqlite3*, const char *zSQL);
5667
+SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
56715668
56725669
/*
56735670
** CAPI3REF: Overload A Function For A Virtual Table
56745671
**
56755672
** ^(Virtual tables can provide alternative implementations of functions
@@ -5683,11 +5680,11 @@
56835680
** of the new function always causes an exception to be thrown. So
56845681
** the new function is not good for anything by itself. Its only
56855682
** purpose is to be a placeholder function that can be overloaded
56865683
** by a [virtual table].
56875684
*/
5688
-SQLITE_API int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
5685
+SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
56895686
56905687
/*
56915688
** The interface to the virtual-table mechanism defined above (back up
56925689
** to a comment remarkably similar to this one) is currently considered
56935690
** to be experimental. The interface might change in incompatible ways.
@@ -5780,11 +5777,11 @@
57805777
** zero-filled blob to read or write using the incremental-blob interface.
57815778
**
57825779
** To avoid a resource leak, every open [BLOB handle] should eventually
57835780
** be released by a call to [sqlite3_blob_close()].
57845781
*/
5785
-SQLITE_API int sqlite3_blob_open(
5782
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
57865783
sqlite3*,
57875784
const char *zDb,
57885785
const char *zTable,
57895786
const char *zColumn,
57905787
sqlite3_int64 iRow,
@@ -5812,11 +5809,11 @@
58125809
** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
58135810
** always returns zero.
58145811
**
58155812
** ^This function sets the database handle error code and message.
58165813
*/
5817
-SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
5814
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
58185815
58195816
/*
58205817
** CAPI3REF: Close A BLOB Handle
58215818
**
58225819
** ^This function closes an open [BLOB handle]. ^(The BLOB handle is closed
@@ -5834,11 +5831,11 @@
58345831
** with a null pointer (such as would be returned by a failed call to
58355832
** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function
58365833
** is passed a valid open blob handle, the values returned by the
58375834
** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning.
58385835
*/
5839
-SQLITE_API int sqlite3_blob_close(sqlite3_blob *);
5836
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *);
58405837
58415838
/*
58425839
** CAPI3REF: Return The Size Of An Open BLOB
58435840
**
58445841
** ^Returns the size in bytes of the BLOB accessible via the
@@ -5849,11 +5846,11 @@
58495846
** This routine only works on a [BLOB handle] which has been created
58505847
** by a prior successful call to [sqlite3_blob_open()] and which has not
58515848
** been closed by [sqlite3_blob_close()]. Passing any other pointer in
58525849
** to this routine results in undefined and probably undesirable behavior.
58535850
*/
5854
-SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *);
5851
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *);
58555852
58565853
/*
58575854
** CAPI3REF: Read Data From A BLOB Incrementally
58585855
**
58595856
** ^(This function is used to read data from an open [BLOB handle] into a
@@ -5877,11 +5874,11 @@
58775874
** been closed by [sqlite3_blob_close()]. Passing any other pointer in
58785875
** to this routine results in undefined and probably undesirable behavior.
58795876
**
58805877
** See also: [sqlite3_blob_write()].
58815878
*/
5882
-SQLITE_API int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
5879
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
58835880
58845881
/*
58855882
** CAPI3REF: Write Data Into A BLOB Incrementally
58865883
**
58875884
** ^(This function is used to write data into an open [BLOB handle] from a
@@ -5918,11 +5915,11 @@
59185915
** been closed by [sqlite3_blob_close()]. Passing any other pointer in
59195916
** to this routine results in undefined and probably undesirable behavior.
59205917
**
59215918
** See also: [sqlite3_blob_read()].
59225919
*/
5923
-SQLITE_API int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
5920
+SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
59245921
59255922
/*
59265923
** CAPI3REF: Virtual File System Objects
59275924
**
59285925
** A virtual filesystem (VFS) is an [sqlite3_vfs] object
@@ -5949,13 +5946,13 @@
59495946
**
59505947
** ^Unregister a VFS with the sqlite3_vfs_unregister() interface.
59515948
** ^(If the default VFS is unregistered, another VFS is chosen as
59525949
** the default. The choice for the new VFS is arbitrary.)^
59535950
*/
5954
-SQLITE_API sqlite3_vfs *sqlite3_vfs_find(const char *zVfsName);
5955
-SQLITE_API int sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
5956
-SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*);
5951
+SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfsName);
5952
+SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
5953
+SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs*);
59575954
59585955
/*
59595956
** CAPI3REF: Mutexes
59605957
**
59615958
** The SQLite core uses these routines for thread
@@ -6064,15 +6061,15 @@
60646061
** sqlite3_mutex_leave() is a NULL pointer, then all three routines
60656062
** behave as no-ops.
60666063
**
60676064
** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
60686065
*/
6069
-SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int);
6070
-SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*);
6071
-SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*);
6072
-SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*);
6073
-SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*);
6066
+SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int);
6067
+SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*);
6068
+SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*);
6069
+SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*);
6070
+SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*);
60746071
60756072
/*
60766073
** CAPI3REF: Mutex Methods Object
60776074
**
60786075
** An instance of this structure defines the low-level routines
@@ -6178,12 +6175,12 @@
61786175
** call to sqlite3_mutex_held() to fail, so a non-zero return is
61796176
** the appropriate thing to do. The sqlite3_mutex_notheld()
61806177
** interface should also return 1 when given a NULL pointer.
61816178
*/
61826179
#ifndef NDEBUG
6183
-SQLITE_API int sqlite3_mutex_held(sqlite3_mutex*);
6184
-SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex*);
6180
+SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex*);
6181
+SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex*);
61856182
#endif
61866183
61876184
/*
61886185
** CAPI3REF: Mutex Types
61896186
**
@@ -6215,11 +6212,11 @@
62156212
** serializes access to the [database connection] given in the argument
62166213
** when the [threading mode] is Serialized.
62176214
** ^If the [threading mode] is Single-thread or Multi-thread then this
62186215
** routine returns a NULL pointer.
62196216
*/
6220
-SQLITE_API sqlite3_mutex *sqlite3_db_mutex(sqlite3*);
6217
+SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3*);
62216218
62226219
/*
62236220
** CAPI3REF: Low-Level Control Of Database Files
62246221
**
62256222
** ^The [sqlite3_file_control()] interface makes a direct call to the
@@ -6249,11 +6246,11 @@
62496246
** an incorrect zDbName and an SQLITE_ERROR return from the underlying
62506247
** xFileControl method.
62516248
**
62526249
** See also: [SQLITE_FCNTL_LOCKSTATE]
62536250
*/
6254
-SQLITE_API int sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
6251
+SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
62556252
62566253
/*
62576254
** CAPI3REF: Testing Interface
62586255
**
62596256
** ^The sqlite3_test_control() interface is used to read out internal
@@ -6268,11 +6265,11 @@
62686265
** The details of the operation codes, their meanings, the parameters
62696266
** they take, and what they do are all subject to change without notice.
62706267
** Unlike most of the SQLite API, this function is not guaranteed to
62716268
** operate consistently from one release to the next.
62726269
*/
6273
-SQLITE_API int sqlite3_test_control(int op, ...);
6270
+SQLITE_API int SQLITE_CDECL sqlite3_test_control(int op, ...);
62746271
62756272
/*
62766273
** CAPI3REF: Testing Interface Operation Codes
62776274
**
62786275
** These constants are the valid operation code parameters used
@@ -6331,12 +6328,12 @@
63316328
** be represented by a 32-bit integer, then the values returned by
63326329
** sqlite3_status() are undefined.
63336330
**
63346331
** See also: [sqlite3_db_status()]
63356332
*/
6336
-SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6337
-SQLITE_API int sqlite3_status64(
6333
+SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6334
+SQLITE_API int SQLITE_STDCALL sqlite3_status64(
63386335
int op,
63396336
sqlite3_int64 *pCurrent,
63406337
sqlite3_int64 *pHighwater,
63416338
int resetFlag
63426339
);
@@ -6455,11 +6452,11 @@
64556452
** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a
64566453
** non-zero [error code] on failure.
64576454
**
64586455
** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
64596456
*/
6460
-SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
6457
+SQLITE_API int SQLITE_STDCALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
64616458
64626459
/*
64636460
** CAPI3REF: Status Parameters for database connections
64646461
** KEYWORDS: {SQLITE_DBSTATUS options}
64656462
**
@@ -6584,11 +6581,11 @@
65846581
** ^If the resetFlg is true, then the counter is reset to zero after this
65856582
** interface call returns.
65866583
**
65876584
** See also: [sqlite3_status()] and [sqlite3_db_status()].
65886585
*/
6589
-SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
6586
+SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
65906587
65916588
/*
65926589
** CAPI3REF: Status Parameters for prepared statements
65936590
** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters}
65946591
**
@@ -7053,20 +7050,20 @@
70537050
** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()
70547051
** APIs are not strictly speaking threadsafe. If they are invoked at the
70557052
** same time as another thread is invoking sqlite3_backup_step() it is
70567053
** possible that they return invalid values.
70577054
*/
7058
-SQLITE_API sqlite3_backup *sqlite3_backup_init(
7055
+SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
70597056
sqlite3 *pDest, /* Destination database handle */
70607057
const char *zDestName, /* Destination database name */
70617058
sqlite3 *pSource, /* Source database handle */
70627059
const char *zSourceName /* Source database name */
70637060
);
7064
-SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage);
7065
-SQLITE_API int sqlite3_backup_finish(sqlite3_backup *p);
7066
-SQLITE_API int sqlite3_backup_remaining(sqlite3_backup *p);
7067
-SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p);
7061
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage);
7062
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p);
7063
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p);
7064
+SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p);
70687065
70697066
/*
70707067
** CAPI3REF: Unlock Notification
70717068
**
70727069
** ^When running in shared-cache mode, a database operation may fail with
@@ -7178,11 +7175,11 @@
71787175
** by an sqlite3_step() call. ^(If there is a blocking connection, then the
71797176
** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in
71807177
** the special "DROP TABLE/INDEX" case, the extended error code is just
71817178
** SQLITE_LOCKED.)^
71827179
*/
7183
-SQLITE_API int sqlite3_unlock_notify(
7180
+SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
71847181
sqlite3 *pBlocked, /* Waiting connection */
71857182
void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */
71867183
void *pNotifyArg /* Argument to pass to xNotify */
71877184
);
71887185
@@ -7193,12 +7190,12 @@
71937190
** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications
71947191
** and extensions to compare the contents of two buffers containing UTF-8
71957192
** strings in a case-independent fashion, using the same definition of "case
71967193
** independence" that SQLite uses internally when comparing identifiers.
71977194
*/
7198
-SQLITE_API int sqlite3_stricmp(const char *, const char *);
7199
-SQLITE_API int sqlite3_strnicmp(const char *, const char *, int);
7195
+SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *, const char *);
7196
+SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *, const char *, int);
72007197
72017198
/*
72027199
** CAPI3REF: String Globbing
72037200
*
72047201
** ^The [sqlite3_strglob(P,X)] interface returns zero if string X matches
@@ -7209,11 +7206,11 @@
72097206
** sensitive.
72107207
**
72117208
** Note that this routine returns zero on a match and non-zero if the strings
72127209
** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
72137210
*/
7214
-SQLITE_API int sqlite3_strglob(const char *zGlob, const char *zStr);
7211
+SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlob, const char *zStr);
72157212
72167213
/*
72177214
** CAPI3REF: Error Logging Interface
72187215
**
72197216
** ^The [sqlite3_log()] interface writes a message into the [error log]
@@ -7232,11 +7229,11 @@
72327229
** will not use dynamically allocated memory. The log message is stored in
72337230
** a fixed-length buffer on the stack. If the log message is longer than
72347231
** a few hundred characters, it will be truncated to the length of the
72357232
** buffer.
72367233
*/
7237
-SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...);
7234
+SQLITE_API void SQLITE_CDECL sqlite3_log(int iErrCode, const char *zFormat, ...);
72387235
72397236
/*
72407237
** CAPI3REF: Write-Ahead Log Commit Hook
72417238
**
72427239
** ^The [sqlite3_wal_hook()] function is used to register a callback that
@@ -7267,11 +7264,11 @@
72677264
** previously registered write-ahead log callback. ^Note that the
72687265
** [sqlite3_wal_autocheckpoint()] interface and the
72697266
** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will
72707267
** those overwrite any prior [sqlite3_wal_hook()] settings.
72717268
*/
7272
-SQLITE_API void *sqlite3_wal_hook(
7269
+SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
72737270
sqlite3*,
72747271
int(*)(void *,sqlite3*,const char*,int),
72757272
void*
72767273
);
72777274
@@ -7301,11 +7298,11 @@
73017298
** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]
73027299
** pages. The use of this interface
73037300
** is only necessary if the default setting is found to be suboptimal
73047301
** for a particular application.
73057302
*/
7306
-SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
7303
+SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
73077304
73087305
/*
73097306
** CAPI3REF: Checkpoint a database
73107307
**
73117308
** ^(The sqlite3_wal_checkpoint(D,X) is equivalent to
@@ -7322,11 +7319,11 @@
73227319
** interface was added. This interface is retained for backwards
73237320
** compatibility and as a convenience for applications that need to manually
73247321
** start a callback but which do not need the full power (and corresponding
73257322
** complication) of [sqlite3_wal_checkpoint_v2()].
73267323
*/
7327
-SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
7324
+SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
73287325
73297326
/*
73307327
** CAPI3REF: Checkpoint a database
73317328
**
73327329
** ^(The sqlite3_wal_checkpoint_v2(D,X,M,L,C) interface runs a checkpoint
@@ -7415,11 +7412,11 @@
74157412
** [sqlite3_errcode()] and [sqlite3_errmsg()].
74167413
**
74177414
** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface
74187415
** from SQL.
74197416
*/
7420
-SQLITE_API int sqlite3_wal_checkpoint_v2(
7417
+SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
74217418
sqlite3 *db, /* Database handle */
74227419
const char *zDb, /* Name of attached database (or NULL) */
74237420
int eMode, /* SQLITE_CHECKPOINT_* value */
74247421
int *pnLog, /* OUT: Size of WAL log in frames */
74257422
int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -7451,11 +7448,11 @@
74517448
**
74527449
** At present, there is only one option that may be configured using
74537450
** this function. (See [SQLITE_VTAB_CONSTRAINT_SUPPORT].) Further options
74547451
** may be added in the future.
74557452
*/
7456
-SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...);
7453
+SQLITE_API int SQLITE_CDECL sqlite3_vtab_config(sqlite3*, int op, ...);
74577454
74587455
/*
74597456
** CAPI3REF: Virtual Table Configuration Options
74607457
**
74617458
** These macros define the various options to the
@@ -7504,11 +7501,11 @@
75047501
** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL],
75057502
** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode
75067503
** of the SQL statement that triggered the call to the [xUpdate] method of the
75077504
** [virtual table].
75087505
*/
7509
-SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *);
7506
+SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *);
75107507
75117508
/*
75127509
** CAPI3REF: Conflict resolution modes
75137510
** KEYWORDS: {conflict resolution mode}
75147511
**
@@ -7608,11 +7605,11 @@
76087605
** as if the loop did not exist - it returns non-zero and leave the variable
76097606
** that pOut points to unchanged.
76107607
**
76117608
** See also: [sqlite3_stmt_scanstatus_reset()]
76127609
*/
7613
-SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_stmt_scanstatus(
7610
+SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_stmt_scanstatus(
76147611
sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
76157612
int idx, /* Index of loop to report on */
76167613
int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
76177614
void *pOut /* Result written here */
76187615
);
@@ -7623,11 +7620,11 @@
76237620
** ^Zero all [sqlite3_stmt_scanstatus()] related event counters.
76247621
**
76257622
** This API is only available if the library is built with pre-processor
76267623
** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined.
76277624
*/
7628
-SQLITE_API SQLITE_EXPERIMENTAL void sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
7625
+SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
76297626
76307627
76317628
/*
76327629
** Undo the hack that converts floating point types to integer for
76337630
** builds on processors without floating point support.
@@ -7678,11 +7675,11 @@
76787675
** Register a geometry callback named zGeom that can be used as part of an
76797676
** R-Tree geometry query as follows:
76807677
**
76817678
** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
76827679
*/
7683
-SQLITE_API int sqlite3_rtree_geometry_callback(
7680
+SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
76847681
sqlite3 *db,
76857682
const char *zGeom,
76867683
int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
76877684
void *pContext
76887685
);
@@ -7704,11 +7701,11 @@
77047701
** Register a 2nd-generation geometry callback named zScore that can be
77057702
** used as part of an R-Tree geometry query as follows:
77067703
**
77077704
** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...)
77087705
*/
7709
-SQLITE_API int sqlite3_rtree_query_callback(
7706
+SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
77107707
sqlite3 *db,
77117708
const char *zQueryFunc,
77127709
int (*xQueryFunc)(sqlite3_rtree_query_info*),
77137710
void *pContext,
77147711
void (*xDestructor)(void*)
77157712
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -41,27 +41,24 @@
41 extern "C" {
42 #endif
43
44
45 /*
46 ** Add the ability to override 'extern'
47 */
48 #ifndef SQLITE_EXTERN
49 # define SQLITE_EXTERN extern
50 #endif
51
52 #ifndef SQLITE_API
53 # define SQLITE_API
54 #endif
55
56
57 /*
58 ** Add the ability to override 'cdecl'
59 */
60 #ifndef SQLITE_CDECL
61 # define SQLITE_CDECL
62 #endif
 
 
 
63
64 /*
65 ** These no-op macros are used in front of interfaces to mark those
66 ** interfaces as either deprecated or experimental. New applications
67 ** should not use deprecated interfaces - they are supported for backwards
@@ -114,11 +111,11 @@
114 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
115 ** [sqlite_version()] and [sqlite_source_id()].
116 */
117 #define SQLITE_VERSION "3.8.9"
118 #define SQLITE_VERSION_NUMBER 3008009
119 #define SQLITE_SOURCE_ID "2015-03-24 18:19:39 436314b5728c9413f9ac2d837e1c19364f31be72"
120
121 /*
122 ** CAPI3REF: Run-Time Library Version Numbers
123 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
124 **
@@ -147,13 +144,13 @@
147 ** [SQLITE_SOURCE_ID] C preprocessor macro.
148 **
149 ** See also: [sqlite_version()] and [sqlite_source_id()].
150 */
151 SQLITE_API SQLITE_EXTERN const char sqlite3_version[];
152 SQLITE_API const char *sqlite3_libversion(void);
153 SQLITE_API const char *sqlite3_sourceid(void);
154 SQLITE_API int sqlite3_libversion_number(void);
155
156 /*
157 ** CAPI3REF: Run-Time Library Compilation Options Diagnostics
158 **
159 ** ^The sqlite3_compileoption_used() function returns 0 or 1
@@ -174,12 +171,12 @@
174 **
175 ** See also: SQL functions [sqlite_compileoption_used()] and
176 ** [sqlite_compileoption_get()] and the [compile_options pragma].
177 */
178 #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
179 SQLITE_API int sqlite3_compileoption_used(const char *zOptName);
180 SQLITE_API const char *sqlite3_compileoption_get(int N);
181 #endif
182
183 /*
184 ** CAPI3REF: Test To See If The Library Is Threadsafe
185 **
@@ -214,11 +211,11 @@
214 ** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
215 ** is unchanged by calls to sqlite3_config().)^
216 **
217 ** See the [threading mode] documentation for additional information.
218 */
219 SQLITE_API int sqlite3_threadsafe(void);
220
221 /*
222 ** CAPI3REF: Database Connection Handle
223 ** KEYWORDS: {database connection} {database connections}
224 **
@@ -310,12 +307,12 @@
310 ** from [sqlite3_open()], [sqlite3_open16()], or
311 ** [sqlite3_open_v2()], and not previously closed.
312 ** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
313 ** argument is a harmless no-op.
314 */
315 SQLITE_API int sqlite3_close(sqlite3*);
316 SQLITE_API int sqlite3_close_v2(sqlite3*);
317
318 /*
319 ** The type for a callback function.
320 ** This is legacy and deprecated. It is included for historical
321 ** compatibility and is not documented.
@@ -381,11 +378,11 @@
381 ** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
382 ** <li> The application must not modify the SQL statement text passed into
383 ** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
384 ** </ul>
385 */
386 SQLITE_API int sqlite3_exec(
387 sqlite3*, /* An open database */
388 const char *sql, /* SQL to be evaluated */
389 int (*callback)(void*,int,char**,char**), /* Callback function */
390 void *, /* 1st argument to callback */
391 char **errmsg /* Error msg written here */
@@ -1341,14 +1338,14 @@
1341 ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied
1342 ** implementation of sqlite3_os_init() or sqlite3_os_end()
1343 ** must return [SQLITE_OK] on success and some other [error code] upon
1344 ** failure.
1345 */
1346 SQLITE_API int sqlite3_initialize(void);
1347 SQLITE_API int sqlite3_shutdown(void);
1348 SQLITE_API int sqlite3_os_init(void);
1349 SQLITE_API int sqlite3_os_end(void);
1350
1351 /*
1352 ** CAPI3REF: Configuring The SQLite Library
1353 **
1354 ** The sqlite3_config() interface is used to make global configuration
@@ -1375,11 +1372,11 @@
1375 **
1376 ** ^When a configuration option is set, sqlite3_config() returns [SQLITE_OK].
1377 ** ^If the option is unknown or SQLite is unable to set the option
1378 ** then this routine returns a non-zero [error code].
1379 */
1380 SQLITE_API int sqlite3_config(int, ...);
1381
1382 /*
1383 ** CAPI3REF: Configure database connections
1384 **
1385 ** The sqlite3_db_config() interface is used to make configuration
@@ -1393,11 +1390,11 @@
1393 ** Subsequent arguments vary depending on the configuration verb.
1394 **
1395 ** ^Calls to sqlite3_db_config() return SQLITE_OK if and only if
1396 ** the call is considered successful.
1397 */
1398 SQLITE_API int sqlite3_db_config(sqlite3*, int op, ...);
1399
1400 /*
1401 ** CAPI3REF: Memory Allocation Routines
1402 **
1403 ** An instance of this object defines the interface between SQLite
@@ -1881,11 +1878,11 @@
1881 **
1882 ** ^The sqlite3_extended_result_codes() routine enables or disables the
1883 ** [extended result codes] feature of SQLite. ^The extended result
1884 ** codes are disabled by default for historical compatibility.
1885 */
1886 SQLITE_API int sqlite3_extended_result_codes(sqlite3*, int onoff);
1887
1888 /*
1889 ** CAPI3REF: Last Insert Rowid
1890 **
1891 ** ^Each entry in most SQLite tables (except for [WITHOUT ROWID] tables)
@@ -1932,11 +1929,11 @@
1932 ** function is running and thus changes the last insert [rowid],
1933 ** then the value returned by [sqlite3_last_insert_rowid()] is
1934 ** unpredictable and might not equal either the old or the new
1935 ** last insert [rowid].
1936 */
1937 SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*);
1938
1939 /*
1940 ** CAPI3REF: Count The Number Of Rows Modified
1941 **
1942 ** ^This function returns the number of rows modified, inserted or
@@ -1984,11 +1981,11 @@
1984 **
1985 ** If a separate thread makes changes on the same database connection
1986 ** while [sqlite3_changes()] is running then the value returned
1987 ** is unpredictable and not meaningful.
1988 */
1989 SQLITE_API int sqlite3_changes(sqlite3*);
1990
1991 /*
1992 ** CAPI3REF: Total Number Of Rows Modified
1993 **
1994 ** ^This function returns the total number of rows inserted, modified or
@@ -2007,11 +2004,11 @@
2007 **
2008 ** If a separate thread makes changes on the same database connection
2009 ** while [sqlite3_total_changes()] is running then the value
2010 ** returned is unpredictable and not meaningful.
2011 */
2012 SQLITE_API int sqlite3_total_changes(sqlite3*);
2013
2014 /*
2015 ** CAPI3REF: Interrupt A Long-Running Query
2016 **
2017 ** ^This function causes any pending database operation to abort and
@@ -2046,11 +2043,11 @@
2046 ** that are started after the sqlite3_interrupt() call returns.
2047 **
2048 ** If the database connection closes while [sqlite3_interrupt()]
2049 ** is running then bad things will likely happen.
2050 */
2051 SQLITE_API void sqlite3_interrupt(sqlite3*);
2052
2053 /*
2054 ** CAPI3REF: Determine If An SQL Statement Is Complete
2055 **
2056 ** These routines are useful during command-line input to determine if the
@@ -2081,12 +2078,12 @@
2081 ** UTF-8 string.
2082 **
2083 ** The input to [sqlite3_complete16()] must be a zero-terminated
2084 ** UTF-16 string in native byte order.
2085 */
2086 SQLITE_API int sqlite3_complete(const char *sql);
2087 SQLITE_API int sqlite3_complete16(const void *sql);
2088
2089 /*
2090 ** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
2091 ** KEYWORDS: {busy-handler callback} {busy handler}
2092 **
@@ -2142,11 +2139,11 @@
2142 ** result in undefined behavior.
2143 **
2144 ** A busy handler must not close the database connection
2145 ** or [prepared statement] that invoked the busy handler.
2146 */
2147 SQLITE_API int sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*);
2148
2149 /*
2150 ** CAPI3REF: Set A Busy Timeout
2151 **
2152 ** ^This routine sets a [sqlite3_busy_handler | busy handler] that sleeps
@@ -2164,11 +2161,11 @@
2164 ** was defined (using [sqlite3_busy_handler()]) prior to calling
2165 ** this routine, that other busy handler is cleared.)^
2166 **
2167 ** See also: [PRAGMA busy_timeout]
2168 */
2169 SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms);
2170
2171 /*
2172 ** CAPI3REF: Convenience Routines For Running Queries
2173 **
2174 ** This is a legacy interface that is preserved for backwards compatibility.
@@ -2238,19 +2235,19 @@
2238 ** interface defined here. As a consequence, errors that occur in the
2239 ** wrapper layer outside of the internal [sqlite3_exec()] call are not
2240 ** reflected in subsequent calls to [sqlite3_errcode()] or
2241 ** [sqlite3_errmsg()].
2242 */
2243 SQLITE_API int sqlite3_get_table(
2244 sqlite3 *db, /* An open database */
2245 const char *zSql, /* SQL to be evaluated */
2246 char ***pazResult, /* Results of the query */
2247 int *pnRow, /* Number of result rows written here */
2248 int *pnColumn, /* Number of result columns written here */
2249 char **pzErrmsg /* Error msg written here */
2250 );
2251 SQLITE_API void sqlite3_free_table(char **result);
2252
2253 /*
2254 ** CAPI3REF: Formatted String Printing Functions
2255 **
2256 ** These routines are work-alikes of the "printf()" family of functions
@@ -2352,14 +2349,14 @@
2352 **
2353 ** ^(The "%z" formatting option works like "%s" but with the
2354 ** addition that after the string has been read and copied into
2355 ** the result, [sqlite3_free()] is called on the input string.)^
2356 */
2357 SQLITE_API char *sqlite3_mprintf(const char*,...);
2358 SQLITE_API char *sqlite3_vmprintf(const char*, va_list);
2359 SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...);
2360 SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);
2361
2362 /*
2363 ** CAPI3REF: Memory Allocation Subsystem
2364 **
2365 ** The SQLite core uses these three routines for all of its own
@@ -2445,16 +2442,16 @@
2445 **
2446 ** The application must not read or write any part of
2447 ** a block of memory after it has been released using
2448 ** [sqlite3_free()] or [sqlite3_realloc()].
2449 */
2450 SQLITE_API void *sqlite3_malloc(int);
2451 SQLITE_API void *sqlite3_malloc64(sqlite3_uint64);
2452 SQLITE_API void *sqlite3_realloc(void*, int);
2453 SQLITE_API void *sqlite3_realloc64(void*, sqlite3_uint64);
2454 SQLITE_API void sqlite3_free(void*);
2455 SQLITE_API sqlite3_uint64 sqlite3_msize(void*);
2456
2457 /*
2458 ** CAPI3REF: Memory Allocator Statistics
2459 **
2460 ** SQLite provides these two interfaces for reporting on the status
@@ -2475,12 +2472,12 @@
2475 ** [sqlite3_memory_used()] if and only if the parameter to
2476 ** [sqlite3_memory_highwater()] is true. ^The value returned
2477 ** by [sqlite3_memory_highwater(1)] is the high-water mark
2478 ** prior to the reset.
2479 */
2480 SQLITE_API sqlite3_int64 sqlite3_memory_used(void);
2481 SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int resetFlag);
2482
2483 /*
2484 ** CAPI3REF: Pseudo-Random Number Generator
2485 **
2486 ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
@@ -2499,11 +2496,11 @@
2499 ** ^If the previous call to this routine had an N of 1 or more and a
2500 ** non-NULL P then the pseudo-randomness is generated
2501 ** internally and without recourse to the [sqlite3_vfs] xRandomness
2502 ** method.
2503 */
2504 SQLITE_API void sqlite3_randomness(int N, void *P);
2505
2506 /*
2507 ** CAPI3REF: Compile-Time Authorization Callbacks
2508 **
2509 ** ^This routine registers an authorizer callback with a particular
@@ -2581,11 +2578,11 @@
2581 ** [sqlite3_prepare()] or its variants. Authorization is not
2582 ** performed during statement evaluation in [sqlite3_step()], unless
2583 ** as stated in the previous paragraph, sqlite3_step() invokes
2584 ** sqlite3_prepare_v2() to reprepare a statement after a schema change.
2585 */
2586 SQLITE_API int sqlite3_set_authorizer(
2587 sqlite3*,
2588 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
2589 void *pUserData
2590 );
2591
@@ -2685,12 +2682,12 @@
2685 ** digits in the time are meaningless. Future versions of SQLite
2686 ** might provide greater resolution on the profiler callback. The
2687 ** sqlite3_profile() function is considered experimental and is
2688 ** subject to change in future versions of SQLite.
2689 */
2690 SQLITE_API void *sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*);
2691 SQLITE_API SQLITE_EXPERIMENTAL void *sqlite3_profile(sqlite3*,
2692 void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
2693
2694 /*
2695 ** CAPI3REF: Query Progress Callbacks
2696 **
@@ -2720,11 +2717,11 @@
2720 ** the database connection that invoked the progress handler.
2721 ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
2722 ** database connections for the meaning of "modify" in this paragraph.
2723 **
2724 */
2725 SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
2726
2727 /*
2728 ** CAPI3REF: Opening A New Database Connection
2729 **
2730 ** ^These routines open an SQLite database file as specified by the
@@ -2948,19 +2945,19 @@
2948 ** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various
2949 ** features that require the use of temporary files may fail.
2950 **
2951 ** See also: [sqlite3_temp_directory]
2952 */
2953 SQLITE_API int sqlite3_open(
2954 const char *filename, /* Database filename (UTF-8) */
2955 sqlite3 **ppDb /* OUT: SQLite db handle */
2956 );
2957 SQLITE_API int sqlite3_open16(
2958 const void *filename, /* Database filename (UTF-16) */
2959 sqlite3 **ppDb /* OUT: SQLite db handle */
2960 );
2961 SQLITE_API int sqlite3_open_v2(
2962 const char *filename, /* Database filename (UTF-8) */
2963 sqlite3 **ppDb, /* OUT: SQLite db handle */
2964 int flags, /* Flags */
2965 const char *zVfs /* Name of VFS module to use */
2966 );
@@ -3002,13 +2999,13 @@
3002 ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and
3003 ** is not a database file pathname pointer that SQLite passed into the xOpen
3004 ** VFS method, then the behavior of this routine is undefined and probably
3005 ** undesirable.
3006 */
3007 SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3008 SQLITE_API int sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3009 SQLITE_API sqlite3_int64 sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
3010
3011
3012 /*
3013 ** CAPI3REF: Error Codes And Messages
3014 **
@@ -3047,15 +3044,15 @@
3047 **
3048 ** If an interface fails with SQLITE_MISUSE, that means the interface
3049 ** was invoked incorrectly by the application. In that case, the
3050 ** error code and message may or may not be set.
3051 */
3052 SQLITE_API int sqlite3_errcode(sqlite3 *db);
3053 SQLITE_API int sqlite3_extended_errcode(sqlite3 *db);
3054 SQLITE_API const char *sqlite3_errmsg(sqlite3*);
3055 SQLITE_API const void *sqlite3_errmsg16(sqlite3*);
3056 SQLITE_API const char *sqlite3_errstr(int);
3057
3058 /*
3059 ** CAPI3REF: SQL Statement Object
3060 ** KEYWORDS: {prepared statement} {prepared statements}
3061 **
@@ -3118,11 +3115,11 @@
3118 ** created by an untrusted script can be contained using the
3119 ** [max_page_count] [PRAGMA].
3120 **
3121 ** New run-time limit categories may be added in future releases.
3122 */
3123 SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal);
3124
3125 /*
3126 ** CAPI3REF: Run-Time Limit Categories
3127 ** KEYWORDS: {limit category} {*limit categories}
3128 **
@@ -3268,32 +3265,32 @@
3268 ** or [GLOB] operator or if the parameter is compared to an indexed column
3269 ** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
3270 ** </li>
3271 ** </ol>
3272 */
3273 SQLITE_API int sqlite3_prepare(
3274 sqlite3 *db, /* Database handle */
3275 const char *zSql, /* SQL statement, UTF-8 encoded */
3276 int nByte, /* Maximum length of zSql in bytes. */
3277 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3278 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3279 );
3280 SQLITE_API int sqlite3_prepare_v2(
3281 sqlite3 *db, /* Database handle */
3282 const char *zSql, /* SQL statement, UTF-8 encoded */
3283 int nByte, /* Maximum length of zSql in bytes. */
3284 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3285 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3286 );
3287 SQLITE_API int sqlite3_prepare16(
3288 sqlite3 *db, /* Database handle */
3289 const void *zSql, /* SQL statement, UTF-16 encoded */
3290 int nByte, /* Maximum length of zSql in bytes. */
3291 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3292 const void **pzTail /* OUT: Pointer to unused portion of zSql */
3293 );
3294 SQLITE_API int sqlite3_prepare16_v2(
3295 sqlite3 *db, /* Database handle */
3296 const void *zSql, /* SQL statement, UTF-16 encoded */
3297 int nByte, /* Maximum length of zSql in bytes. */
3298 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3299 const void **pzTail /* OUT: Pointer to unused portion of zSql */
@@ -3304,11 +3301,11 @@
3304 **
3305 ** ^This interface can be used to retrieve a saved copy of the original
3306 ** SQL text used to create a [prepared statement] if that statement was
3307 ** compiled using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()].
3308 */
3309 SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt);
3310
3311 /*
3312 ** CAPI3REF: Determine If An SQL Statement Writes The Database
3313 **
3314 ** ^The sqlite3_stmt_readonly(X) interface returns true (non-zero) if
@@ -3335,11 +3332,11 @@
3335 ** database. ^The [ATTACH] and [DETACH] statements also cause
3336 ** sqlite3_stmt_readonly() to return true since, while those statements
3337 ** change the configuration of a database connection, they do not make
3338 ** changes to the content of the database files on disk.
3339 */
3340 SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
3341
3342 /*
3343 ** CAPI3REF: Determine If A Prepared Statement Has Been Reset
3344 **
3345 ** ^The sqlite3_stmt_busy(S) interface returns true (non-zero) if the
@@ -3354,11 +3351,11 @@
3354 ** to locate all prepared statements associated with a database
3355 ** connection that are in need of being reset. This can be used,
3356 ** for example, in diagnostic routines to search for prepared
3357 ** statements that are holding a transaction open.
3358 */
3359 SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt*);
3360
3361 /*
3362 ** CAPI3REF: Dynamically Typed Value Object
3363 ** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
3364 **
@@ -3515,23 +3512,23 @@
3515 ** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails.
3516 **
3517 ** See also: [sqlite3_bind_parameter_count()],
3518 ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].
3519 */
3520 SQLITE_API int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
3521 SQLITE_API int sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
3522 void(*)(void*));
3523 SQLITE_API int sqlite3_bind_double(sqlite3_stmt*, int, double);
3524 SQLITE_API int sqlite3_bind_int(sqlite3_stmt*, int, int);
3525 SQLITE_API int sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
3526 SQLITE_API int sqlite3_bind_null(sqlite3_stmt*, int);
3527 SQLITE_API int sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
3528 SQLITE_API int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
3529 SQLITE_API int sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
3530 void(*)(void*), unsigned char encoding);
3531 SQLITE_API int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
3532 SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
3533
3534 /*
3535 ** CAPI3REF: Number Of SQL Parameters
3536 **
3537 ** ^This routine can be used to find the number of [SQL parameters]
@@ -3547,11 +3544,11 @@
3547 **
3548 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3549 ** [sqlite3_bind_parameter_name()], and
3550 ** [sqlite3_bind_parameter_index()].
3551 */
3552 SQLITE_API int sqlite3_bind_parameter_count(sqlite3_stmt*);
3553
3554 /*
3555 ** CAPI3REF: Name Of A Host Parameter
3556 **
3557 ** ^The sqlite3_bind_parameter_name(P,N) interface returns
@@ -3574,11 +3571,11 @@
3574 **
3575 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3576 ** [sqlite3_bind_parameter_count()], and
3577 ** [sqlite3_bind_parameter_index()].
3578 */
3579 SQLITE_API const char *sqlite3_bind_parameter_name(sqlite3_stmt*, int);
3580
3581 /*
3582 ** CAPI3REF: Index Of A Parameter With A Given Name
3583 **
3584 ** ^Return the index of an SQL parameter given its name. ^The
@@ -3590,20 +3587,20 @@
3590 **
3591 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3592 ** [sqlite3_bind_parameter_count()], and
3593 ** [sqlite3_bind_parameter_index()].
3594 */
3595 SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
3596
3597 /*
3598 ** CAPI3REF: Reset All Bindings On A Prepared Statement
3599 **
3600 ** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset
3601 ** the [sqlite3_bind_blob | bindings] on a [prepared statement].
3602 ** ^Use this routine to reset all host parameters to NULL.
3603 */
3604 SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt*);
3605
3606 /*
3607 ** CAPI3REF: Number Of Columns In A Result Set
3608 **
3609 ** ^Return the number of columns in the result set returned by the
@@ -3610,11 +3607,11 @@
3610 ** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
3611 ** statement that does not return data (for example an [UPDATE]).
3612 **
3613 ** See also: [sqlite3_data_count()]
3614 */
3615 SQLITE_API int sqlite3_column_count(sqlite3_stmt *pStmt);
3616
3617 /*
3618 ** CAPI3REF: Column Names In A Result Set
3619 **
3620 ** ^These routines return the name assigned to a particular column
@@ -3638,12 +3635,12 @@
3638 ** ^The name of a result column is the value of the "AS" clause for
3639 ** that column, if there is an AS clause. If there is no AS clause
3640 ** then the name of the column is unspecified and may change from
3641 ** one release of SQLite to the next.
3642 */
3643 SQLITE_API const char *sqlite3_column_name(sqlite3_stmt*, int N);
3644 SQLITE_API const void *sqlite3_column_name16(sqlite3_stmt*, int N);
3645
3646 /*
3647 ** CAPI3REF: Source Of Data In A Query Result
3648 **
3649 ** ^These routines provide a means to determine the database, table, and
@@ -3686,16 +3683,16 @@
3686 ** If two or more threads call one or more
3687 ** [sqlite3_column_database_name | column metadata interfaces]
3688 ** for the same [prepared statement] and result column
3689 ** at the same time then the results are undefined.
3690 */
3691 SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int);
3692 SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int);
3693 SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int);
3694 SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int);
3695 SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int);
3696 SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);
3697
3698 /*
3699 ** CAPI3REF: Declared Datatype Of A Query Result
3700 **
3701 ** ^(The first parameter is a [prepared statement].
@@ -3722,12 +3719,12 @@
3722 ** data stored in that column is of the declared type. SQLite is
3723 ** strongly typed, but the typing is dynamic not static. ^Type
3724 ** is associated with individual values, not with the containers
3725 ** used to hold those values.
3726 */
3727 SQLITE_API const char *sqlite3_column_decltype(sqlite3_stmt*,int);
3728 SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int);
3729
3730 /*
3731 ** CAPI3REF: Evaluate An SQL Statement
3732 **
3733 ** After a [prepared statement] has been prepared using either
@@ -3802,11 +3799,11 @@
3802 ** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
3803 ** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,
3804 ** then the more specific [error codes] are returned directly
3805 ** by sqlite3_step(). The use of the "v2" interface is recommended.
3806 */
3807 SQLITE_API int sqlite3_step(sqlite3_stmt*);
3808
3809 /*
3810 ** CAPI3REF: Number of columns in a result set
3811 **
3812 ** ^The sqlite3_data_count(P) interface returns the number of columns in the
@@ -3822,11 +3819,11 @@
3822 ** where it always returns zero since each step of that multi-step
3823 ** pragma returns 0 columns of data.
3824 **
3825 ** See also: [sqlite3_column_count()]
3826 */
3827 SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt);
3828
3829 /*
3830 ** CAPI3REF: Fundamental Datatypes
3831 ** KEYWORDS: SQLITE_TEXT
3832 **
@@ -4018,20 +4015,20 @@
4018 ** of these routines, a default value is returned. The default value
4019 ** is either the integer 0, the floating point number 0.0, or a NULL
4020 ** pointer. Subsequent calls to [sqlite3_errcode()] will return
4021 ** [SQLITE_NOMEM].)^
4022 */
4023 SQLITE_API const void *sqlite3_column_blob(sqlite3_stmt*, int iCol);
4024 SQLITE_API int sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4025 SQLITE_API int sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4026 SQLITE_API double sqlite3_column_double(sqlite3_stmt*, int iCol);
4027 SQLITE_API int sqlite3_column_int(sqlite3_stmt*, int iCol);
4028 SQLITE_API sqlite3_int64 sqlite3_column_int64(sqlite3_stmt*, int iCol);
4029 SQLITE_API const unsigned char *sqlite3_column_text(sqlite3_stmt*, int iCol);
4030 SQLITE_API const void *sqlite3_column_text16(sqlite3_stmt*, int iCol);
4031 SQLITE_API int sqlite3_column_type(sqlite3_stmt*, int iCol);
4032 SQLITE_API sqlite3_value *sqlite3_column_value(sqlite3_stmt*, int iCol);
4033
4034 /*
4035 ** CAPI3REF: Destroy A Prepared Statement Object
4036 **
4037 ** ^The sqlite3_finalize() function is called to delete a [prepared statement].
@@ -4054,11 +4051,11 @@
4054 ** resource leaks. It is a grievous error for the application to try to use
4055 ** a prepared statement after it has been finalized. Any use of a prepared
4056 ** statement after it has been finalized can result in undefined and
4057 ** undesirable behavior such as segfaults and heap corruption.
4058 */
4059 SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt);
4060
4061 /*
4062 ** CAPI3REF: Reset A Prepared Statement Object
4063 **
4064 ** The sqlite3_reset() function is called to reset a [prepared statement]
@@ -4080,11 +4077,11 @@
4080 ** [sqlite3_reset(S)] returns an appropriate [error code].
4081 **
4082 ** ^The [sqlite3_reset(S)] interface does not change the values
4083 ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
4084 */
4085 SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt);
4086
4087 /*
4088 ** CAPI3REF: Create Or Redefine SQL Functions
4089 ** KEYWORDS: {function creation routines}
4090 ** KEYWORDS: {application-defined SQL function}
@@ -4179,31 +4176,31 @@
4179 ** ^An application-defined function is permitted to call other
4180 ** SQLite interfaces. However, such calls must not
4181 ** close the database connection nor finalize or reset the prepared
4182 ** statement in which the function is running.
4183 */
4184 SQLITE_API int sqlite3_create_function(
4185 sqlite3 *db,
4186 const char *zFunctionName,
4187 int nArg,
4188 int eTextRep,
4189 void *pApp,
4190 void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4191 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4192 void (*xFinal)(sqlite3_context*)
4193 );
4194 SQLITE_API int sqlite3_create_function16(
4195 sqlite3 *db,
4196 const void *zFunctionName,
4197 int nArg,
4198 int eTextRep,
4199 void *pApp,
4200 void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4201 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4202 void (*xFinal)(sqlite3_context*)
4203 );
4204 SQLITE_API int sqlite3_create_function_v2(
4205 sqlite3 *db,
4206 const char *zFunctionName,
4207 int nArg,
4208 int eTextRep,
4209 void *pApp,
@@ -4245,16 +4242,16 @@
4245 ** to be supported. However, new applications should avoid
4246 ** the use of these functions. To encourage programmers to avoid
4247 ** these functions, we will not explain what they do.
4248 */
4249 #ifndef SQLITE_OMIT_DEPRECATED
4250 SQLITE_API SQLITE_DEPRECATED int sqlite3_aggregate_count(sqlite3_context*);
4251 SQLITE_API SQLITE_DEPRECATED int sqlite3_expired(sqlite3_stmt*);
4252 SQLITE_API SQLITE_DEPRECATED int sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4253 SQLITE_API SQLITE_DEPRECATED int sqlite3_global_recover(void);
4254 SQLITE_API SQLITE_DEPRECATED void sqlite3_thread_cleanup(void);
4255 SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
4256 void*,sqlite3_int64);
4257 #endif
4258
4259 /*
4260 ** CAPI3REF: Obtaining SQL Function Parameter Values
@@ -4299,22 +4296,22 @@
4299 ** or [sqlite3_value_text16()].
4300 **
4301 ** These routines must be called from the same thread as
4302 ** the SQL function that supplied the [sqlite3_value*] parameters.
4303 */
4304 SQLITE_API const void *sqlite3_value_blob(sqlite3_value*);
4305 SQLITE_API int sqlite3_value_bytes(sqlite3_value*);
4306 SQLITE_API int sqlite3_value_bytes16(sqlite3_value*);
4307 SQLITE_API double sqlite3_value_double(sqlite3_value*);
4308 SQLITE_API int sqlite3_value_int(sqlite3_value*);
4309 SQLITE_API sqlite3_int64 sqlite3_value_int64(sqlite3_value*);
4310 SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value*);
4311 SQLITE_API const void *sqlite3_value_text16(sqlite3_value*);
4312 SQLITE_API const void *sqlite3_value_text16le(sqlite3_value*);
4313 SQLITE_API const void *sqlite3_value_text16be(sqlite3_value*);
4314 SQLITE_API int sqlite3_value_type(sqlite3_value*);
4315 SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*);
4316
4317 /*
4318 ** CAPI3REF: Obtain Aggregate Function Context
4319 **
4320 ** Implementations of aggregate SQL functions use this
@@ -4354,11 +4351,11 @@
4354 ** function.
4355 **
4356 ** This routine must be called from the same thread in which
4357 ** the aggregate SQL function is running.
4358 */
4359 SQLITE_API void *sqlite3_aggregate_context(sqlite3_context*, int nBytes);
4360
4361 /*
4362 ** CAPI3REF: User Data For Functions
4363 **
4364 ** ^The sqlite3_user_data() interface returns a copy of
@@ -4368,11 +4365,11 @@
4368 ** registered the application defined function.
4369 **
4370 ** This routine must be called from the same thread in which
4371 ** the application-defined function is running.
4372 */
4373 SQLITE_API void *sqlite3_user_data(sqlite3_context*);
4374
4375 /*
4376 ** CAPI3REF: Database Connection For Functions
4377 **
4378 ** ^The sqlite3_context_db_handle() interface returns a copy of
@@ -4379,11 +4376,11 @@
4379 ** the pointer to the [database connection] (the 1st parameter)
4380 ** of the [sqlite3_create_function()]
4381 ** and [sqlite3_create_function16()] routines that originally
4382 ** registered the application defined function.
4383 */
4384 SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*);
4385
4386 /*
4387 ** CAPI3REF: Function Auxiliary Data
4388 **
4389 ** These functions may be used by (non-aggregate) SQL functions to
@@ -4431,12 +4428,12 @@
4431 ** values and [parameters] and expressions composed from the same.)^
4432 **
4433 ** These routines must be called from the same thread in which
4434 ** the SQL function is running.
4435 */
4436 SQLITE_API void *sqlite3_get_auxdata(sqlite3_context*, int N);
4437 SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
4438
4439
4440 /*
4441 ** CAPI3REF: Constants Defining Special Destructor Behavior
4442 **
@@ -4567,30 +4564,30 @@
4567 **
4568 ** If these routines are called from within the different thread
4569 ** than the one containing the application-defined function that received
4570 ** the [sqlite3_context] pointer, the results are undefined.
4571 */
4572 SQLITE_API void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
4573 SQLITE_API void sqlite3_result_blob64(sqlite3_context*,const void*,
4574 sqlite3_uint64,void(*)(void*));
4575 SQLITE_API void sqlite3_result_double(sqlite3_context*, double);
4576 SQLITE_API void sqlite3_result_error(sqlite3_context*, const char*, int);
4577 SQLITE_API void sqlite3_result_error16(sqlite3_context*, const void*, int);
4578 SQLITE_API void sqlite3_result_error_toobig(sqlite3_context*);
4579 SQLITE_API void sqlite3_result_error_nomem(sqlite3_context*);
4580 SQLITE_API void sqlite3_result_error_code(sqlite3_context*, int);
4581 SQLITE_API void sqlite3_result_int(sqlite3_context*, int);
4582 SQLITE_API void sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
4583 SQLITE_API void sqlite3_result_null(sqlite3_context*);
4584 SQLITE_API void sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
4585 SQLITE_API void sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
4586 void(*)(void*), unsigned char encoding);
4587 SQLITE_API void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
4588 SQLITE_API void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
4589 SQLITE_API void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
4590 SQLITE_API void sqlite3_result_value(sqlite3_context*, sqlite3_value*);
4591 SQLITE_API void sqlite3_result_zeroblob(sqlite3_context*, int n);
4592
4593 /*
4594 ** CAPI3REF: Define New Collating Sequences
4595 **
4596 ** ^These functions add, remove, or modify a [collation] associated
@@ -4667,26 +4664,26 @@
4667 ** is unfortunate but cannot be changed without breaking backwards
4668 ** compatibility.
4669 **
4670 ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].
4671 */
4672 SQLITE_API int sqlite3_create_collation(
4673 sqlite3*,
4674 const char *zName,
4675 int eTextRep,
4676 void *pArg,
4677 int(*xCompare)(void*,int,const void*,int,const void*)
4678 );
4679 SQLITE_API int sqlite3_create_collation_v2(
4680 sqlite3*,
4681 const char *zName,
4682 int eTextRep,
4683 void *pArg,
4684 int(*xCompare)(void*,int,const void*,int,const void*),
4685 void(*xDestroy)(void*)
4686 );
4687 SQLITE_API int sqlite3_create_collation16(
4688 sqlite3*,
4689 const void *zName,
4690 int eTextRep,
4691 void *pArg,
4692 int(*xCompare)(void*,int,const void*,int,const void*)
@@ -4716,16 +4713,16 @@
4716 **
4717 ** The callback function should register the desired collation using
4718 ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or
4719 ** [sqlite3_create_collation_v2()].
4720 */
4721 SQLITE_API int sqlite3_collation_needed(
4722 sqlite3*,
4723 void*,
4724 void(*)(void*,sqlite3*,int eTextRep,const char*)
4725 );
4726 SQLITE_API int sqlite3_collation_needed16(
4727 sqlite3*,
4728 void*,
4729 void(*)(void*,sqlite3*,int eTextRep,const void*)
4730 );
4731
@@ -4735,15 +4732,15 @@
4735 ** called right after sqlite3_open().
4736 **
4737 ** The code to implement this API is not available in the public release
4738 ** of SQLite.
4739 */
4740 SQLITE_API int sqlite3_key(
4741 sqlite3 *db, /* Database to be rekeyed */
4742 const void *pKey, int nKey /* The key */
4743 );
4744 SQLITE_API int sqlite3_key_v2(
4745 sqlite3 *db, /* Database to be rekeyed */
4746 const char *zDbName, /* Name of the database */
4747 const void *pKey, int nKey /* The key */
4748 );
4749
@@ -4753,35 +4750,35 @@
4753 ** database is decrypted.
4754 **
4755 ** The code to implement this API is not available in the public release
4756 ** of SQLite.
4757 */
4758 SQLITE_API int sqlite3_rekey(
4759 sqlite3 *db, /* Database to be rekeyed */
4760 const void *pKey, int nKey /* The new key */
4761 );
4762 SQLITE_API int sqlite3_rekey_v2(
4763 sqlite3 *db, /* Database to be rekeyed */
4764 const char *zDbName, /* Name of the database */
4765 const void *pKey, int nKey /* The new key */
4766 );
4767
4768 /*
4769 ** Specify the activation key for a SEE database. Unless
4770 ** activated, none of the SEE routines will work.
4771 */
4772 SQLITE_API void sqlite3_activate_see(
4773 const char *zPassPhrase /* Activation phrase */
4774 );
4775 #endif
4776
4777 #ifdef SQLITE_ENABLE_CEROD
4778 /*
4779 ** Specify the activation key for a CEROD database. Unless
4780 ** activated, none of the CEROD routines will work.
4781 */
4782 SQLITE_API void sqlite3_activate_cerod(
4783 const char *zPassPhrase /* Activation phrase */
4784 );
4785 #endif
4786
4787 /*
@@ -4799,11 +4796,11 @@
4799 ** method of the default [sqlite3_vfs] object. If the xSleep() method
4800 ** of the default VFS is not implemented correctly, or not implemented at
4801 ** all, then the behavior of sqlite3_sleep() may deviate from the description
4802 ** in the previous paragraphs.
4803 */
4804 SQLITE_API int sqlite3_sleep(int);
4805
4806 /*
4807 ** CAPI3REF: Name Of The Folder Holding Temporary Files
4808 **
4809 ** ^(If this global variable is made to point to a string which is
@@ -4917,11 +4914,11 @@
4917 **
4918 ** If another thread changes the autocommit status of the database
4919 ** connection while this routine is running, then the return value
4920 ** is undefined.
4921 */
4922 SQLITE_API int sqlite3_get_autocommit(sqlite3*);
4923
4924 /*
4925 ** CAPI3REF: Find The Database Handle Of A Prepared Statement
4926 **
4927 ** ^The sqlite3_db_handle interface returns the [database connection] handle
@@ -4929,11 +4926,11 @@
4929 ** returned by sqlite3_db_handle is the same [database connection]
4930 ** that was the first argument
4931 ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
4932 ** create the statement in the first place.
4933 */
4934 SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*);
4935
4936 /*
4937 ** CAPI3REF: Return The Filename For A Database Connection
4938 **
4939 ** ^The sqlite3_db_filename(D,N) interface returns a pointer to a filename
@@ -4945,20 +4942,20 @@
4945 ** ^The filename returned by this function is the output of the
4946 ** xFullPathname method of the [VFS]. ^In other words, the filename
4947 ** will be an absolute pathname, even if the filename used
4948 ** to open the database originally was a URI or relative pathname.
4949 */
4950 SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName);
4951
4952 /*
4953 ** CAPI3REF: Determine if a database is read-only
4954 **
4955 ** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N
4956 ** of connection D is read-only, 0 if it is read/write, or -1 if N is not
4957 ** the name of a database on connection D.
4958 */
4959 SQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
4960
4961 /*
4962 ** CAPI3REF: Find the next prepared statement
4963 **
4964 ** ^This interface returns a pointer to the next [prepared statement] after
@@ -4969,11 +4966,11 @@
4969 **
4970 ** The [database connection] pointer D in a call to
4971 ** [sqlite3_next_stmt(D,S)] must refer to an open database
4972 ** connection and in particular must not be a NULL pointer.
4973 */
4974 SQLITE_API sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
4975
4976 /*
4977 ** CAPI3REF: Commit And Rollback Notification Callbacks
4978 **
4979 ** ^The sqlite3_commit_hook() interface registers a callback
@@ -5017,12 +5014,12 @@
5017 ** ^The rollback callback is not invoked if a transaction is
5018 ** automatically rolled back because the database connection is closed.
5019 **
5020 ** See also the [sqlite3_update_hook()] interface.
5021 */
5022 SQLITE_API void *sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
5023 SQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
5024
5025 /*
5026 ** CAPI3REF: Data Change Notification Callbacks
5027 **
5028 ** ^The sqlite3_update_hook() interface registers a callback function
@@ -5068,11 +5065,11 @@
5068 ** the first call on D.
5069 **
5070 ** See also the [sqlite3_commit_hook()] and [sqlite3_rollback_hook()]
5071 ** interfaces.
5072 */
5073 SQLITE_API void *sqlite3_update_hook(
5074 sqlite3*,
5075 void(*)(void *,int ,char const *,char const *,sqlite3_int64),
5076 void*
5077 );
5078
@@ -5108,11 +5105,11 @@
5108 ** This interface is threadsafe on processors where writing a
5109 ** 32-bit integer is atomic.
5110 **
5111 ** See Also: [SQLite Shared-Cache Mode]
5112 */
5113 SQLITE_API int sqlite3_enable_shared_cache(int);
5114
5115 /*
5116 ** CAPI3REF: Attempt To Free Heap Memory
5117 **
5118 ** ^The sqlite3_release_memory() interface attempts to free N bytes
@@ -5124,11 +5121,11 @@
5124 ** ^The sqlite3_release_memory() routine is a no-op returning zero
5125 ** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5126 **
5127 ** See also: [sqlite3_db_release_memory()]
5128 */
5129 SQLITE_API int sqlite3_release_memory(int);
5130
5131 /*
5132 ** CAPI3REF: Free Memory Used By A Database Connection
5133 **
5134 ** ^The sqlite3_db_release_memory(D) interface attempts to free as much heap
@@ -5137,11 +5134,11 @@
5137 ** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
5138 ** omitted.
5139 **
5140 ** See also: [sqlite3_release_memory()]
5141 */
5142 SQLITE_API int sqlite3_db_release_memory(sqlite3*);
5143
5144 /*
5145 ** CAPI3REF: Impose A Limit On Heap Size
5146 **
5147 ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the
@@ -5189,11 +5186,11 @@
5189 ** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5190 **
5191 ** The circumstances under which SQLite will enforce the soft heap limit may
5192 ** changes in future releases of SQLite.
5193 */
5194 SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 N);
5195
5196 /*
5197 ** CAPI3REF: Deprecated Soft Heap Limit Interface
5198 ** DEPRECATED
5199 **
@@ -5200,11 +5197,11 @@
5200 ** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
5201 ** interface. This routine is provided for historical compatibility
5202 ** only. All new applications should use the
5203 ** [sqlite3_soft_heap_limit64()] interface rather than this one.
5204 */
5205 SQLITE_API SQLITE_DEPRECATED void sqlite3_soft_heap_limit(int N);
5206
5207
5208 /*
5209 ** CAPI3REF: Extract Metadata About A Column Of A Table
5210 **
@@ -5269,11 +5266,11 @@
5269 **
5270 ** ^This function causes all database schemas to be read from disk and
5271 ** parsed, if that has not already been done, and returns an error if
5272 ** any errors are encountered while loading the schema.
5273 */
5274 SQLITE_API int sqlite3_table_column_metadata(
5275 sqlite3 *db, /* Connection handle */
5276 const char *zDbName, /* Database name or NULL */
5277 const char *zTableName, /* Table name */
5278 const char *zColumnName, /* Column name */
5279 char const **pzDataType, /* OUTPUT: Declared data type */
@@ -5315,11 +5312,11 @@
5315 ** [sqlite3_enable_load_extension()] prior to calling this API,
5316 ** otherwise an error will be returned.
5317 **
5318 ** See also the [load_extension() SQL function].
5319 */
5320 SQLITE_API int sqlite3_load_extension(
5321 sqlite3 *db, /* Load the extension into this database connection */
5322 const char *zFile, /* Name of the shared library containing extension */
5323 const char *zProc, /* Entry point. Derived from zFile if 0 */
5324 char **pzErrMsg /* Put error message here if not 0 */
5325 );
@@ -5335,11 +5332,11 @@
5335 ** ^Extension loading is off by default.
5336 ** ^Call the sqlite3_enable_load_extension() routine with onoff==1
5337 ** to turn extension loading on and call it with onoff==0 to turn
5338 ** it back off again.
5339 */
5340 SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
5341
5342 /*
5343 ** CAPI3REF: Automatically Load Statically Linked Extensions
5344 **
5345 ** ^This interface causes the xEntryPoint() function to be invoked for
@@ -5373,11 +5370,11 @@
5373 ** will be called more than once for each database connection that is opened.
5374 **
5375 ** See also: [sqlite3_reset_auto_extension()]
5376 ** and [sqlite3_cancel_auto_extension()]
5377 */
5378 SQLITE_API int sqlite3_auto_extension(void (*xEntryPoint)(void));
5379
5380 /*
5381 ** CAPI3REF: Cancel Automatic Extension Loading
5382 **
5383 ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
@@ -5385,19 +5382,19 @@
5385 ** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)]
5386 ** routine returns 1 if initialization routine X was successfully
5387 ** unregistered and it returns 0 if X was not on the list of initialization
5388 ** routines.
5389 */
5390 SQLITE_API int sqlite3_cancel_auto_extension(void (*xEntryPoint)(void));
5391
5392 /*
5393 ** CAPI3REF: Reset Automatic Extension Loading
5394 **
5395 ** ^This interface disables all automatic extensions previously
5396 ** registered using [sqlite3_auto_extension()].
5397 */
5398 SQLITE_API void sqlite3_reset_auto_extension(void);
5399
5400 /*
5401 ** The interface to the virtual-table mechanism is currently considered
5402 ** to be experimental. The interface might change in incompatible ways.
5403 ** If this is a problem for you, do not use the interface at this time.
@@ -5596,17 +5593,17 @@
5596 ** be invoked if the call to sqlite3_create_module_v2() fails.
5597 ** ^The sqlite3_create_module()
5598 ** interface is equivalent to sqlite3_create_module_v2() with a NULL
5599 ** destructor.
5600 */
5601 SQLITE_API int sqlite3_create_module(
5602 sqlite3 *db, /* SQLite connection to register module with */
5603 const char *zName, /* Name of the module */
5604 const sqlite3_module *p, /* Methods for the module */
5605 void *pClientData /* Client data for xCreate/xConnect */
5606 );
5607 SQLITE_API int sqlite3_create_module_v2(
5608 sqlite3 *db, /* SQLite connection to register module with */
5609 const char *zName, /* Name of the module */
5610 const sqlite3_module *p, /* Methods for the module */
5611 void *pClientData, /* Client data for xCreate/xConnect */
5612 void(*xDestroy)(void*) /* Module destructor function */
@@ -5665,11 +5662,11 @@
5665 ** ^The [xCreate] and [xConnect] methods of a
5666 ** [virtual table module] call this interface
5667 ** to declare the format (the names and datatypes of the columns) of
5668 ** the virtual tables they implement.
5669 */
5670 SQLITE_API int sqlite3_declare_vtab(sqlite3*, const char *zSQL);
5671
5672 /*
5673 ** CAPI3REF: Overload A Function For A Virtual Table
5674 **
5675 ** ^(Virtual tables can provide alternative implementations of functions
@@ -5683,11 +5680,11 @@
5683 ** of the new function always causes an exception to be thrown. So
5684 ** the new function is not good for anything by itself. Its only
5685 ** purpose is to be a placeholder function that can be overloaded
5686 ** by a [virtual table].
5687 */
5688 SQLITE_API int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
5689
5690 /*
5691 ** The interface to the virtual-table mechanism defined above (back up
5692 ** to a comment remarkably similar to this one) is currently considered
5693 ** to be experimental. The interface might change in incompatible ways.
@@ -5780,11 +5777,11 @@
5780 ** zero-filled blob to read or write using the incremental-blob interface.
5781 **
5782 ** To avoid a resource leak, every open [BLOB handle] should eventually
5783 ** be released by a call to [sqlite3_blob_close()].
5784 */
5785 SQLITE_API int sqlite3_blob_open(
5786 sqlite3*,
5787 const char *zDb,
5788 const char *zTable,
5789 const char *zColumn,
5790 sqlite3_int64 iRow,
@@ -5812,11 +5809,11 @@
5812 ** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
5813 ** always returns zero.
5814 **
5815 ** ^This function sets the database handle error code and message.
5816 */
5817 SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
5818
5819 /*
5820 ** CAPI3REF: Close A BLOB Handle
5821 **
5822 ** ^This function closes an open [BLOB handle]. ^(The BLOB handle is closed
@@ -5834,11 +5831,11 @@
5834 ** with a null pointer (such as would be returned by a failed call to
5835 ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function
5836 ** is passed a valid open blob handle, the values returned by the
5837 ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning.
5838 */
5839 SQLITE_API int sqlite3_blob_close(sqlite3_blob *);
5840
5841 /*
5842 ** CAPI3REF: Return The Size Of An Open BLOB
5843 **
5844 ** ^Returns the size in bytes of the BLOB accessible via the
@@ -5849,11 +5846,11 @@
5849 ** This routine only works on a [BLOB handle] which has been created
5850 ** by a prior successful call to [sqlite3_blob_open()] and which has not
5851 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
5852 ** to this routine results in undefined and probably undesirable behavior.
5853 */
5854 SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *);
5855
5856 /*
5857 ** CAPI3REF: Read Data From A BLOB Incrementally
5858 **
5859 ** ^(This function is used to read data from an open [BLOB handle] into a
@@ -5877,11 +5874,11 @@
5877 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
5878 ** to this routine results in undefined and probably undesirable behavior.
5879 **
5880 ** See also: [sqlite3_blob_write()].
5881 */
5882 SQLITE_API int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
5883
5884 /*
5885 ** CAPI3REF: Write Data Into A BLOB Incrementally
5886 **
5887 ** ^(This function is used to write data into an open [BLOB handle] from a
@@ -5918,11 +5915,11 @@
5918 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
5919 ** to this routine results in undefined and probably undesirable behavior.
5920 **
5921 ** See also: [sqlite3_blob_read()].
5922 */
5923 SQLITE_API int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
5924
5925 /*
5926 ** CAPI3REF: Virtual File System Objects
5927 **
5928 ** A virtual filesystem (VFS) is an [sqlite3_vfs] object
@@ -5949,13 +5946,13 @@
5949 **
5950 ** ^Unregister a VFS with the sqlite3_vfs_unregister() interface.
5951 ** ^(If the default VFS is unregistered, another VFS is chosen as
5952 ** the default. The choice for the new VFS is arbitrary.)^
5953 */
5954 SQLITE_API sqlite3_vfs *sqlite3_vfs_find(const char *zVfsName);
5955 SQLITE_API int sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
5956 SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*);
5957
5958 /*
5959 ** CAPI3REF: Mutexes
5960 **
5961 ** The SQLite core uses these routines for thread
@@ -6064,15 +6061,15 @@
6064 ** sqlite3_mutex_leave() is a NULL pointer, then all three routines
6065 ** behave as no-ops.
6066 **
6067 ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
6068 */
6069 SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int);
6070 SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*);
6071 SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*);
6072 SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*);
6073 SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*);
6074
6075 /*
6076 ** CAPI3REF: Mutex Methods Object
6077 **
6078 ** An instance of this structure defines the low-level routines
@@ -6178,12 +6175,12 @@
6178 ** call to sqlite3_mutex_held() to fail, so a non-zero return is
6179 ** the appropriate thing to do. The sqlite3_mutex_notheld()
6180 ** interface should also return 1 when given a NULL pointer.
6181 */
6182 #ifndef NDEBUG
6183 SQLITE_API int sqlite3_mutex_held(sqlite3_mutex*);
6184 SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex*);
6185 #endif
6186
6187 /*
6188 ** CAPI3REF: Mutex Types
6189 **
@@ -6215,11 +6212,11 @@
6215 ** serializes access to the [database connection] given in the argument
6216 ** when the [threading mode] is Serialized.
6217 ** ^If the [threading mode] is Single-thread or Multi-thread then this
6218 ** routine returns a NULL pointer.
6219 */
6220 SQLITE_API sqlite3_mutex *sqlite3_db_mutex(sqlite3*);
6221
6222 /*
6223 ** CAPI3REF: Low-Level Control Of Database Files
6224 **
6225 ** ^The [sqlite3_file_control()] interface makes a direct call to the
@@ -6249,11 +6246,11 @@
6249 ** an incorrect zDbName and an SQLITE_ERROR return from the underlying
6250 ** xFileControl method.
6251 **
6252 ** See also: [SQLITE_FCNTL_LOCKSTATE]
6253 */
6254 SQLITE_API int sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
6255
6256 /*
6257 ** CAPI3REF: Testing Interface
6258 **
6259 ** ^The sqlite3_test_control() interface is used to read out internal
@@ -6268,11 +6265,11 @@
6268 ** The details of the operation codes, their meanings, the parameters
6269 ** they take, and what they do are all subject to change without notice.
6270 ** Unlike most of the SQLite API, this function is not guaranteed to
6271 ** operate consistently from one release to the next.
6272 */
6273 SQLITE_API int sqlite3_test_control(int op, ...);
6274
6275 /*
6276 ** CAPI3REF: Testing Interface Operation Codes
6277 **
6278 ** These constants are the valid operation code parameters used
@@ -6331,12 +6328,12 @@
6331 ** be represented by a 32-bit integer, then the values returned by
6332 ** sqlite3_status() are undefined.
6333 **
6334 ** See also: [sqlite3_db_status()]
6335 */
6336 SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6337 SQLITE_API int sqlite3_status64(
6338 int op,
6339 sqlite3_int64 *pCurrent,
6340 sqlite3_int64 *pHighwater,
6341 int resetFlag
6342 );
@@ -6455,11 +6452,11 @@
6455 ** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a
6456 ** non-zero [error code] on failure.
6457 **
6458 ** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
6459 */
6460 SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
6461
6462 /*
6463 ** CAPI3REF: Status Parameters for database connections
6464 ** KEYWORDS: {SQLITE_DBSTATUS options}
6465 **
@@ -6584,11 +6581,11 @@
6584 ** ^If the resetFlg is true, then the counter is reset to zero after this
6585 ** interface call returns.
6586 **
6587 ** See also: [sqlite3_status()] and [sqlite3_db_status()].
6588 */
6589 SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
6590
6591 /*
6592 ** CAPI3REF: Status Parameters for prepared statements
6593 ** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters}
6594 **
@@ -7053,20 +7050,20 @@
7053 ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()
7054 ** APIs are not strictly speaking threadsafe. If they are invoked at the
7055 ** same time as another thread is invoking sqlite3_backup_step() it is
7056 ** possible that they return invalid values.
7057 */
7058 SQLITE_API sqlite3_backup *sqlite3_backup_init(
7059 sqlite3 *pDest, /* Destination database handle */
7060 const char *zDestName, /* Destination database name */
7061 sqlite3 *pSource, /* Source database handle */
7062 const char *zSourceName /* Source database name */
7063 );
7064 SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage);
7065 SQLITE_API int sqlite3_backup_finish(sqlite3_backup *p);
7066 SQLITE_API int sqlite3_backup_remaining(sqlite3_backup *p);
7067 SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p);
7068
7069 /*
7070 ** CAPI3REF: Unlock Notification
7071 **
7072 ** ^When running in shared-cache mode, a database operation may fail with
@@ -7178,11 +7175,11 @@
7178 ** by an sqlite3_step() call. ^(If there is a blocking connection, then the
7179 ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in
7180 ** the special "DROP TABLE/INDEX" case, the extended error code is just
7181 ** SQLITE_LOCKED.)^
7182 */
7183 SQLITE_API int sqlite3_unlock_notify(
7184 sqlite3 *pBlocked, /* Waiting connection */
7185 void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */
7186 void *pNotifyArg /* Argument to pass to xNotify */
7187 );
7188
@@ -7193,12 +7190,12 @@
7193 ** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications
7194 ** and extensions to compare the contents of two buffers containing UTF-8
7195 ** strings in a case-independent fashion, using the same definition of "case
7196 ** independence" that SQLite uses internally when comparing identifiers.
7197 */
7198 SQLITE_API int sqlite3_stricmp(const char *, const char *);
7199 SQLITE_API int sqlite3_strnicmp(const char *, const char *, int);
7200
7201 /*
7202 ** CAPI3REF: String Globbing
7203 *
7204 ** ^The [sqlite3_strglob(P,X)] interface returns zero if string X matches
@@ -7209,11 +7206,11 @@
7209 ** sensitive.
7210 **
7211 ** Note that this routine returns zero on a match and non-zero if the strings
7212 ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
7213 */
7214 SQLITE_API int sqlite3_strglob(const char *zGlob, const char *zStr);
7215
7216 /*
7217 ** CAPI3REF: Error Logging Interface
7218 **
7219 ** ^The [sqlite3_log()] interface writes a message into the [error log]
@@ -7232,11 +7229,11 @@
7232 ** will not use dynamically allocated memory. The log message is stored in
7233 ** a fixed-length buffer on the stack. If the log message is longer than
7234 ** a few hundred characters, it will be truncated to the length of the
7235 ** buffer.
7236 */
7237 SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...);
7238
7239 /*
7240 ** CAPI3REF: Write-Ahead Log Commit Hook
7241 **
7242 ** ^The [sqlite3_wal_hook()] function is used to register a callback that
@@ -7267,11 +7264,11 @@
7267 ** previously registered write-ahead log callback. ^Note that the
7268 ** [sqlite3_wal_autocheckpoint()] interface and the
7269 ** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will
7270 ** those overwrite any prior [sqlite3_wal_hook()] settings.
7271 */
7272 SQLITE_API void *sqlite3_wal_hook(
7273 sqlite3*,
7274 int(*)(void *,sqlite3*,const char*,int),
7275 void*
7276 );
7277
@@ -7301,11 +7298,11 @@
7301 ** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]
7302 ** pages. The use of this interface
7303 ** is only necessary if the default setting is found to be suboptimal
7304 ** for a particular application.
7305 */
7306 SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
7307
7308 /*
7309 ** CAPI3REF: Checkpoint a database
7310 **
7311 ** ^(The sqlite3_wal_checkpoint(D,X) is equivalent to
@@ -7322,11 +7319,11 @@
7322 ** interface was added. This interface is retained for backwards
7323 ** compatibility and as a convenience for applications that need to manually
7324 ** start a callback but which do not need the full power (and corresponding
7325 ** complication) of [sqlite3_wal_checkpoint_v2()].
7326 */
7327 SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
7328
7329 /*
7330 ** CAPI3REF: Checkpoint a database
7331 **
7332 ** ^(The sqlite3_wal_checkpoint_v2(D,X,M,L,C) interface runs a checkpoint
@@ -7415,11 +7412,11 @@
7415 ** [sqlite3_errcode()] and [sqlite3_errmsg()].
7416 **
7417 ** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface
7418 ** from SQL.
7419 */
7420 SQLITE_API int sqlite3_wal_checkpoint_v2(
7421 sqlite3 *db, /* Database handle */
7422 const char *zDb, /* Name of attached database (or NULL) */
7423 int eMode, /* SQLITE_CHECKPOINT_* value */
7424 int *pnLog, /* OUT: Size of WAL log in frames */
7425 int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -7451,11 +7448,11 @@
7451 **
7452 ** At present, there is only one option that may be configured using
7453 ** this function. (See [SQLITE_VTAB_CONSTRAINT_SUPPORT].) Further options
7454 ** may be added in the future.
7455 */
7456 SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...);
7457
7458 /*
7459 ** CAPI3REF: Virtual Table Configuration Options
7460 **
7461 ** These macros define the various options to the
@@ -7504,11 +7501,11 @@
7504 ** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL],
7505 ** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode
7506 ** of the SQL statement that triggered the call to the [xUpdate] method of the
7507 ** [virtual table].
7508 */
7509 SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *);
7510
7511 /*
7512 ** CAPI3REF: Conflict resolution modes
7513 ** KEYWORDS: {conflict resolution mode}
7514 **
@@ -7608,11 +7605,11 @@
7608 ** as if the loop did not exist - it returns non-zero and leave the variable
7609 ** that pOut points to unchanged.
7610 **
7611 ** See also: [sqlite3_stmt_scanstatus_reset()]
7612 */
7613 SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_stmt_scanstatus(
7614 sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
7615 int idx, /* Index of loop to report on */
7616 int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
7617 void *pOut /* Result written here */
7618 );
@@ -7623,11 +7620,11 @@
7623 ** ^Zero all [sqlite3_stmt_scanstatus()] related event counters.
7624 **
7625 ** This API is only available if the library is built with pre-processor
7626 ** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined.
7627 */
7628 SQLITE_API SQLITE_EXPERIMENTAL void sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
7629
7630
7631 /*
7632 ** Undo the hack that converts floating point types to integer for
7633 ** builds on processors without floating point support.
@@ -7678,11 +7675,11 @@
7678 ** Register a geometry callback named zGeom that can be used as part of an
7679 ** R-Tree geometry query as follows:
7680 **
7681 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
7682 */
7683 SQLITE_API int sqlite3_rtree_geometry_callback(
7684 sqlite3 *db,
7685 const char *zGeom,
7686 int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
7687 void *pContext
7688 );
@@ -7704,11 +7701,11 @@
7704 ** Register a 2nd-generation geometry callback named zScore that can be
7705 ** used as part of an R-Tree geometry query as follows:
7706 **
7707 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...)
7708 */
7709 SQLITE_API int sqlite3_rtree_query_callback(
7710 sqlite3 *db,
7711 const char *zQueryFunc,
7712 int (*xQueryFunc)(sqlite3_rtree_query_info*),
7713 void *pContext,
7714 void (*xDestructor)(void*)
7715
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -41,27 +41,24 @@
41 extern "C" {
42 #endif
43
44
45 /*
46 ** Provide the ability to override linkage features of the interface.
47 */
48 #ifndef SQLITE_EXTERN
49 # define SQLITE_EXTERN extern
50 #endif
 
51 #ifndef SQLITE_API
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
64 ** should not use deprecated interfaces - they are supported for backwards
@@ -114,11 +111,11 @@
111 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
112 ** [sqlite_version()] and [sqlite_source_id()].
113 */
114 #define SQLITE_VERSION "3.8.9"
115 #define SQLITE_VERSION_NUMBER 3008009
116 #define SQLITE_SOURCE_ID "2015-03-30 23:43:56 395bb3e677a6551b06ba96fc58c393132b93d1e8"
117
118 /*
119 ** CAPI3REF: Run-Time Library Version Numbers
120 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
121 **
@@ -147,13 +144,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
@@ -174,12 +171,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 **
@@ -214,11 +211,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 **
@@ -310,12 +307,12 @@
307 ** from [sqlite3_open()], [sqlite3_open16()], or
308 ** [sqlite3_open_v2()], and not previously closed.
309 ** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
310 ** argument is a harmless no-op.
311 */
312 SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3*);
313 SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3*);
314
315 /*
316 ** The type for a callback function.
317 ** This is legacy and deprecated. It is included for historical
318 ** compatibility and is not documented.
@@ -381,11 +378,11 @@
378 ** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
379 ** <li> The application must not modify the SQL statement text passed into
380 ** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
381 ** </ul>
382 */
383 SQLITE_API int SQLITE_STDCALL sqlite3_exec(
384 sqlite3*, /* An open database */
385 const char *sql, /* SQL to be evaluated */
386 int (*callback)(void*,int,char**,char**), /* Callback function */
387 void *, /* 1st argument to callback */
388 char **errmsg /* Error msg written here */
@@ -1341,14 +1338,14 @@
1338 ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied
1339 ** implementation of sqlite3_os_init() or sqlite3_os_end()
1340 ** must return [SQLITE_OK] on success and some other [error code] upon
1341 ** failure.
1342 */
1343 SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void);
1344 SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void);
1345 SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void);
1346 SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void);
1347
1348 /*
1349 ** CAPI3REF: Configuring The SQLite Library
1350 **
1351 ** The sqlite3_config() interface is used to make global configuration
@@ -1375,11 +1372,11 @@
1372 **
1373 ** ^When a configuration option is set, sqlite3_config() returns [SQLITE_OK].
1374 ** ^If the option is unknown or SQLite is unable to set the option
1375 ** then this routine returns a non-zero [error code].
1376 */
1377 SQLITE_API int SQLITE_CDECL sqlite3_config(int, ...);
1378
1379 /*
1380 ** CAPI3REF: Configure database connections
1381 **
1382 ** The sqlite3_db_config() interface is used to make configuration
@@ -1393,11 +1390,11 @@
1390 ** Subsequent arguments vary depending on the configuration verb.
1391 **
1392 ** ^Calls to sqlite3_db_config() return SQLITE_OK if and only if
1393 ** the call is considered successful.
1394 */
1395 SQLITE_API int SQLITE_CDECL sqlite3_db_config(sqlite3*, int op, ...);
1396
1397 /*
1398 ** CAPI3REF: Memory Allocation Routines
1399 **
1400 ** An instance of this object defines the interface between SQLite
@@ -1881,11 +1878,11 @@
1878 **
1879 ** ^The sqlite3_extended_result_codes() routine enables or disables the
1880 ** [extended result codes] feature of SQLite. ^The extended result
1881 ** codes are disabled by default for historical compatibility.
1882 */
1883 SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3*, int onoff);
1884
1885 /*
1886 ** CAPI3REF: Last Insert Rowid
1887 **
1888 ** ^Each entry in most SQLite tables (except for [WITHOUT ROWID] tables)
@@ -1932,11 +1929,11 @@
1929 ** function is running and thus changes the last insert [rowid],
1930 ** then the value returned by [sqlite3_last_insert_rowid()] is
1931 ** unpredictable and might not equal either the old or the new
1932 ** last insert [rowid].
1933 */
1934 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3*);
1935
1936 /*
1937 ** CAPI3REF: Count The Number Of Rows Modified
1938 **
1939 ** ^This function returns the number of rows modified, inserted or
@@ -1984,11 +1981,11 @@
1981 **
1982 ** If a separate thread makes changes on the same database connection
1983 ** while [sqlite3_changes()] is running then the value returned
1984 ** is unpredictable and not meaningful.
1985 */
1986 SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3*);
1987
1988 /*
1989 ** CAPI3REF: Total Number Of Rows Modified
1990 **
1991 ** ^This function returns the total number of rows inserted, modified or
@@ -2007,11 +2004,11 @@
2004 **
2005 ** If a separate thread makes changes on the same database connection
2006 ** while [sqlite3_total_changes()] is running then the value
2007 ** returned is unpredictable and not meaningful.
2008 */
2009 SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3*);
2010
2011 /*
2012 ** CAPI3REF: Interrupt A Long-Running Query
2013 **
2014 ** ^This function causes any pending database operation to abort and
@@ -2046,11 +2043,11 @@
2043 ** that are started after the sqlite3_interrupt() call returns.
2044 **
2045 ** If the database connection closes while [sqlite3_interrupt()]
2046 ** is running then bad things will likely happen.
2047 */
2048 SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3*);
2049
2050 /*
2051 ** CAPI3REF: Determine If An SQL Statement Is Complete
2052 **
2053 ** These routines are useful during command-line input to determine if the
@@ -2081,12 +2078,12 @@
2078 ** UTF-8 string.
2079 **
2080 ** The input to [sqlite3_complete16()] must be a zero-terminated
2081 ** UTF-16 string in native byte order.
2082 */
2083 SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *sql);
2084 SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *sql);
2085
2086 /*
2087 ** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
2088 ** KEYWORDS: {busy-handler callback} {busy handler}
2089 **
@@ -2142,11 +2139,11 @@
2139 ** result in undefined behavior.
2140 **
2141 ** A busy handler must not close the database connection
2142 ** or [prepared statement] that invoked the busy handler.
2143 */
2144 SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*);
2145
2146 /*
2147 ** CAPI3REF: Set A Busy Timeout
2148 **
2149 ** ^This routine sets a [sqlite3_busy_handler | busy handler] that sleeps
@@ -2164,11 +2161,11 @@
2161 ** was defined (using [sqlite3_busy_handler()]) prior to calling
2162 ** this routine, that other busy handler is cleared.)^
2163 **
2164 ** See also: [PRAGMA busy_timeout]
2165 */
2166 SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3*, int ms);
2167
2168 /*
2169 ** CAPI3REF: Convenience Routines For Running Queries
2170 **
2171 ** This is a legacy interface that is preserved for backwards compatibility.
@@ -2238,19 +2235,19 @@
2235 ** interface defined here. As a consequence, errors that occur in the
2236 ** wrapper layer outside of the internal [sqlite3_exec()] call are not
2237 ** reflected in subsequent calls to [sqlite3_errcode()] or
2238 ** [sqlite3_errmsg()].
2239 */
2240 SQLITE_API int SQLITE_STDCALL sqlite3_get_table(
2241 sqlite3 *db, /* An open database */
2242 const char *zSql, /* SQL to be evaluated */
2243 char ***pazResult, /* Results of the query */
2244 int *pnRow, /* Number of result rows written here */
2245 int *pnColumn, /* Number of result columns written here */
2246 char **pzErrmsg /* Error msg written here */
2247 );
2248 SQLITE_API void SQLITE_STDCALL sqlite3_free_table(char **result);
2249
2250 /*
2251 ** CAPI3REF: Formatted String Printing Functions
2252 **
2253 ** These routines are work-alikes of the "printf()" family of functions
@@ -2352,14 +2349,14 @@
2349 **
2350 ** ^(The "%z" formatting option works like "%s" but with the
2351 ** addition that after the string has been read and copied into
2352 ** the result, [sqlite3_free()] is called on the input string.)^
2353 */
2354 SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...);
2355 SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list);
2356 SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...);
2357 SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list);
2358
2359 /*
2360 ** CAPI3REF: Memory Allocation Subsystem
2361 **
2362 ** The SQLite core uses these three routines for all of its own
@@ -2445,16 +2442,16 @@
2442 **
2443 ** The application must not read or write any part of
2444 ** a block of memory after it has been released using
2445 ** [sqlite3_free()] or [sqlite3_realloc()].
2446 */
2447 SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int);
2448 SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64);
2449 SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void*, int);
2450 SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void*, sqlite3_uint64);
2451 SQLITE_API void SQLITE_STDCALL sqlite3_free(void*);
2452 SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void*);
2453
2454 /*
2455 ** CAPI3REF: Memory Allocator Statistics
2456 **
2457 ** SQLite provides these two interfaces for reporting on the status
@@ -2475,12 +2472,12 @@
2472 ** [sqlite3_memory_used()] if and only if the parameter to
2473 ** [sqlite3_memory_highwater()] is true. ^The value returned
2474 ** by [sqlite3_memory_highwater(1)] is the high-water mark
2475 ** prior to the reset.
2476 */
2477 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void);
2478 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag);
2479
2480 /*
2481 ** CAPI3REF: Pseudo-Random Number Generator
2482 **
2483 ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
@@ -2499,11 +2496,11 @@
2496 ** ^If the previous call to this routine had an N of 1 or more and a
2497 ** non-NULL P then the pseudo-randomness is generated
2498 ** internally and without recourse to the [sqlite3_vfs] xRandomness
2499 ** method.
2500 */
2501 SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *P);
2502
2503 /*
2504 ** CAPI3REF: Compile-Time Authorization Callbacks
2505 **
2506 ** ^This routine registers an authorizer callback with a particular
@@ -2581,11 +2578,11 @@
2578 ** [sqlite3_prepare()] or its variants. Authorization is not
2579 ** performed during statement evaluation in [sqlite3_step()], unless
2580 ** as stated in the previous paragraph, sqlite3_step() invokes
2581 ** sqlite3_prepare_v2() to reprepare a statement after a schema change.
2582 */
2583 SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer(
2584 sqlite3*,
2585 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
2586 void *pUserData
2587 );
2588
@@ -2685,12 +2682,12 @@
2682 ** digits in the time are meaningless. Future versions of SQLite
2683 ** might provide greater resolution on the profiler callback. The
2684 ** sqlite3_profile() function is considered experimental and is
2685 ** subject to change in future versions of SQLite.
2686 */
2687 SQLITE_API void *SQLITE_STDCALL sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*);
2688 SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_STDCALL sqlite3_profile(sqlite3*,
2689 void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
2690
2691 /*
2692 ** CAPI3REF: Query Progress Callbacks
2693 **
@@ -2720,11 +2717,11 @@
2717 ** the database connection that invoked the progress handler.
2718 ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
2719 ** database connections for the meaning of "modify" in this paragraph.
2720 **
2721 */
2722 SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
2723
2724 /*
2725 ** CAPI3REF: Opening A New Database Connection
2726 **
2727 ** ^These routines open an SQLite database file as specified by the
@@ -2948,19 +2945,19 @@
2945 ** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various
2946 ** features that require the use of temporary files may fail.
2947 **
2948 ** See also: [sqlite3_temp_directory]
2949 */
2950 SQLITE_API int SQLITE_STDCALL sqlite3_open(
2951 const char *filename, /* Database filename (UTF-8) */
2952 sqlite3 **ppDb /* OUT: SQLite db handle */
2953 );
2954 SQLITE_API int SQLITE_STDCALL sqlite3_open16(
2955 const void *filename, /* Database filename (UTF-16) */
2956 sqlite3 **ppDb /* OUT: SQLite db handle */
2957 );
2958 SQLITE_API int SQLITE_STDCALL sqlite3_open_v2(
2959 const char *filename, /* Database filename (UTF-8) */
2960 sqlite3 **ppDb, /* OUT: SQLite db handle */
2961 int flags, /* Flags */
2962 const char *zVfs /* Name of VFS module to use */
2963 );
@@ -3002,13 +2999,13 @@
2999 ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and
3000 ** is not a database file pathname pointer that SQLite passed into the xOpen
3001 ** VFS method, then the behavior of this routine is undefined and probably
3002 ** undesirable.
3003 */
3004 SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3005 SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3006 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
3007
3008
3009 /*
3010 ** CAPI3REF: Error Codes And Messages
3011 **
@@ -3047,15 +3044,15 @@
3044 **
3045 ** If an interface fails with SQLITE_MISUSE, that means the interface
3046 ** was invoked incorrectly by the application. In that case, the
3047 ** error code and message may or may not be set.
3048 */
3049 SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db);
3050 SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db);
3051 SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*);
3052 SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*);
3053 SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int);
3054
3055 /*
3056 ** CAPI3REF: SQL Statement Object
3057 ** KEYWORDS: {prepared statement} {prepared statements}
3058 **
@@ -3118,11 +3115,11 @@
3115 ** created by an untrusted script can be contained using the
3116 ** [max_page_count] [PRAGMA].
3117 **
3118 ** New run-time limit categories may be added in future releases.
3119 */
3120 SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3*, int id, int newVal);
3121
3122 /*
3123 ** CAPI3REF: Run-Time Limit Categories
3124 ** KEYWORDS: {limit category} {*limit categories}
3125 **
@@ -3268,32 +3265,32 @@
3265 ** or [GLOB] operator or if the parameter is compared to an indexed column
3266 ** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
3267 ** </li>
3268 ** </ol>
3269 */
3270 SQLITE_API int SQLITE_STDCALL sqlite3_prepare(
3271 sqlite3 *db, /* Database handle */
3272 const char *zSql, /* SQL statement, UTF-8 encoded */
3273 int nByte, /* Maximum length of zSql in bytes. */
3274 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3275 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3276 );
3277 SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2(
3278 sqlite3 *db, /* Database handle */
3279 const char *zSql, /* SQL statement, UTF-8 encoded */
3280 int nByte, /* Maximum length of zSql in bytes. */
3281 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3282 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3283 );
3284 SQLITE_API int SQLITE_STDCALL sqlite3_prepare16(
3285 sqlite3 *db, /* Database handle */
3286 const void *zSql, /* SQL statement, UTF-16 encoded */
3287 int nByte, /* Maximum length of zSql in bytes. */
3288 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3289 const void **pzTail /* OUT: Pointer to unused portion of zSql */
3290 );
3291 SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2(
3292 sqlite3 *db, /* Database handle */
3293 const void *zSql, /* SQL statement, UTF-16 encoded */
3294 int nByte, /* Maximum length of zSql in bytes. */
3295 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
3296 const void **pzTail /* OUT: Pointer to unused portion of zSql */
@@ -3304,11 +3301,11 @@
3301 **
3302 ** ^This interface can be used to retrieve a saved copy of the original
3303 ** SQL text used to create a [prepared statement] if that statement was
3304 ** compiled using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()].
3305 */
3306 SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt);
3307
3308 /*
3309 ** CAPI3REF: Determine If An SQL Statement Writes The Database
3310 **
3311 ** ^The sqlite3_stmt_readonly(X) interface returns true (non-zero) if
@@ -3335,11 +3332,11 @@
3332 ** database. ^The [ATTACH] and [DETACH] statements also cause
3333 ** sqlite3_stmt_readonly() to return true since, while those statements
3334 ** change the configuration of a database connection, they do not make
3335 ** changes to the content of the database files on disk.
3336 */
3337 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
3338
3339 /*
3340 ** CAPI3REF: Determine If A Prepared Statement Has Been Reset
3341 **
3342 ** ^The sqlite3_stmt_busy(S) interface returns true (non-zero) if the
@@ -3354,11 +3351,11 @@
3351 ** to locate all prepared statements associated with a database
3352 ** connection that are in need of being reset. This can be used,
3353 ** for example, in diagnostic routines to search for prepared
3354 ** statements that are holding a transaction open.
3355 */
3356 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt*);
3357
3358 /*
3359 ** CAPI3REF: Dynamically Typed Value Object
3360 ** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
3361 **
@@ -3515,23 +3512,23 @@
3512 ** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails.
3513 **
3514 ** See also: [sqlite3_bind_parameter_count()],
3515 ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].
3516 */
3517 SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
3518 SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
3519 void(*)(void*));
3520 SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt*, int, double);
3521 SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt*, int, int);
3522 SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
3523 SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt*, int);
3524 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
3525 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
3526 SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
3527 void(*)(void*), unsigned char encoding);
3528 SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
3529 SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
3530
3531 /*
3532 ** CAPI3REF: Number Of SQL Parameters
3533 **
3534 ** ^This routine can be used to find the number of [SQL parameters]
@@ -3547,11 +3544,11 @@
3544 **
3545 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3546 ** [sqlite3_bind_parameter_name()], and
3547 ** [sqlite3_bind_parameter_index()].
3548 */
3549 SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt*);
3550
3551 /*
3552 ** CAPI3REF: Name Of A Host Parameter
3553 **
3554 ** ^The sqlite3_bind_parameter_name(P,N) interface returns
@@ -3574,11 +3571,11 @@
3571 **
3572 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3573 ** [sqlite3_bind_parameter_count()], and
3574 ** [sqlite3_bind_parameter_index()].
3575 */
3576 SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt*, int);
3577
3578 /*
3579 ** CAPI3REF: Index Of A Parameter With A Given Name
3580 **
3581 ** ^Return the index of an SQL parameter given its name. ^The
@@ -3590,20 +3587,20 @@
3587 **
3588 ** See also: [sqlite3_bind_blob|sqlite3_bind()],
3589 ** [sqlite3_bind_parameter_count()], and
3590 ** [sqlite3_bind_parameter_index()].
3591 */
3592 SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
3593
3594 /*
3595 ** CAPI3REF: Reset All Bindings On A Prepared Statement
3596 **
3597 ** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset
3598 ** the [sqlite3_bind_blob | bindings] on a [prepared statement].
3599 ** ^Use this routine to reset all host parameters to NULL.
3600 */
3601 SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt*);
3602
3603 /*
3604 ** CAPI3REF: Number Of Columns In A Result Set
3605 **
3606 ** ^Return the number of columns in the result set returned by the
@@ -3610,11 +3607,11 @@
3607 ** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
3608 ** statement that does not return data (for example an [UPDATE]).
3609 **
3610 ** See also: [sqlite3_data_count()]
3611 */
3612 SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt);
3613
3614 /*
3615 ** CAPI3REF: Column Names In A Result Set
3616 **
3617 ** ^These routines return the name assigned to a particular column
@@ -3638,12 +3635,12 @@
3635 ** ^The name of a result column is the value of the "AS" clause for
3636 ** that column, if there is an AS clause. If there is no AS clause
3637 ** then the name of the column is unspecified and may change from
3638 ** one release of SQLite to the next.
3639 */
3640 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt*, int N);
3641 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt*, int N);
3642
3643 /*
3644 ** CAPI3REF: Source Of Data In A Query Result
3645 **
3646 ** ^These routines provide a means to determine the database, table, and
@@ -3686,16 +3683,16 @@
3683 ** If two or more threads call one or more
3684 ** [sqlite3_column_database_name | column metadata interfaces]
3685 ** for the same [prepared statement] and result column
3686 ** at the same time then the results are undefined.
3687 */
3688 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int);
3689 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int);
3690 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int);
3691 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int);
3692 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int);
3693 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int);
3694
3695 /*
3696 ** CAPI3REF: Declared Datatype Of A Query Result
3697 **
3698 ** ^(The first parameter is a [prepared statement].
@@ -3722,12 +3719,12 @@
3719 ** data stored in that column is of the declared type. SQLite is
3720 ** strongly typed, but the typing is dynamic not static. ^Type
3721 ** is associated with individual values, not with the containers
3722 ** used to hold those values.
3723 */
3724 SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt*,int);
3725 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt*,int);
3726
3727 /*
3728 ** CAPI3REF: Evaluate An SQL Statement
3729 **
3730 ** After a [prepared statement] has been prepared using either
@@ -3802,11 +3799,11 @@
3799 ** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
3800 ** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,
3801 ** then the more specific [error codes] are returned directly
3802 ** by sqlite3_step(). The use of the "v2" interface is recommended.
3803 */
3804 SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt*);
3805
3806 /*
3807 ** CAPI3REF: Number of columns in a result set
3808 **
3809 ** ^The sqlite3_data_count(P) interface returns the number of columns in the
@@ -3822,11 +3819,11 @@
3819 ** where it always returns zero since each step of that multi-step
3820 ** pragma returns 0 columns of data.
3821 **
3822 ** See also: [sqlite3_column_count()]
3823 */
3824 SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt);
3825
3826 /*
3827 ** CAPI3REF: Fundamental Datatypes
3828 ** KEYWORDS: SQLITE_TEXT
3829 **
@@ -4018,20 +4015,20 @@
4015 ** of these routines, a default value is returned. The default value
4016 ** is either the integer 0, the floating point number 0.0, or a NULL
4017 ** pointer. Subsequent calls to [sqlite3_errcode()] will return
4018 ** [SQLITE_NOMEM].)^
4019 */
4020 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt*, int iCol);
4021 SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt*, int iCol);
4022 SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
4023 SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt*, int iCol);
4024 SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt*, int iCol);
4025 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt*, int iCol);
4026 SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt*, int iCol);
4027 SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt*, int iCol);
4028 SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt*, int iCol);
4029 SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt*, int iCol);
4030
4031 /*
4032 ** CAPI3REF: Destroy A Prepared Statement Object
4033 **
4034 ** ^The sqlite3_finalize() function is called to delete a [prepared statement].
@@ -4054,11 +4051,11 @@
4051 ** resource leaks. It is a grievous error for the application to try to use
4052 ** a prepared statement after it has been finalized. Any use of a prepared
4053 ** statement after it has been finalized can result in undefined and
4054 ** undesirable behavior such as segfaults and heap corruption.
4055 */
4056 SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt);
4057
4058 /*
4059 ** CAPI3REF: Reset A Prepared Statement Object
4060 **
4061 ** The sqlite3_reset() function is called to reset a [prepared statement]
@@ -4080,11 +4077,11 @@
4077 ** [sqlite3_reset(S)] returns an appropriate [error code].
4078 **
4079 ** ^The [sqlite3_reset(S)] interface does not change the values
4080 ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
4081 */
4082 SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt);
4083
4084 /*
4085 ** CAPI3REF: Create Or Redefine SQL Functions
4086 ** KEYWORDS: {function creation routines}
4087 ** KEYWORDS: {application-defined SQL function}
@@ -4179,31 +4176,31 @@
4176 ** ^An application-defined function is permitted to call other
4177 ** SQLite interfaces. However, such calls must not
4178 ** close the database connection nor finalize or reset the prepared
4179 ** statement in which the function is running.
4180 */
4181 SQLITE_API int SQLITE_STDCALL sqlite3_create_function(
4182 sqlite3 *db,
4183 const char *zFunctionName,
4184 int nArg,
4185 int eTextRep,
4186 void *pApp,
4187 void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4188 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4189 void (*xFinal)(sqlite3_context*)
4190 );
4191 SQLITE_API int SQLITE_STDCALL sqlite3_create_function16(
4192 sqlite3 *db,
4193 const void *zFunctionName,
4194 int nArg,
4195 int eTextRep,
4196 void *pApp,
4197 void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
4198 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
4199 void (*xFinal)(sqlite3_context*)
4200 );
4201 SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2(
4202 sqlite3 *db,
4203 const char *zFunctionName,
4204 int nArg,
4205 int eTextRep,
4206 void *pApp,
@@ -4245,16 +4242,16 @@
4242 ** to be supported. However, new applications should avoid
4243 ** the use of these functions. To encourage programmers to avoid
4244 ** these functions, we will not explain what they do.
4245 */
4246 #ifndef SQLITE_OMIT_DEPRECATED
4247 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context*);
4248 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt*);
4249 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
4250 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_global_recover(void);
4251 SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_thread_cleanup(void);
4252 SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
4253 void*,sqlite3_int64);
4254 #endif
4255
4256 /*
4257 ** CAPI3REF: Obtaining SQL Function Parameter Values
@@ -4299,22 +4296,22 @@
4296 ** or [sqlite3_value_text16()].
4297 **
4298 ** These routines must be called from the same thread as
4299 ** the SQL function that supplied the [sqlite3_value*] parameters.
4300 */
4301 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value*);
4302 SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value*);
4303 SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value*);
4304 SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value*);
4305 SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value*);
4306 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value*);
4307 SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value*);
4308 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value*);
4309 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value*);
4310 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*);
4311 SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*);
4312 SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*);
4313
4314 /*
4315 ** CAPI3REF: Obtain Aggregate Function Context
4316 **
4317 ** Implementations of aggregate SQL functions use this
@@ -4354,11 +4351,11 @@
4351 ** function.
4352 **
4353 ** This routine must be called from the same thread in which
4354 ** the aggregate SQL function is running.
4355 */
4356 SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context*, int nBytes);
4357
4358 /*
4359 ** CAPI3REF: User Data For Functions
4360 **
4361 ** ^The sqlite3_user_data() interface returns a copy of
@@ -4368,11 +4365,11 @@
4365 ** registered the application defined function.
4366 **
4367 ** This routine must be called from the same thread in which
4368 ** the application-defined function is running.
4369 */
4370 SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context*);
4371
4372 /*
4373 ** CAPI3REF: Database Connection For Functions
4374 **
4375 ** ^The sqlite3_context_db_handle() interface returns a copy of
@@ -4379,11 +4376,11 @@
4376 ** the pointer to the [database connection] (the 1st parameter)
4377 ** of the [sqlite3_create_function()]
4378 ** and [sqlite3_create_function16()] routines that originally
4379 ** registered the application defined function.
4380 */
4381 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context*);
4382
4383 /*
4384 ** CAPI3REF: Function Auxiliary Data
4385 **
4386 ** These functions may be used by (non-aggregate) SQL functions to
@@ -4431,12 +4428,12 @@
4428 ** values and [parameters] and expressions composed from the same.)^
4429 **
4430 ** These routines must be called from the same thread in which
4431 ** the SQL function is running.
4432 */
4433 SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context*, int N);
4434 SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
4435
4436
4437 /*
4438 ** CAPI3REF: Constants Defining Special Destructor Behavior
4439 **
@@ -4567,30 +4564,30 @@
4564 **
4565 ** If these routines are called from within the different thread
4566 ** than the one containing the application-defined function that received
4567 ** the [sqlite3_context] pointer, the results are undefined.
4568 */
4569 SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
4570 SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(sqlite3_context*,const void*,
4571 sqlite3_uint64,void(*)(void*));
4572 SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context*, double);
4573 SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context*, const char*, int);
4574 SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context*, const void*, int);
4575 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context*);
4576 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context*);
4577 SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context*, int);
4578 SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context*, int);
4579 SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
4580 SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context*);
4581 SQLITE_API void SQLITE_STDCALL sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
4582 SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
4583 void(*)(void*), unsigned char encoding);
4584 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
4585 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
4586 SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
4587 SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
4588 SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n);
4589
4590 /*
4591 ** CAPI3REF: Define New Collating Sequences
4592 **
4593 ** ^These functions add, remove, or modify a [collation] associated
@@ -4667,26 +4664,26 @@
4664 ** is unfortunate but cannot be changed without breaking backwards
4665 ** compatibility.
4666 **
4667 ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].
4668 */
4669 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
4670 sqlite3*,
4671 const char *zName,
4672 int eTextRep,
4673 void *pArg,
4674 int(*xCompare)(void*,int,const void*,int,const void*)
4675 );
4676 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2(
4677 sqlite3*,
4678 const char *zName,
4679 int eTextRep,
4680 void *pArg,
4681 int(*xCompare)(void*,int,const void*,int,const void*),
4682 void(*xDestroy)(void*)
4683 );
4684 SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16(
4685 sqlite3*,
4686 const void *zName,
4687 int eTextRep,
4688 void *pArg,
4689 int(*xCompare)(void*,int,const void*,int,const void*)
@@ -4716,16 +4713,16 @@
4713 **
4714 ** The callback function should register the desired collation using
4715 ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or
4716 ** [sqlite3_create_collation_v2()].
4717 */
4718 SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed(
4719 sqlite3*,
4720 void*,
4721 void(*)(void*,sqlite3*,int eTextRep,const char*)
4722 );
4723 SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16(
4724 sqlite3*,
4725 void*,
4726 void(*)(void*,sqlite3*,int eTextRep,const void*)
4727 );
4728
@@ -4735,15 +4732,15 @@
4732 ** called right after sqlite3_open().
4733 **
4734 ** The code to implement this API is not available in the public release
4735 ** of SQLite.
4736 */
4737 SQLITE_API int SQLITE_STDCALL sqlite3_key(
4738 sqlite3 *db, /* Database to be rekeyed */
4739 const void *pKey, int nKey /* The key */
4740 );
4741 SQLITE_API int SQLITE_STDCALL sqlite3_key_v2(
4742 sqlite3 *db, /* Database to be rekeyed */
4743 const char *zDbName, /* Name of the database */
4744 const void *pKey, int nKey /* The key */
4745 );
4746
@@ -4753,35 +4750,35 @@
4750 ** database is decrypted.
4751 **
4752 ** The code to implement this API is not available in the public release
4753 ** of SQLite.
4754 */
4755 SQLITE_API int SQLITE_STDCALL sqlite3_rekey(
4756 sqlite3 *db, /* Database to be rekeyed */
4757 const void *pKey, int nKey /* The new key */
4758 );
4759 SQLITE_API int SQLITE_STDCALL sqlite3_rekey_v2(
4760 sqlite3 *db, /* Database to be rekeyed */
4761 const char *zDbName, /* Name of the database */
4762 const void *pKey, int nKey /* The new key */
4763 );
4764
4765 /*
4766 ** Specify the activation key for a SEE database. Unless
4767 ** activated, none of the SEE routines will work.
4768 */
4769 SQLITE_API void SQLITE_STDCALL sqlite3_activate_see(
4770 const char *zPassPhrase /* Activation phrase */
4771 );
4772 #endif
4773
4774 #ifdef SQLITE_ENABLE_CEROD
4775 /*
4776 ** Specify the activation key for a CEROD database. Unless
4777 ** activated, none of the CEROD routines will work.
4778 */
4779 SQLITE_API void SQLITE_STDCALL sqlite3_activate_cerod(
4780 const char *zPassPhrase /* Activation phrase */
4781 );
4782 #endif
4783
4784 /*
@@ -4799,11 +4796,11 @@
4796 ** method of the default [sqlite3_vfs] object. If the xSleep() method
4797 ** of the default VFS is not implemented correctly, or not implemented at
4798 ** all, then the behavior of sqlite3_sleep() may deviate from the description
4799 ** in the previous paragraphs.
4800 */
4801 SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int);
4802
4803 /*
4804 ** CAPI3REF: Name Of The Folder Holding Temporary Files
4805 **
4806 ** ^(If this global variable is made to point to a string which is
@@ -4917,11 +4914,11 @@
4914 **
4915 ** If another thread changes the autocommit status of the database
4916 ** connection while this routine is running, then the return value
4917 ** is undefined.
4918 */
4919 SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3*);
4920
4921 /*
4922 ** CAPI3REF: Find The Database Handle Of A Prepared Statement
4923 **
4924 ** ^The sqlite3_db_handle interface returns the [database connection] handle
@@ -4929,11 +4926,11 @@
4926 ** returned by sqlite3_db_handle is the same [database connection]
4927 ** that was the first argument
4928 ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
4929 ** create the statement in the first place.
4930 */
4931 SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt*);
4932
4933 /*
4934 ** CAPI3REF: Return The Filename For A Database Connection
4935 **
4936 ** ^The sqlite3_db_filename(D,N) interface returns a pointer to a filename
@@ -4945,20 +4942,20 @@
4942 ** ^The filename returned by this function is the output of the
4943 ** xFullPathname method of the [VFS]. ^In other words, the filename
4944 ** will be an absolute pathname, even if the filename used
4945 ** to open the database originally was a URI or relative pathname.
4946 */
4947 SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName);
4948
4949 /*
4950 ** CAPI3REF: Determine if a database is read-only
4951 **
4952 ** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N
4953 ** of connection D is read-only, 0 if it is read/write, or -1 if N is not
4954 ** the name of a database on connection D.
4955 */
4956 SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
4957
4958 /*
4959 ** CAPI3REF: Find the next prepared statement
4960 **
4961 ** ^This interface returns a pointer to the next [prepared statement] after
@@ -4969,11 +4966,11 @@
4966 **
4967 ** The [database connection] pointer D in a call to
4968 ** [sqlite3_next_stmt(D,S)] must refer to an open database
4969 ** connection and in particular must not be a NULL pointer.
4970 */
4971 SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
4972
4973 /*
4974 ** CAPI3REF: Commit And Rollback Notification Callbacks
4975 **
4976 ** ^The sqlite3_commit_hook() interface registers a callback
@@ -5017,12 +5014,12 @@
5014 ** ^The rollback callback is not invoked if a transaction is
5015 ** automatically rolled back because the database connection is closed.
5016 **
5017 ** See also the [sqlite3_update_hook()] interface.
5018 */
5019 SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
5020 SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
5021
5022 /*
5023 ** CAPI3REF: Data Change Notification Callbacks
5024 **
5025 ** ^The sqlite3_update_hook() interface registers a callback function
@@ -5068,11 +5065,11 @@
5065 ** the first call on D.
5066 **
5067 ** See also the [sqlite3_commit_hook()] and [sqlite3_rollback_hook()]
5068 ** interfaces.
5069 */
5070 SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
5071 sqlite3*,
5072 void(*)(void *,int ,char const *,char const *,sqlite3_int64),
5073 void*
5074 );
5075
@@ -5108,11 +5105,11 @@
5105 ** This interface is threadsafe on processors where writing a
5106 ** 32-bit integer is atomic.
5107 **
5108 ** See Also: [SQLite Shared-Cache Mode]
5109 */
5110 SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int);
5111
5112 /*
5113 ** CAPI3REF: Attempt To Free Heap Memory
5114 **
5115 ** ^The sqlite3_release_memory() interface attempts to free N bytes
@@ -5124,11 +5121,11 @@
5121 ** ^The sqlite3_release_memory() routine is a no-op returning zero
5122 ** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5123 **
5124 ** See also: [sqlite3_db_release_memory()]
5125 */
5126 SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int);
5127
5128 /*
5129 ** CAPI3REF: Free Memory Used By A Database Connection
5130 **
5131 ** ^The sqlite3_db_release_memory(D) interface attempts to free as much heap
@@ -5137,11 +5134,11 @@
5134 ** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
5135 ** omitted.
5136 **
5137 ** See also: [sqlite3_release_memory()]
5138 */
5139 SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3*);
5140
5141 /*
5142 ** CAPI3REF: Impose A Limit On Heap Size
5143 **
5144 ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the
@@ -5189,11 +5186,11 @@
5186 ** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5187 **
5188 ** The circumstances under which SQLite will enforce the soft heap limit may
5189 ** changes in future releases of SQLite.
5190 */
5191 SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 N);
5192
5193 /*
5194 ** CAPI3REF: Deprecated Soft Heap Limit Interface
5195 ** DEPRECATED
5196 **
@@ -5200,11 +5197,11 @@
5197 ** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
5198 ** interface. This routine is provided for historical compatibility
5199 ** only. All new applications should use the
5200 ** [sqlite3_soft_heap_limit64()] interface rather than this one.
5201 */
5202 SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_soft_heap_limit(int N);
5203
5204
5205 /*
5206 ** CAPI3REF: Extract Metadata About A Column Of A Table
5207 **
@@ -5269,11 +5266,11 @@
5266 **
5267 ** ^This function causes all database schemas to be read from disk and
5268 ** parsed, if that has not already been done, and returns an error if
5269 ** any errors are encountered while loading the schema.
5270 */
5271 SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata(
5272 sqlite3 *db, /* Connection handle */
5273 const char *zDbName, /* Database name or NULL */
5274 const char *zTableName, /* Table name */
5275 const char *zColumnName, /* Column name */
5276 char const **pzDataType, /* OUTPUT: Declared data type */
@@ -5315,11 +5312,11 @@
5312 ** [sqlite3_enable_load_extension()] prior to calling this API,
5313 ** otherwise an error will be returned.
5314 **
5315 ** See also the [load_extension() SQL function].
5316 */
5317 SQLITE_API int SQLITE_STDCALL sqlite3_load_extension(
5318 sqlite3 *db, /* Load the extension into this database connection */
5319 const char *zFile, /* Name of the shared library containing extension */
5320 const char *zProc, /* Entry point. Derived from zFile if 0 */
5321 char **pzErrMsg /* Put error message here if not 0 */
5322 );
@@ -5335,11 +5332,11 @@
5332 ** ^Extension loading is off by default.
5333 ** ^Call the sqlite3_enable_load_extension() routine with onoff==1
5334 ** to turn extension loading on and call it with onoff==0 to turn
5335 ** it back off again.
5336 */
5337 SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff);
5338
5339 /*
5340 ** CAPI3REF: Automatically Load Statically Linked Extensions
5341 **
5342 ** ^This interface causes the xEntryPoint() function to be invoked for
@@ -5373,11 +5370,11 @@
5370 ** will be called more than once for each database connection that is opened.
5371 **
5372 ** See also: [sqlite3_reset_auto_extension()]
5373 ** and [sqlite3_cancel_auto_extension()]
5374 */
5375 SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void (*xEntryPoint)(void));
5376
5377 /*
5378 ** CAPI3REF: Cancel Automatic Extension Loading
5379 **
5380 ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
@@ -5385,19 +5382,19 @@
5382 ** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)]
5383 ** routine returns 1 if initialization routine X was successfully
5384 ** unregistered and it returns 0 if X was not on the list of initialization
5385 ** routines.
5386 */
5387 SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void (*xEntryPoint)(void));
5388
5389 /*
5390 ** CAPI3REF: Reset Automatic Extension Loading
5391 **
5392 ** ^This interface disables all automatic extensions previously
5393 ** registered using [sqlite3_auto_extension()].
5394 */
5395 SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void);
5396
5397 /*
5398 ** The interface to the virtual-table mechanism is currently considered
5399 ** to be experimental. The interface might change in incompatible ways.
5400 ** If this is a problem for you, do not use the interface at this time.
@@ -5596,17 +5593,17 @@
5593 ** be invoked if the call to sqlite3_create_module_v2() fails.
5594 ** ^The sqlite3_create_module()
5595 ** interface is equivalent to sqlite3_create_module_v2() with a NULL
5596 ** destructor.
5597 */
5598 SQLITE_API int SQLITE_STDCALL sqlite3_create_module(
5599 sqlite3 *db, /* SQLite connection to register module with */
5600 const char *zName, /* Name of the module */
5601 const sqlite3_module *p, /* Methods for the module */
5602 void *pClientData /* Client data for xCreate/xConnect */
5603 );
5604 SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2(
5605 sqlite3 *db, /* SQLite connection to register module with */
5606 const char *zName, /* Name of the module */
5607 const sqlite3_module *p, /* Methods for the module */
5608 void *pClientData, /* Client data for xCreate/xConnect */
5609 void(*xDestroy)(void*) /* Module destructor function */
@@ -5665,11 +5662,11 @@
5662 ** ^The [xCreate] and [xConnect] methods of a
5663 ** [virtual table module] call this interface
5664 ** to declare the format (the names and datatypes of the columns) of
5665 ** the virtual tables they implement.
5666 */
5667 SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3*, const char *zSQL);
5668
5669 /*
5670 ** CAPI3REF: Overload A Function For A Virtual Table
5671 **
5672 ** ^(Virtual tables can provide alternative implementations of functions
@@ -5683,11 +5680,11 @@
5680 ** of the new function always causes an exception to be thrown. So
5681 ** the new function is not good for anything by itself. Its only
5682 ** purpose is to be a placeholder function that can be overloaded
5683 ** by a [virtual table].
5684 */
5685 SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
5686
5687 /*
5688 ** The interface to the virtual-table mechanism defined above (back up
5689 ** to a comment remarkably similar to this one) is currently considered
5690 ** to be experimental. The interface might change in incompatible ways.
@@ -5780,11 +5777,11 @@
5777 ** zero-filled blob to read or write using the incremental-blob interface.
5778 **
5779 ** To avoid a resource leak, every open [BLOB handle] should eventually
5780 ** be released by a call to [sqlite3_blob_close()].
5781 */
5782 SQLITE_API int SQLITE_STDCALL sqlite3_blob_open(
5783 sqlite3*,
5784 const char *zDb,
5785 const char *zTable,
5786 const char *zColumn,
5787 sqlite3_int64 iRow,
@@ -5812,11 +5809,11 @@
5809 ** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
5810 ** always returns zero.
5811 **
5812 ** ^This function sets the database handle error code and message.
5813 */
5814 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
5815
5816 /*
5817 ** CAPI3REF: Close A BLOB Handle
5818 **
5819 ** ^This function closes an open [BLOB handle]. ^(The BLOB handle is closed
@@ -5834,11 +5831,11 @@
5831 ** with a null pointer (such as would be returned by a failed call to
5832 ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function
5833 ** is passed a valid open blob handle, the values returned by the
5834 ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning.
5835 */
5836 SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *);
5837
5838 /*
5839 ** CAPI3REF: Return The Size Of An Open BLOB
5840 **
5841 ** ^Returns the size in bytes of the BLOB accessible via the
@@ -5849,11 +5846,11 @@
5846 ** This routine only works on a [BLOB handle] which has been created
5847 ** by a prior successful call to [sqlite3_blob_open()] and which has not
5848 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
5849 ** to this routine results in undefined and probably undesirable behavior.
5850 */
5851 SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *);
5852
5853 /*
5854 ** CAPI3REF: Read Data From A BLOB Incrementally
5855 **
5856 ** ^(This function is used to read data from an open [BLOB handle] into a
@@ -5877,11 +5874,11 @@
5874 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
5875 ** to this routine results in undefined and probably undesirable behavior.
5876 **
5877 ** See also: [sqlite3_blob_write()].
5878 */
5879 SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
5880
5881 /*
5882 ** CAPI3REF: Write Data Into A BLOB Incrementally
5883 **
5884 ** ^(This function is used to write data into an open [BLOB handle] from a
@@ -5918,11 +5915,11 @@
5915 ** been closed by [sqlite3_blob_close()]. Passing any other pointer in
5916 ** to this routine results in undefined and probably undesirable behavior.
5917 **
5918 ** See also: [sqlite3_blob_read()].
5919 */
5920 SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
5921
5922 /*
5923 ** CAPI3REF: Virtual File System Objects
5924 **
5925 ** A virtual filesystem (VFS) is an [sqlite3_vfs] object
@@ -5949,13 +5946,13 @@
5946 **
5947 ** ^Unregister a VFS with the sqlite3_vfs_unregister() interface.
5948 ** ^(If the default VFS is unregistered, another VFS is chosen as
5949 ** the default. The choice for the new VFS is arbitrary.)^
5950 */
5951 SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfsName);
5952 SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
5953 SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs*);
5954
5955 /*
5956 ** CAPI3REF: Mutexes
5957 **
5958 ** The SQLite core uses these routines for thread
@@ -6064,15 +6061,15 @@
6061 ** sqlite3_mutex_leave() is a NULL pointer, then all three routines
6062 ** behave as no-ops.
6063 **
6064 ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
6065 */
6066 SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int);
6067 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*);
6068 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*);
6069 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*);
6070 SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*);
6071
6072 /*
6073 ** CAPI3REF: Mutex Methods Object
6074 **
6075 ** An instance of this structure defines the low-level routines
@@ -6178,12 +6175,12 @@
6175 ** call to sqlite3_mutex_held() to fail, so a non-zero return is
6176 ** the appropriate thing to do. The sqlite3_mutex_notheld()
6177 ** interface should also return 1 when given a NULL pointer.
6178 */
6179 #ifndef NDEBUG
6180 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex*);
6181 SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex*);
6182 #endif
6183
6184 /*
6185 ** CAPI3REF: Mutex Types
6186 **
@@ -6215,11 +6212,11 @@
6212 ** serializes access to the [database connection] given in the argument
6213 ** when the [threading mode] is Serialized.
6214 ** ^If the [threading mode] is Single-thread or Multi-thread then this
6215 ** routine returns a NULL pointer.
6216 */
6217 SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3*);
6218
6219 /*
6220 ** CAPI3REF: Low-Level Control Of Database Files
6221 **
6222 ** ^The [sqlite3_file_control()] interface makes a direct call to the
@@ -6249,11 +6246,11 @@
6246 ** an incorrect zDbName and an SQLITE_ERROR return from the underlying
6247 ** xFileControl method.
6248 **
6249 ** See also: [SQLITE_FCNTL_LOCKSTATE]
6250 */
6251 SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
6252
6253 /*
6254 ** CAPI3REF: Testing Interface
6255 **
6256 ** ^The sqlite3_test_control() interface is used to read out internal
@@ -6268,11 +6265,11 @@
6265 ** The details of the operation codes, their meanings, the parameters
6266 ** they take, and what they do are all subject to change without notice.
6267 ** Unlike most of the SQLite API, this function is not guaranteed to
6268 ** operate consistently from one release to the next.
6269 */
6270 SQLITE_API int SQLITE_CDECL sqlite3_test_control(int op, ...);
6271
6272 /*
6273 ** CAPI3REF: Testing Interface Operation Codes
6274 **
6275 ** These constants are the valid operation code parameters used
@@ -6331,12 +6328,12 @@
6328 ** be represented by a 32-bit integer, then the values returned by
6329 ** sqlite3_status() are undefined.
6330 **
6331 ** See also: [sqlite3_db_status()]
6332 */
6333 SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
6334 SQLITE_API int SQLITE_STDCALL sqlite3_status64(
6335 int op,
6336 sqlite3_int64 *pCurrent,
6337 sqlite3_int64 *pHighwater,
6338 int resetFlag
6339 );
@@ -6455,11 +6452,11 @@
6452 ** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a
6453 ** non-zero [error code] on failure.
6454 **
6455 ** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
6456 */
6457 SQLITE_API int SQLITE_STDCALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
6458
6459 /*
6460 ** CAPI3REF: Status Parameters for database connections
6461 ** KEYWORDS: {SQLITE_DBSTATUS options}
6462 **
@@ -6584,11 +6581,11 @@
6581 ** ^If the resetFlg is true, then the counter is reset to zero after this
6582 ** interface call returns.
6583 **
6584 ** See also: [sqlite3_status()] and [sqlite3_db_status()].
6585 */
6586 SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
6587
6588 /*
6589 ** CAPI3REF: Status Parameters for prepared statements
6590 ** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters}
6591 **
@@ -7053,20 +7050,20 @@
7050 ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()
7051 ** APIs are not strictly speaking threadsafe. If they are invoked at the
7052 ** same time as another thread is invoking sqlite3_backup_step() it is
7053 ** possible that they return invalid values.
7054 */
7055 SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init(
7056 sqlite3 *pDest, /* Destination database handle */
7057 const char *zDestName, /* Destination database name */
7058 sqlite3 *pSource, /* Source database handle */
7059 const char *zSourceName /* Source database name */
7060 );
7061 SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage);
7062 SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p);
7063 SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p);
7064 SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p);
7065
7066 /*
7067 ** CAPI3REF: Unlock Notification
7068 **
7069 ** ^When running in shared-cache mode, a database operation may fail with
@@ -7178,11 +7175,11 @@
7175 ** by an sqlite3_step() call. ^(If there is a blocking connection, then the
7176 ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in
7177 ** the special "DROP TABLE/INDEX" case, the extended error code is just
7178 ** SQLITE_LOCKED.)^
7179 */
7180 SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify(
7181 sqlite3 *pBlocked, /* Waiting connection */
7182 void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */
7183 void *pNotifyArg /* Argument to pass to xNotify */
7184 );
7185
@@ -7193,12 +7190,12 @@
7190 ** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications
7191 ** and extensions to compare the contents of two buffers containing UTF-8
7192 ** strings in a case-independent fashion, using the same definition of "case
7193 ** independence" that SQLite uses internally when comparing identifiers.
7194 */
7195 SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *, const char *);
7196 SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *, const char *, int);
7197
7198 /*
7199 ** CAPI3REF: String Globbing
7200 *
7201 ** ^The [sqlite3_strglob(P,X)] interface returns zero if string X matches
@@ -7209,11 +7206,11 @@
7206 ** sensitive.
7207 **
7208 ** Note that this routine returns zero on a match and non-zero if the strings
7209 ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
7210 */
7211 SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlob, const char *zStr);
7212
7213 /*
7214 ** CAPI3REF: Error Logging Interface
7215 **
7216 ** ^The [sqlite3_log()] interface writes a message into the [error log]
@@ -7232,11 +7229,11 @@
7229 ** will not use dynamically allocated memory. The log message is stored in
7230 ** a fixed-length buffer on the stack. If the log message is longer than
7231 ** a few hundred characters, it will be truncated to the length of the
7232 ** buffer.
7233 */
7234 SQLITE_API void SQLITE_CDECL sqlite3_log(int iErrCode, const char *zFormat, ...);
7235
7236 /*
7237 ** CAPI3REF: Write-Ahead Log Commit Hook
7238 **
7239 ** ^The [sqlite3_wal_hook()] function is used to register a callback that
@@ -7267,11 +7264,11 @@
7264 ** previously registered write-ahead log callback. ^Note that the
7265 ** [sqlite3_wal_autocheckpoint()] interface and the
7266 ** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will
7267 ** those overwrite any prior [sqlite3_wal_hook()] settings.
7268 */
7269 SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
7270 sqlite3*,
7271 int(*)(void *,sqlite3*,const char*,int),
7272 void*
7273 );
7274
@@ -7301,11 +7298,11 @@
7298 ** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]
7299 ** pages. The use of this interface
7300 ** is only necessary if the default setting is found to be suboptimal
7301 ** for a particular application.
7302 */
7303 SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
7304
7305 /*
7306 ** CAPI3REF: Checkpoint a database
7307 **
7308 ** ^(The sqlite3_wal_checkpoint(D,X) is equivalent to
@@ -7322,11 +7319,11 @@
7319 ** interface was added. This interface is retained for backwards
7320 ** compatibility and as a convenience for applications that need to manually
7321 ** start a callback but which do not need the full power (and corresponding
7322 ** complication) of [sqlite3_wal_checkpoint_v2()].
7323 */
7324 SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
7325
7326 /*
7327 ** CAPI3REF: Checkpoint a database
7328 **
7329 ** ^(The sqlite3_wal_checkpoint_v2(D,X,M,L,C) interface runs a checkpoint
@@ -7415,11 +7412,11 @@
7412 ** [sqlite3_errcode()] and [sqlite3_errmsg()].
7413 **
7414 ** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface
7415 ** from SQL.
7416 */
7417 SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2(
7418 sqlite3 *db, /* Database handle */
7419 const char *zDb, /* Name of attached database (or NULL) */
7420 int eMode, /* SQLITE_CHECKPOINT_* value */
7421 int *pnLog, /* OUT: Size of WAL log in frames */
7422 int *pnCkpt /* OUT: Total number of frames checkpointed */
@@ -7451,11 +7448,11 @@
7448 **
7449 ** At present, there is only one option that may be configured using
7450 ** this function. (See [SQLITE_VTAB_CONSTRAINT_SUPPORT].) Further options
7451 ** may be added in the future.
7452 */
7453 SQLITE_API int SQLITE_CDECL sqlite3_vtab_config(sqlite3*, int op, ...);
7454
7455 /*
7456 ** CAPI3REF: Virtual Table Configuration Options
7457 **
7458 ** These macros define the various options to the
@@ -7504,11 +7501,11 @@
7501 ** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL],
7502 ** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode
7503 ** of the SQL statement that triggered the call to the [xUpdate] method of the
7504 ** [virtual table].
7505 */
7506 SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *);
7507
7508 /*
7509 ** CAPI3REF: Conflict resolution modes
7510 ** KEYWORDS: {conflict resolution mode}
7511 **
@@ -7608,11 +7605,11 @@
7605 ** as if the loop did not exist - it returns non-zero and leave the variable
7606 ** that pOut points to unchanged.
7607 **
7608 ** See also: [sqlite3_stmt_scanstatus_reset()]
7609 */
7610 SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_stmt_scanstatus(
7611 sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
7612 int idx, /* Index of loop to report on */
7613 int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
7614 void *pOut /* Result written here */
7615 );
@@ -7623,11 +7620,11 @@
7620 ** ^Zero all [sqlite3_stmt_scanstatus()] related event counters.
7621 **
7622 ** This API is only available if the library is built with pre-processor
7623 ** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined.
7624 */
7625 SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
7626
7627
7628 /*
7629 ** Undo the hack that converts floating point types to integer for
7630 ** builds on processors without floating point support.
@@ -7678,11 +7675,11 @@
7675 ** Register a geometry callback named zGeom that can be used as part of an
7676 ** R-Tree geometry query as follows:
7677 **
7678 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
7679 */
7680 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback(
7681 sqlite3 *db,
7682 const char *zGeom,
7683 int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
7684 void *pContext
7685 );
@@ -7704,11 +7701,11 @@
7701 ** Register a 2nd-generation geometry callback named zScore that can be
7702 ** used as part of an R-Tree geometry query as follows:
7703 **
7704 ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...)
7705 */
7706 SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback(
7707 sqlite3 *db,
7708 const char *zQueryFunc,
7709 int (*xQueryFunc)(sqlite3_rtree_query_info*),
7710 void *pContext,
7711 void (*xDestructor)(void*)
7712

Keyboard Shortcuts

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